diff options
author | Erich Keane <erich.keane@intel.com> | 2017-03-23 18:51:54 +0000 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2017-03-23 18:51:54 +0000 |
commit | 4a1e0b13e783f7eac1028ad640c30e85f227b3fd (patch) | |
tree | 3192edbada11b71de1d130bf60bd8dacaaca46b6 /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 53160ec41938642e39d3aeef3392c68a52d516c0 (diff) |
Correct class-template deprecation behavior-REDUX
Correct class-template deprecation behavior
Based on the comment in the test, and my reading of the standard, a deprecated warning should be issued in the following case:
template<typename T> [[deprecated]] class Foo{}; Foo<int> f;
This was not the case, because the ClassTemplateSpecializationDecl creation did not also copy the deprecated attribute.
Note: I did NOT audit the complete set of attributes to see WHICH ones should be copied, so instead I simply copy ONLY the deprecated attribute.
Previous DiffRev: https://reviews.llvm.org/D27486, was reverted.
This patch fixes the issues brought up here by the reverter: https://reviews.llvm.org/rL298410
Differential Revision: https://reviews.llvm.org/D31245
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298634 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index 314dfe3256..67e330a6da 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -1939,6 +1939,9 @@ namespace clang { namespace sema { Attr *instantiateTemplateAttribute(const Attr *At, ASTContext &C, Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs); + Attr *instantiateTemplateAttributeForDecl( + const Attr *At, ASTContext &C, Sema &S, + const MultiLevelTemplateArgumentList &TemplateArgs); } } |