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: "niemayer at isg dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Dec 2007 14:32:57 -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 #2 from niemayer at isg dot de 2007-12-20 14:32 -------
I can second that problem for template member functions - in contrast to
non-template member functions, where the attribute works.
This gives a warning about deprecation as expected:
-----------------------------------------------------------------
struct T { } ;
struct A {
inline void foo(T & ) __attribute__((deprecated));
};
inline void A::foo(T & ) { }
void test(T & t) {
A a;
a.foo(t);
}
-------------------------------------------------------------
... while this is not causing a warning as it should:
-------------------------------------------------------------
struct A {
template <class T> inline void foo(T & ) __attribute__((deprecated));
};
template <class T> inline void A::foo(T & ) { }
void test(A & t) {
A a;
a.foo(t);
}
-------------------------------------------------------------
--
niemayer at isg dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |niemayer at isg dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33911