summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-10-23 17:07:16 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-10-23 17:07:16 +0000
commite109a2ca59820af5852fee0e2be2e633403e76d3 (patch)
tree07aa37385c1197e4a9ddf65d3ed58cbf70c75431 /clang/lib/Sema/SemaDecl.cpp
parent1695466fe3ec8f62176ec5c3793e580cfd4f3d5b (diff)
downloadbcm5719-llvm-e109a2ca59820af5852fee0e2be2e633403e76d3.tar.gz
bcm5719-llvm-e109a2ca59820af5852fee0e2be2e633403e76d3.zip
Attach class template attributes to the templated CXXRecordDecl,
instead of silently discarding them. As a side effect, this improves diagnostics for constexpr class templates slightly. llvm-svn: 142755
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 289ec1a6f6f..2241024ba4d 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -2312,7 +2312,10 @@ Decl *Sema::ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
// Note that the above type specs guarantee that the
// type rep is a Decl, whereas in many of the others
// it's a Type.
- Tag = dyn_cast<TagDecl>(TagD);
+ if (isa<TagDecl>(TagD))
+ Tag = cast<TagDecl>(TagD);
+ else if (ClassTemplateDecl *CTD = dyn_cast<ClassTemplateDecl>(TagD))
+ Tag = CTD->getTemplatedDecl();
}
if (Tag)
OpenPOWER on IntegriCloud