public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/79501] member deduction guide not recognized
       [not found] <bug-79501-4@http.gcc.gnu.org/bugzilla/>
@ 2020-09-16 20:03 ` mpolacek at gcc dot gnu.org
  2020-09-16 20:32 ` mpolacek at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-09-16 20:03 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jeanmichael.celerier@gmail.
                   |                            |com

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
*** Bug 86403 has been marked as a duplicate of this bug. ***

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

* [Bug c++/79501] member deduction guide not recognized
       [not found] <bug-79501-4@http.gcc.gnu.org/bugzilla/>
  2020-09-16 20:03 ` [Bug c++/79501] member deduction guide not recognized mpolacek at gcc dot gnu.org
@ 2020-09-16 20:32 ` mpolacek at gcc dot gnu.org
  2021-07-09 18:11 ` ppalka at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-09-16 20:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Expanded test for the second problem:

// PR c++/79501
// { dg-do compile { target c++17 } }

struct X {
  template<typename T>
  struct B { T t; };

  // In C++20, should work even without this guide (P1816).
  template<typename T> B(T) -> B<T>;

  void foo () {
    B{1};
  }
};

void
fn ()
{
  X x;
  x.foo ();
}

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

* [Bug c++/79501] member deduction guide not recognized
       [not found] <bug-79501-4@http.gcc.gnu.org/bugzilla/>
  2020-09-16 20:03 ` [Bug c++/79501] member deduction guide not recognized mpolacek at gcc dot gnu.org
  2020-09-16 20:32 ` mpolacek at gcc dot gnu.org
@ 2021-07-09 18:11 ` ppalka at gcc dot gnu.org
  2021-07-12 20:35 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-07-09 18:11 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

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

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

* [Bug c++/79501] member deduction guide not recognized
       [not found] <bug-79501-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-07-09 18:11 ` ppalka at gcc dot gnu.org
@ 2021-07-12 20:35 ` cvs-commit at gcc dot gnu.org
  2021-08-11 20:00 ` cvs-commit at gcc dot gnu.org
  2021-08-11 20:05 ` ppalka at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-12 20:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:8d75b8830e9dafb4e0c400c723653512adf40295

commit r12-2260-g8d75b8830e9dafb4e0c400c723653512adf40295
Author: Patrick Palka <ppalka@redhat.com>
Date:   Mon Jul 12 16:35:18 2021 -0400

    c++: permit deduction guides at class scope [PR79501]

    This adds support for declaring (class-scope) deduction guides for a
    member class template.  Fortunately it seems only a couple of changes
    are needed in order for the existing CTAD machinery to handle them
    properly: we need to make sure to give them a FUNCTION_TYPE instead of a
    METHOD_TYPE, and we need to avoid using a BASELINK when looking them up.

            PR c++/79501
            PR c++/100983

    gcc/cp/ChangeLog:

            * decl.c (grokfndecl): Don't require that deduction guides are
            declared at namespace scope.  Check that class-scope deduction
            guides have the same access as the member class template.
            (grokdeclarator): Pretend class-scope deduction guides are static.
            * search.c (lookup_member): Don't use a BASELINK for (class-scope)
            deduction guides.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp1z/class-deduction92.C: New test.
            * g++.dg/cpp1z/class-deduction93.C: New test.
            * g++.dg/cpp1z/class-deduction94.C: New test.
            * g++.dg/cpp1z/class-deduction95.C: New test.

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

* [Bug c++/79501] member deduction guide not recognized
       [not found] <bug-79501-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-07-12 20:35 ` cvs-commit at gcc dot gnu.org
@ 2021-08-11 20:00 ` cvs-commit at gcc dot gnu.org
  2021-08-11 20:05 ` ppalka at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-11 20:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:7e39d1a15f5276f72ee478a692445569bb646e65

commit r12-2860-g7e39d1a15f5276f72ee478a692445569bb646e65
Author: Patrick Palka <ppalka@redhat.com>
Date:   Wed Aug 11 15:59:22 2021 -0400

    c++: recognize class-scope non-template dguides [PR79501]

    It looks like we still don't recognize class-scope non-template
    deduction guides even after r12-2260.   This is because deduction guides
    are tagged as such in cp_parser_init_declarator after calling
    cp_parser_declarator, but in cp_parser_member_declaration we call
    cp_parser_declarator directly.

    So let's tag them in cp_parser_member_declaration as well.

            PR c++/79501

    gcc/cp/ChangeLog:

            * parser.c (maybe_adjust_declarator_for_dguide): New, split
            out from ...
            (cp_parser_init_declarator): ... here.
            (cp_parser_member_declaration): Use it.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp1z/class-deduction98.C: New test.

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

* [Bug c++/79501] member deduction guide not recognized
       [not found] <bug-79501-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2021-08-11 20:00 ` cvs-commit at gcc dot gnu.org
@ 2021-08-11 20:05 ` ppalka at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-08-11 20:05 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|---                         |12.0

--- Comment #6 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 12.

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

end of thread, other threads:[~2021-08-11 20:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-79501-4@http.gcc.gnu.org/bugzilla/>
2020-09-16 20:03 ` [Bug c++/79501] member deduction guide not recognized mpolacek at gcc dot gnu.org
2020-09-16 20:32 ` mpolacek at gcc dot gnu.org
2021-07-09 18:11 ` ppalka at gcc dot gnu.org
2021-07-12 20:35 ` cvs-commit at gcc dot gnu.org
2021-08-11 20:00 ` cvs-commit at gcc dot gnu.org
2021-08-11 20:05 ` ppalka 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).