http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53721

             Bug #: 53721
           Summary: "this" not allowed in trailing return type
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: spe56...@vivid.ocn.ne.jp


gcc 4.7.0 outputs following errors when "this" pointer used in trailing return
type:
error: invalid use of incomplete type 'struct A'
error: forward declaration of 'struct A'
error: invalid use of incomplete type 'struct A'
error: forward declaration of 'struct A'

However, according to [expr.prim.general]ยง5.1.1 clause 3 it should be valid
because it appears after the "cv-qualifier-seq".

Code Example:

struct A
{
    void f() {};
    auto g() -> decltype(this->f())
    {

    }

};

Possible duplicate of Bug 52869, however that is about noexcept clauses.

Reply via email to