c++: Refine enum direct-list-initialization [CWG2374]
authorPatrick Palka <ppalka@redhat.com>
Fri, 23 Apr 2021 12:28:58 +0000 (08:28 -0400)
committerPatrick Palka <ppalka@redhat.com>
Fri, 23 Apr 2021 12:28:58 +0000 (08:28 -0400)
commit5f8aed72e76970d2c6fa06fb23fdaa47660555b0
tree17888290d6de3fa35ec098cd55538bf4b16366ba
parent35b2be219fc1934ae040d045e355680a83d839c4
c++: Refine enum direct-list-initialization [CWG2374]

This implements the wording changes of CWG2374, which clarifies the
wording of P0138 to forbid e.g. direct-list-initialization of a scoped
enumeration from a different scoped enumeration.

gcc/cp/ChangeLog:

DR 2374
* decl.c (is_direct_enum_init): Check the implicit
convertibility requirement added by CWG 2374.

gcc/testsuite/ChangeLog:

DR 2374
* g++.dg/cpp1z/direct-enum-init2.C: New test.
gcc/cp/decl.c
gcc/testsuite/g++.dg/cpp1z/direct-enum-init2.C [new file with mode: 0644]