fork download
  1. #include <iostream>
  2. using namespace std;
  3. template<class T>
  4. class Test;
  5. class Foo
  6. {
  7. public:
  8. Foo(){cout<<"Foo"<<endl;}
  9. ~Foo(){cout<<"~Foo"<<endl;}
  10. };
  11. int main() {
  12.  
  13. auto&& z = {1, 2, 3};
  14. z = {1, 2, 3};
  15. Test<decltype(z)> t;
  16. auto&& f = Foo();
  17. Test<decltype(f)> t2;
  18.  
  19. return 0;
  20. }
Compilation error #stdin compilation error #stdout 0s 15232KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:15:20: error: aggregate ‘Test<std::initializer_list<int>&&> t’ has incomplete type and cannot be defined
  Test<decltype(z)> t;
                    ^
prog.cpp:17:20: error: aggregate ‘Test<Foo&&> t2’ has incomplete type and cannot be defined
  Test<decltype(f)> t2;
                    ^~
stdout
Standard output is empty