OSDN Git Service

* tree.c (lvalue_p_1): Use DECL_C_BIT_FIELD to check for
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 3 Oct 1999 16:04:30 +0000 (16:04 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 3 Oct 1999 16:04:30 +0000 (16:04 +0000)
bitfields, rather than DECL_BIT_FIELD.
* ir.texi: Document how to tell whether or not a field is a
bitfield.

* lex.c (make_lang_type): Fix typo in comment.

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

gcc/cp/ChangeLog
gcc/cp/ir.texi
gcc/cp/lex.c
gcc/cp/tree.c
gcc/testsuite/g++.old-deja/g++.other/bitfld4.C [new file with mode: 0644]

index 814e211..ffe4cd2 100644 (file)
@@ -1,3 +1,12 @@
+1999-10-03  Mark Mitchell  <mark@codesourcery.com>
+
+       * tree.c (lvalue_p_1): Use DECL_C_BIT_FIELD to check for
+       bitfields, rather than DECL_BIT_FIELD.
+       * ir.texi: Document how to tell whether or not a field is a
+       bitfield.
+       
+       * lex.c (make_lang_type): Fix typo in comment.
+
 1999-10-01  Jason Merrill  <jason@yorick.cygnus.com>
 
        * typeck.c (decay_conversion): Strip cv-quals from non-class rvalues.
index 2831e3b..6e1623e 100644 (file)
@@ -842,7 +842,7 @@ These nodes represent non-static data members.  The @code{DECL_SIZE} and
 @code{INTEGER_CST}.  These values are indexed from zero, where zero
 indicates the first bit in the object.
 
-FIXME: Talk about bitfields.
+If @code{DECL_C_BIT_FIELD} holds, this field is a bitfield.
 
 @item NAMESPACE_DECL
 @xref{Namespaces}.
index acc99c7..5d87eea 100644 (file)
@@ -4830,7 +4830,7 @@ make_lang_type (code)
        clear it here.  */
     TYPE_ALIAS_SET (t) = 0;
 
-  /* We need to allocate a TYPE_BINFO even for TEMPALTE_TYPE_PARMs
+  /* We need to allocate a TYPE_BINFO even for TEMPLATE_TYPE_PARMs
      since they can be virtual base types, and we then need a
      canonical binfo for them.  Ideally, this would be done lazily for
      all types.  */
index 8e4f2da..96a1549 100644 (file)
@@ -86,7 +86,7 @@ lvalue_p_1 (ref, treat_class_rvalues_as_lvalues)
          /* The "field" can be a FUNCTION_DECL or an OVERLOAD in some
             situations.  */
          && TREE_CODE (TREE_OPERAND (ref, 1)) == FIELD_DECL
-         && DECL_BIT_FIELD (TREE_OPERAND (ref, 1)))
+         && DECL_C_BIT_FIELD (TREE_OPERAND (ref, 1)))
        {
          /* Clear the ordinary bit.  If this object was a class
             rvalue we want to preserve that information.  */
diff --git a/gcc/testsuite/g++.old-deja/g++.other/bitfld4.C b/gcc/testsuite/g++.old-deja/g++.other/bitfld4.C
new file mode 100644 (file)
index 0000000..ac0a378
--- /dev/null
@@ -0,0 +1,25 @@
+// Build don't link:
+// Origin: "Chen, Wen-Ke" <chwk@cs.arizona.edu>
+
+template <class T>
+bool operator!=(const T&, const T&);
+
+enum MsgType {
+  MSG_DATA
+};
+
+class C {
+public:
+  MsgType mType : 8;
+};
+
+int main(void)
+{
+  extern C& c;
+
+  c.mType = MSG_DATA; 
+  if (c.mType != MSG_DATA)
+    return -1;
+
+  return 0;
+}