From: Paolo Carlini Date: Fri, 13 Oct 2017 16:50:13 +0000 (+0000) Subject: re PR c++/80873 (ICE in tsubst_copy when trying to use an overloaded function without... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8de7190350263d381df5c12cfbbfb4191b8d3973;p=gcc.git re PR c++/80873 (ICE in tsubst_copy when trying to use an overloaded function without a definition in a lambda) 2017-10-13 Paolo Carlini PR c++/80873 * g++.dg/cpp1y/auto-fn41.C: New. * g++.dg/cpp1y/auto-fn42.C: Likewise. From-SVN: r253733 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6bb877ea387..f3dbf5d9286 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-10-13 Paolo Carlini + + PR c++/80873 + * g++.dg/cpp1y/auto-fn41.C: New. + * g++.dg/cpp1y/auto-fn42.C: Likewise. + 2017-10-13 David Malcolm * g++.dg/cpp0x/udlit-extern-c.C: New test case. diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn41.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn41.C new file mode 100644 index 00000000000..25a879da118 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn41.C @@ -0,0 +1,23 @@ +// PR c++/80873 +// { dg-do compile { target c++14 } } + +struct S {}; + +auto overloaded(S &); + +template +int overloaded(T &) { + return 0; +} + +template +auto returns_lambda(T ¶m) { + return [&] { + overloaded(param); // { dg-error "before deduction" } + }; +} + +int main() { + S s; + returns_lambda(s); +} diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn42.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn42.C new file mode 100644 index 00000000000..0f2b68efa42 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn42.C @@ -0,0 +1,21 @@ +// PR c++/80873 +// { dg-do compile { target c++14 } } + +struct Buffer {}; + +auto parse(Buffer b); +template void parse(T target); + +template +auto field(T target) { + return [&] { + parse(target); + }; +} + +template +void parse(T target) {} + +auto parse(Buffer b) { + field(0); +}