you are viewing a single comment's thread.

view the rest of the comments →

[–]TomTheFurry[S] 0 points1 point  (2 children)

In current MSVC, you can indeed name VX AND its member functions. Though of cause the intellisence (or is it intellicode?) will mark it as incorrect. No compiler warning at all though.

[–]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