12019-05-03 Release Manager 2 3 * GCC 9.1.0 released. 4 52019-04-24 Jason Merrill <jason@redhat.com> 6 7 PR c++/90227 - error with template parameter packs. 8 * pt.c (coerce_template_parms): Do add empty pack when 9 require_all_args. 10 112019-04-24 Richard Biener <rguenther@suse.de> 12 13 * call.c (null_ptr_cst_p): Order checks according to expensiveness. 14 (conversion_null_warnings): Likewise. 15 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Return 16 early if type1 == type2. 17 182019-04-22 Jason Merrill <jason@redhat.com> 19 20 PR c++/87366 - wrong error with alias template. 21 * typeck.c (structural_comptypes): When comparing_specializations, 22 aliases are unequal. 23 (comptypes): When comparing_specializations, do structural 24 comparison. 25 262019-04-19 Jason Merrill <jason@redhat.com> 27 28 PR c++/90190 - CTAD with list-constructor. 29 * pt.c (do_class_deduction): Don't try the single element deduction 30 if the single element is also a braced list. 31 32 PR c++/90171 - ICE with destroying delete with size_t parm. 33 * call.c (sized_deallocation_fn_p): New. Use it instead of 34 second_parm_is_size_t in most cases. 35 (second_parm_is_size_t): Don't check for aligned. 36 372019-04-19 Paolo Carlini <paolo.carlini@oracle.com> 38 39 PR c++/89900 40 * pt.c (fn_type_unification): When handling null explicit 41 arguments do not special case non-parameter packs. 42 432019-04-19 Jakub Jelinek <jakub@redhat.com> 44 45 PR c++/90138 46 * pt.c (process_template_parm): Set decl to pushdecl result. If 47 !is_non_type, also set parm to that. 48 49 PR c/89888 50 * decl.c (struct cp_switch): Remove outside_range_p member. 51 (push_switch): Don't clear it. 52 (pop_switch): Adjust c_do_switch_warnings caller. 53 (finish_case_label): Adjust c_add_case_label caller. 54 55 PR c++/90108 56 * decl.c (duplicate_decls): If remove is main variant and 57 DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE 58 variant that has newdecl as TYPE_NAME if any. 59 602019-04-18 Jason Merrill <jason@redhat.com> 61 62 PR c++/87554 - ICE with extern template and reference member. 63 * decl.c (cp_finish_decl): Don't set DECL_INITIAL of external vars. 64 652019-04-17 Jason Merrill <jason@redhat.com> 66 67 PR c++/90047 - ICE with enable_if alias template. 68 * pt.c (tsubst_decl) [TYPE_DECL]: Don't put an erroneous decl in the 69 hash table when we're in SFINAE context. 70 712019-04-17 Marek Polacek <polacek@redhat.com> 72 73 PR c++/90124 - bogus error with incomplete type in decltype. 74 * typeck.c (build_class_member_access_expr): Check 75 cp_unevaluated_operand. 76 772019-04-12 Jakub Jelinek <jakub@redhat.com> 78 79 PR c/89933 80 * decl.c (duplicate_decls): When newdecl's type is its main variant, 81 don't try to remove it from the variant list, but instead assert 82 it has no variants. 83 842019-04-12 Martin Sebor <msebor@redhat.com> 85 86 PR c/88383 87 PR c/89288 88 * parser.c (cp_parser_has_attribute_expression): Handle assignment 89 expressions. 90 912019-04-12 Jason Merrill <jason@redhat.com> 92 93 * call.c (null_member_pointer_value_p): Handle an empty CONSTRUCTOR 94 of PMF type. 95 962019-04-12 Marek Polacek <polacek@redhat.com> 97 98 * except.c (build_noexcept_spec): Use build_converted_constant_bool_expr 99 instead of perform_implicit_conversion_flags. 100 101 PR c++/87603 - constexpr functions are no longer noexcept. 102 * constexpr.c (is_sub_constant_expr): Remove unused function. 103 * cp-tree.h (is_sub_constant_expr): Remove declaration. 104 * except.c (check_noexcept_r): Don't consider a call to a constexpr 105 function noexcept. 106 1072019-04-11 Jakub Jelinek <jakub@redhat.com> 108 109 PR translation/90035 110 * parser.h (struct cp_parser): Add 111 type_definition_forbidden_message_arg member. 112 * parser.c (cp_debug_parser): Print it. 113 (cp_parser_check_type_definition): Pass 114 parser->type_definition_forbidden_message_arg as second argument to 115 error. 116 (cp_parser_has_attribute_expression, cp_parser_sizeof_operand): Set 117 parser->type_definition_forbidden_message_arg and use G_() with 118 %qs for parser->type_definition_forbidden_message instead of 119 building untranslatable message using concat. 120 1212019-04-09 Jakub Jelinek <jakub@redhat.com> 122 123 PR translation/90011 124 * typeck2.c (check_narrowing): Remove trailing space from diagnostics. 125 1262019-04-08 Marek Polacek <polacek@redhat.com> 127 128 * typeck2.c (digest_init_r): Don't condition the object slicing warning 129 on flag_checking. 130 1312019-04-08 Paolo Carlini <paolo.carlini@oracle.com> 132 133 PR c++/89914 134 * semantics.c (trait_expr_value): Don't use TYPE_NOTHROW_P 135 when maybe_instantiate_noexcept fails. 136 (classtype_has_nothrow_assign_or_copy_p): Likewise. 137 * method.c (implicitly_declare_fn): Avoid passing error_mark_node 138 to build_exception_variant. 139 1402019-04-05 Marek Polacek <polacek@redhat.com> 141 142 PR c++/87145 - bogus error converting class type in template arg list. 143 * pt.c (convert_nontype_argument): Don't call 144 build_converted_constant_expr if it could involve calling a conversion 145 function with a instantiation-dependent constructor as its argument. 146 1472019-04-05 Martin Sebor <msebor@redhat.com> 148 149 PR bootstrap/89980 150 * decl.c (reshape_init_array_1): Avoid treating empty strings 151 as zeros in array initializers. 152 Use trivial_type_p () instead of TYPE_HAS_TRIVIAL_DFLT(). 153 1542019-04-04 Jason Merrill <jason@redhat.com> 155 156 PR c++/89948 - ICE with break in statement-expr. 157 * constexpr.c (cxx_eval_statement_list): Jumping out of a 158 statement-expr is non-constant. 159 1602019-04-04 Jason Merrill <jason@redhat.com> 161 162 PR c++/89966 - error with non-type auto tparm. 163 * pt.c (do_auto_deduction): Clear tf_partial. 164 1652019-04-04 Jason Merrill <jason@redhat.com> 166 167 PR c++/86986 - ICE with TTP with parameter pack. 168 * pt.c (coerce_template_parameter_pack): Only look at the type of a 169 non-type parameter pack. 170 (fixed_parameter_pack_p_1): Don't recurse into the type of a 171 non-type parameter pack. 172 (coerce_template_template_parms): Call add_outermost_template_args. 173 1742019-04-04 Martin Sebor <msebor@redhat.com> 175 176 PR c++/89974 177 PR c++/89878 178 PR c++/89833 179 PR c++/47488 180 * decl.c (reshape_init_array_1): Strip trailing zero-initializers 181 from arrays of trivial type and known size. 182 * mangle.c (write_expression): Convert braced initializer lists 183 to STRING_CSTs. 184 (write_expression): Trim trailing zero-initializers from arrays 185 of trivial type. 186 (write_template_arg_literal): Mangle strings the same as braced 187 initializer lists. 188 1892019-04-03 Jason Merrill <jason@redhat.com> 190 191 PR c++/81866 - ICE with member template and default targ. 192 * pt.c (tsubst_template_decl): Handle getting a type from 193 retrieve_specialization. 194 195 PR c++/86586 - -fcompare-debug=-Wsign-compare. 196 * typeck.c (cp_build_binary_op): Don't fold for -Wsign-compare. 197 198 PR c++/89331 - ICE with offsetof in incomplete class. 199 * semantics.c (finish_offsetof): Handle error_mark_node. 200 * typeck.c (build_class_member_access_expr): Call 201 complete_type_or_maybe_complain before converting to base. 202 203 PR c++/89917 - ICE with lambda in variadic mem-init. 204 * pt.c (make_pack_expansion): Change type_pack_expansion_p to false. 205 2062019-04-01 Jason Merrill <jason@redhat.com> 207 208 PR c++/86946 - ICE with function call in template argument. 209 DR 1321 210 * pt.c (iterative_hash_template_arg) [CALL_EXPR]: Use 211 dependent_name. 212 2132019-04-01 Paolo Carlini <paolo.carlini@oracle.com> 214 215 PR c++/62207 216 * pt.c (tsubst_copy): Deal with lookup_name not returing a variable. 217 2182019-03-31 Marek Polacek <polacek@redhat.com> 219 220 PR c++/89852 - ICE with C++11 functional cast with { }. 221 * constexpr.c (fold_non_dependent_expr_template): New static function 222 broken out of... 223 (fold_non_dependent_expr): ...here. 224 (fold_non_dependent_init): New function. 225 * cp-tree.h (fold_non_dependent_init): Declare. 226 * typeck2.c (massage_init_elt): Call fold_non_dependent_init instead 227 of fold_non_dependent_expr. Don't call maybe_constant_init. 228 2292019-03-30 Jason Merrill <jason@redhat.com> 230 231 PR c++/89744 - ICE with specialization of member class template. 232 * pt.c (lookup_template_class_1): If the partial instantiation is 233 explicitly specialized, adjust. 234 (maybe_process_partial_specialization): Also adjust 235 CLASSTYPE_TI_ARGS. 236 2372019-03-29 Jakub Jelinek <jakub@redhat.com> 238 239 PR sanitizer/89869 240 * typeck.c: Include gimplify.h. 241 (cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it 242 for second time. Formatting fixes. 243 2442019-03-29 Marek Polacek <polacek@redhat.com> 245 246 PR c++/89876 - ICE with deprecated conversion. 247 * call.c (convert_like_real): Only give warnings with tf_warning. 248 2492019-03-28 Marek Polacek <polacek@redhat.com> 250 251 PR c++/89612 - ICE with member friend template with noexcept. 252 * pt.c (maybe_instantiate_noexcept): For function templates, use their 253 template result (function decl). Don't set up local specializations. 254 Temporarily turn on processing_template_decl. Update the template type 255 too. 256 257 PR c++/89836 - bool constant expression and explicit conversions. 258 * call.c (build_converted_constant_expr_internal): New function, 259 renamed from... 260 (build_converted_constant_expr): ...this. New. 261 (build_converted_constant_bool_expr): New. 262 * cp-tree.h (build_converted_constant_bool_expr): Declare. 263 * decl.c (build_explicit_specifier): Call 264 build_converted_constant_bool_expr. 265 2662019-03-28 Jakub Jelinek <jakub@redhat.com> 267 268 PR c++/89785 269 * constexpr.c (struct check_for_return_continue_data): New type. 270 (check_for_return_continue): New function. 271 (potential_constant_expression_1) <case SWITCH_STMT>: Walk 272 SWITCH_STMT_BODY to find RETURN_EXPRs or CONTINUE_STMTs not nested 273 in loop bodies and set *jump_target to that if found. 274 2752019-03-27 Jason Merrill <jason@redhat.com> 276 277 PR c++/89831 - error with qualified-id in const member function. 278 * semantics.c (finish_non_static_data_member): Use object cv-quals 279 in scoped case, too. 280 281 PR c++/89421 - ICE with lambda in template parameter list. 282 * parser.c (cp_parser_lambda_expression): Also reject a lambda in a 283 template parameter list before C++20. 284 * pt.c (type_dependent_expression_p): True for LAMBDA_EXPR. 285 * semantics.c (begin_class_definition): Restore error about defining 286 non-lambda class in template parm list. 287 2882019-03-26 Jason Merrill <jason@redhat.com> 289 290 PR c++/86932 - missed SFINAE with empty pack. 291 * pt.c (coerce_template_parms): Don't add an empty pack if 292 tf_partial. 293 (fn_type_unification): Pass tf_partial to coerce_template_parms. 294 295 PR c++/86429 - constexpr variable in lambda. 296 PR c++/82643 297 PR c++/87327 298 * constexpr.c (cxx_eval_constant_expression): In a lambda function, 299 try evaluating the captured variable directly. 300 3012019-03-26 Jakub Jelinek <jakub@redhat.com> 302 303 PR c++/89796 304 * semantics.c (finish_omp_atomic): Add warning_sentinel for 305 -Wunused-value around finish_expr_stmt call. 306 3072019-03-25 Paolo Carlini <paolo.carlini@oracle.com> 308 309 PR c++/84661 310 PR c++/85013 311 * parser.c (cp_parser_binary_expression): Don't call cp_fully_fold 312 to undo the disabling of warnings. 313 3142019-03-25 Jason Merrill <jason@redhat.com> 315 316 PR c++/87748 - substitution failure error with decltype. 317 * pt.c (most_specialized_partial_spec): Clear 318 processing_template_decl. 319 3202019-03-25 Marek Polacek <polacek@redhat.com> 321 322 PR c++/89214 - ICE when initializing aggregates with bases. 323 * typeck2.c (digest_init_r): Warn about object slicing instead of 324 crashing. 325 326 PR c++/89705 - ICE with reference binding with conversion function. 327 * call.c (reference_binding): If the result of the conversion function 328 is a prvalue of non-class type, use the cv-unqualified type. 329 3302019-03-25 Nathan Sidwell <nathan@acm.org> 331 332 * lambda.c (maybe_add_lambda_conv_op): Don't add to comdat group. 333 3342019-03-22 Jakub Jelinek <jakub@redhat.com> 335 336 PR c++/60702 337 * cp-tree.h (get_tls_wrapper_fn): Remove declaration. 338 (maybe_get_tls_wrapper_call): Declare. 339 * decl2.c (get_tls_wrapper_fn): Make static. 340 (maybe_get_tls_wrapper_call): New function. 341 * typeck.c (build_class_member_access_expr): Handle accesses to TLS 342 variables. 343 * semantics.c (finish_qualified_id_expr): Likewise. 344 (finish_id_expression_1): Use maybe_get_tls_wrapper_call. 345 * pt.c (tsubst_copy_and_build): Likewise. 346 347 PR c++/87481 348 * constexpr.c (struct constexpr_ctx): Add constexpr_ops_count member. 349 (cxx_eval_constant_expression): When not skipping, not constant class 350 or location wrapper, increment *ctx->constexpr_ops_count and if it is 351 above constexpr_loop_nest_limit, diagnose failure. 352 (cxx_eval_outermost_constant_expr): Add constexpr_ops_count and 353 initialize ctx.constexpr_ops_count to its address. 354 (is_sub_constant_expr): Likewise. 355 3562019-03-21 Jakub Jelinek <jakub@redhat.com> 357 358 PR c++/71446 359 * call.c (filed_in_pset): Change pset from hash_set<tree> * to 360 hash_set<tree, true> &, adjust uses accordingly. 361 (build_aggr_conv): Change pset from hash_set<tree> * 362 to hash_set<tree, true>. Replace goto fail; with return NULL;, 363 adjust pset uses. 364 365 PR c++/89767 366 * parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id 367 variables, check for duplicates in this function. 368 * lambda.c (add_capture): Don't check for duplicates nor use 369 IDENTIFIER_MARKED. 370 (register_capture_members): Don't clear IDENTIFIER_MARKED here. 371 3722019-03-21 Paolo Carlini <paolo.carlini@oracle.com> 373 374 PR c++/89571 375 * method.c (after_nsdmi_defaulted_late_checks): Avoid passing 376 error_mark_node to comp_except_specs. 377 3782019-03-20 Jason Merrill <jason@redhat.com> 379 380 PR c++/87480 - decltype of member access in default template arg 381 * pt.c (type_unification_real): Accept a dependent result in 382 template context. 383 3842019-03-19 Martin Sebor <msebor@redhat.com> 385 386 PR tree-optimization/89688 387 * typeck2.c (store_init_value): Call braced_lists_to_string for more 388 kinds of initializers. 389 3902019-03-18 Jason Merrill <jason@redhat.com> 391 392 PR c++/89630 - ICE with dependent using-decl as template arg. 393 * tree.c (cp_tree_equal): Always return false for USING_DECL. 394 395 PR c++/89761 - ICE with sizeof... in pack expansion. 396 * pt.c (argument_pack_element_is_expansion_p): Handle 397 ARGUMENT_PACK_SELECT. 398 399 PR c++/89640 - GNU attributes on lambda. 400 * parser.c (cp_parser_lambda_declarator_opt): Allow GNU attributes. 401 402 PR c++/89682 - wrong access error in default argument. 403 * pt.c (tsubst_default_argument): Don't defer access checks. 404 4052019-03-18 Paolo Carlini <paolo.carlini@oracle.com> 406 407 PR c++/85014 408 * semantics.c (finish_non_static_data_member): Check return value 409 of context_for_name_lookup and immediately return error_mark_node 410 if isn't a type. 411 4122019-03-17 Jason Merrill <jason@redhat.com> 413 414 PR c++/89571 - ICE with ill-formed noexcept on constructor. 415 * pt.c (maybe_instantiate_noexcept): Only return false if defaulted. 416 (regenerate_decl_from_template): Use it for noexcept-specs. 417 4182019-03-14 Jason Merrill <jason@redhat.com> 419 420 * parser.c (cp_parser_decl_specifier_seq): Support C++20 421 concept-definition syntax without 'bool'. 422 4232019-03-14 Jakub Jelinek <jakub@redhat.com> 424 425 PR c++/89512 426 * semantics.c (finish_qualified_id_expr): Reject variable templates. 427 428 PR c++/89652 429 * constexpr.c (struct constexpr_ctx): Change save_exprs type from 430 hash_set<tree> to vec<tree>. 431 (cxx_eval_call_expression): Adjust for save_exprs being a vec instead 432 of hash_set. 433 (cxx_eval_loop_expr): Likewise. Truncate the vector after each 434 removal of SAVE_EXPRs from values. 435 (cxx_eval_constant_expression) <case SAVE_EXPR>: Call safe_push 436 method on save_exprs instead of add. 437 4382019-03-13 Jason Merrill <jason@redhat.com> 439 440 PR c++/86521 - C++17 copy elision in initialization by constructor. 441 * call.c (joust_maybe_elide_copy): New. 442 (joust): Call it. 443 4442019-03-13 Marek Polacek <polacek@redhat.com> 445 446 PR c++/88979 - further P0634 fix for constructors. 447 * parser.c (cp_parser_decl_specifier_seq): Pass flags to 448 cp_parser_constructor_declarator_p. 449 (cp_parser_direct_declarator): Allow missing typename for constructor 450 parameters. 451 (cp_parser_constructor_declarator_p): Add FLAGS parameter. Pass it to 452 cp_parser_type_specifier. 453 454 PR c++/89686 - mixing init-capture and simple-capture in lambda. 455 * parser.c (cp_parser_lambda_introducer): Give error when combining 456 init-capture and simple-capture. 457 458 PR c++/89660 - bogus error with -Wredundant-move. 459 * typeck.c (maybe_warn_pessimizing_move): Only accept (T &) &arg 460 as the std::move's argument. Don't call convert_for_initialization 461 when warn_redundant_move isn't on. 462 4632019-03-11 Jason Merrill <jason@redhat.com> 464 465 PR c++/86521 - wrong overload resolution with ref-qualifiers. 466 * call.c (build_user_type_conversion_1): Don't use a conversion to a 467 reference of the wrong rvalueness for direct binding. 468 4692019-03-11 Martin Liska <mliska@suse.cz> 470 471 * cvt.c (build_expr_type_conversion): Wrap apostrophes 472 in gcc internal format with %'. 473 * decl.c (check_no_redeclaration_friend_default_args): Likewise. 474 (grokfndecl): Likewise. 475 * name-lookup.c (do_pushtag): Likewise. 476 * pt.c (unify_parameter_deduction_failure): Likewise. 477 (unify_template_deduction_failure): Likewise. 478 4792019-03-11 Martin Liska <mliska@suse.cz> 480 481 * call.c (convert_arg_to_ellipsis): Wrap an option name 482 in a string format message and fix GNU coding style. 483 (build_over_call): Likewise. 484 * class.c (check_field_decl): Likewise. 485 (layout_nonempty_base_or_field): Likewise. 486 * constexpr.c (cxx_eval_loop_expr): Likewise. 487 * cvt.c (type_promotes_to): Likewise. 488 * decl.c (cxx_init_decl_processing): Likewise. 489 (mark_inline_variable): Likewise. 490 (grokdeclarator): Likewise. 491 * decl2.c (record_mangling): Likewise. 492 * error.c (maybe_warn_cpp0x): Likewise. 493 * except.c (doing_eh): Likewise. 494 * mangle.c (maybe_check_abi_tags): Likewise. 495 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise. 496 (cp_parser_userdef_numeric_literal): Likewise. 497 (cp_parser_primary_expression): Likewise. 498 (cp_parser_unqualified_id): Likewise. 499 (cp_parser_pseudo_destructor_name): Likewise. 500 (cp_parser_builtin_offsetof): Likewise. 501 (cp_parser_lambda_expression): Likewise. 502 (cp_parser_lambda_introducer): Likewise. 503 (cp_parser_lambda_declarator_opt): Likewise. 504 (cp_parser_selection_statement): Likewise. 505 (cp_parser_init_statement): Likewise. 506 (cp_parser_decomposition_declaration): Likewise. 507 (cp_parser_function_specifier_opt): Likewise. 508 (cp_parser_static_assert): Likewise. 509 (cp_parser_simple_type_specifier): Likewise. 510 (cp_parser_namespace_definition): Likewise. 511 (cp_parser_using_declaration): Likewise. 512 (cp_parser_ctor_initializer_opt_and_function_body): Likewise. 513 (cp_parser_initializer_list): Likewise. 514 (cp_parser_type_parameter_key): Likewise. 515 (cp_parser_member_declaration): Likewise. 516 (cp_parser_try_block): Likewise. 517 (cp_parser_std_attribute_spec): Likewise. 518 (cp_parser_requires_clause_opt): Likewise. 519 * pt.c (check_template_variable): Likewise. 520 (check_default_tmpl_args): Likewise. 521 (push_tinst_level_loc): Likewise. 522 (instantiate_pending_templates): Likewise. 523 (invalid_nontype_parm_type_p): Likewise. 524 * repo.c (get_base_filename): Likewise. 525 * rtti.c (typeid_ok_p): Likewise. 526 (build_dynamic_cast_1): Likewise. 527 * tree.c (maybe_warn_parm_abi): Likewise. 528 5292019-03-08 Jakub Jelinek <jakub@redhat.com> 530 531 PR other/80058 532 * parser.c (cp_parser_template_declaration_after_parameters): Avoid 533 one space before " at the end of line and another after " on another 534 line in a string literal. 535 536 PR tree-optimization/89550 537 * semantics.c (maybe_convert_cond): Only set TREE_NO_WARNING if 538 warning_at returned true. 539 * decl2.c (c_parse_final_cleanups): Likewise. 540 * typeck.c (convert_for_assignment): Likewise. 541 * decl.c (finish_function): Likewise. 542 543 PR c++/89585 544 * parser.c (cp_parser_asm_definition): Just warn instead of error 545 on volatile qualifier outside of function body. 546 547 PR c++/89599 548 * constexpr.c (potential_constant_expression_1): Reject 549 REINTERPRET_CAST_P NOP_EXPRs. 550 551 PR c++/89622 552 * call.c (joust): Call print_z_candidate only if pedwarn returned 553 true. 554 5552019-03-07 Jason Merrill <jason@redhat.com> 556 557 PR c++/88123 - lambda and using-directive. 558 * name-lookup.c (op_unqualified_lookup) 559 (maybe_save_operator_binding, discard_operator_bindings) 560 (push_operator_bindings): New. 561 * typeck.c (build_x_binary_op, build_x_unary_op): Call 562 maybe_save_operator_binding. 563 * decl.c (start_preparsed_function): Call push_operator_bindings. 564 * tree.c (cp_free_lang_data): Call discard_operator_bindings. 565 566 PR c++/88820 - ICE with CTAD and member template used in DMI. 567 * pt.c (do_class_deduction): Handle parm used as its own arg. 568 5692019-03-07 Jakub Jelinek <jakub@redhat.com> 570 571 PR c++/89585 572 * parser.c (cp_parser_asm_definition): Parse asm qualifiers even 573 at toplevel, but diagnose them. 574 5752019-03-06 Jason Merrill <jason@redhat.com> 576 577 PR c++/89381 - implicit copy and using-declaration. 578 * class.c (classtype_has_move_assign_or_move_ctor_p): Don't consider 579 op= brought in by a using-declaration. 580 5812019-03-06 Jakub Jelinek <jakub@redhat.com> 582 583 PR c++/87148 584 * init.c (build_value_init_noctor): Ignore flexible array members. 585 5862019-03-06 Jason Merrill <jason@redhat.com> 587 588 PR c++/89576 - if constexpr of lambda capture. 589 * semantics.c (maybe_convert_cond): Do convert a non-dependent 590 condition in a template. 591 * typeck.c (condition_conversion): Handle being called in a 592 template. 593 5942019-03-06 Marek Polacek <polacek@redhat.com> 595 596 PR c++/87378 - bogus -Wredundant-move warning. 597 * typeck.c (maybe_warn_pessimizing_move): See if the maybe-rvalue 598 overload resolution would actually succeed. 599 6002019-03-05 Jason Merrill <jason@redhat.com> 601 602 * class.c (is_really_empty_class): Add ignore_vptr parm. 603 (trivial_default_constructor_is_constexpr): Pass it. 604 * call.c (build_over_call): Pass it. 605 * constexpr.c (cxx_eval_constant_expression): Pass it instead of 606 checking TYPE_POLYMORPHIC_P. 607 (cxx_eval_component_reference, potential_constant_expression_1): 608 Pass it. 609 * cp-gimplify.c (simple_empty_class_p): Pass it. 610 * init.c (expand_aggr_init_1): Pass it. 611 6122019-03-04 Paolo Carlini <paolo.carlini@oracle.com> 613 614 PR c++/84605 615 * parser.c (cp_parser_class_head): Reject TYPE_BEING_DEFINED too. 616 6172019-03-04 Jakub Jelinek <jakub@redhat.com> 618 619 PR c++/71446 620 * call.c (field_in_pset): New function. 621 (build_aggr_conv): Handle CONSTRUCTOR_IS_DESIGNATED_INIT correctly. 622 6232019-03-02 Jakub Jelinek <jakub@redhat.com> 624 625 PR c++/71446 626 * cp-tree.h (CONSTRUCTOR_IS_DESIGNATED_INIT): Define. 627 * parser.c (cp_parser_braced_list): Adjust cp_parser_initializer_list 628 caller, set CONSTRUCTOR_IS_DESIGNATED_INIT. 629 (cp_parser_initializer_list): Add designated parameter, set *designated 630 to a bool whether any designators were parsed. 631 * decl.c (reshape_init): Copy over CONSTRUCTOR_IS_DESIGNATED_INIT if 632 needed. 633 * pt.c (tsubst_copy_and_build): Likewise. 634 * call.c (implicit_conversion): If CONSTRUCTOR_IS_DESIGNATED_INIT, 635 don't call build_list_conv, nor build_complex_conv, nor attempt to 636 convert a single element initializer to scalar. 637 6382019-03-01 Marek Polacek <polacek@redhat.com> 639 640 PR c++/89537 - missing location for error with non-static member fn. 641 * call.c (resolve_args): Use EXPR_LOCATION. 642 * typeck.c (build_class_member_access_expr): Use input_location. 643 644 PR c++/89532 - ICE with incomplete type in decltype. 645 * semantics.c (finish_compound_literal): Return error_mark_node 646 if digest_init_flags returns error_mark_node. 647 6482019-03-01 Jakub Jelinek <jakub@redhat.com> 649 650 Implement P1002R1, Try-catch blocks in constexpr functions 651 PR c++/89513 652 * parser.c (cp_parser_ctor_initializer_opt_and_function_body): 653 Diagnose constexpr ctor or function with function-try-block with 654 pedwarn for c++17 and earlier. Formatting fix. 655 (cp_parser_try_block): Use pedwarn instead of error and only for 656 c++17 and earlier when try block appears in constexpr function. 657 * constexpr.c (build_constexpr_constructor_member_initializers): 658 Handle TRY_BLOCK here instead of erroring on it. 659 6602019-02-28 Jason Merrill <jason@redhat.com> 661 662 PR c++/88183 - ICE with .* fold-expression. 663 * pt.c (fold_expression) [DOTSTAR_EXPR]: Remove special handling. 664 665 PR c++/86969 - ICE with constexpr if and recursive generic lambdas. 666 * class.c, lambda.c, pt.c: Revert earlier change. 667 * lambda.c (add_capture): Don't special-case capture of dependent 668 VLA. 669 670 * name-lookup.c (print_binding_level): Print this_entity. 671 6722019-02-27 Marek Polacek <polacek@redhat.com> 673 674 PR c++/88857 - ICE with value-initialization of argument in template. 675 * call.c (convert_like_real): Don't call build_value_init in template. 676 6772019-02-27 Jason Merrill <jason@redhat.com> 678 679 PR c++/86969 - ICE with constexpr if and recursive generic lambdas. 680 * semantics.c (process_outer_var_ref): Do capture dependent vars. 681 * class.c (finish_struct): Only add TAG_DEFN if T is in 682 current_function_decl. 683 * lambda.c (vla_capture_type): Force the capture type out into the 684 lambda's enclosing function. 685 (add_capture): Pass in the lambda. 686 * pt.c (tsubst_lambda_expr): complete_type a VLA capture type. 687 6882019-02-27 Marek Polacek <polacek@redhat.com> 689 690 PR c++/89511 - ICE with using-declaration and unscoped enumerator. 691 * parser.c (cp_parser_using_declaration): For an unscoped enum 692 only use its context if it's not a function declaration. 693 6942019-02-27 Paolo Carlini <paolo.carlini@oracle.com> 695 696 PR c++/89488 697 * method.c (process_subob_fn): When maybe_instantiate_noexcept 698 returns false don't call merge_exception_specifiers. 699 7002019-02-27 Paolo Carlini <paolo.carlini@oracle.com> 701 702 PR c++/88987 703 * parser.c (cp_parser_noexcept_specification_opt): Return NULL_TREE 704 for a non-constant parsed expression. 705 7062019-02-26 Jakub Jelinek <jakub@redhat.com> 707 708 PR c++/89481 709 * constexpr.c (cxx_eval_store_expression): When changing active union 710 member, set no_zero_init. 711 7122019-02-23 Marek Polacek <polacek@redhat.com> 713 714 PR c++/88294 - ICE with non-constant noexcept-specifier. 715 * pt.c (maybe_instantiate_noexcept): Set up the list of local 716 specializations. Set current_class_{ptr,ref}. 717 7182019-02-22 David Malcolm <dmalcolm@redhat.com> 719 720 PR c++/89390 721 * parser.c (cp_parser_unqualified_id): Capture and use locations 722 for destructors. 723 7242019-02-22 Marek Polacek <polacek@redhat.com> 725 726 PR c++/89420 - ICE with CAST_EXPR in explicit-specifier. 727 * decl.c (build_explicit_specifier): Don't check 728 processing_template_decl. Call instantiation_dependent_expression_p 729 instead of value_dependent_expression_p. Call 730 instantiate_non_dependent_expr_sfinae before 731 build_converted_constant_expr instead of calling 732 instantiate_non_dependent_expr after it. Add 733 processing_template_decl_sentinel. 734 7352019-02-22 Thomas Schwinge <thomas@codesourcery.com> 736 737 * parser.c (cp_parser_oacc_simple_clause): Remove parser formal 738 parameter, move loc formal parameter to the front. Adjust all 739 users. 740 (cp_parser_oacc_shape_clause): Add loc formal parameter. Adjust 741 all users. 742 7432019-02-21 Jason Merrill <jason@redhat.com> 744 745 PR c++/87685 - generic lambda 'this' capture error. 746 * lambda.c (lambda_expr_this_capture): Change add_capture_p to int. 747 (maybe_generic_this_capture): Pass -1. 748 749 PR c++/88394 - ICE with VLA init-capture. 750 * lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE. 751 752 PR c++/88869 - C++17 ICE with CTAD and explicit specialization. 753 * pt.c (do_class_deduction): Don't include explicit specialization 754 args in outer_args. 755 756 PR c++/89422 - ICE with -g and lambda in default arg in template. 757 * pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner. 758 7592019-02-21 Jason Merrill <jason@redhat.com> 760 761 PR c++/88419 - C++17 ICE with class template arg deduction. 762 * pt.c (make_template_placeholder): Set TYPE_CANONICAL after 763 CLASS_PLACEHOLDER_TEMPLATE. 764 7652019-02-21 Jakub Jelinek <jakub@redhat.com> 766 767 PR c++/89285 768 * constexpr.c (struct constexpr_fundef): Add parms and result members. 769 (retrieve_constexpr_fundef): Adjust for the above change. 770 (register_constexpr_fundef): Save constexpr body with copy_fn, 771 temporarily set DECL_CONTEXT on DECL_RESULT before that. 772 (get_fundef_copy): Change FUN argument to FUNDEF with 773 constexpr_fundef * type, grab body and parms/result out of 774 constexpr_fundef struct and temporarily change it for copy_fn calls 775 too. 776 (cxx_eval_builtin_function_call): For __builtin_FUNCTION temporarily 777 adjust current_function_decl from ctx->call context. Test 778 !potential_constant_expression instead of !is_constant_expression. 779 (cxx_bind_parameters_in_call): Grab parameters from new_call. Undo 780 convert_for_arg_passing changes for TREE_ADDRESSABLE type passing. 781 (cxx_eval_call_expression): Adjust get_fundef_copy caller. 782 (cxx_eval_conditional_expression): For IF_STMT, allow then or else 783 operands to be NULL. 784 (label_matches): Handle BREAK_STMT and CONTINUE_STMT. 785 (cxx_eval_loop_expr): Add support for FOR_STMT, WHILE_STMT and DO_STMT. 786 (cxx_eval_switch_expr): Add support for SWITCH_STMT. 787 (cxx_eval_constant_expression): Handle IF_STMT, FOR_STMT, WHILE_STMT, 788 DO_STMT, CONTINUE_STMT, SWITCH_STMT, BREAK_STMT and CONTINUE_STMT. 789 For SIZEOF_EXPR, recurse on the result of fold_sizeof_expr. Ignore 790 DECL_EXPR with USING_DECL operand. 791 * lambda.c (maybe_add_lambda_conv_op): Build thisarg using 792 build_int_cst to make it a valid constant expression. 793 7942019-02-20 Jason Merrill <jason@redhat.com> 795 796 PR c++/88690 - C++17 ICE with empty base in aggregate. 797 * typeck2.c (process_init_constructor_record): Skip trivial 798 initialization of an empty base. 799 8002019-02-21 Richard Biener <rguenther@suse.de> 801 802 PR middle-end/89392 803 * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not 804 make symtab process new functions here. 805 8062019-02-20 Jason Merrill <jason@redhat.com> 807 808 PR c++/87921 - wrong error with inline static data member. 809 * decl2.c (finish_static_data_member_decl): Don't set DECL_IN_AGGR_P 810 for a non-template inline variable. Do nothing for an 811 already-instantiated variable. 812 (c_parse_final_cleanups): Check DECL_IN_AGGR_P without 813 DECL_INLINE_VAR_P. 814 * decl.c (check_initializer): Likewise. 815 (make_rtl_for_nonlocal_decl): Likewise. 816 * pt.c (instantiate_decl): Likewise. 817 * typeck2.c (store_init_value): Likewise. 818 8192019-02-20 Jakub Jelinek <jakub@redhat.com> 820 821 PR c++/89403 822 * decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting 823 for flag_syntax_only from here... 824 * semantics.c (expand_or_defer_fn_1): ... here. 825 826 PR c++/89405 827 * decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and 828 DECL_COMMON, set DECL_INTERFACE_KNOWN. 829 830 PR c++/89336 831 * constexpr.c (cxx_eval_store_expression): Diagnose changing of active 832 union member for -std=c++17 and earlier. 833 8342019-02-19 Jason Merrill <jason@redhat.com> 835 836 PR c++/87513 - 'sorry' mangling PMF template-id. 837 * mangle.c (write_expression): Handle SCOPE_REF to BASELINK. 838 8392019-02-19 Jason Merrill <jason@redhat.com> 840 841 PR c++/88380 - wrong-code with flexible array and NSDMI. 842 * typeck2.c (process_init_constructor_record): Skip flexarrays. 843 8442019-02-20 will wray <wjwray@gmail.com> 845 846 PR c++/88572 - wrong handling of braces on scalar init. 847 * decl.c (reshape_init_r): Allow braces around scalar initializer 848 within aggregate init. Reject double braced-init of scalar 849 variable. 850 8512019-02-20 Paolo Carlini <paolo.carlini@oracle.com> 852 853 PR c++/84536 854 * pt.c (tsubst_init): Diagnose an initializer expanding to an 855 empty list of expressions; tweak wrt dependent types. 856 (regenerate_decl_from_template): For VAR_DECLs call tsubst_init 857 instead of tsubst_expr. 858 8592019-02-19 Jason Merrill <jason@redhat.com> 860 861 PR c++/88368 - wrong 'use of deleted function' 862 * method.c (walk_field_subobs): Remember errors from get_nsdmi. 863 (get_defaulted_eh_spec): Call push_tinst_level. 864 * pt.c (maybe_instantiate_noexcept): Keep error_mark_node. 865 * typeck2.c (merge_exception_specifiers): Handle error_mark_node. 866 8672019-02-19 Chung-Lin Tang <cltang@codesourcery.com> 868 869 PR c/87924 870 * parser.c (cp_parser_oacc_clause_wait): Add representation of wait 871 clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments. 872 8732019-02-19 Jakub Jelinek <jakub@redhat.com> 874 875 PR c++/89387 876 * lambda.c (maybe_generic_this_capture): Don't check 877 DECL_NONSTATIC_MEMBER_FUNCTION_P on USING_DECLs. 878 879 PR c++/89391 880 * typeck.c (build_reinterpret_cast_1): Don't handle void to 881 && conversion go through build_target_expr_with_type. 882 883 PR c++/89390 884 * error.c (qualified_name_lookup_error): Only call 885 suggest_alternative_in_scoped_enum if name is IDENTIFIER_NODE. 886 8872019-02-19 Tom Honermann <tom@honermann.net> 888 889 * name-lookup.c (get_std_name_hint): Added u8string as a name hint. 890 8912019-02-18 Jason Merrill <jason@redhat.com> 892 893 PR c++/89336 - multiple stores in constexpr stmt. 894 * constexpr.c (cxx_eval_store_expression): Preevaluate scalar or 895 assigned value. 896 897 * pt.c (check_explicit_specialization): If the declarator is a 898 template-id, only check whether the arguments are dependent. 899 900 Improve duplicate [[likely]] diagnostic. 901 * parser.c (cp_parser_statement): Make attrs_loc a range. Pass it 902 to process_stmt_hotness_attribute. 903 * cp-gimplify.c (process_stmt_hotness_attribute): Take attrs_loc. 904 (genericize_if_stmt): Use likely/unlikely instead of predictor_name. 905 9062019-02-17 Marek Polacek <polacek@redhat.com> 907 908 PR c++/89217 - ICE with list-initialization in range-based for loop. 909 * constexpr.c (unshare_constructor): No longer static. 910 * cp-tree.h (unshare_constructor): Declare. 911 * semantics.c (finish_compound_literal): When dealing with a 912 non-dependent expression in a template, return the original 913 expression. Pass LOOKUP_NO_NARROWING to digest_init_flags. 914 9152019-02-13 Marek Polacek <polacek@redhat.com> 916 917 PR c++/89297 - ICE with OVERLOAD in template. 918 * semantics.c (finish_compound_literal): Call 919 instantiate_non_dependent_expr_sfinae. 920 9212019-02-13 Alexandre Oliva <aoliva@redhat.com> 922 923 PR c++/86379 924 * cp-tree.h (USING_DECL_SCOPE): Use result rather than type. 925 * name-lookup.c (strip_using_decl): Use USING_DECL_SCOPE. 926 * search.c (protected_accessible_p): Follow USING_DECL_DECLS. 927 (shared_member_p): Likewise. 928 (lookup_member): Likewise. 929 * decl.c (grok_special_member_properties): Skip USING_DECLs. 930 * semantics.c (finish_omp_declare_simd_methods): Likewise. 931 (finish_qualified_id_expr): Do not call shared_member_p with 932 a dependent expr. 933 934 PR c++/87322 935 * pt.c (tsubst_lambda_expr): Avoid duplicate tsubsting. 936 Move cp_evaluated resetting before signature tsubsting. 937 (gen_elem_of_pack_expansion_instantiation): Separate local 938 specializations per index. 939 9402019-02-13 David Malcolm <dmalcolm@redhat.com> 941 942 PR c++/89036 943 * class.c (add_method): Drop destructor assertion. 944 9452019-02-13 Paolo Carlini <paolo.carlini@oracle.com> 946 947 PR c++/88986 948 * decl.c (make_typename_type): Allow for TYPE_PACK_EXPANSION as 949 context (the first argument). 950 * pt.c (tsubst, case TYPENAME_TYPE): Handle TYPE_PACK_EXPANSION 951 as context. 952 9532019-02-12 Jason Merrill <jason@redhat.com> 954 955 PR c++/89144 - link error with constexpr initializer_list. 956 * call.c (convert_like_real) [ck_list]: Don't allocate a temporary 957 array for an empty list. 958 * typeck2.c (store_init_value): Don't use cxx_constant_init in a 959 template. 960 9612019-02-11 Jason Merrill <jason@redhat.com> 962 963 PR c++/89241 - ICE with __func__ in lambda in template. 964 * pt.c (enclosing_instantiation_of): Also check 965 instantiated_lambda_fn_p for the template context. 966 9672019-02-11 Marek Polacek <polacek@redhat.com> 968 969 PR c++/89212 - ICE converting nullptr to pointer-to-member-function. 970 * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Return early for 971 null member pointer value. 972 9732019-02-11 Jakub Jelinek <jakub@redhat.com> 974 975 PR c++/88977 976 * pt.c (convert_nontype_argument): Pass true as manifestly_const_eval 977 to maybe_constant_value calls. 978 9792019-02-11 Marek Polacek <polacek@redhat.com> 980 981 * typeck2.c (digest_init_r): Remove commented code. 982 9832019-02-11 Martin Sebor <msebor@redhat.com> 984 985 PR c++/87996 986 * decl.c (compute_array_index_type_loc): Preserve signed sizes 987 for diagnostics. Call valid_array_size_p instead of error. 988 * init.c (build_new_1): Compute size for diagnostic. Call 989 invalid_array_size_error 990 (build_new): Call valid_array_size_p instead of error. 991 9922019-02-07 Alexandre Oliva <aoliva@redhat.com> 993 994 PR c++/86218 995 * call.c (compare_ics): Deal with ck_aggr in either cs. 996 9972019-02-06 David Malcolm <dmalcolm@redhat.com> 998 999 PR c++/71302 1000 * call.c (get_location_for_expr_unwinding_for_system_header): New 1001 function. 1002 (conversion_null_warnings): Use it when getting locations for 1003 EXPR, effectively adding a call to 1004 get_location_for_expr_unwinding_for_system_header for 1005 -Wconversion-null and making use of EXPR_LOCATION for 1006 -Wzero-as-null-pointer-constant. 1007 10082019-02-05 Jakub Jelinek <jakub@redhat.com> 1009 1010 PR c++/89187 1011 * optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on 1012 PARM_DECLs of the thunk. 1013 * lambda.c (maybe_add_lambda_conv_op): Likewise. 1014 10152019-02-05 Marek Polacek <polacek@redhat.com> 1016 1017 PR c++/89158 - by-value capture of constexpr variable broken. 1018 * call.c (convert_like_real) <case ck_user>: Call mark_exp_read 1019 instead of mark_rvalue_use. 1020 10212019-02-05 Alexandre Oliva <aoliva@redhat.com> 1022 1023 PR c++/87770 1024 * pt.c (instantiates_primary_template_p): New. 1025 (type_dependent_expression_p): Use it. 1026 10272019-02-01 Jason Merrill <jason@redhat.com> 1028 1029 PR c++/88761 - ICE with reference capture of constant. 1030 * lambda.c (mark_const_cap_r): Do walk subtrees of DECL_EXPR for 1031 non-proxy decls. 1032 10332019-02-01 Marek Polacek <polacek@redhat.com> 1034 1035 PR c++/88325 - ICE with invalid out-of-line template member definition. 1036 * parser.c (cp_parser_class_name): Don't call make_typename_type 1037 for overloads. 1038 10392019-02-01 Jakub Jelinek <jakub@redhat.com> 1040 1041 PR c++/87175 1042 * parser.c (cp_parser_gnu_attributes_opt): Set ok to false 1043 if require_open failed. 1044 10452019-01-31 Marek Polacek <polacek@redhat.com> 1046 1047 PR c++/89083, c++/80864 - ICE with list initialization in template. 1048 * constexpr.c (adjust_temp_type): Use copy_node and change the type 1049 instead of using build_constructor. 1050 * decl.c (reshape_init_r): Don't reshape a digested initializer. 1051 Return the initializer for COMPOUND_LITERAL_P. 1052 1053 PR c++/88983 - ICE with switch in constexpr function. 1054 * constexpr.c (cxx_eval_switch_expr): Use SWITCH_COND and SWITCH_BODY. 1055 (cxx_eval_constant_expression) <case COND_EXPR>: Don't look for the 1056 label in the else branch if we found it in the then branch. 1057 10582019-01-30 Jason Merrill <jason@redhat.com> 1059 1060 PR c++/88752 - ICE with lambda and constexpr if. 1061 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New. 1062 * pt.c (tsubst_lambda_expr): Set it. 1063 (instantiated_lambda_fn_p): Check it. 1064 (enclosing_instantiation_of): Use it. 1065 10662019-01-31 Jakub Jelinek <jakub@redhat.com> 1067 1068 PR libstdc++/88170 1069 * cxx-pretty-print.c (pp_cxx_enumeration_constant): Print always as 1070 a C cast in pp_c_flag_gnu_v3 mode. 1071 10722019-01-30 Jakub Jelinek <jakub@redhat.com> 1073 1074 PR c++/88988 1075 * lambda.c (is_capture_proxy): Don't return true for 1076 DECL_OMP_PRIVATIZED_MEMBER artificial vars. 1077 10782019-01-30 Marek Polacek <polacek@redhat.com> 1079 1080 PR c++/89119 - ICE with value-initialization in template. 1081 * pt.c (tsubst_copy_and_build): Handle RANGE_EXPR. 1082 10832019-01-29 Jason Merrill <jason@redhat.com> 1084 1085 PR c++/86943 - wrong code converting lambda to function pointer. 1086 * lambda.c (maybe_add_lambda_conv_op): Use a template-id in the 1087 call. Only forward parms for decltype. 1088 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Handle CALL_FROM_THUNK_P 1089 specially. 1090 * typeck.c (check_return_expr): Don't mess with a thunk call. 1091 10922019-01-28 Jason Merrill <jason@redhat.com> 1093 1094 PR c++/89089 - ICE with [[no_unique_address]]. 1095 PR c++/88865 - wrong layout with [[no_unique_address]]. 1096 * class.c (check_field_decls): A potentially-overlapping field makes 1097 the class non-layout-POD, but not non-empty. 1098 (end_of_class): Always consider empty data members. 1099 (layout_class_type): Set DECL_SIZE for empty fields. 1100 11012019-01-28 Marek Polacek <polacek@redhat.com> 1102 1103 PR c++/88358 - name wrongly treated as type. 1104 * parser.c (cp_parser_direct_declarator): Don't assume a qualified-id 1105 in parameter-list is a type if the function's declarator-id is not 1106 qualified. 1107 11082019-01-27 Marek Polacek <polacek@redhat.com> 1109 1110 PR c++/88815 - narrowing conversion lost in decltype. 1111 PR c++/78244 - narrowing conversion in template not detected. 1112 * cp-tree.h (CONSTRUCTOR_IS_DEPENDENT): New. 1113 * pt.c (instantiation_dependent_r): Consider a CONSTRUCTOR with 1114 CONSTRUCTOR_IS_DEPENDENT instantiation-dependent. 1115 * semantics.c (finish_compound_literal): When the compound literal 1116 isn't instantiation-dependent and the type isn't type-dependent, 1117 fall back to the normal processing. Set CONSTRUCTOR_IS_DEPENDENT. 1118 1119 PR c++/89024 - ICE with incomplete enum type. 1120 * call.c (standard_conversion): When converting an 1121 ARITHMETIC_TYPE_P to an incomplete type, return NULL. 1122 11232019-01-25 Paolo Carlini <paolo.carlini@oracle.com> 1124 1125 PR c++/88969 1126 * call.c (build_op_delete_call): Implement 7.6.2.5/(10.1). 1127 * decl2.c (coerce_delete_type): Use build_pointer_type instead 1128 of TYPE_POINTER_TO. 1129 11302019-01-24 Jason Merrill <jason@redhat.com> 1131 1132 PR c++/89001 - mangling of reference temporaries 1133 * cp-tree.h (struct saved_scope): Add ref_temp_count. 1134 (current_ref_temp_count): New macro. 1135 * mangle.c (mangle_ref_init_variable): Use it. 1136 * typeck2.c (store_init_value): Clear it. 1137 * call.c (make_temporary_var_for_ref_to_temp): Copy public and 1138 comdat. 1139 11402019-01-24 Jakub Jelinek <jakub@redhat.com> 1141 1142 PR c++/88976 1143 * semantics.c (finish_omp_cancel): Diagnose more than one if 1144 on #pragma omp cancel with different modifiers. Use 1145 maybe_convert_cond when not in template or build_x_binary_op 1146 otherwise. 1147 11482019-01-23 Marek Polacek <polacek@redhat.com> 1149 1150 PR c++/88757 - qualified name treated wrongly as type. 1151 * parser.c (cp_parser_direct_declarator): Don't treat qualified-ids 1152 in parameter-list as types if name lookup for declarator-id didn't 1153 find one or more function templates. 1154 11552019-01-23 Jakub Jelinek <jakub@redhat.com> 1156 1157 PR c/44715 1158 * cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only 1159 after genericizing cond and incr expressions. 1160 1161 PR c++/88984 1162 * cp-gimplify.c (genericize_switch_stmt): Move cond genericization 1163 before the begin_bc_block call. 1164 11652019-01-21 Jason Merrill <jason@redhat.com> 1166 1167 PR c++/87893 - constexpr ctor ICE on ARM. 1168 PR c++/88293 - ICE with comma expression. 1169 * constexpr.c (initialized_type): Don't shortcut non-void type. 1170 Handle COMPOUND_EXPR. 1171 (cxx_eval_outermost_constant_expr): Return early for void type. 1172 11732019-01-21 Jakub Jelinek <jakub@redhat.com> 1174 1175 PR c++/88949 1176 * optimize.c (cxx_copy_decl): New function. 1177 (clone_body): Use it instead of copy_decl_no_change. 1178 1179 PR sanitizer/88901 1180 * typeck.c (cp_build_binary_op): Don't instrument 1181 SANITIZE_POINTER_COMPARE if processing_template_decl. 1182 (pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT. 1183 11842019-01-18 Jason Merrill <jason@redhat.com> 1185 1186 PR c++/88875 - error with explicit list constructor. 1187 * call.c (reference_binding): Don't modify EXPR. Set 1188 need_temporary_p on the ck_user conversion for a temporary. 1189 (convert_like_real): Check it. 1190 11912019-01-18 H.J. Lu <hongjiu.lu@intel.com> 1192 1193 PR c/51628 1194 PR c/88664 1195 * call.c (convert_for_arg_passing): Upate the 1196 warn_for_address_or_pointer_of_packed_member call. 1197 * typeck.c (convert_for_assignment): Likewise. 1198 11992019-01-17 Jason Merrill <jason@redhat.com> 1200 1201 PR c++/86205 - ICE with ?: of throw and template-id. 1202 * pt.c (resolve_nondeduced_context_or_error): Split out from... 1203 * typeck.c (decay_conversion): ...here. 1204 * call.c (build_conditional_expr_1): Use it. 1205 1206 PR c++/86740, ICE with constexpr if and nested generic lambdas. 1207 * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR. 1208 12092019-01-17 Paolo Carlini <paolo.carlini@oracle.com> 1210 1211 * decl.c (grokdeclarator): Use typespec_loc in error messages 1212 about 'auto' and trailing return type. 1213 12142019-01-17 David Malcolm <dmalcolm@redhat.com> 1215 1216 PR c++/88699 1217 * class.c (add_method): Don't use DECL_DESTRUCTOR_P on 1218 USING_DECLs. 1219 12202019-01-17 Nathan Sidwell <nathan@acm.org> 1221 1222 PR c++/86610 1223 * semantics.c (process_outer_var_ref): Only skip dependent types 1224 in templates. 1225 12262019-01-17 Alexandre Oliva <aoliva@redhat.com> 1227 1228 PR c++/87768 1229 * cp-tree.h (saved_scope): Add suppress_location_wrappers. 1230 * name-lookup.c (do_push_to_top_level): Save and reset it. 1231 (do_pop_from_top_level): Restore it. 1232 1233 PR c++/86648 1234 * pt.c (make_template_placeholder): Use auto_identifier. 1235 (is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test. 1236 * error.c (dump_type): Handle template placeholders. 1237 * cxx-pretty-print.c (pp_cx_unqualified_id): Likewise. 1238 1239 PR c++/88146 1240 * cvt.c (convert_to_void): Handle all cdtor calls as if 1241 returning void. 1242 12432019-01-16 Paolo Carlini <paolo.carlini@oracle.com> 1244 1245 * decl.c (grokdeclarator): Use locations[ds_storage_class] in 1246 error messages about ill-formed uses of mutable. 1247 12482019-01-16 Marek Polacek <polacek@redhat.com> 1249 1250 PR c++/78244 - narrowing conversion in template not detected. 1251 * call.c (perform_implicit_conversion_flags): Set 1252 IMPLICIT_CONV_EXPR_BRACED_INIT. 1253 * cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New. 1254 * pt.c (tsubst_copy_and_build): Use it. 1255 12562019-01-15 David Malcolm <dmalcolm@redhat.com> 1257 1258 PR c++/88795 1259 * pt.c (build_deduction_guide): Bail out if tsubst_arg_types 1260 fails. 1261 12622019-01-15 Paolo Carlini <paolo.carlini@oracle.com> 1263 1264 * decl.c (start_decl): Improve error location. 1265 * decl2.c (grokfield): Likewise. 1266 12672019-01-15 Paolo Carlini <paolo.carlini@oracle.com> 1268 1269 * decl.c (grokdeclarator): Move further up the location_t loc 1270 declaration and use the location when building a TYPE_DECL for 1271 a typedef name. 1272 * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error 1273 about an ill-formed bit-field as typedef. 1274 12752019-01-14 Marek Polacek <polacek@redhat.com> 1276 1277 PR c++/88830 - ICE with abstract class. 1278 * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR. 1279 Fix formatting. 1280 1281 PR c++/88825 - ICE with bogus function return type deduction. 1282 * typeck.c (can_do_nrvo_p): Check error_mark_node. 1283 12842019-01-14 Tom Honermann <tom@honermann.net> 1285 1286 Implement P0482R5, char8_t: A type for UTF-8 characters and strings 1287 * cvt.c (type_promotes_to): Handle char8_t promotion. 1288 * decl.c (grokdeclarator): Handle invalid type specifier 1289 combinations involving char8_t. 1290 * lex.c (init_reswords): Add char8_t as a reserved word. 1291 * mangle.c (write_builtin_type): Add name mangling for char8_t (Du). 1292 * parser.c (cp_keyword_starts_decl_specifier_p) 1293 (cp_parser_simple_type_specifier): Recognize char8_t as a simple 1294 type specifier. 1295 (cp_parser_string_literal): Use char8_array_type_node for the type 1296 of CPP_UTF8STRING. 1297 (cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system 1298 headers. 1299 * rtti.c (emit_support_tinfos): type_info support for char8_t. 1300 * tree.c (char_type_p): Recognize char8_t as a character type. 1301 * typeck.c (string_conv_p): Handle conversions of u8 string 1302 literals of char8_t type. 1303 (check_literal_operator_args): Handle UDLs with u8 string literals 1304 of char8_t type. 1305 * typeck2.c (ordinary_char_type_p): New. 1306 (digest_init_r): Disallow initializing a char array with a u8 string 1307 literal. 1308 13092019-01-14 Martin Liska <mliska@suse.cz> 1310 1311 PR gcov-profile/88263 1312 * decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION 1313 as location of the TLS wrapper. 1314 13152019-01-12 Paolo Carlini <paolo.carlini@oracle.com> 1316 1317 * decl.c (cp_finish_decl): Improve error location. 1318 * decl2.c (grokfield): Likewise, improve two locations. 1319 13202019-01-11 Marek Polacek <polacek@redhat.com> 1321 1322 PR c++/88692, c++/87882 - -Wredundant-move false positive with *this. 1323 * typeck.c (maybe_warn_pessimizing_move): Return if ARG isn't 1324 ADDR_EXPR. 1325 13262019-01-11 Jason Merrill <jason@redhat.com> 1327 1328 PR c++/88312 - pack expansion of decltype. 1329 * pt.c (instantiation_dependent_r): A template non-type parameter 1330 pack is instantiation-dependent. 1331 13322019-01-11 Jason Merrill <jason@redhat.com> 1333 1334 PR c++/88613 - ICE with use of const var in lambda. 1335 * expr.c (mark_use): Fix location wrapper handling. 1336 * cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use. 1337 13382019-01-11 Tobias Burnus <burnus@net-b.de> 1339 1340 PR C++/88114 1341 * decl2.c (maybe_emit_vtables): If needed, generate code for 1342 the destructor of an abstract class. 1343 (mark_used): Update comment for older function-name change. 1344 13452019-01-11 Paolo Carlini <paolo.carlini@oracle.com> 1346 1347 * decl.c (start_decl): Improve error location. 1348 (grokdeclarator): Likewise, improve two locations. 1349 13502019-01-09 Sandra Loosemore <sandra@codesourcery.com> 1351 1352 PR other/16615 1353 1354 * cp-tree.h: Mechanically replace "can not" with "cannot". 1355 * parser.c: Likewise. 1356 * pt.c: Likewise. 1357 13582019-01-08 Paolo Carlini <paolo.carlini@oracle.com> 1359 1360 * decl.c (grok_reference_init): Improve error location. 1361 (grokdeclarator): Likewise, improve two locations. 1362 13632019-01-08 Marek Polacek <polacek@redhat.com> 1364 1365 PR c++/88538 - braced-init-list in template-argument-list. 1366 * parser.c (cp_parser_template_argument): Handle braced-init-list when 1367 in C++20. 1368 1369 PR c++/88548 - this accepted in static member functions. 1370 * parser.c (cp_debug_parser): Adjust printing of 1371 local_variables_forbidden_p. 1372 (cp_parser_new): Set local_variables_forbidden_p to 0 rather than false. 1373 (cp_parser_primary_expression): When checking 1374 local_variables_forbidden_p, use THIS_FORBIDDEN or 1375 LOCAL_VARS_FORBIDDEN. 1376 (cp_parser_lambda_body): Update the type of 1377 local_variables_forbidden_p. Set it to 0 rather than false. 1378 (cp_parser_condition): Adjust call to cp_parser_declarator. 1379 (cp_parser_explicit_instantiation): Likewise. 1380 (cp_parser_init_declarator): Likewise. 1381 (cp_parser_declarator): New parameter. Use it. 1382 (cp_parser_direct_declarator): New parameter. Use it to set 1383 local_variables_forbidden_p. Adjust call to cp_parser_declarator. 1384 (cp_parser_type_id_1): Adjust call to cp_parser_declarator. 1385 (cp_parser_parameter_declaration): Likewise. 1386 (cp_parser_default_argument): Update the type of 1387 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN 1388 rather than true. 1389 (cp_parser_member_declaration): Tell cp_parser_declarator if we saw 1390 'static' or 'friend'. 1391 (cp_parser_exception_declaration): Adjust call to cp_parser_declarator. 1392 (cp_parser_late_parsing_default_args): Update the type of 1393 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN 1394 rather than true. 1395 (cp_parser_cache_defarg): Adjust call to cp_parser_declarator. 1396 (cp_parser_objc_class_ivars): Likewise. 1397 (cp_parser_objc_struct_declaration): Likewise. 1398 (cp_parser_omp_for_loop_init): Likewise. 1399 * parser.h (cp_parser): Change the type of local_variables_forbidden_p 1400 to unsigned char. 1401 (LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN): 1402 Define. 1403 14042019-01-08 Paolo Carlini <paolo.carlini@oracle.com> 1405 1406 * decl.c (start_decl): Improve permerror location. 1407 14082019-01-08 Jonathan Wakely <jwakely@redhat.com> 1409 Jakub Jelinek <jakub@redhat.com> 1410 1411 PR c++/88554 1412 * decl.c (finish_function): For -Wreturn-type don't add a return *this; 1413 fixit hint if current_class_ref is NULL. Use a single if instead of 1414 two nested ones. 1415 14162019-01-07 Paolo Carlini <paolo.carlini@oracle.com> 1417 1418 * decl.c (start_decl): Improve two error_at locations. 1419 (expand_static_init): Likewise. 1420 14212019-01-07 Marek Polacek <polacek@redhat.com> 1422 1423 PR c++/88741 - wrong error with initializer-string. 1424 * decl.c (cp_complete_array_type): Strip any location wrappers. 1425 14262019-01-07 Bernd Edlinger <bernd.edlinger@hotmail.de> 1427 1428 PR c++/88261 1429 PR c++/69338 1430 PR c++/69696 1431 PR c++/69697 1432 * cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value. 1433 * typeck2.c (digest_init_r): Raise an error for non-static 1434 initialization of a flexible array member. 1435 (process_init_constructor, massage_init_elt, 1436 process_init_constructor_array, process_init_constructor_record, 1437 process_init_constructor_union, process_init_constructor): Add the 1438 flags parameter and pass it thru. 1439 (store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to 1440 digest_init_flags for static decls. 1441 14422019-01-07 Jakub Jelinek <jakub@redhat.com> 1443 1444 PR c++/85052 1445 * cp-tree.h (cp_build_vec_convert): Declare. 1446 * parser.c (cp_parser_postfix_expression): Parse 1447 __builtin_convertvector. 1448 * constexpr.c: Include fold-const-call.h. 1449 (cxx_eval_internal_function): Handle IFN_VEC_CONVERT. 1450 (potential_constant_expression_1): Likewise. 1451 * semantics.c (cp_build_vec_convert): New function. 1452 * pt.c (tsubst_copy_and_build): Handle CALL_EXPR to 1453 IFN_VEC_CONVERT. 1454 14552019-01-03 Jakub Jelinek <jakub@redhat.com> 1456 1457 PR c++/88636 1458 * decl.c (builtin_function_1): Return result of pushdecl_top_level 1459 or pushdecl rather than decl. 1460 14612019-01-03 Paolo Carlini <paolo.carlini@oracle.com> 1462 1463 * tree.c (handle_nodiscard_attribute): Improve warning location. 1464 14652019-01-02 Marek Polacek <polacek@redhat.com> 1466 1467 PR c++/88612 - ICE with -Waddress-of-packed-member. 1468 * call.c (convert_for_arg_passing): Only give warnings with tf_warning. 1469 * typeck.c (convert_for_assignment): Likewise. 1470 1471 PR c++/88631 - CTAD failing for value-initialization. 1472 * typeck2.c (build_functional_cast): Try deducing the template 1473 arguments even if there are no arguments to deduce from. 1474 14752019-01-01 Jakub Jelinek <jakub@redhat.com> 1476 1477 Update copyright years. 1478 1479Copyright (C) 2019 Free Software Foundation, Inc. 1480 1481Copying and distribution of this file, with or without modification, 1482are permitted in any medium without royalty provided the copyright 1483notice and this notice are preserved. 1484