public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97745] New: [10 Regression] ICE in tsubst_decl, at cp/pt.c:14666
@ 2020-11-06 16:06 doko at debian dot org
  2020-11-06 16:37 ` [Bug c++/97745] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: doko at debian dot org @ 2020-11-06 16:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97745
           Summary: [10 Regression] ICE in tsubst_decl, at cp/pt.c:14666
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at debian dot org
  Target Milestone: ---

https://bugs.debian.org/973698

seen with the gcc-10 branch, compiler configured with
--enable-checking=yes,extra,rtl

gives an error on the gcc-9 branch and trunk.

$ cat search_collection_test.ii
template <typename a, typename b = a> b aa;
template <typename a> auto ab() -> decltype(aa<a>);
# 1 "" 3
template <typename br, typename c> concept d = __is_base_of(c, br);
template <typename> struct bz;
struct {
  template <typename cb, typename... cc>
  auto operator()(cb e, cc... g) -> decltype(e(g...));
} bw;
template <typename cd, typename... cc>
using ce = decltype(bw(ab<cd>(), ab<cc>...));
namespace ch {
struct cx;
}
template <typename cy, typename f> concept da = d<ce<cy, f>, ch::cx>;
template <typename cy, typename f> concept db = da<cy, f>;
struct {
  template <typename cd> bz<cd> operator()(cd);
} dc;
struct h {
  template <typename f, typename cy>
  requires db<cy, f> friend operator|(f, bz<cy>);
};
template <typename> struct bz : h {};
struct {
  template <typename cd> auto operator()(cd e) { return dc(e); }
} dm;
class {
  count() {
    count | dm([*this](auto) {})
  }
};

$ g++ -c -std=c++17 -fconcepts -Wall search_collection_test.ii
: In instantiation of ‘<unnamed class>::count()::<lambda(auto:1)> [with auto:1
= int (<unnamed class>::* (*)())()]’:
:5:47:   required by substitution of ‘template<class cb, class ... cc> decltype
(e(._anon_0::operator()::g ...))<unnamed struct>::operator()(cb, cc ...) [with
cb = <unnamed class>::count()::<lambda(auto:1)>; cc = {int (<unnamed class>::*
(*)())()}]’
:8:23:   required from ‘int operator|(f, bz<cy>) [with f = int (<unnamed
class>::*)(); cy = <unnamed class>::count()::<lambda(auto:1)>]’
:27:32:   required from here
:27:28: internal compiler error: in tsubst_decl, at cp/pt.c:14666
0x6656de tsubst_decl
        ../../src/gcc/cp/pt.c:14666
0xc21587 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../src/gcc/cp/pt.c:18002
0xc1e8e8 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../src/gcc/cp/pt.c:18219
0xc1c831 instantiate_decl(tree_node*, bool, bool)
        ../../src/gcc/cp/pt.c:25824
0xb5084a maybe_instantiate_decl
        ../../src/gcc/cp/decl2.c:5370
0xb52f40 maybe_instantiate_decl
        ../../src/gcc/cp/decl2.c:5555
0xb52f40 mark_used(tree_node*, int)
        ../../src/gcc/cp/decl2.c:5581
0xaa4322 build_over_call
        ../../src/gcc/cp/call.c:9093
0xaa91b1 build_op_call_1
        ../../src/gcc/cp/call.c:4872
0xaa91b1 build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int)
        ../../src/gcc/cp/call.c:4901
0xc64f8e finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ../../src/gcc/cp/semantics.c:2689
0xc2ec88 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../src/gcc/cp/pt.c:20115
0xc30cf4 tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../src/gcc/cp/pt.c:15946
0xc3b54a tsubst_function_type
        ../../src/gcc/cp/pt.c:14932
0xc308f0 tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../src/gcc/cp/pt.c:15753
0xc3f3cc tsubst_function_decl
        ../../src/gcc/cp/pt.c:13787
0xc28c3f tsubst_decl
        ../../src/gcc/cp/pt.c:14230
0xc39569 instantiate_template_1
        ../../src/gcc/cp/pt.c:20871
0xc48ecb instantiate_template(tree_node*, tree_node*, int)
        ../../src/gcc/cp/pt.c:20928
0xc48ecb fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool,
bool)
        ../../src/gcc/cp/pt.c:21372
Please submit a full bug report,
with preprocessed source if appropriate.

$ g++-9 -c -std=c++17 -fconcepts -Wall search_collection_test.ii
: In member function ‘int<unnamed class>::count()’:
:27:11: error: invalid use of non-static member function ‘int<unnamed
class>::count()’
:26:3: note: declared here
: At global scope:
:29:2: error: abstract declarator ‘<unnamed class>’ used as declaration
:15:33: error: ‘bz<cd><unnamed struct>::operator()(cd) [with cd = <unnamed
class>::count()::<lambda(auto:1)>]’, declared using local type ‘<unnamed
class>::count()::<lambda(auto:1)>’, is used but never defined [-fpermissive]


$ /usr/lib/gcc-snapshot/bin/g++ -c -std=c++17 -fconcepts -Wall
search_collection_test.ii
: In member function 'int<unnamed class>::count()':
:27:11: error: invalid use of non-static member function 'int<unnamed
class>::count()'
:26:3: note: declared here
: At global scope:
:29:2: error: abstract declarator '<unnamed class>' used as declaration
:15:33: error: 'bz<cd><unnamed struct>::operator()(cd) [with cd = <unnamed
class>::count()::<lambda(auto:1)>]', declared using local type '<unnamed
class>::count()::<lambda(auto:1)>', is used but never defined [-fpermissive]

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

* [Bug c++/97745] [10 Regression] ICE in tsubst_decl, at cp/pt.c:14666
  2020-11-06 16:06 [Bug c++/97745] New: [10 Regression] ICE in tsubst_decl, at cp/pt.c:14666 doko at debian dot org
@ 2020-11-06 16:37 ` rguenth at gcc dot gnu.org
  2020-11-19 18:52 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-11-06 16:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.3
           Keywords|                            |ice-on-invalid-code

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

* [Bug c++/97745] [10 Regression] ICE in tsubst_decl, at cp/pt.c:14666
  2020-11-06 16:06 [Bug c++/97745] New: [10 Regression] ICE in tsubst_decl, at cp/pt.c:14666 doko at debian dot org
  2020-11-06 16:37 ` [Bug c++/97745] " rguenth at gcc dot gnu.org
@ 2020-11-19 18:52 ` mpolacek at gcc dot gnu.org
  2020-12-30 12:47 ` gcc-bugs at marehr dot dialup.fu-berlin.de
  2020-12-31 19:16 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-19 18:52 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Oof, I can't really bisect it, but since it works on trunk, and is
ICE-on-invalid, I'm inclined to close this.

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

* [Bug c++/97745] [10 Regression] ICE in tsubst_decl, at cp/pt.c:14666
  2020-11-06 16:06 [Bug c++/97745] New: [10 Regression] ICE in tsubst_decl, at cp/pt.c:14666 doko at debian dot org
  2020-11-06 16:37 ` [Bug c++/97745] " rguenth at gcc dot gnu.org
  2020-11-19 18:52 ` mpolacek at gcc dot gnu.org
@ 2020-12-30 12:47 ` gcc-bugs at marehr dot dialup.fu-berlin.de
  2020-12-31 19:16 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: gcc-bugs at marehr dot dialup.fu-berlin.de @ 2020-12-30 12:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from gcc-bugs at marehr dot dialup.fu-berlin.de ---
This bug is fixed and can be closed.

This ICE was reduced from our code base
(https://github.com/seqan/seqan3/issues/2236#issuecomment-723194705).

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

* [Bug c++/97745] [10 Regression] ICE in tsubst_decl, at cp/pt.c:14666
  2020-11-06 16:06 [Bug c++/97745] New: [10 Regression] ICE in tsubst_decl, at cp/pt.c:14666 doko at debian dot org
                   ` (2 preceding siblings ...)
  2020-12-30 12:47 ` gcc-bugs at marehr dot dialup.fu-berlin.de
@ 2020-12-31 19:16 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-12-31 19:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2020-12-31 19:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-06 16:06 [Bug c++/97745] New: [10 Regression] ICE in tsubst_decl, at cp/pt.c:14666 doko at debian dot org
2020-11-06 16:37 ` [Bug c++/97745] " rguenth at gcc dot gnu.org
2020-11-19 18:52 ` mpolacek at gcc dot gnu.org
2020-12-30 12:47 ` gcc-bugs at marehr dot dialup.fu-berlin.de
2020-12-31 19:16 ` 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).