mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/52725 (error: "capture of non-variable" for new-expression incorrectly parsed as lambda-expression)
PR c++/52725 * parser.c (cp_parser_binary_expression): Bail early if we're parsing tentatively and the LHS has a parse error. From-SVN: r188127
This commit is contained in:
parent
4efa926130
commit
ef4b1d6de5
|
|
@ -1,5 +1,9 @@
|
||||||
2012-06-01 Jason Merrill <jason@redhat.com>
|
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.
|
||||||
|
|
||||||
PR c++/53137
|
PR c++/53137
|
||||||
* pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
|
* pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
|
||||||
(instantiate_decl): Don't push_to_top_level for local class methods.
|
(instantiate_decl): Don't push_to_top_level for local class methods.
|
||||||
|
|
|
||||||
|
|
@ -7246,6 +7246,9 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p,
|
||||||
current.lhs_type = ERROR_MARK;
|
current.lhs_type = ERROR_MARK;
|
||||||
current.prec = prec;
|
current.prec = prec;
|
||||||
|
|
||||||
|
if (cp_parser_error_occurred (parser))
|
||||||
|
return error_mark_node;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
/* Get an operator token. */
|
/* Get an operator token. */
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
|
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 Eric Botcazou <ebotcazou@adacore.com>
|
2012-06-01 Eric Botcazou <ebotcazou@adacore.com>
|
||||||
|
|
||||||
* c-c++-common/restrict-2.c: Revert previous change.
|
* c-c++-common/restrict-2.c: Revert previous change.
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
// PR c++/52725
|
||||||
|
|
||||||
|
struct A { };
|
||||||
|
|
||||||
|
const int n = 42;
|
||||||
|
|
||||||
|
void f()
|
||||||
|
{
|
||||||
|
A** p = new (A*[n]);
|
||||||
|
}
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
|
|
||||||
template<int> struct A {};
|
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;
|
int a;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue