Daily bump.
[gcc.git] / gcc / cp / ChangeLog
1 2020-09-10 Nathan Sidwell <nathan@acm.org>
2
3 * cp-tree.h (TINFO_VAR_DECLARED_CONSTINIT): Replace with ...
4 (DECL_DECLARED_CONSTINIT_P): ... this.
5 * decl.c (start_decl): No need to retrofit_lang_decl for constinit
6 flag.
7 (cp_finish_decl): Use DECL_DECLARED_CONSTINIT_P.
8 * pt.c (tsubst_decl): No need to handle constinit flag
9 propagation.
10 (tsubst_expr): Or here.
11
12 2020-09-10 Nathan Sidwell <nathan@acm.org>
13
14 * cp-tree.h (DECL_LOCAL_FUNCTION_P): Rename to ...
15 (DECL_LOCAL_DECL_P): ... here. Accept both fns and vars.
16 * decl.c (start_decl): Set DECL_LOCAL_DECL_P for local externs.
17 (omp_declare_variant_finalize_one): Use DECL_LOCAL_DECL_P.
18 (local_variable_p): Simplify.
19 * name-lookup.c (set_decl_context_in_fn): Assert DECL_LOCAL_DECL_P
20 is as expected. Simplify.
21 (do_pushdecl): Don't set decl_context_in_fn for friends.
22 (is_local_extern): Simplify.
23 * call.c (equal_functions): Use DECL_LOCAL_DECL_P.
24 * parser.c (cp_parser_postfix_expression): Likewise.
25 (cp_parser_omp_declare_reduction): Likewise.
26 * pt.c (check_default_tmpl_args): Likewise.
27 (tsubst_expr): Assert nested reduction function is local.
28 (type_dependent_expression_p): Use DECL_LOCAL_DECL_P.
29 * semantics.c (finish_call_expr): Likewise.
30
31 2020-09-09 Marek Polacek <polacek@redhat.com>
32
33 PR c++/77841
34 * decl.c (reshape_init): If we're initializing a char array from
35 a string-literal that is enclosed in braces, unwrap it.
36 * init.c (build_new_1): Don't handle string-initializers here.
37 (build_new): Handle new-expression with paren-init when the
38 array bound is known. Always pass string constants to build_new_1
39 enclosed in braces. Don't handle string-initializers in any
40 special way.
41
42 2020-09-09 Marek Polacek <polacek@redhat.com>
43
44 PR c++/95164
45 * decl.c (reshape_init_r): When initializing an aggregate member
46 with an initializer from an initializer-list, also consider
47 COMPOUND_LITERAL_P.
48
49 2020-09-09 Nathan Sidwell <nathan@acm.org>
50
51 * parser.c (cp_parser_omp_declare_reduction): Refactor to avoid
52 code duplication. Update DECL_TI_TEMPLATE's context.
53 * pt.c (tsubst_expr): For OMP reduction function, set context to
54 global_namespace before pushing.
55 (tsubst_omp_udr): Assert current_function_decl, add comment about
56 decl context.
57
58 2020-09-09 Patrick Palka <ppalka@redhat.com>
59
60 PR c++/96647
61 * class.c (resolve_address_of_overloaded_function): Check
62 constraints_satisfied_p and perform return-type deduction via
63 maybe_instantiate_decl when considering non-template functions
64 in the overload set.
65 * cp-tree.h (maybe_instantiate_decl): Declare.
66 * decl2.c (maybe_instantiate_decl): Remove static.
67
68 2020-09-04 Jason Merrill <jason@redhat.com>
69
70 * expr.c (mark_use): Use iloc_sentinel.
71
72 2020-09-03 Jakub Jelinek <jakub@redhat.com>
73
74 PR c++/96901
75 * constexpr.c (fundef_copies_table): Change type from
76 hash_map<tree, tree> * to decl_tree_map *.
77
78 2020-09-03 Marek Polacek <polacek@redhat.com>
79
80 PR c++/92812
81 * cp-tree.h (do_aggregate_paren_init): Declare.
82 * decl.c (do_aggregate_paren_init): New.
83 (grok_reference_init): Use it.
84 (check_initializer): Likewise.
85 * init.c (perform_member_init): Handle initializing an array from
86 a ()-list. Use do_aggregate_paren_init.
87
88 2020-09-03 Jakub Jelinek <jakub@redhat.com>
89
90 PR c++/96862
91 * constexpr.c (cxx_eval_outermost_constant_expr): Temporarily disable
92 flag_rounding_math during manifestly constant evaluation.
93
94 2020-09-01 Marek Polacek <polacek@redhat.com>
95
96 PR c++/77841
97 * init.c (build_new_1): Call reshape_init.
98
99 2020-09-01 Jakub Jelinek <jakub@redhat.com>
100
101 PR c++/96867
102 * semantics.c (handle_omp_array_sections_1): Test
103 DECL_ARRAY_PARAMETER_P only on PARM_DECLs.
104
105 2020-08-31 Marek Polacek <polacek@redhat.com>
106 Jason Merrill <jason@redhat.com>
107
108 PR c++/93529
109 * call.c (build_new_method_call_1): Use build_constructor_from_vec
110 instead of build_tree_list_vec + build_constructor_from_list.
111 * init.c (build_new_1): Handle new char[]{"foo"}. Use
112 build_constructor_from_vec instead of build_tree_list_vec +
113 build_constructor_from_list.
114 (build_new): Deduce the array size in new-expression if not
115 present. Handle ()-init. Handle initializing an array from
116 a string literal.
117 * parser.c (cp_parser_new_type_id): Leave [] alone.
118 (cp_parser_direct_new_declarator): Allow [].
119 * pt.c (type_dependent_expression_p): In a NEW_EXPR, consider
120 array types whose dimension has to be deduced type-dependent.
121
122 2020-08-27 Martin Liska <mliska@suse.cz>
123
124 * class.c (build_vtbl_initializer): Set exact argument of a vector
125 growth function to true.
126 * constraint.cc (get_mapped_args): Likewise.
127 * decl.c (cp_maybe_mangle_decomp): Likewise.
128 (cp_finish_decomp): Likewise.
129 * parser.c (cp_parser_omp_for_loop): Likewise.
130 * pt.c (canonical_type_parameter): Likewise.
131 * rtti.c (get_pseudo_ti_init): Likewise.
132
133 2020-08-26 Nathan Sidwell <nathan@acm.org>
134
135 * decl.c (poplevel): A local-binding tree list holds the name in
136 TREE_PURPOSE.
137 * name-lookup.c (update_local_overload): Add id to TREE_PURPOSE.
138 (lookup_name_1): Deal with local-binding error_mark_node marker.
139 (op_unqualified_lookup): Return error_mark_node for 'nothing
140 found'. Retain global binding, check class binding here.
141 (maybe_save_operator_binding): Reimplement to always cache a
142 result.
143 (push_operator_bindings): Deal with 'ignore' marker.
144
145 2020-08-25 Tobias Burnus <tobias@codesourcery.com>
146
147 PR c/96678
148 * semantics.c (handle_omp_array_sections_1): Talk about
149 array function parameter in the error message.
150
151 2020-08-25 Jakub Jelinek <jakub@redhat.com>
152
153 PR c++/96721
154 * cp-tree.h (build_trivial_dtor_call): Add bool argument defaulted
155 to false.
156 * call.c (build_trivial_dtor_call): Add NO_PTR_DEREF argument. If
157 instance is a pointer and NO_PTR_DEREF is true, clobber the pointer
158 rather than what it points to.
159 * semantics.c (finish_call_expr): Call build_trivial_dtor_call with
160 true as NO_PTR_DEREF.
161
162 2020-08-25 Jason Merrill <jason@redhat.com>
163
164 PR c++/95428
165 * optimize.c (populate_clone_array): Revert PR70462 change.
166 (maybe_clone_body): Likewise.
167
168 2020-08-24 Nathan Sidwell <nathan@acm.org>
169
170 * ptree.c (debug_overload): New.
171
172 2020-08-19 Jason Merrill <jason@redhat.com>
173
174 DR 2369
175 * cp-tree.h (push_tinst_level, push_tinst_level_loc): Declare.
176 * constraint.cc (satisfy_declaration_constraints):
177 Use add_outermost_template_args and push_tinst_level.
178 * pt.c (add_outermost_template_args): Handle getting
179 a TEMPLATE_DECL as the first argument.
180 (push_tinst_level, push_tinst_level_loc): No longer static.
181 (fn_type_unification): Check satisfaction before non-dependent
182 conversions.
183
184 2020-08-18 Nathan Sidwell <nathan@acm.org>
185
186 * cp-tree.h (SET_TYPE_TEMPLTE_INFO): Do not deal with ALIAS templates.
187 * pt.c (lookup_template_class_1): Special-case alias template
188 template_info setting.
189
190 2020-08-18 Jason Merrill <jason@redhat.com>
191
192 PR c++/96199
193 * pt.c (tsubst_aggr_type): Rewrite in C++17, too.
194 (maybe_dependent_member_ref): Likewise.
195 (build_deduction_guide): Re-substitute template parms.
196 * cp-tree.h (struct push_nested_class_guard): New.
197 * constraint.cc (get_normalized_constraints_from_decl): Use it.
198
199 2020-08-18 Jason Merrill <jason@redhat.com>
200
201 PR c++/96199
202 * pt.c (maybe_dependent_member_ref): New.
203 (tsubst_copy) [CONST_DECL]: Use it.
204 [VAR_DECL]: Likewise.
205 (tsubst_aggr_type): Handle nested type.
206
207 2020-08-18 Nathan Sidwell <nathan@acm.org>
208
209 * name-lookup.c (qualify_lookup): Drop lambda checking here.
210 Reorder namespace & type checking.
211 (lookup_name_1): Do hidden lambda checking here.
212
213 2020-08-14 Nathan Sidwell <nathan@acm.org>
214
215 * name-lookup.h (lookup_name_real, lookup_name_nonclass): Rename
216 to ...
217 (lookup_name): ... these new overloads.
218 * name-lookup.c (identifier_type_value_1): Rename lookup_name_real
219 call.
220 (lookup_name_real_1): Rename to ...
221 (lookup_name_1): ... here.
222 (lookup_name_real): Rename to ...
223 (lookup_name): ... here. Rename lookup_name_real_1 call.
224 (lookup_name_nonclass): Delete.
225 * call.c (build_operator_new_call): Rename lookup_name_real call.
226 (add_operator_candidates): Likewise.
227 (build_op_delete_call): Rename lookup_name_nonclass call.
228 * parser.c (cp_parser_lookup_name): Likewise.
229 * pt.c (tsubst_friend_class, lookup_init_capture_pack): Likewise.
230 (tsubst_expr): Likewise.
231 * semantics.c (capture_decltype): Likewise.
232
233 2020-08-14 Nathan Sidwell <nathan@acm.org>
234
235 * cp-tree.h (LOOKUP_HIDDEN): Delete.
236 (LOOKUP_PREFER_RVALUE): Adjust initializer.
237 * name-lookup.h (enum class LOOK_want): Add HIDDEN_FRIEND and
238 HIDDEN_LAMBDA flags.
239 (lookup_name_real): Drop flags parm.
240 (lookup_qualified_name): Drop find_hidden parm.
241 * name-lookup.c (class name_lookup): Drop hidden field, adjust
242 ctors.
243 (name_lookup::add_overload): Check want for hiddenness.
244 (name_lookup::process_binding): Likewise.
245 (name_lookup::search_unqualified): Likewise.
246 (identifier_type_value_1): Adjust lookup_name_real call.
247 (set_decl_namespace): Adjust name_lookup ctor.
248 (qualify_lookup): Drop flags parm, use want for hiddenness.
249 (lookup_qualified_name): Drop find_hidden parm.
250 (lookup_name_real_1): Drop flags parm, adjust qualify_lookup
251 calls.
252 (lookup_name_real): Drop flags parm.
253 (lookup_name_nonclass, lookup_name): Adjust lookup_name_real
254 calls.
255 (lookup_type_scope_1): Adjust qualify_lookup calls.
256 * call.c (build_operator_new_call): Adjust lookup_name_real call.
257 (add_operator_candidates): Likewise.
258 * coroutines.cc (morph_fn_to_coro): Adjust lookup_qualified_name
259 call.
260 * parser.c (cp_parser_lookup_name): Adjust lookup_name_real calls.
261 * pt.c (check_explicit_specialization): Adjust
262 lookup_qualified_name call.
263 (deduction_guides_for): Likewise.
264 (tsubst_friend_class): Adjust lookup_name_real call.
265 (lookup_init_capture_pack): Likewise.
266 (tsubst_expr): Likewise, don't look in namespaces.
267 * semantics.c (capture_decltype): Adjust lookup_name_real. Don't
268 look in namespaces.
269
270 2020-08-14 Jason Merrill <jason@redhat.com>
271
272 PR c++/90254
273 PR c++/93711
274 * cp-tree.h (unsafe_return_slot_p): Declare.
275 * call.c (is_base_field_ref): Rename to unsafe_return_slot_p.
276 (build_over_call): Check unsafe_return_slot_p.
277 (build_special_member_call): Likewise.
278 * init.c (expand_default_init): Likewise.
279 * typeck2.c (split_nonconstant_init_1): Likewise.
280
281 2020-08-14 Nathan Sidwell <nathan@acm.org>
282
283 * cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES)
284 (LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY)
285 (LOOKUP_QUALIFIERS_ONL): Delete.
286 (LOOKUP_HIDDEN): Adjust.
287 * name-lookup.h (enum class LOOK_want): New.
288 (operator|, operator&): Overloads for it.
289 (lookup_name_real): Replace prefer_type & namespaces_only with
290 LOOK_want parm.
291 (lookup_qualified_name): Replace prefer_type with LOOK_want.
292 (lookup_name_prefer_type): Replace with ...
293 (lookup_name): ... this. New overload with LOOK_want parm.
294 * name-lookup.c (struct name_lookup): Replace flags with want and
295 hidden fields. Adjust constructors.
296 (name_lookyp::add_overload): Correct hidden stripping test. Update
297 for new LOOK_want type.
298 (name_lookup::process_binding): Likewise.
299 (name_lookup::search_unqualified): Use hidden flag.
300 (identifier_type_value_1): Adjust lookup_name_real call.
301 (set_decl_namespace): Adjust name_lookup ctor.
302 (lookup_flags): Delete.
303 (qualify_lookup): Add LOOK_want parm, adjust.
304 (lookup_qualified_name): Replace prefer_type parm with LOOK_want.
305 (lookup_name_real_1): Replace prefer_type and namespaces_only with
306 LOOK_want parm.
307 (lookup_name_real): Likewise.
308 (lookup_name_nonclass, lookup_name): Adjust lookup_name_real call.
309 (lookup_name_prefer_type): Rename to ...
310 (lookup_name): ... here. New overload with LOOK_want parm.
311 (lookup_type_scope_1): Adjust qualify_lookup calls.
312 * call.c (build_operator_new_call)
313 (add_operator_candidates): Adjust lookup_name_real calls.
314 * coroutines.cc (find_coro_traits_template_decl)
315 (find_coro_handle_template_decl, morph_fn_to_coro): Adjust
316 lookup_qualified_name calls.
317 * cp-objcp-common.c (identifier_global_tag): Likewise.
318 * decl.c (get_tuple_size, get_tuple_decomp_init): Likewise.
319 (lookup_and_check_tag): Use lookup_name overload.
320 * parser.c (cp_parser_userdef_numeric_literal): Adjust
321 lookup_qualified_name call.
322 (prefer_arg_type): Drop template_mem_access parm, return LOOK_want
323 value.
324 (cp_parser_lookup_name): Adjust lookup_member, lookup_name_real
325 calls.
326 * pt.c (check_explicit_specialization): Adjust lookup_qualified_name
327 call.
328 (tsubst_copy_and_build, tsubst_qualified_name): Likewise
329 (deduction_guides_for): Likewise.
330 (tsubst_friend_class): Adjust lookup_name_real call.
331 (lookup_init_capture, tsubst_expr): Likewise.
332 * rtti.c (emit_support_tinfos): Adjust lookup_qualified_name call.
333 * semantics.c (omp_reduction_lookup): Likewise.
334 (capture_decltype): Adjust lookup_name_real call.
335
336 2020-08-13 Nathan Sidwell <nathan@acm.org>
337
338 * name-lookup.h (enum class LOOK_where): New.
339 (operator|, operator&): Overloads for it.
340 (lookup_name_real): Replace NONCLASS & BLOCK_P parms with WHERE.
341 * name-lookup.c (identifier_type_value_w): Adjust
342 lookup_name_real call.
343 (lookup_name_real_1): Replace NONCLASS and BLOCK_P parameters
344 with WHERE bitmask. Don't search namespaces if not asked to.
345 (lookup_name_real): Adjust lookup_name_real_1 call.
346 (lookup_name_nonclass, lookup_name)
347 (lookup_name_prefer_type): Likewise.
348 * call.c (build_operator_new_call)
349 (add_operator_candidates): Adjust lookup_name_real calls.
350 * parser.c (cp_parser_lookup_name): Likewise.
351 * pt.c (tsubst_friend_class, lookup_init_capture_pack)
352 (tsubst_expr): Likewise.
353 * semantics.c (capture_decltype): Likewise.
354
355 2020-08-13 Marek Polacek <polacek@redhat.com>
356
357 PR c++/92812
358 * typeck.c (build_static_cast_1): Implement P1975R0 by allowing
359 static_cast to aggregate type.
360
361 2020-08-10 Jakub Jelinek <jakub@redhat.com>
362
363 PR c++/96497
364 * constexpr.c (cxx_eval_binary_expression): For SPACESHIP_EXPR, tail
365 call cxx_eval_constant_expression after genericize_spaceship to avoid
366 undesirable further VERIFY_CONSTANT.
367
368 2020-08-10 Patrick Palka <ppalka@redhat.com>
369
370 * pt.c (resolve_overloaded_unification): Drop functions with
371 unsatisfied constraints.
372 (resolve_nondeduced_context): Likewise.
373
374 2020-08-05 Patrick Palka <ppalka@redhat.com>
375 Jason Merrill <jason@redhat.com>
376
377 PR c++/96282
378 * constexpr.c (cxx_eval_vec_init_1): Truncate ctx->ctor and
379 then clear CONSTRUCTOR_NO_CLEARING on each appended element
380 initializer if we're initializing a previously zero-initialized
381 array object.
382
383 2020-08-04 Marek Polacek <polacek@redhat.com>
384
385 PR c++/96082
386 * parser.c (cp_parser_elaborated_type_specifier): Allow
387 'template' following ::.
388
389 2020-08-04 Nathan Sidwell <nathan@acm.org>
390
391 * parser.c (cp_parser_explicit_specialization): Refactor
392 to avoid leak of num_template_parameter_lists value.
393
394 2020-08-04 Patrick Palka <ppalka@redhat.com>
395
396 PR c++/94024
397 * init.c (sort_mem_initializers): Preserve TREE_TYPE of the
398 member initializer list node.
399 (emit_mem_initializers): Set input_location when performing each
400 member initialization.
401 * parser.c (cp_parser_mem_initializer): Attach the source
402 location of this initializer to a dummy EMPTY_CLASS_EXPR
403 within the TREE_TYPE of the list node.
404 * pt.c (tsubst_initializer_list): Preserve TREE_TYPE of the
405 member initializer list node.
406
407 2020-08-03 Marek Polacek <polacek@redhat.com>
408
409 * cp-tree.h (after_nsdmi_defaulted_late_checks): Remove.
410
411 2020-08-03 Marek Polacek <polacek@redhat.com>
412
413 DR 2032
414 PR c++/96218
415 * pt.c (check_default_tmpl_args): Also consider variable
416 templates.
417
418 2020-07-31 Jakub Jelinek <jakub@redhat.com>
419
420 PR c++/96182
421 * decl.c (finish_function): In constexpr functions use for C++14 and
422 later error instead of warning if no return statement is present and
423 diagnose it regardless of warn_return_type. Move the warn_return_type
424 diagnostics earlier in the function.
425
426 2020-07-31 Martin Sebor <msebor@redhat.com>
427
428 PR c++/96003
429 * class.c (build_base_path): Set no-warning bit on the synthesized
430 conditional expression in static_cast.
431
432 2020-07-31 Richard Biener <rguenther@suse.de>
433
434 PR debug/96383
435 * cp-objcp-common.h (LANG_HOOKS_FINALIZE_EARLY_DEBUG):
436 Define to c_common_finalize_early_debug.
437
438 2020-07-31 Patrick Palka <ppalka@redhat.com>
439
440 PR c++/96197
441 * constexpr.c (cxx_eval_constant_expression) <case CONST_DECL>:
442 Pass false to decl_constant_value and decl_really_constant_value
443 so that they don't unshare their result.
444 * cp-tree.h (decl_constant_value): New declaration with an added
445 bool parameter.
446 (decl_really_constant_value): Add bool parameter defaulting to
447 true to existing declaration.
448 * init.c (constant_value_1): Add bool parameter which controls
449 whether to unshare the initializer before returning. Call
450 unshare_expr at most once.
451 (scalar_constant_value): Pass true to constant_value_1's new
452 bool parameter.
453 (decl_really_constant_value): Add bool parameter and forward it
454 to constant_value_1.
455 (decl_constant_value): Likewise, but instead define a new
456 overload with an added bool parameter.
457
458 2020-07-30 Patrick Palka <ppalka@redhat.com>
459
460 PR c++/64194
461 * pt.c (resolve_overloaded_unification): If the function
462 template specialization has a placeholder return type,
463 then instantiate it before attempting unification.
464
465 2020-07-30 Patrick Palka <ppalka@redhat.com>
466
467 PR c++/95486
468 * pt.c (alias_ctad_tweaks): Call remove_constraints before
469 calling set_constraints.
470
471 2020-07-30 Patrick Palka <ppalka@redhat.com>
472
473 PR c++/96106
474 * pt.c (reduce_template_parm_level): Propagate DECL_VIRTUAL_P
475 from the original TEMPLATE_PARM_DECL to the new lowered one.
476
477 2020-07-30 Patrick Palka <ppalka@redhat.com>
478
479 PR c++/96164
480 * constraint.cc (constraints_satisfied_p): Return true if
481 !flags_concepts.
482 * pt.c (do_type_instantiation): Update a paragraph taken from
483 [temp.explicit] to reflect the latest specification. Don't
484 instantiate a member with unsatisfied constraints.
485
486 2020-07-29 Jason Merrill <jason@redhat.com>
487
488 PR c++/91427
489 * cp-tree.h (IMPLICIT_RVALUE_P): New.
490 (enum cp_lvalue_kind_flags): Add clk_implicit_rval.
491 (implicit_rvalue_p, set_implicit_rvalue_p): New.
492 * call.c (reference_binding): Check clk_implicit_rval.
493 (build_over_call): Adjust C++20 implicit move.
494 * coroutines.cc (finish_co_return_stmt): Simplify implicit move.
495 * except.c (build_throw): Adjust C++20 implicit move.
496 * pt.c (tsubst_copy_and_build) [STATIC_CAST_EXPR]: Propagate
497 IMPLICIT_RVALUE_P.
498 * tree.c (lvalue_kind): Set clk_implicit_rval.
499 * typeck.c (treat_lvalue_as_rvalue_p): Overhaul.
500 (maybe_warn_pessimizing_move): Adjust.
501 (check_return_expr): Adjust C++20 implicit move.
502
503 2020-07-29 Jason Merrill <jason@redhat.com>
504
505 PR c++/91212
506 * call.c (build_over_call): Don't call a const ref
507 overload for implicit move.
508
509 2020-07-28 Nathan Sidwell <nathan@acm.org>
510
511 * cp-gimplify.c (cp_genericize_r): Set IMPORTED_DECL's context.
512 * cp-objcp-common.c (cp_pushdecl): Set decl's context.
513 * decl.c (grokfndecl): Make DECL_CONTEXT setting clearer.
514
515 2020-07-28 Nathan Sidwell <nathan@acm.org>
516
517 * class.c (fixup_type_variants): Copy TYPE_SIZE and
518 TYPE_SIZE_UINIT.
519 (finish_struct): Call it.
520
521 2020-07-28 Nathan Sidwell <nathan@acm.org>
522
523 * ptree.c (cxx_print_decl): Better indentation.
524
525 2020-07-28 Jakub Jelinek <jakub@redhat.com>
526 Mark Wielaard <mark@klomp.org>
527
528 PR c++/96328
529 * parser.c (cp_lexer_safe_previous_token): Don't call
530 cp_lexer_previous_token, instead inline it by hand and return NULL
531 instead of failing assertion if all previous tokens until the first
532 one are purged.
533 (cp_parser_error_1): Optimize - only call cp_lexer_safe_previous_token
534 if token->type is CPP_NAME. Use cp_lexer_safe_previous_token instead
535 of cp_lexer_previous_token for the missing_token_desc != RT_NONE
536 case too.
537
538 2020-07-27 Nathan Sidwell <nathan@acm.org>
539
540 * cp-tree.h (enum cp_tree_index): Add CPTI_AS_BASE_IDENTIFIER.
541 (as_base_identifier): Define.
542 * decl.c (initialize_predifined_identifiers): Initialize as_base
543 identifier.
544 * class.c (layout_class_type): Name the as-base type. Zap
545 NSDMI its fields may have.
546
547 2020-07-22 Nathan Sidwell <nathan@acm.org>
548
549 * class.c (maybe_add_class_template_decl_list): Don't add CONST_DECLs.
550
551 2020-07-22 Nathan Sidwell <nathan@acm.org>
552
553 * typeck.c (structural_comptypes): [DECLTYPE_TYPE] break
554 apart complex if.
555 [UNDERLYING_TYPE]: Use an if.
556 [TYPEOF_TYPE]: New.
557
558 2020-07-22 Nathan Sidwell <nathan@acm.org>
559
560 * decl.c (decls_match): Move variables into scopes
561 they're needed in.
562 (duplicate_decls): Use STRIP_TEMPLATE.
563 (build_typename_type): Move var decls to their assignments.
564 (begin_function_body): Likewise.
565 * decl2.c (get_guard): Likewise.
566 (mark_used): Use true for truthiness.
567 * error.c (dump_aggr_type): Hold the decl in a var called
568 'decl', not 'name'.
569
570 2020-07-22 Nathan Sidwell <nathan@acm.org>
571
572 * cp-tree.h (struct tree_lambda_expr): Shrink
573 default_capture_mode & discriminator.
574
575 2020-07-22 Nathan Sidwell <nathan@acm.org>
576
577 * mangle.c (decl_is_template_id): Rename to ...
578 (maybe_template_info): ... here. Return the template info,
579 rather than use a pointer. Adjust all callers.
580 (find_substitution): Use template_args_equal, rather than
581 local check.
582
583 2020-07-22 Tobias Burnus <tobias@codesourcery.com>
584
585 * parser.c (cp_parser_omp_clause_hint): Require nonnegative hint.
586 (cp_parser_omp_critical): Permit hint(0) clause without named critical.
587 * pt.c (tsubst_expr): Re-check the latter for templates.
588
589 2020-07-21 Sunil K Pandey <skpgkp2@gmail.com>
590
591 PR target/95237
592 * decl.c (cp_finish_decl): Call target hook
593 lower_local_decl_alignment to lower local decl alignment.
594
595 2020-07-21 Nathan Sidwell <nathan@acm.org>
596
597 * parser.c (cp_lexer_consume_token): Drop PRAGMA_EOL assert.
598 (cp_parser_skip_to_closing_parenthesis_1): Only pass start token
599 to pragma skipper if recovering.
600 (cp_parser_skip_to_pragma_eol): Only purge and change pragma
601 state when recovering.
602
603 2020-07-20 Jason Merrill <jason@redhat.com>
604
605 * pt.c (type_dependent_expression_p): A pseudo-dtor can be
606 dependent.
607 * semantics.c (finish_call_expr): Use build_trivial_dtor_call for
608 pseudo-destructor.
609 (finish_pseudo_destructor_expr): Leave type NULL for dependent arg.
610
611 2020-07-20 Jason Merrill <jason@redhat.com>
612
613 * mangle.c (write_base_ref): New.
614 (write_expression): Use it for base field COMPONENT_REFs.
615 * pt.c (invalid_tparm_referent_p): Canonicalize the type
616 of array offsets. Allow subobjects.
617
618 2020-07-20 Jason Merrill <jason@redhat.com>
619
620 * pt.c (collect_ctor_idx_types): Add 'const' when deducing from
621 a string constant.
622
623 2020-07-17 Marek Polacek <polacek@redhat.com>
624
625 PR c++/79815
626 * decl.c (grokdeclarator): Detect cv-qual decltype(auto).
627 * pt.c (do_auto_deduction): Likewise.
628
629 2020-07-16 Iain Sandoe <iain@sandoe.co.uk>
630
631 PR c++/95591
632 PR c++/95599
633 PR c++/95823
634 PR c++/95824
635 PR c++/95895
636 * coroutines.cc (struct coro_ret_data): Delete.
637 (coro_maybe_expand_co_return): Delete.
638 (co_return_expander): Delete.
639 (expand_co_returns): Delete.
640 (co_await_find_in_subtree): Remove unused name.
641 (build_actor_fn): Remove unused parm, remove handling
642 for co_return expansion.
643 (register_await_info): Demote duplicate info message to a
644 warning.
645 (coro_make_frame_entry): Move closer to use site.
646 (struct susp_frame_data): Add fields for final suspend label
647 and a flag to indicate await expressions with initializers.
648 (captures_temporary): Delete.
649 (register_awaits): Remove unused code, update comments.
650 (find_any_await): New.
651 (tmp_target_expr_p): New.
652 (struct interesting): New.
653 (find_interesting_subtree): New.
654 (struct var_nest_node): New.
655 (flatten_await_stmt): New.
656 (handle_nested_conditionals): New.
657 (process_conditional): New.
658 (replace_statement_captures): Rename to...
659 (maybe_promote_temps): ... this.
660 (maybe_promote_captured_temps): Delete.
661 (analyze_expression_awaits): Check for await expressions with
662 initializers. Simplify handling for truth-and/or-if.
663 (expand_one_truth_if): Simplify (map cases that need expansion
664 to COND_EXPR).
665 (await_statement_walker): Handle CO_RETURN_EXPR. Simplify the
666 handling for truth-and/or-if expressions.
667 (register_local_var_uses): Ensure that we create names in the
668 implementation namespace.
669 (morph_fn_to_coro): Add final suspend label to suspend frame
670 callback data and remove it from the build_actor_fn call.
671
672 2020-07-16 Marek Polacek <polacek@redhat.com>
673
674 * call.c (convert_like): Remove macro and introduce a new
675 wrapper instead.
676 (convert_like_with_context): Likewise.
677 (convert_like_real): Rename to convert_like.
678 (convert_like_real_1): Rename to convert_like_internal. Call
679 convert_like instead of convert_like_real therein.
680 (perform_direct_initialization_if_possible): Call convert_like
681 instead of convert_like_real.
682
683 2020-07-16 Iain Sandoe <iain@sandoe.co.uk>
684
685 * coroutines.cc: Correct some spelling errors
686 in comments.
687
688 2020-07-15 Nathan Sidwell <nathan@acm.org>
689
690 * parser.c (cp_parser_declaration): Avoid copying tokens.
691 (cp_parser_block_declaration): RAII token pointer.
692
693 2020-07-15 Nathan Sidwell <nathan@acm.org>
694
695 * parser.c (cp_parser_skip_to_closing_parenthesis_1): Deal with
696 meeting a deferred pragma.
697 (cp_parser_skip_to_end_of_statement): Likewise.
698 (cp_parser_skip_to_end_of_block_or_statement): Likewise.
699 (cp_parser_skip_to_pragma_eol): We should never meet EOF.
700 (cp_parser_omp_declare_simd): Likewise.
701 (cp_parser_omp_declare_reduction, cp_parser_oacc_routine)
702 (pragma_lex): Likewise.
703
704 2020-07-14 Marek Polacek <polacek@redhat.com>
705
706 PR c++/95789
707 PR c++/96104
708 PR c++/96179
709 * call.c (convert_like_real_1): Renamed from convert_like_real.
710 (convert_like_real): New wrapper for convert_like_real_1.
711
712 2020-07-14 Nathan Sidwell <nathan@acm.org>
713
714 * parser.c (cp_lexer_alloc): Do not deal with PCH here.
715 (cp_lexer_new_main): Deal with PCH here. Store the tokens directly
716 into the buffer.
717 (cp_lexer_new_from_tokens): Assert last token isn't purged either.
718 (cp_lexer_get_preprocessor_token): Change first arg to flags, adjust.
719 (cp_parser_new): Pass the lexer in, don't create it here.
720 (cp_parser_translation_unit): Initialize access checks here.
721 (cp_parser_initial_pragma): First token is provided by caller,
722 don't deal with PCH stopping here. Adjust error message.
723 (c_parse_file): Adjust, change error message to avoid C++20 module
724 confusion.
725
726 2020-07-14 Nathan Sidwell <nathan@acm.org>
727
728 * ptree.c (cxx_print_type): Add TYPEOF_TYPE and BASES.
729
730 2020-07-14 Nathan Sidwell <nathan@acm.org>
731
732 * class.c (build_base_field_1): Cache CLASSTYPE_AS_BASE.
733 (build_self_reference): Rename value -> decl.
734 (dump_class_hierarchy_1): Cache CLASSTYPE_AS_BASE.
735
736 2020-07-14 Marek Polacek <polacek@redhat.com>
737
738 PR c++/95820
739 * decl.c (grokdeclarator) <case cdk_function>: Check also
740 pointers/references/... to functions.
741
742 2020-07-14 Nathan Sidwell <nathan@acm.org>
743
744 * cp-tree.h: Correct some tree lang flag comments,
745 reformat some structure definitions. Note some structure
746 sizes. Clarify some comments.
747 (yyungetc): Delete. Not been a thing for some time.
748 * class.c (copy_fndecl_with_name): Comment.
749 (check_bases_and_members): Unnecessary {}.
750 (layout_class_type): Comment.
751 * cp-tree.def (UNBOUND_CLASS_TEMPLATE): Adjust comment.
752 * decl.c: Fix some formatting & whitespace issues.
753 (function_requirements_equivalent_p): Note why
754 substitutions are needed.
755 * decl2.c (no_linkage_error): Note that heroics about
756 'typedef struct { ... };' are no longer needed.
757 * method.c: Whitespace.
758 * name-lookup.c: Whitespace.
759 (add_decl_to_level): Reformat a line.
760 (print_binding_stack): Mark as DEBUG_FUNCTION.
761 (has_using_namespace_std_directive_p): Delete comment.
762 * pt.c: Whitespace
763 * ptree.c: Whitespace.
764 * rtti.c: Whitespace & comment.
765 * tree.c: Comment.
766 * typeck.c (structural_comptypes): Add comment.
767
768 2020-07-13 Nathan Sidwell <nathan@acm.org>
769
770 * Make-lang.in (c++.disclean): Likewise.
771
772 2020-07-13 Marek Polacek <polacek@redhat.com>
773
774 PR c++/96077
775 * parser.c (cp_parser_enum_specifier): Commit to tentative parse
776 after we've seen an opening brace.
777
778 2020-07-10 Jason Merrill <jason@redhat.com>
779
780 * tree.c (structural_type_p): Allow unions.
781 * mangle.c (write_expression): Express unions with a designator.
782
783 2020-07-10 Jason Merrill <jason@redhat.com>
784
785 * pt.c (convert_nontype_argument): Handle REAL_TYPE.
786 (invalid_nontype_parm_type_p): Allow all structural types.
787 * tree.c (structural_type_p): Use SCALAR_TYPE_P.
788
789 2020-07-10 Jason Merrill <jason@redhat.com>
790
791 PR c++/96105
792 PR c++/96052
793 PR c++/95976
794 * class.c (check_field_decls): An array of empty classes is not an
795 empty data member.
796 (layout_empty_base_or_field): Handle explicit alignment.
797 Fix union handling.
798
799 2020-07-09 Julian Brown <julian@codesourcery.com>
800 Thomas Schwinge <thomas@codesourcery.com>
801
802 PR middle-end/95270
803 * semantics.c (finish_omp_clauses): Likewise.
804
805 2020-07-09 Patrick Palka <ppalka@redhat.com>
806
807 PR c++/96132
808 * constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
809 Restore dependent_type_p check that guarded the call to
810 is_really_empty_class.
811
812 2020-07-08 Patrick Palka <ppalka@redhat.com>
813
814 PR c++/95497
815 * constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
816 When processing_template_decl, check COMPLETE_TYPE_P before
817 calling is_really_empty_class. Don't check dependent_type_p.
818
819 2020-07-08 Marek Polacek <polacek@redhat.com>
820
821 PR c++/96103
822 * parser.c (cp_parser_decltype): Print error about using decltype(auto)
823 in C++11. Check that the token following "auto" is ")".
824
825 2020-07-07 Patrick Palka <ppalka@redhat.com>
826
827 PR c++/95303
828 * cxx-pretty-print.c (pp_cxx_unqualified_id): Check
829 PRIMARY_TEMPLATE_P before printing the innermost template
830 arguments.
831
832 2020-07-07 Martin Sebor <msebor@redhat.com>
833
834 PR c++/96063
835 * parser.c (class_decl_loc_t::diag_mismatched_tags): Print notes only
836 if warning_at returns nonzero.
837
838 2020-07-06 Martin Sebor <msebor@redhat.com>
839
840 PR c++/95984
841 * call.c (build_over_call): Check calls only when tf_warning is set.
842
843 2020-07-06 Nathan Sidwell <nathan@acm.org>
844
845 * decl.c (push_library_fn): Return the decl pushdecl_toplevel returns.
846 * except.c (verify_library_fn): Replace with ...
847 (declare_library_fn_1): ... this fn. Always push the fn.
848 (declare_library_fn): Call it.
849 (build_throw): Call declare_library_fn_1.
850
851 2020-07-06 Jonathan Wakely <jwakely@redhat.com>
852
853 PR c++/96068
854 * parser.c (cp_parser_toplevel_declaration): Only do pedwarn for
855 empty-declaration in C++98.
856
857 2020-07-02 Jason Merrill <jason@redhat.com>
858 Jakub Jelinek <jakub@redhat.com>
859
860 * decl.c (grokfndecl): Allow consteval virtual.
861 * search.c (check_final_overrider): Check consteval mismatch.
862 * constexpr.c (cxx_eval_thunk_call): New.
863 (cxx_eval_call_expression): Call it.
864 * cvt.c (cp_get_fndecl_from_callee): Handle FDESC_EXPR.
865 * decl2.c (mark_vtable_entries): Track vtables with consteval.
866 (maybe_emit_vtables): Pass consteval_vtables through.
867 (clear_consteval_vfns): Replace consteval with nullptr.
868 (c_parse_final_cleanups): Call it.
869
870 2020-07-01 Nathan Sidwell <nathan@acm.org>
871
872 * class.c (copy_fndecl_with_name): Add additional predicate args, do
873 not deduce them locally.
874 (copy_operator_fn): Adjust copy_fndecl_with_name call.
875 (build_clone): Add vtt and inherited predicate args. Pass through
876 to copy_fndecl_with_name call.
877 (build_cdtor_clones): Likewise, pass through to build_clone as
878 needed.
879 (build_cdtor): Determine vtt and inherited here.
880 * cp-tree.h (DECL_NEEDS_CTT_PARM_P): Delete.
881
882 2020-06-30 Nathan Sidwell <nathan@acm.org>
883
884 * cp-tree.h (copy_fndecl_with_name): Rename to ...
885 (copy_operatorn_fn): ... this. Change arg type.
886 (clone_function_decl): Rename to ...
887 (clone_cdtor): ... this.
888 * class.c (copy_fndecl_with_name): Make static.
889 (copy_operator_fn): New wrapper.
890 (build_clones): Rename to ...
891 (build_cdtor_clones): ... this.
892 (clone_function_decl): Rename to ...
893 (clone_cdtor): ... this. Adjust build_clones calls.
894 (clone_constructors_and_destructors): Adjust clone_function_decl
895 calls.
896 * method.c (implicitly_declare_fn): Adjust copy_fndecl_with_name
897 call.
898 (lazily_declare_fn): Adjust clone_function_decl call.
899 * pt.c (tsubst_function_decl): Likewise.
900 (instantiate_template_1): Likewise.
901
902 2020-06-30 Iain Sandoe <iain@sandoe.co.uk>
903
904 * coroutines.cc (morph_fn_to_coro): Remove trailing
905 space in a diagnostic.
906
907 2020-06-30 Iain Sandoe <iain@sandoe.co.uk>
908
909 * coroutines.cc (expand_one_await_expression): Remove
910 code dealing with initial suspend.
911 (build_actor_fn): Remove code special-casing initial
912 and final suspend. Handle the final suspend and marking
913 of the coroutine as done.
914 (coro_rewrite_function_body): New.
915 (bind_expr_find_in_subtree): Remove.
916 (coro_body_contains_bind_expr_p): Remove.
917 (morph_fn_to_coro): Split the rewrite of the original
918 function into coro_rewrite_function_body and call it.
919
920 2020-06-29 Marek Polacek <polacek@redhat.com>
921
922 PR c++/94553
923 * decl.c (duplicate_decls): Make sure a concept or a variable
924 template is unique in its declarative region.
925
926 2020-06-29 Marek Polacek <polacek@redhat.com>
927
928 PR c++/95568
929 * pt.c (collect_ctor_idx_types): Use TREE_TYPE.
930
931 2020-06-28 Iain Sandoe <iain@sandoe.co.uk>
932
933 PR c++/95711
934 * coroutines.cc (register_local_var_uses): Skip past
935 namespace decls.
936
937 2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
938
939 PR c++/95736
940 * coroutines.cc (get_awaitable_var): New helper.
941 (build_co_await): Check more carefully before
942 copying an awaitable.
943 (expand_one_await_expression): No initializer
944 is required when the awaitable is not a temp.
945 (register_awaits): Remove handling that is now
946 completed when the await expression is built.
947
948 2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
949
950 * coroutines.cc (morph_fn_to_coro): Diagnose unavailable
951 get_return_object_on_allocation_failure.
952
953 2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
954
955 PR c++/95519
956 * coroutines.cc (struct coroutine_info):Add a field
957 to hold computed p.return_void expressions.
958 (coro_build_promise_expression): New.
959 (get_coroutine_return_void_expr): New.
960 (finish_co_yield_expr): Build the promise expression
961 using coro_build_promise_expression.
962 (finish_co_return_stmt): Likewise.
963 (build_init_or_final_await): Likewise.
964 (morph_fn_to_coro): Likewise, for several cases.
965
966 2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
967
968 * coroutines.cc (morph_fn_to_coro): Handle error
969 returns in building g-r-o-o-a-f expressions.
970
971 2020-06-24 Nicholas Krause <xerofoify@gmail.com>
972
973 PR c++/95672
974 * typeck2.c (cxx_incomplete_type_diagnostic): Add missing
975 TYPE_EXPANSION_PACK check for diagnosing incomplete types in
976 cxx_incomplete_type_diagnostic.
977
978 2020-06-24 Iain Sandoe <iain@sandoe.co.uk>
979
980 PR c++/95518
981 PR c++/95813
982 * coroutines.cc (act_des_fn): Copy function
983 attributes onto the outlined coroutine helpers.
984
985 2020-06-24 Jason Merrill <jason@redhat.com>
986
987 * call.c (build_over_call): Only call build_base_path once.
988
989 2020-06-24 Jason Merrill <jason@redhat.com>
990
991 PR c++/95719
992 * call.c (build_over_call): Look up the overrider in base_binfo.
993 * class.c (lookup_vfn_in_binfo): Look through BINFO_PRIMARY_P.
994
995 2020-06-23 Jason Merrill <jason@redhat.com>
996
997 PR c++/93976
998 Implement C++20 P2082R1, Fixing CTAD for aggregates.
999 * cp-tree.h (TPARMS_PRIMARY_TEMPLATE): Split out from...
1000 (DECL_PRIMARY_TEMPLATE): ...here.
1001 (builtin_guide_p): Declare.
1002 * decl.c (reshape_init_class): Handle bases of a template.
1003 (reshape_init_r): An array with dependent bound takes a single
1004 initializer.
1005 * pt.c (tsubst_default_argument): Shortcut {}.
1006 (unify_pack_expansion): Allow omitted arguments to trailing pack.
1007 (builtin_guide_p): New.
1008 (collect_ctor_idx_types): Give a trailing pack a {} default
1009 argument. Handle arrays better.
1010
1011 2020-06-23 Iain Sandoe <iain@sandoe.co.uk>
1012
1013 PR c++/95477
1014 * coroutines.cc (morph_fn_to_coro): Apply a cleanup to
1015 the get return object when the DTOR is non-trivial.
1016
1017 2020-06-20 Iain Sandoe <iain@sandoe.co.uk>
1018
1019 PR c++/95505
1020 * coroutines.cc (morph_fn_to_coro): Update handling of
1021 get-return-object-on-allocation-fail and diagnose missing
1022 std::nothrow.
1023
1024 2020-06-20 Jason Merrill <jason@redhat.com>
1025
1026 * call.c (joust): Only compare constraints for non-template
1027 candidates with matching parameters.
1028 * pt.c (tsubst_pack_expansion): Fix getting a type parameter
1029 pack.
1030 (more_specialized_fn): Only compare constraints for candidates with
1031 matching parameters.
1032
1033 2020-06-19 Jason Merrill <jason@redhat.com>
1034
1035 * method.c (early_check_defaulted_comparison): Allow defaulting
1036 comparison outside class. Complain if non-member operator isn't a
1037 friend.
1038
1039 2020-06-18 Jason Merrill <jason@redhat.com>
1040
1041 * method.c (early_check_defaulted_comparison): Check for &&.
1042 (build_comparison_op): Allow empty union. Diagnose non-category
1043 type.
1044 (common_comparison_type): Remove handling for non-category type.
1045
1046 2020-06-18 Marek Polacek <polacek@redhat.com>
1047
1048 PR c++/95735
1049 * pt.c (finish_template_variable): Return if
1050 coerce_innermost_template_parms return error_mark_node.
1051
1052 2020-06-18 Marek Polacek <polacek@redhat.com>
1053
1054 PR c++/95728
1055 * pt.c (tsubst_copy_and_build) <case NEW_EXPR>: Return error_mark_node
1056 if placement is erroneous.
1057
1058 2020-06-17 Jonathan Wakely <jwakely@redhat.com>
1059
1060 PR c++/66159
1061 * parser.c (cp_parser_elaborated_type_specifier): Do not warn
1062 unless in a declaration.
1063
1064 2020-06-17 Jason Merrill <jason@redhat.com>
1065
1066 * cp-tree.h (copy_fndecl_with_name): Declare.
1067 * class.c (copy_fndecl_with_name): Split out from...
1068 (build_clone): ...here.
1069 (add_implicitly_declared_members): Add op== to TYPE_FIELDS.
1070 * method.c (implicitly_declare_fn): Use copy_fndecl_with_name.
1071
1072 2020-06-17 Jason Merrill <jason@redhat.com>
1073
1074 * call.c (build_new_op_1): Don't look for a CALL_EXPR when
1075 calling a consteval function.
1076
1077 2020-06-17 Jason Merrill <jason@redhat.com>
1078
1079 * decl2.c (grokfield): Pass SD_DEFAULTED and SD_DELETED.
1080 * decl.c (duplicate_decls): Reduce error for delete
1081 after earlier declaration to pedwarn.
1082
1083 2020-06-17 Marek Polacek <polacek@redhat.com>
1084
1085 PR c++/95508
1086 * constexpr.c (maybe_fold_non_dependent_expr): New.
1087 * cp-tree.h (maybe_fold_non_dependent_expr): Declare.
1088 * typeck.c (cp_build_array_ref): Call maybe_fold_non_dependent_expr
1089 instead of maybe_constant_value.
1090
1091 2020-06-16 Marek Polacek <polacek@redhat.com>
1092
1093 PR c++/95369
1094 * call.c (add_list_candidates): Return if a designated initializer
1095 is used with a non-aggregate.
1096 (implicit_conversion_error): Give an error for the case above.
1097
1098 2020-06-16 Marek Polacek <polacek@redhat.com>
1099
1100 PR c++/95560
1101 * name-lookup.c (check_local_shadow): Check if types are
1102 non-null before calling same_type_p.
1103
1104 2020-06-16 Jakub Jelinek <jakub@redhat.com>
1105
1106 * semantics.c (handle_omp_for_class_iterator): Adjust
1107 c_omp_check_loop_iv_exprs caller.
1108 (finish_omp_for): Likewise. Don't call fold_build_cleanup_point_expr
1109 before calling c_finish_omp_for and c_omp_check_loop_iv, move it
1110 after those calls.
1111 * pt.c (tsubst_omp_for_iterator): Handle non-rectangular loops.
1112
1113 2020-06-16 Jakub Jelinek <jakub@redhat.com>
1114
1115 * parser.c (cp_parser_omp_clause_schedule): Reject modifier separated
1116 from kind by comma rather than colon.
1117
1118 2020-06-16 Patrick Palka <ppalka@redhat.com>
1119
1120 * pt.c (perform_instantiation_time_access_checks): No need to
1121 tsubst into decl.
1122 * semantics.c (enforce_access): Verify that decl is not
1123 dependent.
1124
1125 2020-06-16 Patrick Palka <ppalka@redhat.com>
1126
1127 PR c++/41437
1128 PR c++/47346
1129 * cp-tree.h (qualified_typedef_usage_s): Delete.
1130 (qualified_typedef_usage_t): Delete.
1131 (deferred_access_check): Move up in file.
1132 (tree_template_info::typedefs_needing_access_checking): Delete.
1133 (tree_template_info::deferred_access_checks): New field.
1134 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): Rename to ...
1135 (TI_DEFERRED_ACCESS_CHECKS): ... this, and adjust accordingly.
1136 * pt.c (perform_typedefs_access_check): Rename to ...
1137 (perform_instantiation_time_access_checks): ... this, and adjust
1138 accordingly. Remove unnecessary tree tests.
1139 (instantiate_class_template_1): Adjust accordingly.
1140 (instantiate_decl): Likewise.
1141 * semantics.c (enforce_access): Likewise.
1142
1143 2020-06-16 Patrick Palka <ppalka@redhat.com>
1144
1145 PR c++/41437
1146 PR c++/47346
1147 * call.c (enforce_access): Move to semantics.c.
1148 * cp-tree.h (enforce_access): Delete.
1149 (get_types_needing_access_check): Delete.
1150 (add_typedef_to_current_template_for_access_check): Delete.
1151 * decl.c (make_typename_type): Adjust accordingly. Use
1152 check_accessibility_of_qualified_id instead of directly using
1153 perform_or_defer_access_check.
1154 * parser.c (cp_parser_template_declaration_after_parameters):
1155 Don't push a dk_no_check access state when parsing a template.
1156 * pt.c (get_types_needing_access_check): Delete.
1157 (append_type_to_template_for_access_check_1): Delete.
1158 (perform_typedefs_access_check): Adjust. If type_decl is a
1159 FIELD_DECL, also check its DECL_CONTEXT for dependence. Use
1160 tsubst_copy instead of tsubst to substitute into type_decl so
1161 that we substitute into the DECL_CONTEXT of a FIELD_DECL.
1162 (append_type_to_template_for_access_check): Delete.
1163 * search.c (accessible_p): Remove the processing_template_decl
1164 early exit.
1165 * semantics.c (enforce_access): Moved from call.c. If we're
1166 parsing a template and the access check failed, add the check to
1167 TI_TYPEDEFS_NEEDING_ACCESS_CHECKING.
1168 (perform_or_defer_access_check): Adjust comment.
1169 (add_typedef_to_current_template_for_access_check): Delete.
1170 (check_accessibility_of_qualified_id): Adjust accordingly.
1171 Exit early if the scope is dependent.
1172
1173 2020-06-11 Patrick Palka <ppalka@redhat.com>
1174
1175 PR c++/93467
1176 * constraint.cc (associate_classtype_constraints): If there is a
1177 discrepancy between the current template depth and the template
1178 depth of the original declaration, then adjust the template
1179 parameter depth within the current constraints appropriately.
1180 * pt.c (tsubst_friend_class): Substitute into and set the
1181 constraints on the injected declaration.
1182
1183 2020-06-11 Iain Sandoe <iain@sandoe.co.uk>
1184
1185 * coroutines.cc (instantiate_coro_traits): Pass a reference
1186 to lambda closure objects to traits instantiation.
1187 (morph_fn_to_coro): Likewise for promise parameter
1188 preview and allocator lookup.
1189
1190 2020-06-10 Iain Sandoe <iain@sandoe.co.uk>
1191
1192 PR c++/95440
1193 * call.c (add_candidates): Use vec_safe_length() for
1194 testing the arguments list.
1195 (build_new_method_call_1): Use vec_safe_is_empty() when
1196 checking for an empty args list.
1197
1198 2020-06-10 Marek Polacek <polacek@redhat.com>
1199
1200 PR c++/95562
1201 * parser.c (cp_parser_direct_declarator): Clear
1202 CP_PARSER_FLAGS_DELAY_NOEXCEPT if the declarator kind is not
1203 cdk_id.
1204
1205 2020-06-09 Iain Sandoe <iain@sandoe.co.uk>
1206
1207 PR c++/95137
1208 * coroutines.cc (expand_one_await_expression): Build separate
1209 DTOR trees for the awaitable object on the destroy and resume
1210 paths.
1211
1212 2020-06-09 Jason Merrill <jason@redhat.com>
1213
1214 PR c++/95552
1215 * cp-gimplify.c (predeclare_vla): Only predeclare a VLA if it's
1216 wrapped in a pointer type.
1217
1218 2020-06-05 Marek Polacek <polacek@redhat.com>
1219
1220 PR c++/95369
1221 * call.c (build_converted_constant_expr_internal): Allow
1222 list-initialization.
1223
1224 2020-06-05 Iain Sandoe <iain@sandoe.co.uk>
1225
1226 * cp-tree.def (CO_RETURN_EXPR): Correct the class
1227 to use tcc_statement.
1228
1229 2020-06-05 Jason Merrill <jason@redhat.com>
1230
1231 * error.c (dump_binary_op): Handle negative operand to
1232 POINTER_PLUS_EXPR.
1233
1234 2020-06-04 Jason Merrill <jason@redhat.com>
1235
1236 PR c++/93310
1237 * constexpr.c (cxx_eval_constant_expression) [OBJ_TYPE_REF]:
1238 Evaluate OBJ_TYPE_REF_EXPR.
1239
1240 2020-06-04 Jason Merrill <jason@redhat.com>
1241
1242 PR c++/95158
1243 * class.c (lookup_vfn_in_binfo): New.
1244 * call.c (build_over_call): Use it.
1245 * cp-tree.h (resolves_to_fixed_type_p): Add default argument.
1246 (lookup_vfn_in_binfo): Declare.
1247
1248 2020-06-04 Iain Sandoe <iain@sandoe.co.uk>
1249
1250 PR c++/95346
1251 * coroutines.cc (morph_fn_to_coro): Ensure that the get-
1252 return-object is constructed correctly; When it is not the
1253 final return value, pass it to the CTOR of the return type
1254 as an rvalue, per the standard comment.
1255
1256 2020-06-04 Jakub Jelinek <jakub@redhat.com>
1257
1258 PR c++/82304
1259 PR c++/95307
1260 * constexpr.c (cxx_eval_constant_expression): Diagnose CONVERT_EXPR
1261 conversions from pointer types to arithmetic types here...
1262 (cxx_eval_outermost_constant_expr): ... instead of here.
1263
1264 2020-06-03 Mark Wielaard <mark@klomp.org>
1265
1266 * parser.c (cp_lexer_safe_previous_token): New function.
1267 (cp_parser_error_1): Add name_hint if the previous token is
1268 a string literal and next token is a CPP_NAME and we have a
1269 missing header suggestion for the name.
1270
1271 2020-06-03 Patrick Palka <ppalka@redhat.com>
1272
1273 * pt.c (process_partial_specialization): Pass the full set of
1274 generic template arguments to strictly_subsumes.
1275
1276 2020-06-03 Patrick Palka <ppalka@redhat.com>
1277
1278 PR c++/92103
1279 * pt.c (most_specialized_partial_spec): Reorganize the loop over
1280 DECL_TEMPLATE_SPECIALIZATIONS. Check constraints_satisfied_p on
1281 the original template declaration, not on the tsubsted one.
1282
1283 2020-06-03 Iain Sandoe <iain@sandoe.co.uk>
1284
1285 PR c++/95345
1286 * coroutines.cc (finish_co_await_expr): Revise to allow for
1287 parameter packs.
1288 (finish_co_yield_expr): Likewise.
1289
1290 2020-06-03 Jason Merrill <jason@redhat.com>
1291
1292 PR c++/95232
1293 * cp-tree.h (predeclare_vla): Declare.
1294 * cp-gimplify.c (predeclare_vla): Handle getting a decl.
1295 * pt.c (tsubst_expr) [DECL_EXPR]: Use it.
1296
1297 2020-06-03 Tobias Burnus <tobias@codesourcery.com>
1298
1299 * cp-gimplify.c (cxx_omp_predetermined_mapping): New.
1300 * cp-objcp-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redfine.
1301 * cp-tree.h (cxx_omp_predetermined_mapping): Declare.
1302
1303 2020-06-02 Jason Merrill <jason@redhat.com>
1304
1305 PR c++/95193
1306 * pt.c (tsubst_decl): Relax assert.
1307
1308 2020-06-02 Iain Sandoe <iain@sandoe.co.uk>
1309
1310 PR c++/95050
1311 * coroutines.cc (build_co_await): Wrap the co_await expression
1312 in a TARGET_EXPR, where needed.
1313 (finish_co_yield_expr): Likewise.
1314
1315 2020-06-02 Patrick Palka <ppalka@redhat.com>
1316
1317 PR c++/92633
1318 PR c++/92838
1319 * pt.c (tsubst_function_decl): Don't do set_constraints when
1320 regenerating a lambda.
1321 (tsubst_lambda_expr): Substitute into the lambda's constraints
1322 and do set_constraints here.
1323
1324 2020-06-01 Jason Merrill <jason@redhat.com>
1325
1326 PR c++/95466
1327 PR c++/95311
1328 PR c++/95221
1329 * class.c (build_vfn_ref): Revert 95311 change.
1330 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): Build a
1331 COMPOUND_EXPR.
1332
1333 2020-06-01 Iain Sandoe <iain@sandoe.co.uk>
1334
1335 PR c++/95350
1336 * coroutines.cc (struct param_info): Remove rv_ref field.
1337 (build_actor_fn): Remove specifial rvalue ref handling.
1338 (morph_fn_to_coro): Likewise.
1339
1340 2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
1341
1342 PR c++/95087
1343 * coroutines.cc (morph_fn_to_coro): If we see an
1344 early fatal error, drop the erroneous function body.
1345
1346 2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
1347
1348 * coroutines.cc (build_co_await): Remove unused
1349 variable.
1350 (finish_co_await_expr): Likewise.
1351 (finish_co_yield_expr): Likewise; revise comment.
1352
1353 2020-05-30 Iain Sandoe <iain@sandoe.co.uk>
1354
1355 * coroutines.cc (morph_fn_to_coro): Revise initialization
1356 of the frame pointer to avoid an unused value.
1357
1358 2020-05-30 Patrick Palka <ppalka@redhat.com>
1359
1360 PR c++/95386
1361 * constraint.cc (satisfaction_value): Accept INTEGER_CST of any
1362 boolean type.
1363
1364 2020-05-29 Patrick Palka <ppalka@redhat.com>
1365 Jason Merrill <jason@redhat.com>
1366
1367 PR c++/95181
1368 * class.c (add_method): Let special member function templates
1369 coexist if they are not equivalently constrained, or in a class
1370 template.
1371
1372 2020-05-29 Jason Merrill <jason@redhat.com>
1373
1374 PR c++/95371
1375 * pt.c (process_template_parm): Set DECL_TEMPLATE_INFO
1376 on the DECL_TEMPLATE_RESULT.
1377
1378 2020-05-29 Marek Polacek <polacek@redhat.com>
1379
1380 PR c++/95344
1381 * cp-gimplify.c (cp_fold) <case MODIFY_EXPR>: Don't set
1382 TREE_THIS_VOLATILE here.
1383 (cp_fold): Set it here along with TREE_NO_WARNING.
1384
1385 2020-05-29 Jason Merrill <jason@redhat.com>
1386
1387 PR c++/95311
1388 PR c++/95221
1389 * class.c (build_vfn_ref): Don't fold the INDIRECT_REF.
1390
1391 2020-05-29 Patrick Palka <ppalka@redhat.com>
1392
1393 PR c++/92652
1394 PR c++/93698
1395 PR c++/94128
1396 * parser.c (cp_parser_requires_clause_expression): Temporarily
1397 increment processing_template_decl only if it is 0.
1398 (cp_parser_constraint_expression): Likewise.
1399 (cp_parser_requires_expression): Likewise.
1400
1401 2020-05-29 Patrick Palka <ppalka@redhat.com>
1402
1403 PR c++/95241
1404 * constexpr.c (get_or_insert_ctor_field): Add limited support
1405 for RANGE_EXPR index lookups.
1406
1407 2020-05-28 Jakub Jelinek <jakub@redhat.com>
1408
1409 PR c++/95328
1410 * decl.c (cp_finish_decomp): Call complete_type before checking
1411 COMPLETE_TYPE_P.
1412
1413 2020-05-28 Jason Merrill <jason@redhat.com>
1414
1415 PR c++/94926
1416 * decl.c (cp_finish_decl): Revert r9-297 change.
1417 (check_static_variable_definition): Likewise.
1418 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
1419 * pt.c (instantiate_decl): Return early on type error.
1420
1421 2020-05-27 Jason Merrill <jason@redhat.com>
1422
1423 PR c++/95319
1424 * decl.c (reshape_init_array_1): Don't reuse in overload context.
1425
1426 2020-05-27 Jason Merrill <jason@redhat.com>
1427
1428 PR c++/95242
1429 * call.c (build_new_op_1): Suppress
1430 warn_zero_as_null_pointer_constant across comparison of <=> result
1431 to 0.
1432
1433 2020-05-27 Jason Merrill <jason@redhat.com>
1434
1435 PR c++/95222
1436 * decl.c (grokdeclarator): Don't shift attributes in TYPENAME
1437 context.
1438
1439 2020-05-27 Nathan Sidwell <nathan@acm.org>
1440
1441 PR c++/95263
1442 * pt.c (lookup_template_class_1): Restore alias template mutation.
1443
1444 2020-05-26 Jakub Jelinek <jakub@redhat.com>
1445
1446 PR c++/95197
1447 * cp-gimplify.c: Include omp-general.h.
1448 (cp_genericize_r) <case OMP_DISTRIBUTE>: For class iteration
1449 variables in composite distribute parallel for, instantiate copy
1450 ctor of their types.
1451
1452 2020-05-23 Patrick Palka <ppalka@redhat.com>
1453
1454 PR c++/94038
1455 * constexpr.c (cxx_eval_constant_expression)
1456 <case TEMPLATE_ID_EXPR>: Don't evaluate the concept when
1457 constexpr evaluation is uid-sensitive.
1458
1459 2020-05-22 Jason Merrill <jason@redhat.com>
1460
1461 * cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Don't preevaluate
1462 the function address if the call used operator syntax.
1463
1464 2020-05-21 Jason Merrill <jason@redhat.com>
1465
1466 PR c++/95221
1467 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): For a virtual
1468 call, instrument the OBJ_TYPE_REF.
1469
1470 * decl.c (compute_array_index_type_loc): Diagnose expressions
1471 in a template that can't be constant.
1472 * parser.c (cp_parser_direct_declarator): Don't check
1473 non-constant array bounds here.
1474
1475 * cp-tree.h (is_rvalue_constant_expression): Declare.
1476 * constexpr.c (is_rvalue_constant_expression): New.
1477 * parser.c (cp_parser_constant_expression): Use it.
1478 * decl.c (cp_finish_decl): Try to treat a constexpr initializer in a
1479 template as constant.
1480
1481 * typeck.c (build_x_modify_expr): Handle error_mark_node arguments.
1482
1483 * decl.c (grokparms): Return NULL_TREE if any parms were erroneous.
1484
1485 2020-05-21 Iain Sandoe <iain@sandoe.co.uk>
1486
1487 * coroutines.cc (finish_co_return_stmt): Revert change to use
1488 finish_expr_stmt.
1489
1490 2020-05-21 Patrick Palka <ppalka@redhat.com>
1491
1492 PR c++/94038
1493 * constexpr.c (constexpr_ctx::uid_sensitive): Remove field.
1494 (uid_sensitive_constexpr_evaluation_value): Define.
1495 (uid_sensitive_constexpr_evaluation_true_counter): Define.
1496 (uid_sensitive_constexpr_evaluation_p): Define.
1497 (uid_sensitive_constexpr_evaluation_sentinel): Define its
1498 constructor.
1499 (uid_sensitive_constexpr_evaluation_checker): Define its
1500 constructor and its evaluation_restricted_p method.
1501 (get_fundef_copy): Remove 'ctx' parameter. Use u_s_c_e_p
1502 instead of constexpr_ctx::uid_sensitive.
1503 (cxx_eval_call_expression): Use u_s_c_e_p instead, and test it
1504 last. Adjust call to get_fundef_copy.
1505 (instantiate_cx_fn_r): Test u_s_c_e_p so that we increment the
1506 counter if necessary.
1507 (cxx_eval_outermost_constant_expr): Remove 'uid_sensitive'
1508 parameter. Adjust function body accordingly.
1509 (maybe_constant_value): Remove 'uid_sensitive' parameter and
1510 adjust function body accordingly. Set up a
1511 uid_sensitive_constexpr_evaluation_checker, and use it to
1512 conditionally update the cv_cache.
1513 * cp-gimplify.c (cp_fold): Set up a
1514 uid_sensitive_constexpr_evaluation_checker, and use it to
1515 conditionally update the fold_cache.
1516 * cp-tree.h (maybe_constant_value): Update declaration.
1517 (struct uid_sensitive_constexpr_evaluation_sentinel): Define.
1518 (struct sensitive_constexpr_evaluation_checker): Define.
1519 * expr.c (fold_for_warn): Set up a
1520 uid_sensitive_constexpr_evaluation_sentinel before calling
1521 the folding subroutines. Drop all but the first argument to
1522 maybe_constant_value.
1523
1524 2020-05-20 Marek Polacek <polacek@redhat.com>
1525
1526 DR 2237
1527 * parser.c (cp_parser_unqualified_id): Reject simple-template-id as
1528 the declarator-id of a destructor.
1529 (cp_parser_constructor_declarator_p): Reject simple-template-id as
1530 the declarator-id of a constructor.
1531
1532 2020-05-20 Marek Polacek <polacek@redhat.com>
1533
1534 DR 2289
1535 PR c++/94553
1536 * cp-tree.h (SD_DECOMPOSITION): New flag.
1537 * decl.c (duplicate_decls): Make sure a structured binding is unique
1538 in its declarative region.
1539 (start_decl): If INITIALIZED is SD_DECOMPOSITION, call
1540 fit_decomposition_lang_decl.
1541 (grokdeclarator): Compare INITIALIZED directly to SD_* flags.
1542 * parser.c (cp_parser_decomposition_declaration): Pass SD_DECOMPOSITION
1543 to start_decl.
1544
1545 2020-05-20 Patrick Palka <ppalka@redhat.com>
1546
1547 PR c++/95223
1548 * typeck.c (structural_comptypes): Don't perform
1549 context-dependent resolution of TYPENAME_TYPEs when
1550 comparing_specializations.
1551
1552 2020-05-19 Nathan Sidwell <nathan@acm.org>
1553
1554 * pt.c (lookup_template_class_1): Do not reinit template_info of an
1555 alias here.
1556
1557 2020-05-18 Martin Sebor <msebor@redhat.com>
1558
1559 PR c++/94923
1560 * call.c ((maybe_warn_class_memaccess): Use is_byte_access_type.
1561 * cp-tree.h (is_dummy_object): Return bool.
1562 (is_byte_access_type): Declare new function.
1563 * tree.c (is_dummy_object): Return bool.
1564 (is_byte_access_type): Define new function.
1565
1566 2020-05-19 Patrick Palka <ppalka@redhat.com>
1567
1568 PR c++/87847
1569 * pt.c (init_template_processing): Enable sanitization for
1570 decl_specializations and type_specializations.
1571
1572 PR c++/66439
1573 * pt.c (fn_type_unification): Pass 'fn' instead of NULL_TREE as
1574 the 'in_decl' parameter to coerce_template_parms.
1575
1576 2020-05-18 Marek Polacek <polacek@redhat.com>
1577
1578 PR c++/94955
1579 * typeck.c (cp_build_binary_op): Use fold_for_warn instead of
1580 cp_fold_rvalue.
1581
1582 2020-05-18 Marek Polacek <polacek@redhat.com>
1583
1584 PR c++/94937
1585 * cvt.c (cp_get_fndecl_from_callee): Return NULL_TREE if the function
1586 type is not INDIRECT_TYPE_P.
1587 * decl.c (omp_declare_variant_finalize_one): Call
1588 cp_get_callee_fndecl_nofold instead of looking for the function decl
1589 manually.
1590
1591 2020-05-18 Marek Polacek <polacek@redhat.com>
1592
1593 PR c++/90915
1594 * parser.c (cp_parser_has_attribute_expression): Sorry on a
1595 type-dependent argument.
1596
1597 2020-05-18 Marek Polacek <polacek@redhat.com>
1598
1599 DR 1512
1600 PR c++/87699
1601 * call.c (add_builtin_candidate) <case EQ_EXPR>: Create candidate
1602 operator functions when type is std::nullptr_t for ==/!=.
1603 * typeck.c (composite_pointer_type_r): Add a bool * parameter. Use it
1604 to maybe add "const" to the pointer type.
1605 (composite_pointer_type): Update the call to composite_pointer_type_r.
1606 (cp_build_binary_op): Turn two warning_at into error_at. Print the
1607 types.
1608
1609 2020-05-18 Jason Merrill <jason@redhat.com>
1610
1611 * call.c (build_over_call): Remove unnecessary
1612 cp_stabilize_reference.
1613
1614 2020-05-18 Marek Polacek <polacek@redhat.com>
1615
1616 * call.c (add_builtin_candidate): Don't create a builtin overload
1617 candidate for ++ when type is bool in C++17.
1618
1619 2020-05-18 Marek Polacek <polacek@redhat.com>
1620
1621 * cfns.h: Regenerated.
1622
1623 2020-05-17 Iain Sandoe <iain@sandoe.co.uk>
1624
1625 * coroutines.cc (morph_fn_to_coro): Initialize the gro variable.
1626
1627 2020-05-16 Iain Sandoe <iain@sandoe.co.uk>
1628
1629 * coroutines.cc (finish_co_return_stmt): Implement rules
1630 from [class.copy.elision] /3.
1631
1632 2020-05-16 Patrick Palka <ppalka@redhat.com>
1633
1634 PR c++/57943
1635 * semantics.c (finish_decltype_type): Call
1636 instantiate_non_dependent_expr_sfinae on the expression.
1637
1638 2020-05-15 Patrick Palka <ppalka@redhat.com>
1639
1640 Revert:
1641
1642 2020-04-07 Patrick Palka <ppalka@redhat.com>
1643
1644 PR c++/90996
1645 * typeck2.c (process_init_constructor_array): Propagate
1646 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
1647 the array initializer.
1648
1649 2020-05-15 Jason Merrill <jason@redhat.com>
1650
1651 PR c++/93286 - ICE with __is_constructible and variadic template.
1652 * pt.c (tsubst_tree_list): New.
1653 (tsubst, tsubst_copy_and_build): Use it.
1654 * decl2.c (is_late_template_attribute): Handle error_mark_node args.
1655
1656 2020-05-15 Nathan Sidwell <nathan@acm.org>
1657
1658 * pt.c (template_args_equal): Fix thinkos in previous 'cleanup'.
1659
1660 2020-05-14 Jason Merrill <jason@redhat.com>
1661
1662 PR c++/93901
1663 * pt.c (maybe_instantiate_noexcept): Change clone handling.
1664
1665 2020-05-14 Patrick Palka <ppalka@redhat.com>
1666
1667 PR c++/78446
1668 * call.c (build_op_call): Pass complain to lookup_fnfields.
1669 (build_special_member_call): Likewise.
1670 * class.c (type_requires_array_cookie): Pass tf_warning_or_error
1671 to lookup_fnfields.
1672 * cp-tree.h (lookup_fnfields): Add tsubst_flags_t parameter.
1673 * except.c (build_throw): Pass tf_warning_or_error to
1674 lookup_fnfields.
1675 * init.c (build_new_1): Pass complain to lookup_fnfields.
1676 * method.c (locate_fn_flags): Likewise.
1677 * name-lookup.c (lookup_name_real_1): Pass tf_warning_or_error
1678 to lookup_fnfields.
1679 * pt.c (tsubst_baselink): Pass complain to lookup_fnfields.
1680 * search.c (lookup_fnfields): New 'complain' parameter. Pass it
1681 to lookup_member.
1682
1683 2020-05-14 Nathan Sidwell <nathan@acm.org>
1684
1685 * parser.c (cp_parser_diagnose_invalid_typename): Mention
1686 std=c++20 not 2a, reformat dependent binfo inform loops.
1687
1688 * pt.c (tsubst_template_decl): Reorder and commonize some control
1689 paths.
1690
1691 * pt.c (tsubst_friend_function): Simplify control flow.
1692
1693 * pt.c (lookup_template_class_1): Remove unnecessary else by
1694 simply grabbing TYPE_NAME earlier.
1695
1696 * pt.c (push_template_decl_real): Adjust friend pushing logic.
1697 Reinit template type.
1698
1699 * pt.c (build_template_decl): Init DECL_TEMPLATE_RESULT &
1700 TREE_TYPE here ...
1701 (process_partial_specialization): ... not here ...
1702 (push_template_decl_real, add_inherited_template_parms)
1703 (build_deduction_guide): ... or here.
1704
1705 2020-05-14 Jakub Jelinek <jakub@redhat.com>
1706
1707 * cp-gimplify.c (cp_genericize_r): Set cfun->has_omp_target.
1708
1709 2020-05-13 Patrick Palka <ppalka@redhat.com>
1710
1711 PR c++/79706
1712 * init.c (build_vec_delete_1): Just return error_mark_node if
1713 deallocate_expr is error_mark_node.
1714 (build_delete): Just return error_mark_node if do_delete is
1715 error_mark_node.
1716
1717 2020-05-13 Patrick Palka <ppalka@redhat.com>
1718
1719 PR c++/95020
1720 * constraint.cc (tsubst_requires_expr): Produce a new
1721 requires-expression when processing_template_decl, even if
1722 template arguments are not dependent.
1723
1724 2020-05-13 Marek Polacek <polacek@redhat.com>
1725
1726 PR c++/95066
1727 * decl.c (duplicate_decls): Set DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
1728
1729 2020-05-13 Nathan Sidwell <nathan@acm.org>
1730
1731 * pt.c (template_args_equal): Reorder category checking for
1732 clarity.
1733
1734 * pt.c (perform_typedefs_access_check): Cache expensively
1735 calculated object references.
1736 (check_auto_in_tmpl_args): Just assert we do not get unexpected
1737 nodes, rather than silently do nothing.
1738 (append_type_to_template_for_access): Likewise, cache expensie
1739 object reference.
1740
1741 * pt.c (canonical_type_parameter): Simplify.
1742
1743 Formatting fixups & some simplifications.
1744 * pt.c (spec_hash_table): New typedef.
1745 (decl_specializations, type_specializations): Use it.
1746 (retrieve_specialization): Likewise.
1747 (register_specialization): Remove unnecessary casts.
1748 (push_template_decl_real): Reformat.
1749 (instantiate_class_template_1): Use more RAII.
1750 (make_argument_pack): Simplify.
1751 (instantiate_template_1): Use gcc_checking_assert for expensive
1752 asserts.
1753 (instantiate_decl): Likewise.
1754 (resolve_typename_type): Reformat comment.
1755 * semantics.c (struct deferred_access): Remove unnecessary GTY on
1756 member.
1757 (begin_class_definition): Fix formatting.
1758
1759 2020-05-13 Jason Merrill <jason@redhat.com>
1760
1761 * call.c, class.c, constexpr.c, constraint.cc, decl.c, init.c,
1762 lambda.c, lex.c, method.c, name-lookup.c, parser.c, pt.c, tree.c,
1763 typeck2.c: Change cxx2a to cxx20.
1764
1765 2020-05-12 Marek Polacek <polacek@redhat.com>
1766
1767 PR c++/95074
1768 * parser.c (cp_parser_postfix_expression) <case CPP_OPEN_PAREN>: When
1769 looking for a block-scope function declaration, look through the whole
1770 set, not just the first function in the overload set.
1771
1772 2020-05-12 Jakub Jelinek <jakub@redhat.com>
1773
1774 PR c++/95063
1775 * pt.c (tsubst_decl): Deal with DECL_OMP_PRIVATIZED_MEMBER for
1776 a bit-field.
1777
1778 2020-05-11 Jason Merrill <jason@redhat.com>
1779
1780 Resolve C++20 NB comment CA104
1781 * pt.c (determine_specialization): Compare constraints for
1782 specialization of member template of class instantiation.
1783
1784 2020-05-11 Jason Merrill <jason@redhat.com>
1785
1786 PR c++/92583
1787 PR c++/92654
1788 * tree.c (cp_walk_subtrees): Stop at typedefs.
1789 Handle TYPENAME_TYPE here.
1790 * pt.c (find_parameter_packs_r): Not here.
1791 (for_each_template_parm_r): Clear *walk_subtrees.
1792 * decl2.c (min_vis_r): Look through typedefs.
1793
1794 2020-05-11 Jason Merrill <jason@redhat.com>
1795
1796 * call.c (implicit_conversion_error): Split out from...
1797 (perform_implicit_conversion_flags): ...here.
1798 (build_converted_constant_expr_internal): Use it.
1799
1800 2020-05-11 Jason Merrill <jason@redhat.com>
1801
1802 PR c++/90748
1803 * parser.c (inject_parm_decls): Set current_class_ptr here.
1804 (cp_parser_direct_declarator): And here.
1805 (cp_parser_late_return_type_opt): Not here.
1806 (cp_parser_noexcept_specification_opt): Nor here.
1807 (cp_parser_exception_specification_opt)
1808 (cp_parser_late_noexcept_specifier): Remove unneeded parameters.
1809
1810 2020-05-11 Jason Merrill <jason@redhat.com>
1811
1812 * decl.c (cxx_init_decl_processing): Call declare_weak for
1813 __cxa_pure_virtual.
1814
1815 2020-05-11 Jason Merrill <jason@redhat.com>
1816
1817 * pt.c (instantiate_class_template_1): Call tsubst_expr for
1818 STATIC_ASSERT member.
1819 * ptree.c (cxx_print_xnode): Handle STATIC_ASSERT.
1820
1821 2020-05-11 Jason Merrill <jason@redhat.com>
1822
1823 * pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Remove redundant
1824 walking of capture list.
1825
1826 2020-05-11 Jason Merrill <jason@redhat.com>
1827
1828 * cp-tree.h (LOOKUP_EXPLICIT_TMPL_ARGS): Remove.
1829 * call.c (build_new_function_call): Don't set it.
1830 (build_new_method_call_1): Likewise.
1831 (build_over_call): Check cand->explicit_targs instead.
1832
1833 2020-05-11 Jason Merrill <jason@redhat.com>
1834
1835 * decl.c (compute_array_index_type_loc): Stabilize before building
1836 the MINUS_EXPR.
1837
1838 2020-05-11 Jason Merrill <jason@redhat.com>
1839
1840 * decl.c (grokdeclarator): Adjust deprecated_state here.
1841 (start_decl): Not here.
1842
1843 2020-05-08 Iain Sandoe <iain@sandoe.co.uk>
1844
1845 PR c++/95003
1846 * coroutines.cc (build_actor_fn): Ensure that bind scopes
1847 are marked as having side-effects where necessary.
1848 (replace_statement_captures): Likewise.
1849 (morph_fn_to_coro): Likewise.
1850
1851 2020-05-08 Nathan Sidwell <nathan@acm.org>
1852
1853 * NEWS: Delete, it is so stale.
1854
1855 * parser.c (cp_lexer_set_source_position_from_token): EOF has a
1856 location too.
1857
1858 2020-05-07 Iain Sandoe <iain@sandoe.co.uk>
1859
1860 PR c++/94817
1861 PR c++/94829
1862 * coroutines.cc (morph_fn_to_coro): Set unformed outline
1863 functions to error_mark_node. For early error returns suppress
1864 warnings about missing ramp return values. Fix reinstatement
1865 of the function body on pre-existing initial error.
1866 * decl.c (finish_function): Use the normal error path for fails
1867 in the ramp function, do not try to compile the helpers if the
1868 transform fails.
1869
1870 2020-05-07 Marek Polacek <polacek@redhat.com>
1871
1872 PR c++/94590 - Detect long double -> double narrowing.
1873 * typeck2.c (check_narrowing): Detect long double -> double
1874 narrowing even when double and long double have the same
1875 precision. Make it handle conversions to float too.
1876
1877 2020-05-07 Marek Polacek <polacek@redhat.com>
1878
1879 PR c++/94255
1880 * parser.c (cp_parser_class_specifier_1): Check that the scope is
1881 nested inside current scope before pushing it.
1882
1883 2020-05-07 Marek Polacek <polacek@redhat.com>
1884
1885 P1957R2
1886 * typeck2.c (check_narrowing): Consider T* to bool narrowing
1887 in C++11 and up.
1888
1889 2020-05-07 Marek Polacek <polacek@redhat.com>
1890
1891 * decl.c (grok_op_properties): Fix spelling of non-static.
1892 * typeck.c (build_class_member_access_expr): Likewise.
1893
1894 2020-05-07 Richard Biener <rguenther@suse.de>
1895
1896 PR middle-end/94703
1897 * optimize.c (update_cloned_parm): Copy DECL_NOT_GIMPLE_REG_P.
1898
1899 2020-05-06 Marek Polacek <polacek@redhat.com>
1900
1901 PR c++/94938
1902 * pt.c (tsubst_copy_and_build): Call type_dependent_expression_p_push
1903 instead of uses_template_parms. Move the warning_sentinels after the
1904 RECURs.
1905
1906 2020-05-06 Jakub Jelinek <jakub@redhat.com>
1907
1908 PR c++/94951
1909 * typeck.c (cp_strict_aliasing_warning): New function.
1910 (cp_build_indirect_ref_1, build_reinterpret_cast_1): Use
1911 it instead of strict_aliasing_warning.
1912
1913 PR c++/94907
1914 * method.c (defaulted_late_check): Don't call synthesize_method
1915 on constexpr sfk_comparison if it has been called on it already.
1916
1917 2020-05-06 Nathan Sidwell <nathan@acm.org>
1918
1919 PR c++/94946
1920 * decl.c (grokdeclarator): Don't splice template attributes in
1921 parm context -- they can apply to the parm.
1922
1923 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
1924
1925 * coroutines.cc: Remove references to n4849 throughout.
1926
1927 2020-05-05 Jason Merrill <jason@redhat.com>
1928
1929 CWG 2235
1930 * pt.c (more_specialized_fn): Do consider parms with no deducible
1931 template parameters.
1932
1933 2020-05-05 Jason Merrill <jason@redhat.com>
1934
1935 PR c++/90212
1936 * constexpr.c (potential_constant_expression_1): In a lambda
1937 function, consider a captured variable directly.
1938
1939 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
1940
1941 * coroutines.cc (transform_await_wrapper): Check that we have
1942 no unlowered co_yields.
1943 (captures_temporary): Likewise.
1944 (register_awaits): Likewise.
1945
1946 2020-05-05 Nathan Sidwell <nathan@acm.org>
1947
1948 PR c++/94807
1949 * coroutines.cc (morph_fn_to_coro): Just check for
1950 closure_identifier.
1951 * pt.c (tsubst_function_decl): Update lambda fn's this_ptr name.
1952
1953 2020-05-05 Marek Polacek <polacek@redhat.com>
1954 Jason Merrill <jason@redhat.com>
1955
1956 PR c++/94799
1957 * parser.c (cp_parser_postfix_dot_deref_expression): If we have
1958 a type-dependent object of class type, stash it to
1959 parser->context->object_type. If the postfix expression doesn't have
1960 a type, use typeof.
1961 (cp_parser_class_name): Consider object scope too.
1962 (cp_parser_lookup_name): Remove code dealing with the case when
1963 object_type is unknown_type_node.
1964
1965 2020-05-04 Patrick Palka <ppalka@redhat.com>
1966
1967 PR c++/94038
1968 * cp-gimplify.c (cp_fold) <case CALL_EXPR>: Move some variable
1969 declarations closer to their uses. Copy the CALL_EXPR only
1970 when one of its arguments has changed.
1971 <case TREE_VEC>: Instead of first collecting the folded
1972 arguments into a releasing_vec, just make a copy of the TREE_VEC
1973 as soon as folding changes one of its arguments.
1974
1975 2020-05-04 Iain Sandoe <iain@sandoe.co.uk>
1976
1977 * coroutines.cc (morph_fn_to_coro): Mark the coro.gro variable
1978 as artificial and ignored.
1979
1980 2020-05-04 Nathan Sidwell <nathan@acm.org>
1981
1982 pt.c (process_template_parm): Don't walk the template list twice,
1983 remember the final node instead.
1984 (end_template_parm_list): Refactor. Comment on why we do a pop
1985 and a push.
1986
1987 PR c++/94827 -- don't save parms in nested requirement
1988 * constraint.cc (tsubst_nested_requirement): TYPE directly holds
1989 notmalized requirement.
1990 (finish_nested_requirement): Don't stash current tpl parms into
1991 the requirement.
1992 (diagnose_nested_requirement): TYPE directly holds notmalized
1993 requirement.
1994
1995 2020-05-01 Patrick Palka <ppalka@redhat.com>
1996
1997 PR c++/90880
1998 * cp-tree.h (check_accessibility_of_qualified_id): Add
1999 tsubst_flags_t parameter and change return type to bool.
2000 * parser.c (cp_parser_lookup_name): Pass tf_warning_to_error to
2001 check_accessibility_of_qualified_id.
2002 * pt.c (tsubst_qualified_id): Return error_mark_node if
2003 check_accessibility_of_qualified_id returns false.
2004 * semantics.c (check_accessibility_of_qualified_id): Add
2005 complain parameter. Pass complain instead of
2006 tf_warning_or_error to perform_or_defer_access_check. Return
2007 true unless perform_or_defer_access_check returns false.
2008
2009 2020-05-01 Marek Polacek <polacek@redhat.com>
2010
2011 PR c++/94885
2012 * typeck2.c (process_init_constructor_record): Return PICFLAG_ERRONEOUS
2013 if an initializer element was erroneous.
2014
2015 2020-05-01 Jason Merrill <jason@redhat.com>
2016
2017 PR c++/90479
2018 * init.c (get_nsdmi): Don't push_to_top_level for a local class.
2019
2020 2020-05-01 Jason Merrill <jason@redhat.com>
2021
2022 PR c++/91529
2023 * decl.c (cp_finish_decl): Also clear TREE_READONLY if
2024 -fmerge-all-constants.
2025
2026 2020-05-01 Jason Merrill <jason@redhat.com>
2027
2028 PR c++/93822
2029 * pt.c (tsubst_decl): Make sure DECL_VALUE_EXPR continues to have
2030 the same type as the variable.
2031
2032 2020-04-30 Jason Merrill <jason@redhat.com>
2033 Nathan Sidwell <nathan@acm.org>
2034
2035 PR c++/94827
2036 * constraint.cc (map_arguments): If ARGS is null, it's a
2037 self-mapping of parms.
2038 (finish_nested_requirement): Do not pass argified
2039 current_template_parms to normalization.
2040 (tsubst_nested_requirement): Don't assert no template parms.
2041
2042 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
2043
2044 PR c++/94886
2045 * coroutines.cc (transform_local_var_uses): Defer walking
2046 the DECL_INITIALs of BIND_EXPR vars until all the frame
2047 allocations have been made.
2048
2049 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
2050
2051 PR c++/94883
2052 * coroutines.cc (register_awaits): Update target
2053 expressions for awaitable and suspend handle
2054 initializers.
2055
2056 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
2057
2058 PR c++/94879
2059 * coroutines.cc (build_co_await): Account for variables
2060 with DECL_VALUE_EXPRs.
2061 (captures_temporary): Likewise.
2062 (register_awaits): Likewise.
2063
2064 2020-04-29 Patrick Palka <ppalka@redhat.com>
2065
2066 PR c++/94830
2067 * pt.c (find_template_parameter_info::parm_list): New field.
2068 (keep_template_parm): Use the new field to build up the
2069 parameter list here instead of ...
2070 (find_template_parameters): ... here. Return ftpi.parm_list.
2071
2072 2020-04-29 Jakub Jelinek <jakub@redhat.com>
2073
2074 PR target/94707
2075 * class.c (build_base_field): Set DECL_FIELD_ABI_IGNORED on C++17 empty
2076 base artificial FIELD_DECLs.
2077 (layout_class_type): Set DECL_FIELD_ABI_IGNORED on empty class
2078 field_poverlapping_p FIELD_DECLs.
2079
2080 2020-04-29 Patrick Palka <ppalka@redhat.com>
2081
2082 PR c++/94819
2083 * constraint.cc (satisfy_declaration_constraints): Use saved_t
2084 instead of t as the key to decl_satisfied_cache.
2085
2086 PR c++/94808
2087 * error.c (print_requires_expression_info): Print the dependent
2088 form of the parameter list with its template parameter mapping,
2089 rather than printing the substituted form.
2090
2091 2020-04-28 Jason Merrill <jason@redhat.com>
2092
2093 PR c++/94583
2094 * decl.c (use_eh_spec_block): Check nothrow type after
2095 DECL_DEFAULTED_FN.
2096 * pt.c (maybe_instantiate_noexcept): Call synthesize_method for
2097 DECL_MAYBE_DELETED fns here.
2098 * decl2.c (mark_used): Not here.
2099 * method.c (get_defaulted_eh_spec): Reject DECL_MAYBE_DELETED here.
2100
2101 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
2102
2103 PR c++/94760
2104 * coroutines.cc (instantiate_coro_traits): Pass a reference to
2105 object type rather than a pointer type for 'this', for method
2106 coroutines.
2107 (struct param_info): Add a field to hold that the parm is a lambda
2108 closure pointer.
2109 (morph_fn_to_coro): Check for lambda closure pointers in the
2110 args. Use a reference to *this when building the args list for the
2111 promise allocator lookup.
2112
2113 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
2114
2115 PR c++/94759
2116 * coroutines.cc (coro_promise_type_found_p): Do not
2117 exclude non-classes here (this needs to be handled in the
2118 coroutine header).
2119 (morph_fn_to_coro): Allow for the case where the coroutine
2120 returns void.
2121
2122 2020-04-27 Iain Sandoe <iain@sandoe.co.uk>
2123
2124 PR c++/94701
2125 * coroutines.cc (struct local_var_info): Add fields for static
2126 variables and those with DECL_VALUE_EXPR redirection.
2127 (transform_local_var_uses): Skip past typedefs and static vars
2128 and then account for redirected variables.
2129 (register_local_var_uses): Likewise.
2130
2131 2020-04-27 Jason Merrill <jason@redhat.com>
2132
2133 PR c++/90750
2134 PR c++/79585
2135 * decl.c (grokdeclarator): Move dependent attribute to decl.
2136 * decl2.c (splice_template_attributes): No longer static.
2137
2138 2020-04-27 Patrick Palka <ppalka@redhat.com>
2139
2140 PR c++/94772
2141 * constexpr.c (cxx_eval_call_expression): Don't set new_obj if we're
2142 evaluating the target constructor of a delegating constructor.
2143 (cxx_eval_store_expression): Don't set TREE_READONLY if the LHS of the
2144 INIT_EXPR is '*this'.
2145
2146 2020-04-26 Marek Polacek <polacek@redhat.com>
2147
2148 PR c++/90320
2149 * call.c (struct conversion): Add copy_init_p.
2150 (standard_conversion): Set copy_init_p in ck_base and ck_rvalue
2151 if FLAGS demands LOOKUP_ONLYCONVERTING.
2152 (convert_like_real) <case ck_base>: If copy_init_p is set, or
2153 LOOKUP_ONLYCONVERTING into FLAGS.
2154
2155 2020-04-26 Iain Sandoe <iain@sandoe.co.uk>
2156
2157 PR c++/94752
2158 * coroutines.cc (morph_fn_to_coro): Ensure that
2159 unnamed function params have a usable and distinct
2160 frame field name.
2161
2162 2020-04-24 Jason Merrill <jason@redhat.com>
2163
2164 PR c++/94583
2165 * decl.c (redeclaration_error_message): Reject defaulted comparison
2166 operator that has been previously declared.
2167
2168 2020-04-25 Patrick Palka <ppalka@redhat.com>
2169
2170 * parser.c (cp_parser_diagnose_invalid_type_name): Suggest enabling
2171 concepts if the invalid identifier is 'requires'.
2172
2173 2020-04-25 Jakub Jelinek <jakub@redhat.com>
2174
2175 PR c++/94742
2176 * semantics.c (finish_call_expr): When looking if all overloads
2177 are noreturn, use STRIP_TEMPLATE to look through TEMPLATE_DECLs.
2178
2179 2020-04-24 Martin Liska <mliska@suse.cz>
2180
2181 * coroutines.cc: Fix compilation error for release checking
2182 where we miss declaration of ‘coro_body_contains_bind_expr_p’.
2183
2184 2020-04-23 Patrick Palka <ppalka@redhat.com>
2185
2186 * tree.c (zero_init_expr_p): Use uses_template_parms instead of
2187 dependent_type_p.
2188
2189 PR c++/94645
2190 * pt.c (template_class_depth): Walk into the DECL_FRIEND_CONTEXT of a
2191 friend declaration rather than into its CP_DECL_CONTEXT.
2192
2193 2020-04-23 Iain Sandoe <iain@sandoe.co.uk>
2194
2195 PR c++/94288
2196 * coroutines.cc (await_statement_expander): Simplify cases.
2197 (struct susp_frame_data): Add fields for truth and/or if
2198 cases, rename one field.
2199 (analyze_expression_awaits): New.
2200 (expand_one_truth_if): New.
2201 (add_var_to_bind): New helper.
2202 (coro_build_add_if_not_cond_break): New helper.
2203 (await_statement_walker): Handle conditional expressions,
2204 handle expansion of truth-and/or-if cases.
2205 (bind_expr_find_in_subtree): New, checking-only.
2206 (coro_body_contains_bind_expr_p): New, checking-only.
2207 (morph_fn_to_coro): Ensure that we have a top level bind
2208 expression.
2209
2210 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
2211
2212 PR translation/94698
2213 * class.c (check_field_decls): Change "define" to "declare" in
2214 -Weffc++ diagnostics.
2215
2216 2020-04-22 Patrick Palka <ppalka@redhat.com>
2217
2218 PR c++/94719
2219 PR c++/94549
2220 * constraint.cc (satisfy_declaration_constraints): If the inherited
2221 constructor points to an instantiation of a constructor template,
2222 remember and use its attached template arguments.
2223
2224 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
2225
2226 PR translation/94698
2227 * class.c (check_field_decls): Change "override" to "define" in
2228 -Weffc++ diagnostics.
2229
2230 2020-04-22 Iain Sandoe <iain@sandoe.co.uk>
2231
2232 PR c++/94682
2233 * coroutines.cc (struct param_info): Add a field to note that
2234 the param is 'this'.
2235 (morph_fn_to_coro): Convert this to a reference before using it
2236 in the promise parameter preview.
2237
2238 2020-04-22 Jason Merrill <jason@redhat.com>
2239
2240 PR c++/94546
2241 * pt.c (register_parameter_specializations): If the instantiation is
2242 still a parameter pack, don't wrap it in a NONTYPE_ARGUMENT_PACK.
2243 (tsubst_pack_expansion, tsubst_expr): Adjust.
2244
2245 2020-04-22 Martin Sebor <msebor@redhat.com>
2246 Jason Merrill <jason@redhat.com>
2247
2248 PR c++/94510
2249 * decl.c (reshape_init_array_1): Avoid stripping redundant trailing
2250 zero initializers...
2251 * mangle.c (write_expression): ...and handle them here even for
2252 pointers to members by calling zero_init_expr_p.
2253 * cp-tree.h (zero_init_expr_p): Declare.
2254 * tree.c (zero_init_expr_p): Define.
2255 (type_initializer_zero_p): Remove.
2256 * pt.c (tparm_obj_values): New hash_map.
2257 (get_template_parm_object): Store to it.
2258 (tparm_object_argument): New.
2259
2260 2020-04-22 Patrick Palka <ppalka@redhat.com>
2261
2262 PR c++/67825
2263 * constraint.cc (diagnose_valid_expression): Check convert_to_void here
2264 as well as in tsubst_valid_expression_requirement.
2265
2266 2020-04-21 Patrick Palka <ppalka@redhat.com>
2267
2268 PR c++/94549
2269 * constraint.cc (satisfy_declaration_constraints): Don't strip the
2270 inherited constructor if it already has template information.
2271
2272 PR c++/94597
2273 * pt.c (any_template_parm_r) <case IDENTIFIER_NODE>: New case. If this
2274 is a conversion operator, visit its TREE_TYPE.
2275
2276 2020-04-21 Nathan Sidwell <nathan@acm.org>
2277
2278 * pt.c (tsubst_copy_and_build) [POINTER_PLUS_EXPR]: Check for
2279 error_mark_node.
2280
2281 2020-04-21 Iain Sandoe <iain@sandoe.co.uk>
2282
2283 PR c++/94661
2284 * coroutines.cc (morph_fn_to_coro): Simplify return
2285 value computation.
2286
2287 2020-04-17 Marek Polacek <polacek@redhat.com>
2288
2289 PR c++/94592
2290 * constexpr.c (cxx_eval_outermost_constant_expr): Return when T is
2291 a BRACE_ENCLOSED_INITIALIZER_P.
2292 (is_nondependent_constant_expression): Don't check
2293 BRACE_ENCLOSED_INITIALIZER_P.
2294 (is_nondependent_static_init_expression): Likewise.
2295
2296 2020-04-20 Patrick Palka <ppalka@redhat.com>
2297
2298 PR c++/94628
2299 * cp-tree.h (lss_policy::lss_nop): New enumerator.
2300 * pt.c (local_specialization_stack::local_specialization_stack): Handle
2301 an lss_nop policy.
2302 (local_specialization_stack::~local_specialization_stack): Likewise.
2303 (tsubst_pack_expansion): Use a local_specialization_stack instead of
2304 manually saving and restoring local_specializations. Conditionally
2305 replace local_specializations sooner, before the handling of the
2306 unsubstituted_packs case.
2307
2308 2020-04-20 Marek Polacek <polacek@redhat.com>
2309
2310 PR c++/94505 - bogus -Wparentheses warning with fold-expression.
2311 * pt.c (fold_expression): Add warning_sentinel for -Wparentheses
2312 before calling build_x_binary_op.
2313
2314 2020-04-20 Marek Polacek <polacek@redhat.com>
2315
2316 * coroutines.cc (captures_temporary): Don't assign the result of
2317 STRIP_NOPS to the same variable.
2318
2319 2020-04-20 Nathan Sidwell <nathan@acm.org>
2320
2321 PR c++/94454 - tpl-tpl-parms are not canonicalizable types
2322 * pt.c (canonical_type_parameter): Assert not a tpl-tpl-parm.
2323 (process_template_parm): tpl-tpl-parms are structural.
2324 (rewrite_template_parm): Propagate structuralness.
2325
2326 PR c++/94454 - Expr pack expansion equality
2327 * tree.c (cp_tree_equal) [TEMPLATE_ID_EXPR, default]: Refactor.
2328 [EXPR_PACK_EXPANSION]: Add.
2329
2330 PR c++/94454 Template Argument Hashing
2331 * pt.c (iterative_hash_template_arg): Strip nodes as
2332 template_args_equal does.
2333 [ARGUMENT_PACK_SELECT, TREE_VEC, CONSTRUCTOR]: Refactor.
2334 [node_class:TEMPLATE_TEMPLATE_PARM]: Hash by level & index.
2335 [node_class:default]: Refactor.
2336
2337 2020-04-18 Patrick Palka <ppalka@redhat.com>
2338
2339 PR c++/94632
2340 * tree.c (cp_tree_equal) <case PARM_DECL>: Ignore
2341 comparing_specializations if the parameters' contexts are identical.
2342
2343 PR c++/92187
2344 * pt.c (splice_late_return_type): Propagate cv-qualifiers and
2345 PLACEHOLDER_TYPE_CONSTRAINTS from the original auto node to the new one.
2346
2347 2020-04-17 Patrick Palka <ppalka@redhat.com>
2348
2349 PR c++/94483
2350 * lambda.c (lambda_capture_field_type): Avoid doing auto deduction if
2351 the explicit initializer has parameter packs.
2352
2353 PR c++/88754
2354 * parser.c (cp_parser_check_template_parameters): Before issuing a hard
2355 error, first try simulating an error instead.
2356
2357 2020-04-17 Jakub Jelinek <jakub@redhat.com>
2358
2359 PR other/94629
2360 * call.c (build_conditional_expr_1): Remove redundant assignment to
2361 arg2.
2362
2363 2020-04-16 Patrick Palka <ppalka@redhat.com>
2364
2365 PR c++/94475
2366 * cvt.c (ocp_convert): If the result of scalar_constant_value is
2367 erroneous, ignore it and use the original expression.
2368
2369 2020-04-16 Jakub Jelinek <jakub@redhat.com>
2370
2371 PR c++/94571
2372 * parser.c (cp_parser_simple_declaration): Fix up a pasto in
2373 diagnostics.
2374
2375 2020-04-15 Jakub Jelinek <jakub@redhat.com>
2376
2377 PR c/94593
2378 * parser.c (cp_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
2379 requires directive when not at file or namespace scope.
2380
2381 2020-04-14 Iain Sandoe <iain@sandoe.co.uk>
2382
2383 PR c++/94359
2384 * coroutines.cc (build_actor_fn): Check that the target can
2385 support the resume tailcall before mandating it.
2386
2387 2020-04-14 Patrick Palka <ppalka@redhat.com>
2388
2389 PR c++/85278
2390 * cxx-pretty-print.c (cxx_pretty_printer:simple_type_specifier)
2391 <case DECLTYPE_TYPE>: Handle DECLTYPE_TYPE here instead of ...
2392 (pp_cxx_type_specifier_seq) <case DECLTYPE_TYPE>: ... here.
2393 (cxx_pretty_printer::direct_abstract_declarator) <case DECLTYPE_TYPE>:
2394 New no-op case.
2395
2396 PR c++/94034
2397 * constexpr.c (replace_result_decl_data): New struct.
2398 (replace_result_decl_data_r): New function.
2399 (replace_result_decl): New function.
2400 (cxx_eval_call_expression): Use it.
2401 * tree.c (build_aggr_init_expr): Set the location of the AGGR_INIT_EXPR
2402 to that of its initializer.
2403
2404 2020-04-13 Marek Polacek <polacek@redhat.com>
2405
2406 PR c++/94588
2407 * name-lookup.c (check_local_shadow): Add an inform call.
2408
2409 2020-04-13 Patrick Palka <ppalka@redhat.com>
2410
2411 PR c++/94521
2412 * error.c (dump_scope): Pass TFF_NO_FUNCTION_ARGUMENTS to
2413 dump_function_decl when printing a function template instantiation as a
2414 scope.
2415
2416 PR c++/94470
2417 * constexpr.c (get_or_insert_ctor_field): Set default value of parameter
2418 'pos_hint' to -1.
2419 (cxx_eval_bare_aggregate): Use get_or_insert_ctor_field instead of
2420 assuming the the next index belongs at the end of the new CONSTRUCTOR.
2421 (cxx_eval_store_expression): Revert PR c++/78572 fix.
2422
2423 2020-04-13 Nathan Sidwell <nathan@acm.org>
2424
2425 PR c++/94426 lambdas with internal linkage are different to no-linkage
2426 * decl2.c (determine_visibility): A lambda's visibility is
2427 affected by its extra scope.
2428 * pt.c (instantiate_decl): Determine var's visibility before
2429 instantiating its initializer.
2430 * tree.c (no_linkage_check): Revert code looking at visibility of
2431 lambda's extra scope.
2432 `
2433 2020-04-10 Iain Sandoe <iain@sandoe.co.uk>
2434
2435 PR c++/94528
2436 * coroutines.cc (co_await_expander): Remove.
2437 (expand_one_await_expression): New.
2438 (process_one_statement): New.
2439 (await_statement_expander): New.
2440 (build_actor_fn): Revise to use per-statement expander.
2441 (struct susp_frame_data): Reorder and comment.
2442 (register_awaits): Factor code.
2443 (replace_statement_captures): New, factored from...
2444 (maybe_promote_captured_temps):.. here.
2445 (await_statement_walker): Revise to process per statement.
2446 (morph_fn_to_coro): Use revised susp_frame_data layout.
2447
2448 2020-04-10 Marek Polacek <polacek@redhat.com>
2449
2450 PR c++/94149
2451 * method.c (constructible_expr): In C++20, try using parenthesized
2452 initialization of aggregates to determine the result of
2453 __is_constructible.
2454
2455 2020-04-10 Bin Cheng <bin.cheng@linux.alibaba.com>
2456
2457 * coroutines.cc (co_await_expander): Simplify.
2458
2459 2020-04-09 Jason Merrill <jason@redhat.com>
2460
2461 PR c++/94523
2462 * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]: Look at
2463 ctx->object and ctx->global->values first.
2464
2465 2020-04-09 Marek Polacek <polacek@redhat.com>
2466
2467 PR c++/93790
2468 * call.c (initialize_reference): If the reference binding failed, maybe
2469 try initializing from { }.
2470 * decl.c (grok_reference_init): For T& t(e), set
2471 LOOKUP_AGGREGATE_PAREN_INIT but don't build up a constructor yet.
2472
2473 2020-04-08 Iain Sandoe <iain@sandoe.co.uk>
2474 Jun Ma <JunMa@linux.alibaba.com>
2475
2476 * coroutines.cc (maybe_promote_captured_temps): Add a cleanup
2477 expression, if needed, to any call from which we promoted
2478 temporaries captured by reference.
2479
2480 2020-04-08 Marek Polacek <polacek@redhat.com>
2481
2482 PR c++/94507 - ICE-on-invalid with lambda template.
2483 * pt.c (tsubst_lambda_expr): Cope when tsubst_template_decl or
2484 tsubst_function_decl returns error_mark_node.
2485
2486 2020-04-08 Martin Liska <mliska@suse.cz>
2487
2488 PR c++/94314
2489 * decl.c (duplicate_decls): Duplicate also DECL_IS_REPLACEABLE_OPERATOR.
2490 (cxx_init_decl_processing): Mark replaceable all implicitly defined
2491 operators.
2492
2493 2020-04-08 Patrick Palka <ppalka@redhat.com>
2494
2495 Core issues 1001 and 1322
2496 PR c++/92010
2497 * pt.c (rebuild_function_or_method_type): Split function out from ...
2498 (tsubst_function_type): ... here.
2499 (maybe_rebuild_function_decl_type): New function.
2500 (tsubst_function_decl): Use it.
2501
2502 2020-04-08 Jakub Jelinek <jakub@redhat.com>
2503
2504 PR c++/94325
2505 * decl.c (begin_destructor_body): For CLASSTYPE_VBASECLASSES class
2506 dtors, if CLASSTYPE_PRIMARY_BINFO is non-NULL, but not BINFO_VIRTUAL_P,
2507 look at CLASSTYPE_PRIMARY_BINFO of its BINFO_TYPE if it is not
2508 BINFO_VIRTUAL_P, and so on.
2509
2510 2020-04-08 Marek Polacek <polacek@redhat.com>
2511
2512 PR c++/94478 - ICE with defaulted comparison operator
2513 * method.c (early_check_defaulted_comparison): Give an error when the
2514 context is null.
2515
2516 2020-04-08 Tobias Burnus <tobias@codesourcery.com>
2517
2518 PR middle-end/94120
2519 * paser.c (cp_parser_oacc_declare): Add check that variables
2520 are declared in the same scope as the directive.
2521
2522 2020-04-07 Jason Merrill <jason@redhat.com>
2523
2524 PR c++/94480
2525 * parser.c (cp_parser_requires_expression): Use tentative_firewall.
2526
2527 PR c++/94481
2528 * parser.c (cp_parser_placeholder_type_specifier): Use
2529 matching_parens.
2530
2531 2020-04-07 Iain Sandoe <iain@sandoe.co.uk>
2532
2533 * coroutines.cc (maybe_promote_captured_temps): Ensure that
2534 reference capture placeholder vars are properly declared.
2535
2536 2020-04-07 Patrick Palka <ppalka@redhat.com>
2537
2538 PR c++/90996
2539 * tree.c (replace_placeholders): Look through all handled components,
2540 not just COMPONENT_REFs.
2541 * typeck2.c (process_init_constructor_array): Propagate
2542 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
2543 the array initializer.
2544
2545 2020-04-07 Jakub Jelinek <jakub@redhat.com>
2546
2547 PR c++/94512
2548 * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
2549 if cp_parser_omp_master succeeded.
2550
2551 2020-04-06 Jason Merrill <jason@redhat.com>
2552
2553 PR c++/94462
2554 * decl.c (duplicate_decls): Fix handling of DECL_HIDDEN_FRIEND_P.
2555
2556 2020-04-04 Marek Polacek <polacek@redhat.com>
2557 Jason Merrill <jason@redhat.com>
2558
2559 PR c++/94155 - crash in gimplifier with paren init of aggregates.
2560 * init.c (build_vec_init): Fill in indexes.
2561
2562 2020-04-04 Jason Merrill <jason@redhat.com>
2563
2564 PR c++/91377
2565 * mangle.c (write_expression): Skip IMPLICIT_CONV_EXPR.
2566
2567 2020-04-04 Patrick Palka <ppalka@redhat.com>
2568
2569 PR c++/94205
2570 PR c++/79937
2571 * constexpr.c (struct constexpr_ctx): New field 'parent'.
2572 (cxx_eval_bare_aggregate): Propagate CONSTRUCTOR_PLACEHOLDER_BOUNDARY
2573 flag from the original constructor to the reduced constructor.
2574 (lookup_placeholder): Prefer to return the outermost matching object
2575 by recursively calling lookup_placeholder on the 'parent' context,
2576 but don't cross CONSTRUCTOR_PLACEHOLDER_BOUNDARY constructors.
2577 (cxx_eval_constant_expression): Link the 'ctx' context to the 'new_ctx'
2578 context via 'new_ctx.parent' when being expanded without an explicit
2579 target. Don't call replace_placeholders.
2580 (cxx_eval_outermost_constant_expr): Initialize 'ctx.parent' to NULL.
2581
2582 PR c++/94219
2583 PR c++/94205
2584 * constexpr.c (get_or_insert_ctor_field): Split out (while adding
2585 support for VECTOR_TYPEs, and optimizations for the common case)
2586 from ...
2587 (cxx_eval_store_expression): ... here. Rename local variable
2588 'changed_active_union_member_p' to 'activated_union_member_p'. Record
2589 the sequence of indexes into 'indexes' that yields the subobject we're
2590 assigning to. Record the integer offsets of the constructor indexes
2591 we're assigning through into 'index_pos_hints'. After evaluating the
2592 initializer of the store expression, recompute 'valp' using 'indexes'
2593 and using 'index_pos_hints' as hints.
2594 (cxx_eval_bare_aggregate): Tweak comments. Use get_or_insert_ctor_field
2595 to recompute the constructor_elt pointer we're assigning through after
2596 evaluating each initializer.
2597
2598 2020-04-04 Jason Merrill <jason@redhat.com>
2599
2600 PR c++/67825
2601 * constraint.cc (tsubst_valid_expression_requirement): Call
2602 convert_to_void.
2603
2604 2020-04-04 Jason Merrill <jason@redhat.com>
2605
2606 PR c++/94453
2607 * constexpr.c (maybe_constant_value): Use break_out_target_exprs.
2608 * expr.c (mark_use) [VIEW_CONVERT_EXPR]: Don't wrap a TARGET_EXPR in
2609 NON_LVALUE_EXPR.
2610
2611 2020-04-04 Jakub Jelinek <jakub@redhat.com>
2612
2613 PR debug/94441
2614 * parser.c (cp_parser_omp_for_loop): Use
2615 protected_set_expr_location_if_unset.
2616 * cp-gimplify.c (genericize_if_stmt, genericize_cp_loop): Likewise.
2617
2618 PR c++/94477
2619 * pt.c (tsubst_expr) <case OMP_MASTER>: Clear
2620 omp_parallel_combined_clauses.
2621
2622 2020-04-03 Jason Merrill <jason@redhat.com>
2623
2624 PR c++/91966
2625 * pt.c (complex_pack_expansion_r): New.
2626 (complex_alias_template_p): Use it.
2627
2628 2020-03-31 Jason Merrill <jason@redhat.com>
2629
2630 PR c++/94205
2631 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Call
2632 replace_placeholders.
2633 * typeck2.c (store_init_value): Fix arguments to
2634 fold_non_dependent_expr.
2635
2636 2020-03-31 Jason Merrill <jason@redhat.com>
2637
2638 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Use
2639 local variables.
2640
2641 2020-03-30 Jason Merrill <jason@redhat.com>
2642
2643 PR c++/90711
2644 * tree.c (cp_tree_equal) [CALL_EXPR]: Compare KOENIG_LOOKUP_P.
2645 (called_fns_equal): Check DECL_CONTEXT.
2646
2647 2020-03-30 Jakub Jelinek <jakub@redhat.com>
2648
2649 PR c++/94385
2650 * semantics.c (add_stmt): Only set STMT_IS_FULL_EXPR_P on trees with
2651 STATEMENT_CODE_P code.
2652
2653 2020-03-28 Patrick Palka <ppalka@redhat.com>
2654
2655 PR c++/94306
2656 * parser.c (cp_parser_requires_clause_opt): Diagnose and recover from
2657 "requires {" when "requires requires {" was probably intended.
2658
2659 PR c++/94252
2660 * constraint.cc (tsubst_compound_requirement): Always suppress errors
2661 from type_deducible_p and expression_convertible_p, as they're not
2662 substitution errors.
2663 (diagnose_atomic_constraint) <case INTEGER_CST>: Remove this case so
2664 that we diagnose INTEGER_CST expressions of non-bool type via the
2665 default case.
2666 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: New case.
2667 * parser.c (cp_parser_requires_expression): Always parse the requirement
2668 body as if we're processing a template, by temporarily incrementing
2669 processing_template_decl. Afterwards, if we're not actually in a
2670 template context, perform semantic processing to diagnose any invalid
2671 types and expressions.
2672 * pt.c (tsubst_copy_and_build) <case REQUIRES_EXPR>: Remove dead code.
2673 * semantics.c (finish_static_assert): Explain an assertion failure
2674 when the condition is a REQUIRES_EXPR like we do when it is a concept
2675 check.
2676
2677 * constraint.cc (diagnose_compound_requirement): When diagnosing a
2678 compound requirement, maybe replay the satisfaction failure, subject to
2679 the current diagnosis depth.
2680
2681 * constraint.cc (finish_constraint_binary_op): Set the location of EXPR
2682 as well as its range, because build_x_binary_op doesn't always do so.
2683 (current_constraint_diagnosis_depth): New.
2684 (concepts_diagnostics_max_depth_exceeded_p): New.
2685 (collect_operands_of_disjunction): New.
2686 (satisfy_disjunction): When diagnosing a satisfaction failure, maybe
2687 replay each branch of the disjunction, subject to the current diagnosis
2688 depth.
2689 (diagnose_valid_expression): When diagnosing a satisfaction failure,
2690 maybe replay the substitution error, subject to the current diagnosis
2691 recursion.
2692 (diagnose_valid_type): Likewise.
2693 (diagnose_nested_requiremnet): Likewise.
2694 (diagnosing_failed_constraint::diagnosing_failed_constraint): Increment
2695 current_constraint_diagnosis_depth when diagnosing.
2696 (diagnosing_failed_constraint::~diagnosing_failed_constraint): Decrement
2697 current_constraint_diagnosis_depth when diagnosing.
2698 (diagnosing_failed_constraint::replay_errors_p): New static member
2699 function.
2700 (diagnose_constraints): Don't diagnose if concepts_diagnostics_max_depth
2701 is 0. Emit a one-off note to increase -fconcepts-diagnostics-depth if
2702 the limit was exceeded.
2703 * cp-tree.h (diagnosing_failed_constraint::replay_errors_p): Declare.
2704
2705 2020-03-27 Nathan Sidwell <nathan@acm.org>
2706
2707 PR c++/84733
2708 * name-lookup.c (do_pushdecl): Look through cleanp levels.
2709
2710 2020-03-27 Martin Sebor <msebor@redhat.com>
2711
2712 PR c++/94078
2713 PR c++/93824
2714 PR c++/93810
2715 * cp-tree.h (most_specialized_partial_spec): Declare.
2716 * parser.c (cp_parser_elaborated_type_specifier): Distinguish alias
2717 from declarations.
2718 (specialization_of): New function.
2719 (cp_parser_check_class_key): Move code...
2720 (class_decl_loc_t::add): ...to here. Add parameters. Avoid issuing
2721 -Wredundant-tags on first-time declarations in other declarators.
2722 Correct handling of template specializations.
2723 (class_decl_loc_t::diag_mismatched_tags): Also expect to be called
2724 when -Wredundant-tags is enabled. Use primary template or partial
2725 specialization as the guide for uses of implicit instantiations.
2726 * pt.c (most_specialized_partial_spec): Declare extern.
2727
2728 2020-03-27 Nathan Sidwell <nathan@acm.org>
2729
2730 PR c++/94257
2731 * name-lookup.c (push_namespace): Triage ambiguous lookups that
2732 contain namespaces.
2733
2734 2020-03-27 Jakub Jelinek <jakub@redhat.com>
2735
2736 PR c++/94326
2737 * call.c (set_flags_from_callee): Don't update
2738 cp_function_chain->can_throw or current_function_returns_abnormally
2739 if cp_unevaluated_operand.
2740
2741 PR c++/94339
2742 * cvt.c (ocp_convert): Handle COMPOUND_EXPR by recursion on the second
2743 operand and creating a new COMPOUND_EXPR if anything changed.
2744
2745 2020-03-26 Marek Polacek <polacek@redhat.com>
2746
2747 PR c++/94336 - template keyword accepted before destructor names.
2748 * parser.c (cp_parser_unqualified_id): Give an error when 'template'
2749 is followed by a destructor name.
2750
2751 2020-03-27 Patrick Palka <ppalka@redhat.com>
2752
2753 * decl.c (compute_array_index_type_loc): Remove redundant
2754 type_dependent_expression_p check that is subsumed by
2755 value_dependent_expression_p.
2756 * decl2.c (is_late_template_attribute): Likewise.
2757 * pt.c (uses_template_parms): Likewise.
2758 (dependent_template_arg_p): Likewise.
2759
2760 2020-03-26 Marek Polacek <polacek@redhat.com>
2761
2762 DR 1710
2763 PR c++/94057 - template keyword in a typename-specifier.
2764 * parser.c (check_template_keyword_in_nested_name_spec): New.
2765 (cp_parser_nested_name_specifier_opt): Implement DR1710, optional
2766 'template'. Call check_template_keyword_in_nested_name_spec.
2767 (cp_parser_simple_type_specifier): Assume that a <
2768 following a qualified-id in a typename-specifier begins
2769 a template argument list.
2770
2771 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
2772
2773 * coroutines.cc (coro_init_identifiers): Initialize an identifier
2774 for the cororoutine handle 'address' method name.
2775 (struct coro_aw_data): Add fields to cover the continuations.
2776 (co_await_expander): Determine the kind of await_suspend in use.
2777 If we have the case that returns a continuation handle, then save
2778 this and make the target for 'scope exit without cleanup' be the
2779 continuation resume label.
2780 (expand_co_awaits): Remove.
2781 (struct suspend_point_info): Remove fields that kept the returned
2782 await_suspend handle type.
2783 (transform_await_expr): Remove code tracking continuation handles.
2784 (build_actor_fn): Add the continuation handle as an actor-function
2785 scope var. Build the symmetric transfer continuation point. Call
2786 the tree walk for co_await expansion directly, rather than via a
2787 trivial shim function.
2788 (register_await_info): Remove fields tracking continuation handles.
2789 (get_await_suspend_return_type): Remove.
2790 (register_awaits): Remove code tracking continuation handles.
2791 (morph_fn_to_coro): Remove code tracking continuation handles.
2792
2793 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
2794
2795 * coroutines.cc (co_await_expander): If we are expanding the
2796 initial await expression, set a boolean flag to show that we
2797 have now reached the initial await_resume() method call.
2798 (expand_co_awaits): Handle the 'initial await resume called' flag.
2799 (build_actor_fn): Insert the initial await expression into the
2800 start of the user-authored function-body. Handle the 'initial await
2801 resume called' flag.
2802 (morph_fn_to_coro): Initialise the 'initial await resume called'
2803 flag. Modify the unhandled exception catch clause to recognise
2804 exceptions that occur before the initial await_resume() and re-
2805 throw them.
2806
2807 2020-03-26 Jakub Jelinek <jakub@redhat.com>
2808
2809 PR c++/81349
2810 * class.c (user_provided_p): Use STRIP_TEMPLATE instead of returning
2811 true for all TEMPLATE_DECLs.
2812
2813 PR c++/94272
2814 * cp-gimplify.c (cp_genericize_r): Handle STATEMENT_LIST.
2815
2816 2020-03-25 Patrick Palka <ppalka@redhat.com>
2817
2818 PR c++/94265
2819 * parser.c (cp_parser_selection_statement) <case RID_IF>: Invalidate the
2820 current condition chain when the if-statement has a non-empty
2821 init-statement.
2822
2823 2020-03-25 Iain Sandoe <iain@sandoe.co.uk>
2824
2825 PR c++/94319
2826 * coroutines.cc (captures_temporary): Fix a missing dereference.
2827
2828 2020-03-24 Marek Polacek <polacek@redhat.com>
2829
2830 PR c++/94190 - wrong no post-decrement operator error in template.
2831 * call.c (convert_like_real): Use convert_from_reference on the result.
2832
2833 2020-03-24 Jason Merrill <jason@redhat.com>
2834
2835 PR c++/94186
2836 * constraint.cc (constraint_satisfaction_value): Repeat noisily on
2837 error.
2838 (tsubst_nested_requirement): Likewise.
2839 (get_constraint_error_location): Allow missing context.
2840 (diagnose_atomic_constraint): Diagnose non-bool constraint here.
2841 (satisfy_atom): Not here. Only diagnose non-constant when noisy.
2842
2843 2020-03-24 Jason Merrill <jason@redhat.com>
2844
2845 * pt.c (any_template_parm_r): Look into the type of a non-type
2846 template parm.
2847
2848 2020-03-24 Jason Merrill <jason@redhat.com>
2849
2850 * cp-tree.h (cp_expr): When constructing from an expr and a
2851 location, call protected_set_expr_location.
2852
2853 2020-03-23 Patrick Palka <ppalka@redhat.com>
2854
2855 PR c++/93805
2856 * except.c (maybe_noexcept_warning): Add TODO.
2857 * method.c (walk_field_subobs): Pass tf_none to expr_noexcept_p.
2858
2859 2020-03-23 nathans <nathan@acm.org>
2860
2861 PR c++/94044
2862 * tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
2863 operand.
2864
2865 2020-03-21 Patrick Palka <ppalka@redhat.com>
2866
2867 PR c++/94066
2868 * constexpr.c (reduced_constant_expression_p) [CONSTRUCTOR]: Properly
2869 handle unions without an initializer.
2870 (cxx_eval_component_reference): Emit a different diagnostic when the
2871 constructor element corresponding to a union member is NULL.
2872 (cxx_eval_bare_aggregate): When constructing a union, always set the
2873 active union member before evaluating the initializer. Relax assertion
2874 that verifies the index of the constructor element we're initializing
2875 hasn't been changed.
2876 (cxx_eval_store_expression): Diagnose changing the active union member
2877 while the union is in the process of being initialized. After setting
2878 an active union member, clear CONSTRUCTOR_NO_CLEARING on the underlying
2879 CONSTRUCTOR.
2880 (cxx_eval_constant_expression) [PLACEHOLDER_EXPR]: Don't re-reduce a
2881 CONSTRUCTOR returned by lookup_placeholder.
2882
2883 2020-03-20 Patrick Palka <ppalka@redhat.com>
2884
2885 * cxx-pretty-print.c (pp_cxx_parameter_mapping): Make extern. Move
2886 the "[with ]" bits to here from ...
2887 (pp_cxx_atomic_constraint): ... here.
2888 * cxx-pretty-print.h (pp_cxx_parameter_mapping): Declare.
2889 * error.c (rebuild_concept_check): Delete.
2890 (print_concept_check_info): Print the dependent form of the constraint and the
2891 preferably substituted parameter mapping alongside it.
2892
2893 2020-03-19 Jason Merrill <jason@redhat.com>
2894
2895 PR c++/94175
2896 * cp-gimplify.c (simple_empty_class_p): Look through
2897 SIMPLE_TARGET_EXPR_P.
2898 (cp_gimplify_expr) [MODIFY_EXPR]: Likewise.
2899 [RETURN_EXPR]: Avoid producing 'return *retval;'.
2900 * call.c (build_call_a): Strip TARGET_EXPR from empty class arg.
2901 * cp-tree.h (SIMPLE_TARGET_EXPR_P): Check that TARGET_EXPR_INITIAL
2902 is non-null.
2903
2904 2020-03-19 Jakub Jelinek <jakub@redhat.com>
2905
2906 PR c++/93931
2907 * parser.c (cp_parser_omp_var_list_no_open): Call process_outer_var_ref
2908 on outer_automatic_var_p decls.
2909 * cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also for
2910 capture proxy decls.
2911
2912 2020-03-18 Nathan Sidwell <nathan@acm.org>
2913
2914 PR c++/94147 - mangling of lambdas assigned to globals
2915 * parser.c (cp_parser_init_declarator): Namespace-scope variables
2916 provide a lambda scope.
2917 * tree.c (no_linkage_check): Lambdas with a variable for extra
2918 scope have a linkage from the variable.
2919
2920 2020-03-18 Jakub Jelinek <jakub@redhat.com>
2921
2922 * constraint.cc (resolve_function_concept_check, subsumes_constraints,
2923 strictly_subsumes): Fix up duplicated word issue in a comment.
2924 * coroutines.cc (build_init_or_final_await, captures_temporary):
2925 Likewise.
2926 * logic.cc (dnf_size_r, cnf_size_r): Likewise.
2927 * pt.c (append_type_to_template_for_access_check): Likewise.
2928
2929 PR c++/91759
2930 * decl.c (grokfndecl): Restore old diagnostics about deduction
2931 guide declared in different scope if in_namespace is NULL_TREE.
2932
2933 2020-03-17 Jakub Jelinek <jakub@redhat.com>
2934
2935 PR c++/90995
2936 * parser.c (cp_parser_enum_specifier): Use temp_override for
2937 parser->colon_corrects_to_scope_p, replace goto out with return.
2938 If scoped enum or enum with underlying type is not followed by
2939 { or ;, call cp_parser_commit_to_tentative_parse before calling
2940 cp_parser_error and make sure to return error_mark_node instead of
2941 NULL_TREE. Formatting fixes.
2942
2943 2020-03-17 Ville Voutilainen <ville.voutilainen@gmail.com>
2944
2945 PR c++/94197
2946 * method.c (assignable_expr): Use cp_unevaluated.
2947 (is_xible_helper): Push a non-deferred access check for
2948 the stub objects created by assignable_expr and constructible_expr.
2949
2950 2020-03-17 Jakub Jelinek <jakub@redhat.com>
2951
2952 * pt.c (tsubst): Fix up duplicated word issue in a diagnostic message.
2953 (lookup_template_class_1, tsubst_expr): Fix up duplicated word issue
2954 in a comment.
2955 * parser.c (cp_parser_statement, cp_parser_linkage_specification,
2956 cp_parser_placeholder_type_specifier,
2957 cp_parser_constraint_requires_parens): Likewise.
2958 * name-lookup.c (suggest_alternative_in_explicit_scope): Likewise.
2959
2960 2020-03-15 Iain Sandoe <iain@sandoe.co.uk>
2961
2962 * coroutines.cc (co_await_expander): Fix indentation.
2963
2964 2020-03-14 Jason Merrill <jason@redhat.com>
2965
2966 PR c++/92068
2967 * pt.c (process_partial_specialization): Error rather than crash on
2968 extra pack expansion.
2969
2970 2020-03-14 Jason Merrill <jason@redhat.com>
2971
2972 PR c++/92909
2973 * pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
2974 DECL_ORIGINAL_TYPE of a typedef.
2975
2976 2020-03-14 Jason Merrill <jason@redhat.com>
2977
2978 PR c++/93248
2979 * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
2980 substituting DECL_ARGUMENTS.
2981
2982 2020-03-14 Jakub Jelinek <jakub@redhat.com>
2983
2984 * logic.cc (formula::formula): Change "a an" to "an" in a comment.
2985 * parser.c (cp_debug_parser): Change "a an" to "an" in a string
2986 literal.
2987
2988 2020-03-13 Patrick Palka <ppalka@redhat.com>
2989
2990 PR c++/67960
2991 * call.c (build_over_call): Use a warning_sentinel to disable
2992 warn_deprecated_decl before calling build_addr_func.
2993
2994 2020-03-12 Jakub Jelinek <jakub@redhat.com>
2995
2996 PR c++/94124
2997 * decl.c (reshape_init_array_1): Don't unshare constructor if there
2998 aren't any trailing zero elts, otherwise only unshare the first
2999 nelts.
3000
3001 2020-03-11 Jason Merrill <jason@redhat.com>
3002
3003 PR c++/93907
3004 * constraint.cc (tsubst_parameter_mapping): Canonicalize type
3005 argument.
3006
3007 2020-03-11 Marek Polacek <polacek@redhat.com>
3008 Jason Merrill <jason@redhat.com>
3009
3010 PR c++/94074 - wrong modifying const object error for COMPONENT_REF.
3011 * constexpr.c (cref_has_const_field): New function.
3012 (modifying_const_object_p): Consider a COMPONENT_REF
3013 const only if any of its fields are const.
3014 (cxx_eval_store_expression): Mark a CONSTRUCTOR of a const type
3015 as readonly after its initialization has been done.
3016
3017 2020-03-10 Marek Polacek <polacek@redhat.com>
3018
3019 PR c++/94124 - wrong conversion error with non-viable overload.
3020 * decl.c (reshape_init_array_1): Unshare a constructor if we
3021 stripped trailing zero-initializers.
3022
3023 2020-03-10 Jason Merrill <jason@redhat.com>
3024
3025 PR c++/93901
3026 * pt.c (maybe_instantiate_noexcept): Always update clones.
3027
3028 2020-03-10 Jason Merrill <jason@redhat.com>
3029
3030 PR c++/93596
3031 * pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
3032
3033 2020-03-10 Jason Merrill <jason@redhat.com>
3034
3035 PR c++/93922
3036 PR c++/94041
3037 PR c++/52320
3038 PR c++/66139
3039 * cp-gimplify.c (cp_gimplify_init_expr): Partially revert patch for
3040 66139: Don't split_nonconstant_init. Remove pre_p parameter.
3041
3042 2020-03-09 Marek Polacek <polacek@redhat.com>
3043
3044 PR c++/92031 - bogus taking address of rvalue error.
3045 PR c++/91465 - ICE with template codes in check_narrowing.
3046 PR c++/93870 - wrong error when converting template non-type arg.
3047 PR c++/94068 - ICE with template codes in check_narrowing.
3048 * call.c (convert_like_real): Return IMPLICIT_CONV_EXPR
3049 in a template when not ck_identity and we're dealing with a class.
3050 (convert_like_real) <case ck_ref_bind>: Return IMPLICIT_CONV_EXPR
3051 in a template if we need a temporary.
3052 * decl.c (compute_array_index_type_loc): Remove
3053 instantiate_non_dependent_expr_sfinae call. Call
3054 fold_non_dependent_expr instead of maybe_constant_value.
3055 (build_explicit_specifier): Don't instantiate or create a sentinel
3056 before converting the expression.
3057 * except.c (build_noexcept_spec): Likewise.
3058 * pt.c (convert_nontype_argument): Don't build IMPLICIT_CONV_EXPR.
3059 Set IMPLICIT_CONV_EXPR_NONTYPE_ARG if that's what
3060 build_converted_constant_expr returned.
3061 * typeck2.c (check_narrowing): Call fold_non_dependent_expr instead
3062 of maybe_constant_value.
3063
3064 2020-03-09 Jakub Jelinek <jakub@redhat.com>
3065
3066 PR c++/94067
3067 Revert
3068 2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
3069
3070 * constexpr.c (cxx_eval_constant_expression): Do not handle
3071 RROTATE_EXPR and LROTATE_EXPR.
3072
3073 2020-03-09 Marek Polacek <polacek@redhat.com>
3074
3075 PR c++/94050 - ABI issue with alignas on armv7hl.
3076 * class.c (layout_class_type): Don't replace a class's
3077 CLASSTYPE_AS_BASE if their TYPE_USER_ALIGN don't match.
3078
3079 2020-03-09 Bin Cheng <bin.cheng@linux.alibaba.com>
3080
3081 * coroutines.cc (build_actor_fn): Factor out code inserting the
3082 default return_void call to...
3083 (morph_fn_to_coro): ...here, also hoist local var declarations.
3084
3085 2020-03-08 Patrick Palka <ppalka@redhat.com>
3086
3087 PR c++/93729
3088 * call.c (convert_like_real): Check complain before emitting an error
3089 about binding a bit-field to a reference.
3090
3091 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
3092 [TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
3093 TYPE_NAME.
3094
3095 2020-03-06 Nathan Sidwell <nathan@acm.org>
3096
3097 PR c++/94027
3098 * mangle.c (find_substitution): Don't call same_type_p on template
3099 args that cannot match.
3100
3101 2020-03-04 Martin Sebor <msebor@redhat.com>
3102
3103 PR c++/90938
3104 * tree.c (type_initializer_zero_p): Fail for structs initialized
3105 with non-structs.
3106
3107 2020-03-04 Jason Merrill <jason@redhat.com>
3108
3109 PR c++/90432
3110 * init.c (perform_member_init): Don't do aggregate initialization of
3111 empty field.
3112 * constexpr.c (cx_check_missing_mem_inits): Don't enforce
3113 initialization of empty field.
3114
3115 2020-03-04 Martin Liska <mliska@suse.cz>
3116
3117 * method.c: Wrap array in ctor with braces in order
3118 to silent clang warnings.
3119
3120 2020-03-03 Jason Merrill <jason@redhat.com>
3121 Marek Polacek <polacek@redhat.com>
3122
3123 PR c++/90505 - mismatch in template argument deduction.
3124 * pt.c (tsubst): Don't reduce the template level of template
3125 parameters when tf_partial.
3126
3127 2020-03-03 Jakub Jelinek <jakub@redhat.com>
3128
3129 PR c++/93998
3130 * constexpr.c (cxx_eval_constant_expression)
3131 <case TARGET_EXPR, case SAVE_EXPR>: Don't record anything if
3132 *non_constant_p is true.
3133
3134 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
3135
3136 * coroutines.cc (captures_temporary): Strip component_ref
3137 to its base object.
3138
3139 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
3140
3141 * coroutines.cc (finish_co_await_expr): Build co_await_expr
3142 with unknown_type_node.
3143 (finish_co_yield_expr): Ditto.
3144 *pt.c (type_dependent_expression_p): Set co_await/yield_expr
3145 with unknown type as dependent.
3146
3147 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
3148
3149 * coroutines.cc (struct local_var_info): Adjust to remove the
3150 reference to the captured var, and just to note that this is a
3151 lambda capture proxy.
3152 (transform_local_var_uses): Handle lambda captures specially.
3153 (struct param_frame_data): Add a visited set.
3154 (register_param_uses): Also check for param uses in lambda
3155 capture proxies.
3156 (struct local_vars_frame_data): Remove captures list.
3157 (register_local_var_uses): Handle lambda capture proxies by
3158 noting and bypassing them.
3159 (morph_fn_to_coro): Update to remove lifetime extension of
3160 lambda capture-by-copy vars.
3161
3162 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
3163
3164 * coroutines.cc (build_co_await): Do not build frame
3165 awaitable proxy vars when the co_await expression is
3166 a function parameter or local var.
3167 (co_await_expander): Do not initialise a frame var with
3168 itself.
3169 (transform_await_expr): Only substitute the awaitable
3170 frame var if it's needed.
3171 (register_awaits): Do not make frame copies for param
3172 or local vars that are awaitables.
3173
3174 2020-02-28 Jason Merrill <jason@redhat.com>
3175
3176 Implement P2092R0, Disambiguating Nested-Requirements
3177 * parser.c (cp_parser_requirement_parameter_list): Pass
3178 CP_PARSER_FLAGS_TYPENAME_OPTIONAL.
3179
3180 * call.c (build_user_type_conversion_1): Don't look at the second
3181 conversion of a non-viable candidate.
3182
3183 2020-02-28 Jakub Jelinek <jakub@redhat.com>
3184
3185 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
3186 * typeck.c (cp_build_addr_expr_1): Allow taking address of immediate
3187 functions in unevaluated contexts.
3188
3189 2020-02-27 Nathan Sidwell <nathan@acm.org>
3190
3191 PR c++/93933
3192 * pt.c (template_args_equal): Pass ARGUMENT_PACKS through to
3193 cp_tree_equal.
3194 * tree.c (cp_tree_equal): Compare ARGUMENT_PACKS here,
3195 * typeck.c (comptypes): Assert we don't get any argument packs.
3196
3197 * class.c (adjust_clone_args): Correct arg-checking assert.
3198 * typeck.c (comptypes): Assert not nulls.
3199
3200 2020-02-26 Marek Polacek <polacek@redhat.com>
3201
3202 PR c++/93789 - ICE with invalid array bounds.
3203 * decl.c (compute_array_index_type_loc): Don't use the folded
3204 size when folding cleared TREE_CONSTANT.
3205
3206 2020-02-26 Iain Sandoe <iain@sandoe.co.uk>
3207
3208 * class.c (classtype_has_non_deleted_copy_ctor): New.
3209 * coroutines.cc (struct param_info): Keep track of params
3210 that are references, and cache the original type and whether
3211 the DTOR is trivial.
3212 (build_actor_fn): Handle param copies always, and adjust the
3213 handling for references.
3214 (register_param_uses): Only handle uses here.
3215 (classtype_has_non_deleted_copy_ctor): New.
3216 (morph_fn_to_coro): Adjust param copy handling to match n4849
3217 by reordering ahead of the promise CTOR and always making a
3218 frame copy, even if the param is unused in the coroutine body.
3219 * cp-tree.h (classtype_has_non_deleted_copy_ctor): New.
3220
3221 2020-02-26 Patrick Palka <ppalka@redhat.com>
3222
3223 * constraint.cc (finish_constraint_binary_op): Set expr's location range
3224 to the range of its operands.
3225 (satisfy_atom): Pass MAP instead of ARGS to diagnose_atomic_constraint.
3226 (diagnose_trait_expr): Take the instantiated parameter mapping MAP
3227 instead of the corresponding template arguments ARGS and adjust body
3228 accordingly.
3229 (diagnose_requires_expr): Likewise.
3230 (diagnose_atomic_constraint): Likewise. When printing an atomic
3231 constraint expression, print the instantiated parameter mapping
3232 alongside it.
3233 * cxx-pretty-print.cc (cxx_pretty_printer::expression)
3234 [NONTYPE_ARGUMENT_PACK]: Print braces around a NONTYPE_ARGUMENT_PACK.
3235 (cxx_pretty_printer::type_id): Handle TYPE_ARGUMENT_PACK.
3236
3237 2020-02-26 Marek Polacek <polacek@redhat.com>
3238
3239 PR c++/93676 - value-init crash in template.
3240 * init.c (build_new_1): Don't call build_vec_init in a template.
3241
3242 2020-02-26 Marek Polacek <polacek@redhat.com>
3243
3244 PR c++/93862 - ICE with static_cast when converting from int[].
3245 * call.c (reference_compatible_p): No longer static.
3246 * cp-tree.h (reference_compatible_p): Declare.
3247 * typeck.c (build_static_cast_1): Use reference_compatible_p instead
3248 of reference_related_p.
3249
3250 2020-02-26 Marek Polacek <polacek@redhat.com>
3251
3252 PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
3253 * constexpr.c (reduced_constant_expression_p): Don't crash on a null
3254 field.
3255
3256 2020-02-24 Martin Sebor <msebor@redhat.com>
3257
3258 PR c++/93804
3259 * parser.c (cp_parser_check_class_key): Avoid issuing -Wredundant-tags
3260 in shared C/C++ code in headers.
3261 Remove a duplicate hunk of code.
3262
3263 2020-02-24 Marek Polacek <polacek@redhat.com>
3264
3265 PR c++/93869 - ICE with -Wmismatched-tags.
3266 * parser.c (cp_parser_check_class_key): Check class_key earlier.
3267
3268 2020-02-24 Marek Polacek <polacek@redhat.com>
3269
3270 PR c++/93712 - ICE with ill-formed array list-initialization.
3271 * call.c (next_conversion): Return NULL for ck_aggr.
3272 (build_aggr_conv): Set u.expr instead of u.next.
3273 (build_array_conv): Likewise.
3274 (build_complex_conv): Likewise.
3275 (conv_get_original_expr): Handle ck_aggr.
3276
3277 2020-02-24 Jakub Jelinek <jakub@redhat.com>
3278
3279 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
3280 * call.c (build_over_call): Don't evaluate immediate functions in
3281 unevaluated operands.
3282
3283 2020-02-24 Jason Merrill <jason@redhat.com>
3284
3285 P0780R2: Resolve lambda init-capture pack grammar.
3286 * parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than
3287 ...&x=y.
3288
3289 2020-02-22 Marek Polacek <polacek@redhat.com>
3290
3291 PR c++/93882
3292 * decl.c (grokdeclarator): Use %qs in a diagnostic message.
3293
3294 2020-02-21 Martin Sebor <msebor@redhat.com>
3295
3296 PR gcov-profile/93753
3297 * class.c (check_flexarrays): Tighten up a test for potential members
3298 of anonymous structs or unions.
3299
3300 2020-02-20 Martin Sebor <msebor@redhat.com>
3301
3302 PR c++/93801
3303 * parser.c (cp_parser_check_class_key): Only handle true C++ class-keys.
3304
3305 2020-02-20 Martin Liska <mliska@suse.cz>
3306
3307 PR translation/93841
3308 * config/or1k/or1k.opt: Remove superfluous word.
3309 * doc/invoke.texi: Likewise.
3310
3311 2020-02-20 Martin Liska <mliska@suse.cz>
3312
3313 PR translation/93838
3314 * parser.c (cp_parser_decl_specifier_seq): Remove trailing space.
3315
3316 2020-02-19 Marek Polacek <polacek@redhat.com>
3317
3318 PR c++/93169 - wrong-code with a non-constexpr constructor.
3319 * constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY
3320 on constant CONSTRUCTORs.
3321
3322 2020-02-15 Marek Polacek <polacek@redhat.com>
3323
3324 PR c++/93710 - poor diagnostic for array initializer.
3325 * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
3326 for an error call.
3327
3328 2020-02-15 Jason Merrill <jason@redhat.com>
3329
3330 PR c++/92556
3331 * pt.c (any_template_parm_r): Look into lambda body.
3332
3333 PR c++/92583
3334 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
3335
3336 2020-02-14 Jakub Jelinek <jakub@redhat.com>
3337
3338 PR c++/61414
3339 * class.c (enum_min_precision): Change prec type from int to int &.
3340
3341 PR libstdc++/92906
3342 * cp-tree.h (enum cp_tree_index): Add CPTI_FALLBACK_DFLOAT32_TYPE,
3343 CPTI_FALLBACK_DFLOAT64_TYPE and CPTI_FALLBACK_DFLOAT128_TYPE.
3344 (fallback_dfloat32_type, fallback_dfloat64_type,
3345 fallback_dfloat128_type): Define.
3346 * mangle.c (write_builtin_type): Handle fallback_dfloat*_type like
3347 dfloat*_type_node.
3348 * rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
3349 is disabled for compatibility.
3350
3351 2020-02-13 Jason Merrill <jason@redhat.com>
3352
3353 PR c++/93713
3354 * name-lookup.c (matching_fn_p): A function does not match a
3355 template.
3356
3357 PR c++/93643
3358 PR c++/91476
3359 * tree.c (decl_linkage): Always lk_none for locals.
3360
3361 2020-02-12 Jason Merrill <jason@redhat.com>
3362
3363 PR c++/92583
3364 PR c++/92654
3365 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
3366 * pt.c (find_parameter_packs_r): Not here.
3367
3368 2020-02-12 Iain Sandoe <iain@sandoe.co.uk>
3369
3370 * coroutines.cc (build_actor_fn): Implement deallocation function
3371 selection per n4849, dcl.fct.def.coroutine bullet 12.
3372 (morph_fn_to_coro): Implement allocation function selection per
3373 n4849, dcl.fct.def.coroutine bullets 9 and 10.
3374
3375 2020-02-12 Marek Polacek <polacek@redhat.com>
3376
3377 PR c++/93684 - ICE-on-invalid with broken attribute.
3378 * parser.c (cp_parser_std_attribute): Peek a token first before
3379 consuming it.
3380
3381 2020-02-11 Jason Merrill <jason@redhat.com>
3382
3383 PR c++/93675
3384 * class.c (add_implicitly_declared_members): Use do_friend.
3385 * method.c (implicitly_declare_fn): Fix friend handling.
3386 (decl_remember_implicit_trigger_p): New.
3387 (synthesize_method): Use it.
3388 * decl2.c (mark_used): Use it.
3389
3390 2020-02-11 Jason Merrill <jason@redhat.com>
3391
3392 PR c++/93650
3393 PR c++/90691
3394 * constexpr.c (maybe_constant_value): Correct earlier change.
3395 (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
3396 * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.
3397
3398 2020-02-12 Patrick Palka <ppalka@redhat.com>
3399
3400 PR c++/69448
3401 PR c++/80471
3402 * type-utils.h (find_type_usage): Refactor to take a tree * and to
3403 return a tree *, and update documentation accordingly.
3404 * pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
3405 decltype(auto) node.
3406 (make_constrained_decltype_auto): No need to explicitly set
3407 AUTO_IS_DECLTYPE anymore.
3408 (splice_late_return_type): Use find_type_usage to find and
3409 replace a possibly nested auto node instead of using is_auto.
3410 Check test for is_auto into an assert when deciding whether
3411 to late_return_type.
3412 (type_uses_auto): Adjust the call to find_type_usage.
3413 * parser.c (cp_parser_decltype): No need to explicitly set
3414 AUTO_IS_DECLTYPE anymore.
3415
3416 * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
3417 (dump_simple_decl): Handle standard concept definitions as well as
3418 variable concept definitions.
3419
3420 2020-02-10 Jakub Jelinek <jakub@redhat.com>
3421
3422 PR other/93641
3423 * error.c (dump_decl_name): Fix up last argument to strncmp.
3424
3425 2020-02-10 Jason Merrill <jason@redhat.com>
3426
3427 PR c++/93618
3428 * tree.c (array_of_unknown_bound_p): New.
3429 * init.c (perform_member_init): Do nothing for flexible arrays.
3430
3431 2020-02-09 Jakub Jelinek <jakub@redhat.com>
3432
3433 PR c++/93633
3434 * constexpr.c (cxx_eval_constant_expression): If obj is heap var with
3435 ARRAY_TYPE, use the element type. Punt if objtype after that is not
3436 a class type.
3437
3438 2020-02-08 Jason Merrill <jason@redhat.com>
3439
3440 PR c++/90691
3441 * expr.c (fold_for_warn): Call maybe_constant_value.
3442 * constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
3443 (maybe_constant_value): Add uid_sensitive parm.
3444 (get_fundef_copy): Don't copy if it's true.
3445 (cxx_eval_call_expression): Don't instantiate if it's true.
3446 (cxx_eval_outermost_constant_expr): Likewise.
3447
3448 PR c++/92852
3449 * constexpr.c (maybe_constant_value): Don't unshare if the cached
3450 value is the same as the argument.
3451
3452 * typeck.c (maybe_warn_about_returning_address_of_local): Add
3453 location parameter.
3454
3455 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
3456 if appropriate.
3457
3458 2020-02-08 Jakub Jelinek <jakub@redhat.com>
3459
3460 PR c++/93549
3461 * constexpr.c (find_array_ctor_elt): If last element has no index,
3462 for flag_checking verify all elts have no index. If i is within the
3463 elts, return it directly, if it is right after the last elt, append
3464 if NULL index, otherwise force indexes on all elts.
3465 (cxx_eval_store_expression): Allow cep->index to be NULL.
3466
3467 2020-02-07 Marek Polacek <polacek@redhat.com>
3468
3469 PR c++/92947 - Paren init of aggregates in unevaluated context.
3470 * call.c (build_new_method_call_1): Don't check
3471 cp_unevaluated_operand. Check the return value of digest_init.
3472
3473 2020-02-06 Jason Merrill <jason@redhat.com>
3474
3475 PR c++/92654
3476 * tree.c (cp_walk_subtrees): Walk into type template arguments.
3477 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
3478 instead of TYPE_ALIAS_P.
3479 * pt.c (push_template_decl_real): Likewise.
3480 (find_parameter_packs_r): Likewise. Remove dead code.
3481 * error.c (find_typenames_r): Remove dead code.
3482
3483 2020-02-06 Jason Merrill <jason@redhat.com>
3484
3485 PR c++/92517
3486 * parser.c (cp_parser_constraint_primary_expression): Do the main
3487 parse non-tentatively.
3488
3489 2020-02-06 Marek Polacek <polacek@redhat.com>
3490
3491 PR c++/93597 - ICE with lambda in operator function.
3492 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
3493
3494 2020-02-05 Jason Merrill <jason@redhat.com>
3495
3496 PR c++/93140
3497 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
3498 handling of TREE_CHAIN for empty pack.
3499
3500 2020-02-05 Jakub Jelinek <jakub@redhat.com>
3501
3502 PR c++/93557
3503 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
3504 prior to passing it to c_build_vec_convert.
3505
3506 2020-02-05 Marek Polacek <polacek@redhat.com>
3507
3508 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
3509 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
3510 TREE_SIDE_EFFECTS.
3511
3512 2020-02-05 Jason Merrill <jason@redhat.com>
3513
3514 PR c++/92593
3515 * decl.c (grokdeclarator): Reject field of current class type even
3516 in a template.
3517
3518 2020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
3519
3520 * coroutines.cc (maybe_promote_captured_temps): Increase the index
3521 number for temporary variables' name.
3522
3523 2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
3524
3525 * coroutines.cc (build_co_await): Call convert_from_reference
3526 to wrap co_await_expr with indirect_ref which avoid
3527 reference/non-reference type confusion.
3528
3529 (co_await_expander): Sink to call_expr if await_resume
3530 is wrapped by indirect_ref.
3531
3532 2020-02-04 Jason Merrill <jason@redhat.com>
3533
3534 PR c++/93551
3535 * constraint.cc (satisfy_declaration_constraints): Check return
3536 value of push_tinst_level.
3537
3538 PR c++/90951
3539 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
3540 elements instead of value-initializing them.
3541
3542 PR c++/86917
3543 * init.c (perform_member_init): Simplify.
3544 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
3545 flexarray.
3546 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
3547
3548 2020-02-04 Iain Sandoe <iain@sandoe.co.uk>
3549
3550 * coroutines.cc (find_promise_type): Delete unused forward
3551 declaration.
3552 (struct coroutine_info): Add a bool for no promise type error.
3553 (coro_promise_type_found_p): Only emit the error for a missing
3554 promise once in each affected coroutine.
3555
3556 2020-02-03 Jason Merrill <jason@redhat.com>
3557
3558 PR c++/66477
3559 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
3560 defer loading the value of a reference.
3561
3562 2020-02-03 Jason Merrill <jason@redhat.com>
3563
3564 PR c++/91953
3565 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
3566 empty class type.
3567 [COMPONENT_REF]: A member function reference doesn't use the object
3568 as an rvalue.
3569
3570 2020-02-03 Iain Sandoe <iain@sandoe.co.uk>
3571
3572 PR c++/93458
3573 * coroutines.cc (struct coroutine_info): Add a bool flag to note
3574 that we emitted an error for a bad function return type.
3575 (get_coroutine_info): Tolerate an unset info table in case of
3576 missing traits.
3577 (find_coro_traits_template_decl): In case of error or if we didn't
3578 find a type template, note we emitted the error and suppress
3579 duplicates.
3580 (find_coro_handle_template_decl): Likewise.
3581 (instantiate_coro_traits): Only check for error_mark_node in the
3582 return from lookup_qualified_name.
3583 (coro_promise_type_found_p): Reorder initialization so that we check
3584 for the traits and their usability before allocation of the info
3585 table. Check for a suitable return type and emit a diagnostic for
3586 here instead of relying on the lookup machinery. This allows the
3587 error to have a better location, and means we can suppress multiple
3588 copies.
3589 (coro_function_valid_p): Re-check for a valid promise (and thus the
3590 traits) before proceeding. Tolerate missing info as a fatal error.
3591
3592 2020-02-03 Jason Merrill <jason@redhat.com>
3593
3594 PR c++/88256
3595 * cp-gimplify.c (predeclare_vla): New.
3596 (cp_genericize_r) [NOP_EXPR]: Call it.
3597
3598 2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
3599
3600 * coroutines.cc (transform_await_wrapper): Set actor funcion as
3601 new context of label_decl.
3602 (build_actor_fn): Fill new field of await_xform_data.
3603
3604 2020-02-02 Marek Polacek <polacek@redhat.com>
3605
3606 PR c++/93530 - ICE on invalid alignas in a template.
3607 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
3608 decl_attributes.
3609
3610 2020-01-31 Jason Merrill <jason@redhat.com>
3611
3612 PR c++/86216
3613 * semantics.c (process_outer_var_ref): Capture VLAs even in
3614 unevaluated context.
3615
3616 PR c++/14179
3617 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
3618 non-aggregate elements.
3619 (reshape_init_array): Add first_initializer_p parm.
3620 (reshape_init_r): Change first_initializer_p from bool to tree.
3621 (reshape_init): Pass init to it.
3622
3623 PR c++/14179
3624 * parser.c (cp_parser_initializer_list): Suppress location wrappers
3625 after 256 elements.
3626
3627 2020-01-29 Jason Merrill <jason@redhat.com>
3628
3629 PR c++/82521
3630 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
3631 the expression was dependent before substitution.
3632
3633 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
3634
3635 * coroutines.cc (act_des_fn): New.
3636 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
3637 Access promise via actor function's frame pointer argument.
3638 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
3639
3640 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
3641
3642 * coroutines.cc (co_await_expander): Handle type conversion case.
3643
3644 2020-01-29 Jason Merrill <jason@redhat.com>
3645
3646 PR c++/90333
3647 PR c++/89640
3648 PR c++/60503
3649 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
3650 a trailing return type.
3651 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
3652 parens.
3653
3654 2020-01-29 Marek Polacek <polacek@redhat.com>
3655
3656 PR c++/91754 - Fix template arguments comparison with class NTTP.
3657 * pt.c (class_nttp_const_wrapper_p): New.
3658 (template_args_equal): See through class_nttp_const_wrapper_p
3659 arguments.
3660
3661 2020-01-29 Marek Polacek <polacek@redhat.com>
3662
3663 PR c++/92948 - Fix class NTTP with template arguments.
3664 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
3665 converting a value-dependent expression to a class type.
3666 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
3667 as the result of the tsubst_copy call.
3668
3669 2020-01-29 Jakub Jelinek <jakub@redhat.com>
3670
3671 PR c++/91118
3672 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
3673 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
3674
3675 2020-01-28 Jason Merrill <jason@redhat.com>
3676
3677 PR c++/93442
3678 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
3679
3680 PR c++/93477
3681 PR c++/91476
3682 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
3683
3684 PR c++/90546
3685 * call.c (build_user_type_conversion_1): Allow a template conversion
3686 returning an rvalue reference to bind directly to an lvalue.
3687
3688 PR c++/90731
3689 * decl.c (grokdeclarator): Propagate eh spec from typedef.
3690
3691 2020-01-28 Martin Liska <mliska@suse.cz>
3692
3693 PR c++/92440
3694 * pt.c (redeclare_class_template): Group couple of
3695 errors and inform messages with auto_diagnostic_group.
3696
3697 2020-01-28 Martin Liska <mliska@suse.cz>
3698
3699 PR c++/92440
3700 * pt.c (redeclare_class_template): Use inform
3701 for the second location.
3702
3703 2020-01-27 Jason Merrill <jason@redhat.com>
3704
3705 PR c++/90966
3706 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
3707
3708 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
3709
3710 PR c++/93443
3711 * coroutines.cc (morph_fn_to_coro): Check the ramp return
3712 value when it is constructed from the 'get return object'.
3713
3714 2020-01-27 Nathan Sidwell <nathan@acm.org>
3715
3716 PR c++/91826
3717 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
3718
3719 2020-01-26 Jason Merrill <jason@redhat.com>
3720
3721 PR c++/90992
3722 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
3723 temporarily enable -Wsystem-headers. Change second warning to
3724 conditional inform.
3725
3726 PR c++/90997
3727 * semantics.c (finish_call_expr): Don't call
3728 instantiate_non_dependent_expr before warn_for_memset.
3729
3730 2020-01-25 Marek Polacek <polacek@redhat.com>
3731
3732 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
3733 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
3734 dynamic_cast diagnostic.
3735
3736 2020-01-24 Jason Merrill <jason@redhat.com>
3737
3738 PR c++/93400 - ICE with constrained friend.
3739 * constraint.cc (maybe_substitute_reqs_for): New.
3740 * decl.c (function_requirements_equivalent_p): Call it.
3741 * pt.c (tsubst_friend_function): Only substitute
3742 TEMPLATE_PARMS_CONSTRAINTS.
3743 (tsubst_template_parms): Copy constraints.
3744
3745 2020-01-24 Jason Merrill <jason@redhat.com>
3746
3747 PR c++/93279 - ICE with lambda in member operator.
3748 * name-lookup.c (maybe_save_operator_binding): Don't remember
3749 class-scope bindings.
3750
3751 2020-01-24 Jason Merrill <jason@redhat.com>
3752
3753 PR c++/93377 - ICE with member alias in constraint.
3754 * pt.c (any_template_parm_r): Look at template arguments for all
3755 aliases, not only alias templates.
3756
3757 2020-01-24 Marek Polacek <polacek@redhat.com>
3758
3759 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
3760 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
3761
3762 2020-01-24 Jason Merrill <jason@redhat.com>
3763
3764 PR c++/92852 - ICE with generic lambda and reference var.
3765 * constexpr.c (maybe_constant_value): Likewise.
3766
3767 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
3768
3769 PR c++/92804
3770 * parser.c (cp_parser_nested_name_specifier_opt): Properly
3771 diagnose concept-ids.
3772
3773 2020-01-23 Jason Merrill <jason@redhat.com>
3774
3775 PR c++/93331 - ICE with __builtin_strchr.
3776 * constexpr.c (cxx_eval_builtin_function_call): Use the original
3777 argument if we didn't manage to extract a STRING_CST.
3778
3779 PR c++/93345 - ICE with defaulted dtor and template.
3780 PR c++/33799
3781 * decl.c (cxx_maybe_build_cleanup): Don't try to set
3782 throwing_cleanup in a template.
3783
3784 2020-01-22 Marek Polacek <polacek@redhat.com>
3785
3786 PR c++/92907 - noexcept does not consider "const" in member functions.
3787 * g++.dg/cpp0x/noexcept56.C: New test.
3788
3789 2020-01-22 Marek Polacek <polacek@redhat.com>
3790
3791 PR c++/93324 - ICE with -Wall on constexpr if.
3792 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
3793
3794 2020-01-22 Patrick Palka <ppalka@redhat.com>
3795
3796 * constraint.cc (get_mapped_args): Avoid using auto_vec
3797 as a vector element. Release the vectors inside the lists
3798 vector.
3799 * parser.c (cp_literal_operator_id): Free the buffer.
3800
3801 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
3802
3803 * coroutines.cc (finish_co_await_expr): Add error check on return
3804 value of build_co_await.
3805 (finish_co_yield_expr,): Ditto.
3806
3807 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
3808
3809 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
3810 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
3811 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
3812
3813 2020-01-21 Jason Merrill <jason@redhat.com>
3814
3815 PR c++/60855 - ICE with sizeof VLA capture.
3816 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
3817
3818 PR c++/90732 - ICE with VLA capture and generic lambda.
3819 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
3820
3821 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
3822 Bin Cheng <bin.cheng@linux.alibaba.com>
3823
3824 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
3825 from complete_type_or_else.
3826 (register_param_uses): Likewise.
3827 (build_co_await): Do not try to use complete_type_or_else for void
3828 types, otherwise for incomplete types, check for NULL return from
3829 complete_type_or_else.
3830
3831 2020-01-21 Jason Merrill <jason@redhat.com>
3832
3833 PR c++/91476 - anon-namespace reference temp clash between TUs.
3834 * decl2.c (copy_linkage): Factor out of get_guard.
3835 * call.c (make_temporary_var_for_ref_to_temp): Use it.
3836 * decl.c (cp_finish_decomp): Use it.
3837 (cp_finish_decl): determine_visibility sooner.
3838
3839 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
3840
3841 * coroutines.cc (finish_co_await_expr): Set return value flag.
3842 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
3843
3844 2020-01-19 Jason Merrill <jason@redhat.com>
3845
3846 PR c++/33799 - destroy return value, take 2.
3847 * cp-tree.h (current_retval_sentinel): New macro.
3848 (struct language_function): Add throwing_cleanup bitfield.
3849 * decl.c (cxx_maybe_build_cleanup): Set it.
3850 * except.c (maybe_set_retval_sentinel)
3851 (maybe_splice_retval_cleanup): New functions.
3852 * parser.c (cp_parser_compound_statement): Call
3853 maybe_splice_retval_cleanup.
3854 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
3855
3856 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
3857
3858 2020-01-18 Jakub Jelinek <jakub@redhat.com>
3859
3860 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
3861 but non-NO_DOLLAR_IN_LABEL case build.
3862
3863 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
3864
3865 * Make-lang.in: Add coroutines.o.
3866 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
3867 (DECL_COROUTINE_P): New.
3868 * lex.c (init_reswords): Enable keywords when the coroutine flag
3869 is set,
3870 * operators.def (co_await): New operator.
3871 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
3872 (op_error): Likewise.
3873 (build_new_op_1): Likewise.
3874 (build_new_function_call): Validate coroutine builtin arguments.
3875 * constexpr.c (potential_constant_expression_1): Handle
3876 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
3877 * coroutines.cc: New file.
3878 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
3879 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
3880 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
3881 * cp-tree.h (coro_validate_builtin_call): New.
3882 * decl.c (emit_coro_helper): New.
3883 (finish_function): Handle the case when a function is found to
3884 be a coroutine, perform the outlining and emit the outlined
3885 functions. Set a bit to signal that this is a coroutine component.
3886 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
3887 (cp_parser_unary_expression): Handle co_await.
3888 (cp_parser_assignment_expression): Handle co_yield.
3889 (cp_parser_statement): Handle RID_CO_RETURN.
3890 (cp_parser_jump_statement): Handle co_return.
3891 (cp_parser_operator): Handle co_await operator.
3892 (cp_parser_yield_expression): New.
3893 (cp_parser_required_error): Handle RT_CO_YIELD.
3894 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
3895 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
3896 CO_RETURN_EXPRs.
3897 * tree.c (cp_walk_subtrees): Likewise.
3898
3899 2020-01-17 Jason Merrill <jason@redhat.com>
3900
3901 PR c++/92531 - ICE with noexcept(lambda).
3902 * pt.c (uses_template_parms): Don't try to enumerate all the
3903 expression cases.
3904
3905 2020-01-17 Jakub Jelinek <jakub@redhat.com>
3906
3907 PR c++/93228
3908 * parser.c (cp_parser_template_name): Look up deprecated attribute
3909 in DECL_TEMPLATE_RESULT or its type's attributes.
3910
3911 2020-01-16 Jason Merrill <jason@redhat.com>
3912
3913 PR c++/93286 - ICE with __is_constructible and variadic template.
3914 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
3915 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
3916
3917 PR c++/93280 - ICE with aggregate assignment and DMI.
3918 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
3919 * typeck2.c (digest_nsdmi_init): Not here.
3920
3921 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
3922
3923 PR c++/91073
3924 * cp-tree.h (is_constrained_auto): New.
3925 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
3926 handle concept-check expressions; take a cp_decl_specifier_seq*
3927 instead of a bool.
3928 (cp_parser_condition): Update call.
3929 (cp_parser_simple_declaration): Likewise.
3930 (cp_parser_placeholder_type_specifier): Correctly handle
3931 concept-check expressions.
3932
3933 2020-01-15 Jason Merrill <jason@redhat.com>
3934
3935 Revert
3936 PR c++/33799 - destroy return value if local cleanup throws.
3937 * cp-tree.h (current_retval_sentinel): New macro.
3938 * decl.c (start_preparsed_function): Set up cleanup for retval.
3939 * typeck.c (check_return_expr): Set current_retval_sentinel.
3940
3941 PR c++/93257 - consteval void function.
3942 * constexpr.c (verify_constant): Allow void_node.
3943
3944 PR c++/92871 - bad code with xvalue and GNU ?: extension.
3945 * call.c (prevent_lifetime_extension): New.
3946 (build_conditional_expr_1): Use it.
3947
3948 2020-01-14 Nathan Sidwell <nathan@acm.org>
3949
3950 PR c++/90916
3951 * pt.c (retrieve_specialization): Use get_template_info, not open
3952 coding access.
3953
3954 PR c++/90916
3955 * pt.c (retrieve_specialization): Get the TI from the decl or the
3956 classtype as appropriate.
3957
3958 2020-01-14 David Malcolm <dmalcolm@redhat.com>
3959
3960 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
3961 New static constant.
3962 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
3963 (struct named_label_hash::empty_zero_p): Likewise.
3964 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
3965
3966 2020-01-14 Jason Merrill <jason@redhat.com>
3967
3968 PR c++/92590 - wrong handling of inherited default ctor.
3969 * class.c (add_method): A constrained inherited ctor doesn't hide an
3970 implicit derived ctor.
3971 Revert:
3972 PR c++/92552 - ICE with inherited constrained default ctor.
3973 * pt.c (instantiate_class_template_1): Copy
3974 TYPE_HAS_USER_CONSTRUCTOR.
3975 PR c++/91930 - ICE with constrained inherited default ctor.
3976 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
3977 for inherited constructor.
3978 PR c++/92594 - ICE with inherited trivial default ctor.
3979 * method.c (trivial_fn_p): Treat an inherited default constructor
3980 like a normal default constructor.
3981
3982 PR c++/92594 - ICE with inherited trivial default ctor.
3983 * method.c (trivial_fn_p): Treat an inherited default constructor
3984 like a normal default constructor.
3985
3986 PR c++/92009 - ICE with punning of typeid.
3987 * rtti.c (get_tinfo_desc): Call xref_basetypes.
3988 * constexpr.c (cxx_fold_indirect_ref): Don't strip
3989 REINTERPRET_CAST_P.
3990
3991 2020-01-13 Jason Merrill <jason@redhat.com>
3992
3993 PR c++/92746 - ICE with noexcept of function concept check.
3994 * except.c (check_noexcept_r): Handle concept-check.
3995
3996 PR c++/92582 - ICE with member template as requirement.
3997 * pt.c (struct find_template_parameter_info): Add ctx_parms.
3998 (any_template_parm_r): Handle TEMPLATE_DECL.
3999 (find_template_parameters): Take parms instead of their depth.
4000 * constraint.cc (build_parameter_mapping): Pass them.
4001
4002 PR c++/33799 - destroy return value if local cleanup throws.
4003 * cp-tree.h (current_retval_sentinel): New macro.
4004 * decl.c (start_preparsed_function): Set up cleanup for retval.
4005 * typeck.c (check_return_expr): Set current_retval_sentinel.
4006
4007 PR c++/93238 - short right-shift with enum.
4008 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
4009
4010 2020-01-10 Jason Merrill <jason@redhat.com>
4011
4012 * typeck.c (cp_build_binary_op): Restore short_shift code.
4013
4014 PR c++/93143 - incorrect tree sharing with constexpr.
4015 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
4016 CONSTRUCTORs are already unshared.
4017
4018 PR c++/93173 - incorrect tree sharing.
4019 PR c++/93033
4020 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
4021 copy_if_shared after cp_genericize_tree.
4022 * typeck2.c (split_nonconstant_init): Don't unshare here.
4023
4024 2020-01-08 Jason Merrill <jason@redhat.com>
4025
4026 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
4027 TARGET_EXPR_DIRECT_INIT_P.
4028 * constexpr.c (cxx_eval_constant_expression): Likewise.
4029
4030 2020-01-08 Jason Merrill <jason@redhat.com>
4031
4032 PR c++/91369 - constexpr destructor and member initializer.
4033 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
4034 when not preevaluating.
4035
4036 2020-01-08 Jason Merrill <jason@redhat.com>
4037
4038 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
4039 support.
4040
4041 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
4042
4043 * init.c (build_new): Add location_t parameter and use it throughout.
4044 (build_raw_new_expr): Likewise.
4045 * parser.c (cp_parser_new_expression): Pass the combined_loc.
4046 * pt.c (tsubst_copy_and_build): Adjust call.
4047 * cp-tree.h: Update declarations.
4048
4049 2020-01-07 Jason Merrill <jason@redhat.com>
4050
4051 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
4052 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
4053 explicit class visibility for a template.
4054
4055 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
4056
4057 * mangle.c (mangle_type_attribute_p): New function, split out from...
4058 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
4059 that contain a space.
4060
4061 2020-01-07 Jakub Jelinek <jakub@redhat.com>
4062
4063 PR c++/91369
4064 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
4065 member, initialize it to zero in ctor.
4066 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
4067 a heap object. Don't cache calls to functions which allocate some
4068 heap objects and don't deallocate them or deallocate some heap
4069 objects they didn't allocate.
4070
4071 2020-01-06 Jason Merrill <jason@redhat.com>
4072
4073 PR c++/92552 - ICE with inherited constrained default ctor.
4074 * pt.c (instantiate_class_template_1): Copy
4075 TYPE_HAS_USER_CONSTRUCTOR.
4076 * class.c (one_inherited_ctor): Don't set it here.
4077
4078 2020-01-06 Andrew Sutton <asutton@lock3software.com>
4079
4080 PR c++/92739 - parsing requires clause with attributes.
4081 * parser.c (cp_parser_constraint_requires_parens): Exclude
4082 attributes as postfix expressions.
4083
4084 2020-01-05 Jakub Jelinek <jakub@redhat.com>
4085
4086 PR c++/93138
4087 * parser.c (cp_parser_check_class_key): Disable access checks for the
4088 simple name lookup.
4089 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
4090 !warn_redundant_tags.
4091
4092 2010-01-05 Jakub Jelinek <jakub@redhat.com>
4093
4094 PR c++/93046
4095 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
4096 TARGET_EXPR if it has been gimplified already.
4097
4098 2020-01-03 Jason Merrill <jason@redhat.com>
4099
4100 PR c++/93033 - incorrect tree node sharing with array init.
4101 * typeck2.c (split_nonconstant_init): Unshare non-decl.
4102 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
4103
4104 2020-01-02 Jason Merrill <jason@redhat.com>
4105
4106 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
4107 C++17.
4108
4109 2020-01-02 Jakub Jelinek <jakub@redhat.com>
4110
4111 PR c/90677
4112 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
4113 has not been found, rather than error_mark_node.
4114
4115 2020-01-01 Jakub Jelinek <jakub@redhat.com>
4116
4117 Update copyright years.
4118 \f
4119 Copyright (C) 2020 Free Software Foundation, Inc.
4120
4121 Copying and distribution of this file, with or without modification,
4122 are permitted in any medium without royalty provided the copyright
4123 notice and this notice are preserved.