gcc/testsuite/g++.dg/lookup/two-stage5.C
raw| 1 | // { dg-do run } |
| 2 | extern "C" void abort (); |
| 3 | |
| 4 | namespace N { |
| 5 | template <class T> T foo (T) { return T (); } |
| 6 | template <class T> T bar (T t) { return foo (t); } |
| 7 | } |
| 8 | |
| 9 | struct S { S (int i = 0): i_ (i) { } int i_; }; |
| 10 | |
| 11 | namespace N { |
| 12 | /* template <> */ S foo (S) { return S (1); } |
| 13 | } |
| 14 | |
| 15 | int main () |
| 16 | { |
| 17 | if (1 == N::bar (S()).i_) |
| 18 | abort (); |
| 19 | } |