decl.c (grokdeclarator): Remove const and volatile from type after setting constp...
authorJason Merrill <jason@yorick.cygnus.com>
Thu, 26 Mar 1998 11:16:45 +0000 (11:16 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 26 Mar 1998 11:16:45 +0000 (06:16 -0500)
* decl.c (grokdeclarator): Remove const and volatile from type after
setting constp and volatilep.
* class.c (finish_struct_1): Don't warn about bool bitfield larger
than one bit.

From-SVN: r18843

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/decl.c

index 6ca4d8d8f4d552797582e647ac551622ba1c9dd8..a25b4415784b2674b2f82f93ad3aa12daa5e85f3 100644 (file)
@@ -1,3 +1,11 @@
+Thu Mar 26 11:16:30 1998  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * decl.c (grokdeclarator): Remove const and volatile from type after
+       setting constp and volatilep.
+
+       * class.c (finish_struct_1): Don't warn about bool bitfield larger
+       than one bit.
+
 Thu Mar 26 10:25:52 1998  Mark Mitchell  <mmitchell@usa.net>
 
        * pt.c (convert_nontype_argument): STRIP_NOPS where appropriate.
index 337c090535e1edea1ae31772dc83a2d66f50f050..7440a8a71b5acf12b1401621639cf9720eaf333a 100644 (file)
@@ -3499,7 +3499,8 @@ finish_struct_1 (t, warn_anon)
                  cp_error_at ("  in declaration of `%D'", x);
                }
              else if (width > TYPE_PRECISION (TREE_TYPE (x))
-                      && TREE_CODE (TREE_TYPE (x)) != ENUMERAL_TYPE)
+                      && TREE_CODE (TREE_TYPE (x)) != ENUMERAL_TYPE
+                      && TREE_CODE (TREE_TYPE (x)) != BOOLEAN_TYPE)
                {
                  cp_warning_at ("width of `%D' exceeds its type", x);
                }
index 5a3664e96b4912d8e24f4742ee6ba2c28beff47d..15fa6fb20c5e52659d14fa999ad839478c37feb0 100644 (file)
@@ -8397,6 +8397,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
 
   constp = !! RIDBIT_SETP (RID_CONST, specbits) + TYPE_READONLY (type);
   volatilep = !! RIDBIT_SETP (RID_VOLATILE, specbits) + TYPE_VOLATILE (type);
+  type = TYPE_MAIN_VARIANT (type);
   staticp = 0;
   inlinep = !! RIDBIT_SETP (RID_INLINE, specbits);
   virtualp = RIDBIT_SETP (RID_VIRTUAL, specbits);