On 11/18/19 10:18 AM, Andrew Sutton wrote:
I forgot to mention a somewhat odd test included in the patch:
concepts-recursive-sat3.C does not recurse. Code follows:
template<typename T>
concept Fooable = requires(T t) { foo(t); };
template<Fooable T>
void foo(T t) { }
void test()
{
foo(0); // { dg-error "unsatisfied constraints" }
}
It doesn't crash, but it doesn't diagnose also doesn't fail as a
result of recursive instantiation. The recursive-sat2.C test is the
same except that it instantiates foo with a class type. This seems
like it might be related to ADL, but entirely certain.
Yes; since 0 has non-class type, we don't do ADL to find a declaration
of foo, and there were no declarations of foo before the call in
Fooable, so the call fails.
Jason