PR c++/27979
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 16 Jun 2006 23:12:08 +0000 (23:12 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 16 Jun 2006 23:12:08 +0000 (23:12 +0000)
* call.c (standard_conversion): Strip cv-qualifiers from bitfield
types.
PR c++/27979
* g++.dg/expr/bitfield2.C: New test.

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

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/expr/bitfield2.C [new file with mode: 0644]

index 28e1709..35001a0 100644 (file)
@@ -1,5 +1,9 @@
 2006-06-16  Mark Mitchell  <mark@codesourcery.com>
 
+       PR c++/27979
+       * call.c (standard_conversion): Strip cv-qualifiers from bitfield
+       types.
+
        PR c++/27884
        * decl.c (have_extern_spec): Remove.
        (start_decl): Do not check have_extern_spec.
index cd82732..970fce7 100644 (file)
@@ -632,7 +632,7 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
          tree bitfield_type;
          bitfield_type = is_bitfield_expr_with_lowered_type (expr);
          if (bitfield_type)
-           from = bitfield_type;
+           from = strip_top_quals (bitfield_type);
        }
       conv = build_conv (ck_rvalue, from, conv);
     }
index a1eba47..b4cc183 100644 (file)
@@ -1,7 +1,10 @@
 2006-06-16  Mark Mitchell  <mark@codesourcery.com>
 
+       PR c++/27979
+       * g++.dg/expr/bitfield2.C: New test. 
+
        PR c++/27884
-       * g++.dg/parse/linkage2.C: New test
+       * g++.dg/parse/linkage2.C: New test.
 
 2006-06-16  Richard Guenther  <rguenther@suse.de>
 
diff --git a/gcc/testsuite/g++.dg/expr/bitfield2.C b/gcc/testsuite/g++.dg/expr/bitfield2.C
new file mode 100644 (file)
index 0000000..6599315
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/27979
+
+class Ast
+{
+  enum AstKind { };
+  const AstKind kind : 8;
+  void foo(AstKind k) { }
+  void bar(void) { foo(kind); }
+};