* parser.c (cp_parser_binary_expression): Bail early if we're parsing
tentatively and the LHS has a parse error.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@188128
138bc75d-0d04-0410-961f-
82ee72b054a4
2012-06-01 Jason Merrill <jason@redhat.com>
+ PR c++/52725
+ * parser.c (cp_parser_binary_expression): Bail early if we're parsing
+ tentatively and the LHS has a parse error.
+
+2012-06-01 Jason Merrill <jason@redhat.com>
+
PR c++/53137
* pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
(instantiate_decl): Don't push_to_top_level for local class methods.
lhs = cp_parser_cast_expression (parser, /*address_p=*/false, cast_p, pidk);
lhs_type = ERROR_MARK;
+ if (cp_parser_error_occurred (parser))
+ return error_mark_node;
+
for (;;)
{
/* Get an operator token. */
2012-06-01 Jason Merrill <jason@redhat.com>
+ PR c++/52725
+ * g++.dg/parse/new6.C: New.
+ * g++.dg/template/sizeof-template-argument.C: Adjust error message.
+
+2012-06-01 Jason Merrill <jason@redhat.com>
+
PR c++/53137
* g++.dg/cpp0x/lambda/lambda-template5.C: New.
--- /dev/null
+// PR c++/52725
+
+struct A { };
+
+const int n = 42;
+
+void f()
+{
+ A** p = new (A*[n]);
+}
template<int> struct A {};
-template<typename> struct B : A <sizeof(=)> {}; /* { dg-error "parse error in template argument list" } */
+template<typename> struct B : A <sizeof(=)> {}; /* { dg-error "template argument" } */
-template<typename> struct C : A <sizeof(=)> {}; /* { dg-error "parse error in template argument list" } */
+template<typename> struct C : A <sizeof(=)> {}; /* { dg-error "template argument" } */
int a;