PR c++/71450
* pt.c (tsubst_copy): Return error_mark_node when mark_used
fails, even when complain & tf_error.
* g++.dg/cpp0x/pr71450-1.C: New test.
* g++.dg/cpp0x/pr71450-2.C: New test.
From-SVN: r242767
2016-11-23 Jakub Jelinek <jakub@redhat.com>
+ PR c++/71450
+ * pt.c (tsubst_copy): Return error_mark_node when mark_used
+ fails, even when complain & tf_error.
+
PR c++/77739
* cp-gimplify.c (cp_gimplify_tree) <case VEC_INIT_EXPR>: Pass
false as handle_invisiref_parm_p to cp_genericize_tree.
}
else
r = t;
- if (!mark_used (r, complain) && !(complain & tf_error))
+ if (!mark_used (r, complain))
return error_mark_node;
return r;
2016-11-23 Jakub Jelinek <jakub@redhat.com>
+ PR c++/71450
+ * g++.dg/cpp0x/pr71450-1.C: New test.
+ * g++.dg/cpp0x/pr71450-2.C: New test.
+
PR c++/77739
* g++.dg/cpp1y/pr77739.C: New test.
--- /dev/null
+// PR c++/71450
+// { dg-do compile { target c++11 } }
+
+struct A { A operator+ (A a) { return a; } };
+
+template <class T>
+void foo (T t)
+{
+ auto x = t + x; // { dg-error "use of 'x' before deduction of 'auto'" }
+}
+
+int
+main ()
+{
+ foo (A ());
+}
--- /dev/null
+// PR c++/71450
+// { dg-do compile { target c++11 } }
+
+template <class T>
+void foo (T t)
+{
+ auto x = t + x; // { dg-error "use of 'x' before deduction of 'auto'" }
+}
+
+int
+main ()
+{
+ foo (1);
+}