[cfe-commits] r67932 - in /cfe/trunk: lib/Sema/SemaDeclCXX.cpp test/SemaCXX/namespace-alias.cpp
Anders Carlsson
andersca at mac.com
Sat Mar 28 00:51:31 PDT 2009
Author: andersca
Date: Sat Mar 28 02:51:31 2009
New Revision: 67932
URL: http://llvm.org/viewvc/llvm-project?rev=67932&view=rev
Log:
As Eli pointed out, it is possible that a namespace lookup is ambiguous!
Modified:
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
cfe/trunk/test/SemaCXX/namespace-alias.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=67932&r1=67931&r2=67932&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Sat Mar 28 02:51:31 2009
@@ -1627,7 +1627,6 @@
// Lookup namespace name.
LookupResult R = LookupParsedName(S, &SS, NamespcName,
LookupNamespaceName, false);
- // FIXME: Can the result of a namespace lookup ever be ambiguous?
if (R.isAmbiguous()) {
DiagnoseAmbiguousLookup(R, NamespcName, IdentLoc);
return 0;
@@ -1697,7 +1696,6 @@
// Lookup the namespace name.
LookupResult R = LookupParsedName(S, &SS, NamespaceName,
LookupNamespaceName, false);
- // FIXME: Can the result of a namespace lookup ever be ambiguous?
if (R.isAmbiguous()) {
DiagnoseAmbiguousLookup(R, NamespaceName, NamespaceLoc);
return 0;
Modified: cfe/trunk/test/SemaCXX/namespace-alias.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/namespace-alias.cpp?rev=67932&r1=67931&r2=67932&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/namespace-alias.cpp (original)
+++ cfe/trunk/test/SemaCXX/namespace-alias.cpp Sat Mar 28 02:51:31 2009
@@ -14,3 +14,10 @@
namespace D = i; // expected-error {{expected namespace name}}
namespace E = N::Foo; // expected-error {{expected namespace name}}
+
+namespace F {
+ namespace A { namespace B { } } // expected-note {{candidate found by name lookup is 'F::A::B'}}
+ namespace B { } // expected-note {{candidate found by name lookup is 'F::B'}}
+ using namespace A;
+ namespace D = B; // expected-error {{reference to 'B' is ambiguous}}
+}
More information about the cfe-commits
mailing list