Skip to content

Clang crash when trying to evaluate a constexpr with auto type, variadic template before type is fully defined #123296

Closed as duplicate of#84522
@bricknerb

Description

@bricknerb

Example:

struct MyClass {
  template <int...> static constexpr auto foo() { return 1; }
  static constexpr auto my_value = foo();
};

We get a "Unexpected undeduced type!" crash

Compiler Explorer: https://godbolt.org/z/5PKP885K7

I believe this should be an error that says the function foo() isn't defined yet because the class isn't fully defined, but not a crash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:codegenIR generation bugs: mangling, exceptions, etc.crashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions