]> granicus.if.org Git - clang/commitdiff
Restrict creation of OverloadedFunctionDecl only to C++ (it was getting used for...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 22 Oct 2008 23:08:24 +0000 (23:08 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 22 Oct 2008 23:08:24 +0000 (23:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58008 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index 1befc2e2e9a05125a35011c8a71af735d0bb3b63..df4ade090e08aebe281aacdb76bad4766f98735b 100644 (file)
@@ -95,7 +95,8 @@ void Sema::PushOnScopeChains(NamedDecl *D, Scope *S) {
       IdResolver.AddShadowedDecl(TD, *I);
       return;
     }
-  } else if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
+  } else if (getLangOptions().CPlusPlus && isa<FunctionDecl>(D)) {
+    FunctionDecl *FD = cast<FunctionDecl>(D);
     // We are pushing the name of a function, which might be an
     // overloaded name.
     IdentifierResolver::iterator