gcc/testsuite/g++.dg/cpp0x/conv-tmpl3.C
raw| 1 | // PR c++/91465 - ICE with template codes in check_narrowing. |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | enum class D { X }; |
| 5 | enum class S { Z }; |
| 6 | |
| 7 | D foo(S) { return D{}; } |
| 8 | D foo(double) { return D{}; } |
| 9 | |
| 10 | template <typename> |
| 11 | struct Bar { |
| 12 | D baz(S s) |
| 13 | { |
| 14 | return D{foo(s)}; |
| 15 | } |
| 16 | }; |