Commit e76d7cc7 by Jason Merrill Committed by Jason Merrill

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
parent 63cb92c1
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> 2008-04-22 Jakub Jelinek <jakub@redhat.com>
PR c++/35747 PR c++/35747
......
...@@ -4174,7 +4174,7 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p) ...@@ -4174,7 +4174,7 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p)
switch (TREE_CODE (expr)) switch (TREE_CODE (expr))
{ {
case FIELD_DECL: case FIELD_DECL:
if (DECL_C_BIT_FIELD (expr)) if (DECL_BIT_FIELD_TYPE (expr))
{ {
type = DECL_BIT_FIELD_TYPE (expr); type = DECL_BIT_FIELD_TYPE (expr);
break; break;
......
...@@ -1507,7 +1507,7 @@ is_bitfield_expr_with_lowered_type (const_tree exp) ...@@ -1507,7 +1507,7 @@ is_bitfield_expr_with_lowered_type (const_tree exp)
tree field; tree field;
field = TREE_OPERAND (exp, 1); 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; return NULL_TREE;
if (same_type_ignoring_top_level_qualifiers_p if (same_type_ignoring_top_level_qualifiers_p
(TREE_TYPE (exp), DECL_BIT_FIELD_TYPE (field))) (TREE_TYPE (exp), DECL_BIT_FIELD_TYPE (field)))
......
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> 2008-04-23 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/36017 PR rtl-optimization/36017
// PR c++/35316
// { dg-options "-std=c++0x" }
template<int> struct A
{
int i : 2;
void foo()
{
decltype(i) j;
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment