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

            Bug ID: 104347
           Summary: internal compiler error-  default template arguments -
                    missing angle brackets
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dev at gutoehrlein dot eu
  Target Milestone: ---

Created attachment 52330
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52330&action=edit
code which crashes the compiler

command to compile:
g++ -o test -std=c++20 -O2 test.cpp
-----
Version of g++: 11.2
OS: Ubuntu (Kernel: 5.13.0)
-----
The code contains a missing "<>" in line 327. Line 328 (comment) contains the
correct code. g++ crashes with an internal compiler error instead of displaying
an error message.

Additional info:
* Can be also reproduced on https://godbolt.org/
* The current VS compiler also produces an internal compiler error.
* Clang 13 parses the file and displays the appropriate error message: 
  <source>:327:11: error: alias template 'SISpeed' requires template arguments;
argument deduction only allowed for class templates
-----
<source>: In function 'int main(int, char**)':
<source>:327:19: internal compiler error: Segmentation fault
  327 |   SISpeed v = l / t;
      |                   ^
0x1786229 internal_error(char const*, ...)
        ???:0
0x7d2840 template_parms_to_args(tree_node*)
        ???:0
0x7d68ed do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
        ???:0
0x7002b6 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ???:0
0x7c47db c_parse_file()
        ???:0
0x896762 c_common_parse_file()
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1

Reply via email to