public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94100] New: ICE: tree check: accessed elt 1 of 'tree_vec' with 0 elts in tsubst_pack_expansion, at cp/pt.c:12765
@ 2020-03-09 12:51 jjk at acm dot org
  2020-03-09 14:24 ` [Bug c++/94100] " mpolacek at gcc dot gnu.org
  2020-07-02 23:12 ` hstong at ca dot ibm.com
  0 siblings, 2 replies; 3+ messages in thread
From: jjk at acm dot org @ 2020-03-09 12:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94100
           Summary: ICE: tree check: accessed elt 1 of 'tree_vec' with 0
                    elts in tsubst_pack_expansion, at cp/pt.c:12765
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jjk at acm dot org
  Target Milestone: ---

Created attachment 47998
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47998&action=edit
Source file to be compiled.

The attached file elicits an ICE in the GCC "trunk" version used by Compiler
Explorer (https://godbolt.org/z/iPK_JV):
------------
<source>: In function 'int main()':
<source>:20:24: internal compiler error: tree check: accessed elt 1 of
'tree_vec' with 0 elts in tsubst_pack_expansion, at cp/pt.c:12765
   20 |   Foo<bool>::foo<true>();
      |                        ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
------------

When using GCC 9.2, no ICE happens, but the file fails to be parsed:
------------
<source>: In function 'int main()':
<source>:20:24: error: no matching function for call to
'Foo<bool>::foo<true>()'
   20 |   Foo<bool>::foo<true>();
      |                        ^
<source>:11:3: note: candidate: 'template<ARGS ...args> static void
Foo<ARGS>::foo() [with ARGS ...args = {args ...}; ARGS = {bool}]'
   11 |   foo(void)
      |   ^~~
<source>:11:3: note:   template argument deduction/substitution failed:
<source>:21:31: error: no matching function for call to 'Foo<int, long
int>::foo<42, 23>()'
   21 |   Foo<int, long>::foo<42, 23>();
      |                               ^
<source>:11:3: note: candidate: 'template<ARGS ...args> static void
Foo<ARGS>::foo() [with ARGS ...args = {args ...}; ARGS = {int, long int}]'
   11 |   foo(void)
      |   ^~~
<source>:11:3: note:   template argument deduction/substitution failed:
<source>:21:31: error: wrong number of template arguments (2, should be 1)
   21 |   Foo<int, long>::foo<42, 23>();
      |                               ^
<source>:22:34: error: no matching function for call to 'Foo<char,
char>::foo<'h', 'i'>()'
   22 |   Foo<char, char>::foo<'h', 'i'>();
      |                                  ^
<source>:11:3: note: candidate: 'template<ARGS ...args> static void
Foo<ARGS>::foo() [with ARGS ...args = {args ...}; ARGS = {char, char}]'
   11 |   foo(void)
      |   ^~~
<source>:11:3: note:   template argument deduction/substitution failed:
<source>:22:34: error: wrong number of template arguments (2, should be 1)
   22 |   Foo<char, char>::foo<'h', 'i'>();
      |                                  ^
------------

Clang correctly compiles the file.

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

end of thread, other threads:[~2020-07-02 23:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-09 12:51 [Bug c++/94100] New: ICE: tree check: accessed elt 1 of 'tree_vec' with 0 elts in tsubst_pack_expansion, at cp/pt.c:12765 jjk at acm dot org
2020-03-09 14:24 ` [Bug c++/94100] " mpolacek at gcc dot gnu.org
2020-07-02 23:12 ` hstong at ca dot ibm.com

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).