re PR c++/35316 (ICE with typeof/decltype and bit-fields)

PR c++/35316
        * semantics.c (finish_decltype_type): Check DECL_BIT_FIELD_TYPE
        to see if DECL_BIT_FIELD_TYPE should be used, not some other flag.
        * typeck.c (is_bitfield_expr_with_lowered_type): Likewise.

From-SVN: r134571
This commit is contained in:
Jason Merrill 2008-04-22 19:13:19 -04:00 committed by Jason Merrill
parent 63cb92c1ee
commit e76d7cc71d
5 changed files with 26 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2008-04-22 Jason Merrill <jason@redhat.com>
PR c++/35316
* semantics.c (finish_decltype_type): Check DECL_BIT_FIELD_TYPE
to see if DECL_BIT_FIELD_TYPE should be used, not some other flag.
* typeck.c (is_bitfield_expr_with_lowered_type): Likewise.
2008-04-22 Jakub Jelinek <jakub@redhat.com>
PR c++/35747

View File

@ -4174,7 +4174,7 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p)
switch (TREE_CODE (expr))
{
case FIELD_DECL:
if (DECL_C_BIT_FIELD (expr))
if (DECL_BIT_FIELD_TYPE (expr))
{
type = DECL_BIT_FIELD_TYPE (expr);
break;

View File

@ -1507,7 +1507,7 @@ is_bitfield_expr_with_lowered_type (const_tree exp)
tree field;
field = TREE_OPERAND (exp, 1);
if (TREE_CODE (field) != FIELD_DECL || !DECL_C_BIT_FIELD (field))
if (TREE_CODE (field) != FIELD_DECL || !DECL_BIT_FIELD_TYPE (field))
return NULL_TREE;
if (same_type_ignoring_top_level_qualifiers_p
(TREE_TYPE (exp), DECL_BIT_FIELD_TYPE (field)))

View File

@ -1,3 +1,8 @@
2008-04-22 Jason Merrill <jason@redhat.com>
PR c++/35316
* g++.dg/cpp0x/decltype11.C: New.
2008-04-23 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/36017

View File

@ -0,0 +1,12 @@
// PR c++/35316
// { dg-options "-std=c++0x" }
template<int> struct A
{
int i : 2;
void foo()
{
decltype(i) j;
}
};