#include <type_traits> decltype(auto) get_arr() { static int x[] = {1, 2 ,3, 4}; return (x); } template <typename T> struct WhatType; int main() { auto& x = get_arr(); WhatType<decltype(x)> w; return 0; }
Standard input is empty
prog.cpp: In function ‘int main()’:
prog.cpp:14:24: error: aggregate ‘WhatType<int (&)[4]> w’ has incomplete type and cannot be defined
WhatType<decltype(x)> w;
^
Standard output is empty