2019-06-21 Marek Polacek <polacek@redhat.com>
+ PR c++/64235 - missing syntax error with invalid alignas.
+ * parser.c (cp_parser_std_attribute_spec): Commit to tentative parse
+ if there's a missing close paren.
+
PR c++/90490 - fix decltype issues in noexcept-specifier.
* except.c (build_noexcept_spec): Call
instantiate_non_dependent_expr_sfinae before
if (alignas_expr == error_mark_node)
return error_mark_node;
+ /* Missing ')' means the code cannot possibly be valid; go ahead
+ and commit to make sure we issue a hard error. */
+ if (cp_parser_uncommitted_to_tentative_parse_p (parser)
+ && cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_PAREN))
+ cp_parser_commit_to_tentative_parse (parser);
+
if (!parens.require_close (parser))
return error_mark_node;
+2019-06-19 Marek Polacek <polacek@redhat.com>
+
+ PR c++/64235 - missing syntax error with invalid alignas.
+ * g++.dg/parse/alignas1.C: New test.
+
2019-06-21 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/67884
--- /dev/null
+// PR c++/64235
+// { dg-do compile { target c++11 } }
+
+struct S {
+ double d;
+};
+
+struct alignas(sizeof(S) S1 { }; // { dg-error "expected '\\)' before 'S1'" }
+struct alignas(16 S2 { }; // { dg-error "expected '\\)' before 'S2'" }
+struct alignas(int S3 { }; // { dg-error "expected '\\)' before 'S3'" }