2017-10-13 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/80873
* g++.dg/cpp1y/auto-fn41.C: New.
* g++.dg/cpp1y/auto-fn42.C: Likewise.
From-SVN: r253733
+2017-10-13 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/80873
+ * g++.dg/cpp1y/auto-fn41.C: New.
+ * g++.dg/cpp1y/auto-fn42.C: Likewise.
+
2017-10-13 David Malcolm <dmalcolm@redhat.com>
* g++.dg/cpp0x/udlit-extern-c.C: New test case.
--- /dev/null
+// PR c++/80873
+// { dg-do compile { target c++14 } }
+
+struct S {};
+
+auto overloaded(S &);
+
+template <typename T>
+int overloaded(T &) {
+ return 0;
+}
+
+template <typename T>
+auto returns_lambda(T ¶m) {
+ return [&] {
+ overloaded(param); // { dg-error "before deduction" }
+ };
+}
+
+int main() {
+ S s;
+ returns_lambda(s);
+}
--- /dev/null
+// PR c++/80873
+// { dg-do compile { target c++14 } }
+
+struct Buffer {};
+
+auto parse(Buffer b);
+template <typename T> void parse(T target);
+
+template <typename T>
+auto field(T target) {
+ return [&] {
+ parse(target);
+ };
+}
+
+template <typename T>
+void parse(T target) {}
+
+auto parse(Buffer b) {
+ field(0);
+}