public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108438] New: [10/11/12/13 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611
@ 2023-01-17 17:53 gscfq@t-online.de
  2023-01-17 21:00 ` [Bug c++/108438] " mpolacek at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gscfq@t-online.de @ 2023-01-17 17:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108438
           Summary: [10/11/12/13 Regression] ICE in
                    cxx_eval_constant_expression, at cp/constexpr.cc:7611
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Started with r6 and -Wall :


$ cat z1.cc
template <typename T>
T foo (T arg, T& ref, T* ptr)
{
  int a = 1;
  return static_cast<T!>(a);
}


$ g++-13-20230115 -c z1.cc -Wall
z1.cc: In function 'T foo(T, T&, T*)':
z1.cc:5:23: error: expected '>' before '!' token
    5 |   return static_cast<T!>(a);
      |                       ^
z1.cc:5:23: error: expected '(' before '!' token
    5 |   return static_cast<T!>(a);
      |                       ^
      |                       (
z1.cc:5:24: error: expected primary-expression before '>' token
    5 |   return static_cast<T!>(a);
      |                        ^
z1.cc:5:27: internal compiler error: in cxx_eval_constant_expression, at
cp/constexpr.cc:7611
    5 |   return static_cast<T!>(a);
      |                           ^
0x883b61 cxx_eval_constant_expression
        ../../gcc/cp/constexpr.cc:7611
0x88c97a cxx_eval_outermost_constant_expr
        ../../gcc/cp/constexpr.cc:8252
0x891e42 maybe_constant_value(tree_node*, tree_node*, bool)
        ../../gcc/cp/constexpr.cc:8527
0xa11806 cp_parser_binary_expression
        ../../gcc/cp/parser.cc:10233
0xa11da4 cp_parser_assignment_expression
        ../../gcc/cp/parser.cc:10444
0xa14362 cp_parser_expression
        ../../gcc/cp/parser.cc:10614
0xa2b843 cp_parser_postfix_expression
        ../../gcc/cp/parser.cc:7356
0xa44ddf cp_parser_unary_expression
        ../../gcc/cp/parser.cc:9095
0xa106ef cp_parser_cast_expression
        ../../gcc/cp/parser.cc:9999
0xa1101f cp_parser_binary_expression
        ../../gcc/cp/parser.cc:10101
0xa11da4 cp_parser_assignment_expression
        ../../gcc/cp/parser.cc:10444
0xa14362 cp_parser_expression
        ../../gcc/cp/parser.cc:10614
0xa27806 cp_parser_jump_statement
        ../../gcc/cp/parser.cc:14359
0xa27806 cp_parser_statement
        ../../gcc/cp/parser.cc:12335
0xa27de4 cp_parser_statement_seq_opt
        ../../gcc/cp/parser.cc:12909
0xa27ec7 cp_parser_compound_statement
        ../../gcc/cp/parser.cc:12861
0xa51d90 cp_parser_function_body
        ../../gcc/cp/parser.cc:25280
0xa51d90 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/cp/parser.cc:25331
0xa5240a cp_parser_function_definition_after_declarator
        ../../gcc/cp/parser.cc:31953
0xa5393c cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/cp/parser.cc:31870

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

* [Bug c++/108438] [10/11/12/13 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611
  2023-01-17 17:53 [Bug c++/108438] New: [10/11/12/13 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611 gscfq@t-online.de
@ 2023-01-17 21:00 ` mpolacek at gcc dot gnu.org
  2023-01-18  9:00 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-01-17 21:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-01-17
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

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

* [Bug c++/108438] [10/11/12/13 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611
  2023-01-17 17:53 [Bug c++/108438] New: [10/11/12/13 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611 gscfq@t-online.de
  2023-01-17 21:00 ` [Bug c++/108438] " mpolacek at gcc dot gnu.org
@ 2023-01-18  9:00 ` rguenth at gcc dot gnu.org
  2023-07-07 10:44 ` [Bug c++/108438] [11/12/13/14 " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-18  9:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.5
           Keywords|                            |error-recovery
           Priority|P3                          |P4

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

* [Bug c++/108438] [11/12/13/14 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611
  2023-01-17 17:53 [Bug c++/108438] New: [10/11/12/13 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611 gscfq@t-online.de
  2023-01-17 21:00 ` [Bug c++/108438] " mpolacek at gcc dot gnu.org
  2023-01-18  9:00 ` rguenth at gcc dot gnu.org
@ 2023-07-07 10:44 ` rguenth at gcc dot gnu.org
  2024-06-07  9:05 ` [Bug c++/108438] [11/12/13/14/15 " simartin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.5

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

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

* [Bug c++/108438] [11/12/13/14/15 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611
  2023-01-17 17:53 [Bug c++/108438] New: [10/11/12/13 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2023-07-07 10:44 ` [Bug c++/108438] [11/12/13/14 " rguenth at gcc dot gnu.org
@ 2024-06-07  9:05 ` simartin at gcc dot gnu.org
  2024-06-08 11:13 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: simartin at gcc dot gnu.org @ 2024-06-07  9:05 UTC (permalink / raw)
  To: gcc-bugs

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

Simon Martin <simartin at gcc dot gnu.org> changed:

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

--- Comment #2 from Simon Martin <simartin at gcc dot gnu.org> ---
Working on it

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

* [Bug c++/108438] [11/12/13/14/15 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611
  2023-01-17 17:53 [Bug c++/108438] New: [10/11/12/13 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2024-06-07  9:05 ` [Bug c++/108438] [11/12/13/14/15 " simartin at gcc dot gnu.org
@ 2024-06-08 11:13 ` cvs-commit at gcc dot gnu.org
  2024-06-08 11:15 ` simartin at gcc dot gnu.org
  2024-06-08 14:53 ` sjames at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-08 11:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Simon Martin <simartin@gcc.gnu.org>:

https://gcc.gnu.org/g:2c9643c27ecddb7f597d34009d89e932b4aca58e

commit r15-1114-g2c9643c27ecddb7f597d34009d89e932b4aca58e
Author: Simon Martin <simon@nasilyan.com>
Date:   Fri Jun 7 11:21:07 2024 +0200

    c++: Make *_cast<*> parsing more robust to errors [PR108438]

    We ICE upon the following when trying to emit a -Wlogical-not-parentheses
    warning:

    === cut here ===
    template <typename T> T foo (T arg, T& ref, T* ptr) {
      int a = 1;
      return static_cast<T!>(a);
    }
    === cut here ===

    This patch makes *_cast<*> parsing more robust by skipping to the closing
'>'
    upon error in the target type.

    Successfully tested on x86_64-pc-linux-gnu.

            PR c++/108438

    gcc/cp/ChangeLog:

            * parser.cc (cp_parser_postfix_expression): Use
            cp_parser_require_end_of_template_parameter_list to skip to the
closing
            '>' upon error parsing the target type of *_cast<*> expressions.

    gcc/testsuite/ChangeLog:

            * g++.dg/parse/crash75.C: New test.

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

* [Bug c++/108438] [11/12/13/14/15 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611
  2023-01-17 17:53 [Bug c++/108438] New: [10/11/12/13 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2024-06-08 11:13 ` cvs-commit at gcc dot gnu.org
@ 2024-06-08 11:15 ` simartin at gcc dot gnu.org
  2024-06-08 14:53 ` sjames at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: simartin at gcc dot gnu.org @ 2024-06-08 11:15 UTC (permalink / raw)
  To: gcc-bugs

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

Simon Martin <simartin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|11.5                        |14.2
             Status|ASSIGNED                    |RESOLVED

--- Comment #4 from Simon Martin <simartin at gcc dot gnu.org> ---
Fixed on trunk

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

* [Bug c++/108438] [11/12/13/14/15 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611
  2023-01-17 17:53 [Bug c++/108438] New: [10/11/12/13 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2024-06-08 11:15 ` simartin at gcc dot gnu.org
@ 2024-06-08 14:53 ` sjames at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-06-08 14:53 UTC (permalink / raw)
  To: gcc-bugs

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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|14.2                        |15.0
                 CC|                            |sjames at gcc dot gnu.org

--- Comment #5 from Sam James <sjames at gcc dot gnu.org> ---
The milestone would be 15.0 if there's no plan to backport it.

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

end of thread, other threads:[~2024-06-08 14:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-17 17:53 [Bug c++/108438] New: [10/11/12/13 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611 gscfq@t-online.de
2023-01-17 21:00 ` [Bug c++/108438] " mpolacek at gcc dot gnu.org
2023-01-18  9:00 ` rguenth at gcc dot gnu.org
2023-07-07 10:44 ` [Bug c++/108438] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-06-07  9:05 ` [Bug c++/108438] [11/12/13/14/15 " simartin at gcc dot gnu.org
2024-06-08 11:13 ` cvs-commit at gcc dot gnu.org
2024-06-08 11:15 ` simartin at gcc dot gnu.org
2024-06-08 14:53 ` sjames 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).