From: mmitchel Date: Fri, 16 Jun 2006 23:12:08 +0000 (+0000) Subject: PR c++/27979 X-Git-Tag: upstream/4.9.2~54067 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb3282532efc043237065168fc33a84921508e1a;p=platform%2Fupstream%2Flinaro-gcc.git PR c++/27979 * 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 28e1709..35001a0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2006-06-16 Mark Mitchell + 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. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index cd82732..970fce7 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -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); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a1eba47..b4cc183 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,7 +1,10 @@ 2006-06-16 Mark Mitchell + 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 diff --git a/gcc/testsuite/g++.dg/expr/bitfield2.C b/gcc/testsuite/g++.dg/expr/bitfield2.C new file mode 100644 index 0000000..6599315 --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/bitfield2.C @@ -0,0 +1,9 @@ +// PR c++/27979 + +class Ast +{ + enum AstKind { }; + const AstKind kind : 8; + void foo(AstKind k) { } + void bar(void) { foo(kind); } +};