Commit cc6fe784 by Paolo Carlini

re PR c++/82293 (ICE in nonlambda_method_basetype at gcc/cp/lambda.c:886)

/cp
2017-11-29  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/82293
	* lambda.c (nonlambda_method_basetype): Don't use LAMBDA_TYPE_P
	on a null type.

/testsuite
2017-11-29  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/82293
	* g++.dg/cpp0x/lambda/lambda-ice24.C: New.

From-SVN: r255254
parent e3704417
2017-11-29 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/82293
* lambda.c (nonlambda_method_basetype): Don't use LAMBDA_TYPE_P
on a null type.
2017-11-29 Jason Merrill <jason@redhat.com>
PR c++/82760 - memory corruption with aligned new.
......@@ -12,7 +18,7 @@
(note_break_stmt, note_iteration_stmt_body_start,
note_iteration_stmt_body_end): Declare.
* decl.c (struct cp_switch): Add has_default_p, break_stmt_seen_p
and in_loop_body_p fields.
and in_loop_body_p fields.
(push_switch): Clear them.
(pop_switch): Set SWITCH_STMT_CANNOT_FALLTHRU_P if has_default_p
and !break_stmt_seen_p. Assert in_loop_body_p is false.
......
......@@ -920,7 +920,7 @@ nonlambda_method_basetype (void)
return NULL_TREE;
type = current_class_type;
if (!LAMBDA_TYPE_P (type))
if (!type || !LAMBDA_TYPE_P (type))
return type;
/* Find the nearest enclosing non-lambda function. */
......
2017-11-29 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/82293
* g++.dg/cpp0x/lambda/lambda-ice24.C: New.
2017-11-29 Will Schmidt <will_schmidt@vnet.ibm.com>
* gcc.target/powerpc/fold-vec-ld-char.c: Add lxv to expected output.
......
// PR c++/82293
// { dg-do compile { target c++11 } }
// { dg-options "-Wshadow" }
template <typename>
struct S {
int f{[this](){return 42;}()};
};
int main(){
return S<int>{}.f;
}
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