c++: some missing-SFINAE fixes
authorPatrick Palka <ppalka@redhat.com>
Tue, 13 Sep 2022 13:48:04 +0000 (09:48 -0400)
committerPatrick Palka <ppalka@redhat.com>
Tue, 13 Sep 2022 13:48:04 +0000 (09:48 -0400)
commit441a4880cba0908e58a102b068095e4ac2bb46cc
treefc379ce94a32967f51eb7b99bec5ffb709c443f8
parent48e40d0b658c0b7989dfbe67468430b532bcbbe9
c++: some missing-SFINAE fixes

It looks like we aren't respecting SFINAE for:

  * an invalid/non-constant conditional explicit-specifier
  * a non-constant conditional noexcept-specifier
  * a non-constant argument to __integer_pack

This patch fixes these in the usual way, by passing complain and
propagating error_mark_node appropriately.

gcc/cp/ChangeLog:

* decl.cc (build_explicit_specifier): Pass complain to
cxx_constant_value.
* except.cc (build_noexcept_spec): Likewise.
* pt.cc (expand_integer_pack): Likewise.
(tsubst_function_decl): Propagate error_mark_node returned
from build_explicit_specifier.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/noexcept-type26.C: New test.
* g++.dg/cpp2a/explicit19.C: New test.
* g++.dg/ext/integer-pack6.C: New test.
gcc/cp/decl.cc
gcc/cp/except.cc
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp1z/noexcept-type26.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/explicit19.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/integer-pack6.C [new file with mode: 0644]