From: Paolo Carlini Date: Thu, 28 Sep 2017 21:18:36 +0000 (+0000) Subject: re PR c++/79488 (ICE from lambda that has invalid return type) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=051e4e1c60ff2d545f19e31b07d50adc26616b4a;p=gcc.git re PR c++/79488 (ICE from lambda that has invalid return type) 2017-09-28 Paolo Carlini PR c++/79488 * g++.dg/cpp0x/lambda/lambda-ice22.C: New. From-SVN: r253270 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0bc6fd4aedd..bc9b1a365b0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-09-28 Paolo Carlini + + PR c++/79488 + * g++.dg/cpp0x/lambda/lambda-ice22.C: New. + 2017-09-28 Jakub Jelinek PR target/82342 diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice22.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice22.C new file mode 100644 index 00000000000..6f2650dbe77 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice22.C @@ -0,0 +1,25 @@ +// PR c++/79488 +// { dg-do compile { target c++11 } } + +int f(); +static int g __attribute__((__weakref__("f"))); + +template struct res { + static Fn val(); + using type = decltype(val()()); // { dg-error "no match for call" } +}; + +template struct A { + template void set_result(T) {} + + virtual void run() { + auto boundfn = []() -> typename res::type{}; + set_result(boundfn); + } +}; + +struct F { + void operator()() &; +}; + +A t;