GCC Bugzilla – Attachment 33938 Details for
Bug 33911
attribute deprecated vs. templates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
depr.patch (text/plain), 1.74 KB, created by
Jason Merrill
on 2014-11-11 17:52:30 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Jason Merrill
Created:
2014-11-11 17:52:30 UTC
Size:
1.74 KB
patch
obsolete
>commit 025530d086fe52c9c7c5e697ec20480a0ebd6bea >Author: Jason Merrill <jason@redhat.com> >Date: Tue Nov 11 10:58:54 2014 -0500 > > PR c++/33911 > * decl2.c (is_late_template_attribute): Attribute deprecated is > not deferred. > * pt.c (lookup_template_class_1): Copy TREE_DEPRECATED. > >diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c >index ff40710..c18cd1e 100644 >--- a/gcc/cp/decl2.c >+++ b/gcc/cp/decl2.c >@@ -1204,9 +1204,9 @@ is_late_template_attribute (tree attr, tree decl) > /* Also defer most attributes on dependent types. This is not > necessary in all cases, but is the better default. */ > else if (dependent_type_p (type) >- /* But attributes abi_tag and visibility specifically apply >- to templates. */ >+ /* But some attributes specifically apply to templates. */ > && !is_attribute_p ("abi_tag", name) >+ && !is_attribute_p ("deprecated", name) > && !is_attribute_p ("visibility", name)) > return true; > else >diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c >index fa9652f..70f669c 100644 >--- a/gcc/cp/pt.c >+++ b/gcc/cp/pt.c >@@ -7853,6 +7853,8 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context, > if (OVERLOAD_TYPE_P (t) > && !DECL_ALIAS_TEMPLATE_P (gen_tmpl)) > { >+ if (TREE_DEPRECATED (template_type)) >+ TREE_DEPRECATED (t) = true; > if (tree attributes > = lookup_attribute ("abi_tag", TYPE_ATTRIBUTES (template_type))) > { >diff --git a/gcc/testsuite/g++.dg/ext/attr-deprecated-1.C b/gcc/testsuite/g++.dg/ext/attr-deprecated-1.C >new file mode 100644 >index 0000000..4a3098b >--- /dev/null >+++ b/gcc/testsuite/g++.dg/ext/attr-deprecated-1.C >@@ -0,0 +1,2 @@ >+template<typename T> struct __attribute__ ((deprecated)) S {}; >+S<int> s; // { dg-warning "deprecated" }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 33911
: 33938