re PR c++/70540 (ICE on invalid code in cxx_incomplete_type_diagnostic, at cp/typeck2.c:569)

/cp
2016-04-21  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/70540
	* semantics.c (process_outer_var_ref): Unconditionally return
	error_mark_node when mark_used returns false.

/testsuite
2016-04-21  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/70540
	* g++.dg/cpp0x/auto48.C: New.

From-SVN: r235348
This commit is contained in:
Paolo Carlini 2016-04-21 19:42:34 +00:00 committed by Paolo Carlini
parent aedf4e122b
commit 2070009860
4 changed files with 20 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2016-04-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/70540
* semantics.c (process_outer_var_ref): Unconditionally return
error_mark_node when mark_used returns false.
2016-04-21 Marek Polacek <polacek@redhat.com>
PR c++/70513

View File

@ -3281,7 +3281,7 @@ process_outer_var_ref (tree decl, tsubst_flags_t complain)
tree initializer = convert_from_reference (decl);
/* Mark it as used now even if the use is ill-formed. */
if (!mark_used (decl, complain) && !(complain & tf_error))
if (!mark_used (decl, complain))
return error_mark_node;
bool saw_generic_lambda = false;

View File

@ -1,3 +1,8 @@
2016-04-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/70540
* g++.dg/cpp0x/auto48.C: New.
2016-04-21 Marek Polacek <polacek@redhat.com>
PR c++/70513

View File

@ -0,0 +1,8 @@
// PR c++/70540
// { dg-do compile { target c++11 } }
void
foo ()
{
auto f = [&] { return f; }; // { dg-error "before deduction" }
}