[LLVMbugs] [Bug 20373] New: Poor first diagnostic on ambiguous namespace reference

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jul 20 15:03:37 PDT 2014


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: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140720/d2f1c2b0/attachment.html>


More information about the llvm-bugs mailing list