This is the mail archive of the gcc-bugs@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]

[Bug c++/49003] [C++0x] decltype in member function's trailing return type should deduce constness of *this


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*


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