fork download
  1.  
  2. #include <thread>
  3.  
  4. struct Foo
  5. {
  6. Foo()
  7. {
  8. }
  9. ~Foo()
  10. {
  11. }
  12. };
  13.  
  14. void instantiate_foo()
  15. {
  16. thread_local Foo foo = Foo();
  17. }
  18.  
  19. int main()
  20. {
  21. std::thread thread(instantiate_foo);
  22. thread.join();
  23. }
  24.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘void instantiate_foo()’:
prog.cpp:16:5: error: ‘thread_local’ was not declared in this scope
prog.cpp:16:18: error: expected ‘;’ before ‘Foo’
stdout
Standard output is empty