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();
}

Reply via email to