diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-04-23 18:04:33 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-04-23 18:04:33 +0000 |
commit | c0e47fd47264c1a82192e12e949022f12295f2ed (patch) | |
tree | 795f298e0af32f79064b451399d8021ab268f911 /gcc/c-decl.c | |
parent | aeaccda96550eb360f54914984e2e8b3e0a9dffc (diff) | |
download | gcc-c0e47fd47264c1a82192e12e949022f12295f2ed.tar.gz |
2006-04-23 Mark Mitchell <mark@codesourcery.com>
PR c++/26534
* c-common.h (c_build_bitfield_integer_type): Declare.
* c-decl.c (c_build_bitfield_integer_type): Move to ...
* c-common.c (c_build_bitfield_integer_type): ... here.
2006-04-23 Mark Mitchell <mark@codesourcery.com>
PR c++/26534
* cp-tree.h (is_bitfield_expr_with_lowered_type): New function.
* typeck.c (is_bitfield_expr_with_lowered_type): New function.
(decay_conversion): Convert bitfield expressions to the correct
type.
(build_modify_expr): Remove spurious conversions.
* class.c (layout_class_type): Modify the type of bitfields to
indicate a limited range.
* call.c (standard_conversion): Adjust the type of bitfield
expressions used in an rvalue context.
(build_conditional_expr): Likewise.
2006-04-23 Mark Mitchell <mark@codesourcery.com>
PR c++/26534
* g++.dg/opt/bitfield1.C: New test.
* g++.dg/compat/abi/bitfield1_main.C: Add -w.
* g++.dg/compat/abi/bitfield1_x.C: Likewise.
* g++.dg/compat/abi/bitfield1_y.C: Likewise.
* g++.dg/compat/abi/bitfield2_main.C: Likewise.
* g++.dg/compat/abi/bitfield2_x.C: Likewise.
* g++.dg/compat/abi/bitfield2_y.C: Likewise.
* g++.dg/abi/bitfield1.C: Add dg-warning markers.
* g++.dg/abi/bitfield2.C: Likewise.
* g++.dg/init/bitfield1.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113199 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index db906b4456b..f4d33307bf2 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -3814,29 +3814,6 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name) } } -/* Build a bit-field integer type for the given WIDTH and UNSIGNEDP. */ -static tree -c_build_bitfield_integer_type (unsigned HOST_WIDE_INT width, int unsignedp) -{ - /* Extended integer types of the same width as a standard type have - lesser rank, so those of the same width as int promote to int or - unsigned int and are valid for printf formats expecting int or - unsigned int. To avoid such special cases, avoid creating - extended integer types for bit-fields if a standard integer type - is available. */ - if (width == TYPE_PRECISION (integer_type_node)) - return unsignedp ? unsigned_type_node : integer_type_node; - if (width == TYPE_PRECISION (signed_char_type_node)) - return unsignedp ? unsigned_char_type_node : signed_char_type_node; - if (width == TYPE_PRECISION (short_integer_type_node)) - return unsignedp ? short_unsigned_type_node : short_integer_type_node; - if (width == TYPE_PRECISION (long_integer_type_node)) - return unsignedp ? long_unsigned_type_node : long_integer_type_node; - if (width == TYPE_PRECISION (long_long_integer_type_node)) - return (unsignedp ? long_long_unsigned_type_node - : long_long_integer_type_node); - return build_nonstandard_integer_type (width, unsignedp); -} /* Given declspecs and a declarator, determine the name and type of the object declared |