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 struct Outer { + struct Inner {}; + Inner foo(); + }; + + typedef int X; + typedef Outer XOuter; + + int main() { + Outer 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; }