diff options
author | Alexander Kornienko <alexfh@google.com> | 2015-12-03 11:37:28 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2015-12-03 11:37:28 +0000 |
commit | 061900fea81c9439918467d16fcb0bfb0bcb5dc8 (patch) | |
tree | 9ae5e196a47c00d7de6c56b3f284c1a6567d0856 /clang/lib | |
parent | ab43f42d9ced5b604ae9241fb02f12dc30f65556 (diff) | |
download | bcm5719-llvm-061900fea81c9439918467d16fcb0bfb0bcb5dc8.tar.gz bcm5719-llvm-061900fea81c9439918467d16fcb0bfb0bcb5dc8.zip |
Revert "Fix for merging decls in pragma weak Calling CheckFunctionDeclaration so that 2 decls for the 'weak' are merged. Differential Revision: http://reviews.llvm.org/D13048"
This reverts commit r254143 which introduces a crash on the following input:
f(char *);
g(char *);
#pragma weak f = g
int g(char *p) {}
llvm-svn: 254605
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index fed22c934ce..5a0f0f84af7 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -5546,22 +5546,17 @@ NamedDecl * Sema::DeclClonePragmaWeak(NamedDecl *ND, IdentifierInfo *II, assert(isa<FunctionDecl>(ND) || isa<VarDecl>(ND)); NamedDecl *NewD = nullptr; if (FunctionDecl *FD = dyn_cast<FunctionDecl>(ND)) { + FunctionDecl *NewFD; + // FIXME: Missing call to CheckFunctionDeclaration(). // FIXME: Mangling? // FIXME: Is the qualifier info correct? // FIXME: Is the DeclContext correct? - - LookupResult Previous(*this, II, Loc, LookupOrdinaryName); - LookupParsedName(Previous, TUScope, nullptr, true); - - auto NewFD = FunctionDecl::Create( - FD->getASTContext(), FD->getDeclContext(), Loc, Loc, - DeclarationName(II), FD->getType(), FD->getTypeSourceInfo(), SC_None, - false /*isInlineSpecified*/, FD->hasPrototype(), - false /*isConstexprSpecified*/); - - CheckFunctionDeclaration(TUScope, NewFD, Previous, - false /*IsExplicitSpecialization*/); - + NewFD = FunctionDecl::Create(FD->getASTContext(), FD->getDeclContext(), + Loc, Loc, DeclarationName(II), + FD->getType(), FD->getTypeSourceInfo(), + SC_None, false/*isInlineSpecified*/, + FD->hasPrototype(), + false/*isConstexprSpecified*/); NewD = NewFD; if (FD->getQualifier()) |