gcc/testsuite/g++.dg/cpp0x/decltype55.C
raw| 1 | // PR c++/53211 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template<typename A, typename B> |
| 5 | struct is_same { static const bool value = false; }; |
| 6 | |
| 7 | template<typename A> |
| 8 | struct is_same<A, A> { static const bool value = true; }; |
| 9 | |
| 10 | template<typename... Args> |
| 11 | void func(Args... args) |
| 12 | { |
| 13 | int arr[] = { args... }; |
| 14 | static_assert (is_same<decltype(arr), int[sizeof...(Args)]>::value, ""); |
| 15 | } |
| 16 | |
| 17 | int main() |
| 18 | { |
| 19 | func(1, 2, 3, 4); |
| 20 | } |