2008-01-02 Volker Reichelt <reichelt@netcologne.de>
Backport:
+ 2007-10-31 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/33494
+ * cxx-pretty-print.c (pp_cxx_typeid_expression,
+ pp_cxx_delete_expression): Change to static linkage.
+ * cxx-pretty-print.h: Adjust declarations.
+ * error.c (dump_expr, case SCOPE_REF, TYPEID_EXPR, DELETE_EXPR,
+ VEC_DELETE_EXPR, MODOP_EXPR): Forward to pp_expression.
+
+ * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR):
+ Fix typo.
+
2007-11-02 Paolo Carlini <pcarlini@suse.de>
PR c++/33495
static void pp_cxx_statement (cxx_pretty_printer *, tree);
static void pp_cxx_template_parameter (cxx_pretty_printer *, tree);
static void pp_cxx_cast_expression (cxx_pretty_printer *, tree);
+static void pp_cxx_typeid_expression (cxx_pretty_printer *, tree);
\f
static inline void
::(opt) delete cast-expression
::(opt) delete [ ] cast-expression */
-void
+static void
pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t)
{
enum tree_code code = TREE_CODE (t);
case NON_DEPENDENT_EXPR:
case MUST_NOT_THROW_EXPR:
- pp_cxx_expression (pp, t);
+ pp_cxx_expression (pp, TREE_OPERAND (t, 0));
break;
default:
}
}
-void
+static void
pp_cxx_typeid_expression (cxx_pretty_printer *pp, tree t)
{
t = TREE_OPERAND (t, 0);
void pp_cxx_declaration (cxx_pretty_printer *, tree);
void pp_cxx_canonical_template_parameter (cxx_pretty_printer *, tree);
-void pp_cxx_typeid_expression (cxx_pretty_printer *, tree);
void pp_cxx_va_arg_expression (cxx_pretty_printer *, tree);
-void pp_cxx_delete_expression (cxx_pretty_printer *, tree);
#endif /* GCC_CXX_PRETTY_PRINT_H */
dump_decl (TEMPLATE_PARM_DECL (t), flags & ~TFF_DECL_SPECIFIERS);
break;
- case SCOPE_REF:
- pp_expression (cxx_pp, t);
- break;
-
case CAST_EXPR:
if (TREE_OPERAND (t, 0) == NULL_TREE
|| TREE_CHAIN (TREE_OPERAND (t, 0)))
dump_expr (TREE_OPERAND (t, 0), flags);
break;
- case TYPEID_EXPR:
- pp_cxx_typeid_expression (cxx_pp, t);
- break;
-
case VA_ARG_EXPR:
pp_cxx_va_arg_expression (cxx_pp, t);
break;
+ case SCOPE_REF:
+ case TYPEID_EXPR:
case DELETE_EXPR:
case VEC_DELETE_EXPR:
- pp_cxx_delete_expression (cxx_pp, t);
+ case MODOP_EXPR:
+ pp_expression (cxx_pp, t);
break;
/* This list is incomplete, but should suffice for now.
2008-01-02 Volker Reichelt <reichelt@netcologne.de>
Backport:
+ 2007-10-31 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/33494
+ * g++.dg/template/error35.C: New.
+
2007-11-02 Paolo Carlini <pcarlini@suse.de>
PR c++/33495
--- /dev/null
+// PR c++/33494
+
+template<int> void foo(int(*f=0)()); // { dg-error "declared void|scope|erroneous-expression" }