This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53274] New: /*struct*/ S (__cdecl * f)(); fails to compile
- From: "sbergman at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 08 May 2012 07:14:52 +0000
- Subject: [Bug c++/53274] New: /*struct*/ S (__cdecl * f)(); fails to compile
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53274
Bug #: 53274
Summary: /*struct*/ S (__cdecl * f)(); fails to compile
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: sbergman@redhat.com
At least with g++ 4.7.0 --target=i686-w64-mingw32, the compilation unit
struct S { /*struct*/ S (__cdecl * f)(); };
fails with
test.cc:1:34: error: expected identifier before '*' token
test.cc:1:36: warning: '__cdecl__' attribute only applies to function types
[-Wattributes]
test.cc:1:39: error: 'S' declared as function returning a function
All errors and warnings go away when the "/*struct*/" is commented in. (And
when removing the "__cdecl", it compiles fine with and without the commented-in
"struct".)
(This was originally reported to MinGW-w64 at
<sourceforge.net/support/tracker.php?aid=3514133>.)