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