diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-09-29 19:45:32 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-09-29 19:45:32 +0200 |
commit | 7d386d45085cbe472089a8df4a2f033d9d5999a5 (patch) | |
tree | 7fde43d4b5e2b75bed04151a1e9b955665eb7325 /gcc/objc/objc-act.c | |
parent | 9129a561984472bfc7a076742ac7e3ee9117c197 (diff) | |
download | gcc-7d386d45085cbe472089a8df4a2f033d9d5999a5.zip gcc-7d386d45085cbe472089a8df4a2f033d9d5999a5.tar.gz gcc-7d386d45085cbe472089a8df4a2f033d9d5999a5.tar.bz2 |
c-attribs.c (handle_packed_attribute): Test DECL_C_BIT_FIELD rather than DECL_INITIAL.
c-family/
* c-attribs.c (handle_packed_attribute): Test DECL_C_BIT_FIELD
rather than DECL_INITIAL.
(common_handle_aligned_attribute): Likewise.
c/
* c-decl.c (grokfield): Use SET_DECL_C_BIT_FIELD here if
width is non-NULL.
(finish_struct): Test DECL_C_BIT_FIELD instead of DECL_INITIAL,
don't SET_DECL_C_BIT_FIELD here.
cp/
* class.c (check_bitfield_decl): Retrieve and clear width from
DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
(check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than
DECL_INITIAL.
(remove_zero_width_bit_fields): Adjust comment.
* decl2.c (grokbitfield): Stash width into
DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
* pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr
DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width.
objc/
* objc-act.c (check_ivars, gen_declaration): For OBJCPLUS look at
DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
From-SVN: r253301
Diffstat (limited to 'gcc/objc/objc-act.c')
-rw-r--r-- | gcc/objc/objc-act.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 5f70961..5d81af7 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -4602,8 +4602,14 @@ check_ivars (tree inter, tree imp) t1 = TREE_TYPE (intdecls); t2 = TREE_TYPE (impdecls); if (!comptypes (t1, t2) +#ifdef OBJCPLUS + || !tree_int_cst_equal (DECL_BIT_FIELD_REPRESENTATIVE (intdecls), + DECL_BIT_FIELD_REPRESENTATIVE (impdecls)) +#else || !tree_int_cst_equal (DECL_INITIAL (intdecls), - DECL_INITIAL (impdecls))) + DECL_INITIAL (impdecls)) +#endif + ) { if (DECL_NAME (intdecls) == DECL_NAME (impdecls)) { @@ -8895,10 +8901,14 @@ gen_declaration (tree decl) strcat (errbuf, IDENTIFIER_POINTER (DECL_NAME (decl))); } - if (DECL_INITIAL (decl) - && TREE_CODE (DECL_INITIAL (decl)) == INTEGER_CST) +#ifdef OBJCPLUS + tree w = DECL_BIT_FIELD_REPRESENTATIVE (decl); +#else + tree w = DECL_INITIAL (decl); +#endif + if (w && TREE_CODE (w) == INTEGER_CST) sprintf (errbuf + strlen (errbuf), ": " HOST_WIDE_INT_PRINT_DEC, - TREE_INT_CST_LOW (DECL_INITIAL (decl))); + TREE_INT_CST_LOW (w)); } return errbuf; |