[Bug c++/83730] Unnecessary generation of guard variables with -fno-threadsafe-statics
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jan 8 10:56:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83730
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Target|avr |
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-01-08
Ever confirmed|0 |1
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This happens on all targets, but only for a C++17 inline static member
variable.
There's no guard variable for the C++14 equivalent:
struct A {
A() = default;
void foo() {}
};
template<typename T>
struct B {
static void foo() {
mTop.foo();
}
static T mTop;
};
template<typename T> T B<T>::mTop{};
int main() {
B<A>::foo();
}
More information about the Gcc-bugs
mailing list