public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/64127] New: [5.0 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980
@ 2014-11-30 19:29 dimhen at gmail dot com
  2014-12-01  9:30 ` [Bug c++/64127] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: dimhen at gmail dot com @ 2014-11-30 19:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64127

            Bug ID: 64127
           Summary: [5.0 regression] ICE on invalid: tree check: expected
                    identifier_node, have template_id_expr in
                    cp_parser_diagnose_invalid_type_name, at
                    cp/parser.c:2980
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dimhen at gmail dot com

r214134 PASS
r214718 FAIL
r218182 FAIL

$ cat x.ii
template <0> int __copy_streambufs_eof;
__copy_streambufs_eof <
$ ~/bin/gcc_214718/bin/g++ -fpreprocessed -c x.ii
x.ii:1:11: error: expected identifier before numeric constant
 template <0> int __copy_streambufs_eof;
           ^
x.ii:1:11: error: expected '>' before numeric constant
x.ii:1:18: warning: variable templates only available with -std=c++14 or
-std=gnu++14
 template <0> int __copy_streambufs_eof;
                  ^
x.ii:2:1: error: parse error in template argument list
 __copy_streambufs_eof <
 ^
x.ii:2:1: error: '__copy_streambufs_eof<<expression error> >' does not name a
type
x.ii:2:1: internal compiler error: tree check: expected identifier_node, have
template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2932
0xea6824 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
    /home/dimhen/src/gcc_current/gcc/tree.c:9149
0x6789a0 tree_check(tree_node*, char const*, int, char const*, tree_code)
    /home/dimhen/src/gcc_current/gcc/tree.h:2729
0x6789a0 cp_parser_diagnose_invalid_type_name
    /home/dimhen/src/gcc_current/gcc/cp/parser.c:2932
0x699cbf cp_parser_parse_and_diagnose_invalid_type_name
    /home/dimhen/src/gcc_current/gcc/cp/parser.c:3059
0x6a10e7 cp_parser_simple_declaration
    /home/dimhen/src/gcc_current/gcc/cp/parser.c:11359
0x684a93 cp_parser_block_declaration
    /home/dimhen/src/gcc_current/gcc/cp/parser.c:11287
0x6ab465 cp_parser_declaration
    /home/dimhen/src/gcc_current/gcc/cp/parser.c:11184
0x6aa118 cp_parser_declaration_seq_opt
    /home/dimhen/src/gcc_current/gcc/cp/parser.c:11070
0x6ab9b3 cp_parser_translation_unit
    /home/dimhen/src/gcc_current/gcc/cp/parser.c:4053
0x6ab9b3 c_parse_file()
    /home/dimhen/src/gcc_current/gcc/cp/parser.c:31935
0x7d6552 c_common_parse_file()
    /home/dimhen/src/gcc_current/gcc/c-family/c-opts.c:1122
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ ~/bin/gcc_214718/bin/g++ -v                    
Using built-in specs.
COLLECT_GCC=/home/dimhen/bin/gcc_214718/bin/g++
COLLECT_LTO_WRAPPER=/home/dimhen/bin/gcc_214718/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/usr/local/gcc_current/ --enable-checking=yes,df,rtl,tree,fold
--enable-languages=c,c++,lto --enable-plugin=yes --enable-static
Thread model: posix
gcc version 5.0.0 20140829 (experimental) [trunk revision 214718] (GCC)


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

* [Bug c++/64127] [5.0 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980
  2014-11-30 19:29 [Bug c++/64127] New: [5.0 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980 dimhen at gmail dot com
@ 2014-12-01  9:30 ` rguenth at gcc dot gnu.org
  2014-12-03  9:51 ` [Bug c++/64127] [5 " mpolacek at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-12-01  9:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64127

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |5.0


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

* [Bug c++/64127] [5 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980
  2014-11-30 19:29 [Bug c++/64127] New: [5.0 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980 dimhen at gmail dot com
  2014-12-01  9:30 ` [Bug c++/64127] " rguenth at gcc dot gnu.org
@ 2014-12-03  9:51 ` mpolacek at gcc dot gnu.org
  2014-12-03 11:56 ` ktietz at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-12-03  9:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64127

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-12-03
                 CC|                            |mpolacek at gcc dot gnu.org
            Summary|[5.0 regression] ICE on     |[5 regression] ICE on
                   |invalid: tree check:        |invalid: tree check:
                   |expected identifier_node,   |expected identifier_node,
                   |have template_id_expr in    |have template_id_expr in
                   |cp_parser_diagnose_invalid_ |cp_parser_diagnose_invalid_
                   |type_name, at               |type_name, at
                   |cp/parser.c:2980            |cp/parser.c:2980
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.  Does not ice with -std=c++11.


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

* [Bug c++/64127] [5 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980
  2014-11-30 19:29 [Bug c++/64127] New: [5.0 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980 dimhen at gmail dot com
  2014-12-01  9:30 ` [Bug c++/64127] " rguenth at gcc dot gnu.org
  2014-12-03  9:51 ` [Bug c++/64127] [5 " mpolacek at gcc dot gnu.org
@ 2014-12-03 11:56 ` ktietz at gcc dot gnu.org
  2014-12-03 16:19 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ktietz at gcc dot gnu.org @ 2014-12-03 11:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64127

Kai Tietz <ktietz at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktietz at gcc dot gnu.org

--- Comment #2 from Kai Tietz <ktietz at gcc dot gnu.org> ---
Nor does it with c++14.

Issue is that for -std=c++98 the tree isn't a template_decl.  Instead it is a
template_id_expr.

See parser.c:cp_parser_diagnose_invalid_type_name

...
else if (cxx_dialect < cxx11
         && !strcmp (IDENTIFIER_POINTER (id), "thread_local"))
...

By adding to this check '&& DECL_P (id)' fixes the ICE.

Index: parser.c
===================================================================
--- parser.c    (Revision 218142)
+++ parser.c    (Arbeitskopie)
@@ -2977,6 +2977,7 @@ cp_parser_diagnose_invalid_type_name (cp_parser *p
        inform (location, "C++11 %<noexcept%> only available with "
                "-std=c++11 or -std=gnu++11");
       else if (cxx_dialect < cxx11
+              && DECL_P (id)
               && !strcmp (IDENTIFIER_POINTER (id), "thread_local"))
        inform (location, "C++11 %<thread_local%> only available with "
                "-std=c++11 or -std=gnu++11");


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

* [Bug c++/64127] [5 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980
  2014-11-30 19:29 [Bug c++/64127] New: [5.0 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980 dimhen at gmail dot com
                   ` (2 preceding siblings ...)
  2014-12-03 11:56 ` ktietz at gcc dot gnu.org
@ 2014-12-03 16:19 ` jakub at gcc dot gnu.org
  2014-12-09 17:55 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-03 16:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64127

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r214396.


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

* [Bug c++/64127] [5 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980
  2014-11-30 19:29 [Bug c++/64127] New: [5.0 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980 dimhen at gmail dot com
                   ` (3 preceding siblings ...)
  2014-12-03 16:19 ` jakub at gcc dot gnu.org
@ 2014-12-09 17:55 ` jason at gcc dot gnu.org
  2014-12-10 11:29 ` ktietz at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2014-12-09 17:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64127

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |jason at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |ktietz at gcc dot gnu.org

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
I approved Kai's patch last week.


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

* [Bug c++/64127] [5 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980
  2014-11-30 19:29 [Bug c++/64127] New: [5.0 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980 dimhen at gmail dot com
                   ` (4 preceding siblings ...)
  2014-12-09 17:55 ` jason at gcc dot gnu.org
@ 2014-12-10 11:29 ` ktietz at gcc dot gnu.org
  2014-12-10 11:32 ` ktietz at gcc dot gnu.org
  2014-12-10 11:36 ` ktietz at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: ktietz at gcc dot gnu.org @ 2014-12-10 11:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64127

--- Comment #5 from Kai Tietz <ktietz at gcc dot gnu.org> ---
Author: ktietz
Date: Wed Dec 10 11:29:22 2014
New Revision: 218573

URL: https://gcc.gnu.org/viewcvs?rev=218573&root=gcc&view=rev
Log:
    PR c++/64127
    * parser.c (cp_parser_diagnose_invalid_type_name): Check id
    for being an identifier before accessing it.


Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c


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

* [Bug c++/64127] [5 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980
  2014-11-30 19:29 [Bug c++/64127] New: [5.0 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980 dimhen at gmail dot com
                   ` (5 preceding siblings ...)
  2014-12-10 11:29 ` ktietz at gcc dot gnu.org
@ 2014-12-10 11:32 ` ktietz at gcc dot gnu.org
  2014-12-10 11:36 ` ktietz at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: ktietz at gcc dot gnu.org @ 2014-12-10 11:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64127

--- Comment #6 from Kai Tietz <ktietz at gcc dot gnu.org> ---
Author: ktietz
Date: Wed Dec 10 11:32:00 2014
New Revision: 218574

URL: https://gcc.gnu.org/viewcvs?rev=218574&root=gcc&view=rev
Log:
    PR c++/64127
    * g++.dg/cpp/pr64127.C: New file.


Added:
    trunk/gcc/testsuite/g++.dg/cpp/pr64127.C
Modified:
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/64127] [5 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980
  2014-11-30 19:29 [Bug c++/64127] New: [5.0 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980 dimhen at gmail dot com
                   ` (6 preceding siblings ...)
  2014-12-10 11:32 ` ktietz at gcc dot gnu.org
@ 2014-12-10 11:36 ` ktietz at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: ktietz at gcc dot gnu.org @ 2014-12-10 11:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64127

Kai Tietz <ktietz at gcc dot gnu.org> changed:

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

--- Comment #7 from Kai Tietz <ktietz at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2014-12-10 11:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-30 19:29 [Bug c++/64127] New: [5.0 regression] ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980 dimhen at gmail dot com
2014-12-01  9:30 ` [Bug c++/64127] " rguenth at gcc dot gnu.org
2014-12-03  9:51 ` [Bug c++/64127] [5 " mpolacek at gcc dot gnu.org
2014-12-03 11:56 ` ktietz at gcc dot gnu.org
2014-12-03 16:19 ` jakub at gcc dot gnu.org
2014-12-09 17:55 ` jason at gcc dot gnu.org
2014-12-10 11:29 ` ktietz at gcc dot gnu.org
2014-12-10 11:32 ` ktietz at gcc dot gnu.org
2014-12-10 11:36 ` ktietz at gcc dot gnu.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).