// PR c++/71504 // { dg-do compile { target c++17 } } typedef __SIZE_TYPE__ size_t; template struct integral_constant { static constexpr T value = v; typedef T value_type; typedef integral_constant type; constexpr operator value_type () const noexcept { return value; } constexpr value_type operator() () const noexcept { return value; } }; template constexpr T integral_constant::value; typedef integral_constant true_type; typedef integral_constant false_type; template struct is_array : public false_type { }; template struct is_array : public true_type { }; template struct is_array : public true_type { }; template struct conditional; template struct conditional { typedef T type; }; template struct conditional { typedef F type; }; template struct array_ref; template using ref_t = typename conditional::value, array_ref, T&>::type; template struct array_ref { T *a; using const_reference = const ref_t; constexpr const_reference operator[] (unsigned I) const { return {a[I]}; } }; template array_ref (A&) -> array_ref; constexpr int a2[2] = {1,2}; static_assert (array_ref{a2}[0] == 1); constexpr int a22[2][2] = {{1,2},{3,4}}; static_assert (array_ref{a22}[0][0] == 1);