Bug 33912

Summary: attribute deprecated vs. templates
Product: gcc Reporter: Benjamin Kosnik <bkoz>
Component: c++Assignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: normal CC: gcc-bugs
Priority: P3    
Version: 4.3.0   
Target Milestone: ---   
Host: all Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description Benjamin Kosnik 2007-10-26 15:46:53 UTC
In the following example, class "foo" gets a deprecated warning, but a similar class template "goo" does not. Typedefs constructed with foo or goo get an error.

What up?


struct foo
{
  int i;
} __attribute__ ((__deprecated__));

template<typename _Tp>
struct goo
{
  int i;
} __attribute__ ((__deprecated__));

typedef foo foo_type __attribute__ ((__deprecated__));
typedef goo<int> goo_type __attribute__ ((__deprecated__));


int main()
{
  foo f1;
  goo<int> f2;

  foo_type f3;
  goo_type f4;

  return 0;
}


I have a patch to mark the C++0x bits deprecated, but it's not working because of this issue.
Comment 1 Paolo Carlini 2007-10-26 16:08:26 UTC

*** This bug has been marked as a duplicate of 33911 ***