This is the mail archive of the gcc-prs@gcc.gnu.org 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
>Closed-Date:
>Last-Modified:
>Originator:     kparz
>Release:        3.3 20020905 (experimental)
>Organization:
>Environment:
System: FreeBSD arcturus.student.iastate.edu 4.6-STABLE FreeBSD 4.6-STABLE #15: Sat Aug 24 23:25:48 CDT 2002 kparz@arcturus.student.iastate.edu:/usr/obj/usr/src/sys/ARCTURUS 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
>Description:
	Ambiguity in function declarations is resolved incorrectly.
	See ISO/IEC 14882:1998(E), 8.2 p7
	
>How-To-Repeat:
# 1 "parse.cc"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "parse.cc"
typedef int I;
void foo(int(I));
void (*bar)(int (*)(int)) = &foo;
	
>Fix:
Use the other style of function declarators (with *), i.e.
void foo(int (*)(I));
	
>Release-Note:
>Audit-Trail:
>Unformatted:


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