]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/cp/ChangeLog
PR c++/90171 - ICE with destroying delete with size_t parm.
[thirdparty/gcc.git] / gcc / cp / ChangeLog
CommitLineData
0b496006 12019-04-19 Jason Merrill <jason@redhat.com>
2
3 PR c++/90171 - ICE with destroying delete with size_t parm.
4 * call.c (sized_deallocation_fn_p): New. Use it instead of
5 second_parm_is_size_t in most cases.
6 (second_parm_is_size_t): Don't check for aligned.
7
1e9afbb0 82019-04-19 Paolo Carlini <paolo.carlini@oracle.com>
9
10 PR c++/89900
11 * pt.c (fn_type_unification): When handling null explicit
12 arguments do not special case non-parameter packs.
13
b7c7bc83 142019-04-19 Jakub Jelinek <jakub@redhat.com>
15
dc097d0a 16 PR c++/90138
17 * pt.c (process_template_parm): Set decl to pushdecl result. If
18 !is_non_type, also set parm to that.
19
45cf699c 20 PR c/89888
21 * decl.c (struct cp_switch): Remove outside_range_p member.
22 (push_switch): Don't clear it.
23 (pop_switch): Adjust c_do_switch_warnings caller.
24 (finish_case_label): Adjust c_add_case_label caller.
25
b7c7bc83 26 PR c++/90108
27 * decl.c (duplicate_decls): If remove is main variant and
28 DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
29 variant that has newdecl as TYPE_NAME if any.
30
849a7926 312019-04-18 Jason Merrill <jason@redhat.com>
32
33 PR c++/87554 - ICE with extern template and reference member.
34 * decl.c (cp_finish_decl): Don't set DECL_INITIAL of external vars.
35
a9b768f8 362019-04-17 Jason Merrill <jason@redhat.com>
37
38 PR c++/90047 - ICE with enable_if alias template.
39 * pt.c (tsubst_decl) [TYPE_DECL]: Don't put an erroneous decl in the
40 hash table when we're in SFINAE context.
41
f1d497bc 422019-04-17 Marek Polacek <polacek@redhat.com>
43
44 PR c++/90124 - bogus error with incomplete type in decltype.
45 * typeck.c (build_class_member_access_expr): Check
46 cp_unevaluated_operand.
47
81e61a19 482019-04-12 Jakub Jelinek <jakub@redhat.com>
49
50 PR c/89933
51 * decl.c (duplicate_decls): When newdecl's type is its main variant,
52 don't try to remove it from the variant list, but instead assert
53 it has no variants.
54
e7136105 552019-04-12 Martin Sebor <msebor@redhat.com>
56
57 PR c/88383
58 PR c/89288
59 * parser.c (cp_parser_has_attribute_expression): Handle assignment
60 expressions.
61
b7a39acf 622019-04-12 Jason Merrill <jason@redhat.com>
63
64 * call.c (null_member_pointer_value_p): Handle an empty CONSTRUCTOR
65 of PMF type.
66
1fdc37a3 672019-04-12 Marek Polacek <polacek@redhat.com>
68
69 * except.c (build_noexcept_spec): Use build_converted_constant_bool_expr
70 instead of perform_implicit_conversion_flags.
71
01e345e0 72 PR c++/87603 - constexpr functions are no longer noexcept.
73 * constexpr.c (is_sub_constant_expr): Remove unused function.
74 * cp-tree.h (is_sub_constant_expr): Remove declaration.
75 * except.c (check_noexcept_r): Don't consider a call to a constexpr
76 function noexcept.
77
f0121163 782019-04-11 Jakub Jelinek <jakub@redhat.com>
79
80 PR translation/90035
81 * parser.h (struct cp_parser): Add
82 type_definition_forbidden_message_arg member.
83 * parser.c (cp_debug_parser): Print it.
84 (cp_parser_check_type_definition): Pass
85 parser->type_definition_forbidden_message_arg as second argument to
86 error.
87 (cp_parser_has_attribute_expression, cp_parser_sizeof_operand): Set
88 parser->type_definition_forbidden_message_arg and use G_() with
89 %qs for parser->type_definition_forbidden_message instead of
90 building untranslatable message using concat.
91
a9c7b78d 922019-04-09 Jakub Jelinek <jakub@redhat.com>
93
94 PR translation/90011
95 * typeck2.c (check_narrowing): Remove trailing space from diagnostics.
96
67ecd3ae 972019-04-08 Marek Polacek <polacek@redhat.com>
98
99 * typeck2.c (digest_init_r): Don't condition the object slicing warning
100 on flag_checking.
101
7651759b 1022019-04-08 Paolo Carlini <paolo.carlini@oracle.com>
103
104 PR c++/89914
105 * semantics.c (trait_expr_value): Don't use TYPE_NOTHROW_P
106 when maybe_instantiate_noexcept fails.
107 (classtype_has_nothrow_assign_or_copy_p): Likewise.
108 * method.c (implicitly_declare_fn): Avoid passing error_mark_node
109 to build_exception_variant.
110
168afa9b 1112019-04-05 Marek Polacek <polacek@redhat.com>
112
113 PR c++/87145 - bogus error converting class type in template arg list.
114 * pt.c (convert_nontype_argument): Don't call
115 build_converted_constant_expr if it could involve calling a conversion
116 function with a instantiation-dependent constructor as its argument.
117
49666f40 1182019-04-05 Martin Sebor <msebor@redhat.com>
119
120 PR bootstrap/89980
121 * decl.c (reshape_init_array_1): Avoid treating empty strings
122 as zeros in array initializers.
123 Use trivial_type_p () instead of TYPE_HAS_TRIVIAL_DFLT().
124
071a07da 1252019-04-04 Jason Merrill <jason@redhat.com>
126
127 PR c++/89948 - ICE with break in statement-expr.
128 * constexpr.c (cxx_eval_statement_list): Jumping out of a
129 statement-expr is non-constant.
130
1a08779b 1312019-04-04 Jason Merrill <jason@redhat.com>
132
133 PR c++/89966 - error with non-type auto tparm.
134 * pt.c (do_auto_deduction): Clear tf_partial.
135
80d04049 1362019-04-04 Jason Merrill <jason@redhat.com>
137
138 PR c++/86986 - ICE with TTP with parameter pack.
139 * pt.c (coerce_template_parameter_pack): Only look at the type of a
140 non-type parameter pack.
141 (fixed_parameter_pack_p_1): Don't recurse into the type of a
142 non-type parameter pack.
143 (coerce_template_template_parms): Call add_outermost_template_args.
144
b11751dc 1452019-04-04 Martin Sebor <msebor@redhat.com>
146
147 PR c++/89974
148 PR c++/89878
149 PR c++/89833
150 PR c++/47488
151 * decl.c (reshape_init_array_1): Strip trailing zero-initializers
152 from arrays of trivial type and known size.
153 * mangle.c (write_expression): Convert braced initializer lists
154 to STRING_CSTs.
155 (write_expression): Trim trailing zero-initializers from arrays
156 of trivial type.
157 (write_template_arg_literal): Mangle strings the same as braced
158 initializer lists.
159
589c66eb 1602019-04-03 Jason Merrill <jason@redhat.com>
161
b1d61c0e 162 PR c++/81866 - ICE with member template and default targ.
163 * pt.c (tsubst_template_decl): Handle getting a type from
164 retrieve_specialization.
165
b3902d2e 166 PR c++/86586 - -fcompare-debug=-Wsign-compare.
167 * typeck.c (cp_build_binary_op): Don't fold for -Wsign-compare.
168
4c246688 169 PR c++/89331 - ICE with offsetof in incomplete class.
170 * semantics.c (finish_offsetof): Handle error_mark_node.
171 * typeck.c (build_class_member_access_expr): Call
172 complete_type_or_maybe_complain before converting to base.
173
589c66eb 174 PR c++/89917 - ICE with lambda in variadic mem-init.
175 * pt.c (make_pack_expansion): Change type_pack_expansion_p to false.
176
0ccdb705 1772019-04-01 Jason Merrill <jason@redhat.com>
178
179 PR c++/86946 - ICE with function call in template argument.
180 DR 1321
181 * pt.c (iterative_hash_template_arg) [CALL_EXPR]: Use
182 dependent_name.
183
00bc562a 1842019-04-01 Paolo Carlini <paolo.carlini@oracle.com>
185
186 PR c++/62207
187 * pt.c (tsubst_copy): Deal with lookup_name not returing a variable.
188
cf13db0c 1892019-03-31 Marek Polacek <polacek@redhat.com>
190
191 PR c++/89852 - ICE with C++11 functional cast with { }.
192 * constexpr.c (fold_non_dependent_expr_template): New static function
193 broken out of...
194 (fold_non_dependent_expr): ...here.
195 (fold_non_dependent_init): New function.
196 * cp-tree.h (fold_non_dependent_init): Declare.
197 * typeck2.c (massage_init_elt): Call fold_non_dependent_init instead
198 of fold_non_dependent_expr. Don't call maybe_constant_init.
199
439021c1 2002019-03-30 Jason Merrill <jason@redhat.com>
201
202 PR c++/89744 - ICE with specialization of member class template.
203 * pt.c (lookup_template_class_1): If the partial instantiation is
204 explicitly specialized, adjust.
205 (maybe_process_partial_specialization): Also adjust
206 CLASSTYPE_TI_ARGS.
207
9a6cce24 2082019-03-29 Jakub Jelinek <jakub@redhat.com>
209
210 PR sanitizer/89869
211 * typeck.c: Include gimplify.h.
212 (cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it
213 for second time. Formatting fixes.
214
8e98407e 2152019-03-29 Marek Polacek <polacek@redhat.com>
216
217 PR c++/89876 - ICE with deprecated conversion.
218 * call.c (convert_like_real): Only give warnings with tf_warning.
219
fcec39e1 2202019-03-28 Marek Polacek <polacek@redhat.com>
221
facf139f 222 PR c++/89612 - ICE with member friend template with noexcept.
223 * pt.c (maybe_instantiate_noexcept): For function templates, use their
224 template result (function decl). Don't set up local specializations.
225 Temporarily turn on processing_template_decl. Update the template type
226 too.
227
fcec39e1 228 PR c++/89836 - bool constant expression and explicit conversions.
229 * call.c (build_converted_constant_expr_internal): New function,
230 renamed from...
231 (build_converted_constant_expr): ...this. New.
232 (build_converted_constant_bool_expr): New.
233 * cp-tree.h (build_converted_constant_bool_expr): Declare.
234 * decl.c (build_explicit_specifier): Call
235 build_converted_constant_bool_expr.
236
ad6978a6 2372019-03-28 Jakub Jelinek <jakub@redhat.com>
238
239 PR c++/89785
240 * constexpr.c (struct check_for_return_continue_data): New type.
241 (check_for_return_continue): New function.
242 (potential_constant_expression_1) <case SWITCH_STMT>: Walk
243 SWITCH_STMT_BODY to find RETURN_EXPRs or CONTINUE_STMTs not nested
244 in loop bodies and set *jump_target to that if found.
245
64e9a5e0 2462019-03-27 Jason Merrill <jason@redhat.com>
247
7fe010eb 248 PR c++/89831 - error with qualified-id in const member function.
249 * semantics.c (finish_non_static_data_member): Use object cv-quals
250 in scoped case, too.
251
8d96c4f0 252 PR c++/89421 - ICE with lambda in template parameter list.
64e9a5e0 253 * parser.c (cp_parser_lambda_expression): Also reject a lambda in a
254 template parameter list before C++20.
255 * pt.c (type_dependent_expression_p): True for LAMBDA_EXPR.
256 * semantics.c (begin_class_definition): Restore error about defining
257 non-lambda class in template parm list.
258
460e6a8c 2592019-03-26 Jason Merrill <jason@redhat.com>
260
a6cd883f 261 PR c++/86932 - missed SFINAE with empty pack.
262 * pt.c (coerce_template_parms): Don't add an empty pack if
263 tf_partial.
264 (fn_type_unification): Pass tf_partial to coerce_template_parms.
265
460e6a8c 266 PR c++/86429 - constexpr variable in lambda.
267 PR c++/82643
268 PR c++/87327
269 * constexpr.c (cxx_eval_constant_expression): In a lambda function,
270 try evaluating the captured variable directly.
271
024a645d 2722019-03-26 Jakub Jelinek <jakub@redhat.com>
273
274 PR c++/89796
275 * semantics.c (finish_omp_atomic): Add warning_sentinel for
276 -Wunused-value around finish_expr_stmt call.
277
ac557922 2782019-03-25 Paolo Carlini <paolo.carlini@oracle.com>
279
280 PR c++/84661
281 PR c++/85013
282 * parser.c (cp_parser_binary_expression): Don't call cp_fully_fold
283 to undo the disabling of warnings.
284
93877af7 2852019-03-25 Jason Merrill <jason@redhat.com>
286
287 PR c++/87748 - substitution failure error with decltype.
288 * pt.c (most_specialized_partial_spec): Clear
289 processing_template_decl.
290
1de8eb3e 2912019-03-25 Marek Polacek <polacek@redhat.com>
292
751baf9c 293 PR c++/89214 - ICE when initializing aggregates with bases.
294 * typeck2.c (digest_init_r): Warn about object slicing instead of
295 crashing.
296
1de8eb3e 297 PR c++/89705 - ICE with reference binding with conversion function.
298 * call.c (reference_binding): If the result of the conversion function
299 is a prvalue of non-class type, use the cv-unqualified type.
300
37682124 3012019-03-25 Nathan Sidwell <nathan@acm.org>
302
303 * lambda.c (maybe_add_lambda_conv_op): Don't add to comdat group.
304
84f13b2f 3052019-03-22 Jakub Jelinek <jakub@redhat.com>
306
8815602b 307 PR c++/60702
308 * cp-tree.h (get_tls_wrapper_fn): Remove declaration.
309 (maybe_get_tls_wrapper_call): Declare.
310 * decl2.c (get_tls_wrapper_fn): Make static.
311 (maybe_get_tls_wrapper_call): New function.
312 * typeck.c (build_class_member_access_expr): Handle accesses to TLS
313 variables.
314 * semantics.c (finish_qualified_id_expr): Likewise.
315 (finish_id_expression_1): Use maybe_get_tls_wrapper_call.
316 * pt.c (tsubst_copy_and_build): Likewise.
317
84f13b2f 318 PR c++/87481
319 * constexpr.c (struct constexpr_ctx): Add constexpr_ops_count member.
320 (cxx_eval_constant_expression): When not skipping, not constant class
321 or location wrapper, increment *ctx->constexpr_ops_count and if it is
322 above constexpr_loop_nest_limit, diagnose failure.
323 (cxx_eval_outermost_constant_expr): Add constexpr_ops_count and
324 initialize ctx.constexpr_ops_count to its address.
325 (is_sub_constant_expr): Likewise.
326
654b4632 3272019-03-21 Jakub Jelinek <jakub@redhat.com>
328
f03d9a13 329 PR c++/71446
330 * call.c (filed_in_pset): Change pset from hash_set<tree> * to
331 hash_set<tree, true> &, adjust uses accordingly.
332 (build_aggr_conv): Change pset from hash_set<tree> *
333 to hash_set<tree, true>. Replace goto fail; with return NULL;,
334 adjust pset uses.
335
654b4632 336 PR c++/89767
337 * parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id
338 variables, check for duplicates in this function.
339 * lambda.c (add_capture): Don't check for duplicates nor use
340 IDENTIFIER_MARKED.
341 (register_capture_members): Don't clear IDENTIFIER_MARKED here.
342
e6c0a0e8 3432019-03-21 Paolo Carlini <paolo.carlini@oracle.com>
344
345 PR c++/89571
346 * method.c (after_nsdmi_defaulted_late_checks): Avoid passing
347 error_mark_node to comp_except_specs.
348
0f86e901 3492019-03-20 Jason Merrill <jason@redhat.com>
350
351 PR c++/87480 - decltype of member access in default template arg
352 * pt.c (type_unification_real): Accept a dependent result in
353 template context.
354
dc0cf270 3552019-03-19 Martin Sebor <msebor@redhat.com>
356
357 PR tree-optimization/89688
358 * typeck2.c (store_init_value): Call braced_lists_to_string for more
359 kinds of initializers.
360
640c769f 3612019-03-18 Jason Merrill <jason@redhat.com>
362
56c3aeaa 363 PR c++/89630 - ICE with dependent using-decl as template arg.
364 * tree.c (cp_tree_equal): Always return false for USING_DECL.
365
c821b0ef 366 PR c++/89761 - ICE with sizeof... in pack expansion.
367 * pt.c (argument_pack_element_is_expansion_p): Handle
368 ARGUMENT_PACK_SELECT.
369
4273f124 370 PR c++/89640 - GNU attributes on lambda.
371 * parser.c (cp_parser_lambda_declarator_opt): Allow GNU attributes.
372
640c769f 373 PR c++/89682 - wrong access error in default argument.
374 * pt.c (tsubst_default_argument): Don't defer access checks.
375
24c67877 3762019-03-18 Paolo Carlini <paolo.carlini@oracle.com>
377
378 PR c++/85014
379 * semantics.c (finish_non_static_data_member): Check return value
380 of context_for_name_lookup and immediately return error_mark_node
381 if isn't a type.
382
ce139b21 3832019-03-17 Jason Merrill <jason@redhat.com>
384
385 PR c++/89571 - ICE with ill-formed noexcept on constructor.
386 * pt.c (maybe_instantiate_noexcept): Only return false if defaulted.
387 (regenerate_decl_from_template): Use it for noexcept-specs.
388
773c8785 3892019-03-14 Jason Merrill <jason@redhat.com>
390
391 * parser.c (cp_parser_decl_specifier_seq): Support C++20
392 concept-definition syntax without 'bool'.
393
d0782a7e 3942019-03-14 Jakub Jelinek <jakub@redhat.com>
395
c17b0b28 396 PR c++/89512
397 * semantics.c (finish_qualified_id_expr): Reject variable templates.
398
d0782a7e 399 PR c++/89652
400 * constexpr.c (struct constexpr_ctx): Change save_exprs type from
401 hash_set<tree> to vec<tree>.
402 (cxx_eval_call_expression): Adjust for save_exprs being a vec instead
403 of hash_set.
404 (cxx_eval_loop_expr): Likewise. Truncate the vector after each
405 removal of SAVE_EXPRs from values.
406 (cxx_eval_constant_expression) <case SAVE_EXPR>: Call safe_push
407 method on save_exprs instead of add.
408
d28a979f 4092019-03-13 Jason Merrill <jason@redhat.com>
410
411 PR c++/86521 - C++17 copy elision in initialization by constructor.
412 * call.c (joust_maybe_elide_copy): New.
413 (joust): Call it.
414
e214ee76 4152019-03-13 Marek Polacek <polacek@redhat.com>
416
417 PR c++/88979 - further P0634 fix for constructors.
418 * parser.c (cp_parser_decl_specifier_seq): Pass flags to
419 cp_parser_constructor_declarator_p.
420 (cp_parser_direct_declarator): Allow missing typename for constructor
421 parameters.
422 (cp_parser_constructor_declarator_p): Add FLAGS parameter. Pass it to
423 cp_parser_type_specifier.
424
3c78ad42 425 PR c++/89686 - mixing init-capture and simple-capture in lambda.
426 * parser.c (cp_parser_lambda_introducer): Give error when combining
427 init-capture and simple-capture.
428
8b953246 429 PR c++/89660 - bogus error with -Wredundant-move.
430 * typeck.c (maybe_warn_pessimizing_move): Only accept (T &) &arg
431 as the std::move's argument. Don't call convert_for_initialization
432 when warn_redundant_move isn't on.
433
4ca87658 4342019-03-11 Jason Merrill <jason@redhat.com>
435
436 PR c++/86521 - wrong overload resolution with ref-qualifiers.
437 * call.c (build_user_type_conversion_1): Don't use a conversion to a
438 reference of the wrong rvalueness for direct binding.
439
f2a60d44 4402019-03-11 Martin Liska <mliska@suse.cz>
441
442 * cvt.c (build_expr_type_conversion): Wrap apostrophes
443 in gcc internal format with %'.
444 * decl.c (check_no_redeclaration_friend_default_args): Likewise.
445 (grokfndecl): Likewise.
446 * name-lookup.c (do_pushtag): Likewise.
447 * pt.c (unify_parameter_deduction_failure): Likewise.
448 (unify_template_deduction_failure): Likewise.
449
2f6d557f 4502019-03-11 Martin Liska <mliska@suse.cz>
451
452 * call.c (convert_arg_to_ellipsis): Wrap an option name
453 in a string format message and fix GNU coding style.
454 (build_over_call): Likewise.
455 * class.c (check_field_decl): Likewise.
456 (layout_nonempty_base_or_field): Likewise.
457 * constexpr.c (cxx_eval_loop_expr): Likewise.
458 * cvt.c (type_promotes_to): Likewise.
459 * decl.c (cxx_init_decl_processing): Likewise.
460 (mark_inline_variable): Likewise.
461 (grokdeclarator): Likewise.
462 * decl2.c (record_mangling): Likewise.
463 * error.c (maybe_warn_cpp0x): Likewise.
464 * except.c (doing_eh): Likewise.
465 * mangle.c (maybe_check_abi_tags): Likewise.
466 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
467 (cp_parser_userdef_numeric_literal): Likewise.
468 (cp_parser_primary_expression): Likewise.
469 (cp_parser_unqualified_id): Likewise.
470 (cp_parser_pseudo_destructor_name): Likewise.
471 (cp_parser_builtin_offsetof): Likewise.
472 (cp_parser_lambda_expression): Likewise.
473 (cp_parser_lambda_introducer): Likewise.
474 (cp_parser_lambda_declarator_opt): Likewise.
475 (cp_parser_selection_statement): Likewise.
476 (cp_parser_init_statement): Likewise.
477 (cp_parser_decomposition_declaration): Likewise.
478 (cp_parser_function_specifier_opt): Likewise.
479 (cp_parser_static_assert): Likewise.
480 (cp_parser_simple_type_specifier): Likewise.
481 (cp_parser_namespace_definition): Likewise.
482 (cp_parser_using_declaration): Likewise.
483 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
484 (cp_parser_initializer_list): Likewise.
485 (cp_parser_type_parameter_key): Likewise.
486 (cp_parser_member_declaration): Likewise.
487 (cp_parser_try_block): Likewise.
488 (cp_parser_std_attribute_spec): Likewise.
489 (cp_parser_requires_clause_opt): Likewise.
490 * pt.c (check_template_variable): Likewise.
491 (check_default_tmpl_args): Likewise.
492 (push_tinst_level_loc): Likewise.
493 (instantiate_pending_templates): Likewise.
494 (invalid_nontype_parm_type_p): Likewise.
495 * repo.c (get_base_filename): Likewise.
496 * rtti.c (typeid_ok_p): Likewise.
497 (build_dynamic_cast_1): Likewise.
498 * tree.c (maybe_warn_parm_abi): Likewise.
499
29005d9c 5002019-03-08 Jakub Jelinek <jakub@redhat.com>
501
000969f9 502 PR other/80058
503 * parser.c (cp_parser_template_declaration_after_parameters): Avoid
504 one space before " at the end of line and another after " on another
505 line in a string literal.
506
94a62c5a 507 PR tree-optimization/89550
508 * semantics.c (maybe_convert_cond): Only set TREE_NO_WARNING if
509 warning_at returned true.
510 * decl2.c (c_parse_final_cleanups): Likewise.
511 * typeck.c (convert_for_assignment): Likewise.
512 * decl.c (finish_function): Likewise.
513
222c113b 514 PR c++/89585
515 * parser.c (cp_parser_asm_definition): Just warn instead of error
516 on volatile qualifier outside of function body.
517
92651efb 518 PR c++/89599
519 * constexpr.c (potential_constant_expression_1): Reject
520 REINTERPRET_CAST_P NOP_EXPRs.
521
29005d9c 522 PR c++/89622
523 * call.c (joust): Call print_z_candidate only if pedwarn returned
524 true.
525
bddb19c4 5262019-03-07 Jason Merrill <jason@redhat.com>
527
84982f0e 528 PR c++/88123 - lambda and using-directive.
529 * name-lookup.c (op_unqualified_lookup)
530 (maybe_save_operator_binding, discard_operator_bindings)
531 (push_operator_bindings): New.
532 * typeck.c (build_x_binary_op, build_x_unary_op): Call
533 maybe_save_operator_binding.
534 * decl.c (start_preparsed_function): Call push_operator_bindings.
535 * tree.c (cp_free_lang_data): Call discard_operator_bindings.
536
bddb19c4 537 PR c++/88820 - ICE with CTAD and member template used in DMI.
538 * pt.c (do_class_deduction): Handle parm used as its own arg.
539
02a7fc59 5402019-03-07 Jakub Jelinek <jakub@redhat.com>
541
542 PR c++/89585
543 * parser.c (cp_parser_asm_definition): Parse asm qualifiers even
544 at toplevel, but diagnose them.
545
bc17f5fd 5462019-03-06 Jason Merrill <jason@redhat.com>
547
548 PR c++/89381 - implicit copy and using-declaration.
549 * class.c (classtype_has_move_assign_or_move_ctor_p): Don't consider
550 op= brought in by a using-declaration.
551
aa49bda0 5522019-03-06 Jakub Jelinek <jakub@redhat.com>
553
554 PR c++/87148
555 * init.c (build_value_init_noctor): Ignore flexible array members.
556
02daf5d2 5572019-03-06 Jason Merrill <jason@redhat.com>
558
559 PR c++/89576 - if constexpr of lambda capture.
560 * semantics.c (maybe_convert_cond): Do convert a non-dependent
561 condition in a template.
562 * typeck.c (condition_conversion): Handle being called in a
563 template.
564
55d0cc00 5652019-03-06 Marek Polacek <polacek@redhat.com>
566
567 PR c++/87378 - bogus -Wredundant-move warning.
568 * typeck.c (maybe_warn_pessimizing_move): See if the maybe-rvalue
569 overload resolution would actually succeed.
570
cd5a9ed1 5712019-03-05 Jason Merrill <jason@redhat.com>
572
573 * class.c (is_really_empty_class): Add ignore_vptr parm.
574 (trivial_default_constructor_is_constexpr): Pass it.
575 * call.c (build_over_call): Pass it.
576 * constexpr.c (cxx_eval_constant_expression): Pass it instead of
577 checking TYPE_POLYMORPHIC_P.
578 (cxx_eval_component_reference, potential_constant_expression_1):
579 Pass it.
580 * cp-gimplify.c (simple_empty_class_p): Pass it.
581 * init.c (expand_aggr_init_1): Pass it.
582
1751c288 5832019-03-04 Paolo Carlini <paolo.carlini@oracle.com>
584
585 PR c++/84605
586 * parser.c (cp_parser_class_head): Reject TYPE_BEING_DEFINED too.
587
10599713 5882019-03-04 Jakub Jelinek <jakub@redhat.com>
589
590 PR c++/71446
591 * call.c (field_in_pset): New function.
592 (build_aggr_conv): Handle CONSTRUCTOR_IS_DESIGNATED_INIT correctly.
593
73e3d2ee 5942019-03-02 Jakub Jelinek <jakub@redhat.com>
595
596 PR c++/71446
597 * cp-tree.h (CONSTRUCTOR_IS_DESIGNATED_INIT): Define.
598 * parser.c (cp_parser_braced_list): Adjust cp_parser_initializer_list
599 caller, set CONSTRUCTOR_IS_DESIGNATED_INIT.
600 (cp_parser_initializer_list): Add designated parameter, set *designated
601 to a bool whether any designators were parsed.
602 * decl.c (reshape_init): Copy over CONSTRUCTOR_IS_DESIGNATED_INIT if
603 needed.
604 * pt.c (tsubst_copy_and_build): Likewise.
605 * call.c (implicit_conversion): If CONSTRUCTOR_IS_DESIGNATED_INIT,
606 don't call build_list_conv, nor build_complex_conv, nor attempt to
607 convert a single element initializer to scalar.
608
f409a882 6092019-03-01 Marek Polacek <polacek@redhat.com>
610
ae8e3cb6 611 PR c++/89537 - missing location for error with non-static member fn.
612 * call.c (resolve_args): Use EXPR_LOCATION.
613 * typeck.c (build_class_member_access_expr): Use input_location.
614
f409a882 615 PR c++/89532 - ICE with incomplete type in decltype.
616 * semantics.c (finish_compound_literal): Return error_mark_node
617 if digest_init_flags returns error_mark_node.
618
b279a142 6192019-03-01 Jakub Jelinek <jakub@redhat.com>
620
621 Implement P1002R1, Try-catch blocks in constexpr functions
622 PR c++/89513
623 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
624 Diagnose constexpr ctor or function with function-try-block with
625 pedwarn for c++17 and earlier. Formatting fix.
626 (cp_parser_try_block): Use pedwarn instead of error and only for
627 c++17 and earlier when try block appears in constexpr function.
628 * constexpr.c (build_constexpr_constructor_member_initializers):
629 Handle TRY_BLOCK here instead of erroring on it.
630
c7110ca7 6312019-02-28 Jason Merrill <jason@redhat.com>
632
bb019931 633 PR c++/88183 - ICE with .* fold-expression.
634 * pt.c (fold_expression) [DOTSTAR_EXPR]: Remove special handling.
635
9b4cf3ba 636 PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
637 * class.c, lambda.c, pt.c: Revert earlier change.
638 * lambda.c (add_capture): Don't special-case capture of dependent
639 VLA.
640
c7110ca7 641 * name-lookup.c (print_binding_level): Print this_entity.
642
90c2137c 6432019-02-27 Marek Polacek <polacek@redhat.com>
644
645 PR c++/88857 - ICE with value-initialization of argument in template.
646 * call.c (convert_like_real): Don't call build_value_init in template.
647
9ecd4044 6482019-02-27 Jason Merrill <jason@redhat.com>
649
650 PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
651 * semantics.c (process_outer_var_ref): Do capture dependent vars.
652 * class.c (finish_struct): Only add TAG_DEFN if T is in
653 current_function_decl.
654 * lambda.c (vla_capture_type): Force the capture type out into the
655 lambda's enclosing function.
656 (add_capture): Pass in the lambda.
657 * pt.c (tsubst_lambda_expr): complete_type a VLA capture type.
658
7304edd1 6592019-02-27 Marek Polacek <polacek@redhat.com>
660
661 PR c++/89511 - ICE with using-declaration and unscoped enumerator.
662 * parser.c (cp_parser_using_declaration): For an unscoped enum
663 only use its context if it's not a function declaration.
664
c9f30cbb 6652019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
666
667 PR c++/89488
668 * method.c (process_subob_fn): When maybe_instantiate_noexcept
669 returns false don't call merge_exception_specifiers.
670
6712019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
672
673 PR c++/88987
674 * parser.c (cp_parser_noexcept_specification_opt): Return NULL_TREE
675 for a non-constant parsed expression.
676
a165fd90 6772019-02-26 Jakub Jelinek <jakub@redhat.com>
678
679 PR c++/89481
680 * constexpr.c (cxx_eval_store_expression): When changing active union
681 member, set no_zero_init.
682
c005651d 6832019-02-23 Marek Polacek <polacek@redhat.com>
684
685 PR c++/88294 - ICE with non-constant noexcept-specifier.
686 * pt.c (maybe_instantiate_noexcept): Set up the list of local
687 specializations. Set current_class_{ptr,ref}.
688
689cc9b6 6892019-02-22 David Malcolm <dmalcolm@redhat.com>
690
691 PR c++/89390
692 * parser.c (cp_parser_unqualified_id): Capture and use locations
693 for destructors.
694
e7652833 6952019-02-22 Marek Polacek <polacek@redhat.com>
696
697 PR c++/89420 - ICE with CAST_EXPR in explicit-specifier.
698 * decl.c (build_explicit_specifier): Don't check
699 processing_template_decl. Call instantiation_dependent_expression_p
700 instead of value_dependent_expression_p. Call
701 instantiate_non_dependent_expr_sfinae before
702 build_converted_constant_expr instead of calling
703 instantiate_non_dependent_expr after it. Add
704 processing_template_decl_sentinel.
705
51391c1d 7062019-02-22 Thomas Schwinge <thomas@codesourcery.com>
707
708 * parser.c (cp_parser_oacc_simple_clause): Remove parser formal
709 parameter, move loc formal parameter to the front. Adjust all
710 users.
711 (cp_parser_oacc_shape_clause): Add loc formal parameter. Adjust
712 all users.
713
b6700c1a 7142019-02-21 Jason Merrill <jason@redhat.com>
715
532cca3f 716 PR c++/87685 - generic lambda 'this' capture error.
717 * lambda.c (lambda_expr_this_capture): Change add_capture_p to int.
718 (maybe_generic_this_capture): Pass -1.
719
a7ea8f96 720 PR c++/88394 - ICE with VLA init-capture.
721 * lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE.
722
e2d4b8be 723 PR c++/88869 - C++17 ICE with CTAD and explicit specialization.
724 * pt.c (do_class_deduction): Don't include explicit specialization
725 args in outer_args.
726
b6700c1a 727 PR c++/89422 - ICE with -g and lambda in default arg in template.
728 * pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner.
729
147a31b6 7302019-02-21 Jason Merrill <jason@redhat.com>
731
732 PR c++/88419 - C++17 ICE with class template arg deduction.
733 * pt.c (make_template_placeholder): Set TYPE_CANONICAL after
734 CLASS_PLACEHOLDER_TEMPLATE.
735
02d7a132 7362019-02-21 Jakub Jelinek <jakub@redhat.com>
737
738 PR c++/89285
739 * constexpr.c (struct constexpr_fundef): Add parms and result members.
740 (retrieve_constexpr_fundef): Adjust for the above change.
741 (register_constexpr_fundef): Save constexpr body with copy_fn,
742 temporarily set DECL_CONTEXT on DECL_RESULT before that.
743 (get_fundef_copy): Change FUN argument to FUNDEF with
744 constexpr_fundef * type, grab body and parms/result out of
745 constexpr_fundef struct and temporarily change it for copy_fn calls
746 too.
747 (cxx_eval_builtin_function_call): For __builtin_FUNCTION temporarily
748 adjust current_function_decl from ctx->call context. Test
749 !potential_constant_expression instead of !is_constant_expression.
750 (cxx_bind_parameters_in_call): Grab parameters from new_call. Undo
751 convert_for_arg_passing changes for TREE_ADDRESSABLE type passing.
752 (cxx_eval_call_expression): Adjust get_fundef_copy caller.
753 (cxx_eval_conditional_expression): For IF_STMT, allow then or else
754 operands to be NULL.
755 (label_matches): Handle BREAK_STMT and CONTINUE_STMT.
756 (cxx_eval_loop_expr): Add support for FOR_STMT, WHILE_STMT and DO_STMT.
757 (cxx_eval_switch_expr): Add support for SWITCH_STMT.
758 (cxx_eval_constant_expression): Handle IF_STMT, FOR_STMT, WHILE_STMT,
759 DO_STMT, CONTINUE_STMT, SWITCH_STMT, BREAK_STMT and CONTINUE_STMT.
760 For SIZEOF_EXPR, recurse on the result of fold_sizeof_expr. Ignore
761 DECL_EXPR with USING_DECL operand.
762 * lambda.c (maybe_add_lambda_conv_op): Build thisarg using
763 build_int_cst to make it a valid constant expression.
764
dcd8f919 7652019-02-20 Jason Merrill <jason@redhat.com>
766
767 PR c++/88690 - C++17 ICE with empty base in aggregate.
768 * typeck2.c (process_init_constructor_record): Skip trivial
769 initialization of an empty base.
770
309e5f71 7712019-02-21 Richard Biener <rguenther@suse.de>
772
773 PR middle-end/89392
774 * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not
775 make symtab process new functions here.
776
4e60ed29 7772019-02-20 Jason Merrill <jason@redhat.com>
778
779 PR c++/87921 - wrong error with inline static data member.
780 * decl2.c (finish_static_data_member_decl): Don't set DECL_IN_AGGR_P
781 for a non-template inline variable. Do nothing for an
782 already-instantiated variable.
783 (c_parse_final_cleanups): Check DECL_IN_AGGR_P without
784 DECL_INLINE_VAR_P.
785 * decl.c (check_initializer): Likewise.
786 (make_rtl_for_nonlocal_decl): Likewise.
787 * pt.c (instantiate_decl): Likewise.
788 * typeck2.c (store_init_value): Likewise.
789
b47245f1 7902019-02-20 Jakub Jelinek <jakub@redhat.com>
791
0c3f2aa9 792 PR c++/89403
793 * decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting
794 for flag_syntax_only from here...
795 * semantics.c (expand_or_defer_fn_1): ... here.
796
02dc6028 797 PR c++/89405
798 * decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and
799 DECL_COMMON, set DECL_INTERFACE_KNOWN.
800
b47245f1 801 PR c++/89336
802 * constexpr.c (cxx_eval_store_expression): Diagnose changing of active
803 union member for -std=c++17 and earlier.
804
af48cea2 8052019-02-19 Jason Merrill <jason@redhat.com>
806
807 PR c++/87513 - 'sorry' mangling PMF template-id.
808 * mangle.c (write_expression): Handle SCOPE_REF to BASELINK.
809
fd8a4665 8102019-02-19 Jason Merrill <jason@redhat.com>
811
812 PR c++/88380 - wrong-code with flexible array and NSDMI.
813 * typeck2.c (process_init_constructor_record): Skip flexarrays.
814
53ceddc9 8152019-02-20 will wray <wjwray@gmail.com>
816
817 PR c++/88572 - wrong handling of braces on scalar init.
818 * decl.c (reshape_init_r): Allow braces around scalar initializer
819 within aggregate init. Reject double braced-init of scalar
820 variable.
821
ab0fbe16 8222019-02-20 Paolo Carlini <paolo.carlini@oracle.com>
823
824 PR c++/84536
825 * pt.c (tsubst_init): Diagnose an initializer expanding to an
826 empty list of expressions; tweak wrt dependent types.
827 (regenerate_decl_from_template): For VAR_DECLs call tsubst_init
828 instead of tsubst_expr.
829
ce7f22f1 8302019-02-19 Jason Merrill <jason@redhat.com>
831
832 PR c++/88368 - wrong 'use of deleted function'
833 * method.c (walk_field_subobs): Remember errors from get_nsdmi.
834 (get_defaulted_eh_spec): Call push_tinst_level.
835 * pt.c (maybe_instantiate_noexcept): Keep error_mark_node.
836 * typeck2.c (merge_exception_specifiers): Handle error_mark_node.
837
d572a4c3 8382019-02-19 Chung-Lin Tang <cltang@codesourcery.com>
839
840 PR c/87924
841 * parser.c (cp_parser_oacc_clause_wait): Add representation of wait
842 clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.
843
31358ed0 8442019-02-19 Jakub Jelinek <jakub@redhat.com>
845
5ebe5c44 846 PR c++/89387
847 * lambda.c (maybe_generic_this_capture): Don't check
848 DECL_NONSTATIC_MEMBER_FUNCTION_P on USING_DECLs.
849
fcea8c4d 850 PR c++/89391
851 * typeck.c (build_reinterpret_cast_1): Don't handle void to
852 && conversion go through build_target_expr_with_type.
853
31358ed0 854 PR c++/89390
855 * error.c (qualified_name_lookup_error): Only call
856 suggest_alternative_in_scoped_enum if name is IDENTIFIER_NODE.
857
25694c85 8582019-02-19 Tom Honermann <tom@honermann.net>
859
860 * name-lookup.c (get_std_name_hint): Added u8string as a name hint.
861
a1e1b603 8622019-02-18 Jason Merrill <jason@redhat.com>
863
6aaacaf1 864 PR c++/89336 - multiple stores in constexpr stmt.
865 * constexpr.c (cxx_eval_store_expression): Preevaluate scalar or
866 assigned value.
867
f6347d1a 868 * pt.c (check_explicit_specialization): If the declarator is a
869 template-id, only check whether the arguments are dependent.
870
a1e1b603 871 Improve duplicate [[likely]] diagnostic.
872 * parser.c (cp_parser_statement): Make attrs_loc a range. Pass it
873 to process_stmt_hotness_attribute.
874 * cp-gimplify.c (process_stmt_hotness_attribute): Take attrs_loc.
875 (genericize_if_stmt): Use likely/unlikely instead of predictor_name.
876
33e6651d 8772019-02-17 Marek Polacek <polacek@redhat.com>
878
879 PR c++/89217 - ICE with list-initialization in range-based for loop.
880 * constexpr.c (unshare_constructor): No longer static.
881 * cp-tree.h (unshare_constructor): Declare.
882 * semantics.c (finish_compound_literal): When dealing with a
883 non-dependent expression in a template, return the original
884 expression. Pass LOOKUP_NO_NARROWING to digest_init_flags.
885
3a860627 8862019-02-13 Marek Polacek <polacek@redhat.com>
887
888 PR c++/89297 - ICE with OVERLOAD in template.
889 * semantics.c (finish_compound_literal): Call
890 instantiate_non_dependent_expr_sfinae.
891
601c59dd 8922019-02-13 Alexandre Oliva <aoliva@redhat.com>
893
40563cf7 894 PR c++/86379
895 * cp-tree.h (USING_DECL_SCOPE): Use result rather than type.
896 * name-lookup.c (strip_using_decl): Use USING_DECL_SCOPE.
897 * search.c (protected_accessible_p): Follow USING_DECL_DECLS.
898 (shared_member_p): Likewise.
899 (lookup_member): Likewise.
900 * decl.c (grok_special_member_properties): Skip USING_DECLs.
901 * semantics.c (finish_omp_declare_simd_methods): Likewise.
902 (finish_qualified_id_expr): Do not call shared_member_p with
903 a dependent expr.
904
601c59dd 905 PR c++/87322
906 * pt.c (tsubst_lambda_expr): Avoid duplicate tsubsting.
907 Move cp_evaluated resetting before signature tsubsting.
908 (gen_elem_of_pack_expansion_instantiation): Separate local
909 specializations per index.
910
f2da1a76 9112019-02-13 David Malcolm <dmalcolm@redhat.com>
912
913 PR c++/89036
914 * class.c (add_method): Drop destructor assertion.
915
64bd49fa 9162019-02-13 Paolo Carlini <paolo.carlini@oracle.com>
917
918 PR c++/88986
919 * decl.c (make_typename_type): Allow for TYPE_PACK_EXPANSION as
920 context (the first argument).
921 * pt.c (tsubst, case TYPENAME_TYPE): Handle TYPE_PACK_EXPANSION
922 as context.
923
c8e19553 9242019-02-12 Jason Merrill <jason@redhat.com>
925
926 PR c++/89144 - link error with constexpr initializer_list.
927 * call.c (convert_like_real) [ck_list]: Don't allocate a temporary
928 array for an empty list.
929 * typeck2.c (store_init_value): Don't use cxx_constant_init in a
930 template.
931
33fe677e 9322019-02-11 Jason Merrill <jason@redhat.com>
933
934 PR c++/89241 - ICE with __func__ in lambda in template.
935 * pt.c (enclosing_instantiation_of): Also check
936 instantiated_lambda_fn_p for the template context.
937
44263306 9382019-02-11 Marek Polacek <polacek@redhat.com>
939
940 PR c++/89212 - ICE converting nullptr to pointer-to-member-function.
941 * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Return early for
942 null member pointer value.
943
61b94553 9442019-02-11 Jakub Jelinek <jakub@redhat.com>
945
946 PR c++/88977
947 * pt.c (convert_nontype_argument): Pass true as manifestly_const_eval
948 to maybe_constant_value calls.
949
b10193f4 9502019-02-11 Marek Polacek <polacek@redhat.com>
951
952 * typeck2.c (digest_init_r): Remove commented code.
953
08acf739 9542019-02-11 Martin Sebor <msebor@redhat.com>
955
956 PR c++/87996
957 * decl.c (compute_array_index_type_loc): Preserve signed sizes
958 for diagnostics. Call valid_array_size_p instead of error.
959 * init.c (build_new_1): Compute size for diagnostic. Call
960 invalid_array_size_error
961 (build_new): Call valid_array_size_p instead of error.
962
939d44f3 9632019-02-07 Alexandre Oliva <aoliva@redhat.com>
964
965 PR c++/86218
966 * call.c (compare_ics): Deal with ck_aggr in either cs.
967
c92ab8d4 9682019-02-06 David Malcolm <dmalcolm@redhat.com>
969
970 PR c++/71302
971 * call.c (get_location_for_expr_unwinding_for_system_header): New
972 function.
973 (conversion_null_warnings): Use it when getting locations for
974 EXPR, effectively adding a call to
975 get_location_for_expr_unwinding_for_system_header for
976 -Wconversion-null and making use of EXPR_LOCATION for
977 -Wzero-as-null-pointer-constant.
978
b5a6b127 9792019-02-05 Jakub Jelinek <jakub@redhat.com>
980
981 PR c++/89187
982 * optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on
983 PARM_DECLs of the thunk.
984 * lambda.c (maybe_add_lambda_conv_op): Likewise.
985
74ce2ebb 9862019-02-05 Marek Polacek <polacek@redhat.com>
987
988 PR c++/89158 - by-value capture of constexpr variable broken.
989 * call.c (convert_like_real) <case ck_user>: Call mark_exp_read
990 instead of mark_rvalue_use.
991
9ca54fa1 9922019-02-05 Alexandre Oliva <aoliva@redhat.com>
993
994 PR c++/87770
995 * pt.c (instantiates_primary_template_p): New.
996 (type_dependent_expression_p): Use it.
997
c758dd5a 9982019-02-01 Jason Merrill <jason@redhat.com>
999
1000 PR c++/88761 - ICE with reference capture of constant.
1001 * lambda.c (mark_const_cap_r): Do walk subtrees of DECL_EXPR for
1002 non-proxy decls.
1003
bdb43276 10042019-02-01 Marek Polacek <polacek@redhat.com>
1005
1006 PR c++/88325 - ICE with invalid out-of-line template member definition.
1007 * parser.c (cp_parser_class_name): Don't call make_typename_type
1008 for overloads.
1009
5ab8180e 10102019-02-01 Jakub Jelinek <jakub@redhat.com>
1011
1012 PR c++/87175
1013 * parser.c (cp_parser_gnu_attributes_opt): Set ok to false
1014 if require_open failed.
1015
c8f861a0 10162019-01-31 Marek Polacek <polacek@redhat.com>
1017
1018 PR c++/89083, c++/80864 - ICE with list initialization in template.
1019 * constexpr.c (adjust_temp_type): Use copy_node and change the type
1020 instead of using build_constructor.
1021 * decl.c (reshape_init_r): Don't reshape a digested initializer.
1022 Return the initializer for COMPOUND_LITERAL_P.
1023
f1329be6 1024 PR c++/88983 - ICE with switch in constexpr function.
1025 * constexpr.c (cxx_eval_switch_expr): Use SWITCH_COND and SWITCH_BODY.
1026 (cxx_eval_constant_expression) <case COND_EXPR>: Don't look for the
1027 label in the else branch if we found it in the then branch.
1028
8c28f0ef 10292019-01-30 Jason Merrill <jason@redhat.com>
1030
1031 PR c++/88752 - ICE with lambda and constexpr if.
1032 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New.
1033 * pt.c (tsubst_lambda_expr): Set it.
1034 (instantiated_lambda_fn_p): Check it.
1035 (enclosing_instantiation_of): Use it.
1036
abb9ae66 10372019-01-31 Jakub Jelinek <jakub@redhat.com>
1038
1039 PR libstdc++/88170
1040 * cxx-pretty-print.c (pp_cxx_enumeration_constant): Print always as
1041 a C cast in pp_c_flag_gnu_v3 mode.
1042
9b0e9786 10432019-01-30 Jakub Jelinek <jakub@redhat.com>
1044
1045 PR c++/88988
1046 * lambda.c (is_capture_proxy): Don't return true for
1047 DECL_OMP_PRIVATIZED_MEMBER artificial vars.
1048
7066144a 10492019-01-30 Marek Polacek <polacek@redhat.com>
1050
1051 PR c++/89119 - ICE with value-initialization in template.
1052 * pt.c (tsubst_copy_and_build): Handle RANGE_EXPR.
1053
64e3499e 10542019-01-29 Jason Merrill <jason@redhat.com>
1055
1056 PR c++/86943 - wrong code converting lambda to function pointer.
1057 * lambda.c (maybe_add_lambda_conv_op): Use a template-id in the
1058 call. Only forward parms for decltype.
1059 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Handle CALL_FROM_THUNK_P
1060 specially.
1061 * typeck.c (check_return_expr): Don't mess with a thunk call.
1062
107cba11 10632019-01-28 Jason Merrill <jason@redhat.com>
1064
1065 PR c++/89089 - ICE with [[no_unique_address]].
1066 PR c++/88865 - wrong layout with [[no_unique_address]].
1067 * class.c (check_field_decls): A potentially-overlapping field makes
1068 the class non-layout-POD, but not non-empty.
1069 (end_of_class): Always consider empty data members.
1070 (layout_class_type): Set DECL_SIZE for empty fields.
1071
44da2a17 10722019-01-28 Marek Polacek <polacek@redhat.com>
1073
1074 PR c++/88358 - name wrongly treated as type.
1075 * parser.c (cp_parser_direct_declarator): Don't assume a qualified-id
1076 in parameter-list is a type if the function's declarator-id is not
1077 qualified.
1078
1d41b42f 10792019-01-27 Marek Polacek <polacek@redhat.com>
1080
b7feeace 1081 PR c++/88815 - narrowing conversion lost in decltype.
1082 PR c++/78244 - narrowing conversion in template not detected.
1083 * cp-tree.h (CONSTRUCTOR_IS_DEPENDENT): New.
1084 * pt.c (instantiation_dependent_r): Consider a CONSTRUCTOR with
1085 CONSTRUCTOR_IS_DEPENDENT instantiation-dependent.
1086 * semantics.c (finish_compound_literal): When the compound literal
1087 isn't instantiation-dependent and the type isn't type-dependent,
1088 fall back to the normal processing. Set CONSTRUCTOR_IS_DEPENDENT.
1089
1d41b42f 1090 PR c++/89024 - ICE with incomplete enum type.
1091 * call.c (standard_conversion): When converting an
1092 ARITHMETIC_TYPE_P to an incomplete type, return NULL.
1093
837ddebd 10942019-01-25 Paolo Carlini <paolo.carlini@oracle.com>
1095
1096 PR c++/88969
1097 * call.c (build_op_delete_call): Implement 7.6.2.5/(10.1).
1098 * decl2.c (coerce_delete_type): Use build_pointer_type instead
1099 of TYPE_POINTER_TO.
1100
8c89c5fc 11012019-01-24 Jason Merrill <jason@redhat.com>
1102
1103 PR c++/89001 - mangling of reference temporaries
1104 * cp-tree.h (struct saved_scope): Add ref_temp_count.
1105 (current_ref_temp_count): New macro.
1106 * mangle.c (mangle_ref_init_variable): Use it.
1107 * typeck2.c (store_init_value): Clear it.
1108 * call.c (make_temporary_var_for_ref_to_temp): Copy public and
1109 comdat.
1110
b5e76680 11112019-01-24 Jakub Jelinek <jakub@redhat.com>
1112
1113 PR c++/88976
1114 * semantics.c (finish_omp_cancel): Diagnose more than one if
1115 on #pragma omp cancel with different modifiers. Use
1116 maybe_convert_cond when not in template or build_x_binary_op
1117 otherwise.
1118
dffbcba8 11192019-01-23 Marek Polacek <polacek@redhat.com>
1120
1121 PR c++/88757 - qualified name treated wrongly as type.
1122 * parser.c (cp_parser_direct_declarator): Don't treat qualified-ids
1123 in parameter-list as types if name lookup for declarator-id didn't
1124 find one or more function templates.
1125
1f03c410 11262019-01-23 Jakub Jelinek <jakub@redhat.com>
1127
8090d51c 1128 PR c/44715
1129 * cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only
1130 after genericizing cond and incr expressions.
1131
1f03c410 1132 PR c++/88984
1133 * cp-gimplify.c (genericize_switch_stmt): Move cond genericization
1134 before the begin_bc_block call.
1135
48c03f15 11362019-01-21 Jason Merrill <jason@redhat.com>
1137
1138 PR c++/87893 - constexpr ctor ICE on ARM.
1139 PR c++/88293 - ICE with comma expression.
1140 * constexpr.c (initialized_type): Don't shortcut non-void type.
1141 Handle COMPOUND_EXPR.
1142 (cxx_eval_outermost_constant_expr): Return early for void type.
1143
99bf4b63 11442019-01-21 Jakub Jelinek <jakub@redhat.com>
1145
77fe9474 1146 PR c++/88949
1147 * optimize.c (cxx_copy_decl): New function.
1148 (clone_body): Use it instead of copy_decl_no_change.
1149
99bf4b63 1150 PR sanitizer/88901
1151 * typeck.c (cp_build_binary_op): Don't instrument
1152 SANITIZE_POINTER_COMPARE if processing_template_decl.
1153 (pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT.
1154
ecd2d842 11552019-01-18 Jason Merrill <jason@redhat.com>
1156
1157 PR c++/88875 - error with explicit list constructor.
1158 * call.c (reference_binding): Don't modify EXPR. Set
1159 need_temporary_p on the ck_user conversion for a temporary.
1160 (convert_like_real): Check it.
1161
6d4e8a95 11622019-01-18 H.J. Lu <hongjiu.lu@intel.com>
1163
1164 PR c/51628
1165 PR c/88664
1166 * call.c (convert_for_arg_passing): Upate the
1167 warn_for_address_or_pointer_of_packed_member call.
1168 * typeck.c (convert_for_assignment): Likewise.
1169
9d3c4130 11702019-01-17 Jason Merrill <jason@redhat.com>
1171
bc9c0483 1172 PR c++/86205 - ICE with ?: of throw and template-id.
1173 * pt.c (resolve_nondeduced_context_or_error): Split out from...
1174 * typeck.c (decay_conversion): ...here.
1175 * call.c (build_conditional_expr_1): Use it.
1176
9d3c4130 1177 PR c++/86740, ICE with constexpr if and nested generic lambdas.
1178 * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR.
1179
0f910e62 11802019-01-17 Paolo Carlini <paolo.carlini@oracle.com>
1181
1182 * decl.c (grokdeclarator): Use typespec_loc in error messages
1183 about 'auto' and trailing return type.
1184
098cc8f0 11852019-01-17 David Malcolm <dmalcolm@redhat.com>
1186
1187 PR c++/88699
1188 * class.c (add_method): Don't use DECL_DESTRUCTOR_P on
1189 USING_DECLs.
1190
a395125a 11912019-01-17 Nathan Sidwell <nathan@acm.org>
1192
1193 PR c++/86610
1194 * semantics.c (process_outer_var_ref): Only skip dependent types
1195 in templates.
1196
5461905d 11972019-01-17 Alexandre Oliva <aoliva@redhat.com>
1198
c5f929a4 1199 PR c++/87768
1200 * cp-tree.h (saved_scope): Add suppress_location_wrappers.
1201 * name-lookup.c (do_push_to_top_level): Save and reset it.
1202 (do_pop_from_top_level): Restore it.
1203
f97941b7 1204 PR c++/86648
1205 * pt.c (make_template_placeholder): Use auto_identifier.
1206 (is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test.
1207 * error.c (dump_type): Handle template placeholders.
1208 * cxx-pretty-print.c (pp_cx_unqualified_id): Likewise.
1209
5461905d 1210 PR c++/88146
1211 * cvt.c (convert_to_void): Handle all cdtor calls as if
1212 returning void.
1213
b92cc3ed 12142019-01-16 Paolo Carlini <paolo.carlini@oracle.com>
1215
1216 * decl.c (grokdeclarator): Use locations[ds_storage_class] in
1217 error messages about ill-formed uses of mutable.
1218
9fc2172c 12192019-01-16 Marek Polacek <polacek@redhat.com>
1220
1221 PR c++/78244 - narrowing conversion in template not detected.
1222 * call.c (perform_implicit_conversion_flags): Set
1223 IMPLICIT_CONV_EXPR_BRACED_INIT.
1224 * cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New.
1225 * pt.c (tsubst_copy_and_build): Use it.
1226
727d210b 12272019-01-15 David Malcolm <dmalcolm@redhat.com>
1228
1229 PR c++/88795
1230 * pt.c (build_deduction_guide): Bail out if tsubst_arg_types
1231 fails.
1232
39a51021 12332019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
1234
1235 * decl.c (start_decl): Improve error location.
1236 * decl2.c (grokfield): Likewise.
1237
12382019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
1239
1240 * decl.c (grokdeclarator): Move further up the location_t loc
1241 declaration and use the location when building a TYPE_DECL for
1242 a typedef name.
1243 * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error
1244 about an ill-formed bit-field as typedef.
1245
affca1c8 12462019-01-14 Marek Polacek <polacek@redhat.com>
1247
1248 PR c++/88830 - ICE with abstract class.
1249 * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR.
1250 Fix formatting.
1251
9f8a8956 1252 PR c++/88825 - ICE with bogus function return type deduction.
1253 * typeck.c (can_do_nrvo_p): Check error_mark_node.
1254
82362779 12552019-01-14 Tom Honermann <tom@honermann.net>
1256
1257 Implement P0482R5, char8_t: A type for UTF-8 characters and strings
1258 * cvt.c (type_promotes_to): Handle char8_t promotion.
1259 * decl.c (grokdeclarator): Handle invalid type specifier
1260 combinations involving char8_t.
1261 * lex.c (init_reswords): Add char8_t as a reserved word.
1262 * mangle.c (write_builtin_type): Add name mangling for char8_t (Du).
1263 * parser.c (cp_keyword_starts_decl_specifier_p)
1264 (cp_parser_simple_type_specifier): Recognize char8_t as a simple
1265 type specifier.
1266 (cp_parser_string_literal): Use char8_array_type_node for the type
1267 of CPP_UTF8STRING.
1268 (cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system
1269 headers.
1270 * rtti.c (emit_support_tinfos): type_info support for char8_t.
1271 * tree.c (char_type_p): Recognize char8_t as a character type.
1272 * typeck.c (string_conv_p): Handle conversions of u8 string
1273 literals of char8_t type.
1274 (check_literal_operator_args): Handle UDLs with u8 string literals
1275 of char8_t type.
1276 * typeck2.c (ordinary_char_type_p): New.
1277 (digest_init_r): Disallow initializing a char array with a u8 string
1278 literal.
1279
bf4eb32b 12802019-01-14 Martin Liska <mliska@suse.cz>
1281
1282 PR gcov-profile/88263
1283 * decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION
1284 as location of the TLS wrapper.
1285
2fa582a9 12862019-01-12 Paolo Carlini <paolo.carlini@oracle.com>
1287
1288 * decl.c (cp_finish_decl): Improve error location.
1289 * decl2.c (grokfield): Likewise, improve two locations.
1290
0b5957b9 12912019-01-11 Marek Polacek <polacek@redhat.com>
1292
1293 PR c++/88692, c++/87882 - -Wredundant-move false positive with *this.
1294 * typeck.c (maybe_warn_pessimizing_move): Return if ARG isn't
1295 ADDR_EXPR.
1296
d07c152b 12972019-01-11 Jason Merrill <jason@redhat.com>
1298
1299 PR c++/88312 - pack expansion of decltype.
1300 * pt.c (instantiation_dependent_r): A template non-type parameter
1301 pack is instantiation-dependent.
1302
0c2ebbc4 13032019-01-11 Jason Merrill <jason@redhat.com>
1304
1305 PR c++/88613 - ICE with use of const var in lambda.
1306 * expr.c (mark_use): Fix location wrapper handling.
1307 * cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use.
1308
1b2f170e 13092019-01-11 Tobias Burnus <burnus@net-b.de>
1310
1311 PR C++/88114
1312 * decl2.c (maybe_emit_vtables): If needed, generate code for
1313 the destructor of an abstract class.
1314 (mark_used): Update comment for older function-name change.
1315
b385e516 13162019-01-11 Paolo Carlini <paolo.carlini@oracle.com>
1317
1318 * decl.c (start_decl): Improve error location.
1319 (grokdeclarator): Likewise, improve two locations.
1320
f4d3c071 13212019-01-09 Sandra Loosemore <sandra@codesourcery.com>
1322
1323 PR other/16615
1324
1325 * cp-tree.h: Mechanically replace "can not" with "cannot".
1326 * parser.c: Likewise.
1327 * pt.c: Likewise.
1328
7cc45975 13292019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
1330
1331 * decl.c (grok_reference_init): Improve error location.
1332 (grokdeclarator): Likewise, improve two locations.
1333
90e20c9c 13342019-01-08 Marek Polacek <polacek@redhat.com>
1335
91902bb4 1336 PR c++/88538 - braced-init-list in template-argument-list.
1337 * parser.c (cp_parser_template_argument): Handle braced-init-list when
1338 in C++20.
1339
90e20c9c 1340 PR c++/88548 - this accepted in static member functions.
1341 * parser.c (cp_debug_parser): Adjust printing of
1342 local_variables_forbidden_p.
1343 (cp_parser_new): Set local_variables_forbidden_p to 0 rather than false.
1344 (cp_parser_primary_expression): When checking
1345 local_variables_forbidden_p, use THIS_FORBIDDEN or
1346 LOCAL_VARS_FORBIDDEN.
1347 (cp_parser_lambda_body): Update the type of
1348 local_variables_forbidden_p. Set it to 0 rather than false.
1349 (cp_parser_condition): Adjust call to cp_parser_declarator.
1350 (cp_parser_explicit_instantiation): Likewise.
1351 (cp_parser_init_declarator): Likewise.
1352 (cp_parser_declarator): New parameter. Use it.
1353 (cp_parser_direct_declarator): New parameter. Use it to set
1354 local_variables_forbidden_p. Adjust call to cp_parser_declarator.
1355 (cp_parser_type_id_1): Adjust call to cp_parser_declarator.
1356 (cp_parser_parameter_declaration): Likewise.
1357 (cp_parser_default_argument): Update the type of
1358 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
1359 rather than true.
1360 (cp_parser_member_declaration): Tell cp_parser_declarator if we saw
1361 'static' or 'friend'.
1362 (cp_parser_exception_declaration): Adjust call to cp_parser_declarator.
1363 (cp_parser_late_parsing_default_args): Update the type of
1364 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
1365 rather than true.
1366 (cp_parser_cache_defarg): Adjust call to cp_parser_declarator.
1367 (cp_parser_objc_class_ivars): Likewise.
1368 (cp_parser_objc_struct_declaration): Likewise.
1369 (cp_parser_omp_for_loop_init): Likewise.
1370 * parser.h (cp_parser): Change the type of local_variables_forbidden_p
1371 to unsigned char.
1372 (LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN):
1373 Define.
1374
8f7d5246 13752019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
1376
1377 * decl.c (start_decl): Improve permerror location.
1378
6e5908c9 13792019-01-08 Jonathan Wakely <jwakely@redhat.com>
1380 Jakub Jelinek <jakub@redhat.com>
1381
1382 PR c++/88554
1383 * decl.c (finish_function): For -Wreturn-type don't add a return *this;
1384 fixit hint if current_class_ref is NULL. Use a single if instead of
1385 two nested ones.
1386
2318c037 13872019-01-07 Paolo Carlini <paolo.carlini@oracle.com>
1388
1389 * decl.c (start_decl): Improve two error_at locations.
1390 (expand_static_init): Likewise.
1391
677576f7 13922019-01-07 Marek Polacek <polacek@redhat.com>
1393
1394 PR c++/88741 - wrong error with initializer-string.
1395 * decl.c (cp_complete_array_type): Strip any location wrappers.
1396
c38103e8 13972019-01-07 Bernd Edlinger <bernd.edlinger@hotmail.de>
1398
1399 PR c++/88261
1400 PR c++/69338
1401 PR c++/69696
1402 PR c++/69697
1403 * cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value.
1404 * typeck2.c (digest_init_r): Raise an error for non-static
1405 initialization of a flexible array member.
1406 (process_init_constructor, massage_init_elt,
1407 process_init_constructor_array, process_init_constructor_record,
1408 process_init_constructor_union, process_init_constructor): Add the
1409 flags parameter and pass it thru.
1410 (store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to
1411 digest_init_flags for static decls.
1412
59409f09 14132019-01-07 Jakub Jelinek <jakub@redhat.com>
1414
1415 PR c++/85052
1416 * cp-tree.h (cp_build_vec_convert): Declare.
1417 * parser.c (cp_parser_postfix_expression): Parse
1418 __builtin_convertvector.
1419 * constexpr.c: Include fold-const-call.h.
1420 (cxx_eval_internal_function): Handle IFN_VEC_CONVERT.
1421 (potential_constant_expression_1): Likewise.
1422 * semantics.c (cp_build_vec_convert): New function.
1423 * pt.c (tsubst_copy_and_build): Handle CALL_EXPR to
1424 IFN_VEC_CONVERT.
1425
0627c5c9 14262019-01-03 Jakub Jelinek <jakub@redhat.com>
1427
1428 PR c++/88636
1429 * decl.c (builtin_function_1): Return result of pushdecl_top_level
1430 or pushdecl rather than decl.
1431
f9f7d90c 14322019-01-03 Paolo Carlini <paolo.carlini@oracle.com>
1433
1434 * tree.c (handle_nodiscard_attribute): Improve warning location.
1435
37fb9cf6 14362019-01-02 Marek Polacek <polacek@redhat.com>
1437
1438 PR c++/88612 - ICE with -Waddress-of-packed-member.
1439 * call.c (convert_for_arg_passing): Only give warnings with tf_warning.
1440 * typeck.c (convert_for_assignment): Likewise.
1441
6080dd2f 1442 PR c++/88631 - CTAD failing for value-initialization.
1443 * typeck2.c (build_functional_cast): Try deducing the template
1444 arguments even if there are no arguments to deduce from.
1445
fbd26352 14462019-01-01 Jakub Jelinek <jakub@redhat.com>
ca29c574 1447
8e8f6434 1448 Update copyright years.
7dfbd804 1449\f
fbd26352 1450Copyright (C) 2019 Free Software Foundation, Inc.
7dfbd804 1451
1452Copying and distribution of this file, with or without modification,
1453are permitted in any medium without royalty provided the copyright
1454notice and this notice are preserved.