Using the trailing return type to add constraints does not work in some cases. The following code should not compile: 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> ); static_assert( C2<int> ); However this compiles just fine with r226884.
Author: jason Date: Fri Aug 21 18:33:07 2015 New Revision: 227081 URL: https://gcc.gnu.org/viewcvs?rev=227081&root=gcc&view=rev Log: PR c++/67240 * constraint.cc (satisfy_implicit_conversion_constraint): Also check for NULL_TREE. Added: trunk/gcc/testsuite/g++.dg/concepts/iconv1.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/constraint.cc
Fixed.