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]

[C++ Patch / RFC] PR 54864


Hi,

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. If it is, something along the lines of the attached (with at least an improved comment: we want to say something like pointer to this *or* to enclosing class) works for the testcase (and a few positive and negative variants) and lightly tested on x86_64-linux.

Thanks!
Paolo.

/////////////////////////



Attachment: p
Description: Text document


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