aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index d203376f91..80831f42c8 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/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();