1 // { dg-do compile { target c++17 } }
2 // { dg-options "-fconcepts" }
3 // { dg-additional-options "-fdiagnostics-set-output=text:experimental-nesting=yes,experimental-nesting-show-locations=no" }
12 concept pettable = requires(T t) { t.pet(); };
20 pet(donkey{}); // { dg-error "no matching function for call to 'pet\\\(donkey\\\)'" }
23 /* { dg-begin-multiline-output "" }
24 * there are 3 candidates
25 * candidate 1: 'template<class T> requires pettable<T> void pet(T)'
26 * template argument deduction/substitution failed:
27 * constraints not satisfied
28 * In substitution of 'template<class T> requires pettable<T> void pet(T) [with T = donkey]':
30 * required for the satisfaction of 'pettable<T>' [with T = donkey]
31 * in requirements with 'T t' [with T = donkey]
32 * the required expression 't.pet()' is invalid
33 * set '-fconcepts-diagnostics-depth=' to at least 2 for more detail
34 * candidate 2: 'void pet(dog)'
35 * no known conversion for argument 1 from 'donkey' to 'dog'
36 * candidate 3: 'void pet(cat)'
37 * no known conversion for argument 1 from 'donkey' to 'cat'
38 { dg-end-multiline-output "" } */