This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/8905: Function attributes for C++ constructors confuses g++ frontend
- From: Sonal dot Santan at xilinx dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 11 Dec 2002 23:14:47 -0000
- Subject: c++/8905: Function attributes for C++ constructors confuses g++ frontend
- Reply-to: Sonal dot Santan at xilinx dot com
>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