public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a
[not found] <bug-93383-4@http.gcc.gnu.org/bugzilla/>
@ 2020-04-11 3:34 ` mpolacek at gcc dot gnu.org
2020-04-11 3:35 ` mpolacek at gcc dot gnu.org
` (12 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-04-11 3:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93383
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |raphael.grimm at kit dot edu
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
*** Bug 93639 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a
[not found] <bug-93383-4@http.gcc.gnu.org/bugzilla/>
2020-04-11 3:34 ` [Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a mpolacek at gcc dot gnu.org
@ 2020-04-11 3:35 ` mpolacek at gcc dot gnu.org
2020-12-18 15:04 ` mpolacek at gcc dot gnu.org
` (11 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-04-11 3:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93383
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Test from bug 93639:
template<int N> struct A;
template<A> struct B;
template<A a>
struct C
{
using type = B<a.cstr>;
};
int main() {}
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a
[not found] <bug-93383-4@http.gcc.gnu.org/bugzilla/>
2020-04-11 3:34 ` [Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a mpolacek at gcc dot gnu.org
2020-04-11 3:35 ` mpolacek at gcc dot gnu.org
@ 2020-12-18 15:04 ` mpolacek at gcc dot gnu.org
2020-12-18 15:04 ` mpolacek at gcc dot gnu.org
` (10 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-12-18 15:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93383
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jbassett271 at gmail dot com
--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
*** Bug 98367 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a
[not found] <bug-93383-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2020-12-18 15:04 ` mpolacek at gcc dot gnu.org
@ 2020-12-18 15:04 ` mpolacek at gcc dot gnu.org
2021-02-16 15:22 ` mpolacek at gcc dot gnu.org
` (9 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-12-18 15:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93383
--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
template <typename A>
struct ctad_t {
A a;
};
template <ctad_t T>
struct myclass {
};
template <typename Something>
constexpr auto myobject = ctad_t {Something::value};
template <typename Something>
using thing = myclass<myobject<Something>>;
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a
[not found] <bug-93383-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2020-12-18 15:04 ` mpolacek at gcc dot gnu.org
@ 2021-02-16 15:22 ` mpolacek at gcc dot gnu.org
2021-03-25 20:18 ` mpolacek at gcc dot gnu.org
` (8 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-02-16 15:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93383
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |vopl at bk dot ru
--- Comment #8 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
*** Bug 99119 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a
[not found] <bug-93383-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2021-02-16 15:22 ` mpolacek at gcc dot gnu.org
@ 2021-03-25 20:18 ` mpolacek at gcc dot gnu.org
2021-04-04 0:56 ` mpolacek at gcc dot gnu.org
` (7 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-03-25 20:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93383
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |wouter at voti dot nl
--- Comment #9 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
*** Bug 99775 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a
[not found] <bug-93383-4@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2021-03-25 20:18 ` mpolacek at gcc dot gnu.org
@ 2021-04-04 0:56 ` mpolacek at gcc dot gnu.org
2021-04-04 0:56 ` mpolacek at gcc dot gnu.org
` (6 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-04-04 0:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93383
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hewillk at gmail dot com
--- Comment #10 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
*** Bug 99897 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a
[not found] <bug-93383-4@http.gcc.gnu.org/bugzilla/>
` (6 preceding siblings ...)
2021-04-04 0:56 ` mpolacek at gcc dot gnu.org
@ 2021-04-04 0:56 ` mpolacek at gcc dot gnu.org
2021-04-12 16:38 ` ppalka at gcc dot gnu.org
` (5 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-04-04 0:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93383
--- Comment #11 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
template <int> struct A {};
template <A a> struct S { void foo(S<+a>); };
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a
[not found] <bug-93383-4@http.gcc.gnu.org/bugzilla/>
` (7 preceding siblings ...)
2021-04-04 0:56 ` mpolacek at gcc dot gnu.org
@ 2021-04-12 16:38 ` ppalka at gcc dot gnu.org
2021-04-24 4:15 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-04-12 16:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93383
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |ppalka at gcc dot gnu.org
Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org
--- Comment #12 from Patrick Palka <ppalka at gcc dot gnu.org> ---
We also incorrectly reject
template <int> struct A {};
template <A a> struct B {
template <class T> using type = B<T{}>;
};
It seems do_class_deduction needs to be made more forgiving about dependent
initializers.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a
[not found] <bug-93383-4@http.gcc.gnu.org/bugzilla/>
` (8 preceding siblings ...)
2021-04-12 16:38 ` ppalka at gcc dot gnu.org
@ 2021-04-24 4:15 ` cvs-commit at gcc dot gnu.org
2021-04-27 21:24 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-24 4:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93383
--- Comment #13 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:bcd77b7b9f35bd5b559ed593c3b3e346c1e6f364
commit r12-100-gbcd77b7b9f35bd5b559ed593c3b3e346c1e6f364
Author: Patrick Palka <ppalka@redhat.com>
Date: Sat Apr 24 00:14:29 2021 -0400
c++: do_class_deduction and dependent init [PR93383]
Here we're crashing during CTAD with a dependent initializer (performed
from convert_template_argument) because one of the initializer's
elements has an empty TREE_TYPE, which ends up making resolve_args
unhappy.
Besides the case where we're initializing one template placeholder
from another, which is already specifically handled earlier in
do_class_deduction, it seems we can't in general correctly resolve a
template placeholder using a dependent initializer, so this patch makes
the function just punt until instantiation time instead.
gcc/cp/ChangeLog:
PR c++/89565
PR c++/93383
PR c++/95291
PR c++/99200
PR c++/99683
* pt.c (do_class_deduction): Punt if the initializer is
type-dependent.
gcc/testsuite/ChangeLog:
PR c++/89565
PR c++/93383
PR c++/95291
PR c++/99200
PR c++/99683
* g++.dg/cpp2a/nontype-class39.C: Remove dg-ice directive.
* g++.dg/cpp2a/nontype-class45.C: New test.
* g++.dg/cpp2a/nontype-class46.C: New test.
* g++.dg/cpp2a/nontype-class47.C: New test.
* g++.dg/cpp2a/nontype-class48.C: New test.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a
[not found] <bug-93383-4@http.gcc.gnu.org/bugzilla/>
` (9 preceding siblings ...)
2021-04-24 4:15 ` cvs-commit at gcc dot gnu.org
@ 2021-04-27 21:24 ` cvs-commit at gcc dot gnu.org
2021-05-01 18:45 ` ppalka at gcc dot gnu.org
` (2 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-27 21:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93383
--- Comment #14 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:9532344edcf77c7c7b0fa5da31c1b9dd2850288e
commit r11-8309-g9532344edcf77c7c7b0fa5da31c1b9dd2850288e
Author: Patrick Palka <ppalka@redhat.com>
Date: Sat Apr 24 00:14:29 2021 -0400
c++: do_class_deduction and dependent init [PR93383]
Here we're crashing during CTAD with a dependent initializer (performed
from convert_template_argument) because one of the initializer's
elements has an empty TREE_TYPE, which ends up making resolve_args
unhappy.
Besides the case where we're initializing one template placeholder
from another, which is already specifically handled earlier in
do_class_deduction, it seems we can't in general correctly resolve a
template placeholder using a dependent initializer, so this patch makes
the function just punt until instantiation time instead.
gcc/cp/ChangeLog:
PR c++/89565
PR c++/93383
PR c++/95291
PR c++/99200
PR c++/99683
* pt.c (do_class_deduction): Punt if the initializer is
type-dependent.
gcc/testsuite/ChangeLog:
PR c++/89565
PR c++/93383
PR c++/95291
PR c++/99200
PR c++/99683
* g++.dg/cpp2a/nontype-class39.C: Remove dg-ice directive.
* g++.dg/cpp2a/nontype-class45.C: New test.
* g++.dg/cpp2a/nontype-class46.C: New test.
* g++.dg/cpp2a/nontype-class47.C: New test.
* g++.dg/cpp2a/nontype-class48.C: New test.
(cherry picked from commit bcd77b7b9f35bd5b559ed593c3b3e346c1e6f364)
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a
[not found] <bug-93383-4@http.gcc.gnu.org/bugzilla/>
` (10 preceding siblings ...)
2021-04-27 21:24 ` cvs-commit at gcc dot gnu.org
@ 2021-05-01 18:45 ` ppalka at gcc dot gnu.org
2021-06-07 18:27 ` ppalka at gcc dot gnu.org
2022-07-19 10:13 ` marxin at gcc dot gnu.org
13 siblings, 0 replies; 14+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-05-01 18:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93383
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |11.2
--- Comment #15 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 11.2 and 12.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a
[not found] <bug-93383-4@http.gcc.gnu.org/bugzilla/>
` (11 preceding siblings ...)
2021-05-01 18:45 ` ppalka at gcc dot gnu.org
@ 2021-06-07 18:27 ` ppalka at gcc dot gnu.org
2022-07-19 10:13 ` marxin at gcc dot gnu.org
13 siblings, 0 replies; 14+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-06-07 18:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93383
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |josephcanedo at hotmail dot com
--- Comment #16 from Patrick Palka <ppalka at gcc dot gnu.org> ---
*** Bug 100928 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a
[not found] <bug-93383-4@http.gcc.gnu.org/bugzilla/>
` (12 preceding siblings ...)
2021-06-07 18:27 ` ppalka at gcc dot gnu.org
@ 2022-07-19 10:13 ` marxin at gcc dot gnu.org
13 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-07-19 10:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93383
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |lissheidr.spam at gmail dot com
--- Comment #17 from Martin Liška <marxin at gcc dot gnu.org> ---
*** Bug 106341 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2022-07-19 10:13 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-93383-4@http.gcc.gnu.org/bugzilla/>
2020-04-11 3:34 ` [Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a mpolacek at gcc dot gnu.org
2020-04-11 3:35 ` mpolacek at gcc dot gnu.org
2020-12-18 15:04 ` mpolacek at gcc dot gnu.org
2020-12-18 15:04 ` mpolacek at gcc dot gnu.org
2021-02-16 15:22 ` mpolacek at gcc dot gnu.org
2021-03-25 20:18 ` mpolacek at gcc dot gnu.org
2021-04-04 0:56 ` mpolacek at gcc dot gnu.org
2021-04-04 0:56 ` mpolacek at gcc dot gnu.org
2021-04-12 16:38 ` ppalka at gcc dot gnu.org
2021-04-24 4:15 ` cvs-commit at gcc dot gnu.org
2021-04-27 21:24 ` cvs-commit at gcc dot gnu.org
2021-05-01 18:45 ` ppalka at gcc dot gnu.org
2021-06-07 18:27 ` ppalka at gcc dot gnu.org
2022-07-19 10:13 ` marxin 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).