From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25178 invoked by alias); 11 Dec 2002 23:16:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 25150 invoked by uid 71); 11 Dec 2002 23:16:01 -0000 Resent-Date: 11 Dec 2002 23:16:01 -0000 Resent-Message-ID: <20021211231601.25149.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, Sonal.Santan@xilinx.com Received: (qmail 24953 invoked by uid 61); 11 Dec 2002 23:14:47 -0000 Message-Id: <20021211231447.24952.qmail@sources.redhat.com> Date: Wed, 11 Dec 2002 15:16:00 -0000 From: Sonal.Santan@xilinx.com Reply-To: Sonal.Santan@xilinx.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/8905: Function attributes for C++ constructors confuses g++ frontend X-SW-Source: 2002-12/txt/msg00672.txt.bz2 List-Id: >Number: 8905 >Category: c++ >Synopsis: Function attributes for C++ constructors confuses g++ frontend >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Wed Dec 11 15:16:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Sonal.Santan@xilinx.com >Release: gcc version 3.2.1 (MinGW special 20021202-2) >Organization: >Environment: Reading specs from C:/Local/MingW/bin/../lib/gcc-lib/mingw32/3.2.1/specs Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 -target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,objc --disable-win32-registry --disable-shared --enable-sjlj-exceptions Thread model: win32 Operating System Win2000 SP2 i586 >Description: Putting __attribute__((dllexport)) infront of a C++ class constructor confuses the frontend. Moving it to the end of the constructor fixes the problem. Typical output is: C:\sonals\scratch>g++ -c export.cpp export.cpp:5: parse error before `const' export.cpp:7: warning: `dllexport' attribute ignored export.cpp:7: declaration does not declare anything export.cpp:7: parse error before `)' token export.cpp:24: prototype for `MyExpo::MyExpo(const char*)' does not match any in class `MyExpo' export.cpp:1: candidates are: MyExpo::MyExpo() export.cpp:1: MyExpo::MyExpo(const MyExpo&) export.cpp:29: definition of implicitly-declared `MyExpo::MyExpo()' export.cpp:29: declaration of `MyExpo::MyExpo()' throws different exceptions export.cpp:1: than previous declaration `MyExpo::MyExpo() throw ()' >How-To-Repeat: g++ -c export.cpp >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="export.cpp" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="export.cpp" Y2xhc3MgTXlFeHBvIHsNCnB1YmxpYzoNCiAgICBfX2F0dHJpYnV0ZV9fKChkbGxleHBvcnQpKSB2 b2lkIE1ldGhvZDEoY29uc3QgY2hhciAqKTsNCiAgICBfX2F0dHJpYnV0ZV9fKChkbGxleHBvcnQp KSB2b2lkIE1ldGhvZDIoY29uc3QgaW50KTsNCiAgICBfX2F0dHJpYnV0ZV9fKChkbGxleHBvcnQp KSBNeUV4cG8oY29uc3QgY2hhciAqKTsgLy8gdHJvdWJsZSBoZXJlDQpwcml2YXRlOg0KICAgIF9f YXR0cmlidXRlX18oKGRsbGV4cG9ydCkpIE15RXhwbygpOyAvLyB0cm91YmxlIGhlcmUNCg0KfTsg DQoNCnZvaWQgTXlFeHBvOjpNZXRob2QxKGNvbnN0IGNoYXIgKiBjKQ0Kew0KDQp9DQoNCnZvaWQg TXlFeHBvOjpNZXRob2QyKGNvbnN0IGludCBpKQ0Kew0KDQp9DQoNCk15RXhwbzo6TXlFeHBvKGNv bnN0IGNoYXIgKiBjKQ0Kew0KDQp9DQoNCk15RXhwbzo6TXlFeHBvKCkNCnsNCg0KfQ0K