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