Topic: Function/Object declaration ambiguity
Author: jason@cygnus.com (Jason Merrill)
Date: Wed, 23 Feb 1994 23:38:25 GMT Raw View
In the following example, which line is in error? Cfront says line 7, xlC
says line 8. I'm inclined to agree with xlC, but this means that the name
of the enclosing class is treated different SYNTACTICALLY from other
type-names; obviously 'A (bar)' should be parsed as a function declaration.
1 typedef int foo;
2 typedef int bar;
3 struct A {
4 static foo (bar);
5 };
6
7 int i = A::bar;
8 int (*fp)(bar) = A::foo;
Jason