PR c++/35316
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Apr 2008 23:13:19 +0000 (23:13 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Apr 2008 23:13:19 +0000 (23:13 +0000)
        * 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134571 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/decltype11.C [new file with mode: 0644]

index 71bb45e..df32174 100644 (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
index f31235b..7881a9f 100644 (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;
index 9e9d461..2e2aa17 100644 (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)))
index 435f081..28b6431 100644 (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
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype11.C b/gcc/testsuite/g++.dg/cpp0x/decltype11.C
new file mode 100644 (file)
index 0000000..ac32d34
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/35316
+// { dg-options "-std=c++0x" }
+
+template<int> struct A
+{
+  int i : 2;
+
+  void foo()
+  {
+    decltype(i) j;
+  }
+};