This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33911] attribute deprecated vs. templates
- From: "jason at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jan 2008 22:23:02 -0000
- Subject: [Bug c++/33911] attribute deprecated vs. templates
- References: <bug-33911-365@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from jason at redhat dot com 2008-01-04 22:23 -------
Subject: Re: attribute deprecated vs. templates
niemayer at isg dot de wrote:
> I can second that problem for template member functions - in contrast to
> non-template member functions, where the attribute works.
This is a parser bug: parsing the member template declaration winds up
in cp_parser_init_declarator, which ignores attributes at the end of a
declaration. A normal member function goes through
cp_parser_member_declaration, which handles the attributes properly.
You can work around this bug by moving the attribute into the
decl-specifier-seq, i.e. "void __attribute ((deprecated)) foo(T&)".
Jason
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33911