2003-10-06 Mark Mitchell <mark@codesourcery.com>
+ PR c++/10147
+ * call.c (initialize_reference): Tweak error message.
+ * cxx-pretty-print.h (cxx_pretty_printer_flags): Remove
+ pp_cxx_flag_qualified_id and pp_cxx_flag_global_scope.
+ * cxx-pretty-print.c (pp_cxx_id_expression): Always display
+ qualified entities using qualified names.
+
+ PR c++/12337
+ * init.c (build_new_1): Make sure that the expression returned is
+ not an lvalue.
+
+ PR c++/12344, c++/12236, c++/8656
+ * decl.c (start_function): Do not ignore attributes embedded in a
+ function declarator.
+
+2003-10-06 Mark Mitchell <mark@codesourcery.com>
+
* Make-lang.in (c++.info): Remove.
(c++.dvi): Remove.
(c++.generated-manpages): Replace with ...
"type '%T' from a temporary of type '%T'",
type, TREE_TYPE (expr));
else
- error ("could not convert `%E' to `%T'", expr, type);
+ error ("invalid initialization of reference of type "
+ "'%T' from expression of type '%T'", type,
+ TREE_TYPE (expr));
return error_mark_node;
}
{
if (TREE_CODE (t) == OVERLOAD)
t = OVL_CURRENT (t);
- if ((TREE_CODE (t) == FUNCTION_DECL && DECL_FUNCTION_MEMBER_P (t))
- || (pp_c_base (pp)->flags
- & (pp_cxx_flag_qualified_id | pp_cxx_flag_global_scope)))
+ if (DECL_P (t) && DECL_CONTEXT (t))
pp_cxx_qualified_id (pp, t);
else
pp_cxx_unqualified_id (pp, t);
typedef enum
{
/* Ask for an qualified-id. */
- pp_cxx_flag_qualified_id = 1 << pp_c_flag_last_bit,
- pp_cxx_flag_global_scope = 1 << (pp_c_flag_last_bit + 1),
- pp_cxx_flag_default_argument = 1 << (pp_c_flag_last_bit + 2)
+ pp_cxx_flag_default_argument = 1 << pp_c_flag_last_bit
} cxx_pretty_printer_flags;
}
else
{
- decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, 1, NULL);
+ decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, 1, &attrs);
/* If the declarator is not suitable for a function definition,
cause a syntax error. */
if (decl1 == NULL_TREE || TREE_CODE (decl1) != FUNCTION_DECL)
}
/* Convert to the final type. */
- return build_nop (pointer_type, rval);
+ rval = build_nop (pointer_type, rval);
+
+ /* A new-expression is never an lvalue. */
+ if (real_lvalue_p (rval))
+ rval = build1 (NON_LVALUE_EXPR, TREE_TYPE (rval), rval);
+
+ return rval;
}
\f
static tree
+2003-10-06 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10147
+ * g++.dg/other/error4.C: Update error messages.
+ * g++.dg/template/ptrmem4.C: Likewise.
+
+ PR c++/12337
+ * g++.dg/init/new9.C: New test.
+
+ PR c++/12334, c++/12236, c++/8656
+ * g++.dg/ext/attrib8.C: New test.
+
2003-10-06 Devang Patel <dpatel@apple.com>
* gcc.dg/debug/dwarf2-3.h: New test.
--- /dev/null
+// PR 8656
+
+extern int * (__attribute__((stdcall)) *fooPtr)( void);
+int * __attribute__((stdcall)) myFn01( void) { return 0; }
+
+void snafu( void)
+{
+ fooPtr = myFn01;
+}
--- /dev/null
+// PR 12337
+
+class A {};
+
+template <typename T>
+class X : public A {
+public:
+ X(T&);
+};
+
+class B {
+public:
+ bool foo(A*);
+ template <typename T>
+ bool foo(T& t) { return foo(new X<T>(t)); }
+};
+
+int main()
+{
+ B x, y;
+ x.foo(y);
+}
void Baz ()
{
- Foo (Wrapper ()); // { dg-error "convert `Wrapper *\\(\\)' to" "" }
+ Foo (Wrapper ()); // { dg-error "Wrapper" "" }
}
void SpyExample::ready()
{
- queryAliases(inputs); // { dg-error "convert" }
+ queryAliases(inputs); // { dg-error "" }
}