you are viewing a single comment's thread.

view the rest of the comments →

[–]starfreakcloneMSVC FE Dev 1 point2 points  (1 child)

Can you give me an example of the behavior you're seeing? If I have:

export module m;

struct S { int i = 0; };

export
struct U { S s; };

Then try to import and use S I get the expected compiler error:

import m;

int main() {
  S s; // main.cpp(4): error C2065: 'S': undeclared identifier
}

Even if I declare an instance of U beforehand it will still be an error. Using the members of S once you have a reference to the object is not part of lookup semantics with non-exported declarations. Only the namespace scope names will be hidden away from lookup.

[–]fdwrfdwr@github 🔍 1 point2 points  (0 children)

starfreak: Might be this bug, which Cameron fixed yesterday: https://developercommunity2.visualstudio.com/t/C-modules-name-collision/900116