This is the mail archive of the gcc-bugs@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++/7307: -pedantic makes errors to warnings


>Number:         7307
>Category:       c++
>Synopsis:       -pedantic makes errors to warnings
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          accepts-illegal
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 14 08:56:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Martin v. Loewis
>Release:        3.2 20020714 (experimental)
>Organization:
HUB
>Environment:
System: Linux mira 2.4.18-4GB #1 Wed Mar 27 13:57:05 UTC 2002 i686 unknown
Architecture: i686

host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /usr/src/egcs/configure --prefix=/usr/local/newabi --enable-shared --enable-threads --enable-languages=c,c++,java : (reconfigured)  : (reconfigured) /usr/src/egcs/configure --prefix=/usr/local/newabi --enable-shared --enable-threads --enable-languages=c,c++,java
>Description:
	-pedantic changes the status of " field `char test::test' with same name as class"
        from error to warning, thus accepting the code under -pedantic, even though it is
        ill-formed.
>How-To-Repeat:
	Compile the fragment

struct test
{
	char test;
	test();
};

	with and without -pedantic:
martin@mira:~/tmp> /usr/local/newabi/bin/g++ -S a.cc
a.cc:3: error: field `char test::test' with same name as class
martin@mira:~/tmp> /usr/local/newabi/bin/g++ -pedantic -S a.cc
a.cc:3: warning: field `char test::test' with same name as class

>Fix:
>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]