[Bug c++/52869] New: "this" not being allowed in noexcept clauses
dave at boostpro dot com
gcc-bugzilla@gcc.gnu.org
Wed Apr 4 15:47:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52869
Bug #: 52869
Summary: "this" not being allowed in noexcept clauses
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: dave@boostpro.com
Given the following, GCC says: "error: invalid use of 'this' at top level"
However, according to [expr.prim.general]/3 'this'
should be valid in the exception-specification as it comes after the
member function's optional cv-qualifier-seq.
#define RETURNS(...) noexcept(noexcept(__VA_ARGS__)) -> decltype(__VA_ARGS__)
{ return (__VA_ARGS__); }
struct mul_ {
int operator()() const { return 1; }
template <typename A>
A operator()(A const & a) const noexcept(A(std::move(a))) { return a; }
template <typename A, typename B, typename... C>
auto operator()(A const & a, B const & b, C const &... c) const
RETURNS((*this)(a * b, c...))
};
More information about the Gcc-bugs
mailing list