Point the caret at the error for the 'expected namespace name' diagnostic in

a namespace alias declaration.

llvm-svn: 154138
This commit is contained in:
Richard Smith 2012-04-05 23:13:23 +00:00
parent cb5b585cca
commit a974688d35
2 changed files with 7 additions and 3 deletions

View 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;
}
}

View 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'}}