http://llvm.org/bugs/show_bug.cgi?id=10259

           Summary: Fake ambiguity between scoped redeclaration of class
                    found via inline anonymous namespace
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


// scoped declaration fails (correctly: [namespace.qual]p7) if namespace isn't
inline
// works if namespace isn't anonymous
inline namespace {
  class A;
}

// if not scoped, ambiguity is real, no bug
class ::A {};
A a;


daysthatwere:trunk glamr$ clang -std=c++0x /tmp/red3.cpp 
/tmp/red3.cpp:5:1: error: reference to 'A' is ambiguous
A a;
^
/tmp/red3.cpp:4:9: note: candidate found by name lookup is 'A'
class ::A {};
        ^
/tmp/red3.cpp:2:9: note: candidate found by name lookup is '<anonymous
namespace>::A'
  class A;
        ^
/tmp/red3.cpp:5:3: error: variable has incomplete type '<anonymous>::A'
A a;
  ^
/tmp/red3.cpp:2:9: note: forward declaration of '<anonymous>::A'
  class A;
        ^
2 errors generated.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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

Reply via email to