aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2023-01-04 14:12:25 -0500
committerPatrick Palka <ppalka@redhat.com>2023-01-04 14:12:25 -0500
commit238e292cf5d822f3bd12d9b58eb04cf377758b2a (patch)
treec2ee369fd5e91ad6a5ae9332e8be96d523224352 /gcc/cp
parentfc349931adcf1024ee95e0a0cd98cf4a41996093 (diff)
downloadgcc-238e292cf5d822f3bd12d9b58eb04cf377758b2a.zip
gcc-238e292cf5d822f3bd12d9b58eb04cf377758b2a.tar.gz
gcc-238e292cf5d822f3bd12d9b58eb04cf377758b2a.tar.bz2
c++: mark_single_function and SFINAE [PR108282]
We typically ignore mark_used failure when in a non-SFINAE context for sake of better error recovery. But in mark_single_function we're instead ignoring mark_used failure in a SFINAE context, which ends up causing the second static_assert here to incorrectly fail. PR c++/108282 gcc/cp/ChangeLog: * decl2.cc (mark_single_function): Ignore mark_used failure only in a non-SFINAE context rather than in a SFINAE one. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-requires34.C: New test.
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/decl2.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/decl2.cc b/gcc/cp/decl2.cc
index f95529a..00ed64d 100644
--- a/gcc/cp/decl2.cc
+++ b/gcc/cp/decl2.cc
@@ -5600,7 +5600,7 @@ mark_single_function (tree expr, tsubst_flags_t complain)
if (is_overloaded_fn (expr) == 1
&& !mark_used (expr, complain)
- && (complain & tf_error))
+ && !(complain & tf_error))
return false;
return true;
}