зеркало из https://github.com/microsoft/clang-1.git
Don't do an expensive definition check where a cheap 'is this C?' check suffices.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95188 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
16acfee729
Коммит
6c048a916f
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче