diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-10-23 17:07:16 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-10-23 17:07:16 +0000 |
commit | e109a2ca59820af5852fee0e2be2e633403e76d3 (patch) | |
tree | 07aa37385c1197e4a9ddf65d3ed58cbf70c75431 /clang/lib/Sema/SemaDecl.cpp | |
parent | 1695466fe3ec8f62176ec5c3793e580cfd4f3d5b (diff) | |
download | bcm5719-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.cpp | 5 |
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) |