return OVL_CURRENT (fndecls);
}
- error ("prototype for %q#D does not match any in class %qT",
- function, ctype);
+ error_at (DECL_SOURCE_LOCATION (function),
+ "prototype for %q#D does not match any in class %qT",
+ function, ctype);
is_conv_op = DECL_CONV_FN_P (fndecl);
if (is_conv_op)
value = push_template_decl (value);
if (attrlist)
- cplus_decl_attributes (&value, attrlist, 0);
+ {
+ int attrflags = 0;
+
+ /* If this is a typedef that names the class for linkage purposes
+ (7.1.3p8), apply any attributes directly to the type. */
+ if (TAGGED_TYPE_P (TREE_TYPE (value))
+ && value == TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (value))))
+ attrflags = ATTR_FLAG_TYPE_IN_PLACE;
+
+ cplus_decl_attributes (&value, attrlist, attrflags);
+ }
return value;
}
guard_value = integer_one_node;
if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard)))
guard_value = convert (TREE_TYPE (guard), guard_value);
- guard = cp_build_binary_op (BIT_AND_EXPR, guard, guard_value,
+ guard = cp_build_binary_op (input_location,
+ BIT_AND_EXPR, guard, guard_value,
tf_warning_or_error);
}
guard_value = integer_zero_node;
if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard)))
guard_value = convert (TREE_TYPE (guard), guard_value);
- return cp_build_binary_op (EQ_EXPR, guard, guard_value,
+ return cp_build_binary_op (input_location,
+ EQ_EXPR, guard, guard_value,
tf_warning_or_error);
}
last to destroy the variable. */
else if (initp)
guard_cond
- = cp_build_binary_op (EQ_EXPR,
+ = cp_build_binary_op (input_location,
+ EQ_EXPR,
cp_build_unary_op (PREINCREMENT_EXPR,
- guard,
- /*noconvert=*/1,
- tf_warning_or_error),
+ guard,
+ /*noconvert=*/1,
+ tf_warning_or_error),
integer_one_node,
tf_warning_or_error);
else
guard_cond
- = cp_build_binary_op (EQ_EXPR,
+ = cp_build_binary_op (input_location,
+ EQ_EXPR,
cp_build_unary_op (PREDECREMENT_EXPR,
- guard,
- /*noconvert=*/1,
- tf_warning_or_error),
+ guard,
+ /*noconvert=*/1,
+ tf_warning_or_error),
integer_zero_node,
tf_warning_or_error);
/* Build the outer if-stmt to check for initialization or destruction. */
init_if_stmt = begin_if_stmt ();
cond = initp ? integer_one_node : integer_zero_node;
- cond = cp_build_binary_op (EQ_EXPR,
+ cond = cp_build_binary_op (input_location,
+ EQ_EXPR,
initialize_p_decl,
cond,
tf_warning_or_error);
/* Conditionalize this initialization on being in the right priority
and being initializing/finalizing appropriately. */
priority_if_stmt = begin_if_stmt ();
- cond = cp_build_binary_op (EQ_EXPR,
+ cond = cp_build_binary_op (input_location,
+ EQ_EXPR,
priority_decl,
build_int_cst (NULL_TREE, priority),
tf_warning_or_error);