+2003-03-21 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/9898
+ * error.c (dump_decl) [CONST_DECL]: Print '<enumerator>'.
+ (dump_expr) [CONSTRUCTOR]: Print default ctor as a function call.
+
2003-03-20 Mark Mitchell <mark@codesourcery.com>
* cp/decl2.c (arg_assoc_class): Correct check for namespace-scope
else if (DECL_INITIAL (t))
dump_expr (DECL_INITIAL (t), flags | TFF_EXPR_IN_PARENS);
else
- print_identifier (scratch_buffer, "enumerator");
+ print_identifier (scratch_buffer, "<enumerator>");
break;
case USING_DECL:
}
}
}
- output_add_character (scratch_buffer, '{');
- dump_expr_list (CONSTRUCTOR_ELTS (t), flags);
- output_add_character (scratch_buffer, '}');
+ if (TREE_TYPE (t) && !CONSTRUCTOR_ELTS (t))
+ {
+ dump_type (TREE_TYPE (t), 0);
+ output_add_character (scratch_buffer, '(');
+ output_add_character (scratch_buffer, ')');
+ }
+ else
+ {
+ output_add_character (scratch_buffer, '{');
+ dump_expr_list (CONSTRUCTOR_ELTS (t), flags);
+ output_add_character (scratch_buffer, '}');
+ }
+
break;
case OFFSET_REF:
+2003-03-21 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/9898
+ * g++.dg/other/error4.C: New test.
+
2003-03-20 Mark Mitchell <mark@codesourcery.com>
* g++.dg/template/friend17.C: New test.
--- /dev/null
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 21 Mar 2003 <nathan@codesourcery.com>
+
+// PR 9898. Confusing error message
+
+struct Wrapper {};
+
+void Foo(int const &); // { dg-error "in passing" "" }
+
+void Baz ()
+{
+ Foo (Wrapper ()); // { dg-error "convert `Wrapper *\\(\\)' to" "" }
+}