public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105064] New: requires crashes gcc
@ 2022-03-26 17:21 janezz55 at gmail dot com
  2022-03-26 20:40 ` [Bug c++/105064] " redi at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: janezz55 at gmail dot com @ 2022-03-26 17:21 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105064
           Summary: requires crashes gcc
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: janezz55 at gmail dot com
  Target Milestone: ---

another gcc crash:
g++ -std=c++20 -Ofast loopdemo.cpp -o s

In file included from loopdemo.cpp:3:
loop.hpp:168:45: internal compiler error: Segmentation fault
  168 |     requires(std::is_integral_v<decltype(i)>);
      |                                             ^
0xe4c988 internal_error(char const*, ...)
        ???:0
0xf778a4 duplicate_decls(tree_node*, tree_node*, bool, bool)
        ???:0
0xf82c3b pushdecl_namespace_level(tree_node*, bool)
        ???:0
0x10ecbfe push_template_decl(tree_node*, bool)
        ???:0
0x159b601 do_friend(tree_node*, tree_node*, tree_node*, tree_node*,
overload_flags, bool)
        ???:0
0x1001717 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
        ???:0
0x105cc75 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
        ???:0
0x14e7873 c_parse_file()
        ???:0
0x14c9d9e c_common_parse_file()
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://bugs.archlinux.org/> for instructions.

source code is here:
https://github.com/user1095108/cr/blob/master/loopdemo.cpp

clang++ compiles the code without issue.

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

* [Bug c++/105064] requires crashes gcc
  2022-03-26 17:21 [Bug c++/105064] New: requires crashes gcc janezz55 at gmail dot com
@ 2022-03-26 20:40 ` redi at gcc dot gnu.org
  2022-03-27 11:43 ` janezz55 at gmail dot com
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: redi at gcc dot gnu.org @ 2022-03-26 20:40 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-03-26
             Status|UNCONFIRMED                 |WAITING

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Please read https://gcc.gnu.org/bugs (as requested when entering a new bug)

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

* [Bug c++/105064] requires crashes gcc
  2022-03-26 17:21 [Bug c++/105064] New: requires crashes gcc janezz55 at gmail dot com
  2022-03-26 20:40 ` [Bug c++/105064] " redi at gcc dot gnu.org
@ 2022-03-27 11:43 ` janezz55 at gmail dot com
  2022-03-27 13:00 ` redi at gcc dot gnu.org
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: janezz55 at gmail dot com @ 2022-03-27 11:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Janez Zemva <janezz55 at gmail dot com> ---
Yeah, I tried to make a minimal crash example for you, but it compiled
perfectly. Anyway, you know about the crash, you know about my repository and I
am no hurry for a fix, as this is my pet-project. And this is a special bug,
gcc SEGFAULTs are of special interest to you, I imagine.

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

* [Bug c++/105064] requires crashes gcc
  2022-03-26 17:21 [Bug c++/105064] New: requires crashes gcc janezz55 at gmail dot com
  2022-03-26 20:40 ` [Bug c++/105064] " redi at gcc dot gnu.org
  2022-03-27 11:43 ` janezz55 at gmail dot com
@ 2022-03-27 13:00 ` redi at gcc dot gnu.org
  2022-03-27 13:02 ` redi at gcc dot gnu.org
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: redi at gcc dot gnu.org @ 2022-03-27 13:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Read it again, because you've misunderstood. It doesn't say we need a minimal
example, that's not essential. But it clearly says to provide the code HERE,
not via URL. And to include the output of gcc -v.

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

* [Bug c++/105064] requires crashes gcc
  2022-03-26 17:21 [Bug c++/105064] New: requires crashes gcc janezz55 at gmail dot com
                   ` (2 preceding siblings ...)
  2022-03-27 13:00 ` redi at gcc dot gnu.org
@ 2022-03-27 13:02 ` redi at gcc dot gnu.org
  2022-03-27 18:01 ` janezz55 at gmail dot com
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: redi at gcc dot gnu.org @ 2022-03-27 13:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
And segfaults are not special, it's a bug like many others.

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

* [Bug c++/105064] requires crashes gcc
  2022-03-26 17:21 [Bug c++/105064] New: requires crashes gcc janezz55 at gmail dot com
                   ` (3 preceding siblings ...)
  2022-03-27 13:02 ` redi at gcc dot gnu.org
@ 2022-03-27 18:01 ` janezz55 at gmail dot com
  2022-03-27 18:05 ` janezz55 at gmail dot com
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: janezz55 at gmail dot com @ 2022-03-27 18:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Janez Zemva <janezz55 at gmail dot com> ---
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-bootstrap
--prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit
--enable-cet=auto --enable-checking=release --enable-clocale=gnu
--enable-default-pie --enable-default-ssp --enable-gnu-indirect-function
--enable-gnu-unique-object --enable-linker-build-id --enable-lto
--enable-multilib --enable-plugin --enable-shared --enable-threads=posix
--disable-libssp --disable-libstdcxx-pch --disable-werror
--with-build-config=bootstrap-lto --enable-link-serialization=1
gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (GCC)

I think the bug has something to do with two classes having the same friend:

class A
{
  // friend
};

class B
{
  // friend
};

c++ is becoming very complex and these crashes are a warning sign. So, you mean
I'd have to create an archive and place it here as an attachment? What if it
was 1GB in size?

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

* [Bug c++/105064] requires crashes gcc
  2022-03-26 17:21 [Bug c++/105064] New: requires crashes gcc janezz55 at gmail dot com
                   ` (4 preceding siblings ...)
  2022-03-27 18:01 ` janezz55 at gmail dot com
@ 2022-03-27 18:05 ` janezz55 at gmail dot com
  2022-03-27 18:29 ` janezz55 at gmail dot com
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: janezz55 at gmail dot com @ 2022-03-27 18:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Janez Zemva <janezz55 at gmail dot com> ---
Also, there are several workarounds around this bug, but I'll keep my
repository in a crashing state, until you find time to produce a minimal test
case.

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

* [Bug c++/105064] requires crashes gcc
  2022-03-26 17:21 [Bug c++/105064] New: requires crashes gcc janezz55 at gmail dot com
                   ` (5 preceding siblings ...)
  2022-03-27 18:05 ` janezz55 at gmail dot com
@ 2022-03-27 18:29 ` janezz55 at gmail dot com
  2022-03-27 18:39 ` janezz55 at gmail dot com
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: janezz55 at gmail dot com @ 2022-03-27 18:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Janez Zemva <janezz55 at gmail dot com> ---
Also, I'd like to add, that you can mount a github repository with FUSE, so
providing an URL is almost the same as providing an archive.

https://github.com/taterbase/git-mount

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

* [Bug c++/105064] requires crashes gcc
  2022-03-26 17:21 [Bug c++/105064] New: requires crashes gcc janezz55 at gmail dot com
                   ` (6 preceding siblings ...)
  2022-03-27 18:29 ` janezz55 at gmail dot com
@ 2022-03-27 18:39 ` janezz55 at gmail dot com
  2022-03-27 19:16 ` janezz55 at gmail dot com
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: janezz55 at gmail dot com @ 2022-03-27 18:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Janez Zemva <janezz55 at gmail dot com> ---
I can reproduce the bug in my rpi4b:

$ g++ -std=c++20 -Ofast loopdemo.cpp -o l
In file included from loopdemo.cpp:3:
loop.hpp:169:55: internal compiler error: Segmentation fault
  169 |     requires(std::is_same_v<task* const, decltype(tp)>);
      |                                                       ^
0x7f98a33217 __libc_start_main
        ../csu/libc-start.c:308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/10/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 10.2.1-6'
--with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs
--enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr
--with-gcc-major-version-only --program-suffix=-10
--program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-libquadmath --disable-libquadmath-support --enable-plugin
--enable-default-pie --with-system-zlib --enable-libphobos-checking=release
--with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch
--enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release
--build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
--with-build-config=bootstrap-lto-lean --enable-link-mutex
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20210110 (Debian 10.2.1-6)

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

* [Bug c++/105064] requires crashes gcc
  2022-03-26 17:21 [Bug c++/105064] New: requires crashes gcc janezz55 at gmail dot com
                   ` (7 preceding siblings ...)
  2022-03-27 18:39 ` janezz55 at gmail dot com
@ 2022-03-27 19:16 ` janezz55 at gmail dot com
  2022-03-27 22:19 ` [Bug c++/105064] [10/11/12 Regression] " redi at gcc dot gnu.org
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: janezz55 at gmail dot com @ 2022-03-27 19:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Janez Zemva <janezz55 at gmail dot com> ---
Anyway, I've grown bored, so here's the minimal test case:

#include <type_traits>

class task
{
  friend void suspend_to(auto const tp) noexcept
    requires(std::is_same_v<task* const, decltype(tp)>);
};

class loop
{
  friend void suspend_to(auto const tp) noexcept
    requires(std::is_same_v<task* const, decltype(tp)>);
};

void suspend_to(auto const tp) noexcept
  requires(std::is_same_v<task* const, decltype(tp)>)
{
}

$ g++ -std=c++20 -Ofast tmp.cpp -o t
tmp.cpp:12:55: internal compiler error: Segmentation fault
   12 |     requires(std::is_same_v<task* const, decltype(tp)>);
      |                                                       ^
0xe4c988 internal_error(char const*, ...)
        ???:0
0xf778a4 duplicate_decls(tree_node*, tree_node*, bool, bool)
        ???:0
0xf82c3b pushdecl_namespace_level(tree_node*, bool)
        ???:0
0x10ecbfe push_template_decl(tree_node*, bool)
        ???:0
0x159b601 do_friend(tree_node*, tree_node*, tree_node*, tree_node*,
overload_flags, bool)
        ???:0
0x1001717 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
        ???:0
0x105cc75 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
        ???:0
0x14e7873 c_parse_file()
        ???:0
0x14c9d9e c_common_parse_file()
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://bugs.archlinux.org/> for instructions.

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

* [Bug c++/105064] [10/11/12 Regression] requires crashes gcc
  2022-03-26 17:21 [Bug c++/105064] New: requires crashes gcc janezz55 at gmail dot com
                   ` (8 preceding siblings ...)
  2022-03-27 19:16 ` janezz55 at gmail dot com
@ 2022-03-27 22:19 ` redi at gcc dot gnu.org
  2022-03-28  7:30 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: redi at gcc dot gnu.org @ 2022-03-27 22:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |9.4.0
             Status|WAITING                     |NEW
      Known to fail|                            |10.3.1, 11.2.1, 12.0
                 CC|                            |jason at gcc dot gnu.org
            Summary|requires crashes gcc        |[10/11/12 Regression]
                   |                            |requires crashes gcc
           Keywords|                            |ice-on-valid-code

--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Thank you. Confirmed as a regression, starting with r10-6220

    c++: Fix ICE with constrained friend (PR93400).

    Here, the problem was that tsubst_friend_function was modifying the
    CONSTRAINT_INFO for the friend template to have the constraints for one
    instantiation, which fell down when we went to adjust it for another
    instantiation.  Fixed by deferring substitution of trailing requirements
    until we try to check declaration matching.

            PR c++/93400 - ICE with constrained friend.
            * constraint.cc (maybe_substitute_reqs_for): New.
            * decl.c (function_requirements_equivalent_p): Call it.
            * pt.c (tsubst_friend_function): Only substitute
            TEMPLATE_PARMS_CONSTRAINTS.
            (tsubst_template_parms): Copy constraints.

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

* [Bug c++/105064] [10/11/12 Regression] requires crashes gcc
  2022-03-26 17:21 [Bug c++/105064] New: requires crashes gcc janezz55 at gmail dot com
                   ` (9 preceding siblings ...)
  2022-03-27 22:19 ` [Bug c++/105064] [10/11/12 Regression] " redi at gcc dot gnu.org
@ 2022-03-28  7:30 ` rguenth at gcc dot gnu.org
  2022-03-28 13:27 ` ppalka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-03-28  7:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.4
           Priority|P3                          |P2

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

* [Bug c++/105064] [10/11/12 Regression] requires crashes gcc
  2022-03-26 17:21 [Bug c++/105064] New: requires crashes gcc janezz55 at gmail dot com
                   ` (10 preceding siblings ...)
  2022-03-28  7:30 ` rguenth at gcc dot gnu.org
@ 2022-03-28 13:27 ` ppalka at gcc dot gnu.org
  2022-03-28 18:17 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-03-28 13:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug c++/105064] [10/11/12 Regression] requires crashes gcc
  2022-03-26 17:21 [Bug c++/105064] New: requires crashes gcc janezz55 at gmail dot com
                   ` (11 preceding siblings ...)
  2022-03-28 13:27 ` ppalka at gcc dot gnu.org
@ 2022-03-28 18:17 ` cvs-commit at gcc dot gnu.org
  2022-03-28 18:19 ` [Bug c++/105064] [10/11 " ppalka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-28 18:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 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:ecb4882e362e80a1bf172453ac9b366edbb4e89c

commit r12-7860-gecb4882e362e80a1bf172453ac9b366edbb4e89c
Author: Patrick Palka <ppalka@redhat.com>
Date:   Mon Mar 28 14:15:16 2022 -0400

    c++: constrained template friend matching ICE [PR105064]

    Here during declaration matching for the two constrained template
    friends, we crash from maybe_substitute_reqs_for because the second
    friend doesn't yet have DECL_TEMPLATE_INFO set (we're being called
    indirectly from push_template_decl).

    As far as I can tell, this situation happens only when declaring a
    constrained template friend within a non-template class (as in the
    testcase), in which case the substitution would be a no-op anyway.
    So this patch rearranges maybe_substitute_reqs_for to gracefully
    handle missing DECL_TEMPLATE_INFO by just skipping the substitution.

            PR c++/105064

    gcc/cp/ChangeLog:

            * constraint.cc (maybe_substitute_reqs_for): Don't assume
            DECL_TEMPLATE_INFO is available.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/concepts-friend9.C: New test.

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

* [Bug c++/105064] [10/11 Regression] requires crashes gcc
  2022-03-26 17:21 [Bug c++/105064] New: requires crashes gcc janezz55 at gmail dot com
                   ` (12 preceding siblings ...)
  2022-03-28 18:17 ` cvs-commit at gcc dot gnu.org
@ 2022-03-28 18:19 ` ppalka at gcc dot gnu.org
  2022-04-07 19:19 ` cvs-commit at gcc dot gnu.org
  2022-05-04  0:24 ` [Bug c++/105064] [10 " ppalka at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-03-28 18:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11/12 Regression]       |[10/11 Regression] requires
                   |requires crashes gcc        |crashes gcc

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

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

* [Bug c++/105064] [10/11 Regression] requires crashes gcc
  2022-03-26 17:21 [Bug c++/105064] New: requires crashes gcc janezz55 at gmail dot com
                   ` (13 preceding siblings ...)
  2022-03-28 18:19 ` [Bug c++/105064] [10/11 " ppalka at gcc dot gnu.org
@ 2022-04-07 19:19 ` cvs-commit at gcc dot gnu.org
  2022-05-04  0:24 ` [Bug c++/105064] [10 " ppalka at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-07 19:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:214330a15cd7fd52e574023152f1321c6d329e82

commit r11-9796-g214330a15cd7fd52e574023152f1321c6d329e82
Author: Patrick Palka <ppalka@redhat.com>
Date:   Mon Mar 28 14:15:16 2022 -0400

    c++: constrained template friend matching ICE [PR105064]

    Here during declaration matching for the two constrained template
    friends, we crash from maybe_substitute_reqs_for because the second
    friend doesn't yet have DECL_TEMPLATE_INFO set (we're being called
    indirectly from push_template_decl).

    As far as I can tell, this situation happens only when declaring a
    constrained template friend within a non-template class (as in the
    testcase), in which case the substitution would be a no-op anyway.
    So this patch rearranges maybe_substitute_reqs_for to gracefully
    handle missing DECL_TEMPLATE_INFO by just skipping the substitution.

            PR c++/105064

    gcc/cp/ChangeLog:

            * constraint.cc (maybe_substitute_reqs_for): Don't assume
            DECL_TEMPLATE_INFO is available.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/concepts-friend9.C: New test.

    (cherry picked from commit ecb4882e362e80a1bf172453ac9b366edbb4e89c)

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

* [Bug c++/105064] [10 Regression] requires crashes gcc
  2022-03-26 17:21 [Bug c++/105064] New: requires crashes gcc janezz55 at gmail dot com
                   ` (14 preceding siblings ...)
  2022-04-07 19:19 ` cvs-commit at gcc dot gnu.org
@ 2022-05-04  0:24 ` ppalka at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-05-04  0:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #14 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 11.3/12, thanks for the bug report.

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

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

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-26 17:21 [Bug c++/105064] New: requires crashes gcc janezz55 at gmail dot com
2022-03-26 20:40 ` [Bug c++/105064] " redi at gcc dot gnu.org
2022-03-27 11:43 ` janezz55 at gmail dot com
2022-03-27 13:00 ` redi at gcc dot gnu.org
2022-03-27 13:02 ` redi at gcc dot gnu.org
2022-03-27 18:01 ` janezz55 at gmail dot com
2022-03-27 18:05 ` janezz55 at gmail dot com
2022-03-27 18:29 ` janezz55 at gmail dot com
2022-03-27 18:39 ` janezz55 at gmail dot com
2022-03-27 19:16 ` janezz55 at gmail dot com
2022-03-27 22:19 ` [Bug c++/105064] [10/11/12 Regression] " redi at gcc dot gnu.org
2022-03-28  7:30 ` rguenth at gcc dot gnu.org
2022-03-28 13:27 ` ppalka at gcc dot gnu.org
2022-03-28 18:17 ` cvs-commit at gcc dot gnu.org
2022-03-28 18:19 ` [Bug c++/105064] [10/11 " ppalka at gcc dot gnu.org
2022-04-07 19:19 ` cvs-commit at gcc dot gnu.org
2022-05-04  0:24 ` [Bug c++/105064] [10 " 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).