public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057
@ 2021-11-28 14:26 stha09 at googlemail dot com
2021-11-28 17:50 ` [Bug c++/103455] [9/10/11/12 Regression] " pinskia at gcc dot gnu.org
` (17 more replies)
0 siblings, 18 replies; 19+ messages in thread
From: stha09 at googlemail dot com @ 2021-11-28 14:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
Bug ID: 103455
Summary: internal compiler error: in dependent_type_p, at
cp/pt.c:27057
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: stha09 at googlemail dot com
Target Milestone: ---
Reduced testcase:
class raw_ptr {
template <typename U> operator U *();
};
class GLES2Interface class ScopedGLuint {
typedef void (GLES2Interface::*DeleteFunc)();
ScopedGLuint(){gl_->*delete_func_} raw_ptr gl_;
DeleteFunc delete_func_;
};
Original code is here:
https://chromium.googlesource.com/chromium/src/+/refs/heads/main/gpu/command_buffer/client/gl_helper.h#49
It seems GCC doesn't like the function pointer. There are some other locations
where the same happens in the Chromium codebase.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9/10/11/12 Regression] internal compiler error: in dependent_type_p, at cp/pt.c:27057
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
@ 2021-11-28 17:50 ` pinskia at gcc dot gnu.org
2021-11-28 17:54 ` pinskia at gcc dot gnu.org
` (16 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-28 17:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|internal compiler error: in |[9/10/11/12 Regression]
|dependent_type_p, at |internal compiler error: in
|cp/pt.c:27057 |dependent_type_p, at
| |cp/pt.c:27057
Status|UNCONFIRMED |NEW
Last reconfirmed| |2021-11-28
Ever confirmed|0 |1
Known to fail| |10.1.0, 11.1.0, 9.1.0
Known to work| |7.1.0, 8.1.0, 8.5.0
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I know this reduced testcase was invalid but the original code was valid. Is
there a way to reduce this again to see if it is valid (maybe by compiling with
GCC 8 or 7 or even clang too)?
Confirmed.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9/10/11/12 Regression] internal compiler error: in dependent_type_p, at cp/pt.c:27057
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
2021-11-28 17:50 ` [Bug c++/103455] [9/10/11/12 Regression] " pinskia at gcc dot gnu.org
@ 2021-11-28 17:54 ` pinskia at gcc dot gnu.org
2021-11-28 19:00 ` stha09 at googlemail dot com
` (15 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-28 17:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |8.2.0
Keywords| |ice-on-invalid-code
Target Milestone|--- |9.5
Known to work|8.5.0 |
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9/10/11/12 Regression] internal compiler error: in dependent_type_p, at cp/pt.c:27057
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
2021-11-28 17:50 ` [Bug c++/103455] [9/10/11/12 Regression] " pinskia at gcc dot gnu.org
2021-11-28 17:54 ` pinskia at gcc dot gnu.org
@ 2021-11-28 19:00 ` stha09 at googlemail dot com
2021-11-28 19:05 ` stha09 at googlemail dot com
` (14 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: stha09 at googlemail dot com @ 2021-11-28 19:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
--- Comment #2 from Stephan Hartmann <stha09 at googlemail dot com> ---
Handwritten reduced testcase:
template <typename T>
struct raw_ptr {
T* operator->() const;
template <typename U>
explicit operator U*() const;
};
struct bar {
static void func();
};
struct foo {
typedef void (bar::*GenFunc)();
foo(GenFunc gen_func) {
(bar_->*gen_func)();
}
raw_ptr<bar> bar_;
};
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9/10/11/12 Regression] internal compiler error: in dependent_type_p, at cp/pt.c:27057
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
` (2 preceding siblings ...)
2021-11-28 19:00 ` stha09 at googlemail dot com
@ 2021-11-28 19:05 ` stha09 at googlemail dot com
2021-11-28 19:27 ` stha09 at googlemail dot com
` (13 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: stha09 at googlemail dot com @ 2021-11-28 19:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
--- Comment #3 from Stephan Hartmann <stha09 at googlemail dot com> ---
Scratch comment 2, copied wrong one:
template <typename T>
struct raw_ptr {
T* operator->() const;
operator T*() const;
template <typename U>
explicit operator U*() const;
};
struct bar {};
struct foo {
typedef void (bar::*GenFunc)();
foo(GenFunc gen_func) {
(bar_->*gen_func)();
}
raw_ptr<bar> bar_;
};
It compiles with clang-12 and clang-13.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9/10/11/12 Regression] internal compiler error: in dependent_type_p, at cp/pt.c:27057
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
` (3 preceding siblings ...)
2021-11-28 19:05 ` stha09 at googlemail dot com
@ 2021-11-28 19:27 ` stha09 at googlemail dot com
2021-11-28 23:09 ` pinskia at gcc dot gnu.org
` (12 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: stha09 at googlemail dot com @ 2021-11-28 19:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
--- Comment #4 from Stephan Hartmann <stha09 at googlemail dot com> ---
Last working compiler was gcc-8.1, gcc-8.2 and later produce an ICE.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9/10/11/12 Regression] internal compiler error: in dependent_type_p, at cp/pt.c:27057
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
` (4 preceding siblings ...)
2021-11-28 19:27 ` stha09 at googlemail dot com
@ 2021-11-28 23:09 ` pinskia at gcc dot gnu.org
2021-11-29 8:52 ` marxin at gcc dot gnu.org
` (11 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-28 23:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced:
template <class T>
struct rp {
T* operator->() const;
operator T*() const;
template <class U> explicit operator U*() const;
};
struct b {};
typedef void (b::*fptr)();
void foo(rp<b> n, fptr h) {
(n->*h)();
}
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9/10/11/12 Regression] internal compiler error: in dependent_type_p, at cp/pt.c:27057
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
` (5 preceding siblings ...)
2021-11-28 23:09 ` pinskia at gcc dot gnu.org
@ 2021-11-29 8:52 ` marxin at gcc dot gnu.org
2021-11-29 9:04 ` pinskia at gcc dot gnu.org
` (10 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-29 8:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |marxin at gcc dot gnu.org
--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
All GCC revisions I have (4.8.0) do ICE on that.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9/10/11/12 Regression] internal compiler error: in dependent_type_p, at cp/pt.c:27057
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
` (6 preceding siblings ...)
2021-11-29 8:52 ` marxin at gcc dot gnu.org
@ 2021-11-29 9:04 ` pinskia at gcc dot gnu.org
2021-11-29 9:12 ` stha09 at googlemail dot com
` (9 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-29 9:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #6)
> All GCC revisions I have (4.8.0) do ICE on that.
Hmm, maybe the ICE was checking on back then.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9/10/11/12 Regression] internal compiler error: in dependent_type_p, at cp/pt.c:27057
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
` (7 preceding siblings ...)
2021-11-29 9:04 ` pinskia at gcc dot gnu.org
@ 2021-11-29 9:12 ` stha09 at googlemail dot com
2021-11-29 18:50 ` stha09 at googlemail dot com
` (8 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: stha09 at googlemail dot com @ 2021-11-29 9:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
--- Comment #8 from Stephan Hartmann <stha09 at googlemail dot com> ---
(In reply to Andrew Pinski from comment #7)
> (In reply to Martin Liška from comment #6)
> > All GCC revisions I have (4.8.0) do ICE on that.
>
> Hmm, maybe the ICE was checking on back then.
I checked only with godbolt. 8.1 works, 8.2 ICE.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9/10/11/12 Regression] internal compiler error: in dependent_type_p, at cp/pt.c:27057
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
` (8 preceding siblings ...)
2021-11-29 9:12 ` stha09 at googlemail dot com
@ 2021-11-29 18:50 ` stha09 at googlemail dot com
2022-01-17 12:49 ` [Bug c++/103455] [9/10/11/12 Regression] internal compiler error: in dependent_type_p since r9-713-gd9338471b91bbe6e1 rguenth at gcc dot gnu.org
` (7 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: stha09 at googlemail dot com @ 2021-11-29 18:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
--- Comment #9 from Stephan Hartmann <stha09 at googlemail dot com> ---
Bisect points to:
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=4c2125ba18f40e57987a828bfd60e83024850e10
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9/10/11/12 Regression] internal compiler error: in dependent_type_p since r9-713-gd9338471b91bbe6e1
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
` (9 preceding siblings ...)
2021-11-29 18:50 ` stha09 at googlemail dot com
@ 2022-01-17 12:49 ` rguenth at gcc dot gnu.org
2022-03-25 17:22 ` ppalka at gcc dot gnu.org
` (6 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-17 12:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9/10/11/12 Regression] internal compiler error: in dependent_type_p since r9-713-gd9338471b91bbe6e1
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
` (10 preceding siblings ...)
2022-01-17 12:49 ` [Bug c++/103455] [9/10/11/12 Regression] internal compiler error: in dependent_type_p since r9-713-gd9338471b91bbe6e1 rguenth at gcc dot gnu.org
@ 2022-03-25 17:22 ` ppalka at gcc dot gnu.org
2022-03-26 14:20 ` cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-03-25 17:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppalka at gcc dot gnu.org
Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9/10/11/12 Regression] internal compiler error: in dependent_type_p since r9-713-gd9338471b91bbe6e1
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
` (11 preceding siblings ...)
2022-03-25 17:22 ` ppalka at gcc dot gnu.org
@ 2022-03-26 14:20 ` cvs-commit at gcc dot gnu.org
2022-03-26 14:22 ` [Bug c++/103455] [9/10/11 " ppalka at gcc dot gnu.org
` (4 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-26 14:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
--- Comment #10 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:04f19580e8dbdbc7366d0f5fd068aa0cecafdc9d
commit r12-7830-g04f19580e8dbdbc7366d0f5fd068aa0cecafdc9d
Author: Patrick Palka <ppalka@redhat.com>
Date: Sat Mar 26 10:20:16 2022 -0400
c++: ICE when building builtin operator->* set [PR103455]
Here when constructing the builtin operator->* candidate set according
to the available conversion functions for the operand types, we end up
considering a candidate with C1=T (through B's dependent conversion
function) and C2=F, during which we crash from DERIVED_FROM_P because
dependent_type_p sees a TEMPLATE_TYPE_PARM outside of a template
context.
Sidestepping the question of whether we should be considering such a
dependent conversion function here in the first place, it seems futile
to test DERIVED_FROM_P for anything other than an actual class type, so
this patch fixes this ICE by simply guarding the DERIVED_FROM_P test
with CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
PR c++/103455
gcc/cp/ChangeLog:
* call.cc (add_builtin_candidate) <case MEMBER_REF>: Test
CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
gcc/testsuite/ChangeLog:
* g++.dg/overload/builtin6.C: New test.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9/10/11 Regression] internal compiler error: in dependent_type_p since r9-713-gd9338471b91bbe6e1
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
` (12 preceding siblings ...)
2022-03-26 14:20 ` cvs-commit at gcc dot gnu.org
@ 2022-03-26 14:22 ` ppalka at gcc dot gnu.org
2022-04-07 19:19 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-03-26 14:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[9/10/11/12 Regression] |[9/10/11 Regression]
|internal compiler error: in |internal compiler error: in
|dependent_type_p since |dependent_type_p since
|r9-713-gd9338471b91bbe6e1 |r9-713-gd9338471b91bbe6e1
--- Comment #11 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 12 so far.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9/10/11 Regression] internal compiler error: in dependent_type_p since r9-713-gd9338471b91bbe6e1
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
` (13 preceding siblings ...)
2022-03-26 14:22 ` [Bug c++/103455] [9/10/11 " ppalka at gcc dot gnu.org
@ 2022-04-07 19:19 ` cvs-commit at gcc dot gnu.org
2022-05-09 23:33 ` [Bug c++/103455] [9/10 " cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
17 siblings, 0 replies; 19+ 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=103455
--- Comment #12 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:722b23d7a616a92b29826c5bc795c49b2f7775da
commit r11-9793-g722b23d7a616a92b29826c5bc795c49b2f7775da
Author: Patrick Palka <ppalka@redhat.com>
Date: Sat Mar 26 10:20:16 2022 -0400
c++: ICE when building builtin operator->* set [PR103455]
Here when constructing the builtin operator->* candidate set according
to the available conversion functions for the operand types, we end up
considering a candidate with C1=T (through B's dependent conversion
function) and C2=F, during which we crash from DERIVED_FROM_P because
dependent_type_p sees a TEMPLATE_TYPE_PARM outside of a template
context.
Sidestepping the question of whether we should be considering such a
dependent conversion function here in the first place, it seems futile
to test DERIVED_FROM_P for anything other than an actual class type, so
this patch fixes this ICE by simply guarding the DERIVED_FROM_P test
with CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
PR c++/103455
gcc/cp/ChangeLog:
* call.c (add_builtin_candidate) <case MEMBER_REF>: Test
CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
gcc/testsuite/ChangeLog:
* g++.dg/overload/builtin6.C: New test.
(cherry picked from commit 04f19580e8dbdbc7366d0f5fd068aa0cecafdc9d)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9/10 Regression] internal compiler error: in dependent_type_p since r9-713-gd9338471b91bbe6e1
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
` (14 preceding siblings ...)
2022-04-07 19:19 ` cvs-commit at gcc dot gnu.org
@ 2022-05-09 23:33 ` cvs-commit at gcc dot gnu.org
2022-05-11 14:59 ` [Bug c++/103455] [9 " cvs-commit at gcc dot gnu.org
2022-05-11 15:06 ` ppalka at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-09 23:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:09ab962a42d81eff636c1ebc7de43dac7cc7a7c0
commit r10-10604-g09ab962a42d81eff636c1ebc7de43dac7cc7a7c0
Author: Patrick Palka <ppalka@redhat.com>
Date: Sat Mar 26 10:20:16 2022 -0400
c++: ICE when building builtin operator->* set [PR103455]
Here when constructing the builtin operator->* candidate set according
to the available conversion functions for the operand types, we end up
considering a candidate with C1=T (through B's dependent conversion
function) and C2=F, during which we crash from DERIVED_FROM_P because
dependent_type_p sees a TEMPLATE_TYPE_PARM outside of a template
context.
Sidestepping the question of whether we should be considering such a
dependent conversion function here in the first place, it seems futile
to test DERIVED_FROM_P for anything other than an actual class type, so
this patch fixes this ICE by simply guarding the DERIVED_FROM_P test
with CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
PR c++/103455
gcc/cp/ChangeLog:
* call.c (add_builtin_candidate) <case MEMBER_REF>: Test
CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
gcc/testsuite/ChangeLog:
* g++.dg/overload/builtin6.C: New test.
(cherry picked from commit 04f19580e8dbdbc7366d0f5fd068aa0cecafdc9d)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9 Regression] internal compiler error: in dependent_type_p since r9-713-gd9338471b91bbe6e1
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
` (15 preceding siblings ...)
2022-05-09 23:33 ` [Bug c++/103455] [9/10 " cvs-commit at gcc dot gnu.org
@ 2022-05-11 14:59 ` cvs-commit at gcc dot gnu.org
2022-05-11 15:06 ` ppalka at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-11 14:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
--- Comment #14 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:3d1c151bc1f4a3231f62dc3af758fb7a19f8f904
commit r9-10156-g3d1c151bc1f4a3231f62dc3af758fb7a19f8f904
Author: Patrick Palka <ppalka@redhat.com>
Date: Sat Mar 26 10:20:16 2022 -0400
c++: ICE when building builtin operator->* set [PR103455]
Here when constructing the builtin operator->* candidate set according
to the available conversion functions for the operand types, we end up
considering a candidate with C1=T (through B's dependent conversion
function) and C2=F, during which we crash from DERIVED_FROM_P because
dependent_type_p sees a TEMPLATE_TYPE_PARM outside of a template
context.
Sidestepping the question of whether we should be considering such a
dependent conversion function here in the first place, it seems futile
to test DERIVED_FROM_P for anything other than an actual class type, so
this patch fixes this ICE by simply guarding the DERIVED_FROM_P test
with CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
PR c++/103455
gcc/cp/ChangeLog:
* call.c (add_builtin_candidate) <case MEMBER_REF>: Test
CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
gcc/testsuite/ChangeLog:
* g++.dg/overload/builtin6.C: New test.
(cherry picked from commit 04f19580e8dbdbc7366d0f5fd068aa0cecafdc9d)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103455] [9 Regression] internal compiler error: in dependent_type_p since r9-713-gd9338471b91bbe6e1
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
` (16 preceding siblings ...)
2022-05-11 14:59 ` [Bug c++/103455] [9 " cvs-commit at gcc dot gnu.org
@ 2022-05-11 15:06 ` ppalka at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-05-11 15:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #15 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 9.5/10.4/11.3/12.
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2022-05-11 15:06 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-28 14:26 [Bug c++/103455] New: internal compiler error: in dependent_type_p, at cp/pt.c:27057 stha09 at googlemail dot com
2021-11-28 17:50 ` [Bug c++/103455] [9/10/11/12 Regression] " pinskia at gcc dot gnu.org
2021-11-28 17:54 ` pinskia at gcc dot gnu.org
2021-11-28 19:00 ` stha09 at googlemail dot com
2021-11-28 19:05 ` stha09 at googlemail dot com
2021-11-28 19:27 ` stha09 at googlemail dot com
2021-11-28 23:09 ` pinskia at gcc dot gnu.org
2021-11-29 8:52 ` marxin at gcc dot gnu.org
2021-11-29 9:04 ` pinskia at gcc dot gnu.org
2021-11-29 9:12 ` stha09 at googlemail dot com
2021-11-29 18:50 ` stha09 at googlemail dot com
2022-01-17 12:49 ` [Bug c++/103455] [9/10/11/12 Regression] internal compiler error: in dependent_type_p since r9-713-gd9338471b91bbe6e1 rguenth at gcc dot gnu.org
2022-03-25 17:22 ` ppalka at gcc dot gnu.org
2022-03-26 14:20 ` cvs-commit at gcc dot gnu.org
2022-03-26 14:22 ` [Bug c++/103455] [9/10/11 " ppalka at gcc dot gnu.org
2022-04-07 19:19 ` cvs-commit at gcc dot gnu.org
2022-05-09 23:33 ` [Bug c++/103455] [9/10 " cvs-commit at gcc dot gnu.org
2022-05-11 14:59 ` [Bug c++/103455] [9 " cvs-commit at gcc dot gnu.org
2022-05-11 15:06 ` 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).