re PR c++/51412 ([c++0x] Broken diagnostic with invalid lambda expressions)
/cp 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com> PR c++/51412 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR. * error.c (dump_expr): Likewise. /testsuite 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com> PR c++/51412 * g++.dg/cpp0x/lambda/lambda-err3.C: New. From-SVN: r196563
This commit is contained in:
parent
b7a786830f
commit
f030a1dc03
5 changed files with 29 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/51412
|
||||
* cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
|
||||
* error.c (dump_expr): Likewise.
|
||||
|
||||
2013-03-08 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/51884
|
||||
|
|
|
@ -1162,6 +1162,10 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t)
|
|||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case LAMBDA_EXPR:
|
||||
pp_cxx_ws_string (pp, "<lambda>");
|
||||
break;
|
||||
|
||||
default:
|
||||
pp_c_expression (pp_c_base (pp), t);
|
||||
|
|
|
@ -2494,6 +2494,10 @@ dump_expr (tree t, int flags)
|
|||
dump_expr (resolve_virtual_fun_from_obj_type_ref (t), flags);
|
||||
break;
|
||||
|
||||
case LAMBDA_EXPR:
|
||||
pp_string (cxx_pp, M_("<lambda>"));
|
||||
break;
|
||||
|
||||
/* This list is incomplete, but should suffice for now.
|
||||
It is very important that `sorry' does not call
|
||||
`report_error_function'. That could cause an infinite loop. */
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/51412
|
||||
* g++.dg/cpp0x/lambda/lambda-err3.C: New.
|
||||
|
||||
2013-03-08 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR tree-optimization/56478
|
||||
|
|
10
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-err3.C
Normal file
10
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-err3.C
Normal file
|
@ -0,0 +1,10 @@
|
|||
// PR c++/51412
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
void foo(int);
|
||||
|
||||
template<int> void bar()
|
||||
{
|
||||
foo([]{}...); // { dg-error "<lambda>" }
|
||||
foo([]{}=0 ...); // { dg-error "<lambda>" }
|
||||
}
|
Loading…
Add table
Reference in a new issue