8sa1-gcc/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice31.C
Jason Merrill 4f602147b6 c++: Improve error recovery for =.
In a template we were happily embedding error_mark_node in a MODOP_EXPR,
leading to confusion later.

gcc/cp/ChangeLog:

	* typeck.c (build_x_modify_expr): Handle error_mark_node arguments.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/lambda/lambda-ice30.C: Adjust.
	* g++.dg/cpp0x/lambda/lambda-ice31.C: Adjust.
	* g++.dg/ext/fixed1.C: Adjust.
	* g++.dg/template/crash107.C: Adjust.
	* g++.dg/template/error35.C: Adjust.
	* g++.dg/template/sizeof-template-argument.C: Adjust.
2020-05-21 18:04:22 -04:00

9 lines
178 B
C

// PR c++/84518
// { dg-do compile { target c++11 } }
template<typename T> void foo()
{
T x[=]; // { dg-error "expected" }
[&x]{}; // { dg-prune-output "not declared" }
}