From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4830 invoked by alias); 19 Jun 2012 03:45:43 -0000 Received: (qmail 4821 invoked by uid 22791); 19 Jun 2012 03:45:43 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Jun 2012 03:45:30 +0000 From: "spe56nw9 at vivid dot ocn.ne.jp" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53721] New: "this" not allowed in trailing return type Date: Tue, 19 Jun 2012 03:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: spe56nw9 at vivid dot ocn.ne.jp X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-06/txt/msg01241.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D53721 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: unassigned@gcc.gnu.org ReportedBy: spe56nw9@vivid.ocn.ne.jp gcc 4.7.0 outputs following errors when "this" pointer used in trailing ret= urn 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]=C2=A75.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.