public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/100752] New: [11/12 Regression]
Date: Tue, 25 May 2021 09:01:37 +0000	[thread overview]
Message-ID: <bug-100752-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100752

            Bug ID: 100752
           Summary: [11/12 Regression]
           Product: gcc
           Version: 11.1.1
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
                CC: jason at gcc dot gnu.org
  Target Milestone: ---

As noted in Bug 52869 comment 20, this has started to fail:

struct S
{
    void f() noexcept {}
    S &g() noexcept(noexcept(f())) { f(); return *this; }
};

noex.C:4:32: error: cannot call member function ‘void S::f()’ without object
    4 |     S &g() noexcept(noexcept(f())) { f(); return *this; }
      |                                ^


It started with r11-289:

     c++: Use of 'this' in parameter declaration [PR90748]

    We were incorrectly accepting the use of 'this' at parse time and then
    crashing when we tried to instantiate it.  It is invalid because 'this' is
    not in scope until after the function-cv-quals.  So let's hoist setting
    current_class_ptr up from cp_parser_late_return_type_opt into
    cp_parser_direct_declarator where it can work for noexcept as well.


            PR c++/90748
            * parser.c (inject_parm_decls): Set current_class_ptr here.
            (cp_parser_direct_declarator): And here.
            (cp_parser_late_return_type_opt): Not here.
            (cp_parser_noexcept_specification_opt): Nor here.
            (cp_parser_exception_specification_opt)
            (cp_parser_late_noexcept_specifier): Remove unneeded parameters.

             reply	other threads:[~2021-05-25  9:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25  9:01 redi at gcc dot gnu.org [this message]
2021-05-25  9:03 ` [Bug c++/100752] [11/12 Regression] error: cannot call member function ‘void S::f()’ without object redi at gcc dot gnu.org
2021-05-25  9:14 ` rguenth at gcc dot gnu.org
2021-05-26 19:24 ` jason at gcc dot gnu.org
2021-05-26 19:35 ` jason at gcc dot gnu.org
2021-05-26 19:35 ` jason at gcc dot gnu.org
2021-05-26 19:40 ` mpolacek at gcc dot gnu.org
2021-06-08 21:10 ` mpolacek at gcc dot gnu.org
2021-06-08 21:12 ` jason at gcc dot gnu.org
2021-06-26  0:12 ` cvs-commit at gcc dot gnu.org
2021-06-26  0:12 ` [Bug c++/100752] [11 " mpolacek at gcc dot gnu.org
2021-06-29 13:18 ` cvs-commit at gcc dot gnu.org
2021-06-29 13:19 ` mpolacek at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-100752-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).