gcc/testsuite/g++.dg/cpp0x/pr78693.C
raw| 1 | // PR c++/78693 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template <class T> |
| 5 | void |
| 6 | foo (T t) |
| 7 | { |
| 8 | auto i = t, j = 1; // { dg-bogus "inconsistent deduction" } |
| 9 | } |
| 10 | |
| 11 | template <class T> |
| 12 | void |
| 13 | bar (T t) |
| 14 | { |
| 15 | auto i = 1, j = t, k = 2; // { dg-bogus "inconsistent deduction" } |
| 16 | } |
| 17 | |
| 18 | template <class T, class U> |
| 19 | void |
| 20 | foo (T t, U u) |
| 21 | { |
| 22 | auto i = t, j = u; // { dg-bogus "inconsistent deduction" } |
| 23 | } |
| 24 | |
| 25 | void |
| 26 | foo () |
| 27 | { |
| 28 | foo (0); |
| 29 | bar (0); |
| 30 | foo (1, 2); |
| 31 | } |