public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97679] New: ICE with CTAD on a nested class template with constrained constructor
@ 2020-11-02 18:47 ppalka at gcc dot gnu.org
  2020-11-03  2:56 ` [Bug c++/97679] ICE with CTAD for " ppalka at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2020-11-02 18:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97679
           Summary: ICE with CTAD on a nested class template with
                    constrained constructor
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppalka at gcc dot gnu.org
  Target Milestone: ---

$ cat testcase.C
template <bool V> struct A {
  template <class T> struct B { B(T) requires V; };
};

A<true>::B x(0);

$ g++ -std=c++20 testcase.C
testcase.C: In substitution of ‘template<class T> B(T)-> A<true>::B<T> requires
 T [with T = int]’:
testcase.C:5:15:   required from here
testcase.C:5:15: internal compiler error: Segmentation fault
    5 | A<true>::B x(0);
      |               ^

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

* [Bug c++/97679] ICE with CTAD for a nested class template with constrained constructor
  2020-11-02 18:47 [Bug c++/97679] New: ICE with CTAD on a nested class template with constrained constructor ppalka at gcc dot gnu.org
@ 2020-11-03  2:56 ` ppalka at gcc dot gnu.org
  2021-01-19 15:43 ` [Bug c++/97679] [10/11 Regression] [concepts] " ppalka at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2020-11-03  2:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
            Summary|ICE with CTAD on a nested   |ICE with CTAD for a nested
                   |class template with         |class template with
                   |constrained constructor     |constrained constructor
   Last reconfirmed|                            |2020-11-03
           Assignee|unassigned at gcc dot gnu.org      |ppalka at gcc dot gnu.org
     Ever confirmed|0                           |1
      Known to fail|                            |10.2.0, 11.0

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

* [Bug c++/97679] [10/11 Regression] [concepts] ICE with CTAD for a nested class template with constrained constructor
  2020-11-02 18:47 [Bug c++/97679] New: ICE with CTAD on a nested class template with constrained constructor ppalka at gcc dot gnu.org
  2020-11-03  2:56 ` [Bug c++/97679] ICE with CTAD for " ppalka at gcc dot gnu.org
@ 2021-01-19 15:43 ` ppalka at gcc dot gnu.org
  2021-02-26 12:13 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-01-19 15:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |9.3.0
           Keywords|                            |ice-on-valid-code
            Summary|ICE with CTAD for a nested  |[10/11 Regression]
                   |class template with         |[concepts] ICE with CTAD
                   |constrained constructor     |for a nested class template
                   |                            |with constrained
                   |                            |constructor
   Target Milestone|---                         |10.3

--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
This is apparently a regression relative to GCC 9 (when compiled with
-std=c++2a -fconcepts).  Seems to have started with the C++20 concepts merge
r276764.

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

* [Bug c++/97679] [10/11 Regression] [concepts] ICE with CTAD for a nested class template with constrained constructor
  2020-11-02 18:47 [Bug c++/97679] New: ICE with CTAD on a nested class template with constrained constructor ppalka at gcc dot gnu.org
  2020-11-03  2:56 ` [Bug c++/97679] ICE with CTAD for " ppalka at gcc dot gnu.org
  2021-01-19 15:43 ` [Bug c++/97679] [10/11 Regression] [concepts] " ppalka at gcc dot gnu.org
@ 2021-02-26 12:13 ` rguenth at gcc dot gnu.org
  2021-04-08 12:02 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-02-26 12:13 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

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

* [Bug c++/97679] [10/11 Regression] [concepts] ICE with CTAD for a nested class template with constrained constructor
  2020-11-02 18:47 [Bug c++/97679] New: ICE with CTAD on a nested class template with constrained constructor ppalka at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-02-26 12:13 ` rguenth at gcc dot gnu.org
@ 2021-04-08 12:02 ` rguenth at gcc dot gnu.org
  2021-04-08 17:10 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-08 12:02 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.3                        |10.4

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10.3 is being released, retargeting bugs to GCC 10.4.

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

* [Bug c++/97679] [10/11 Regression] [concepts] ICE with CTAD for a nested class template with constrained constructor
  2020-11-02 18:47 [Bug c++/97679] New: ICE with CTAD on a nested class template with constrained constructor ppalka at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-04-08 12:02 ` rguenth at gcc dot gnu.org
@ 2021-04-08 17:10 ` cvs-commit at gcc dot gnu.org
  2021-04-08 20:06 ` [Bug c++/97679] [10 " ppalka at gcc dot gnu.org
  2022-05-04  0:28 ` ppalka at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-08 17:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:05708d6eef87a3dd0c68b1aed7f8d9c3824062b8

commit r11-8064-g05708d6eef87a3dd0c68b1aed7f8d9c3824062b8
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu Apr 8 13:07:37 2021 -0400

    c++: constrained CTAD for nested class template [PR97679]

    In the testcase below, we're crashing during constraint checking of the
    implicitly generated deduction guides for the nested class template A::B
    because we never substitute the outer template arguments (for A) into
    the constraint, neither ahead of time nor as part of satisfaction.

    Ideally we'd like to avoid substituting into a constraint ahead of
    time, but the "flattening" vector 'tsubst_args' is constructed under the
    assumption that all outer template arguments are already substituted in,
    and eliminating this assumption to yield a flattening vector that
    includes outer (generic) template arguments suitable for substituting
    into the constraint would be tricky and error-prone.  So this patch
    takes the approximate approach of substituting the outer arguments into
    the constraint ahead of time, so that the subsequent substitution of
    'tsubst_args' is coherent and so later satisfaction just works.

    gcc/cp/ChangeLog:

            PR c++/97679
            * pt.c (build_deduction_guide): Document OUTER_ARGS.  Substitute
            them into the propagated constraints.

    gcc/testsuite/ChangeLog:

            PR c++/97679
            * g++.dg/cpp2a/concepts-ctad3.C: New test.

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

* [Bug c++/97679] [10 Regression] [concepts] ICE with CTAD for a nested class template with constrained constructor
  2020-11-02 18:47 [Bug c++/97679] New: ICE with CTAD on a nested class template with constrained constructor ppalka at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-04-08 17:10 ` cvs-commit at gcc dot gnu.org
@ 2021-04-08 20:06 ` ppalka at gcc dot gnu.org
  2022-05-04  0:28 ` ppalka at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-04-08 20:06 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11 Regression]          |[10 Regression] [concepts]
                   |[concepts] ICE with CTAD    |ICE with CTAD for a nested
                   |for a nested class template |class template with
                   |with constrained            |constrained constructor
                   |constructor                 |

--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 11 so far.

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

* [Bug c++/97679] [10 Regression] [concepts] ICE with CTAD for a nested class template with constrained constructor
  2020-11-02 18:47 [Bug c++/97679] New: ICE with CTAD on a nested class template with constrained constructor ppalka at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-04-08 20:06 ` [Bug c++/97679] [10 " ppalka at gcc dot gnu.org
@ 2022-05-04  0:28 ` ppalka at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-05-04  0:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2022-05-04  0:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 18:47 [Bug c++/97679] New: ICE with CTAD on a nested class template with constrained constructor ppalka at gcc dot gnu.org
2020-11-03  2:56 ` [Bug c++/97679] ICE with CTAD for " ppalka at gcc dot gnu.org
2021-01-19 15:43 ` [Bug c++/97679] [10/11 Regression] [concepts] " ppalka at gcc dot gnu.org
2021-02-26 12:13 ` rguenth at gcc dot gnu.org
2021-04-08 12:02 ` rguenth at gcc dot gnu.org
2021-04-08 17:10 ` cvs-commit at gcc dot gnu.org
2021-04-08 20:06 ` [Bug c++/97679] [10 " ppalka at gcc dot gnu.org
2022-05-04  0:28 ` 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).