-
-
Notifications
You must be signed in to change notification settings - Fork 262
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Since c++11, static variables are initialized thread-safely once in case of success.
cppinsights shows this correctly for
struct foo{foo();};
const foo& create(){
static foo value = foo(); // exception handling is there
return value;
}
(ie and catch(...) with __cxa_guard_abort is present)
but does not for those variants (adding const or an indirection through a lambda or function)
struct foo{foo();};
const foo& create(){
static const foo value = foo(); // exception handling missing
return value;
}
struct foo{foo();};
const foo& create(){
static foo value = [](){return foo();}(); // exception handling missing
return value;
}
struct foo{foo();};
foo make_foo(){
return foo();
}
const foo& create(){
static foo value = make_foo(); // exception handling missing
return value;
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working