diff options
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index d203376f91b..80831f42c8c 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -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(); |