Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/concepts-p2113a.C

raw
1 // Test that the second foo is not considered more specialized because we don't
2 // compare constraints unless the template parameters and function parameters
3 // are equivalent (P2113)
4
5 // { dg-do compile { target c++20 } }
6
7 template <typename T> concept P = true;
8
9 template <typename T> void foo(int, T);
10 template <P U> void foo(U, int);
11
12 void bar() { foo(1,2); } // { dg-error "ambiguous" }