public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/93807] -std=c++2a allows to omit out-of-class declaration in template class Date: Tue, 21 Apr 2020 22:05:56 +0000 [thread overview] Message-ID: <bug-93807-4-NVqVCv3xai@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-93807-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93807 Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |ASSIGNED Keywords|accepts-invalid | CC| |mpolacek at gcc dot gnu.org Last reconfirmed| |2020-04-21 Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org --- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> --- I think this is valid code: C++20 [temp.names]/2 says "A name is also considered to refer to a template if it is an unqualified-id followed by a < and name lookup either finds one or more functions or finds nothing." so when we're parsing constexpr friend bool operator==<T>(T lhs, const Foo& rhs); we treat "operator==" as a template name, because name lookup of "operator==" found nothing and we have an operator-function-id, which is an unqualified-id. So the declaration isn't needed to treat "operator==<T>" as a template-id. I'll add the test.
next parent reply other threads:[~2020-04-21 22:05 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-93807-4@http.gcc.gnu.org/bugzilla/> 2020-04-21 22:05 ` mpolacek at gcc dot gnu.org [this message] 2020-04-21 22:18 ` mpolacek at gcc dot gnu.org 2020-04-22 19:54 ` cvs-commit at gcc dot gnu.org 2020-04-22 19:55 ` 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-93807-4-NVqVCv3xai@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: linkBe 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).