This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/7844: Function declarations parsed incorrectly

>Number:         7844
>Category:       c++
>Synopsis:       Function declarations parsed incorrectly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 05 15:36:01 PDT 2002
>Originator:     kparz
>Release:        3.3 20020905 (experimental)
System: FreeBSD 4.6-STABLE FreeBSD 4.6-STABLE #15: Sat Aug 24 23:25:48 CDT 2002 i386

host: i386-unknown-freebsd4.6
build: i386-unknown-freebsd4.6
target: i386-unknown-freebsd4.6
configured with: ../gcc/configure --prefix=/u/gcc-20020905 --enable-languages=c,c++,f77
	Ambiguity in function declarations is resolved incorrectly.
	See ISO/IEC 14882:1998(E), 8.2 p7
# 1 ""
# 1 "<built-in>"
# 1 "<command line>"
# 1 ""
typedef int I;
void foo(int(I));
void (*bar)(int (*)(int)) = &foo;
Use the other style of function declarators (with *), i.e.
void foo(int (*)(I));

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]