1 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
4 * coroutines.cc (expand_one_await_expression): If the
5 await_ready() expression is not a boolean then convert it
8 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
11 * coroutines.cc (build_actor_fn): Make destroy index 1
12 correspond to the abnormal unhandled_exception() exit.
13 Substitute the proxy for the resume index.
14 (coro_rewrite_function_body): Arrange to reset the resume
15 index and make done = true for a rethrown exception from
16 unhandled_exception ().
17 (morph_fn_to_coro): Adjust calls to build_actor_fn and
18 coro_rewrite_function_body.
20 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
23 * coroutines.cc (replace_continue): Rewrite continue into
25 (await_statement_walker): Handle await expressions in the
26 initializer, condition and iteration expressions of for
29 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
32 * coroutines.cc (flatten_await_stmt): Allow for the case
33 where a target expression variable only has uses in the
34 second part of a compound expression.
35 (maybe_promote_temps): Avoid emiting empty statements.
37 2021-03-15 Tobias Burnus <tobias@codesourcery.com>
40 * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
41 ensure that the varpool node is marked as offloadable.
43 2021-03-12 Nathan Sidwell <nathan@acm.org>
46 * module.cc (depset::hash::add_binding_entity): Assert not
48 (depset::add::add_specializations): Likewise.
49 * name-lookup.c (name_lookup::dedup): New.
50 (name_lookup::~name_lookup): Assert not deduping.
51 (name_lookup::restore_state): Likewise.
52 (name_lookup::add_overload): Replace outlined code with dedup
54 (name_lookup::add_value): Likewise.
55 (name_lookup::search_namespace_only): Likewise.
56 (name_lookup::adl_namespace_fns): Likewise.
57 (name_lookup::adl_class_fns): Likewise.
58 (name_lookup::search_adl): Likewise. Add clearing dedup call.
59 (name_lookup::search_qualified): Likewise.
60 (name_lookup::search_unqualified): Likewise.
62 2021-03-12 Jakub Jelinek <jakub@redhat.com>
65 * call.c (build_over_call): For immediate evaluation of functions
66 that return references, undo convert_from_reference effects before
67 calling cxx_constant_value and call convert_from_reference
70 2021-03-11 Nathan Sidwell <nathan@acm.org>
73 * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
74 when there's a binding vector.
75 * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
77 2021-03-11 Nathan Sidwell <nathan@acm.org>
80 * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
82 (trees_in::decl_value): Adjust add_mergeable_specialization call.
83 (trees_out::get_merge_kind): Adjust detecting a partial template
85 (trees_out::key_mergeable): Adjust handling same.
86 (trees_in::key_mergeabvle): Likewise.
88 2021-03-10 Nathan Sidwell <nathan@acm.org>
91 * module.cc (post_load_processing): Assert not gcable.
92 (laxy_load_pendings): Extend no-gc region around
95 2021-03-10 Nathan Sidwell <nathan@acm.org>
98 * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
99 assembler name to the ns alias.
101 2021-03-09 Jakub Jelinek <jakub@redhat.com>
104 * coroutines.cc (build_co_await): Look through NOP_EXPRs in
105 build_special_member_call return value to find the CALL_EXPR.
108 2021-03-09 Nathan Sidwell <nathan@acm.org>
111 * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
112 that C++20 does not yet imply modules.
114 2021-03-08 Nathan Sidwell <nathan@acm.org>
117 * name-lookup.c (get_cxx_dialect_name): Add cxx23.
119 2021-03-08 Nathan Sidwell <nathan@acm.org>
121 * lex.c (module_token_filter::resume): Ignore module-decls inside
123 * parser.c (cp_parser_module_declaration): Reject in header-unit.
125 2021-03-08 Nathan Sidwell <nathan@acm.org>
128 * cp-tree.h (match_mergeable_specialization)
129 (add_mergeable_specialization): Adjust parms.
130 * module.cc (trees_in::decl_value): Adjust
131 add_mergeable_specialization calls.
132 (trees_out::key_mergeable): Adjust match_mergeable_specialization
134 (specialization_add): Likewise.
135 * pt.c (match_mergeable_specialization): Do not insert.
136 (add_mergeable_specialization): Add to hash table here.
138 2021-03-06 Patrick Palka <ppalka@redhat.com>
139 Jakub Jelinek <jakub@redhat.com>
142 * constexpr.c (cxx_eval_increment_expression): Pass lval when
143 evaluating the MODIFY_EXPR, and update 'mod' with the result of
144 this evaluation. Check *non_constant_p afterwards. For prefix
145 ops, just return 'mod'.
147 2021-03-06 Patrick Palka <ppalka@redhat.com>
148 Jakub Jelinek <jakub@redhat.com>
151 * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
152 variable 'fn' to 'tmpl'. Handle a variable template-id by
153 calling lookup_template_variable.
155 2021-03-06 Patrick Palka <ppalka@redhat.com>
158 * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
159 outer_targs to do_auto_deduction.
160 (placeholder_type_constraint_dependent_p): Define.
161 (do_auto_deduction): When processing_template_decl != 0
162 and context is adc_unify and we have constraints, pretend the
163 constraints are satisfied instead of punting. Otherwise don't
164 punt unless placeholder_type_constraint_dependent_p holds.
165 Add some clarifying sanity checks. Add a hack to add missing
166 outermost template levels to outer_args before checking
167 satisfaction. Don't substitute outer_targs into type if it's
170 2021-03-05 Marek Polacek <polacek@redhat.com>
173 * call.c (standard_conversion): When converting pointers to
174 member, don't return NULL when the bases are equivalent but
177 2021-03-05 Marek Polacek <polacek@redhat.com>
180 * name-lookup.c (check_local_shadow): Check if the type of decl
181 is non-null before checking TYPE_PTR*.
183 2021-03-05 Nathan Sidwell <nathan@acm.org>
186 * module.cc (module_state::write_cluster): Relax binding assert.
188 2021-03-05 Nathan Sidwell <nathan@acm.org>
191 * pt.c (instantiate_decl): Call set_instantiating_module.
193 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
196 * coroutines.cc (build_co_await): Use type_build_ctor_call()
197 to determine cases when a CTOR needs to be built.
198 (flatten_await_stmt): Likewise.
199 (morph_fn_to_coro): Likewise.
201 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
204 * coroutines.cc (coro_diagnose_throwing_fn): New helper.
205 (coro_diagnose_throwing_final_aw_expr): New helper.
206 (build_co_await): Diagnose throwing final await expression
208 (build_init_or_final_await): Diagnose a throwing promise
209 final_suspend() call.
211 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
214 * coroutines.cc (struct param_info): Track parameter copies that need
216 (coro_get_frame_dtor): New helper function factored from build_actor().
217 (build_actor_fn): Use coro_get_frame_dtor().
218 (morph_fn_to_coro): Track parameters that need DTORs on exception,
219 likewise the frame promise and the return object. On exception, run the
220 DTORs for these, destroy the frame and then rethrow the exception.
222 2021-03-05 Nathan Sidwell <nathan@acm.org>
225 * pt.c (instantiate_class_template_1): Set instantiating module
228 2021-03-05 Tobias Burnus <tobias@codesourcery.com>
231 * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
233 2021-03-04 Jakub Jelinek <jakub@redhat.com>
237 * cvt.c (convert_to_void): Revert 2019-10-17 changes. Clarify
240 2021-03-04 Nathan Sidwell <nathan@acm.org>
243 * module.cc (class uintset): Delete.
244 (typedef attached_map_t): A hash map.
245 (attached_table): Use attached_map_t. Adjust uses ...
246 (trees_out::decl_value, trees_in::decl_value): ... here ...
247 (trees_out::key_mergeable): ... here ...
248 (trees_in::key_mergeable): ... here ...
249 (maybe_attach_decl): ... here ...
250 (direct_import): ... and here.
252 2021-03-04 Nathan Sidwell <nathan@acm.org>
256 * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
258 * module.cc (class pending_key): New.
259 (default_hash_traits<pending_key>): New specialization.
260 (pending_map_t): New typedef.
261 (pending_table): Replace old table.
262 (trees_out::lang_decl_bools): Adjust.
263 (trees_in::lang_decl_bools): Adjust.
264 (trees_in::install_entity): Drop pending member and specialization
266 (find_pending_key): New.
267 (depset::hash::fiund_dependencies): Use it.
268 (pendset_lazy_load): Delete.
269 (module_state::write_cluster): Don't count pendings here. Bye
270 Duff's device-like thing.
271 (module_state::write_pendings): Reimplement.
272 (module_state::read_pendings): Reimplement.
273 (lazy_specializations_p): Delete.
274 (module_state::write): Adjust write_pendings call.
275 (lazy_load_pendings): New.
276 (lazy_load_specializations): Delete.
277 (lazy_load_members): Delete.
278 (init_modules): Adjust.
279 * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
280 not lazy_load_members.
281 (note_pending_specializations): Delete.
282 (load_pending_specializations): Delete.
283 * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
284 (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
285 (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
286 (note_pending_specializations): Delete.
287 (load_pending_specializations): Delete.
288 * pt.c (lookup_template_class_1): Call lazy_load_pendings not
289 lazy_load_specializations.
290 (instantiate_template_class_1): Likewise.
291 (instantiate_decl): Call lazy_load_pendings.
292 * typeck.c (complete_type): Likewise.
294 2021-03-03 Nathan Sidwell <nathan@acm.org>
297 * module.cc (post_load_decls): New.
298 (lazy_snum, recursive_lazy): Move earlier.
299 (module_state::read_cluster): Push cloning onto post_load_decls.
300 (post_load_processing): New. Do the cloning here.
301 (module_state::read_inits): Call post_load_processing.
302 (module_state::read_language): Likewise.
303 (lazy_load_binding, lazy_load_specializations): Likewise
304 (lazy_load_members): Likewise
306 2021-03-03 Nathan Sidwell <nathan@acm.org>
309 * module.cc (trees_out::decl_value): Stream specialization keys
311 (trees_in::decl_value): Stream them back and insert after
313 (trees_out::key_mergeable): Drop some streaming here ...
314 (trees_in::key_mergeable): ... and here. Don't insert into
315 specialization tables.
317 2021-03-03 Patrick Palka <ppalka@redhat.com>
319 * constraint.cc (struct sat_info): Document the different
320 meanings of noisy() and diagnose_unsatisfaction_p() during
321 satisfaction and requires-expression evaluation.
322 (tsubst_valid_expression_requirement): Take a sat_info instead
323 of a subst_info. Perform the substitution quietly first. Fold
324 in error-replaying code from diagnose_valid_expression.
325 (tsubst_simple_requirement): Take a sat_info instead of a
327 (tsubst_type_requirement_1): New. Fold in error-replaying code
328 from diagnose_valid_type.
329 (tsubst_type_requirement): Use the above. Take a sat_info
330 instead of a subst_info.
331 (tsubst_compound_requirement): Likewise. Fold in
332 error-replaying code from diagnose_compound_requirement.
333 (tsubst_nested_requirement): Take a sat_info instead of a
334 subst_info. Fold in error-replaying code from
335 diagnose_nested_requirement.
336 (tsubst_requirement): Take a sat_info instead of a subst_info.
337 (tsubst_requires_expr): Split into two versions, one that takes
338 a sat_info argument and another that takes a complain and
339 in_decl argument. Remove outdated documentation. Document the
340 effects of the sat_info argument. Don't short-circuit
341 processing of requirements when diagnosing unsatisfaction,
342 mirroring diagnose_requires_expr.
343 (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
344 assert, and se the three-parameter version of tsubst_requires_expr.
345 (diagnose_trait_expr): Make static. Take a template argument
346 vector instead of a parameter mapping.
347 (diagnose_valid_expression): Remove.
348 (diagnose_valid_type): Remove.
349 (diagnose_simple_requirement): Remove.
350 (diagnose_compound_requirement): Remove.
351 (diagnose_type_requirement): Remove.
352 (diagnose_nested_requirement): Remove.
353 (diagnose_requirement): Remove.
354 (diagnose_requires_expr): Remove.
355 (diagnose_atomic_constraint): Take a sat_info instead of a
356 subst_info. Adjust call to diagnose_trait_expr. Call
357 tsubst_requires_expr instead of diagnose_requires_expr.
358 (diagnose_constraints): Remove special casing of REQUIRES_EXPR
359 and just always call constraint_satisfaction_value.
361 2021-03-03 Patrick Palka <ppalka@redhat.com>
363 * constexpr.c (cxx_eval_call_expression): Adjust call to
364 evaluate_concept_check.
365 (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
366 evaluate_requires_expression instead of
367 satisfy_constraint_expression.
368 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
369 * constraint.cc (struct sat_info): Adjust comment about which
370 satisfaction entrypoints use noisy-unsat.
371 (normalize_template_requirements): Remove (and adjust callers
373 (normalize_nontemplate_requirements): Likewise.
374 (tsubst_nested_requirement): Use constraint_satisfaction_value
375 instead of satisfy_constraint_expression, which'll do the
376 noisy replaying of ill-formed quiet satisfaction for us.
377 (decl_satisfied_cache): Adjust comment.
378 (satisfy_constraint): Rename to ...
379 (satisfy_normalized_constraints): ... this.
380 (satisfy_associated_constraints): Remove (and make its
381 callers check for dependent arguments).
382 (satisfy_constraint_expression): Rename to ...
383 (satisfy_nondeclaration_constraints): ... this. Assert that
384 'args' is empty when 't' is a concept-id. Removing handling
385 bare constraint-expressions, and handle REQUIRES_EXPRs
386 specially. Adjust comment accordingly.
387 (satisfy_declaration_constraints): Assert in the two-parameter
388 version that 't' is not a TEMPLATE_DECL. Adjust following
389 removal of normalize_(non)?template_requirements and
390 satisfy_asociated_constraints.
391 (constraint_satisfaction_value): Combine the two- and
392 three-parameter versions in the natural way.
393 (constraints_satisfied_p): Combine the one- and two-parameter
394 versions in the natural way. Improve documentation.
395 (evaluate_requires_expr): Define.
396 (evaluate_concept_check): Remove 'complain' parameter. Use
397 constraint_satisfaction_value instead of
398 satisfy_constraint_expression.
399 (diagnose_nested_requirement): Adjust following renaming of
400 satisfy_constraint_expression.
401 (diagnose_constraints): Handle REQUIRES_EXPR by going through
402 diagnose_requires_expr directly instead of treating it as a
403 constraint-expression. Improve documentation.
404 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
405 to evaluate_concept_check.
406 <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
407 constraints_satisfied_p.
408 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
409 * cp-tree.h (evaluate_requires_expr): Declare.
410 (evaluate_concept_check): Remove tsubst_flag_t parameter.
411 (satisfy_constraint_expression): Remove declaration.
412 (constraints_satisfied_p): Remove one-parameter declaration.
413 Add a default argument to the two-parameter declaration.
414 * cvt.c (convert_to_void): Adjust call to
415 evaluate_concept_check.
417 2021-03-03 Jakub Jelinek <jakub@redhat.com>
420 * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
423 2021-03-03 Marek Polacek <polacek@redhat.com>
427 * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
428 (maybe_aggr_guide): Use the original template type where needed. In
429 a class member template, partially instantiate the result of
430 collect_ctor_idx_types.
431 (do_class_deduction): Defer the deduction until the enclosing
432 scope is non-dependent.
434 2021-03-03 Jason Merrill <jason@redhat.com>
437 * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
438 if it didn't get one before.
440 2021-03-03 Nathan Sidwell <nathan@acm.org>
443 * module.cc (trees_out::decl_node): Small refactor.
444 (depset::hash::add_binding_entity): Return true on meeting an
445 import. Set namespace's import here.
446 (module_state:write_namespaces): Inform of purview too.
447 (module_state:read_namespaces): Adjust.
448 * name-lookup.c (implicitly_export_namespace): Delete.
449 (do_pushdecl): Don't call it.
450 (push_namespace): Likewise, set purview.
451 (add_imported_namespace): Reorder parms.
452 * name-lookup.h (add_imported_namespace): Alter param ordering.
454 2021-03-02 Martin Sebor <msebor@redhat.com>
457 * class.c (build_base_path): Call build_if_nonnull.
458 * cp-tree.h (build_if_nonnull): Declare.
459 * rtti.c (ifnonnull): Rename...
460 (build_if_nonnull): ...to this. Set no-warning bit on COND_EXPR.
461 (build_dynamic_cast_1): Adjust to name change.
463 2021-03-02 Patrick Palka <ppalka@redhat.com>
467 * constraint.cc (type_deducible_p): Don't substitute into the
468 constraints, and instead just pass 'args' to do_auto_deduction
469 as the outer template arguments.
470 (tsubst_parameter_mapping): Remove confused code for handling
471 placeholder type arguments.
472 (normalize_placeholder_type_constraint): Define.
473 (satisfy_constraint_expression): Use it to handle placeholder
475 * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
476 (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
477 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
478 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
479 (make_constrained_placeholder_type): Set
480 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
481 (do_auto_deduction): Clarify comments about the outer_targs
482 parameter. Rework satisfaction of a placeholder type constraint
483 to pass in the complete set of template arguments directly to
484 constraints_satisfied_p.
485 (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
486 instead. Also rebuild the the constraint info on the new auto.
488 2021-03-02 Patrick Palka <ppalka@redhat.com>
490 * constraint.cc (build_parameter_mapping): Rely on the caller to
491 determine the in-scope template parameters.
492 (norm_info::norm_info): Delegate the tsubst_flags_t constructor
493 to the two-parameter constructor. In the two-parameter
494 constructor, fold in the definition of make_context, set
495 initial_parms appropriately, and don't set the now-removed
497 (norm_info::make_context): Remove, now that its only use is
498 inlined into the caller.
499 (norm_info::update_context): Adjust call to
500 build_parameter_mapping to pass in the relevant set of in-scope
502 (norm_info::ctx_parms): Define this member function.
503 (norm_info::context): Initialize to NULL_TREE.
504 (norm_info::orig_decl): Remove this data member.
505 (norm_info::initial_parms): Define this data member.
506 (normalize_atom): Adjust call to build_parameter_mapping to pass
507 in the relevant set of in-scope template parameters. Use
508 info.initial_parms instead of info.orig_decl.
509 (normalize_constraint_expression): Take a norm_info object
510 instead of a bool. Cache the result of normalization.
511 (tsubst_nested_requirement): Call satisfy_constraint_expression
512 instead of satisfy_constraint, so that we normalize on demand.
513 (satisfy_constraint_expression): Handle a NESTED_REQ argument.
514 Adjust call to normalize_constraint_expression.
515 (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
516 to current_template_parms.
517 (diagnose_nested_requirements): Go through
518 satisfy_constraint_expression, as with tsubst_nested_requirement.
520 2021-03-02 Patrick Palka <ppalka@redhat.com>
522 * constraint.cc (tsubst_parameter_mapping): Canonicalize the
523 arguments of a substituted TYPE_ARGUMENT_PACK even if we've
524 started with a TYPE_ARGUMENT_PACK.
525 (finish_requires_expr): Don't set DECL_CONTEXT and
526 CONSTRAINT_VAR_P on each of the introduced parameters here.
527 * parser.c (cp_parser_requirement_parameter_list): Instead set
528 these fields earlier, here.
529 * pt.c (do_auto_deduction): Canonicalize the result of
530 do_auto_deduction. Pass 'complain' to finish_decltype_type.
532 2021-03-02 Patrick Palka <ppalka@redhat.com>
534 * constraint.cc (tsubst_simple_requirement): Just return
535 boolean_true_node on success.
536 (tsubst_type_requirement): Likewise.
537 (tsubst_compound_requirement): Likewise.
538 (tsubst_nested_requirement): Likewise.
539 (tsubst_requirement_body): Remove.
540 (check_constaint_variables): Rename to ...
541 (check_constraint_variables): ... this.
542 (tsubst_constraint_variables): Adjust.
543 (tsubst_requires_expr): Fold tsubst_requirement_body into here.
545 2021-03-01 Nathan Sidwell <nathan@acm.org>
548 * class.c (fixup_type_variants): Propagate mode, precision,
549 alignment & emptiness.
550 * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
551 (trees_in::tree_node): Rematerialize alignment here.
553 2021-02-27 Jason Merrill <jason@redhat.com>
556 * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
559 2021-02-26 Jakub Jelinek <jakub@redhat.com>
561 * parser.c (cp_parser_lambda_declarator_opt): Implement
562 P1102R2 - Down with ()! Make ()s optional before lambda specifiers
563 for -std={c,gnu}++2b or with pedwarn in earlier versions.
565 2021-02-26 Jakub Jelinek <jakub@redhat.com>
568 * lambda.c (is_lambda_ignored_entity): Before checking for
569 LAMBDA_FUNCTION_P, use OVL_FIRST. Drop FUNCTION_DECL check.
571 2021-02-26 Jason Merrill <jason@redhat.com>
574 * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
575 to a class non-type template argument that needs it.
577 2021-02-26 Patrick Palka <ppalka@redhat.com>
580 * pt.c (splice_late_return_type): Rebuild the entire return type
581 if we have to adjust the level of an auto within.
582 (type_uses_auto): Adjust call to find_type_usage.
583 * type-utils.h (find_type_usage): Revert r10-6571 change that
584 made this function return a pointer to the auto node.
586 2021-02-25 Patrick Palka <ppalka@redhat.com>
590 * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
591 TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
593 2021-02-25 Patrick Palka <ppalka@redhat.com>
596 * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
597 (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
599 2021-02-25 Marek Polacek <polacek@redhat.com>
603 * constexpr.c (is_std_construct_at): New overload.
604 (is_std_allocator_allocate): New overload.
605 (cxx_eval_call_expression): Use the new overloads.
606 (cxx_eval_constant_expression): Reject casting
607 from void * as per DR 1312. Don't check can_convert.
609 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
612 * coroutines.cc (struct param_info): Track rvalue refs.
613 (morph_fn_to_coro): Track rvalue refs, and call the promise
614 CTOR with the frame copy of passed parms.
616 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
619 * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
620 set throwing_cleanup marker.
622 2021-02-25 Nathan Sidwell <nathan@acm.org>
625 * module.cc (module_state::inform_cmi_p): Renamed field.
626 (module_state::do_import): Adjust.
627 (init_modules, finish_module_processing): Likewise.
628 (handle_module_option): Likewise.
630 2021-02-25 Nathan Sidwell <nathan@acm.org>
633 * mapper-client.cc (module_client::open_module_client): Fix typo
636 2021-02-24 Nathan Sidwell <nathan@acm.org>
639 * module.cc (ool): New indirection vector.
640 (loc_spans::maybe_propagate): Location is not optional.
641 (loc_spans::open): Likewise. Assert monotonically advancing.
642 (module_for_ordinary_loc): Use ool indirection vector.
643 (module_state::write_prepare_maps): Do not count empty macro
644 expansions. Elide empty spans.
645 (module_state::write_macro_maps): Skip empty expansions.
646 (ool_cmp): New qsort comparator.
647 (module_state::write): Create and destroy ool vector.
648 (name_pending_imports): Fix dump push/pop.
649 (preprocess_module): Likewise. Add more dumping.
650 (preprocessed_module): Likewise.
652 2021-02-24 Iain Sandoe <iain@sandoe.co.uk>
655 * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
656 error reporting when instantiating for a constexpr.
658 2021-02-23 Nathan Sidwell <nathan@acm.org>
661 * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
664 2021-02-23 Patrick Palka <ppalka@redhat.com>
667 * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
668 over from tsubst_copy.
670 2021-02-23 Patrick Palka <ppalka@redhat.com>
672 * pt.c (instantiation_dependent_expression_p): Check
673 processing_template_decl before calling
674 potential_constant_expression.
676 2021-02-22 Nathan Sidwell <nathan@acm.org>
679 * module.cc (struct module_state): Add visited_p flag.
680 (name_pending_imports): Use it to avoid duplicate requests.
681 (preprocess_module): Don't read preprocessor state if we failed to
682 load a module's config.
684 2021-02-22 Nathan Sidwell <nathan@acm.org>
687 * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
689 * module.cc (set_defining_module): Add assert.
691 2021-02-19 Nathan Sidwell <nathan@acm.org>
694 * module.cc (pending_imports): New.
695 (declare_module): Adjust test condition.
696 (name_pending_imports): New.
697 (preprocess_module): Reimplement using pending_imports.
698 (preprocessed_module): Move name-getting to name_pending_imports.
699 * name-lookup.c (append_imported_binding_slot): Assert module
700 ordering is increasing.
702 2021-02-19 Nathan Sidwell <nathan@acm.org>
704 * module.cc (note_cmis): New.
705 (struct module_state): Add inform_read_p bit.
706 (module_state::do_import): Inform of CMI location, if enabled.
707 (init_modules): Canonicalize note_cmis entries.
708 (handle_module_option): Handle -flang-info-module-read=FOO.
710 2021-02-19 Jason Merrill <jason@redhat.com>
713 * call.c (perfect_conversion_p): Limit rvalueness
714 test to reference bindings.
716 2021-02-19 Jason Merrill <jason@redhat.com>
719 * call.c (perfect_conversion_p): New.
720 (perfect_candidate_p): New.
721 (add_candidates): Ignore templates after a perfect non-template.
723 2021-02-18 Nathan Sidwell <nathan@acm.org>
726 * module.cc (canonicalize_header_name): Use
727 cpp_probe_header_unit.
728 (maybe_translate_include): Fix note_includes comparison.
729 (init_modules): Fix note_includes string termination.
731 2021-02-18 Jakub Jelinek <jakub@redhat.com>
734 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
735 cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
736 for immediate function calls.
738 2021-02-17 Nathan Sidwell <nathan@acm.org>
741 * module.cc (struct macro_export): Add GTY markers.
742 (macro_exports): Likewise, us a va_gc Vector.
744 2021-02-17 Jakub Jelinek <jakub@redhat.com>
747 * init.c (build_zero_init_1): For flexible array members just return
748 NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
751 2021-02-17 Nathan Sidwell <nathan@acm.org>
754 * name-lookup.c (do_pushdecl): Don't peek under template_parm
756 (set_identifier_type_value_with_scope): ... or here.
757 (do_pushtag): Only set_identifier_type_value_with_scope at
758 non-class template parm scope, and use parent scope.
760 2021-02-17 Nathan Sidwell <nathan@acm.org>
763 * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
766 2021-02-17 Patrick Palka <ppalka@redhat.com>
770 * tree.c (build_aggr_init_expr): Revert r10-7718 change.
772 2021-02-12 Nathan Sidwell <nathan@acm.org>
774 * module.cc (module_state::write_cluster): Check bindings for
775 imported using-decls.
777 2021-02-12 Nathan Sidwell <nathan@acm.org>
780 * module.cc (trees_in::decl_value): Call add_module_namespace_decl
781 for new namespace-scope entities.
782 (module_state::read_cluster): Don't call add_module_decl here.
783 * name-lookup.h (add_module_decl): Rename to ...
784 (add_module_namespace_decl): ... this.
785 * name-lookup.c (newbinding_bookkeeping): Move into ...
786 (do_pushdecl): ... here. Its only remaining caller.
787 (add_module_decl): Rename to ...
788 (add_module_namespace_decl): ... here. Add checking-assert for
789 circularity. Don't call newbinding_bookkeeping, just extern_c
790 checking and incomplete var checking.
792 2021-02-12 Nathan Sidwell <nathan@acm.org>
796 * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
797 (global_type_node): Delete.
798 (IDENTIFIER_TYPE_VALUE): Delete.
799 (IDENTIFIER_HAS_TYPE_VALUE): Delete.
800 (get_type_value): Delete.
801 * name-lookup.h (identifier_type_value): Delete.
802 * name-lookup.c (check_module_override): Don't
803 SET_IDENTIFIER_TYPE_VALUE here.
804 (do_pushdecl): Nor here.
805 (identifier_type_value_1, identifier_type_value): Delete.
806 (set_identifier_type_value_with_scope): Only
807 SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
808 (pushdecl_nanmespace_level): Remove shadow stack nadgering.
809 (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
810 * call.c (check_dtor_name): Use lookup_name.
811 * decl.c (cxx_init_decl_processing): Drop global_type_node.
812 * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
814 * init.c (get_type_value): Delete.
815 * pt.c (instantiate_class_template_1): Don't call pushtag or
816 SET_IDENTIFIER_TYPE_VALUE here.
817 (tsubst): Assert never an identifier.
818 (dependent_type_p): Drop global_type_node assert.
819 * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
820 to determine ctorness.
822 2021-02-12 Jakub Jelinek <jakub@redhat.com>
825 * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
828 2021-02-12 Jason Merrill <jason@redhat.com>
832 * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
833 (register_parameter_specializations): Not here.
835 2021-02-11 Marek Polacek <polacek@redhat.com>
838 * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
839 for the partial instantiation.
841 2021-02-11 Jakub Jelinek <jakub@redhat.com>
844 * init.c (build_zero_init_1): Handle zero initialiation of
845 flexible array members like initialization of [0] arrays.
846 Use integer_minus_onep instead of comparison to integer_minus_one_node
847 and integer_zerop instead of comparison against size_zero_node.
850 2021-02-11 Marek Polacek <polacek@redhat.com>
853 * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
855 2021-02-11 Patrick Palka <ppalka@redhat.com>
858 * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
859 lookup result by discarding it if the first element is a
860 class-scope declaration, otherwise return it.
861 (push_operator_bindings): Handle an ambiguous lookup result by
862 doing push_local_binding on each element in the list.
864 2021-02-11 Marek Polacek <polacek@redhat.com>
866 * parser.c (cp_parser_selection_statement): Use vec_free.
868 2021-02-10 Jakub Jelinek <jakub@redhat.com>
872 * constexpr.c: Include cgraph.h.
873 (cxx_eval_call_expression): Call varpool_node::finalize_decl on
874 heap artificial vars.
875 (cxx_eval_outermost_constant_expr): Remove varpool nodes for
876 heap artificial vars.
878 2021-02-10 Nathan Sidwell <nathan@acm.org>
881 * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
882 answer if there's no local specialization.
884 2021-02-09 Nathan Sidwell <nathan@acm.org>
887 * module.cc (module_state::is_rooted): Rename to ...
888 (module_state::has_location): ... here. Adjust callers.
889 (module_state::read_partitions): Adjust validity check.
890 Don't overwrite a known location.
892 2021-02-09 Jason Merrill <jason@redhat.com>
895 * pt.c (mark_decl_instantiated): Exit early if consteval.
897 2021-02-09 Jason Merrill <jason@redhat.com>
901 * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
904 2021-02-09 Jason Merrill <jason@redhat.com>
908 * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
911 2021-02-08 Nathan Sidwell <nathan@acm.org>
913 * decl.c (start_cleanup_fn): Push function into
916 2021-02-08 Nathan Sidwell <nathan@acm.org>
919 * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
920 * decl.c (push_abi_namespace, pop_abi_namespace): Moved
921 from rtti.c, add default namespace arg.
922 (check_redeclaration_exception_specification): Allow a lazy
923 builtin's eh spec to differ from an lready-declared user
925 (declare_global_var): Use push/pop_abi_namespace.
926 (get_atexit_node): Push the fndecl into a namespace.
927 * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
930 2021-02-08 Marek Polacek <polacek@redhat.com>
932 * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
934 2021-02-05 Marek Polacek <polacek@redhat.com>
937 * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
939 * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
940 issuing the -Wvolatile warning. Only set TREE_THIS_VOLATILE if
941 a warning was emitted.
943 2021-02-05 Marek Polacek <polacek@redhat.com>
946 * name-lookup.c (lookup_using_decl): Hoist the destructor check.
948 2021-02-05 Jakub Jelinek <jakub@redhat.com>
951 * decl.c (check_array_initializer): For structured bindings, require
952 the array type to be complete.
954 2021-02-04 Jason Merrill <jason@redhat.com>
957 * constraint.cc (build_concept_check_arguments): Remove assert.
958 (build_concept_check): Allow empty args.
960 2021-02-04 Tom Greenslade (thomgree) <thomgree@cisco.com>
963 * call.c (can_convert_array): Extend to handle all valid aggregate
964 initializers of an array; including by string literals, not just by
966 (build_aggr_conv): Call can_convert_array more often, not just in
967 brace-init-list case.
968 * typeck2.c (array_string_literal_compatible_p): New function.
969 (digest_init_r): call array_string_literal_compatible_p
970 * cp-tree.h: (array_string_literal_compatible_p): Declare.
972 2021-02-04 Jason Merrill <jason@redhat.com>
975 * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
977 2021-02-04 Jason Merrill <jason@redhat.com>
980 * pt.c (tsubst_attribute): Handle error.
981 (apply_late_template_attributes): Return false on error.
982 (tsubst_function_decl): Check its return value.
983 (tsubst_decl): Likewise.
984 (push_template_decl): Assert current_template_parms.
985 (tsubst_template_decl): Set current_template_parms.
987 2021-02-03 Marek Polacek <polacek@redhat.com>
990 * call.c (struct z_candidate): Mark rewritten and reversed as const.
991 (struct NonPublicField): Mark operator() as const.
992 (struct NonTrivialField): Likewise.
994 2021-02-03 Jason Merrill <jason@redhat.com>
998 * pt.c (spec_hasher::equal): Set processing_template_decl.
999 * Make-lang.in (check-g++-strict-gc): Add --param
1000 hash-table-verification-limit=10000.
1002 2021-02-03 Marek Polacek <polacek@redhat.com>
1005 * parser.c (cp_parser_class_specifier_1): Use any possible
1006 DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
1007 (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
1008 * pt.c (tsubst_exception_specification): Stash new_specs into
1009 DEFPARSE_INSTANTIATIONS.
1010 * tree.c (fixup_deferred_exception_variants): Use
1011 UNPARSED_NOEXCEPT_SPEC_P.
1013 2021-02-02 Jason Merrill <jason@redhat.com>
1017 * error.c (dump_expr): Ignore dummy object.
1018 * pt.c (tsubst_baselink): Handle dependent scope.
1020 2021-02-01 Patrick Palka <ppalka@redhat.com>
1023 * constexpr.c (cxx_eval_array_reference): Also set
1024 new_ctx.object when setting new_ctx.ctor.
1026 2021-02-01 Marek Polacek <polacek@redhat.com>
1029 * parser.c (cp_parser_has_attribute_expression): Use
1030 uses_template_parms instead of type_dependent_expression_p.
1032 2021-02-01 Jason Merrill <jason@redhat.com>
1035 * cp-tree.h: Declare it.
1036 * pt.c (comparing_dependent_aliases): New flag.
1037 (template_args_equal, spec_hasher::equal): Set it.
1038 (dependent_alias_template_spec_p): Assert that we don't
1039 get non-types other than error_mark_node.
1040 (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
1041 on complex alias specializations. Set TYPE_DEPENDENT_P here.
1042 (tsubst_decl): Not here.
1043 * module.cc (module_state::read_cluster): Set
1044 comparing_dependent_aliases instead of
1045 comparing_specializations.
1046 * tree.c (cp_tree_equal): Remove comparing_specializations
1048 * typeck.c (structural_comptypes): Adjust.
1049 (comptypes): Remove comparing_specializations handling.
1051 2021-01-29 Nathan Sidwell <nathan@acm.org>
1054 * module.cc (module_state_config): Add num_entities field.
1055 (module_state::read_entities): The entity_ary span is
1057 (module_state::write_config): Write num_entities.
1058 (module_state::read_config): Read num_entities.
1059 (module_state::write): Set config's num_entities.
1060 (module_state::read_initial): Allocate the entity ary
1062 (module_state::read_language): Do not set entity_lwm
1065 2021-01-29 Marek Polacek <polacek@redhat.com>
1068 * parser.c (cp_parser_class_name): If parser->scope is
1069 error_mark_node, return it, otherwise continue.
1071 2021-01-28 Jakub Jelinek <jakub@redhat.com>
1074 * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
1076 2021-01-28 Jakub Jelinek <jakub@redhat.com>
1080 * decl.c (cp_finish_decl): For register vars with asmspec in templates
1081 call set_user_assembler_name and set DECL_HARD_REGISTER.
1082 * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
1083 pass asmspec_tree to cp_finish_decl.
1085 2021-01-28 Nathan Sidwell <nathan@acm.org>
1088 * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
1090 (trees_in::decl_value): Do typedef frobbing only when installing
1091 a new typedef, adjust is_matching_decl call. Swap is_typedef
1093 (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
1094 names and deal with typedef checking.
1096 2021-01-27 Jason Merrill <jason@redhat.com>
1099 * name-lookup.c (lookup_using_decl): Clean up handling
1100 of dependency and inherited constructors.
1101 (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
1102 * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
1104 2021-01-26 Jason Merrill <jason@redhat.com>
1107 * call.c (type_passed_as): Don't mark invisiref restrict.
1109 2021-01-26 Jason Merrill <jason@redhat.com>
1113 * class.c (layout_class_type): An empty field gets size 0.
1114 (is_empty_field): New.
1115 (check_bases): Check it.
1116 * cp-tree.h (is_empty_field): Declare it.
1117 * constexpr.c (cxx_eval_store_expression): Check it.
1118 (cx_check_missing_mem_inits): Likewise.
1119 * init.c (perform_member_init): Likewise.
1120 * typeck2.c (process_init_constructor_record): Likewise.
1122 2021-01-25 Martin Sebor <msebor@redhat.com>
1125 * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
1127 2021-01-25 Jason Merrill <jason@redhat.com>
1130 * constexpr.c (get_or_insert_ctor_field): Add check.
1131 (cxx_eval_store_expression): Handle discontinuity of refs.
1133 2021-01-23 Anthony Sharp <anthonysharp15@gmail.com>
1135 * call.c (complain_about_access): Altered function.
1136 * cp-tree.h (complain_about_access): Changed parameters of function.
1137 (get_parent_with_private_access): Declared new function.
1138 * search.c (get_parent_with_private_access): Defined new function.
1139 * semantics.c (enforce_access): Modified function.
1140 * typeck.c (complain_about_unrecognized_member): Updated function
1141 arguments in complain_about_access.
1143 2021-01-23 Patrick Palka <ppalka@redhat.com>
1146 * cp-tree.h (shared_member_p): Adjust declaration.
1147 * parser.c (cp_parser_init_declarator): If the storage class
1148 specifier is sc_static, pass true for static_p to
1149 cp_parser_declarator.
1150 (cp_parser_direct_declarator): Don't do inject_this_parm when
1151 the declarator is a friend.
1152 * search.c (shared_member_p): Change return type to bool and
1153 adjust function body accordingly. Return false for a dependent
1154 USING_DECL instead of aborting.
1155 * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
1156 even when type-dependent.
1158 2021-01-22 Marek Polacek <polacek@redhat.com>
1161 * parser.c (inject_parm_decls): Remove a redundant assignment.
1162 (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
1163 before calling inject_parm_decls.
1165 2021-01-22 Jason Merrill <jason@redhat.com>
1168 * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
1170 2021-01-22 Jakub Jelinek <jakub@redhat.com>
1173 * init.c (build_zero_init_1): Revert the 2018-03-06 change to
1174 return build_zero_cst for reference types.
1175 * typeck2.c (process_init_constructor_record): Instead call
1176 build_zero_cst here during error recovery instead of build_zero_init.
1178 2021-01-22 Marek Polacek <polacek@redhat.com>
1181 * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
1182 warnings regardless of abi_version_at_least.
1183 (write_expression): When the expression is a dependent name
1184 and an operator name, write "on" before writing its name.
1186 2021-01-22 Marek Polacek <polacek@redhat.com>
1189 * pt.c (instantiate_class_template_1): Instantiate members
1190 marked with attribute used only after we're done instantiating
1193 2021-01-21 Patrick Palka <ppalka@redhat.com>
1196 * semantics.c (finish_decltype_type): Set up a cp_unevaluated
1197 sentinel at the start of the function. Remove a now-redundant
1198 manual adjustment of cp_unevaluated_operand.
1200 2021-01-21 Nathan Sidwell <nathan@acm.org>
1203 * module.cc (depset::hash::find_dependencies): Add
1205 (trees_out::core_vals): Check state before calling
1207 (sort_cluster, module_state::write): Adjust
1208 find_dependencies call.
1210 2021-01-21 Jakub Jelinek <jakub@redhat.com>
1213 * constexpr.c (check_for_return_continue_data): Add break_stmt member.
1214 (check_for_return_continue): Also look for BREAK_STMT. Handle
1215 SWITCH_STMT by ignoring break_stmt from its body.
1216 (potential_constant_expression_1) <case FOR_STMT>,
1217 <case WHILE_STMT>: If the condition isn't constant true, check if
1218 the loop body can contain a return stmt.
1219 <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
1220 <case IF_STMT>: If recursion with tf_none is successful,
1221 merge *jump_target from the branches - returns with highest priority,
1222 breaks or continues lower. If then branch is potentially constant and
1223 doesn't return, check the else branch if it could return, break or
1226 2021-01-21 Nathan Sidwell <nathan@acm.org>
1229 * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
1231 2021-01-20 Nathan Sidwell <nathan@acm.org>
1233 * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
1236 2021-01-20 Patrick Palka <ppalka@redhat.com>
1239 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
1240 CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
1241 adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
1243 2021-01-20 Patrick Palka <ppalka@redhat.com>
1246 * parser.c (cp_parser_class_head): Defer access checking when
1247 parsing the base-clause until all bases are seen and attached
1249 * pt.c (instantiate_class_template): Likewise when substituting
1250 into dependent bases.
1252 2021-01-20 Jakub Jelinek <jakub@redhat.com>
1255 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
1256 error_operand_p, remove clause without further checking. Check
1257 for non-NULL TYPE_NAME.
1259 2021-01-19 Marek Polacek <polacek@redhat.com>
1262 * pt.c (maybe_instantiate_noexcept): Return false if FN is
1265 2021-01-19 Marek Polacek <polacek@redhat.com>
1268 * name-lookup.c (push_using_decl_bindings): New, broken out of...
1269 (finish_nonmember_using_decl): ...here.
1270 * name-lookup.h (push_using_decl_bindings): Update declaration.
1271 * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
1273 2021-01-19 Patrick Palka <ppalka@redhat.com>
1277 * search.c (friend_accessible_p): If scope is a hidden friend
1278 defined inside a dependent class, consider access from the
1280 * parser.c (cp_parser_late_parsing_for_member): Don't push a
1281 dk_no_check access state.
1283 2021-01-19 Marek Polacek <polacek@redhat.com>
1286 * parser.c (cp_parser_class_specifier_1): Perform late-parsing
1287 of NSDMIs before late-parsing of noexcept-specifiers.
1289 2021-01-19 Nathan Sidwell <nathan@acm.org>
1291 * module.cc (identifier): Merge overloads.
1293 2021-01-19 Nathan Sidwell <nathan@acm.org>
1296 * module.cc (trees_out::write_location): Make static.
1298 2021-01-16 Kwok Cheung Yeung <kcy@codesourcery.com>
1300 * parser.c (cp_parser_omp_clause_detach): New.
1301 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
1302 (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
1303 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
1304 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
1305 Prevent use of detach with mergeable and overriding the data sharing
1306 mode of the event handle.
1308 2021-01-15 Nathan Sidwell <nathan@acm.org>
1311 * tree.c (cp_build_qualified_type_real): Propagate an array's
1312 dependentness to the copy, if known.
1314 2021-01-15 Jason Merrill <jason@redhat.com>
1317 * call.c (unsafe_return_slot_p): Return int.
1318 (init_by_return_slot_p): Split out from...
1319 (unsafe_copy_elision_p): ...here.
1320 (unsafe_copy_elision_p_opt): New name for old meaning.
1321 (build_over_call): Adjust.
1322 (make_safe_copy_elision): New.
1323 * typeck2.c (split_nonconstant_init_1): Elide copy from safe
1324 list-initialization.
1325 * cp-tree.h: Adjust.
1327 2021-01-15 Jason Merrill <jason@redhat.com>
1329 * call.c (base_ctor_for, make_base_init_ok): New.
1330 (build_over_call): Use make_base_init_ok.
1332 2021-01-15 Jason Merrill <jason@redhat.com>
1335 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
1336 if we got a CONSTRUCTOR.
1338 2021-01-15 Nathan Sidwell <nathan@acm.org>
1341 * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
1343 2021-01-14 Jason Merrill <jason@redhat.com>
1345 * typeck2.c (process_init_constructor_record): Use fldtype
1346 variable consistently.
1348 2021-01-14 Nathan Sidwell <nathan@acm.org>
1351 * tree.c (cp_tree_equal): Correct map_context logic.
1353 2021-01-13 Marek Polacek <polacek@redhat.com>
1356 * name-lookup.c (push_using_decl_bindings): New.
1357 * name-lookup.h (push_using_decl_bindings): Declare.
1358 * pt.c (tsubst_expr): Call push_using_decl_bindings.
1360 2021-01-13 Nathan Sidwell <nathan@acm.org>
1363 * module.cc (module_add_import_initializers): Pass a
1364 zero-element argument vector.
1366 2021-01-12 Patrick Palka <ppalka@redhat.com>
1369 * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
1370 the template of a CTAD placeholder.
1372 2021-01-12 Marek Polacek <polacek@redhat.com>
1375 * typeck2.c (process_init_constructor_record): Don't emit
1376 -Wmissing-field-initializers warnings in unevaluated contexts.
1378 2021-01-11 Jakub Jelinek <jakub@redhat.com>
1381 * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
1383 (mark_abi_tags_r): Likewise.
1384 * decl2.c (min_vis_r): Likewise.
1385 * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
1388 2021-01-08 Patrick Palka <ppalka@redhat.com>
1391 * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
1392 instead of AGGREGATE_TYPE_P before calling replace_result_decl.
1394 2021-01-08 Patrick Palka <ppalka@redhat.com>
1397 * semantics.c (check_accessibility_of_qualified_id): Punt if
1398 we're checking access of a scoped non-static member inside a
1401 2021-01-07 Jakub Jelinek <jakub@redhat.com>
1404 * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
1405 cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
1407 (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
1409 2021-01-07 Marek Polacek <polacek@redhat.com>
1412 * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
1413 !late_return_type block.
1415 2021-01-07 Jason Merrill <jason@redhat.com>
1417 * constexpr.c (cxx_bind_parameters_in_call): Add comment.
1418 (cxx_eval_store_expression): Add comment.
1420 2021-01-07 Jason Merrill <jason@redhat.com>
1422 * call.c (has_next): Factor out from...
1423 (next_conversion): ...here.
1424 (strip_standard_conversion): And here.
1425 (is_subseq): And here.
1426 (build_conv): Check it.
1427 (standard_conversion): Don't call build_conv
1430 2021-01-06 Martin Sebor <msebor@redhat.com>
1433 * error.c (dump_expr): Call c_pretty_printer::unary_expression.
1435 2021-01-05 Patrick Palka <ppalka@redhat.com>
1437 * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
1438 the type of the NTTP, substitute into the type again. If the
1439 type is still dependent, don't unify the NTTP.
1441 2021-01-05 Jakub Jelinek <jakub@redhat.com>
1443 * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
1444 $(CODYLIB) after $(BACKEND).
1446 2021-01-05 Jakub Jelinek <jakub@redhat.com>
1449 * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
1450 Punt if lval is true.
1451 * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
1452 the result if it has a class type.
1454 2021-01-05 Marek Polacek <polacek@redhat.com>
1457 * pt.c (resolve_overloaded_unification): Call
1458 maybe_instantiate_noexcept after instantiating the function
1461 2021-01-05 Nathan Sidwell <nathan@acm.org>
1463 * parser.c (cp_parser_module_declaration): Alter diagnostic
1464 text to say where is permissable.
1466 2021-01-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1469 * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
1471 2021-01-02 Jan Hubicka <jh@suse.cz>
1473 * cp-tree.h (cp_tree_c_finish_parsing): Declare.
1474 * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
1475 * tree.c (cp_tree_c_finish_parsing): New function.
1477 2021-01-01 Jakub Jelinek <jakub@redhat.com>
1479 * ChangeLog-2020: Rotate ChangeLog. New file.
1482 Copyright (C) 2021 Free Software Foundation, Inc.
1484 Copying and distribution of this file, with or without modification,
1485 are permitted in any medium without royalty provided the copyright
1486 notice and this notice are preserved.