gcc/testsuite/g++.dg/template/non-dependent17.C
raw| 1 | // A variant of deduce4.C with multiple overloads of foo. Verify we don't |
| 2 | // crash after ahead-of-time pruning of the overload set for the non-dependent |
| 3 | // call to foo. |
| 4 | // { dg-do compile } |
| 5 | |
| 6 | template <typename T> |
| 7 | struct S { |
| 8 | template <typename U, typename V> |
| 9 | static void foo(V) { } |
| 10 | template <typename U> |
| 11 | static void foo(...) { } |
| 12 | |
| 13 | void bar () { foo<int>(10); } |
| 14 | }; |
| 15 | |
| 16 | void |
| 17 | test () |
| 18 | { |
| 19 | S<int> s; |
| 20 | s.bar (); |
| 21 | } |