+2019-05-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/89875
+ * parser.c (cp_parser_sizeof_operand): When the type-id production
+ did not work out commit to the tentative parse.
+
2019-05-29 Jakub Jelinek <jakub@redhat.com>
P1091R3 - Extending structured bindings to be more like var decls
{
tree type = NULL_TREE;
+ tentative_firewall firewall (parser);
+
/* We can't be sure yet whether we're looking at a type-id or an
expression. */
cp_parser_parse_tentatively (parser);
/* If all went well, then we're done. */
if (cp_parser_parse_definitely (parser))
expr = type;
- }
+ else
+ {
+ /* Commit to the tentative_firewall so we get syntax errors. */
+ cp_parser_commit_to_tentative_parse (parser);
- /* If the type-id production did not work out, then we must be
- looking at the unary-expression production. */
- if (!expr)
+ expr = cp_parser_unary_expression (parser);
+ }
+ }
+ else
expr = cp_parser_unary_expression (parser);
/* Go back to evaluating expressions. */
+2019-05-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/89875
+ * g++.dg/cpp0x/decltype-pr66548.C: Remove xfail.
+ * g++.dg/template/sizeof-template-argument.C: Adjust expected error.
+
2019-05-29 Alejandro Martinez <alejandro.martinezvicente@arm.com>
- * gcc.target/aarch64/sve2/aarch64-sve2.exp: New file, regression driver
- for AArch64 SVE2.
+ * gcc.target/aarch64/sve2/aarch64-sve2.exp: New file, regression
+ driver for AArch64 SVE2.
* gcc.target/aarch64/sve2/average_1.c: New test.
* lib/target-supports.exp (check_effective_target_aarch64_sve2): New
helper.
void f ()
{
- decltype (Meow.purr ()) d; // { dg-error "expected primary-expression" "pr89875" { xfail c++98_only } }
+ decltype (Meow.purr ()) d; // { dg-error "expected primary-expression" }
(void)&d;
}
template<int> struct A {};
-template<typename> struct B : A <sizeof(=)> {}; /* { dg-error "template argument" } */
+template<typename> struct B : A <sizeof(=)> {}; /* { dg-error "expected primary-expression" } */
-template<typename> struct C : A <sizeof(=)> {}; /* { dg-error "template argument" } */
+template<typename> struct C : A <sizeof(=)> {}; /* { dg-error "expected primary-expression" } */
int a;