+2018-12-06 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in error message;
+ print the type too; fix thinko in INDIRECT_TYPE_P use.
+
2018-12-05 Alexandre Oliva <aoliva@redhat.com>
PR c++/85569
if (value == error_mark_node)
return NULL_TREE; /* friends went bad. */
- if (TREE_TYPE (value) == error_mark_node)
+
+ tree type = TREE_TYPE (value);
+ if (type == error_mark_node)
return value;
/* Pass friendly classes back. */
if (VOID_TYPE_P (value))
return void_type_node;
- if (!INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (value))
- && (INDIRECT_TYPE_P (value)
- || !dependent_type_p (TREE_TYPE (value))))
+ if (!INTEGRAL_OR_ENUMERATION_TYPE_P (type)
+ && (INDIRECT_TYPE_P (type) || !dependent_type_p (type)))
{
- error ("bit-field %qD with non-integral type", value);
+ error_at (DECL_SOURCE_LOCATION (value),
+ "bit-field %qD with non-integral type %qT",
+ value, type);
return error_mark_node;
}
return NULL_TREE;
}
- if (width && TYPE_WARN_IF_NOT_ALIGN (TREE_TYPE (value)))
+ if (width && TYPE_WARN_IF_NOT_ALIGN (type))
{
error ("cannot declare bit-field %qD with %<warn_if_not_aligned%> type",
DECL_NAME (value));
+2018-12-06 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * g++.dg/parse/bitfield6b.C: New.
+ * g++.dg/parse/bitfield3.C: Test location and type.
+
2018-12-06 Iain Sandoe <iain@sandoe.co.uk>
* lib/c-compat.exp (compat-use-alt-compiler):