Commit dc442cef by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/85076 (ICE with invalid template used as lambda argument)

	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: r258901
parent ef22816c
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.
2018-03-27 Volker Reichelt <v.reichelt@netcologne.de>
* search.c (check_final_overrider): Use inform instead of error
......
......@@ -1078,6 +1078,9 @@ cp_build_reference_type (tree to_type, bool rval)
{
tree lvalue_ref, t;
if (to_type == error_mark_node)
return error_mark_node;
if (TREE_CODE (to_type) == REFERENCE_TYPE)
{
rval = rval && TYPE_REF_IS_RVALUE (to_type);
......
2018-03-27 Jakub Jelinek <jakub@redhat.com>
PR c++/85076
* g++.dg/cpp1y/pr85076.C: New test.
2018-03-27 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/85084
......
// 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" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment