Here constant evaluation of the atomic constraint use_func_v<T>
sensibly yields an INTEGER_CST of type const bool, but the assert in
satisfaction_value expects unqualified bool. So let's just relax the
assert to accept cv-qualified bool.
PR c++/104410
gcc/cp/ChangeLog:
* constraint.cc (satisfaction_value): Relax assert to accept
cv-qualified bool.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-pr104410.C: New test.
return t;
gcc_assert (TREE_CODE (t) == INTEGER_CST
- && same_type_p (TREE_TYPE (t), boolean_type_node));
+ && same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (t),
+ boolean_type_node));
if (integer_zerop (t))
return boolean_false_node;
else
--- /dev/null
+// PR c++/104410
+// { dg-do compile { target c++20 } }
+
+template<class T> constexpr bool use_func_v{};
+template<class T> void f() requires use_func_v<T> || true { }
+template void f<int>();