public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104294] New: ICE: tree check: accessed elt 2 of 'tree_vec' with 1 elts in tsubst_pack_expansion, at cp/pt.cc:13130
@ 2022-01-31 3:33 hewillk at gmail dot com
2022-01-31 14:08 ` [Bug c++/104294] " hewillk at gmail dot com
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: hewillk at gmail dot com @ 2022-01-31 3:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104294
Bug ID: 104294
Summary: ICE: tree check: accessed elt 2 of 'tree_vec' with 1
elts in tsubst_pack_expansion, at cp/pt.cc:13130
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: hewillk at gmail dot com
Target Milestone: ---
template<class>
struct B;
template <class R, class... Args>
struct B<R(Args...)> {
template<class T>
struct C { C(T); };
};
int main() {
B<void(int)>::C{0};
}
https://godbolt.org/z/h1jGhc5b4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/104294] ICE: tree check: accessed elt 2 of 'tree_vec' with 1 elts in tsubst_pack_expansion, at cp/pt.cc:13130
2022-01-31 3:33 [Bug c++/104294] New: ICE: tree check: accessed elt 2 of 'tree_vec' with 1 elts in tsubst_pack_expansion, at cp/pt.cc:13130 hewillk at gmail dot com
@ 2022-01-31 14:08 ` hewillk at gmail dot com
2022-01-31 14:43 ` ppalka at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: hewillk at gmail dot com @ 2022-01-31 14:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104294
--- Comment #1 from 康桓瑋 <hewillk at gmail dot com> ---
(In reply to 康桓瑋 from comment #0)
> template<class>
> struct B;
>
> template <class R, class... Args>
> struct B<R(Args...)> {
> template<class T>
> struct C { C(T); };
> };
>
> int main() {
> B<void(int)>::C{0};
> }
>
> https://godbolt.org/z/h1jGhc5b4
In fact, if we add CATD for inner class C, it should be well-formed.
template<class>
struct B;
template <class R, class... Args>
struct B<R(Args...)> {
template<class T>
struct C { C(T); };
template<class T>
C(T) -> C<T>;
};
int main() {
B<void()>::C c{0};
}
https://godbolt.org/z/E35rj1YP5
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/104294] ICE: tree check: accessed elt 2 of 'tree_vec' with 1 elts in tsubst_pack_expansion, at cp/pt.cc:13130
2022-01-31 3:33 [Bug c++/104294] New: ICE: tree check: accessed elt 2 of 'tree_vec' with 1 elts in tsubst_pack_expansion, at cp/pt.cc:13130 hewillk at gmail dot com
2022-01-31 14:08 ` [Bug c++/104294] " hewillk at gmail dot com
@ 2022-01-31 14:43 ` ppalka at gcc dot gnu.org
2022-01-31 14:49 ` ppalka at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-01-31 14:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104294
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2022-01-31
Status|UNCONFIRMED |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org
CC| |ppalka at gcc dot gnu.org
Ever confirmed|0 |1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/104294] ICE: tree check: accessed elt 2 of 'tree_vec' with 1 elts in tsubst_pack_expansion, at cp/pt.cc:13130
2022-01-31 3:33 [Bug c++/104294] New: ICE: tree check: accessed elt 2 of 'tree_vec' with 1 elts in tsubst_pack_expansion, at cp/pt.cc:13130 hewillk at gmail dot com
2022-01-31 14:08 ` [Bug c++/104294] " hewillk at gmail dot com
2022-01-31 14:43 ` ppalka at gcc dot gnu.org
@ 2022-01-31 14:49 ` ppalka at gcc dot gnu.org
2022-01-31 14:49 ` ppalka at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-01-31 14:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104294
--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> ---
I believe the testcase should be valid even without the user-defined deduction
guide since we should have synthesized an equivalent guide from the C(T)
constructor.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/104294] ICE: tree check: accessed elt 2 of 'tree_vec' with 1 elts in tsubst_pack_expansion, at cp/pt.cc:13130
2022-01-31 3:33 [Bug c++/104294] New: ICE: tree check: accessed elt 2 of 'tree_vec' with 1 elts in tsubst_pack_expansion, at cp/pt.cc:13130 hewillk at gmail dot com
` (2 preceding siblings ...)
2022-01-31 14:49 ` ppalka at gcc dot gnu.org
@ 2022-01-31 14:49 ` ppalka at gcc dot gnu.org
2022-01-31 20:28 ` cvs-commit at gcc dot gnu.org
2022-01-31 20:29 ` ppalka at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-01-31 14:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104294
--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
*** Bug 104295 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/104294] ICE: tree check: accessed elt 2 of 'tree_vec' with 1 elts in tsubst_pack_expansion, at cp/pt.cc:13130
2022-01-31 3:33 [Bug c++/104294] New: ICE: tree check: accessed elt 2 of 'tree_vec' with 1 elts in tsubst_pack_expansion, at cp/pt.cc:13130 hewillk at gmail dot com
` (3 preceding siblings ...)
2022-01-31 14:49 ` ppalka at gcc dot gnu.org
@ 2022-01-31 20:28 ` cvs-commit at gcc dot gnu.org
2022-01-31 20:29 ` ppalka at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-31 20:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104294
--- Comment #4 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:76dc465aaf1b74bf92143510b6db5671e1c053d6
commit r12-6950-g76dc465aaf1b74bf92143510b6db5671e1c053d6
Author: Patrick Palka <ppalka@redhat.com>
Date: Mon Jan 31 15:27:58 2022 -0500
c++: CTAD for class tmpl defined inside partial spec [PR104294]
Here during deduction guide generation for the nested class template
B<char(int)>::C, the computation of outer_args yields the template
arguments relative to the primary template for B (i.e. {char(int)})
but what we really want is those relative to C's enclosing scope, the
partial specialization of B (i.e. {char, int}).
PR c++/104294
gcc/cp/ChangeLog:
* pt.cc (ctor_deduction_guides_for): Correct computation of
outer_args.
gcc/testsuite/ChangeLog:
* g++.dg/cpp1z/class-deduction106.C: New test.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/104294] ICE: tree check: accessed elt 2 of 'tree_vec' with 1 elts in tsubst_pack_expansion, at cp/pt.cc:13130
2022-01-31 3:33 [Bug c++/104294] New: ICE: tree check: accessed elt 2 of 'tree_vec' with 1 elts in tsubst_pack_expansion, at cp/pt.cc:13130 hewillk at gmail dot com
` (4 preceding siblings ...)
2022-01-31 20:28 ` cvs-commit at gcc dot gnu.org
@ 2022-01-31 20:29 ` ppalka at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-01-31 20:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104294
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
Target Milestone|--- |12.0
--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-01-31 20:29 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-31 3:33 [Bug c++/104294] New: ICE: tree check: accessed elt 2 of 'tree_vec' with 1 elts in tsubst_pack_expansion, at cp/pt.cc:13130 hewillk at gmail dot com
2022-01-31 14:08 ` [Bug c++/104294] " hewillk at gmail dot com
2022-01-31 14:43 ` ppalka at gcc dot gnu.org
2022-01-31 14:49 ` ppalka at gcc dot gnu.org
2022-01-31 14:49 ` ppalka at gcc dot gnu.org
2022-01-31 20:28 ` cvs-commit at gcc dot gnu.org
2022-01-31 20:29 ` 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).