forked from OSchip/llvm-project
Don't do an expensive definition check where a cheap 'is this C?' check suffices.
llvm-svn: 95188
This commit is contained in:
parent
0b78cc2af5
commit
d85be0cc60
|
@ -1300,7 +1300,8 @@ void Sema::MergeVarDecl(VarDecl *New, LookupResult &Previous) {
|
|||
|
||||
// C++ doesn't have tentative definitions, so go right ahead and check here.
|
||||
const VarDecl *Def;
|
||||
if (New->isThisDeclarationADefinition() == VarDecl::Definition &&
|
||||
if (getLangOptions().CPlusPlus &&
|
||||
New->isThisDeclarationADefinition() == VarDecl::Definition &&
|
||||
(Def = Old->getDefinition())) {
|
||||
Diag(New->getLocation(), diag::err_redefinition)
|
||||
<< New->getDeclName();
|
||||
|
|
Loading…
Reference in New Issue