no matching function for call to ‘pet(lizard)
26 pet(lizard{}); // { dg-error "no matching function for call to 'pet\\\(lizard\\\)'" }
~~~^~~~~~~~~~
there are 3 candidates
26 pet(lizard{}); // { dg-error "no matching function for call to 'pet\\\(lizard\\\)'" }
~~~^~~~~~~~~~
candidate 1: ‘template<class auto:1> requires pettable<auto:1> void pet(auto:1)
21 void pet(pettable auto t);
^~~
template argument deduction/substitution failed:
21 void pet(pettable auto t);
^~~
constraints not satisfied
21 void pet(pettable auto t);
^~~
no operand of the disjunction is satisfied
19 concept pettable = has_member_pet<T> or has_default_pet<T>;
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
the operand ‘has_member_pet<T>’ is unsatisfied because
19 concept pettable = has_member_pet<T> or has_default_pet<T>;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
the required expression ‘t.pet()’ is invalid, because
13 concept has_member_pet = requires(T t) { t.pet(); };
~~~~~^~
struct lizard’ has no member named ‘pet
13 concept has_member_pet = requires(T t) { t.pet(); };
~~^~~
the operand ‘has_default_pet<T>’ is unsatisfied because
19 concept pettable = has_member_pet<T> or has_default_pet<T>;
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
is_pettable’ is not a member of ‘lizard’
16 concept has_default_pet = T::is_pettable;
^~~~~~~~~~~
candidate 2: ‘void pet(dog)
9 void pet(dog);
^~~
no known conversion for argument 1 from ‘lizard’ to ‘dog’
9 void pet(dog);
^~~
candidate 3: ‘void pet(cat)
10 void pet(cat);
^~~
no known conversion for argument 1 from ‘lizard’ to ‘cat’
10 void pet(cat);
^~~