diff options
author | Patrick Palka <ppalka@redhat.com> | 2022-09-13 09:48:04 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2022-09-13 09:48:04 -0400 |
commit | 441a4880cba0908e58a102b068095e4ac2bb46cc (patch) | |
tree | fc379ce94a32967f51eb7b99bec5ffb709c443f8 /gcc/cp/except.cc | |
parent | 48e40d0b658c0b7989dfbe67468430b532bcbbe9 (diff) | |
download | gcc-441a4880cba0908e58a102b068095e4ac2bb46cc.zip gcc-441a4880cba0908e58a102b068095e4ac2bb46cc.tar.gz gcc-441a4880cba0908e58a102b068095e4ac2bb46cc.tar.bz2 |
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.
Diffstat (limited to 'gcc/cp/except.cc')
-rw-r--r-- | gcc/cp/except.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/except.cc b/gcc/cp/except.cc index 7fdbc74..4d7f0ce 100644 --- a/gcc/cp/except.cc +++ b/gcc/cp/except.cc @@ -1257,7 +1257,7 @@ build_noexcept_spec (tree expr, tsubst_flags_t complain) { expr = build_converted_constant_bool_expr (expr, complain); expr = instantiate_non_dependent_expr (expr, complain); - expr = cxx_constant_value (expr); + expr = cxx_constant_value (expr, NULL_TREE, complain); } if (TREE_CODE (expr) == INTEGER_CST) { |