This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ Patch] PR 17763
- From: Paolo Carlini <pcarlini at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Mark Mitchell <mark at codesourcery dot com>
- Date: Fri, 10 Aug 2007 16:32:23 +0200
- Subject: [C++ Patch] PR 17763
Hi,
this is to fix the remaining bit of the PR. Tested x86_64-linux.
Ok for mainline (and then 4_2 and 4_1)?
////////////////////
/cp
2007-08-10 Paolo Carlini <pcarlini@suse.de>
PR c++/17763
* error.c (dump_expr): Consistently use the *_cxx_*
variants of the pretty-print functions.
/testsuite
2007-08-10 Paolo Carlini <pcarlini@suse.de>
PR c++/17763
* g++.dg/other/error16.C: New.
Index: testsuite/g++.dg/other/error16.C
===================================================================
*** testsuite/g++.dg/other/error16.C (revision 0)
--- testsuite/g++.dg/other/error16.C (revision 0)
***************
*** 0 ****
--- 1,14 ----
+ // PR c++/17763
+
+ template <typename U> struct Outer {
+ struct Inner {};
+ Inner foo();
+ };
+
+ typedef int X;
+ typedef Outer<X> XOuter;
+
+ int main() {
+ Outer<int> ab;
+ ab.foo() == 1; // { dg-error "ab.Outer" }
+ }
Index: cp/error.c
===================================================================
*** cp/error.c (revision 127330)
--- cp/error.c (working copy)
*************** dump_expr (tree t, int flags)
*** 1550,1562 ****
if (TREE_CODE (ob) == ADDR_EXPR)
{
dump_expr (TREE_OPERAND (ob, 0), flags | TFF_EXPR_IN_PARENS);
! pp_dot (cxx_pp);
}
else if (TREE_CODE (ob) != PARM_DECL
|| strcmp (IDENTIFIER_POINTER (DECL_NAME (ob)), "this"))
{
dump_expr (ob, flags | TFF_EXPR_IN_PARENS);
! pp_arrow (cxx_pp);
}
skipfirst = true;
}
--- 1550,1562 ----
if (TREE_CODE (ob) == ADDR_EXPR)
{
dump_expr (TREE_OPERAND (ob, 0), flags | TFF_EXPR_IN_PARENS);
! pp_cxx_dot (cxx_pp);
}
else if (TREE_CODE (ob) != PARM_DECL
|| strcmp (IDENTIFIER_POINTER (DECL_NAME (ob)), "this"))
{
dump_expr (ob, flags | TFF_EXPR_IN_PARENS);
! pp_cxx_arrow (cxx_pp);
}
skipfirst = true;
}