]> granicus.if.org Git - clang/commit
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)
commitc1312361da3eb9d40a6b7dd770e7bace2a79e7fb
tree47eaac26cd2cc24d74ee19e35a4cb1685f78570a
parent9bd00f207cc73a964015de302fe002c4a94298e1
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298410 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/clang/Basic/Attr.td
include/clang/Sema/Sema.h
lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaTemplate.cpp
lib/Sema/SemaTemplateInstantiate.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp
test/Sema/attr-deprecated.c
test/SemaCXX/attr-deprecated.cpp
test/SemaObjC/attr-deprecated.m
test/SemaObjC/special-dep-unavail-warning.m
test/SemaObjC/warn-deprecated-implementations.m
utils/TableGen/ClangAttrEmitter.cpp