]> granicus.if.org Git - clang/commitdiff
Point the caret at the error for the 'expected namespace name' diagnostic in
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 5 Apr 2012 23:13:23 +0000 (23:13 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 5 Apr 2012 23:13:23 +0000 (23:13 +0000)
a namespace alias declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154138 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclCXX.cpp
test/SemaCXX/namespace-alias.cpp

index e5dc4f5ac93e9e645dcb174e5e78decb77880704..fb34126943b135f2ec3bbb4971311587720d8d19 100644 (file)
@@ -6742,7 +6742,7 @@ Decl *Sema::ActOnNamespaceAliasDef(Scope *S,
 
   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;
     }
   }
index 52cae2e92f5ae3f8b3de89dba8250e2510d2efff..e18b58b4d441797815f868b4bdb183ac9971a100 100644 (file)
@@ -11,9 +11,13 @@ namespace C { } // expected-note {{previous definition is here}}
 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'}}