]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: non-dep decltype folding of concept-id C<Ts...> [PR123676]
authorPatrick Palka <ppalka@redhat.com>
Tue, 27 Jan 2026 03:00:16 +0000 (22:00 -0500)
committerPatrick Palka <ppalka@redhat.com>
Tue, 27 Jan 2026 03:00:16 +0000 (22:00 -0500)
commit22f51c0f5e62a4e05bccbd0dfb23762ef2eeeff8
tree01fb040fb080702c3171825e59ceb9c4d1cee8a9
parent9cb5c879e722bb63d5ff5621cd77f402cb94a316
c++: non-dep decltype folding of concept-id C<Ts...> [PR123676]

Here since the expression within the decltype C<Ts...> is not instantiation
dependent (we know its type is bool, and don't care about its value)
finish_decltype_type instantiates it immediately via the usual tsubst_expr
with NULL_TREE args.  During which however tsubst_pack_expansion isn't
prepared to handle such a substitution due to an overly strict assert.
This patch relaxes the assert accordingly.

PR c++/123676

gcc/cp/ChangeLog:

* pt.cc (tsubst_pack_expansion): Relax unsubsituted_packs
assert to allow !processing_template_decl when args is
NULL_TREE.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-decltype5.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp2a/concepts-decltype5.C [new file with mode: 0644]