public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14283] New: [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
@ 2004-02-25  1:37 reichelt at gcc dot gnu dot org
  2004-02-25  1:38 ` [Bug c++/14283] " reichelt at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-02-25  1:37 UTC (permalink / raw)
  To: gcc-bugs

The following valid code snippet is causing trouble:

=========================================
struct A
{
    template <typename> struct B {};
};

template <typename> struct C
{
    typedef A::template B<void> X;
};
=========================================

It gave an ICE with 2.95.x - 3.3.x.
With the new parser in the 3.4 branch we only got a rejects-valid.
But with Giovanni's patch for PR 14008

http://gcc.gnu.org/ml/gcc-patches/2004-02/msg00361.html

we get an ICE on mainline again:

PR.cc:8: internal compiler error: in
cp_parser_parse_and_diagnose_invalid_type_name, at cp/parser.c:2050

Giovanni, could you please have a look (although you are not responsible for
the fact that gcc never got this right).

-- 
           Summary: [3.5 regression] ICE in
                    cp_parser_parse_and_diagnose_invalid_type_name
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,giovannibajo at libero
                    dot it


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


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

* [Bug c++/14283] [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
  2004-02-25  1:37 [Bug c++/14283] New: [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name reichelt at gcc dot gnu dot org
@ 2004-02-25  1:38 ` reichelt at gcc dot gnu dot org
  2004-02-25  2:33 ` pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-02-25  1:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-02-25 01:38 -------
Kriang, this is related to PR 11715 (which is assigned to you).
Maybe you want to have a look at this PR, too.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lerdsuwa at gcc dot gnu dot
                   |                            |org


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


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

* [Bug c++/14283] [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
  2004-02-25  1:37 [Bug c++/14283] New: [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name reichelt at gcc dot gnu dot org
  2004-02-25  1:38 ` [Bug c++/14283] " reichelt at gcc dot gnu dot org
@ 2004-02-25  2:33 ` pinskia at gcc dot gnu dot org
  2004-02-25  2:38 ` giovannibajo at libero dot it
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-25  2:33 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.5.0


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


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

* [Bug c++/14283] [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
  2004-02-25  1:37 [Bug c++/14283] New: [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name reichelt at gcc dot gnu dot org
  2004-02-25  1:38 ` [Bug c++/14283] " reichelt at gcc dot gnu dot org
  2004-02-25  2:33 ` pinskia at gcc dot gnu dot org
@ 2004-02-25  2:38 ` giovannibajo at libero dot it
  2004-02-25  2:38 ` giovannibajo at libero dot it
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: giovannibajo at libero dot it @ 2004-02-25  2:38 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.5.0


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


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

* [Bug c++/14283] [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
  2004-02-25  1:37 [Bug c++/14283] New: [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-02-25  2:38 ` giovannibajo at libero dot it
@ 2004-02-25  2:38 ` giovannibajo at libero dot it
  2004-02-26 17:39 ` giovannibajo at libero dot it
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: giovannibajo at libero dot it @ 2004-02-25  2:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-02-25 02:38 -------
Well, basically I can see an ICE on invalid with this:

-----------------------------
struct A {};

template <typename> struct C
{
    typedef A::template INVALID<void> X;
};
-----------------------------

The ice-on-valid would disappear if the underlying rejects-valid were fixed.

I keep forgetting that a TEMPLATE_ID_EXPR is just a syntactic tree. Caused by 
my patch, I'll fix this as soon as I am done with the 3.4 regressions.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |giovannibajo at libero dot
                   |dot org                     |it
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-invalid-code
      Known to fail|                            |3.5.0
      Known to work|                            |3.4.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-02-25 02:38:09
               date|                            |
   Target Milestone|3.5.0                       |---


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


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

* [Bug c++/14283] [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
  2004-02-25  1:37 [Bug c++/14283] New: [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-02-25  2:38 ` giovannibajo at libero dot it
@ 2004-02-26 17:39 ` giovannibajo at libero dot it
  2004-03-19 12:25 ` reichelt at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: giovannibajo at libero dot it @ 2004-02-26 17:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-02-26 17:39 -------
Patch posted:
http://gcc.gnu.org/ml/gcc-patches/2004-02/msg02500.html

-- 


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


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

* [Bug c++/14283] [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
  2004-02-25  1:37 [Bug c++/14283] New: [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-02-26 17:39 ` giovannibajo at libero dot it
@ 2004-03-19 12:25 ` reichelt at gcc dot gnu dot org
  2004-03-19 14:42 ` giovannibajo at libero dot it
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-03-19 12:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-03-19 12:25 -------
With Mark's patch

http://gcc.gnu.org/ml/gcc-cvs/2004-03/msg00865.html

the ice-on-valid is gone now.
In fact the code is accepted now in 3.4.0 and 3.5.0!
The ice-on-invalid in 3.5.0 is also gone with this patch,
we get an error message now.

Giovanni, what are you going to do with your patch?
It's not needed to fix this bug. Is it obsoleted altogether or
is it still useful for different cases?

I'll keep the report open until a decision is reached.


-- 


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


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

* [Bug c++/14283] [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
  2004-02-25  1:37 [Bug c++/14283] New: [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name reichelt at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-03-19 12:25 ` reichelt at gcc dot gnu dot org
@ 2004-03-19 14:42 ` giovannibajo at libero dot it
  2004-03-19 15:52 ` reichelt at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: giovannibajo at libero dot it @ 2004-03-19 14:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-03-19 14:42 -------
Well, Mark's patch to cp_parser_template_name is something I had in my tree 
already in a very similar fashion and was the first step towards fixing this 
bug and getting decent error messages. I'm glad it's been done in 3.4.0.

I reckon my patch is still an improvement in diagnostic for the testcase in 
comment #2 that can go to 3.5.0. What's the current diagnostic for this? The 
diagnostic we get with my patch is reported in the mail.

Mark, can you have a quick look at my patch? Even if it's not a 3.4 regression, 
it's something I'd rather have in mainline.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mmitchel at gcc dot gnu dot
                   |                            |org


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


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

* [Bug c++/14283] [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
  2004-02-25  1:37 [Bug c++/14283] New: [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name reichelt at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2004-03-19 14:42 ` giovannibajo at libero dot it
@ 2004-03-19 15:52 ` reichelt at gcc dot gnu dot org
  2004-03-19 16:30 ` mark at codesourcery dot com
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-03-19 15:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-03-19 15:52 -------
In 3.4.0 and mainline we get the message

x.cc:5: error: type `A' is not derived from type `C< <template-parameter-1-1> >'
x.cc:5: error: ISO C++ forbids declaration of `INVALID' with no type
x.cc:5: error: expected `;' before '<' token

for the testcase in comment #2.
So your patch should be an improvement, Giovanni.


-- 


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


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

* [Bug c++/14283] [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
  2004-02-25  1:37 [Bug c++/14283] New: [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name reichelt at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2004-03-19 15:52 ` reichelt at gcc dot gnu dot org
@ 2004-03-19 16:30 ` mark at codesourcery dot com
  2004-03-20 12:03 ` wanderer at rsu dot ru
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mark at codesourcery dot com @ 2004-03-19 16:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mark at codesourcery dot com  2004-03-19 16:30 -------
Subject: Re:  [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name

reichelt at gcc dot gnu dot org wrote:

>------- Additional Comments From reichelt at gcc dot gnu dot org  2004-03-19 15:52 -------
>In 3.4.0 and mainline we get the message
>
>x.cc:5: error: type `A' is not derived from type `C< <template-parameter-1-1> >'
>x.cc:5: error: ISO C++ forbids declaration of `INVALID' with no type
>x.cc:5: error: expected `;' before '<' token
>
>for the testcase in comment #2.
>So your patch should be an improvement, Giovanni.
>
>  
>
We don't need this for 3.4.0, and I'm not reviewing 3.5 patches at the 
moment, due to focusing on 3.4.  So, ping me about this after 3.4.0 is 
out, or talk to Jason.



-- 


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


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

* [Bug c++/14283] [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
  2004-02-25  1:37 [Bug c++/14283] New: [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name reichelt at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2004-03-19 16:30 ` mark at codesourcery dot com
@ 2004-03-20 12:03 ` wanderer at rsu dot ru
  2004-03-21  0:47 ` giovannibajo at libero dot it
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: wanderer at rsu dot ru @ 2004-03-20 12:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From wanderer at rsu dot ru  2004-03-20 12:03 -------
With current mainline GCC (gcc version 3.5.0 20040319) i have same error 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---------------------


-- 


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


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

* [Bug c++/14283] [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
  2004-02-25  1:37 [Bug c++/14283] New: [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name reichelt at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2004-03-20 12:03 ` wanderer at rsu dot ru
@ 2004-03-21  0:47 ` giovannibajo at libero dot it
  2004-03-21 10:19 ` wanderer at rsu dot ru
  2004-05-04 17:27 ` [Bug c++/14283] Diagnostic for invalid template-id could be improved giovannibajo at libero dot it
  12 siblings, 0 replies; 14+ messages in thread
From: giovannibajo at libero dot it @ 2004-03-21  0:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-03-21 00:47 -------
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.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wanderer at rsu dot ru


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


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

* [Bug c++/14283] [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
  2004-02-25  1:37 [Bug c++/14283] New: [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name reichelt at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2004-03-21  0:47 ` giovannibajo at libero dot it
@ 2004-03-21 10:19 ` wanderer at rsu dot ru
  2004-05-04 17:27 ` [Bug c++/14283] Diagnostic for invalid template-id could be improved giovannibajo at libero dot it
  12 siblings, 0 replies; 14+ messages in thread
From: wanderer at rsu dot ru @ 2004-03-21 10:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From wanderer at rsu dot ru  2004-03-21 10:19 -------
OK.
Bug 14667 Submitted.

-- 


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


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

* [Bug c++/14283] Diagnostic for invalid template-id could be improved
  2004-02-25  1:37 [Bug c++/14283] New: [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name reichelt at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2004-03-21 10:19 ` wanderer at rsu dot ru
@ 2004-05-04 17:27 ` giovannibajo at libero dot it
  12 siblings, 0 replies; 14+ messages in thread
From: giovannibajo at libero dot it @ 2004-05-04 17:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-05-04 17:27 -------
My patch does not work anymore after Mark's fix. I'm also retargeting this bug 
as a diagnostic enhancement. I'll be working on this.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
           Keywords|ice-on-invalid-code, ice-on-|diagnostic
                   |valid-code, patch           |
      Known to fail|3.5.0                       |3.5.0 3.4.0
      Known to work|3.4.0                       |
            Summary|[3.5 regression] ICE in     |Diagnostic for invalid
                   |cp_parser_parse_and_diagnose|template-id could be
                   |_invalid_type_name          |improved
   Target Milestone|3.5.0                       |---


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


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

end of thread, other threads:[~2004-05-04 17:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-25  1:37 [Bug c++/14283] New: [3.5 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name reichelt at gcc dot gnu dot org
2004-02-25  1:38 ` [Bug c++/14283] " reichelt at gcc dot gnu dot org
2004-02-25  2:33 ` pinskia at gcc dot gnu dot org
2004-02-25  2:38 ` giovannibajo at libero dot it
2004-02-25  2:38 ` giovannibajo at libero dot it
2004-02-26 17:39 ` giovannibajo at libero dot it
2004-03-19 12:25 ` reichelt at gcc dot gnu dot org
2004-03-19 14:42 ` giovannibajo at libero dot it
2004-03-19 15:52 ` reichelt at gcc dot gnu dot org
2004-03-19 16:30 ` mark at codesourcery dot com
2004-03-20 12:03 ` wanderer at rsu dot ru
2004-03-21  0:47 ` giovannibajo at libero dot it
2004-03-21 10:19 ` wanderer at rsu dot ru
2004-05-04 17:27 ` [Bug c++/14283] Diagnostic for invalid template-id could be improved 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).