public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104347] New: internal compiler error-  default template arguments - missing angle brackets
@ 2022-02-02 17:08 dev at gutoehrlein dot eu
  2022-02-02 21:44 ` [Bug c++/104347] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dev at gutoehrlein dot eu @ 2022-02-02 17:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

* [Bug c++/104347] internal compiler error-  default template arguments - missing angle brackets
  2022-02-02 17:08 [Bug c++/104347] New: internal compiler error- default template arguments - missing angle brackets dev at gutoehrlein dot eu
@ 2022-02-02 21:44 ` pinskia at gcc dot gnu.org
  2022-02-02 21:47 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-02 21:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So the trunk, GCC is able to compile this.
clang gives the following error though:
<source>:328:11: error: alias template 'SISpeed' requires template arguments;
argument deduction only allowed for class templates

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

* [Bug c++/104347] internal compiler error-  default template arguments - missing angle brackets
  2022-02-02 17:08 [Bug c++/104347] New: internal compiler error- default template arguments - missing angle brackets dev at gutoehrlein dot eu
  2022-02-02 21:44 ` [Bug c++/104347] " pinskia at gcc dot gnu.org
@ 2022-02-02 21:47 ` pinskia at gcc dot gnu.org
  2022-02-03  9:07 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-02 21:47 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |needs-bisection
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=103852

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
But see PR 103852 (and CWG1286) of why this is still valid code.

So just need to find out which patch fixed the ICE then.

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

* [Bug c++/104347] internal compiler error-  default template arguments - missing angle brackets
  2022-02-02 17:08 [Bug c++/104347] New: internal compiler error- default template arguments - missing angle brackets dev at gutoehrlein dot eu
  2022-02-02 21:44 ` [Bug c++/104347] " pinskia at gcc dot gnu.org
  2022-02-02 21:47 ` pinskia at gcc dot gnu.org
@ 2022-02-03  9:07 ` marxin at gcc dot gnu.org
  2022-02-03  9:17 ` pinskia at gcc dot gnu.org
  2022-02-03  9:19 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-02-03  9:07 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=102479
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed on master with r12-3906-g51018dd1395c72b3.

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

* [Bug c++/104347] internal compiler error-  default template arguments - missing angle brackets
  2022-02-02 17:08 [Bug c++/104347] New: internal compiler error- default template arguments - missing angle brackets dev at gutoehrlein dot eu
                   ` (2 preceding siblings ...)
  2022-02-03  9:07 ` marxin at gcc dot gnu.org
@ 2022-02-03  9:17 ` pinskia at gcc dot gnu.org
  2022-02-03  9:19 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-03  9:17 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is an exact dup of bug 102479.
See bug 102479 comment #2 about the alias part.
So yes this is valid code.

*** This bug has been marked as a duplicate of bug 102479 ***

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

* [Bug c++/104347] internal compiler error-  default template arguments - missing angle brackets
  2022-02-02 17:08 [Bug c++/104347] New: internal compiler error- default template arguments - missing angle brackets dev at gutoehrlein dot eu
                   ` (3 preceding siblings ...)
  2022-02-03  9:17 ` pinskia at gcc dot gnu.org
@ 2022-02-03  9:19 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-03  9:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Oh clang does not implement alias deduction even in C++20 mode. So yes this is
still valid C++20.

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

end of thread, other threads:[~2022-02-03  9:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-02 17:08 [Bug c++/104347] New: internal compiler error- default template arguments - missing angle brackets dev at gutoehrlein dot eu
2022-02-02 21:44 ` [Bug c++/104347] " pinskia at gcc dot gnu.org
2022-02-02 21:47 ` pinskia at gcc dot gnu.org
2022-02-03  9:07 ` marxin at gcc dot gnu.org
2022-02-03  9:17 ` pinskia at gcc dot gnu.org
2022-02-03  9:19 ` pinskia 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).