+2018-02-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * c-common.h (DECL_UNNAMED_BIT_FIELD): New.
+
2018-02-02 Julia Koval <julia.koval@intel.com>
* c-common.h (omp_clause_mask): Move to wide_int_bitmask.h.
#define CLEAR_DECL_C_BIT_FIELD(NODE) \
(DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) = 0)
+/* True if the decl was an unnamed bitfield. */
+#define DECL_UNNAMED_BIT_FIELD(NODE) \
+ (DECL_C_BIT_FIELD (NODE) && !DECL_NAME (NODE))
+
extern tree do_case (location_t, tree, tree);
extern tree build_stmt (location_t, enum tree_code, ...);
extern tree build_real_imag_expr (location_t, enum tree_code, tree);
+2018-02-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * c-typeck.c (really_start_incremental_init, push_init_level,
+ set_nonincremental_init, output_init_element, process_init_element):
+ Use DECL_UNNAMED_BIT_FIELD.
+
2018-01-31 Marek Polacek <polacek@redhat.com>
PR c/81779
constructor_fields = TYPE_FIELDS (constructor_type);
/* Skip any nameless bit fields at the beginning. */
while (constructor_fields != NULL_TREE
- && DECL_C_BIT_FIELD (constructor_fields)
- && DECL_NAME (constructor_fields) == NULL_TREE)
+ && DECL_UNNAMED_BIT_FIELD (constructor_fields))
constructor_fields = DECL_CHAIN (constructor_fields);
constructor_unfilled_fields = constructor_fields;
constructor_fields = TYPE_FIELDS (constructor_type);
/* Skip any nameless bit fields at the beginning. */
while (constructor_fields != NULL_TREE
- && DECL_C_BIT_FIELD (constructor_fields)
- && DECL_NAME (constructor_fields) == NULL_TREE)
+ && DECL_UNNAMED_BIT_FIELD (constructor_fields))
constructor_fields = DECL_CHAIN (constructor_fields);
constructor_unfilled_fields = constructor_fields;
constructor_unfilled_fields = TYPE_FIELDS (constructor_type);
/* Skip any nameless bit fields at the beginning. */
while (constructor_unfilled_fields != NULL_TREE
- && DECL_C_BIT_FIELD (constructor_unfilled_fields)
- && DECL_NAME (constructor_unfilled_fields) == NULL_TREE)
+ && DECL_UNNAMED_BIT_FIELD (constructor_unfilled_fields))
constructor_unfilled_fields = TREE_CHAIN (constructor_unfilled_fields);
}
/* Skip any nameless bit fields. */
while (constructor_unfilled_fields != NULL_TREE
- && DECL_C_BIT_FIELD (constructor_unfilled_fields)
- && DECL_NAME (constructor_unfilled_fields) == NULL_TREE)
+ && DECL_UNNAMED_BIT_FIELD (constructor_unfilled_fields))
constructor_unfilled_fields =
DECL_CHAIN (constructor_unfilled_fields);
}
constructor_unfilled_fields = DECL_CHAIN (constructor_fields);
/* Skip any nameless bit fields. */
while (constructor_unfilled_fields != 0
- && DECL_C_BIT_FIELD (constructor_unfilled_fields)
- && DECL_NAME (constructor_unfilled_fields) == 0)
+ && (DECL_UNNAMED_BIT_FIELD
+ (constructor_unfilled_fields)))
constructor_unfilled_fields =
DECL_CHAIN (constructor_unfilled_fields);
}
constructor_fields = DECL_CHAIN (constructor_fields);
/* Skip any nameless bit fields at the beginning. */
while (constructor_fields != NULL_TREE
- && DECL_C_BIT_FIELD (constructor_fields)
- && DECL_NAME (constructor_fields) == NULL_TREE)
+ && DECL_UNNAMED_BIT_FIELD (constructor_fields))
constructor_fields = DECL_CHAIN (constructor_fields);
}
else if (TREE_CODE (constructor_type) == UNION_TYPE)
+2018-02-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * class.c (is_really_empty_class): Use DECL_UNNAMED_BIT_FIELD.
+ * constexpr.c (cx_check_missing_mem_inits): Likewise.
+ * decl.c (next_initializable_field, find_decomp_class_base,
+ cp_finish_decomp): Likewise.
+ * typeck2.c (process_init_constructor_record): Likewise.
+
2018-02-02 Jason Merrill <jason@redhat.com>
PR c++/84181 - ICE with lambda parm in template argument.
if (TREE_CODE (field) == FIELD_DECL
&& !DECL_ARTIFICIAL (field)
/* An unnamed bit-field is not a data member. */
- && (DECL_NAME (field) || !DECL_C_BIT_FIELD (field))
+ && !DECL_UNNAMED_BIT_FIELD (field)
&& !is_really_empty_class (TREE_TYPE (field)))
return false;
return true;
tree ftype;
if (TREE_CODE (field) != FIELD_DECL)
continue;
- if (DECL_C_BIT_FIELD (field) && !DECL_NAME (field))
+ if (DECL_UNNAMED_BIT_FIELD (field))
continue;
if (DECL_ARTIFICIAL (field))
continue;
{
while (field
&& (TREE_CODE (field) != FIELD_DECL
- || (DECL_C_BIT_FIELD (field) && !DECL_NAME (field))
+ || DECL_UNNAMED_BIT_FIELD (field)
|| (DECL_ARTIFICIAL (field)
&& !(cxx_dialect >= cxx17 && DECL_FIELD_IS_BASE (field)))))
field = DECL_CHAIN (field);
for (tree field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) != FIELD_DECL
|| DECL_ARTIFICIAL (field)
- || (DECL_C_BIT_FIELD (field) && !DECL_NAME (field)))
+ || DECL_UNNAMED_BIT_FIELD (field))
continue;
else if (ret)
return type;
for (tree field = TYPE_FIELDS (btype); field; field = TREE_CHAIN (field))
if (TREE_CODE (field) != FIELD_DECL
|| DECL_ARTIFICIAL (field)
- || (DECL_C_BIT_FIELD (field) && !DECL_NAME (field)))
+ || DECL_UNNAMED_BIT_FIELD (field))
continue;
else
eltscnt++;
for (tree field = TYPE_FIELDS (btype); field; field = TREE_CHAIN (field))
if (TREE_CODE (field) != FIELD_DECL
|| DECL_ARTIFICIAL (field)
- || (DECL_C_BIT_FIELD (field) && !DECL_NAME (field)))
+ || DECL_UNNAMED_BIT_FIELD (field))
continue;
else
{
tree next;
tree type;
- if (!DECL_NAME (field) && DECL_C_BIT_FIELD (field))
- continue;
-
if (TREE_CODE (field) != FIELD_DECL
|| (DECL_ARTIFICIAL (field)
&& !(cxx_dialect >= cxx17 && DECL_FIELD_IS_BASE (field))))
continue;
+ if (DECL_UNNAMED_BIT_FIELD (field))
+ continue;
+
/* If this is a bitfield, first convert to the declared type. */
type = TREE_TYPE (field);
if (DECL_BIT_FIELD_TYPE (field))
for (field = TYPE_FIELDS (type);
field; field = DECL_CHAIN (field))
{
- if (!DECL_NAME (field) && DECL_C_BIT_FIELD (field))
- continue;
if (TREE_CODE (field) != FIELD_DECL
|| (DECL_ARTIFICIAL (field)
&& !(cxx_dialect >= cxx17
&& DECL_FIELD_IS_BASE (field))))
continue;
+ if (DECL_UNNAMED_BIT_FIELD (field))
+ continue;
+
if (ce->index == field || ce->index == DECL_NAME (field))
break;
if (ANON_AGGR_TYPE_P (TREE_TYPE (field)))