]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: ICE with unnamed tparm and concept [PR103408]
authorMarek Polacek <polacek@redhat.com>
Tue, 30 Nov 2021 21:43:19 +0000 (16:43 -0500)
committerMarek Polacek <polacek@redhat.com>
Thu, 2 Dec 2021 13:11:39 +0000 (08:11 -0500)
commit6f43a8a08053a871e785e2ebc80383e0849efb6f
treec59b0a23922889efa133143f68a4d46ba1b0ae61
parent06b8cdc8d7339ac44802044ef148dd86874333d8
c++: ICE with unnamed tparm and concept [PR103408]

Here we crash when issuing the "constraint C has type T, not bool"
error, because pp_cxx_parameter_mapping wasn't prepared to see an
anonymous template parameter.  With this patch we print

error: constraint 'auto(<lambda>) [with <unnamed> = 0]' has type '<lambda()>', not 'bool'

The "<unnamed>" is what this patch adds.

PR c++/103408

gcc/cp/ChangeLog:

* cxx-pretty-print.c (pp_cxx_parameter_mapping): Print "<unnamed>"
rather than crash on an unnamed template parameter.

gcc/testsuite/ChangeLog:

* g++.dg/cpp23/concepts-err1.C: New test.
gcc/cp/cxx-pretty-print.c
gcc/testsuite/g++.dg/cpp23/concepts-err1.C [new file with mode: 0644]