[cfe-commits] r58008 - /cfe/trunk/lib/Sema/SemaDecl.cpp

Argiris Kirtzidis akyrtzi at gmail.com
Wed Oct 22 16:08:24 PDT 2008


Author: akirtzidis
Date: Wed Oct 22 18:08:24 2008
New Revision: 58008

URL: http://llvm.org/viewvc/llvm-project?rev=58008&view=rev
Log:
Restrict creation of OverloadedFunctionDecl only to C++ (it was getting used for invalid redeclarations on C).

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=58008&r1=58007&r2=58008&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Oct 22 18:08:24 2008
@@ -95,7 +95,8 @@
       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





More information about the cfe-commits mailing list