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++ Patch / RFC] PR 54864


On 08/07/2013 03:17 PM, Paolo Carlini wrote:
the issue here is that... I'm not sure the bug report is valid ;)
Seriously, *if* we think it is, must be fixable with a moderate effort.
Here Jason fixed the closely related c++/53721:

     http://gcc.gnu.org/ml/gcc-patches/2013-04/msg01445.html

and tweaking a bit more the check would allow this variant too, with
outer pointing to the enclosing S:

struct S
{
     int foo();

     struct nested
     {
         S* outer;

         auto bar() -> decltype(outer->foo());
     };
};


but I'm not sure it's valid code: for example clang accepts it, icc
doesn't.

The rule that allows use of *this is pretty specific:

Unlike the object expression in other contexts, *this is not required to be of complete type for purposes of class member access (5.2.5) outside the member function body.

That doesn't seem to allow the use of *outer.

Jason


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