Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / initlist-array17.C
blobc4284a7b3913007e82b71c0f1241d5c95f18cf78
1 // PR c++/93259
2 // { dg-do compile { target c++11 } }
4 template <class T, class U> struct is_same;
5 template <class T> struct is_same<T,T> { };
7 using Array = int[];
9 template <typename ...Ts>
10 void bar1(Ts ...)
12   auto && array = Array{ 1, 2, 3 };
14   is_same<int (&&)[3], decltype(array)>{}; // this fails, deduces array as int (&&) []
17 template <typename T>
18 void bar2()
20   auto && array = Array{ 1, 2, 3 };
22   is_same<int (&&)[3], decltype(array)>{};  // this fails, deduces array as int (&&) []
25 void bar3()
27   auto && array = Array{ 1, 2, 3 };
29   is_same<int (&&)[3], decltype(array)>{}; // OK
32 int main()
34   bar1<int>(1, 2, 3);
35   bar2<int>();
36   bar3();