llvm-project
llvm-project copied to clipboard
Assertion `FromType->isIntegralOrUnscopedEnumerationType()' failed when converting between scoped enums
> cat test.ii
enum class a : int;
enum class b : int;
b x{a{}};
> ~/l/ra/bin/clang++ test.ii -std=c++17
clang: ../clang/lib/Sema/SemaOverload.cpp:424: clang::NarrowingKind clang::StandardConversionSequence::getNarrowingKind(clang::ASTContext &, const clang::Expr *, clang::APValue &, clang::QualType &, bool) const: Assertion `FromType->isIntegralOrUnscopedEnumerationType()' failed.
@llvm/issue-subscribers-clang-frontend
https://reviews.llvm.org/D120862
This code is ill-formed and both gcc and clang currently reject this code and clang no longer seems to assert, see godbolt: https://godbolt.org/z/35MdP5EKv
Note defect report 2374