backport: re PR c++/92732 (Bit-field of scoped enumeration type cannot be initialized)
commit41e5eec55cb64b54c717d9625bcee1aac1def569
authorJakub Jelinek <jakub@redhat.com>
Fri, 14 Feb 2020 11:58:46 +0000 (14 12:58 +0100)
committerJakub Jelinek <jakub@redhat.com>
Fri, 14 Feb 2020 15:01:44 +0000 (14 16:01 +0100)
tree09851cf8b88f5a1730eb4ff90a6ab3b9e095484e
parent1aafdd7c93226cb092b560462028394a82f404a2
backport: re PR c++/92732 (Bit-field of scoped enumeration type cannot be initialized)

Backported from mainline
2019-12-03  Jakub Jelinek  <jakub@redhat.com>

PR c++/92732
* typeck2.c (digest_nsdmi_init): For bitfields, use
DECL_BIT_FIELD_TYPE instead of TREE_TYPE.

* g++.dg/cpp2a/bitfield3.C: Don't expect narrowing conversion
warnings.
* g++.dg/cpp2a/bitfield4.C: New test.
gcc/cp/ChangeLog
gcc/cp/typeck2.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp2a/bitfield3.C
gcc/testsuite/g++.dg/cpp2a/bitfield4.C [new file with mode: 0644]