[gcn] install.texi: Update for new ISA targets and their requirements
[gcc.git] / gcc / testsuite / g++.dg / concepts / nested-diagnostics-2.C
blobcc15f11d63f41d6c27112c8729575747084bcc65
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" }
5 struct dog{};
6 struct cat{};
8 void pet(dog);
9 void pet(cat);
11 template <class T>
12 concept pettable = requires(T t) { t.pet(); };
14 template <pettable T>
15 void pet(T);
17 struct donkey {};
19 int main() {
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]':
29           * required from here
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 "" } */