/* C++14 DR1658 Means we do not have to construct vbases of
abstract classes. */
construct_virtual_base (subobject, arguments);
+ else
+ /* When not constructing vbases of abstract classes, at least mark
+ the arguments expressions as read to avoid
+ -Wunused-but-set-parameter false positives. */
+ for (tree arg = arguments; arg; arg = TREE_CHAIN (arg))
+ mark_exp_read (TREE_VALUE (arg));
if (inherited_base)
pop_deferring_access_checks ();
If the access is to form a pointer to member, the
nested-name-specifier shall name the derived class
(or any class derived from that class). */
+ bool ok;
if (address_p && DECL_P (t)
&& DECL_NONSTATIC_MEMBER_P (t))
- perform_or_defer_access_check (TYPE_BINFO (type), t, t,
- complain);
+ ok = perform_or_defer_access_check (TYPE_BINFO (type), t, t,
+ complain);
else
- perform_or_defer_access_check (basebinfo, t, t,
- complain);
-
+ ok = perform_or_defer_access_check (basebinfo, t, t,
+ complain);
+ if (!ok)
+ return error_mark_node;
if (DECL_STATIC_FUNCTION_P (t))
return t;
member = t;
TREE_TYPE (member) = unknown_type_node;
}
else if (address_p && TREE_CODE (member) == FIELD_DECL)
- /* We need additional test besides the one in
- check_accessibility_of_qualified_id in case it is
- a pointer to non-static member. */
- perform_or_defer_access_check (TYPE_BINFO (type), member, member,
- complain);
+ {
+ /* We need additional test besides the one in
+ check_accessibility_of_qualified_id in case it is
+ a pointer to non-static member. */
+ if (!perform_or_defer_access_check (TYPE_BINFO (type), member, member,
+ complain))
+ return error_mark_node;
+ }
if (!address_p)
{
{
pedwarn (EXPR_LOC_OR_LOC (outer_nelts, input_location), OPT_Wvla,
typedef_variant_p (orig_type)
- ? "non-constant array new length must be specified "
- "directly, not by typedef"
+ ? G_("non-constant array new length must be specified "
+ "directly, not by typedef")
: G_("non-constant array new length must be specified "
"without parentheses around the type-id"));
}
if (type == error_mark_node)
return error_mark_node;
- if (nelts == NULL_TREE && vec_safe_length (*init) == 1
+ if (nelts == NULL_TREE
/* Don't do auto deduction where it might affect mangling. */
&& (!processing_template_decl || at_function_scope_p ()))
{
tree auto_node = type_uses_auto (type);
if (auto_node)
{
- tree d_init = (**init)[0];
- d_init = resolve_nondeduced_context (d_init, complain);
+ tree d_init = NULL_TREE;
+ if (vec_safe_length (*init) == 1)
+ {
+ d_init = (**init)[0];
+ d_init = resolve_nondeduced_context (d_init, complain);
+ }
type = do_auto_deduction (type, d_init, auto_node);
}
}