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