// P0846R0 // { dg-do compile } // { dg-options "-std=c++2a" } struct S { template int foo(T); template int foo(T, T); template int foo(T, T, T); }; template struct W { template T foo(U); template T foo(U, U); template T foo(U, U, U); }; void test () { S s; s.foo(1); s.foo(1, 2); s.foo(1, 2, 3); W w; w.foo(1); w.foo(1, 2); w.foo(1, 2, 3); w.nothere(1); // { dg-error "has no member|expected" } s.nothere(1); // { dg-error "has no member|expected" } }