This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ diagnostic] Handle MEMBER_REF/DOTSTAR_EXPR in C++ dump_expr (PR c++/33844)
On Fri, Oct 26, 2007 at 03:05:09PM -0500, Gabriel Dos Reis wrote:
> On Fri, 26 Oct 2007, Jakub Jelinek wrote:
>
> | On Fri, Oct 26, 2007 at 01:34:02PM -0500, Gabriel Dos Reis wrote:
> | > No, one would need to set a `scope' cutoff.
> |
> | So should reinit_cxx_pp set enclosing_scope to current_function_decl
> | instead of 0?
>
> Yes, try it out if it works.
With the additional patch below other/ptrmem8.C reports:
/usr/src/gcc/gcc/testsuite/g++.dg/other/ptrmem8.C: In function 'void foo(void (A::*)())':
/usr/src/gcc/gcc/testsuite/g++.dg/other/ptrmem8.C:9: error: invalid use of 'a.*f' to form a pointer-to-member-function
/usr/src/gcc/gcc/testsuite/g++.dg/other/ptrmem8.C:9: note: a qualified-id is required
/usr/src/gcc/gcc/testsuite/g++.dg/other/ptrmem8.C: In function 'void bar(void (A::*)())':
/usr/src/gcc/gcc/testsuite/g++.dg/other/ptrmem8.C:15: error: invalid use of 'p->*f' to form a pointer-to-member-function
/usr/src/gcc/gcc/testsuite/g++.dg/other/ptrmem8.C:15: note: a qualified-id is required
and no regressions appear in regression testing.
Ok to commit both patches to the trunk?
2007-10-27 Jakub Jelinek <jakub@redhat.com>
* error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope
to current_function_decl rather than 0.
--- gcc/cp/error.c.jj 2007-10-26 18:06:15.000000000 +0200
+++ gcc/cp/error.c 2007-10-27 11:52:10.000000000 +0200
@@ -2107,7 +2107,7 @@ reinit_cxx_pp (void)
pp_base (cxx_pp)->padding = pp_none;
pp_indentation (cxx_pp) = 0;
pp_needs_newline (cxx_pp) = false;
- cxx_pp->enclosing_scope = 0;
+ cxx_pp->enclosing_scope = current_function_decl;
}
Jakub