From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19822 invoked by alias); 11 Sep 2003 07:00:40 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 19815 invoked by uid 48); 11 Sep 2003 07:00:39 -0000 Date: Thu, 11 Sep 2003 14:54:00 -0000 From: "Bruce at Fitzsimons dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20030911070034.12246.Bruce@Fitzsimons.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/12246] New: __attribute__ not able to be placed on inline ctors X-Bugzilla-Reason: CC X-SW-Source: 2003-09/txt/msg00888.txt.bz2 List-Id: PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12246 Summary: __attribute__ not able to be placed on inline ctors Product: gcc Version: 3.2.3 Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: Bruce at Fitzsimons dot org CC: gcc-bugs at gcc dot gnu dot org __attribute__ attributes are not able to be placed on inline ctors, which is a bit frustrating. Sometimes inline ctors are used in header files, esp. when doing a thin layer of inheritance around an existing object ie only the base class needs initialisation, there are no new member variables. This is often the case for deriving exceptions, where a new type is desired (for specific catch'es) but no new methods or members are defined. A simple example (not the inheritance case) class A { public: A(int _anInt) __attribute__ ((deprecated)) { anInt = _anInt; } private: int anInt; }; int main(void) { A aInstance(42); } Fails to parse: g++ test.cc test.cc:4: syntax error before `{' token test.cc:5: semicolon missing after declaration of `A' test.cc: In function `int main()': test.cc:10: no matching function for call to `A::A(int)' test.cc:2: candidates are: A::A(const A&)