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++/98939] [C++23] Implement P1787R6 "Declarations and where to find them"
Date: Thu, 08 Jul 2021 17:05:04 +0000	[thread overview]
Message-ID: <bug-98939-4-zoCrDE0oJr@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98939-4@http.gcc.gnu.org/bugzilla/>

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to Jason Merrill from comment #0)
> The changes from this paper should not affect a significant amount of code;
> many are clarifications that bring the wording in line with existing
> practice, some are clarifications of corner cases that most code doesn't
> depend on, like ambiguous lookup within a conversion-type-id.
> 
> A few changes that allow code that has been ill-formed:
> 
> conversion-type-id is added to the list of type-only contexts from P0634:
> 
> template <class T> struct A { operator T::type(); }; // OK

This already works; I fixed it via DR 2413 in GCC 10.

> ::template is also not required in type-only contexts:
> 
> template <class T> auto f(T t) { return static_cast<T::X<int>>(t); } // OK

This needs to be implemented, but it's in the spirit of P0634 which I
implemented.  Strongly related to DR 1478.

It's also reminiscent of CWG 96 which is assigned to me.

> Default template arguments are now complete-class contexts, like default
> function arguments:
> 
> template <class T> struct A {
>   template <int I = sizeof(t)> void g() { } // OK
>   T t;
> };

This is DR 1635 / bug 57314.

Since I've dealt with deferred parsing quite often recently (in the context of
deferred noexcept parsing), I might as well tackle this one too.  My hope is
that the very same trick of stashing the tokens and then reparsing them at the
end of the class will work here too.  This will probably need some kind of
tparm -> defarg mapping.

So it looks like I'm in a position to fix at least parts of this proposal, thus
mine for now.


A question worth considering is whether we only want to allow the code in
C++23, or whether we really want to treat those issues as DRs, and so allow the
code in previous modes.  P0634 is only enabled in C++20, so it makes the best
sense to me to only allow the above in C++23.

  parent reply	other threads:[~2021-07-08 17:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02 19:40 [Bug c++/98939] New: " jason at gcc dot gnu.org
2021-02-02 19:40 ` [Bug c++/98939] " jason at gcc dot gnu.org
2021-07-08 17:05 ` mpolacek at gcc dot gnu.org [this message]
2021-11-12 21:14 ` mpolacek at gcc dot gnu.org
2021-11-18 17:38 ` jason at gcc dot gnu.org
2021-11-18 20:05 ` mpolacek at gcc dot gnu.org
2021-11-18 21:59 ` ppalka at gcc dot gnu.org
2021-12-03  5:02 ` pinskia at gcc dot gnu.org
2021-12-03 20:41 ` jason at gcc dot gnu.org
2021-12-04 11:38 ` pinskia at gcc dot gnu.org
2022-02-28 14:55 ` mpolacek at gcc dot gnu.org
2023-03-28 20:07 ` alisdairm at me dot com

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-98939-4-zoCrDE0oJr@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).