From a32910da1ac5f7c3a2a97d1e5e2050cebe109ae7 Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Thu, 23 Mar 2017 18:51:54 +0000 Subject: 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 [[deprecated]] class Foo{}; Foo 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 llvm-svn: 298634 --- clang/test/SemaCXX/attr-deprecated.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'clang/test/SemaCXX/attr-deprecated.cpp') diff --git a/clang/test/SemaCXX/attr-deprecated.cpp b/clang/test/SemaCXX/attr-deprecated.cpp index eab5a1c0ec0..1680c5c6760 100644 --- a/clang/test/SemaCXX/attr-deprecated.cpp +++ b/clang/test/SemaCXX/attr-deprecated.cpp @@ -56,14 +56,14 @@ void f(B* b, C *c) { } struct D { - virtual void f() __attribute__((deprecated)); - virtual void f(int) __attribute__((deprecated)); - virtual void f(int, int) __attribute__((deprecated)); + virtual void f() __attribute__((deprecated));// expected-note{{'f' has been explicitly marked deprecated here}} + virtual void f(int) __attribute__((deprecated));// expected-note{{'f' has been explicitly marked deprecated here}} + virtual void f(int, int) __attribute__((deprecated));// expected-note{{'f' has been explicitly marked deprecated here}} }; -void D::f() { } // expected-note{{'f' has been explicitly marked deprecated here}} -void D::f(int v) { } // expected-note{{'f' has been explicitly marked deprecated here}} -void D::f(int v1, int v2) { } // expected-note{{'f' has been explicitly marked deprecated here}} +void D::f() { } +void D::f(int v) { } +void D::f(int v1, int v2) { } void f(D* d) { d->f(); // expected-warning{{'f' is deprecated}} -- cgit v1.2.3