diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-10-22 23:08:24 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-10-22 23:08:24 +0000 |
commit | f1af6a70c3060f7eda67da0bfe10f57966fd8073 (patch) | |
tree | 5a6a122ad2485f7286763b6e40e69786e70e9cbf /lib/Sema/SemaDecl.cpp | |
parent | 8970feab05b96f640a554a309e06d99478ef05fe (diff) |
Restrict creation of OverloadedFunctionDecl only to C++ (it was getting used for invalid redeclarations on C).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58008 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 1befc2e2e9..df4ade090e 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -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 |