re PR c++/67810 (Non-expression recognized as fold expression)
authorJason Merrill <jason@redhat.com>
Wed, 7 Oct 2015 01:46:54 +0000 (21:46 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 7 Oct 2015 01:46:54 +0000 (21:46 -0400)
commit8237beb118c5b5a724a459584975a11c3234c1c7
treeb4ad303ed518efe8b5b620511f36ee500ddd8383
parent437d8c80894a5e332b99f72e605050005b4542e5
re PR c++/67810 (Non-expression recognized as fold expression)

PR c++/67810
* parser.c (cp_parser_fold_expr_p): Remove.
(is_binary_op): New.
(cp_parser_fold_expression): Take LHS as parameter.
(cp_parser_primary_expression): Call it after parsing an expression.
(cp_parser_binary_expression, cp_parser_assignment_operator_opt)
(cp_parser_expression): Ignore an operator followed by '...'.
(is_binary_op): New.
* pt.c (tsubst_unary_left_fold, tsubst_binary_left_fold)
(tsubst_unary_right_fold, tsubst_binary_right_fold): Handle errors.

From-SVN: r228556
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp1y/var-templ45.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/fold2.C
gcc/testsuite/g++.dg/cpp1z/fold6.C [new file with mode: 0644]