public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/112365] New: [14 regression] ICE on invalid C++
@ 2023-11-03  8:15 sjames at gcc dot gnu.org
  2023-11-03  8:33 ` [Bug c++/112365] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-03  8:15 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112365
           Summary: [14 regression] ICE on invalid C++
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

This came from a (bad) reduction from a user downstream for another bug we'll
file shortly.

```
template <typename> struct ResolvedColorType;
         template < typename ColorType > ResolvedColorType< ColorType >
resolvedColor(ColorType;
         template < typename ColorType > struct ResolvedColorType {
  constexpr ResolvedColorType : ColorType {}        }
         struct {                 resolved( {
  resolvedColor(this)
```

```
$ g++-14 /tmp/foo.cxx
/tmp/foo.cxx:2:96: error: expected ‘)’ before ‘;’ token
    2 |          template < typename ColorType > ResolvedColorType< ColorType >
resolvedColor(ColorType;
      |                                                                        
             ~         ^
      |                                                                        
                       )
/tmp/foo.cxx:4:3: error: non-static data member ‘’ declared ‘constexpr’
    4 |   constexpr ResolvedColorType : ColorType {}        }
      |   ^~~~~~~~~
/tmp/foo.cxx:4:44: error: expected ‘;’ at end of member declaration
    4 |   constexpr ResolvedColorType : ColorType {}        }
      |                                            ^
      |                                             ;
/tmp/foo.cxx:4:54: error: expected ‘;’ after struct definition
    4 |   constexpr ResolvedColorType : ColorType {}        }
      |                                                      ^
      |                                                      ;
/tmp/foo.cxx:5:45: error: expected identifier before ‘{’ token
    5 |          struct {                 resolved( {
      |                                             ^
/tmp/foo.cxx:5:44: error: expected ‘)’ before ‘{’ token
    5 |          struct {                 resolved( {
      |                                           ~^~
      |                                            )
/tmp/foo.cxx:5:35: error: ISO C++ forbids declaration of ‘resolved’ with no
type [-fpermissive]
    5 |          struct {                 resolved( {
      |                                   ^~~~~~~~
/tmp/foo.cxx:6:22: error: expected ‘}’ at end of input
    6 |   resolvedColor(this)
      |                      ^
/tmp/foo.cxx:5:17: note: to match this ‘{’
    5 |          struct {                 resolved( {
      |                 ^
/tmp/foo.cxx: In instantiation of ‘struct ResolvedColorType<<unnamed
struct>*>’:
/tmp/foo.cxx:6:16:   required from here
/tmp/foo.cxx:5:17: note:     6 |   resolvedColor(this)
/tmp/foo.cxx:5:17: note:       |   ~~~~~~~~~~~~~^~~~~~
/tmp/foo.cxx:4:44: error: ‘ResolvedColorType< <template-parameter-1-1>
>::<anonymous>’ has incomplete type
    4 |   constexpr ResolvedColorType : ColorType {}        }
      |                                            ^
/tmp/foo.cxx:3:49: note: definition of ‘struct ResolvedColorType<<unnamed
struct>*>’ is not complete until the closing brace
    3 |          template < typename ColorType > struct ResolvedColorType {
      |                                                 ^~~~~~~~~~~~~~~~~
/tmp/foo.cxx:3:49: internal compiler error: in layout_class_type, at
cp/class.cc:6966
0x5643dcc7dd8e layout_class_type(tree_node*, tree_node**) [clone .constprop.0]
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/class.cc:6966
0x5643de537884 finish_struct_1(tree_node*)
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/class.cc:7601
0x5643de854da8 instantiate_class_template(tree_node*)
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/pt.cc:12569
0x5643de33ae80 complete_type(tree_node*)
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/typeck.cc:138
0x5643de33ae80 complete_type_or_maybe_complain(tree_node*, tree_node*, int)
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/typeck.cc:151
0x5643de5f3da2 require_complete_type(tree_node*, int)
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/typeck.cc:94
0x5643de5f3da2 build_cxx_call(tree_node*, int, tree_node**, int, tree_node*)
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/call.cc:10941
0x5643de5d8d5c build_over_call
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/call.cc:10426
0x5643de5c10b2 build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/call.cc:5026
0x5643de5bb166 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**,
bool, bool, int)
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/semantics.cc:2981
0x5643de4ddb17 cp_parser_postfix_expression
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/parser.cc:8084
0x5643de4d9a39 cp_parser_binary_expression
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/parser.cc:10229
0x5643de4d8cd8 cp_parser_assignment_expression
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/parser.cc:10573
0x5643de4decdd cp_parser_expression
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/parser.cc:10740
0x5643de4decdd cp_parser_expression_statement
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/parser.cc:12939
0x5643de4d5671 cp_parser_statement
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/parser.cc:12719
0x5643de4d2015 cp_parser_statement_seq_opt
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/parser.cc:13188
0x5643de4d2015 cp_parser_compound_statement
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/parser.cc:13042
0x5643de4ce999 cp_parser_function_body
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/parser.cc:25560
0x5643de4ce999 cp_parser_ctor_initializer_opt_and_function_body
       
/usr/src/debug/sys-devel/gcc-14.0.0_pre20231029/gcc-14-20231029/gcc/cp/parser.cc:25611
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.
```

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

end of thread, other threads:[~2023-11-16 16:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-03  8:15 [Bug c++/112365] New: [14 regression] ICE on invalid C++ sjames at gcc dot gnu.org
2023-11-03  8:33 ` [Bug c++/112365] " rguenth at gcc dot gnu.org
2023-11-03 14:26 ` [Bug c++/112365] " sjames at gcc dot gnu.org
2023-11-03 14:39 ` [Bug c++/112365] [12/13/14 Regression] " mpolacek at gcc dot gnu.org
2023-11-16 16:43 ` [Bug c++/112365] [12/13/14 Regression] ICE on invalid C++ since r12-3324 cvs-commit at gcc dot gnu.org
2023-11-16 16:44 ` jakub 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).