Backported from mainline
2018-03-27 Jakub Jelinek <jakub@redhat.com>
PR c++/85076
* tree.c (cp_build_reference_type): If to_type is error_mark_node,
return it right away.
* g++.dg/cpp1y/pr85076.C: New test.
From-SVN: r262087
Backported from mainline
2018-03-27 Jakub Jelinek <jakub@redhat.com>
+ PR c++/85076
+ * tree.c (cp_build_reference_type): If to_type is error_mark_node,
+ return it right away.
+
PR c++/85068
* class.c (update_vtable_entry_for_fn): Don't ICE if base_binfo
is NULL. Assert if thunk_binfo is NULL then errorcount is non-zero.
cp_build_reference_type (tree to_type, bool rval)
{
tree lvalue_ref, t;
+
+ if (to_type == error_mark_node)
+ return error_mark_node;
+
lvalue_ref = build_reference_type (to_type);
if (!rval)
return lvalue_ref;
Backported from mainline
2018-03-27 Jakub Jelinek <jakub@redhat.com>
+ PR c++/85076
+ * g++.dg/cpp1y/pr85076.C: New test.
+
PR c++/85068
* g++.dg/inherit/covariant22.C: New test.
--- /dev/null
+// PR c++/85076
+// { dg-do compile { target c++14 } }
+
+template<typename> struct A*; // { dg-error "expected unqualified-id before" }
+
+auto a = [](A<auto>) {}; // { dg-error "is not a template|has incomplete type" }