This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/9658: compiler accepts invalid code
- From: bangerth at dealii dot org
- To: at at sources dot redhat dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, papadopo at sources dot redhat dot com
- Date: 14 Feb 2003 20:58:12 -0000
- Subject: Re: c++/9658: compiler accepts invalid code
- Reply-to: bangerth at dealii dot org, at at sources dot redhat dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, papadopo at sources dot redhat dot com, gcc-gnats at gcc dot gnu dot org
Synopsis: compiler accepts invalid code
State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Fri Feb 14 20:58:12 2003
State-Changed-Why:
That's a gcc extension. If you use -ansi -pedantic, you'll get
tmp/g> /home/bangerth/bin/gcc-3.2.2-pre/bin/c++ -ansi -pedantic -c x.cc
x.cc: In function `int main()':
x.cc:2: warning: ISO C++ forbids array dimensions with parenthesized type in
new
The new parser in 3.4 rejects it outright (i.e. the extension
has been removed):
tmp/g> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc: In function `int main()':
x.cc:2: error: expected `,' or `;'
Wolfgang
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9658