Skip to content

Clang frontend C++ crash on auto in non-static struct member #63278

@brutalsavage

Description

@brutalsavage

To quickly reproduce: https://gcc.godbolt.org/z/G79ThqzWE (assertion-trunk)

struct Tournament {
  int id{0}; // remove this line and it no longer crashes
  auto x = 1;
};

int main() {
  Tournament s(0);
}

Compiling the above code crashes clang clang++ -x c++ -std=c++20 , crashes locally using clang-17.0 (a10019a) (requires c++20 or above), also on trunk with assertion (see godbolt link)

Note that removing int id{0}; inside the struct stops the crash.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions