diff options
author | Martin Liska <mliska@suse.cz> | 2022-08-01 05:53:37 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2022-08-01 05:53:37 +0200 |
commit | 89eca196c99645ee1abefcf8b4a9dd84edd87ad6 (patch) | |
tree | 185cc8907ce37e82132f395cb52611f029215355 /gcc/cp | |
parent | 3a4cd5dc6faca8fed7fa256c4c06f4999b5a1f9c (diff) | |
parent | 4a7274ddc4970c1ad011343ed285d6219dffa396 (diff) | |
download | gcc-89eca196c99645ee1abefcf8b4a9dd84edd87ad6.zip gcc-89eca196c99645ee1abefcf8b4a9dd84edd87ad6.tar.gz gcc-89eca196c99645ee1abefcf8b4a9dd84edd87ad6.tar.bz2 |
Merge branch 'master' into devel/sphinx
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 19 | ||||
-rw-r--r-- | gcc/cp/constexpr.cc | 8 | ||||
-rw-r--r-- | gcc/cp/parser.cc | 6 |
3 files changed, 30 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a5ed51a..4d7761c2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,22 @@ +2022-07-31 Lewis Hyatt <lhyatt@gmail.com> + + PR c++/66290 + * parser.cc (cp_lexer_new_main): Rename global done_lexing to + override_libcpp_locations. + +2022-07-31 Jason Merrill <jason@redhat.com> + + PR c++/106369 + * constexpr.cc (reduced_constant_expression_p): Return false + if a CONSTRUCTOR initializes an empty field. + +2022-07-29 Jakub Jelinek <jakub@redhat.com> + + PR c++/106448 + * parser.cc (cp_parser_omp_atomic): For simple cast followed by + CPP_QUERY token, don't try cp_parser_binary_operation if compare + is true. + 2022-07-26 Marek Polacek <polacek@redhat.com> PR c++/106311 diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc index 5f7fc6f..5e0d339 100644 --- a/gcc/cp/constexpr.cc +++ b/gcc/cp/constexpr.cc @@ -3081,7 +3081,13 @@ reduced_constant_expression_p (tree t) element. */ if (!reduced_constant_expression_p (e.value)) return false; - /* Empty class field may or may not have an initializer. */ + /* We want to remove initializers for empty fields in a struct to + avoid confusing output_constructor. */ + if (is_empty_field (e.index) + && TREE_CODE (TREE_TYPE (t)) == RECORD_TYPE) + return false; + /* Check for non-empty fields between initialized fields when + CONSTRUCTOR_NO_CLEARING. */ for (; field && e.index != field; field = next_subobject_field (DECL_CHAIN (field))) if (!is_really_empty_class (TREE_TYPE (field), diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index 4f67441..33926d2 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -755,7 +755,7 @@ cp_lexer_new_main (void) /* Subsequent preprocessor diagnostics should use compiler diagnostic functions to get the compiler source location. */ - done_lexing = true; + override_libcpp_locations = true; maybe_check_all_macros (parse_in); @@ -41535,7 +41535,9 @@ restart: goto saw_error; } token = cp_lexer_peek_token (parser->lexer); - if (token->type != CPP_SEMICOLON && !cp_tree_equal (lhs, rhs1)) + if (token->type != CPP_SEMICOLON + && (!compare || token->type != CPP_QUERY) + && !cp_tree_equal (lhs, rhs1)) { cp_parser_abort_tentative_parse (parser); cp_parser_parse_tentatively (parser); |