aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-03-22 06:58:49 +0000
committerJohn McCall <rjmccall@apple.com>2011-03-22 06:58:49 +0000
commit78951941f31d3c63c4178a1275e1a2db2e20da11 (patch)
tree10e304acbf4d0fdb5146c9369087d78122f62d63 /lib/AST/Decl.cpp
parent74990f45b0bc57fca81f908efb13d2b6c6350f03 (diff)
Fix a test case and teach ClearLinkageCache() to clear the linkage of
a function template decl's pattern, which was suddenly exposed by my last patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 0dce211c13..df72541fbf 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -639,10 +639,12 @@ void NamedDecl::ClearLinkageCache() {
// Clear cached linkage for function template decls, too.
if (FunctionTemplateDecl *temp =
- dyn_cast<FunctionTemplateDecl>(const_cast<NamedDecl*>(this)))
+ dyn_cast<FunctionTemplateDecl>(const_cast<NamedDecl*>(this))) {
+ temp->getTemplatedDecl()->ClearLinkageCache();
for (FunctionTemplateDecl::spec_iterator
i = temp->spec_begin(), e = temp->spec_end(); i != e; ++i)
i->ClearLinkageCache();
+ }
}