* [Bug c++/97582] [9/10/11 Regression] ICE tree check: expected function_type or method_type, have error_mark in add_function_candidate, at cp/call.c:2146 since r9-6405-gbddee796d0b4800b
2020-10-26 14:08 [Bug c++/97582] New: Regression Internal compiler error in lambda benjamin.freist at hexagon dot com
@ 2020-10-26 14:59 ` marxin at gcc dot gnu.org
2021-01-14 9:31 ` rguenth at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-26 14:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97582
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Keywords| |ice-on-valid-code
CC| |jason at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
Summary|Regression Internal |[9/10/11 Regression] ICE
|compiler error in lambda |tree check: expected
| |function_type or
| |method_type, have
| |error_mark in
| |add_function_candidate, at
| |cp/call.c:2146 since
| |r9-6405-gbddee796d0b4800b
Target Milestone|--- |9.4
Last reconfirmed| |2020-10-26
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r9-6405-gbddee796d0b4800b.
Reduced test-case:
$ cat pr97582.ii
template <typename, typename> class __normal_iterator {};
template <typename _Iterator, typename _Container>
void operator==(__normal_iterator<_Iterator, _Container>,
__normal_iterator<_Iterator, _Container>);
template <typename _Predicate> struct _Iter_pred {
_Predicate _M_pred;
template <typename _Iterator> void operator()(_Iterator __it) {
_M_pred(__it);
}
};
template <typename _Predicate> _Iter_pred<_Predicate> __pred_iter(_Predicate)
{}
template <typename _RandomAccessIterator, typename _Predicate>
void __find_if(_RandomAccessIterator __first, _Predicate __pred) {
__pred(__first);
}
template <typename _InputIterator, typename _Predicate>
void none_of(_InputIterator __last, _Predicate __pred) {
find_if(__last, __pred);
}
template <typename _InputIterator, typename _Predicate>
void any_of(_InputIterator, _InputIterator __last, _Predicate __pred) {
none_of(__last, __pred);
}
template <typename _InputIterator, typename _Tp>
_InputIterator find(_InputIterator, _Tp);
template <typename _InputIterator, typename _Predicate>
void find_if(_InputIterator __last, _Predicate __pred) {
_Iter_pred __trans_tmp_1 = __pred_iter(__pred);
__find_if(__last, __trans_tmp_1);
}
class C2 {
void operator==(C2);
};
class C6 {
void operator==(C6);
};
class C5 : C6, C2 {
void get() {
__normal_iterator<C6 *, int> __trans_tmp_2, __trans_tmp_3;
any_of(__trans_tmp_2, __trans_tmp_3, [](auto elem) {
__normal_iterator<const int **, int> __trans_tmp_4, __trans_tmp_5;
find(__trans_tmp_4, elem) == __trans_tmp_5;
});
}
};
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/97582] [9/10/11 Regression] ICE tree check: expected function_type or method_type, have error_mark in add_function_candidate, at cp/call.c:2146 since r9-6405-gbddee796d0b4800b
2020-10-26 14:08 [Bug c++/97582] New: Regression Internal compiler error in lambda benjamin.freist at hexagon dot com
2020-10-26 14:59 ` [Bug c++/97582] [9/10/11 Regression] ICE tree check: expected function_type or method_type, have error_mark in add_function_candidate, at cp/call.c:2146 since r9-6405-gbddee796d0b4800b marxin at gcc dot gnu.org
@ 2021-01-14 9:31 ` rguenth at gcc dot gnu.org
2021-02-02 5:23 ` ppalka at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-14 9:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97582
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/97582] [9/10/11 Regression] ICE tree check: expected function_type or method_type, have error_mark in add_function_candidate, at cp/call.c:2146 since r9-6405-gbddee796d0b4800b
2020-10-26 14:08 [Bug c++/97582] New: Regression Internal compiler error in lambda benjamin.freist at hexagon dot com
2020-10-26 14:59 ` [Bug c++/97582] [9/10/11 Regression] ICE tree check: expected function_type or method_type, have error_mark in add_function_candidate, at cp/call.c:2146 since r9-6405-gbddee796d0b4800b marxin at gcc dot gnu.org
2021-01-14 9:31 ` rguenth at gcc dot gnu.org
@ 2021-02-02 5:23 ` ppalka at gcc dot gnu.org
2021-02-11 16:00 ` cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-02-02 5:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97582
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org
CC| |ppalka at gcc dot gnu.org
--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Minimal testcase:
struct C1 { void operator+(); };
struct C2 { void operator+(); };
struct C3 : C1, C2 {
template <class T> void get() { [] (T x) { +x; }; }
};
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/97582] [9/10/11 Regression] ICE tree check: expected function_type or method_type, have error_mark in add_function_candidate, at cp/call.c:2146 since r9-6405-gbddee796d0b4800b
2020-10-26 14:08 [Bug c++/97582] New: Regression Internal compiler error in lambda benjamin.freist at hexagon dot com
` (2 preceding siblings ...)
2021-02-02 5:23 ` ppalka at gcc dot gnu.org
@ 2021-02-11 16:00 ` cvs-commit at gcc dot gnu.org
2021-02-11 16:01 ` [Bug c++/97582] [9/10 " ppalka at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-11 16:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97582
--- Comment #3 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:cb168f779c87c1e0c37d22ea82dfb93ff8c873bc
commit r11-7191-gcb168f779c87c1e0c37d22ea82dfb93ff8c873bc
Author: Patrick Palka <ppalka@redhat.com>
Date: Thu Feb 11 10:59:54 2021 -0500
c++: Fix ICE from op_unqualified_lookup [PR97582]
In this testcase, we're crashing because the lookup of operator+ from
within the generic lambda via lookup_name finds multiple bindings
(C1::operator+ and C2::operator+) and returns a TREE_LIST thereof,
something which op_unqualified_lookup (and push_operator_bindings) isn't
prepared to handle.
This patch extends op_unqualified_lookup and push_operator_bindings
to handle such an ambiguous lookup result in the natural way.
gcc/cp/ChangeLog:
PR c++/97582
* name-lookup.c (op_unqualified_lookup): Handle an ambiguous
lookup result by discarding it if the first element is a
class-scope declaration, otherwise return it.
(push_operator_bindings): Handle an ambiguous lookup result by
doing push_local_binding on each element in the list.
gcc/testsuite/ChangeLog:
PR c++/97582
* g++.dg/cpp0x/lambda/lambda-template17.C: New test.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/97582] [9/10 Regression] ICE tree check: expected function_type or method_type, have error_mark in add_function_candidate, at cp/call.c:2146 since r9-6405-gbddee796d0b4800b
2020-10-26 14:08 [Bug c++/97582] New: Regression Internal compiler error in lambda benjamin.freist at hexagon dot com
` (3 preceding siblings ...)
2021-02-11 16:00 ` cvs-commit at gcc dot gnu.org
@ 2021-02-11 16:01 ` ppalka at gcc dot gnu.org
2021-06-01 8:18 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-02-11 16:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97582
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[9/10/11 Regression] ICE |[9/10 Regression] ICE tree
|tree check: expected |check: expected
|function_type or |function_type or
|method_type, have |method_type, have
|error_mark in |error_mark in
|add_function_candidate, at |add_function_candidate, at
|cp/call.c:2146 since |cp/call.c:2146 since
|r9-6405-gbddee796d0b4800b |r9-6405-gbddee796d0b4800b
--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 11 so far.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/97582] [9/10 Regression] ICE tree check: expected function_type or method_type, have error_mark in add_function_candidate, at cp/call.c:2146 since r9-6405-gbddee796d0b4800b
2020-10-26 14:08 [Bug c++/97582] New: Regression Internal compiler error in lambda benjamin.freist at hexagon dot com
` (4 preceding siblings ...)
2021-02-11 16:01 ` [Bug c++/97582] [9/10 " ppalka at gcc dot gnu.org
@ 2021-06-01 8:18 ` rguenth at gcc dot gnu.org
2022-05-27 9:43 ` [Bug c++/97582] [10 " rguenth at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01 8:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97582
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|9.4 |9.5
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/97582] [10 Regression] ICE tree check: expected function_type or method_type, have error_mark in add_function_candidate, at cp/call.c:2146 since r9-6405-gbddee796d0b4800b
2020-10-26 14:08 [Bug c++/97582] New: Regression Internal compiler error in lambda benjamin.freist at hexagon dot com
` (5 preceding siblings ...)
2021-06-01 8:18 ` rguenth at gcc dot gnu.org
@ 2022-05-27 9:43 ` rguenth at gcc dot gnu.org
2022-06-28 10:42 ` jakub at gcc dot gnu.org
2023-07-07 9:10 ` rguenth at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27 9:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97582
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|9.5 |10.4
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/97582] [10 Regression] ICE tree check: expected function_type or method_type, have error_mark in add_function_candidate, at cp/call.c:2146 since r9-6405-gbddee796d0b4800b
2020-10-26 14:08 [Bug c++/97582] New: Regression Internal compiler error in lambda benjamin.freist at hexagon dot com
` (6 preceding siblings ...)
2022-05-27 9:43 ` [Bug c++/97582] [10 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:42 ` jakub at gcc dot gnu.org
2023-07-07 9:10 ` rguenth at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97582
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.4 |10.5
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/97582] [10 Regression] ICE tree check: expected function_type or method_type, have error_mark in add_function_candidate, at cp/call.c:2146 since r9-6405-gbddee796d0b4800b
2020-10-26 14:08 [Bug c++/97582] New: Regression Internal compiler error in lambda benjamin.freist at hexagon dot com
` (7 preceding siblings ...)
2022-06-28 10:42 ` jakub at gcc dot gnu.org
@ 2023-07-07 9:10 ` rguenth at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 9:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97582
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |11.1.0
Target Milestone|10.5 |11.0
Status|ASSIGNED |RESOLVED
Known to fail| |10.5.0
Resolution|--- |FIXED
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed for GCC 11.
^ permalink raw reply [flat|nested] 10+ messages in thread