PR c++/46159
* parser.c (cp_parser_primary_expression): Don't warn about a
failed tentative parse.
From-SVN: r170621
2011-03-01 Jason Merrill <jason@redhat.com>
+ PR c++/46159
+ * parser.c (cp_parser_primary_expression): Don't warn about a
+ failed tentative parse.
+
PR c++/47200
* semantics.c (cxx_bind_parameters_in_call): Don't call
adjust_temp_type on non-constant args.
if (c_dialect_objc ())
/* We have an Objective-C++ message. */
return cp_parser_objc_expression (parser);
- maybe_warn_cpp0x (CPP0X_LAMBDA_EXPR);
- return cp_parser_lambda_expression (parser);
+ {
+ tree lam = cp_parser_lambda_expression (parser);
+ /* Don't warn about a failed tentative parse. */
+ if (cp_parser_error_occurred (parser))
+ return error_mark_node;
+ maybe_warn_cpp0x (CPP0X_LAMBDA_EXPR);
+ return lam;
+ }
case CPP_OBJC_STRING:
if (c_dialect_objc ())
2011-03-01 Jason Merrill <jason@redhat.com>
+ * g++.dg/cpp0x/lambda/lambda-98.C: New.
+
* g++.dg/cpp0x/constexpr-non-const-arg2.C: New.
2011-03-02 Richard Sandiford <richard.sandiford@linaro.org>
--- /dev/null
+// PR c++/46159
+// { dg-options -std=c++98 }
+
+void
+f()
+{
+ int **p = new(int(*[2]));
+}