https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83441

Boldizsar Palotas <boldizsar.palo...@continental-corporation.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |boldizsar.palotas@continent
                   |                            |al-corporation.com

--- Comment #1 from Boldizsar Palotas 
<boldizsar.palo...@continental-corporation.com> ---
A more minimal reproduction that relies on the core language only:

  // https://godbolt.org/z/fW6Bkx
  #include <cassert>

  template <class X>
  struct S {
    S* x = [this] { return this; }();
  };

  int main()
  {
    S<int> s;
    assert(s.x != nullptr);
  }

The assert fails only on GCC 7, including GCC 7.4 and 7.5. Other compilers and
newer GCC major versions seem fine. More combinations can be tested on the
Compiler Explorer link.
  • [Bug c++/83441] Null this ca... boldizsar.palo...@continental-corporation.com

Reply via email to