Imrpove the note text for when a non-type decl hides a tag type

llvm-svn: 155723
This commit is contained in:
Kaelyn Uhrain 2012-04-27 18:26:49 +00:00
parent 6120cfb8cd
commit 3fe3f85769
5 changed files with 6 additions and 6 deletions

View File

@ -74,8 +74,8 @@ def err_module_cycle : Error<"cyclic dependency in module '%0': %1">,
def warn_module_build : Warning<"building module '%0' from source">,
InGroup<ModuleBuild>, DefaultIgnore;
def note_pragma_entered_here : Note<"#pragma entered here">;
def note_decl_shadowing_tag_type : Note<
"non-type %0 shadowing %1 %0 declared here">;
def note_decl_hiding_tag_type : Note<
"%1 %0 is hidden by a non-type declaration of %0 here">;
// Sema && Lex
def ext_longlong : Extension<

View File

@ -1683,7 +1683,7 @@ bool Parser::ParseImplicitInt(DeclSpec &DS, CXXScopeSpec *SS,
if (Actions.LookupParsedName(R, getCurScope(), SS)) {
for (LookupResult::iterator I = R.begin(), IEnd = R.end();
I != IEnd; ++I)
Diag((*I)->getLocation(), diag::note_decl_shadowing_tag_type)
Diag((*I)->getLocation(), diag::note_decl_hiding_tag_type)
<< TokenName << TagName;
}

View File

@ -569,7 +569,7 @@ Corrected:
if (LookupParsedName(R, S, &SS)) {
for (LookupResult::iterator I = R.begin(), IEnd = R.end();
I != IEnd; ++I)
Diag((*I)->getLocation(), diag::note_decl_shadowing_tag_type)
Diag((*I)->getLocation(), diag::note_decl_hiding_tag_type)
<< Name << TagName;
}
break;

View File

@ -211,7 +211,7 @@ class Foo {
public:
enum Bar { X, Y };
void SetBar(Bar bar);
Bar Bar(); // expected-note 2 {{non-type 'Bar' shadowing enum 'Bar' declared here}}
Bar Bar(); // expected-note 2 {{enum 'Bar' is hidden by a non-type declaration of 'Bar' here}}
private:
Bar bar_; // expected-error {{must use 'enum' tag to refer to type 'Bar' in this scope}}
};

View File

@ -51,7 +51,7 @@ namespace foo {
class Bar {};
}
void Bar(int); // expected-note{{non-type 'Bar' shadowing class 'Bar' declared here}}
void Bar(int); // expected-note{{class 'Bar' is hidden by a non-type declaration of 'Bar' here}}
using foo::Bar;
void ambiguity() {