[cfe-commits] r154138 - in /cfe/trunk: lib/Sema/SemaDeclCXX.cpp test/SemaCXX/namespace-alias.cpp
Richard Smith
richard-llvm at metafoo.co.uk
Thu Apr 5 16:13:23 PDT 2012
Author: rsmith
Date: Thu Apr 5 18:13:23 2012
New Revision: 154138
URL: http://llvm.org/viewvc/llvm-project?rev=154138&view=rev
Log:
Point the caret at the error for the 'expected namespace name' diagnostic in
a namespace alias declaration.
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=154138&r1=154137&r2=154138&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu Apr 5 18:13:23 2012
@@ -6742,7 +6742,7 @@
if (R.empty()) {
if (!TryNamespaceTypoCorrection(*this, R, S, SS, IdentLoc, Ident)) {
- Diag(NamespaceLoc, diag::err_expected_namespace_name) << SS.getRange();
+ Diag(IdentLoc, diag::err_expected_namespace_name) << SS.getRange();
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=154138&r1=154137&r2=154138&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/namespace-alias.cpp (original)
+++ cfe/trunk/test/SemaCXX/namespace-alias.cpp Thu Apr 5 18:13:23 2012
@@ -11,9 +11,13 @@
namespace C = N; // expected-error {{redefinition of 'C'}}
int i;
-namespace D = i; // expected-error {{expected namespace name}}
+namespace D =
+i; // expected-error {{expected namespace name}}
-namespace E = N::Foo; // expected-error {{expected namespace name}}
+namespace E1 = N::
+Foo; // expected-error {{expected namespace name}}
+namespace E2 = N::
+X; // expected-error {{expected namespace name}}
namespace F {
namespace A { namespace B { } } // expected-note {{candidate found by name lookup is 'F::A::B'}}
More information about the cfe-commits
mailing list