Index: clang/lib/Sema/SemaExpr.cpp =================================================================== --- clang/lib/Sema/SemaExpr.cpp +++ clang/lib/Sema/SemaExpr.cpp @@ -15428,8 +15428,8 @@ // C++11 5.17p9: // The meaning of x = {v} [...] is that of x = T(v) [...]. The meaning // of x = {} is x = T(). - InitializationKind Kind = InitializationKind::CreateDirectList( - RHSExpr->getBeginLoc(), RHSExpr->getBeginLoc(), RHSExpr->getEndLoc()); + InitializationKind Kind = + InitializationKind::CreateCopy(RHSExpr->getBeginLoc(), OpLoc); InitializedEntity Entity = InitializedEntity::InitializeTemporary(LHSExpr->getType()); InitializationSequence InitSeq(*this, Entity, Kind, RHSExpr); Index: clang/test/CXX/dcl.decl/dcl.init/dcl.init.list/p3.cpp =================================================================== --- clang/test/CXX/dcl.decl/dcl.init/dcl.init.list/p3.cpp +++ clang/test/CXX/dcl.decl/dcl.init/dcl.init.list/p3.cpp @@ -283,3 +283,12 @@ F f4(const bool x) { return F{x}; } #endif } + +namespace GH62503 { +enum class E {}; + +void f() { + E e; + e = {0}; // expected-error {{cannot initialize a value of type 'E' with an rvalue of type 'int'}} +} +}