This is the mail archive of the gcc@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]

Surprising behavior of __attribute__((deprecated)) in ctor


Hello,

I have quite a surpising behavior with gcc when compiling the following code (*). Here is the output:

$ g++ deprecated.cxx                                       /tmp
deprecated.cxx: In constructor `A::A(int)':
deprecated.cxx:11: warning: `A' is deprecated (declared at deprecated.cxx:9)
deprecated.cxx: In constructor `A::A(int)':
deprecated.cxx:11: warning: `A' is deprecated (declared at deprecated.cxx:9)

Using:
$ g++ --version
g++ (GCC) 3.3 20030304 (Apple Computer, Inc. build 1671)

I cannot reproduce that with gcc 3.3, 3.4, 4.0 on my linux box (debian testing package).

Comment ?

Thanks,
Mathieu
Ps: function seems fine.


(*) -------- deprecated.cxx ------ class A { public: A() { foo=0; }; A(int b) __attribute__((deprecated)); int foo; }; A::A(int b) { foo = b; }

int main()
{
  A a;
  // A a(2);
}


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