commit d25eb4518d272d25dbd63d0d4802102be0a2ca08
Author: Jason Merrill <jason@redhat.com>
Date: Fri Aug 21 12:14:48 2015 -0400
PR c++/67240
* constraint.cc (satisfy_implicit_conversion_constraint): Also
check for NULL_TREE.
@@ -1775,7 +1775,7 @@ satisfy_implicit_conversion_constraint (tree t, tree args,
of the form TYPE <unspecified> = EXPR. */
tree conv =
perform_direct_initialization_if_possible (type, expr, false, complain);
- if (conv == error_mark_node)
+ if (conv == NULL_TREE || conv == error_mark_node)
return boolean_false_node;
else
return boolean_true_node;
new file mode 100644
@@ -0,0 +1,20 @@
+// PR c++/67240
+// { dg-options -std=c++1z }
+
+int foo(int x)
+{
+ return x;
+}
+
+template <typename T>
+concept bool C1 = requires (T x) {
+ {foo(x)} -> int&;
+};
+
+template <typename T>
+concept bool C2 = requires (T x) {
+ {foo(x)} -> void;
+};
+
+static_assert( C1<int> ); // { dg-error "assert" }
+static_assert( C2<int> ); // { dg-error "assert" }