Correct class-template deprecation behavior
authorErich Keane <erich.keane@intel.com>
Tue, 21 Mar 2017 17:49:17 +0000 (17:49 +0000)
committerErich Keane <erich.keane@intel.com>
Tue, 21 Mar 2017 17:49:17 +0000 (17:49 +0000)
commit8a8f5f0f00d7c0842871f180c80883e87304f653
tree0894364e7dd1bb1ca78942a9e1d022578098d5c9
parenta1e3d08666f4daa714218d073ab2828fd2131928
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.

Differential Revision: https://reviews.llvm.org/D27486

llvm-svn: 298410
13 files changed:
clang/include/clang/Basic/Attr.td
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaDeclAttr.cpp
clang/lib/Sema/SemaTemplate.cpp
clang/lib/Sema/SemaTemplateInstantiate.cpp
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp
clang/test/Sema/attr-deprecated.c
clang/test/SemaCXX/attr-deprecated.cpp
clang/test/SemaObjC/attr-deprecated.m
clang/test/SemaObjC/special-dep-unavail-warning.m
clang/test/SemaObjC/warn-deprecated-implementations.m
clang/utils/TableGen/ClangAttrEmitter.cpp