12021-06-01 Release Manager 2 3 * GCC 9.4.0 released. 4 52021-05-28 Jason Merrill <jason@redhat.com> 6 7 PR c++/100797 8 PR c++/95719 9 * call.c (build_over_call): Adjust base_binfo in 10 resolves_to_fixed_type_p case. 11 122021-05-21 Jason Merrill <jason@redhat.com> 13 14 PR c++/97938 15 * cp-tree.h (PACK_EXPANSION_AUTO_P): New. 16 * lambda.c (add_capture): Set it. 17 * pt.c (tsubst_pack_expansion): Handle it. 18 192021-05-21 Jason Merrill <jason@redhat.com> 20 21 PR c++/52625 22 * pt.c (maybe_process_partial_specialization): Check 23 DECL_SELF_REFERENCE_P. 24 252021-05-21 Jason Merrill <jason@redhat.com> 26 27 PR c++/80456 28 * call.c (build_new_method_call_1): Check again for side-effects 29 with a volatile object. 30 312021-04-30 Jason Merrill <jason@redhat.com> 32 33 PR c++/95719 34 * call.c (build_over_call): Look up the overrider in base_binfo. 35 * class.c (lookup_vfn_in_binfo): Look through BINFO_PRIMARY_P. 36 372021-04-21 Patrick Palka <ppalka@redhat.com> 38 39 Backported from master: 40 2021-02-23 Patrick Palka <ppalka@redhat.com> 41 42 PR c++/95468 43 * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied 44 over from tsubst_copy. 45 462021-04-21 Patrick Palka <ppalka@redhat.com> 47 48 Backported from master: 49 2020-08-05 Patrick Palka <ppalka@redhat.com> 50 Jason Merrill <jason@redhat.com> 51 52 PR c++/96282 53 * constexpr.c (cxx_eval_vec_init_1): Truncate ctx->ctor and 54 then clear CONSTRUCTOR_NO_CLEARING on each appended element 55 initializer if we're initializing a previously zero-initialized 56 array object. 57 582021-04-21 Patrick Palka <ppalka@redhat.com> 59 60 Backported from master: 61 2020-07-30 Patrick Palka <ppalka@redhat.com> 62 63 PR c++/64194 64 * pt.c (resolve_overloaded_unification): If the function 65 template specialization has a placeholder return type, 66 then instantiate it before attempting unification. 67 682021-04-20 Jakub Jelinek <jakub@redhat.com> 69 70 Backported from master: 71 2021-04-20 Jakub Jelinek <jakub@redhat.com> 72 73 PR c++/99833 74 * pt.c (extract_locals_r): When handling DECL_EXPR of a structured 75 binding, add to data.internal also all corresponding structured 76 binding decls. 77 782021-04-20 Jakub Jelinek <jakub@redhat.com> 79 80 Backported from master: 81 2021-03-30 Jakub Jelinek <jakub@redhat.com> 82 83 PR c++/99790 84 * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST. 85 862021-04-20 Jakub Jelinek <jakub@redhat.com> 87 88 Backported from master: 89 2021-03-30 Jakub Jelinek <jakub@redhat.com> 90 91 PR c++/99745 92 * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter 93 packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case. 94 952021-04-20 Jakub Jelinek <jakub@redhat.com> 96 97 Backported from master: 98 2021-03-30 Jakub Jelinek <jakub@redhat.com> 99 100 PR c++/99650 101 * decl.c (cp_finish_decomp): Diagnose void initializers when 102 using tuple_element and get. 103 1042021-04-20 Jakub Jelinek <jakub@redhat.com> 105 106 Backported from master: 107 2021-03-19 Jakub Jelinek <jakub@redhat.com> 108 109 PR c++/99613 110 * decl.c (expand_static_init): For thread guards, call __cxa_atexit 111 before calling __cxa_guard_release rather than after it. Formatting 112 fixes. 113 1142021-04-20 Jakub Jelinek <jakub@redhat.com> 115 116 Backported from master: 117 2021-03-19 Jakub Jelinek <jakub@redhat.com> 118 119 PR c++/82959 120 * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR 121 and COMPOUND_EXPR. 122 1232021-04-20 Jakub Jelinek <jakub@redhat.com> 124 125 Backported from master: 126 2021-03-19 Jakub Jelinek <jakub@redhat.com> 127 128 PR c++/95451 129 * lambda.c (is_lambda_ignored_entity): Before checking for 130 LAMBDA_FUNCTION_P, use OVL_FIRST. Drop FUNCTION_DECL check. 131 1322021-04-20 Jakub Jelinek <jakub@redhat.com> 133 134 Backported from master: 135 2021-03-19 Jakub Jelinek <jakub@redhat.com> 136 137 PR sanitizer/99106 138 * init.c (build_zero_init_1): For flexible array members just return 139 NULL_TREE instead of returning empty CONSTRUCTOR with non-complete 140 ARRAY_TYPE. 141 1422021-04-20 Jakub Jelinek <jakub@redhat.com> 143 144 Backported from master: 145 2021-03-19 Jakub Jelinek <jakub@redhat.com> 146 147 PR c++/99033 148 * init.c (build_zero_init_1): Handle zero initialiation of 149 flexible array members like initialization of [0] arrays. 150 Use integer_minus_onep instead of comparison to integer_minus_one_node 151 and integer_zerop instead of comparison against size_zero_node. 152 Formatting fixes. 153 1542021-04-20 Jakub Jelinek <jakub@redhat.com> 155 156 Backported from master: 157 2021-03-19 Jakub Jelinek <jakub@redhat.com> 158 159 PR c++/97878 160 * decl.c (check_array_initializer): For structured bindings, require 161 the array type to be complete. 162 1632021-04-20 Jakub Jelinek <jakub@redhat.com> 164 165 Backported from master: 166 2021-01-29 Jakub Jelinek <jakub@redhat.com> 167 168 PR c++/33661 169 PR c++/98847 170 * decl.c (cp_finish_decl): For register vars with asmspec in templates 171 call set_user_assembler_name and set DECL_HARD_REGISTER. 172 * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars, 173 pass asmspec_tree to cp_finish_decl. 174 1752021-04-20 Jakub Jelinek <jakub@redhat.com> 176 177 Backported from master: 178 2021-01-29 Jakub Jelinek <jakub@redhat.com> 179 180 PR sanitizer/95693 181 * init.c (build_zero_init_1): Revert the 2018-03-06 change to 182 return build_zero_cst for reference types. 183 * typeck2.c (process_init_constructor_record): Instead call 184 build_zero_cst here during error recovery instead of build_zero_init. 185 1862021-04-20 Jakub Jelinek <jakub@redhat.com> 187 188 Backported from master: 189 2021-01-29 Jakub Jelinek <jakub@redhat.com> 190 191 PR c++/98672 192 * constexpr.c (check_for_return_continue_data): Add break_stmt member. 193 (check_for_return_continue): Also look for BREAK_STMT. Handle 194 SWITCH_STMT by ignoring break_stmt from its body. 195 (potential_constant_expression_1) <case FOR_STMT>, 196 <case WHILE_STMT>: If the condition isn't constant true, check if 197 the loop body can contain a return stmt. 198 <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer. 199 <case IF_STMT>: If recursion with tf_none is successful, 200 merge *jump_target from the branches - returns with highest priority, 201 breaks or continues lower. If then branch is potentially constant and 202 doesn't return, check the else branch if it could return, break or 203 continue. 204 2052021-04-20 Jakub Jelinek <jakub@redhat.com> 206 207 Backported from master: 208 2021-01-06 Jakub Jelinek <jakub@redhat.com> 209 210 PR c++/98187 211 * parser.c (cp_parser_omp_parallel): For parallel master with 212 -fopenmp-simd only, just call cp_parser_omp_master instead of 213 wrapping it in OMP_PARALLEL. 214 2152021-04-20 Jakub Jelinek <jakub@redhat.com> 216 217 Backported from master: 218 2021-01-06 Jakub Jelinek <jakub@redhat.com> 219 220 PR c++/98072 221 * parser.c (cp_parser_omp_depobj): Suppress location wrappers when 222 parsing depend clause. 223 2242021-04-20 Jakub Jelinek <jakub@redhat.com> 225 226 Backported from master: 227 2020-11-12 Jakub Jelinek <jakub@redhat.com> 228 229 PR c++/97663 230 * parser.c (cp_parser_init_declarator): Don't try to parse 231 C++17 deduction guides if there are any type specifiers even when 232 type is NULL. 233 2342021-03-06 Tobias Burnus <tobias@codesourcery.com> 235 236 Backported from master: 237 2021-03-05 Tobias Burnus <tobias@codesourcery.com> 238 239 PR c/99137 240 * parser.c (cp_parser_oacc_clause_async): Reject comma expressions. 241 2422021-03-04 Jason Merrill <jason@redhat.com> 243 244 PR c++/98810 245 * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const 246 to a class non-type template argument that needs it. 247 2482021-03-04 Jason Merrill <jason@redhat.com> 249 250 PR c++/95675 251 * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR 252 if it didn't get one before. 253 2542021-02-27 Jason Merrill <jason@redhat.com> 255 256 PR c++/90333 257 * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes 258 between () and ->. 259 2602021-01-29 Jason Merrill <jason@redhat.com> 261 262 PR c++/63707 263 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt 264 if we got a CONSTRUCTOR. 265 2662020-12-16 Nathan Sidwell <nathan@acm.org> 267 268 * parser.c (cp_parser_elaborated_type_specifier): Test 269 BOUND_TEMPLATE_TEMPLATE_PARM before checking for instantiation. 270 2712020-11-26 Thomas Schwinge <thomas@codesourcery.com> 272 273 Backported from master: 274 2020-11-26 Thomas Schwinge <thomas@codesourcery.com> 275 276 * parser.c (cp_parser_omp_var_list_no_open): Assert that array 277 section's 'low_bound', 'length' are not location wrapper nodes. 278 (cp_parser_oacc_all_clauses, cp_parser_oacc_cache): Instantiate 279 'auto_suppress_location_wrappers'. 280 2812020-11-25 Thomas Schwinge <thomas@codesourcery.com> 282 283 Backported from master: 284 2020-11-25 Thomas Schwinge <thomas@codesourcery.com> 285 286 * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE__CACHE_'. 287 (tsubst_expr): Handle 'OACC_CACHE'. 288 2892020-11-24 Jason Merrill <jason@redhat.com> 290 291 PR c++/95158 292 * class.c (lookup_vfn_in_binfo): New. 293 * call.c (build_over_call): Use it. 294 (build_new_method_call_1): Don't set LOOKUP_NONVIRTUAL. 295 * cp-tree.h (resolves_to_fixed_type_p): Add default argument. 296 (lookup_vfn_in_binfo): Declare. 297 2982020-11-13 Patrick Palka <ppalka@redhat.com> 299 300 Backported from master: 301 2020-10-07 Patrick Palka <ppalka@redhat.com> 302 303 PR c++/88115 304 PR libstdc++/97273 305 * tree.c (cp_tree_equal) <case ALIGNOF_EXPR>: Return false if 306 ALIGNOF_EXPR_STD_P differ. 307 3082020-09-16 Jakub Jelinek <jakub@redhat.com> 309 310 Backported from master: 311 2020-09-03 Jakub Jelinek <jakub@redhat.com> 312 313 PR c++/96862 314 * constexpr.c (cxx_eval_outermost_constant_expr): Temporarily disable 315 flag_rounding_math during manifestly constant evaluation. 316 3172020-09-16 Jakub Jelinek <jakub@redhat.com> 318 319 Backported from master: 320 2020-05-28 Jakub Jelinek <jakub@redhat.com> 321 322 PR c++/95328 323 * decl.c (cp_finish_decomp): Call complete_type before checking 324 COMPLETE_TYPE_P. 325 3262020-09-16 Jakub Jelinek <jakub@redhat.com> 327 328 Backported from master: 329 2020-05-07 Jakub Jelinek <jakub@redhat.com> 330 331 PR c++/94951 332 * typeck.c (cp_strict_aliasing_warning): New function. 333 (cp_build_indirect_ref_1, build_reinterpret_cast_1): Use 334 it instead of strict_aliasing_warning. 335 3362020-09-16 Jakub Jelinek <jakub@redhat.com> 337 338 Backported from master: 339 2020-04-24 Jakub Jelinek <jakub@redhat.com> 340 341 PR c++/94742 342 * semantics.c (finish_call_expr): When looking if all overloads 343 are noreturn, use STRIP_TEMPLATE to look through TEMPLATE_DECLs. 344 3452020-09-16 Jakub Jelinek <jakub@redhat.com> 346 347 Backported from master: 348 2020-04-16 Jakub Jelinek <jakub@redhat.com> 349 350 PR c++/94571 351 * parser.c (cp_parser_simple_declaration): Fix up a pasto in 352 diagnostics. 353 3542020-09-16 Jakub Jelinek <jakub@redhat.com> 355 356 Backported from master: 357 2020-04-08 Jakub Jelinek <jakub@redhat.com> 358 359 PR c++/94325 360 * decl.c (begin_destructor_body): For CLASSTYPE_VBASECLASSES class 361 dtors, if CLASSTYPE_PRIMARY_BINFO is non-NULL, but not BINFO_VIRTUAL_P, 362 look at CLASSTYPE_PRIMARY_BINFO of its BINFO_TYPE if it is not 363 BINFO_VIRTUAL_P, and so on. 364 3652020-06-16 Patrick Palka <ppalka@redhat.com> 366 367 PR c++/95678 368 * tree.c (zero_init_expr_p): Use uses_template_parms instead of 369 dependent_type_p. 370 3712020-06-11 Marek Polacek <polacek@redhat.com> 372 373 PR c++/95344 374 * cp-gimplify.c (cp_fold) <case MODIFY_EXPR>: Don't set 375 TREE_THIS_VOLATILE here. 376 (cp_fold): Set it here along with TREE_NO_WARNING. 377 3782020-06-11 Marek Polacek <polacek@redhat.com> 379 380 PR c++/95560 381 * name-lookup.c (check_local_shadow): Check if types are 382 non-null before calling same_type_p. 383 3842020-05-25 Jason Merrill <jason@redhat.com> 385 386 PR c++/90212 387 * constexpr.c (potential_constant_expression_1): In a lambda 388 function, consider a captured variable directly. 389 3902020-05-25 Jason Merrill <jason@redhat.com> 391 392 PR c++/90479 393 * init.c (get_nsdmi): Don't push_to_top_level for a local class. 394 3952020-05-25 Jason Merrill <jason@redhat.com> 396 397 PR c++/91529 398 * decl.c (cp_finish_decl): Also clear TREE_READONLY if 399 -fmerge-all-constants. 400 4012020-05-25 Jason Merrill <jason@redhat.com> 402 403 PR c++/93822 404 * pt.c (tsubst_decl): Make sure DECL_VALUE_EXPR continues to have 405 the same type as the variable. 406 4072020-05-06 Nathan Sidwell <nathan@acm.org> 408 409 PR c++/94946 410 * decl.c (grokdeclarator): Don't splice template attributes in 411 parm context -- they can apply to the parm. 412 4132020-04-27 Jason Merrill <jason@redhat.com> 414 415 PR c++/90750 416 PR c++/79585 417 * decl.c (grokdeclarator): Move dependent attribute to decl. 418 * decl2.c (splice_template_attributes): No longer static. 419 4202020-04-21 Martin Sebor <msebor@redhat.com> 421 Jason Merrill <jason@redhat.com> 422 423 PR c++/94510 424 * decl.c (reshape_init_array_1): Avoid stripping redundant trailing 425 zero initializers... 426 * mangle.c (write_expression): ...and handle them here even for 427 pointers to members by calling zero_init_expr_p. 428 * cp-tree.h (zero_init_expr_p): Declare. 429 * tree.c (zero_init_expr_p): Define. 430 (type_initializer_zero_p): Remove. 431 * pt.c (tparm_obj_values): New hash_map. 432 (get_template_parm_object): Store to it. 433 (tparm_object_argument): New. 434 4352020-04-20 Marek Polacek <polacek@redhat.com> 436 437 Backported from mainline 438 2020-04-20 Marek Polacek <polacek@redhat.com> 439 440 PR c++/94505 - bogus -Wparentheses warning with fold-expression. 441 * pt.c (fold_expression): Add warning_sentinel for -Wparentheses 442 before calling build_x_binary_op. 443 4442020-04-07 Jakub Jelinek <jakub@redhat.com> 445 446 PR c++/94512 447 * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED 448 if cp_parser_omp_master succeeded. 449 450 Backported from mainline 451 2020-04-04 Jakub Jelinek <jakub@redhat.com> 452 453 PR c++/94477 454 * pt.c (tsubst_expr) <case OMP_MASTER>: Clear 455 omp_parallel_combined_clauses. 456 457 2020-03-30 Jakub Jelinek <jakub@redhat.com> 458 459 PR c++/94385 460 * semantics.c (add_stmt): Only set STMT_IS_FULL_EXPR_P on trees with 461 STATEMENT_CODE_P code. 462 463 2020-03-19 Jakub Jelinek <jakub@redhat.com> 464 465 PR c++/93931 466 * parser.c (cp_parser_omp_var_list_no_open): Call process_outer_var_ref 467 on outer_automatic_var_p decls. 468 * cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also for 469 capture proxy decls. 470 471 2020-03-17 Jakub Jelinek <jakub@redhat.com> 472 473 PR c++/90995 474 * parser.c (cp_parser_enum_specifier): Use temp_override for 475 parser->colon_corrects_to_scope_p, replace goto out with return. 476 If scoped enum or enum with underlying type is not followed by 477 { or ;, call cp_parser_commit_to_tentative_parse before calling 478 cp_parser_error and make sure to return error_mark_node instead of 479 NULL_TREE. Formatting fixes. 480 4812020-04-05 Marek Polacek <polacek@redhat.com> 482 483 2020-02-06 Marek Polacek <polacek@redhat.com> 484 Backport from mainline 485 486 PR c++/93597 - ICE with lambda in operator function. 487 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn. 488 4892020-04-04 Jason Merrill <jason@redhat.com> 490 491 PR c++/91377 492 * mangle.c (write_expression): Skip IMPLICIT_CONV_EXPR. 493 4942020-04-04 Jason Merrill <jason@redhat.com> 495 496 PR c++/94453 497 * constexpr.c (maybe_constant_value): Use break_out_target_exprs. 498 * expr.c (mark_use) [VIEW_CONVERT_EXPR]: Don't wrap a TARGET_EXPR in 499 NON_LVALUE_EXPR. 500 5012020-04-03 Jason Merrill <jason@redhat.com> 502 503 PR c++/91966 504 * pt.c (complex_pack_expansion_r): New. 505 (complex_alias_template_p): Use it. 506 5072020-03-30 Jason Merrill <jason@redhat.com> 508 509 PR c++/90711 510 * tree.c (cp_tree_equal) [CALL_EXPR]: Compare KOENIG_LOOKUP_P. 511 (called_fns_equal): Check DECL_CONTEXT. 512 5132020-03-27 Nathan Sidwell <nathan@acm.org> 514 515 PR c++/84733 516 * name-lookup.c (do_pushdecl): Look through cleanp levels. 517 5182020-03-14 Jason Merrill <jason@redhat.com> 519 520 PR c++/92909 521 * pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk 522 DECL_ORIGINAL_TYPE of a typedef. 523 5242020-03-14 Jason Merrill <jason@redhat.com> 525 526 PR c++/92068 527 * pt.c (process_partial_specialization): Error rather than crash on 528 extra pack expansion. 529 5302020-03-14 Jason Merrill <jason@redhat.com> 531 532 PR c++/93248 533 * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for 534 substituting DECL_ARGUMENTS. 535 5362020-03-12 Release Manager 537 538 * GCC 9.3.0 released. 539 5402020-03-05 Jason Merrill <jason@redhat.com> 541 542 PR c++/88395 543 PR c++/93551 544 * constraint.cc (constraints_satisfied_p): Use push_tinst_level. 545 5462020-03-05 Martin Sebor <msebor@redhat.com> 547 548 Backport from trunk. 549 2020-02-21 Martin Sebor <msebor@redhat.com> 550 551 PR gcov-profile/93753 552 * class.c (check_flexarrays): Tighten up a test for potential members 553 of anonymous structs or unions. 554 5552020-03-05 Jason Merrill <jason@redhat.com> 556 557 PR c++/90338 558 * pt.c (invalid_nontype_parm_type_p): Check complain for non-literal 559 and mutable errors. 560 5612020-03-04 Jason Merrill <jason@redhat.com> 562 563 PR c++/91607 564 * constexpr.c (constexpr_call_hasher::equal): Use 565 same_type_ignoring_top_level_qualifiers_p. 566 5672020-03-04 Martin Sebor <msebor@redhat.com> 568 569 PR c++/90938 570 * tree.c (type_initializer_zero_p): Fail for structs initialized 571 with non-structs. 572 5732020-03-04 Marek Polacek <polacek@redhat.com> 574 575 Backported from mainline 576 2020-01-24 Marek Polacek <polacek@redhat.com> 577 578 PR c++/93299 - ICE in tsubst_copy with parenthesized expression. 579 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR. 580 5812020-03-04 Marek Polacek <polacek@redhat.com> 582 583 Backported from mainline 584 2020-02-26 Marek Polacek <polacek@redhat.com> 585 586 PR c++/93676 - value-init crash in template. 587 * init.c (build_new_1): Don't call build_vec_init in a template. 588 5892020-03-04 Jason Merrill <jason@redhat.com> 590 Marek Polacek <polacek@redhat.com> 591 592 PR c++/90505 - mismatch in template argument deduction. 593 * pt.c (tsubst): Don't reduce the template level of template 594 parameters when tf_partial. 595 5962020-03-04 Jason Merrill <jason@redhat.com> 597 598 PR c++/90432 599 * init.c (perform_member_init): Don't do aggregate initialization of 600 empty field. 601 * constexpr.c (cx_check_missing_mem_inits): Don't enforce 602 initialization of empty field. 603 6042020-03-04 Jason Merrill <jason@redhat.com> 605 606 PR c++/90997 607 * semantics.c (finish_call_expr): Don't call 608 instantiate_non_dependent_expr before warn_for_memset. 609 6102020-03-02 Jason Merrill <jason@redhat.com> 611 612 PR c++/86917 613 * constexpr.c (cxx_eval_vec_init_1): Handle CONSTRUCTOR. 614 6152020-03-02 Jason Merrill <jason@redhat.com> 616 617 PR c++/91953 618 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow 619 empty class type. 620 [COMPONENT_REF]: A member function reference doesn't use the object 621 as an rvalue. 622 6232020-03-02 Jason Merrill <jason@redhat.com> 624 625 PR c++/88256 626 * cp-gimplify.c (predeclare_vla): New. 627 (cp_genericize_r) [NOP_EXPR]: Call it. 628 6292020-03-02 Jason Merrill <jason@redhat.com> 630 631 PR c++/93442 632 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt. 633 6342020-03-02 Jason Merrill <jason@redhat.com> 635 636 PR c++/90732 - ICE with VLA capture and generic lambda. 637 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs. 638 6392020-03-02 Jason Merrill <jason@redhat.com> 640 641 PR c++/90333 642 PR c++/89640 643 PR c++/60503 644 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in 645 a trailing return type. 646 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before 647 parens. 648 6492020-02-26 Marek Polacek <polacek@redhat.com> 650 651 PR c++/92745 - bogus error when initializing array of vectors. 652 * decl.c (reshape_init_r): For a nested compound literal, do 653 call reshape_init_{class,array,vector}. 654 6552020-02-26 Jason Merrill <jason@redhat.com> 656 657 PR c++/90951 658 * constexpr.c (cxx_eval_array_reference): {}-initialize missing 659 elements instead of value-initializing them. 660 6612020-02-26 Jason Merrill <jason@redhat.com> 662 663 PR c++/93140 664 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in 665 handling of TREE_CHAIN for empty pack. 666 6672020-02-26 Jason Merrill <jason@redhat.com> 668 669 PR c++/92852 670 * constexpr.c (maybe_constant_value): Don't unshare if the cached 671 value is the same as the argument. 672 6732020-02-14 Jakub Jelinek <jakub@redhat.com> 674 675 PR c++/61414 676 * class.c (enum_min_precision): Change prec type from int to int &. 677 6782020-02-13 Jakub Jelinek <jakub@redhat.com> 679 680 Backported from mainline 681 2020-02-05 Jakub Jelinek <jakub@redhat.com> 682 683 PR c++/93557 684 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg 685 prior to passing it to c_build_vec_convert. 686 687 2020-01-29 Jakub Jelinek <jakub@redhat.com> 688 689 PR c++/91118 690 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return 691 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls. 692 6932020-01-28 Jason Merrill <jason@redhat.com> 694 695 PR c++/90546 696 * call.c (build_user_type_conversion_1): Allow a template conversion 697 returning an rvalue reference to bind directly to an lvalue. 698 699 PR c++/90731 700 * decl.c (grokdeclarator): Propagate eh spec from typedef. 701 702 PR c++/90966 703 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert. 704 705 PR c++/93279 - ICE with lambda in member operator. 706 * name-lookup.c (maybe_save_operator_binding): Don't remember 707 class-scope bindings. 708 7092020-01-27 Nathan Sidwell <nathan@acm.org> 710 711 PR c++/91826 712 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias. 713 7142020-01-24 Jason Merrill <jason@redhat.com> 715 716 PR c++/92852 - ICE with generic lambda and reference var. 717 * constexpr.c (maybe_constant_value): Likewise. 718 7192020-01-22 Jakub Jelinek <jakub@redhat.com> 720 721 Backported from mainline 722 2020-01-17 Jakub Jelinek <jakub@redhat.com> 723 724 PR c++/93228 725 * parser.c (cp_parser_template_name): Look up deprecated attribute 726 in DECL_TEMPLATE_RESULT or its type's attributes. 727 728 2019-12-26 Jakub Jelinek <jakub@redhat.com> 729 730 PR c++/92438 731 * parser.c (cp_parser_constructor_declarator_p): If open paren 732 is followed by RID_ATTRIBUTE, skip over the attribute tokens and 733 try to parse type specifier. 734 735 2019-12-20 Jakub Jelinek <jakub@redhat.com> 736 737 PR c++/92992 738 * call.c (convert_arg_to_ellipsis): For decltype(nullptr) arguments 739 that have side-effects use cp_build_compound_expr. 740 7412020-01-21 Jason Merrill <jason@redhat.com> 742 743 PR c++/91476 - anon-namespace reference temp clash between TUs. 744 * call.c (make_temporary_var_for_ref_to_temp): Clear TREE_PUBLIC 745 if DECL is in the anonymous namespace. 746 7472020-01-17 Jason Merrill <jason@redhat.com> 748 749 PR c++/92531 - ICE with noexcept(lambda). 750 * pt.c (uses_template_parms): Don't try to enumerate all the 751 expression cases. 752 7532020-01-16 Jason Merrill <jason@redhat.com> 754 755 PR c++/93286 - ICE with __is_constructible and variadic template. 756 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion. 757 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2. 758 7592020-01-02 Jakub Jelinek <jakub@redhat.com> 760 761 PR c/90677 762 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name 763 has not been found, rather than error_mark_node. 764 7652019-12-20 Jakub Jelinek <jakub@redhat.com> 766 767 Backported from mainline 768 2019-12-06 Jakub Jelinek <jakub@redhat.com> 769 770 PR c++/92831 - CWG 1299, not extending temporary lifetime for ?: 771 * cp-tree.h (extend_ref_init_temps): Add a new argument with NULL 772 default arg. 773 * call.c (set_up_extended_ref_temp): Add COND_GUARD argument, pass it 774 down to extend_ref_init_temps. Before pushing cleanup, if COND_GUARD 775 is non-NULL, create a bool temporary if needed, initialize to false 776 and guard the cleanup with the temporary being true. 777 (extend_ref_init_temps_1): Add COND_GUARD argument, pass it down 778 to recursive calls and set_up_extended_ref_temp. Handle COND_EXPR. 779 (extend_ref_init_temps): Add COND_GUARD argument, pass it down to 780 recursive calls and to extend_ref_init_temps_1. 781 782 2019-12-03 Jakub Jelinek <jakub@redhat.com> 783 784 PR c++/92732 785 * typeck2.c (digest_nsdmi_init): For bitfields, use 786 DECL_BIT_FIELD_TYPE instead of TREE_TYPE. 787 788 PR c++/92695 789 * constexpr.c (cxx_bind_parameters_in_call): For virtual calls, 790 adjust the first argument to point to the derived object rather 791 than its base. 792 793 2019-12-02 Jakub Jelinek <jakub@redhat.com> 794 795 PR c++/92695 796 * constexpr.c (cxx_eval_constant_expression) <case OBJ_TYPE_REF>: Use 797 STRIP_NOPS before checking for ADDR_EXPR. 798 799 2019-11-29 Jakub Jelinek <jakub@redhat.com> 800 801 PR c++/60228 802 * parser.c (cp_parser_omp_declare_reduction_exprs): If 803 processing_template_decl, wrap the combiner or initializer 804 into EXPR_STMT. 805 * decl.c (start_preparsed_function): Don't start a lambda scope 806 for DECL_OMP_DECLARE_REDUCTION_P functions. 807 (finish_function): Don't finish a lambda scope for 808 DECL_OMP_DECLARE_REDUCTION_P functions, nor cp_fold_function 809 them nor cp_genericize them. 810 * mangle.c (decl_mangling_context): Look through 811 DECL_OMP_DECLARE_REDUCTION_P functions. 812 * semantics.c (expand_or_defer_fn_1): For DECL_OMP_DECLARE_REDUCTION_P 813 functions, use tentative linkage, don't keep their bodies with 814 -fkeep-inline-functions and return false at the end. 815 816 2019-11-28 Jakub Jelinek <jakub@redhat.com> 817 818 PR c++/92695 819 * decl2.c (mark_used): Don't call note_vague_linkage_fn for pure 820 virtual functions, even if they are declared inline. 821 822 2019-11-27 Jakub Jelinek <jakub@redhat.com> 823 824 PR c++/92524 825 * tree.c (replace_placeholders_r): Don't walk constructor elts with 826 RANGE_EXPR indexes. 827 828 2019-11-26 Jakub Jelinek <jakub@redhat.com> 829 830 PR c++/92648 831 * parser.c (cp_parser_std_attribute): For unknown attributes, 832 skip balanced token seq instead of trying to parse 833 attribute-argument-clause as expression list. 834 835 PR c++/61414 836 * class.c (enum_to_min_precision): New hash_map. 837 (enum_min_precision): New function. 838 (check_bitfield_decl): Use it. 839 840 2019-11-22 Jakub Jelinek <jakub@redhat.com> 841 842 PR c/90677 843 * cp-objcp-common.c (identifier_global_tag): Define. 844 845 2019-11-21 Jakub Jelinek <jakub@redhat.com> 846 Jason Merrill <jason@redhat.com> 847 848 PR c++/90842 849 * parser.c (cp_parser_decl_specifier_seq): For concept or typedef 850 break early if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR. 851 For type specifiers, set CP_PARSER_FLAGS_NO_TYPE_DEFINITIONS 852 if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR is set. 853 8542019-12-11 Jason Merrill <jason@redhat.com> 855 856 PR c++/57082 - new X{} and private destructor. 857 * init.c (build_new_1): Also pass tf_no_cleanup to 858 build_special_member_call. 859 8602019-12-11 Jason Merrill <jason@redhat.com> 861 862 PR c++/92859 - ADL and bit-field. 863 * name-lookup.c: Use unlowered_expr_type. 864 8652019-12-11 Jason Merrill <jason@redhat.com> 866 867 PR c++/92446 - deduction of class NTTP. 868 * pt.c (deducible_expression): Look through VIEW_CONVERT_EXPR. 869 8702019-11-06 Jason Merrill <jason@redhat.com> 871 872 PR c++/92150 - partial specialization with class NTTP. 873 * pt.c (unify): Handle VIEW_CONVERT_EXPR. 874 8752019-11-20 Jakub Jelinek <jakub@redhat.com> 876 877 PR c++/90767 878 * call.c (complain_about_no_candidates_for_method_call): If 879 conv->from is not a type, pass to complain_about_bad_argument 880 lvalue_type of conv->from. 881 882 Backported from mainline 883 2019-11-19 Jakub Jelinek <jakub@redhat.com> 884 885 PR c++/92504 886 * semantics.c (handle_omp_for_class_iterator): Don't call 887 cp_fully_fold on cond. 888 8892019-11-08 Marek Polacek <polacek@redhat.com> 890 891 Backported from mainline 892 2019-10-29 Marek Polacek <polacek@redhat.com> 893 894 PR c++/90998 - ICE with copy elision in init by ctor and -Wconversion. 895 * call.c (joust): Don't attempt to warn if ->second_conv is null. 896 8972019-11-08 Jakub Jelinek <jakub@redhat.com> 898 899 Backported from mainline 900 2019-11-05 Jakub Jelinek <jakub@redhat.com> 901 902 PR c++/92343 903 * constexpr.c (potential_constant_expression_1): Return true rather 904 than false for PREDICT_EXPR. 905 906 2019-10-31 Jakub Jelinek <jakub@redhat.com> 907 908 PR c++/90947 909 * cp-tree.h (type_initializer_zero_p): Declare. 910 * decl.c (reshape_init_array_1): Formatting fix. 911 * tree.c (type_initializer_zero_p): New function. Moved from 912 ../tree.c, use next_initializable_field, formatting fix. Return 913 false for TYPE_NON_AGGREGATE_CLASS types. 914 915 2019-10-22 Jakub Jelinek <jakub@redhat.com> 916 917 PR tree-optimization/85887 918 * decl.c (expand_static_init): Drop ECF_LEAF from __cxa_guard_acquire 919 and __cxa_guard_release. 920 921 2019-10-21 Jakub Jelinek <jakub@redhat.com> 922 923 PR c++/92015 924 * constexpr.c (cxx_eval_component_reference, cxx_eval_bit_field_ref): 925 Use STRIP_ANY_LOCATION_WRAPPER on CONSTRUCTOR elts. 926 9272019-10-29 Jakub Jelinek <jakub@redhat.com> 928 929 PR c++/92201 930 * cp-gimplify.c (cp_gimplify_expr): If gimplify_to_rvalue changes the 931 function pointer type, re-add cast to the original one. 932 9332018-10-26 Ville Voutilainen <ville.voutilainen@gmail.com> 934 935 Backport from mainline 936 937 2019-06-01 Ville Voutilainen <ville.voutilainen@gmail.com> 938 939 PR c++/85254 940 * class.c (fixup_type_variants): Handle CLASSTYPE_FINAL. 941 9422019-10-24 Marek Polacek <polacek@redhat.com> 943 944 * decl.c (reshape_init_r): Add missing space. 945 9462019-10-22 Marek Polacek <polacek@redhat.com> 947 948 Backported from mainline 949 2019-10-21 Marek Polacek <polacek@redhat.com> 950 951 PR c++/92106 - ICE with structured bindings and -Wreturn-local-addr. 952 * typeck.c (maybe_warn_about_returning_address_of_local): Avoid 953 recursing on null initializer and return false instead. 954 955 PR c++/92062 - ODR-use ignored for static member of class template. 956 * pt.c (has_value_dependent_address): Strip location wrappers. 957 9582019-10-21 Jakub Jelinek <jakub@redhat.com> 959 960 Backported from mainline 961 2019-10-04 Jakub Jelinek <jakub@redhat.com> 962 963 PR c++/91974 964 * cp-gimplify.c (cp_gimplify_expr) <case CALL_EXPR>: For 965 -fstrong-eval-order ensure CALL_EXPR_FN side-effects are evaluated 966 before any arguments. Additionally, ensure CALL_EXPR_FN that isn't 967 invariant nor OBJ_TYPE_REF nor SSA_NAME is forced into a temporary. 968 969 2019-09-27 Jakub Jelinek <jakub@redhat.com> 970 971 PR c++/88203 972 * parser.c (cp_parser_omp_var_list_no_open): Parse predefined 973 variables. 974 * semantics.c (finish_omp_clauses): Allow predefined variables in 975 shared and firstprivate clauses, even when they are predetermined 976 shared. 977 * cp-gimplify.c (cxx_omp_predetermined_sharing_1): Return 978 OMP_CLAUSE_DEFAULT_SHARED for predefined variables. 979 980 2019-08-09 Jakub Jelinek <jakub@redhat.com> 981 982 PR c/91401 983 * parser.c (cp_parser_omp_clause_dist_schedule): Comment out the 984 check_no_duplicate_clause call, instead emit a warning for duplicate 985 dist_schedule clauses. 986 9872019-10-16 Richard Biener <rguenther@suse.de> 988 989 Backport from mainline 990 2019-10-02 Richard Biener <rguenther@suse.de> 991 992 PR c++/91606 993 * decl.c (build_ptrmemfunc_type): Mark pointer-to-member 994 fat pointer structure members as DECL_NONADDRESSABLE_P. 995 9962019-10-08 Marek Polacek <polacek@redhat.com> 997 998 Backported from mainline 999 2019-09-15 Marek Polacek <polacek@redhat.com> 1000 1001 PR c++/91740 - ICE with constexpr call and ?: in ARRAY_REF. 1002 * pt.c (build_non_dependent_expr): Call build_non_dependent_expr for 1003 the first operand. 1004 10052019-09-28 Marek Polacek <polacek@redhat.com> 1006 1007 Backported from mainline 1008 2019-09-28 Marek Polacek <polacek@redhat.com> 1009 1010 PR c++/91923 - failure-to-SFINAE with class type NTTP in C++17. 1011 * pt.c (invalid_nontype_parm_type_p): Only emit errors when 1012 tf_error. 1013 10142019-09-10 Marek Polacek <polacek@redhat.com> 1015 1016 Backported from mainline 1017 2019-09-10 Marek Polacek <polacek@redhat.com> 1018 1019 PR c++/91705 - constexpr evaluation rejects ++/-- on floats. 1020 * constexpr.c (cxx_eval_increment_expression): Call fold_simple on 1021 the offset. 1022 10232019-09-01 Marek Polacek <polacek@redhat.com> 1024 1025 Backported from mainline 1026 2019-09-01 Marek Polacek <polacek@redhat.com> 1027 1028 PR c++/91129 - wrong error with binary op in template argument. 1029 * typeck.c (warn_for_null_address): Use fold_for_warn instead of 1030 fold_non_dependent_expr. 1031 (cp_build_binary_op): Likewise. 1032 10332019-08-31 Iain Sandoe <iain@sandoe.co.uk> 1034 1035 Backported from mainline 1036 2019-08-23 Iain Sandoe <iain@sandoe.co.uk> 1037 1038 PR pch/61250 1039 * parser.c (cp_parser_initial_pragma): Call c_common_no_more_pch () 1040 after determining that the first token is not 1041 PRAGMA_GCC_PCH_PREPROCESS. 1042 10432019-08-23 Marek Polacek <polacek@redhat.com> 1044 1045 Backported from mainline 1046 2019-08-23 Marek Polacek <polacek@redhat.com> 1047 1048 PR c++/91521 - wrong error with operator->. 1049 * decl.c (grokdeclarator): Return error_mark_node for an invalid 1050 trailing return type. 1051 10522019-08-16 Jason Merrill <jason@redhat.com> 1053 1054 PR c++/90393 - ICE with throw in ?: 1055 * call.c (build_conditional_expr_1): Revert changes from 1056 PR c++/64372 and c++/86205. 1057 10582019-08-15 Marek Polacek <polacek@redhat.com> 1059 1060 Backported from mainline 1061 2019-08-07 Marek Polacek <polacek@redhat.com> 1062 1063 PR c++/81429 - wrong parsing of constructor with C++11 attribute. 1064 * parser.c (cp_parser_constructor_declarator_p): Handle the scenario 1065 when a parameter declaration begins with [[attribute]]. 1066 1067 2019-08-08 Marek Polacek <polacek@redhat.com> 1068 1069 PR c++/87519 - bogus warning with -Wsign-conversion. 1070 * typeck.c (cp_build_binary_op): Use same_type_p instead of comparing 1071 the types directly. 1072 1073 2019-08-13 Marek Polacek <polacek@redhat.com> 1074 1075 PR c++/90473 - wrong code with nullptr in default argument. 1076 * call.c (null_ptr_cst_p): Update quote from the standard. 1077 * decl.c (check_default_argument): Don't return nullptr when the arg 1078 has side-effects. 1079 1080 2019-06-14 Marek Polacek <polacek@redhat.com> 1081 1082 PR c++/90884 - stray note with -Wctor-dtor-privacy. 1083 * class.c (maybe_warn_about_overly_private_class): Guard the call to 1084 inform. 1085 10862019-08-14 Martin Sebor <msebor@redhat.com> 1087 1088 Backported from mainline 1089 2019-08-01 Martin Sebor <msebor@redhat.com> 1090 1091 PR c++/90947 1092 * decl.c (reshape_init_array_1): Avoid truncating initializer 1093 lists containing string literals. 1094 10952019-08-14 Jonathan Wakely <jwakely@redhat.com> 1096 1097 PR c++/91436 1098 * name-lookup.c (get_std_name_hint): Fix min_dialect field for 1099 complex_literals and make_unique entries. 1100 11012019-08-12 Tom Honermann <tom@honermann.net> 1102 1103 * parser.c (cp_parser_template_declaration_after_parameters): Enable 1104 class template argument deduction for non-type template parameters 1105 in literal operator templates. 1106 11072019-08-12 Jason Merrill <jason@redhat.com> 1108 1109 PR c++/91378 - ICE with noexcept and auto return type. 1110 * pt.c (maybe_instantiate_noexcept): push_to_top_level. 1111 1112 PR c++/90538 - multiple expansions of capture packs 1113 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): Remove. 1114 * lambda.c (add_capture): Copy parameter packs from init. 1115 (lambda_capture_field_type): Always use auto for init-capture. 1116 * pt.c (uses_parameter_packs): Return tree. 1117 (tsubst) [DECLTYPE_TYPE]: Remove init-capture handling. 1118 (gen_elem_of_pack_expansion_instantiation): Don't push 1119 local_specialization_stack. 1120 (prepend_one_capture): New. 1121 (tsubst_lambda_expr): Use it. Don't touch local_specializations. 1122 (do_auto_deduction): Avoid redundant error. 1123 11242019-08-12 Release Manager 1125 1126 * GCC 9.2.0 released. 1127 11282019-08-02 Martin Sebor <msebor@redhat.com> 1129 1130 Backport from mainline 1131 2019-06-05 Martin Sebor <msebor@redhat.com> 1132 1133 PR c/90737 1134 * typeck.c (maybe_warn_about_returning_address_of_local): Only 1135 consider functions returning pointers as candidates for 1136 -Wreturn-local-addr. 1137 11382019-08-02 Marek Polacek <polacek@redhat.com> 1139 1140 Backported from mainline 1141 2019-08-02 Marek Polacek <polacek@redhat.com> 1142 1143 PR c++/91230 - wrong error with __PRETTY_FUNCTION__ and generic lambda. 1144 * pt.c (value_dependent_expression_p): Consider __PRETTY_FUNCTION__ 1145 inside a template function value-dependent. 1146 11472019-07-19 Jason Merrill <jason@redhat.com> 1148 1149 PR c++/90098 - partial specialization and class non-type parms. 1150 PR c++/90099 1151 PR c++/90101 1152 * call.c (build_converted_constant_expr_internal): Don't copy. 1153 * pt.c (process_partial_specialization): Allow VIEW_CONVERT_EXPR 1154 around class non-type parameter. 1155 (unify) [TEMPLATE_PARM_INDEX]: Ignore cv-quals. 1156 (invalid_nontype_parm_type_p): Check for dependent class type. 1157 1158 PR c++/85552 - wrong instantiation of dtor for DMI. 1159 * typeck2.c (digest_nsdmi_init): Set tf_no_cleanup for direct-init. 1160 11612019-07-19 Nina Dinka Ranns <dinka.ranns@gmail.com> 1162 1163 PR c++/63149 - Wrong auto deduction from braced-init-list. 1164 * pt.c (listify_autos): use non cv qualified auto_node in 1165 std::initializer_list<auto>. 1166 11672019-07-01 Marek Polacek <polacek@redhat.com> 1168 1169 Backported from mainline 1170 2019-06-21 Marek Polacek <polacek@redhat.com> 1171 1172 PR c++/60223 - ICE with T{} in non-deduced context. 1173 * pt.c (unify): Allow COMPOUND_LITERAL_P in a non-deduced context. 1174 1175 PR c++/90490 - fix decltype issues in noexcept-specifier. 1176 * except.c (build_noexcept_spec): Call 1177 instantiate_non_dependent_expr_sfinae before 1178 build_converted_constant_expr instead of calling 1179 instantiate_non_dependent_expr after it. Add 1180 processing_template_decl_sentinel. 1181 11822019-06-29 Jakub Jelinek <jakub@redhat.com> 1183 1184 Backported from mainline 1185 2019-06-21 Jakub Jelinek <jakub@redhat.com> 1186 1187 PR c++/90950 1188 * semantics.c (finish_omp_clauses): Don't reject references to 1189 incomplete types if processing_template_decl. 1190 11912019-06-12 Marek Polacek <polacek@redhat.com> 1192 1193 PR c++/90825 - endless recursion when evaluating sizeof. 1194 PR c++/90832 - endless recursion when evaluating sizeof. 1195 * constexpr.c (cxx_eval_constant_expression): Don't recurse on the 1196 result of fold_sizeof_expr if is returns a SIZEOF_EXPR. 1197 * typeck.c (cxx_sizeof_expr): Only return a SIZEOF_EXPR if the operand 1198 is instantiation-dependent. 1199 1200 PR c++/90736 - bogus error with alignof. 1201 * constexpr.c (adjust_temp_type): Use cv_unqualified type. 1202 12032019-06-11 Jakub Jelinek <jakub@redhat.com> 1204 1205 PR c++/90810 1206 * init.c (constant_value_1): Handle VECTOR_CST DECL_INITIAL for 1207 !DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P decls like CONSTRUCTOR. 1208 12092019-06-05 Jakub Jelinek <jakub@redhat.com> 1210 1211 Backported from mainline 1212 2019-05-29 Jakub Jelinek <jakub@redhat.com> 1213 1214 PR c++/90598 1215 * tree.c (lvalue_kind): Return clk_none for expressions with 1216 with VOID_TYPE_P. 1217 12182019-05-28 Marek Polacek <polacek@redhat.com> 1219 1220 Backported from mainline 1221 2019-05-28 Marek Polacek <polacek@redhat.com> 1222 1223 PR c++/90548 - ICE with generic lambda and empty pack. 1224 * pt.c (tsubst_copy_and_build): Handle pack expansion properly. 1225 12262019-05-25 Marek Polacek <polacek@redhat.com> 1227 1228 Backported from mainline 1229 2019-05-25 Marek Polacek <polacek@redhat.com> 1230 1231 PR c++/90572 - wrong disambiguation in friend declaration. 1232 * parser.c (cp_parser_constructor_declarator_p): Don't allow missing 1233 typename for friend declarations. 1234 12352019-05-20 Jonathan Wakely <jwakely@redhat.com> 1236 1237 Backported from mainline 1238 2019-05-20 Jonathan Wakely <jwakely@redhat.com> 1239 1240 PR c++/90532 Ensure __is_constructible(T[]) is false 1241 * method.c (is_xible_helper): Return error_mark_node for construction 1242 of an array of unknown bound. 1243 12442019-05-17 Jakub Jelinek <jakub@redhat.com> 1245 1246 Backported from mainline 1247 2019-05-15 Jakub Jelinek <jakub@redhat.com> 1248 1249 PR debug/90197 1250 * cp-gimplify.c (genericize_cp_loop): Emit a DEBUG_BEGIN_STMT 1251 before the condition (or if missing or constant non-zero at the end 1252 of the loop. Emit a DEBUG_BEGIN_STMT before the increment expression 1253 if any. Don't call protected_set_expr_location on incr if it already 1254 has a location. 1255 1256 2019-05-10 Jakub Jelinek <jakub@redhat.com> 1257 1258 PR pch/90326 1259 * config-lang.in (gtfiles): Remove c-family/c-lex.c, add 1260 c-family/c-cppbuiltin.c. 1261 12622019-05-10 Marek Polacek <polacek@redhat.com> 1263 1264 PR c++/78010 - bogus -Wsuggest-override warning on final function. 1265 * class.c (check_for_override): Don't warn for final functions. 1266 12672019-05-06 Marek Polacek <polacek@redhat.com> 1268 1269 PR c++/90265 - ICE with generic lambda. 1270 * pt.c (tsubst_copy_and_build): Use a dedicated variable for the last 1271 element in the vector. 1272 12732019-05-06 Paolo Carlini <paolo.carlini@oracle.com> 1274 1275 PR c++/90173 1276 * decl.c (grokdeclarator): Set type to error_mark_node 1277 upon error about template placeholder type non followed 1278 by a simple declarator-id. 1279 12802019-05-04 Michael Meissner <meissner@linux.ibm.com> 1281 1282 * ChangeLog.ibm: Delete unintentional commit on the wrong branch. 1283 12842019-05-03 Release Manager 1285 1286 * GCC 9.1.0 released. 1287 12882019-04-24 Jason Merrill <jason@redhat.com> 1289 1290 PR c++/90227 - error with template parameter packs. 1291 * pt.c (coerce_template_parms): Do add empty pack when 1292 require_all_args. 1293 12942019-04-24 Richard Biener <rguenther@suse.de> 1295 1296 * call.c (null_ptr_cst_p): Order checks according to expensiveness. 1297 (conversion_null_warnings): Likewise. 1298 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Return 1299 early if type1 == type2. 1300 13012019-04-22 Jason Merrill <jason@redhat.com> 1302 1303 PR c++/87366 - wrong error with alias template. 1304 * typeck.c (structural_comptypes): When comparing_specializations, 1305 aliases are unequal. 1306 (comptypes): When comparing_specializations, do structural 1307 comparison. 1308 13092019-04-19 Jason Merrill <jason@redhat.com> 1310 1311 PR c++/90190 - CTAD with list-constructor. 1312 * pt.c (do_class_deduction): Don't try the single element deduction 1313 if the single element is also a braced list. 1314 1315 PR c++/90171 - ICE with destroying delete with size_t parm. 1316 * call.c (sized_deallocation_fn_p): New. Use it instead of 1317 second_parm_is_size_t in most cases. 1318 (second_parm_is_size_t): Don't check for aligned. 1319 13202019-04-19 Paolo Carlini <paolo.carlini@oracle.com> 1321 1322 PR c++/89900 1323 * pt.c (fn_type_unification): When handling null explicit 1324 arguments do not special case non-parameter packs. 1325 13262019-04-19 Jakub Jelinek <jakub@redhat.com> 1327 1328 PR c++/90138 1329 * pt.c (process_template_parm): Set decl to pushdecl result. If 1330 !is_non_type, also set parm to that. 1331 1332 PR c/89888 1333 * decl.c (struct cp_switch): Remove outside_range_p member. 1334 (push_switch): Don't clear it. 1335 (pop_switch): Adjust c_do_switch_warnings caller. 1336 (finish_case_label): Adjust c_add_case_label caller. 1337 1338 PR c++/90108 1339 * decl.c (duplicate_decls): If remove is main variant and 1340 DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE 1341 variant that has newdecl as TYPE_NAME if any. 1342 13432019-04-18 Jason Merrill <jason@redhat.com> 1344 1345 PR c++/87554 - ICE with extern template and reference member. 1346 * decl.c (cp_finish_decl): Don't set DECL_INITIAL of external vars. 1347 13482019-04-17 Jason Merrill <jason@redhat.com> 1349 1350 PR c++/90047 - ICE with enable_if alias template. 1351 * pt.c (tsubst_decl) [TYPE_DECL]: Don't put an erroneous decl in the 1352 hash table when we're in SFINAE context. 1353 13542019-04-17 Marek Polacek <polacek@redhat.com> 1355 1356 PR c++/90124 - bogus error with incomplete type in decltype. 1357 * typeck.c (build_class_member_access_expr): Check 1358 cp_unevaluated_operand. 1359 13602019-04-12 Jakub Jelinek <jakub@redhat.com> 1361 1362 PR c/89933 1363 * decl.c (duplicate_decls): When newdecl's type is its main variant, 1364 don't try to remove it from the variant list, but instead assert 1365 it has no variants. 1366 13672019-04-12 Martin Sebor <msebor@redhat.com> 1368 1369 PR c/88383 1370 PR c/89288 1371 * parser.c (cp_parser_has_attribute_expression): Handle assignment 1372 expressions. 1373 13742019-04-12 Jason Merrill <jason@redhat.com> 1375 1376 * call.c (null_member_pointer_value_p): Handle an empty CONSTRUCTOR 1377 of PMF type. 1378 13792019-04-12 Marek Polacek <polacek@redhat.com> 1380 1381 * except.c (build_noexcept_spec): Use build_converted_constant_bool_expr 1382 instead of perform_implicit_conversion_flags. 1383 1384 PR c++/87603 - constexpr functions are no longer noexcept. 1385 * constexpr.c (is_sub_constant_expr): Remove unused function. 1386 * cp-tree.h (is_sub_constant_expr): Remove declaration. 1387 * except.c (check_noexcept_r): Don't consider a call to a constexpr 1388 function noexcept. 1389 13902019-04-11 Jakub Jelinek <jakub@redhat.com> 1391 1392 PR translation/90035 1393 * parser.h (struct cp_parser): Add 1394 type_definition_forbidden_message_arg member. 1395 * parser.c (cp_debug_parser): Print it. 1396 (cp_parser_check_type_definition): Pass 1397 parser->type_definition_forbidden_message_arg as second argument to 1398 error. 1399 (cp_parser_has_attribute_expression, cp_parser_sizeof_operand): Set 1400 parser->type_definition_forbidden_message_arg and use G_() with 1401 %qs for parser->type_definition_forbidden_message instead of 1402 building untranslatable message using concat. 1403 14042019-04-09 Jakub Jelinek <jakub@redhat.com> 1405 1406 PR translation/90011 1407 * typeck2.c (check_narrowing): Remove trailing space from diagnostics. 1408 14092019-04-08 Marek Polacek <polacek@redhat.com> 1410 1411 * typeck2.c (digest_init_r): Don't condition the object slicing warning 1412 on flag_checking. 1413 14142019-04-08 Paolo Carlini <paolo.carlini@oracle.com> 1415 1416 PR c++/89914 1417 * semantics.c (trait_expr_value): Don't use TYPE_NOTHROW_P 1418 when maybe_instantiate_noexcept fails. 1419 (classtype_has_nothrow_assign_or_copy_p): Likewise. 1420 * method.c (implicitly_declare_fn): Avoid passing error_mark_node 1421 to build_exception_variant. 1422 14232019-04-05 Marek Polacek <polacek@redhat.com> 1424 1425 PR c++/87145 - bogus error converting class type in template arg list. 1426 * pt.c (convert_nontype_argument): Don't call 1427 build_converted_constant_expr if it could involve calling a conversion 1428 function with a instantiation-dependent constructor as its argument. 1429 14302019-04-05 Martin Sebor <msebor@redhat.com> 1431 1432 PR bootstrap/89980 1433 * decl.c (reshape_init_array_1): Avoid treating empty strings 1434 as zeros in array initializers. 1435 Use trivial_type_p () instead of TYPE_HAS_TRIVIAL_DFLT(). 1436 14372019-04-04 Jason Merrill <jason@redhat.com> 1438 1439 PR c++/89948 - ICE with break in statement-expr. 1440 * constexpr.c (cxx_eval_statement_list): Jumping out of a 1441 statement-expr is non-constant. 1442 14432019-04-04 Jason Merrill <jason@redhat.com> 1444 1445 PR c++/89966 - error with non-type auto tparm. 1446 * pt.c (do_auto_deduction): Clear tf_partial. 1447 14482019-04-04 Jason Merrill <jason@redhat.com> 1449 1450 PR c++/86986 - ICE with TTP with parameter pack. 1451 * pt.c (coerce_template_parameter_pack): Only look at the type of a 1452 non-type parameter pack. 1453 (fixed_parameter_pack_p_1): Don't recurse into the type of a 1454 non-type parameter pack. 1455 (coerce_template_template_parms): Call add_outermost_template_args. 1456 14572019-04-04 Martin Sebor <msebor@redhat.com> 1458 1459 PR c++/89974 1460 PR c++/89878 1461 PR c++/89833 1462 PR c++/47488 1463 * decl.c (reshape_init_array_1): Strip trailing zero-initializers 1464 from arrays of trivial type and known size. 1465 * mangle.c (write_expression): Convert braced initializer lists 1466 to STRING_CSTs. 1467 (write_expression): Trim trailing zero-initializers from arrays 1468 of trivial type. 1469 (write_template_arg_literal): Mangle strings the same as braced 1470 initializer lists. 1471 14722019-04-03 Jason Merrill <jason@redhat.com> 1473 1474 PR c++/81866 - ICE with member template and default targ. 1475 * pt.c (tsubst_template_decl): Handle getting a type from 1476 retrieve_specialization. 1477 1478 PR c++/86586 - -fcompare-debug=-Wsign-compare. 1479 * typeck.c (cp_build_binary_op): Don't fold for -Wsign-compare. 1480 1481 PR c++/89331 - ICE with offsetof in incomplete class. 1482 * semantics.c (finish_offsetof): Handle error_mark_node. 1483 * typeck.c (build_class_member_access_expr): Call 1484 complete_type_or_maybe_complain before converting to base. 1485 1486 PR c++/89917 - ICE with lambda in variadic mem-init. 1487 * pt.c (make_pack_expansion): Change type_pack_expansion_p to false. 1488 14892019-04-01 Jason Merrill <jason@redhat.com> 1490 1491 PR c++/86946 - ICE with function call in template argument. 1492 DR 1321 1493 * pt.c (iterative_hash_template_arg) [CALL_EXPR]: Use 1494 dependent_name. 1495 14962019-04-01 Paolo Carlini <paolo.carlini@oracle.com> 1497 1498 PR c++/62207 1499 * pt.c (tsubst_copy): Deal with lookup_name not returing a variable. 1500 15012019-03-31 Marek Polacek <polacek@redhat.com> 1502 1503 PR c++/89852 - ICE with C++11 functional cast with { }. 1504 * constexpr.c (fold_non_dependent_expr_template): New static function 1505 broken out of... 1506 (fold_non_dependent_expr): ...here. 1507 (fold_non_dependent_init): New function. 1508 * cp-tree.h (fold_non_dependent_init): Declare. 1509 * typeck2.c (massage_init_elt): Call fold_non_dependent_init instead 1510 of fold_non_dependent_expr. Don't call maybe_constant_init. 1511 15122019-03-30 Jason Merrill <jason@redhat.com> 1513 1514 PR c++/89744 - ICE with specialization of member class template. 1515 * pt.c (lookup_template_class_1): If the partial instantiation is 1516 explicitly specialized, adjust. 1517 (maybe_process_partial_specialization): Also adjust 1518 CLASSTYPE_TI_ARGS. 1519 15202019-03-29 Jakub Jelinek <jakub@redhat.com> 1521 1522 PR sanitizer/89869 1523 * typeck.c: Include gimplify.h. 1524 (cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it 1525 for second time. Formatting fixes. 1526 15272019-03-29 Marek Polacek <polacek@redhat.com> 1528 1529 PR c++/89876 - ICE with deprecated conversion. 1530 * call.c (convert_like_real): Only give warnings with tf_warning. 1531 15322019-03-28 Marek Polacek <polacek@redhat.com> 1533 1534 PR c++/89612 - ICE with member friend template with noexcept. 1535 * pt.c (maybe_instantiate_noexcept): For function templates, use their 1536 template result (function decl). Don't set up local specializations. 1537 Temporarily turn on processing_template_decl. Update the template type 1538 too. 1539 1540 PR c++/89836 - bool constant expression and explicit conversions. 1541 * call.c (build_converted_constant_expr_internal): New function, 1542 renamed from... 1543 (build_converted_constant_expr): ...this. New. 1544 (build_converted_constant_bool_expr): New. 1545 * cp-tree.h (build_converted_constant_bool_expr): Declare. 1546 * decl.c (build_explicit_specifier): Call 1547 build_converted_constant_bool_expr. 1548 15492019-03-28 Jakub Jelinek <jakub@redhat.com> 1550 1551 PR c++/89785 1552 * constexpr.c (struct check_for_return_continue_data): New type. 1553 (check_for_return_continue): New function. 1554 (potential_constant_expression_1) <case SWITCH_STMT>: Walk 1555 SWITCH_STMT_BODY to find RETURN_EXPRs or CONTINUE_STMTs not nested 1556 in loop bodies and set *jump_target to that if found. 1557 15582019-03-27 Jason Merrill <jason@redhat.com> 1559 1560 PR c++/89831 - error with qualified-id in const member function. 1561 * semantics.c (finish_non_static_data_member): Use object cv-quals 1562 in scoped case, too. 1563 1564 PR c++/89421 - ICE with lambda in template parameter list. 1565 * parser.c (cp_parser_lambda_expression): Also reject a lambda in a 1566 template parameter list before C++20. 1567 * pt.c (type_dependent_expression_p): True for LAMBDA_EXPR. 1568 * semantics.c (begin_class_definition): Restore error about defining 1569 non-lambda class in template parm list. 1570 15712019-03-26 Jason Merrill <jason@redhat.com> 1572 1573 PR c++/86932 - missed SFINAE with empty pack. 1574 * pt.c (coerce_template_parms): Don't add an empty pack if 1575 tf_partial. 1576 (fn_type_unification): Pass tf_partial to coerce_template_parms. 1577 1578 PR c++/86429 - constexpr variable in lambda. 1579 PR c++/82643 1580 PR c++/87327 1581 * constexpr.c (cxx_eval_constant_expression): In a lambda function, 1582 try evaluating the captured variable directly. 1583 15842019-03-26 Jakub Jelinek <jakub@redhat.com> 1585 1586 PR c++/89796 1587 * semantics.c (finish_omp_atomic): Add warning_sentinel for 1588 -Wunused-value around finish_expr_stmt call. 1589 15902019-03-25 Paolo Carlini <paolo.carlini@oracle.com> 1591 1592 PR c++/84661 1593 PR c++/85013 1594 * parser.c (cp_parser_binary_expression): Don't call cp_fully_fold 1595 to undo the disabling of warnings. 1596 15972019-03-25 Jason Merrill <jason@redhat.com> 1598 1599 PR c++/87748 - substitution failure error with decltype. 1600 * pt.c (most_specialized_partial_spec): Clear 1601 processing_template_decl. 1602 16032019-03-25 Marek Polacek <polacek@redhat.com> 1604 1605 PR c++/89214 - ICE when initializing aggregates with bases. 1606 * typeck2.c (digest_init_r): Warn about object slicing instead of 1607 crashing. 1608 1609 PR c++/89705 - ICE with reference binding with conversion function. 1610 * call.c (reference_binding): If the result of the conversion function 1611 is a prvalue of non-class type, use the cv-unqualified type. 1612 16132019-03-25 Nathan Sidwell <nathan@acm.org> 1614 1615 * lambda.c (maybe_add_lambda_conv_op): Don't add to comdat group. 1616 16172019-03-22 Jakub Jelinek <jakub@redhat.com> 1618 1619 PR c++/60702 1620 * cp-tree.h (get_tls_wrapper_fn): Remove declaration. 1621 (maybe_get_tls_wrapper_call): Declare. 1622 * decl2.c (get_tls_wrapper_fn): Make static. 1623 (maybe_get_tls_wrapper_call): New function. 1624 * typeck.c (build_class_member_access_expr): Handle accesses to TLS 1625 variables. 1626 * semantics.c (finish_qualified_id_expr): Likewise. 1627 (finish_id_expression_1): Use maybe_get_tls_wrapper_call. 1628 * pt.c (tsubst_copy_and_build): Likewise. 1629 1630 PR c++/87481 1631 * constexpr.c (struct constexpr_ctx): Add constexpr_ops_count member. 1632 (cxx_eval_constant_expression): When not skipping, not constant class 1633 or location wrapper, increment *ctx->constexpr_ops_count and if it is 1634 above constexpr_loop_nest_limit, diagnose failure. 1635 (cxx_eval_outermost_constant_expr): Add constexpr_ops_count and 1636 initialize ctx.constexpr_ops_count to its address. 1637 (is_sub_constant_expr): Likewise. 1638 16392019-03-21 Jakub Jelinek <jakub@redhat.com> 1640 1641 PR c++/71446 1642 * call.c (filed_in_pset): Change pset from hash_set<tree> * to 1643 hash_set<tree, true> &, adjust uses accordingly. 1644 (build_aggr_conv): Change pset from hash_set<tree> * 1645 to hash_set<tree, true>. Replace goto fail; with return NULL;, 1646 adjust pset uses. 1647 1648 PR c++/89767 1649 * parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id 1650 variables, check for duplicates in this function. 1651 * lambda.c (add_capture): Don't check for duplicates nor use 1652 IDENTIFIER_MARKED. 1653 (register_capture_members): Don't clear IDENTIFIER_MARKED here. 1654 16552019-03-21 Paolo Carlini <paolo.carlini@oracle.com> 1656 1657 PR c++/89571 1658 * method.c (after_nsdmi_defaulted_late_checks): Avoid passing 1659 error_mark_node to comp_except_specs. 1660 16612019-03-20 Jason Merrill <jason@redhat.com> 1662 1663 PR c++/87480 - decltype of member access in default template arg 1664 * pt.c (type_unification_real): Accept a dependent result in 1665 template context. 1666 16672019-03-19 Martin Sebor <msebor@redhat.com> 1668 1669 PR tree-optimization/89688 1670 * typeck2.c (store_init_value): Call braced_lists_to_string for more 1671 kinds of initializers. 1672 16732019-03-18 Jason Merrill <jason@redhat.com> 1674 1675 PR c++/89630 - ICE with dependent using-decl as template arg. 1676 * tree.c (cp_tree_equal): Always return false for USING_DECL. 1677 1678 PR c++/89761 - ICE with sizeof... in pack expansion. 1679 * pt.c (argument_pack_element_is_expansion_p): Handle 1680 ARGUMENT_PACK_SELECT. 1681 1682 PR c++/89640 - GNU attributes on lambda. 1683 * parser.c (cp_parser_lambda_declarator_opt): Allow GNU attributes. 1684 1685 PR c++/89682 - wrong access error in default argument. 1686 * pt.c (tsubst_default_argument): Don't defer access checks. 1687 16882019-03-18 Paolo Carlini <paolo.carlini@oracle.com> 1689 1690 PR c++/85014 1691 * semantics.c (finish_non_static_data_member): Check return value 1692 of context_for_name_lookup and immediately return error_mark_node 1693 if isn't a type. 1694 16952019-03-17 Jason Merrill <jason@redhat.com> 1696 1697 PR c++/89571 - ICE with ill-formed noexcept on constructor. 1698 * pt.c (maybe_instantiate_noexcept): Only return false if defaulted. 1699 (regenerate_decl_from_template): Use it for noexcept-specs. 1700 17012019-03-14 Jason Merrill <jason@redhat.com> 1702 1703 * parser.c (cp_parser_decl_specifier_seq): Support C++20 1704 concept-definition syntax without 'bool'. 1705 17062019-03-14 Jakub Jelinek <jakub@redhat.com> 1707 1708 PR c++/89512 1709 * semantics.c (finish_qualified_id_expr): Reject variable templates. 1710 1711 PR c++/89652 1712 * constexpr.c (struct constexpr_ctx): Change save_exprs type from 1713 hash_set<tree> to vec<tree>. 1714 (cxx_eval_call_expression): Adjust for save_exprs being a vec instead 1715 of hash_set. 1716 (cxx_eval_loop_expr): Likewise. Truncate the vector after each 1717 removal of SAVE_EXPRs from values. 1718 (cxx_eval_constant_expression) <case SAVE_EXPR>: Call safe_push 1719 method on save_exprs instead of add. 1720 17212019-03-13 Jason Merrill <jason@redhat.com> 1722 1723 PR c++/86521 - C++17 copy elision in initialization by constructor. 1724 * call.c (joust_maybe_elide_copy): New. 1725 (joust): Call it. 1726 17272019-03-13 Marek Polacek <polacek@redhat.com> 1728 1729 PR c++/88979 - further P0634 fix for constructors. 1730 * parser.c (cp_parser_decl_specifier_seq): Pass flags to 1731 cp_parser_constructor_declarator_p. 1732 (cp_parser_direct_declarator): Allow missing typename for constructor 1733 parameters. 1734 (cp_parser_constructor_declarator_p): Add FLAGS parameter. Pass it to 1735 cp_parser_type_specifier. 1736 1737 PR c++/89686 - mixing init-capture and simple-capture in lambda. 1738 * parser.c (cp_parser_lambda_introducer): Give error when combining 1739 init-capture and simple-capture. 1740 1741 PR c++/89660 - bogus error with -Wredundant-move. 1742 * typeck.c (maybe_warn_pessimizing_move): Only accept (T &) &arg 1743 as the std::move's argument. Don't call convert_for_initialization 1744 when warn_redundant_move isn't on. 1745 17462019-03-11 Jason Merrill <jason@redhat.com> 1747 1748 PR c++/86521 - wrong overload resolution with ref-qualifiers. 1749 * call.c (build_user_type_conversion_1): Don't use a conversion to a 1750 reference of the wrong rvalueness for direct binding. 1751 17522019-03-11 Martin Liska <mliska@suse.cz> 1753 1754 * cvt.c (build_expr_type_conversion): Wrap apostrophes 1755 in gcc internal format with %'. 1756 * decl.c (check_no_redeclaration_friend_default_args): Likewise. 1757 (grokfndecl): Likewise. 1758 * name-lookup.c (do_pushtag): Likewise. 1759 * pt.c (unify_parameter_deduction_failure): Likewise. 1760 (unify_template_deduction_failure): Likewise. 1761 17622019-03-11 Martin Liska <mliska@suse.cz> 1763 1764 * call.c (convert_arg_to_ellipsis): Wrap an option name 1765 in a string format message and fix GNU coding style. 1766 (build_over_call): Likewise. 1767 * class.c (check_field_decl): Likewise. 1768 (layout_nonempty_base_or_field): Likewise. 1769 * constexpr.c (cxx_eval_loop_expr): Likewise. 1770 * cvt.c (type_promotes_to): Likewise. 1771 * decl.c (cxx_init_decl_processing): Likewise. 1772 (mark_inline_variable): Likewise. 1773 (grokdeclarator): Likewise. 1774 * decl2.c (record_mangling): Likewise. 1775 * error.c (maybe_warn_cpp0x): Likewise. 1776 * except.c (doing_eh): Likewise. 1777 * mangle.c (maybe_check_abi_tags): Likewise. 1778 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise. 1779 (cp_parser_userdef_numeric_literal): Likewise. 1780 (cp_parser_primary_expression): Likewise. 1781 (cp_parser_unqualified_id): Likewise. 1782 (cp_parser_pseudo_destructor_name): Likewise. 1783 (cp_parser_builtin_offsetof): Likewise. 1784 (cp_parser_lambda_expression): Likewise. 1785 (cp_parser_lambda_introducer): Likewise. 1786 (cp_parser_lambda_declarator_opt): Likewise. 1787 (cp_parser_selection_statement): Likewise. 1788 (cp_parser_init_statement): Likewise. 1789 (cp_parser_decomposition_declaration): Likewise. 1790 (cp_parser_function_specifier_opt): Likewise. 1791 (cp_parser_static_assert): Likewise. 1792 (cp_parser_simple_type_specifier): Likewise. 1793 (cp_parser_namespace_definition): Likewise. 1794 (cp_parser_using_declaration): Likewise. 1795 (cp_parser_ctor_initializer_opt_and_function_body): Likewise. 1796 (cp_parser_initializer_list): Likewise. 1797 (cp_parser_type_parameter_key): Likewise. 1798 (cp_parser_member_declaration): Likewise. 1799 (cp_parser_try_block): Likewise. 1800 (cp_parser_std_attribute_spec): Likewise. 1801 (cp_parser_requires_clause_opt): Likewise. 1802 * pt.c (check_template_variable): Likewise. 1803 (check_default_tmpl_args): Likewise. 1804 (push_tinst_level_loc): Likewise. 1805 (instantiate_pending_templates): Likewise. 1806 (invalid_nontype_parm_type_p): Likewise. 1807 * repo.c (get_base_filename): Likewise. 1808 * rtti.c (typeid_ok_p): Likewise. 1809 (build_dynamic_cast_1): Likewise. 1810 * tree.c (maybe_warn_parm_abi): Likewise. 1811 18122019-03-08 Jakub Jelinek <jakub@redhat.com> 1813 1814 PR other/80058 1815 * parser.c (cp_parser_template_declaration_after_parameters): Avoid 1816 one space before " at the end of line and another after " on another 1817 line in a string literal. 1818 1819 PR tree-optimization/89550 1820 * semantics.c (maybe_convert_cond): Only set TREE_NO_WARNING if 1821 warning_at returned true. 1822 * decl2.c (c_parse_final_cleanups): Likewise. 1823 * typeck.c (convert_for_assignment): Likewise. 1824 * decl.c (finish_function): Likewise. 1825 1826 PR c++/89585 1827 * parser.c (cp_parser_asm_definition): Just warn instead of error 1828 on volatile qualifier outside of function body. 1829 1830 PR c++/89599 1831 * constexpr.c (potential_constant_expression_1): Reject 1832 REINTERPRET_CAST_P NOP_EXPRs. 1833 1834 PR c++/89622 1835 * call.c (joust): Call print_z_candidate only if pedwarn returned 1836 true. 1837 18382019-03-07 Jason Merrill <jason@redhat.com> 1839 1840 PR c++/88123 - lambda and using-directive. 1841 * name-lookup.c (op_unqualified_lookup) 1842 (maybe_save_operator_binding, discard_operator_bindings) 1843 (push_operator_bindings): New. 1844 * typeck.c (build_x_binary_op, build_x_unary_op): Call 1845 maybe_save_operator_binding. 1846 * decl.c (start_preparsed_function): Call push_operator_bindings. 1847 * tree.c (cp_free_lang_data): Call discard_operator_bindings. 1848 1849 PR c++/88820 - ICE with CTAD and member template used in DMI. 1850 * pt.c (do_class_deduction): Handle parm used as its own arg. 1851 18522019-03-07 Jakub Jelinek <jakub@redhat.com> 1853 1854 PR c++/89585 1855 * parser.c (cp_parser_asm_definition): Parse asm qualifiers even 1856 at toplevel, but diagnose them. 1857 18582019-03-06 Jason Merrill <jason@redhat.com> 1859 1860 PR c++/89381 - implicit copy and using-declaration. 1861 * class.c (classtype_has_move_assign_or_move_ctor_p): Don't consider 1862 op= brought in by a using-declaration. 1863 18642019-03-06 Jakub Jelinek <jakub@redhat.com> 1865 1866 PR c++/87148 1867 * init.c (build_value_init_noctor): Ignore flexible array members. 1868 18692019-03-06 Jason Merrill <jason@redhat.com> 1870 1871 PR c++/89576 - if constexpr of lambda capture. 1872 * semantics.c (maybe_convert_cond): Do convert a non-dependent 1873 condition in a template. 1874 * typeck.c (condition_conversion): Handle being called in a 1875 template. 1876 18772019-03-06 Marek Polacek <polacek@redhat.com> 1878 1879 PR c++/87378 - bogus -Wredundant-move warning. 1880 * typeck.c (maybe_warn_pessimizing_move): See if the maybe-rvalue 1881 overload resolution would actually succeed. 1882 18832019-03-05 Jason Merrill <jason@redhat.com> 1884 1885 * class.c (is_really_empty_class): Add ignore_vptr parm. 1886 (trivial_default_constructor_is_constexpr): Pass it. 1887 * call.c (build_over_call): Pass it. 1888 * constexpr.c (cxx_eval_constant_expression): Pass it instead of 1889 checking TYPE_POLYMORPHIC_P. 1890 (cxx_eval_component_reference, potential_constant_expression_1): 1891 Pass it. 1892 * cp-gimplify.c (simple_empty_class_p): Pass it. 1893 * init.c (expand_aggr_init_1): Pass it. 1894 18952019-03-04 Paolo Carlini <paolo.carlini@oracle.com> 1896 1897 PR c++/84605 1898 * parser.c (cp_parser_class_head): Reject TYPE_BEING_DEFINED too. 1899 19002019-03-04 Jakub Jelinek <jakub@redhat.com> 1901 1902 PR c++/71446 1903 * call.c (field_in_pset): New function. 1904 (build_aggr_conv): Handle CONSTRUCTOR_IS_DESIGNATED_INIT correctly. 1905 19062019-03-02 Jakub Jelinek <jakub@redhat.com> 1907 1908 PR c++/71446 1909 * cp-tree.h (CONSTRUCTOR_IS_DESIGNATED_INIT): Define. 1910 * parser.c (cp_parser_braced_list): Adjust cp_parser_initializer_list 1911 caller, set CONSTRUCTOR_IS_DESIGNATED_INIT. 1912 (cp_parser_initializer_list): Add designated parameter, set *designated 1913 to a bool whether any designators were parsed. 1914 * decl.c (reshape_init): Copy over CONSTRUCTOR_IS_DESIGNATED_INIT if 1915 needed. 1916 * pt.c (tsubst_copy_and_build): Likewise. 1917 * call.c (implicit_conversion): If CONSTRUCTOR_IS_DESIGNATED_INIT, 1918 don't call build_list_conv, nor build_complex_conv, nor attempt to 1919 convert a single element initializer to scalar. 1920 19212019-03-01 Marek Polacek <polacek@redhat.com> 1922 1923 PR c++/89537 - missing location for error with non-static member fn. 1924 * call.c (resolve_args): Use EXPR_LOCATION. 1925 * typeck.c (build_class_member_access_expr): Use input_location. 1926 1927 PR c++/89532 - ICE with incomplete type in decltype. 1928 * semantics.c (finish_compound_literal): Return error_mark_node 1929 if digest_init_flags returns error_mark_node. 1930 19312019-03-01 Jakub Jelinek <jakub@redhat.com> 1932 1933 Implement P1002R1, Try-catch blocks in constexpr functions 1934 PR c++/89513 1935 * parser.c (cp_parser_ctor_initializer_opt_and_function_body): 1936 Diagnose constexpr ctor or function with function-try-block with 1937 pedwarn for c++17 and earlier. Formatting fix. 1938 (cp_parser_try_block): Use pedwarn instead of error and only for 1939 c++17 and earlier when try block appears in constexpr function. 1940 * constexpr.c (build_constexpr_constructor_member_initializers): 1941 Handle TRY_BLOCK here instead of erroring on it. 1942 19432019-02-28 Jason Merrill <jason@redhat.com> 1944 1945 PR c++/88183 - ICE with .* fold-expression. 1946 * pt.c (fold_expression) [DOTSTAR_EXPR]: Remove special handling. 1947 1948 PR c++/86969 - ICE with constexpr if and recursive generic lambdas. 1949 * class.c, lambda.c, pt.c: Revert earlier change. 1950 * lambda.c (add_capture): Don't special-case capture of dependent 1951 VLA. 1952 1953 * name-lookup.c (print_binding_level): Print this_entity. 1954 19552019-02-27 Marek Polacek <polacek@redhat.com> 1956 1957 PR c++/88857 - ICE with value-initialization of argument in template. 1958 * call.c (convert_like_real): Don't call build_value_init in template. 1959 19602019-02-27 Jason Merrill <jason@redhat.com> 1961 1962 PR c++/86969 - ICE with constexpr if and recursive generic lambdas. 1963 * semantics.c (process_outer_var_ref): Do capture dependent vars. 1964 * class.c (finish_struct): Only add TAG_DEFN if T is in 1965 current_function_decl. 1966 * lambda.c (vla_capture_type): Force the capture type out into the 1967 lambda's enclosing function. 1968 (add_capture): Pass in the lambda. 1969 * pt.c (tsubst_lambda_expr): complete_type a VLA capture type. 1970 19712019-02-27 Marek Polacek <polacek@redhat.com> 1972 1973 PR c++/89511 - ICE with using-declaration and unscoped enumerator. 1974 * parser.c (cp_parser_using_declaration): For an unscoped enum 1975 only use its context if it's not a function declaration. 1976 19772019-02-27 Paolo Carlini <paolo.carlini@oracle.com> 1978 1979 PR c++/89488 1980 * method.c (process_subob_fn): When maybe_instantiate_noexcept 1981 returns false don't call merge_exception_specifiers. 1982 19832019-02-27 Paolo Carlini <paolo.carlini@oracle.com> 1984 1985 PR c++/88987 1986 * parser.c (cp_parser_noexcept_specification_opt): Return NULL_TREE 1987 for a non-constant parsed expression. 1988 19892019-02-26 Jakub Jelinek <jakub@redhat.com> 1990 1991 PR c++/89481 1992 * constexpr.c (cxx_eval_store_expression): When changing active union 1993 member, set no_zero_init. 1994 19952019-02-23 Marek Polacek <polacek@redhat.com> 1996 1997 PR c++/88294 - ICE with non-constant noexcept-specifier. 1998 * pt.c (maybe_instantiate_noexcept): Set up the list of local 1999 specializations. Set current_class_{ptr,ref}. 2000 20012019-02-22 David Malcolm <dmalcolm@redhat.com> 2002 2003 PR c++/89390 2004 * parser.c (cp_parser_unqualified_id): Capture and use locations 2005 for destructors. 2006 20072019-02-22 Marek Polacek <polacek@redhat.com> 2008 2009 PR c++/89420 - ICE with CAST_EXPR in explicit-specifier. 2010 * decl.c (build_explicit_specifier): Don't check 2011 processing_template_decl. Call instantiation_dependent_expression_p 2012 instead of value_dependent_expression_p. Call 2013 instantiate_non_dependent_expr_sfinae before 2014 build_converted_constant_expr instead of calling 2015 instantiate_non_dependent_expr after it. Add 2016 processing_template_decl_sentinel. 2017 20182019-02-22 Thomas Schwinge <thomas@codesourcery.com> 2019 2020 * parser.c (cp_parser_oacc_simple_clause): Remove parser formal 2021 parameter, move loc formal parameter to the front. Adjust all 2022 users. 2023 (cp_parser_oacc_shape_clause): Add loc formal parameter. Adjust 2024 all users. 2025 20262019-02-21 Jason Merrill <jason@redhat.com> 2027 2028 PR c++/87685 - generic lambda 'this' capture error. 2029 * lambda.c (lambda_expr_this_capture): Change add_capture_p to int. 2030 (maybe_generic_this_capture): Pass -1. 2031 2032 PR c++/88394 - ICE with VLA init-capture. 2033 * lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE. 2034 2035 PR c++/88869 - C++17 ICE with CTAD and explicit specialization. 2036 * pt.c (do_class_deduction): Don't include explicit specialization 2037 args in outer_args. 2038 2039 PR c++/89422 - ICE with -g and lambda in default arg in template. 2040 * pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner. 2041 20422019-02-21 Jason Merrill <jason@redhat.com> 2043 2044 PR c++/88419 - C++17 ICE with class template arg deduction. 2045 * pt.c (make_template_placeholder): Set TYPE_CANONICAL after 2046 CLASS_PLACEHOLDER_TEMPLATE. 2047 20482019-02-21 Jakub Jelinek <jakub@redhat.com> 2049 2050 PR c++/89285 2051 * constexpr.c (struct constexpr_fundef): Add parms and result members. 2052 (retrieve_constexpr_fundef): Adjust for the above change. 2053 (register_constexpr_fundef): Save constexpr body with copy_fn, 2054 temporarily set DECL_CONTEXT on DECL_RESULT before that. 2055 (get_fundef_copy): Change FUN argument to FUNDEF with 2056 constexpr_fundef * type, grab body and parms/result out of 2057 constexpr_fundef struct and temporarily change it for copy_fn calls 2058 too. 2059 (cxx_eval_builtin_function_call): For __builtin_FUNCTION temporarily 2060 adjust current_function_decl from ctx->call context. Test 2061 !potential_constant_expression instead of !is_constant_expression. 2062 (cxx_bind_parameters_in_call): Grab parameters from new_call. Undo 2063 convert_for_arg_passing changes for TREE_ADDRESSABLE type passing. 2064 (cxx_eval_call_expression): Adjust get_fundef_copy caller. 2065 (cxx_eval_conditional_expression): For IF_STMT, allow then or else 2066 operands to be NULL. 2067 (label_matches): Handle BREAK_STMT and CONTINUE_STMT. 2068 (cxx_eval_loop_expr): Add support for FOR_STMT, WHILE_STMT and DO_STMT. 2069 (cxx_eval_switch_expr): Add support for SWITCH_STMT. 2070 (cxx_eval_constant_expression): Handle IF_STMT, FOR_STMT, WHILE_STMT, 2071 DO_STMT, CONTINUE_STMT, SWITCH_STMT, BREAK_STMT and CONTINUE_STMT. 2072 For SIZEOF_EXPR, recurse on the result of fold_sizeof_expr. Ignore 2073 DECL_EXPR with USING_DECL operand. 2074 * lambda.c (maybe_add_lambda_conv_op): Build thisarg using 2075 build_int_cst to make it a valid constant expression. 2076 20772019-02-20 Jason Merrill <jason@redhat.com> 2078 2079 PR c++/88690 - C++17 ICE with empty base in aggregate. 2080 * typeck2.c (process_init_constructor_record): Skip trivial 2081 initialization of an empty base. 2082 20832019-02-21 Richard Biener <rguenther@suse.de> 2084 2085 PR middle-end/89392 2086 * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not 2087 make symtab process new functions here. 2088 20892019-02-20 Jason Merrill <jason@redhat.com> 2090 2091 PR c++/87921 - wrong error with inline static data member. 2092 * decl2.c (finish_static_data_member_decl): Don't set DECL_IN_AGGR_P 2093 for a non-template inline variable. Do nothing for an 2094 already-instantiated variable. 2095 (c_parse_final_cleanups): Check DECL_IN_AGGR_P without 2096 DECL_INLINE_VAR_P. 2097 * decl.c (check_initializer): Likewise. 2098 (make_rtl_for_nonlocal_decl): Likewise. 2099 * pt.c (instantiate_decl): Likewise. 2100 * typeck2.c (store_init_value): Likewise. 2101 21022019-02-20 Jakub Jelinek <jakub@redhat.com> 2103 2104 PR c++/89403 2105 * decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting 2106 for flag_syntax_only from here... 2107 * semantics.c (expand_or_defer_fn_1): ... here. 2108 2109 PR c++/89405 2110 * decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and 2111 DECL_COMMON, set DECL_INTERFACE_KNOWN. 2112 2113 PR c++/89336 2114 * constexpr.c (cxx_eval_store_expression): Diagnose changing of active 2115 union member for -std=c++17 and earlier. 2116 21172019-02-19 Jason Merrill <jason@redhat.com> 2118 2119 PR c++/87513 - 'sorry' mangling PMF template-id. 2120 * mangle.c (write_expression): Handle SCOPE_REF to BASELINK. 2121 21222019-02-19 Jason Merrill <jason@redhat.com> 2123 2124 PR c++/88380 - wrong-code with flexible array and NSDMI. 2125 * typeck2.c (process_init_constructor_record): Skip flexarrays. 2126 21272019-02-20 will wray <wjwray@gmail.com> 2128 2129 PR c++/88572 - wrong handling of braces on scalar init. 2130 * decl.c (reshape_init_r): Allow braces around scalar initializer 2131 within aggregate init. Reject double braced-init of scalar 2132 variable. 2133 21342019-02-20 Paolo Carlini <paolo.carlini@oracle.com> 2135 2136 PR c++/84536 2137 * pt.c (tsubst_init): Diagnose an initializer expanding to an 2138 empty list of expressions; tweak wrt dependent types. 2139 (regenerate_decl_from_template): For VAR_DECLs call tsubst_init 2140 instead of tsubst_expr. 2141 21422019-02-19 Jason Merrill <jason@redhat.com> 2143 2144 PR c++/88368 - wrong 'use of deleted function' 2145 * method.c (walk_field_subobs): Remember errors from get_nsdmi. 2146 (get_defaulted_eh_spec): Call push_tinst_level. 2147 * pt.c (maybe_instantiate_noexcept): Keep error_mark_node. 2148 * typeck2.c (merge_exception_specifiers): Handle error_mark_node. 2149 21502019-02-19 Chung-Lin Tang <cltang@codesourcery.com> 2151 2152 PR c/87924 2153 * parser.c (cp_parser_oacc_clause_wait): Add representation of wait 2154 clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments. 2155 21562019-02-19 Jakub Jelinek <jakub@redhat.com> 2157 2158 PR c++/89387 2159 * lambda.c (maybe_generic_this_capture): Don't check 2160 DECL_NONSTATIC_MEMBER_FUNCTION_P on USING_DECLs. 2161 2162 PR c++/89391 2163 * typeck.c (build_reinterpret_cast_1): Don't handle void to 2164 && conversion go through build_target_expr_with_type. 2165 2166 PR c++/89390 2167 * error.c (qualified_name_lookup_error): Only call 2168 suggest_alternative_in_scoped_enum if name is IDENTIFIER_NODE. 2169 21702019-02-19 Tom Honermann <tom@honermann.net> 2171 2172 * name-lookup.c (get_std_name_hint): Added u8string as a name hint. 2173 21742019-02-18 Jason Merrill <jason@redhat.com> 2175 2176 PR c++/89336 - multiple stores in constexpr stmt. 2177 * constexpr.c (cxx_eval_store_expression): Preevaluate scalar or 2178 assigned value. 2179 2180 * pt.c (check_explicit_specialization): If the declarator is a 2181 template-id, only check whether the arguments are dependent. 2182 2183 Improve duplicate [[likely]] diagnostic. 2184 * parser.c (cp_parser_statement): Make attrs_loc a range. Pass it 2185 to process_stmt_hotness_attribute. 2186 * cp-gimplify.c (process_stmt_hotness_attribute): Take attrs_loc. 2187 (genericize_if_stmt): Use likely/unlikely instead of predictor_name. 2188 21892019-02-17 Marek Polacek <polacek@redhat.com> 2190 2191 PR c++/89217 - ICE with list-initialization in range-based for loop. 2192 * constexpr.c (unshare_constructor): No longer static. 2193 * cp-tree.h (unshare_constructor): Declare. 2194 * semantics.c (finish_compound_literal): When dealing with a 2195 non-dependent expression in a template, return the original 2196 expression. Pass LOOKUP_NO_NARROWING to digest_init_flags. 2197 21982019-02-13 Marek Polacek <polacek@redhat.com> 2199 2200 PR c++/89297 - ICE with OVERLOAD in template. 2201 * semantics.c (finish_compound_literal): Call 2202 instantiate_non_dependent_expr_sfinae. 2203 22042019-02-13 Alexandre Oliva <aoliva@redhat.com> 2205 2206 PR c++/86379 2207 * cp-tree.h (USING_DECL_SCOPE): Use result rather than type. 2208 * name-lookup.c (strip_using_decl): Use USING_DECL_SCOPE. 2209 * search.c (protected_accessible_p): Follow USING_DECL_DECLS. 2210 (shared_member_p): Likewise. 2211 (lookup_member): Likewise. 2212 * decl.c (grok_special_member_properties): Skip USING_DECLs. 2213 * semantics.c (finish_omp_declare_simd_methods): Likewise. 2214 (finish_qualified_id_expr): Do not call shared_member_p with 2215 a dependent expr. 2216 2217 PR c++/87322 2218 * pt.c (tsubst_lambda_expr): Avoid duplicate tsubsting. 2219 Move cp_evaluated resetting before signature tsubsting. 2220 (gen_elem_of_pack_expansion_instantiation): Separate local 2221 specializations per index. 2222 22232019-02-13 David Malcolm <dmalcolm@redhat.com> 2224 2225 PR c++/89036 2226 * class.c (add_method): Drop destructor assertion. 2227 22282019-02-13 Paolo Carlini <paolo.carlini@oracle.com> 2229 2230 PR c++/88986 2231 * decl.c (make_typename_type): Allow for TYPE_PACK_EXPANSION as 2232 context (the first argument). 2233 * pt.c (tsubst, case TYPENAME_TYPE): Handle TYPE_PACK_EXPANSION 2234 as context. 2235 22362019-02-12 Jason Merrill <jason@redhat.com> 2237 2238 PR c++/89144 - link error with constexpr initializer_list. 2239 * call.c (convert_like_real) [ck_list]: Don't allocate a temporary 2240 array for an empty list. 2241 * typeck2.c (store_init_value): Don't use cxx_constant_init in a 2242 template. 2243 22442019-02-11 Jason Merrill <jason@redhat.com> 2245 2246 PR c++/89241 - ICE with __func__ in lambda in template. 2247 * pt.c (enclosing_instantiation_of): Also check 2248 instantiated_lambda_fn_p for the template context. 2249 22502019-02-11 Marek Polacek <polacek@redhat.com> 2251 2252 PR c++/89212 - ICE converting nullptr to pointer-to-member-function. 2253 * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Return early for 2254 null member pointer value. 2255 22562019-02-11 Jakub Jelinek <jakub@redhat.com> 2257 2258 PR c++/88977 2259 * pt.c (convert_nontype_argument): Pass true as manifestly_const_eval 2260 to maybe_constant_value calls. 2261 22622019-02-11 Marek Polacek <polacek@redhat.com> 2263 2264 * typeck2.c (digest_init_r): Remove commented code. 2265 22662019-02-11 Martin Sebor <msebor@redhat.com> 2267 2268 PR c++/87996 2269 * decl.c (compute_array_index_type_loc): Preserve signed sizes 2270 for diagnostics. Call valid_array_size_p instead of error. 2271 * init.c (build_new_1): Compute size for diagnostic. Call 2272 invalid_array_size_error 2273 (build_new): Call valid_array_size_p instead of error. 2274 22752019-02-07 Alexandre Oliva <aoliva@redhat.com> 2276 2277 PR c++/86218 2278 * call.c (compare_ics): Deal with ck_aggr in either cs. 2279 22802019-02-06 David Malcolm <dmalcolm@redhat.com> 2281 2282 PR c++/71302 2283 * call.c (get_location_for_expr_unwinding_for_system_header): New 2284 function. 2285 (conversion_null_warnings): Use it when getting locations for 2286 EXPR, effectively adding a call to 2287 get_location_for_expr_unwinding_for_system_header for 2288 -Wconversion-null and making use of EXPR_LOCATION for 2289 -Wzero-as-null-pointer-constant. 2290 22912019-02-05 Jakub Jelinek <jakub@redhat.com> 2292 2293 PR c++/89187 2294 * optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on 2295 PARM_DECLs of the thunk. 2296 * lambda.c (maybe_add_lambda_conv_op): Likewise. 2297 22982019-02-05 Marek Polacek <polacek@redhat.com> 2299 2300 PR c++/89158 - by-value capture of constexpr variable broken. 2301 * call.c (convert_like_real) <case ck_user>: Call mark_exp_read 2302 instead of mark_rvalue_use. 2303 23042019-02-05 Alexandre Oliva <aoliva@redhat.com> 2305 2306 PR c++/87770 2307 * pt.c (instantiates_primary_template_p): New. 2308 (type_dependent_expression_p): Use it. 2309 23102019-02-01 Jason Merrill <jason@redhat.com> 2311 2312 PR c++/88761 - ICE with reference capture of constant. 2313 * lambda.c (mark_const_cap_r): Do walk subtrees of DECL_EXPR for 2314 non-proxy decls. 2315 23162019-02-01 Marek Polacek <polacek@redhat.com> 2317 2318 PR c++/88325 - ICE with invalid out-of-line template member definition. 2319 * parser.c (cp_parser_class_name): Don't call make_typename_type 2320 for overloads. 2321 23222019-02-01 Jakub Jelinek <jakub@redhat.com> 2323 2324 PR c++/87175 2325 * parser.c (cp_parser_gnu_attributes_opt): Set ok to false 2326 if require_open failed. 2327 23282019-01-31 Marek Polacek <polacek@redhat.com> 2329 2330 PR c++/89083, c++/80864 - ICE with list initialization in template. 2331 * constexpr.c (adjust_temp_type): Use copy_node and change the type 2332 instead of using build_constructor. 2333 * decl.c (reshape_init_r): Don't reshape a digested initializer. 2334 Return the initializer for COMPOUND_LITERAL_P. 2335 2336 PR c++/88983 - ICE with switch in constexpr function. 2337 * constexpr.c (cxx_eval_switch_expr): Use SWITCH_COND and SWITCH_BODY. 2338 (cxx_eval_constant_expression) <case COND_EXPR>: Don't look for the 2339 label in the else branch if we found it in the then branch. 2340 23412019-01-30 Jason Merrill <jason@redhat.com> 2342 2343 PR c++/88752 - ICE with lambda and constexpr if. 2344 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New. 2345 * pt.c (tsubst_lambda_expr): Set it. 2346 (instantiated_lambda_fn_p): Check it. 2347 (enclosing_instantiation_of): Use it. 2348 23492019-01-31 Jakub Jelinek <jakub@redhat.com> 2350 2351 PR libstdc++/88170 2352 * cxx-pretty-print.c (pp_cxx_enumeration_constant): Print always as 2353 a C cast in pp_c_flag_gnu_v3 mode. 2354 23552019-01-30 Jakub Jelinek <jakub@redhat.com> 2356 2357 PR c++/88988 2358 * lambda.c (is_capture_proxy): Don't return true for 2359 DECL_OMP_PRIVATIZED_MEMBER artificial vars. 2360 23612019-01-30 Marek Polacek <polacek@redhat.com> 2362 2363 PR c++/89119 - ICE with value-initialization in template. 2364 * pt.c (tsubst_copy_and_build): Handle RANGE_EXPR. 2365 23662019-01-29 Jason Merrill <jason@redhat.com> 2367 2368 PR c++/86943 - wrong code converting lambda to function pointer. 2369 * lambda.c (maybe_add_lambda_conv_op): Use a template-id in the 2370 call. Only forward parms for decltype. 2371 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Handle CALL_FROM_THUNK_P 2372 specially. 2373 * typeck.c (check_return_expr): Don't mess with a thunk call. 2374 23752019-01-28 Jason Merrill <jason@redhat.com> 2376 2377 PR c++/89089 - ICE with [[no_unique_address]]. 2378 PR c++/88865 - wrong layout with [[no_unique_address]]. 2379 * class.c (check_field_decls): A potentially-overlapping field makes 2380 the class non-layout-POD, but not non-empty. 2381 (end_of_class): Always consider empty data members. 2382 (layout_class_type): Set DECL_SIZE for empty fields. 2383 23842019-01-28 Marek Polacek <polacek@redhat.com> 2385 2386 PR c++/88358 - name wrongly treated as type. 2387 * parser.c (cp_parser_direct_declarator): Don't assume a qualified-id 2388 in parameter-list is a type if the function's declarator-id is not 2389 qualified. 2390 23912019-01-27 Marek Polacek <polacek@redhat.com> 2392 2393 PR c++/88815 - narrowing conversion lost in decltype. 2394 PR c++/78244 - narrowing conversion in template not detected. 2395 * cp-tree.h (CONSTRUCTOR_IS_DEPENDENT): New. 2396 * pt.c (instantiation_dependent_r): Consider a CONSTRUCTOR with 2397 CONSTRUCTOR_IS_DEPENDENT instantiation-dependent. 2398 * semantics.c (finish_compound_literal): When the compound literal 2399 isn't instantiation-dependent and the type isn't type-dependent, 2400 fall back to the normal processing. Set CONSTRUCTOR_IS_DEPENDENT. 2401 2402 PR c++/89024 - ICE with incomplete enum type. 2403 * call.c (standard_conversion): When converting an 2404 ARITHMETIC_TYPE_P to an incomplete type, return NULL. 2405 24062019-01-25 Paolo Carlini <paolo.carlini@oracle.com> 2407 2408 PR c++/88969 2409 * call.c (build_op_delete_call): Implement 7.6.2.5/(10.1). 2410 * decl2.c (coerce_delete_type): Use build_pointer_type instead 2411 of TYPE_POINTER_TO. 2412 24132019-01-24 Jason Merrill <jason@redhat.com> 2414 2415 PR c++/89001 - mangling of reference temporaries 2416 * cp-tree.h (struct saved_scope): Add ref_temp_count. 2417 (current_ref_temp_count): New macro. 2418 * mangle.c (mangle_ref_init_variable): Use it. 2419 * typeck2.c (store_init_value): Clear it. 2420 * call.c (make_temporary_var_for_ref_to_temp): Copy public and 2421 comdat. 2422 24232019-01-24 Jakub Jelinek <jakub@redhat.com> 2424 2425 PR c++/88976 2426 * semantics.c (finish_omp_cancel): Diagnose more than one if 2427 on #pragma omp cancel with different modifiers. Use 2428 maybe_convert_cond when not in template or build_x_binary_op 2429 otherwise. 2430 24312019-01-23 Marek Polacek <polacek@redhat.com> 2432 2433 PR c++/88757 - qualified name treated wrongly as type. 2434 * parser.c (cp_parser_direct_declarator): Don't treat qualified-ids 2435 in parameter-list as types if name lookup for declarator-id didn't 2436 find one or more function templates. 2437 24382019-01-23 Jakub Jelinek <jakub@redhat.com> 2439 2440 PR c/44715 2441 * cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only 2442 after genericizing cond and incr expressions. 2443 2444 PR c++/88984 2445 * cp-gimplify.c (genericize_switch_stmt): Move cond genericization 2446 before the begin_bc_block call. 2447 24482019-01-21 Jason Merrill <jason@redhat.com> 2449 2450 PR c++/87893 - constexpr ctor ICE on ARM. 2451 PR c++/88293 - ICE with comma expression. 2452 * constexpr.c (initialized_type): Don't shortcut non-void type. 2453 Handle COMPOUND_EXPR. 2454 (cxx_eval_outermost_constant_expr): Return early for void type. 2455 24562019-01-21 Jakub Jelinek <jakub@redhat.com> 2457 2458 PR c++/88949 2459 * optimize.c (cxx_copy_decl): New function. 2460 (clone_body): Use it instead of copy_decl_no_change. 2461 2462 PR sanitizer/88901 2463 * typeck.c (cp_build_binary_op): Don't instrument 2464 SANITIZE_POINTER_COMPARE if processing_template_decl. 2465 (pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT. 2466 24672019-01-18 Jason Merrill <jason@redhat.com> 2468 2469 PR c++/88875 - error with explicit list constructor. 2470 * call.c (reference_binding): Don't modify EXPR. Set 2471 need_temporary_p on the ck_user conversion for a temporary. 2472 (convert_like_real): Check it. 2473 24742019-01-18 H.J. Lu <hongjiu.lu@intel.com> 2475 2476 PR c/51628 2477 PR c/88664 2478 * call.c (convert_for_arg_passing): Upate the 2479 warn_for_address_or_pointer_of_packed_member call. 2480 * typeck.c (convert_for_assignment): Likewise. 2481 24822019-01-17 Jason Merrill <jason@redhat.com> 2483 2484 PR c++/86205 - ICE with ?: of throw and template-id. 2485 * pt.c (resolve_nondeduced_context_or_error): Split out from... 2486 * typeck.c (decay_conversion): ...here. 2487 * call.c (build_conditional_expr_1): Use it. 2488 2489 PR c++/86740, ICE with constexpr if and nested generic lambdas. 2490 * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR. 2491 24922019-01-17 Paolo Carlini <paolo.carlini@oracle.com> 2493 2494 * decl.c (grokdeclarator): Use typespec_loc in error messages 2495 about 'auto' and trailing return type. 2496 24972019-01-17 David Malcolm <dmalcolm@redhat.com> 2498 2499 PR c++/88699 2500 * class.c (add_method): Don't use DECL_DESTRUCTOR_P on 2501 USING_DECLs. 2502 25032019-01-17 Nathan Sidwell <nathan@acm.org> 2504 2505 PR c++/86610 2506 * semantics.c (process_outer_var_ref): Only skip dependent types 2507 in templates. 2508 25092019-01-17 Alexandre Oliva <aoliva@redhat.com> 2510 2511 PR c++/87768 2512 * cp-tree.h (saved_scope): Add suppress_location_wrappers. 2513 * name-lookup.c (do_push_to_top_level): Save and reset it. 2514 (do_pop_from_top_level): Restore it. 2515 2516 PR c++/86648 2517 * pt.c (make_template_placeholder): Use auto_identifier. 2518 (is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test. 2519 * error.c (dump_type): Handle template placeholders. 2520 * cxx-pretty-print.c (pp_cx_unqualified_id): Likewise. 2521 2522 PR c++/88146 2523 * cvt.c (convert_to_void): Handle all cdtor calls as if 2524 returning void. 2525 25262019-01-16 Paolo Carlini <paolo.carlini@oracle.com> 2527 2528 * decl.c (grokdeclarator): Use locations[ds_storage_class] in 2529 error messages about ill-formed uses of mutable. 2530 25312019-01-16 Marek Polacek <polacek@redhat.com> 2532 2533 PR c++/78244 - narrowing conversion in template not detected. 2534 * call.c (perform_implicit_conversion_flags): Set 2535 IMPLICIT_CONV_EXPR_BRACED_INIT. 2536 * cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New. 2537 * pt.c (tsubst_copy_and_build): Use it. 2538 25392019-01-15 David Malcolm <dmalcolm@redhat.com> 2540 2541 PR c++/88795 2542 * pt.c (build_deduction_guide): Bail out if tsubst_arg_types 2543 fails. 2544 25452019-01-15 Paolo Carlini <paolo.carlini@oracle.com> 2546 2547 * decl.c (start_decl): Improve error location. 2548 * decl2.c (grokfield): Likewise. 2549 25502019-01-15 Paolo Carlini <paolo.carlini@oracle.com> 2551 2552 * decl.c (grokdeclarator): Move further up the location_t loc 2553 declaration and use the location when building a TYPE_DECL for 2554 a typedef name. 2555 * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error 2556 about an ill-formed bit-field as typedef. 2557 25582019-01-14 Marek Polacek <polacek@redhat.com> 2559 2560 PR c++/88830 - ICE with abstract class. 2561 * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR. 2562 Fix formatting. 2563 2564 PR c++/88825 - ICE with bogus function return type deduction. 2565 * typeck.c (can_do_nrvo_p): Check error_mark_node. 2566 25672019-01-14 Tom Honermann <tom@honermann.net> 2568 2569 Implement P0482R5, char8_t: A type for UTF-8 characters and strings 2570 * cvt.c (type_promotes_to): Handle char8_t promotion. 2571 * decl.c (grokdeclarator): Handle invalid type specifier 2572 combinations involving char8_t. 2573 * lex.c (init_reswords): Add char8_t as a reserved word. 2574 * mangle.c (write_builtin_type): Add name mangling for char8_t (Du). 2575 * parser.c (cp_keyword_starts_decl_specifier_p) 2576 (cp_parser_simple_type_specifier): Recognize char8_t as a simple 2577 type specifier. 2578 (cp_parser_string_literal): Use char8_array_type_node for the type 2579 of CPP_UTF8STRING. 2580 (cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system 2581 headers. 2582 * rtti.c (emit_support_tinfos): type_info support for char8_t. 2583 * tree.c (char_type_p): Recognize char8_t as a character type. 2584 * typeck.c (string_conv_p): Handle conversions of u8 string 2585 literals of char8_t type. 2586 (check_literal_operator_args): Handle UDLs with u8 string literals 2587 of char8_t type. 2588 * typeck2.c (ordinary_char_type_p): New. 2589 (digest_init_r): Disallow initializing a char array with a u8 string 2590 literal. 2591 25922019-01-14 Martin Liska <mliska@suse.cz> 2593 2594 PR gcov-profile/88263 2595 * decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION 2596 as location of the TLS wrapper. 2597 25982019-01-12 Paolo Carlini <paolo.carlini@oracle.com> 2599 2600 * decl.c (cp_finish_decl): Improve error location. 2601 * decl2.c (grokfield): Likewise, improve two locations. 2602 26032019-01-11 Marek Polacek <polacek@redhat.com> 2604 2605 PR c++/88692, c++/87882 - -Wredundant-move false positive with *this. 2606 * typeck.c (maybe_warn_pessimizing_move): Return if ARG isn't 2607 ADDR_EXPR. 2608 26092019-01-11 Jason Merrill <jason@redhat.com> 2610 2611 PR c++/88312 - pack expansion of decltype. 2612 * pt.c (instantiation_dependent_r): A template non-type parameter 2613 pack is instantiation-dependent. 2614 26152019-01-11 Jason Merrill <jason@redhat.com> 2616 2617 PR c++/88613 - ICE with use of const var in lambda. 2618 * expr.c (mark_use): Fix location wrapper handling. 2619 * cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use. 2620 26212019-01-11 Tobias Burnus <burnus@net-b.de> 2622 2623 PR C++/88114 2624 * decl2.c (maybe_emit_vtables): If needed, generate code for 2625 the destructor of an abstract class. 2626 (mark_used): Update comment for older function-name change. 2627 26282019-01-11 Paolo Carlini <paolo.carlini@oracle.com> 2629 2630 * decl.c (start_decl): Improve error location. 2631 (grokdeclarator): Likewise, improve two locations. 2632 26332019-01-09 Sandra Loosemore <sandra@codesourcery.com> 2634 2635 PR other/16615 2636 2637 * cp-tree.h: Mechanically replace "can not" with "cannot". 2638 * parser.c: Likewise. 2639 * pt.c: Likewise. 2640 26412019-01-08 Paolo Carlini <paolo.carlini@oracle.com> 2642 2643 * decl.c (grok_reference_init): Improve error location. 2644 (grokdeclarator): Likewise, improve two locations. 2645 26462019-01-08 Marek Polacek <polacek@redhat.com> 2647 2648 PR c++/88538 - braced-init-list in template-argument-list. 2649 * parser.c (cp_parser_template_argument): Handle braced-init-list when 2650 in C++20. 2651 2652 PR c++/88548 - this accepted in static member functions. 2653 * parser.c (cp_debug_parser): Adjust printing of 2654 local_variables_forbidden_p. 2655 (cp_parser_new): Set local_variables_forbidden_p to 0 rather than false. 2656 (cp_parser_primary_expression): When checking 2657 local_variables_forbidden_p, use THIS_FORBIDDEN or 2658 LOCAL_VARS_FORBIDDEN. 2659 (cp_parser_lambda_body): Update the type of 2660 local_variables_forbidden_p. Set it to 0 rather than false. 2661 (cp_parser_condition): Adjust call to cp_parser_declarator. 2662 (cp_parser_explicit_instantiation): Likewise. 2663 (cp_parser_init_declarator): Likewise. 2664 (cp_parser_declarator): New parameter. Use it. 2665 (cp_parser_direct_declarator): New parameter. Use it to set 2666 local_variables_forbidden_p. Adjust call to cp_parser_declarator. 2667 (cp_parser_type_id_1): Adjust call to cp_parser_declarator. 2668 (cp_parser_parameter_declaration): Likewise. 2669 (cp_parser_default_argument): Update the type of 2670 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN 2671 rather than true. 2672 (cp_parser_member_declaration): Tell cp_parser_declarator if we saw 2673 'static' or 'friend'. 2674 (cp_parser_exception_declaration): Adjust call to cp_parser_declarator. 2675 (cp_parser_late_parsing_default_args): Update the type of 2676 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN 2677 rather than true. 2678 (cp_parser_cache_defarg): Adjust call to cp_parser_declarator. 2679 (cp_parser_objc_class_ivars): Likewise. 2680 (cp_parser_objc_struct_declaration): Likewise. 2681 (cp_parser_omp_for_loop_init): Likewise. 2682 * parser.h (cp_parser): Change the type of local_variables_forbidden_p 2683 to unsigned char. 2684 (LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN): 2685 Define. 2686 26872019-01-08 Paolo Carlini <paolo.carlini@oracle.com> 2688 2689 * decl.c (start_decl): Improve permerror location. 2690 26912019-01-08 Jonathan Wakely <jwakely@redhat.com> 2692 Jakub Jelinek <jakub@redhat.com> 2693 2694 PR c++/88554 2695 * decl.c (finish_function): For -Wreturn-type don't add a return *this; 2696 fixit hint if current_class_ref is NULL. Use a single if instead of 2697 two nested ones. 2698 26992019-01-07 Paolo Carlini <paolo.carlini@oracle.com> 2700 2701 * decl.c (start_decl): Improve two error_at locations. 2702 (expand_static_init): Likewise. 2703 27042019-01-07 Marek Polacek <polacek@redhat.com> 2705 2706 PR c++/88741 - wrong error with initializer-string. 2707 * decl.c (cp_complete_array_type): Strip any location wrappers. 2708 27092019-01-07 Bernd Edlinger <bernd.edlinger@hotmail.de> 2710 2711 PR c++/88261 2712 PR c++/69338 2713 PR c++/69696 2714 PR c++/69697 2715 * cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value. 2716 * typeck2.c (digest_init_r): Raise an error for non-static 2717 initialization of a flexible array member. 2718 (process_init_constructor, massage_init_elt, 2719 process_init_constructor_array, process_init_constructor_record, 2720 process_init_constructor_union, process_init_constructor): Add the 2721 flags parameter and pass it thru. 2722 (store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to 2723 digest_init_flags for static decls. 2724 27252019-01-07 Jakub Jelinek <jakub@redhat.com> 2726 2727 PR c++/85052 2728 * cp-tree.h (cp_build_vec_convert): Declare. 2729 * parser.c (cp_parser_postfix_expression): Parse 2730 __builtin_convertvector. 2731 * constexpr.c: Include fold-const-call.h. 2732 (cxx_eval_internal_function): Handle IFN_VEC_CONVERT. 2733 (potential_constant_expression_1): Likewise. 2734 * semantics.c (cp_build_vec_convert): New function. 2735 * pt.c (tsubst_copy_and_build): Handle CALL_EXPR to 2736 IFN_VEC_CONVERT. 2737 27382019-01-03 Jakub Jelinek <jakub@redhat.com> 2739 2740 PR c++/88636 2741 * decl.c (builtin_function_1): Return result of pushdecl_top_level 2742 or pushdecl rather than decl. 2743 27442019-01-03 Paolo Carlini <paolo.carlini@oracle.com> 2745 2746 * tree.c (handle_nodiscard_attribute): Improve warning location. 2747 27482019-01-02 Marek Polacek <polacek@redhat.com> 2749 2750 PR c++/88612 - ICE with -Waddress-of-packed-member. 2751 * call.c (convert_for_arg_passing): Only give warnings with tf_warning. 2752 * typeck.c (convert_for_assignment): Likewise. 2753 2754 PR c++/88631 - CTAD failing for value-initialization. 2755 * typeck2.c (build_functional_cast): Try deducing the template 2756 arguments even if there are no arguments to deduce from. 2757 27582019-01-01 Jakub Jelinek <jakub@redhat.com> 2759 2760 Update copyright years. 2761 2762Copyright (C) 2019 Free Software Foundation, Inc. 2763 2764Copying and distribution of this file, with or without modification, 2765are permitted in any medium without royalty provided the copyright 2766notice and this notice are preserved. 2767