re PR c++/51242 ([C++11] Unable to use strongly typed enums as bit fields)
/cp 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com> Paolo Carlini <paolo.carlini@oracle.com> PR c++/51242 * decl2.c (grokbitfield): Allow scoped enumeration types. /testsuite 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com> Paolo Carlini <paolo.carlini@oracle.com> PR c++/51242 * g++.dg/cpp0x/enum23.C: New. Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com> From-SVN: r196100
This commit is contained in:
parent
7102a358e3
commit
4d0648ac8f
@ -1,3 +1,9 @@
|
||||
2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
|
||||
Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/51242
|
||||
* decl2.c (grokbitfield): Allow scoped enumeration types.
|
||||
|
||||
2013-02-15 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/54276
|
||||
|
@ -1028,7 +1028,7 @@ grokbitfield (const cp_declarator *declarator,
|
||||
if (TREE_CODE (value) == VOID_TYPE)
|
||||
return void_type_node;
|
||||
|
||||
if (!INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (value))
|
||||
if (!INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (value))
|
||||
&& (POINTER_TYPE_P (value)
|
||||
|| !dependent_type_p (TREE_TYPE (value))))
|
||||
{
|
||||
|
@ -1,3 +1,9 @@
|
||||
2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
|
||||
Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/51242
|
||||
* g++.dg/cpp0x/enum23.C: New.
|
||||
|
||||
2013-02-15 Oleg Endo <olegendo@gcc.gnu.org>
|
||||
|
||||
PR target/54685
|
||||
|
9
gcc/testsuite/g++.dg/cpp0x/enum23.C
Normal file
9
gcc/testsuite/g++.dg/cpp0x/enum23.C
Normal file
@ -0,0 +1,9 @@
|
||||
// PR c++/51242
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
enum class MyEnum { A = 1 };
|
||||
|
||||
struct MyClass
|
||||
{
|
||||
MyEnum Field1 : 3; // { dg-bogus "warning: 'MyClass::Field1' is too small" "" { xfail *-*-* } }
|
||||
};
|
Loading…
Reference in New Issue
Block a user