public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14667] New: ICE in cp_parser_parse_and_diagnose_invalid_type_name
@ 2004-03-21 10:19 wanderer at rsu dot ru
2004-03-21 15:44 ` [Bug c++/14667] [3.4?/3.5 Regression] " pinskia at gcc dot gnu dot org
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: wanderer at rsu dot ru @ 2004-03-21 10:19 UTC (permalink / raw)
To: gcc-bugs
With current mainline GCC (gcc version 3.5.0 20040319) crash at
invalide sourcecode:
Test.cc:7: internal compiler error: in
cp_parser_parse_and_diagnose_invalid_type_name, at cp/parser.c:2060
Please submit a full bug report,
--8X---------------------
template<class T>
class Class1;
class Class2 {
} // no ;
typedef Class1<Class2> Type1;
--X8---------------------
Giovanni Bajo in PR14283 comment:
"wanderer: this is a totally unrelated bug, even if the ICE happens at the
same
place. Would you please file a new bugreport to track it? Thanks."
And i create this bugreport.
--
Summary: ICE in cp_parser_parse_and_diagnose_invalid_type_name
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: wanderer at rsu dot ru
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i386-unknown-freebsd5.1
GCC host triplet: i386-unknown-freebsd5.1
GCC target triplet: i386-unknown-freebsd5.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14667
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/14667] [3.4?/3.5 Regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
2004-03-21 10:19 [Bug c++/14667] New: ICE in cp_parser_parse_and_diagnose_invalid_type_name wanderer at rsu dot ru
@ 2004-03-21 15:44 ` pinskia at gcc dot gnu dot org
2004-03-21 15:51 ` wanderer at rsu dot ru
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-21 15:44 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-03-21 15:44 -------
Confirmed on a compiler built today.
/* If we got here, this cannot be a valid variable declaration, thus
the cp_parser_id_expression must have resolved to a plain identifier
node (not a TYPE_DECL or TEMPLATE_ID_EXPR). */
my_friendly_assert (TREE_CODE (id) == IDENTIFIER_NODE, 20030203);
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |ice-on-invalid-code
Known to work| |3.3.3
Last reconfirmed|0000-00-00 00:00:00 |2004-03-21 15:44:10
date| |
Summary|ICE in |[3.4?/3.5 Regression] ICE in
|cp_parser_parse_and_diagnose|cp_parser_parse_and_diagnose
|_invalid_type_name |_invalid_type_name
Target Milestone|--- |3.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14667
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/14667] [3.4?/3.5 Regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
2004-03-21 10:19 [Bug c++/14667] New: ICE in cp_parser_parse_and_diagnose_invalid_type_name wanderer at rsu dot ru
2004-03-21 15:44 ` [Bug c++/14667] [3.4?/3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-03-21 15:51 ` wanderer at rsu dot ru
2004-03-23 1:31 ` [Bug c++/14667] [3.5 " giovannibajo at libero dot it
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: wanderer at rsu dot ru @ 2004-03-21 15:51 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From wanderer at rsu dot ru 2004-03-21 15:51 -------
For gcc version 3.4.0 20040321 (prerelease):
~/work/cpp/Bugs > ~/pkg/gcc_34/bin/g++ 14667.cc
14667.cc:7: error: expected init-declarator before "Type1"
14667.cc:7: error: expected `,' or `;' before "Type1"
For gcc version 3.3.4 20040321 (prerelease):
~/work/cpp/Bugs > ~/pkg/gcc_33/bin/g++ 14667.cc
14667.cc:7: error: ISO C++ forbids defining types within return type
14667.cc:7: error: `Class1<Class2>' specified as declarator-id
14667.cc:7: error: syntax error before `;' token
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14667
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/14667] [3.5 Regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
2004-03-21 10:19 [Bug c++/14667] New: ICE in cp_parser_parse_and_diagnose_invalid_type_name wanderer at rsu dot ru
2004-03-21 15:44 ` [Bug c++/14667] [3.4?/3.5 Regression] " pinskia at gcc dot gnu dot org
2004-03-21 15:51 ` wanderer at rsu dot ru
@ 2004-03-23 1:31 ` giovannibajo at libero dot it
2004-03-23 3:26 ` bangerth at dealii dot org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: giovannibajo at libero dot it @ 2004-03-23 1:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-03-23 01:31 -------
The ICE appears with my patch reworking the invalid typename diagnostic, but
it's something latent: somewhere we should diagnose the missing ';' when we see
the 'typedef' keyword. Instead, we get on and make "Class1<Class2>" go through
the invalid typename diagnostic function.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14667
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/14667] [3.5 Regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
2004-03-21 10:19 [Bug c++/14667] New: ICE in cp_parser_parse_and_diagnose_invalid_type_name wanderer at rsu dot ru
` (2 preceding siblings ...)
2004-03-23 1:31 ` [Bug c++/14667] [3.5 " giovannibajo at libero dot it
@ 2004-03-23 3:26 ` bangerth at dealii dot org
2004-09-14 20:10 ` [Bug c++/14667] [4.0 " reichelt at gcc dot gnu dot org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: bangerth at dealii dot org @ 2004-03-23 3:26 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-03-23 03:26 -------
No, don't forget that this
---------------
int typedef T;
struct X {} typedef S;
---------------
is legal, so we can't report on the missing semicolon. Yes, that's
an abomination, but it's valid code anyway...
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14667
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/14667] [4.0 Regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
2004-03-21 10:19 [Bug c++/14667] New: ICE in cp_parser_parse_and_diagnose_invalid_type_name wanderer at rsu dot ru
` (3 preceding siblings ...)
2004-03-23 3:26 ` bangerth at dealii dot org
@ 2004-09-14 20:10 ` reichelt at gcc dot gnu dot org
2004-09-14 20:18 ` reichelt at gcc dot gnu dot org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-09-14 20:10 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-09-14 20:10 -------
Fixed by Mark's patch for PR 16716:
http://gcc.gnu.org/ml/gcc-cvs/2004-09/msg00624.html
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Known to fail|4.0 |
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14667
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/14667] [4.0 Regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
2004-03-21 10:19 [Bug c++/14667] New: ICE in cp_parser_parse_and_diagnose_invalid_type_name wanderer at rsu dot ru
` (4 preceding siblings ...)
2004-09-14 20:10 ` [Bug c++/14667] [4.0 " reichelt at gcc dot gnu dot org
@ 2004-09-14 20:18 ` reichelt at gcc dot gnu dot org
2004-10-13 13:44 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-09-14 20:18 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-09-14 20:18 -------
Oops, the bug is not fixed.
The ICE went away, but now the invalid code is accepted. :-(
Mark, could you please have a look?
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |mark at codesourcery dot com
Status|RESOLVED |REOPENED
Keywords| |accepts-invalid
Resolution|FIXED |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14667
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/14667] [4.0 Regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
2004-03-21 10:19 [Bug c++/14667] New: ICE in cp_parser_parse_and_diagnose_invalid_type_name wanderer at rsu dot ru
` (5 preceding siblings ...)
2004-09-14 20:18 ` reichelt at gcc dot gnu dot org
@ 2004-10-13 13:44 ` pinskia at gcc dot gnu dot org
2004-10-15 4:41 ` mmitchel at gcc dot gnu dot org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-13 13:44 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14667
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/14667] [4.0 Regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
2004-03-21 10:19 [Bug c++/14667] New: ICE in cp_parser_parse_and_diagnose_invalid_type_name wanderer at rsu dot ru
` (6 preceding siblings ...)
2004-10-13 13:44 ` pinskia at gcc dot gnu dot org
@ 2004-10-15 4:41 ` mmitchel at gcc dot gnu dot org
2004-10-15 21:12 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-10-15 4:41 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |mark at codesourcery dot com
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14667
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/14667] [4.0 Regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
2004-03-21 10:19 [Bug c++/14667] New: ICE in cp_parser_parse_and_diagnose_invalid_type_name wanderer at rsu dot ru
` (7 preceding siblings ...)
2004-10-15 4:41 ` mmitchel at gcc dot gnu dot org
@ 2004-10-15 21:12 ` cvs-commit at gcc dot gnu dot org
2004-10-15 21:16 ` mmitchel at gcc dot gnu dot org
2004-10-15 21:18 ` cvs-commit at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-10-15 21:12 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-10-15 21:11 -------
Subject: Bug 14667
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: mmitchel@gcc.gnu.org 2004-10-15 21:11:50
Modified files:
gcc/cp : ChangeLog decl.c parser.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/init: dso_handle1.C
gcc/testsuite/g++.dg/parse: pragma1.C typedef6.C
Log message:
PR c++/17042
* decl.c (declare_global_var): Use the return value from pushdecl.
PR c++/14667
* parser.c (cp_parser_simple_declaration): Do not diagnose invalid
type names if we have already found a valid type.
(cp_parser_member_declaration): Likewise.
PR c++/17852
* parser.c (cp_parser_member_specification_opt): Handle
CPP_PRAGMA.
PR c++/17042
* g++.dg/init/dso_handle1.C: New test.
PR c++/17852
* g++.dg/parse/pragma1.C: New test.
PR c++/14667
* g++.dg/parse/typedef6.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4437&r2=1.4438
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1315&r2=1.1316
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.263&r2=1.264
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4459&r2=1.4460
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/dso_handle1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/pragma1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/typedef6.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14667
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/14667] [4.0 Regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
2004-03-21 10:19 [Bug c++/14667] New: ICE in cp_parser_parse_and_diagnose_invalid_type_name wanderer at rsu dot ru
` (8 preceding siblings ...)
2004-10-15 21:12 ` cvs-commit at gcc dot gnu dot org
@ 2004-10-15 21:16 ` mmitchel at gcc dot gnu dot org
2004-10-15 21:18 ` cvs-commit at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-10-15 21:16 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-10-15 21:15 -------
Fixed in GCC 4.0.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14667
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/14667] [4.0 Regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
2004-03-21 10:19 [Bug c++/14667] New: ICE in cp_parser_parse_and_diagnose_invalid_type_name wanderer at rsu dot ru
` (9 preceding siblings ...)
2004-10-15 21:16 ` mmitchel at gcc dot gnu dot org
@ 2004-10-15 21:18 ` cvs-commit at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-10-15 21:18 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-10-15 21:18 -------
Subject: Bug 14667
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: mmitchel@gcc.gnu.org 2004-10-15 21:18:08
Modified files:
gcc/cp : ChangeLog
gcc/testsuite : ChangeLog
gcc/testsuite/g++.dg/parse: pragma1.C
Log message:
PR c++/17042
* decl.c (declare_global_var): Use the return value from pushdecl.
PR c++/14667
* parser.c (cp_parser_simple_declaration): Do not diagnose invalid
type names if we have already found a valid type.
(cp_parser_member_declaration): Likewise.
PR c++/17852
* parser.c (cp_parser_member_specification_opt): Handle
CPP_PRAGMA.
PR c++/17042
* g++.dg/init/dso_handle1.C: New test.
PR c++/17852
* g++.dg/parse/pragma1.C: New test.
PR c++/14667
* g++.dg/parse/typedef6.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4438&r2=1.4439
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4460&r2=1.4461
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/pragma1.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14667
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2004-10-15 21:18 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-21 10:19 [Bug c++/14667] New: ICE in cp_parser_parse_and_diagnose_invalid_type_name wanderer at rsu dot ru
2004-03-21 15:44 ` [Bug c++/14667] [3.4?/3.5 Regression] " pinskia at gcc dot gnu dot org
2004-03-21 15:51 ` wanderer at rsu dot ru
2004-03-23 1:31 ` [Bug c++/14667] [3.5 " giovannibajo at libero dot it
2004-03-23 3:26 ` bangerth at dealii dot org
2004-09-14 20:10 ` [Bug c++/14667] [4.0 " reichelt at gcc dot gnu dot org
2004-09-14 20:18 ` reichelt at gcc dot gnu dot org
2004-10-13 13:44 ` pinskia at gcc dot gnu dot org
2004-10-15 4:41 ` mmitchel at gcc dot gnu dot org
2004-10-15 21:12 ` cvs-commit at gcc dot gnu dot org
2004-10-15 21:16 ` mmitchel at gcc dot gnu dot org
2004-10-15 21:18 ` cvs-commit at gcc dot gnu dot org
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).