]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/cp/ChangeLog
PR c++/89660 - bogus error with -Wredundant-move.
[thirdparty/gcc.git] / gcc / cp / ChangeLog
1 2019-03-13 Marek Polacek <polacek@redhat.com>
2
3 PR c++/88979 - further P0634 fix for constructors.
4 * parser.c (cp_parser_decl_specifier_seq): Pass flags to
5 cp_parser_constructor_declarator_p.
6 (cp_parser_direct_declarator): Allow missing typename for constructor
7 parameters.
8 (cp_parser_constructor_declarator_p): Add FLAGS parameter. Pass it to
9 cp_parser_type_specifier.
10
11 PR c++/89686 - mixing init-capture and simple-capture in lambda.
12 * parser.c (cp_parser_lambda_introducer): Give error when combining
13 init-capture and simple-capture.
14
15 PR c++/89660 - bogus error with -Wredundant-move.
16 * typeck.c (maybe_warn_pessimizing_move): Only accept (T &) &arg
17 as the std::move's argument. Don't call convert_for_initialization
18 when warn_redundant_move isn't on.
19
20 2019-03-11 Jason Merrill <jason@redhat.com>
21
22 PR c++/86521 - wrong overload resolution with ref-qualifiers.
23 * call.c (build_user_type_conversion_1): Don't use a conversion to a
24 reference of the wrong rvalueness for direct binding.
25
26 2019-03-11 Martin Liska <mliska@suse.cz>
27
28 * cvt.c (build_expr_type_conversion): Wrap apostrophes
29 in gcc internal format with %'.
30 * decl.c (check_no_redeclaration_friend_default_args): Likewise.
31 (grokfndecl): Likewise.
32 * name-lookup.c (do_pushtag): Likewise.
33 * pt.c (unify_parameter_deduction_failure): Likewise.
34 (unify_template_deduction_failure): Likewise.
35
36 2019-03-11 Martin Liska <mliska@suse.cz>
37
38 * call.c (convert_arg_to_ellipsis): Wrap an option name
39 in a string format message and fix GNU coding style.
40 (build_over_call): Likewise.
41 * class.c (check_field_decl): Likewise.
42 (layout_nonempty_base_or_field): Likewise.
43 * constexpr.c (cxx_eval_loop_expr): Likewise.
44 * cvt.c (type_promotes_to): Likewise.
45 * decl.c (cxx_init_decl_processing): Likewise.
46 (mark_inline_variable): Likewise.
47 (grokdeclarator): Likewise.
48 * decl2.c (record_mangling): Likewise.
49 * error.c (maybe_warn_cpp0x): Likewise.
50 * except.c (doing_eh): Likewise.
51 * mangle.c (maybe_check_abi_tags): Likewise.
52 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
53 (cp_parser_userdef_numeric_literal): Likewise.
54 (cp_parser_primary_expression): Likewise.
55 (cp_parser_unqualified_id): Likewise.
56 (cp_parser_pseudo_destructor_name): Likewise.
57 (cp_parser_builtin_offsetof): Likewise.
58 (cp_parser_lambda_expression): Likewise.
59 (cp_parser_lambda_introducer): Likewise.
60 (cp_parser_lambda_declarator_opt): Likewise.
61 (cp_parser_selection_statement): Likewise.
62 (cp_parser_init_statement): Likewise.
63 (cp_parser_decomposition_declaration): Likewise.
64 (cp_parser_function_specifier_opt): Likewise.
65 (cp_parser_static_assert): Likewise.
66 (cp_parser_simple_type_specifier): Likewise.
67 (cp_parser_namespace_definition): Likewise.
68 (cp_parser_using_declaration): Likewise.
69 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
70 (cp_parser_initializer_list): Likewise.
71 (cp_parser_type_parameter_key): Likewise.
72 (cp_parser_member_declaration): Likewise.
73 (cp_parser_try_block): Likewise.
74 (cp_parser_std_attribute_spec): Likewise.
75 (cp_parser_requires_clause_opt): Likewise.
76 * pt.c (check_template_variable): Likewise.
77 (check_default_tmpl_args): Likewise.
78 (push_tinst_level_loc): Likewise.
79 (instantiate_pending_templates): Likewise.
80 (invalid_nontype_parm_type_p): Likewise.
81 * repo.c (get_base_filename): Likewise.
82 * rtti.c (typeid_ok_p): Likewise.
83 (build_dynamic_cast_1): Likewise.
84 * tree.c (maybe_warn_parm_abi): Likewise.
85
86 2019-03-08 Jakub Jelinek <jakub@redhat.com>
87
88 PR other/80058
89 * parser.c (cp_parser_template_declaration_after_parameters): Avoid
90 one space before " at the end of line and another after " on another
91 line in a string literal.
92
93 PR tree-optimization/89550
94 * semantics.c (maybe_convert_cond): Only set TREE_NO_WARNING if
95 warning_at returned true.
96 * decl2.c (c_parse_final_cleanups): Likewise.
97 * typeck.c (convert_for_assignment): Likewise.
98 * decl.c (finish_function): Likewise.
99
100 PR c++/89585
101 * parser.c (cp_parser_asm_definition): Just warn instead of error
102 on volatile qualifier outside of function body.
103
104 PR c++/89599
105 * constexpr.c (potential_constant_expression_1): Reject
106 REINTERPRET_CAST_P NOP_EXPRs.
107
108 PR c++/89622
109 * call.c (joust): Call print_z_candidate only if pedwarn returned
110 true.
111
112 2019-03-07 Jason Merrill <jason@redhat.com>
113
114 PR c++/88123 - lambda and using-directive.
115 * name-lookup.c (op_unqualified_lookup)
116 (maybe_save_operator_binding, discard_operator_bindings)
117 (push_operator_bindings): New.
118 * typeck.c (build_x_binary_op, build_x_unary_op): Call
119 maybe_save_operator_binding.
120 * decl.c (start_preparsed_function): Call push_operator_bindings.
121 * tree.c (cp_free_lang_data): Call discard_operator_bindings.
122
123 PR c++/88820 - ICE with CTAD and member template used in DMI.
124 * pt.c (do_class_deduction): Handle parm used as its own arg.
125
126 2019-03-07 Jakub Jelinek <jakub@redhat.com>
127
128 PR c++/89585
129 * parser.c (cp_parser_asm_definition): Parse asm qualifiers even
130 at toplevel, but diagnose them.
131
132 2019-03-06 Jason Merrill <jason@redhat.com>
133
134 PR c++/89381 - implicit copy and using-declaration.
135 * class.c (classtype_has_move_assign_or_move_ctor_p): Don't consider
136 op= brought in by a using-declaration.
137
138 2019-03-06 Jakub Jelinek <jakub@redhat.com>
139
140 PR c++/87148
141 * init.c (build_value_init_noctor): Ignore flexible array members.
142
143 2019-03-06 Jason Merrill <jason@redhat.com>
144
145 PR c++/89576 - if constexpr of lambda capture.
146 * semantics.c (maybe_convert_cond): Do convert a non-dependent
147 condition in a template.
148 * typeck.c (condition_conversion): Handle being called in a
149 template.
150
151 2019-03-06 Marek Polacek <polacek@redhat.com>
152
153 PR c++/87378 - bogus -Wredundant-move warning.
154 * typeck.c (maybe_warn_pessimizing_move): See if the maybe-rvalue
155 overload resolution would actually succeed.
156
157 2019-03-05 Jason Merrill <jason@redhat.com>
158
159 * class.c (is_really_empty_class): Add ignore_vptr parm.
160 (trivial_default_constructor_is_constexpr): Pass it.
161 * call.c (build_over_call): Pass it.
162 * constexpr.c (cxx_eval_constant_expression): Pass it instead of
163 checking TYPE_POLYMORPHIC_P.
164 (cxx_eval_component_reference, potential_constant_expression_1):
165 Pass it.
166 * cp-gimplify.c (simple_empty_class_p): Pass it.
167 * init.c (expand_aggr_init_1): Pass it.
168
169 2019-03-04 Paolo Carlini <paolo.carlini@oracle.com>
170
171 PR c++/84605
172 * parser.c (cp_parser_class_head): Reject TYPE_BEING_DEFINED too.
173
174 2019-03-04 Jakub Jelinek <jakub@redhat.com>
175
176 PR c++/71446
177 * call.c (field_in_pset): New function.
178 (build_aggr_conv): Handle CONSTRUCTOR_IS_DESIGNATED_INIT correctly.
179
180 2019-03-02 Jakub Jelinek <jakub@redhat.com>
181
182 PR c++/71446
183 * cp-tree.h (CONSTRUCTOR_IS_DESIGNATED_INIT): Define.
184 * parser.c (cp_parser_braced_list): Adjust cp_parser_initializer_list
185 caller, set CONSTRUCTOR_IS_DESIGNATED_INIT.
186 (cp_parser_initializer_list): Add designated parameter, set *designated
187 to a bool whether any designators were parsed.
188 * decl.c (reshape_init): Copy over CONSTRUCTOR_IS_DESIGNATED_INIT if
189 needed.
190 * pt.c (tsubst_copy_and_build): Likewise.
191 * call.c (implicit_conversion): If CONSTRUCTOR_IS_DESIGNATED_INIT,
192 don't call build_list_conv, nor build_complex_conv, nor attempt to
193 convert a single element initializer to scalar.
194
195 2019-03-01 Marek Polacek <polacek@redhat.com>
196
197 PR c++/89537 - missing location for error with non-static member fn.
198 * call.c (resolve_args): Use EXPR_LOCATION.
199 * typeck.c (build_class_member_access_expr): Use input_location.
200
201 PR c++/89532 - ICE with incomplete type in decltype.
202 * semantics.c (finish_compound_literal): Return error_mark_node
203 if digest_init_flags returns error_mark_node.
204
205 2019-03-01 Jakub Jelinek <jakub@redhat.com>
206
207 Implement P1002R1, Try-catch blocks in constexpr functions
208 PR c++/89513
209 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
210 Diagnose constexpr ctor or function with function-try-block with
211 pedwarn for c++17 and earlier. Formatting fix.
212 (cp_parser_try_block): Use pedwarn instead of error and only for
213 c++17 and earlier when try block appears in constexpr function.
214 * constexpr.c (build_constexpr_constructor_member_initializers):
215 Handle TRY_BLOCK here instead of erroring on it.
216
217 2019-02-28 Jason Merrill <jason@redhat.com>
218
219 PR c++/88183 - ICE with .* fold-expression.
220 * pt.c (fold_expression) [DOTSTAR_EXPR]: Remove special handling.
221
222 PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
223 * class.c, lambda.c, pt.c: Revert earlier change.
224 * lambda.c (add_capture): Don't special-case capture of dependent
225 VLA.
226
227 * name-lookup.c (print_binding_level): Print this_entity.
228
229 2019-02-27 Marek Polacek <polacek@redhat.com>
230
231 PR c++/88857 - ICE with value-initialization of argument in template.
232 * call.c (convert_like_real): Don't call build_value_init in template.
233
234 2019-02-27 Jason Merrill <jason@redhat.com>
235
236 PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
237 * semantics.c (process_outer_var_ref): Do capture dependent vars.
238 * class.c (finish_struct): Only add TAG_DEFN if T is in
239 current_function_decl.
240 * lambda.c (vla_capture_type): Force the capture type out into the
241 lambda's enclosing function.
242 (add_capture): Pass in the lambda.
243 * pt.c (tsubst_lambda_expr): complete_type a VLA capture type.
244
245 2019-02-27 Marek Polacek <polacek@redhat.com>
246
247 PR c++/89511 - ICE with using-declaration and unscoped enumerator.
248 * parser.c (cp_parser_using_declaration): For an unscoped enum
249 only use its context if it's not a function declaration.
250
251 2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
252
253 PR c++/89488
254 * method.c (process_subob_fn): When maybe_instantiate_noexcept
255 returns false don't call merge_exception_specifiers.
256
257 2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
258
259 PR c++/88987
260 * parser.c (cp_parser_noexcept_specification_opt): Return NULL_TREE
261 for a non-constant parsed expression.
262
263 2019-02-26 Jakub Jelinek <jakub@redhat.com>
264
265 PR c++/89481
266 * constexpr.c (cxx_eval_store_expression): When changing active union
267 member, set no_zero_init.
268
269 2019-02-23 Marek Polacek <polacek@redhat.com>
270
271 PR c++/88294 - ICE with non-constant noexcept-specifier.
272 * pt.c (maybe_instantiate_noexcept): Set up the list of local
273 specializations. Set current_class_{ptr,ref}.
274
275 2019-02-22 David Malcolm <dmalcolm@redhat.com>
276
277 PR c++/89390
278 * parser.c (cp_parser_unqualified_id): Capture and use locations
279 for destructors.
280
281 2019-02-22 Marek Polacek <polacek@redhat.com>
282
283 PR c++/89420 - ICE with CAST_EXPR in explicit-specifier.
284 * decl.c (build_explicit_specifier): Don't check
285 processing_template_decl. Call instantiation_dependent_expression_p
286 instead of value_dependent_expression_p. Call
287 instantiate_non_dependent_expr_sfinae before
288 build_converted_constant_expr instead of calling
289 instantiate_non_dependent_expr after it. Add
290 processing_template_decl_sentinel.
291
292 2019-02-22 Thomas Schwinge <thomas@codesourcery.com>
293
294 * parser.c (cp_parser_oacc_simple_clause): Remove parser formal
295 parameter, move loc formal parameter to the front. Adjust all
296 users.
297 (cp_parser_oacc_shape_clause): Add loc formal parameter. Adjust
298 all users.
299
300 2019-02-21 Jason Merrill <jason@redhat.com>
301
302 PR c++/87685 - generic lambda 'this' capture error.
303 * lambda.c (lambda_expr_this_capture): Change add_capture_p to int.
304 (maybe_generic_this_capture): Pass -1.
305
306 PR c++/88394 - ICE with VLA init-capture.
307 * lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE.
308
309 PR c++/88869 - C++17 ICE with CTAD and explicit specialization.
310 * pt.c (do_class_deduction): Don't include explicit specialization
311 args in outer_args.
312
313 PR c++/89422 - ICE with -g and lambda in default arg in template.
314 * pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner.
315
316 2019-02-21 Jason Merrill <jason@redhat.com>
317
318 PR c++/88419 - C++17 ICE with class template arg deduction.
319 * pt.c (make_template_placeholder): Set TYPE_CANONICAL after
320 CLASS_PLACEHOLDER_TEMPLATE.
321
322 2019-02-21 Jakub Jelinek <jakub@redhat.com>
323
324 PR c++/89285
325 * constexpr.c (struct constexpr_fundef): Add parms and result members.
326 (retrieve_constexpr_fundef): Adjust for the above change.
327 (register_constexpr_fundef): Save constexpr body with copy_fn,
328 temporarily set DECL_CONTEXT on DECL_RESULT before that.
329 (get_fundef_copy): Change FUN argument to FUNDEF with
330 constexpr_fundef * type, grab body and parms/result out of
331 constexpr_fundef struct and temporarily change it for copy_fn calls
332 too.
333 (cxx_eval_builtin_function_call): For __builtin_FUNCTION temporarily
334 adjust current_function_decl from ctx->call context. Test
335 !potential_constant_expression instead of !is_constant_expression.
336 (cxx_bind_parameters_in_call): Grab parameters from new_call. Undo
337 convert_for_arg_passing changes for TREE_ADDRESSABLE type passing.
338 (cxx_eval_call_expression): Adjust get_fundef_copy caller.
339 (cxx_eval_conditional_expression): For IF_STMT, allow then or else
340 operands to be NULL.
341 (label_matches): Handle BREAK_STMT and CONTINUE_STMT.
342 (cxx_eval_loop_expr): Add support for FOR_STMT, WHILE_STMT and DO_STMT.
343 (cxx_eval_switch_expr): Add support for SWITCH_STMT.
344 (cxx_eval_constant_expression): Handle IF_STMT, FOR_STMT, WHILE_STMT,
345 DO_STMT, CONTINUE_STMT, SWITCH_STMT, BREAK_STMT and CONTINUE_STMT.
346 For SIZEOF_EXPR, recurse on the result of fold_sizeof_expr. Ignore
347 DECL_EXPR with USING_DECL operand.
348 * lambda.c (maybe_add_lambda_conv_op): Build thisarg using
349 build_int_cst to make it a valid constant expression.
350
351 2019-02-20 Jason Merrill <jason@redhat.com>
352
353 PR c++/88690 - C++17 ICE with empty base in aggregate.
354 * typeck2.c (process_init_constructor_record): Skip trivial
355 initialization of an empty base.
356
357 2019-02-21 Richard Biener <rguenther@suse.de>
358
359 PR middle-end/89392
360 * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not
361 make symtab process new functions here.
362
363 2019-02-20 Jason Merrill <jason@redhat.com>
364
365 PR c++/87921 - wrong error with inline static data member.
366 * decl2.c (finish_static_data_member_decl): Don't set DECL_IN_AGGR_P
367 for a non-template inline variable. Do nothing for an
368 already-instantiated variable.
369 (c_parse_final_cleanups): Check DECL_IN_AGGR_P without
370 DECL_INLINE_VAR_P.
371 * decl.c (check_initializer): Likewise.
372 (make_rtl_for_nonlocal_decl): Likewise.
373 * pt.c (instantiate_decl): Likewise.
374 * typeck2.c (store_init_value): Likewise.
375
376 2019-02-20 Jakub Jelinek <jakub@redhat.com>
377
378 PR c++/89403
379 * decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting
380 for flag_syntax_only from here...
381 * semantics.c (expand_or_defer_fn_1): ... here.
382
383 PR c++/89405
384 * decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and
385 DECL_COMMON, set DECL_INTERFACE_KNOWN.
386
387 PR c++/89336
388 * constexpr.c (cxx_eval_store_expression): Diagnose changing of active
389 union member for -std=c++17 and earlier.
390
391 2019-02-19 Jason Merrill <jason@redhat.com>
392
393 PR c++/87513 - 'sorry' mangling PMF template-id.
394 * mangle.c (write_expression): Handle SCOPE_REF to BASELINK.
395
396 2019-02-19 Jason Merrill <jason@redhat.com>
397
398 PR c++/88380 - wrong-code with flexible array and NSDMI.
399 * typeck2.c (process_init_constructor_record): Skip flexarrays.
400
401 2019-02-20 will wray <wjwray@gmail.com>
402
403 PR c++/88572 - wrong handling of braces on scalar init.
404 * decl.c (reshape_init_r): Allow braces around scalar initializer
405 within aggregate init. Reject double braced-init of scalar
406 variable.
407
408 2019-02-20 Paolo Carlini <paolo.carlini@oracle.com>
409
410 PR c++/84536
411 * pt.c (tsubst_init): Diagnose an initializer expanding to an
412 empty list of expressions; tweak wrt dependent types.
413 (regenerate_decl_from_template): For VAR_DECLs call tsubst_init
414 instead of tsubst_expr.
415
416 2019-02-19 Jason Merrill <jason@redhat.com>
417
418 PR c++/88368 - wrong 'use of deleted function'
419 * method.c (walk_field_subobs): Remember errors from get_nsdmi.
420 (get_defaulted_eh_spec): Call push_tinst_level.
421 * pt.c (maybe_instantiate_noexcept): Keep error_mark_node.
422 * typeck2.c (merge_exception_specifiers): Handle error_mark_node.
423
424 2019-02-19 Chung-Lin Tang <cltang@codesourcery.com>
425
426 PR c/87924
427 * parser.c (cp_parser_oacc_clause_wait): Add representation of wait
428 clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.
429
430 2019-02-19 Jakub Jelinek <jakub@redhat.com>
431
432 PR c++/89387
433 * lambda.c (maybe_generic_this_capture): Don't check
434 DECL_NONSTATIC_MEMBER_FUNCTION_P on USING_DECLs.
435
436 PR c++/89391
437 * typeck.c (build_reinterpret_cast_1): Don't handle void to
438 && conversion go through build_target_expr_with_type.
439
440 PR c++/89390
441 * error.c (qualified_name_lookup_error): Only call
442 suggest_alternative_in_scoped_enum if name is IDENTIFIER_NODE.
443
444 2019-02-19 Tom Honermann <tom@honermann.net>
445
446 * name-lookup.c (get_std_name_hint): Added u8string as a name hint.
447
448 2019-02-18 Jason Merrill <jason@redhat.com>
449
450 PR c++/89336 - multiple stores in constexpr stmt.
451 * constexpr.c (cxx_eval_store_expression): Preevaluate scalar or
452 assigned value.
453
454 * pt.c (check_explicit_specialization): If the declarator is a
455 template-id, only check whether the arguments are dependent.
456
457 Improve duplicate [[likely]] diagnostic.
458 * parser.c (cp_parser_statement): Make attrs_loc a range. Pass it
459 to process_stmt_hotness_attribute.
460 * cp-gimplify.c (process_stmt_hotness_attribute): Take attrs_loc.
461 (genericize_if_stmt): Use likely/unlikely instead of predictor_name.
462
463 2019-02-17 Marek Polacek <polacek@redhat.com>
464
465 PR c++/89217 - ICE with list-initialization in range-based for loop.
466 * constexpr.c (unshare_constructor): No longer static.
467 * cp-tree.h (unshare_constructor): Declare.
468 * semantics.c (finish_compound_literal): When dealing with a
469 non-dependent expression in a template, return the original
470 expression. Pass LOOKUP_NO_NARROWING to digest_init_flags.
471
472 2019-02-13 Marek Polacek <polacek@redhat.com>
473
474 PR c++/89297 - ICE with OVERLOAD in template.
475 * semantics.c (finish_compound_literal): Call
476 instantiate_non_dependent_expr_sfinae.
477
478 2019-02-13 Alexandre Oliva <aoliva@redhat.com>
479
480 PR c++/86379
481 * cp-tree.h (USING_DECL_SCOPE): Use result rather than type.
482 * name-lookup.c (strip_using_decl): Use USING_DECL_SCOPE.
483 * search.c (protected_accessible_p): Follow USING_DECL_DECLS.
484 (shared_member_p): Likewise.
485 (lookup_member): Likewise.
486 * decl.c (grok_special_member_properties): Skip USING_DECLs.
487 * semantics.c (finish_omp_declare_simd_methods): Likewise.
488 (finish_qualified_id_expr): Do not call shared_member_p with
489 a dependent expr.
490
491 PR c++/87322
492 * pt.c (tsubst_lambda_expr): Avoid duplicate tsubsting.
493 Move cp_evaluated resetting before signature tsubsting.
494 (gen_elem_of_pack_expansion_instantiation): Separate local
495 specializations per index.
496
497 2019-02-13 David Malcolm <dmalcolm@redhat.com>
498
499 PR c++/89036
500 * class.c (add_method): Drop destructor assertion.
501
502 2019-02-13 Paolo Carlini <paolo.carlini@oracle.com>
503
504 PR c++/88986
505 * decl.c (make_typename_type): Allow for TYPE_PACK_EXPANSION as
506 context (the first argument).
507 * pt.c (tsubst, case TYPENAME_TYPE): Handle TYPE_PACK_EXPANSION
508 as context.
509
510 2019-02-12 Jason Merrill <jason@redhat.com>
511
512 PR c++/89144 - link error with constexpr initializer_list.
513 * call.c (convert_like_real) [ck_list]: Don't allocate a temporary
514 array for an empty list.
515 * typeck2.c (store_init_value): Don't use cxx_constant_init in a
516 template.
517
518 2019-02-11 Jason Merrill <jason@redhat.com>
519
520 PR c++/89241 - ICE with __func__ in lambda in template.
521 * pt.c (enclosing_instantiation_of): Also check
522 instantiated_lambda_fn_p for the template context.
523
524 2019-02-11 Marek Polacek <polacek@redhat.com>
525
526 PR c++/89212 - ICE converting nullptr to pointer-to-member-function.
527 * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Return early for
528 null member pointer value.
529
530 2019-02-11 Jakub Jelinek <jakub@redhat.com>
531
532 PR c++/88977
533 * pt.c (convert_nontype_argument): Pass true as manifestly_const_eval
534 to maybe_constant_value calls.
535
536 2019-02-11 Marek Polacek <polacek@redhat.com>
537
538 * typeck2.c (digest_init_r): Remove commented code.
539
540 2019-02-11 Martin Sebor <msebor@redhat.com>
541
542 PR c++/87996
543 * decl.c (compute_array_index_type_loc): Preserve signed sizes
544 for diagnostics. Call valid_array_size_p instead of error.
545 * init.c (build_new_1): Compute size for diagnostic. Call
546 invalid_array_size_error
547 (build_new): Call valid_array_size_p instead of error.
548
549 2019-02-07 Alexandre Oliva <aoliva@redhat.com>
550
551 PR c++/86218
552 * call.c (compare_ics): Deal with ck_aggr in either cs.
553
554 2019-02-06 David Malcolm <dmalcolm@redhat.com>
555
556 PR c++/71302
557 * call.c (get_location_for_expr_unwinding_for_system_header): New
558 function.
559 (conversion_null_warnings): Use it when getting locations for
560 EXPR, effectively adding a call to
561 get_location_for_expr_unwinding_for_system_header for
562 -Wconversion-null and making use of EXPR_LOCATION for
563 -Wzero-as-null-pointer-constant.
564
565 2019-02-05 Jakub Jelinek <jakub@redhat.com>
566
567 PR c++/89187
568 * optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on
569 PARM_DECLs of the thunk.
570 * lambda.c (maybe_add_lambda_conv_op): Likewise.
571
572 2019-02-05 Marek Polacek <polacek@redhat.com>
573
574 PR c++/89158 - by-value capture of constexpr variable broken.
575 * call.c (convert_like_real) <case ck_user>: Call mark_exp_read
576 instead of mark_rvalue_use.
577
578 2019-02-05 Alexandre Oliva <aoliva@redhat.com>
579
580 PR c++/87770
581 * pt.c (instantiates_primary_template_p): New.
582 (type_dependent_expression_p): Use it.
583
584 2019-02-01 Jason Merrill <jason@redhat.com>
585
586 PR c++/88761 - ICE with reference capture of constant.
587 * lambda.c (mark_const_cap_r): Do walk subtrees of DECL_EXPR for
588 non-proxy decls.
589
590 2019-02-01 Marek Polacek <polacek@redhat.com>
591
592 PR c++/88325 - ICE with invalid out-of-line template member definition.
593 * parser.c (cp_parser_class_name): Don't call make_typename_type
594 for overloads.
595
596 2019-02-01 Jakub Jelinek <jakub@redhat.com>
597
598 PR c++/87175
599 * parser.c (cp_parser_gnu_attributes_opt): Set ok to false
600 if require_open failed.
601
602 2019-01-31 Marek Polacek <polacek@redhat.com>
603
604 PR c++/89083, c++/80864 - ICE with list initialization in template.
605 * constexpr.c (adjust_temp_type): Use copy_node and change the type
606 instead of using build_constructor.
607 * decl.c (reshape_init_r): Don't reshape a digested initializer.
608 Return the initializer for COMPOUND_LITERAL_P.
609
610 PR c++/88983 - ICE with switch in constexpr function.
611 * constexpr.c (cxx_eval_switch_expr): Use SWITCH_COND and SWITCH_BODY.
612 (cxx_eval_constant_expression) <case COND_EXPR>: Don't look for the
613 label in the else branch if we found it in the then branch.
614
615 2019-01-30 Jason Merrill <jason@redhat.com>
616
617 PR c++/88752 - ICE with lambda and constexpr if.
618 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New.
619 * pt.c (tsubst_lambda_expr): Set it.
620 (instantiated_lambda_fn_p): Check it.
621 (enclosing_instantiation_of): Use it.
622
623 2019-01-31 Jakub Jelinek <jakub@redhat.com>
624
625 PR libstdc++/88170
626 * cxx-pretty-print.c (pp_cxx_enumeration_constant): Print always as
627 a C cast in pp_c_flag_gnu_v3 mode.
628
629 2019-01-30 Jakub Jelinek <jakub@redhat.com>
630
631 PR c++/88988
632 * lambda.c (is_capture_proxy): Don't return true for
633 DECL_OMP_PRIVATIZED_MEMBER artificial vars.
634
635 2019-01-30 Marek Polacek <polacek@redhat.com>
636
637 PR c++/89119 - ICE with value-initialization in template.
638 * pt.c (tsubst_copy_and_build): Handle RANGE_EXPR.
639
640 2019-01-29 Jason Merrill <jason@redhat.com>
641
642 PR c++/86943 - wrong code converting lambda to function pointer.
643 * lambda.c (maybe_add_lambda_conv_op): Use a template-id in the
644 call. Only forward parms for decltype.
645 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Handle CALL_FROM_THUNK_P
646 specially.
647 * typeck.c (check_return_expr): Don't mess with a thunk call.
648
649 2019-01-28 Jason Merrill <jason@redhat.com>
650
651 PR c++/89089 - ICE with [[no_unique_address]].
652 PR c++/88865 - wrong layout with [[no_unique_address]].
653 * class.c (check_field_decls): A potentially-overlapping field makes
654 the class non-layout-POD, but not non-empty.
655 (end_of_class): Always consider empty data members.
656 (layout_class_type): Set DECL_SIZE for empty fields.
657
658 2019-01-28 Marek Polacek <polacek@redhat.com>
659
660 PR c++/88358 - name wrongly treated as type.
661 * parser.c (cp_parser_direct_declarator): Don't assume a qualified-id
662 in parameter-list is a type if the function's declarator-id is not
663 qualified.
664
665 2019-01-27 Marek Polacek <polacek@redhat.com>
666
667 PR c++/88815 - narrowing conversion lost in decltype.
668 PR c++/78244 - narrowing conversion in template not detected.
669 * cp-tree.h (CONSTRUCTOR_IS_DEPENDENT): New.
670 * pt.c (instantiation_dependent_r): Consider a CONSTRUCTOR with
671 CONSTRUCTOR_IS_DEPENDENT instantiation-dependent.
672 * semantics.c (finish_compound_literal): When the compound literal
673 isn't instantiation-dependent and the type isn't type-dependent,
674 fall back to the normal processing. Set CONSTRUCTOR_IS_DEPENDENT.
675
676 PR c++/89024 - ICE with incomplete enum type.
677 * call.c (standard_conversion): When converting an
678 ARITHMETIC_TYPE_P to an incomplete type, return NULL.
679
680 2019-01-25 Paolo Carlini <paolo.carlini@oracle.com>
681
682 PR c++/88969
683 * call.c (build_op_delete_call): Implement 7.6.2.5/(10.1).
684 * decl2.c (coerce_delete_type): Use build_pointer_type instead
685 of TYPE_POINTER_TO.
686
687 2019-01-24 Jason Merrill <jason@redhat.com>
688
689 PR c++/89001 - mangling of reference temporaries
690 * cp-tree.h (struct saved_scope): Add ref_temp_count.
691 (current_ref_temp_count): New macro.
692 * mangle.c (mangle_ref_init_variable): Use it.
693 * typeck2.c (store_init_value): Clear it.
694 * call.c (make_temporary_var_for_ref_to_temp): Copy public and
695 comdat.
696
697 2019-01-24 Jakub Jelinek <jakub@redhat.com>
698
699 PR c++/88976
700 * semantics.c (finish_omp_cancel): Diagnose more than one if
701 on #pragma omp cancel with different modifiers. Use
702 maybe_convert_cond when not in template or build_x_binary_op
703 otherwise.
704
705 2019-01-23 Marek Polacek <polacek@redhat.com>
706
707 PR c++/88757 - qualified name treated wrongly as type.
708 * parser.c (cp_parser_direct_declarator): Don't treat qualified-ids
709 in parameter-list as types if name lookup for declarator-id didn't
710 find one or more function templates.
711
712 2019-01-23 Jakub Jelinek <jakub@redhat.com>
713
714 PR c/44715
715 * cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only
716 after genericizing cond and incr expressions.
717
718 PR c++/88984
719 * cp-gimplify.c (genericize_switch_stmt): Move cond genericization
720 before the begin_bc_block call.
721
722 2019-01-21 Jason Merrill <jason@redhat.com>
723
724 PR c++/87893 - constexpr ctor ICE on ARM.
725 PR c++/88293 - ICE with comma expression.
726 * constexpr.c (initialized_type): Don't shortcut non-void type.
727 Handle COMPOUND_EXPR.
728 (cxx_eval_outermost_constant_expr): Return early for void type.
729
730 2019-01-21 Jakub Jelinek <jakub@redhat.com>
731
732 PR c++/88949
733 * optimize.c (cxx_copy_decl): New function.
734 (clone_body): Use it instead of copy_decl_no_change.
735
736 PR sanitizer/88901
737 * typeck.c (cp_build_binary_op): Don't instrument
738 SANITIZE_POINTER_COMPARE if processing_template_decl.
739 (pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT.
740
741 2019-01-18 Jason Merrill <jason@redhat.com>
742
743 PR c++/88875 - error with explicit list constructor.
744 * call.c (reference_binding): Don't modify EXPR. Set
745 need_temporary_p on the ck_user conversion for a temporary.
746 (convert_like_real): Check it.
747
748 2019-01-18 H.J. Lu <hongjiu.lu@intel.com>
749
750 PR c/51628
751 PR c/88664
752 * call.c (convert_for_arg_passing): Upate the
753 warn_for_address_or_pointer_of_packed_member call.
754 * typeck.c (convert_for_assignment): Likewise.
755
756 2019-01-17 Jason Merrill <jason@redhat.com>
757
758 PR c++/86205 - ICE with ?: of throw and template-id.
759 * pt.c (resolve_nondeduced_context_or_error): Split out from...
760 * typeck.c (decay_conversion): ...here.
761 * call.c (build_conditional_expr_1): Use it.
762
763 PR c++/86740, ICE with constexpr if and nested generic lambdas.
764 * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR.
765
766 2019-01-17 Paolo Carlini <paolo.carlini@oracle.com>
767
768 * decl.c (grokdeclarator): Use typespec_loc in error messages
769 about 'auto' and trailing return type.
770
771 2019-01-17 David Malcolm <dmalcolm@redhat.com>
772
773 PR c++/88699
774 * class.c (add_method): Don't use DECL_DESTRUCTOR_P on
775 USING_DECLs.
776
777 2019-01-17 Nathan Sidwell <nathan@acm.org>
778
779 PR c++/86610
780 * semantics.c (process_outer_var_ref): Only skip dependent types
781 in templates.
782
783 2019-01-17 Alexandre Oliva <aoliva@redhat.com>
784
785 PR c++/87768
786 * cp-tree.h (saved_scope): Add suppress_location_wrappers.
787 * name-lookup.c (do_push_to_top_level): Save and reset it.
788 (do_pop_from_top_level): Restore it.
789
790 PR c++/86648
791 * pt.c (make_template_placeholder): Use auto_identifier.
792 (is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test.
793 * error.c (dump_type): Handle template placeholders.
794 * cxx-pretty-print.c (pp_cx_unqualified_id): Likewise.
795
796 PR c++/88146
797 * cvt.c (convert_to_void): Handle all cdtor calls as if
798 returning void.
799
800 2019-01-16 Paolo Carlini <paolo.carlini@oracle.com>
801
802 * decl.c (grokdeclarator): Use locations[ds_storage_class] in
803 error messages about ill-formed uses of mutable.
804
805 2019-01-16 Marek Polacek <polacek@redhat.com>
806
807 PR c++/78244 - narrowing conversion in template not detected.
808 * call.c (perform_implicit_conversion_flags): Set
809 IMPLICIT_CONV_EXPR_BRACED_INIT.
810 * cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New.
811 * pt.c (tsubst_copy_and_build): Use it.
812
813 2019-01-15 David Malcolm <dmalcolm@redhat.com>
814
815 PR c++/88795
816 * pt.c (build_deduction_guide): Bail out if tsubst_arg_types
817 fails.
818
819 2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
820
821 * decl.c (start_decl): Improve error location.
822 * decl2.c (grokfield): Likewise.
823
824 2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
825
826 * decl.c (grokdeclarator): Move further up the location_t loc
827 declaration and use the location when building a TYPE_DECL for
828 a typedef name.
829 * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error
830 about an ill-formed bit-field as typedef.
831
832 2019-01-14 Marek Polacek <polacek@redhat.com>
833
834 PR c++/88830 - ICE with abstract class.
835 * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR.
836 Fix formatting.
837
838 PR c++/88825 - ICE with bogus function return type deduction.
839 * typeck.c (can_do_nrvo_p): Check error_mark_node.
840
841 2019-01-14 Tom Honermann <tom@honermann.net>
842
843 Implement P0482R5, char8_t: A type for UTF-8 characters and strings
844 * cvt.c (type_promotes_to): Handle char8_t promotion.
845 * decl.c (grokdeclarator): Handle invalid type specifier
846 combinations involving char8_t.
847 * lex.c (init_reswords): Add char8_t as a reserved word.
848 * mangle.c (write_builtin_type): Add name mangling for char8_t (Du).
849 * parser.c (cp_keyword_starts_decl_specifier_p)
850 (cp_parser_simple_type_specifier): Recognize char8_t as a simple
851 type specifier.
852 (cp_parser_string_literal): Use char8_array_type_node for the type
853 of CPP_UTF8STRING.
854 (cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system
855 headers.
856 * rtti.c (emit_support_tinfos): type_info support for char8_t.
857 * tree.c (char_type_p): Recognize char8_t as a character type.
858 * typeck.c (string_conv_p): Handle conversions of u8 string
859 literals of char8_t type.
860 (check_literal_operator_args): Handle UDLs with u8 string literals
861 of char8_t type.
862 * typeck2.c (ordinary_char_type_p): New.
863 (digest_init_r): Disallow initializing a char array with a u8 string
864 literal.
865
866 2019-01-14 Martin Liska <mliska@suse.cz>
867
868 PR gcov-profile/88263
869 * decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION
870 as location of the TLS wrapper.
871
872 2019-01-12 Paolo Carlini <paolo.carlini@oracle.com>
873
874 * decl.c (cp_finish_decl): Improve error location.
875 * decl2.c (grokfield): Likewise, improve two locations.
876
877 2019-01-11 Marek Polacek <polacek@redhat.com>
878
879 PR c++/88692, c++/87882 - -Wredundant-move false positive with *this.
880 * typeck.c (maybe_warn_pessimizing_move): Return if ARG isn't
881 ADDR_EXPR.
882
883 2019-01-11 Jason Merrill <jason@redhat.com>
884
885 PR c++/88312 - pack expansion of decltype.
886 * pt.c (instantiation_dependent_r): A template non-type parameter
887 pack is instantiation-dependent.
888
889 2019-01-11 Jason Merrill <jason@redhat.com>
890
891 PR c++/88613 - ICE with use of const var in lambda.
892 * expr.c (mark_use): Fix location wrapper handling.
893 * cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use.
894
895 2019-01-11 Tobias Burnus <burnus@net-b.de>
896
897 PR C++/88114
898 * decl2.c (maybe_emit_vtables): If needed, generate code for
899 the destructor of an abstract class.
900 (mark_used): Update comment for older function-name change.
901
902 2019-01-11 Paolo Carlini <paolo.carlini@oracle.com>
903
904 * decl.c (start_decl): Improve error location.
905 (grokdeclarator): Likewise, improve two locations.
906
907 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
908
909 PR other/16615
910
911 * cp-tree.h: Mechanically replace "can not" with "cannot".
912 * parser.c: Likewise.
913 * pt.c: Likewise.
914
915 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
916
917 * decl.c (grok_reference_init): Improve error location.
918 (grokdeclarator): Likewise, improve two locations.
919
920 2019-01-08 Marek Polacek <polacek@redhat.com>
921
922 PR c++/88538 - braced-init-list in template-argument-list.
923 * parser.c (cp_parser_template_argument): Handle braced-init-list when
924 in C++20.
925
926 PR c++/88548 - this accepted in static member functions.
927 * parser.c (cp_debug_parser): Adjust printing of
928 local_variables_forbidden_p.
929 (cp_parser_new): Set local_variables_forbidden_p to 0 rather than false.
930 (cp_parser_primary_expression): When checking
931 local_variables_forbidden_p, use THIS_FORBIDDEN or
932 LOCAL_VARS_FORBIDDEN.
933 (cp_parser_lambda_body): Update the type of
934 local_variables_forbidden_p. Set it to 0 rather than false.
935 (cp_parser_condition): Adjust call to cp_parser_declarator.
936 (cp_parser_explicit_instantiation): Likewise.
937 (cp_parser_init_declarator): Likewise.
938 (cp_parser_declarator): New parameter. Use it.
939 (cp_parser_direct_declarator): New parameter. Use it to set
940 local_variables_forbidden_p. Adjust call to cp_parser_declarator.
941 (cp_parser_type_id_1): Adjust call to cp_parser_declarator.
942 (cp_parser_parameter_declaration): Likewise.
943 (cp_parser_default_argument): Update the type of
944 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
945 rather than true.
946 (cp_parser_member_declaration): Tell cp_parser_declarator if we saw
947 'static' or 'friend'.
948 (cp_parser_exception_declaration): Adjust call to cp_parser_declarator.
949 (cp_parser_late_parsing_default_args): Update the type of
950 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
951 rather than true.
952 (cp_parser_cache_defarg): Adjust call to cp_parser_declarator.
953 (cp_parser_objc_class_ivars): Likewise.
954 (cp_parser_objc_struct_declaration): Likewise.
955 (cp_parser_omp_for_loop_init): Likewise.
956 * parser.h (cp_parser): Change the type of local_variables_forbidden_p
957 to unsigned char.
958 (LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN):
959 Define.
960
961 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
962
963 * decl.c (start_decl): Improve permerror location.
964
965 2019-01-08 Jonathan Wakely <jwakely@redhat.com>
966 Jakub Jelinek <jakub@redhat.com>
967
968 PR c++/88554
969 * decl.c (finish_function): For -Wreturn-type don't add a return *this;
970 fixit hint if current_class_ref is NULL. Use a single if instead of
971 two nested ones.
972
973 2019-01-07 Paolo Carlini <paolo.carlini@oracle.com>
974
975 * decl.c (start_decl): Improve two error_at locations.
976 (expand_static_init): Likewise.
977
978 2019-01-07 Marek Polacek <polacek@redhat.com>
979
980 PR c++/88741 - wrong error with initializer-string.
981 * decl.c (cp_complete_array_type): Strip any location wrappers.
982
983 2019-01-07 Bernd Edlinger <bernd.edlinger@hotmail.de>
984
985 PR c++/88261
986 PR c++/69338
987 PR c++/69696
988 PR c++/69697
989 * cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value.
990 * typeck2.c (digest_init_r): Raise an error for non-static
991 initialization of a flexible array member.
992 (process_init_constructor, massage_init_elt,
993 process_init_constructor_array, process_init_constructor_record,
994 process_init_constructor_union, process_init_constructor): Add the
995 flags parameter and pass it thru.
996 (store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to
997 digest_init_flags for static decls.
998
999 2019-01-07 Jakub Jelinek <jakub@redhat.com>
1000
1001 PR c++/85052
1002 * cp-tree.h (cp_build_vec_convert): Declare.
1003 * parser.c (cp_parser_postfix_expression): Parse
1004 __builtin_convertvector.
1005 * constexpr.c: Include fold-const-call.h.
1006 (cxx_eval_internal_function): Handle IFN_VEC_CONVERT.
1007 (potential_constant_expression_1): Likewise.
1008 * semantics.c (cp_build_vec_convert): New function.
1009 * pt.c (tsubst_copy_and_build): Handle CALL_EXPR to
1010 IFN_VEC_CONVERT.
1011
1012 2019-01-03 Jakub Jelinek <jakub@redhat.com>
1013
1014 PR c++/88636
1015 * decl.c (builtin_function_1): Return result of pushdecl_top_level
1016 or pushdecl rather than decl.
1017
1018 2019-01-03 Paolo Carlini <paolo.carlini@oracle.com>
1019
1020 * tree.c (handle_nodiscard_attribute): Improve warning location.
1021
1022 2019-01-02 Marek Polacek <polacek@redhat.com>
1023
1024 PR c++/88612 - ICE with -Waddress-of-packed-member.
1025 * call.c (convert_for_arg_passing): Only give warnings with tf_warning.
1026 * typeck.c (convert_for_assignment): Likewise.
1027
1028 PR c++/88631 - CTAD failing for value-initialization.
1029 * typeck2.c (build_functional_cast): Try deducing the template
1030 arguments even if there are no arguments to deduce from.
1031
1032 2019-01-01 Jakub Jelinek <jakub@redhat.com>
1033
1034 Update copyright years.
1035 \f
1036 Copyright (C) 2019 Free Software Foundation, Inc.
1037
1038 Copying and distribution of this file, with or without modification,
1039 are permitted in any medium without royalty provided the copyright
1040 notice and this notice are preserved.