public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14181] New: Cryptic error message for code that compiled without warnings in 3.3.x
@ 2004-02-17 17:40 daney at gcc dot gnu dot org
  2004-02-17 17:43 ` [Bug c++/14181] " giovannibajo at libero dot it
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: daney at gcc dot gnu dot org @ 2004-02-17 17:40 UTC (permalink / raw)
  To: gcc-bugs

I have the following code that compiles without warnings with g++ 3.3.2
(x86-pc-linux) and 3.3.1 (mipsel-linux).  But I get an error under 3.4.

Not being a C++ expert, can someone tell me if my code is bogus, or if this is a
problem with 3.4.

Here is the code:

----------d1.cpp--------8<------------------------
char **
f1()
{
   char** pSections;
     // allocate an array of 10 char pointers.
   pSections = new (char*)[10];
     return pSections;
  }
---------------8<----------------------------

These are the errors:

[daney@dl junk]$ mipsel-linux-g++ --version
mipsel-linux-g++ (GCC) 3.4.0 20040214 (prerelease)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[daney@dl junk]$ mipsel-linux-g++ -c d1.cpp
d1.cpp: In function `char** f1()':
d1.cpp:7: error: expected `;' before '[' token


Perhaps it should say something like:  Parenthesized type name no longer allowed
in new type[] expressions...

-- 
           Summary: Cryptic error message for code that compiled without
                    warnings in 3.3.x
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: daney at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: *
  GCC host triplet: *
GCC target triplet: *


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14181


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/14181] Cryptic error message for code that compiled without warnings in 3.3.x
  2004-02-17 17:40 [Bug c++/14181] New: Cryptic error message for code that compiled without warnings in 3.3.x daney at gcc dot gnu dot org
@ 2004-02-17 17:43 ` giovannibajo at libero dot it
  2004-02-18 18:06 ` giovannibajo at libero dot it
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: giovannibajo at libero dot it @ 2004-02-17 17:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-02-17 17:43 -------
Confirmed, normal priority as per Joe Buck's request. Not a regression, but let 
me set a target on 3.4.0 anyway. 

I'll take care of thss, but I don't know if the patch will be feasable for the 
3.4 branch. Let's see how intrusive it turns out to be.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |giovannibajo at gcc dot gnu
                   |dot org                     |dot org
           Severity|minor                       |normal
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1
      Known to fail|                            |3.4.0 3.5.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-02-17 17:43:55
               date|                            |
   Target Milestone|---                         |3.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14181


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/14181] Cryptic error message for code that compiled without warnings in 3.3.x
  2004-02-17 17:40 [Bug c++/14181] New: Cryptic error message for code that compiled without warnings in 3.3.x daney at gcc dot gnu dot org
  2004-02-17 17:43 ` [Bug c++/14181] " giovannibajo at libero dot it
@ 2004-02-18 18:06 ` giovannibajo at libero dot it
  2004-02-19  3:06 ` cvs-commit at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: giovannibajo at libero dot it @ 2004-02-18 18:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-02-18 18:06 -------
Patch submitted:
http://gcc.gnu.org/ml/gcc-patches/2004-02/msg01610.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14181


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/14181] Cryptic error message for code that compiled without warnings in 3.3.x
  2004-02-17 17:40 [Bug c++/14181] New: Cryptic error message for code that compiled without warnings in 3.3.x daney at gcc dot gnu dot org
  2004-02-17 17:43 ` [Bug c++/14181] " giovannibajo at libero dot it
  2004-02-18 18:06 ` giovannibajo at libero dot it
@ 2004-02-19  3:06 ` cvs-commit at gcc dot gnu dot org
  2004-02-19  3:10 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-19  3:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-02-19 03:06 -------
Subject: Bug 14181

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	giovannibajo@gcc.gnu.org	2004-02-19 03:06:10

Modified files:
	gcc/cp         : ChangeLog parser.c 

Log message:
	PR c++/14181
	* parser.c (cp_parser_new_expression): Parse an ill-formed
	direct-new-declarator after a parenthesized type-id to emit good
	diagnostic.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3960&r2=1.3961
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.173&r2=1.174



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14181


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/14181] Cryptic error message for code that compiled without warnings in 3.3.x
  2004-02-17 17:40 [Bug c++/14181] New: Cryptic error message for code that compiled without warnings in 3.3.x daney at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-02-19  3:06 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-19  3:10 ` cvs-commit at gcc dot gnu dot org
  2004-02-19  3:20 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-19  3:10 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-02-19 03:10 -------
Subject: Bug 14181

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	giovannibajo@gcc.gnu.org	2004-02-19 03:09:59

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/parse: new2.C 

Log message:
	PR c++/14181
	* g++.dg/parse/new2.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3516&r2=1.3517
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/new2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14181


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/14181] Cryptic error message for code that compiled without warnings in 3.3.x
  2004-02-17 17:40 [Bug c++/14181] New: Cryptic error message for code that compiled without warnings in 3.3.x daney at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-02-19  3:10 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-19  3:20 ` cvs-commit at gcc dot gnu dot org
  2004-02-19  3:23 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-19  3:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-02-19 03:20 -------
Subject: Bug 14181

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	giovannibajo@gcc.gnu.org	2004-02-19 03:20:19

Modified files:
	gcc/cp         : ChangeLog parser.c 

Log message:
	PR c++/14181
	* parser.c (cp_parser_new_expression): Parse an ill-formed
	direct-new-declarator after a parenthesized type-id to emit good
	diagnostic.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.55&r2=1.3892.2.56
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.157.2.13&r2=1.157.2.14



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14181


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/14181] Cryptic error message for code that compiled without warnings in 3.3.x
  2004-02-17 17:40 [Bug c++/14181] New: Cryptic error message for code that compiled without warnings in 3.3.x daney at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-02-19  3:20 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-19  3:23 ` cvs-commit at gcc dot gnu dot org
  2004-02-19  3:24 ` giovannibajo at libero dot it
  2004-02-19  3:25 ` giovannibajo at libero dot it
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-19  3:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-02-19 03:23 -------
Subject: Bug 14181

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	giovannibajo@gcc.gnu.org	2004-02-19 03:23:28

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/parse: new2.C 

Log message:
	PR c++/14181
	* g++.dg/parse/new2.C: New test.
	PR c++/14181
	* g++.dg/parse/new2.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.90&r2=1.3389.2.91
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/new2.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14181


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/14181] Cryptic error message for code that compiled without warnings in 3.3.x
  2004-02-17 17:40 [Bug c++/14181] New: Cryptic error message for code that compiled without warnings in 3.3.x daney at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-02-19  3:23 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-19  3:24 ` giovannibajo at libero dot it
  2004-02-19  3:25 ` giovannibajo at libero dot it
  7 siblings, 0 replies; 9+ messages in thread
From: giovannibajo at libero dot it @ 2004-02-19  3:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-02-19 03:24 -------
Fixed in GCC 3.4.0 and 3.5.0.

pr14181.cc:7: error: array bound forbidden after parenthesized type-id
pr14181.cc:7: note: try removing the parentheses around the type-id

Thank you for the report!

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14181


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/14181] Cryptic error message for code that compiled without warnings in 3.3.x
  2004-02-17 17:40 [Bug c++/14181] New: Cryptic error message for code that compiled without warnings in 3.3.x daney at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2004-02-19  3:24 ` giovannibajo at libero dot it
@ 2004-02-19  3:25 ` giovannibajo at libero dot it
  7 siblings, 0 replies; 9+ messages in thread
From: giovannibajo at libero dot it @ 2004-02-19  3:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-02-19 03:25 -------
I forgot to say, I also added a note about this in http://gcc.gnu.org/gcc-
3.4/changes.html.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14181


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-02-19  3:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-17 17:40 [Bug c++/14181] New: Cryptic error message for code that compiled without warnings in 3.3.x daney at gcc dot gnu dot org
2004-02-17 17:43 ` [Bug c++/14181] " giovannibajo at libero dot it
2004-02-18 18:06 ` giovannibajo at libero dot it
2004-02-19  3:06 ` cvs-commit at gcc dot gnu dot org
2004-02-19  3:10 ` cvs-commit at gcc dot gnu dot org
2004-02-19  3:20 ` cvs-commit at gcc dot gnu dot org
2004-02-19  3:23 ` cvs-commit at gcc dot gnu dot org
2004-02-19  3:24 ` giovannibajo at libero dot it
2004-02-19  3:25 ` giovannibajo at libero dot it

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).