This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/33911] attribute deprecated vs. templates



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]