public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52869] New: "this" not being allowed in noexcept clauses
@ 2012-04-04 15:47 dave at boostpro dot com
  2013-09-18 17:54 ` [Bug c++/52869] [DR 1207] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: dave at boostpro dot com @ 2012-04-04 15:47 UTC (permalink / raw)
  To: gcc-bugs

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...))
  };


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

end of thread, other threads:[~2021-05-25  9:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-04 15:47 [Bug c++/52869] New: "this" not being allowed in noexcept clauses dave at boostpro dot com
2013-09-18 17:54 ` [Bug c++/52869] [DR 1207] " redi at gcc dot gnu.org
2015-06-07  8:04 ` lz96 at foxmail dot com
2021-05-25  7:42 ` spam+gcc at alt dot ee
2021-05-25  9:02 ` redi at gcc dot gnu.org

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).