[Bug 799066] Re: Parsing issue: Instance reinterpreted as function-pointer something
Hendrik Lönngren
799066 at bugs.launchpad.net
Wed Jul 6 16:41:52 UTC 2011
On further thought, I see that g++ allows "A()" as a shortcut for "A(*)()", so it confuses "B b(A());" with a function declaration. As this might be as designed, I am closing this bug.
But still, I think that this code should be perfectly legal. Also, the compiler error would be much clearer if it said "B (*)(A (*)())" instead of "B(A (*)())". Overall, allowing that shortcut doesn’t seems like a good idea to me.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-4.4 in Ubuntu.
https://bugs.launchpad.net/bugs/799066
Title:
Parsing issue: Instance reinterpreted as function-pointer something
Status in “gcc-4.4” package in Ubuntu:
Invalid
Bug description:
Binary package hint: gcc-4.4
When compiling the attached code with
g++ -c -o test.o test.cpp
I get the following error:
test.cpp: In function ‘int main()’:
test.cpp:15: error: request for member ‘dummy’ in ‘b’, which is of non-class type ‘B(A (*)())’
Actually I don’t even think that is a type.
ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: g++-4.4 4.4.4-14ubuntu5
ProcVersionSignature: Ubuntu 2.6.35-28.50-generic 2.6.35.11
Uname: Linux 2.6.35-28-generic i686
Architecture: i386
Date: Sat Jun 18 08:54:49 2011
ProcEnviron:
LANGUAGE=eo
PATH=(custom, user)
LANG=de_DE.UTF-8
SHELL=/bin/bash
SourcePackage: gcc-4.4
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.4/+bug/799066/+subscriptions
More information about the foundations-bugs
mailing list