12018-12-27 Martin Liska <mliska@suse.cz> 2 3 PR c++/88263 4 * decl2.c (get_local_tls_init_fn): Add location_t argument and 5 use it. 6 (get_tls_init_fn): Call it with location of variable for which 7 we'll need to create tls_init function. 8 (handle_tls_init): Likewise. 9 102018-12-21 Jakub Jelinek <jakub@redhat.com> 11 12 PR c++/86524 13 PR c++/88446 14 * cp-tree.h (cp_fold_maybe_rvalue, cp_fold_rvalue): Declare. 15 (fold_non_dependent_expr): Add manifestly_const_eval argument. 16 * constexpr.c (cxx_eval_builtin_function_call): Evaluate 17 __builtin_constant_p if ctx->manifestly_const_eval even in constexpr 18 functions. Don't reuse dummy{1,2} vars between different arguments. 19 Use cp_fold_rvalue instead of cp_fully_fold. Fix comment typo. 20 (fold_non_dependent_expr): Add manifestly_const_eval argument, pass 21 it through to cxx_eval_outermost_constant_expr and 22 maybe_constant_value. 23 * cp-gimplify.c (cp_fold_maybe_rvalue, cp_fold_rvalue): No longer 24 static. 25 * semantics.c (finish_static_assert): Call fold_non_dependent_expr 26 with true as manifestly_const_eval. 27 282018-12-20 Marek Polacek <polacek@redhat.com> 29 30 PR c++/88196 - ICE with class non-type template parameter. 31 * pt.c (convert_nontype_argument): If the expr is a PTRMEM_CST, also 32 check if the type we're converting it to is TYPE_PTRMEM_P. 33 342018-12-20 H.J. Lu <hongjiu.lu@intel.com> 35 36 PR c/51628 37 * call.c (convert_for_arg_passing): Call 38 warn_for_address_or_pointer_of_packed_member. 39 * typeck.c (convert_for_assignment): Likewise. 40 412018-12-20 Jakub Jelinek <jakub@redhat.com> 42 43 PR c++/88180 44 * parser.c (cp_parser_class_specifier_1): If 45 cp_parser_check_type_definition fails, skip default arguments, NSDMIs, 46 etc. like for erroneous template args. 47 48 * cp-tree.h (cp_fully_fold_init): Declare. 49 * cp-gimplify.c (cp_fully_fold_init): New function. 50 * typeck2.c (split_nonconstant_init, store_init_value): Use it 51 instead of cp_fully_fold. 52 532018-12-19 Segher Boessenkool <segher@kernel.crashing.org> 54 55 * parser.c (cp_parser_asm_definition): Do not allow any asm qualifiers 56 on top-level asm. 57 582018-12-19 Segher Boessenkool <segher@kernel.crashing.org> 59 60 * parser.c (cp_parser_asm_definition) <RID_CONST, RID_RESTRICT>: Give 61 a more specific error message (instead of just falling through). 62 632018-12-19 Segher Boessenkool <segher@kernel.crashing.org> 64 65 * parser.c (cp_parser_asm_definition): Rewrite the loop to work without 66 "done" boolean variable. 67 * parser.c (cp_parser_asm_definition): Keep track of the location each 68 asm qualifier is first seen; use that to give nicer "duplicate asm 69 qualifier" messages. 70 712018-12-19 Segher Boessenkool <segher@kernel.crashing.org> 72 73 * parser.c (cp_parser_asm_definition): Rewrite the loop to work without 74 "done" boolean variable. 75 762018-12-19 David Malcolm <dmalcolm@redhat.com> 77 78 PR c++/88375 79 * typeck.c (convert_for_assignment): Capture location of rhs 80 before stripping, and if available. Use the location when 81 complaining about bad conversions, labelling it with the 82 rhstype if the location was present. 83 * typeck2.c (digest_init_r): Capture location of init before 84 stripping. 85 862018-12-19 David Malcolm <dmalcolm@redhat.com> 87 88 PR c++/87504 89 * call.c (op_error): Convert 1st param from location_t to 90 const op_location_t &. Use binary_op_rich_location for binary 91 ops. 92 (build_conditional_expr_1): Convert 1st param from location_t to 93 const op_location_t &. 94 (build_conditional_expr): Likewise. 95 (build_new_op_1): Likewise. 96 (build_new_op): Likewise. 97 * cp-tree.h (build_conditional_expr): Likewise. 98 (build_new_op): Likewise. 99 (build_x_binary_op): Likewise. 100 (cp_build_binary_op): Likewise. 101 * parser.c (cp_parser_primary_expression): Build a location 102 for id-expression nodes. 103 (cp_parser_binary_expression): Use an op_location_t when 104 calling build_x_binary_op. 105 (cp_parser_operator): Build a location for user-defined literals. 106 * typeck.c (build_x_binary_op): Convert 1st param from location_t 107 to const op_location_t &. 108 (cp_build_binary_op): Likewise. Use binary_op_rich_location. 109 1102018-12-19 David Malcolm <dmalcolm@redhat.com> 111 112 PR c++/43064 113 PR c++/43486 114 * call.c (build_conditional_expr_1): Strip location wrappers when 115 checking for CONST_DECL. 116 (conversion_null_warnings): Use location of "expr" if available. 117 * class.c (fixed_type_or_null): Handle location wrappers. 118 * constexpr.c (potential_constant_expression_1): Likewise. 119 * cvt.c (ignore_overflows): Strip location wrappers when 120 checking for INTEGER_CST, and re-wrap the result if present. 121 (ocp_convert): Call fold_for_warn before checking for INTEGER_CST. 122 * decl.c (reshape_init_r): Strip any location wrapper. 123 (undeduced_auto_decl): Likewise. 124 * expr.c (mark_discarded_use): Likewise for expr. 125 * init.c (build_aggr_init): Likewise before checking init for 126 DECL_P. 127 (warn_placement_new_too_small): Call fold_for_warn on adj before 128 checking for CONSTANT_CLASS_P, and on nelts. Strip any location 129 wrapper from op0 and on oper before checking for VAR_P. 130 * parser.c (cp_parser_primary_expression): Call 131 maybe_add_location_wrapper on numeric and string literals. 132 (cp_parser_postfix_expression): Strip any location wrapper when 133 checking for DECL_IS_BUILTIN_CONSTANT_P. 134 (cp_parser_unary_expression): Ensure that folding of NEGATE_EXPR 135 around a constant happens in the presence of location wrappers and 136 returns a wrapped result. 137 (cp_parser_has_attribute_expression): Strip any location wrapper 138 from "oper". 139 (cp_parser_binary_expression): Strip any location wrapper when 140 checking for DECL_P on the lhs. 141 (cp_parser_decltype): Strip any location wrapper from result of 142 cp_parser_decltype_expr. 143 (cp_parser_mem_initializer): Add location wrappers to the 144 parenthesized expression list. 145 (cp_parser_template_parameter_list): Don't create wrapper nodes 146 within a template-parameter-list. 147 (cp_parser_template_argument_list): Don't create wrapper nodes 148 within a template-argument-list. 149 (cp_parser_parameter_declaration): Strip location wrappers from 150 default arguments. 151 (cp_parser_gnu_attribute_list): Don't create wrapper nodes. 152 (cp_parser_std_attribute_spec_seq): Likewise. 153 (cp_parser_omp_all_clauses): Don't create wrapper nodes within 154 OpenMP clauses. 155 (cp_parser_omp_for_loop): Likewise. 156 (cp_parser_omp_declare_reduction_exprs): Likewise. 157 * pt.c (convert_nontype_argument_function): Strip location 158 wrappers from fn_no_ptr before checking for FUNCTION_DECL. 159 (tsubst_default_argument): Move note about which callsite led to 160 instantiation to after the check_default_argument call. 161 (do_auto_deduction): Likewise from init before checking for 162 DECL_P. 163 * semantics.c (force_paren_expr): Likewise from expr before 164 checking for DECL_P. 165 (finish_parenthesized_expr): Likewise from expr before 166 checking for STRING_CST. 167 (perform_koenig_lookup): Likewise from fn. 168 (finish_call_expr): Likewise. 169 (finish_id_expression): Rename to... 170 (finish_id_expression_1): ...this, calling 171 maybe_add_location_wrapper on the result. 172 (capture_decltype): Use lookup_name_real rather than value_member 173 when looking up decl within the capture-list. 174 * tree.c (cp_stabilize_reference): Strip any location wrapper. 175 (builtin_valid_in_constant_expr_p): Likewise. 176 (strip_typedefs_expr): Strip any location wrapper before checking 177 for decls or constants. 178 (is_overloaded_fn): Likewise. 179 (maybe_get_fns): Likewise. 180 (selftest::test_lvalue_kind): Verify lvalue_p. 181 * typeck.c (cxx_sizeof_expr): Strip any location wrapper. 182 (cxx_alignof_expr): Likewise. 183 (is_bitfield_expr_with_lowered_type): Handle location wrappers. 184 (cp_build_array_ref): Call maybe_constant_value on "idx". 185 (cp_build_binary_op): Strip location wrapper from first_arg before 186 checking for PARM_DECL. Likewise for op1 before checking for 187 INTEGER_CST in two places. Likewise for orig_op0 and orig_op1 188 when checking for STRING_CST. 189 (cp_build_addr_expr_1): Likewise for arg when checking for 190 FUNCTION_DECL. 191 (cp_build_modify_expr): Likewise for newrhs when checking for 192 STRING_CST. 193 (convert_for_assignment): Don't strip location wrappers when 194 stripping NON_LVALUE_EXPR. 195 (maybe_warn_about_returning_address_of_local): Strip location 196 wrapper from whats_returned before checking for DECL_P. 197 (can_do_nrvo_p): Strip location wrapper from retval. 198 (treat_lvalue_as_rvalue_p): Likewise. 199 (check_return_expr): Likewise. 200 * typeck2.c (cxx_incomplete_type_diagnostic): Strip location 201 wrapper from value before checking for VAR_P or PARM_DECL. 202 (digest_init_r): Strip location wrapper from init. When 203 copying "init", also copy the wrapped node. 204 2052018-12-19 Jakub Jelinek <jakub@redhat.com> 206 207 PR c++/87934 208 * constexpr.c (cxx_eval_constant_expression) <case CONSTRUCTOR>: Do 209 re-process TREE_CONSTANT CONSTRUCTORs if they aren't reduced constant 210 expressions. 211 2122018-12-19 Alexandre Oliva <aoliva@redhat.com> 213 214 PR c++/87012 215 * pt.c (convert_template_argument): Canonicalize type after 216 tsubst/deduce. 217 218 PR c++/88146 219 * method.c (do_build_copy_constructor): Guard cvquals init and 220 loop over fields to run for non-inherited ctors only. 221 (synthesize_method): Retain location of inherited ctor. 222 2232018-12-17 Jakub Jelinek <jakub@redhat.com> 224 225 PR c++/88410 226 * cp-gimplify.c (cp_fold) <case ADDR_EXPR>: For offsetof-like folding, 227 call maybe_constant_value on val to see if it is INTEGER_CST. 228 2292018-12-17 Jonathan Wakely <jwakely@redhat.com> 230 231 PR c++/52321 232 * typeck.c (build_static_cast): Print a note when the destination 233 type or the operand is a pointer/reference to incomplete class type. 234 2352018-12-16 Jakub Jelinek <jakub@redhat.com> 236 237 PR c++/88482 238 * except.c (verify_library_fn): New function. 239 (declare_library_fn): Use it. Initialize TM even if the non-TM 240 library function has been user declared. 241 (do_end_catch): Don't set TREE_NOTHROW on error_mark_node. 242 (expand_start_catch_block): Don't call initialize_handler_parm 243 for error_mark_node. 244 (build_throw): Use verify_library_fn. Initialize TM even if the 245 non-TM library function has been user declared. Don't crash if 246 any library fn is error_mark_node. 247 2482018-12-14 Jason Merrill <jason@redhat.com> 249 250 * pt.c (tsubst_expr) [DECL_EXPR]: Ignore class-scope bindings when 251 looking up a capture proxy. 252 2532018-12-15 Paolo Carlini <paolo.carlini@oracle.com> 254 255 PR c++/84644 256 * decl.c (check_tag_decl): A decltype with no declarator 257 doesn't declare anything. 258 2592018-12-14 Alexandre Oliva <aoliva@redhat.com> 260 261 PR c++/87814 262 * pt.c (tsubst_exception_specification): Handle 263 DEFERRED_NOEXCEPT with !defer_ok. 264 2652018-12-14 Jason Merrill <jason@redhat.com> 266 267 PR c++/86823 268 * parser.c (cp_parser_template_id): Rearrange deferred access 269 checks into the firewall. 270 2712018-12-14 Jakub Jelinek <jakub@redhat.com> 272 273 PR c++/82294 274 PR c++/87436 275 * init.c (build_vec_init): Change num_initialized_elts type from int 276 to HOST_WIDE_INT. Build a RANGE_EXPR if e needs to be repeated more 277 than once. 278 2792018-12-13 Marek Polacek <polacek@redhat.com> 280 281 PR c++/88216 - ICE with class type in non-type template parameter. 282 * mangle.c (write_expression): Handle TARGET_EXPR and 283 VIEW_CONVERT_EXPR. 284 * pt.c (convert_nontype_argument): Don't call 285 get_template_parm_object for value-dependent expressions. 286 2872018-12-13 Nathan Sidwell <nathan@acm.org> 288 289 PR c++/87531 290 * class.c (finish_struct): Set DECL_CONTEXT of template assign op. 291 * name-lookup.c (get_class_binding_direct): Don't strip using-decl 292 of overload here. 293 * parser.c (cp_parser_postfix_expression): Cope with using decl in 294 overload set. 295 * semantics.c (finish_id_expr): Likewise. 296 2972018-12-12 Paolo Carlini <paolo.carlini@oracle.com> 298 299 * decl.c (grokdeclarator): Fix location of error message about 300 static data member definition. 301 3022018-12-12 Jakub Jelinek <jakub@redhat.com> 303 304 PR c++/88446 305 * cp-tree.h (maybe_constant_value): Add manifestly_const_eval 306 argument. 307 * constexpr.c (struct constexpr_call): Rename pretend_const_required 308 member to manifestly_const_eval. 309 (struct constexpr_ctx): Likewise. 310 (constexpr_call_hasher::equal): Adjust users. 311 (cxx_eval_builtin_function_call): Likewise. Formatting fix. 312 (cxx_eval_call_expression): Adjust users. 313 (cxx_eval_outermost_constant_expr, maybe_constant_init_1, 314 maybe_constant_init): Rename pretend_const_required argument to 315 manifestly_const_eval, adjust function comments. 316 (maybe_constant_value): Add manifestly_const_eval argument. If true, 317 don't cache and call cxx_eval_outermost_constant_expr with true as 318 manifestly_const_eval. 319 * decl.c (compute_array_index_type_loc): Call maybe_constant_value 320 with true as manifestly_const_eval. 321 322 PR c++/88449 323 * constexpr.c (struct constexpr_call): Add pretend_const_required 324 member. 325 (constexpr_call_hasher::equal): Return false if pretend_const_required 326 members differ. 327 (cxx_eval_call_expression): Adjust new_call initialization. Hash in 328 ctx->pretend_const_required. 329 3302018-12-11 Jakub Jelinek <jakub@redhat.com> 331 332 PR c++/87861 333 * class.c (build_vtbl_initializer): For TARGET_VTABLE_USES_DESCRIPTORS 334 bump index for each added word. 335 * constexpr.c (find_array_ctor_elt): Add forward declaration. 336 (cxx_eval_call_expression): Handle TARGET_VTABLE_USES_DESCRIPTORS 337 vtable calls. 338 (cxx_eval_constant_expression) <case OBJ_TYPE_REF>: Divide token 339 by TARGET_VTABLE_USES_DESCRIPTORS if non-zero. 340 3412018-12-11 Marek Polacek <polacek@redhat.com> 342 343 PR c++/86608 - reading constexpr volatile variable. 344 * constexpr.c (potential_constant_expression_1): Check want_rval 345 instead of checking if we have a decl. 346 * decl2.c (decl_maybe_constant_var_p): Don't consider volatile 347 constexpr variables as maybe constant. 348 3492018-12-11 Paolo Carlini <paolo.carlini@oracle.com> 350 351 * decl.c (grokvardecl): Add location_t parameter and use it 352 in build_lang_decl_loc and build_decl calls. 353 (grokdeclarator): Move up loc declaration and use it in the 354 grokvardecl call too. 355 3562018-12-09 Cesar Philippidis <cesar@codesourcery.com> 357 358 * parser.c (cp_parser_oacc_kernels_parallel): Adjust EXPR_LOCATION 359 on the combined acc loop. 360 3612018-12-07 Paolo Carlini <paolo.carlini@oracle.com> 362 363 * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in error messages 364 about bit-fields with function type, warn_if_not_aligned type, and 365 static bit-fields; avoid DECL_NAME for unnamed declarations. 366 3672018-12-07 Jakub Jelinek <jakub@redhat.com> 368 369 PR c++/86669 370 * call.c (make_temporary_var_for_ref_to_temp): Call pushdecl even for 371 automatic vars. 372 373 PR c++/87506 374 * constexpr.c (adjust_temp_type): Handle EMPTY_CLASS_EXPR. 375 3762018-12-06 Paolo Carlini <paolo.carlini@oracle.com> 377 378 * class.c (check_bitfield_decl): In error message about non-integral 379 type print the type itself too. 380 * decl.c (grokdeclarator): Do not ICE on unnamed bit-fields declared 381 friends; when calling build_decl for a FIELD_DECL possibly pass the 382 declarator->id_loc. 383 3842018-12-06 Alexandre Oliva <aoliva@redhat.com> 385 386 PR c++/86747 387 * pt.c (tsubst_friend_class): Enter tsubsted class context. 388 389 PR c++/86397 390 * except.c (build_noexcept_spec): Resolve nondependent 391 expressions. 392 3932018-12-06 Jason Merrill <jason@redhat.com> 394 395 PR c++/88136 - -Wdeprecated-copy false positives 396 * class.c (classtype_has_depr_implicit_copy): Rename from 397 classtype_has_user_copy_or_dtor. 398 * method.c (lazily_declare_fn): Adjust. 399 * decl2.c (cp_warn_deprecated_use): Refer to -Wdeprecated-copy-dtor 400 if deprecation is due to a destructor. 401 4022018-12-06 Marek Polacek <polacek@redhat.com> 403 404 PR c++/88373 - wrong parse error with ~. 405 * parser.c (cp_parser_template_name): Check tag_type for 406 none_type. 407 4082018-12-06 Segher Boessenkool <segher@kernel.crashing.org> 409 410 * cp-tree.h (finish_asm_stmt): Update declaration. 411 * parser.c (cp_parser_asm_definition): Detect the inline keyword 412 after asm. Pass a flag for it to finish_asm_stmt. 413 * pt.c (tsubst_expr): Pass the ASM_INLINE_P flag to finish_asm_stmt. 414 * semantics.c (finish_asm_stmt): Add inline_p parameter. Use it to 415 set ASM_INLINE_P. 416 4172018-12-06 Segher Boessenkool <segher@kernel.crashing.org> 418 419 PR inline-asm/55681 420 * parser.c (cp_parser_asm_definition): Update grammar. Allow any 421 combination of volatile and goto, in any order, without repetitions. 422 4232018-12-06 David Malcolm <dmalcolm@redhat.com> 424 425 PR c++/85110 426 * call.c (conversion_null_warnings): Try to use the location of 427 the expression for the warnings. Add notes showing the parameter 428 of the function decl, where available. 429 (get_fndecl_argument_location): For implicitly-declared functions, 430 use the fndecl location rather than that of the param. 431 (maybe_inform_about_fndecl_for_bogus_argument_init): New function. 432 (convert_like_real): Use it in various places to avoid repetition. 433 (complain_about_bad_argument): Likewise. 434 * cp-tree.h (maybe_inform_about_fndecl_for_bogus_argument_init): 435 New declaration. 436 * decl2.c (check_default_args): Put all diagnostics for the fndecl 437 into a diagnostic group. Use the location of the parameter when 438 complaining about parameters with missing default arguments in 439 preference to that of the fndecl. Attempt to record the location 440 of the first parameter with a default argument and emit a note 441 for the first parameter that's missing one. 442 * typeck.c (convert_arguments): When complaining about parameters 443 with incomplete types, attempt to use the location of the 444 argument. Where available, add a note showing the pertinent 445 parameter in the fndecl. 446 (convert_for_assignment): When complaining about bad conversions 447 at function calls, use the location of the unstripped argument. 448 (convert_for_initialization): When checking for bogus references, 449 add an auto_diagnostic_group, and update the note to use the 450 location of the pertinent parameter, rather than just the callee. 451 4522018-12-06 Paolo Carlini <paolo.carlini@oracle.com> 453 454 * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in error message; 455 print the type too; fix thinko in INDIRECT_TYPE_P use. 456 4572018-12-05 Alexandre Oliva <aoliva@redhat.com> 458 459 PR c++/85569 460 * constexpr.c (adjust_temp_type): Test for type equality with 461 same_type_p. 462 (constexpr_call_hasher::equal): Likewise. 463 4642018-12-04 Paolo Carlini <paolo.carlini@oracle.com> 465 466 PR c++/84636 467 * decl.c (grokdeclarator): Avoid crashing on an anonymous bit-field 468 with function type. 469 4702018-12-04 Marek Polacek <polacek@redhat.com> 471 472 PR c++/88184 - ICE when treating name as template-name. 473 * pt.c (lookup_template_function): Always build the TEMPLATE_ID_EXPR 474 with unknown_type_node. 475 4762018-12-04 Julian Brown <julian@codesourcery.com> 477 478 * parser.c (cp_parser_oacc_wait_list): Fix error message and avoid 479 duplicate diagnostic. 480 4812018-12-04 Jakub Jelinek <jakub@redhat.com> 482 483 PR c++/88103 484 * typeck.c (build_class_member_access_expr): If unary_complex_lvalue 485 turned xvalue_p into non-xvalue_p, call move on it. 486 4872018-12-02 Jakub Jelinek <jakub@redhat.com> 488 489 PR c++/88258 490 * parser.c (cp_parser_skip_to_closing_parenthesis_1, 491 cp_parser_skip_to_end_of_statement, 492 cp_parser_skip_to_end_of_block_or_statement, 493 cp_parser_skip_to_closing_brace, 494 cp_parser_skip_to_closing_square_bracket, 495 cp_parser_skip_balanced_tokens): Don't treat CPP_PRAGMA_EOL specially 496 if in_pragma is false. 497 4982018-12-01 Marek Polacek <polacek@redhat.com> 499 500 Implement P0634R3, Down with typename! 501 * parser.c (CP_PARSER_FLAGS_TYPENAME_OPTIONAL): New enumerator. 502 (cp_parser_type_name): Remove declaration. 503 (cp_parser_postfix_expression): Pass CP_PARSER_FLAGS_TYPENAME_OPTIONAL 504 to cp_parser_type_id. 505 (cp_parser_new_type_id): Pass CP_PARSER_FLAGS_TYPENAME_OPTIONAL to 506 cp_parser_type_specifier_seq. 507 (cp_parser_lambda_declarator_opt): Pass 508 CP_PARSER_FLAGS_TYPENAME_OPTIONAL to 509 cp_parser_parameter_declaration_clause. 510 (cp_parser_condition): Pass CP_PARSER_FLAGS_NONE to 511 cp_parser_declarator. 512 (cp_parser_simple_declaration): Pass CP_PARSER_FLAGS_NONE to 513 cp_parser_init_declarator. 514 (cp_parser_conversion_type_id): Pass CP_PARSER_FLAGS_NONE to 515 cp_parser_type_specifier_seq. 516 (cp_parser_default_type_template_argument): Pass 517 CP_PARSER_FLAGS_TYPENAME_OPTIONAL to cp_parser_type_id. 518 (cp_parser_template_parameter): Pass CP_PARSER_FLAGS_TYPENAME_OPTIONAL 519 to cp_parser_parameter_declaration. 520 (cp_parser_explicit_instantiation): Pass CP_PARSER_FLAGS_NONE to 521 cp_parser_declarator. 522 (cp_parser_simple_type_specifier): Adjust call to cp_parser_type_name 523 to relay if we should treat the typename keyword as optional. Maybe 524 call cp_parser_make_typename_type is parsing a template-id and it's 525 not a TYPE_DECL. 526 (cp_parser_type_name): Remove unused function. 527 (cp_parser_enum_specifier): Pass to CP_PARSER_FLAGS_NONE 528 cp_parser_type_specifier_seq. 529 (cp_parser_alias_declaration): Pass CP_PARSER_FLAGS_TYPENAME_OPTIONAL 530 to cp_parser_type_id. 531 (cp_parser_init_declarator): New parameter. Pass it down to 532 cp_parser_declarator. 533 (cp_parser_declarator): New parameter. Pass CP_PARSER_FLAGS_NONE to 534 cp_parser_declarator. Pass the new parameter to 535 cp_parser_direct_declarator. 536 (cp_parser_direct_declarator): New parameter. Pass it to 537 cp_parser_parameter_declaration_clause and cp_parser_declarator. 538 (cp_parser_declarator_id): 539 (cp_parser_type_id_1): New parameter. Pass it to 540 cp_parser_type_specifier_seq. Adjust call to cp_parser_declarator. 541 (cp_parser_type_id): New parameter. Pass it to cp_parser_type_id_1. 542 (cp_parser_template_type_arg): Pass CP_PARSER_FLAGS_NONE to 543 cp_parser_type_id_1. 544 (cp_parser_trailing_type_id): Pass CP_PARSER_FLAGS_TYPENAME_OPTIONAL 545 to cp_parser_type_id_1. 546 (cp_parser_type_specifier_seq): New parameter. 547 (function_being_declared_is_template_p): 548 (cp_parser_parameter_declaration_clause): New parameter. Pass it to 549 cp_parser_parameter_declaration_list. 550 (cp_parser_parameter_declaration_list): New parameter. Pass it to 551 cp_parser_parameter_declaration. 552 (cp_parser_parameter_declaration): New parameter. Pass it to 553 cp_parser_decl_specifier_seq. Pass CP_PARSER_FLAGS_NONE to 554 cp_parser_declarator. 555 (cp_parser_member_declaration): Adjust call to 556 cp_parser_decl_specifier_seq to also include 557 CP_PARSER_FLAGS_TYPENAME_OPTIONAL. Pass 558 CP_PARSER_FLAGS_TYPENAME_OPTIONAL to cp_parser_declarator. 559 (cp_parser_exception_declaration): Pass CP_PARSER_FLAGS_NONE to 560 cp_parser_type_specifier_seq and cp_parser_declarator. 561 (cp_parser_requirement_parameter_list): Pass CP_PARSER_FLAGS_NONE to 562 cp_parser_parameter_declaration_clause. 563 (cp_parser_constructor_declarator_p): Resolve the TYPENAME_TYPE. 564 (cp_parser_single_declaration): Pass CP_PARSER_FLAGS_TYPENAME_OPTIONAL 565 to cp_parser_decl_specifier_seq and cp_parser_init_declarator. 566 (cp_parser_cache_defarg): Pass CP_PARSER_FLAGS_NONE to 567 cp_parser_declarator and cp_parser_parameter_declaration_list. 568 (cp_parser_objc_method_tail_params_opt): Pass CP_PARSER_FLAGS_NONE to 569 cp_parser_parameter_declaration. 570 (cp_parser_objc_class_ivars): Pass CP_PARSER_FLAGS_NONE to 571 cp_parser_declarator. 572 (cp_parser_objc_try_catch_finally_statement): Pass CP_PARSER_FLAGS_NONE 573 to cp_parser_parameter_declaration 574 (cp_parser_objc_struct_declaration): Pass CP_PARSER_FLAGS_NONE to 575 cp_parser_declarator. 576 (cp_parser_omp_for_loop_init): Pass CP_PARSER_FLAGS_NONE to 577 cp_parser_declarator and cp_parser_type_specifier_seq. 578 5792018-11-30 David Malcolm <dmalcolm@redhat.com> 580 581 * typeck2.c: Include "gcc-rich-location.h". 582 (cxx_incomplete_type_diagnostic): When complaining about possibly 583 missing parens, add a fix-it hint if the member function takes no 584 additional params. 585 5862018-11-30 James Norris <jnorris@codesourcery.com> 587 588 * parser.c (cp_parser_oacc_enter_exit_data): Use existing local 589 variable. 590 5912018-11-29 Paolo Carlini <paolo.carlini@oracle.com> 592 593 * decl.c (compute_array_index_type_loc): New, like the current 594 compute_array_index_type but takes a location_t too. 595 (compute_array_index_type): Forward to the latter. 596 (create_array_type_for_decl): Use compute_array_index_type_loc. 597 5982018-11-29 David Malcolm <dmalcolm@redhat.com> 599 600 PR c++/88121 601 * cp-name-hint.h (suggest_alternative_in_scoped_enum): New decl. 602 * error.c (dump_scope): Ensure that we print any scope for values 603 of unscoped enums. Print the scope of values of scoped enums. 604 (qualified_name_lookup_error): Offer suggestions for failures 605 within scoped enums by calling suggest_alternative_in_scoped_enum. 606 * name-lookup.c (class namespace_hints): Update comment to mention 607 scoped enums. 608 (namespace_hints::namespace_hints): Call 609 maybe_add_candidate_for_scoped_enum. 610 (namespace_hints::maybe_add_candidate_for_scoped_enum): New member 611 (suggest_alternatives_for): Update comment to mention scoped 612 enums. 613 (suggest_alternative_in_scoped_enum): New function. 614 6152018-11-28 Marek Polacek <polacek@redhat.com> 616 617 Implement P1094R2, Nested inline namespaces. 618 * parser.c (cp_parser_namespace_definition): Parse the optional inline 619 keyword in a nested-namespace-definition. Adjust push_namespace call. 620 Formatting fix. 621 6222018-11-28 Nathan Sidwell <nathan@acm.org> 623 624 PR c++/87531 625 * class.c (finish_struct): In a template, add artificial using 626 decl for operator=. 627 6282018-11-28 Jan Hubicka <hubicka@ucw.cz> 629 630 * except.c (do_allocate_exception): Annotate __cxa_allocate_exception 631 as COLD. 632 6332018-11-28 Marek Polacek <polacek@redhat.com> 634 635 PR c++/88222 - ICE with bit-field with invalid type. 636 * decl.c (grokdeclarator): Check if declarator is null. 637 6382018-11-28 Jakub Jelinek <jakub@redhat.com> 639 640 PR c++/87476 641 * typeck2.c (digest_init_r): Re-add handing of signed/unsigned char 642 strings and add it to the initialization of wide array from non-wide 643 string diagnostics too. 644 6452018-11-27 Jakub Jelinek <jakub@redhat.com> 646 647 PR c++/88187 648 * decl.c (grokdeclarator): Don't diagnose deduction guide errors 649 if !funcdecl_p. 650 651 PR c++/88181 652 * class.c (fixup_attribute_variants): Also propagate TYPE_PACKED 653 to variants. 654 6552018-11-26 Marek Polacek <polacek@redhat.com> 656 657 PR c++/88120 - ICE when calling save_expr in a template. 658 * typeck.c (cp_build_binary_op): Call cp_save_expr instead of 659 save_expr. 660 6612018-11-22 Jakub Jelinek <jakub@redhat.com> 662 663 PR c++/87386 664 * parser.c (cp_parser_operator): Use str.get_value () instead of just 665 str in USERDEF_LITERAL_VALUE and USERDEF_LITERAL_SUFFIX_ID arguments. 666 6672018-11-21 Jakub Jelinek <jakub@redhat.com> 668 669 PR c++/88122 670 * method.c (maybe_explain_implicit_delete): If 671 FUNCTION_FIRST_USER_PARMTYPE (decl) is NULL, set const_p to false 672 instead of ICEing. 673 674 PR c++/87386 675 * parser.c (cp_parser_primary_expression): Use 676 id_expression.get_location () instead of id_expr_token->location. 677 Adjust the range from id_expr_token->location to 678 id_expressio.get_finish (). 679 (cp_parser_operator_function_id): Pass location of the operator 680 token down to cp_parser_operator. 681 (cp_parser_operator): Add start_loc argument, always construct a 682 location with caret at start_loc and range from start_loc to the 683 finish of the last token. 684 685 PR c++/87393 686 * parser.c (cp_parser_linkage_specification): Remove useless 687 dereference of the consume_open method result. 688 6892018-11-20 Martin Sebor <msebor@redhat.com> 690 691 * cp-tree.h (cp_check_const_attributes): Declare. 692 * decl2.c (cp_check_const_attributes): Declare extern. 693 * parser.c (cp_parser_has_attribute_expression): New function. 694 (cp_parser_unary_expression): Handle RID_HAS_ATTRIBUTE_EXPRESSION. 695 (cp_parser_gnu_attribute_list): Add argument. 696 6972018-11-20 Jakub Jelinek <jakub@redhat.com> 698 699 PR c++/88110 700 * constexpr.c (cxx_eval_constant_expression) <case OBJ_TYPE_REF>: Punt 701 if get_base_address of ADDR_EXPR operand is not a DECL_P. 702 7032018-11-19 Marek Polacek <polacek@redhat.com> 704 705 PR c++/87781 - detect invalid elaborated-type-specifier. 706 * parser.c (cp_parser_elaborated_type_specifier): Ensure that 707 typename follows a nested-name-specifier. 708 7092018-11-18 Paolo Carlini <paolo.carlini@oracle.com> 710 711 * decl2.c (grokfield): Remove obsolete _vptr check; fix 712 explicit template argument list error location. 713 7142018-11-16 Kamlesh Kumar <kamleshbhalui@gmail.com> 715 716 DR 1207 717 PR c++/52869 718 * parser.c (cp_parser_noexcept_specification_opt): Call 719 inject_this_parameter. 720 7212018-11-16 Jason Merrill <jason@redhat.com> 722 723 Implement P0479R5, [[likely]] and [[unlikely]]. 724 * tree.c (handle_likeliness_attribute): New. 725 (std_attribute_table): Add likely/unlikely. 726 * cp-gimplify.c (lookup_hotness_attribute, remove_hotness_attribute) 727 (process_stmt_hotness_attribute, first_stmt): New. 728 (genericize_if_stmt): Check for duplicate predictions. 729 * parser.c (cp_parser_statement): Call 730 process_stmt_hotness_attribute. 731 (cp_parser_label_for_labeled_statement): Apply attributes to case. 732 * decl.c (finish_case_label): Give label in template type void. 733 * pt.c (tsubst_expr) [CASE_LABEL_EXPR]: Copy attributes. 734 [PREDICT_EXPR]: Handle. 735 7362018-11-16 Nathan Sidwell <nathan@acm.org> 737 738 Remove ovl_used, it is no longer needed 739 * cp-tree.h (OVL_USED_P): Delete. 740 (lookup_keep): Delete. 741 * friend.c (add_friend): Don't call it. 742 * parser.c (lookup_literal_operator): Likewise. 743 (cp_parser_primary_expression): Likewise. 744 * semantics.c (perform_koenig_lookup): Likewise. 745 * pt.c (tsubst_copy <OVERLOAD>): Don't assert OVL_USED_P. 746 * tree.c (ovl_copy): Delete. 747 (ovl_insert): Remove OVL_USED_P checks. 748 (ovl_iterator::reveal_node): Likewise. 749 (ovl_iterator::remove__node): Likewise. 750 (ovl_used, lookup_keep): Delete. 751 752 PR c++/87269 753 * parser.c (lookup_literal_operator): Mark overload for keeping 754 when inside template. Refactor. 755 7562018-11-15 Nathan Sidwell <nathan@acm.org> 757 758 PR c++/86246 759 PR c++/87989 760 * typeck.c (finish_class_member_access_expr): Conversion operator 761 to dependent type is dependent. 762 7632018-11-15 Paolo Carlini <paolo.carlini@oracle.com> 764 765 * constexpr.c (ensure_literal_type_for_constexpr_object): Use 766 DECL_SOURCE_LOCATION in error_at calls. 767 7682018-11-15 Nathan Sidwell <nathan@acm.org> 769 770 DR 2336 771 * cp-tree.h (enum special_function_kind): Add sfk_virtual_destructor. 772 * method.c (type_has_trivial_fn): Add it. 773 (SFK_DTOR_P): Likewise. 774 (synthesized_method_base_walk): Don't check access of vbases of 775 abstract classes when sfk_virtual_destructor. 776 (synthesized_method_walk): Skip vbases of abstract classes except 777 when sfk_virtual_destructor. 778 (get_defaulted_eh_spec): Set sfk_virtual_destructor as needed. 779 780 * cp-tree.h (enum special_function_kind): Reorder and comment. 781 * method.c (SFK_CTOR_P, SFK_DTOR_P, SFK_ASSIGN_P, SFK_COPY_P) 782 (SFK_MOVE_P): New predicates. 783 (walk_field_subobs, synthesized_method_base_walk): Drop 784 copy_arg_p, move_p, assign_p args. Use new SFK predicates. Order 785 parameters consistently. 786 (synthesized_method_walk): Drop ctor_p, copy_arg_p, move_p, 787 assign_p calculations. Use new SFK predicates. Adjust calls to 788 worker functions. 789 7902018-11-14 Paolo Carlini <paolo.carlini@oracle.com> 791 792 * parser.c (make_id_declarator): Add location_t parameter. 793 (cp_parser_lambda_declarator_opt): Adjust call. 794 (cp_parser_decomposition_declaration): Likewise. 795 (cp_parser_alias_declaration): Likewise. 796 (cp_parser_direct_declarator): Likewise. 797 (cp_parser_member_declaration): Likewise. 798 (cp_parser_objc_class_ivars): Likewise. 799 * decl.c (grokdeclarator): Use declarator->id_loc in two error 800 messages. 801 8022018-11-14 Jakub Jelinek <jakub@redhat.com> 803 804 P1236R1 - Signed integers are two's complement 805 * constexpr.c (cxx_eval_check_shift_p): Disable the signed LSHIFT_EXPR 806 checks for c++2a. 807 8082018-11-13 David Malcolm <dmalcolm@redhat.com> 809 810 * call.c: Replace "source_location" with "location_t". 811 * cp-tree.h: Likewise. 812 * cvt.c: Likewise. 813 * name-lookup.c: Likewise. 814 * parser.c: Likewise. 815 * typeck.c: Likewise. 816 8172018-11-12 Jason Merrill <jason@redhat.com> 818 819 Implement P0315R4, Lambdas in unevaluated contexts. 820 * decl2.c (min_vis_expr_r): Handle LAMBDA_EXPR. 821 * mangle.c (write_expression): Handle LAMBDA_EXPR. 822 * parser.c (cp_parser_lambda_expression): Allow lambdas in 823 unevaluated context. Start the tentative firewall sooner. 824 (cp_parser_lambda_body): Use cp_evaluated. 825 * pt.c (iterative_hash_template_arg): Handle LAMBDA_EXPR. 826 (tsubst_function_decl): Substitute a lambda even if it isn't 827 dependent. 828 (tsubst_lambda_expr): Use cp_evaluated. Always complain. 829 (tsubst_copy_and_build) [LAMBDA_EXPR]: Do nothing if tf_partial. 830 * semantics.c (begin_class_definition): Allow in template parm list. 831 * tree.c (strip_typedefs_expr): Pass through LAMBDA_EXPR. 832 (cp_tree_equal): Handle LAMBDA_EXPR. 833 834 * pt.c (fn_type_unification): If we have a full set of explicit 835 arguments, go straight to substitution. 836 837 * decl2.c (min_vis_expr_r, expr_visibility): New. 838 (min_vis_r): Call expr_visibility. 839 (constrain_visibility_for_template): Likewise. 840 841 Implement P0722R3, destroying operator delete. 842 * call.c (std_destroying_delete_t_p, destroying_delete_p): New. 843 (aligned_deallocation_fn_p, usual_deallocation_fn_p): Use 844 destroying_delete_p. 845 (build_op_delete_call): Handle destroying delete. 846 * decl2.c (coerce_delete_type): Handle destroying delete. 847 * init.c (build_delete): Don't call dtor with destroying delete. 848 * optimize.c (build_delete_destructor_body): Likewise. 849 850 Implement P0780R2, pack expansion in lambda init-capture. 851 * parser.c (cp_parser_lambda_introducer): Parse pack init-capture. 852 * pt.c (tsubst_pack_expansion): Handle init-capture packs. 853 (lookup_init_capture_pack): New. 854 (tsubst_expr) [DECL_EXPR]: Use it. 855 (tsubst_lambda_expr): Remember field pack expansions for 856 init-captures. 857 858 * cp-tree.h (struct cp_evaluated): New. 859 * init.c (get_nsdmi): Use it. 860 * parser.c (cp_parser_enclosed_template_argument_list): Use it. 861 * pt.c (coerce_template_parms, tsubst_aggr_type): Use it. 862 8632018-11-09 Jakub Jelinek <jakub@redhat.com> 864 865 * parser.c (cp_parser_omp_clause_final, cp_parser_omp_clause_if): Use 866 cp_parser_assignment_expression instead of cp_parser_condition. 867 (cp_parser_omp_clause_num_threads, cp_parser_omp_clause_num_tasks, 868 cp_parser_omp_clause_grainsize, cp_parser_omp_clause_priority, 869 cp_parser_omp_clause_num_teams, cp_parser_omp_clause_thread_limit, 870 cp_parser_omp_clause_linear, cp_parser_omp_clause_device): Use 871 cp_parser_assignment_expression instead of cp_parser_expression. 872 (cp_parser_omp_clause_hint): Likewise. Formatting fix. 873 874 * parser.c (cp_parser_omp_clause_reduction): Call sorry_at on 875 reduction clause with inscan modifier. 876 877 * parser.c (cp_parser_omp_requires): Call sorry_at on requires 878 clauses other than atomic_default_mem_order. 879 8802018-11-09 Martin Sebor <msebor@redhat.com> 881 882 PR middle-end/81824 883 * pt.c (warn_spec_missing_attributes): Move code to attribs.c. 884 Call decls_mismatched_attributes. 885 8862018-11-08 Jakub Jelinek <jakub@redhat.com> 887 888 * constexpr.c (potential_constant_expression_1): Handle OMP_DEPOBJ. 889 * cp-gimplify.c (cp_genericize_r): Handle 890 OMP_CLAUSE_{IN,TASK}_REDUCTION. 891 (cxx_omp_predetermined_sharing_1): Don't return 892 OMP_CLAUSE_DEFAULT_SHARED for const qualified decls with no mutable 893 member. Return OMP_CLAUSE_DEFAULT_FIRSTPRIVATE for this pointer. 894 * cp-objcp-common.c (cp_common_init_ts): Handle OMP_DEPOBJ. 895 * cp-tree.def (OMP_DEPOBJ): New tree code. 896 * cp-tree.h (OMP_ATOMIC_DEPENDENT_P): Return true also for first 897 argument being OMP_CLAUSE. 898 (OMP_DEPOBJ_DEPOBJ, OMP_DEPOBJ_CLAUSES): Define. 899 (cp_convert_omp_range_for, cp_finish_omp_range_for): Declare. 900 (finish_omp_atomic): Add LOC, CLAUSES and MO arguments. Remove 901 SEQ_CST argument. 902 (finish_omp_for_block): Declare. 903 (finish_omp_flush): Add MO argument. 904 (finish_omp_depobj): Declare. 905 * cxx-pretty-print.c (cxx_pretty_printer::statement): Handle 906 OMP_DEPOBJ. 907 * dump.c (cp_dump_tree): Likewise. 908 * lex.c (cxx_init): Likewise. 909 * parser.c: Include memmodel.h. 910 (cp_parser_for): Pass false as new is_omp argument to 911 cp_parser_range_for. 912 (cp_parser_range_for): Add IS_OMP argument, return before finalizing 913 if it is true. 914 (cp_parser_omp_clause_name): Handle nontemporal, in_reduction and 915 task_reduction clauses. 916 (cp_parser_omp_var_list_no_open): Handle 917 OMP_CLAUSE_{IN,TASK}_REDUCTION. For OMP_CLAUSE_DEPEND, parse clause 918 operands as either an array section, or lvalue assignment expression. 919 (cp_parser_omp_clause_if): Handle cancel and simd modifiers. 920 (cp_parser_omp_clause_defaultmap): Parse new kinds of defaultmap 921 clause. 922 (cp_parser_omp_clause_reduction): Add IS_OMP and KIND arguments. 923 Parse reduction modifiers. Pass KIND to c_parser_omp_variable_list. 924 (cp_parser_omp_clause_lastprivate, cp_parser_omp_iterators): New 925 functions. 926 (cp_parser_omp_clause_depend): Parse iterator modifier and handle 927 iterators. Parse mutexinoutset and depobj kinds. 928 (cp_parser_oacc_all_clauses): Adjust cp_parser_omp_clause_reduction 929 callers. 930 (cp_parser_omp_all_clauses): Likewise. Handle 931 PRAGMA_OMP_CLAUSE_NONTEMPORAL and 932 PRAGMA_OMP_CLAUSE_{IN,TASK}_REDUCTION. Call 933 cp_parser_omp_clause_lastprivate for OpenMP lastprivate clause. 934 (cp_parser_omp_atomic): Pass pragma_tok->location as 935 LOC to finish_omp_atomic. Parse hint and memory order clauses. 936 Handle default memory order from requires directive if any. Adjust 937 finish_omp_atomic caller. 938 (cp_parser_omp_critical): Allow comma in between (name) and hint 939 clause. 940 (cp_parser_omp_depobj): New function. 941 (cp_parser_omp_flush): Parse flush with memory-order-clause. 942 (cp_parser_omp_for_cond): Allow NE_EXPR even in OpenMP loops. 943 (cp_convert_omp_range_for, cp_finish_omp_range_for): New functions. 944 (cp_parser_omp_for_loop): Parse C++11 range for loops among omp 945 loops. Handle OMP_CLAUSE_IN_REDUCTION like OMP_CLAUSE_REDUCTION. 946 (OMP_SIMD_CLAUSE_MASK): Add if and nontemporal clauses. 947 (cp_parser_omp_simd, cp_parser_omp_for): Call keep_next_level before 948 begin_omp_structured_block and call finish_omp_for_block on 949 finish_omp_structured_block result. 950 (cp_parser_omp_master): Add p_name, mask and cclauses arguments. 951 Allow to be called while parsing combined parallel master. 952 Parse combined master taskloop{, simd}. 953 (cp_parser_omp_parallel): Parse combined 954 parallel master{, taskloop{, simd}} constructs. 955 (cp_parser_omp_single): Use SET_EXPR_LOCATION. 956 (OMP_TASK_CLAUSE_MASK): Add in_reduction clause. 957 (OMP_TASKWAIT_CLAUSE_MASK): Define. 958 (cp_parser_omp_taskwait): Handle taskwait with depend clauses. 959 (OMP_TASKGROUP_CLAUSE_MASK): Define. 960 (cp_parser_omp_taskgroup): Parse taskgroup clauses, adjust 961 c_finish_omp_taskgroup caller. 962 (cp_parser_omp_distribute): Call keep_next_level before 963 begin_omp_structured_block and call finish_omp_for_block on 964 finish_omp_structured_block result. 965 (cp_parser_omp_teams): Force a BIND_EXPR with BLOCK around teams 966 body. 967 (cp_parser_omp_target_data): Allow target data with only 968 use_device_ptr clauses. 969 (cp_parser_omp_target): Set OMP_REQUIRES_TARGET_USED bit in 970 omp_requires_mask. 971 (cp_parser_omp_requires): New function. 972 (OMP_TASKLOOP_CLAUSE_MASK): Add reduction and in_reduction clauses. 973 (cp_parser_omp_taskloop): Add forward declaration. Disallow 974 in_reduction clause when combined with parallel master. Call 975 keep_next_level before begin_omp_structured_block and call 976 finish_omp_for_block on finish_omp_structured_block result. 977 (cp_parser_omp_construct): Adjust cp_parser_omp_master caller. 978 (cp_parser_pragma): Handle PRAGMA_OMP_DEPOBJ and PRAGMA_OMP_REQUIRES. 979 * pt.c (tsubst_omp_clause_decl): Add iterators_cache argument. 980 Adjust recursive calls. Handle iterators. 981 (tsubst_omp_clauses): Handle OMP_CLAUSE_{IN,TASK}_REDUCTION and 982 OMP_CLAUSE_NONTEMPORAL. Adjust tsubst_omp_clause_decl callers. 983 (tsubst_decomp_names): 984 (tsubst_omp_for_iterator): Change orig_declv into a reference. 985 Handle range for loops. Move orig_declv handling after declv/initv 986 handling. 987 (tsubst_expr): Force a BIND_EXPR with BLOCK around teams body. 988 Adjust finish_omp_atomic caller. Call keep_next_level before 989 begin_omp_structured_block. Call cp_finish_omp_range_for for range 990 for loops and use {begin,finish}_omp_structured_block instead of 991 {push,pop}_stmt_list if there are any range for loops. Call 992 finish_omp_for_block on finish_omp_structured_block result. 993 Handle OMP_DEPOBJ. Handle taskwait with depend clauses. For 994 OMP_ATOMIC call tsubst_omp_clauses on clauses if any, adjust 995 finish_omp_atomic caller. Use OMP_ATOMIC_MEMORY_ORDER rather 996 than OMP_ATOMIC_SEQ_CST. Handle clauses on OMP_TASKGROUP. 997 (dependent_omp_for_p): Always return true for range for loops if 998 processing_template_decl. Return true if class type iterator 999 does not have INTEGER_CST increment. 1000 * semantics.c: Include memmodel.h. 1001 (handle_omp_array_sections_1): Handle OMP_CLAUSE_{IN,TASK}_REDUCTION 1002 like OMP_CLAUSE_REDUCTION. 1003 (handle_omp_array_sections): Likewise. Call save_expr on array 1004 reductions before calling build_index_type. Handle depend clauses 1005 with iterators. 1006 (finish_omp_reduction_clause): Call save_expr for whole array 1007 reduction sizes. Don't mark OMP_CLAUSE_DECL addressable if it has 1008 reference type. Do mark decl_placeholder addressable if needed. 1009 Use error_at with OMP_CLAUSE_LOCATION (c) as first argument instead 1010 of error. 1011 (cp_omp_finish_iterators): New function. 1012 (finish_omp_clauses): Don't diagnose nonmonotonic clause with static, 1013 runtime or auto schedule kinds. Diagnose nogroup clause used with 1014 reduction clause(s). Handle depend clause with 1015 OMP_CLAUSE_DEPEND_DEPOBJ. Diagnose bit-fields. Require 1016 omp_depend_t type for OMP_CLAUSE_DEPEND_DEPOBJ kinds and 1017 some different type for other kinds. Use cp_build_addr_expr 1018 and cp_build_indirect_ref instead of cxx_mark_addressable. 1019 Handle depend clauses with iterators. Only handle static data members 1020 in the special case that const qualified vars may be specified in 1021 firstprivate clause. Complain if const qualified vars without mutable 1022 members are mentioned in data-sharing clauses other than firstprivate 1023 or shared. Use error_at with OMP_CLAUSE_LOCATION (c) as first 1024 argument instead of error. Diagnose more than one nontemporal clause 1025 refering to the same variable. Use error_at rather than error for 1026 priority and hint clause diagnostics. Fix pasto for hint clause. 1027 Diagnose hint expression that doesn't fold into INTEGER_CST. 1028 Diagnose if clause with modifier other than cancel. Handle 1029 OMP_CLAUSE_{IN,TASK}_REDUCTION like OMP_CLAUSE_REDUCTION. Allow any 1030 lvalue as OMP_CLAUSE_DEPEND operand (besides array section), adjust 1031 diagnostics. 1032 (handle_omp_for_class_iterator): Don't create a new TREE_LIST if one 1033 has been created already for range for, just fill TREE_PURPOSE and 1034 TREE_VALUE. Call cp_fully_fold on incr. 1035 (finish_omp_for): Don't check cond/incr if cond is global_namespace. 1036 Pass to c_omp_check_loop_iv_exprs orig_declv if non-NULL. Don't 1037 use IS_EMPTY_STMT on NULL pre_body. Adjust c_finish_omp_for caller. 1038 (finish_omp_for_block): New function. 1039 (finish_omp_atomic): Add LOC argument, pass it through 1040 to c_finish_omp_atomic and set it as location of OMP_ATOMIC* trees. 1041 Remove SEQ_CST argument. Add CLAUSES and MO arguments. Adjust 1042 c_finish_omp_atomic caller. Stick clauses if any into first argument 1043 of wrapping OMP_ATOMIC. 1044 (finish_omp_depobj): New function. 1045 (finish_omp_flush): Add MO argument, if not 1046 MEMMODEL_LAST, emit __atomic_thread_fence call with the given value. 1047 (finish_omp_cancel): Diagnose if clause with modifier other than 1048 cancel. 1049 10502018-11-07 Nathan Sidwell <nathan@acm.org> 1051 1052 PR c++/87904 1053 * cp-tree.h (struct tree_overload): Fix comment. 1054 * tree.c (ovl_iterator::reveal_node): Propagate OVL_DEDUP_P. 1055 10562018-11-04 Jason Merrill <jason@redhat.com> 1057 1058 Implement UDL changes from P0732R2. 1059 * cp-tree.h (struct releasing_vec): Move from mangle.c. 1060 Add get_ref method. 1061 * parser.c (cp_parser_userdef_string_literal): Use it. Handle 1062 passing the string to a single template parameter of class type. 1063 (cp_parser_template_declaration_after_parameters): Allow it. 1064 Pedwarn about the character pack template that was proposed but not 1065 accepted for C++14, and don't suggest it. 1066 1067 Implement P0732R2, class types in non-type template parameters. 1068 * error.c (dump_simple_decl): Look through a template parm object. 1069 * mangle.c (write_template_arg): Likewise. 1070 (mangle_template_parm_object): New. 1071 * pt.c (template_parm_object_p, get_template_parm_object): New. 1072 (invalid_tparm_referent_p): Factor from convert_nontype_argument. 1073 (convert_nontype_argument, invalid_nontype_parm_type_p): Handle 1074 class-type template arguments. 1075 * tree.c (lvalue_kind): Likewise. 1076 1077 * cvt.c (ocp_convert): Don't wrap a CONSTRUCTOR in a NOP_EXPR. 1078 * constexpr.c (initialized_type): Fix AGGR_INIT_EXPR handling. 1079 (cxx_eval_vec_init_1): Correct type of AGGR_INIT_EXPR. 1080 (cxx_eval_outermost_constant_expr): Make sure a CONSTRUCTOR has the 1081 right type. Don't wrap a CONSTRUCTOR if one was passed in. 1082 * tree.c (build_aggr_init_expr): Check for void. 1083 1084 PR c++/60503 - wrong lambda attribute syntax. 1085 * parser.c (cp_parser_lambda_declarator_opt): Fix attribute 1086 handling. 1087 10882018-11-02 Nathan Sidwell <nathan@acm.org> 1089 1090 * decl.c (duplicate_decls): Refactor checks. 1091 10922018-11-01 Marek Polacek <polacek@redhat.com> 1093 1094 Implement P0846R0, ADL and function templates. 1095 * decl.c (grokfndecl): Allow FUNCTION_DECL in assert. 1096 * lex.c (unqualified_fn_lookup_error): Handle TEMPLATE_ID_EXPR. 1097 * parser.c (cp_parser_postfix_expression): Do ADL for a template-name. 1098 (cp_parser_template_id): Give errors if parsing the template argument 1099 list didn't go well. Allow FUNCTION_DECL in assert. 1100 (cp_parser_template_name): Consider a name to refer to a template if 1101 it is an unqualified-id followed by a <. Don't return the identifier 1102 if the decl is a function and dependent. 1103 * pt.c (tsubst_copy) <case OVERLOAD>: Remove assert. 1104 11052018-11-01 Nathan Sidwell <nathan@acm.org> 1106 1107 * cp-tree.h (struct lang_function): Delete x_local_names field. 1108 (struct lang_decl_base): Rename u2sel to spare. 1109 (struct lang_decl_min): Remove lang_decl_u2 union. Keep access 1110 field. 1111 (LANG_DECL_U2_CHECK): Delete. 1112 (DECL_DISCRIMINATOR_P): Require function scope. 1113 (DECL_DISCRIMINATOR): Adjust. 1114 (DECL_DISCRIMINATOR_SET_P): Delete. 1115 (DECL_CAPTURED_VARIABLE, DECL_ACCESS, THUnK_VIRTUAL_OFFSET): Adjust. 1116 (local_classes): Don't declare. 1117 (determine_local_discriminator): Declare. 1118 * decl.c (push_local_name): Delete. 1119 (local_entities, determina_local_discrminator): New. 1120 (duplicate_decls): Copy DECL_ACCESS. Fix formatting. 1121 (cp_finish_decl): Use determine_local_discriminator. 1122 (save_function_data): Drop x_local_names. 1123 (finish_function): Drop local_names. 1124 * decl2.c (finish_anon_union): Use determine_local_disciminator. 1125 * mangle.c (write_unnamed_type_name): Use 1126 discriminator_for_local_entity. 1127 (local_class_index): Delete. 1128 (discriminator_for_local_entity): Reimplement. 1129 (write_local_name): Adjust discriminator code. 1130 * name-lookup.c (do_pushtag): Call determine_local_discrimiator. 1131 * semantics.c (finish_omp_threadprivate): Drop DECL_DISCRIMINATOR 1132 handling. 1133 * class.c (local_classes): Delete. 1134 (init_class_processing): Don't init it. 1135 11362018-11-01 Martin Liska <mliska@suse.cz> 1137 Jason Merrill <jason@redhat.com> 1138 1139 PR c++/64266 1140 PR bootstrap/70422 1141 PR ipa/81277 1142 * cp-tree.h (DECL_FNAME_P): New macro. 1143 * decl.c (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P, 1144 DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. 1145 (cp_finish_decl): 1146 * lambda.c (is_capture_proxy): Use DECL_FNAME_P. 1147 * pt.c (tsubst_expr): Handle DECL_PRETTY_FUNCTION_P. 1148 11492018-10-31 Nathan Sidwell <nathan@acm.org> 1150 1151 * cp-tree.h (OVL_DEDUP_P): New. 1152 * name-lookup.c (name_lookup::add_overload): Check OVL_DEDUP_P. 1153 (get_class_binding_direct): Likwise. 1154 * tree.c (ovl_make): Propagate OVL_DEDUP_P. 1155 (ovl_copy): Copy it. 1156 (ovl_insert): Do not keep using-decls ordered. 1157 (lookup_maybe_add): Adjust comment. 1158 11592018-10-30 Marek Polacek <polacek@redhat.com> 1160 1161 Implement P0892R2, explicit(bool). 1162 * call.c (add_template_candidate_real): Return if the declaration is 1163 explicit and we're only looking for non-converting constructor. 1164 * cp-tree.h (lang_decl_fn): Add has_dependent_explicit_spec_p bit. 1165 (DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P): New macro. 1166 (cp_decl_specifier_seq): Add explicit_specifier field. 1167 (build_explicit_specifier, store_explicit_specifier): Declare. 1168 * decl.c (grokdeclarator): Call store_explicit_specifier. 1169 (build_explicit_specifier): New function. 1170 * parser.c (cp_parser_function_specifier_opt) <case RID_EXPLICIT>: 1171 Parse C++20 explicit(bool). 1172 * pt.c (store_explicit_specifier, lookup_explicit_specifier): New. 1173 (tsubst_function_decl): Handle explicit(dependent-expr). 1174 11752018-10-30 Paolo Carlini <paolo.carlini@oracle.com> 1176 1177 * decl.c (grokdeclarator): Use declarator->id_loc in diagnostic 1178 about flexible array members. 1179 11802018-10-29 David Malcolm <dmalcolm@redhat.com> 1181 1182 * cp-name-hint.h: New file. 1183 * cp-tree.h (expr_to_string): New decl. 1184 (suggest_alternatives_for): Move to cp-name-hint.h, changing 1185 return type from bool to name_hint. 1186 (suggest_alternative_in_explicit_scope): Likewise. 1187 * error.c: Define INCLUDE_UNIQUE_PTR. Include "cp-name-hint.h". 1188 (expr_to_string): Make non-static. 1189 (qualified_name_lookup_error): For the non-"::" case, take 1190 responsibity for issuing any suggestion from 1191 suggest_alternative_in_explicit_scope, as it changes from 1192 returning a bool to returning a name_hint. Replace fallback call 1193 to suggest_alternatives_for to a call to 1194 suggest_alternatives_in_other_namespaces, capturing the fact that 1195 we don't have enough location information to issue a fix-it hint 1196 for this case. Update the error to support emitting a fix-it hint 1197 where appropriate. For the "::" case, take responsibility for 1198 issuing any suggestion from suggest_alternatives_for, supporting 1199 emitting a fix-it hint. 1200 * lex.c: Define INCLUDE_UNIQUE_PTR. Include "gcc-rich-location.h" 1201 and "cp-name-hint.h". 1202 (unqualified_name_lookup_error): Take responsibility for issuing 1203 any suggestion from suggest_alternatives_for, supporting emitting 1204 a fix-it hint. 1205 * name-lookup.c (class namespace_limit_reached): New subclass of 1206 deferred_diagnostic. 1207 (class show_candidate_location): Likewise. 1208 (class suggest_alternatives): Likewise. 1209 (class namespace_hints): New class. 1210 (suggest_alternatives_for): Convert return type from bool to 1211 name_hint, replacing all direct diagnostic emission by setting 1212 suggestions on the return value, or creating deferred diagnostics. 1213 Specifically, split out initial traversal of namespaces into 1214 namespace_hints' ctor, and maybe_decorate_with_limit, and move the 1215 rest of the implementation to 1216 namespace_hints::convert_candidates_to_name_hint and 1217 suggest_alternatives_for_1. 1218 (namespace_hints::namespace_hints): New ctor, adapted from 1219 suggest_alternatives_for's initial namespace traversal, storing 1220 location and name, and converting locals "candidates", "limited" 1221 and "limit" into members. 1222 (namespace_hints::convert_candidates_to_name_hint): New member 1223 function. 1224 (namespace_hints::maybe_decorate_with_limit): New member function. 1225 (suggest_alternatives_for_1): New function, based on second half 1226 of old implementation of suggest_alternatives_for, converting from 1227 immediate emission of suggestions to using name_hint. 1228 (suggest_alternatives_in_other_namespaces): New function. 1229 (maybe_suggest_missing_std_header): Convert from immediate 1230 emission of suggestions to using name_hint, moving emission 1231 implementation to... 1232 (class missing_std_header): New subclass of deferred_diagnostic. 1233 (maybe_suggest_missing_header): Convert return type from bool to 1234 name_hint. 1235 (suggest_alternative_in_explicit_scope): Convert from immediate 1236 emission of suggestions to using name_hint. 1237 * parser.c: Replace include of "c-family/name-hint.h" with 1238 "cp-name-hint.h". 1239 (cp_parser_diagnose_invalid_type_name): Update 1240 "is there a suggestion" logic for change to 1241 name_hint::operator bool. Take responsibility for emitting 1242 fix-it hints from suggest_alternative_in_explicit_scope. 1243 (cp_parser_namespace_name): Take responsibility for emitting 1244 fix-it hints from suggest_alternative_in_explicit_scope. Don't 1245 emit the "expected namespace-name" error if we've already emitted 1246 an "is not a namespace-name" error. 1247 12482018-10-29 David Malcolm <dmalcolm@redhat.com> 1249 1250 PR c++/56856 1251 * call.c (build_over_call): Eliminate the "arglocs" array, and the 1252 call to maybe_constant_value when building "fargs". 1253 12542018-10-29 Paolo Carlini <paolo.carlini@oracle.com> 1255 1256 * decl.c (create_array_type_for_decl): Add location_t parameter 1257 and use it. 1258 (grokdeclarator): Adjust call. 1259 12602018-10-29 Marek Polacek <polacek@redhat.com> 1261 1262 PR c++/87594 - constexpr rejects-valid with range-based for. 1263 * constexpr.c (potential_constant_expression_1): If the condition 1264 can't be evaluated, return true. 1265 12662018-10-29 Joseph Myers <joseph@codesourcery.com> 1267 Julian Brown <julian@codesourcery.com> 1268 1269 PR c++/66053 1270 * semantics.c (handle_omp_array_sections_1): Allow array 1271 sections with "this" pointer for OpenACC. 1272 12732018-10-25 Jason Merrill <jason@redhat.com> 1274 1275 * parser.c (cp_parser_sizeof_operand): Remove redundant use of 1276 grokdeclarator. 1277 12782018-10-24 Jakub Jelinek <jakub@redhat.com> 1279 1280 PR c++/86288 1281 * parser.c (cp_parser_std_attribute): Canonicalize attr_ns, and when 1282 :: is not present and attr_ns non-NULL, canonicalize also attr_id. 1283 (cp_parser_attribute_spec): Fix comment typo. 1284 12852018-10-24 Martin Sebor <msebor@redhat.com> 1286 1287 PR c++/84851 1288 * call.c (maybe_warn_class_memaccess): Tighten up. 1289 12902018-10-17 David Malcolm <dmalcolm@redhat.com> 1291 1292 * Make-lang.in (selftest-c++): New. 1293 (CPP_SELFTEST_FLAGS, CPP_SELFTEST_DEPS, s-selftest-c++) 1294 (selftest-c++-gdb, selftest-c++-valgrind): Move here from 1295 gcc/Makefile.in. 1296 12972018-10-17 Paolo Carlini <paolo.carlini@oracle.com> 1298 1299 PR c++/84705 1300 * tree.c (build_cplus_new): Avoid duplicate diagnostic about 1301 incomplete type, early return error_mark_node if the second 1302 argument is error_mark_node. 1303 13042018-10-12 Nathan Sidwell <nathan@acm.org> 1305 1306 * parser.h (struct cp_parser): Drop implicit_extern_c. 1307 * parser.c (cp_debug_parser): Drop implicit_extern_c. 1308 (cp_parser_new): Likewise. 1309 (cp_parser_translation_unit): Handle implicit extern c here. Call 1310 cp_parser_toplevel_declaration. 1311 (cp_parser_toplevel_declaration): New, broken out of ... 1312 (cp_parser_declaration_seq_opt): ... here. Call it. Drop 1313 implicit extern C handling. 1314 13152018-10-11 Will Wray <wjwray@gmail.com> 1316 1317 PR c++/87364 1318 * cxx-pretty-print.c (pp_cxx_enumeration_constant): New function. 1319 (cxx_pretty_printer::constant): Use it. 1320 13212018-10-11 David Malcolm <dmalcolm@redhat.com> 1322 1323 PR c++/84993 1324 * call.c (enforce_access): Move diagnostics to... 1325 (complain_about_access): ...this new function. 1326 * cp-tree.h (class access_failure_info): Rename split out field 1327 "m_field_decl" into "m_decl" and "m_diag_decl". 1328 (access_failure_info::record_access_failure): Add tree param. 1329 (access_failure_info::was_inaccessible_p): New accessor. 1330 (access_failure_info::get_decl): New accessor. 1331 (access_failure_info::get_diag_decl): New accessor. 1332 (access_failure_info::get_any_accessor): New member function. 1333 (access_failure_info::add_fixit_hint): New static member function. 1334 (complain_about_access): New decl. 1335 * typeck.c (access_failure_info::record_access_failure): Update 1336 for change to fields. 1337 (access_failure_info::maybe_suggest_accessor): Split out into... 1338 (access_failure_info::get_any_accessor): ...this new function... 1339 (access_failure_info::add_fixit_hint): ...and this new function. 1340 (finish_class_member_access_expr): Split out "has no member named" 1341 error-handling into... 1342 (complain_about_unrecognized_member): ...this new function, and 1343 check that the guessed name is accessible along the access path. 1344 Only provide a spell-correction fix-it hint if it is; otherwise, 1345 attempt to issue an accessor fix-it hint. 1346 13472018-10-11 Nathan Sidwell <nathan@acm.org> 1348 1349 * parser.c (cp_parser_translation_unit): Return void. Don't fail 1350 at first extra }, simplify logic. 1351 (c_parse_file): Call finish_translation_unit here. 1352 13532018-10-11 Jakub Jelinek <jakub@redhat.com> 1354 1355 PR c++/87582 1356 * typeck.c (maybe_warn_about_returning_address_of_local): If 1357 whats_returned is a structured binding identifier and the structured 1358 binding is a reference, recurse on its initializer. 1359 1360 PR c++/87547 1361 * rtti.c (get_tinfo_decl_dynamic): Use unlowered_expr_type instead 1362 of TREE_TYPE. 1363 13642018-10-10 Marek Polacek <polacek@redhat.com> 1365 1366 PR c++/87567 - constexpr rejects call to non-constexpr function. 1367 * constexpr.c (potential_constant_expression_1) <case FOR_STMT>: Return 1368 true if the condition is always false. 1369 <case WHILE_STMT>: Likewise. 1370 13712018-10-09 Paolo Carlini <paolo.carlini@oracle.com> 1372 1373 PR c++/84423 1374 * pt.c (convert_template_argument): Immediately return error_mark_node 1375 if the second argument is erroneous. 1376 * parser.c (cp_parser_type_id): Add location_t * parameter. 1377 (cp_parser_type_id_1): Likewise. 1378 (cp_parser_alias_declaration): Adjust cp_parser_type_id call, 1379 obtain the location of the type and save it. 1380 (cp_parser_template_type_arg): Adjust. 1381 (cp_parser_trailing_type_id): Likewise. 1382 * decl.c (grokdeclarator): Improve error message for 'auto' in 1383 alias declaration. 1384 13852018-10-08 Paolo Carlini <paolo.carlini@oracle.com> 1386 1387 PR c++/71128 1388 * pt.c (do_decl_instantiation): Per 12.6.8/5, a concept cannot be 1389 explicitly instantiated. 1390 13912018-10-05 David Malcolm <dmalcolm@redhat.com> 1392 1393 PR c++/56856 1394 * call.c (build_over_call): Build a vec of locations of the 1395 arguments before the call to maybe_constant_value, and pass to 1396 check_function_arguments. 1397 * cp-lang.c (LANG_HOOKS_GET_SUBSTRING_LOCATION): Define as 1398 c_get_substring_location. 1399 * parser.c (cp_parser_string_literal): Capture string 1400 concatenation locations. 1401 14022018-10-04 Nathan Sidwell <nathan@acm.org> 1403 1404 * lang-specs.h: Use string contatenation, not line splicing. 1405 14062018-10-03 Jason Merrill <jason@redhat.com> 1407 1408 Implement P0840, language support for empty objects. 1409 * tree.c (handle_no_unique_addr_attribute): New. 1410 (cxx_attribute_table): Add [[no_unique_address]]. 1411 * class.c (field_poverlapping_p): New. 1412 (layout_class_type): Check it. Adjust DECL_SIZE of potentially 1413 overlapping fields. 1414 (layout_empty_base_or_field): Rename from layout_empty_base, handle 1415 FIELD_DECL as well. 1416 (build_base_field, record_subobject_offsets): Adjust. 1417 14182018-10-03 Martin Liska <mliska@suse.cz> 1419 1420 PR gcov-profile/86109 1421 * parser.c (cp_parser_lambda_declarator_opt): 1422 Set DECL_LAMBDA_FUNCTION for lambdas. 1423 14242018-10-02 Richard Biener <rguenther@suse.de> 1425 1426 * name-lookup.c (check_local_shadow): Do not test DECL_FROM_INLINE. 1427 14282018-09-28 Eric Botcazou <ebotcazou@adacore.com> 1429 Pierre-Marie de Rodat <derodat@adacore.com> 1430 1431 * method.c (use_thunk): Adjust call to cgraph_node::create_thunk. 1432 14332018-09-28 Richard Biener <rguenther@suse.de> 1434 1435 * error.c (cp_print_error_function): Simplify by eliding 1436 the BLOCK_ABSTRACT_ORIGIN chasing. 1437 14382018-09-27 Paolo Carlini <paolo.carlini@oracle.com> 1439 1440 PR c++/84940 1441 * semantics.c (finish_unary_op_expr): Check return value of 1442 build_x_unary_op for error_mark_node. 1443 14442018-09-25 Jakub Jelinek <jakub@redhat.com> 1445 1446 PR c++/87398 1447 * constexpr.c (cxx_eval_constant_expression) <case OBJ_TYPE_REF>: Only 1448 look through COMPONENT_REFs with DECL_FIELD_IS_BASE FIELD_DECLs. 1449 14502018-09-25 Martin Liska <mliska@suse.cz> 1451 1452 * name-lookup.c (namespace_scope_ht_size): Remove 1453 unused function. 1454 * parser.c (cp_lexer_next_token_is_not_keyword): Likewise. 1455 14562018-09-24 Paolo Carlini <paolo.carlini@oracle.com> 1457 1458 PR c++/85070 1459 * method.c (lazily_declare_fn): During error-recovery add_method 1460 may return false. 1461 14622018-09-21 Marek Polacek <polacek@redhat.com> 1463 1464 PR c++/87372 - __func__ constexpr evaluation. 1465 * constexpr.c (maybe_constant_init_1): Pass false for strict down to 1466 cxx_eval_outermost_constant_expr. 1467 14682018-09-20 Marek Polacek <polacek@redhat.com> 1469 1470 PR c++/87109 - wrong ctor with maybe-rvalue semantics. 1471 * call.c (build_user_type_conversion_1): Refine the maybe-rvalue 1472 check to only return if we're converting the return value to a base 1473 class. 1474 14752018-09-20 Allan Sandfeld Jensen <allan.jensen@qt.io> 1476 1477 * g++spec.c (lang_specific_driver): Handle -r like -nostdlib. 1478 14792018-09-20 Jason Merrill <jason@redhat.com> 1480 1481 PR c++/87075 - ICE with constexpr array initialization. 1482 * constexpr.c (cxx_eval_vec_init_1): Handle trivial initialization. 1483 14842018-09-19 Marek Polacek <polacek@redhat.com> 1485 1486 Add -Wclass-conversion. 1487 * decl.c (grok_op_properties): Change a warning from -Wconversion to 1488 -Wclass-conversion. Make it print the types. 1489 14902018-09-19 Paolo Carlini <paolo.carlini@oracle.com> 1491 1492 PR c++/87324 1493 * parser.c (cp_parser_initializer_list): Assign error_mark_node 1494 to the index upon error. 1495 14962018-09-19 Marek Polacek <polacek@redhat.com> 1497 1498 PR c++/87357 - missing -Wconversion warning 1499 * decl.c (grok_op_properties): Remove diagnostic parts mentioning 1500 a conversion to a reference to void. Use 1501 same_type_ignoring_top_level_qualifiers_p rather than comparing types 1502 directly. 1503 15042018-09-18 Marek Polacek <polacek@redhat.com> 1505 1506 P1064R0 - Allowing Virtual Function Calls in Constant Expressions 1507 * call.c (build_over_call): No longer check if we're outside a template 1508 function. 1509 * class.c (build_vtbl_initializer): Build vtable's constructor with 1510 indexes. 1511 * constexpr.c (cxx_eval_constant_expression): Don't ignore _vptr's 1512 initializer. Handle OBJ_TYPE_REF. 1513 (potential_constant_expression_1): Handle OBJ_TYPE_REF. 1514 * decl.c (maybe_commonize_var): Bail out for any DECL_ARTIFICIAL. 1515 (initialize_artificial_var): Mark the variable as constexpr. 1516 (grokdeclarator): Change error to pedwarn. Only warn when 1517 pedantic and not C++2a. 1518 15192018-09-18 Paolo Carlini <paolo.carlini@oracle.com> 1520 1521 PR c++/85065 1522 * cp-tree.h (NON_ERROR): New. 1523 * pt.c (auto_hash::hash): Use it. 1524 (do_auto_deduction): Likewise. 1525 15262018-09-18 Nathan Sidwell <nathan@acm.org> 1527 1528 PR c++/86881 1529 * name-lookup.c (check_local_shadow): Ignore auto types. 1530 15312018-09-17 David Malcolm <dmalcolm@redhat.com> 1532 1533 * error.c (range_label_for_type_mismatch::get_text): Update for 1534 new param. 1535 15362018-09-13 Bernd Edlinger <bernd.edlinger@hotmail.de> 1537 1538 * typeck2.c (digest_init_r): Fix overlength strings. 1539 15402018-09-13 Ville Voutilainen <ville.voutilainen@gmail.com> 1541 1542 PR c++/87093 1543 * method.c (constructible_expr): We're in an unevaluated context 1544 in all cases, not just for class targets. 1545 15462018-09-12 David Malcolm <dmalcolm@redhat.com> 1547 1548 PR c++/85110 1549 * call.c (struct conversion_info): Add "loc" field. 1550 (arg_conversion_rejection): Add "loc" param, using it to 1551 initialize the new field. 1552 (bad_arg_conversion_rejection): Likewise. 1553 (explicit_conversion_rejection): Initialize the new field to 1554 UNKNOWN_LOCATION. 1555 (template_conversion_rejection): Likewise. 1556 (add_function_candidate): Pass on the argument location to the new 1557 param of arg_conversion_rejection. 1558 (add_conv_candidate): Likewise. 1559 (build_builtin_candidate): Likewise. 1560 (build_user_type_conversion_1): Likewise. 1561 (single_z_candidate): New function. 1562 (maybe_get_bad_conversion_for_unmatched_call): New function. 1563 (complain_about_bad_argument): New function, based on part of 1564 convert_for_assignment. 1565 (build_new_method_call_1): Split out handling of the "no viable 1566 candidates" case into... 1567 (complain_about_no_candidates_for_method_call): ...this new 1568 function, and use the new functions above to special-case the 1569 handling of a single non-viable candidate due to a bad argument. 1570 * cp-tree.h (complain_about_bad_argument): New decl. 1571 * typeck.c (convert_for_assignment): Split out one error-handling 1572 case into complain_about_bad_argument. 1573 15742018-09-09 Cesar Philippidis <cesar@codesourcery.com> 1575 Julian Brown <julian@codesourcery.com> 1576 1577 PR middle-end/86336 1578 * semantics.c (finish_omp_clauses): Treat C++ references the same in 1579 OpenACC as OpenMP. 1580 15812018-08-28 Martin Liska <mliska@suse.cz> 1582 1583 * constexpr.c (cxx_eval_call_expression): Add quotes 1584 to -fconstexpr-depth=. 1585 15862018-09-10 Marek Polacek <polacek@redhat.com> 1587 1588 * class.c (build_vtbl_ref): Remove. 1589 (build_vtbl_ref_1): Rename to build_vtbl_ref. 1590 (build_vfn_ref): Call build_vtbl_ref instead of build_vtbl_ref_1. 1591 15922018-09-08 Marek Polacek <polacek@redhat.com> 1593 1594 PR c++/87150 - wrong ctor with maybe-rvalue semantics. 1595 * call.c (struct conversion): Update commentary. 1596 (standard_conversion): Set rvaluedness_matches_p if LOOKUP_PREFER_RVALUE 1597 for ck_base. 1598 15992018-09-08 Jason Merrill <jason@redhat.com> 1600 1601 PR c++/86678 - constexpr function with non-constant after return. 1602 * constexpr.c (potential_constant_expression_1): Add jump_target. 1603 (breaks): Check for BREAK_STMT. 1604 (continues): Check for CONTINUE_STMT. 1605 16062018-09-08 Marek Polacek <polacek@redhat.com> 1607 1608 * cxx-pretty-print.c (cxx_pretty_printer::statement) <case 1609 RANGE_FOR_SMT>: Handle RANGE_FOR_INIT_STMT. 1610 16112018-09-07 Marek Polacek <polacek@redhat.com> 1612 1613 PR c++/87152 - range-based for loops with initializer broken in templates. 1614 * constexpr.c (potential_constant_expression_1) <case RANGE_FOR_STMT>: 1615 Recur into RANGE_FOR_INIT_STMT. 1616 * cp-tree.def: Add RANGE_FOR_INIT_STMT to RANGE_FOR_STMT. 1617 * cp-tree.h (RANGE_FOR_INIT_STMT): Define. 1618 * dump.c (cp_dump_tree) <case RANGE_FOR_STMT>: Also dump 1619 RANGE_FOR_INIT_STMT. 1620 * pt.c (tsubst_expr) <case RANGE_FOR_STMT>: Recur into 1621 RANGE_FOR_INIT_STMT. 1622 * semantics.c (begin_range_for_stmt): Adjust call to build_stmt. 1623 Do put the init statement in RANGE_FOR_INIT_STMT. 1624 (finish_range_for_decl): Pop it for templates. 1625 16262018-09-06 Bernd Edlinger <bernd.edlinger@hotmail.de> 1627 1628 * decl.c (check_initializer): Call cp_complete_array_type. 1629 16302018-09-05 Marek Polacek <polacek@redhat.com> 1631 1632 PR c++/87109, wrong overload with ref-qualifiers. 1633 * call.c (build_user_type_conversion_1): Use NULL instead of 0. Bail 1634 out if performing the maybe-rvalue overload resolution and a conversion 1635 function is getting called. 1636 1637 PR c++/86982, -Wreturn-local-addr and std::move and std::forward. 1638 * typeck.c (maybe_warn_about_returning_address_of_local): Handle calls 1639 to std::move or std::forward. 1640 (is_std_forward_p): New function. 1641 16422018-09-05 Pádraig Brady <p@draigbrady.com> 1643 1644 PR c++/87185 1645 * lambda.c (prune_lambda_captures): Protect against const_vars.get 1646 returning NULL. 1647 16482018-09-04 Marek Polacek <polacek@redhat.com> 1649 1650 * cp-tree.h (treat_lvalue_as_rvalue_p): Declare. 1651 * except.c (build_throw): Use it. Use CP_TYPE_VOLATILE_P. 1652 * typeck.c (treat_lvalue_as_rvalue_p): No longer static. Add PARM_OK 1653 parameter. 1654 (maybe_warn_pessimizing_move): Adjust treat_lvalue_as_rvalue_p call. 1655 (check_return_expr): Likewise. 1656 16572018-09-03 Paolo Carlini <paolo.carlini@oracle.com> 1658 1659 PR c++/84980 1660 * constraint.cc (finish_shorthand_constraint): Early return if the 1661 constraint is erroneous. 1662 16632018-09-02 Bernd Edlinger <bernd.edlinger@hotmail.de> 1664 1665 * decl.c (eval_check_narrowing): Remove. 1666 (check_initializer): Move call to braced_list_to_string from here ... 1667 * typeck2.c (store_init_value): ... to here. 1668 (digest_init_r): Remove handing of signed/unsigned char strings. 1669 16702018-08-31 Nathan Sidwell <nathan@acm.org> 1671 1672 PR c++/87155 1673 PR c++/84707 1674 * name-lookup.c (name_lookup::search_namespace): Don't look at 1675 inlines when searching for NULL names. 1676 1677 * decl.c (decls_match): Remove SYSTEM_IMPLICIT_EXTERN_C matching 1678 of return types and parms. 1679 * parser.c (cp_parser_parameter_declaration_clause): Likewise, 1680 '()' always means '(void)'. 1681 16822018-08-29 Jakub Jelinek <jakub@redhat.com> 1683 1684 PR c++/87095 1685 * decl.c (begin_destructor_body): If current_class_type has 1686 virtual bases and the primary base is nearly empty virtual base, 1687 voidify clearing of vptr and make it conditional on in-charge 1688 argument. 1689 16902018-08-29 Paolo Carlini <paolo.carlini@oracle.com> 1691 1692 PR c++/85265 1693 * parser.c (cp_parser_introduction_list): If cp_parser_identifier 1694 returns error_mark_node early exit the loop. 1695 (cp_parser_template_introduction): Improve error-recovery, remove 1696 error call about empty introduction-list. 1697 16982018-08-29 David Malcolm <dmalcolm@redhat.com> 1699 1700 PR c++/85110 1701 * call.c (print_conversion_rejection): Add "fn" param and use it 1702 for "no known conversion" messages to underline the pertinent 1703 param. 1704 (print_z_candidate): Supply "fn" to the new param above. 1705 17062018-08-29 Jakub Jelinek <jakub@redhat.com> 1707 1708 PR c++/87122 1709 * pt.c (tsubst_expr) <case RANGE_FOR_STMT>: If 1710 processing_template_decl and decl is structured binding decl, call 1711 cp_finish_decomp. 1712 17132018-08-28 Paolo Carlini <paolo.carlini@oracle.com> 1714 1715 PR c++/86546 1716 * decl.c (finish_case_label): If the type is erroneous early 1717 return error_mark_node. 1718 17192018-08-27 David Malcolm <dmalcolm@redhat.com> 1720 1721 PR c++/63392 1722 * parser.c (cp_parser_diagnose_invalid_type_name): Add fix-it 1723 hint. 1724 17252018-08-27 Jakub Jelinek <jakub@redhat.com> 1726 1727 PR c++/86993 1728 * cp-tree.h (cxx_readonly_error): Add location_t argument. 1729 * typeck2.c (cxx_readonly_error): Add LOC argument, pass it to 1730 ERROR_FOR_ASSIGNMENT macro and readonly_error. Add LOC argument 1731 to ERROR_FOR_ASSIGNMENT macro, use error_at instead of error and 1732 pass LOC to it. Formatting fixes. 1733 * typeck.c (cp_build_unary_op): Pass location to cxx_readonly_error. 1734 (cp_build_modify_expr): Pass loc to cxx_readonly_error. 1735 * semantics.c (finish_asm_stmt): Pass input_location to 1736 cxx_readonly_error. 1737 17382018-08-27 David Malcolm <dmalcolm@redhat.com> 1739 1740 PR c++/87091 1741 * decl.c (grokdeclarator): Update for conversion of show_caret_p 1742 to a tri-state. 1743 * error.c (cp_printer): Likewise. 1744 * name-lookup.c (maybe_suggest_missing_std_header): Update call to 1745 maybe_add_include_fixit to suggest overriding the location, as it 1746 is for a note. 1747 * parser.c (cp_parser_string_literal): Update for conversion of 1748 show_caret_p to a tri-state. 1749 (cp_parser_elaborated_type_specifier): Likewise. 1750 (set_and_check_decl_spec_loc): Likewise. 1751 * pt.c (listify): Update call to maybe_add_include_fixit to not 1752 override the location, as it is for an error. 1753 * rtti.c (typeid_ok_p): Likewise. 1754 17552018-08-27 Martin Liska <mliska@suse.cz> 1756 1757 * call.c (build_call_a): Use new function 1758 fndecl_built_in_p and remove check for FUNCTION_DECL if 1759 possible. 1760 (build_cxx_call): Likewise. 1761 * constexpr.c (constexpr_fn_retval): Likewise. 1762 (cxx_eval_builtin_function_call): Likewise. 1763 (cxx_eval_call_expression): Likewise. 1764 (potential_constant_expression_1): Likewise. 1765 * cp-gimplify.c (cp_gimplify_expr): Likewise. 1766 (cp_fold): Likewise. 1767 * decl.c (decls_match): Likewise. 1768 (validate_constexpr_redeclaration): Likewise. 1769 (duplicate_decls): Likewise. 1770 (make_rtl_for_nonlocal_decl): Likewise. 1771 * name-lookup.c (consider_binding_level): Likewise. 1772 (cp_emit_debug_info_for_using): Likewise. 1773 * semantics.c (finish_call_expr): Likewise. 1774 * tree.c (builtin_valid_in_constant_expr_p): Likewise. 1775 17762018-08-26 Marek Polacek <polacek@redhat.com> 1777 1778 PR c++/87080 1779 * typeck.c (maybe_warn_pessimizing_move): Do nothing in a template. 1780 1781 PR c++/87029, Implement -Wredundant-move. 1782 * typeck.c (treat_lvalue_as_rvalue_p): New function. 1783 (maybe_warn_pessimizing_move): Call convert_from_reference. 1784 Warn about redundant moves. 1785 17862018-08-24 Marek Polacek <polacek@redhat.com> 1787 1788 PR c++/67012 1789 PR c++/86942 1790 * decl.c (grokdeclarator): Disallow functions with trailing return 1791 type with decltype(auto) as its type. Also check the function if 1792 it's inner declarator doesn't exist 1793 17942018-08-21 Marek Polacek <polacek@redhat.com> 1795 1796 PR c++/86499 1797 * parser.c (cp_parser_lambda_introducer): Give error if a non-local 1798 lambda has a capture-default. 1799 18002018-08-21 Paolo Carlini <paolo.carlini@oracle.com> 1801 1802 * decl.c (check_static_variable_definition): Change to return void. 1803 18042018-08-21 Marek Polacek <polacek@redhat.com> 1805 1806 PR c++/86981, Implement -Wpessimizing-move. 1807 * typeck.c (decl_in_std_namespace_p): New. 1808 (is_std_move_p): New. 1809 (maybe_warn_pessimizing_move): New. 1810 (can_do_nrvo_p): New, factored out of ... 1811 (check_return_expr): ... here. Warn about potentially harmful 1812 std::move in a return statement. 1813 1814 PR c++/65043 1815 * call.c (standard_conversion): Set check_narrowing. 1816 * typeck2.c (check_narrowing): Use CP_INTEGRAL_TYPE_P rather 1817 than comparing with INTEGER_TYPE. 1818 1819 * cp-tree.h: Fix typo. 1820 18212018-08-20 David Malcolm <dmalcolm@redhat.com> 1822 1823 PR other/84889 1824 * call.c (build_user_type_conversion_1): Add auto_diagnostic_group 1825 instance(s). 1826 (print_error_for_call_failure): Likewise. 1827 (build_op_call_1): Likewise. 1828 (build_conditional_expr_1): Likewise. 1829 (build_new_op_1): Likewise. 1830 (build_op_delete_call): Likewise. 1831 (convert_like_real): Likewise. 1832 (build_over_call): Likewise. 1833 (build_new_method_call_1): Likewise. 1834 (joust): Likewise. 1835 * class.c (check_tag): Likewise. 1836 (finish_struct_anon_r): Likewise. 1837 (one_inherited_ctor): Likewise. 1838 (finalize_literal_type_property): Likewise. 1839 (explain_non_literal_class): Likewise. 1840 (find_flexarrays): Likewise. 1841 (resolve_address_of_overloaded_function): Likewise. 1842 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise. 1843 (is_valid_constexpr_fn): Likewise. 1844 (cx_check_missing_mem_inits): Likewise. 1845 * cp-gimplify.c (cp_genericize_r): Likewise. 1846 * cvt.c (maybe_warn_nodiscard): Likewise. 1847 * decl.c (warn_extern_redeclared_static): Likewise. 1848 (check_redeclaration_exception_specification): Likewise. 1849 (check_no_redeclaration_friend_default_args): Likewise. 1850 (duplicate_decls): Likewise. 1851 (redeclaration_error_message): Likewise. 1852 (warn_misplaced_attr_for_class_type): Likewise. 1853 * decl2.c (finish_static_data_member_decl): Likewise. 1854 (no_linkage_error): Likewise. 1855 (cp_warn_deprecated_use): Likewise. 1856 * error.c (qualified_name_lookup_error): Likewise. 1857 * friend.c (make_friend_class): Likewise. 1858 (do_friend): Likewise. 1859 * init.c (perform_member_init): Likewise. 1860 (build_new_1): Likewise. 1861 (build_vec_delete_1): Likewise. 1862 (build_delete): Likewise. 1863 * lex.c (unqualified_name_lookup_error): Likewise. 1864 * name-lookup.c (check_extern_c_conflict): Likewise. 1865 (inform_shadowed): New function. 1866 (check_local_shadow): Add auto_diagnostic_group instances, 1867 replacing goto "inform_shadowed" label with call to subroutine. 1868 (set_local_extern_decl_linkage): Add auto_diagnostic_group 1869 instance(s). 1870 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise. 1871 (cp_parser_namespace_name): Likewise. 1872 * pt.c (check_specialization_namespace): Likewise. 1873 (check_template_variable): Likewise. 1874 (warn_spec_missing_attributes): Likewise. 1875 (check_explicit_specialization): Likewise. 1876 (process_partial_specialization): Likewise. 1877 (lookup_template_class_1): Likewise. 1878 (finish_template_variable): Likewise. 1879 (do_auto_deduction): Likewise. 1880 * search.c (check_final_overrider): Likewise. 1881 (look_for_overrides_r): Likewise. 1882 * tree.c (maybe_warn_parm_abi): Likewise. 1883 * typeck.c (cxx_sizeof_expr): Likewise. 1884 (cp_build_function_call_vec): Likewise. 1885 (cp_build_binary_op): Likewise. 1886 (convert_for_assignment): Likewise. 1887 (maybe_warn_about_returning_address_of_local): Likewise. 1888 * typeck2.c (abstract_virtuals_error_sfinae): Likewise. 1889 (check_narrowing): Likewise. 1890 18912018-08-17 David Malcolm <dmalcolm@redhat.com> 1892 1893 * typeck.c (string_conv_p): Extract location from EXP and use it 1894 in preference to input_location when issuing warnings. 1895 18962018-08-15 David Malcolm <dmalcolm@redhat.com> 1897 1898 * call.c: Include "gcc-rich-location.h". 1899 (convert_like_real): Add range label for "invalid conversion" 1900 diagnostic. 1901 (perform_implicit_conversion_flags): Add type label to the 1902 "could not convert" error. 1903 * error.c: Include "gcc-rich-location.h". 1904 (range_label_for_type_mismatch::get_text): New function. 1905 * typeck.c (convert_for_assignment): Add type label to 1906 the "cannot convert" error if a location is available. 1907 19082018-08-15 Paolo Carlini <paolo.carlini@oracle.com> 1909 1910 * decl.c (check_previous_goto_1): When decl_jump_unsafe returns 2 1911 emit an error instead of a permerror. 1912 19132018-08-13 Marek Polacek <polacek@redhat.com> 1914 1915 PR c++/57891 1916 * call.c (struct conversion): Add check_narrowing_const_only. 1917 (build_converted_constant_expr): Set check_narrowing and 1918 check_narrowing_const_only. Give error if expr is error node. 1919 (convert_like_real): Pass it to check_narrowing. 1920 * cp-tree.h (check_narrowing): Add a default parameter. 1921 * decl.c (compute_array_index_type): Use input_location instead of 1922 location_of. 1923 * pt.c (convert_nontype_argument): Return NULL_TREE if tf_error. 1924 * typeck2.c (check_narrowing): Don't warn for instantiation-dependent 1925 expressions. Call maybe_constant_value instead of 1926 fold_non_dependent_expr. Don't mention { } in diagnostic. Only check 1927 narrowing for constants if CONST_ONLY. 1928 19292018-08-13 Martin Sebor <msebor@redhat.com> 1930 1931 PR tree-optimization/71625 1932 * decl.c (check_initializer): Call braced_list_to_string. 1933 (eval_check_narrowing): New function. 1934 * gcc/cp/typeck2.c (digest_init_r): Accept strings literals 1935 as initilizers for all narrow character types. 1936 19372018-08-13 Marek Polacek <polacek@redhat.com> 1938 1939 P0806R2 - Deprecate implicit capture of this via [=] 1940 * lambda.c (add_default_capture): Formatting fixes. Warn about 1941 deprecated implicit capture of this via [=]. 1942 1943 PR c++/86915 1944 * decl.c (create_array_type_for_decl): Handle null name. 1945 19462018-08-10 Jason Merrill <jason@redhat.com> 1947 1948 PR c++/86728 - C variadic generic lambda. 1949 * parser.c (cp_parser_parameter_declaration): Don't turn 'auto' into 1950 a pack if it's followed by a declarator-id. 1951 19522018-08-08 Jakub Jelinek <jakub@redhat.com> 1953 1954 P0595R1 - is_constant_evaluated 1955 * cp-tree.h (enum cp_built_in_function): New. 1956 (maybe_constant_init): Add pretend_const_required argument. 1957 * typeck2.c (store_init_value): Pass true as new argument to 1958 maybe_constant_init. 1959 * constexpr.c (constexpr_fn_retval): Check also DECL_BUILT_IN_CLASS 1960 for BUILT_IN_UNREACHABLE. 1961 (struct constexpr_ctx): Add pretend_const_required field. 1962 (cxx_eval_builtin_function_call): Use DECL_IS_BUILTIN_CONSTANT_P 1963 macro. Handle CP_BUILT_IN_IS_CONSTANT_EVALUATED. Check also 1964 DECL_BUILT_IN_CLASS for BUILT_IN_UNREACHABLE. 1965 (cxx_eval_outermost_constant_expr): Add pretend_const_required 1966 argument, initialize pretend_const_required field in ctx. If the 1967 result is TREE_CONSTANT and non_constant_p, retry with 1968 pretend_const_required false if it was true. 1969 (is_sub_constant_expr): Initialize pretend_const_required_field in 1970 ctx. 1971 (cxx_constant_value): Pass true as pretend_const_required to 1972 cxx_eval_outermost_constant_expr. 1973 (maybe_constant_value): Pass false as pretend_const_required to 1974 cxx_eval_outermost_constant_expr. 1975 (fold_non_dependent_expr): Likewise. 1976 (maybe_constant_init_1): Add pretend_const_required argument, pass it 1977 down to cxx_eval_outermost_constant_expr. Pass !allow_non_constant 1978 instead of false as strict to cxx_eval_outermost_constant_expr. 1979 (maybe_constant_init): Add pretend_const_required argument, pass it 1980 down to maybe_constant_init_1. 1981 (cxx_constant_init): Pass true as pretend_const_required to 1982 maybe_constant_init_1. 1983 * cp-gimplify.c (cp_gimplify_expr): Handle CALL_EXPRs to 1984 CP_BUILT_IN_IS_CONSTANT_EVALUATED. 1985 (cp_fold): Don't fold CP_BUILT_IN_IS_CONSTANT_EVALUATED calls. 1986 * decl.c: Include langhooks.h. 1987 (cxx_init_decl_processing): Register __builtin_is_constant_evaluated 1988 built-in. 1989 * tree.c (builtin_valid_in_constant_expr_p): Return true for 1990 CP_BUILT_IN_IS_CONSTANT_EVALUATED. 1991 * pt.c (declare_integer_pack): Initialize DECL_FUNCTION_CODE. 1992 1993 PR c++/86836 1994 * pt.c (tsubst_expr): For structured bindings, call tsubst_decomp_names 1995 before tsubst_init, not after it. 1996 1997 PR c++/86738 1998 * constexpr.c (cxx_eval_binary_expression): For arithmetics involving 1999 NULL pointer set *non_constant_p to true. 2000 (cxx_eval_component_reference): For dereferencing of a NULL pointer, 2001 set *non_constant_p to true and return t. 2002 20032018-08-07 Paolo Carlini <paolo.carlini@oracle.com> 2004 2005 PR c++/59480, DR 136 2006 * decl.c (check_no_redeclaration_friend_default_args): New. 2007 (duplicate_decls): Use the latter; also check that a friend 2008 declaration specifying default arguments is a definition. 2009 20102018-08-07 Ville Voutilainen <ville.voutilainen@gmail.com> 2011 2012 PR c++/79133 2013 * name-lookup.c (check_local_shadow): Reject captures and parameters 2014 with the same name. 2015 20162018-08-06 Marek Polacek <polacek@redhat.com> 2017 2018 PR c++/86767 2019 * constexpr.c (cxx_eval_statement_list): Handle continue. 2020 20212018-08-03 David Malcolm <dmalcolm@redhat.com> 2022 Jonathan Wakely <jwakely@redhat.com> 2023 2024 * decl.c: Include "gcc-rich-location.h". 2025 (add_return_star_this_fixit): New function. 2026 (finish_function): When warning about missing return statements in 2027 functions returning non-void, add a "return *this;" fix-it hint for 2028 assignment operators. 2029 20302018-08-03 Jason Merrill <jason@redhat.com> 2031 2032 PR c++/86706 2033 * class.c (build_base_path): Use currently_open_class. 2034 20352018-08-02 David Malcolm <dmalcolm@redhat.com> 2036 2037 * error.c (cxx_print_error_function): Duplicate "file" before 2038 passing it to pp_set_prefix. 2039 (cp_print_error_function): Use pp_take_prefix when saving the 2040 existing prefix. 2041 20422018-08-02 Richard Biener <rguenther@suse.de> 2043 2044 PR c++/86763 2045 * class.c (layout_class_type): Copy TYPE_TYPELESS_STORAGE 2046 to the CLASSTYPE_AS_BASE. 2047 20482018-08-01 Martin Sebor <msebor@redhat.com> 2049 2050 PR tree-optimization/86650 2051 * error.c (cp_printer): Move usage of EXPR_LOCATION (t) and 2052 TREE_BLOCK (t) from within percent_K_format to this callsite. 2053 20542018-08-01 Paolo Carlini <paolo.carlini@oracle.com> 2055 2056 PR c++/86661 2057 * class.c (note_name_declared_in_class): Use location_of in permerror 2058 instead of DECL_SOURCE_LOCATION (for OVERLOADs). 2059 20602018-07-31 Tom de Vries <tdevries@suse.de> 2061 2062 PR debug/86687 2063 * optimize.c (update_cloned_parm): Copy DECL_BY_REFERENCE. 2064 20652018-07-31 Jakub Jelinek <jakub@redhat.com> 2066 2067 P1008R1 - prohibit aggregates with user-declared constructors 2068 * class.c (check_bases_and_members): For C++2a set 2069 CLASSTYPE_NON_AGGREGATE based on TYPE_HAS_USER_CONSTRUCTOR rather than 2070 type_has_user_provided_or_explicit_constructor. 2071 20722018-07-31 Martin Liska <mliska@suse.cz> 2073 2074 PR c++/86653 2075 * parser.c (cp_parser_condition): Initialize non_constant_p 2076 to false. 2077 20782018-07-28 David Malcolm <dmalcolm@redhat.com> 2079 2080 * error.c (cp_printer): In the leading comment, move "%H" and "%I" 2081 into alphabetical order, and add missing "%G" and "%K". Within 2082 the switch statement, move cases 'G', 'H', 'I' and 'K' so that the 2083 cases are in alphabetical order. 2084 20852018-07-25 Jakub Jelinek <jakub@redhat.com> 2086 2087 * cp-tree.h (enum cp_tree_index): Add 2088 CPTI_{ABI_TAG,ALIGNED,BEGIN,END,GET,TUPLE_{ELEMENT,SIZE}}_IDENTIFIER 2089 and CPTI_{GNU,TYPE,VALUE,FUN,CLOSURE}_IDENTIFIER. 2090 (abi_tag_identifier, aligned_identifier, begin_identifier, 2091 end_identifier, get__identifier, gnu_identifier, 2092 tuple_element_identifier, tuple_size_identifier, type_identifier, 2093 value_identifier, fun_identifier, closure_identifier): Define. 2094 * decl.c (initialize_predefined_identifiers): Initialize the above 2095 identifiers. 2096 (get_tuple_size): Use tuple_size_identifier instead of 2097 get_identifier ("tuple_size") and value_identifier instead of 2098 get_identifier ("value"). 2099 (get_tuple_element_type): Use tuple_element_identifier instead of 2100 get_identifier ("tuple_element") and type_identifier instead of 2101 get_identifier ("type"). 2102 (get_tuple_decomp_init): Use get__identifier instead of 2103 get_identifier ("get"). 2104 * lambda.c (maybe_add_lambda_conv_op): Use fun_identifier instead of 2105 get_identifier ("_FUN"). 2106 * parser.c (cp_parser_lambda_declarator_opt): Use closure_identifier 2107 instead of get_identifier ("__closure"). 2108 (cp_parser_std_attribute): Use gnu_identifier instead of 2109 get_identifier ("gnu"). 2110 (cp_parser_std_attribute_spec): Likewise. Use aligned_identifier 2111 instead of get_identifier ("aligned"). 2112 * class.c (check_abi_tags, inherit_targ_abi_tags): Use 2113 abi_tag_identifier instead of get_identifier ("abi_tag"). 2114 2115 PR c++/85515 2116 * cp-tree.h (enum cp_tree_index): Add 2117 CPTI_FOR_{RANGE,BEGIN,END}{,_}_IDENTIFIER. 2118 (for_range__identifier, for_begin__identifier, for_end__identifier, 2119 for_range_identifier, for_begin_identifier, for_end_identifier): 2120 Define. 2121 * decl.c (initialize_predefined_identifiers): Initialize 2122 for_{range,begin,end}{,_}_identifier. 2123 * parser.c (build_range_temp): Use for_range__identifier instead of 2124 get_identifier ("__for_range"). 2125 (cp_convert_range_for): Use for_begin__identifier and 2126 for_end__identifier instead of get_identifier ("__for_begin") and 2127 get_identifier ("__for_end"). 2128 * semantics.c (finish_for_stmt): Rename "__for_{range,begin,end} " 2129 local symbols to "__for_{range,begin,end}". 2130 21312018-07-23 Jakub Jelinek <jakub@redhat.com> 2132 2133 PR c++/86569 2134 * cp-gimplify.c (cp_fold): Don't fold comparisons into other kind 2135 of expressions other than INTEGER_CST regardless of TREE_NO_WARNING 2136 or warn_nonnull_compare. 2137 21382018-07-19 Paolo Carlini <paolo.carlini@oracle.com> 2139 2140 Revert fix for c++/59480 (and testsuite followup) 2141 2142 2019-07-18 Paolo Carlini <paolo.carlini@oracle.com> 2143 2144 PR c++/59480, DR 136 2145 * decl.c (check_no_redeclaration_friend_default_args): New. 2146 (duplicate_decls): Use the latter; also check that a friend 2147 declaration specifying default arguments is a definition. 2148 21492018-07-18 Jakub Jelinek <jakub@redhat.com> 2150 2151 PR c++/86550 2152 * parser.c (cp_parser_decl_specifier_seq): Diagnose invalid type 2153 specifier if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR. 2154 21552018-07-18 Marek Polacek <polacek@redhat.com> 2156 2157 PR c++/86190 - bogus -Wsign-conversion warning 2158 * typeck.c (cp_build_binary_op): Fix formatting. Add a warning 2159 sentinel. 2160 21612018-07-18 Paolo Carlini <paolo.carlini@oracle.com> 2162 2163 PR c++/59480, DR 136 2164 * decl.c (check_no_redeclaration_friend_default_args): New. 2165 (duplicate_decls): Use the latter; also check that a friend 2166 declaration specifying default arguments is a definition. 2167 21682018-07-18 Paolo Carlini <paolo.carlini@oracle.com> 2169 2170 * class.c (note_name_declared_in_class): Prefer permerror + inform 2171 to a pair of permerrors; use DECL_SOURCE_LOCATION. 2172 21732018-07-18 Richard Biener <rguenther@suse.de> 2174 2175 PR debug/86523 2176 * decl2.c (c_parse_final_cleanups): Call write_out_vars before 2177 start_static_storage_duration_function sets current_function_decl. 2178 21792018-07-17 Jason Merrill <jason@redhat.com> 2180 2181 PR c++/86480 - nested variadic lambda and constexpr if. 2182 * pt.c (find_parameter_packs_r) [IF_STMT]: Don't walk into 2183 IF_STMT_EXTRA_ARGS. 2184 * tree.c (cp_walk_subtrees) [DECLTYPE_TYPE]: Set 2185 cp_unevaluated_operand. 2186 [ALIGNOF_EXPR] [SIZEOF_EXPR] [NOEXCEPT_EXPR]: Likewise. 2187 21882018-07-16 Paolo Carlini <paolo.carlini@oracle.com> 2189 2190 * class.c (resolve_address_of_overloaded_function): Don't emit an 2191 inform if the matching permerror returns false. 2192 * pt.c (check_specialization_namespace): Likewise. 2193 21942018-07-16 Jakub Jelinek <jakub@redhat.com> 2195 2196 PR c++/3698 2197 PR c++/86208 2198 * cp-gimplify.c (cp_genericize_r): When using extern_decl_map, or 2199 in TREE_USED flag from stmt to h->to. 2200 22012018-07-13 Nathan Sidwell <nathan@acm.org> 2202 2203 PR c++/86374 2204 * pt.c (lookup_template_class_1): Use tsubst_aggr_type for 2205 contexts that are classes. 2206 * parser.c (cp_parser_template_id): Combine entering_scope decl & 2207 initializer. 2208 22092018-07-12 Jakub Jelinek <jakub@redhat.com> 2210 2211 * decl2.c (cplus_decl_attributes): Don't diagnose vars without mappable 2212 type here, instead add "omp declare target implicit" attribute. Add 2213 that attribute instead of "omp declare target" also when 2214 processing_template_decl. 2215 * decl.c (cp_finish_decl): Diagnose vars without mappable type here, 2216 and before calling cp_omp_mappable_type call complete_type. 2217 22182018-07-10 Jakub Jelinek <jakub@redhat.com> 2219 2220 PR sanitizer/86406 2221 * cp-gimplify.c (cp_maybe_instrument_return): Skip trailing 2222 DEBUG_BEGIN_STMTs. 2223 2224 PR c++/86443 2225 * semantics.c (handle_omp_for_class_iterator): Remove lastp argument, 2226 instead of setting *lastp turn orig_declv elt into a TREE_LIST. 2227 (finish_omp_for): Adjust handle_omp_for_class_iterator caller. 2228 * pt.c (tsubst_omp_for_iterator): Allow OMP_FOR_ORIG_DECLS to contain 2229 TREE_LIST for both the original class iterator and the "last" helper 2230 var. 2231 22322018-07-09 Paolo Carlini <paolo.carlini@oracle.com> 2233 2234 * decl.c (grokdeclarator): Use rich_location::add_range in three 2235 more places; include gcc-rich-location.h. 2236 22372018-07-07 Aldy Hernandez <aldyh@redhat.com> 2238 2239 * decl.c (build_enumerator): Change overflow type to overflow_type. 2240 * init.c (build_new_1): Same. 2241 22422018-07-05 Nathan Sidwell <nathan@acm.org> 2243 2244 * cp/decl.c (decls_match): Check SYSTEM_IMPLICIT_EXTERN_C not 2245 NO_IMPLICIT_EXTERN_C. 2246 * cp/parser.c (cp_parser_parameter_declaration_clause): Likewise. 2247 22482018-07-04 Ville Voutilainen <ville.voutilainen@gmail.com> 2249 2250 PR c++/86398 2251 * method.c (is_trivially_xible): Return false 2252 if is_xible_helper returns a NULL_TREE. 2253 22542018-07-03 Paolo Carlini <paolo.carlini@oracle.com> 2255 2256 * decl.c (min_location): New. 2257 (smallest_type_quals_location): Use the latter. 2258 (check_concept_fn): Use DECL_SOURCE_LOCATION. 2259 (grokdeclarator): Use accurate locations in a number of error 2260 messages involving ds_thread, ds_storage_class, ds_virtual, 2261 ds_constexpr, ds_typedef and ds_friend; exploit min_location. 2262 22632018-07-03 Marek Polacek <polacek@redhat.com> 2264 2265 PR c++/86201 2266 * typeck.c (cp_build_binary_op): Check c_inhibit_evaluation_warnings. 2267 22682018-07-03 Jason Merrill <jason@redhat.com> 2269 2270 PR c++/86378 - functional cast in noexcept-specifier. 2271 * tree.c (strip_typedefs_expr) [TREE_LIST]: Fix iteration. 2272 22732018-07-02 Paolo Carlini <paolo.carlini@oracle.com> 2274 2275 * parser.c (set_and_check_decl_spec_loc): Use rich_location::add_range 2276 in error message about __thread and thread_local at the same time. 2277 22782018-06-29 Marek Polacek <polacek@redhat.com> 2279 2280 PR c++/86184 2281 * tree.c (cp_save_expr): Don't call save_expr for TARGET_EXPRs. 2282 22832018-06-28 David Malcolm <dmalcolm@redhat.com> 2284 2285 * parser.c (cp_parser_error_1): After issuing a conflict marker 2286 error, consume tokens until the end of the source line. 2287 22882018-06-28 Jason Merrill <jason@redhat.com> 2289 2290 PR c++/86342 - -Wdeprecated-copy and system headers. 2291 * decl2.c (cp_warn_deprecated_use): Don't warn about declarations 2292 in system headers. 2293 22942018-06-27 David Malcolm <dmalcolm@redhat.com> 2295 2296 PR c++/86329 2297 * name-lookup.c (consider_binding_level): Filter out names that 2298 match anon_aggrname_p. 2299 23002018-06-27 Jason Merrill <jason@redhat.com> 2301 2302 * name-lookup.c (do_pushtag): If we skip a class level, also skip 2303 its template level. 2304 23052018-06-26 Jason Merrill <jason@redhat.com> 2306 2307 PR c++/86320 - memory-hog with std::array of pair 2308 * typeck2.c (process_init_constructor_array): Only compute a 2309 constant initializer once. 2310 2311 PR c++/80290 - memory-hog with std::pair. 2312 * pt.c (fn_type_unification): Add convs parameter. 2313 (check_non_deducible_conversion): Remember conversion. 2314 (check_non_deducible_conversions): New. Do checks here. 2315 (type_unification_real): Not here. Remove flags parm. 2316 * call.c (add_function_candidate): Make convs a parameter. 2317 Don't recalculate the conversion if it's already set. 2318 (add_template_candidate_real): Allocate convs here. 2319 (good_conversion, conv_flags): New. 2320 23212018-06-26 Jakub Jelinek <jakub@redhat.com> 2322 2323 PR c++/86291 2324 * parser.c (cp_parser_omp_for_loop_init): Change for_block argument 2325 type from vec<tree, va_gc> * to vec<tree, va_gc> *&. 2326 23272018-06-23 Paolo Carlini <paolo.carlini@oracle.com> 2328 2329 * decl.c (bad_specifiers): Add const location_t* parameter and 2330 use locations in error messages about 'inline' and 'virtual'. 2331 (mark_inline_variable): Add location_t parameter and use it in 2332 error_at and pedwarn messages. 2333 (grokdeclarator): Use declspecs->locations[ds_constexpr], 2334 declspecs->locations[ds_concept], declspecs->locations[ds_virtual], 2335 declspecs->locations[ds_inline] in many error messages; adjust 2336 bad_specifiers and mark_inline_variable calls. 2337 (grokvardecl): Use declspecs->locations[ds_concept] in error message. 2338 23392018-06-22 Jason Merrill <jason@redhat.com> 2340 2341 PR c++/86219 - ICE with erroneous initializer in template. 2342 * constexpr.c (fold_non_dependent_expr): Add complain parm. 2343 * call.c, expr.c, init.c, pt.c, semantics.c, typeck.c, typeck2.c: 2344 Pass it. 2345 * call.c (build_cxx_call): Don't mess with builtins in a template. 2346 * typeck2.c (store_init_value): If fold_non_dependent_expr didn't 2347 produce a constant value, go back to the uninstantiated form. 2348 2349 Avoid taking the address of something just because it's in parens. 2350 * constexpr.c (same_type_ignoring_tlq_and_bounds_p): New. 2351 (cxx_fold_indirect_ref): Use it. 2352 (cxx_eval_constant_expression) [VIEW_CONVERT_EXPR]: Use it. 2353 * cp-tree.h (REF_PARENTHESIZED_P): Allow VIEW_CONVERT_EXPR. 2354 * semantics.c (force_paren_expr): Use VIEW_CONVERT_EXPR instead of 2355 static_cast to reference type. 2356 (maybe_undo_parenthesized_ref): Handle VIEW_CONVERT_EXPR. 2357 23582018-06-21 Jason Merrill <jason@redhat.com> 2359 2360 * pt.c (tsubst) [TEMPLATE_TYPE_PARM]: Use TEMPLATE_PARM_DESCENDANTS. 2361 2362 * name-lookup.c (do_push_to_top_level): Don't allocate 2363 current_lang_base. 2364 (do_pop_from_top_level): Release current_lang_base. 2365 2366 Let -fmem-report see callers of cxx_make_type. 2367 * lex.c (cxx_make_type): Add MEM_STAT_DECL. 2368 (make_class_type): Likewise. 2369 (cxx_make_type_hook): New. 2370 * cp-objcp-common.h (LANG_HOOKS_MAKE_TYPE): Use cxx_make_type_hook. 2371 23722018-06-20 Nathan Sidwell <nathan@acm.org> 2373 2374 PR c++/85634 2375 * friend.c (add_friend): Keep lookup sets of tempate sets. 2376 23772018-06-20 Paolo Carlini <paolo.carlini@oracle.com> 2378 2379 * decl.c (grokfndecl): Add const cp_decl_specifier_seq* parameter; 2380 tidy handling of a null location_t argument; use proper location 2381 information in a few additional error messages. 2382 (grokdeclarator): Update calls. 2383 23842018-06-20 Chung-Lin Tang <cltang@codesourcery.com> 2385 Thomas Schwinge <thomas@codesourcery.com> 2386 Cesar Philippidis <cesar@codesourcery.com> 2387 2388 * parser.c (cp_parser_omp_clause_name): Add support for finalize 2389 and if_present. Make present_or_{copy,copyin,copyout,create} aliases 2390 to their non-present_or_* counterparts. Make 'self' an alias to 2391 PRAGMA_OACC_CLAUSE_HOST. 2392 (cp_parser_oacc_data_clause): Update GOMP mappings for 2393 PRAGMA_OACC_CLAUSE_{COPY,COPYIN,COPYOUT,CREATE,DELETE}. Remove 2394 PRAGMA_OACC_CLAUSE_{SELF,PRESENT_OR_*}. 2395 (cp_parser_oacc_all_clauses): Handle finalize and if_present clauses. 2396 Remove support for present_or_* clauses. 2397 (OACC_KERNELS_CLAUSE_MASK): Remove PRESENT_OR_* clauses. 2398 (OACC_PARALLEL_CLAUSE_MASK): Likewise. 2399 (OACC_DECLARE_CLAUSE_MASK): Likewise. 2400 (OACC_DATA_CLAUSE_MASK): Likewise. 2401 (OACC_ENTER_DATA_CLAUSE_MASK): Remove PRESENT_OR_* clauses. 2402 (OACC_EXIT_DATA_CLAUSE_MASK): Add FINALIZE clause. 2403 (OACC_UPDATE_CLAUSE_MASK): Remove SELF, add IF_PRESENT. 2404 (cp_parser_oacc_declare): Remove PRESENT_OR_* clauses. 2405 * pt.c (tsubst_omp_clauses): Handle IF_PRESENT and FINALIZE. 2406 * semantics.c (finish_omp_clauses): Handle IF_PRESENT and FINALIZE. 2407 24082018-06-20 Marek Polacek <polacek@redhat.com> 2409 2410 PR c++/86240 2411 * constexpr.c (cxx_eval_constant_expression): Handle ABSU_EXPR. 2412 (fold_simple_1): Likewise. 2413 * error.c (dump_expr): Likewise. 2414 24152018-06-20 Nathan Sidwell <nathan@acm.org> 2416 2417 PR c++/85634 2418 * cp-tree.h (lookup_keep): Drop KEEP parm. 2419 (lookup_list_keep): Delete. 2420 (maybe_get_fns): Declare. 2421 * parser.c (cp_parser_primary_expression): Call lookup_keep here. 2422 (cp_parser_template_id): Not here ... 2423 * decl.c (cp_finish_decl): ... nor here ... 2424 * init.c (build_raw_new_expr): ... nor here ... 2425 * pt.c (process_template_parm): ... nor here ... 2426 * semantics.c (perform_koenig_lookup): Call lookup_keep. 2427 (finish_call_expr): Not here. 2428 * tree.c (ovl_cache): Delete. 2429 (ovl_make, ovl_copy): No cache. 2430 (lookup_keep): Always keep. 2431 (lookup_list_keep): Delete. 2432 (maybe_get_fns): New, broken out of ... 2433 (get_fns): ... here. Call it. 2434 (built_min_nt_loc, build_min, build_min_non_dep): Drop lookup_keep. 2435 (build_min_nt_call_vec): Likewise. 2436 24372018-06-19 Jason Merrill <jason@redhat.com> 2438 2439 * cp-tree.h (CONSTRUCTOR_NO_IMPLICIT_ZERO): Remove. 2440 * constexpr.c: Use CONSTRUCTOR_NO_CLEARING instead. 2441 2442 PR c++/86182 - ICE with anonymous union passed to template. 2443 * pt.c (tsubst_expr) [DECL_EXPR]: Handle an anonymous union type 2444 used to declare a named variable. 2445 24462018-06-18 Jason Merrill <jason@redhat.com> 2447 2448 * tree.c (cp_expr_location): New. 2449 * cp-tree.h (cp_expr_loc_or_loc): New. 2450 * call.c, cvt.c, constexpr.c, constraint.cc, cp-gimplify.c, decl.c, 2451 error.c, init.c, lex.c, parser.c, pt.c, semantics.c, typeck.c, 2452 typeck2.c: Use it instead of EXPR_LOC_OR_LOC. 2453 2454 * parser.c (cp_parser_lambda_expression): Use a range for 2455 LAMBDA_EXPR_LOCATION. 2456 2457 PR c++/86200 - ICE with unexpanded pack in lambda parameter. 2458 * pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Also look into the 2459 function type. 2460 2461 PR c++/81060 - ICE with unexpanded parameter pack. 2462 * pt.c (check_for_bare_parameter_packs): Add loc parameter. 2463 * decl.c (grokdeclarator): Call it for qualifying_scope. 2464 2465 PR c++/86171 - ICE with recursive alias instantiation. 2466 * pt.c (tsubst_decl): Handle recursive alias instantiation. 2467 24682018-06-18 Paolo Carlini <paolo.carlini@oracle.com> 2469 2470 * decl.c (duplicate_decls): Consistently use DECL_SOURCE_LOCATION 2471 in errors about redefined default arguments; tidy. 2472 24732018-06-16 Kugan Vivekanandarajah <kuganv@linaro.org> 2474 2475 * constexpr.c (potential_constant_expression_1): Handle ABSU_EXPR. 2476 * cp-gimplify.c (cp_fold): Likewise. 2477 24782018-06-15 Jason Merrill <jason@redhat.com> 2479 2480 PR c++/86147 - wrong capture for template argument. 2481 * expr.c (mark_use): Look through NOP_EXPR. 2482 2483 * name-lookup.c (do_pushtag): Don't look through complete types, but 2484 don't add to them either. Get context from current_binding_level. 2485 * pt.c (tsubst_default_argument): Use push_to/pop_from_top_level. 2486 2487 * decl.c (start_enum): Do compare dependent underlying type. 2488 2489 PR c++/82882 - ICE with lambda in template default argument. 2490 * lambda.c (record_null_lambda_scope): New. 2491 * pt.c (tsubst_lambda_expr): Use it. 2492 * name-lookup.c (do_pushtag): Don't give a lambda DECL_CONTEXT of a 2493 function that isn't open. 2494 2495 * tree.c (maybe_warn_parm_abi): Inform the location of the class. 2496 24972018-06-14 Marek Polacek <polacek@redhat.com> 2498 2499 PR c++/86063 2500 * decl2.c (cp_check_const_attributes): Skip trees that are not 2501 TREE_LISTs. 2502 25032018-06-14 Jakub Jelinek <jakub@redhat.com> 2504 2505 P0624R2 - Default constructible and assignable stateless lambdas 2506 * method.c (synthesized_method_walk): For C++2a don't mark 2507 sfk_constructor or sfk_copy_assignment as deleted if lambda has 2508 no lambda-captures. 2509 25102018-06-14 Paolo Carlini <paolo.carlini@oracle.com> 2511 2512 * decl.c (duplicate_decls): Use DECL_SOURCE_LOCATION in 2513 OPT_Wshadow warning_at. 2514 (grokfndecl): Consistently use the location_t argument in 2515 literal operator diagnostic messages. 2516 (grokdeclarator): Use declspecs->locations[ds_storage_class] 2517 in error_at call. 2518 * decl2.c (finish_static_data_member_decl): Use DECL_SOURCE_LOCATION 2519 in permerror call. 2520 25212018-06-13 Jason Merrill <jason@redhat.com> 2522 2523 PR c++/86099 - ICE with trivial copy and non-trivial default ctor. 2524 * constexpr.c (instantiate_cx_fn_r): Don't synthesize trivial 2525 constructors. 2526 2527 PR c++/86094 - wrong code with defaulted move ctor. 2528 * class.c (classtype_has_non_deleted_move_ctor): New. 2529 * tree.c (maybe_warn_parm_abi, type_has_nontrivial_copy_init): 2530 Handle v12 breakage. 2531 25322018-06-12 Jason Merrill <jason@redhat.com> 2533 2534 PR c++/86098 - ICE with template placeholder for TTP. 2535 * typeck.c (structural_comptypes) [TEMPLATE_TYPE_PARM]: Check 2536 CLASS_PLACEHOLDER_TEMPLATE. 2537 25382018-06-12 Paolo Carlini <paolo.carlini@oracle.com> 2539 2540 * decl2.c (coerce_new_type, coerce_delete_type): Add location_t 2541 parameter and adjust error_at calls. 2542 * decl.c (grok_op_properties): Adjust calls. 2543 * cp-tree.h (oerce_new_type, coerce_delete_type): Adjust decls. 2544 25452018-06-12 Marek Polacek <polacek@redhat.com> 2546 2547 Core issue 1331 - const mismatch with defaulted copy constructor 2548 * class.c (check_bases_and_members): When checking a defaulted 2549 function, mark it as deleted rather than giving an error. 2550 25512018-06-11 Jason Merrill <jason@redhat.com> 2552 2553 PR c++/85792 -Wctor-dtor-privacy and inherited constructor. 2554 * class.c (maybe_warn_about_overly_private_class): Handle inherited 2555 constructors. 2556 2557 PR c++/85963 - -Wunused-but-set with ?: in template. 2558 * pt.c (tsubst_copy_and_build) [COND_EXPR]: Call mark_rvalue_use. 2559 25602018-06-11 Paolo Carlini <paolo.carlini@oracle.com> 2561 2562 * decl.c (grok_op_properties): Consistently use the location 2563 of the decl; remove special casing of POSTINCREMENT_EXPR and 2564 POSTDECREMENT_EXPR wrt default arguments. 2565 25662018-06-05 Jason Merrill <jason@redhat.com> 2567 2568 * constexpr.c (cxx_eval_binary_expression): Special case comparison 2569 of pointers to members of the same union. 2570 25712018-06-11 Jason Merrill <jason@redhat.com> 2572 2573 PR c++/86094 - wrong code with defaulted move ctor. 2574 * tree.c (type_has_nontrivial_copy_init): Fix move ctor handling. 2575 25762018-06-10 Paolo Carlini <paolo.carlini@oracle.com> 2577 2578 * decl.c (grokfndecl): Use the location_t argument in two more places. 2579 25802018-06-06 Marek Polacek <polacek@redhat.com> 2581 2582 PR c++/85977 2583 * pt.c (unify): If ELTTYPE has no deducible template parms, skip 2584 deduction from the list elements. 2585 (type_unification_real): Check convertibility of list elements. 2586 25872018-06-06 Jason Merrill <jason@redhat.com> 2588 2589 PR c++/86060 - ICE on range for with -std=c++98. 2590 * parser.c (cp_parser_init_statement): Don't clobber *decl after 2591 pedwarn. 2592 2593 PR c++/85710 - ICE with -Wmemset-elt-size. 2594 * semantics.c (finish_call_expr): Call warn_for_memset here. 2595 * parser.c (cp_parser_postfix_expression): Not here. 2596 (literal_integer_zerop): No longer static. 2597 * pt.c (build_non_dependent_expr): Don't wrap CONST_DECL. 2598 25992018-06-05 Marek Polacek <polacek@redhat.com> 2600 2601 PR c++/85976 2602 * tree.c (cp_tree_equal): Handle USING_DECL. 2603 26042018-06-05 Jason Merrill <jason@redhat.com> 2605 2606 PR c++/85731 - wrong error with qualified-id in template. 2607 * semantics.c (finish_qualified_id_expr): build_qualified_name 2608 for unbound names in the current class. 2609 26102018-06-04 Jason Merrill <jason@redhat.com> 2611 2612 PR c++/61806 - missed SFINAE with partial specialization. 2613 * cp-tree.h (deferring_access_check_sentinel): Add deferring_kind 2614 parameter to constructor. 2615 * pt.c (instantiate_class_template_1): Enable access checking 2616 before call to most_specialized_partial_spec. 2617 2618 PR c++/85765 - SFINAE and non-type default template arg. 2619 * pt.c (type_unification_real): Do full semantic processing if 2620 substituting a partial args list replaces all template parms. 2621 26222018-06-03 Jason Merrill <jason@redhat.com> 2623 2624 PR c++/85739 - ICE with pointer to member template parm. 2625 * cvt.c (perform_qualification_conversions): Use cp_fold_convert. 2626 26272018-06-02 Jason Merrill <jason@redhat.com> 2628 2629 PR c++/85761 - ICE with ill-formed use of const outer variable. 2630 * expr.c (mark_use): Handle location wrappers. 2631 26322018-06-01 Jason Merrill <jason@redhat.com> 2633 2634 PR c++/85764 - bogus 'this' not captured error. 2635 * lambda.c (resolvable_dummy_lambda): Use nonlambda_method_basetype. 2636 (nonlambda_method_basetype): Handle NSDMI. 2637 2638 CWG 1581: When are constexpr member functions defined? 2639 * constexpr.c (instantiate_cx_fn_r, instantiate_constexpr_fns): New. 2640 (cxx_eval_outermost_constant_expr): Call instantiate_constexpr_fns. 2641 2642 PR c++/58281 - explicit instantiation of constexpr 2643 * pt.c (mark_decl_instantiated): Clear DECL_EXTERNAL. 2644 2645 * pt.c (instantiate_decl): Any defaulted function is defined. 2646 26472018-05-30 Jonathan Wakely <jwakely@redhat.com> 2648 2649 PR c++/77777 2650 * call.c (resolve_args): Use location of expression, not current input 2651 location. 2652 26532018-05-30 Ville Voutilainen <ville.voutilainen@gmail.com> 2654 2655 Do not warn about zero-as-null when NULL is used. 2656 * call.c (conversion_null_warnings): Check for pointer 2657 types converted from zero constants. 2658 (convert_like_real): Add a warning sentinel at the end. 2659 * tree.c (maybe_warn_zero_as_null_pointer_constant): Also 2660 check null_node_p. 2661 26622018-05-30 Jason Merrill <jason@redhat.com> 2663 2664 PR c++/85807 - ICE with call in template NSDMI. 2665 * init.c (get_nsdmi): Use push_to/pop_from_top_level. 2666 * tree.c (bot_manip): Don't set_flags_from_callee in a template. 2667 2668 PR c++/85873 - constant initializer_list array not in .rodata. 2669 * tree.c (build_target_expr): Set TREE_READONLY. 2670 * call.c (set_up_extended_ref_temp): Set TREE_READONLY. 2671 2672 * parser.c (cp_parser_check_condition_declarator): Handle 2673 cp_error_declarator. 2674 26752018-05-30 Jonathan Wakely <jwakely@redhat.com> 2676 2677 * typeck.c (cxx_sizeof_or_alignof_type): Return size_one_node instead 2678 of using it in dead store. 2679 26802018-05-29 Jason Merrill <jason@redhat.com> 2681 2682 PR c++/67445 - returning temporary initializer_list. 2683 PR c++/67711 - assigning from temporary initializer_list. 2684 PR c++/48562 - new initializer_list. 2685 * typeck.c (maybe_warn_about_returning_address_of_local): Also warn 2686 about returning local initializer_list. 2687 * cp-tree.h (AUTO_TEMP_NAME, TEMP_NAME_P): Remove. 2688 * call.c (build_over_call): Warn about assignment from temporary 2689 init_list. 2690 * init.c (build_new_1): Warn about 'new std::initializer_list'. 2691 (find_list_begin, maybe_warn_list_ctor): New. 2692 (perform_member_init): Use maybe_warn_list_ctor. 2693 26942018-05-29 Marek Polacek <polacek@redhat.com> 2695 2696 PR c++/85883 2697 * init.c (build_new): Handle deducing a class with new 2698 with more than one argument. 2699 27002018-05-29 Jakub Jelinek <jakub@redhat.com> 2701 2702 PR c++/85952 2703 * init.c (build_aggr_init): For structured binding initialized from 2704 array call mark_rvalue_use on the initializer. 2705 27062018-05-28 Bernd Edlinger <bernd.edlinger@hotmail.de> 2707 2708 * decl2.c (start_static_storage_duration_function): Use 2709 splay_tree_delete_pointers. 2710 27112018-05-25 Jason Merrill <jason@redhat.com> 2712 2713 PR c++/85815 - reference to member of enclosing template. 2714 * search.c (lookup_base): Use currently_open_class. 2715 (lookup_member): Use it regardless of -fconcepts. 2716 * parser.c (cp_parser_postfix_dot_deref_expression): Check it. 2717 2718 CWG 616, 1213 - value category of subobject references. 2719 * tree.c (lvalue_kind): Fix handling of ARRAY_REF of pointer. 2720 27212018-05-24 Jason Merrill <jason@redhat.com> 2722 2723 PR c++/85842 - -Wreturn-type, constexpr if and generic lambda. 2724 * pt.c (tsubst_lambda_expr): Copy current_function_returns_* to 2725 generic lambda. 2726 27272018-05-24 Ville Voutilainen <ville.voutilainen@gmail.com> 2728 2729 Pedwarn on a non-standard position of a C++ attribute. 2730 * parser.c (cp_parser_namespace_definition): Pedwarn about attributes 2731 after the namespace name. 2732 27332018-05-24 Paolo Carlini <paolo.carlini@oracle.com> 2734 2735 * cp-tree.h (INDIRECT_TYPE_P): New. 2736 * call.c (build_trivial_dtor_call, maybe_warn_class_memaccess, 2737 joust): Use it instead of POINTER_TYPE_P. 2738 * class.c (update_vtable_entry_for_fn, find_flexarrays, 2739 * fixed_type_or_null, resolves_to_fixed_type_p): Likewise. 2740 * constexpr.c (cxx_eval_binary_expression, cxx_fold_indirect_ref, 2741 * cxx_eval_increment_expression, potential_constant_expression_1): 2742 Likewise. 2743 * cp-gimplify.c (cp_gimplify_expr, cp_genericize_r): Likewise. 2744 * cp-objcp-common.c (cxx_get_alias_set): Likewise. 2745 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call, 2746 cp_ubsan_maybe_instrument_downcast): Likewise. 2747 * cvt.c (cp_convert_to_pointer, ocp_convert, 2748 cp_get_fndecl_from_callee, maybe_warn_nodiscard, convert): Likewise. 2749 * cxx-pretty-print.c (cxx_pretty_printer::abstract_declarator, 2750 pp_cxx_offsetof_expression_1): Likewise. 2751 * decl.c (grokparms, static_fn_type): Likewise. 2752 * decl2.c (grokbitfield): Likewise. 2753 * error.c (dump_expr): Likewise. 2754 * except.c (initialize_handler_parm, check_noexcept_r): Likewise. 2755 * init.c (warn_placement_new_too_small): Likewise. 2756 * lambda.c (build_capture_proxy, add_capture): Likewise. 2757 * parser.c (cp_parser_omp_for_loop): Likewise. 2758 * pt.c (convert_nontype_argument, fn_type_unification, 2759 uses_deducible_template_parms, check_cv_quals_for_unify, 2760 dependent_type_p_r): Likewise. 2761 * search.c (check_final_overrider): Likewise. 2762 * semantics.c (handle_omp_array_sections, finish_omp_clauses, 2763 finish_omp_for): Likewise. 2764 * tree.c (cp_build_qualified_type_real): Likewise. 2765 * typeck.c (build_class_member_access_expr, 2766 finish_class_member_access_expr, build_x_indirect_ref, 2767 cp_build_indirect_ref_1, cp_build_binary_op, build_const_cast_1): 2768 Likewise. 2769 27702018-05-24 Jason Merrill <jason@redhat.com> 2771 2772 PR c++/85864 - literal template and default template arg. 2773 * pt.c (instantiation_dependent_r): Handle NONTYPE_ARGUMENT_PACK. 2774 27752018-05-24 Marek Polacek <polacek@redhat.com> 2776 2777 PR c++/85847 2778 * init.c (build_new_1): Use fold_non_dependent_expr. Use a dedicated 2779 variable for its result. Fix a condition. 2780 (build_new): Use fold_non_dependent_expr. Tweak a condition. 2781 27822018-05-23 Jason Merrill <jason@redhat.com> 2783 2784 Fix cast to rvalue reference from prvalue. 2785 * cvt.c (diagnose_ref_binding): Handle rvalue reference. 2786 * rtti.c (build_dynamic_cast_1): Don't try to build a reference to 2787 non-class type. Handle xvalue argument. 2788 * typeck.c (build_reinterpret_cast_1): Allow cast from prvalue to 2789 rvalue reference. 2790 * semantics.c (finish_compound_literal): Do direct-initialization, 2791 not cast, to initialize a reference. 2792 2793 CWG 616, 1213 - value category of subobject references. 2794 * tree.c (lvalue_kind): A reference to a subobject of a prvalue is 2795 an xvalue. 2796 * typeck2.c (build_m_component_ref): Likewise. 2797 * typeck.c (cp_build_addr_expr_1, lvalue_or_else): Remove diagnostic 2798 distinction between temporary and xvalue. 2799 28002018-05-23 Marek Polacek <polacek@redhat.com> 2801 2802 Implement P0614R1, Range-based for statements with initializer. 2803 * parser.c (cp_parser_range_based_for_with_init_p): New. 2804 (cp_parser_init_statement): Use it. Parse the optional init-statement 2805 for a range-based for loop. 2806 (cp_parser_skip_to_closing_parenthesis_1): Handle balancing ?:. 2807 28082018-05-22 Jason Merrill <jason@redhat.com> 2809 2810 PR c++/81420 - not extending temporary lifetime. 2811 * call.c (extend_ref_init_temps_1): Handle ARRAY_REF. 2812 * class.c (build_base_path): Avoid redundant move of an rvalue. 2813 2814 PR c++/85866 - error with .* in default template arg. 2815 * pt.c (tsubst_copy_and_build): Handle partial instantiation. 2816 28172018-05-21 Paolo Carlini <paolo.carlini@oracle.com> 2818 2819 * parser.c (cp_parser_parameter_declaration_list): Remove 2820 bool* parameter. 2821 (cp_parser_parameter_declaration_clause): Adjust. 2822 (cp_parser_cache_defarg): Likewise. 2823 28242018-05-21 Paolo Carlini <paolo.carlini@oracle.com> 2825 2826 PR c++/84588 2827 * parser.c (cp_parser_maybe_commit_to_declaration, 2828 cp_parser_check_condition_declarator): New. 2829 (cp_parser_simple_declaration): Use the first above. 2830 (cp_parser_condition): Use both the above; enforce 2831 [stmt.stmt]/2 about the declarator not specifying 2832 a function or an array; improve error-recovery. 2833 28342018-05-20 Jason Merrill <jason@redhat.com> 2835 2836 PR libstdc++/85843 - warning in logic_error copy constructor. 2837 * class.c (type_has_user_nondefault_constructor): Check for a 2838 user-provided ctor, not user-declared. 2839 28402018-05-19 Jason Merrill <jason@redhat.com> 2841 2842 * pt.c (tsubst_pack_expansion): Sorry rather than abort 2843 on __integer_pack as subexpression of pattern. 2844 28452018-05-18 Jason Merrill <jason@redhat.com> 2846 2847 PR c++/58407 - deprecated implicit copy ops. 2848 * call.c (build_over_call): Warn about deprecated trivial fns. 2849 * class.c (classtype_has_user_copy_or_dtor): New. 2850 (type_build_ctor_call): Check TREE_DEPRECATED. 2851 (type_build_dtor_call): Likewise. 2852 * decl2.c (cp_warn_deprecated_use): Move from tree.c. 2853 Add checks. Return bool. Handle -Wdeprecated-copy. 2854 (mark_used): Use it. 2855 * decl.c (grokdeclarator): Remove redundant checks. 2856 * typeck2.c (build_functional_cast): Likewise. 2857 * method.c (lazily_declare_fn): Mark deprecated copy ops. 2858 * init.c (build_aggr_init): Only set TREE_USED if there are 2859 side-effects. 2860 28612018-05-18 Cesar Philippidis <cesar@codesourcery.com> 2862 2863 PR c++/85782 2864 * cp-gimplify.c (cp_genericize_r): Call genericize_omp_for_stmt for 2865 OACC_LOOPs. 2866 28672018-05-18 Richard Sandiford <richard.sandiford@linaro.org> 2868 2869 * constexpr.c (cxx_eval_constant_expression): Remove FMA_EXPR handling. 2870 (potential_constant_expression_1): Likewise. 2871 28722018-05-16 Marek Polacek <polacek@redhat.com> 2873 2874 PR c++/85363 2875 * call.c (set_flags_from_callee): Handle AGGR_INIT_EXPRs too. 2876 * tree.c (bot_manip): Call set_flags_from_callee for 2877 AGGR_INIT_EXPRs too. 2878 28792018-05-15 Jason Merrill <jason@redhat.com> 2880 2881 * cp-tree.h (cp_expr): Remove copy constructor. 2882 * mangle.c (struct releasing_vec): Declare copy constructor. 2883 2884 * constexpr.c (cxx_eval_vec_init_1): Pass tf_none if ctx->quiet. 2885 2886 PR c++/64372 - CWG 1560, gratuitous lvalue-rvalue conversion in ?: 2887 * call.c (build_conditional_expr_1): Don't force_rvalue when one arm 2888 is a throw-expression. 2889 28902018-05-15 Paolo Carlini <paolo.carlini@oracle.com> 2891 2892 * cp-tree.h (DECL_MAYBE_IN_CHARGE_CDTOR_P): New. 2893 (FOR_EACH_CLONE): Update. 2894 * decl.c (grokdeclarator): Use it. 2895 * decl2.c (vague_linkage_p): Likewise. 2896 * mangle.c (mangle_decl): Likewise. 2897 * method.c (lazily_declare_fn): Likewise. 2898 * optimize.c (can_alias_cdtor, maybe_clone_body): Likewise. 2899 * repo.c (repo_emit_p): Likewise. 2900 * tree.c (decl_linkage): Likewise. 2901 29022018-05-14 Jason Merrill <jason@redhat.com> 2903 2904 Handle TYPE_HAS_LATE_RETURN_TYPE like ref-qualifier and eh spec. 2905 * tree.c (build_cp_fntype_variant): New. 2906 (build_ref_qualified_type, build_exception_variant) 2907 (strip_typedefs, cxx_copy_lang_qualifiers): Use it. 2908 (cxx_type_hash_eq, cp_check_qualified_type): Check 2909 TYPE_HAS_LATE_RETURN_TYPE. 2910 (cp_build_type_attribute_variant): Check cxx_type_hash_eq. 2911 (cp_build_qualified_type_real): No need to preserve C++ qualifiers. 2912 * class.c (build_clone): Use cxx_copy_lang_qualifiers. 2913 (adjust_clone_args): Likewise. 2914 * decl.c (grokfndecl): Add late_return_type_p parameter. Use 2915 build_cp_fntype_variant. 2916 (grokdeclarator): Pass late_return_type_p to grokfndecl. 2917 (check_function_type): Use cxx_copy_lang_qualifiers. 2918 (static_fn_type): Use cxx_copy_lang_qualifiers. 2919 * decl2.c (build_memfn_type, maybe_retrofit_in_chrg) 2920 (cp_reconstruct_complex_type, coerce_new_type, coerce_delete_type) 2921 (change_return_type): Use cxx_copy_lang_qualifiers. 2922 * mangle.c (write_type): Use cxx_copy_lang_qualifiers. 2923 * parser.c (cp_parser_lambda_declarator_opt): Represent an explicit 2924 return type on the declarator like a normal trailing return type. 2925 * pt.c (tsubst_function_type): Use build_cp_fntype_variant. 2926 (copy_default_args_to_explicit_spec): Use cxx_copy_lang_qualifiers. 2927 * typeck.c (merge_types): Use build_cp_fntype_variant. 2928 29292018-05-14 Paolo Carlini <paolo.carlini@oracle.com> 2930 2931 * cp-tree.h (TYPE_REF_P): New. 2932 (TYPE_OBJ_P, TYPE_REF_OBJ_P, TYPE_REFFN_P): Update. 2933 * call.c (build_list_conv, build_aggr_conv, standard_conversion, 2934 direct_reference_binding, reference_binding, implicit_conversion, 2935 add_builtin_candidate, build_user_type_conversion_1, build_op_call_1, 2936 build_new_op_1, build_x_va_arg, conv_binds_ref_to_prvalue, 2937 build_over_call, perform_implicit_conversion_flags, 2938 extend_ref_init_temps, type_has_extended_temps): Use it. 2939 * class.c (one_inheriting_sig, check_field_decls, 2940 check_bases_and_members, find_flexarrays, finish_struct, 2941 fixed_type_or_null): Likewise. 2942 * constexpr.c (literal_type_p, cxx_bind_parameters_in_call, 2943 non_const_var_error, cxx_eval_constant_expression, 2944 potential_constant_expression_1): Likewise. 2945 * cp-gimplify.c (omp_var_to_track, omp_cxx_notice_variable, 2946 cp_genericize_r, cxx_omp_privatize_by_reference, 2947 cxx_omp_const_qual_no_mutable, cxx_omp_finish_clause, 2948 cp_fold_maybe_rvalue): Likewise. 2949 * cp-ubsan.c (cp_ubsan_maybe_instrument_downcast): Likewise. 2950 * cvt.c (build_up_reference, convert_to_reference, 2951 convert_from_reference, convert_to_void, noexcept_conv_p, 2952 fnptr_conv_p): Likewise. 2953 * decl.c (poplevel, check_for_uninitialized_const_var, 2954 check_initializer, initialize_local_var, cp_finish_decl, 2955 get_tuple_decomp_init, cp_finish_decomp, grokdeclarator, copy_fn_p, 2956 move_signature_fn_p, grok_op_properties, finish_function): Likewise. 2957 * decl2.c (grok_array_decl, cp_reconstruct_complex_type, 2958 decl_maybe_constant_var_p): Likewise. 2959 * error.c (dump_type_prefix, dump_expr): Likewise. 2960 * except.c (initialize_handler_parm, complete_ptr_ref_or_void_ptr_p, 2961 is_admissible_throw_operand_or_catch_parameter): Likewise. 2962 * expr.c (mark_use): Likewise. 2963 * init.c (build_zero_init_1, build_value_init_noctor, 2964 perform_member_init, diagnose_uninitialized_cst_or_ref_member_1, 2965 build_new, build_delete): Likewise. 2966 * lambda.c (build_lambda_object): Likewise. 2967 * mangle.c (write_expression, write_template_arg): Likewise. 2968 * method.c (forward_parm, do_build_copy_constructor, 2969 do_build_copy_assign, build_stub_object, constructible_expr, 2970 walk_field_subobs): Likewise. 2971 * parser.c (cp_parser_omp_for_loop_init, 2972 cp_parser_omp_declare_reduction_exprs, 2973 cp_parser_omp_declare_reduction): Likewise. 2974 * pt.c (convert_nontype_argument_function, convert_nontype_argument, 2975 convert_template_argument, tsubst_pack_expansion, 2976 tsubst_function_decl, tsubst_decl, tsubst, tsubst_copy_and_build, 2977 maybe_adjust_types_for_deduction, check_cv_quals_for_unify, unify, 2978 more_specialized_fn, invalid_nontype_parm_type_p, dependent_type_p_r, 2979 value_dependent_expression_p, build_deduction_guide): Likewise. 2980 * semantics.c (finish_handler_parms, finish_non_static_data_member, 2981 finish_compound_literal, omp_privatize_field, 2982 handle_omp_array_sections_1, handle_omp_array_sections, 2983 cp_check_omp_declare_reduction, finish_omp_reduction_clause, 2984 finish_omp_declare_simd_methods, cp_finish_omp_clause_depend_sink, 2985 finish_omp_clauses, finish_decltype_type, capture_decltype, 2986 finish_builtin_launder): Likewise. 2987 * tree.c (lvalue_kind, cp_build_reference_type, move, 2988 cp_build_qualified_type_real, stabilize_expr, stabilize_init): Likewise. 2989 * typeck.c (cxx_safe_arg_type_equiv_p, build_class_member_access_expr, 2990 cp_build_indirect_ref_1, convert_arguments, warn_for_null_address, 2991 cp_build_addr_expr_1, maybe_warn_about_useless_cast, 2992 build_static_cast_1, build_static_cast, build_reinterpret_cast_1, 2993 build_const_cast_1, cp_build_c_cast, cp_build_modify_expr, 2994 convert_for_initialization, 2995 maybe_warn_about_returning_address_of_local, check_return_expr, 2996 cp_type_quals, casts_away_constness, non_reference): Likewise. 2997 * typeck2.c (cxx_readonly_error, store_init_value, 2998 process_init_constructor_record, build_x_arrow, build_functional_cast, 2999 add_exception_specifier): Likewise. 3000 30012018-05-14 Jason Merrill <jason@redhat.com> 3002 3003 * pt.c (tsubst) [ARRAY_TYPE]: Check valid_array_size_p. 3004 (tsubst_copy_and_build) [NEW_EXPR]: Clear in_decl. 3005 30062018-05-11 Jakub Jelinek <jakub@redhat.com> 3007 3008 PR c/85696 3009 * cp-tree.h (cxx_omp_predetermined_sharing_1): New prototype. 3010 * cp-gimplify.c (cxx_omp_predetermined_sharing): New wrapper around 3011 cxx_omp_predetermined_sharing_1. Rename old function to ... 3012 (cxx_omp_predetermined_sharing_1): ... this. 3013 * semantics.c (finish_omp_clauses): Use cxx_omp_predetermined_sharing_1 3014 instead of cxx_omp_predetermined_sharing. 3015 30162018-05-10 Jason Merrill <jason@redhat.com> 3017 3018 * decl.c (cp_finish_decl): Don't instantiate auto variable. 3019 (check_static_variable_definition): Allow auto. 3020 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise. 3021 3022 * cp-tree.h (DECL_CONSTRUCTOR_P): Use DECL_CXX_CONSTRUCTOR_P. 3023 (DECL_DESTRUCTOR_P): Use DECL_CXX_DESTRUCTOR_P. 3024 3025 Core issue 2310 - conversion to base of incomplete type. 3026 * class.c (build_base_path): Check COMPLETE_TYPE_P for source type. 3027 3028 CWG 2267 - list-initialization of reference temporary 3029 * call.c (reference_binding): List-initializing a reference 3030 temporary is copy-list-initialization. 3031 3032 * parser.c (cp_parser_class_head): Use num_template_headers_for_class. 3033 3034 * pt.c (instantiate_decl): Make sure we aren't trying to do a nested 3035 instantiation in template context. 3036 3037 * class.c (vbase_has_user_provided_move_assign): Use 3038 user_provided_p. 3039 3040 * lambda.c (lambda_expr_this_capture): Improve logic. 3041 3042 * decl.c (make_typename_type): s/parameters/arguments/. 3043 * parser.c (cp_parser_nested_name_specifier_opt): Likewise. 3044 * pt.c (make_pack_expansion): Correct error message. 3045 30462018-05-10 Jakub Jelinek <jakub@redhat.com> 3047 3048 PR c++/85662 3049 * cp-gimplify.c (cp_fold): Use fold_offsetof rather than 3050 fold_offsetof_1, pass TREE_TYPE (x) as TYPE to it and drop the 3051 fold_convert. 3052 30532018-05-10 Eric Botcazou <ebotcazou@adacore.com> 3054 3055 PR c++/85400 3056 * decl2.c (adjust_var_decl_tls_model): New static function. 3057 (comdat_linkage): Call it on a variable. 3058 (maybe_make_one_only): Likewise. 3059 30602018-05-09 Paolo Carlini <paolo.carlini@oracle.com> 3061 3062 PR c++/85713 3063 Revert: 3064 2018-05-08 Paolo Carlini <paolo.carlini@oracle.com> 3065 3066 PR c++/84588 3067 * parser.c (cp_parser_parameter_declaration_list): When the 3068 entire parameter-declaration-list is erroneous maybe call 3069 abort_fully_implicit_template. 3070 30712018-05-08 Jason Merrill <jason@redhat.com> 3072 3073 PR c++/85706 - class deduction under decltype 3074 * pt.c (for_each_template_parm_r): Handle DECLTYPE_TYPE. Clear 3075 *walk_subtrees whether or not we walked into the operand. 3076 (type_uses_auto): Only look at deduced contexts. 3077 30782018-05-08 Paolo Carlini <paolo.carlini@oracle.com> 3079 3080 PR c++/84588 3081 * parser.c (cp_parser_parameter_declaration_list): When the 3082 entire parameter-declaration-list is erroneous maybe call 3083 abort_fully_implicit_template. 3084 30852018-05-08 Marek Polacek <polacek@redhat.com> 3086 3087 PR c++/85695 3088 * semantics.c (finish_if_stmt_cond): See through typedefs. 3089 30902018-05-07 Jason Merrill <jason@redhat.com> 3091 3092 PR c++/85646 - lambda visibility. 3093 * decl2.c (determine_visibility): Don't mess with template arguments 3094 from the containing scope. 3095 (vague_linkage_p): Check DECL_ABSTRACT_P before looking at a 'tor 3096 thunk. 3097 30982018-05-07 Nathan Sidwell <nathan@acm.org> 3099 3100 Remove fno-for-scope 3101 * cp-tree.h (DECL_ERROR_REPORTED, DECL_DEAD_FOR_LOCAL) 3102 (DECL_HAS_SHADOWED_FOR_VAR_P, DECL_SHADOWED_FOR_VAR) 3103 (SET_DECL_SHADOWED_FOR_VAR): Delete. 3104 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert) 3105 (check_for_out_of_scope_variable, init_shadowed_var_for_decl): 3106 Don't declare. 3107 * name-lookup.h (struct cp_binding_level): Remove 3108 dead_vars_from_for field. 3109 * cp-lang.c (cp_init_ts): Delete. 3110 (LANG_HOOKS_INIT_TS): Override to cp_common_init_ts. 3111 * cp-objcp-common.c (shadowed_var_for_decl): Delete. 3112 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert) 3113 (init_shadowed_var_for_decl): Delete. 3114 * decl.c (poplevel): Remove shadowed for var handling. 3115 (cxx_init_decl_processing): Remove -ffor-scope deprecation. 3116 * name-lookup.c (find_local_binding): Remove shadowed for var 3117 handling. 3118 (check_local_shadow): Likewise. 3119 (check_for_out_of_scope_variable): Delete. 3120 * parser.c (cp_parser_primary_expression): Remove shadowed for var 3121 handling. 3122 * pt.c (tsubst_decl): Remove DECL_DEAD_FOR_LOCAL setting. 3123 * semantics.c (begin_for_scope): Always have a scope. 3124 (begin_for_stmt, finish_for_stmt): Remove ARM-for scope handling. 3125 (begin_range_for_stmt, finish_id_expression): Likewise. 3126 31272018-05-07 Jason Merrill <jason@redhat.com> 3128 3129 PR c++/85618 - ICE with initialized VLA. 3130 * tree.c (vla_type_p): New. 3131 * typeck2.c (store_init_value, split_nonconstant_init_1): Check it 3132 rather than array_of_runtime_bound_p. 3133 31342018-05-05 Paolo Carlini <paolo.carlini@oracle.com> 3135 3136 * cvt.c (ocp_convert): Early handle the special case of a 3137 null_ptr_cst_p expr converted to a NULLPTR_TYPE_P type. 3138 31392018-05-03 Jason Merrill <jason@redhat.com> 3140 3141 PR c++/85600 - virtual delete failure. 3142 * init.c (build_delete): Always save_expr when deleting. 3143 31442018-05-03 Nathan Sidwell <nathan@acm.org> 3145 3146 * decl.c (cxx_init_decl_processing): Remove flag_friend_injection. 3147 * name-lookup.c (do_pushdecl): Likewise. 3148 31492018-05-02 Paolo Carlini <paolo.carlini@oracle.com> 3150 Jason Merrill <jason@redhat.com> 3151 3152 PR c++/68374 3153 * name-lookup.c (check_local_shadow): Don't handle static old 3154 declarations in the block handling locals shadowing locals. 3155 31562018-05-01 Jason Merrill <jason@redhat.com> 3157 3158 PR c++/85587 - error with scoped enum in template. 3159 * semantics.c (finish_qualified_id_expr): Don't return an 3160 unqualified IDENTIFIER_NODE. 3161 31622018-04-30 Jason Merrill <jason@redhat.com> 3163 3164 PR c++/85580 - extern "C" and local variables 3165 * name-lookup.c (check_extern_c_conflict): Ignore local decls. 3166 3167 PR c++/84701 - unsigned typeof. 3168 * decl.c (grokdeclarator): Overhaul diagnostics for invalid use 3169 of long/short/signed/unsigned. 3170 3171 PR c++/85305 - pack in lambda init-capture. 3172 * parser.c (cp_parser_initializer): Add subexpression_p parm; don't 3173 check_for_bare_parameter_packs in a subexpression. 3174 (cp_parser_lambda_introducer): Use it. 3175 3176 PR c++/61982 - dead stores to destroyed objects. 3177 * call.c (build_trivial_dtor_call): New, assigns a clobber. 3178 (build_over_call, build_special_member_call): Use it. 3179 * cp-tree.h: Declare it. 3180 * init.c (build_delete): Remove trivial path. 3181 3182 * init.c (build_dtor_call): Use build_special_member_call. 3183 (build_delete): Remove redundant uses of save_addr. 3184 3185 * decl.c (build_clobber_this): Use build_clobber. 3186 31872018-04-27 Jakub Jelinek <jakub@redhat.com> 3188 3189 PR c++/85553 3190 * init.c (build_zero_init_1): For zero initialization of 3191 NULLPTR_TYPE_P type use build_int_cst directly. 3192 31932018-04-27 David Malcolm <dmalcolm@redhat.com> 3194 3195 PR c++/85515 3196 * name-lookup.c (consider_binding_level): Skip compiler-generated 3197 variables. 3198 * search.c (lookup_field_fuzzy_info::fuzzy_lookup_field): Flatten 3199 nested if statements into a series of rejection tests. Reject 3200 lambda-ignored entities as suggestions. 3201 32022018-04-27 Jason Merrill <jason@redhat.com> 3203 3204 * cvt.c (cp_fold_convert): Use convert_ptrmem. 3205 * typeck.c (convert_ptrmem): Add a NOP even if no adjustment. 3206 32072018-04-27 Paolo Carlini <paolo.carlini@oracle.com> 3208 3209 PR c++/84691 3210 * decl.c (grokdeclarator): Clear friendp upon definition in local 3211 class definition error. 3212 32132018-04-27 Jason Merrill <jason@redhat.com> 3214 3215 PR c++/85545 - ICE with noexcept PMF conversion. 3216 * cvt.c (cp_fold_convert): Pass PMF CONSTRUCTORs to 3217 build_ptrmemfunc. 3218 * typeck.c (build_ptrmemfunc): Don't build a NOP_EXPR for zero 3219 adjustment. 3220 (build_ptrmemfunc_access_expr): Special-case CONSTRUCTORs. 3221 32222018-04-27 Nathan Sidwell <nathan@acm.org> 3223 3224 * typeck.c (convert_ptrmem): Move local var decls to initialization. 3225 3226 * cp-tree.h (TEMPLATE_INFO): Fix comments. 3227 (TI_PENDING_TEMPLATE_FLAG): Check TEMPLATE_INFO. 3228 (NON_DEFAULT_TEMPLATE_ARG_COUNT): Wrap line. 3229 (dump, print_other_binding_stacks): Remove declarations. 3230 * name-lookup.c (print_other_binding_stack): Make static. 3231 * pt.c (build_template_decl): Make static. 3232 32332018-04-26 Jason Merrill <jason@redhat.com> 3234 3235 PR c++/85545 - ICE with noexcept PMF conversion. 3236 * cvt.c (cp_fold_convert): Handle PMF CONSTRUCTORs directly. 3237 32382018-04-25 Nathan Sidwell <nathan@acm.org> 3239 3240 PR c++/85437 3241 PR c++/49171 3242 * cp-tree.h (REINTERPRET_CAST_P): New. 3243 * constexpr.c (cxx_eval_constant_expression) <case NOP_EXPR>: 3244 Reject REINTERPET_CAST_P conversions. Use cplus_expand_constant 3245 for non-trivial PTRMEM_CST cases. 3246 * typeck.c (build_nop_reinterpret): New. 3247 (build_reinterpret_cast_1): Use it. Set REINTERPRET_CAST_P on 3248 NOP_EXPRs returned by cp_convert. 3249 32502018-04-23 Jason Merrill <jason@redhat.com> 3251 3252 PR c++/69560 - wrong alignof(double) on x86. 3253 CWG 1879 - Inadequate definition of alignment requirement. 3254 * cp-tree.h (ALIGNOF_EXPR_STD_P): New. 3255 * typeck.c (cxx_sizeof_or_alignof_type): Add std_alignof parm. 3256 (cxx_sizeof_expr, cxx_sizeof_nowarn, cxx_alignas_expr) 3257 (cxx_alignof_expr): Pass it. 3258 * parser.c (cp_parser_unary_expression): Pass it. 3259 * pt.c (tsubst_copy): Copy it. 3260 (tsubst_copy_and_build): Pass it. 3261 * decl.c (fold_sizeof_expr): Pass it. 3262 32632018-04-23 Jakub Jelinek <jakub@redhat.com> 3264 Jason Merrill <jason@redhat.com> 3265 3266 PR c++/85470 - wrong error with static data member. 3267 * decl.c (check_initializer): Check DECL_INITIALIZED_IN_CLASS_P. 3268 * typeck2.c (store_init_value): Likewise. 3269 32702018-04-20 Jakub Jelinek <jakub@redhat.com> 3271 3272 PR c++/85462 3273 * cp-tree.h (tinst_level): Remove in_system_header_p member, 3274 change refcount member from unsigned char to unsigned short, 3275 add refcount_infinity static data member, adjust comments. 3276 * pt.c (tinst_level::refcount_infinity): Define. 3277 (inc_refcount_use): Remove assert, don't increment if refcount 3278 is already refcount_infinity, adjust comment. 3279 (dec_refcount_use): Remove assert, don't decrement if refcount 3280 is refcount_infinity, adjust comment. 3281 (push_tinst_level_loc): Formatting fix. 3282 32832018-04-19 Paolo Carlini <paolo.carlini@oracle.com> 3284 3285 PR c++/84611 3286 * pt.c (lookup_template_class_1): Check pushtag return value for 3287 error_mark_node. 3288 32892018-04-19 Alexandre Oliva <aoliva@redhat.com> 3290 3291 PR c++/80290 3292 * cp-tree.h (tinst_level::free): Fix whitespace. 3293 32942018-04-18 Paolo Carlini <paolo.carlini@oracle.com> 3295 3296 PR c++/84630 3297 * pt.c (tsubst_lambda_expr): Check begin_lambda_type return value 3298 for error_mark_node. 3299 33002018-04-18 Jakub Jelinek <jakub@redhat.com> 3301 3302 PR c++/84463 3303 * typeck.c (cp_build_addr_expr_1): Move handling of offsetof-like 3304 tricks from here to ... 3305 * cp-gimplify.c (cp_fold) <case ADDR_EXPR>: ... here. Only use it 3306 if INDIRECT_REF's operand is INTEGER_CST cast to pointer type. 3307 33082018-04-18 Alexandre Oliva <aoliva@redhat.com> 3309 3310 PR c++/80290 3311 * cp-tree.h (struct tinst_level): Split decl into tldcl and 3312 targs. Add private split_list_p, tree_list_p, and not_list_p 3313 inline const predicates; to_list private member function 3314 declaration; free public member function declaration; list_p, 3315 get_node and maybe_get_node accessors, and refcount data 3316 member. Narrow errors to unsigned short. 3317 * error.c (print_instantiation_full_context): Use new 3318 accessors. 3319 (print_instantiation_partial_context_line): Likewise. Drop 3320 const from tinst_level-typed parameter. 3321 * mangle.c (mangle_decl_string): Likewise. 3322 * pt.c (freelist): New template class. 3323 (tree_list_freelist_head): New var. 3324 (tree_list_freelist): New fn, along with specializations. 3325 (tinst_level_freelist_head): New var. 3326 (pending_template_freelist_head): Likewise. 3327 (tinst_level_freelist, pending_template_freelist): New fns. 3328 (tinst_level::to_list, tinst_level::free): Define. 3329 (inc_refcount_use, dec_refcount_use): New fns for tinst_level. 3330 (set_refcount_ptr): New template fn. 3331 (add_pending_template): Adjust for refcounting, freelists and 3332 new accessors. 3333 (neglectable_inst_p): Take a NULL d as a non-DECL. 3334 (limit_bad_template_recursion): Use new accessors. 3335 (push_tinst_level): New overload to create the list. 3336 (push_tinst_level_loc): Make it static, split decl into two 3337 args, adjust tests and initialization to cope with split 3338 lists, use freelist, adjust for refcounting. 3339 (push_tinst_level_loc): New wrapper with the old interface. 3340 (pop_tinst_level): Adjust for refcounting. 3341 (record_last_problematic_instantiation): Likewise. 3342 (reopen_tinst_level): Likewise. Use new accessors. 3343 (instantiate_alias_template): Adjust for split list. 3344 (fn_type_unification): Likewise. 3345 (get_partial_spec_bindings): Likewise. 3346 (instantiate_pending_templates): Use new accessors. Adjust 3347 for refcount. Release pending_template to freelist. 3348 (instantiating_current_function_p): Use new accessors. 3349 33502018-04-16 Alexandre Oliva <aoliva@redhat.com> 3351 3352 PR c++/85039 3353 * parser.c (cp_parser_builtin_offset): Reject type definitions. 3354 * mangle.c (nested_anon_class_index): Avoid crash returning -1 3355 if we've seen errors. 3356 33572018-04-12 David Malcolm <dmalcolm@redhat.com> 3358 3359 PR c++/85385 3360 * name-lookup.c (macro_use_before_def::maybe_make): New function, 3361 checking that the use is indeed before the definition. 3362 (macro_use_before_def::macro_use_before_def): Make private. 3363 (macro_use_before_def::~macro_use_before_def): Make private. Move 3364 check for UNKNOWN_LOCATION to macro_use_before_def::maybe_make. 3365 (lookup_name_fuzzy): Call macro_use_before_def::maybe_make rather 3366 than using new directly. 3367 33682018-04-12 Jason Merrill <jason@redhat.com> 3369 3370 PR c++/85356 - ICE with pointer to member function. 3371 * pt.c (maybe_instantiate_noexcept): Do instantiate in templates if 3372 flag_noexcept_type. Build the new spec within the function context. 3373 * except.c (build_noexcept_spec): Do get constant value in templates 3374 if flag_noexcept_type. 3375 * decl.c (check_redeclaration_exception_specification): Don't 3376 instantiate noexcept on a dependent declaration. 3377 33782018-04-12 Marek Polacek <polacek@redhat.com> 3379 3380 PR c++/85258 3381 * constexpr.c (reduced_constant_expression_p): Return false for null 3382 trees. 3383 33842018-04-11 Marek Polacek <polacek@redhat.com> 3385 3386 PR c++/85032 3387 * constexpr.c (potential_constant_expression_1): Consider conversions 3388 from classes to literal types potentially constant. 3389 33902018-04-10 Paolo Carlini <paolo.carlini@oracle.com> 3391 3392 PR c++/70808 3393 * init.c (build_zero_init_1): Handle NULLPTR_TYPE_P being true of 3394 the type like TYPE_PTR_OR_PTRMEM_P. 3395 33962018-04-10 Jason Merrill <jason@redhat.com> 3397 3398 PR debug/65821 - wrong location for main(). 3399 * call.c (clear_location_r, convert_default_arg): Revert. 3400 * tree.c (break_out_target_exprs): Add clear_location parm. 3401 (struct bot_data): New. 3402 (bot_manip): Clear location if requested. 3403 * init.c (get_nsdmi): Pass clear_location. 3404 34052018-04-10 David Malcolm <dmalcolm@redhat.com> 3406 3407 PR c++/85110 3408 * call.c (get_fndecl_argument_location): Make non-static. 3409 * cp-tree.h (get_fndecl_argument_location): New decl. 3410 * typeck.c (convert_for_assignment): When complaining due to 3411 conversions for an argument, show the location of the parameter 3412 within the decl. 3413 34142018-04-10 Jakub Jelinek <jakub@redhat.com> 3415 3416 PR c++/85312 - P0962 cleanup 3417 * parser.c (cp_parser_perform_range_for_lookup): Remove unreachable 3418 diagnostics. 3419 34202018-04-10 Jason Merrill <jason@redhat.com> 3421 3422 PR debug/65821 - wrong location for main(). 3423 * call.c (clear_location_r): New. 3424 (convert_default_arg): Use it. 3425 * tree.c (bot_manip): Remove builtin_LINE/FILE handling. 3426 3427 PR c++/85285 - ICE with flexible array after substitution. 3428 * pt.c (instantiate_class_template_1): Check for flexible array in 3429 union. 3430 34312018-04-09 Paolo Carlini <paolo.carlini@oracle.com> 3432 3433 PR c++/85227 3434 * decl.c (cp_finish_decomp): In a template, if the type is incomplete 3435 issue a pedwarn and defer trying to do bindings. 3436 34372018-04-09 Jason Merrill <jason@redhat.com> 3438 3439 PR c++/85279 - dump_expr doesn't understand decltype. 3440 * error.c (dump_expr): Handle DECLTYPE_TYPE. 3441 3442 PR c++/85262 - ICE with redundant qualification on constructor. 3443 * call.c (build_new_method_call_1): Move make_args_non_dependent 3444 after A::A() handling. 3445 3446 PR c++/85277 - ICE with invalid offsetof. 3447 * semantics.c (finish_offsetof): Avoid passing non-DECL to %qD. 3448 Adjust -Winvalid-offsetof diagnostic to say conditionally supported. 3449 3450 PR c++/85264 - ICE with excess template-parameter-list. 3451 * parser.c (cp_parser_check_template_parameters): Add template_id_p 3452 parameter. Don't allow an extra template header if true. 3453 (cp_parser_class_head): Pass template_id_p. 3454 (cp_parser_elaborated_type_specifier): Likewise. 3455 (cp_parser_alias_declaration): Likewise. 3456 (cp_parser_check_declarator_template_parameters): Likewise. 3457 34582018-04-09 Jakub Jelinek <jakub@redhat.com> 3459 3460 PR c++/85194 3461 * parser.c (cp_parser_simple_declaration): For structured bindings, 3462 if *maybe_range_for_decl is NULL after parsing it, set it to 3463 error_mark_node. 3464 34652018-04-09 Jason Merrill <jason@redhat.com> 3466 3467 PR c++/85256 - ICE capturing pointer to VLA. 3468 * lambda.c (add_capture): Distinguish between variable-size and 3469 variably-modified types. 3470 34712018-04-06 Jason Merrill <jason@redhat.com> 3472 3473 PR c++/85214 - ICE with alias, generic lambda, constexpr if. 3474 * pt.c (extract_locals_r): Remember local typedefs. 3475 34762018-04-06 David Malcolm <dmalcolm@redhat.com> 3477 3478 PR c++/84269 3479 * name-lookup.c (struct std_name_hint): Move out of 3480 get_std_name_hint; add field "min_dialect". 3481 (get_std_name_hint): Add min_dialect values to all initializers. 3482 Add <any>, <atomic>, <bitset>, <condition_variable>, <functional>, 3483 <future>, <istream>, <iterator>, <ostream>, <mutex>, <optional>, 3484 <shared_mutex>, <string_view>, <thread>, and <variant>. 3485 Add fstream, ifstream, and ofstream to <fstream>. 3486 Add istringstream, ostringstream, and stringstream to <sstream>. 3487 Add basic_string to <string>. 3488 Add tuple_element and tuple_size to <tuple>. 3489 Add declval to <utility>. 3490 Fix ordering of <queue> and <tuple>. 3491 Return a std_name_hint, rather than a const char *. 3492 (get_cxx_dialect_name): New function. 3493 (maybe_suggest_missing_std_header): Detect names that aren't yet 3494 available in the current dialect, and instead of suggesting a 3495 missing #include, warn about the dialect. 3496 34972018-04-06 Jakub Jelinek <jakub@redhat.com> 3498 3499 PR c++/85210 3500 * pt.c (tsubst_decomp_names): Return error_mark_node and assert 3501 errorcount is set if tsubst doesn't return a VAR_DECL. 3502 35032018-04-06 David Malcolm <dmalcolm@redhat.com> 3504 3505 PR c++/85021 3506 * name-lookup.c (using_directives_contain_std_p): New function. 3507 (has_using_namespace_std_directive_p): New function. 3508 (suggest_alternatives_for): Simplify if/else logic using early 3509 returns. If no candidates were found, and there's a 3510 "using namespace std;" directive, call 3511 maybe_suggest_missing_std_header. 3512 (maybe_suggest_missing_header): Split later part of the function 3513 into.. 3514 (maybe_suggest_missing_std_header): New. 3515 35162018-04-06 Jason Merrill <jason@redhat.com> 3517 3518 PR c++/85242 - ICE with class definition in template parm. 3519 * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): False if 3520 processing_template_parmlist. 3521 3522 PR c++/85240 - LTO ICE with using of undeduced auto fn. 3523 * cp-gimplify.c (cp_genericize_r): Discard using of undeduced auto. 3524 35252018-04-05 Jakub Jelinek <jakub@redhat.com> 3526 3527 PR c++/85209 3528 * pt.c (tsubst_decomp_names): Don't fail or ICE if DECL_CHAIN (decl3) 3529 is not prev, if prev == decl. 3530 3531 PR c++/85208 3532 * decl.c (start_decl): For DECL_DECOMPOSITION_P decls, don't call 3533 maybe_apply_pragma_weak here... 3534 (cp_maybe_mangle_decomp): ... but call it here instead. 3535 35362018-04-05 Jason Merrill <jason@redhat.com> 3537 3538 PR c++/85136 - ICE with designated init in template. 3539 * decl.c (maybe_deduce_size_from_array_init): Handle dependent 3540 designated initializer. 3541 (check_array_designated_initializer): Update ce->index with the 3542 constant value. 3543 3544 PR c++/83808 - ICE with VLA initialization. 3545 * typeck2.c (process_init_constructor_array): Don't require a VLA 3546 initializer to have VLA type. 3547 35482018-04-05 Paolo Carlini <paolo.carlini@oracle.com> 3549 3550 PR c++/80956 3551 * call.c (convert_like_real): Fail gracefully for a broken 3552 std::initializer_list, missing a definition. 3553 3554 * name-lookup.c (do_pushtag): Tweak message, use %< and %>. 3555 35562018-04-05 Paolo Carlini <paolo.carlini@oracle.com> 3557 3558 PR c++/84792 3559 * decl.c (grokdeclarator): Fix diagnostic about typedef name used 3560 as nested-name-specifier, keep type and TREE_TYPE (decl) in sync. 3561 35622018-04-05 Jason Merrill <jason@redhat.com> 3563 3564 PR c++/82152 - ICE with class deduction and inherited ctor. 3565 * pt.c (do_class_deduction): Ignore inherited ctors. 3566 3567 PR c++/84665 - ICE with array of empty class. 3568 * decl2.c (cp_check_const_attributes): Use fold_non_dependent_expr. 3569 3570 PR c++/85228 - ICE with lambda in enumerator in template. 3571 * pt.c (bt_instantiate_type_proc): Don't assume 3572 CLASSTYPE_TEMPLATE_INFO is non-null. 3573 35742018-04-05 Ville Voutilainen <ville.voutilainen@gmail.com> 3575 3576 Implement P0969 3577 * decl.c (find_decomp_class_base): Check accessibility instead 3578 of declared access, adjust diagnostic. 3579 35802018-04-05 Ville Voutilainen <ville.voutilainen@gmail.com> 3581 3582 Implement P0961 3583 * decl.c (get_tuple_decomp_init): Check the templatedness 3584 of a member get. 3585 35862018-04-05 Jason Merrill <jason@redhat.com> 3587 3588 PR c++/85200 - ICE with constexpr if in generic lambda. 3589 * pt.c (extract_locals_r): Don't record the local specs of variables 3590 declared within the pattern. 3591 35922018-04-05 Alexandre Oliva <aoliva@redhat.com> 3593 3594 PR c++/84979 3595 * pt.c (check_auto_in_tmpl_args): New. 3596 (tsubst_qualified_id): Use it to reject template args 3597 referencing auto for non-type templates. 3598 * parser.c (cp_parser_template_id): Likewise. 3599 * cp-tree.h (check_auto_in_tmpl_args): Declare. 3600 * typeck2.c (build_functional_cast): Report correct location 3601 for invalid use of auto. 3602 36032018-04-04 Jason Merrill <jason@redhat.com> 3604 3605 PR c++/85215 - ICE with copy-init from conversion. 3606 * call.c (merge_conversion_sequences): Fix type of direct binding 3607 sequence. 3608 3609 PR c++/84938 - ICE with division by ~-1. 3610 * call.c (set_up_extended_ref_temp): Call cp_fully_fold. 3611 3612 PR c++/84936 - ICE with unexpanded pack in mem-initializer. 3613 * parser.c (cp_parser_mem_initializer_list): Call 3614 check_for_bare_parameter_packs. 3615 36162018-04-04 Jakub Jelinek <jakub@redhat.com> 3617 3618 PR inline-asm/85172 3619 * constexpr.c (cxx_eval_builtin_function_call): For calls to 3620 builtin_valid_in_constant_expr_p functions, don't call 3621 cxx_eval_constant_expression if argument is not 3622 potential_constant_expression. 3623 3624 PR c++/85146 3625 * cp-tree.h (calculate_bases, calculate_direct_bases): Add complain 3626 argument. 3627 * semantics.c (calculate_bases): Add complain argument. Use 3628 complete_type_or_maybe_complain instead of just complete_type and 3629 return an empty vector if it fails. Move make_tree_vector () call 3630 after early return. Formatting fixes. 3631 (calculate_direct_bases): Likewise. Call release_tree_vector at the 3632 end. 3633 (dfs_calculate_bases_post, calculate_bases_helper): Formatting fixes. 3634 * pt.c (tsubst_pack_expansion): Adjust calculate_bases and 3635 calculate_direct_bases callers, formatting fixes. 3636 36372018-04-04 Jason Merrill <jason@redhat.com> 3638 3639 PR c++/85006 - -fconcepts ICE with A<auto...> return type 3640 * pt.c (tsubst_pack_expansion): Allow unsubstituted auto pack. 3641 3642 PR c++/85200 - ICE with constexpr if in generic lambda. 3643 * tree.c (cp_walk_subtrees): Walk into DECL_EXPR in templates. 3644 3645 PR c++/84221 - bogus -Wunused with attribute and template. 3646 * decl2.c (is_late_template_attribute): Handle unused and used 3647 normally on non-TYPE_DECL. 3648 3649 PR c++/85135 - ICE with omitted template arguments. 3650 * decl.c (grokdeclarator): Catch deduced class type in trailing 3651 return type. 3652 3653 PR c++/85133 - ICE with missing concept initializer. 3654 * decl.c (cp_finish_decl): If a concept initializer is missing, use 3655 true. 3656 3657 PR c++/85118 - wrong error with generic lambda and std::bind. 3658 * call.c (add_template_conv_candidate): Disable if there are any 3659 call operators. 3660 3661 PR c++/85141 - ICE with compound assignment and static member fn. 3662 * typeck.c (cp_build_modify_expr): Call decay_conversion for RHS of 3663 compound assignment. 3664 3665 PR c++/85148 - ICE with 'this' in array NSDMI. 3666 * tree.c (replace_placeholders_r): Use handled_component_p. 3667 36682018-04-04 Ville Voutilainen <ville.voutilainen@gmail.com> 3669 3670 PR c++/65923 3671 * decl.c (grokfndecl): Handle standard UDL diagnostics here.. 3672 * parser.c (cp_parser_unqualified_id): ..not here. 3673 36742018-04-04 Alexandre Oliva <aoliva@redhat.com> 3675 3676 PR c++/84943 3677 * typeck.c (cp_build_addr_expr_1): Mark FUNCTION_DECL as 3678 used. 3679 * decl2.c (mark_used): Return without effects if tf_conv. 3680 36812018-04-03 Jason Merrill <jason@redhat.com> 3682 3683 PR c++/85092 - C++17 ICE with unused list constructor. 3684 * call.c (conv_binds_ref_to_prvalue): Also count ck_identity 3685 from a TARGET_EXPR. 3686 3687 PR c++/85113 - ICE with constexpr and __builtin_constant_p. 3688 * constexpr.c (cxx_eval_builtin_function_call): Only defer 3689 __builtin_constant_p if ctx->quiet. 3690 36912018-04-03 Paolo Carlini <paolo.carlini@oracle.com> 3692 3693 PR c++/84768 3694 * pt.c (rewrite_template_parm): If the first argument is 3695 error_mark_node return it immediately. 3696 (build_deduction_guide): Check the return value of the 3697 latter for error_mark_node. 3698 (do_class_deduction): Check the return value of the latter. 3699 37002018-04-03 Jason Merrill <jason@redhat.com> 3701 3702 * semantics.c (finish_if_stmt_cond): Use 3703 instantiation_dependent_expression_p. 3704 3705 PR c++/85149 - generic lambda and constexpr if. 3706 * pt.c (build_extra_args, add_extra_args): Split from 3707 tsubst_pack_expansion. 3708 (tsubst_expr) [IF_STMT]: Use them. 3709 * cp-tree.h (IF_STMT_EXTRA_ARGS): New. 3710 3711 * typeck.c (merge_types): Limit matching attribute shortcut to 3712 the default case. 3713 37142018-04-03 Jakub Jelinek <jakub@redhat.com> 3715 3716 PR c++/85147 3717 * pt.c (fixed_parameter_pack_p_1): Punt if parm is error_mark_node. 3718 3719 PR c++/85140 3720 * name-lookup.c (handle_namespace_attrs): Return early if attributes 3721 is error_mark_node. 3722 3723 PR c++/85134 3724 * decl.c (cp_finish_decl): If ensure_literal_type_for_constexpr_object 3725 fails, after clearing DECL_DECLARED_CONSTEXPR_P don't return early, 3726 instead for static data members clear init and set DECL_EXTERNAL. 3727 37282018-04-02 Jason Merrill <jason@redhat.com> 3729 3730 PR c++/64095 - auto... parameter pack. 3731 * parser.c (cp_parser_parameter_declaration): Handle turning autos 3732 into packs here. 3733 (cp_parser_parameter_declaration_list): Not here. 3734 37352018-03-31 Alexandre Oliva <aoliva@redhat.com> 3736 3737 PR c++/85027 3738 * class.c (instantiate_type): Peel off SAVE_EXPR before 3739 BASELINK. 3740 37412018-03-30 Jason Merrill <jason@redhat.com> 3742 3743 * typeck2.c (process_init_constructor_record): Use 3744 init_list_type_node for the CONSTRUCTOR around an anonymous union 3745 designated initializer. 3746 37472018-03-30 Jakub Jelinek <jakub@redhat.com> 3748 3749 PR c++/84791 3750 * semantics.c (finish_omp_reduction_clause): If 3751 OMP_CLAUSE_REDUCTION_PLACEHOLDER is error_mark_node, return true 3752 even if processing_template_decl. 3753 37542018-03-29 David Malcolm <dmalcolm@redhat.com> 3755 3756 PR c++/84269 3757 * name-lookup.c (get_std_name_hint): Add names from <memory>, 3758 <tuple>, and <utility>. 3759 37602018-03-29 Jason Merrill <jason@redhat.com> 3761 3762 PR c++/85093 - too many template args with pack expansion. 3763 * pt.c (coerce_template_parms): Keep pack expansion args that will 3764 need to be empty. 3765 37662018-03-29 Jason Merrill <jason@redhat.com> 3767 3768 * pt.c (build_non_dependent_expr): Propagate expr location. 3769 37702018-03-27 Jason Merrill <jason@redhat.com> 3771 3772 PR c++/85060 - wrong-code with call to base member in template. 3773 * search.c (any_dependent_bases_p): Check uses_template_parms 3774 rather than processing_template_decl. 3775 37762018-03-29 David Malcolm <dmalcolm@redhat.com> 3777 3778 PR c++/85110 3779 * typeck.c (convert_for_assignment): When complaining due to 3780 conversions for an argument, attempt to use the location of the 3781 argument. 3782 37832018-03-28 Paolo Carlini <paolo.carlini@oracle.com> 3784 3785 PR c++/85028 3786 * pt.c (tsubst_default_argument): Early return if the type of the 3787 parameter is erroneous. 3788 37892018-03-28 Alexandre Oliva <aoliva@redhat.com> 3790 3791 PR c++/84973 3792 * decl2.c (note_vague_linkage_fn): Don't defer uninstantiated 3793 templates. 3794 3795 PR c++/84968 3796 * tree.c (strip_typedefs_expr): Reject STATEMENT_LISTs. 3797 37982018-03-27 Paolo Carlini <paolo.carlini@oracle.com> 3799 3800 PR c++/85067 3801 * method.c (defaulted_late_check): Partially revert r253321 changes, 3802 do not early return upon error. 3803 38042018-03-27 Jakub Jelinek <jakub@redhat.com> 3805 3806 PR c++/85077 3807 * cp-gimplify.c (cp_fold) <case CONSTRUCTOR>: For ctors with vector 3808 type call fold to generate VECTOR_CSTs when possible. 3809 3810 PR c++/85076 3811 * tree.c (cp_build_reference_type): If to_type is error_mark_node, 3812 return it right away. 3813 38142018-03-27 Volker Reichelt <v.reichelt@netcologne.de> 3815 3816 * search.c (check_final_overrider): Use inform instead of error 3817 for the diagnostics of the overridden functions. Tweak wording. 3818 38192018-03-27 Jakub Jelinek <jakub@redhat.com> 3820 3821 PR c++/85068 3822 * class.c (update_vtable_entry_for_fn): Don't ICE if base_binfo 3823 is NULL. Assert if thunk_binfo is NULL then errorcount is non-zero. 3824 38252018-03-27 Paolo Carlini <paolo.carlini@oracle.com> 3826 Jason Merrill <jason@redhat.com> 3827 3828 PR c++/84632 3829 * init.c (build_aggr_init): When initializing from array, 3830 reject anything but CONSTRUCTORs and TARGET_EXPRs. 3831 (build_vec_init): Handle separately ARRAY_TYPEs. 3832 38332018-03-26 Jason Merrill <jason@redhat.com> 3834 3835 PR c++/85062 - ICE with alignas in wrong place. 3836 * decl.c (grokdeclarator): Ignore attributes on type-specifiers 3837 here. 3838 3839 PR c++/85049 - ICE with __integer_pack. 3840 * pt.c (unify_pack_expansion): Don't try to deduce generated packs. 3841 * cp-tree.h (TEMPLATE_PARM_P): New. 3842 38432018-03-23 Jason Merrill <jason@redhat.com> 3844 3845 PR c++/78489 - wrong SFINAE behavior. 3846 3847 PR c++/84489 3848 * pt.c (type_unification_real): Don't defer substitution failure. 3849 38502018-03-23 Jakub Jelinek <jakub@redhat.com> 3851 3852 PR c++/85015 3853 * decl.c (compute_array_index_type): Set osize to mark_rvalue_use 3854 result. 3855 3856 PR c++/84942 3857 * pt.c (tsubst_copy_and_build) <case FIX_TRUNC_EXPR>: Replace 3858 cp_build_unary_op call with gcc_unreachable (). 3859 38602018-03-23 Marek Polacek <polacek@redhat.com> 3861 3862 PR c++/85045 3863 * cxx-pretty-print.c (cxx_pretty_printer::multiplicative_expression): 3864 Handle EXACT_DIV_EXPR and RDIV_EXPR. Tweak condition. 3865 (cxx_pretty_printer::expression): Handle EXACT_DIV_EXPR and RDIV_EXPR. 3866 38672018-03-23 Ville Voutilainen <ville.voutilainen@gmail.com> 3868 3869 Implement P0962 3870 * parser.c (cp_parser_perform_range_for_lookup): Change 3871 the condition for deciding whether to use members. 3872 38732018-03-23 Marek Polacek <polacek@redhat.com> 3874 3875 PR c++/85033 3876 * semantics.c (finish_offsetof): Don't allow CONST_DECLs. 3877 38782018-03-23 Alexandre Oliva <aoliva@redhat.com> 3879 3880 PR c++/71251 3881 * parser.c (cp_parser_alias_declaration): Call 3882 parser_check_template_parameters. 3883 3884 PR c++/84789 3885 * pt.c (resolve_typename_type): Drop assert that stopped 3886 simplification to template-independent types. Add assert to 3887 verify the initial scope is template dependent. 3888 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): 3889 Reparse the id expression as a type-name, not a declarator. 3890 3891 PR c++/84729 3892 * init.c (build_vec_init): Error at parenthesized array init. 3893 3894 PR c++/84610 3895 PR c++/84642 3896 PR c++/84942 3897 * cp-tree.h (temp_override): New template class, generalizing 3898 a cleanup that was only used... 3899 * parser.c (cp_parser_parameter_declaration_clause): 3900 ... here for auto_is_implicit_function_template_parm_p. 3901 (cp_parser_gnu_attributes_opt): Use it here as well. 3902 (cp_parser_std_attribute): Likewise. 3903 39042018-03-22 Marek Polacek <polacek@redhat.com> 3905 3906 PR c++/84854 3907 * semantics.c (finish_if_stmt_cond): Check if the type of the condition 3908 is boolean. 3909 39102018-03-21 Jason Merrill <jason@redhat.com> 3911 3912 PR c++/81311 - wrong C++17 overload resolution. 3913 * call.c (build_user_type_conversion_1): Remove C++17 code. 3914 (conv_binds_ref_to_prvalue): New. 3915 (build_over_call): Handle C++17 copy elision. 3916 (build_special_member_call): Only do C++17 copy elision here if the 3917 argument is already the right type. 3918 39192018-03-21 Alexandre Oliva <aoliva@redhat.com> 3920 3921 PR c++/71965 3922 * init.c (build_vec_init): Silence error, former sorry, 3923 without tf_error. 3924 3925 PR c++/84610 3926 PR c++/84642 3927 * parser.c (abort_fully_implicit_template_p): New. 3928 (cp_parser_skip_to_end_of_statement): Use it. 3929 (cp_parser_skip_to_end_of_block_or_statement): Likewise. 3930 (finish_fully_implicit_template_p): Clear 3931 implicit_template_parms and implicit_template_scope. 3932 39332018-03-21 Paolo Carlini <paolo.carlini@oracle.com> 3934 3935 PR c++/84972 3936 * decl.c (maybe_deduce_size_from_array_init): Set TREE_TYPE to 3937 error_mark_node when check_array_designated_initializer fails. 3938 39392018-03-21 Jakub Jelinek <jakub@redhat.com> 3940 3941 PR c++/84961 3942 * cp-tree.h (genericize_compound_lvalue): Declare. 3943 * typeck.c (genericize_compound_lvalue): New function. 3944 (unary_complex_lvalue, cp_build_modify_expr): Use it. 3945 * semantics.c (finish_asm_stmt): Replace MODIFY_EXPR, PREINCREMENT_EXPR 3946 and PREDECREMENT_EXPR in output and "m" constrained input operands with 3947 COMPOUND_EXPR. Call cxx_mark_addressable on the rightmost 3948 COMPOUND_EXPR operand. 3949 39502018-03-21 Nathan Sidwell <nathan@acm.org> 3951 3952 PR c++/85008 3953 * tree.c (decl_linkage): Use DECL_CLONED_FUNCTION_P. 3954 * decl2.c (vague_linkage_p): Likewise. 3955 39562018-03-21 David Malcolm <dmalcolm@redhat.com> 3957 3958 PR c++/84994 3959 * constexpr.c (constexpr_fn_retval): Make non-"static". 3960 * cp-tree.h (constexpr_fn_retval): New decl. 3961 * search.c (direct_accessor_p): Update leading comment. 3962 (reference_accessor_p): Likewise. 3963 (field_accessor_p): Replace check that function body is a 3964 RETURN_EXPR with a call to constexpr_fn_retval. Fix 3965 indentation of "field_type" decl. 3966 39672018-03-21 Nathan Sidwell <nathan@acm.org> 3968 3969 PR c++/84804 3970 * name-lookup.c (do_pushtag): Permit lambdas to be pushed into 3971 complete classes. 3972 39732018-03-21 Martin Sebor <msebor@redhat.com> 3974 3975 PR c++/84850 3976 * call.c (first_non_public_field): New template and function. 3977 (first_non_trivial_field): New function. 3978 (maybe_warn_class_memaccess): Call them. 3979 39802018-03-21 David Malcolm <dmalcolm@redhat.com> 3981 3982 PR c++/84892 3983 * search.c (field_accessor_p): Use class_of_this_parm rather than 3984 type_of_this_parm, to check that "this" is a "const T *", rather 3985 than a "T *const". 3986 39872018-03-21 Nathan Sidwell <nathan@acm.org> 3988 3989 * class.c (finish_struct_anon_r): Refactor, deprecate anything 3990 other than public non-static data members. 3991 * parser.c (cp_parser_init_declarator): Deprecate attributes after 3992 parenthesized initializer. 3993 3994 PR c++/84836 3995 * name-lookup.c (update_binding): Correct logic for local binding 3996 update. 3997 39982018-03-21 Marek Polacek <polacek@redhat.com> 3999 4000 PR c++/71638, ICE with NSDMI and reference. 4001 * constexpr.c (cxx_eval_bare_aggregate): Update constructor's flags 4002 even when we replace an element. 4003 40042018-03-20 Marek Polacek <polacek@redhat.com> 4005 4006 PR c++/84978, ICE with NRVO. 4007 * constexpr.c (cxx_eval_constant_expression): Handle the case when 4008 a RESULT_DECL isn't in the hash map. 4009 40102018-03-20 Jason Merrill <jason@redhat.com> 4011 4012 PR c++/84978, ICE with NRVO. 4013 * cvt.c (cp_get_fndecl_from_callee): Add fold parameter. 4014 (cp_get_callee_fndecl_nofold): New. 4015 * cp-gimplify.c (cp_genericize_r): Use it instead. 4016 * call.c (check_self_delegation): Likewise. 4017 40182018-03-20 Nathan Sidwell <nathan@acm.org> 4019 4020 PR c++/84962 4021 * name-lookup.c (pushdecl_class_level): Push anon-struct's 4022 member_vec, if there is one. 4023 4024 PR c++/84970 4025 * cp-tree.h (lookup_list_keep): Declare. 4026 * tree.c (lookup_list_keep): New, broken out of ... 4027 (build_min): ... here. Call it. 4028 * decl.c (cp_finish_decl): Call lookup_list_keep. 4029 40302018-03-19 Jason Merrill <jason@redhat.com> 4031 4032 PR c++/84937 - ICE with class deduction and auto. 4033 * pt.c (rewrite_template_parm): Fix auto handling. 4034 40352018-03-19 Marek Polacek <polacek@redhat.com> 4036 4037 PR c++/84925 4038 * pt.c (enclosing_instantiation_of): Check if fn is null. 4039 4040 PR c++/84927 4041 * constexpr.c (cxx_eval_bare_aggregate): Update constructor's flags 4042 as we evaluate the elements. 4043 (cxx_eval_constant_expression): Verify constructor's flags 4044 unconditionally. 4045 40462018-03-19 Jason Merrill <jason@redhat.com> 4047 4048 PR c++/71834 - template-id with too few arguments. 4049 * pt.c (coerce_template_parms): Check fixed_parameter_pack_p. 4050 40512018-03-19 Nathan Sidwell <nathan@acm.org> 4052 4053 PR c++/84835 4054 * lambda.c (maybe_add_lambda_conv_op): Force C++ linkage. 4055 * pt.c (build_template_decl): Propagate language linkage. 4056 4057 PR c++/84812 4058 * name-lookup.c (set_local_extern_decl_linkage): Defend against 4059 ambiguous lookups. 4060 40612018-03-16 Jakub Jelinek <jakub@redhat.com> 4062 4063 PR c/84910 4064 * parser.c (cp_parser_lambda_introducer): Remove trailing space from 4065 diagnostics. 4066 * method.c (synthesize_method): Likewise. 4067 * pt.c (convert_nontype_argument): Likewise. 4068 40692018-03-16 Jason Merrill <jason@redhat.com> 4070 4071 PR c++/84720 - ICE with rvalue ref non-type argument. 4072 * pt.c (invalid_nontype_parm_type_p): Prohibit rvalue reference. 4073 (convert_nontype_argument): Revert earlier change. 4074 4075 PR c++/80227 - SFINAE and negative array size. 4076 * decl.c (compute_array_index_type): Use 4077 build_converted_constant_expr and valid_constant_size_p. 4078 4079 PR c++/84906 - silent wrong code with ambiguous conversion. 4080 * call.c (build_user_type_conversion_1): Set need_temporary_p on 4081 ambiguous conversion. 4082 (convert_like_real): Check it. 4083 4084 PR c++/83937 - wrong C++17 handling of init-list ctor argument. 4085 * call.c (build_special_member_call): Don't convert an init-list 4086 argument directly to the class type. 4087 40882018-03-16 Jakub Jelinek <jakub@redhat.com> 4089 4090 PR c++/79937 4091 PR c++/82410 4092 * cp-tree.h (CONSTRUCTOR_PLACEHOLDER_BOUNDARY): Define. 4093 (find_placeholder): Declare. 4094 * tree.c (struct replace_placeholders_t): Add exp member. 4095 (replace_placeholders_r): Don't walk into ctors with 4096 CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag set, unless they are equal to 4097 d->exp. Replace PLACEHOLDER_EXPR with unshare_expr (x) rather than x. 4098 (replace_placeholders): Initialize data.exp. 4099 (find_placeholders_r, find_placeholders): New functions. 4100 * typeck2.c (process_init_constructor_record, 4101 process_init_constructor_union): Set CONSTRUCTOR_PLACEHOLDER_BOUNDARY 4102 if adding NSDMI on which find_placeholder returns true. 4103 * call.c (build_over_call): Don't call replace_placeholders here. 4104 * cp-gimplify.c (cp_genericize_r): Set TARGET_EXPR_NO_ELIDE on 4105 TARGET_EXPRs with CONSTRUCTOR_PLACEHOLDER_BOUNDARY set on 4106 TARGET_EXPR_INITIAL. 4107 (cp_fold): Copy over CONSTRUCTOR_PLACEHOLDER_BOUNDARY bit to new 4108 ctor. 4109 41102018-03-16 Jason Merrill <jason@redhat.com> 4111 4112 PR c++/83911 - ICE with multiversioned constructor. 4113 * cp-gimplify.c (cp_genericize_r): Replace versioned function with 4114 dispatchere here. 4115 * call.c (build_over_call): Not here. 4116 41172018-03-16 Jakub Jelinek <jakub@redhat.com> 4118 4119 PR c++/84874 4120 * decl.c (reshape_init_class): Don't assert d->cur->index == field 4121 if d->cur->index is a FIELD_DECL, instead set field to d->cur->index. 4122 41232018-03-15 Jakub Jelinek <jakub@redhat.com> 4124 4125 PR c++/84222 4126 * cp-tree.h (cp_warn_deprecated_use): Declare. 4127 * tree.c (cp_warn_deprecated_use): New function. 4128 * typeck2.c (build_functional_cast): Use it. 4129 * decl.c (grokparms): Likewise. 4130 (grokdeclarator): Likewise. Temporarily push nested class scope 4131 around grokparms call for out of class member definitions. 4132 41332018-03-14 Jason Merrill <jason@redhat.com> 4134 4135 PR c++/84820 - no error for invalid qualified-id. 4136 * parser.c (cp_parser_make_indirect_declarator): Don't wrap 4137 cp_error_declarator. 4138 4139 PR c++/84801 - ICE with unexpanded pack in lambda. 4140 * pt.c (check_for_bare_parameter_packs): Don't return early for a 4141 lambda in non-template context. 4142 4143 PR c++/81236 - auto variable and auto function 4144 * pt.c (tsubst_baselink): Update the type of the BASELINK after 4145 mark_used. 4146 41472018-03-14 Jason Merrill <jason@redhat.com> 4148 4149 PR c++/83916 - ICE with template template parameters. 4150 * pt.c (convert_template_argument): Don't substitute into type of 4151 non-type parameter if we don't have enough arg levels. 4152 (unify): Likewise. 4153 41542018-03-14 Marek Polacek <polacek@redhat.com> 4155 4156 PR c++/84596 4157 * semantics.c (finish_static_assert): Check 4158 instantiation_dependent_expression_p instead of 4159 {type,value}_dependent_expression_p. 4160 41612018-03-13 Paolo Carlini <paolo.carlini@oracle.com> 4162 Jason Merrill <jason@redhat.com> 4163 4164 PR c++/82336 - link error with list-init default argument. 4165 * decl.c (check_default_argument): Unshare an initializer list. 4166 41672018-03-13 Jakub Jelinek <jakub@redhat.com> 4168 4169 PR c++/84843 4170 * decl.c (duplicate_decls): For redefinition of built-in, use error 4171 and return error_mark_node. For redeclaration, return error_mark_node 4172 rather than olddecl if !flag_permissive. 4173 41742018-03-13 Jason Merrill <jason@redhat.com> 4175 4176 PR c++/82565 - ICE with concepts and generic lambda. 4177 * pt.c (instantiate_decl): Clear fn_context for lambdas. 4178 41792018-03-13 Jason Merrill <jason@redhat.com> 4180 4181 PR c++/84720 - ICE with rvalue ref non-type argument. 4182 * pt.c (convert_nontype_argument): Handle rvalue references. 4183 4184 PR c++/84839 - ICE with decltype of parameter pack. 4185 * pt.c (tsubst_pack_expansion): Set cp_unevaluated_operand while 4186 instantiating dummy parms. 4187 4188 * parser.c (cp_parser_simple_type_specifier): Pedwarn about auto 4189 parameter even without -Wpedantic. 4190 4191 PR c++/84798 - ICE with auto in abstract function declarator. 4192 * parser.c (cp_parser_parameter_declaration_clause): Check 4193 parser->default_arg_ok_p. 4194 41952018-03-13 Jakub Jelinek <jakub@redhat.com> 4196 4197 PR c++/84808 4198 * constexpr.c (find_array_ctor_elt): Don't use elt reference after 4199 first potential CONSTRUCTOR_ELTS reallocation. Convert dindex to 4200 sizetype. Formatting fixes. 4201 42022018-03-12 Jason Merrill <jason@redhat.com> 4203 4204 PR c++/84355 - ICE with deduction for member class template. 4205 * pt.c (tsubst) [TEMPLATE_TYPE_PARM]: Always substitute into 4206 CLASS_PLACEHOLDER_TEMPLATE. 4207 4208 PR c++/84802 - ICE capturing uninstantiated class. 4209 * lambda.c (build_capture_proxy): Call complete_type. 4210 42112018-03-09 Jason Merrill <jason@redhat.com> 4212 4213 PR c++/84770 - ICE with typedef and parameter pack. 4214 * pt.c (verify_unstripped_args_1): Split out from 4215 verify_unstripped_args. 4216 4217 PR c++/84785 - ICE with alias template and default targs. 4218 * pt.c (type_unification_real): Set processing_template_decl if 4219 saw_undeduced == 1. 4220 4221 PR c++/84752 - ICE with capture of constexpr array. 4222 * call.c (standard_conversion): Set rvaluedness_matches_p on the 4223 identity conversion under ck_lvalue. 4224 42252018-03-09 Jason Merrill <jason@redhat.com> 4226 Paolo Carlini <paolo.carlini@oracle.com> 4227 4228 PR c++/71169 4229 PR c++/71832 4230 * pt.c (any_erroneous_template_args_p): New. 4231 * cp-tree.h (any_erroneous_template_args_p): Declare it. 4232 * parser.c (cp_parser_class_specifier_1): Use it. 4233 42342018-03-09 Jason Merrill <jason@redhat.com> 4235 4236 PR c++/84726 - unnecessary capture of constant vars. 4237 * cp-tree.h (LAMBDA_CAPTURE_EXPLICIT_P) 4238 (LAMBDA_EXPR_CAPTURE_OPTIMIZED): New. 4239 * expr.c (mark_use): Set LAMBDA_EXPR_CAPTURE_OPTIMIZED. 4240 * lambda.c (is_constant_capture_proxy) 4241 (current_lambda_expr, var_to_maybe_prune, mark_const_cap_r) 4242 (prune_lambda_captures): New. 4243 (finish_lambda_function): Call prune_lambda_captures. 4244 42452018-03-09 Jason Merrill <jason@redhat.com> 4246 Jakub Jelinek <jakub@redhat.com> 4247 4248 PR c++/84076 4249 * call.c (convert_arg_to_ellipsis): Instead of cp_build_addr_expr 4250 build ADDR_EXPR with REFERENCE_TYPE. 4251 (build_over_call): For purposes of check_function_arguments, if 4252 argarray[j] is ADDR_EXPR with REFERENCE_TYPE created above, use 4253 its operand rather than the argument itself. 4254 42552018-03-09 Jakub Jelinek <jakub@redhat.com> 4256 4257 PR c++/84724 4258 * decl.c (duplicate_decls): Don't override __* prefixed builtins 4259 except for __[^b]*_chk, instead issue permerror and for -fpermissive 4260 also a note and return olddecl. 4261 42622018-03-09 Nathan Sidwell <nathan@acm.org> 4263 4264 PR c++/84733 4265 * name-lookup.c (do_pushdecl_with_scope): Only clear 4266 current_function_decl when pushing a non-class (i.e. namespace) 4267 scope. 4268 42692018-03-08 Jason Merrill <jason@redhat.com> 4270 Jakub Jelinek <jakub@redhat.com> 4271 4272 PR c++/80598 4273 * call.c (build_over_call): In templates set TREE_USED (first_fn) when 4274 not calling mark_used for the benefit of -Wunused-function warning. 4275 42762018-03-06 Jason Merrill <jason@redhat.com> 4277 4278 * lambda.c (is_capture_proxy_with_ref): Remove. 4279 * constexpr.c, expr.c, cp-tree.h, semantics.c: Adjust. 4280 42812018-03-06 Marek Polacek <polacek@redhat.com> 4282 4283 PR c++/84684 4284 * constexpr.c (cxx_bind_parameters_in_call): Unshare evaluated 4285 arguments. 4286 42872018-03-06 Alexandre Oliva <aoliva@redhat.com> 4288 4289 PR c++/84231 4290 * tree.c (lvalue_kind): Use presence/absence of REFERENCE_TYPE 4291 only while processing template decls. 4292 * typeck.c (build_x_conditional_expr): Move wrapping of 4293 reference type around type... 4294 * call.c (build_conditional_expr_1): ... here. Rename 4295 is_lvalue to is_glvalue. 4296 * parser.c (cp_parser_fold_expression): Catch REFERENCE_REF_P 4297 INDIRECT_REF of COND_EXPR too. 4298 4299 PR c++/84593 4300 * init.c (build_zero_init_1): Zero-initialize references. 4301 4302 PR c++/84492 4303 * semantics.c (finish_stmt_expr_expr): Reject unresolved 4304 overloads used as stmt expr values. 4305 43062018-03-05 Jason Merrill <jason@redhat.com> 4307 4308 PR c++/84708 - ICE with lambda in local class NSDMI. 4309 * lambda.c (lambda_expr_this_capture): Handle local class NSDMI 4310 context. 4311 43122018-03-05 Jakub Jelinek <jakub@redhat.com> 4313 4314 PR c++/84684 4315 * constexpr.c (constexpr_call_hasher::equal): Return false if 4316 lhs->hash != rhs->hash. Change return 1 to return true and 4317 return 0 to return false. 4318 43192018-03-05 Nathan Sidwell <nathan@acm.org> 4320 4321 PR c++/84702 4322 * pt.c (process_template_arg): Mark lookup_keep on a default arg. 4323 43242018-03-05 Marek Polacek <polacek@redhat.com> 4325 4326 PR c++/84707 4327 * decl.c (duplicate_decls): Check DECL_NAME before accessing 4328 UDLIT_OPER_P. 4329 43302018-03-05 Nathan Sidwell <nathan@acm.org> 4331 4332 PR c++/84694 4333 * friend.c (do_friend): Restore check for identifier_p inside 4334 TEMPLATE_ID_EXPR. 4335 43362018-03-05 Paolo Carlini <paolo.carlini@oracle.com> 4337 4338 PR c++/84618 4339 * parser.c (cp_parser_lambda_introducer): Reject any capture not 4340 involving a VAR_DECL or a PARM_DECL. 4341 43422018-03-05 Pádraig Brady <P@draigBrady.com> 4343 Jason Merrill <jason@redhat.com> 4344 Nathan Sidwell <nathan@acm.org> 4345 4346 PR c++/84497 4347 * decl2.c (get_tls_init_fn): Check TYPE_HAS_TRIVIAL_DFLT too. 4348 43492018-03-03 Jason Merrill <jason@redhat.com> 4350 4351 PR c++/84686 - missing volatile loads. 4352 * cvt.c (convert_to_void): Call maybe_undo_parenthesized_ref. 4353 43542018-03-03 Paolo Carlini <paolo.carlini@oracle.com> 4355 4356 PR c++/71464 4357 * optimize.c (maybe_thunk_body): Bail out immediately if either 4358 fns[0] or fns[1] is null. 4359 43602018-03-02 Marek Polacek <polacek@redhat.com> 4361 4362 PR c++/84578 4363 * constexpr.c (get_array_or_vector_nelts): New. 4364 (cxx_eval_array_reference): Use it. 4365 (cxx_eval_vec_init_1): Likewise. 4366 (cxx_eval_store_expression): Likewise. 4367 43682018-03-02 Jason Merrill <jason@redhat.com> 4369 4370 * semantics.c (force_paren_expr): Remove redundant test. 4371 43722018-03-02 Marek Polacek <polacek@redhat.com> 4373 4374 PR c++/84663 4375 * decl.c (cp_complete_array_type): Check error_mark_node. 4376 4377 PR c++/84664 4378 * typeck.c (cp_perform_integral_promotions): Check the result of 4379 mark_rvalue_use. 4380 43812018-03-02 Jakub Jelinek <jakub@redhat.com> 4382 4383 PR c++/84662 4384 * pt.c (tsubst_copy_and_build) <case TEMPLATE_ID_EXPR>: Use 4385 RETURN instead of return. 4386 <case POINTER_PLUS_EXPR>: Likewise. 4387 <case CONVERT_EXPR>: If op0 is error_mark_node, just return 4388 it instead of wrapping it into CONVERT_EXPR. 4389 43902018-03-02 Jason Merrill <jason@redhat.com> 4391 4392 Fix MIPS16 ICE. 4393 * pt.c (type_dependent_expression_p): Check DECL_LANG_SPECIFIC. 4394 43952018-03-02 Marek Polacek <polacek@redhat.com> 4396 4397 PR c++/84590 4398 * cp-gimplify.c (cp_fully_fold): Unwrap TARGET_EXPR or a CONSTRUCTOR 4399 wrapped in VIEW_CONVERT_EXPR. 4400 44012018-03-01 Martin Sebor <msebor@redhat.com> 4402 4403 PR c++/84294 4404 * decl.c (check_redeclaration_no_default_args): Merge attributes 4405 specified on redeclarations of the same function template. 4406 Remove dead code. 4407 44082018-03-01 Marek Polacek <polacek@redhat.com> 4409 Jason Merrill <jason@redhat.com> 4410 4411 PR c++/84582 4412 * semantics.c (force_paren_expr): Create a PAREN_EXPR when in 4413 a template. 4414 (maybe_undo_parenthesized_ref): Unwrap PAREN_EXPR. 4415 * typeck2.c (store_init_value): Call fold_non_dependent_expr instead 4416 of instantiate_non_dependent_expr. 4417 * tree.c (lvalue_kind): Handle PAREN_EXPR like NON_DEPENDENT_EXPR. 4418 44192018-03-01 Nathan Sidwell <nathan@acm.org> 4420 4421 PR c++/84434 4422 * name-lookup.c (member_vec_dedup): Remove manually peeled 4423 iteration. Ignore dependent ctor inheritance. 4424 44252018-03-01 Jason Merrill <jason@redhat.com> 4426 4427 PR c++/71569 - decltype of template. 4428 * parser.c (cp_parser_decltype_expr): Handle missing template args. 4429 44302018-03-01 Marek Polacek <polacek@redhat.com> 4431 4432 PR c++/84596 4433 * constexpr.c (require_rvalue_constant_expression): New function. 4434 * cp-tree.h: Declare it. 4435 * semantics.c (finish_static_assert): Use it instead of 4436 require_potential_rvalue_constant_expression. 4437 44382018-03-01 Jason Merrill <jason@redhat.com> 4439 Alexandre Oliva <aoliva@redhat.com> 4440 4441 PR c++/71569 - ICE with redundant args on member variable template. 4442 * decl.c (start_decl): Handle partial specialization of member 4443 variable template. 4444 * pt.c (determine_specialization): Allow partial specialization 4445 of member variable template without specializing enclosing class. 4446 (process_partial_specialization): Improve error message. 4447 44482018-02-28 Jason Merrill <jason@redhat.com> 4449 4450 PR c++/71784 - ICE with ref-qualifier and explicit specialization. 4451 * pt.c (determine_specialization): Check ref-qualifier. 4452 44532018-02-28 Jakub Jelinek <jakub@redhat.com> 4454 4455 PR c++/84609 4456 * parser.c (cp_parser_attributes_opt): Formatting fix. 4457 (cp_parser_skip_balanced_tokens, cp_parser_skip_gnu_attributes_opt, 4458 cp_parser_skip_std_attribute_spec_seq, cp_parser_skip_attributes_opt): 4459 New functions. 4460 (cp_parser_member_declaration): Use cp_parser_skip_attributes_opt 4461 instead of tentative parse to peek over optional attribute tokens 4462 to check for CPP_COLON after them. 4463 4464 PR c++/83871 4465 PR c++/83503 4466 * pt.c (INCLUDE_STRING): Remove define. 4467 (warn_spec_missing_attributes): Use pretty_printer instead of 4468 std::string. Fix up inform call so that the list of attributes 4469 is in %s argument. 4470 44712018-02-28 Martin Sebor <msebor@redhat.com> 4472 4473 PR testsuite/84617 4474 * decl.c (duplicate_decls): Fully merge attributes const, pure, 4475 and malloc. 4476 44772018-02-28 Nathan Sidwell <nathan@acm.org> 4478 4479 PR c++/84602 4480 * name-lookup.h (search_anon_aggr): Add defaulted WANT_TYPE arg. 4481 * name-lookup.c (fields_linear_search): Look in an anon-aggr 4482 regardless of want_type. 4483 (search_anon_aggr): Just use get_class_binding_direct. 4484 44852018-02-28 Jakub Jelinek <jakub@redhat.com> 4486 4487 * decl.c (cp_finish_decomp): Don't adjust eltscnt when calling 4488 inform_n. 4489 44902018-02-27 Martin Sebor <msebor@redhat.com> 4491 4492 * pt.c: Avoid including <string> directly. 4493 44942018-02-27 Martin Sebor <msebor@redhat.com> 4495 4496 PR c++/83871 4497 PR c++/83503 4498 * cp-tree.h (warn_spec_missing_attributes): New function. 4499 ((check_explicit_specialization): Add an argument. Call the above 4500 function. 4501 * decl.c (duplicate_decls): Avoid applying primary function template's 4502 attributes to its explicit specializations. 4503 cp/pt.c (warn_spec_missing_attributes): Define. 4504 45052018-02-27 Håkon Sandsmark <hsandsmark@gmail.com> 4506 4507 PR c++/71546 - lambda init-capture with qualified-id. 4508 * parser.c (cp_parser_lambda_introducer): Clear scope after 4509 each lambda capture. 4510 45112018-02-27 Nathan Sidwell <nathan@acm.org> 4512 4513 PR c++/84426 4514 * name-lookup.h (get_member_slot): Rename ... 4515 (find_member_slot): ... here. 4516 (add_member_slot): New. 4517 * name-lookup.c (member_vec_linear_search): No need to check for 4518 NULL slot. 4519 (get_member_slot): Rename ... 4520 (find_member_slot): ... here. Don't add slot for incomplete class. 4521 (add_member_slot): New. 4522 * class.c (add_method): Adjust get_member_slot rename. Bail out 4523 if push_class_level_binding fails. Create slot and grok 4524 properties once we're committed to insertion. 4525 45262018-02-27 Jason Merrill <jason@redhat.com> 4527 4528 PR c++/84489 - dependent default template argument 4529 * pt.c (type_unification_real): Handle early substitution failure. 4530 45312018-02-26 Jason Merrill <jason@redhat.com> 4532 4533 PR c++/84560 - ICE capturing multi-dimensional VLA. 4534 * tree.c (array_of_runtime_bound_p): False if the element is 4535 variably-modified. 4536 4537 PR c++/84441 - ICE with base initialized from ?: 4538 * call.c (unsafe_copy_elision_p): Handle COND_EXPR. 4539 4540 PR c++/84520 - ICE with generic lambda in NSDMI. 4541 * lambda.c (lambda_expr_this_capture): Don't look for fake NSDMI 4542 'this' in a generic lambda instantiation. 4543 4544 PR c++/84559 - ICE with constexpr VLA. 4545 * constexpr.c (ensure_literal_type_for_constexpr_object): Check 4546 for constexpr variable with VLA type. 4547 45482018-02-26 Jakub Jelinek <jakub@redhat.com> 4549 4550 PR c++/84558 4551 * constexpr.c (cxx_eval_vec_init_1): For reuse, treat NULL eltinit like 4552 a valid constant initializer. Formatting fixes. 4553 45542018-02-26 Paolo Carlini <paolo.carlini@oracle.com> 4555 4556 PR c++/84540 4557 * pt.c (tsubst_attributes): Handle correctly tsubst_attribute 4558 returning NULL_TREE. 4559 (apply_late_template_attributes): Likewise. 4560 45612018-02-26 Jakub Jelinek <jakub@redhat.com> 4562 4563 PR c++/84557 4564 * parser.c (cp_parser_omp_var_list_no_open): Only call 4565 cp_parser_lookup_name_simple on names satisfying identifier_p. 4566 (cp_parser_oacc_routine): Likewise. 4567 45682018-02-26 Jason Merrill <jason@redhat.com> 4569 4570 PR c++/84551 - ICE with concepts and -g. 4571 * parser.c (add_debug_begin_stmt): Do nothing in a concept. 4572 45732018-02-26 Marek Polacek <polacek@redhat.com> 4574 4575 PR c++/84325 4576 * tree.c (replace_placeholders_r): Only check TREE_CONSTANT on 4577 non-types. 4578 45792018-02-26 Jason Merrill <jason@redhat.com> 4580 4581 PR c++/84447 - ICE with deleted inherited ctor with default arg. 4582 * call.c (build_over_call): Handle deleted functions in one place. 4583 45842018-02-26 Paolo Carlini <paolo.carlini@oracle.com> 4585 4586 PR c++/84533 4587 * decl.c (redeclaration_error_message): Don't try to use 4588 DECL_DECLARED_CONSTEXPR_P on CONST_DECLs. 4589 45902018-02-26 Paolo Carlini <paolo.carlini@oracle.com> 4591 4592 * lambda.c (build_capture_proxy): Define static. 4593 * cp-tree.h (build_capture_proxy): Remove. 4594 45952018-02-26 Marek Polacek <polacek@redhat.com> 4596 4597 PR c++/84537 4598 * name-lookup.c (suggest_alternative_in_explicit_scope): Return false 4599 if name is error node. 4600 46012018-02-25 Jason Merrill <jason@redhat.com> 4602 4603 PR c++/84015 - ICE with class deduction and auto template parm. 4604 * pt.c (rewrite_template_parm): Use tf_partial in first tsubst. 4605 46062018-02-24 Marek Polacek <polacek@redhat.com> 4607 4608 PR c++/83692 4609 * constexpr.c (maybe_constant_init_1): New function. 4610 (maybe_constant_init): Make it a wrapper around maybe_constant_init_1. 4611 (cxx_constant_init): New function. 4612 * cp-tree.h (cxx_constant_init): Declare. 4613 * typeck2.c (store_init_value): Call cxx_constant_init instead of 4614 cxx_constant_value. Move the maybe_constant_init call under an 'else'. 4615 46162018-02-22 Jason Merrill <jason@redhat.com> 4617 4618 PR c++/70468 - ICE with constructor delegation via typedef. 4619 * pt.c (tsubst_initializer_list): Check for other mem-initializers 4620 with constructor delegation. 4621 46222018-02-22 Jason Merrill <jason@redhat.com> 4623 4624 PR c++/84424 - ICE with constexpr and __builtin_shuffle. 4625 * constexpr.c (reduced_constant_expression_p): Handle CONSTRUCTOR of 4626 VECTOR_TYPE. 4627 46282018-02-22 Marek Polacek <polacek@redhat.com> 4629 4630 PR c++/84493 4631 * parser.c (cp_parser_braced_list): Use require_open instead of 4632 consume_open. 4633 46342018-02-21 Jason Merrill <jason@redhat.com> 4635 4636 PR c++/84454 - ICE with pack expansion in signature. 4637 * error.c (find_typenames_r): Also stop on EXPR_PACK_EXPANSION. 4638 46392018-02-20 Siddhesh Poyarekar <siddhesh@sourceware.org> 4640 4641 * cp-objcp-common.c (cxx_block_may_fallthru): Add case for 4642 IF_STMT. 4643 46442018-02-20 Paolo Carlini <paolo.carlini@oracle.com> 4645 4646 PR c++/84446 4647 * parser.c (cp_parser_init_declarator): Don't call start_lambda_scope 4648 on error_mark_node. 4649 46502018-02-20 Jakub Jelinek <jakub@redhat.com> 4651 4652 PR c++/84445 4653 * class.c (fixed_type_or_null) <case CALL_EXPR>: Only test 4654 TREE_HAS_CONSTRUCTOR if instance is not an internal function call. 4655 4656 PR c++/84449 4657 * tree.c (bot_manip): If build_cplus_new or break_out_target_exprs 4658 returns error_mark_node, return it immediately. 4659 (break_out_target_exprs): If cp_walk_tree with bot_manip returns 4660 error_mark_node, return error_mark_node. 4661 4662 PR c++/84455 4663 * pt.c (tsubst_lambda_expr): If not nested, increment temporarily 4664 function_depth to avoid GC during finish_lambda_function. 4665 46662018-02-19 Jason Merrill <jason@redhat.com> 4667 4668 PR c++/84429 - ICE capturing VLA. 4669 * lambda.c (build_capture_proxy): Handle reference refs. 4670 46712018-02-19 Jakub Jelinek <jakub@redhat.com> 4672 4673 PR c++/84448 4674 * parser.c (cp_parser_binary_expression): For no_toplevel_fold_p, if 4675 either operand is error_mark_node, set current.lhs to that instead of 4676 creating a binary op with error_mark_node operands. 4677 4678 PR c++/84430 4679 * constexpr.c (potential_constant_expression_1): Handle OMP_SIMD. 4680 46812018-02-19 Paolo Carlini <paolo.carlini@oracle.com> 4682 4683 PR c++/84348 4684 * decl.c (grokdeclarator): Early return error_mark_node upon 4685 ill-formed friend declaration. 4686 46872018-02-16 Marek Polacek <polacek@redhat.com> 4688 Jakub Jelinek <jakub@redhat.com> 4689 4690 PR c++/84192 4691 * constexpr.c (cxx_eval_constant_expression) <case RETURN_EXPR>: Don't 4692 set *jump_target to anything if jump_target is NULL. 4693 46942018-02-16 Jason Merrill <jason@redhat.com> 4695 4696 PR c++/84151 - unnecessary volatile load with static member. 4697 * call.c (build_new_method_call_1): Avoid loading from a volatile 4698 lvalue used as the object argument for a static member function. 4699 4700 PR c++/81853 - using-directive and constexpr. 4701 * constexpr.c (cxx_eval_constant_expression): Handle USING_STMT. 4702 4703 PR c++/84420 - ICE with structured binding in lambda. 4704 * lambda.c (is_capture_proxy): Check DECL_DECOMPOSITION_P. 4705 4706 PR c++/83835 - C++17 error with constructor ctors. 4707 * call.c (build_special_member_call): Set TARGET_EXPR_DIRECT_INIT_P. 4708 4709 PR c++/82664 - ICE with reference to function template parm. 4710 * pt.c (convert_nontype_argument_function): Avoid obfuscationg 4711 NOP_EXPRs. 4712 4713 PR c++/82764 - C++17 ICE with empty base 4714 * class.c (build_base_field_1): Set DECL_SIZE to zero for empty base. 4715 47162018-02-16 Jason Merrill <jason@redhat.com> 4717 4718 PR c++/84421 - type-dependent if constexpr 4719 * semantics.c (finish_if_stmt_cond): Check type_dependent_expression_p. 4720 47212018-02-16 Nathan Sidwell <nathan@acm.org> 4722 4723 Deprecate -ffriend-injection. 4724 * decl.c (cxx_init_decl_processing): Emit warning on option. 4725 * name-lookup.c (do_pushdecl): Emit warning if we push a visible 4726 friend. 4727 47282018-02-16 Paolo Carlini <paolo.carlini@oracle.com> 4729 4730 PR c++/82468 4731 * decl.c (check_special_function_return_type): Reject template 4732 template parameter in deduction guide. 4733 47342018-02-16 Nathan Sidwell <nathan@acm.org> 4735 4736 PR c++/84375 4737 * name-lookup.c (do_pushdecl): Bail out on bad local friend injection. 4738 47392018-02-15 Jason Merrill <jason@redhat.com> 4740 4741 PR c++/83227 - C++17 ICE with init-list derived-to-base conversion. 4742 * call.c (convert_like_real): Don't use the copy-list-initialization 4743 shortcut for ck_base. 4744 4745 PR c++/84045 - ICE with typedef and noexcept. 4746 * except.c (build_noexcept_spec): Use strip_typedefs_expr. 4747 4748 PR c++/84376 - ICE with omitted template arguments. 4749 * pt.c (dguide_name_p): Check for IDENTIFIER_NODE. 4750 4751 PR c++/84368 - wrong error with local variable in variadic lambda. 4752 * pt.c (tsubst_pack_expansion): Fix handling of non-packs in 4753 local_specializations. 4754 47552018-02-15 Paolo Carlini <paolo.carlini@oracle.com> 4756 4757 PR c++/84330 4758 * constraint.cc (tsubst_constraint_info): Handle an error_mark_node 4759 as first argument. 4760 47612018-02-14 Paolo Carlini <paolo.carlini@oracle.com> 4762 4763 PR c++/84350 4764 * pt.c (do_auto_deduction): Don't check the TREE_TYPE of a null 4765 init, early return. 4766 47672018-02-14 Nathan Sidwell <nathan@acm.org> 4768 4769 * decl2.c (mark_vtable_entries): Set input_location to decl's. 4770 (c_parse_final_cleanups): Restore input_location after emitting 4771 vtables. 4772 47732018-02-14 Paolo Carlini <paolo.carlini@oracle.com> 4774 4775 * cp-tree.h (do_auto_deduction (tree, tree, tree)): Remove. 4776 (do_auto_deduction (tree, tree, tree, tsubst_flags_t, 4777 auto_deduction_context, tree, int): Add defaults. 4778 * pt.c (do_auto_deduction (tree, tree, tree)): Remove definition. 4779 (tsubst_omp_for_iterator): Adjust do_auto_deduction call, forward 4780 tsubst_flags_t argument. 4781 * init.c (build_new): Likewise. 4782 47832018-02-13 Jakub Jelinek <jakub@redhat.com> 4784 4785 PR c++/84364 4786 * typeck.c (check_return_expr): Don't emit -Weffc++ warning 4787 about return other than *this in assignment operators if 4788 retval is type dependent expression. 4789 47902018-02-13 Paolo Carlini <paolo.carlini@oracle.com> 4791 4792 PR c++/84333 4793 * call.c (build_conditional_expr_1): Use cp_save_expr instead of 4794 save_expr for the G++ extension. 4795 47962018-02-13 Jason Merrill <jason@redhat.com> 4797 4798 PR c++/84080 - ICE with return type deduction and specialization. 4799 * pt.c (determine_specialization): Check uses_template_parms. 4800 4801 Fix more variadic capture issues. 4802 * pt.c (find_parameter_packs_r): Also look at explicit captures. 4803 (check_for_bare_parameter_packs): Check current_class_type for 4804 lambda context. 4805 (extract_locals_r): Handle seeing a full instantiation of a pack. 4806 (tsubst_pack_expansion): Likewise. Force lambda capture. 4807 * parser.c (cp_parser_lambda_introducer): Don't 4808 check_for_bare_parameter_packs. 4809 4810 PR c++/84338 - wrong variadic sizeof. 4811 * pt.c (argument_pack_select_arg): Like the macro, but look through 4812 a pack expansion. 4813 (tsubst, tsubst_copy, dependent_template_arg_p): Use it. 4814 (extract_fnparm_pack): Do make_pack_expansion. 4815 (extract_locals_r): Do strip a pack expansion. 4816 * cp-tree.h (ARGUMENT_PACK_SELECT_ARG): Remove. 4817 48182018-02-12 Jakub Jelinek <jakub@redhat.com> 4819 4820 PR c++/84341 4821 * parser.c (cp_parser_binary_expression): Use build_min instead of 4822 build2_loc to build the no_toplevel_fold_p toplevel binary expression. 4823 48242018-02-12 Nathan Sidwell <nathan@acm.org> 4825 4826 PR c++/84263 4827 * parser.c (cp_parser_decltype): Push and pop 4828 deferring_access_checks. Reorganize to avoid goto. 4829 48302018-02-12 Richard Biener <rguenther@suse.de> 4831 4832 PR c++/84281 4833 * constexpr.c (cxx_eval_vec_init_1): Use a RANGE_EXPR to compact 4834 uniform constructors and delay allocating them fully. 4835 48362018-02-09 Jason Merrill <jason@redhat.com> 4837 4838 PR c++/84036 - ICE with variadic capture. 4839 Handle variadic capture proxies more like non-variadic. 4840 * lambda.c (build_capture_proxy): Remove workaround. 4841 * pt.c (find_parameter_packs_r): The proxy is a pack. 4842 (instantiate_class_template_1): Remove dead lambda code. 4843 (extract_fnparm_pack): Don't make_pack_expansion. 4844 (extract_locals_r): Don't strip a pack expansion. 4845 (tsubst_pack_expansion): Handle proxy packs. Use 4846 PACK_EXPANSION_EXTRA_ARGS less. 4847 (tsubst_decl) [FIELD_DECL]: Don't register_specialization. 4848 (tsubst_copy) [FIELD_DECL]: Don't retrieve*_specialization. 4849 [VAR_DECL]: Handle ARGUMENT_PACK_SELECT. 4850 (tsubst_expr) [DECL_EXPR]: Handle proxy packs. 4851 (tsubst_copy_and_build) [VAR_DECL]: Handle proxy packs normally. 4852 48532018-02-10 Jakub Jelinek <jakub@redhat.com> 4854 4855 PR sanitizer/83987 4856 * tree.c (cp_free_lang_data): Revert 2018-01-23 change. 4857 48582018-02-09 Jason Merrill <jason@redhat.com> 4859 4860 PR c++/81917 - ICE with void_t and partial specialization. 4861 * pt.c (instantiate_class_template_1): Set TYPE_BEING_DEFINED before 4862 calling most_specialized_partial_spec. 4863 48642018-02-09 Nathan Sidwell <nathan@acm.org> 4865 4866 PR c/84293 4867 * typeck.c (cp_build_indirect_ref_1, build_reinterpret_cast_1): 4868 Pass expr location to strict_aliasing_warning. 4869 48702018-02-09 Jason Merrill <jason@redhat.com> 4871 4872 PR c++/84296 - ICE with qualified-id in template. 4873 PR c++/83714 4874 * pt.c (unknown_base_ref_p): New. 4875 (instantiation_dependent_scope_ref_p): Use it instead of 4876 any_dependent_bases_p. 4877 48782018-02-09 Marek Polacek <polacek@redhat.com> 4879 Jakub Jelinek <jakub@redhat.com> 4880 4881 PR c++/83659 4882 * constexpr.c (cxx_fold_indirect_ref): Sync some changes from 4883 fold_indirect_ref_1, including poly_*int64. Verify first that 4884 tree_fits_poly_int64_p (op01). Formatting fixes. 4885 48862018-02-08 Paolo Carlini <paolo.carlini@oracle.com> 4887 4888 * constexpr.c (cxx_eval_component_reference): Use INDIRECT_REF_P. 4889 * lambda.c (build_capture_proxy): Likewise. 4890 * search.c (field_access_p): Likewise. 4891 * semantics.c (omp_clause_decl, omp_privatize_field, 4892 finish_omp_clauses): Likewise. 4893 48942018-02-08 Paolo Carlini <paolo.carlini@oracle.com> 4895 4896 PR c++/83806 4897 * typeck.c (decay_conversion): Use mark_rvalue_use for the special 4898 case of nullptr too. 4899 49002018-02-08 Nathan Sidwell <nathan@acm.org> 4901 4902 * class.c (finish_struct): Fix std:initializer_list diagnostic 4903 formatting. 4904 49052018-02-08 Paolo Carlini <paolo.carlini@oracle.com> 4906 4907 PR c++/83204 4908 * pt.c (tsubst_copy_and_build): Use force_paren_expr for INDIRECT_REF. 4909 49102018-02-07 Jakub Jelinek <jakub@redhat.com> 4911 4912 PR c++/84082 4913 * parser.c (cp_parser_dot_deref_incomplete): New function. 4914 (cp_parser_postfix_dot_deref_expression): Use it. 4915 49162018-02-07 David Malcolm <dmalcolm@redhat.com> 4917 4918 PR c++/81610 4919 PR c++/80567 4920 * name-lookup.c (suggest_rid_p): New function. 4921 (lookup_name_fuzzy): Replace enum-rid-filtering logic with call to 4922 suggest_rid_p. 4923 49242018-02-07 Jason Merrill <jason@redhat.com> 4925 4926 PR c++/84182 - ICE with captured lambda 4927 PR c++/84181 4928 * pt.c (extract_locals_r, extract_local_specs): New. 4929 (tsubst_pack_expansion): Use them. 4930 49312018-02-07 Martin Liska <mliska@suse.cz> 4932 4933 PR c++/84059. 4934 * class.c (add_method): Append argument value. 4935 * cp-tree.h (maybe_version_functions): Add new argument. 4936 * decl.c (decls_match): Call it if a declaration does not 4937 have DECL_FUNCTION_VERSIONED. 4938 (maybe_version_functions): record argument is added. 4939 49402018-02-05 Marek Polacek <polacek@redhat.com> 4941 4942 * class.c: Remove unused global variables. 4943 (build_primary_vtable): Don't gather statistics. 4944 (print_class_statistics): Remove. 4945 * cp-tree.h (print_class_statistics): Remove. 4946 * tree.c (cxx_print_statistics): Don't call print_class_statistics. 4947 49482018-02-02 Paolo Carlini <paolo.carlini@oracle.com> 4949 4950 * class.c (is_really_empty_class): Use DECL_UNNAMED_BIT_FIELD. 4951 * constexpr.c (cx_check_missing_mem_inits): Likewise. 4952 * decl.c (next_initializable_field, find_decomp_class_base, 4953 cp_finish_decomp): Likewise. 4954 * typeck2.c (process_init_constructor_record): Likewise. 4955 49562018-02-02 Jason Merrill <jason@redhat.com> 4957 4958 PR c++/84181 - ICE with lambda parm in template argument. 4959 * tree.c (strip_typedefs_expr): Use cp_tree_operand_length. 4960 49612018-02-01 Jason Merrill <jason@redhat.com> 4962 4963 PR c++/84160 - ICE with nested variadic capture. 4964 * lambda.c (is_capture_proxy_with_ref): New. 4965 (insert_capture_proxy): Don't set DECL_CAPTURED_VARIABLE from a 4966 COMPONENT_REF. 4967 * expr.c (mark_use): Use is_capture_proxy_with_ref. 4968 * constexpr.c (potential_constant_expression_1): Likewise. 4969 * semantics.c (process_outer_var_ref): Likewise. 4970 49712018-02-01 Marek Polacek <polacek@redhat.com> 4972 4973 PR c++/84125 4974 * typeck.c (build_address): Relax the assert when 4975 processing_template_decl. 4976 49772018-02-01 Jason Merrill <jason@redhat.com> 4978 4979 PR c++/84126 - ICE with variadic generic lambda 4980 PR c++/84036 4981 PR c++/82249 4982 * pt.c (tsubst_pack_expansion): Handle function parameter_packs in 4983 PACK_EXPANSION_EXTRA_ARGS. 4984 49852018-02-01 Paolo Carlini <paolo.carlini@oracle.com> 4986 4987 PR c++/83796 4988 * call.c (convert_like_real): If w're initializing from {} explicitly 4989 call abstract_virtuals_error_sfinae. 4990 49912018-01-31 Jason Merrill <jason@redhat.com> 4992 Jakub Jelinek <jakub@redhat.com> 4993 4994 PR c++/83993 4995 * constexpr.c (cxx_eval_outermost_constant_expr): Build NOP_EXPR 4996 around non-constant ADDR_EXPRs rather than clearing TREE_CONSTANT 4997 on ADDR_EXPR. 4998 49992018-01-31 Jakub Jelinek <jakub@redhat.com> 5000 5001 PR c++/83993 5002 * constexpr.c (diag_array_subscript): Emit different diagnostics 5003 if TYPE_DOMAIN (arraytype) is NULL. 5004 (cxx_eval_array_reference, cxx_eval_store_expression): For arrays 5005 with NULL TYPE_DOMAIN use size_zero_node as nelts. 5006 50072018-01-31 Paolo Carlini <paolo.carlini@oracle.com> 5008 5009 PR c++/84092 5010 * semantics.c (finish_qualified_id_expr): When handling an 5011 UNBOUND_CLASS_TEMPLATE only adjust qualifying_class and expr. 5012 50132018-01-31 Marek Polacek <polacek@redhat.com> 5014 5015 PR c++/84138 5016 * cp-gimplify.c (cp_fold): Check if X is an error node before 5017 calling useless_type_conversion_p. 5018 50192018-01-30 Jason Merrill <jason@redhat.com> 5020 5021 PR c++/84091 - ICE with local class in lambda in template. 5022 * decl2.c (determine_visibility): Look for outer containing template 5023 instantiation. 5024 5025 PR c++/84098 - ICE with lambda in template NSDMI. 5026 * pt.c (instantiate_class_template_1): Ignore more lambdas. 5027 50282018-01-29 Jason Merrill <jason@redhat.com> 5029 5030 PR c++/68810 - wrong location for reinterpret_cast error. 5031 * cvt.c (cp_convert_to_pointer): Always build a CONVERT_EXPR when 5032 !dofold. 5033 50342018-01-29 Marek Polacek <polacek@redhat.com> 5035 5036 PR c++/83996 5037 * constexpr.c (cxx_fold_indirect_ref): Compute ((foo *)&fooarray)[1] 5038 => fooarray[1] in offset_int. 5039 50402018-01-29 Jason Merrill <jason@redhat.com> 5041 5042 PR c++/83942 - wrong unused warning with static_cast. 5043 * cvt.c (ocp_convert): Call mark_rvalue_use. 5044 50452018-01-26 Jason Merrill <jason@redhat.com> 5046 5047 PR c++/83956 - wrong dtor error with anonymous union 5048 * method.c (walk_field_subobs): Variant members only affect 5049 deletedness. 5050 (maybe_explain_implicit_delete): Pass &deleted_p for diagnostic. 5051 5052 PR c++/84036 - ICE with variadic capture. 5053 PR c++/82249 5054 * pt.c (tsubst_pack_expansion): When optimizing a simple 5055 substitution, pull a single pack expansion out of its pack. 5056 5057 PR c++/82514 - ICE with local class in generic lambda. 5058 * pt.c (regenerated_lambda_fn_p): Remove. 5059 (enclosing_instantiation_of): Don't use it. 5060 (tsubst_function_decl): Call enclosing_instantiation_of. 5061 5062 * pt.c (lookup_template_class_1): Add sanity check. 5063 * name-lookup.c (do_pushtag): Don't add closures to local_classes. 5064 50652018-01-25 Jakub Jelinek <jakub@redhat.com> 5066 5067 PR c++/84031 5068 * decl.c (find_decomp_class_base): Ignore unnamed bitfields. Ignore 5069 recursive calls that return ret. 5070 (cp_finish_decomp): Ignore unnamed bitfields. 5071 50722018-01-23 Jason Merrill <jason@redhat.com> 5073 5074 PR c++/82249 - wrong mismatched pack length error. 5075 * pt.c (extract_fnparm_pack, tsubst_pack_expansion): Handle 5076 unsubstituted function parameter pack. 5077 50782018-01-23 Paolo Carlini <paolo.carlini@oracle.com> 5079 5080 PR c++/83921 5081 * decl.c (check_for_uninitialized_const_var): Not static; add 5082 bool and tsubst_flags_t parameters; adjust to be used both in 5083 constexpr context and not. 5084 * constexpr.c (potential_constant_expression_1): Use the above. 5085 * cp-tree.h (check_for_uninitialized_const_var): Declare. 5086 50872018-01-23 Jason Merrill <jason@redhat.com> 5088 5089 PR c++/83947 - ICE with auto declarations. 5090 * pt.c (do_auto_deduction): Don't deduce from an auto decl. 5091 * decl.c (undeduced_auto_decl): Limit to vars and fns. 5092 50932018-01-23 David Malcolm <dmalcolm@redhat.com> 5094 5095 PR c++/83974 5096 * pt.c (tsubst_copy_and_build) <CONSTRUCTOR>: Remove early bailout 5097 for pointer to member function types. 5098 50992018-01-23 Jakub Jelinek <jakub@redhat.com> 5100 5101 PR sanitizer/83987 5102 * tree.c (cp_free_lang_data): Change DECL_VALUE_EXPR of 5103 DECL_OMP_PRIVATIZED_MEMBER vars to error_mark_node. 5104 51052018-01-23 Nathan Sidwell <nathan@acm.org> 5106 5107 PR c++/83988 5108 * pt.c (tsubst_baselink): Remove optype assert. 5109 * ptree.c (cxx_print_xnode): <case BASELINK> Print BASELINK_OPTYPE. 5110 51112018-01-23 Jakub Jelinek <jakub@redhat.com> 5112 5113 PR c++/83958 5114 * decl.c (cp_finish_decomp): Diagnose if reference structure binding 5115 refers to incomplete type. 5116 51172018-01-23 Nathan Sidwell <nathan@acm.org> 5118 5119 Deprecate ARM-era for scope handling 5120 * decl.c (poplevel): Flag_new_for_scope is a boolean-like. 5121 (cxx_init_decl_processing): Deprecate flag_new_for_scope being 5122 cleared. 5123 * name-lookup.c (check_for_out_of_scope_variable): Deprecate and 5124 cleanup handling. 5125 * semantics.c (begin_for_scope): Flag_new_for_scope is 5126 boolean-like. 5127 (finish_for_stmt, begin_range_for_stmt): Likewise. 5128 51292018-01-22 Jason Merrill <jason@redhat.com> 5130 5131 PR c++/83720 5132 * decl2.c (determine_visibility): Fix template_decl handling 5133 instead of blocking it. 5134 5135 PR c++/83720 - ICE with lambda and LTO. 5136 * decl2.c (determine_visibility): Clear template_decl for 5137 function-scope decls. Propagate anonymous linkage from containing 5138 function. 5139 51402018-01-22 Marek Polacek <polacek@redhat.com> 5141 5142 PR c++/81933 5143 * typeck2.c (split_nonconstant_init_1): Return false if we didn't 5144 split out anything. 5145 51462018-01-22 Ville Voutilainen <ville.voutilainen@gmail.com> 5147 5148 PR c++/83895 5149 * decl.c (grokdeclarator): Don't diagnose extra parens 5150 on typedefs. 5151 51522018-01-19 Jakub Jelinek <jakub@redhat.com> 5153 5154 PR c++/81167 5155 * call.c (joust): Use TREE_TYPE (source) if source is 5156 a POINTER_TYPE_P rather than if ! DECL_CONSTRUCTOR_P (w->fn). 5157 5158 PR c++/83919 5159 * typeck.c (convert_for_assignment): Suppress warn_ignored_qualifiers 5160 for direct enum init. 5161 * decl.c (reshape_init): Likewise. 5162 51632018-01-19 Marek Polacek <polacek@redhat.com> 5164 5165 * constexpr.c (fold_simple): Simplify. 5166 51672018-01-18 Jason Merrill <jason@redhat.com> 5168 5169 PR c++/83714 5170 * search.c (any_dependent_bases_p): Handle null TREE_BINFO. 5171 * pt.c (instantiation_dependent_scope_ref_p): True if 5172 any_dependent_bases_p. 5173 51742018-01-18 Paolo Carlini <paolo.carlini@oracle.com> 5175 5176 * cp-tree.h: Fix comment typo (DECL_NON_TRIVIALLY_INITIALIZED_P 5177 vs DECL_NONTRIVIALLY_INITIALIZED_P). 5178 51792018-01-18 Jason Merrill <jason@redhat.com> 5180 5181 PR c++/82461 - constexpr list-initialized member 5182 * constexpr.c (potential_constant_expression_1): Check 5183 TARGET_EXPR_DIRECT_INIT_P. 5184 51852018-01-18 Paolo Carlini <paolo.carlini@oracle.com> 5186 5187 PR c++/81013 5188 * decl.c (xref_basetypes): Early return upon error about derived 5189 union. 5190 51912018-01-18 Nathan Sidwell <nathan@acm.org> 5192 5193 PR c++/83160 5194 * cp-tree.h (mark_use): Declare. 5195 * expr.c (mark_use): Make extern. 5196 * call.c (direct_reference_binding): Set inner conv's 5197 rvaluedness_matches_p, if it is an identity. 5198 (convert_like_real): Mark lvalue or rvalue use for identity as 5199 rvaledness_matches_p demands. 5200 52012018-01-18 Jakub Jelinek <jakub@redhat.com> 5202 5203 PR c++/83824 5204 * parser.c (attr_chainon): New function. 5205 (cp_parser_label_for_labeled_statement, cp_parser_decl_specifier_seq, 5206 cp_parser_namespace_definition, cp_parser_init_declarator, 5207 cp_parser_type_specifier_seq, cp_parser_parameter_declaration, 5208 cp_parser_gnu_attributes_opt): Use it. 5209 (cp_parser_member_declaration, cp_parser_objc_class_ivars, 5210 cp_parser_objc_struct_declaration): Likewise. Don't reset 5211 prefix_attributes if attributes is error_mark_node. 5212 52132018-01-17 Paolo Carlini <paolo.carlini@oracle.com> 5214 5215 PR c++/78344 5216 * decl.c (grokdeclarator): Do not append the error_mark_node 5217 due to an erroneous optional attribute-specifier-seq. 5218 52192018-01-17 Jakub Jelinek <jakub@redhat.com> 5220 5221 PR c++/83897 5222 * cp-gimplify.c (cp_maybe_instrument_return): Handle 5223 CLEANUP_POINT_EXPR. 5224 52252018-01-17 Paolo Carlini <paolo.carlini@oracle.com> 5226 5227 PR c++/81054 5228 * constexpr.c (ensure_literal_type_for_constexpr_object): Return 5229 error_mark_node when we give an error. 5230 * decl.c (cp_finish_decl): Use the latter. 5231 52322018-01-17 Nathan Sidwell <nathan@acm.org> 5233 5234 PR c++/83287 5235 * init.c (build_raw_new_expr): Scan list for lookups to keep. 5236 52372018-01-17 David Malcolm <dmalcolm@redhat.com> 5238 5239 PR c++/83814 5240 * expr.c (fold_for_warn): Move from c-common.c, reducing to just 5241 the C++ part. If processing a template, call 5242 fold_non_dependent_expr rather than fully folding. 5243 52442018-01-17 Jason Merrill <jason@redhat.com> 5245 5246 PR c++/81067 - redundant NULL warning. 5247 * call.c (convert_like_real): Restore null_node handling. 5248 52492018-01-17 Jason Merrill <jason@redhat.com> 5250 5251 PR c++/81843 - ICE with variadic member template. 5252 PR c++/72801 5253 * pt.c (unify_pack_expansion): Don't try to deduce enclosing 5254 template args. 5255 52562018-01-17 David Malcolm <dmalcolm@redhat.com> 5257 5258 PR c++/83799 5259 * pt.c (type_dependent_expression_p): Strip any location wrapper 5260 before testing tree codes. 5261 (selftest::test_type_dependent_expression_p): New function. 5262 (selftest::cp_pt_c_tests): Call it. 5263 52642018-01-17 Nathan Sidwell <nathan@acm.org> 5265 5266 PR c++/83739 5267 * pt.c (tsubst_expr) <case RANGE_FOR_STMT>: Rebuild a range_for if 5268 this not a final instantiation. 5269 52702018-01-16 Jason Merrill <jason@redhat.com> 5271 5272 PR c++/83714 - ICE checking return in template. 5273 * typeck.c (check_return_expr): Call build_non_dependent_expr. 5274 52752018-01-16 Jakub Jelinek <jakub@redhat.com> 5276 5277 PR c++/83817 5278 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: If function 5279 is AGGR_INIT_EXPR rather than CALL_EXPR, set AGGR_INIT_FROM_THUNK_P 5280 instead of CALL_FROM_THUNK_P. 5281 5282 PR c++/83825 5283 * name-lookup.c (member_vec_dedup): Return early if len is 0. 5284 (resort_type_member_vec, set_class_bindings, 5285 insert_late_enum_def_bindings): Use vec qsort method instead of 5286 calling qsort directly. 5287 52882018-01-15 Martin Sebor <msebor@redhat.com> 5289 5290 PR c++/83588 5291 * class.c (find_flexarrays): Make a record of multiple flexible array 5292 members. 5293 52942018-01-12 Jason Merrill <jason@redhat.com> 5295 5296 PR c++/83186 - ICE with static_cast of list-initialized temporary. 5297 * typeck.c (build_static_cast): Use build_non_dependent_expr. 5298 52992018-01-12 Nathan Sidwell <nathan@acm.org> 5300 5301 * cp-tree.h (mark_rvalue_use): Add parm name. 5302 * expr.c (mark_lvalue_use, mark_lvalue_use_nonread): Move next to 5303 mark_rvalue_use. 5304 * call.c (convert_like_real): Fix formatting. 5305 53062018-01-11 Jason Merrill <jason@redhat.com> 5307 5308 PR c++/82728 - wrong -Wunused-but-set-variable 5309 PR c++/82799 5310 PR c++/83690 5311 * call.c (perform_implicit_conversion_flags): Call mark_rvalue_use. 5312 * decl.c (case_conversion): Likewise. 5313 * semantics.c (finish_static_assert): Call 5314 perform_implicit_conversion_flags. 5315 53162018-01-11 Nathan Sidwell <nathan@acm.org> 5317 5318 * method.c (enum mangling_flags): Delete long-dead enum. 5319 53202018-01-10 Paolo Carlini <paolo.carlini@oracle.com> 5321 5322 * parser.c (cp_parser_std_attribute_spec): When 5323 token_pair::require_open / require_close return false simply 5324 return error_mark_node, avoid duplicate cp_parser_error about 5325 expected '(' / ')', respectively. 5326 53272018-01-10 David Malcolm <dmalcolm@redhat.com> 5328 5329 PR c++/43486 5330 * call.c (null_ptr_cst_p): Strip location wrappers when 5331 converting from '0' to a pointer type in C++11 onwards. 5332 (conversion_null_warnings): Replace comparison with null_node with 5333 call to null_node_p. 5334 (build_over_call): Likewise. 5335 * cp-gimplify.c (cp_fold): Remove the early bailout when 5336 processing_template_decl. 5337 * cp-lang.c (selftest::run_cp_tests): Call 5338 selftest::cp_pt_c_tests and selftest::cp_tree_c_tests. 5339 * cp-tree.h (cp_expr::maybe_add_location_wrapper): New method. 5340 (selftest::run_cp_tests): Move decl to bottom of file. 5341 (null_node_p): New inline function. 5342 (selftest::cp_pt_c_tests): New decl. 5343 (selftest::cp_tree_c_tests): New decl. 5344 * cvt.c (build_expr_type_conversion): Replace comparison with 5345 null_node with call to null_node_p. 5346 * error.c (args_to_string): Likewise. 5347 * except.c (build_throw): Likewise. 5348 * mangle.c (write_expression): Skip location wrapper nodes. 5349 * parser.c (literal_integer_zerop): New function. 5350 (cp_parser_postfix_expression): Call maybe_add_location_wrapper on 5351 the result for RID_TYPEID. Pass true for new "wrap_locations_p" 5352 param of cp_parser_parenthesized_expression_list. When calling 5353 warn_for_memset, replace integer_zerop calls with 5354 literal_integer_zerop, eliminating the double logical negation 5355 cast to bool. Eliminate the special-casing for CONST_DECL in 5356 favor of the fold_for_warn within warn_for_memset. 5357 (cp_parser_parenthesized_expression_list): Add "wrap_locations_p" 5358 param, defaulting to false. Convert "expr" to a cp_expr, and call 5359 maybe_add_location_wrapper on it when wrap_locations_p is true. 5360 (cp_parser_unary_expression): Call maybe_add_location_wrapper on 5361 the result for RID_ALIGNOF and RID_SIZEOF. 5362 (cp_parser_builtin_offsetof): Likewise. 5363 * pt.c: Include "selftest.h". 5364 (tsubst_copy): Handle location wrappers. 5365 (tsubst_copy_and_build): Likewise. 5366 (build_non_dependent_expr): Likewise. 5367 (selftest::test_build_non_dependent_expr): New function. 5368 (selftest::cp_pt_c_tests): New function. 5369 * tree.c: Include "selftest.h". 5370 (lvalue_kind): Handle VIEW_CONVERT_EXPR location wrapper nodes. 5371 (selftest::test_lvalue_kind): New function. 5372 (selftest::cp_tree_c_tests): New function. 5373 * typeck.c (string_conv_p): Strip any location wrapper from "exp". 5374 (cp_build_binary_op): Replace comparison with null_node with call 5375 to null_node_p. 5376 (build_address): Use location of operand when building address 5377 expression. 5378 53792018-01-10 Marek Polacek <polacek@redhat.com> 5380 5381 PR c++/82541 5382 * call.c (build_conditional_expr_1): Check complain before warning. 5383 * pt.c (tsubst_copy_and_build) <case COND_EXPR>: Suppress 5384 -Wduplicated-branches. 5385 53862018-01-10 Jakub Jelinek <jakub@redhat.com> 5387 5388 PR c++/81327 5389 * call.c (maybe_warn_class_memaccess): Add forward declaration. 5390 Change last argument from tree * to const vec<tree, va_gc> *, adjust 5391 args uses and check number of operands too. Don't strip away any 5392 nops. Use maybe_constant_value when looking for INTEGER_CST args. 5393 Deal with src argument not having pointer type. Check 5394 tree_fits_uhwi_p before calling tree_to_uhwi. Remove useless 5395 test. 5396 (build_over_call): Call maybe_warn_class_memaccess here on the 5397 original arguments. 5398 (build_cxx_call): Rather than here on converted arguments. 5399 54002018-01-10 Paolo Carlini <paolo.carlini@oracle.com> 5401 5402 PR c++/81055 5403 * init.c (build_vec_init): Avoid building an INIT_EXPR with 5404 error_mark_node as second argument. 5405 54062018-01-09 Jakub Jelinek <jakub@redhat.com> 5407 5408 PR c++/83734 5409 * constexpr.c (cxx_eval_statement_list): Ignore DEBUG_BEGIN_STMTs 5410 in STATEMENT_LIST. Remove unneeded assert. 5411 54122018-01-03 Richard Sandiford <richard.sandiford@linaro.org> 5413 Alan Hayward <alan.hayward@arm.com> 5414 David Sherwood <david.sherwood@arm.com> 5415 5416 * constexpr.c (cxx_eval_array_reference): Handle polynomial 5417 VECTOR_CST_NELTS. 5418 (cxx_fold_indirect_ref): Handle polynomial TYPE_VECTOR_SUBPARTS. 5419 * call.c (build_conditional_expr_1): Likewise. 5420 * decl.c (cp_finish_decomp): Likewise. 5421 * mangle.c (write_type): Likewise. 5422 * typeck.c (structural_comptypes): Likewise. 5423 (cp_build_binary_op): Likewise. 5424 * typeck2.c (process_init_constructor_array): Likewise. 5425 54262018-01-03 Jakub Jelinek <jakub@redhat.com> 5427 5428 PR c++/83555 5429 * typeck.c (build_static_cast_1): For static casts to reference types, 5430 call build_base_path with flag_delete_null_pointer_checks as nonnull 5431 instead of always false. When -fsanitize=null, call 5432 ubsan_maybe_instrument_reference on the NULL reference INTEGER_CST. 5433 * cp-gimplify.c (cp_genericize_r): Don't walk subtrees of UBSAN_NULL 5434 call if the first argument is INTEGER_CST with REFERENCE_TYPE. 5435 54362018-01-03 Nathan Sidwell <nathan@acm.org> 5437 5438 PR c++/83667 5439 * method.c (make_alias_for): Copy DECL_CONTEXT. 5440 54412018-01-03 Marek Polacek <polacek@redhat.com> 5442 5443 PR c++/83592 5444 * decl.c (grokdeclarator): Don't warn about MVP in typename context. 5445 54462018-01-03 Jakub Jelinek <jakub@redhat.com> 5447 5448 PR preprocessor/83602 5449 * name-lookup.c (lookup_name_fuzzy): Don't use macro_use_before_def 5450 for builtin macros. 5451 5452 PR c++/83634 5453 * cp-gimplify.c (cp_fold) <case NOP_EXPR>: If the operand folds to 5454 error_mark_node, return error_mark_node. 5455 5456 Update copyright years. 5457 54582018-01-02 Jakub Jelinek <jakub@redhat.com> 5459 5460 PR c++/83556 5461 * tree.c (replace_placeholders_r): Pass NULL as last argument to 5462 cp_walk_tree instead of d->pset. If non-TREE_CONSTANT and 5463 non-PLACEHOLDER_EXPR tree has been seen already, set *walk_subtrees 5464 to false and return. 5465 (replace_placeholders): Pass NULL instead of &pset as last argument 5466 to cp_walk_tree. 5467 54682018-01-02 Nathan Sidwell <nathan@acm.org> 5469 5470 * constexpr.c (cxx_bind_parameters_in_call): Remove unneeded local 5471 lval var. 5472 5473Copyright (C) 2018 Free Software Foundation, Inc. 5474 5475Copying and distribution of this file, with or without modification, 5476are permitted in any medium without royalty provided the copyright 5477notice and this notice are preserved. 5478