+1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
+
+ * typeck.c (build_binary_op_nodefault): Change % in format strings
+ to %%.
+
+ * decl.c (grokvardecl): Don't build_static_name for decls that
+ aren't at namespace scope.
+
+ * init.c (perform_member_init): Catch default-initialization of
+ references.
+
1998-06-17 Mark Mitchell <mark@markmitchell.com>
* errfn.c (cp_thing): Handle the `%%' formatting sequence.
1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
- * init.c (resolve_offset_ref): Handle default-initialization.
+ * init.c (perform_member_init): Handle default-initialization.
* except.c (build_throw): Handle throwing NULL.
{
tree context = in_namespace ? in_namespace : current_namespace;
decl = build_decl (VAR_DECL, declarator, complete_type (type));
- if (context != global_namespace && declarator)
+ if (context != global_namespace && namespace_bindings_p ())
DECL_ASSEMBLER_NAME (decl) = build_static_name (context,
declarator);
}
/* default-initialization. */
if (AGGREGATE_TYPE_P (type))
init = build (CONSTRUCTOR, type, NULL_TREE, NULL_TREE);
+ else if (TREE_CODE (type) == REFERENCE_TYPE)
+ {
+ cp_error ("default-initialization of `%#D', which has reference type",
+ member);
+ init = error_mark_node;
+ }
else
init = integer_zero_node;
}
case TRUNC_MOD_EXPR:
case FLOOR_MOD_EXPR:
if (code1 == INTEGER_TYPE && integer_zerop (op1))
- cp_warning ("division by zero in `%E % 0'", op0);
+ cp_warning ("division by zero in `%E %% 0'", op0);
else if (code1 == REAL_TYPE && real_zerop (op1))
- cp_warning ("division by zero in `%E % 0.'", op0);
+ cp_warning ("division by zero in `%E %% 0.'", op0);
if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
{