summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-11-27 01:44:24 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-11-27 01:44:24 +0000
commit7dc71d03b984e2cd288cb0b6c02de3fe54782a73 (patch)
tree2e15ec3edbfb2159e5faca170bdf688bbd766aac /clang/lib
parent710c374dfe7b37efa57848916c3e57c5e2007631 (diff)
downloadbcm5719-llvm-7dc71d03b984e2cd288cb0b6c02de3fe54782a73.tar.gz
bcm5719-llvm-7dc71d03b984e2cd288cb0b6c02de3fe54782a73.zip
Revert r168411 for now.
llvm-svn: 168667
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/Decl.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 1f390eec05e..ed48c439b54 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud