aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/parser.c3
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-asm1.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-stmtexpr1.C5
5 files changed, 25 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 01b8c4d..035a1b7 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-04 Paolo Carlini <paolo.carlini@oracle.com>
+ Andrew Pinski <apinski@cavium.com>
+
+ PR c++/71946
+ * parser.c (cp_parser_lambda_body): Set parser->in_function_body.
+
2017-10-04 Nathan Sidwell <nathan@acm.org>
Move mangling aliases out of global namespace.
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 6e817cb..28bc8e4 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -10557,6 +10557,7 @@ cp_parser_lambda_body (cp_parser* parser, tree lambda_expr)
{
bool nested = (current_function_decl != NULL_TREE);
bool local_variables_forbidden_p = parser->local_variables_forbidden_p;
+ bool in_function_body = parser->in_function_body;
if (nested)
push_function_context ();
else
@@ -10567,6 +10568,7 @@ cp_parser_lambda_body (cp_parser* parser, tree lambda_expr)
save_omp_privatization_clauses (omp_privatization_save);
/* Clear this in case we're in the middle of a default argument. */
parser->local_variables_forbidden_p = false;
+ parser->in_function_body = true;
/* Finish the function call operator
- class_specifier
@@ -10653,6 +10655,7 @@ cp_parser_lambda_body (cp_parser* parser, tree lambda_expr)
restore_omp_privatization_clauses (omp_privatization_save);
parser->local_variables_forbidden_p = local_variables_forbidden_p;
+ parser->in_function_body = in_function_body;
if (nested)
pop_function_context();
else
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index da8358c..8e00f32 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2017-10-04 Paolo Carlini <paolo.carlini@oracle.com>
+ Andrew Pinski <apinski@cavium.com>
+
+ PR c++/71946
+ * g++.dg/cpp0x/lambda/lambda-asm1.C: New.
+ * g++.dg/cpp0x/lambda/lambda-stmtexpr1.C: Likewise.
+
2017-10-04 Sudakshina Das <sudi.das@arm.com>
* gcc.target/aarch64/bic_imm_1.c: New.
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-asm1.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-asm1.C
new file mode 100644
index 0000000..ef0b125
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-asm1.C
@@ -0,0 +1,4 @@
+// PR c++/71946
+// { dg-do compile { target c++11 } }
+
+auto test = []{ __asm__ __volatile__ ("" : : "r" (0) ); };
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-stmtexpr1.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-stmtexpr1.C
new file mode 100644
index 0000000..e461db6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-stmtexpr1.C
@@ -0,0 +1,5 @@
+// PR c++/71946
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
+
+auto test = []{ int t = ({ int t1; t1 = 7; t1; }); };