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: [email protected]
ReportedBy: [email protected]
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>.)