public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105655] New: [12/13 Regression] ICE on invalid deduction
@ 2022-05-19  8:02 egor.pugin at gmail dot com
  2022-05-19  8:22 ` [Bug c++/105655] " marxin at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: egor.pugin at gmail dot com @ 2022-05-19  8:02 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105655
           Summary: [12/13 Regression] ICE on invalid deduction
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: egor.pugin at gmail dot com
  Target Milestone: ---

Works on 11.3, does not work on 12 and trunk.
https://godbolt.org/z/YrEbn3K6f

template <class T>
struct A
{
    template <class L, class R>
    struct B
    {
        B(const L & left, const R & right)
        {}
    };

    template <class L, class R>
    B(const L &, const R &) -> B<L, R>;
};

template <class L, class R>
using C = A<int>::B<L, R>;

int main()
{
    C x{0, 0};
}

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

* [Bug c++/105655] [12/13 Regression] ICE on invalid deduction
  2022-05-19  8:02 [Bug c++/105655] New: [12/13 Regression] ICE on invalid deduction egor.pugin at gmail dot com
@ 2022-05-19  8:22 ` marxin at gcc dot gnu.org
  2022-05-19 10:59 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-05-19  8:22 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-05-19

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r10-5020-g1a291106384cabc7.

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

* [Bug c++/105655] [12/13 Regression] ICE on invalid deduction
  2022-05-19  8:02 [Bug c++/105655] New: [12/13 Regression] ICE on invalid deduction egor.pugin at gmail dot com
  2022-05-19  8:22 ` [Bug c++/105655] " marxin at gcc dot gnu.org
@ 2022-05-19 10:59 ` rguenth at gcc dot gnu.org
  2022-05-25 16:14 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-19 10:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
           Priority|P3                          |P2
            Version|unknown                     |12.1.0
   Target Milestone|---                         |12.2

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

* [Bug c++/105655] [12/13 Regression] ICE on invalid deduction
  2022-05-19  8:02 [Bug c++/105655] New: [12/13 Regression] ICE on invalid deduction egor.pugin at gmail dot com
  2022-05-19  8:22 ` [Bug c++/105655] " marxin at gcc dot gnu.org
  2022-05-19 10:59 ` rguenth at gcc dot gnu.org
@ 2022-05-25 16:14 ` jason at gcc dot gnu.org
  2022-05-25 18:50 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2022-05-25 16:14 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

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

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

* [Bug c++/105655] [12/13 Regression] ICE on invalid deduction
  2022-05-19  8:02 [Bug c++/105655] New: [12/13 Regression] ICE on invalid deduction egor.pugin at gmail dot com
                   ` (2 preceding siblings ...)
  2022-05-25 16:14 ` jason at gcc dot gnu.org
@ 2022-05-25 18:50 ` cvs-commit at gcc dot gnu.org
  2022-05-31 19:31 ` [Bug c++/105655] [12 " cvs-commit at gcc dot gnu.org
  2022-05-31 19:32 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-25 18:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:34970d08c6297e12f3f9117b6ac19fb2de522e24

commit r13-769-g34970d08c6297e12f3f9117b6ac19fb2de522e24
Author: Jason Merrill <jason@redhat.com>
Date:   Wed May 25 12:38:58 2022 -0400

    c++: CTAD with alias and nested template [PR105655]

    Here, alias_ctad_tweaks expect tsubst_decl of a FUNCTION_DECL to return a
    FUNCTION_DECL.  A reasonable expectation, but in this case we were
replacing
    the template args of the class-scope deduction guide with equivalent args,
    so looking in the hash table we found the partial instantiation stored when
    instantiating A<int>, which is a TEMPLATE_DECL.  It's fine for that to be
    what is stored, but tsubst_function_decl should never return it.

            PR c++/105655

    gcc/cp/ChangeLog:

            * pt.cc (build_template_decl): Add assert.
            (tsubst_function_decl): Don't return a template.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/class-deduction-alias13.C: New test.

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

* [Bug c++/105655] [12 Regression] ICE on invalid deduction
  2022-05-19  8:02 [Bug c++/105655] New: [12/13 Regression] ICE on invalid deduction egor.pugin at gmail dot com
                   ` (3 preceding siblings ...)
  2022-05-25 18:50 ` cvs-commit at gcc dot gnu.org
@ 2022-05-31 19:31 ` cvs-commit at gcc dot gnu.org
  2022-05-31 19:32 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-31 19:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:d81be519fd6547654f1eda6976e95524db7d39b7

commit r12-8442-gd81be519fd6547654f1eda6976e95524db7d39b7
Author: Jason Merrill <jason@redhat.com>
Date:   Wed May 25 12:38:58 2022 -0400

    c++: CTAD with alias and nested template [PR105655]

    Here, alias_ctad_tweaks expect tsubst_decl of a FUNCTION_DECL to return a
    FUNCTION_DECL.  A reasonable expectation, but in this case we were
replacing
    the template args of the class-scope deduction guide with equivalent args,
    so looking in the hash table we found the partial instantiation stored when
    instantiating A<int>, which is a TEMPLATE_DECL.  It's fine for that to be
    what is stored, but tsubst_function_decl should never return it.

            PR c++/105655

    gcc/cp/ChangeLog:

            * pt.cc (build_template_decl): Add assert.
            (tsubst_function_decl): Don't return a template.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/class-deduction-alias13.C: New test.

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

* [Bug c++/105655] [12 Regression] ICE on invalid deduction
  2022-05-19  8:02 [Bug c++/105655] New: [12/13 Regression] ICE on invalid deduction egor.pugin at gmail dot com
                   ` (4 preceding siblings ...)
  2022-05-31 19:31 ` [Bug c++/105655] [12 " cvs-commit at gcc dot gnu.org
@ 2022-05-31 19:32 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2022-05-31 19:32 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 12.2/13.

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

end of thread, other threads:[~2022-05-31 19:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19  8:02 [Bug c++/105655] New: [12/13 Regression] ICE on invalid deduction egor.pugin at gmail dot com
2022-05-19  8:22 ` [Bug c++/105655] " marxin at gcc dot gnu.org
2022-05-19 10:59 ` rguenth at gcc dot gnu.org
2022-05-25 16:14 ` jason at gcc dot gnu.org
2022-05-25 18:50 ` cvs-commit at gcc dot gnu.org
2022-05-31 19:31 ` [Bug c++/105655] [12 " cvs-commit at gcc dot gnu.org
2022-05-31 19:32 ` jason 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).