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

            Bug ID: 20373
           Summary: Poor first diagnostic on ambiguous namespace reference
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

Nicos-MacBook-Pro:src thakis$ cat test.cc
namespace Foo { class Bar {}; }

namespace A = Foo;
namespace { namespace A = Foo; }

void f() {
  A::Bar b;
}
Nicos-MacBook-Pro:src thakis$ ~/src/llvm-build/bin/clang -c test.cc
test.cc:7:3: error: 'A' is not a class, namespace, or scoped enumeration
  A::Bar b;
  ^
test.cc:7:3: error: reference to 'A' is ambiguous
  A::Bar b;
  ^
test.cc:3:11: note: candidate found by name lookup is 'A'
namespace A = Foo;
          ^
test.cc:4:23: note: candidate found by name lookup is '(anonymous
namespace)::A'
namespace { namespace A = Foo; }
                      ^
2 errors generated.


The second error is great, but the first shouldn't be there. We had this bug
somewhere and were building with -ferror-limit=1 for some reason, and due to
that first diagnostic it took me longer to understand what's going on than it
should have.

-- 
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