]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/cp/ChangeLog
Reduce accumulated garbage in constexpr evaluation.
[thirdparty/gcc.git] / gcc / cp / ChangeLog
1 2019-06-04 Jason Merrill <jason@redhat.com>
2
3 Reduce accumulated garbage in constexpr evaluation.
4 * constexpr.c (cxx_eval_call_expression): ggc_free any bindings we
5 don't save.
6 (cxx_eval_increment_expression): ggc_free the MODIFY_EXPR after
7 evaluating it.
8
9 2019-06-04 Jakub Jelinek <jakub@redhat.com>
10
11 * cp-tree.h (CP_OMP_CLAUSE_INFO): Allow for any clauses up to _condvar_
12 instead of only up to linear.
13
14 2019-06-03 Paolo Carlini <paolo.carlini@oracle.com>
15
16 * parser.c (cp_parser_unqualified_id): Use build_min_nt_loc in
17 five places.
18
19 2019-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
20
21 PR c++/85254
22 * class.c (fixup_type_variants): Handle CLASSTYPE_FINAL.
23
24 2019-05-31 Nathan Sidwell <nathan@acm.org>
25
26 * cp-tree.h (IDENTIFIER_LAMBDA_P): New.
27 (TYPE_ANON_P): New.
28 (LAMBDA_TYPE_P, TYPE_UNNAMED_P): Likewise.
29 (LAMBDANAME_PREFIX, LAMBDANAME_FORMAT): Delete.
30 (make_lambda_name): Don't declare.
31 * error.c (dump_aggr_type): Check for lambdas before other
32 anonymous names.
33 * lambda.c (begin_lambda_type): Use make_anon_name.
34 * cp-lang.c (cxx_dwarf_name): Lambda names smell anonymous.
35 * mangle.c (write_local_name): Likewise.
36 * name-lookup.c (lambda_cnt, make_lambda_name): Delete.
37
38 2019-05-30 Marek Polacek <polacek@redhat.com>
39
40 * cp-tree.h (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Fix a typo.
41
42 2019-05-31 Paolo Carlini <paolo.carlini@oracle.com>
43
44 * decl.c (grokdeclarator): Use declarator->id_loc in five
45 error_at calls.
46
47 2019-05-29 Jakub Jelinek <jakub@redhat.com>
48
49 PR c++/90598
50 * tree.c (lvalue_kind): Return clk_none for expressions with
51 with VOID_TYPE_P.
52
53 2019-05-29 Paolo Carlini <paolo.carlini@oracle.com>
54
55 PR c++/89875
56 * parser.c (cp_parser_sizeof_operand): When the type-id production
57 did not work out commit to the tentative parse.
58
59 2019-05-29 Jakub Jelinek <jakub@redhat.com>
60
61 P1091R3 - Extending structured bindings to be more like var decls
62 P1381R1 - Reference capture of structured bindings
63 * decl.c (cp_maybe_mangle_decomp): Handle TREE_STATIC decls even at
64 function scope.
65 (cp_finish_decomp): Copy over various decl properties from decl to
66 v[i] in the tuple case.
67 (grokdeclarator): Allow static, thread_local and __thread for C++2a
68 and use pedwarn instead of error for older standard revisions.
69 Make other structured binding diagnostic messages more i18n friendly.
70
71 2019-05-28 Nathan Sidwell <nathan@acm.org>
72
73 * decl.c (duplicate_decls): Assert a template newdecl has no
74 specializations.
75
76 2019-05-28 Marek Polacek <polacek@redhat.com>
77
78 PR c++/90548 - ICE with generic lambda and empty pack.
79 * pt.c (tsubst_copy_and_build): Handle pack expansion properly.
80
81 2019-05-28 Nathan Sidwell <nathan@acm.org>
82
83 * cp-tree.h (make_anon_name): Drop declaration.
84 (TYPE_UNNAMED_P): Use IDENTIFIER_ANON_P.
85 * cp-lang.c (cxx_dwarf_name): Likewise.
86 * class.c (find_flexarrays): Likewise.
87 * decl.c (name_unnamed_type, xref_tag_1): Likewise.
88 * error.c (dump_aggr_type): Likewise.
89 * pt.c (push_template_decl_real): Likewise.
90 * name-lookup.c (consider_binding_level): Likewise.
91 (anon_cnt, make_anon_name): Delete.
92
93 2019-05-25 Marek Polacek <polacek@redhat.com>
94
95 PR c++/90572 - wrong disambiguation in friend declaration.
96 * parser.c (cp_parser_constructor_declarator_p): Don't allow missing
97 typename for friend declarations.
98
99 2019-05-23 Jonathan Wakely <jwakely@redhat.com>
100
101 * cp-tree.h (CP_AGGREGATE_TYPE_P): Fix whitespace.
102
103 * init.c (std_placement_new_fn_p): Remove outdated TODO comment that
104 was resolved by r254694.
105
106 2019-05-22 Jason Merrill <jason@redhat.com>
107
108 PR c++/20408 - unnecessary code for empty struct.
109 * call.c (build_call_a): Use simple_empty_class_p.
110
111 PR c++/86485 - -Wmaybe-unused with empty class ?:
112 * cp-gimplify.c (simple_empty_class_p): Also true for MODIFY_EXPR.
113
114 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
115
116 * parser.c (cp_parser_template_declaration_after_parameters): Use
117 DECL_SOURCE_LOCATION in literal operator template errors.
118
119 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
120
121 PR c++/67184
122 PR c++/69445
123 * call.c (build_over_call): Devirtualize when the final overrider
124 comes from the base.
125
126 2019-05-21 Nathan Sidwell <nathan@acm.org>
127
128 * name-lookup.c (do_nonmember_using_decl): Drop INSERT_P
129 parameter. Document.
130 (finish_nonmember_using_decl): Adjust do_nonmember_using_decl
131 calls. Remove stray FIXME comment.
132
133 * name-lookup.h (struct cp_binding_level): Drop usings field.
134 (finish_namespace_using_decl, finish_local_using_decl): Replace with ...
135 (finish_nonmember_using_decl): ... this.
136 * name-lookup.c (push_using_decl_1, push_using_decl):
137 (do_nonmember_using_decl): ... here. Add INSERT_P arg. Reimplement.
138 (validate_nonmember_using_decl, finish_namespace_using_decl)
139 (finish_local_using_decl): Replace with ...
140 (finish_nonmember_using_decl): ... this. Drop DECL parm.
141 * parser.c (cp_parser_using_declaration): Don't do lookup here.
142 * pt.c (tsubst_expr): Do not do using decl lookup here.
143
144 2019-05-21 Eric Botcazou <ebotcazou@adacore.com>
145
146 * decl2.c (cpp_check) <IS_ASSIGNMENT_OPERATOR>: New case.
147
148 2019-05-20 Marek Polacek <polacek@redhat.com>
149
150 CWG 2094 - volatile scalars are trivially copyable.
151 PR c++/85679
152 * tree.c (trivially_copyable_p): Don't check CP_TYPE_VOLATILE_P for
153 scalar types.
154
155 2019-05-20 Marek Polacek <polacek@redhat.com>
156
157 * pt.c (convert_template_argument): Add a diagnostic for the
158 [temp.arg]/2 ambiguity case.
159
160 * name-lookup.c (finish_using_directive): Don't issue inform() if the
161 warning didn't trigger. Add quoting. Tweak the inform message.
162
163 2019-05-20 Paolo Carlini <paolo.carlini@oracle.com>
164
165 * cp-tree.h: Remove remnants of CONV_NONCONVERTING.
166
167 2019-05-20 Nathan Sidwell <nathan@acm.org>
168
169 * name-lookup.c (finish_namespace_using_directive)
170 (finish_local_using_directive): Merge to ...
171 (finish_using_directive): ... here. Handle both contexts.
172 * name-lookup.h (finish_namespace_using_directive)
173 (finish_local_using_directive): Replace with ...
174 (finish_using_directive): ... this.
175 * parser.c (cp_parser_using_directive): Adjust.
176 * pt.c (tsubst_expr): Likewise.
177
178 * cp-tree.h (struct lang_decl_ns): Remove usings field.
179 (DECL_NAMESPACE_USING): Delete.
180 * name-lookup.c (name_lookup::search_usings): Use namespace's
181 binding scope.
182 (name_lookup::queue_namespae): Likewise.
183 (finish_namespace_using_directive, push_namespace): Likewise.
184 (has_using_namespace_std_directive): Just search the entire
185 binding stack.
186
187 2019-05-20 Jonathan Wakely <jwakely@redhat.com>
188
189 PR c++/90532 Ensure __is_constructible(T[]) is false
190 * method.c (is_xible_helper): Return error_mark_node for construction
191 of an array of unknown bound.
192
193 2019-05-17 Thomas Schwinge <thomas@codesourcery.com>
194
195 PR c++/89433
196 * parser.c (cp_finalize_oacc_routine): Rework checking if already
197 marked with an OpenACC 'routine' directive.
198
199 PR c++/89433
200 * parser.c (cp_parser_oacc_routine)
201 (cp_parser_late_parsing_oacc_routine): Normalize order of clauses.
202 (cp_finalize_oacc_routine): Call oacc_verify_routine_clauses.
203
204 PR c++/89433
205 * parser.c (cp_finalize_oacc_routine): Refer to OpenACC 'routine'
206 clauses from "omp declare target" attribute.
207
208 2019-05-16 Martin Sebor <msebor@redhat.com>
209
210 * call.c (print_z_candidate): Wrap diagnostic text in a gettext
211 macro. Adjust.
212 (print_z_candidates): Same.
213 (build_conditional_expr_1): Quote keywords, operators, and types
214 in diagnostics.
215 (build_op_delete_call): Same.
216 (maybe_print_user_conv_context): Wrap diagnostic text in a gettext
217 macro.
218 (convert_like_real): Same.
219 (convert_arg_to_ellipsis): Quote keywords, operators, and types
220 in diagnostics.
221 (build_over_call): Same.
222 (joust): Break up an overlong line. Wrap diagnostic text in a gettext
223 macro.
224 * constexpr.c (cxx_eval_check_shift_p): Spell out >= in English.
225 (cxx_eval_constant_expression): Quote keywords, operators, and types
226 in diagnostics.
227 (potential_constant_expression_1): Same.
228 * cp-gimplify.c (cp_genericize_r): Same.
229 * cvt.c (maybe_warn_nodiscard): Quote keywords, operators, and types
230 in diagnostics.
231 (type_promotes_to): Same.
232 * decl.c (check_previous_goto_1): Same.
233 (check_goto): Same.
234 (start_decl): Same.
235 (cp_finish_decl): Avoid parenthesizing a sentence for consistency.
236 (grok_op_properties): Quote keywords, operators, and types
237 in diagnostics.
238 * decl2.c (grokfield): Same.
239 (coerce_delete_type): Same.
240 * except.c (is_admissible_throw_operand_or_catch_parameter): Same.
241 * friend.c (do_friend): Quote C++ tokens.
242 * init.c (build_new_1): Quote keywords, operators, and types
243 in diagnostics.
244 (build_vec_delete_1): Same.
245 (build_delete): Same.
246 * lex.c (parse_strconst_pragma): Same.
247 (handle_pragma_implementation): Same.
248 (unqualified_fn_lookup_error): Same.
249 * mangle.c (write_type): Same.
250 * method.c (defaulted_late_check): Avoid two consecutive punctuators.
251 * name-lookup.c (cp_binding_level_debug): Remove a trailing newline.
252 (pop_everything): Same.
253 * parser.c (cp_lexer_start_debugging): Quote a macro name.
254 in a diagnostic
255 (cp_lexer_stop_debugging): Same.
256 (cp_parser_userdef_numeric_literal): Quote a C++ header name
257 in a diagnostic.
258 (cp_parser_nested_name_specifier_opt): Quote keywords, operators,
259 and types in diagnostics.
260 (cp_parser_question_colon_clause): Same.
261 (cp_parser_asm_definition): Same.
262 (cp_parser_init_declarator): Same.
263 (cp_parser_template_declaration_after_parameters): Avoid capitalizing
264 a sentence in a diagnostic.
265 (cp_parser_omp_declare_reduction): Quote keywords, operators, and types
266 in diagnostics.
267 (cp_parser_transaction): Same.
268 * pt.c (maybe_process_partial_specialization): Replace second call
269 to permerror with inform for consistency with other uses.
270 (expand_integer_pack): Quote keywords, operators, and types
271 in diagnostics.
272 * rtti.c (get_typeid): Quote keywords, operators, and types
273 in diagnostics.
274 (build_dynamic_cast_1): Same.
275 * semantics.c (finish_asm_stmt): Same.
276 (finish_label_decl): Same.
277 (finish_bases): Same.
278 (finish_offsetof): Same.
279 (cp_check_omp_declare_reduction): Same.
280 (finish_decltype_type): Same.
281 * tree.c (handle_init_priority_attribute): Same. Add detail
282 to diagnostics.
283 (maybe_warn_zero_as_null_pointer_constant): Same.
284 * typeck.c (cp_build_binary_op): Quote keywords, operators, and types
285 in diagnostics.
286 (cp_build_unary_op): Same.
287 (check_for_casting_away_constness): Same.
288 (build_static_cast): Same.
289 (build_const_cast_1): Same.
290 (maybe_warn_about_returning_address_of_local): Same.
291 (check_return_expr): Same.
292 * typeck2.c (abstract_virtuals_error_sfinae): Same.
293 (digest_init_r): Replace a tab with spaces in a diagnostic.
294 (build_functional_cast): Quote keywords, operators, and types
295 in diagnostics.
296
297 2019-05-15 Jakub Jelinek <jakub@redhat.com>
298
299 PR debug/90197
300 * cp-gimplify.c (genericize_cp_loop): Emit a DEBUG_BEGIN_STMT
301 before the condition (or if missing or constant non-zero at the end
302 of the loop. Emit a DEBUG_BEGIN_STMT before the increment expression
303 if any. Don't call protected_set_expr_location on incr if it already
304 has a location.
305
306 2019-05-15 Marek Polacek <polacek@redhat.com>
307
308 CWG 2096 - constraints on literal unions.
309 * class.c (check_field_decls): Initialize booleans directly. A union
310 is literal if at least one of its non-static data members is of
311 non-volatile literal type.
312
313 2019-05-15 Paolo Carlini <paolo.carlini@oracle.com>
314
315 * cp-tree.h (REFERENCE_VLA_OK): Remove.
316 * lambda.c (build_capture_proxy): Remove use of the above.
317
318 2019-05-15 Paolo Carlini <paolo.carlini@oracle.com>
319
320 * call.c (perform_overload_resolution, build_new_method_call_1):
321 Use OVL_P; remove redundant TEMPLATE_DECL checks.
322 * decl.c (grokfndecl): Likewise.
323 * mangle.c (write_expression): Likewise.
324 * parser.c (cp_parser_template_id): Likewise.
325 * pt.c (resolve_overloaded_unification, type_dependent_expression_p):
326 Likewise.
327 * search.c (build_baselink): Likewise.
328 * tree.c (is_overloaded_fn, dependent_name, maybe_get_fns): Likewise.
329
330 2019-05-14 Paolo Carlini <paolo.carlini@oracle.com>
331
332 PR preprocessor/90382
333 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
334 min_location.
335
336 2019-05-13 Jason Merrill <jason@redhat.com>
337
338 Use releasing_vec more broadly.
339 * cp-tree.h (struct releasing_vec): Replace get_ref method with
340 operator&.
341 (vec_safe_push, vec_safe_reserve, vec_safe_length, vec_safe_splice):
342 Forwarding functions for releasing_vec.
343 (release_tree_vector): Declare but don't define.
344 * call.c (build_op_delete_call, build_temp, call_copy_ctor)
345 (perform_direct_initialization_if_possible): Use releasing_vec.
346 * constexpr.c (cxx_eval_vec_init_1, cxx_eval_store_expression):
347 Likewise.
348 * cp-gimplify.c (cp_fold): Likewise.
349 * cvt.c (force_rvalue, ocp_convert): Likewise.
350 * decl.c (get_tuple_decomp_init): Likewise.
351 * except.c (build_throw): Likewise.
352 * init.c (perform_member_init, expand_default_init): Likewise.
353 * method.c (do_build_copy_assign, locate_fn_flags): Likewise.
354 * parser.c (cp_parser_userdef_char_literal)
355 (cp_parser_userdef_numeric_literal)
356 (cp_parser_userdef_string_literal)
357 (cp_parser_perform_range_for_lookup)
358 (cp_parser_range_for_member_function, cp_parser_omp_for_loop)
359 (cp_parser_omp_for_loop_init): Likewise.
360 * pt.c (tsubst_copy_and_build, do_class_deduction): Likewise.
361 * semantics.c (calculate_direct_bases, calculate_bases)
362 (finish_omp_barrier, finish_omp_flush, finish_omp_taskwait)
363 (finish_omp_taskyield, finish_omp_cancel)
364 (finish_omp_cancellation_point): Likewise.
365 * tree.c (build_vec_init_elt, strip_typedefs, strip_typedefs_expr)
366 (build_min_non_dep_op_overload): Likewise.
367 * typeck.c (build_function_call_vec, cp_build_function_call_nary)
368 (cp_build_modify_expr): Likewise.
369 * typeck2.c (build_functional_cast): Likewise.
370
371 2019-05-11 Paolo Carlini <paolo.carlini@oracle.com>
372
373 * typeck.c (cp_build_function_call_vec): When mark_used fails
374 unconditionally return error_mark_node.
375
376 2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
377
378 * decl.c (grokvardecl): Use an accurate location in error message
379 about main as a global variable.
380
381 2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
382
383 * call.c (build_call_a): Use FUNC_OR_METHOD_TYPE_P.
384 * cp-gimplify.c (cp_fold): Likewise.
385 * cp-objcp-common.c (cp_type_dwarf_attribute): Likewise.
386 * cp-tree.h (TYPE_OBJ_P, TYPE_PTROBV_P): Likewise.
387 * cvt.c (perform_qualification_conversions): Likewise.
388 * decl.c (grokdeclarator): Likewise.
389 * decl2.c (build_memfn_type): Likewise.
390 * mangle.c (canonicalize_for_substitution, write_type): Likewise.
391 * parser.c (cp_parser_omp_declare_reduction): Likewise.
392 * pt.c (check_explicit_specialization, uses_deducible_template_parms,
393 check_cv_quals_for_unify, dependent_type_p_r): Likewise.
394 * rtti.c (ptr_initializer): Likewise.
395 * semantics.c (finish_asm_stmt, finish_offsetof,
396 cp_check_omp_declare_reduction): Likewise.
397 * tree.c (cp_build_qualified_type_real,
398 cp_build_type_attribute_variant, cxx_type_hash_eq,
399 cxx_copy_lang_qualifiers, cp_free_lang_data): Likewise.
400 * typeck.c (structural_comptypes, convert_arguments,
401 cp_build_addr_expr_1, unary_complex_lvalue, cp_build_c_cast,
402 cp_build_modify_expr, comp_ptr_ttypes_real, type_memfn_rqual):
403 Likewise.
404
405 2019-05-10 Marek Polacek <polacek@redhat.com>
406
407 PR c++/78010 - bogus -Wsuggest-override warning on final function.
408 * class.c (check_for_override): Don't warn for final functions.
409
410 2019-05-10 Jakub Jelinek <jakub@redhat.com>
411
412 PR pch/90326
413 * config-lang.in (gtfiles): Remove c-family/c-lex.c, add
414 c-family/c-cppbuiltin.c.
415
416 2019-05-09 Paolo Carlini <paolo.carlini@oracle.com>
417
418 PR c++/90382
419 Revert:
420 2018-04-26 Paolo Carlini <paolo.carlini@oracle.com>
421
422 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
423 min_location.
424
425 2019-05-08 Nathan Sidwell <nathan@acm.org>
426
427 Kill DECL_SAVED_FUNCTION_DATA .
428 * cp-tree.h (language_function): Remove x_auto_return_pattern.
429 (current_function_auto_return_pattern): Delete.
430 (lang_decl_fn): Replace saved_language_function with
431 saved_auto_return type.
432 (DECL_SAVED_FUNCTION_DATA): Delete.
433 (DECL_SAVED_AUTO_RETURN_TYPE): New.
434 (FNDECL_USED_AUTO): Correct documentation.
435 * decl.c (duplicate_decls): Adjust AUTO return handling.
436 (start_preparsed_function): Replace
437 current_function_auto_return_pattern with
438 DECL_SAVED_AUTO_RETURN_TYPE. Remove DECL_SAVED_FUNCTION_DATA
439 zapping.
440 (finish_function): Likewise.
441 (save_function_data): Delete.
442 (fndecl_declared_return_type): Reimplement.
443 * mangle.c (write_unqualified_name): Use DECL_SAVED_AUTO_RETURN_TYPE.
444 * method.c (make_thunk, make_alias_for): Likewise.
445 * parser.c (cp_parser_jump_statement): Likewise.
446 * pt.c (do_auto_deduction): Likewise.
447 * typeck.c (check_return_expr): Likewise.
448
449 2019-05-06 Jason Merrill <jason@redhat.com>
450
451 PR c++/90171 - reorganize usual_deallocation_fn_p
452 * call.c (struct dealloc_info): New.
453 (usual_deallocation_fn_p): Take a dealloc_info*.
454 (aligned_deallocation_fn_p, sized_deallocation_fn_p): Remove.
455 (build_op_delete_call): Adjust.
456
457 2019-05-07 Jason Merrill <jason@redhat.com>
458
459 PR c++/86485 - -Wmaybe-unused with empty class ?:
460 * typeck.c (build_static_cast_1): Use cp_build_addr_expr.
461
462 * pt.c (type_dependent_expression_p): A non-type template parm with
463 a placeholder type is type-dependent.
464
465 2019-05-06 Marek Polacek <polacek@redhat.com>
466
467 PR c++/90265 - ICE with generic lambda.
468 * pt.c (tsubst_copy_and_build): Use a dedicated variable for the last
469 element in the vector.
470
471 2019-05-03 Martin Liska <mliska@suse.cz>
472
473 * call.c (build_aggr_conv): Use is_empty instead of
474 elements () == 0 (and similar usages).
475 * parser.c (cp_parser_lambda_introducer): Likewise.
476
477 2019-05-02 Nathan Sidwell <nathan@acm.org>
478
479 * semantics.c (finish_id_expression_1): Remove unreachable code.
480
481 2019-05-01 Nathan Sidwell <nathan@acm.org>
482
483 * name-lookup.h (get_class_binding_direct): Change final arg to
484 bool.
485 (get_class_binding): Likewise.
486 * name-lookup.c (get_class_binding_direct): Replace TYPE_OR_FNS
487 arg with WANT_TYPE bool. Simplify.
488 (get_class_binding): Adjust final arg.
489 * decl.c (reshape_init_class): Adjust get_class_binding calls.
490
491 2019-04-30 Nathan Sidwell <nathan@acm.org>
492
493 * cp-objcp-common.c (cp_common_init_ts): Use MARK_TS_EXP for _EXPR
494 nodes. Call c_common_init_ts.
495
496 2019-04-29 Nathan Sidwell <nathan@acm.org>
497
498 * decl.c (duplicate_decls): Add whitespace, move comments into
499 conditional blocks.
500 * method.c (explain_implicit_non_constexpr): Refactor.
501 * pt.c (check_explicit_specialization): Fix indentation.
502 * semantics.c (process_outer_var_ref): Reformat.
503 (finish_id_expression_1): Use STRIP_TEMPLATE.
504
505 2019-04-26 Jonathan Wakely <jwakely@redhat.com>
506
507 PR c++/90243 - orphaned note in uninstantiated constexpr function
508 * decl.c (check_for_uninitialized_const_var): Suppress notes if no
509 error was shown.
510
511 2019-04-26 Paolo Carlini <paolo.carlini@oracle.com>
512
513 PR c++/90173
514 * decl.c (grokdeclarator): Set type to error_mark_node
515 upon error about template placeholder type non followed
516 by a simple declarator-id.
517
518 2019-04-26 Paolo Carlini <paolo.carlini@oracle.com>
519
520 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
521 min_location.
522
523 2019-04-24 Jason Merrill <jason@redhat.com>
524
525 PR c++/90227 - error with template parameter packs.
526 * pt.c (coerce_template_parms): Do add empty pack when
527 require_all_args.
528
529 2019-04-24 Richard Biener <rguenther@suse.de>
530
531 * call.c (null_ptr_cst_p): Order checks according to expensiveness.
532 (conversion_null_warnings): Likewise.
533 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Return
534 early if type1 == type2.
535
536 2019-04-22 Jason Merrill <jason@redhat.com>
537
538 PR c++/87366 - wrong error with alias template.
539 * typeck.c (structural_comptypes): When comparing_specializations,
540 aliases are unequal.
541 (comptypes): When comparing_specializations, do structural
542 comparison.
543
544 2019-04-19 Jason Merrill <jason@redhat.com>
545
546 PR c++/90190 - CTAD with list-constructor.
547 * pt.c (do_class_deduction): Don't try the single element deduction
548 if the single element is also a braced list.
549
550 PR c++/90171 - ICE with destroying delete with size_t parm.
551 * call.c (sized_deallocation_fn_p): New. Use it instead of
552 second_parm_is_size_t in most cases.
553 (second_parm_is_size_t): Don't check for aligned.
554
555 2019-04-19 Paolo Carlini <paolo.carlini@oracle.com>
556
557 PR c++/89900
558 * pt.c (fn_type_unification): When handling null explicit
559 arguments do not special case non-parameter packs.
560
561 2019-04-19 Jakub Jelinek <jakub@redhat.com>
562
563 PR c++/90138
564 * pt.c (process_template_parm): Set decl to pushdecl result. If
565 !is_non_type, also set parm to that.
566
567 PR c/89888
568 * decl.c (struct cp_switch): Remove outside_range_p member.
569 (push_switch): Don't clear it.
570 (pop_switch): Adjust c_do_switch_warnings caller.
571 (finish_case_label): Adjust c_add_case_label caller.
572
573 PR c++/90108
574 * decl.c (duplicate_decls): If remove is main variant and
575 DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
576 variant that has newdecl as TYPE_NAME if any.
577
578 2019-04-18 Jason Merrill <jason@redhat.com>
579
580 PR c++/87554 - ICE with extern template and reference member.
581 * decl.c (cp_finish_decl): Don't set DECL_INITIAL of external vars.
582
583 2019-04-17 Jason Merrill <jason@redhat.com>
584
585 PR c++/90047 - ICE with enable_if alias template.
586 * pt.c (tsubst_decl) [TYPE_DECL]: Don't put an erroneous decl in the
587 hash table when we're in SFINAE context.
588
589 2019-04-17 Marek Polacek <polacek@redhat.com>
590
591 PR c++/90124 - bogus error with incomplete type in decltype.
592 * typeck.c (build_class_member_access_expr): Check
593 cp_unevaluated_operand.
594
595 2019-04-12 Jakub Jelinek <jakub@redhat.com>
596
597 PR c/89933
598 * decl.c (duplicate_decls): When newdecl's type is its main variant,
599 don't try to remove it from the variant list, but instead assert
600 it has no variants.
601
602 2019-04-12 Martin Sebor <msebor@redhat.com>
603
604 PR c/88383
605 PR c/89288
606 * parser.c (cp_parser_has_attribute_expression): Handle assignment
607 expressions.
608
609 2019-04-12 Jason Merrill <jason@redhat.com>
610
611 * call.c (null_member_pointer_value_p): Handle an empty CONSTRUCTOR
612 of PMF type.
613
614 2019-04-12 Marek Polacek <polacek@redhat.com>
615
616 * except.c (build_noexcept_spec): Use build_converted_constant_bool_expr
617 instead of perform_implicit_conversion_flags.
618
619 PR c++/87603 - constexpr functions are no longer noexcept.
620 * constexpr.c (is_sub_constant_expr): Remove unused function.
621 * cp-tree.h (is_sub_constant_expr): Remove declaration.
622 * except.c (check_noexcept_r): Don't consider a call to a constexpr
623 function noexcept.
624
625 2019-04-11 Jakub Jelinek <jakub@redhat.com>
626
627 PR translation/90035
628 * parser.h (struct cp_parser): Add
629 type_definition_forbidden_message_arg member.
630 * parser.c (cp_debug_parser): Print it.
631 (cp_parser_check_type_definition): Pass
632 parser->type_definition_forbidden_message_arg as second argument to
633 error.
634 (cp_parser_has_attribute_expression, cp_parser_sizeof_operand): Set
635 parser->type_definition_forbidden_message_arg and use G_() with
636 %qs for parser->type_definition_forbidden_message instead of
637 building untranslatable message using concat.
638
639 2019-04-09 Jakub Jelinek <jakub@redhat.com>
640
641 PR translation/90011
642 * typeck2.c (check_narrowing): Remove trailing space from diagnostics.
643
644 2019-04-08 Marek Polacek <polacek@redhat.com>
645
646 * typeck2.c (digest_init_r): Don't condition the object slicing warning
647 on flag_checking.
648
649 2019-04-08 Paolo Carlini <paolo.carlini@oracle.com>
650
651 PR c++/89914
652 * semantics.c (trait_expr_value): Don't use TYPE_NOTHROW_P
653 when maybe_instantiate_noexcept fails.
654 (classtype_has_nothrow_assign_or_copy_p): Likewise.
655 * method.c (implicitly_declare_fn): Avoid passing error_mark_node
656 to build_exception_variant.
657
658 2019-04-05 Marek Polacek <polacek@redhat.com>
659
660 PR c++/87145 - bogus error converting class type in template arg list.
661 * pt.c (convert_nontype_argument): Don't call
662 build_converted_constant_expr if it could involve calling a conversion
663 function with a instantiation-dependent constructor as its argument.
664
665 2019-04-05 Martin Sebor <msebor@redhat.com>
666
667 PR bootstrap/89980
668 * decl.c (reshape_init_array_1): Avoid treating empty strings
669 as zeros in array initializers.
670 Use trivial_type_p () instead of TYPE_HAS_TRIVIAL_DFLT().
671
672 2019-04-04 Jason Merrill <jason@redhat.com>
673
674 PR c++/89948 - ICE with break in statement-expr.
675 * constexpr.c (cxx_eval_statement_list): Jumping out of a
676 statement-expr is non-constant.
677
678 2019-04-04 Jason Merrill <jason@redhat.com>
679
680 PR c++/89966 - error with non-type auto tparm.
681 * pt.c (do_auto_deduction): Clear tf_partial.
682
683 2019-04-04 Jason Merrill <jason@redhat.com>
684
685 PR c++/86986 - ICE with TTP with parameter pack.
686 * pt.c (coerce_template_parameter_pack): Only look at the type of a
687 non-type parameter pack.
688 (fixed_parameter_pack_p_1): Don't recurse into the type of a
689 non-type parameter pack.
690 (coerce_template_template_parms): Call add_outermost_template_args.
691
692 2019-04-04 Martin Sebor <msebor@redhat.com>
693
694 PR c++/89974
695 PR c++/89878
696 PR c++/89833
697 PR c++/47488
698 * decl.c (reshape_init_array_1): Strip trailing zero-initializers
699 from arrays of trivial type and known size.
700 * mangle.c (write_expression): Convert braced initializer lists
701 to STRING_CSTs.
702 (write_expression): Trim trailing zero-initializers from arrays
703 of trivial type.
704 (write_template_arg_literal): Mangle strings the same as braced
705 initializer lists.
706
707 2019-04-03 Jason Merrill <jason@redhat.com>
708
709 PR c++/81866 - ICE with member template and default targ.
710 * pt.c (tsubst_template_decl): Handle getting a type from
711 retrieve_specialization.
712
713 PR c++/86586 - -fcompare-debug=-Wsign-compare.
714 * typeck.c (cp_build_binary_op): Don't fold for -Wsign-compare.
715
716 PR c++/89331 - ICE with offsetof in incomplete class.
717 * semantics.c (finish_offsetof): Handle error_mark_node.
718 * typeck.c (build_class_member_access_expr): Call
719 complete_type_or_maybe_complain before converting to base.
720
721 PR c++/89917 - ICE with lambda in variadic mem-init.
722 * pt.c (make_pack_expansion): Change type_pack_expansion_p to false.
723
724 2019-04-01 Jason Merrill <jason@redhat.com>
725
726 PR c++/86946 - ICE with function call in template argument.
727 DR 1321
728 * pt.c (iterative_hash_template_arg) [CALL_EXPR]: Use
729 dependent_name.
730
731 2019-04-01 Paolo Carlini <paolo.carlini@oracle.com>
732
733 PR c++/62207
734 * pt.c (tsubst_copy): Deal with lookup_name not returing a variable.
735
736 2019-03-31 Marek Polacek <polacek@redhat.com>
737
738 PR c++/89852 - ICE with C++11 functional cast with { }.
739 * constexpr.c (fold_non_dependent_expr_template): New static function
740 broken out of...
741 (fold_non_dependent_expr): ...here.
742 (fold_non_dependent_init): New function.
743 * cp-tree.h (fold_non_dependent_init): Declare.
744 * typeck2.c (massage_init_elt): Call fold_non_dependent_init instead
745 of fold_non_dependent_expr. Don't call maybe_constant_init.
746
747 2019-03-30 Jason Merrill <jason@redhat.com>
748
749 PR c++/89744 - ICE with specialization of member class template.
750 * pt.c (lookup_template_class_1): If the partial instantiation is
751 explicitly specialized, adjust.
752 (maybe_process_partial_specialization): Also adjust
753 CLASSTYPE_TI_ARGS.
754
755 2019-03-29 Jakub Jelinek <jakub@redhat.com>
756
757 PR sanitizer/89869
758 * typeck.c: Include gimplify.h.
759 (cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it
760 for second time. Formatting fixes.
761
762 2019-03-29 Marek Polacek <polacek@redhat.com>
763
764 PR c++/89876 - ICE with deprecated conversion.
765 * call.c (convert_like_real): Only give warnings with tf_warning.
766
767 2019-03-28 Marek Polacek <polacek@redhat.com>
768
769 PR c++/89612 - ICE with member friend template with noexcept.
770 * pt.c (maybe_instantiate_noexcept): For function templates, use their
771 template result (function decl). Don't set up local specializations.
772 Temporarily turn on processing_template_decl. Update the template type
773 too.
774
775 PR c++/89836 - bool constant expression and explicit conversions.
776 * call.c (build_converted_constant_expr_internal): New function,
777 renamed from...
778 (build_converted_constant_expr): ...this. New.
779 (build_converted_constant_bool_expr): New.
780 * cp-tree.h (build_converted_constant_bool_expr): Declare.
781 * decl.c (build_explicit_specifier): Call
782 build_converted_constant_bool_expr.
783
784 2019-03-28 Jakub Jelinek <jakub@redhat.com>
785
786 PR c++/89785
787 * constexpr.c (struct check_for_return_continue_data): New type.
788 (check_for_return_continue): New function.
789 (potential_constant_expression_1) <case SWITCH_STMT>: Walk
790 SWITCH_STMT_BODY to find RETURN_EXPRs or CONTINUE_STMTs not nested
791 in loop bodies and set *jump_target to that if found.
792
793 2019-03-27 Jason Merrill <jason@redhat.com>
794
795 PR c++/89831 - error with qualified-id in const member function.
796 * semantics.c (finish_non_static_data_member): Use object cv-quals
797 in scoped case, too.
798
799 PR c++/89421 - ICE with lambda in template parameter list.
800 * parser.c (cp_parser_lambda_expression): Also reject a lambda in a
801 template parameter list before C++20.
802 * pt.c (type_dependent_expression_p): True for LAMBDA_EXPR.
803 * semantics.c (begin_class_definition): Restore error about defining
804 non-lambda class in template parm list.
805
806 2019-03-26 Jason Merrill <jason@redhat.com>
807
808 PR c++/86932 - missed SFINAE with empty pack.
809 * pt.c (coerce_template_parms): Don't add an empty pack if
810 tf_partial.
811 (fn_type_unification): Pass tf_partial to coerce_template_parms.
812
813 PR c++/86429 - constexpr variable in lambda.
814 PR c++/82643
815 PR c++/87327
816 * constexpr.c (cxx_eval_constant_expression): In a lambda function,
817 try evaluating the captured variable directly.
818
819 2019-03-26 Jakub Jelinek <jakub@redhat.com>
820
821 PR c++/89796
822 * semantics.c (finish_omp_atomic): Add warning_sentinel for
823 -Wunused-value around finish_expr_stmt call.
824
825 2019-03-25 Paolo Carlini <paolo.carlini@oracle.com>
826
827 PR c++/84661
828 PR c++/85013
829 * parser.c (cp_parser_binary_expression): Don't call cp_fully_fold
830 to undo the disabling of warnings.
831
832 2019-03-25 Jason Merrill <jason@redhat.com>
833
834 PR c++/87748 - substitution failure error with decltype.
835 * pt.c (most_specialized_partial_spec): Clear
836 processing_template_decl.
837
838 2019-03-25 Marek Polacek <polacek@redhat.com>
839
840 PR c++/89214 - ICE when initializing aggregates with bases.
841 * typeck2.c (digest_init_r): Warn about object slicing instead of
842 crashing.
843
844 PR c++/89705 - ICE with reference binding with conversion function.
845 * call.c (reference_binding): If the result of the conversion function
846 is a prvalue of non-class type, use the cv-unqualified type.
847
848 2019-03-25 Nathan Sidwell <nathan@acm.org>
849
850 * lambda.c (maybe_add_lambda_conv_op): Don't add to comdat group.
851
852 2019-03-22 Jakub Jelinek <jakub@redhat.com>
853
854 PR c++/60702
855 * cp-tree.h (get_tls_wrapper_fn): Remove declaration.
856 (maybe_get_tls_wrapper_call): Declare.
857 * decl2.c (get_tls_wrapper_fn): Make static.
858 (maybe_get_tls_wrapper_call): New function.
859 * typeck.c (build_class_member_access_expr): Handle accesses to TLS
860 variables.
861 * semantics.c (finish_qualified_id_expr): Likewise.
862 (finish_id_expression_1): Use maybe_get_tls_wrapper_call.
863 * pt.c (tsubst_copy_and_build): Likewise.
864
865 PR c++/87481
866 * constexpr.c (struct constexpr_ctx): Add constexpr_ops_count member.
867 (cxx_eval_constant_expression): When not skipping, not constant class
868 or location wrapper, increment *ctx->constexpr_ops_count and if it is
869 above constexpr_loop_nest_limit, diagnose failure.
870 (cxx_eval_outermost_constant_expr): Add constexpr_ops_count and
871 initialize ctx.constexpr_ops_count to its address.
872 (is_sub_constant_expr): Likewise.
873
874 2019-03-21 Jakub Jelinek <jakub@redhat.com>
875
876 PR c++/71446
877 * call.c (filed_in_pset): Change pset from hash_set<tree> * to
878 hash_set<tree, true> &, adjust uses accordingly.
879 (build_aggr_conv): Change pset from hash_set<tree> *
880 to hash_set<tree, true>. Replace goto fail; with return NULL;,
881 adjust pset uses.
882
883 PR c++/89767
884 * parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id
885 variables, check for duplicates in this function.
886 * lambda.c (add_capture): Don't check for duplicates nor use
887 IDENTIFIER_MARKED.
888 (register_capture_members): Don't clear IDENTIFIER_MARKED here.
889
890 2019-03-21 Paolo Carlini <paolo.carlini@oracle.com>
891
892 PR c++/89571
893 * method.c (after_nsdmi_defaulted_late_checks): Avoid passing
894 error_mark_node to comp_except_specs.
895
896 2019-03-20 Jason Merrill <jason@redhat.com>
897
898 PR c++/87480 - decltype of member access in default template arg
899 * pt.c (type_unification_real): Accept a dependent result in
900 template context.
901
902 2019-03-19 Martin Sebor <msebor@redhat.com>
903
904 PR tree-optimization/89688
905 * typeck2.c (store_init_value): Call braced_lists_to_string for more
906 kinds of initializers.
907
908 2019-03-18 Jason Merrill <jason@redhat.com>
909
910 PR c++/89630 - ICE with dependent using-decl as template arg.
911 * tree.c (cp_tree_equal): Always return false for USING_DECL.
912
913 PR c++/89761 - ICE with sizeof... in pack expansion.
914 * pt.c (argument_pack_element_is_expansion_p): Handle
915 ARGUMENT_PACK_SELECT.
916
917 PR c++/89640 - GNU attributes on lambda.
918 * parser.c (cp_parser_lambda_declarator_opt): Allow GNU attributes.
919
920 PR c++/89682 - wrong access error in default argument.
921 * pt.c (tsubst_default_argument): Don't defer access checks.
922
923 2019-03-18 Paolo Carlini <paolo.carlini@oracle.com>
924
925 PR c++/85014
926 * semantics.c (finish_non_static_data_member): Check return value
927 of context_for_name_lookup and immediately return error_mark_node
928 if isn't a type.
929
930 2019-03-17 Jason Merrill <jason@redhat.com>
931
932 PR c++/89571 - ICE with ill-formed noexcept on constructor.
933 * pt.c (maybe_instantiate_noexcept): Only return false if defaulted.
934 (regenerate_decl_from_template): Use it for noexcept-specs.
935
936 2019-03-14 Jason Merrill <jason@redhat.com>
937
938 * parser.c (cp_parser_decl_specifier_seq): Support C++20
939 concept-definition syntax without 'bool'.
940
941 2019-03-14 Jakub Jelinek <jakub@redhat.com>
942
943 PR c++/89512
944 * semantics.c (finish_qualified_id_expr): Reject variable templates.
945
946 PR c++/89652
947 * constexpr.c (struct constexpr_ctx): Change save_exprs type from
948 hash_set<tree> to vec<tree>.
949 (cxx_eval_call_expression): Adjust for save_exprs being a vec instead
950 of hash_set.
951 (cxx_eval_loop_expr): Likewise. Truncate the vector after each
952 removal of SAVE_EXPRs from values.
953 (cxx_eval_constant_expression) <case SAVE_EXPR>: Call safe_push
954 method on save_exprs instead of add.
955
956 2019-03-13 Jason Merrill <jason@redhat.com>
957
958 PR c++/86521 - C++17 copy elision in initialization by constructor.
959 * call.c (joust_maybe_elide_copy): New.
960 (joust): Call it.
961
962 2019-03-13 Marek Polacek <polacek@redhat.com>
963
964 PR c++/88979 - further P0634 fix for constructors.
965 * parser.c (cp_parser_decl_specifier_seq): Pass flags to
966 cp_parser_constructor_declarator_p.
967 (cp_parser_direct_declarator): Allow missing typename for constructor
968 parameters.
969 (cp_parser_constructor_declarator_p): Add FLAGS parameter. Pass it to
970 cp_parser_type_specifier.
971
972 PR c++/89686 - mixing init-capture and simple-capture in lambda.
973 * parser.c (cp_parser_lambda_introducer): Give error when combining
974 init-capture and simple-capture.
975
976 PR c++/89660 - bogus error with -Wredundant-move.
977 * typeck.c (maybe_warn_pessimizing_move): Only accept (T &) &arg
978 as the std::move's argument. Don't call convert_for_initialization
979 when warn_redundant_move isn't on.
980
981 2019-03-11 Jason Merrill <jason@redhat.com>
982
983 PR c++/86521 - wrong overload resolution with ref-qualifiers.
984 * call.c (build_user_type_conversion_1): Don't use a conversion to a
985 reference of the wrong rvalueness for direct binding.
986
987 2019-03-11 Martin Liska <mliska@suse.cz>
988
989 * cvt.c (build_expr_type_conversion): Wrap apostrophes
990 in gcc internal format with %'.
991 * decl.c (check_no_redeclaration_friend_default_args): Likewise.
992 (grokfndecl): Likewise.
993 * name-lookup.c (do_pushtag): Likewise.
994 * pt.c (unify_parameter_deduction_failure): Likewise.
995 (unify_template_deduction_failure): Likewise.
996
997 2019-03-11 Martin Liska <mliska@suse.cz>
998
999 * call.c (convert_arg_to_ellipsis): Wrap an option name
1000 in a string format message and fix GNU coding style.
1001 (build_over_call): Likewise.
1002 * class.c (check_field_decl): Likewise.
1003 (layout_nonempty_base_or_field): Likewise.
1004 * constexpr.c (cxx_eval_loop_expr): Likewise.
1005 * cvt.c (type_promotes_to): Likewise.
1006 * decl.c (cxx_init_decl_processing): Likewise.
1007 (mark_inline_variable): Likewise.
1008 (grokdeclarator): Likewise.
1009 * decl2.c (record_mangling): Likewise.
1010 * error.c (maybe_warn_cpp0x): Likewise.
1011 * except.c (doing_eh): Likewise.
1012 * mangle.c (maybe_check_abi_tags): Likewise.
1013 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
1014 (cp_parser_userdef_numeric_literal): Likewise.
1015 (cp_parser_primary_expression): Likewise.
1016 (cp_parser_unqualified_id): Likewise.
1017 (cp_parser_pseudo_destructor_name): Likewise.
1018 (cp_parser_builtin_offsetof): Likewise.
1019 (cp_parser_lambda_expression): Likewise.
1020 (cp_parser_lambda_introducer): Likewise.
1021 (cp_parser_lambda_declarator_opt): Likewise.
1022 (cp_parser_selection_statement): Likewise.
1023 (cp_parser_init_statement): Likewise.
1024 (cp_parser_decomposition_declaration): Likewise.
1025 (cp_parser_function_specifier_opt): Likewise.
1026 (cp_parser_static_assert): Likewise.
1027 (cp_parser_simple_type_specifier): Likewise.
1028 (cp_parser_namespace_definition): Likewise.
1029 (cp_parser_using_declaration): Likewise.
1030 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
1031 (cp_parser_initializer_list): Likewise.
1032 (cp_parser_type_parameter_key): Likewise.
1033 (cp_parser_member_declaration): Likewise.
1034 (cp_parser_try_block): Likewise.
1035 (cp_parser_std_attribute_spec): Likewise.
1036 (cp_parser_requires_clause_opt): Likewise.
1037 * pt.c (check_template_variable): Likewise.
1038 (check_default_tmpl_args): Likewise.
1039 (push_tinst_level_loc): Likewise.
1040 (instantiate_pending_templates): Likewise.
1041 (invalid_nontype_parm_type_p): Likewise.
1042 * repo.c (get_base_filename): Likewise.
1043 * rtti.c (typeid_ok_p): Likewise.
1044 (build_dynamic_cast_1): Likewise.
1045 * tree.c (maybe_warn_parm_abi): Likewise.
1046
1047 2019-03-08 Jakub Jelinek <jakub@redhat.com>
1048
1049 PR other/80058
1050 * parser.c (cp_parser_template_declaration_after_parameters): Avoid
1051 one space before " at the end of line and another after " on another
1052 line in a string literal.
1053
1054 PR tree-optimization/89550
1055 * semantics.c (maybe_convert_cond): Only set TREE_NO_WARNING if
1056 warning_at returned true.
1057 * decl2.c (c_parse_final_cleanups): Likewise.
1058 * typeck.c (convert_for_assignment): Likewise.
1059 * decl.c (finish_function): Likewise.
1060
1061 PR c++/89585
1062 * parser.c (cp_parser_asm_definition): Just warn instead of error
1063 on volatile qualifier outside of function body.
1064
1065 PR c++/89599
1066 * constexpr.c (potential_constant_expression_1): Reject
1067 REINTERPRET_CAST_P NOP_EXPRs.
1068
1069 PR c++/89622
1070 * call.c (joust): Call print_z_candidate only if pedwarn returned
1071 true.
1072
1073 2019-03-07 Jason Merrill <jason@redhat.com>
1074
1075 PR c++/88123 - lambda and using-directive.
1076 * name-lookup.c (op_unqualified_lookup)
1077 (maybe_save_operator_binding, discard_operator_bindings)
1078 (push_operator_bindings): New.
1079 * typeck.c (build_x_binary_op, build_x_unary_op): Call
1080 maybe_save_operator_binding.
1081 * decl.c (start_preparsed_function): Call push_operator_bindings.
1082 * tree.c (cp_free_lang_data): Call discard_operator_bindings.
1083
1084 PR c++/88820 - ICE with CTAD and member template used in DMI.
1085 * pt.c (do_class_deduction): Handle parm used as its own arg.
1086
1087 2019-03-07 Jakub Jelinek <jakub@redhat.com>
1088
1089 PR c++/89585
1090 * parser.c (cp_parser_asm_definition): Parse asm qualifiers even
1091 at toplevel, but diagnose them.
1092
1093 2019-03-06 Jason Merrill <jason@redhat.com>
1094
1095 PR c++/89381 - implicit copy and using-declaration.
1096 * class.c (classtype_has_move_assign_or_move_ctor_p): Don't consider
1097 op= brought in by a using-declaration.
1098
1099 2019-03-06 Jakub Jelinek <jakub@redhat.com>
1100
1101 PR c++/87148
1102 * init.c (build_value_init_noctor): Ignore flexible array members.
1103
1104 2019-03-06 Jason Merrill <jason@redhat.com>
1105
1106 PR c++/89576 - if constexpr of lambda capture.
1107 * semantics.c (maybe_convert_cond): Do convert a non-dependent
1108 condition in a template.
1109 * typeck.c (condition_conversion): Handle being called in a
1110 template.
1111
1112 2019-03-06 Marek Polacek <polacek@redhat.com>
1113
1114 PR c++/87378 - bogus -Wredundant-move warning.
1115 * typeck.c (maybe_warn_pessimizing_move): See if the maybe-rvalue
1116 overload resolution would actually succeed.
1117
1118 2019-03-05 Jason Merrill <jason@redhat.com>
1119
1120 * class.c (is_really_empty_class): Add ignore_vptr parm.
1121 (trivial_default_constructor_is_constexpr): Pass it.
1122 * call.c (build_over_call): Pass it.
1123 * constexpr.c (cxx_eval_constant_expression): Pass it instead of
1124 checking TYPE_POLYMORPHIC_P.
1125 (cxx_eval_component_reference, potential_constant_expression_1):
1126 Pass it.
1127 * cp-gimplify.c (simple_empty_class_p): Pass it.
1128 * init.c (expand_aggr_init_1): Pass it.
1129
1130 2019-03-04 Paolo Carlini <paolo.carlini@oracle.com>
1131
1132 PR c++/84605
1133 * parser.c (cp_parser_class_head): Reject TYPE_BEING_DEFINED too.
1134
1135 2019-03-04 Jakub Jelinek <jakub@redhat.com>
1136
1137 PR c++/71446
1138 * call.c (field_in_pset): New function.
1139 (build_aggr_conv): Handle CONSTRUCTOR_IS_DESIGNATED_INIT correctly.
1140
1141 2019-03-02 Jakub Jelinek <jakub@redhat.com>
1142
1143 PR c++/71446
1144 * cp-tree.h (CONSTRUCTOR_IS_DESIGNATED_INIT): Define.
1145 * parser.c (cp_parser_braced_list): Adjust cp_parser_initializer_list
1146 caller, set CONSTRUCTOR_IS_DESIGNATED_INIT.
1147 (cp_parser_initializer_list): Add designated parameter, set *designated
1148 to a bool whether any designators were parsed.
1149 * decl.c (reshape_init): Copy over CONSTRUCTOR_IS_DESIGNATED_INIT if
1150 needed.
1151 * pt.c (tsubst_copy_and_build): Likewise.
1152 * call.c (implicit_conversion): If CONSTRUCTOR_IS_DESIGNATED_INIT,
1153 don't call build_list_conv, nor build_complex_conv, nor attempt to
1154 convert a single element initializer to scalar.
1155
1156 2019-03-01 Marek Polacek <polacek@redhat.com>
1157
1158 PR c++/89537 - missing location for error with non-static member fn.
1159 * call.c (resolve_args): Use EXPR_LOCATION.
1160 * typeck.c (build_class_member_access_expr): Use input_location.
1161
1162 PR c++/89532 - ICE with incomplete type in decltype.
1163 * semantics.c (finish_compound_literal): Return error_mark_node
1164 if digest_init_flags returns error_mark_node.
1165
1166 2019-03-01 Jakub Jelinek <jakub@redhat.com>
1167
1168 Implement P1002R1, Try-catch blocks in constexpr functions
1169 PR c++/89513
1170 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
1171 Diagnose constexpr ctor or function with function-try-block with
1172 pedwarn for c++17 and earlier. Formatting fix.
1173 (cp_parser_try_block): Use pedwarn instead of error and only for
1174 c++17 and earlier when try block appears in constexpr function.
1175 * constexpr.c (build_constexpr_constructor_member_initializers):
1176 Handle TRY_BLOCK here instead of erroring on it.
1177
1178 2019-02-28 Jason Merrill <jason@redhat.com>
1179
1180 PR c++/88183 - ICE with .* fold-expression.
1181 * pt.c (fold_expression) [DOTSTAR_EXPR]: Remove special handling.
1182
1183 PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
1184 * class.c, lambda.c, pt.c: Revert earlier change.
1185 * lambda.c (add_capture): Don't special-case capture of dependent
1186 VLA.
1187
1188 * name-lookup.c (print_binding_level): Print this_entity.
1189
1190 2019-02-27 Marek Polacek <polacek@redhat.com>
1191
1192 PR c++/88857 - ICE with value-initialization of argument in template.
1193 * call.c (convert_like_real): Don't call build_value_init in template.
1194
1195 2019-02-27 Jason Merrill <jason@redhat.com>
1196
1197 PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
1198 * semantics.c (process_outer_var_ref): Do capture dependent vars.
1199 * class.c (finish_struct): Only add TAG_DEFN if T is in
1200 current_function_decl.
1201 * lambda.c (vla_capture_type): Force the capture type out into the
1202 lambda's enclosing function.
1203 (add_capture): Pass in the lambda.
1204 * pt.c (tsubst_lambda_expr): complete_type a VLA capture type.
1205
1206 2019-02-27 Marek Polacek <polacek@redhat.com>
1207
1208 PR c++/89511 - ICE with using-declaration and unscoped enumerator.
1209 * parser.c (cp_parser_using_declaration): For an unscoped enum
1210 only use its context if it's not a function declaration.
1211
1212 2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
1213
1214 PR c++/89488
1215 * method.c (process_subob_fn): When maybe_instantiate_noexcept
1216 returns false don't call merge_exception_specifiers.
1217
1218 2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
1219
1220 PR c++/88987
1221 * parser.c (cp_parser_noexcept_specification_opt): Return NULL_TREE
1222 for a non-constant parsed expression.
1223
1224 2019-02-26 Jakub Jelinek <jakub@redhat.com>
1225
1226 PR c++/89481
1227 * constexpr.c (cxx_eval_store_expression): When changing active union
1228 member, set no_zero_init.
1229
1230 2019-02-23 Marek Polacek <polacek@redhat.com>
1231
1232 PR c++/88294 - ICE with non-constant noexcept-specifier.
1233 * pt.c (maybe_instantiate_noexcept): Set up the list of local
1234 specializations. Set current_class_{ptr,ref}.
1235
1236 2019-02-22 David Malcolm <dmalcolm@redhat.com>
1237
1238 PR c++/89390
1239 * parser.c (cp_parser_unqualified_id): Capture and use locations
1240 for destructors.
1241
1242 2019-02-22 Marek Polacek <polacek@redhat.com>
1243
1244 PR c++/89420 - ICE with CAST_EXPR in explicit-specifier.
1245 * decl.c (build_explicit_specifier): Don't check
1246 processing_template_decl. Call instantiation_dependent_expression_p
1247 instead of value_dependent_expression_p. Call
1248 instantiate_non_dependent_expr_sfinae before
1249 build_converted_constant_expr instead of calling
1250 instantiate_non_dependent_expr after it. Add
1251 processing_template_decl_sentinel.
1252
1253 2019-02-22 Thomas Schwinge <thomas@codesourcery.com>
1254
1255 * parser.c (cp_parser_oacc_simple_clause): Remove parser formal
1256 parameter, move loc formal parameter to the front. Adjust all
1257 users.
1258 (cp_parser_oacc_shape_clause): Add loc formal parameter. Adjust
1259 all users.
1260
1261 2019-02-21 Jason Merrill <jason@redhat.com>
1262
1263 PR c++/87685 - generic lambda 'this' capture error.
1264 * lambda.c (lambda_expr_this_capture): Change add_capture_p to int.
1265 (maybe_generic_this_capture): Pass -1.
1266
1267 PR c++/88394 - ICE with VLA init-capture.
1268 * lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE.
1269
1270 PR c++/88869 - C++17 ICE with CTAD and explicit specialization.
1271 * pt.c (do_class_deduction): Don't include explicit specialization
1272 args in outer_args.
1273
1274 PR c++/89422 - ICE with -g and lambda in default arg in template.
1275 * pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner.
1276
1277 2019-02-21 Jason Merrill <jason@redhat.com>
1278
1279 PR c++/88419 - C++17 ICE with class template arg deduction.
1280 * pt.c (make_template_placeholder): Set TYPE_CANONICAL after
1281 CLASS_PLACEHOLDER_TEMPLATE.
1282
1283 2019-02-21 Jakub Jelinek <jakub@redhat.com>
1284
1285 PR c++/89285
1286 * constexpr.c (struct constexpr_fundef): Add parms and result members.
1287 (retrieve_constexpr_fundef): Adjust for the above change.
1288 (register_constexpr_fundef): Save constexpr body with copy_fn,
1289 temporarily set DECL_CONTEXT on DECL_RESULT before that.
1290 (get_fundef_copy): Change FUN argument to FUNDEF with
1291 constexpr_fundef * type, grab body and parms/result out of
1292 constexpr_fundef struct and temporarily change it for copy_fn calls
1293 too.
1294 (cxx_eval_builtin_function_call): For __builtin_FUNCTION temporarily
1295 adjust current_function_decl from ctx->call context. Test
1296 !potential_constant_expression instead of !is_constant_expression.
1297 (cxx_bind_parameters_in_call): Grab parameters from new_call. Undo
1298 convert_for_arg_passing changes for TREE_ADDRESSABLE type passing.
1299 (cxx_eval_call_expression): Adjust get_fundef_copy caller.
1300 (cxx_eval_conditional_expression): For IF_STMT, allow then or else
1301 operands to be NULL.
1302 (label_matches): Handle BREAK_STMT and CONTINUE_STMT.
1303 (cxx_eval_loop_expr): Add support for FOR_STMT, WHILE_STMT and DO_STMT.
1304 (cxx_eval_switch_expr): Add support for SWITCH_STMT.
1305 (cxx_eval_constant_expression): Handle IF_STMT, FOR_STMT, WHILE_STMT,
1306 DO_STMT, CONTINUE_STMT, SWITCH_STMT, BREAK_STMT and CONTINUE_STMT.
1307 For SIZEOF_EXPR, recurse on the result of fold_sizeof_expr. Ignore
1308 DECL_EXPR with USING_DECL operand.
1309 * lambda.c (maybe_add_lambda_conv_op): Build thisarg using
1310 build_int_cst to make it a valid constant expression.
1311
1312 2019-02-20 Jason Merrill <jason@redhat.com>
1313
1314 PR c++/88690 - C++17 ICE with empty base in aggregate.
1315 * typeck2.c (process_init_constructor_record): Skip trivial
1316 initialization of an empty base.
1317
1318 2019-02-21 Richard Biener <rguenther@suse.de>
1319
1320 PR middle-end/89392
1321 * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not
1322 make symtab process new functions here.
1323
1324 2019-02-20 Jason Merrill <jason@redhat.com>
1325
1326 PR c++/87921 - wrong error with inline static data member.
1327 * decl2.c (finish_static_data_member_decl): Don't set DECL_IN_AGGR_P
1328 for a non-template inline variable. Do nothing for an
1329 already-instantiated variable.
1330 (c_parse_final_cleanups): Check DECL_IN_AGGR_P without
1331 DECL_INLINE_VAR_P.
1332 * decl.c (check_initializer): Likewise.
1333 (make_rtl_for_nonlocal_decl): Likewise.
1334 * pt.c (instantiate_decl): Likewise.
1335 * typeck2.c (store_init_value): Likewise.
1336
1337 2019-02-20 Jakub Jelinek <jakub@redhat.com>
1338
1339 PR c++/89403
1340 * decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting
1341 for flag_syntax_only from here...
1342 * semantics.c (expand_or_defer_fn_1): ... here.
1343
1344 PR c++/89405
1345 * decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and
1346 DECL_COMMON, set DECL_INTERFACE_KNOWN.
1347
1348 PR c++/89336
1349 * constexpr.c (cxx_eval_store_expression): Diagnose changing of active
1350 union member for -std=c++17 and earlier.
1351
1352 2019-02-19 Jason Merrill <jason@redhat.com>
1353
1354 PR c++/87513 - 'sorry' mangling PMF template-id.
1355 * mangle.c (write_expression): Handle SCOPE_REF to BASELINK.
1356
1357 2019-02-19 Jason Merrill <jason@redhat.com>
1358
1359 PR c++/88380 - wrong-code with flexible array and NSDMI.
1360 * typeck2.c (process_init_constructor_record): Skip flexarrays.
1361
1362 2019-02-20 will wray <wjwray@gmail.com>
1363
1364 PR c++/88572 - wrong handling of braces on scalar init.
1365 * decl.c (reshape_init_r): Allow braces around scalar initializer
1366 within aggregate init. Reject double braced-init of scalar
1367 variable.
1368
1369 2019-02-20 Paolo Carlini <paolo.carlini@oracle.com>
1370
1371 PR c++/84536
1372 * pt.c (tsubst_init): Diagnose an initializer expanding to an
1373 empty list of expressions; tweak wrt dependent types.
1374 (regenerate_decl_from_template): For VAR_DECLs call tsubst_init
1375 instead of tsubst_expr.
1376
1377 2019-02-19 Jason Merrill <jason@redhat.com>
1378
1379 PR c++/88368 - wrong 'use of deleted function'
1380 * method.c (walk_field_subobs): Remember errors from get_nsdmi.
1381 (get_defaulted_eh_spec): Call push_tinst_level.
1382 * pt.c (maybe_instantiate_noexcept): Keep error_mark_node.
1383 * typeck2.c (merge_exception_specifiers): Handle error_mark_node.
1384
1385 2019-02-19 Chung-Lin Tang <cltang@codesourcery.com>
1386
1387 PR c/87924
1388 * parser.c (cp_parser_oacc_clause_wait): Add representation of wait
1389 clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.
1390
1391 2019-02-19 Jakub Jelinek <jakub@redhat.com>
1392
1393 PR c++/89387
1394 * lambda.c (maybe_generic_this_capture): Don't check
1395 DECL_NONSTATIC_MEMBER_FUNCTION_P on USING_DECLs.
1396
1397 PR c++/89391
1398 * typeck.c (build_reinterpret_cast_1): Don't handle void to
1399 && conversion go through build_target_expr_with_type.
1400
1401 PR c++/89390
1402 * error.c (qualified_name_lookup_error): Only call
1403 suggest_alternative_in_scoped_enum if name is IDENTIFIER_NODE.
1404
1405 2019-02-19 Tom Honermann <tom@honermann.net>
1406
1407 * name-lookup.c (get_std_name_hint): Added u8string as a name hint.
1408
1409 2019-02-18 Jason Merrill <jason@redhat.com>
1410
1411 PR c++/89336 - multiple stores in constexpr stmt.
1412 * constexpr.c (cxx_eval_store_expression): Preevaluate scalar or
1413 assigned value.
1414
1415 * pt.c (check_explicit_specialization): If the declarator is a
1416 template-id, only check whether the arguments are dependent.
1417
1418 Improve duplicate [[likely]] diagnostic.
1419 * parser.c (cp_parser_statement): Make attrs_loc a range. Pass it
1420 to process_stmt_hotness_attribute.
1421 * cp-gimplify.c (process_stmt_hotness_attribute): Take attrs_loc.
1422 (genericize_if_stmt): Use likely/unlikely instead of predictor_name.
1423
1424 2019-02-17 Marek Polacek <polacek@redhat.com>
1425
1426 PR c++/89217 - ICE with list-initialization in range-based for loop.
1427 * constexpr.c (unshare_constructor): No longer static.
1428 * cp-tree.h (unshare_constructor): Declare.
1429 * semantics.c (finish_compound_literal): When dealing with a
1430 non-dependent expression in a template, return the original
1431 expression. Pass LOOKUP_NO_NARROWING to digest_init_flags.
1432
1433 2019-02-13 Marek Polacek <polacek@redhat.com>
1434
1435 PR c++/89297 - ICE with OVERLOAD in template.
1436 * semantics.c (finish_compound_literal): Call
1437 instantiate_non_dependent_expr_sfinae.
1438
1439 2019-02-13 Alexandre Oliva <aoliva@redhat.com>
1440
1441 PR c++/86379
1442 * cp-tree.h (USING_DECL_SCOPE): Use result rather than type.
1443 * name-lookup.c (strip_using_decl): Use USING_DECL_SCOPE.
1444 * search.c (protected_accessible_p): Follow USING_DECL_DECLS.
1445 (shared_member_p): Likewise.
1446 (lookup_member): Likewise.
1447 * decl.c (grok_special_member_properties): Skip USING_DECLs.
1448 * semantics.c (finish_omp_declare_simd_methods): Likewise.
1449 (finish_qualified_id_expr): Do not call shared_member_p with
1450 a dependent expr.
1451
1452 PR c++/87322
1453 * pt.c (tsubst_lambda_expr): Avoid duplicate tsubsting.
1454 Move cp_evaluated resetting before signature tsubsting.
1455 (gen_elem_of_pack_expansion_instantiation): Separate local
1456 specializations per index.
1457
1458 2019-02-13 David Malcolm <dmalcolm@redhat.com>
1459
1460 PR c++/89036
1461 * class.c (add_method): Drop destructor assertion.
1462
1463 2019-02-13 Paolo Carlini <paolo.carlini@oracle.com>
1464
1465 PR c++/88986
1466 * decl.c (make_typename_type): Allow for TYPE_PACK_EXPANSION as
1467 context (the first argument).
1468 * pt.c (tsubst, case TYPENAME_TYPE): Handle TYPE_PACK_EXPANSION
1469 as context.
1470
1471 2019-02-12 Jason Merrill <jason@redhat.com>
1472
1473 PR c++/89144 - link error with constexpr initializer_list.
1474 * call.c (convert_like_real) [ck_list]: Don't allocate a temporary
1475 array for an empty list.
1476 * typeck2.c (store_init_value): Don't use cxx_constant_init in a
1477 template.
1478
1479 2019-02-11 Jason Merrill <jason@redhat.com>
1480
1481 PR c++/89241 - ICE with __func__ in lambda in template.
1482 * pt.c (enclosing_instantiation_of): Also check
1483 instantiated_lambda_fn_p for the template context.
1484
1485 2019-02-11 Marek Polacek <polacek@redhat.com>
1486
1487 PR c++/89212 - ICE converting nullptr to pointer-to-member-function.
1488 * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Return early for
1489 null member pointer value.
1490
1491 2019-02-11 Jakub Jelinek <jakub@redhat.com>
1492
1493 PR c++/88977
1494 * pt.c (convert_nontype_argument): Pass true as manifestly_const_eval
1495 to maybe_constant_value calls.
1496
1497 2019-02-11 Marek Polacek <polacek@redhat.com>
1498
1499 * typeck2.c (digest_init_r): Remove commented code.
1500
1501 2019-02-11 Martin Sebor <msebor@redhat.com>
1502
1503 PR c++/87996
1504 * decl.c (compute_array_index_type_loc): Preserve signed sizes
1505 for diagnostics. Call valid_array_size_p instead of error.
1506 * init.c (build_new_1): Compute size for diagnostic. Call
1507 invalid_array_size_error
1508 (build_new): Call valid_array_size_p instead of error.
1509
1510 2019-02-07 Alexandre Oliva <aoliva@redhat.com>
1511
1512 PR c++/86218
1513 * call.c (compare_ics): Deal with ck_aggr in either cs.
1514
1515 2019-02-06 David Malcolm <dmalcolm@redhat.com>
1516
1517 PR c++/71302
1518 * call.c (get_location_for_expr_unwinding_for_system_header): New
1519 function.
1520 (conversion_null_warnings): Use it when getting locations for
1521 EXPR, effectively adding a call to
1522 get_location_for_expr_unwinding_for_system_header for
1523 -Wconversion-null and making use of EXPR_LOCATION for
1524 -Wzero-as-null-pointer-constant.
1525
1526 2019-02-05 Jakub Jelinek <jakub@redhat.com>
1527
1528 PR c++/89187
1529 * optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on
1530 PARM_DECLs of the thunk.
1531 * lambda.c (maybe_add_lambda_conv_op): Likewise.
1532
1533 2019-02-05 Marek Polacek <polacek@redhat.com>
1534
1535 PR c++/89158 - by-value capture of constexpr variable broken.
1536 * call.c (convert_like_real) <case ck_user>: Call mark_exp_read
1537 instead of mark_rvalue_use.
1538
1539 2019-02-05 Alexandre Oliva <aoliva@redhat.com>
1540
1541 PR c++/87770
1542 * pt.c (instantiates_primary_template_p): New.
1543 (type_dependent_expression_p): Use it.
1544
1545 2019-02-01 Jason Merrill <jason@redhat.com>
1546
1547 PR c++/88761 - ICE with reference capture of constant.
1548 * lambda.c (mark_const_cap_r): Do walk subtrees of DECL_EXPR for
1549 non-proxy decls.
1550
1551 2019-02-01 Marek Polacek <polacek@redhat.com>
1552
1553 PR c++/88325 - ICE with invalid out-of-line template member definition.
1554 * parser.c (cp_parser_class_name): Don't call make_typename_type
1555 for overloads.
1556
1557 2019-02-01 Jakub Jelinek <jakub@redhat.com>
1558
1559 PR c++/87175
1560 * parser.c (cp_parser_gnu_attributes_opt): Set ok to false
1561 if require_open failed.
1562
1563 2019-01-31 Marek Polacek <polacek@redhat.com>
1564
1565 PR c++/89083, c++/80864 - ICE with list initialization in template.
1566 * constexpr.c (adjust_temp_type): Use copy_node and change the type
1567 instead of using build_constructor.
1568 * decl.c (reshape_init_r): Don't reshape a digested initializer.
1569 Return the initializer for COMPOUND_LITERAL_P.
1570
1571 PR c++/88983 - ICE with switch in constexpr function.
1572 * constexpr.c (cxx_eval_switch_expr): Use SWITCH_COND and SWITCH_BODY.
1573 (cxx_eval_constant_expression) <case COND_EXPR>: Don't look for the
1574 label in the else branch if we found it in the then branch.
1575
1576 2019-01-30 Jason Merrill <jason@redhat.com>
1577
1578 PR c++/88752 - ICE with lambda and constexpr if.
1579 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New.
1580 * pt.c (tsubst_lambda_expr): Set it.
1581 (instantiated_lambda_fn_p): Check it.
1582 (enclosing_instantiation_of): Use it.
1583
1584 2019-01-31 Jakub Jelinek <jakub@redhat.com>
1585
1586 PR libstdc++/88170
1587 * cxx-pretty-print.c (pp_cxx_enumeration_constant): Print always as
1588 a C cast in pp_c_flag_gnu_v3 mode.
1589
1590 2019-01-30 Jakub Jelinek <jakub@redhat.com>
1591
1592 PR c++/88988
1593 * lambda.c (is_capture_proxy): Don't return true for
1594 DECL_OMP_PRIVATIZED_MEMBER artificial vars.
1595
1596 2019-01-30 Marek Polacek <polacek@redhat.com>
1597
1598 PR c++/89119 - ICE with value-initialization in template.
1599 * pt.c (tsubst_copy_and_build): Handle RANGE_EXPR.
1600
1601 2019-01-29 Jason Merrill <jason@redhat.com>
1602
1603 PR c++/86943 - wrong code converting lambda to function pointer.
1604 * lambda.c (maybe_add_lambda_conv_op): Use a template-id in the
1605 call. Only forward parms for decltype.
1606 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Handle CALL_FROM_THUNK_P
1607 specially.
1608 * typeck.c (check_return_expr): Don't mess with a thunk call.
1609
1610 2019-01-28 Jason Merrill <jason@redhat.com>
1611
1612 PR c++/89089 - ICE with [[no_unique_address]].
1613 PR c++/88865 - wrong layout with [[no_unique_address]].
1614 * class.c (check_field_decls): A potentially-overlapping field makes
1615 the class non-layout-POD, but not non-empty.
1616 (end_of_class): Always consider empty data members.
1617 (layout_class_type): Set DECL_SIZE for empty fields.
1618
1619 2019-01-28 Marek Polacek <polacek@redhat.com>
1620
1621 PR c++/88358 - name wrongly treated as type.
1622 * parser.c (cp_parser_direct_declarator): Don't assume a qualified-id
1623 in parameter-list is a type if the function's declarator-id is not
1624 qualified.
1625
1626 2019-01-27 Marek Polacek <polacek@redhat.com>
1627
1628 PR c++/88815 - narrowing conversion lost in decltype.
1629 PR c++/78244 - narrowing conversion in template not detected.
1630 * cp-tree.h (CONSTRUCTOR_IS_DEPENDENT): New.
1631 * pt.c (instantiation_dependent_r): Consider a CONSTRUCTOR with
1632 CONSTRUCTOR_IS_DEPENDENT instantiation-dependent.
1633 * semantics.c (finish_compound_literal): When the compound literal
1634 isn't instantiation-dependent and the type isn't type-dependent,
1635 fall back to the normal processing. Set CONSTRUCTOR_IS_DEPENDENT.
1636
1637 PR c++/89024 - ICE with incomplete enum type.
1638 * call.c (standard_conversion): When converting an
1639 ARITHMETIC_TYPE_P to an incomplete type, return NULL.
1640
1641 2019-01-25 Paolo Carlini <paolo.carlini@oracle.com>
1642
1643 PR c++/88969
1644 * call.c (build_op_delete_call): Implement 7.6.2.5/(10.1).
1645 * decl2.c (coerce_delete_type): Use build_pointer_type instead
1646 of TYPE_POINTER_TO.
1647
1648 2019-01-24 Jason Merrill <jason@redhat.com>
1649
1650 PR c++/89001 - mangling of reference temporaries
1651 * cp-tree.h (struct saved_scope): Add ref_temp_count.
1652 (current_ref_temp_count): New macro.
1653 * mangle.c (mangle_ref_init_variable): Use it.
1654 * typeck2.c (store_init_value): Clear it.
1655 * call.c (make_temporary_var_for_ref_to_temp): Copy public and
1656 comdat.
1657
1658 2019-01-24 Jakub Jelinek <jakub@redhat.com>
1659
1660 PR c++/88976
1661 * semantics.c (finish_omp_cancel): Diagnose more than one if
1662 on #pragma omp cancel with different modifiers. Use
1663 maybe_convert_cond when not in template or build_x_binary_op
1664 otherwise.
1665
1666 2019-01-23 Marek Polacek <polacek@redhat.com>
1667
1668 PR c++/88757 - qualified name treated wrongly as type.
1669 * parser.c (cp_parser_direct_declarator): Don't treat qualified-ids
1670 in parameter-list as types if name lookup for declarator-id didn't
1671 find one or more function templates.
1672
1673 2019-01-23 Jakub Jelinek <jakub@redhat.com>
1674
1675 PR c/44715
1676 * cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only
1677 after genericizing cond and incr expressions.
1678
1679 PR c++/88984
1680 * cp-gimplify.c (genericize_switch_stmt): Move cond genericization
1681 before the begin_bc_block call.
1682
1683 2019-01-21 Jason Merrill <jason@redhat.com>
1684
1685 PR c++/87893 - constexpr ctor ICE on ARM.
1686 PR c++/88293 - ICE with comma expression.
1687 * constexpr.c (initialized_type): Don't shortcut non-void type.
1688 Handle COMPOUND_EXPR.
1689 (cxx_eval_outermost_constant_expr): Return early for void type.
1690
1691 2019-01-21 Jakub Jelinek <jakub@redhat.com>
1692
1693 PR c++/88949
1694 * optimize.c (cxx_copy_decl): New function.
1695 (clone_body): Use it instead of copy_decl_no_change.
1696
1697 PR sanitizer/88901
1698 * typeck.c (cp_build_binary_op): Don't instrument
1699 SANITIZE_POINTER_COMPARE if processing_template_decl.
1700 (pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT.
1701
1702 2019-01-18 Jason Merrill <jason@redhat.com>
1703
1704 PR c++/88875 - error with explicit list constructor.
1705 * call.c (reference_binding): Don't modify EXPR. Set
1706 need_temporary_p on the ck_user conversion for a temporary.
1707 (convert_like_real): Check it.
1708
1709 2019-01-18 H.J. Lu <hongjiu.lu@intel.com>
1710
1711 PR c/51628
1712 PR c/88664
1713 * call.c (convert_for_arg_passing): Upate the
1714 warn_for_address_or_pointer_of_packed_member call.
1715 * typeck.c (convert_for_assignment): Likewise.
1716
1717 2019-01-17 Jason Merrill <jason@redhat.com>
1718
1719 PR c++/86205 - ICE with ?: of throw and template-id.
1720 * pt.c (resolve_nondeduced_context_or_error): Split out from...
1721 * typeck.c (decay_conversion): ...here.
1722 * call.c (build_conditional_expr_1): Use it.
1723
1724 PR c++/86740, ICE with constexpr if and nested generic lambdas.
1725 * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR.
1726
1727 2019-01-17 Paolo Carlini <paolo.carlini@oracle.com>
1728
1729 * decl.c (grokdeclarator): Use typespec_loc in error messages
1730 about 'auto' and trailing return type.
1731
1732 2019-01-17 David Malcolm <dmalcolm@redhat.com>
1733
1734 PR c++/88699
1735 * class.c (add_method): Don't use DECL_DESTRUCTOR_P on
1736 USING_DECLs.
1737
1738 2019-01-17 Nathan Sidwell <nathan@acm.org>
1739
1740 PR c++/86610
1741 * semantics.c (process_outer_var_ref): Only skip dependent types
1742 in templates.
1743
1744 2019-01-17 Alexandre Oliva <aoliva@redhat.com>
1745
1746 PR c++/87768
1747 * cp-tree.h (saved_scope): Add suppress_location_wrappers.
1748 * name-lookup.c (do_push_to_top_level): Save and reset it.
1749 (do_pop_from_top_level): Restore it.
1750
1751 PR c++/86648
1752 * pt.c (make_template_placeholder): Use auto_identifier.
1753 (is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test.
1754 * error.c (dump_type): Handle template placeholders.
1755 * cxx-pretty-print.c (pp_cx_unqualified_id): Likewise.
1756
1757 PR c++/88146
1758 * cvt.c (convert_to_void): Handle all cdtor calls as if
1759 returning void.
1760
1761 2019-01-16 Paolo Carlini <paolo.carlini@oracle.com>
1762
1763 * decl.c (grokdeclarator): Use locations[ds_storage_class] in
1764 error messages about ill-formed uses of mutable.
1765
1766 2019-01-16 Marek Polacek <polacek@redhat.com>
1767
1768 PR c++/78244 - narrowing conversion in template not detected.
1769 * call.c (perform_implicit_conversion_flags): Set
1770 IMPLICIT_CONV_EXPR_BRACED_INIT.
1771 * cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New.
1772 * pt.c (tsubst_copy_and_build): Use it.
1773
1774 2019-01-15 David Malcolm <dmalcolm@redhat.com>
1775
1776 PR c++/88795
1777 * pt.c (build_deduction_guide): Bail out if tsubst_arg_types
1778 fails.
1779
1780 2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
1781
1782 * decl.c (start_decl): Improve error location.
1783 * decl2.c (grokfield): Likewise.
1784
1785 2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
1786
1787 * decl.c (grokdeclarator): Move further up the location_t loc
1788 declaration and use the location when building a TYPE_DECL for
1789 a typedef name.
1790 * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error
1791 about an ill-formed bit-field as typedef.
1792
1793 2019-01-14 Marek Polacek <polacek@redhat.com>
1794
1795 PR c++/88830 - ICE with abstract class.
1796 * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR.
1797 Fix formatting.
1798
1799 PR c++/88825 - ICE with bogus function return type deduction.
1800 * typeck.c (can_do_nrvo_p): Check error_mark_node.
1801
1802 2019-01-14 Tom Honermann <tom@honermann.net>
1803
1804 Implement P0482R5, char8_t: A type for UTF-8 characters and strings
1805 * cvt.c (type_promotes_to): Handle char8_t promotion.
1806 * decl.c (grokdeclarator): Handle invalid type specifier
1807 combinations involving char8_t.
1808 * lex.c (init_reswords): Add char8_t as a reserved word.
1809 * mangle.c (write_builtin_type): Add name mangling for char8_t (Du).
1810 * parser.c (cp_keyword_starts_decl_specifier_p)
1811 (cp_parser_simple_type_specifier): Recognize char8_t as a simple
1812 type specifier.
1813 (cp_parser_string_literal): Use char8_array_type_node for the type
1814 of CPP_UTF8STRING.
1815 (cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system
1816 headers.
1817 * rtti.c (emit_support_tinfos): type_info support for char8_t.
1818 * tree.c (char_type_p): Recognize char8_t as a character type.
1819 * typeck.c (string_conv_p): Handle conversions of u8 string
1820 literals of char8_t type.
1821 (check_literal_operator_args): Handle UDLs with u8 string literals
1822 of char8_t type.
1823 * typeck2.c (ordinary_char_type_p): New.
1824 (digest_init_r): Disallow initializing a char array with a u8 string
1825 literal.
1826
1827 2019-01-14 Martin Liska <mliska@suse.cz>
1828
1829 PR gcov-profile/88263
1830 * decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION
1831 as location of the TLS wrapper.
1832
1833 2019-01-12 Paolo Carlini <paolo.carlini@oracle.com>
1834
1835 * decl.c (cp_finish_decl): Improve error location.
1836 * decl2.c (grokfield): Likewise, improve two locations.
1837
1838 2019-01-11 Marek Polacek <polacek@redhat.com>
1839
1840 PR c++/88692, c++/87882 - -Wredundant-move false positive with *this.
1841 * typeck.c (maybe_warn_pessimizing_move): Return if ARG isn't
1842 ADDR_EXPR.
1843
1844 2019-01-11 Jason Merrill <jason@redhat.com>
1845
1846 PR c++/88312 - pack expansion of decltype.
1847 * pt.c (instantiation_dependent_r): A template non-type parameter
1848 pack is instantiation-dependent.
1849
1850 2019-01-11 Jason Merrill <jason@redhat.com>
1851
1852 PR c++/88613 - ICE with use of const var in lambda.
1853 * expr.c (mark_use): Fix location wrapper handling.
1854 * cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use.
1855
1856 2019-01-11 Tobias Burnus <burnus@net-b.de>
1857
1858 PR C++/88114
1859 * decl2.c (maybe_emit_vtables): If needed, generate code for
1860 the destructor of an abstract class.
1861 (mark_used): Update comment for older function-name change.
1862
1863 2019-01-11 Paolo Carlini <paolo.carlini@oracle.com>
1864
1865 * decl.c (start_decl): Improve error location.
1866 (grokdeclarator): Likewise, improve two locations.
1867
1868 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
1869
1870 PR other/16615
1871
1872 * cp-tree.h: Mechanically replace "can not" with "cannot".
1873 * parser.c: Likewise.
1874 * pt.c: Likewise.
1875
1876 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
1877
1878 * decl.c (grok_reference_init): Improve error location.
1879 (grokdeclarator): Likewise, improve two locations.
1880
1881 2019-01-08 Marek Polacek <polacek@redhat.com>
1882
1883 PR c++/88538 - braced-init-list in template-argument-list.
1884 * parser.c (cp_parser_template_argument): Handle braced-init-list when
1885 in C++20.
1886
1887 PR c++/88548 - this accepted in static member functions.
1888 * parser.c (cp_debug_parser): Adjust printing of
1889 local_variables_forbidden_p.
1890 (cp_parser_new): Set local_variables_forbidden_p to 0 rather than false.
1891 (cp_parser_primary_expression): When checking
1892 local_variables_forbidden_p, use THIS_FORBIDDEN or
1893 LOCAL_VARS_FORBIDDEN.
1894 (cp_parser_lambda_body): Update the type of
1895 local_variables_forbidden_p. Set it to 0 rather than false.
1896 (cp_parser_condition): Adjust call to cp_parser_declarator.
1897 (cp_parser_explicit_instantiation): Likewise.
1898 (cp_parser_init_declarator): Likewise.
1899 (cp_parser_declarator): New parameter. Use it.
1900 (cp_parser_direct_declarator): New parameter. Use it to set
1901 local_variables_forbidden_p. Adjust call to cp_parser_declarator.
1902 (cp_parser_type_id_1): Adjust call to cp_parser_declarator.
1903 (cp_parser_parameter_declaration): Likewise.
1904 (cp_parser_default_argument): Update the type of
1905 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
1906 rather than true.
1907 (cp_parser_member_declaration): Tell cp_parser_declarator if we saw
1908 'static' or 'friend'.
1909 (cp_parser_exception_declaration): Adjust call to cp_parser_declarator.
1910 (cp_parser_late_parsing_default_args): Update the type of
1911 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
1912 rather than true.
1913 (cp_parser_cache_defarg): Adjust call to cp_parser_declarator.
1914 (cp_parser_objc_class_ivars): Likewise.
1915 (cp_parser_objc_struct_declaration): Likewise.
1916 (cp_parser_omp_for_loop_init): Likewise.
1917 * parser.h (cp_parser): Change the type of local_variables_forbidden_p
1918 to unsigned char.
1919 (LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN):
1920 Define.
1921
1922 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
1923
1924 * decl.c (start_decl): Improve permerror location.
1925
1926 2019-01-08 Jonathan Wakely <jwakely@redhat.com>
1927 Jakub Jelinek <jakub@redhat.com>
1928
1929 PR c++/88554
1930 * decl.c (finish_function): For -Wreturn-type don't add a return *this;
1931 fixit hint if current_class_ref is NULL. Use a single if instead of
1932 two nested ones.
1933
1934 2019-01-07 Paolo Carlini <paolo.carlini@oracle.com>
1935
1936 * decl.c (start_decl): Improve two error_at locations.
1937 (expand_static_init): Likewise.
1938
1939 2019-01-07 Marek Polacek <polacek@redhat.com>
1940
1941 PR c++/88741 - wrong error with initializer-string.
1942 * decl.c (cp_complete_array_type): Strip any location wrappers.
1943
1944 2019-01-07 Bernd Edlinger <bernd.edlinger@hotmail.de>
1945
1946 PR c++/88261
1947 PR c++/69338
1948 PR c++/69696
1949 PR c++/69697
1950 * cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value.
1951 * typeck2.c (digest_init_r): Raise an error for non-static
1952 initialization of a flexible array member.
1953 (process_init_constructor, massage_init_elt,
1954 process_init_constructor_array, process_init_constructor_record,
1955 process_init_constructor_union, process_init_constructor): Add the
1956 flags parameter and pass it thru.
1957 (store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to
1958 digest_init_flags for static decls.
1959
1960 2019-01-07 Jakub Jelinek <jakub@redhat.com>
1961
1962 PR c++/85052
1963 * cp-tree.h (cp_build_vec_convert): Declare.
1964 * parser.c (cp_parser_postfix_expression): Parse
1965 __builtin_convertvector.
1966 * constexpr.c: Include fold-const-call.h.
1967 (cxx_eval_internal_function): Handle IFN_VEC_CONVERT.
1968 (potential_constant_expression_1): Likewise.
1969 * semantics.c (cp_build_vec_convert): New function.
1970 * pt.c (tsubst_copy_and_build): Handle CALL_EXPR to
1971 IFN_VEC_CONVERT.
1972
1973 2019-01-03 Jakub Jelinek <jakub@redhat.com>
1974
1975 PR c++/88636
1976 * decl.c (builtin_function_1): Return result of pushdecl_top_level
1977 or pushdecl rather than decl.
1978
1979 2019-01-03 Paolo Carlini <paolo.carlini@oracle.com>
1980
1981 * tree.c (handle_nodiscard_attribute): Improve warning location.
1982
1983 2019-01-02 Marek Polacek <polacek@redhat.com>
1984
1985 PR c++/88612 - ICE with -Waddress-of-packed-member.
1986 * call.c (convert_for_arg_passing): Only give warnings with tf_warning.
1987 * typeck.c (convert_for_assignment): Likewise.
1988
1989 PR c++/88631 - CTAD failing for value-initialization.
1990 * typeck2.c (build_functional_cast): Try deducing the template
1991 arguments even if there are no arguments to deduce from.
1992
1993 2019-01-01 Jakub Jelinek <jakub@redhat.com>
1994
1995 Update copyright years.
1996 \f
1997 Copyright (C) 2019 Free Software Foundation, Inc.
1998
1999 Copying and distribution of this file, with or without modification,
2000 are permitted in any medium without royalty provided the copyright
2001 notice and this notice are preserved.