#include <thread> struct Foo { Foo() { } ~Foo() { } }; void instantiate_foo() { thread_local Foo foo = Foo(); } int main() { std::thread thread(instantiate_foo); thread.join(); }
Standard input is empty
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’
Standard output is empty