From: Jason Merrill Date: Wed, 30 Aug 2017 22:19:33 +0000 (-0400) Subject: PR c++/82030 - ICE inheriting from multiple lambdas X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3f0973e53960f7487d41a9867fbe60b1a35e794b;p=gcc.git PR c++/82030 - ICE inheriting from multiple lambdas PR c++/80767 * call.c (compare_ics): Handle null candidate. From-SVN: r251549 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 10ae08ae186..a8c13672b5f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2017-08-30 Jason Merrill + + PR c++/82030 - ICE inheriting from multiple lambdas + PR c++/80767 + * call.c (compare_ics): Handle null candidate. + 2017-08-30 Ville Voutilainen Make taking the address of an overloaded function a non-deduced context diff --git a/gcc/cp/call.c b/gcc/cp/call.c index c446057cfba..9e4a5c1b9ae 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -9561,7 +9561,9 @@ compare_ics (conversion *ics1, conversion *ics2) return 0; else if (t1->kind == ck_user) { - if (t1->cand->fn != t2->cand->fn) + tree f1 = t1->cand ? t1->cand->fn : t1->type; + tree f2 = t2->cand ? t2->cand->fn : t2->type; + if (f1 != f2) return 0; } else diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv12.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv12.C new file mode 100644 index 00000000000..16adee6b9c3 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv12.C @@ -0,0 +1,18 @@ +// PR c++/80767 +// { dg-do compile { target c++11 } } + +template struct A { using type = U; }; +template struct B : B::type, B::type { + using type = B; + using B::type::operator(); +}; +template struct B { using type = F; }; +struct { + template ::type...>::type> + Overload operator()(F...){} +} a; +int main() { + auto f = a([](int) {}, [](float) {}); + f({}); +}