Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bricknerb opened this issue Jan 17, 2025 · 1 comment
Labels
clang:codegen IR generation bugs: mangling, exceptions, etc. crash Prefer [crash-on-valid] or [crash-on-invalid]

Comments

@bricknerb
Copy link
Contributor

bricknerb commented Jan 17, 2025

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.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jan 17, 2025
@EugeneZelenko EugeneZelenko added clang:codegen IR generation bugs: mangling, exceptions, etc. crash Prefer [crash-on-valid] or [crash-on-invalid] and removed clang Clang issues not falling into any other category labels Jan 17, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 17, 2025

@llvm/issue-subscribers-clang-codegen

Author: Boaz Brickner (bricknerb)

Example:
struct MyClass {
  template &lt;int...&gt; 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:codegen IR generation bugs: mangling, exceptions, etc. crash Prefer [crash-on-valid] or [crash-on-invalid]
Projects
None yet
Development

No branches or pull requests

3 participants