fork download
  1. #include <type_traits>
  2.  
  3. decltype(auto) get_arr() {
  4. static int x[] = {1, 2 ,3, 4};
  5.  
  6. return (x);
  7. }
  8.  
  9. template <typename T> struct WhatType;
  10.  
  11. int main() {
  12. auto& x = get_arr();
  13.  
  14. WhatType<decltype(x)> w;
  15. return 0;
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
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;
                        ^
stdout
Standard output is empty