How do I deprecate a class?

Ian Lance Taylor iant@google.com
Wed Mar 21 15:34:00 GMT 2007


Thimo.Neubauer@cst.com writes:

> I concluded that
> 
>   class Foo {
>   public:
> 	void  bar(int x);
>   } __attribute__ ((deprecated));
> 
> should do the trick. However
> 
>   int main() {
> 	Foo f;
> 
> 	return 0;
>   };
> 
> only warns about the (obviously) unused variable but nothing else:

Looks like a bug to me.

And it's been filed already: http://gcc.gnu.org/PR16370

Interestingly, I do get a warning for this:

struct Foo { int i; } __attribute__ ((deprecated));
void foo() { struct Foo f; }

It matters whether I use "struct" or not.  Which is bizarre.

Ian



More information about the Gcc-help mailing list