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