// PR c++/59867 // { dg-do compile { target c++1y } } #include using namespace std; // constant template struct meta_value { typedef meta_value type; typedef T value_type; static const T value = x; }; // array template struct meta_array { typedef meta_array type; typedef T item_type; }; // static array -> runtime array conversion utility template struct array_gen; template struct array_gen> { static const T value[sizeof...(xs)]; }; template const T array_gen>::value[sizeof...(xs)] = {xs...}; // static string template constexpr meta_array operator""_s() { static_assert(sizeof...(xs) == 3, "What's wrong with you?"); return meta_array(); } int main() { auto a = "123"_s; const char (& xs)[3] = array_gen::value; }