[Sema] Reject list-initialization of enumeration types from a
authorAkira Hatanaka <ahatanaka@apple.com>
Fri, 20 May 2022 19:16:29 +0000 (12:16 -0700)
committerAkira Hatanaka <ahatanaka@apple.com>
Fri, 3 Jun 2022 00:25:11 +0000 (17:25 -0700)
commit66e08995b0b72d28acb5e87b90292e59fabfadae
tree2fa5aacc0ed58ecaf6fff1cafea177c1bb296ad4
parentf8b692dd31d986bc5a83437fceecf80d4e90f745
[Sema] Reject list-initialization of enumeration types from a
brace-init-list containing a single element of a different scoped
enumeration type

It is rejected because it doesn't satisfy the condition that the element
has to be implicitly convertible to the underlying type of the
enumeration.

http://eel.is/c++draft/dcl.init.list#3.8

Differential Revision: https://reviews.llvm.org/D126084
clang/lib/Sema/SemaInit.cpp
clang/test/SemaCXX/enum-scoped.cpp