12020-03-04 Release Manager 2 3 * GCC 8.4.0 released. 4 52020-02-26 Jakub Jelinek <jakub@redhat.com> 6 7 PR c++/93905 8 Backported from mainline 9 2018-11-04 Jason Merrill <jason@redhat.com> 10 11 * constexpr.c (cxx_eval_outermost_constant_expr): Don't wrap a 12 CONSTRUCTOR if one was passed in. 13 142020-02-26 Marek Polacek <polacek@redhat.com> 15 16 PR c++/90998 - ICE with copy elision in init by ctor and -Wconversion. 17 * call.c (joust): Don't attempt to warn if ->second_conv is null. 18 192020-02-26 Jason Merrill <jason@redhat.com> 20 21 PR c++/86521 - C++17 copy elision in initialization by constructor. 22 * call.c (joust_maybe_elide_copy): New. 23 (joust): Call it. 24 252020-02-26 Jason Merrill <jason@redhat.com> 26 27 PR c++/90546 28 * call.c (build_user_type_conversion_1): Allow a template conversion 29 returning an rvalue reference to bind directly to an lvalue. 30 312020-02-26 Jason Merrill <jason@redhat.com> 32 33 PR c++/86521 - wrong overload resolution with ref-qualifiers. 34 * call.c (build_user_type_conversion_1): Don't use a conversion to a 35 reference of the wrong rvalueness for direct binding. 36 372020-02-25 Jason Merrill <jason@redhat.com> 38 39 PR c++/89831 - error with qualified-id in const member function. 40 * semantics.c (finish_non_static_data_member): Use object cv-quals 41 in scoped case, too. 42 432020-02-25 Jason Merrill <jason@redhat.com> 44 45 PR c++/88380 - wrong-code with flexible array and NSDMI. 46 * typeck2.c (process_init_constructor_record): Skip flexarrays. 47 482020-02-25 Jason Merrill <jason@redhat.com> 49 50 PR c++/87685 - generic lambda 'this' capture error. 51 * lambda.c (lambda_expr_this_capture): Change add_capture_p to int. 52 (maybe_generic_this_capture): Pass -1. 53 542020-02-25 Jason Merrill <jason@redhat.com> 55 56 PR c++/87554 - ICE with extern template and reference member. 57 * decl.c (cp_finish_decl): Don't set DECL_INITIAL of external vars. 58 592020-02-25 Alexandre Oliva <aoliva@redhat.com> 60 61 PR c++/86747 62 * pt.c (tsubst_friend_class): Enter tsubsted class context. 63 642020-02-25 Jason Merrill <jason@redhat.com> 65 66 PR c++/86429 - constexpr variable in lambda. 67 PR c++/82643 68 PR c++/87327 69 * constexpr.c (cxx_eval_constant_expression): In a lambda function, 70 try evaluating the captured variable directly. 71 722020-02-25 Jason Merrill <jason@redhat.com> 73 74 * cp-tree.h (TYPE_REF_P): New. 75 762020-02-25 Jason Merrill <jason@redhat.com> 77 78 PR c++/87748 - substitution failure error with decltype. 79 * pt.c (most_specialized_partial_spec): Clear 80 processing_template_decl. 81 822020-02-25 Jason Merrill <jason@redhat.com> 83 84 PR c++/87480 - decltype of member access in default template arg 85 * pt.c (type_unification_real): Accept a dependent result in 86 template context. 87 882020-02-25 Jason Merrill <jason@redhat.com> 89 90 PR c++/88394 - ICE with VLA init-capture. 91 * lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE. 92 932019-02-05 Alexandre Oliva <aoliva@redhat.com> 94 95 PR c++/87770 96 * pt.c (instantiates_primary_template_p): New. 97 (type_dependent_expression_p): Use it. 98 992020-02-25 Marek Polacek <polacek@redhat.com> 100 101 PR c++/92745 - bogus error when initializing array of vectors. 102 * decl.c (reshape_init_r): For a nested compound literal, do 103 call reshape_init_{class,array,vector}. 104 1052020-02-25 Jason Merrill <jason@redhat.com> 106 107 PR c++/89917 - ICE with lambda in variadic mem-init. 108 * pt.c (make_pack_expansion): Change type_pack_expansion_p to false. 109 1102020-02-24 Jason Merrill <jason@redhat.com> 111 112 PR c++/90951 113 * constexpr.c (cxx_eval_array_reference): {}-initialize missing 114 elements instead of value-initializing them. 115 1162020-02-24 Jason Merrill <jason@redhat.com> 117 118 PR c++/93140 119 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in 120 handling of TREE_CHAIN for empty pack. 121 1222020-02-24 Jason Merrill <jason@redhat.com> 123 124 PR c++/92852 125 * constexpr.c (maybe_constant_value): Don't unshare if the cached 126 value is the same as the argument. 127 1282020-02-14 Jakub Jelinek <jakub@redhat.com> 129 130 PR c++/61414 131 * class.c (enum_min_precision): Change prec type from int to int &. 132 1332020-02-14 Jakub Jelinek <jakub@redhat.com> 134 135 Backported from mainline 136 2020-01-17 Jakub Jelinek <jakub@redhat.com> 137 138 PR c++/93228 139 * parser.c (cp_parser_template_name): Look up deprecated attribute 140 in DECL_TEMPLATE_RESULT or its type's attributes. 141 142 2019-12-26 Jakub Jelinek <jakub@redhat.com> 143 144 PR c++/92438 145 * parser.c (cp_parser_constructor_declarator_p): If open paren 146 is followed by RID_ATTRIBUTE, skip over the attribute tokens and 147 try to parse type specifier. 148 149 2019-12-20 Jakub Jelinek <jakub@redhat.com> 150 151 PR c++/92992 152 * call.c (convert_arg_to_ellipsis): For decltype(nullptr) arguments 153 that have side-effects use cp_build_compound_expr. 154 155 2019-12-03 Jakub Jelinek <jakub@redhat.com> 156 157 PR c++/92732 158 * typeck2.c (digest_nsdmi_init): For bitfields, use 159 DECL_BIT_FIELD_TYPE instead of TREE_TYPE. 160 161 2019-11-29 Jakub Jelinek <jakub@redhat.com> 162 163 PR c++/60228 164 * parser.c (cp_parser_omp_declare_reduction_exprs): If 165 processing_template_decl, wrap the combiner or initializer 166 into EXPR_STMT. 167 * decl.c (start_preparsed_function): Don't start a lambda scope 168 for DECL_OMP_DECLARE_REDUCTION_P functions. 169 (finish_function): Don't finish a lambda scope for 170 DECL_OMP_DECLARE_REDUCTION_P functions, nor cp_fold_function 171 them nor cp_genericize them. 172 * mangle.c (decl_mangling_context): Look through 173 DECL_OMP_DECLARE_REDUCTION_P functions. 174 * semantics.c (expand_or_defer_fn_1): For DECL_OMP_DECLARE_REDUCTION_P 175 functions, use tentative linkage, don't keep their bodies with 176 -fkeep-inline-functions and return false at the end. 177 178 2019-11-27 Jakub Jelinek <jakub@redhat.com> 179 180 PR c++/92524 181 * tree.c (replace_placeholders_r): Don't walk constructor elts with 182 RANGE_EXPR indexes. 183 184 2019-11-26 Jakub Jelinek <jakub@redhat.com> 185 186 PR c++/92648 187 * parser.c (cp_parser_std_attribute): For unknown attributes, 188 skip balanced token seq instead of trying to parse 189 attribute-argument-clause as expression list. 190 191 PR c++/61414 192 * class.c (enum_to_min_precision): New hash_map. 193 (enum_min_precision): New function. 194 (check_bitfield_decl): Use it. 195 196 2019-11-21 Jakub Jelinek <jakub@redhat.com> 197 Jason Merrill <jason@redhat.com> 198 199 PR c++/90842 200 * parser.c (cp_parser_decl_specifier_seq): For concept or typedef 201 break early if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR. 202 For type specifiers, set CP_PARSER_FLAGS_NO_TYPE_DEFINITIONS 203 if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR is set. 204 2052020-01-27 Nathan Sidwell <nathan@acm.org> 206 207 PR c++/91826 208 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias. 209 2102020-01-24 Jason Merrill <jason@redhat.com> 211 212 PR c++/92852 - ICE with generic lambda and reference var. 213 * constexpr.c (maybe_constant_value): Likewise. 214 2152019-12-11 Jason Merrill <jason@redhat.com> 216 217 PR c++/92859 - ADL and bit-field. 218 * name-lookup.c: Use unlowered_expr_type. 219 2202019-11-21 Jakub Jelinek <jakub@redhat.com> 221 222 Backported from mainline 223 2019-10-22 Jakub Jelinek <jakub@redhat.com> 224 225 PR tree-optimization/85887 226 * decl.c (expand_static_init): Drop ECF_LEAF from __cxa_guard_acquire 227 and __cxa_guard_release. 228 229 2019-10-29 Jakub Jelinek <jakub@redhat.com> 230 231 PR c++/92201 232 * cp-gimplify.c (cp_gimplify_expr): If gimplify_to_rvalue changes the 233 function pointer type, re-add cast to the original one. 234 235 2019-10-04 Jakub Jelinek <jakub@redhat.com> 236 237 PR c++/91974 238 * cp-gimplify.c (cp_gimplify_expr) <case CALL_EXPR>: For 239 -fstrong-eval-order ensure CALL_EXPR_FN side-effects are evaluated 240 before any arguments. Additionally, ensure CALL_EXPR_FN that isn't 241 invariant nor OBJ_TYPE_REF nor SSA_NAME is forced into a temporary. 242 243 2019-08-09 Jakub Jelinek <jakub@redhat.com> 244 245 PR c/91401 246 * parser.c (cp_parser_omp_clause_dist_schedule): Comment out the 247 check_no_duplicate_clause call, instead emit a warning for duplicate 248 dist_schedule clauses. 249 2502019-11-05 Jason Merrill <jason@redhat.com> 251 252 PR c++/88075 253 * parser.c (cp_parser_decl_specifier_seq): Support C++20 254 concept-definition syntax without 'bool'. 255 2562019-10-22 Marek Polacek <polacek@redhat.com> 257 258 Backported from mainline 259 2019-10-21 Marek Polacek <polacek@redhat.com> 260 261 PR c++/92106 - ICE with structured bindings and -Wreturn-local-addr. 262 * typeck.c (maybe_warn_about_returning_address_of_local): Avoid 263 recursing on null initializer and return false instead. 264 2652019-09-03 Iain Sandoe <iain@sandoe.co.uk> 266 267 Backported from mainline 268 2019-08-23 Iain Sandoe <iain@sandoe.co.uk> 269 270 PR pch/61250 271 * parser.c (cp_parser_initial_pragma): Call c_common_no_more_pch () 272 after determining that the first token is not 273 PRAGMA_GCC_PCH_PREPROCESS. 274 2752019-08-30 Richard Biener <rguenther@suse.de> 276 277 Backport from mainline 278 2019-02-21 Richard Biener <rguenther@suse.de> 279 280 PR middle-end/89392 281 * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not 282 make symtab process new functions here. 283 2842019-08-29 Jakub Jelinek <jakub@redhat.com> 285 286 Backported from mainline 287 2019-06-21 Jakub Jelinek <jakub@redhat.com> 288 289 PR c++/90950 290 * semantics.c (finish_omp_clauses): Don't reject references to 291 incomplete types if processing_template_decl. 292 293 2019-05-15 Jakub Jelinek <jakub@redhat.com> 294 295 PR debug/90197 296 * cp-gimplify.c (genericize_cp_loop): Emit a DEBUG_BEGIN_STMT 297 before the condition (or if missing or constant non-zero at the end 298 of the loop. Emit a DEBUG_BEGIN_STMT before the increment expression 299 if any. Don't call protected_set_expr_location on incr if it already 300 has a location. 301 302 2019-05-10 Jakub Jelinek <jakub@redhat.com> 303 304 PR pch/90326 305 * config-lang.in (gtfiles): Remove c-family/c-lex.c, add 306 c-family/c-cppbuiltin.c. 307 3082019-08-15 Jonathan Wakely <jwakely@redhat.com> 309 310 Backport from mainline. 311 2019-08-14 Jonathan Wakely <jwakely@redhat.com> 312 313 PR c++/91436 314 * name-lookup.c (get_std_name_hint): Fix min_dialect field for 315 complex_literals and make_unique entries. 316 3172019-08-01 Marek Polacek <polacek@redhat.com> 318 319 Backported from mainline 320 2018-06-12 Jason Merrill <jason@redhat.com> 321 322 PR c++/86098 - ICE with template placeholder for TTP. 323 * typeck.c (structural_comptypes) [TEMPLATE_TYPE_PARM]: Check 324 CLASS_PLACEHOLDER_TEMPLATE. 325 3262019-06-11 Jakub Jelinek <jakub@redhat.com> 327 328 PR c++/90810 329 * init.c (constant_value_1): Handle VECTOR_CST DECL_INITIAL for 330 !DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P decls like CONSTRUCTOR. 331 3322019-05-22 Eric Botcazou <ebotcazou@adacore.com> 333 334 Backport from mainline 335 2018-05-10 Eric Botcazou <ebotcazou@adacore.com> 336 337 PR c++/85400 338 * decl2.c (adjust_var_decl_tls_model): New static function. 339 (comdat_linkage): Call it on a variable. 340 (maybe_make_one_only): Likewise. 341 3422019-05-20 Jonathan Wakely <jwakely@redhat.com> 343 344 Backported from mainline 345 2019-05-20 Jonathan Wakely <jwakely@redhat.com> 346 347 PR c++/90532 Ensure __is_constructible(T[]) is false 348 * method.c (is_xible_helper): Return error_mark_node for construction 349 of an array of unknown bound. 350 3512019-05-07 Marek Polacek <polacek@redhat.com> 352 353 Backported from mainline 354 2019-02-27 Marek Polacek <polacek@redhat.com> 355 356 PR c++/88857 - ICE with value-initialization of argument in template. 357 * call.c (convert_like_real): Don't call build_value_init in template. 358 359 2019-03-25 Marek Polacek <polacek@redhat.com> 360 361 PR c++/89214 - ICE when initializing aggregates with bases. 362 * typeck2.c (digest_init_r): Warn about object slicing instead of 363 crashing. 364 365 2019-02-27 Marek Polacek <polacek@redhat.com> 366 367 PR c++/89511 - ICE with using-declaration and unscoped enumerator. 368 * parser.c (cp_parser_using_declaration): For an unscoped enum 369 only use its context if it's not a function declaration. 370 371 2019-03-25 Marek Polacek <polacek@redhat.com> 372 373 PR c++/89705 - ICE with reference binding with conversion function. 374 * call.c (reference_binding): If the result of the conversion function 375 is a prvalue of non-class type, use the cv-unqualified type. 376 377 2019-03-29 Marek Polacek <polacek@redhat.com> 378 379 PR c++/89876 - ICE with deprecated conversion. 380 * call.c (convert_like_real): Only give warnings with tf_warning. 381 3822019-04-30 Jakub Jelinek <jakub@redhat.com> 383 384 Backported from mainline 385 2019-04-19 Jakub Jelinek <jakub@redhat.com> 386 387 PR c++/90108 388 * decl.c (duplicate_decls): If remove is main variant and 389 DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE 390 variant that has newdecl as TYPE_NAME if any. 391 392 2019-04-12 Jakub Jelinek <jakub@redhat.com> 393 394 PR c/89933 395 * decl.c (duplicate_decls): When newdecl's type is its main variant, 396 don't try to remove it from the variant list, but instead assert 397 it has no variants. 398 399 2019-03-29 Jakub Jelinek <jakub@redhat.com> 400 401 PR sanitizer/89869 402 * typeck.c: Include gimplify.h. 403 (cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it 404 for second time. Formatting fixes. 405 406 2019-03-26 Jakub Jelinek <jakub@redhat.com> 407 408 PR c++/89796 409 * semantics.c (finish_omp_atomic): Add warning_sentinel for 410 -Wunused-value around finish_expr_stmt call. 411 412 2019-03-22 Jakub Jelinek <jakub@redhat.com> 413 414 PR c++/60702 415 * cp-tree.h (get_tls_wrapper_fn): Remove declaration. 416 (maybe_get_tls_wrapper_call): Declare. 417 * decl2.c (get_tls_wrapper_fn): Make static. 418 (maybe_get_tls_wrapper_call): New function. 419 * typeck.c (build_class_member_access_expr): Handle accesses to TLS 420 variables. 421 * semantics.c (finish_qualified_id_expr): Likewise. 422 (finish_id_expression_1): Use maybe_get_tls_wrapper_call. 423 * pt.c (tsubst_copy_and_build): Likewise. 424 425 2019-03-21 Jakub Jelinek <jakub@redhat.com> 426 427 PR c++/89767 428 * parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id 429 variables, check for duplicates in this function. 430 * lambda.c (add_capture): Don't check for duplicates nor use 431 IDENTIFIER_MARKED. 432 (register_capture_members): Don't clear IDENTIFIER_MARKED here. 433 434 2019-03-14 Jakub Jelinek <jakub@redhat.com> 435 436 PR c++/89512 437 * semantics.c (finish_qualified_id_expr): Reject variable templates. 438 439 2019-03-06 Jakub Jelinek <jakub@redhat.com> 440 441 PR c++/87148 442 * init.c (build_value_init_noctor): Ignore flexible array members. 443 444 2019-02-20 Jakub Jelinek <jakub@redhat.com> 445 446 PR c++/89403 447 * decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting 448 for flag_syntax_only from here... 449 * semantics.c (expand_or_defer_fn_1): ... here. 450 451 PR c++/89405 452 * decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and 453 DECL_COMMON, set DECL_INTERFACE_KNOWN. 454 4552019-03-08 Jason Merrill <jason@redhat.com> 456 457 PR c++/88820 - ICE with CTAD and member template used in DMI. 458 * pt.c (do_class_deduction): Handle parm used as its own arg. 459 460 PR c++/88869 - C++17 ICE with CTAD and explicit specialization. 461 * pt.c (do_class_deduction): Don't include explicit specialization 462 args in outer_args. 463 464 PR c++/88419 - C++17 ICE with class template arg deduction. 465 * pt.c (make_template_placeholder): Set TYPE_CANONICAL after 466 CLASS_PLACEHOLDER_TEMPLATE. 467 468 PR c++/88690 - C++17 ICE with empty base in aggregate. 469 * typeck2.c (process_init_constructor_record): Skip trivial 470 initialization of an empty base. 471 472 PR c++/87921 - wrong error with inline static data member. 473 * decl2.c (c_parse_final_cleanups): Don't force out uninstantiated 474 inline static data members. 475 476 PR c++/89381 - implicit copy and using-declaration. 477 * class.c (classtype_has_move_assign_or_move_ctor_p): Don't consider 478 op= brought in by a using-declaration. 479 480 PR c++/89576 - if constexpr of lambda capture. 481 * semantics.c (maybe_convert_cond): Do convert a non-dependent 482 condition in a template. 483 * typeck.c (condition_conversion): Handle being called in a 484 template. 485 486 PR c++/89422 - ICE with -g and lambda in default arg in template. 487 * pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner. 488 489 PR c++/87513 - 'sorry' mangling PMF template-id. 490 * mangle.c (write_expression): Handle SCOPE_REF to BASELINK. 491 492 PR c++/88183 - ICE with .* fold-expression. 493 * pt.c (fold_expression) [DOTSTAR_EXPR]: Remove special handling. 494 4952019-03-07 Jakub Jelinek <jakub@redhat.com> 496 497 PR c++/89585 498 * parser.c (cp_parser_asm_definition): Parse asm qualifiers even 499 at toplevel, but diagnose them. 500 5012019-02-26 Marek Polacek <polacek@redhat.com> 502 503 Backported from mainline 504 2019-02-11 Marek Polacek <polacek@redhat.com> 505 506 PR c++/89212 - ICE converting nullptr to pointer-to-member-function. 507 * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Return early for 508 null member pointer value. 509 5102019-02-22 Release Manager 511 512 * GCC 8.3.0 released. 513 5142019-02-14 David Malcolm <dmalcolm@redhat.com> 515 516 2019-02-13 David Malcolm <dmalcolm@redhat.com> 517 Backport of r268847 from trunk. 518 519 PR c++/89036 520 * class.c (add_method): Drop destructor assertion. 521 5222019-02-14 David Malcolm <dmalcolm@redhat.com> 523 524 Backport of r267957 from trunk. 525 2019-01-15 David Malcolm <dmalcolm@redhat.com> 526 527 PR c++/88795 528 * pt.c (build_deduction_guide): Bail out if tsubst_arg_types 529 fails. 530 5312019-02-14 David Malcolm <dmalcolm@redhat.com> 532 533 Backport of r262199 from trunk. 534 2018-06-27 David Malcolm <dmalcolm@redhat.com> 535 536 PR c++/86329 537 * name-lookup.c (consider_binding_level): Filter out names that 538 match anon_aggrname_p. 539 5402019-02-14 David Malcolm <dmalcolm@redhat.com> 541 542 Backport of r259720 from trunk. 543 2018-04-27 David Malcolm <dmalcolm@redhat.com> 544 545 PR c++/85515 546 * name-lookup.c (consider_binding_level): Skip compiler-generated 547 variables. 548 * search.c (lookup_field_fuzzy_info::fuzzy_lookup_field): Flatten 549 nested if statements into a series of rejection tests. Reject 550 lambda-ignored entities as suggestions. 551 5522019-02-11 Jason Merrill <jason@redhat.com> 553 554 Revert: 555 PR c++/88752 - ICE with lambda and constexpr if. 556 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New. 557 * pt.c (tsubst_lambda_expr): Set it. 558 (instantiated_lambda_fn_p): Check it. 559 (enclosing_instantiation_of): Use it. 560 5612019-02-11 Jason Merrill <jason@redhat.com> 562 563 PR c++/89267 - change of error location. 564 * pt.c (tsubst_copy_and_build): Do still clear expr location 565 for instantiated thunk calls. 566 5672019-02-08 Jason Merrill <jason@redhat.com> 568 569 PR c++/88761 - ICE with reference capture of constant. 570 * lambda.c (mark_const_cap_r): Do walk subtrees of DECL_EXPR for 571 non-proxy decls. 572 573 PR c++/88752 - ICE with lambda and constexpr if. 574 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New. 575 * pt.c (tsubst_lambda_expr): Set it. 576 (instantiated_lambda_fn_p): Check it. 577 (enclosing_instantiation_of): Use it. 578 579 PR c++/86943 - wrong code converting generic lambda to pointer. 580 * pt.c (tsubst_copy_and_build): Don't propagate CALL_FROM_THUNK_P. 581 5822019-02-07 Jakub Jelinek <jakub@redhat.com> 583 584 Backported from mainline 585 2019-02-05 Jakub Jelinek <jakub@redhat.com> 586 587 PR c++/89187 588 * optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on 589 PARM_DECLs of the thunk. 590 * lambda.c (maybe_add_lambda_conv_op): Likewise. 591 592 2019-01-30 Jakub Jelinek <jakub@redhat.com> 593 594 PR c++/88988 595 * lambda.c (is_capture_proxy): Don't return true for 596 DECL_OMP_PRIVATIZED_MEMBER artificial vars. 597 598 2019-01-24 Jakub Jelinek <jakub@redhat.com> 599 600 PR c++/88976 601 * semantics.c (finish_omp_cancel): Use maybe_convert_cond when not in 602 template or build_x_binary_op otherwise. 603 604 2019-01-21 Jakub Jelinek <jakub@redhat.com> 605 606 PR c++/88949 607 * optimize.c (cxx_copy_decl): New function. 608 (clone_body): Use it instead of copy_decl_no_change. 609 610 PR sanitizer/88901 611 * typeck.c (cp_build_binary_op): Don't instrument 612 SANITIZE_POINTER_COMPARE if processing_template_decl. 613 (pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT. 614 6152019-02-06 Marek Polacek <polacek@redhat.com> 616 617 Backport from mainline 618 2019-02-05 Marek Polacek <polacek@redhat.com> 619 620 PR c++/89158 - by-value capture of constexpr variable broken. 621 * call.c (convert_like_real) <case ck_user>: Call mark_exp_read 622 instead of mark_rvalue_use. 623 624 Backport from mainline 625 2019-01-31 Marek Polacek <polacek@redhat.com> 626 627 PR c++/88983 - ICE with switch in constexpr function. 628 * constexpr.c (cxx_eval_switch_expr): Use SWITCH_COND and SWITCH_BODY. 629 (cxx_eval_constant_expression) <case COND_EXPR>: Don't look for the 630 label in the else branch if we found it in the then branch. 631 632 Backport from mainline 633 2019-01-30 Marek Polacek <polacek@redhat.com> 634 635 PR c++/89119 - ICE with value-initialization in template. 636 * pt.c (tsubst_copy_and_build): Handle RANGE_EXPR. 637 638 Backport from mainline 639 2019-01-27 Marek Polacek <polacek@redhat.com> 640 641 PR c++/89024 - ICE with incomplete enum type. 642 * call.c (standard_conversion): When converting an 643 ARITHMETIC_TYPE_P to an incomplete type, return NULL. 644 6452019-02-05 Marek Polacek <polacek@redhat.com> 646 647 Backported from mainline 648 2019-01-31 Marek Polacek <polacek@redhat.com> 649 650 PR c++/89083, c++/80864 - ICE with list initialization in template. 651 * decl.c (reshape_init_r): Don't reshape a digested initializer. 652 Return the initializer for COMPOUND_LITERAL_P. 653 6542019-01-27 Jason Merrill <jason@redhat.com> 655 656 PR c++/86740, ICE with constexpr if and nested generic lambdas. 657 * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR. 658 659 PR c++/87075 - ICE with constexpr array initialization. 660 * constexpr.c (cxx_eval_vec_init_1): Handle trivial initialization. 661 662 * pt.c (tsubst) [TEMPLATE_TYPE_PARM]: Use TEMPLATE_PARM_DESCENDANTS. 663 6642019-01-17 Nathan Sidwell <nathan@acm.org> 665 666 PR c++/86610 667 * semantics.c (process_outer_var_ref): Only skip dependent types 668 in templates. 669 6702019-01-08 Jakub Jelinek <jakub@redhat.com> 671 672 Backported from mainline 673 2018-12-20 Jakub Jelinek <jakub@redhat.com> 674 675 PR c++/88180 676 * parser.c (cp_parser_class_specifier_1): If 677 cp_parser_check_type_definition fails, skip default arguments, NSDMIs, 678 etc. like for erroneous template args. 679 680 2018-12-19 Jakub Jelinek <jakub@redhat.com> 681 682 PR c++/87934 683 * constexpr.c (cxx_eval_constant_expression) <case CONSTRUCTOR>: Do 684 re-process TREE_CONSTANT CONSTRUCTORs if they aren't reduced constant 685 expressions. 686 687 2018-12-17 Jakub Jelinek <jakub@redhat.com> 688 689 PR c++/88410 690 * cp-gimplify.c (cp_fold) <case ADDR_EXPR>: For offsetof-like folding, 691 call maybe_constant_value on val to see if it is INTEGER_CST. 692 693 2018-12-14 Jakub Jelinek <jakub@redhat.com> 694 695 PR c++/82294 696 PR c++/87436 697 * init.c (build_vec_init): Change num_initialized_elts type from int 698 to HOST_WIDE_INT. Build a RANGE_EXPR if e needs to be repeated more 699 than once. 700 701 2018-12-07 Jakub Jelinek <jakub@redhat.com> 702 703 PR c++/86669 704 * call.c (make_temporary_var_for_ref_to_temp): Call pushdecl even for 705 automatic vars. 706 707 PR c++/87506 708 * constexpr.c (adjust_temp_type): Handle EMPTY_CLASS_EXPR. 709 710 2018-12-04 Jakub Jelinek <jakub@redhat.com> 711 712 PR c++/88103 713 * typeck.c (build_class_member_access_expr): If unary_complex_lvalue 714 turned xvalue_p into non-xvalue_p, call move on it. 715 716 2018-11-27 Jakub Jelinek <jakub@redhat.com> 717 718 PR c++/88181 719 * class.c (fixup_attribute_variants): Also propagate TYPE_PACKED 720 to variants. 721 722 2018-11-21 Jakub Jelinek <jakub@redhat.com> 723 724 PR c++/88122 725 * method.c (maybe_explain_implicit_delete): If 726 FUNCTION_FIRST_USER_PARMTYPE (decl) is NULL, set const_p to false 727 instead of ICEing. 728 7292018-01-02 Segher Boessenkool <segher@kernel.crashing.org> 730 731 Backport from trunk 732 2018-12-06 Segher Boessenkool <segher@kernel.crashing.org> 733 734 PR inline-asm/55681 735 * parser.c (cp_parser_asm_definition): Update grammar. Allow any 736 combination of volatile and goto, in any order, without repetitions. 737 738 Backport from trunk 739 2018-12-06 Segher Boessenkool <segher@kernel.crashing.org> 740 741 * cp-tree.h (finish_asm_stmt): Update declaration. 742 * parser.c (cp_parser_asm_definition): Detect the inline keyword 743 after asm. Pass a flag for it to finish_asm_stmt. 744 * pt.c (tsubst_expr): Pass the ASM_INLINE_P flag to finish_asm_stmt. 745 * semantics.c (finish_asm_stmt): Add inline_p parameter. Use it to 746 set ASM_INLINE_P. 747 748 Backport from trunk 749 2018-12-19 Segher Boessenkool <segher@kernel.crashing.org> 750 751 * parser.c (cp_parser_asm_definition): Rewrite the loop to work without 752 "done" boolean variable. 753 754 Backport from trunk 755 2018-12-19 Segher Boessenkool <segher@kernel.crashing.org> 756 757 * parser.c (cp_parser_asm_definition): Rewrite the loop to work without 758 "done" boolean variable. 759 * parser.c (cp_parser_asm_definition): Keep track of the location each 760 asm qualifier is first seen; use that to give nicer "duplicate asm 761 qualifier" messages. 762 763 Backport from trunk 764 2018-12-19 Segher Boessenkool <segher@kernel.crashing.org> 765 766 * parser.c (cp_parser_asm_definition) <RID_CONST, RID_RESTRICT>: Give 767 a more specific error message (instead of just falling through). 768 769 Backport from trunk 770 2018-12-10 Segher Boessenkool <segher@kernel.crashing.org> 771 772 * parser.c (cp_parser_asm_definition): Do not allow any asm qualifiers 773 on top-level asm. 774 7752018-12-13 Nathan Sidwell <nathan@acm.org> 776 777 PR c++/87531 778 * class.c (finish_struct): Set DECL_CONTEXT of template assign op. 779 * name-lookup.c (get_class_binding_direct): Don't strip using-decl 780 of overload here. 781 * parser.c (cp_parser_postfix_expression): Cope with using decl in 782 overload set. 783 * semantics.c (finish_id_expr): Likewise. 784 7852018-12-04 Marek Polacek <polacek@redhat.com> 786 787 Backported from mainline 788 2018-11-26 Marek Polacek <polacek@redhat.com> 789 790 PR c++/88120 - ICE when calling save_expr in a template. 791 * typeck.c (cp_build_binary_op): Call cp_save_expr instead of 792 save_expr. 793 7942018-11-29 Nathan Sidwell <nathan@acm.org> 795 796 PR c++/87531 797 * class.c (finish_struct): In a template, add artificial using 798 decl for operator=. 799 8002018-11-15 Nathan Sidwell <nathan@acm.org> 801 802 PR c++/86246 803 PR c++/87989 804 * typeck.c (finish_class_member_access_expr): Conversion operator 805 to dependent type is dependent. 806 8072018-11-05 Jakub Jelinek <jakub@redhat.com> 808 809 Backported from mainline 810 2018-10-24 Jakub Jelinek <jakub@redhat.com> 811 812 PR c++/86288 813 * parser.c (cp_parser_std_attribute): Canonicalize attr_ns, and when 814 :: is not present and attr_ns non-NULL, canonicalize also attr_id. 815 (cp_parser_attribute_spec): Fix comment typo. 816 8172018-10-23 Tom de Vries <tdevries@suse.de> 818 819 backport from trunk: 820 2018-07-31 Tom de Vries <tdevries@suse.de> 821 822 PR debug/86687 823 * optimize.c (update_cloned_parm): Copy DECL_BY_REFERENCE. 824 8252018-10-11 Jakub Jelinek <jakub@redhat.com> 826 827 PR c++/87582 828 * typeck.c (maybe_warn_about_returning_address_of_local): If 829 whats_returned is a structured binding identifier and the structured 830 binding is a reference, recurse on its initializer. 831 8322018-10-10 Paolo Carlini <paolo.carlini@oracle.com> 833 834 PR c++/84940 835 * semantics.c (finish_unary_op_expr): Check return value of 836 build_x_unary_op for error_mark_node. 837 8382018-10-03 Martin Liska <mliska@suse.cz> 839 840 Backport from mainline 841 2018-10-03 Martin Liska <mliska@suse.cz> 842 843 PR gcov-profile/86109 844 * parser.c (cp_parser_lambda_declarator_opt): 845 Set DECL_LAMBDA_FUNCTION for lambdas. 846 8472018-09-24 Paolo Carlini <paolo.carlini@oracle.com> 848 849 PR c++/85070 850 * method.c (lazily_declare_fn): During error-recovery add_method 851 may return false. 852 8532018-09-18 Nathan Sidwell <nathan@acm.org> 854 855 PR c++/86881 856 * name-lookup.c (check_local_shadow): Ignore auto types. 857 8582018-09-13 Ville Voutilainen <ville.voutilainen@gmail.com> 859 860 Backport from mainline 861 2018-09-13 Ville Voutilainen <ville.voutilainen@gmail.com> 862 gcc/cp 863 864 PR c++/87093 865 * method.c (constructible_expr): We're in an unevaluated context 866 in all cases, not just for class targets. 867 868 testsuite/ 869 870 PR c++/87093 871 * g++.dg/ext/is_constructible2.C: New. 872 8732018-09-05 Pádraig Brady <p@draigbrady.com> 874 875 PR c++/87185 876 * lambda.c (prune_lambda_captures): Protect against const_vars.get 877 returning NULL. 878 8792018-09-05 Jakub Jelinek <jakub@redhat.com> 880 881 Backported from mainline 882 2018-08-29 Jakub Jelinek <jakub@redhat.com> 883 884 PR c++/87095 885 * decl.c (begin_destructor_body): If current_class_type has 886 virtual bases and the primary base is nearly empty virtual base, 887 voidify clearing of vptr and make it conditional on in-charge 888 argument. 889 890 2018-08-08 Jakub Jelinek <jakub@redhat.com> 891 892 PR c++/86836 893 * pt.c (tsubst_expr): For structured bindings, call tsubst_decomp_names 894 before tsubst_init, not after it. 895 896 PR c++/86738 897 * constexpr.c (cxx_eval_binary_expression): For arithmetics involving 898 NULL pointer set *non_constant_p to true. 899 (cxx_eval_component_reference): For dereferencing of a NULL pointer, 900 set *non_constant_p to true and return t. 901 902 2018-08-03 Jason Merrill <jason@redhat.com> 903 904 PR c++/86706 905 * class.c (build_base_path): Use currently_open_class. 906 9072018-08-31 Nathan Sidwell <nathan@acm.org> 908 909 PR c++/87155 910 PR c++/84707 911 * name-lookup.c (name_lookup::search_namespace): Don't look at 912 inlines when searching for NULL names. 913 9142018-08-29 Jakub Jelinek <jakub@redhat.com> 915 916 PR c++/87122 917 * pt.c (tsubst_expr) <case RANGE_FOR_STMT>: If 918 processing_template_decl and decl is structured binding decl, call 919 cp_finish_decomp. 920 9212018-08-17 Richard Biener <rguenther@suse.de> 922 923 Backport from mainline 924 2018-08-02 Richard Biener <rguenther@suse.de> 925 926 PR c++/86763 927 * class.c (layout_class_type): Copy TYPE_TYPELESS_STORAGE 928 to the CLASSTYPE_AS_BASE. 929 9302018-08-10 Jason Merrill <jason@redhat.com> 931 932 PR c++/86728 - C variadic generic lambda. 933 * parser.c (cp_parser_parameter_declaration): Don't turn 'auto' into 934 a pack if it's followed by a declarator-id. 935 9362018-08-08 Marek Polacek <polacek@redhat.com> 937 938 Backport from mainline 939 2018-08-06 Marek Polacek <polacek@redhat.com> 940 941 PR c++/86767 942 * constexpr.c (cxx_eval_statement_list): Handle continue. 943 9442018-08-01 Marek Polacek <polacek@redhat.com> 945 946 PR c++/86190 - bogus -Wsign-conversion warning 947 * typeck.c (cp_build_binary_op): Add a warning sentinel. 948 9492018-07-26 Release Manager 950 951 * GCC 8.2.0 released. 952 9532018-07-17 Jason Merrill <jason@redhat.com> 954 955 PR c++/86480 - nested variadic lambda and constexpr if. 956 * pt.c (find_parameter_packs_r) [IF_STMT]: Don't walk into 957 IF_STMT_EXTRA_ARGS. 958 9592018-07-16 Jakub Jelinek <jakub@redhat.com> 960 961 PR c++/3698 962 PR c++/86208 963 * cp-gimplify.c (cp_genericize_r): When using extern_decl_map, or 964 in TREE_USED flag from stmt to h->to. 965 9662018-07-13 Nathan Sidwell <nathan@acm.org> 967 968 PR c++/86374 969 * pt.c (lookup_template_class_1): Use tsubst_aggr_type for 970 contexts that are classes. 971 9722018-07-12 Jakub Jelinek <jakub@redhat.com> 973 974 * decl2.c (cplus_decl_attributes): Don't diagnose vars without mappable 975 type here, instead add "omp declare target implicit" attribute. Add 976 that attribute instead of "omp declare target" also when 977 processing_template_decl. 978 * decl.c (cp_finish_decl): Diagnose vars without mappable type here, 979 and before calling cp_omp_mappable_type call complete_type. 980 9812018-07-10 Jakub Jelinek <jakub@redhat.com> 982 983 PR sanitizer/86406 984 * cp-gimplify.c (cp_maybe_instrument_return): Skip trailing 985 DEBUG_BEGIN_STMTs. 986 9872018-07-04 Ville Voutilainen <ville.voutilainen@gmail.com> 988 989 Backport from mainline 990 2018-07-04 Ville Voutilainen <ville.voutilainen@gmail.com> 991 992 gcc/cp/ 993 994 PR c++/86398 995 * method.c (is_trivially_xible): Return false 996 if is_xible_helper returns a NULL_TREE. 997 9982018-07-03 Jason Merrill <jason@redhat.com> 999 1000 PR c++/86378 - functional cast in noexcept-specifier. 1001 * tree.c (strip_typedefs_expr) [TREE_LIST]: Fix iteration. 1002 1003 * name-lookup.c (do_push_to_top_level): Don't allocate 1004 current_lang_base. 1005 (do_pop_from_top_level): Release current_lang_base. 1006 10072018-06-26 Jason Merrill <jason@redhat.com> 1008 1009 PR c++/86320 - memory-hog with std::array of pair 1010 * typeck2.c (process_init_constructor_array): If zero-initialization 1011 is fine for one element, we're done. 1012 1013 PR c++/80290 - memory-hog with std::pair. 1014 * pt.c (type_unification_real): Skip non-dependent conversion 1015 check for a nested list argument. 1016 (braced_init_depth): New. 1017 10182018-06-26 Jakub Jelinek <jakub@redhat.com> 1019 1020 PR c++/86291 1021 * parser.c (cp_parser_omp_for_loop_init): Change for_block argument 1022 type from vec<tree, va_gc> * to vec<tree, va_gc> *&. 1023 10242018-06-22 Jason Merrill <jason@redhat.com> 1025 1026 PR c++/86219 - ICE with erroneous initializer in template. 1027 * constexpr.c (fold_non_dependent_expr): Add complain parm. 1028 * typeck2.c (store_init_value): Pass tf_warning_or_error. 1029 10302018-06-21 Jason Merrill <jason@redhat.com> 1031 1032 PR c++/86182 - ICE with anonymous union passed to template. 1033 * pt.c (tsubst_expr) [DECL_EXPR]: Handle an anonymous union type 1034 used to declare a named variable. 1035 10362018-06-20 Nathan Sidwell <nathan@acm.org> 1037 1038 PR c++/85634 - tsubst ICE on unmarked lookup 1039 * parser.c (cp_parser_primary_expression): Keep lookup in template. 1040 10412018-06-18 Jason Merrill <jason@redhat.com> 1042 1043 PR c++/86200 - ICE with unexpanded pack in lambda parameter. 1044 * pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Also look into the 1045 function type. 1046 1047 PR c++/81060 - ICE with unexpanded parameter pack. 1048 * pt.c (check_for_bare_parameter_packs): Add loc parameter. 1049 * decl.c (grokdeclarator): Call it for qualifying_scope. 1050 10512018-06-15 Jason Merrill <jason@redhat.com> 1052 1053 PR c++/86147 - wrong capture for template argument. 1054 * expr.c (mark_use): Look through NOP_EXPR. 1055 1056 PR c++/82882 - ICE with lambda in template default argument. 1057 * lambda.c (record_null_lambda_scope): New. 1058 * pt.c (tsubst_lambda_expr): Use it. 1059 * name-lookup.c (do_pushtag): Don't give a lambda DECL_CONTEXT of a 1060 function that isn't open. 1061 1062 * tree.c (maybe_warn_parm_abi): Inform the location of the class. 1063 10642018-06-13 Jason Merrill <jason@redhat.com> 1065 1066 PR c++/86094 - wrong code with defaulted move ctor. 1067 * class.c (classtype_has_non_deleted_move_ctor): New. 1068 * tree.c (maybe_warn_parm_abi, type_has_nontrivial_copy_init): 1069 Handle v12 breakage. 1070 10712018-06-11 Jason Merrill <jason@redhat.com> 1072 1073 PR c++/85792 -Wctor-dtor-privacy and inherited constructor. 1074 * class.c (maybe_warn_about_overly_private_class): Handle inherited 1075 constructors. 1076 1077 PR c++/85963 - -Wunused-but-set with ?: in template. 1078 * pt.c (tsubst_copy_and_build) [COND_EXPR]: Call mark_rvalue_use. 1079 1080 PR c++/61806 - missed SFINAE with partial specialization. 1081 * cp-tree.h (deferring_access_check_sentinel): Add deferring_kind 1082 parameter to constructor. 1083 * pt.c (instantiate_class_template_1): Enable access checking 1084 before call to most_specialized_partial_spec. 1085 1086 PR c++/85765 - SFINAE and non-type default template arg. 1087 * pt.c (type_unification_real): Do full semantic processing if 1088 substituting a partial args list replaces all template parms. 1089 1090 PR c++/85764 - bogus 'this' not captured error. 1091 * lambda.c (resolvable_dummy_lambda): Use nonlambda_method_basetype. 1092 (nonlambda_method_basetype): Handle NSDMI. 1093 1094 PR c++/85807 - ICE with call in template NSDMI. 1095 * init.c (get_nsdmi): Use push_to/pop_from_top_level. 1096 * tree.c (bot_manip): Don't set_flags_from_callee in a template. 1097 1098 PR c++/85815 - reference to member of enclosing template. 1099 * search.c (lookup_base): Use currently_open_class. 1100 (lookup_member): Use it regardless of -fconcepts. 1101 * parser.c (cp_parser_postfix_dot_deref_expression): Check it. 1102 1103 PR c++/86094 - wrong code with defaulted move ctor. 1104 * tree.c (type_has_nontrivial_copy_init): Fix move ctor handling. 1105 11062018-06-06 Jason Merrill <jason@redhat.com> 1107 1108 PR c++/86060 - ICE on range for with -std=c++98. 1109 * parser.c (cp_parser_init_statement): Don't clobber *decl after 1110 pedwarn. 1111 11122018-06-05 Marek Polacek <polacek@redhat.com> 1113 1114 Backported from mainline 1115 2018-05-24 Marek Polacek <polacek@redhat.com> 1116 1117 PR c++/85847 1118 * init.c (build_new_1): Use fold_non_dependent_expr. Use a dedicated 1119 variable for its result. Fix a condition. 1120 (build_new): Use fold_non_dependent_expr. Tweak a condition. 1121 1122 2018-06-05 Marek Polacek <polacek@redhat.com> 1123 1124 PR c++/85976 1125 * tree.c (cp_tree_equal): Handle USING_DECL. 1126 11272018-06-05 Jason Merrill <jason@redhat.com> 1128 1129 PR c++/85731 - wrong error with qualified-id in template. 1130 * semantics.c (finish_qualified_id_expr): build_qualified_name 1131 for unbound names in the current class. 1132 11332018-06-03 Jason Merrill <jason@redhat.com> 1134 1135 PR c++/85739 - ICE with pointer to member template parm. 1136 * cvt.c (perform_qualification_conversions): Use cp_fold_convert. 1137 1138 PR c++/85761 - ICE with ill-formed use of const outer variable. 1139 * expr.c (mark_use): Handle location wrappers. 1140 11412018-06-01 Jason Merrill <jason@redhat.com> 1142 1143 PR c++/85873 - constant initializer_list array not in .rodata. 1144 * call.c (convert_like_real): Treat the backing array for an 1145 initializer_list like a C99 compound literal. 1146 11472018-05-30 Jakub Jelinek <jakub@redhat.com> 1148 1149 Backported from mainline 1150 2018-05-29 Jakub Jelinek <jakub@redhat.com> 1151 1152 PR c++/85952 1153 * init.c (build_aggr_init): For structured binding initialized from 1154 array call mark_rvalue_use on the initializer. 1155 1156 2018-05-11 Jakub Jelinek <jakub@redhat.com> 1157 1158 PR c/85696 1159 * cp-tree.h (cxx_omp_predetermined_sharing_1): New prototype. 1160 * cp-gimplify.c (cxx_omp_predetermined_sharing): New wrapper around 1161 cxx_omp_predetermined_sharing_1. Rename old function to ... 1162 (cxx_omp_predetermined_sharing_1): ... this. 1163 * semantics.c (finish_omp_clauses): Use cxx_omp_predetermined_sharing_1 1164 instead of cxx_omp_predetermined_sharing. 1165 1166 2018-05-10 Jakub Jelinek <jakub@redhat.com> 1167 1168 PR c++/85662 1169 * cp-gimplify.c (cp_fold): Use fold_offsetof rather than 1170 fold_offsetof_1, pass TREE_TYPE (x) as TYPE to it and drop the 1171 fold_convert. 1172 11732018-05-24 Jason Merrill <jason@redhat.com> 1174 1175 PR c++/85842 - -Wreturn-type, constexpr if and generic lambda. 1176 * pt.c (tsubst_lambda_expr): Copy current_function_returns_* to 1177 generic lambda. 1178 1179 PR c++/85864 - literal template and default template arg. 1180 * pt.c (instantiation_dependent_r): Handle NONTYPE_ARGUMENT_PACK. 1181 1182 PR c++/81420 - not extending temporary lifetime. 1183 * call.c (extend_ref_init_temps_1): Handle ARRAY_REF. 1184 * class.c (build_base_path): Avoid redundant move of an rvalue. 1185 11862018-05-22 Jason Merrill <jason@redhat.com> 1187 1188 PR c++/85866 - error with .* in default template arg. 1189 * pt.c (tsubst_copy_and_build): Handle partial instantiation. 1190 11912018-05-18 Cesar Philippidis <cesar@codesourcery.com> 1192 1193 Backport from mainline 1194 2018-05-18 Cesar Philippidis <cesar@codesourcery.com> 1195 1196 PR c++/85782 1197 * cp-gimplify.c (cp_genericize_r): Call genericize_omp_for_stmt for 1198 OACC_LOOPs. 1199 12002018-05-08 Jason Merrill <jason@redhat.com> 1201 1202 PR c++/85706 - class deduction under decltype 1203 * pt.c (for_each_template_parm_r): Handle DECLTYPE_TYPE. Clear 1204 *walk_subtrees whether or not we walked into the operand. 1205 (type_uses_auto): Only look at deduced contexts. 1206 12072018-05-08 Marek Polacek <polacek@redhat.com> 1208 1209 PR c++/85695 1210 * semantics.c (finish_if_stmt_cond): See through typedefs. 1211 12122018-05-07 Jason Merrill <jason@redhat.com> 1213 1214 PR c++/85646 - lambda visibility. 1215 * decl2.c (determine_visibility): Don't mess with template arguments 1216 from the containing scope. 1217 (vague_linkage_p): Check DECL_ABSTRACT_P before looking at a 'tor 1218 thunk. 1219 1220 PR c++/85618 - ICE with initialized VLA. 1221 * tree.c (vla_type_p): New. 1222 * typeck2.c (store_init_value, split_nonconstant_init_1): Check it 1223 rather than array_of_runtime_bound_p. 1224 12252018-05-04 Jason Merrill <jason@redhat.com> 1226 1227 PR c++/85305 - pack in lambda init-capture. 1228 * parser.c (cp_parser_initializer): Add subexpression_p parm; don't 1229 check_for_bare_parameter_packs in a subexpression. 1230 (cp_parser_lambda_introducer): Use it. 1231 12322018-05-02 Release Manager 1233 1234 * GCC 8.1.0 released. 1235 12362018-05-02 Jason Merrill <jason@redhat.com> 1237 1238 PR c++/85587 - error with scoped enum in template. 1239 * semantics.c (finish_qualified_id_expr): Don't return an 1240 unqualified IDENTIFIER_NODE. 1241 12422018-04-30 Jason Merrill <jason@redhat.com> 1243 1244 PR c++/85580 - extern "C" and local variables 1245 * name-lookup.c (check_extern_c_conflict): Ignore local decls. 1246 12472018-04-27 Jakub Jelinek <jakub@redhat.com> 1248 1249 PR c++/85553 1250 * init.c (build_zero_init_1): For zero initialization of 1251 NULLPTR_TYPE_P type use build_int_cst directly. 1252 12532018-04-27 Jason Merrill <jason@redhat.com> 1254 1255 PR c++/85545 - ICE with noexcept PMF conversion. 1256 * cvt.c (cp_fold_convert): Pass PMF CONSTRUCTORs to 1257 build_ptrmemfunc. 1258 * typeck.c (build_ptrmemfunc): Don't build a NOP_EXPR for zero 1259 adjustment. 1260 (build_ptrmemfunc_access_expr): Special-case CONSTRUCTORs. 1261 12622018-04-25 Nathan Sidwell <nathan@acm.org> 1263 1264 PR c++/85437 1265 PR c++/49171 1266 * cp-tree.h (REINTERPRET_CAST_P): New. 1267 * constexpr.c (cxx_eval_constant_expression) <case NOP_EXPR>: 1268 Reject REINTERPET_CAST_P conversions. Use cplus_expand_constant 1269 for non-trivial PTRMEM_CST cases. 1270 * typeck.c (build_nop_reinterpret): New. 1271 (build_reinterpret_cast_1): Use it. Set REINTERPRET_CAST_P on 1272 NOP_EXPRs returned by cp_convert. 1273 12742018-04-23 Jason Merrill <jason@redhat.com> 1275 1276 PR c++/69560 - wrong alignof(double) on x86. 1277 CWG 1879 - Inadequate definition of alignment requirement. 1278 * cp-tree.h (ALIGNOF_EXPR_STD_P): New. 1279 * typeck.c (cxx_sizeof_or_alignof_type): Add std_alignof parm. 1280 (cxx_sizeof_expr, cxx_sizeof_nowarn, cxx_alignas_expr) 1281 (cxx_alignof_expr): Pass it. 1282 * parser.c (cp_parser_unary_expression): Pass it. 1283 * pt.c (tsubst_copy): Copy it. 1284 (tsubst_copy_and_build): Pass it. 1285 * decl.c (fold_sizeof_expr): Pass it. 1286 12872018-04-23 Jakub Jelinek <jakub@redhat.com> 1288 Jason Merrill <jason@redhat.com> 1289 1290 PR c++/85470 - wrong error with static data member. 1291 * decl.c (check_initializer): Check DECL_INITIALIZED_IN_CLASS_P. 1292 * typeck2.c (store_init_value): Likewise. 1293 12942018-04-20 Jakub Jelinek <jakub@redhat.com> 1295 1296 PR c++/85462 1297 * cp-tree.h (tinst_level): Remove in_system_header_p member, 1298 change refcount member from unsigned char to unsigned short, 1299 add refcount_infinity static data member, adjust comments. 1300 * pt.c (tinst_level::refcount_infinity): Define. 1301 (inc_refcount_use): Remove assert, don't increment if refcount 1302 is already refcount_infinity, adjust comment. 1303 (dec_refcount_use): Remove assert, don't decrement if refcount 1304 is refcount_infinity, adjust comment. 1305 (push_tinst_level_loc): Formatting fix. 1306 13072018-04-19 Paolo Carlini <paolo.carlini@oracle.com> 1308 1309 PR c++/84611 1310 * pt.c (lookup_template_class_1): Check pushtag return value for 1311 error_mark_node. 1312 13132018-04-19 Alexandre Oliva <aoliva@redhat.com> 1314 1315 PR c++/80290 1316 * cp-tree.h (tinst_level::free): Fix whitespace. 1317 13182018-04-18 Paolo Carlini <paolo.carlini@oracle.com> 1319 1320 PR c++/84630 1321 * pt.c (tsubst_lambda_expr): Check begin_lambda_type return value 1322 for error_mark_node. 1323 13242018-04-18 Jakub Jelinek <jakub@redhat.com> 1325 1326 PR c++/84463 1327 * typeck.c (cp_build_addr_expr_1): Move handling of offsetof-like 1328 tricks from here to ... 1329 * cp-gimplify.c (cp_fold) <case ADDR_EXPR>: ... here. Only use it 1330 if INDIRECT_REF's operand is INTEGER_CST cast to pointer type. 1331 13322018-04-18 Alexandre Oliva <aoliva@redhat.com> 1333 1334 PR c++/80290 1335 * cp-tree.h (struct tinst_level): Split decl into tldcl and 1336 targs. Add private split_list_p, tree_list_p, and not_list_p 1337 inline const predicates; to_list private member function 1338 declaration; free public member function declaration; list_p, 1339 get_node and maybe_get_node accessors, and refcount data 1340 member. Narrow errors to unsigned short. 1341 * error.c (print_instantiation_full_context): Use new 1342 accessors. 1343 (print_instantiation_partial_context_line): Likewise. Drop 1344 const from tinst_level-typed parameter. 1345 * mangle.c (mangle_decl_string): Likewise. 1346 * pt.c (freelist): New template class. 1347 (tree_list_freelist_head): New var. 1348 (tree_list_freelist): New fn, along with specializations. 1349 (tinst_level_freelist_head): New var. 1350 (pending_template_freelist_head): Likewise. 1351 (tinst_level_freelist, pending_template_freelist): New fns. 1352 (tinst_level::to_list, tinst_level::free): Define. 1353 (inc_refcount_use, dec_refcount_use): New fns for tinst_level. 1354 (set_refcount_ptr): New template fn. 1355 (add_pending_template): Adjust for refcounting, freelists and 1356 new accessors. 1357 (neglectable_inst_p): Take a NULL d as a non-DECL. 1358 (limit_bad_template_recursion): Use new accessors. 1359 (push_tinst_level): New overload to create the list. 1360 (push_tinst_level_loc): Make it static, split decl into two 1361 args, adjust tests and initialization to cope with split 1362 lists, use freelist, adjust for refcounting. 1363 (push_tinst_level_loc): New wrapper with the old interface. 1364 (pop_tinst_level): Adjust for refcounting. 1365 (record_last_problematic_instantiation): Likewise. 1366 (reopen_tinst_level): Likewise. Use new accessors. 1367 (instantiate_alias_template): Adjust for split list. 1368 (fn_type_unification): Likewise. 1369 (get_partial_spec_bindings): Likewise. 1370 (instantiate_pending_templates): Use new accessors. Adjust 1371 for refcount. Release pending_template to freelist. 1372 (instantiating_current_function_p): Use new accessors. 1373 13742018-04-16 Alexandre Oliva <aoliva@redhat.com> 1375 1376 PR c++/85039 1377 * parser.c (cp_parser_builtin_offset): Reject type definitions. 1378 * mangle.c (nested_anon_class_index): Avoid crash returning -1 1379 if we've seen errors. 1380 13812018-04-12 David Malcolm <dmalcolm@redhat.com> 1382 1383 PR c++/85385 1384 * name-lookup.c (macro_use_before_def::maybe_make): New function, 1385 checking that the use is indeed before the definition. 1386 (macro_use_before_def::macro_use_before_def): Make private. 1387 (macro_use_before_def::~macro_use_before_def): Make private. Move 1388 check for UNKNOWN_LOCATION to macro_use_before_def::maybe_make. 1389 (lookup_name_fuzzy): Call macro_use_before_def::maybe_make rather 1390 than using new directly. 1391 13922018-04-12 Jason Merrill <jason@redhat.com> 1393 1394 PR c++/85356 - ICE with pointer to member function. 1395 * pt.c (maybe_instantiate_noexcept): Do instantiate in templates if 1396 flag_noexcept_type. Build the new spec within the function context. 1397 * except.c (build_noexcept_spec): Do get constant value in templates 1398 if flag_noexcept_type. 1399 * decl.c (check_redeclaration_exception_specification): Don't 1400 instantiate noexcept on a dependent declaration. 1401 14022018-04-12 Marek Polacek <polacek@redhat.com> 1403 1404 PR c++/85258 1405 * constexpr.c (reduced_constant_expression_p): Return false for null 1406 trees. 1407 14082018-04-11 Marek Polacek <polacek@redhat.com> 1409 1410 PR c++/85032 1411 * constexpr.c (potential_constant_expression_1): Consider conversions 1412 from classes to literal types potentially constant. 1413 14142018-04-10 Paolo Carlini <paolo.carlini@oracle.com> 1415 1416 PR c++/70808 1417 * init.c (build_zero_init_1): Handle NULLPTR_TYPE_P being true of 1418 the type like TYPE_PTR_OR_PTRMEM_P. 1419 14202018-04-10 Jason Merrill <jason@redhat.com> 1421 1422 PR debug/65821 - wrong location for main(). 1423 * call.c (clear_location_r, convert_default_arg): Revert. 1424 * tree.c (break_out_target_exprs): Add clear_location parm. 1425 (struct bot_data): New. 1426 (bot_manip): Clear location if requested. 1427 * init.c (get_nsdmi): Pass clear_location. 1428 14292018-04-10 David Malcolm <dmalcolm@redhat.com> 1430 1431 PR c++/85110 1432 * call.c (get_fndecl_argument_location): Make non-static. 1433 * cp-tree.h (get_fndecl_argument_location): New decl. 1434 * typeck.c (convert_for_assignment): When complaining due to 1435 conversions for an argument, show the location of the parameter 1436 within the decl. 1437 14382018-04-10 Jakub Jelinek <jakub@redhat.com> 1439 1440 PR c++/85312 - P0962 cleanup 1441 * parser.c (cp_parser_perform_range_for_lookup): Remove unreachable 1442 diagnostics. 1443 14442018-04-10 Jason Merrill <jason@redhat.com> 1445 1446 PR debug/65821 - wrong location for main(). 1447 * call.c (clear_location_r): New. 1448 (convert_default_arg): Use it. 1449 * tree.c (bot_manip): Remove builtin_LINE/FILE handling. 1450 1451 PR c++/85285 - ICE with flexible array after substitution. 1452 * pt.c (instantiate_class_template_1): Check for flexible array in 1453 union. 1454 14552018-04-09 Paolo Carlini <paolo.carlini@oracle.com> 1456 1457 PR c++/85227 1458 * decl.c (cp_finish_decomp): In a template, if the type is incomplete 1459 issue a pedwarn and defer trying to do bindings. 1460 14612018-04-09 Jason Merrill <jason@redhat.com> 1462 1463 PR c++/85279 - dump_expr doesn't understand decltype. 1464 * error.c (dump_expr): Handle DECLTYPE_TYPE. 1465 1466 PR c++/85262 - ICE with redundant qualification on constructor. 1467 * call.c (build_new_method_call_1): Move make_args_non_dependent 1468 after A::A() handling. 1469 1470 PR c++/85277 - ICE with invalid offsetof. 1471 * semantics.c (finish_offsetof): Avoid passing non-DECL to %qD. 1472 Adjust -Winvalid-offsetof diagnostic to say conditionally supported. 1473 1474 PR c++/85264 - ICE with excess template-parameter-list. 1475 * parser.c (cp_parser_check_template_parameters): Add template_id_p 1476 parameter. Don't allow an extra template header if true. 1477 (cp_parser_class_head): Pass template_id_p. 1478 (cp_parser_elaborated_type_specifier): Likewise. 1479 (cp_parser_alias_declaration): Likewise. 1480 (cp_parser_check_declarator_template_parameters): Likewise. 1481 14822018-04-09 Jakub Jelinek <jakub@redhat.com> 1483 1484 PR c++/85194 1485 * parser.c (cp_parser_simple_declaration): For structured bindings, 1486 if *maybe_range_for_decl is NULL after parsing it, set it to 1487 error_mark_node. 1488 14892018-04-09 Jason Merrill <jason@redhat.com> 1490 1491 PR c++/85256 - ICE capturing pointer to VLA. 1492 * lambda.c (add_capture): Distinguish between variable-size and 1493 variably-modified types. 1494 14952018-04-06 Jason Merrill <jason@redhat.com> 1496 1497 PR c++/85214 - ICE with alias, generic lambda, constexpr if. 1498 * pt.c (extract_locals_r): Remember local typedefs. 1499 15002018-04-06 David Malcolm <dmalcolm@redhat.com> 1501 1502 PR c++/84269 1503 * name-lookup.c (struct std_name_hint): Move out of 1504 get_std_name_hint; add field "min_dialect". 1505 (get_std_name_hint): Add min_dialect values to all initializers. 1506 Add <any>, <atomic>, <bitset>, <condition_variable>, <functional>, 1507 <future>, <istream>, <iterator>, <ostream>, <mutex>, <optional>, 1508 <shared_mutex>, <string_view>, <thread>, and <variant>. 1509 Add fstream, ifstream, and ofstream to <fstream>. 1510 Add istringstream, ostringstream, and stringstream to <sstream>. 1511 Add basic_string to <string>. 1512 Add tuple_element and tuple_size to <tuple>. 1513 Add declval to <utility>. 1514 Fix ordering of <queue> and <tuple>. 1515 Return a std_name_hint, rather than a const char *. 1516 (get_cxx_dialect_name): New function. 1517 (maybe_suggest_missing_std_header): Detect names that aren't yet 1518 available in the current dialect, and instead of suggesting a 1519 missing #include, warn about the dialect. 1520 15212018-04-06 Jakub Jelinek <jakub@redhat.com> 1522 1523 PR c++/85210 1524 * pt.c (tsubst_decomp_names): Return error_mark_node and assert 1525 errorcount is set if tsubst doesn't return a VAR_DECL. 1526 15272018-04-06 David Malcolm <dmalcolm@redhat.com> 1528 1529 PR c++/85021 1530 * name-lookup.c (using_directives_contain_std_p): New function. 1531 (has_using_namespace_std_directive_p): New function. 1532 (suggest_alternatives_for): Simplify if/else logic using early 1533 returns. If no candidates were found, and there's a 1534 "using namespace std;" directive, call 1535 maybe_suggest_missing_std_header. 1536 (maybe_suggest_missing_header): Split later part of the function 1537 into.. 1538 (maybe_suggest_missing_std_header): New. 1539 15402018-04-06 Jason Merrill <jason@redhat.com> 1541 1542 PR c++/85242 - ICE with class definition in template parm. 1543 * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): False if 1544 processing_template_parmlist. 1545 1546 PR c++/85240 - LTO ICE with using of undeduced auto fn. 1547 * cp-gimplify.c (cp_genericize_r): Discard using of undeduced auto. 1548 15492018-04-05 Jakub Jelinek <jakub@redhat.com> 1550 1551 PR c++/85209 1552 * pt.c (tsubst_decomp_names): Don't fail or ICE if DECL_CHAIN (decl3) 1553 is not prev, if prev == decl. 1554 1555 PR c++/85208 1556 * decl.c (start_decl): For DECL_DECOMPOSITION_P decls, don't call 1557 maybe_apply_pragma_weak here... 1558 (cp_maybe_mangle_decomp): ... but call it here instead. 1559 15602018-04-05 Jason Merrill <jason@redhat.com> 1561 1562 PR c++/85136 - ICE with designated init in template. 1563 * decl.c (maybe_deduce_size_from_array_init): Handle dependent 1564 designated initializer. 1565 (check_array_designated_initializer): Update ce->index with the 1566 constant value. 1567 1568 PR c++/83808 - ICE with VLA initialization. 1569 * typeck2.c (process_init_constructor_array): Don't require a VLA 1570 initializer to have VLA type. 1571 15722018-04-05 Paolo Carlini <paolo.carlini@oracle.com> 1573 1574 PR c++/80956 1575 * call.c (convert_like_real): Fail gracefully for a broken 1576 std::initializer_list, missing a definition. 1577 1578 * name-lookup.c (do_pushtag): Tweak message, use %< and %>. 1579 15802018-04-05 Paolo Carlini <paolo.carlini@oracle.com> 1581 1582 PR c++/84792 1583 * decl.c (grokdeclarator): Fix diagnostic about typedef name used 1584 as nested-name-specifier, keep type and TREE_TYPE (decl) in sync. 1585 15862018-04-05 Jason Merrill <jason@redhat.com> 1587 1588 PR c++/82152 - ICE with class deduction and inherited ctor. 1589 * pt.c (do_class_deduction): Ignore inherited ctors. 1590 1591 PR c++/84665 - ICE with array of empty class. 1592 * decl2.c (cp_check_const_attributes): Use fold_non_dependent_expr. 1593 1594 PR c++/85228 - ICE with lambda in enumerator in template. 1595 * pt.c (bt_instantiate_type_proc): Don't assume 1596 CLASSTYPE_TEMPLATE_INFO is non-null. 1597 15982018-04-05 Ville Voutilainen <ville.voutilainen@gmail.com> 1599 1600 Implement P0969 1601 * decl.c (find_decomp_class_base): Check accessibility instead 1602 of declared access, adjust diagnostic. 1603 16042018-04-05 Ville Voutilainen <ville.voutilainen@gmail.com> 1605 1606 Implement P0961 1607 * decl.c (get_tuple_decomp_init): Check the templatedness 1608 of a member get. 1609 16102018-04-05 Jason Merrill <jason@redhat.com> 1611 1612 PR c++/85200 - ICE with constexpr if in generic lambda. 1613 * pt.c (extract_locals_r): Don't record the local specs of variables 1614 declared within the pattern. 1615 16162018-04-05 Alexandre Oliva <aoliva@redhat.com> 1617 1618 PR c++/84979 1619 * pt.c (check_auto_in_tmpl_args): New. 1620 (tsubst_qualified_id): Use it to reject template args 1621 referencing auto for non-type templates. 1622 * parser.c (cp_parser_template_id): Likewise. 1623 * cp-tree.h (check_auto_in_tmpl_args): Declare. 1624 * typeck2.c (build_functional_cast): Report correct location 1625 for invalid use of auto. 1626 16272018-04-04 Jason Merrill <jason@redhat.com> 1628 1629 PR c++/85215 - ICE with copy-init from conversion. 1630 * call.c (merge_conversion_sequences): Fix type of direct binding 1631 sequence. 1632 1633 PR c++/84938 - ICE with division by ~-1. 1634 * call.c (set_up_extended_ref_temp): Call cp_fully_fold. 1635 1636 PR c++/84936 - ICE with unexpanded pack in mem-initializer. 1637 * parser.c (cp_parser_mem_initializer_list): Call 1638 check_for_bare_parameter_packs. 1639 16402018-04-04 Jakub Jelinek <jakub@redhat.com> 1641 1642 PR inline-asm/85172 1643 * constexpr.c (cxx_eval_builtin_function_call): For calls to 1644 builtin_valid_in_constant_expr_p functions, don't call 1645 cxx_eval_constant_expression if argument is not 1646 potential_constant_expression. 1647 1648 PR c++/85146 1649 * cp-tree.h (calculate_bases, calculate_direct_bases): Add complain 1650 argument. 1651 * semantics.c (calculate_bases): Add complain argument. Use 1652 complete_type_or_maybe_complain instead of just complete_type and 1653 return an empty vector if it fails. Move make_tree_vector () call 1654 after early return. Formatting fixes. 1655 (calculate_direct_bases): Likewise. Call release_tree_vector at the 1656 end. 1657 (dfs_calculate_bases_post, calculate_bases_helper): Formatting fixes. 1658 * pt.c (tsubst_pack_expansion): Adjust calculate_bases and 1659 calculate_direct_bases callers, formatting fixes. 1660 16612018-04-04 Jason Merrill <jason@redhat.com> 1662 1663 PR c++/85006 - -fconcepts ICE with A<auto...> return type 1664 * pt.c (tsubst_pack_expansion): Allow unsubstituted auto pack. 1665 1666 PR c++/85200 - ICE with constexpr if in generic lambda. 1667 * tree.c (cp_walk_subtrees): Walk into DECL_EXPR in templates. 1668 1669 PR c++/84221 - bogus -Wunused with attribute and template. 1670 * decl2.c (is_late_template_attribute): Handle unused and used 1671 normally on non-TYPE_DECL. 1672 1673 PR c++/85135 - ICE with omitted template arguments. 1674 * decl.c (grokdeclarator): Catch deduced class type in trailing 1675 return type. 1676 1677 PR c++/85133 - ICE with missing concept initializer. 1678 * decl.c (cp_finish_decl): If a concept initializer is missing, use 1679 true. 1680 1681 PR c++/85118 - wrong error with generic lambda and std::bind. 1682 * call.c (add_template_conv_candidate): Disable if there are any 1683 call operators. 1684 1685 PR c++/85141 - ICE with compound assignment and static member fn. 1686 * typeck.c (cp_build_modify_expr): Call decay_conversion for RHS of 1687 compound assignment. 1688 1689 PR c++/85148 - ICE with 'this' in array NSDMI. 1690 * tree.c (replace_placeholders_r): Use handled_component_p. 1691 16922018-04-04 Ville Voutilainen <ville.voutilainen@gmail.com> 1693 1694 PR c++/65923 1695 * decl.c (grokfndecl): Handle standard UDL diagnostics here.. 1696 * parser.c (cp_parser_unqualified_id): ..not here. 1697 16982018-04-04 Alexandre Oliva <aoliva@redhat.com> 1699 1700 PR c++/84943 1701 * typeck.c (cp_build_addr_expr_1): Mark FUNCTION_DECL as 1702 used. 1703 * decl2.c (mark_used): Return without effects if tf_conv. 1704 17052018-04-03 Jason Merrill <jason@redhat.com> 1706 1707 PR c++/85092 - C++17 ICE with unused list constructor. 1708 * call.c (conv_binds_ref_to_prvalue): Also count ck_identity 1709 from a TARGET_EXPR. 1710 1711 PR c++/85113 - ICE with constexpr and __builtin_constant_p. 1712 * constexpr.c (cxx_eval_builtin_function_call): Only defer 1713 __builtin_constant_p if ctx->quiet. 1714 17152018-04-03 Paolo Carlini <paolo.carlini@oracle.com> 1716 1717 PR c++/84768 1718 * pt.c (rewrite_template_parm): If the first argument is 1719 error_mark_node return it immediately. 1720 (build_deduction_guide): Check the return value of the 1721 latter for error_mark_node. 1722 (do_class_deduction): Check the return value of the latter. 1723 17242018-04-03 Jason Merrill <jason@redhat.com> 1725 1726 * semantics.c (finish_if_stmt_cond): Use 1727 instantiation_dependent_expression_p. 1728 1729 PR c++/85149 - generic lambda and constexpr if. 1730 * pt.c (build_extra_args, add_extra_args): Split from 1731 tsubst_pack_expansion. 1732 (tsubst_expr) [IF_STMT]: Use them. 1733 * cp-tree.h (IF_STMT_EXTRA_ARGS): New. 1734 1735 * typeck.c (merge_types): Limit matching attribute shortcut to 1736 the default case. 1737 17382018-04-03 Jakub Jelinek <jakub@redhat.com> 1739 1740 PR c++/85147 1741 * pt.c (fixed_parameter_pack_p_1): Punt if parm is error_mark_node. 1742 1743 PR c++/85140 1744 * name-lookup.c (handle_namespace_attrs): Return early if attributes 1745 is error_mark_node. 1746 1747 PR c++/85134 1748 * decl.c (cp_finish_decl): If ensure_literal_type_for_constexpr_object 1749 fails, after clearing DECL_DECLARED_CONSTEXPR_P don't return early, 1750 instead for static data members clear init and set DECL_EXTERNAL. 1751 17522018-04-02 Jason Merrill <jason@redhat.com> 1753 1754 PR c++/64095 - auto... parameter pack. 1755 * parser.c (cp_parser_parameter_declaration): Handle turning autos 1756 into packs here. 1757 (cp_parser_parameter_declaration_list): Not here. 1758 17592018-03-31 Alexandre Oliva <aoliva@redhat.com> 1760 1761 PR c++/85027 1762 * class.c (instantiate_type): Peel off SAVE_EXPR before 1763 BASELINK. 1764 17652018-03-30 Jason Merrill <jason@redhat.com> 1766 1767 * typeck2.c (process_init_constructor_record): Use 1768 init_list_type_node for the CONSTRUCTOR around an anonymous union 1769 designated initializer. 1770 17712018-03-30 Jakub Jelinek <jakub@redhat.com> 1772 1773 PR c++/84791 1774 * semantics.c (finish_omp_reduction_clause): If 1775 OMP_CLAUSE_REDUCTION_PLACEHOLDER is error_mark_node, return true 1776 even if processing_template_decl. 1777 17782018-03-29 David Malcolm <dmalcolm@redhat.com> 1779 1780 PR c++/84269 1781 * name-lookup.c (get_std_name_hint): Add names from <memory>, 1782 <tuple>, and <utility>. 1783 17842018-03-29 Jason Merrill <jason@redhat.com> 1785 1786 PR c++/85093 - too many template args with pack expansion. 1787 * pt.c (coerce_template_parms): Keep pack expansion args that will 1788 need to be empty. 1789 17902018-03-29 Jason Merrill <jason@redhat.com> 1791 1792 * pt.c (build_non_dependent_expr): Propagate expr location. 1793 17942018-03-27 Jason Merrill <jason@redhat.com> 1795 1796 PR c++/85060 - wrong-code with call to base member in template. 1797 * search.c (any_dependent_bases_p): Check uses_template_parms 1798 rather than processing_template_decl. 1799 18002018-03-29 David Malcolm <dmalcolm@redhat.com> 1801 1802 PR c++/85110 1803 * typeck.c (convert_for_assignment): When complaining due to 1804 conversions for an argument, attempt to use the location of the 1805 argument. 1806 18072018-03-28 Paolo Carlini <paolo.carlini@oracle.com> 1808 1809 PR c++/85028 1810 * pt.c (tsubst_default_argument): Early return if the type of the 1811 parameter is erroneous. 1812 18132018-03-28 Alexandre Oliva <aoliva@redhat.com> 1814 1815 PR c++/84973 1816 * decl2.c (note_vague_linkage_fn): Don't defer uninstantiated 1817 templates. 1818 1819 PR c++/84968 1820 * tree.c (strip_typedefs_expr): Reject STATEMENT_LISTs. 1821 18222018-03-27 Paolo Carlini <paolo.carlini@oracle.com> 1823 1824 PR c++/85067 1825 * method.c (defaulted_late_check): Partially revert r253321 changes, 1826 do not early return upon error. 1827 18282018-03-27 Jakub Jelinek <jakub@redhat.com> 1829 1830 PR c++/85077 1831 * cp-gimplify.c (cp_fold) <case CONSTRUCTOR>: For ctors with vector 1832 type call fold to generate VECTOR_CSTs when possible. 1833 1834 PR c++/85076 1835 * tree.c (cp_build_reference_type): If to_type is error_mark_node, 1836 return it right away. 1837 18382018-03-27 Volker Reichelt <v.reichelt@netcologne.de> 1839 1840 * search.c (check_final_overrider): Use inform instead of error 1841 for the diagnostics of the overridden functions. Tweak wording. 1842 18432018-03-27 Jakub Jelinek <jakub@redhat.com> 1844 1845 PR c++/85068 1846 * class.c (update_vtable_entry_for_fn): Don't ICE if base_binfo 1847 is NULL. Assert if thunk_binfo is NULL then errorcount is non-zero. 1848 18492018-03-27 Paolo Carlini <paolo.carlini@oracle.com> 1850 Jason Merrill <jason@redhat.com> 1851 1852 PR c++/84632 1853 * init.c (build_aggr_init): When initializing from array, 1854 reject anything but CONSTRUCTORs and TARGET_EXPRs. 1855 (build_vec_init): Handle separately ARRAY_TYPEs. 1856 18572018-03-26 Jason Merrill <jason@redhat.com> 1858 1859 PR c++/85062 - ICE with alignas in wrong place. 1860 * decl.c (grokdeclarator): Ignore attributes on type-specifiers 1861 here. 1862 1863 PR c++/85049 - ICE with __integer_pack. 1864 * pt.c (unify_pack_expansion): Don't try to deduce generated packs. 1865 * cp-tree.h (TEMPLATE_PARM_P): New. 1866 18672018-03-23 Jason Merrill <jason@redhat.com> 1868 1869 PR c++/78489 - wrong SFINAE behavior. 1870 1871 PR c++/84489 1872 * pt.c (type_unification_real): Don't defer substitution failure. 1873 18742018-03-23 Jakub Jelinek <jakub@redhat.com> 1875 1876 PR c++/85015 1877 * decl.c (compute_array_index_type): Set osize to mark_rvalue_use 1878 result. 1879 1880 PR c++/84942 1881 * pt.c (tsubst_copy_and_build) <case FIX_TRUNC_EXPR>: Replace 1882 cp_build_unary_op call with gcc_unreachable (). 1883 18842018-03-23 Marek Polacek <polacek@redhat.com> 1885 1886 PR c++/85045 1887 * cxx-pretty-print.c (cxx_pretty_printer::multiplicative_expression): 1888 Handle EXACT_DIV_EXPR and RDIV_EXPR. Tweak condition. 1889 (cxx_pretty_printer::expression): Handle EXACT_DIV_EXPR and RDIV_EXPR. 1890 18912018-03-23 Ville Voutilainen <ville.voutilainen@gmail.com> 1892 1893 Implement P0962 1894 * parser.c (cp_parser_perform_range_for_lookup): Change 1895 the condition for deciding whether to use members. 1896 18972018-03-23 Marek Polacek <polacek@redhat.com> 1898 1899 PR c++/85033 1900 * semantics.c (finish_offsetof): Don't allow CONST_DECLs. 1901 19022018-03-23 Alexandre Oliva <aoliva@redhat.com> 1903 1904 PR c++/71251 1905 * parser.c (cp_parser_alias_declaration): Call 1906 parser_check_template_parameters. 1907 1908 PR c++/84789 1909 * pt.c (resolve_typename_type): Drop assert that stopped 1910 simplification to template-independent types. Add assert to 1911 verify the initial scope is template dependent. 1912 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): 1913 Reparse the id expression as a type-name, not a declarator. 1914 1915 PR c++/84729 1916 * init.c (build_vec_init): Error at parenthesized array init. 1917 1918 PR c++/84610 1919 PR c++/84642 1920 PR c++/84942 1921 * cp-tree.h (temp_override): New template class, generalizing 1922 a cleanup that was only used... 1923 * parser.c (cp_parser_parameter_declaration_clause): 1924 ... here for auto_is_implicit_function_template_parm_p. 1925 (cp_parser_gnu_attributes_opt): Use it here as well. 1926 (cp_parser_std_attribute): Likewise. 1927 19282018-03-22 Marek Polacek <polacek@redhat.com> 1929 1930 PR c++/84854 1931 * semantics.c (finish_if_stmt_cond): Check if the type of the condition 1932 is boolean. 1933 19342018-03-21 Jason Merrill <jason@redhat.com> 1935 1936 PR c++/81311 - wrong C++17 overload resolution. 1937 * call.c (build_user_type_conversion_1): Remove C++17 code. 1938 (conv_binds_ref_to_prvalue): New. 1939 (build_over_call): Handle C++17 copy elision. 1940 (build_special_member_call): Only do C++17 copy elision here if the 1941 argument is already the right type. 1942 19432018-03-21 Alexandre Oliva <aoliva@redhat.com> 1944 1945 PR c++/71965 1946 * init.c (build_vec_init): Silence error, former sorry, 1947 without tf_error. 1948 1949 PR c++/84610 1950 PR c++/84642 1951 * parser.c (abort_fully_implicit_template_p): New. 1952 (cp_parser_skip_to_end_of_statement): Use it. 1953 (cp_parser_skip_to_end_of_block_or_statement): Likewise. 1954 (finish_fully_implicit_template_p): Clear 1955 implicit_template_parms and implicit_template_scope. 1956 19572018-03-21 Paolo Carlini <paolo.carlini@oracle.com> 1958 1959 PR c++/84972 1960 * decl.c (maybe_deduce_size_from_array_init): Set TREE_TYPE to 1961 error_mark_node when check_array_designated_initializer fails. 1962 19632018-03-21 Jakub Jelinek <jakub@redhat.com> 1964 1965 PR c++/84961 1966 * cp-tree.h (genericize_compound_lvalue): Declare. 1967 * typeck.c (genericize_compound_lvalue): New function. 1968 (unary_complex_lvalue, cp_build_modify_expr): Use it. 1969 * semantics.c (finish_asm_stmt): Replace MODIFY_EXPR, PREINCREMENT_EXPR 1970 and PREDECREMENT_EXPR in output and "m" constrained input operands with 1971 COMPOUND_EXPR. Call cxx_mark_addressable on the rightmost 1972 COMPOUND_EXPR operand. 1973 19742018-03-21 Nathan Sidwell <nathan@acm.org> 1975 1976 PR c++/85008 1977 * tree.c (decl_linkage): Use DECL_CLONED_FUNCTION_P. 1978 * decl2.c (vague_linkage_p): Likewise. 1979 19802018-03-21 David Malcolm <dmalcolm@redhat.com> 1981 1982 PR c++/84994 1983 * constexpr.c (constexpr_fn_retval): Make non-"static". 1984 * cp-tree.h (constexpr_fn_retval): New decl. 1985 * search.c (direct_accessor_p): Update leading comment. 1986 (reference_accessor_p): Likewise. 1987 (field_accessor_p): Replace check that function body is a 1988 RETURN_EXPR with a call to constexpr_fn_retval. Fix 1989 indentation of "field_type" decl. 1990 19912018-03-21 Nathan Sidwell <nathan@acm.org> 1992 1993 PR c++/84804 1994 * name-lookup.c (do_pushtag): Permit lambdas to be pushed into 1995 complete classes. 1996 19972018-03-21 Martin Sebor <msebor@redhat.com> 1998 1999 PR c++/84850 2000 * call.c (first_non_public_field): New template and function. 2001 (first_non_trivial_field): New function. 2002 (maybe_warn_class_memaccess): Call them. 2003 20042018-03-21 David Malcolm <dmalcolm@redhat.com> 2005 2006 PR c++/84892 2007 * search.c (field_accessor_p): Use class_of_this_parm rather than 2008 type_of_this_parm, to check that "this" is a "const T *", rather 2009 than a "T *const". 2010 20112018-03-21 Nathan Sidwell <nathan@acm.org> 2012 2013 * class.c (finish_struct_anon_r): Refactor, deprecate anything 2014 other than public non-static data members. 2015 * parser.c (cp_parser_init_declarator): Deprecate attributes after 2016 parenthesized initializer. 2017 2018 PR c++/84836 2019 * name-lookup.c (update_binding): Correct logic for local binding 2020 update. 2021 20222018-03-21 Marek Polacek <polacek@redhat.com> 2023 2024 PR c++/71638, ICE with NSDMI and reference. 2025 * constexpr.c (cxx_eval_bare_aggregate): Update constructor's flags 2026 even when we replace an element. 2027 20282018-03-20 Marek Polacek <polacek@redhat.com> 2029 2030 PR c++/84978, ICE with NRVO. 2031 * constexpr.c (cxx_eval_constant_expression): Handle the case when 2032 a RESULT_DECL isn't in the hash map. 2033 20342018-03-20 Jason Merrill <jason@redhat.com> 2035 2036 PR c++/84978, ICE with NRVO. 2037 * cvt.c (cp_get_fndecl_from_callee): Add fold parameter. 2038 (cp_get_callee_fndecl_nofold): New. 2039 * cp-gimplify.c (cp_genericize_r): Use it instead. 2040 * call.c (check_self_delegation): Likewise. 2041 20422018-03-20 Nathan Sidwell <nathan@acm.org> 2043 2044 PR c++/84962 2045 * name-lookup.c (pushdecl_class_level): Push anon-struct's 2046 member_vec, if there is one. 2047 2048 PR c++/84970 2049 * cp-tree.h (lookup_list_keep): Declare. 2050 * tree.c (lookup_list_keep): New, broken out of ... 2051 (build_min): ... here. Call it. 2052 * decl.c (cp_finish_decl): Call lookup_list_keep. 2053 20542018-03-19 Jason Merrill <jason@redhat.com> 2055 2056 PR c++/84937 - ICE with class deduction and auto. 2057 * pt.c (rewrite_template_parm): Fix auto handling. 2058 20592018-03-19 Marek Polacek <polacek@redhat.com> 2060 2061 PR c++/84925 2062 * pt.c (enclosing_instantiation_of): Check if fn is null. 2063 2064 PR c++/84927 2065 * constexpr.c (cxx_eval_bare_aggregate): Update constructor's flags 2066 as we evaluate the elements. 2067 (cxx_eval_constant_expression): Verify constructor's flags 2068 unconditionally. 2069 20702018-03-19 Jason Merrill <jason@redhat.com> 2071 2072 PR c++/71834 - template-id with too few arguments. 2073 * pt.c (coerce_template_parms): Check fixed_parameter_pack_p. 2074 20752018-03-19 Nathan Sidwell <nathan@acm.org> 2076 2077 PR c++/84835 2078 * lambda.c (maybe_add_lambda_conv_op): Force C++ linkage. 2079 * pt.c (build_template_decl): Propagate language linkage. 2080 2081 PR c++/84812 2082 * name-lookup.c (set_local_extern_decl_linkage): Defend against 2083 ambiguous lookups. 2084 20852018-03-16 Jakub Jelinek <jakub@redhat.com> 2086 2087 PR c/84910 2088 * parser.c (cp_parser_lambda_introducer): Remove trailing space from 2089 diagnostics. 2090 * method.c (synthesize_method): Likewise. 2091 * pt.c (convert_nontype_argument): Likewise. 2092 20932018-03-16 Jason Merrill <jason@redhat.com> 2094 2095 PR c++/84720 - ICE with rvalue ref non-type argument. 2096 * pt.c (invalid_nontype_parm_type_p): Prohibit rvalue reference. 2097 (convert_nontype_argument): Revert earlier change. 2098 2099 PR c++/80227 - SFINAE and negative array size. 2100 * decl.c (compute_array_index_type): Use 2101 build_converted_constant_expr and valid_constant_size_p. 2102 2103 PR c++/84906 - silent wrong code with ambiguous conversion. 2104 * call.c (build_user_type_conversion_1): Set need_temporary_p on 2105 ambiguous conversion. 2106 (convert_like_real): Check it. 2107 2108 PR c++/83937 - wrong C++17 handling of init-list ctor argument. 2109 * call.c (build_special_member_call): Don't convert an init-list 2110 argument directly to the class type. 2111 21122018-03-16 Jakub Jelinek <jakub@redhat.com> 2113 2114 PR c++/79937 2115 PR c++/82410 2116 * cp-tree.h (CONSTRUCTOR_PLACEHOLDER_BOUNDARY): Define. 2117 (find_placeholder): Declare. 2118 * tree.c (struct replace_placeholders_t): Add exp member. 2119 (replace_placeholders_r): Don't walk into ctors with 2120 CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag set, unless they are equal to 2121 d->exp. Replace PLACEHOLDER_EXPR with unshare_expr (x) rather than x. 2122 (replace_placeholders): Initialize data.exp. 2123 (find_placeholders_r, find_placeholders): New functions. 2124 * typeck2.c (process_init_constructor_record, 2125 process_init_constructor_union): Set CONSTRUCTOR_PLACEHOLDER_BOUNDARY 2126 if adding NSDMI on which find_placeholder returns true. 2127 * call.c (build_over_call): Don't call replace_placeholders here. 2128 * cp-gimplify.c (cp_genericize_r): Set TARGET_EXPR_NO_ELIDE on 2129 TARGET_EXPRs with CONSTRUCTOR_PLACEHOLDER_BOUNDARY set on 2130 TARGET_EXPR_INITIAL. 2131 (cp_fold): Copy over CONSTRUCTOR_PLACEHOLDER_BOUNDARY bit to new 2132 ctor. 2133 21342018-03-16 Jason Merrill <jason@redhat.com> 2135 2136 PR c++/83911 - ICE with multiversioned constructor. 2137 * cp-gimplify.c (cp_genericize_r): Replace versioned function with 2138 dispatchere here. 2139 * call.c (build_over_call): Not here. 2140 21412018-03-16 Jakub Jelinek <jakub@redhat.com> 2142 2143 PR c++/84874 2144 * decl.c (reshape_init_class): Don't assert d->cur->index == field 2145 if d->cur->index is a FIELD_DECL, instead set field to d->cur->index. 2146 21472018-03-15 Jakub Jelinek <jakub@redhat.com> 2148 2149 PR c++/84222 2150 * cp-tree.h (cp_warn_deprecated_use): Declare. 2151 * tree.c (cp_warn_deprecated_use): New function. 2152 * typeck2.c (build_functional_cast): Use it. 2153 * decl.c (grokparms): Likewise. 2154 (grokdeclarator): Likewise. Temporarily push nested class scope 2155 around grokparms call for out of class member definitions. 2156 21572018-03-14 Jason Merrill <jason@redhat.com> 2158 2159 PR c++/84820 - no error for invalid qualified-id. 2160 * parser.c (cp_parser_make_indirect_declarator): Don't wrap 2161 cp_error_declarator. 2162 2163 PR c++/84801 - ICE with unexpanded pack in lambda. 2164 * pt.c (check_for_bare_parameter_packs): Don't return early for a 2165 lambda in non-template context. 2166 2167 PR c++/81236 - auto variable and auto function 2168 * pt.c (tsubst_baselink): Update the type of the BASELINK after 2169 mark_used. 2170 21712018-03-14 Jason Merrill <jason@redhat.com> 2172 2173 PR c++/83916 - ICE with template template parameters. 2174 * pt.c (convert_template_argument): Don't substitute into type of 2175 non-type parameter if we don't have enough arg levels. 2176 (unify): Likewise. 2177 21782018-03-14 Marek Polacek <polacek@redhat.com> 2179 2180 PR c++/84596 2181 * semantics.c (finish_static_assert): Check 2182 instantiation_dependent_expression_p instead of 2183 {type,value}_dependent_expression_p. 2184 21852018-03-13 Paolo Carlini <paolo.carlini@oracle.com> 2186 Jason Merrill <jason@redhat.com> 2187 2188 PR c++/82336 - link error with list-init default argument. 2189 * decl.c (check_default_argument): Unshare an initializer list. 2190 21912018-03-13 Jakub Jelinek <jakub@redhat.com> 2192 2193 PR c++/84843 2194 * decl.c (duplicate_decls): For redefinition of built-in, use error 2195 and return error_mark_node. For redeclaration, return error_mark_node 2196 rather than olddecl if !flag_permissive. 2197 21982018-03-13 Jason Merrill <jason@redhat.com> 2199 2200 PR c++/82565 - ICE with concepts and generic lambda. 2201 * pt.c (instantiate_decl): Clear fn_context for lambdas. 2202 22032018-03-13 Jason Merrill <jason@redhat.com> 2204 2205 PR c++/84720 - ICE with rvalue ref non-type argument. 2206 * pt.c (convert_nontype_argument): Handle rvalue references. 2207 2208 PR c++/84839 - ICE with decltype of parameter pack. 2209 * pt.c (tsubst_pack_expansion): Set cp_unevaluated_operand while 2210 instantiating dummy parms. 2211 2212 * parser.c (cp_parser_simple_type_specifier): Pedwarn about auto 2213 parameter even without -Wpedantic. 2214 2215 PR c++/84798 - ICE with auto in abstract function declarator. 2216 * parser.c (cp_parser_parameter_declaration_clause): Check 2217 parser->default_arg_ok_p. 2218 22192018-03-13 Jakub Jelinek <jakub@redhat.com> 2220 2221 PR c++/84808 2222 * constexpr.c (find_array_ctor_elt): Don't use elt reference after 2223 first potential CONSTRUCTOR_ELTS reallocation. Convert dindex to 2224 sizetype. Formatting fixes. 2225 22262018-03-12 Jason Merrill <jason@redhat.com> 2227 2228 PR c++/84355 - ICE with deduction for member class template. 2229 * pt.c (tsubst) [TEMPLATE_TYPE_PARM]: Always substitute into 2230 CLASS_PLACEHOLDER_TEMPLATE. 2231 2232 PR c++/84802 - ICE capturing uninstantiated class. 2233 * lambda.c (build_capture_proxy): Call complete_type. 2234 22352018-03-09 Jason Merrill <jason@redhat.com> 2236 2237 PR c++/84770 - ICE with typedef and parameter pack. 2238 * pt.c (verify_unstripped_args_1): Split out from 2239 verify_unstripped_args. 2240 2241 PR c++/84785 - ICE with alias template and default targs. 2242 * pt.c (type_unification_real): Set processing_template_decl if 2243 saw_undeduced == 1. 2244 2245 PR c++/84752 - ICE with capture of constexpr array. 2246 * call.c (standard_conversion): Set rvaluedness_matches_p on the 2247 identity conversion under ck_lvalue. 2248 22492018-03-09 Jason Merrill <jason@redhat.com> 2250 Paolo Carlini <paolo.carlini@oracle.com> 2251 2252 PR c++/71169 2253 PR c++/71832 2254 * pt.c (any_erroneous_template_args_p): New. 2255 * cp-tree.h (any_erroneous_template_args_p): Declare it. 2256 * parser.c (cp_parser_class_specifier_1): Use it. 2257 22582018-03-09 Jason Merrill <jason@redhat.com> 2259 2260 PR c++/84726 - unnecessary capture of constant vars. 2261 * cp-tree.h (LAMBDA_CAPTURE_EXPLICIT_P) 2262 (LAMBDA_EXPR_CAPTURE_OPTIMIZED): New. 2263 * expr.c (mark_use): Set LAMBDA_EXPR_CAPTURE_OPTIMIZED. 2264 * lambda.c (is_constant_capture_proxy) 2265 (current_lambda_expr, var_to_maybe_prune, mark_const_cap_r) 2266 (prune_lambda_captures): New. 2267 (finish_lambda_function): Call prune_lambda_captures. 2268 22692018-03-09 Jason Merrill <jason@redhat.com> 2270 Jakub Jelinek <jakub@redhat.com> 2271 2272 PR c++/84076 2273 * call.c (convert_arg_to_ellipsis): Instead of cp_build_addr_expr 2274 build ADDR_EXPR with REFERENCE_TYPE. 2275 (build_over_call): For purposes of check_function_arguments, if 2276 argarray[j] is ADDR_EXPR with REFERENCE_TYPE created above, use 2277 its operand rather than the argument itself. 2278 22792018-03-09 Jakub Jelinek <jakub@redhat.com> 2280 2281 PR c++/84724 2282 * decl.c (duplicate_decls): Don't override __* prefixed builtins 2283 except for __[^b]*_chk, instead issue permerror and for -fpermissive 2284 also a note and return olddecl. 2285 22862018-03-09 Nathan Sidwell <nathan@acm.org> 2287 2288 PR c++/84733 2289 * name-lookup.c (do_pushdecl_with_scope): Only clear 2290 current_function_decl when pushing a non-class (i.e. namespace) 2291 scope. 2292 22932018-03-08 Jason Merrill <jason@redhat.com> 2294 Jakub Jelinek <jakub@redhat.com> 2295 2296 PR c++/80598 2297 * call.c (build_over_call): In templates set TREE_USED (first_fn) when 2298 not calling mark_used for the benefit of -Wunused-function warning. 2299 23002018-03-06 Jason Merrill <jason@redhat.com> 2301 2302 * lambda.c (is_capture_proxy_with_ref): Remove. 2303 * constexpr.c, expr.c, cp-tree.h, semantics.c: Adjust. 2304 23052018-03-06 Marek Polacek <polacek@redhat.com> 2306 2307 PR c++/84684 2308 * constexpr.c (cxx_bind_parameters_in_call): Unshare evaluated 2309 arguments. 2310 23112018-03-06 Alexandre Oliva <aoliva@redhat.com> 2312 2313 PR c++/84231 2314 * tree.c (lvalue_kind): Use presence/absence of REFERENCE_TYPE 2315 only while processing template decls. 2316 * typeck.c (build_x_conditional_expr): Move wrapping of 2317 reference type around type... 2318 * call.c (build_conditional_expr_1): ... here. Rename 2319 is_lvalue to is_glvalue. 2320 * parser.c (cp_parser_fold_expression): Catch REFERENCE_REF_P 2321 INDIRECT_REF of COND_EXPR too. 2322 2323 PR c++/84593 2324 * init.c (build_zero_init_1): Zero-initialize references. 2325 2326 PR c++/84492 2327 * semantics.c (finish_stmt_expr_expr): Reject unresolved 2328 overloads used as stmt expr values. 2329 23302018-03-05 Jason Merrill <jason@redhat.com> 2331 2332 PR c++/84708 - ICE with lambda in local class NSDMI. 2333 * lambda.c (lambda_expr_this_capture): Handle local class NSDMI 2334 context. 2335 23362018-03-05 Jakub Jelinek <jakub@redhat.com> 2337 2338 PR c++/84684 2339 * constexpr.c (constexpr_call_hasher::equal): Return false if 2340 lhs->hash != rhs->hash. Change return 1 to return true and 2341 return 0 to return false. 2342 23432018-03-05 Nathan Sidwell <nathan@acm.org> 2344 2345 PR c++/84702 2346 * pt.c (process_template_arg): Mark lookup_keep on a default arg. 2347 23482018-03-05 Marek Polacek <polacek@redhat.com> 2349 2350 PR c++/84707 2351 * decl.c (duplicate_decls): Check DECL_NAME before accessing 2352 UDLIT_OPER_P. 2353 23542018-03-05 Nathan Sidwell <nathan@acm.org> 2355 2356 PR c++/84694 2357 * friend.c (do_friend): Restore check for identifier_p inside 2358 TEMPLATE_ID_EXPR. 2359 23602018-03-05 Paolo Carlini <paolo.carlini@oracle.com> 2361 2362 PR c++/84618 2363 * parser.c (cp_parser_lambda_introducer): Reject any capture not 2364 involving a VAR_DECL or a PARM_DECL. 2365 23662018-03-05 Pádraig Brady <P@draigBrady.com> 2367 Jason Merrill <jason@redhat.com> 2368 Nathan Sidwell <nathan@acm.org> 2369 2370 PR c++/84497 2371 * decl2.c (get_tls_init_fn): Check TYPE_HAS_TRIVIAL_DFLT too. 2372 23732018-03-03 Jason Merrill <jason@redhat.com> 2374 2375 PR c++/84686 - missing volatile loads. 2376 * cvt.c (convert_to_void): Call maybe_undo_parenthesized_ref. 2377 23782018-03-03 Paolo Carlini <paolo.carlini@oracle.com> 2379 2380 PR c++/71464 2381 * optimize.c (maybe_thunk_body): Bail out immediately if either 2382 fns[0] or fns[1] is null. 2383 23842018-03-02 Marek Polacek <polacek@redhat.com> 2385 2386 PR c++/84578 2387 * constexpr.c (get_array_or_vector_nelts): New. 2388 (cxx_eval_array_reference): Use it. 2389 (cxx_eval_vec_init_1): Likewise. 2390 (cxx_eval_store_expression): Likewise. 2391 23922018-03-02 Jason Merrill <jason@redhat.com> 2393 2394 * semantics.c (force_paren_expr): Remove redundant test. 2395 23962018-03-02 Marek Polacek <polacek@redhat.com> 2397 2398 PR c++/84663 2399 * decl.c (cp_complete_array_type): Check error_mark_node. 2400 2401 PR c++/84664 2402 * typeck.c (cp_perform_integral_promotions): Check the result of 2403 mark_rvalue_use. 2404 24052018-03-02 Jakub Jelinek <jakub@redhat.com> 2406 2407 PR c++/84662 2408 * pt.c (tsubst_copy_and_build) <case TEMPLATE_ID_EXPR>: Use 2409 RETURN instead of return. 2410 <case POINTER_PLUS_EXPR>: Likewise. 2411 <case CONVERT_EXPR>: If op0 is error_mark_node, just return 2412 it instead of wrapping it into CONVERT_EXPR. 2413 24142018-03-02 Jason Merrill <jason@redhat.com> 2415 2416 Fix MIPS16 ICE. 2417 * pt.c (type_dependent_expression_p): Check DECL_LANG_SPECIFIC. 2418 24192018-03-02 Marek Polacek <polacek@redhat.com> 2420 2421 PR c++/84590 2422 * cp-gimplify.c (cp_fully_fold): Unwrap TARGET_EXPR or a CONSTRUCTOR 2423 wrapped in VIEW_CONVERT_EXPR. 2424 24252018-03-01 Martin Sebor <msebor@redhat.com> 2426 2427 PR c++/84294 2428 * decl.c (check_redeclaration_no_default_args): Merge attributes 2429 specified on redeclarations of the same function template. 2430 Remove dead code. 2431 24322018-03-01 Marek Polacek <polacek@redhat.com> 2433 Jason Merrill <jason@redhat.com> 2434 2435 PR c++/84582 2436 * semantics.c (force_paren_expr): Create a PAREN_EXPR when in 2437 a template. 2438 (maybe_undo_parenthesized_ref): Unwrap PAREN_EXPR. 2439 * typeck2.c (store_init_value): Call fold_non_dependent_expr instead 2440 of instantiate_non_dependent_expr. 2441 * tree.c (lvalue_kind): Handle PAREN_EXPR like NON_DEPENDENT_EXPR. 2442 24432018-03-01 Nathan Sidwell <nathan@acm.org> 2444 2445 PR c++/84434 2446 * name-lookup.c (member_vec_dedup): Remove manually peeled 2447 iteration. Ignore dependent ctor inheritance. 2448 24492018-03-01 Jason Merrill <jason@redhat.com> 2450 2451 PR c++/71569 - decltype of template. 2452 * parser.c (cp_parser_decltype_expr): Handle missing template args. 2453 24542018-03-01 Marek Polacek <polacek@redhat.com> 2455 2456 PR c++/84596 2457 * constexpr.c (require_rvalue_constant_expression): New function. 2458 * cp-tree.h: Declare it. 2459 * semantics.c (finish_static_assert): Use it instead of 2460 require_potential_rvalue_constant_expression. 2461 24622018-03-01 Jason Merrill <jason@redhat.com> 2463 Alexandre Oliva <aoliva@redhat.com> 2464 2465 PR c++/71569 - ICE with redundant args on member variable template. 2466 * decl.c (start_decl): Handle partial specialization of member 2467 variable template. 2468 * pt.c (determine_specialization): Allow partial specialization 2469 of member variable template without specializing enclosing class. 2470 (process_partial_specialization): Improve error message. 2471 24722018-02-28 Jason Merrill <jason@redhat.com> 2473 2474 PR c++/71784 - ICE with ref-qualifier and explicit specialization. 2475 * pt.c (determine_specialization): Check ref-qualifier. 2476 24772018-02-28 Jakub Jelinek <jakub@redhat.com> 2478 2479 PR c++/84609 2480 * parser.c (cp_parser_attributes_opt): Formatting fix. 2481 (cp_parser_skip_balanced_tokens, cp_parser_skip_gnu_attributes_opt, 2482 cp_parser_skip_std_attribute_spec_seq, cp_parser_skip_attributes_opt): 2483 New functions. 2484 (cp_parser_member_declaration): Use cp_parser_skip_attributes_opt 2485 instead of tentative parse to peek over optional attribute tokens 2486 to check for CPP_COLON after them. 2487 2488 PR c++/83871 2489 PR c++/83503 2490 * pt.c (INCLUDE_STRING): Remove define. 2491 (warn_spec_missing_attributes): Use pretty_printer instead of 2492 std::string. Fix up inform call so that the list of attributes 2493 is in %s argument. 2494 24952018-02-28 Martin Sebor <msebor@redhat.com> 2496 2497 PR testsuite/84617 2498 * decl.c (duplicate_decls): Fully merge attributes const, pure, 2499 and malloc. 2500 25012018-02-28 Nathan Sidwell <nathan@acm.org> 2502 2503 PR c++/84602 2504 * name-lookup.h (search_anon_aggr): Add defaulted WANT_TYPE arg. 2505 * name-lookup.c (fields_linear_search): Look in an anon-aggr 2506 regardless of want_type. 2507 (search_anon_aggr): Just use get_class_binding_direct. 2508 25092018-02-28 Jakub Jelinek <jakub@redhat.com> 2510 2511 * decl.c (cp_finish_decomp): Don't adjust eltscnt when calling 2512 inform_n. 2513 25142018-02-27 Martin Sebor <msebor@redhat.com> 2515 2516 * pt.c: Avoid including <string> directly. 2517 25182018-02-27 Martin Sebor <msebor@redhat.com> 2519 2520 PR c++/83871 2521 PR c++/83503 2522 * cp-tree.h (warn_spec_missing_attributes): New function. 2523 ((check_explicit_specialization): Add an argument. Call the above 2524 function. 2525 * decl.c (duplicate_decls): Avoid applying primary function template's 2526 attributes to its explicit specializations. 2527 cp/pt.c (warn_spec_missing_attributes): Define. 2528 25292018-02-27 Håkon Sandsmark <hsandsmark@gmail.com> 2530 2531 PR c++/71546 - lambda init-capture with qualified-id. 2532 * parser.c (cp_parser_lambda_introducer): Clear scope after 2533 each lambda capture. 2534 25352018-02-27 Nathan Sidwell <nathan@acm.org> 2536 2537 PR c++/84426 2538 * name-lookup.h (get_member_slot): Rename ... 2539 (find_member_slot): ... here. 2540 (add_member_slot): New. 2541 * name-lookup.c (member_vec_linear_search): No need to check for 2542 NULL slot. 2543 (get_member_slot): Rename ... 2544 (find_member_slot): ... here. Don't add slot for incomplete class. 2545 (add_member_slot): New. 2546 * class.c (add_method): Adjust get_member_slot rename. Bail out 2547 if push_class_level_binding fails. Create slot and grok 2548 properties once we're committed to insertion. 2549 25502018-02-27 Jason Merrill <jason@redhat.com> 2551 2552 PR c++/84489 - dependent default template argument 2553 * pt.c (type_unification_real): Handle early substitution failure. 2554 25552018-02-26 Jason Merrill <jason@redhat.com> 2556 2557 PR c++/84560 - ICE capturing multi-dimensional VLA. 2558 * tree.c (array_of_runtime_bound_p): False if the element is 2559 variably-modified. 2560 2561 PR c++/84441 - ICE with base initialized from ?: 2562 * call.c (unsafe_copy_elision_p): Handle COND_EXPR. 2563 2564 PR c++/84520 - ICE with generic lambda in NSDMI. 2565 * lambda.c (lambda_expr_this_capture): Don't look for fake NSDMI 2566 'this' in a generic lambda instantiation. 2567 2568 PR c++/84559 - ICE with constexpr VLA. 2569 * constexpr.c (ensure_literal_type_for_constexpr_object): Check 2570 for constexpr variable with VLA type. 2571 25722018-02-26 Jakub Jelinek <jakub@redhat.com> 2573 2574 PR c++/84558 2575 * constexpr.c (cxx_eval_vec_init_1): For reuse, treat NULL eltinit like 2576 a valid constant initializer. Formatting fixes. 2577 25782018-02-26 Paolo Carlini <paolo.carlini@oracle.com> 2579 2580 PR c++/84540 2581 * pt.c (tsubst_attributes): Handle correctly tsubst_attribute 2582 returning NULL_TREE. 2583 (apply_late_template_attributes): Likewise. 2584 25852018-02-26 Jakub Jelinek <jakub@redhat.com> 2586 2587 PR c++/84557 2588 * parser.c (cp_parser_omp_var_list_no_open): Only call 2589 cp_parser_lookup_name_simple on names satisfying identifier_p. 2590 (cp_parser_oacc_routine): Likewise. 2591 25922018-02-26 Jason Merrill <jason@redhat.com> 2593 2594 PR c++/84551 - ICE with concepts and -g. 2595 * parser.c (add_debug_begin_stmt): Do nothing in a concept. 2596 25972018-02-26 Marek Polacek <polacek@redhat.com> 2598 2599 PR c++/84325 2600 * tree.c (replace_placeholders_r): Only check TREE_CONSTANT on 2601 non-types. 2602 26032018-02-26 Jason Merrill <jason@redhat.com> 2604 2605 PR c++/84447 - ICE with deleted inherited ctor with default arg. 2606 * call.c (build_over_call): Handle deleted functions in one place. 2607 26082018-02-26 Paolo Carlini <paolo.carlini@oracle.com> 2609 2610 PR c++/84533 2611 * decl.c (redeclaration_error_message): Don't try to use 2612 DECL_DECLARED_CONSTEXPR_P on CONST_DECLs. 2613 26142018-02-26 Paolo Carlini <paolo.carlini@oracle.com> 2615 2616 * lambda.c (build_capture_proxy): Define static. 2617 * cp-tree.h (build_capture_proxy): Remove. 2618 26192018-02-26 Marek Polacek <polacek@redhat.com> 2620 2621 PR c++/84537 2622 * name-lookup.c (suggest_alternative_in_explicit_scope): Return false 2623 if name is error node. 2624 26252018-02-25 Jason Merrill <jason@redhat.com> 2626 2627 PR c++/84015 - ICE with class deduction and auto template parm. 2628 * pt.c (rewrite_template_parm): Use tf_partial in first tsubst. 2629 26302018-02-24 Marek Polacek <polacek@redhat.com> 2631 2632 PR c++/83692 2633 * constexpr.c (maybe_constant_init_1): New function. 2634 (maybe_constant_init): Make it a wrapper around maybe_constant_init_1. 2635 (cxx_constant_init): New function. 2636 * cp-tree.h (cxx_constant_init): Declare. 2637 * typeck2.c (store_init_value): Call cxx_constant_init instead of 2638 cxx_constant_value. Move the maybe_constant_init call under an 'else'. 2639 26402018-02-22 Jason Merrill <jason@redhat.com> 2641 2642 PR c++/70468 - ICE with constructor delegation via typedef. 2643 * pt.c (tsubst_initializer_list): Check for other mem-initializers 2644 with constructor delegation. 2645 26462018-02-22 Jason Merrill <jason@redhat.com> 2647 2648 PR c++/84424 - ICE with constexpr and __builtin_shuffle. 2649 * constexpr.c (reduced_constant_expression_p): Handle CONSTRUCTOR of 2650 VECTOR_TYPE. 2651 26522018-02-22 Marek Polacek <polacek@redhat.com> 2653 2654 PR c++/84493 2655 * parser.c (cp_parser_braced_list): Use require_open instead of 2656 consume_open. 2657 26582018-02-21 Jason Merrill <jason@redhat.com> 2659 2660 PR c++/84454 - ICE with pack expansion in signature. 2661 * error.c (find_typenames_r): Also stop on EXPR_PACK_EXPANSION. 2662 26632018-02-20 Siddhesh Poyarekar <siddhesh@sourceware.org> 2664 2665 * cp-objcp-common.c (cxx_block_may_fallthru): Add case for 2666 IF_STMT. 2667 26682018-02-20 Paolo Carlini <paolo.carlini@oracle.com> 2669 2670 PR c++/84446 2671 * parser.c (cp_parser_init_declarator): Don't call start_lambda_scope 2672 on error_mark_node. 2673 26742018-02-20 Jakub Jelinek <jakub@redhat.com> 2675 2676 PR c++/84445 2677 * class.c (fixed_type_or_null) <case CALL_EXPR>: Only test 2678 TREE_HAS_CONSTRUCTOR if instance is not an internal function call. 2679 2680 PR c++/84449 2681 * tree.c (bot_manip): If build_cplus_new or break_out_target_exprs 2682 returns error_mark_node, return it immediately. 2683 (break_out_target_exprs): If cp_walk_tree with bot_manip returns 2684 error_mark_node, return error_mark_node. 2685 2686 PR c++/84455 2687 * pt.c (tsubst_lambda_expr): If not nested, increment temporarily 2688 function_depth to avoid GC during finish_lambda_function. 2689 26902018-02-19 Jason Merrill <jason@redhat.com> 2691 2692 PR c++/84429 - ICE capturing VLA. 2693 * lambda.c (build_capture_proxy): Handle reference refs. 2694 26952018-02-19 Jakub Jelinek <jakub@redhat.com> 2696 2697 PR c++/84448 2698 * parser.c (cp_parser_binary_expression): For no_toplevel_fold_p, if 2699 either operand is error_mark_node, set current.lhs to that instead of 2700 creating a binary op with error_mark_node operands. 2701 2702 PR c++/84430 2703 * constexpr.c (potential_constant_expression_1): Handle OMP_SIMD. 2704 27052018-02-19 Paolo Carlini <paolo.carlini@oracle.com> 2706 2707 PR c++/84348 2708 * decl.c (grokdeclarator): Early return error_mark_node upon 2709 ill-formed friend declaration. 2710 27112018-02-16 Marek Polacek <polacek@redhat.com> 2712 Jakub Jelinek <jakub@redhat.com> 2713 2714 PR c++/84192 2715 * constexpr.c (cxx_eval_constant_expression) <case RETURN_EXPR>: Don't 2716 set *jump_target to anything if jump_target is NULL. 2717 27182018-02-16 Jason Merrill <jason@redhat.com> 2719 2720 PR c++/84151 - unnecessary volatile load with static member. 2721 * call.c (build_new_method_call_1): Avoid loading from a volatile 2722 lvalue used as the object argument for a static member function. 2723 2724 PR c++/81853 - using-directive and constexpr. 2725 * constexpr.c (cxx_eval_constant_expression): Handle USING_STMT. 2726 2727 PR c++/84420 - ICE with structured binding in lambda. 2728 * lambda.c (is_capture_proxy): Check DECL_DECOMPOSITION_P. 2729 2730 PR c++/83835 - C++17 error with constructor ctors. 2731 * call.c (build_special_member_call): Set TARGET_EXPR_DIRECT_INIT_P. 2732 2733 PR c++/82664 - ICE with reference to function template parm. 2734 * pt.c (convert_nontype_argument_function): Avoid obfuscationg 2735 NOP_EXPRs. 2736 2737 PR c++/82764 - C++17 ICE with empty base 2738 * class.c (build_base_field_1): Set DECL_SIZE to zero for empty base. 2739 27402018-02-16 Jason Merrill <jason@redhat.com> 2741 2742 PR c++/84421 - type-dependent if constexpr 2743 * semantics.c (finish_if_stmt_cond): Check type_dependent_expression_p. 2744 27452018-02-16 Nathan Sidwell <nathan@acm.org> 2746 2747 Deprecate -ffriend-injection. 2748 * decl.c (cxx_init_decl_processing): Emit warning on option. 2749 * name-lookup.c (do_pushdecl): Emit warning if we push a visible 2750 friend. 2751 27522018-02-16 Paolo Carlini <paolo.carlini@oracle.com> 2753 2754 PR c++/82468 2755 * decl.c (check_special_function_return_type): Reject template 2756 template parameter in deduction guide. 2757 27582018-02-16 Nathan Sidwell <nathan@acm.org> 2759 2760 PR c++/84375 2761 * name-lookup.c (do_pushdecl): Bail out on bad local friend injection. 2762 27632018-02-15 Jason Merrill <jason@redhat.com> 2764 2765 PR c++/83227 - C++17 ICE with init-list derived-to-base conversion. 2766 * call.c (convert_like_real): Don't use the copy-list-initialization 2767 shortcut for ck_base. 2768 2769 PR c++/84045 - ICE with typedef and noexcept. 2770 * except.c (build_noexcept_spec): Use strip_typedefs_expr. 2771 2772 PR c++/84376 - ICE with omitted template arguments. 2773 * pt.c (dguide_name_p): Check for IDENTIFIER_NODE. 2774 2775 PR c++/84368 - wrong error with local variable in variadic lambda. 2776 * pt.c (tsubst_pack_expansion): Fix handling of non-packs in 2777 local_specializations. 2778 27792018-02-15 Paolo Carlini <paolo.carlini@oracle.com> 2780 2781 PR c++/84330 2782 * constraint.cc (tsubst_constraint_info): Handle an error_mark_node 2783 as first argument. 2784 27852018-02-14 Paolo Carlini <paolo.carlini@oracle.com> 2786 2787 PR c++/84350 2788 * pt.c (do_auto_deduction): Don't check the TREE_TYPE of a null 2789 init, early return. 2790 27912018-02-14 Nathan Sidwell <nathan@acm.org> 2792 2793 * decl2.c (mark_vtable_entries): Set input_location to decl's. 2794 (c_parse_final_cleanups): Restore input_location after emitting 2795 vtables. 2796 27972018-02-14 Paolo Carlini <paolo.carlini@oracle.com> 2798 2799 * cp-tree.h (do_auto_deduction (tree, tree, tree)): Remove. 2800 (do_auto_deduction (tree, tree, tree, tsubst_flags_t, 2801 auto_deduction_context, tree, int): Add defaults. 2802 * pt.c (do_auto_deduction (tree, tree, tree)): Remove definition. 2803 (tsubst_omp_for_iterator): Adjust do_auto_deduction call, forward 2804 tsubst_flags_t argument. 2805 * init.c (build_new): Likewise. 2806 28072018-02-13 Jakub Jelinek <jakub@redhat.com> 2808 2809 PR c++/84364 2810 * typeck.c (check_return_expr): Don't emit -Weffc++ warning 2811 about return other than *this in assignment operators if 2812 retval is type dependent expression. 2813 28142018-02-13 Paolo Carlini <paolo.carlini@oracle.com> 2815 2816 PR c++/84333 2817 * call.c (build_conditional_expr_1): Use cp_save_expr instead of 2818 save_expr for the G++ extension. 2819 28202018-02-13 Jason Merrill <jason@redhat.com> 2821 2822 PR c++/84080 - ICE with return type deduction and specialization. 2823 * pt.c (determine_specialization): Check uses_template_parms. 2824 2825 Fix more variadic capture issues. 2826 * pt.c (find_parameter_packs_r): Also look at explicit captures. 2827 (check_for_bare_parameter_packs): Check current_class_type for 2828 lambda context. 2829 (extract_locals_r): Handle seeing a full instantiation of a pack. 2830 (tsubst_pack_expansion): Likewise. Force lambda capture. 2831 * parser.c (cp_parser_lambda_introducer): Don't 2832 check_for_bare_parameter_packs. 2833 2834 PR c++/84338 - wrong variadic sizeof. 2835 * pt.c (argument_pack_select_arg): Like the macro, but look through 2836 a pack expansion. 2837 (tsubst, tsubst_copy, dependent_template_arg_p): Use it. 2838 (extract_fnparm_pack): Do make_pack_expansion. 2839 (extract_locals_r): Do strip a pack expansion. 2840 * cp-tree.h (ARGUMENT_PACK_SELECT_ARG): Remove. 2841 28422018-02-12 Jakub Jelinek <jakub@redhat.com> 2843 2844 PR c++/84341 2845 * parser.c (cp_parser_binary_expression): Use build_min instead of 2846 build2_loc to build the no_toplevel_fold_p toplevel binary expression. 2847 28482018-02-12 Nathan Sidwell <nathan@acm.org> 2849 2850 PR c++/84263 2851 * parser.c (cp_parser_decltype): Push and pop 2852 deferring_access_checks. Reorganize to avoid goto. 2853 28542018-02-12 Richard Biener <rguenther@suse.de> 2855 2856 PR c++/84281 2857 * constexpr.c (cxx_eval_vec_init_1): Use a RANGE_EXPR to compact 2858 uniform constructors and delay allocating them fully. 2859 28602018-02-09 Jason Merrill <jason@redhat.com> 2861 2862 PR c++/84036 - ICE with variadic capture. 2863 Handle variadic capture proxies more like non-variadic. 2864 * lambda.c (build_capture_proxy): Remove workaround. 2865 * pt.c (find_parameter_packs_r): The proxy is a pack. 2866 (instantiate_class_template_1): Remove dead lambda code. 2867 (extract_fnparm_pack): Don't make_pack_expansion. 2868 (extract_locals_r): Don't strip a pack expansion. 2869 (tsubst_pack_expansion): Handle proxy packs. Use 2870 PACK_EXPANSION_EXTRA_ARGS less. 2871 (tsubst_decl) [FIELD_DECL]: Don't register_specialization. 2872 (tsubst_copy) [FIELD_DECL]: Don't retrieve*_specialization. 2873 [VAR_DECL]: Handle ARGUMENT_PACK_SELECT. 2874 (tsubst_expr) [DECL_EXPR]: Handle proxy packs. 2875 (tsubst_copy_and_build) [VAR_DECL]: Handle proxy packs normally. 2876 28772018-02-10 Jakub Jelinek <jakub@redhat.com> 2878 2879 PR sanitizer/83987 2880 * tree.c (cp_free_lang_data): Revert 2018-01-23 change. 2881 28822018-02-09 Jason Merrill <jason@redhat.com> 2883 2884 PR c++/81917 - ICE with void_t and partial specialization. 2885 * pt.c (instantiate_class_template_1): Set TYPE_BEING_DEFINED before 2886 calling most_specialized_partial_spec. 2887 28882018-02-09 Nathan Sidwell <nathan@acm.org> 2889 2890 PR c/84293 2891 * typeck.c (cp_build_indirect_ref_1, build_reinterpret_cast_1): 2892 Pass expr location to strict_aliasing_warning. 2893 28942018-02-09 Jason Merrill <jason@redhat.com> 2895 2896 PR c++/84296 - ICE with qualified-id in template. 2897 PR c++/83714 2898 * pt.c (unknown_base_ref_p): New. 2899 (instantiation_dependent_scope_ref_p): Use it instead of 2900 any_dependent_bases_p. 2901 29022018-02-09 Marek Polacek <polacek@redhat.com> 2903 Jakub Jelinek <jakub@redhat.com> 2904 2905 PR c++/83659 2906 * constexpr.c (cxx_fold_indirect_ref): Sync some changes from 2907 fold_indirect_ref_1, including poly_*int64. Verify first that 2908 tree_fits_poly_int64_p (op01). Formatting fixes. 2909 29102018-02-08 Paolo Carlini <paolo.carlini@oracle.com> 2911 2912 * constexpr.c (cxx_eval_component_reference): Use INDIRECT_REF_P. 2913 * lambda.c (build_capture_proxy): Likewise. 2914 * search.c (field_access_p): Likewise. 2915 * semantics.c (omp_clause_decl, omp_privatize_field, 2916 finish_omp_clauses): Likewise. 2917 29182018-02-08 Paolo Carlini <paolo.carlini@oracle.com> 2919 2920 PR c++/83806 2921 * typeck.c (decay_conversion): Use mark_rvalue_use for the special 2922 case of nullptr too. 2923 29242018-02-08 Nathan Sidwell <nathan@acm.org> 2925 2926 * class.c (finish_struct): Fix std:initializer_list diagnostic 2927 formatting. 2928 29292018-02-08 Paolo Carlini <paolo.carlini@oracle.com> 2930 2931 PR c++/83204 2932 * pt.c (tsubst_copy_and_build): Use force_paren_expr for INDIRECT_REF. 2933 29342018-02-07 Jakub Jelinek <jakub@redhat.com> 2935 2936 PR c++/84082 2937 * parser.c (cp_parser_dot_deref_incomplete): New function. 2938 (cp_parser_postfix_dot_deref_expression): Use it. 2939 29402018-02-07 David Malcolm <dmalcolm@redhat.com> 2941 2942 PR c++/81610 2943 PR c++/80567 2944 * name-lookup.c (suggest_rid_p): New function. 2945 (lookup_name_fuzzy): Replace enum-rid-filtering logic with call to 2946 suggest_rid_p. 2947 29482018-02-07 Jason Merrill <jason@redhat.com> 2949 2950 PR c++/84182 - ICE with captured lambda 2951 PR c++/84181 2952 * pt.c (extract_locals_r, extract_local_specs): New. 2953 (tsubst_pack_expansion): Use them. 2954 29552018-02-07 Martin Liska <mliska@suse.cz> 2956 2957 PR c++/84059. 2958 * class.c (add_method): Append argument value. 2959 * cp-tree.h (maybe_version_functions): Add new argument. 2960 * decl.c (decls_match): Call it if a declaration does not 2961 have DECL_FUNCTION_VERSIONED. 2962 (maybe_version_functions): record argument is added. 2963 29642018-02-05 Marek Polacek <polacek@redhat.com> 2965 2966 * class.c: Remove unused global variables. 2967 (build_primary_vtable): Don't gather statistics. 2968 (print_class_statistics): Remove. 2969 * cp-tree.h (print_class_statistics): Remove. 2970 * tree.c (cxx_print_statistics): Don't call print_class_statistics. 2971 29722018-02-02 Paolo Carlini <paolo.carlini@oracle.com> 2973 2974 * class.c (is_really_empty_class): Use DECL_UNNAMED_BIT_FIELD. 2975 * constexpr.c (cx_check_missing_mem_inits): Likewise. 2976 * decl.c (next_initializable_field, find_decomp_class_base, 2977 cp_finish_decomp): Likewise. 2978 * typeck2.c (process_init_constructor_record): Likewise. 2979 29802018-02-02 Jason Merrill <jason@redhat.com> 2981 2982 PR c++/84181 - ICE with lambda parm in template argument. 2983 * tree.c (strip_typedefs_expr): Use cp_tree_operand_length. 2984 29852018-02-01 Jason Merrill <jason@redhat.com> 2986 2987 PR c++/84160 - ICE with nested variadic capture. 2988 * lambda.c (is_capture_proxy_with_ref): New. 2989 (insert_capture_proxy): Don't set DECL_CAPTURED_VARIABLE from a 2990 COMPONENT_REF. 2991 * expr.c (mark_use): Use is_capture_proxy_with_ref. 2992 * constexpr.c (potential_constant_expression_1): Likewise. 2993 * semantics.c (process_outer_var_ref): Likewise. 2994 29952018-02-01 Marek Polacek <polacek@redhat.com> 2996 2997 PR c++/84125 2998 * typeck.c (build_address): Relax the assert when 2999 processing_template_decl. 3000 30012018-02-01 Jason Merrill <jason@redhat.com> 3002 3003 PR c++/84126 - ICE with variadic generic lambda 3004 PR c++/84036 3005 PR c++/82249 3006 * pt.c (tsubst_pack_expansion): Handle function parameter_packs in 3007 PACK_EXPANSION_EXTRA_ARGS. 3008 30092018-02-01 Paolo Carlini <paolo.carlini@oracle.com> 3010 3011 PR c++/83796 3012 * call.c (convert_like_real): If w're initializing from {} explicitly 3013 call abstract_virtuals_error_sfinae. 3014 30152018-01-31 Jason Merrill <jason@redhat.com> 3016 Jakub Jelinek <jakub@redhat.com> 3017 3018 PR c++/83993 3019 * constexpr.c (cxx_eval_outermost_constant_expr): Build NOP_EXPR 3020 around non-constant ADDR_EXPRs rather than clearing TREE_CONSTANT 3021 on ADDR_EXPR. 3022 30232018-01-31 Jakub Jelinek <jakub@redhat.com> 3024 3025 PR c++/83993 3026 * constexpr.c (diag_array_subscript): Emit different diagnostics 3027 if TYPE_DOMAIN (arraytype) is NULL. 3028 (cxx_eval_array_reference, cxx_eval_store_expression): For arrays 3029 with NULL TYPE_DOMAIN use size_zero_node as nelts. 3030 30312018-01-31 Paolo Carlini <paolo.carlini@oracle.com> 3032 3033 PR c++/84092 3034 * semantics.c (finish_qualified_id_expr): When handling an 3035 UNBOUND_CLASS_TEMPLATE only adjust qualifying_class and expr. 3036 30372018-01-31 Marek Polacek <polacek@redhat.com> 3038 3039 PR c++/84138 3040 * cp-gimplify.c (cp_fold): Check if X is an error node before 3041 calling useless_type_conversion_p. 3042 30432018-01-30 Jason Merrill <jason@redhat.com> 3044 3045 PR c++/84091 - ICE with local class in lambda in template. 3046 * decl2.c (determine_visibility): Look for outer containing template 3047 instantiation. 3048 3049 PR c++/84098 - ICE with lambda in template NSDMI. 3050 * pt.c (instantiate_class_template_1): Ignore more lambdas. 3051 30522018-01-29 Jason Merrill <jason@redhat.com> 3053 3054 PR c++/68810 - wrong location for reinterpret_cast error. 3055 * cvt.c (cp_convert_to_pointer): Always build a CONVERT_EXPR when 3056 !dofold. 3057 30582018-01-29 Marek Polacek <polacek@redhat.com> 3059 3060 PR c++/83996 3061 * constexpr.c (cxx_fold_indirect_ref): Compute ((foo *)&fooarray)[1] 3062 => fooarray[1] in offset_int. 3063 30642018-01-29 Jason Merrill <jason@redhat.com> 3065 3066 PR c++/83942 - wrong unused warning with static_cast. 3067 * cvt.c (ocp_convert): Call mark_rvalue_use. 3068 30692018-01-26 Jason Merrill <jason@redhat.com> 3070 3071 PR c++/83956 - wrong dtor error with anonymous union 3072 * method.c (walk_field_subobs): Variant members only affect 3073 deletedness. 3074 (maybe_explain_implicit_delete): Pass &deleted_p for diagnostic. 3075 3076 PR c++/84036 - ICE with variadic capture. 3077 PR c++/82249 3078 * pt.c (tsubst_pack_expansion): When optimizing a simple 3079 substitution, pull a single pack expansion out of its pack. 3080 3081 PR c++/82514 - ICE with local class in generic lambda. 3082 * pt.c (regenerated_lambda_fn_p): Remove. 3083 (enclosing_instantiation_of): Don't use it. 3084 (tsubst_function_decl): Call enclosing_instantiation_of. 3085 3086 * pt.c (lookup_template_class_1): Add sanity check. 3087 * name-lookup.c (do_pushtag): Don't add closures to local_classes. 3088 30892018-01-25 Jakub Jelinek <jakub@redhat.com> 3090 3091 PR c++/84031 3092 * decl.c (find_decomp_class_base): Ignore unnamed bitfields. Ignore 3093 recursive calls that return ret. 3094 (cp_finish_decomp): Ignore unnamed bitfields. 3095 30962018-01-23 Jason Merrill <jason@redhat.com> 3097 3098 PR c++/82249 - wrong mismatched pack length error. 3099 * pt.c (extract_fnparm_pack, tsubst_pack_expansion): Handle 3100 unsubstituted function parameter pack. 3101 31022018-01-23 Paolo Carlini <paolo.carlini@oracle.com> 3103 3104 PR c++/83921 3105 * decl.c (check_for_uninitialized_const_var): Not static; add 3106 bool and tsubst_flags_t parameters; adjust to be used both in 3107 constexpr context and not. 3108 * constexpr.c (potential_constant_expression_1): Use the above. 3109 * cp-tree.h (check_for_uninitialized_const_var): Declare. 3110 31112018-01-23 Jason Merrill <jason@redhat.com> 3112 3113 PR c++/83947 - ICE with auto declarations. 3114 * pt.c (do_auto_deduction): Don't deduce from an auto decl. 3115 * decl.c (undeduced_auto_decl): Limit to vars and fns. 3116 31172018-01-23 David Malcolm <dmalcolm@redhat.com> 3118 3119 PR c++/83974 3120 * pt.c (tsubst_copy_and_build) <CONSTRUCTOR>: Remove early bailout 3121 for pointer to member function types. 3122 31232018-01-23 Jakub Jelinek <jakub@redhat.com> 3124 3125 PR sanitizer/83987 3126 * tree.c (cp_free_lang_data): Change DECL_VALUE_EXPR of 3127 DECL_OMP_PRIVATIZED_MEMBER vars to error_mark_node. 3128 31292018-01-23 Nathan Sidwell <nathan@acm.org> 3130 3131 PR c++/83988 3132 * pt.c (tsubst_baselink): Remove optype assert. 3133 * ptree.c (cxx_print_xnode): <case BASELINK> Print BASELINK_OPTYPE. 3134 31352018-01-23 Jakub Jelinek <jakub@redhat.com> 3136 3137 PR c++/83958 3138 * decl.c (cp_finish_decomp): Diagnose if reference structure binding 3139 refers to incomplete type. 3140 31412018-01-23 Nathan Sidwell <nathan@acm.org> 3142 3143 Deprecate ARM-era for scope handling 3144 * decl.c (poplevel): Flag_new_for_scope is a boolean-like. 3145 (cxx_init_decl_processing): Deprecate flag_new_for_scope being 3146 cleared. 3147 * name-lookup.c (check_for_out_of_scope_variable): Deprecate and 3148 cleanup handling. 3149 * semantics.c (begin_for_scope): Flag_new_for_scope is 3150 boolean-like. 3151 (finish_for_stmt, begin_range_for_stmt): Likewise. 3152 31532018-01-22 Jason Merrill <jason@redhat.com> 3154 3155 PR c++/83720 3156 * decl2.c (determine_visibility): Fix template_decl handling 3157 instead of blocking it. 3158 3159 PR c++/83720 - ICE with lambda and LTO. 3160 * decl2.c (determine_visibility): Clear template_decl for 3161 function-scope decls. Propagate anonymous linkage from containing 3162 function. 3163 31642018-01-22 Marek Polacek <polacek@redhat.com> 3165 3166 PR c++/81933 3167 * typeck2.c (split_nonconstant_init_1): Return false if we didn't 3168 split out anything. 3169 31702018-01-22 Ville Voutilainen <ville.voutilainen@gmail.com> 3171 3172 PR c++/83895 3173 * decl.c (grokdeclarator): Don't diagnose extra parens 3174 on typedefs. 3175 31762018-01-19 Jakub Jelinek <jakub@redhat.com> 3177 3178 PR c++/81167 3179 * call.c (joust): Use TREE_TYPE (source) if source is 3180 a POINTER_TYPE_P rather than if ! DECL_CONSTRUCTOR_P (w->fn). 3181 3182 PR c++/83919 3183 * typeck.c (convert_for_assignment): Suppress warn_ignored_qualifiers 3184 for direct enum init. 3185 * decl.c (reshape_init): Likewise. 3186 31872018-01-19 Marek Polacek <polacek@redhat.com> 3188 3189 * constexpr.c (fold_simple): Simplify. 3190 31912018-01-18 Jason Merrill <jason@redhat.com> 3192 3193 PR c++/83714 3194 * search.c (any_dependent_bases_p): Handle null TREE_BINFO. 3195 * pt.c (instantiation_dependent_scope_ref_p): True if 3196 any_dependent_bases_p. 3197 31982018-01-18 Paolo Carlini <paolo.carlini@oracle.com> 3199 3200 * cp-tree.h: Fix comment typo (DECL_NON_TRIVIALLY_INITIALIZED_P 3201 vs DECL_NONTRIVIALLY_INITIALIZED_P). 3202 32032018-01-18 Jason Merrill <jason@redhat.com> 3204 3205 PR c++/82461 - constexpr list-initialized member 3206 * constexpr.c (potential_constant_expression_1): Check 3207 TARGET_EXPR_DIRECT_INIT_P. 3208 32092018-01-18 Paolo Carlini <paolo.carlini@oracle.com> 3210 3211 PR c++/81013 3212 * decl.c (xref_basetypes): Early return upon error about derived 3213 union. 3214 32152018-01-18 Nathan Sidwell <nathan@acm.org> 3216 3217 PR c++/83160 3218 * cp-tree.h (mark_use): Declare. 3219 * expr.c (mark_use): Make extern. 3220 * call.c (direct_reference_binding): Set inner conv's 3221 rvaluedness_matches_p, if it is an identity. 3222 (convert_like_real): Mark lvalue or rvalue use for identity as 3223 rvaledness_matches_p demands. 3224 32252018-01-18 Jakub Jelinek <jakub@redhat.com> 3226 3227 PR c++/83824 3228 * parser.c (attr_chainon): New function. 3229 (cp_parser_label_for_labeled_statement, cp_parser_decl_specifier_seq, 3230 cp_parser_namespace_definition, cp_parser_init_declarator, 3231 cp_parser_type_specifier_seq, cp_parser_parameter_declaration, 3232 cp_parser_gnu_attributes_opt): Use it. 3233 (cp_parser_member_declaration, cp_parser_objc_class_ivars, 3234 cp_parser_objc_struct_declaration): Likewise. Don't reset 3235 prefix_attributes if attributes is error_mark_node. 3236 32372018-01-17 Paolo Carlini <paolo.carlini@oracle.com> 3238 3239 PR c++/78344 3240 * decl.c (grokdeclarator): Do not append the error_mark_node 3241 due to an erroneous optional attribute-specifier-seq. 3242 32432018-01-17 Jakub Jelinek <jakub@redhat.com> 3244 3245 PR c++/83897 3246 * cp-gimplify.c (cp_maybe_instrument_return): Handle 3247 CLEANUP_POINT_EXPR. 3248 32492018-01-17 Paolo Carlini <paolo.carlini@oracle.com> 3250 3251 PR c++/81054 3252 * constexpr.c (ensure_literal_type_for_constexpr_object): Return 3253 error_mark_node when we give an error. 3254 * decl.c (cp_finish_decl): Use the latter. 3255 32562018-01-17 Nathan Sidwell <nathan@acm.org> 3257 3258 PR c++/83287 3259 * init.c (build_raw_new_expr): Scan list for lookups to keep. 3260 32612018-01-17 David Malcolm <dmalcolm@redhat.com> 3262 3263 PR c++/83814 3264 * expr.c (fold_for_warn): Move from c-common.c, reducing to just 3265 the C++ part. If processing a template, call 3266 fold_non_dependent_expr rather than fully folding. 3267 32682018-01-17 Jason Merrill <jason@redhat.com> 3269 3270 PR c++/81067 - redundant NULL warning. 3271 * call.c (convert_like_real): Restore null_node handling. 3272 32732018-01-17 Jason Merrill <jason@redhat.com> 3274 3275 PR c++/81843 - ICE with variadic member template. 3276 PR c++/72801 3277 * pt.c (unify_pack_expansion): Don't try to deduce enclosing 3278 template args. 3279 32802018-01-17 David Malcolm <dmalcolm@redhat.com> 3281 3282 PR c++/83799 3283 * pt.c (type_dependent_expression_p): Strip any location wrapper 3284 before testing tree codes. 3285 (selftest::test_type_dependent_expression_p): New function. 3286 (selftest::cp_pt_c_tests): Call it. 3287 32882018-01-17 Nathan Sidwell <nathan@acm.org> 3289 3290 PR c++/83739 3291 * pt.c (tsubst_expr) <case RANGE_FOR_STMT>: Rebuild a range_for if 3292 this not a final instantiation. 3293 32942018-01-16 Jason Merrill <jason@redhat.com> 3295 3296 PR c++/83714 - ICE checking return in template. 3297 * typeck.c (check_return_expr): Call build_non_dependent_expr. 3298 32992018-01-16 Jakub Jelinek <jakub@redhat.com> 3300 3301 PR c++/83817 3302 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: If function 3303 is AGGR_INIT_EXPR rather than CALL_EXPR, set AGGR_INIT_FROM_THUNK_P 3304 instead of CALL_FROM_THUNK_P. 3305 3306 PR c++/83825 3307 * name-lookup.c (member_vec_dedup): Return early if len is 0. 3308 (resort_type_member_vec, set_class_bindings, 3309 insert_late_enum_def_bindings): Use vec qsort method instead of 3310 calling qsort directly. 3311 33122018-01-15 Martin Sebor <msebor@redhat.com> 3313 3314 PR c++/83588 3315 * class.c (find_flexarrays): Make a record of multiple flexible array 3316 members. 3317 33182018-01-12 Jason Merrill <jason@redhat.com> 3319 3320 PR c++/83186 - ICE with static_cast of list-initialized temporary. 3321 * typeck.c (build_static_cast): Use build_non_dependent_expr. 3322 33232018-01-12 Nathan Sidwell <nathan@acm.org> 3324 3325 * cp-tree.h (mark_rvalue_use): Add parm name. 3326 * expr.c (mark_lvalue_use, mark_lvalue_use_nonread): Move next to 3327 mark_rvalue_use. 3328 * call.c (convert_like_real): Fix formatting. 3329 33302018-01-11 Jason Merrill <jason@redhat.com> 3331 3332 PR c++/82728 - wrong -Wunused-but-set-variable 3333 PR c++/82799 3334 PR c++/83690 3335 * call.c (perform_implicit_conversion_flags): Call mark_rvalue_use. 3336 * decl.c (case_conversion): Likewise. 3337 * semantics.c (finish_static_assert): Call 3338 perform_implicit_conversion_flags. 3339 33402018-01-11 Nathan Sidwell <nathan@acm.org> 3341 3342 * method.c (enum mangling_flags): Delete long-dead enum. 3343 33442018-01-10 Paolo Carlini <paolo.carlini@oracle.com> 3345 3346 * parser.c (cp_parser_std_attribute_spec): When 3347 token_pair::require_open / require_close return false simply 3348 return error_mark_node, avoid duplicate cp_parser_error about 3349 expected '(' / ')', respectively. 3350 33512018-01-10 David Malcolm <dmalcolm@redhat.com> 3352 3353 PR c++/43486 3354 * call.c (null_ptr_cst_p): Strip location wrappers when 3355 converting from '0' to a pointer type in C++11 onwards. 3356 (conversion_null_warnings): Replace comparison with null_node with 3357 call to null_node_p. 3358 (build_over_call): Likewise. 3359 * cp-gimplify.c (cp_fold): Remove the early bailout when 3360 processing_template_decl. 3361 * cp-lang.c (selftest::run_cp_tests): Call 3362 selftest::cp_pt_c_tests and selftest::cp_tree_c_tests. 3363 * cp-tree.h (cp_expr::maybe_add_location_wrapper): New method. 3364 (selftest::run_cp_tests): Move decl to bottom of file. 3365 (null_node_p): New inline function. 3366 (selftest::cp_pt_c_tests): New decl. 3367 (selftest::cp_tree_c_tests): New decl. 3368 * cvt.c (build_expr_type_conversion): Replace comparison with 3369 null_node with call to null_node_p. 3370 * error.c (args_to_string): Likewise. 3371 * except.c (build_throw): Likewise. 3372 * mangle.c (write_expression): Skip location wrapper nodes. 3373 * parser.c (literal_integer_zerop): New function. 3374 (cp_parser_postfix_expression): Call maybe_add_location_wrapper on 3375 the result for RID_TYPEID. Pass true for new "wrap_locations_p" 3376 param of cp_parser_parenthesized_expression_list. When calling 3377 warn_for_memset, replace integer_zerop calls with 3378 literal_integer_zerop, eliminating the double logical negation 3379 cast to bool. Eliminate the special-casing for CONST_DECL in 3380 favor of the fold_for_warn within warn_for_memset. 3381 (cp_parser_parenthesized_expression_list): Add "wrap_locations_p" 3382 param, defaulting to false. Convert "expr" to a cp_expr, and call 3383 maybe_add_location_wrapper on it when wrap_locations_p is true. 3384 (cp_parser_unary_expression): Call maybe_add_location_wrapper on 3385 the result for RID_ALIGNOF and RID_SIZEOF. 3386 (cp_parser_builtin_offsetof): Likewise. 3387 * pt.c: Include "selftest.h". 3388 (tsubst_copy): Handle location wrappers. 3389 (tsubst_copy_and_build): Likewise. 3390 (build_non_dependent_expr): Likewise. 3391 (selftest::test_build_non_dependent_expr): New function. 3392 (selftest::cp_pt_c_tests): New function. 3393 * tree.c: Include "selftest.h". 3394 (lvalue_kind): Handle VIEW_CONVERT_EXPR location wrapper nodes. 3395 (selftest::test_lvalue_kind): New function. 3396 (selftest::cp_tree_c_tests): New function. 3397 * typeck.c (string_conv_p): Strip any location wrapper from "exp". 3398 (cp_build_binary_op): Replace comparison with null_node with call 3399 to null_node_p. 3400 (build_address): Use location of operand when building address 3401 expression. 3402 34032018-01-10 Marek Polacek <polacek@redhat.com> 3404 3405 PR c++/82541 3406 * call.c (build_conditional_expr_1): Check complain before warning. 3407 * pt.c (tsubst_copy_and_build) <case COND_EXPR>: Suppress 3408 -Wduplicated-branches. 3409 34102018-01-10 Jakub Jelinek <jakub@redhat.com> 3411 3412 PR c++/81327 3413 * call.c (maybe_warn_class_memaccess): Add forward declaration. 3414 Change last argument from tree * to const vec<tree, va_gc> *, adjust 3415 args uses and check number of operands too. Don't strip away any 3416 nops. Use maybe_constant_value when looking for INTEGER_CST args. 3417 Deal with src argument not having pointer type. Check 3418 tree_fits_uhwi_p before calling tree_to_uhwi. Remove useless 3419 test. 3420 (build_over_call): Call maybe_warn_class_memaccess here on the 3421 original arguments. 3422 (build_cxx_call): Rather than here on converted arguments. 3423 34242018-01-10 Paolo Carlini <paolo.carlini@oracle.com> 3425 3426 PR c++/81055 3427 * init.c (build_vec_init): Avoid building an INIT_EXPR with 3428 error_mark_node as second argument. 3429 34302018-01-09 Jakub Jelinek <jakub@redhat.com> 3431 3432 PR c++/83734 3433 * constexpr.c (cxx_eval_statement_list): Ignore DEBUG_BEGIN_STMTs 3434 in STATEMENT_LIST. Remove unneeded assert. 3435 34362018-01-03 Richard Sandiford <richard.sandiford@linaro.org> 3437 Alan Hayward <alan.hayward@arm.com> 3438 David Sherwood <david.sherwood@arm.com> 3439 3440 * constexpr.c (cxx_eval_array_reference): Handle polynomial 3441 VECTOR_CST_NELTS. 3442 (cxx_fold_indirect_ref): Handle polynomial TYPE_VECTOR_SUBPARTS. 3443 * call.c (build_conditional_expr_1): Likewise. 3444 * decl.c (cp_finish_decomp): Likewise. 3445 * mangle.c (write_type): Likewise. 3446 * typeck.c (structural_comptypes): Likewise. 3447 (cp_build_binary_op): Likewise. 3448 * typeck2.c (process_init_constructor_array): Likewise. 3449 34502018-01-03 Jakub Jelinek <jakub@redhat.com> 3451 3452 PR c++/83555 3453 * typeck.c (build_static_cast_1): For static casts to reference types, 3454 call build_base_path with flag_delete_null_pointer_checks as nonnull 3455 instead of always false. When -fsanitize=null, call 3456 ubsan_maybe_instrument_reference on the NULL reference INTEGER_CST. 3457 * cp-gimplify.c (cp_genericize_r): Don't walk subtrees of UBSAN_NULL 3458 call if the first argument is INTEGER_CST with REFERENCE_TYPE. 3459 34602018-01-03 Nathan Sidwell <nathan@acm.org> 3461 3462 PR c++/83667 3463 * method.c (make_alias_for): Copy DECL_CONTEXT. 3464 34652018-01-03 Marek Polacek <polacek@redhat.com> 3466 3467 PR c++/83592 3468 * decl.c (grokdeclarator): Don't warn about MVP in typename context. 3469 34702018-01-03 Jakub Jelinek <jakub@redhat.com> 3471 3472 PR preprocessor/83602 3473 * name-lookup.c (lookup_name_fuzzy): Don't use macro_use_before_def 3474 for builtin macros. 3475 3476 PR c++/83634 3477 * cp-gimplify.c (cp_fold) <case NOP_EXPR>: If the operand folds to 3478 error_mark_node, return error_mark_node. 3479 3480 Update copyright years. 3481 34822018-01-02 Jakub Jelinek <jakub@redhat.com> 3483 3484 PR c++/83556 3485 * tree.c (replace_placeholders_r): Pass NULL as last argument to 3486 cp_walk_tree instead of d->pset. If non-TREE_CONSTANT and 3487 non-PLACEHOLDER_EXPR tree has been seen already, set *walk_subtrees 3488 to false and return. 3489 (replace_placeholders): Pass NULL instead of &pset as last argument 3490 to cp_walk_tree. 3491 34922018-01-02 Nathan Sidwell <nathan@acm.org> 3493 3494 * constexpr.c (cxx_bind_parameters_in_call): Remove unneeded local 3495 lval var. 3496 3497Copyright (C) 2018 Free Software Foundation, Inc. 3498 3499Copying and distribution of this file, with or without modification, 3500are permitted in any medium without royalty provided the copyright 3501notice and this notice are preserved. 3502