public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59186] decltype(this) treated specially in trailing-return-specifier
       [not found] <bug-59186-4@http.gcc.gnu.org/bugzilla/>
@ 2013-11-19  6:28 ` potswa at mac dot com
  2013-11-19  9:59 ` osensei80 at gmail dot com
  2013-11-19 11:10 ` potswa at mac dot com
  2 siblings, 0 replies; 3+ messages in thread
From: potswa at mac dot com @ 2013-11-19  6:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from David Krauss <potswa at mac dot com> ---
Just to clarify, in the last paragraph, decltype(this) has the same meaning in
both cases according to the standard but the bug causes it to refer to the
inner type instead of the outer type.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/59186] decltype(this) treated specially in trailing-return-specifier
       [not found] <bug-59186-4@http.gcc.gnu.org/bugzilla/>
  2013-11-19  6:28 ` [Bug c++/59186] decltype(this) treated specially in trailing-return-specifier potswa at mac dot com
@ 2013-11-19  9:59 ` osensei80 at gmail dot com
  2013-11-19 11:10 ` potswa at mac dot com
  2 siblings, 0 replies; 3+ messages in thread
From: osensei80 at gmail dot com @ 2013-11-19  9:59 UTC (permalink / raw)
  To: gcc-bugs

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

Marcel Wid <osensei80 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |osensei80 at gmail dot com

--- Comment #2 from Marcel Wid <osensei80 at gmail dot com> ---
§5.1.1/3 [expr.prim.general] states:

"If a declaration declares a member function or member function template of a
class X, the expression this is a prvalue of type “pointer to cv-qualifier-seq
X” between the optional cv-qualifer-seq and the end of the function-definition,
member-declarator, or declarator. It shall not appear before the optional
cv-qualifier-seq and it shall not appear within the declaration of a static
member function (although its type and value category are defined within a
static member function as they are within a non-static member function)."

Hence, I think gcc 4.9 is correct: 

struct s {
  auto f() -> decltype(this) { return this; } // `this` refers to `struct s`
  void g() {
    struct t {
      decltype(this) g() { return static_cast<s*>(nullptr); } // same as above
      auto h() -> decltype(this) { return static_cast<s*>(nullptr); } // here
`this` refers to the inner struct `t` and there is no conversion from `s*` to
`s::g()::t*`.
    };
  }
};
>From gcc-bugs-return-435012-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Nov 19 10:09:23 2013
Return-Path: <gcc-bugs-return-435012-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 25108 invoked by alias); 19 Nov 2013 10:09:22 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 25075 invoked by uid 48); 19 Nov 2013 10:09:18 -0000
From: "schwab@linux-m68k.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/58421] [4.9 regression] FAIL: gcc.c-torture/compile/20051216-1.c  -O3 -fomit-frame-pointer  (internal compiler error)
Date: Tue, 19 Nov 2013 10:09:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: schwab@linux-m68k.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-58421-4-lq1yywiUXW@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58421-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58421-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-11/txt/msg01789.txt.bz2
Content-length: 156

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX421

--- Comment #4 from Andreas Schwab <schwab@linux-m68k.org> ---
Somewhere between 20131030 and 20131101.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/59186] decltype(this) treated specially in trailing-return-specifier
       [not found] <bug-59186-4@http.gcc.gnu.org/bugzilla/>
  2013-11-19  6:28 ` [Bug c++/59186] decltype(this) treated specially in trailing-return-specifier potswa at mac dot com
  2013-11-19  9:59 ` osensei80 at gmail dot com
@ 2013-11-19 11:10 ` potswa at mac dot com
  2 siblings, 0 replies; 3+ messages in thread
From: potswa at mac dot com @ 2013-11-19 11:10 UTC (permalink / raw)
  To: gcc-bugs

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

David Krauss <potswa at mac dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from David Krauss <potswa at mac dot com> ---
Ah, you are correct. I missed that because I expected to find it in
[class.this].


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-19 11:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-59186-4@http.gcc.gnu.org/bugzilla/>
2013-11-19  6:28 ` [Bug c++/59186] decltype(this) treated specially in trailing-return-specifier potswa at mac dot com
2013-11-19  9:59 ` osensei80 at gmail dot com
2013-11-19 11:10 ` potswa at mac dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).