public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/82099] internal compiler error: in type_throw_all_p, at cp/except.c:1186 when using a function pointer for templated predicate
       [not found] <bug-82099-4@http.gcc.gnu.org/bugzilla/>
@ 2020-04-02 16:31 ` ed at catmur dot uk
  2020-04-07 21:24 ` mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: ed at catmur dot uk @ 2020-04-02 16:31 UTC (permalink / raw)
  To: gcc-bugs

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

Ed Catmur <ed at catmur dot uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ed at catmur dot uk

--- Comment #6 from Ed Catmur <ed at catmur dot uk> ---
Workaround: force computation of noexcept of predicate before it is required:

    noexcept(+baz<int>);

or simply

    baz<int>;

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

* [Bug c++/82099] internal compiler error: in type_throw_all_p, at cp/except.c:1186 when using a function pointer for templated predicate
       [not found] <bug-82099-4@http.gcc.gnu.org/bugzilla/>
  2020-04-02 16:31 ` [Bug c++/82099] internal compiler error: in type_throw_all_p, at cp/except.c:1186 when using a function pointer for templated predicate ed at catmur dot uk
@ 2020-04-07 21:24 ` mpolacek at gcc dot gnu.org
  2020-11-10 10:37 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-04-07 21:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |twelvevolt at yandex dot ru

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

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

* [Bug c++/82099] internal compiler error: in type_throw_all_p, at cp/except.c:1186 when using a function pointer for templated predicate
       [not found] <bug-82099-4@http.gcc.gnu.org/bugzilla/>
  2020-04-02 16:31 ` [Bug c++/82099] internal compiler error: in type_throw_all_p, at cp/except.c:1186 when using a function pointer for templated predicate ed at catmur dot uk
  2020-04-07 21:24 ` mpolacek at gcc dot gnu.org
@ 2020-11-10 10:37 ` redi at gcc dot gnu.org
  2020-12-10  3:27 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2020-11-10 10:37 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |janezz55 at gmail dot com

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
*** Bug 97773 has been marked as a duplicate of this bug. ***

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

* [Bug c++/82099] internal compiler error: in type_throw_all_p, at cp/except.c:1186 when using a function pointer for templated predicate
       [not found] <bug-82099-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-11-10 10:37 ` redi at gcc dot gnu.org
@ 2020-12-10  3:27 ` mpolacek at gcc dot gnu.org
  2021-01-05 16:08 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-12-10  3:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #9 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I have a patch.

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

* [Bug c++/82099] internal compiler error: in type_throw_all_p, at cp/except.c:1186 when using a function pointer for templated predicate
       [not found] <bug-82099-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2020-12-10  3:27 ` mpolacek at gcc dot gnu.org
@ 2021-01-05 16:08 ` cvs-commit at gcc dot gnu.org
  2021-01-05 21:33 ` cvs-commit at gcc dot gnu.org
  2021-01-05 21:37 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-05 16:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:

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

commit r11-6476-gaf362af18f405c34840d820143aa3a94f72fce4d
Author: Marek Polacek <polacek@redhat.com>
Date:   Thu Dec 10 15:00:58 2020 -0500

    c++: ICE with deferred noexcept when deducing targs [PR82099]

    In this test we ICE in type_throw_all_p because it got a deferred
    noexcept which it shouldn't.  Here's the story:

    In noexcept61.C, we call bar, so we perform overload resolution.  When
    adding the (only) candidate, we need to deduce template arguments, so
    call fn_type_unification as usually.  That deduces U to

      void (*) (int &, int &)

    which is correct, but its noexcept-spec is deferred_noexcept.  Then
    we call add_function_candidate (bar), wherein we try to create an
    implicit conversion sequence for every argument.  Since baz<int> is
    of unknown type, we instantiate_type it; it is a TEMPLATE_ID_EXPR
    so that calls resolve_address_of_overloaded_function.  But we crash
    there, because target_type contains the deferred_noexcept.

    So we need to maybe_instantiate_noexcept before we can compare types.
    resolve_overloaded_unification seemed like the appropriate spot, now
    fn_type_unification produces the function type with its noexcept-spec
    instantiated.  This shouldn't go against CWG 1330 because here we
    really need to instantiate the noexcept-spec.

    This also fixes class-deduction76.C, a dg-ice test I recently added,
    therefore this fix also fixes c++/90799, yay.

    gcc/cp/ChangeLog:

            PR c++/82099
            * pt.c (resolve_overloaded_unification): Call
            maybe_instantiate_noexcept after instantiating the function
            decl.

    gcc/testsuite/ChangeLog:

            PR c++/82099
            * g++.dg/cpp1z/class-deduction76.C: Remove dg-ice.
            * g++.dg/cpp0x/noexcept61.C: New test.

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

* [Bug c++/82099] internal compiler error: in type_throw_all_p, at cp/except.c:1186 when using a function pointer for templated predicate
       [not found] <bug-82099-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2021-01-05 16:08 ` cvs-commit at gcc dot gnu.org
@ 2021-01-05 21:33 ` cvs-commit at gcc dot gnu.org
  2021-01-05 21:37 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-05 21:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Marek Polacek
<mpolacek@gcc.gnu.org>:

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

commit r10-9209-gff22b4e8d0613170601d28eec9462ea31147c7c7
Author: Marek Polacek <polacek@redhat.com>
Date:   Tue Jan 5 16:33:07 2021 -0500

    c++: ICE with deferred noexcept when deducing targs [PR82099]

    In this test we ICE in type_throw_all_p because it got a deferred
    noexcept which it shouldn't.  Here's the story:

    In noexcept61.C, we call bar, so we perform overload resolution.  When
    adding the (only) candidate, we need to deduce template arguments, so
    call fn_type_unification as usually.  That deduces U to

      void (*) (int &, int &)

    which is correct, but its noexcept-spec is deferred_noexcept.  Then
    we call add_function_candidate (bar), wherein we try to create an
    implicit conversion sequence for every argument.  Since baz<int> is
    of unknown type, we instantiate_type it; it is a TEMPLATE_ID_EXPR
    so that calls resolve_address_of_overloaded_function.  But we crash
    there, because target_type contains the deferred_noexcept.

    So we need to maybe_instantiate_noexcept before we can compare types.
    resolve_overloaded_unification seemed like the appropriate spot, now
    fn_type_unification produces the function type with its noexcept-spec
    instantiated.  This shouldn't go against CWG 1330 because here we
    really need to instantiate the noexcept-spec.

    This also fixes class-deduction76.C, a dg-ice test I recently added,
    therefore this fix also fixes c++/90799, yay.

    gcc/cp/ChangeLog:

            PR c++/82099
            * pt.c (resolve_overloaded_unification): Call
            maybe_instantiate_noexcept after instantiating the function
            decl.

    gcc/testsuite/ChangeLog:

            PR c++/82099
            * g++.dg/cpp0x/noexcept61.C: New test.

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

* [Bug c++/82099] internal compiler error: in type_throw_all_p, at cp/except.c:1186 when using a function pointer for templated predicate
       [not found] <bug-82099-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2021-01-05 21:33 ` cvs-commit at gcc dot gnu.org
@ 2021-01-05 21:37 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-01-05 21:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #12 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2021-01-05 21:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-82099-4@http.gcc.gnu.org/bugzilla/>
2020-04-02 16:31 ` [Bug c++/82099] internal compiler error: in type_throw_all_p, at cp/except.c:1186 when using a function pointer for templated predicate ed at catmur dot uk
2020-04-07 21:24 ` mpolacek at gcc dot gnu.org
2020-11-10 10:37 ` redi at gcc dot gnu.org
2020-12-10  3:27 ` mpolacek at gcc dot gnu.org
2021-01-05 16:08 ` cvs-commit at gcc dot gnu.org
2021-01-05 21:33 ` cvs-commit at gcc dot gnu.org
2021-01-05 21:37 ` mpolacek 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).