This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ diagnostic] Handle MEMBER_REF/DOTSTAR_EXPR in C++ dump_expr (PR c++/33844)


Paolo Carlini <pcarlini@suse.de> writes:

| Hi,
| > --- gcc/testsuite/g++.dg/other/ptrmem8.C.jj	2007-10-26 18:08:53.000000000 +0200
| > +++ gcc/testsuite/g++.dg/other/ptrmem8.C	2007-10-26 18:14:30.000000000 +0200
| > @@ -0,0 +1,16 @@
| > +// PR c++/33844
| > +// { dg-do compile }
| > +
| > +struct A {};
| > +
| > +template<int> void foo(void (A::* f)())
| > +{
| > +  A a;
| > +  &(a.*f);	// { dg-error "invalid use of\[^\n\]*\\.\\*\[^\n\]*to form|qualified-id is required" }
| > +}
| > +
| > +template<int> void bar(void (A::* f)())
| > +{
| > +  A *p;
| > +  &(p->*f);	// { dg-error "invalid use of\[^\n\]*->\\*\[^\n\]*to form|qualified-id is required" }
| > +}
| >   
| In the output I'm seeing:
| 
| Âfoo::a.*foo::f'
| 
| and
| 
| Âfoo::p->*foo::fÂ
| 
| are we really sure we want to qualify with foo:: like that?

No, one would need to set a `scope' cutoff.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]