diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -420,7 +420,7 @@ // value when converted back to the original type. case ICK_Integral_Conversion: IntegralConversion: { - assert(FromType->isIntegralOrUnscopedEnumerationType()); + assert(FromType->isIntegralOrEnumerationType()); assert(ToType->isIntegralOrUnscopedEnumerationType()); const bool FromSigned = FromType->isSignedIntegerOrEnumerationType(); const unsigned FromWidth = Ctx.getIntWidth(FromType); diff --git a/clang/test/SemaCXX/cxx17-enum-scoped.cpp b/clang/test/SemaCXX/cxx17-enum-scoped.cpp new file mode 100644 --- /dev/null +++ b/clang/test/SemaCXX/cxx17-enum-scoped.cpp @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -fsyntax-only -pedantic -std=c++17 -verify -triple x86_64-apple-darwin %s + +// expected-no-diagnostics + +namespace PR54158 { + enum class A : int; + enum class B : int; + B x{A{}}; +}