This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49003] [C++0x] decltype in member function's trailing return type should deduce constness of *this
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 16 May 2011 15:04:24 +0000
- Subject: [Bug c++/49003] [C++0x] decltype in member function's trailing return type should deduce constness of *this
- Auto-submitted: auto-generated
- References: <bug-49003-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49003
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-05-16 14:48:13 UTC ---
A simpler test for DR 1207 being implemented is:
struct A {
auto a() const -> decltype(this) { return this; }
};
nc.cc:2:32: error: invalid use of 'this' at top level
nc.cc:2:32: error: invalid use of 'this' at top level
The late-specified return type should be accepted with the same type as the
return statement's expression i.e. const A*