https://llvm.org/bugs/show_bug.cgi?id=24264
Anders Granlund <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|INVALID |--- --- Comment #2 from Anders Granlund <[email protected]> --- Yes, but by [namespace.udir]/2 during the unqualified name lookup of x in sizeof (x), the declaration struct x {}; appears as if it was declared in the declarative region of the global namespace, so the name lookup will appear to be affected by the type of name hiding described in [basic.scope.hiding]/2. Just like the way name lookup of i in the example below appears to be affected by normal name hiding. When performing unqualified name lookup of i in f the definition static int i = 2; appears to be made in the declarative region of T, and therefore appears to hide i in the definition static int i = 1; That is why we get the result 2 printed out in the example below: #include <iostream> static int i = 1; namespace T { namespace N { static int i = 2; } namespace M { using namespace N; void f() { std::cout << i << std::endl; } } } int main() { T::M::f(); } I still think the program in the bug report is well-formed because of this. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ LLVMbugs mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs
