diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-11-27 01:44:24 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-11-27 01:44:24 +0000 |
commit | 8272be5ed3bf7c7ac5d32fa9fd83f9229bf455d0 (patch) | |
tree | 5682619d8d5123ae31345f251206ef383cfc0c33 /lib/AST/Decl.cpp | |
parent | 4b98b2b555a9ad4f9a724fbddb94cd767ca6b2a1 (diff) |
Revert r168411 for now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168667 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 1f390eec05..ed48c439b5 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -777,10 +777,12 @@ static LinkageInfo getLVForDecl(const NamedDecl *D, bool OnlyTemplate) { if (llvm::Optional<Visibility> Vis = Function->getExplicitVisibility()) LV.mergeVisibility(*Vis, true); } - - // Note that Sema::MergeCompatibleFunctionDecls already takes care of - // merging storage classes and visibility attributes, so we don't have to - // look at previous decls in here. + + if (const FunctionDecl *Prev = Function->getPreviousDecl()) { + LinkageInfo PrevLV = getLVForDecl(Prev, OnlyTemplate); + if (PrevLV.linkage()) LV.setLinkage(PrevLV.linkage()); + LV.mergeVisibility(PrevLV); + } return LV; } |