public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98939] New: [C++23] Implement P1787R6 "Declarations and where to find them"
@ 2021-02-02 19:40 jason at gcc dot gnu.org
  2021-02-02 19:40 ` [Bug c++/98939] " jason at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2021-02-02 19:40 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98939
           Summary: [C++23] Implement P1787R6 "Declarations and where to
                    find them"
           Product: gcc
           Version: 10.0
               URL: http://wg21.link/p1787r6
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jason at gcc dot gnu.org
  Target Milestone: ---

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

::template is also not required in type-only contexts:

template <class T> auto f(T t) { return static_cast<T::X<int>>(t); } // OK

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

One change that might break a small amount of existing code:

Since lookup for a name after . or -> now happens first in the scope of the
object, .template is required in dependent.template X<...> even if a definition
of X would be found by unqualified lookup.

template <int> struct X { void f(); };
template <class T> void g(T t) { t.X<2>::f(); } // error, needs .template

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

end of thread, other threads:[~2023-03-28 20:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02 19:40 [Bug c++/98939] New: [C++23] Implement P1787R6 "Declarations and where to find them" 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
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

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