forked from OSchip/llvm-project
Sema: err_after_alias is unreachable, remove it
Examples this would have catched are now handled by the attribute verification code. llvm-svn: 226626
This commit is contained in:
parent
83887fb7dc
commit
1efd55ff21
|
@ -3902,8 +3902,6 @@ def warn_missing_variable_declarations : Warning<
|
|||
def err_static_data_member_reinitialization :
|
||||
Error<"static data member %0 already has an initializer">;
|
||||
def err_redefinition : Error<"redefinition of %0">;
|
||||
def err_alias_after_tentative :
|
||||
Error<"alias definition of %0 after tentative definition">;
|
||||
def err_alias_is_definition :
|
||||
Error<"definition %0 cannot also be an alias">;
|
||||
def err_definition_of_implicitly_declared_member : Error<
|
||||
|
|
|
@ -2223,11 +2223,7 @@ static void checkNewAttributesAfterDef(Sema &S, Decl *New, const Decl *Old) {
|
|||
S.CheckForFunctionRedefinition(FD, cast<FunctionDecl>(Def));
|
||||
else {
|
||||
VarDecl *VD = cast<VarDecl>(New);
|
||||
unsigned Diag = cast<VarDecl>(Def)->isThisDeclarationADefinition() ==
|
||||
VarDecl::TentativeDefinition
|
||||
? diag::err_alias_after_tentative
|
||||
: diag::err_redefinition;
|
||||
S.Diag(VD->getLocation(), Diag) << VD->getDeclName();
|
||||
S.Diag(VD->getLocation(), diag::err_redefinition) << VD->getDeclName();
|
||||
S.Diag(Def->getLocation(), diag::note_previous_definition);
|
||||
VD->setInvalidDecl();
|
||||
}
|
||||
|
|
|
@ -28,3 +28,7 @@ static int var2 __attribute((alias("v2"))) = 2; // expected-error {{definition '
|
|||
|
||||
extern int var3 __attribute__((alias("C"))); // expected-note{{previous definition is here}}
|
||||
int var3 = 3; // expected-error{{redefinition of 'var3'}}
|
||||
|
||||
int v4;
|
||||
int var4;
|
||||
int var4 __attribute((alias("v4"))); // expected-error {{definition 'var4' cannot also be an alias}}
|
||||
|
|
Loading…
Reference in New Issue