2007-09-18 Paolo Carlini <pcarlini@suse.de>
PR c++/33463
* cxx-pretty-print.c (pp_cxx_postfix_expression): Split
out case TYPEID_EXPR to...
(pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
and pp_cxx_right_paren.
* cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
* error.c (dump_expr): Use it.
/testsuite
2007-09-18 Paolo Carlini <pcarlini@suse.de>
PR c++/33463
* g++.dg/rtti/typeid6.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128582
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-09-18 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/33463
+ * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
+ out case TYPEID_EXPR to...
+ (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
+ and pp_cxx_right_paren.
+ * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
+ * error.c (dump_expr): Use it.
+
2007-09-18 Paolo Carlini <pcarlini@suse.de>
PR c++/33464
break;
case TYPEID_EXPR:
- t = TREE_OPERAND (t, 0);
- pp_cxx_identifier (pp, "typeid");
- pp_left_paren (pp);
- if (TYPE_P (t))
- pp_cxx_type_id (pp, t);
- else
- pp_cxx_expression (pp, t);
- pp_right_paren (pp);
+ pp_cxx_typeid_expression (pp, t);
break;
case PSEUDO_DTOR_EXPR:
}
}
+void
+pp_cxx_typeid_expression (cxx_pretty_printer *pp, tree t)
+{
+ t = TREE_OPERAND (t, 0);
+ pp_cxx_identifier (pp, "typeid");
+ pp_cxx_left_paren (pp);
+ if (TYPE_P (t))
+ pp_cxx_type_id (pp, t);
+ else
+ pp_cxx_expression (pp, t);
+ pp_cxx_right_paren (pp);
+}
+
void
pp_cxx_trait_expression (cxx_pretty_printer *pp, tree t)
{
void pp_cxx_declaration (cxx_pretty_printer *, tree);
void pp_cxx_canonical_template_parameter (cxx_pretty_printer *, tree);
void pp_cxx_trait_expression (cxx_pretty_printer *, tree);
+void pp_cxx_typeid_expression (cxx_pretty_printer *, tree);
#endif /* GCC_CXX_PRETTY_PRINT_H */
pp_cxx_trait_expression (cxx_pp, t);
break;
+ case TYPEID_EXPR:
+ pp_cxx_typeid_expression (cxx_pp, t);
+ break;
+
/* This list is incomplete, but should suffice for now.
It is very important that `sorry' does not call
`report_error_function'. That could cause an infinite loop. */
+2007-09-18 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/33463
+ * g++.dg/rtti/typeid6.C: New.
+
2007-09-18 Paolo Carlini <pcarlini@suse.de>
PR c++/33464
--- /dev/null
+// PR c++/33463
+
+namespace std
+{
+ class type_info {};
+}
+
+template<int> void foo()
+{
+ !typeid(void); // { dg-error "!typeid\\(void\\)|candidates" }
+}