1 2021-03-23 Nathan Sidwell <nathan@acm.org>
4 * name-lookup.c (check_module_override): Set global or partition
5 DUP on the binding vector.
7 2021-03-23 Marek Polacek <polacek@redhat.com>
10 * decl2.c (cp_warn_deprecated_use_scopes): Only call
11 cp_warn_deprecated_use when decl is a namespace, class, or enum.
13 2021-03-23 Nathan Sidwell <nathan@acm.org>
16 * decl.c (duplicate_decls): Remove assert about maybe-imported
19 2021-03-23 Jakub Jelinek <jakub@redhat.com>
22 * decl.c (cp_finish_decomp): Diagnose void initializers when
23 using tuple_element and get.
25 2021-03-22 Nathan Sidwell <nathan@acm.org>
28 * module.cc (depset::hash::make_dependency): Propagate flags for
29 partial specialization.
30 (module_may_redeclare): Handle partial specialization.
32 2021-03-22 Nathan Sidwell <nathan@acm.org>
35 * cp-tree.h (map_context_from, map_context_to): Delete.
36 (add_mergeable_specialization): Add is_alias parm.
37 * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
38 * module.cc (map_context_from, map_context_to): Delete.
39 (trees_in::decl_value): Add specializations later, adjust call.
40 Drop useless alias lookup. Set duplicate fn parm context.
41 (check_mergeable_decl): Drop context mapping.
42 (trees_in::is_matching_decl): Likewise.
43 (trees_in::read_function_def): Drop parameter context adjustment
46 2021-03-22 Martin Liska <mliska@suse.cz>
49 * module.cc (fini_modules): Call vec_free instead of delete.
51 2021-03-20 Jakub Jelinek <jakub@redhat.com>
54 * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
55 special code, instead call c_genericize_control_stmt.
57 2021-03-19 Jakub Jelinek <jakub@redhat.com>
60 * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
61 INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
62 don't diagnose it, set *non_constant_p nor return t.
64 2021-03-19 Marek Polacek <polacek@redhat.com>
67 * parser.c (cp_parser_requirement_parameter_list): Handle
70 2021-03-18 Marek Polacek <polacek@redhat.com>
72 * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
74 2021-03-18 Marek Polacek <polacek@redhat.com>
76 * pt.c (tsubst_copy_and_build): Add assert.
78 2021-03-18 Iain Sandoe <iain@sandoe.co.uk>
81 * parser.c (cp_debug_parser): Add Objective-C++ message
83 (cp_parser_nested_name_specifier_opt): Allow colon to
84 terminate an assignment-expression when parsing Objective-
86 (cp_parser_objc_message_expression): Set and clear message
87 parsing state on entry and exit.
88 * parser.h (struct cp_parser): Add a context flag for
89 Objective-C++ message state.
91 2021-03-18 Martin Liska <mliska@suse.cz>
94 * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
97 2021-03-17 Marek Polacek <polacek@redhat.com>
100 * call.c (conv_unsafe_in_template_p): New.
101 (convert_like): Use it.
103 2021-03-17 Anthony Sharp <anthonysharp15@gmail.com>
104 Jason Merrill <jason@redhat.com>
106 * semantics.c (get_class_access_diagnostic_decl): New
107 function that examines special cases when a parent
108 class causes a private access failure.
109 (enforce_access): Slightly modified to call function
112 2021-03-16 Jason Merrill <jason@redhat.com>
114 * tree.c (cp_tree_equal): Use real_identical.
116 2021-03-16 Jakub Jelinek <jakub@redhat.com>
119 * decl.c (expand_static_init): For thread guards, call __cxa_atexit
120 before calling __cxa_guard_release rather than after it. Formatting
123 2021-03-16 Martin Liska <mliska@suse.cz>
124 Jason Merrill <jason@redhat.com>
127 * call.c (get_function_version_dispatcher): Handle
129 * decl.c (maybe_version_functions): Likewise.
130 (maybe_mark_function_versioned): New.
131 * name-lookup.c (push_local_extern_decl_alias): No longer static.
132 * name-lookup.h (push_local_extern_decl_alias): Adjust.
134 2021-03-16 Nathan Sidwell <nathan@acm.org>
137 * module.cc (trees_out::decl_value): Adjust typedef streaming,
138 indicate whether it is a dependent alias.
139 (trees_in::decl_value): Likewise. Set as dependent alias, if it
142 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
145 * coroutines.cc (expand_one_await_expression): If the
146 await_ready() expression is not a boolean then convert it
149 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
152 * coroutines.cc (build_actor_fn): Make destroy index 1
153 correspond to the abnormal unhandled_exception() exit.
154 Substitute the proxy for the resume index.
155 (coro_rewrite_function_body): Arrange to reset the resume
156 index and make done = true for a rethrown exception from
157 unhandled_exception ().
158 (morph_fn_to_coro): Adjust calls to build_actor_fn and
159 coro_rewrite_function_body.
161 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
164 * coroutines.cc (replace_continue): Rewrite continue into
166 (await_statement_walker): Handle await expressions in the
167 initializer, condition and iteration expressions of for
170 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
173 * coroutines.cc (flatten_await_stmt): Allow for the case
174 where a target expression variable only has uses in the
175 second part of a compound expression.
176 (maybe_promote_temps): Avoid emiting empty statements.
178 2021-03-15 Tobias Burnus <tobias@codesourcery.com>
181 * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
182 ensure that the varpool node is marked as offloadable.
184 2021-03-12 Nathan Sidwell <nathan@acm.org>
187 * module.cc (depset::hash::add_binding_entity): Assert not
189 (depset::add::add_specializations): Likewise.
190 * name-lookup.c (name_lookup::dedup): New.
191 (name_lookup::~name_lookup): Assert not deduping.
192 (name_lookup::restore_state): Likewise.
193 (name_lookup::add_overload): Replace outlined code with dedup
195 (name_lookup::add_value): Likewise.
196 (name_lookup::search_namespace_only): Likewise.
197 (name_lookup::adl_namespace_fns): Likewise.
198 (name_lookup::adl_class_fns): Likewise.
199 (name_lookup::search_adl): Likewise. Add clearing dedup call.
200 (name_lookup::search_qualified): Likewise.
201 (name_lookup::search_unqualified): Likewise.
203 2021-03-12 Jakub Jelinek <jakub@redhat.com>
206 * call.c (build_over_call): For immediate evaluation of functions
207 that return references, undo convert_from_reference effects before
208 calling cxx_constant_value and call convert_from_reference
211 2021-03-11 Nathan Sidwell <nathan@acm.org>
214 * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
215 when there's a binding vector.
216 * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
218 2021-03-11 Nathan Sidwell <nathan@acm.org>
221 * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
223 (trees_in::decl_value): Adjust add_mergeable_specialization call.
224 (trees_out::get_merge_kind): Adjust detecting a partial template
226 (trees_out::key_mergeable): Adjust handling same.
227 (trees_in::key_mergeabvle): Likewise.
229 2021-03-10 Nathan Sidwell <nathan@acm.org>
232 * module.cc (post_load_processing): Assert not gcable.
233 (laxy_load_pendings): Extend no-gc region around
234 post_load_processing.
236 2021-03-10 Nathan Sidwell <nathan@acm.org>
239 * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
240 assembler name to the ns alias.
242 2021-03-09 Jakub Jelinek <jakub@redhat.com>
245 * coroutines.cc (build_co_await): Look through NOP_EXPRs in
246 build_special_member_call return value to find the CALL_EXPR.
249 2021-03-09 Nathan Sidwell <nathan@acm.org>
252 * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
253 that C++20 does not yet imply modules.
255 2021-03-08 Nathan Sidwell <nathan@acm.org>
258 * name-lookup.c (get_cxx_dialect_name): Add cxx23.
260 2021-03-08 Nathan Sidwell <nathan@acm.org>
262 * lex.c (module_token_filter::resume): Ignore module-decls inside
264 * parser.c (cp_parser_module_declaration): Reject in header-unit.
266 2021-03-08 Nathan Sidwell <nathan@acm.org>
269 * cp-tree.h (match_mergeable_specialization)
270 (add_mergeable_specialization): Adjust parms.
271 * module.cc (trees_in::decl_value): Adjust
272 add_mergeable_specialization calls.
273 (trees_out::key_mergeable): Adjust match_mergeable_specialization
275 (specialization_add): Likewise.
276 * pt.c (match_mergeable_specialization): Do not insert.
277 (add_mergeable_specialization): Add to hash table here.
279 2021-03-06 Patrick Palka <ppalka@redhat.com>
280 Jakub Jelinek <jakub@redhat.com>
283 * constexpr.c (cxx_eval_increment_expression): Pass lval when
284 evaluating the MODIFY_EXPR, and update 'mod' with the result of
285 this evaluation. Check *non_constant_p afterwards. For prefix
286 ops, just return 'mod'.
288 2021-03-06 Patrick Palka <ppalka@redhat.com>
289 Jakub Jelinek <jakub@redhat.com>
292 * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
293 variable 'fn' to 'tmpl'. Handle a variable template-id by
294 calling lookup_template_variable.
296 2021-03-06 Patrick Palka <ppalka@redhat.com>
299 * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
300 outer_targs to do_auto_deduction.
301 (placeholder_type_constraint_dependent_p): Define.
302 (do_auto_deduction): When processing_template_decl != 0
303 and context is adc_unify and we have constraints, pretend the
304 constraints are satisfied instead of punting. Otherwise don't
305 punt unless placeholder_type_constraint_dependent_p holds.
306 Add some clarifying sanity checks. Add a hack to add missing
307 outermost template levels to outer_args before checking
308 satisfaction. Don't substitute outer_targs into type if it's
311 2021-03-05 Marek Polacek <polacek@redhat.com>
314 * call.c (standard_conversion): When converting pointers to
315 member, don't return NULL when the bases are equivalent but
318 2021-03-05 Marek Polacek <polacek@redhat.com>
321 * name-lookup.c (check_local_shadow): Check if the type of decl
322 is non-null before checking TYPE_PTR*.
324 2021-03-05 Nathan Sidwell <nathan@acm.org>
327 * module.cc (module_state::write_cluster): Relax binding assert.
329 2021-03-05 Nathan Sidwell <nathan@acm.org>
332 * pt.c (instantiate_decl): Call set_instantiating_module.
334 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
337 * coroutines.cc (build_co_await): Use type_build_ctor_call()
338 to determine cases when a CTOR needs to be built.
339 (flatten_await_stmt): Likewise.
340 (morph_fn_to_coro): Likewise.
342 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
345 * coroutines.cc (coro_diagnose_throwing_fn): New helper.
346 (coro_diagnose_throwing_final_aw_expr): New helper.
347 (build_co_await): Diagnose throwing final await expression
349 (build_init_or_final_await): Diagnose a throwing promise
350 final_suspend() call.
352 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
355 * coroutines.cc (struct param_info): Track parameter copies that need
357 (coro_get_frame_dtor): New helper function factored from build_actor().
358 (build_actor_fn): Use coro_get_frame_dtor().
359 (morph_fn_to_coro): Track parameters that need DTORs on exception,
360 likewise the frame promise and the return object. On exception, run the
361 DTORs for these, destroy the frame and then rethrow the exception.
363 2021-03-05 Nathan Sidwell <nathan@acm.org>
366 * pt.c (instantiate_class_template_1): Set instantiating module
369 2021-03-05 Tobias Burnus <tobias@codesourcery.com>
372 * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
374 2021-03-04 Jakub Jelinek <jakub@redhat.com>
378 * cvt.c (convert_to_void): Revert 2019-10-17 changes. Clarify
381 2021-03-04 Nathan Sidwell <nathan@acm.org>
384 * module.cc (class uintset): Delete.
385 (typedef attached_map_t): A hash map.
386 (attached_table): Use attached_map_t. Adjust uses ...
387 (trees_out::decl_value, trees_in::decl_value): ... here ...
388 (trees_out::key_mergeable): ... here ...
389 (trees_in::key_mergeable): ... here ...
390 (maybe_attach_decl): ... here ...
391 (direct_import): ... and here.
393 2021-03-04 Nathan Sidwell <nathan@acm.org>
397 * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
399 * module.cc (class pending_key): New.
400 (default_hash_traits<pending_key>): New specialization.
401 (pending_map_t): New typedef.
402 (pending_table): Replace old table.
403 (trees_out::lang_decl_bools): Adjust.
404 (trees_in::lang_decl_bools): Adjust.
405 (trees_in::install_entity): Drop pending member and specialization
407 (find_pending_key): New.
408 (depset::hash::fiund_dependencies): Use it.
409 (pendset_lazy_load): Delete.
410 (module_state::write_cluster): Don't count pendings here. Bye
411 Duff's device-like thing.
412 (module_state::write_pendings): Reimplement.
413 (module_state::read_pendings): Reimplement.
414 (lazy_specializations_p): Delete.
415 (module_state::write): Adjust write_pendings call.
416 (lazy_load_pendings): New.
417 (lazy_load_specializations): Delete.
418 (lazy_load_members): Delete.
419 (init_modules): Adjust.
420 * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
421 not lazy_load_members.
422 (note_pending_specializations): Delete.
423 (load_pending_specializations): Delete.
424 * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
425 (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
426 (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
427 (note_pending_specializations): Delete.
428 (load_pending_specializations): Delete.
429 * pt.c (lookup_template_class_1): Call lazy_load_pendings not
430 lazy_load_specializations.
431 (instantiate_template_class_1): Likewise.
432 (instantiate_decl): Call lazy_load_pendings.
433 * typeck.c (complete_type): Likewise.
435 2021-03-03 Nathan Sidwell <nathan@acm.org>
438 * module.cc (post_load_decls): New.
439 (lazy_snum, recursive_lazy): Move earlier.
440 (module_state::read_cluster): Push cloning onto post_load_decls.
441 (post_load_processing): New. Do the cloning here.
442 (module_state::read_inits): Call post_load_processing.
443 (module_state::read_language): Likewise.
444 (lazy_load_binding, lazy_load_specializations): Likewise
445 (lazy_load_members): Likewise
447 2021-03-03 Nathan Sidwell <nathan@acm.org>
450 * module.cc (trees_out::decl_value): Stream specialization keys
452 (trees_in::decl_value): Stream them back and insert after
454 (trees_out::key_mergeable): Drop some streaming here ...
455 (trees_in::key_mergeable): ... and here. Don't insert into
456 specialization tables.
458 2021-03-03 Patrick Palka <ppalka@redhat.com>
460 * constraint.cc (struct sat_info): Document the different
461 meanings of noisy() and diagnose_unsatisfaction_p() during
462 satisfaction and requires-expression evaluation.
463 (tsubst_valid_expression_requirement): Take a sat_info instead
464 of a subst_info. Perform the substitution quietly first. Fold
465 in error-replaying code from diagnose_valid_expression.
466 (tsubst_simple_requirement): Take a sat_info instead of a
468 (tsubst_type_requirement_1): New. Fold in error-replaying code
469 from diagnose_valid_type.
470 (tsubst_type_requirement): Use the above. Take a sat_info
471 instead of a subst_info.
472 (tsubst_compound_requirement): Likewise. Fold in
473 error-replaying code from diagnose_compound_requirement.
474 (tsubst_nested_requirement): Take a sat_info instead of a
475 subst_info. Fold in error-replaying code from
476 diagnose_nested_requirement.
477 (tsubst_requirement): Take a sat_info instead of a subst_info.
478 (tsubst_requires_expr): Split into two versions, one that takes
479 a sat_info argument and another that takes a complain and
480 in_decl argument. Remove outdated documentation. Document the
481 effects of the sat_info argument. Don't short-circuit
482 processing of requirements when diagnosing unsatisfaction,
483 mirroring diagnose_requires_expr.
484 (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
485 assert, and se the three-parameter version of tsubst_requires_expr.
486 (diagnose_trait_expr): Make static. Take a template argument
487 vector instead of a parameter mapping.
488 (diagnose_valid_expression): Remove.
489 (diagnose_valid_type): Remove.
490 (diagnose_simple_requirement): Remove.
491 (diagnose_compound_requirement): Remove.
492 (diagnose_type_requirement): Remove.
493 (diagnose_nested_requirement): Remove.
494 (diagnose_requirement): Remove.
495 (diagnose_requires_expr): Remove.
496 (diagnose_atomic_constraint): Take a sat_info instead of a
497 subst_info. Adjust call to diagnose_trait_expr. Call
498 tsubst_requires_expr instead of diagnose_requires_expr.
499 (diagnose_constraints): Remove special casing of REQUIRES_EXPR
500 and just always call constraint_satisfaction_value.
502 2021-03-03 Patrick Palka <ppalka@redhat.com>
504 * constexpr.c (cxx_eval_call_expression): Adjust call to
505 evaluate_concept_check.
506 (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
507 evaluate_requires_expression instead of
508 satisfy_constraint_expression.
509 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
510 * constraint.cc (struct sat_info): Adjust comment about which
511 satisfaction entrypoints use noisy-unsat.
512 (normalize_template_requirements): Remove (and adjust callers
514 (normalize_nontemplate_requirements): Likewise.
515 (tsubst_nested_requirement): Use constraint_satisfaction_value
516 instead of satisfy_constraint_expression, which'll do the
517 noisy replaying of ill-formed quiet satisfaction for us.
518 (decl_satisfied_cache): Adjust comment.
519 (satisfy_constraint): Rename to ...
520 (satisfy_normalized_constraints): ... this.
521 (satisfy_associated_constraints): Remove (and make its
522 callers check for dependent arguments).
523 (satisfy_constraint_expression): Rename to ...
524 (satisfy_nondeclaration_constraints): ... this. Assert that
525 'args' is empty when 't' is a concept-id. Removing handling
526 bare constraint-expressions, and handle REQUIRES_EXPRs
527 specially. Adjust comment accordingly.
528 (satisfy_declaration_constraints): Assert in the two-parameter
529 version that 't' is not a TEMPLATE_DECL. Adjust following
530 removal of normalize_(non)?template_requirements and
531 satisfy_asociated_constraints.
532 (constraint_satisfaction_value): Combine the two- and
533 three-parameter versions in the natural way.
534 (constraints_satisfied_p): Combine the one- and two-parameter
535 versions in the natural way. Improve documentation.
536 (evaluate_requires_expr): Define.
537 (evaluate_concept_check): Remove 'complain' parameter. Use
538 constraint_satisfaction_value instead of
539 satisfy_constraint_expression.
540 (diagnose_nested_requirement): Adjust following renaming of
541 satisfy_constraint_expression.
542 (diagnose_constraints): Handle REQUIRES_EXPR by going through
543 diagnose_requires_expr directly instead of treating it as a
544 constraint-expression. Improve documentation.
545 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
546 to evaluate_concept_check.
547 <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
548 constraints_satisfied_p.
549 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
550 * cp-tree.h (evaluate_requires_expr): Declare.
551 (evaluate_concept_check): Remove tsubst_flag_t parameter.
552 (satisfy_constraint_expression): Remove declaration.
553 (constraints_satisfied_p): Remove one-parameter declaration.
554 Add a default argument to the two-parameter declaration.
555 * cvt.c (convert_to_void): Adjust call to
556 evaluate_concept_check.
558 2021-03-03 Jakub Jelinek <jakub@redhat.com>
561 * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
564 2021-03-03 Marek Polacek <polacek@redhat.com>
568 * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
569 (maybe_aggr_guide): Use the original template type where needed. In
570 a class member template, partially instantiate the result of
571 collect_ctor_idx_types.
572 (do_class_deduction): Defer the deduction until the enclosing
573 scope is non-dependent.
575 2021-03-03 Jason Merrill <jason@redhat.com>
578 * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
579 if it didn't get one before.
581 2021-03-03 Nathan Sidwell <nathan@acm.org>
584 * module.cc (trees_out::decl_node): Small refactor.
585 (depset::hash::add_binding_entity): Return true on meeting an
586 import. Set namespace's import here.
587 (module_state:write_namespaces): Inform of purview too.
588 (module_state:read_namespaces): Adjust.
589 * name-lookup.c (implicitly_export_namespace): Delete.
590 (do_pushdecl): Don't call it.
591 (push_namespace): Likewise, set purview.
592 (add_imported_namespace): Reorder parms.
593 * name-lookup.h (add_imported_namespace): Alter param ordering.
595 2021-03-02 Martin Sebor <msebor@redhat.com>
598 * class.c (build_base_path): Call build_if_nonnull.
599 * cp-tree.h (build_if_nonnull): Declare.
600 * rtti.c (ifnonnull): Rename...
601 (build_if_nonnull): ...to this. Set no-warning bit on COND_EXPR.
602 (build_dynamic_cast_1): Adjust to name change.
604 2021-03-02 Patrick Palka <ppalka@redhat.com>
608 * constraint.cc (type_deducible_p): Don't substitute into the
609 constraints, and instead just pass 'args' to do_auto_deduction
610 as the outer template arguments.
611 (tsubst_parameter_mapping): Remove confused code for handling
612 placeholder type arguments.
613 (normalize_placeholder_type_constraint): Define.
614 (satisfy_constraint_expression): Use it to handle placeholder
616 * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
617 (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
618 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
619 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
620 (make_constrained_placeholder_type): Set
621 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
622 (do_auto_deduction): Clarify comments about the outer_targs
623 parameter. Rework satisfaction of a placeholder type constraint
624 to pass in the complete set of template arguments directly to
625 constraints_satisfied_p.
626 (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
627 instead. Also rebuild the the constraint info on the new auto.
629 2021-03-02 Patrick Palka <ppalka@redhat.com>
631 * constraint.cc (build_parameter_mapping): Rely on the caller to
632 determine the in-scope template parameters.
633 (norm_info::norm_info): Delegate the tsubst_flags_t constructor
634 to the two-parameter constructor. In the two-parameter
635 constructor, fold in the definition of make_context, set
636 initial_parms appropriately, and don't set the now-removed
638 (norm_info::make_context): Remove, now that its only use is
639 inlined into the caller.
640 (norm_info::update_context): Adjust call to
641 build_parameter_mapping to pass in the relevant set of in-scope
643 (norm_info::ctx_parms): Define this member function.
644 (norm_info::context): Initialize to NULL_TREE.
645 (norm_info::orig_decl): Remove this data member.
646 (norm_info::initial_parms): Define this data member.
647 (normalize_atom): Adjust call to build_parameter_mapping to pass
648 in the relevant set of in-scope template parameters. Use
649 info.initial_parms instead of info.orig_decl.
650 (normalize_constraint_expression): Take a norm_info object
651 instead of a bool. Cache the result of normalization.
652 (tsubst_nested_requirement): Call satisfy_constraint_expression
653 instead of satisfy_constraint, so that we normalize on demand.
654 (satisfy_constraint_expression): Handle a NESTED_REQ argument.
655 Adjust call to normalize_constraint_expression.
656 (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
657 to current_template_parms.
658 (diagnose_nested_requirements): Go through
659 satisfy_constraint_expression, as with tsubst_nested_requirement.
661 2021-03-02 Patrick Palka <ppalka@redhat.com>
663 * constraint.cc (tsubst_parameter_mapping): Canonicalize the
664 arguments of a substituted TYPE_ARGUMENT_PACK even if we've
665 started with a TYPE_ARGUMENT_PACK.
666 (finish_requires_expr): Don't set DECL_CONTEXT and
667 CONSTRAINT_VAR_P on each of the introduced parameters here.
668 * parser.c (cp_parser_requirement_parameter_list): Instead set
669 these fields earlier, here.
670 * pt.c (do_auto_deduction): Canonicalize the result of
671 do_auto_deduction. Pass 'complain' to finish_decltype_type.
673 2021-03-02 Patrick Palka <ppalka@redhat.com>
675 * constraint.cc (tsubst_simple_requirement): Just return
676 boolean_true_node on success.
677 (tsubst_type_requirement): Likewise.
678 (tsubst_compound_requirement): Likewise.
679 (tsubst_nested_requirement): Likewise.
680 (tsubst_requirement_body): Remove.
681 (check_constaint_variables): Rename to ...
682 (check_constraint_variables): ... this.
683 (tsubst_constraint_variables): Adjust.
684 (tsubst_requires_expr): Fold tsubst_requirement_body into here.
686 2021-03-01 Nathan Sidwell <nathan@acm.org>
689 * class.c (fixup_type_variants): Propagate mode, precision,
690 alignment & emptiness.
691 * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
692 (trees_in::tree_node): Rematerialize alignment here.
694 2021-02-27 Jason Merrill <jason@redhat.com>
697 * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
700 2021-02-26 Jakub Jelinek <jakub@redhat.com>
702 * parser.c (cp_parser_lambda_declarator_opt): Implement
703 P1102R2 - Down with ()! Make ()s optional before lambda specifiers
704 for -std={c,gnu}++2b or with pedwarn in earlier versions.
706 2021-02-26 Jakub Jelinek <jakub@redhat.com>
709 * lambda.c (is_lambda_ignored_entity): Before checking for
710 LAMBDA_FUNCTION_P, use OVL_FIRST. Drop FUNCTION_DECL check.
712 2021-02-26 Jason Merrill <jason@redhat.com>
715 * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
716 to a class non-type template argument that needs it.
718 2021-02-26 Patrick Palka <ppalka@redhat.com>
721 * pt.c (splice_late_return_type): Rebuild the entire return type
722 if we have to adjust the level of an auto within.
723 (type_uses_auto): Adjust call to find_type_usage.
724 * type-utils.h (find_type_usage): Revert r10-6571 change that
725 made this function return a pointer to the auto node.
727 2021-02-25 Patrick Palka <ppalka@redhat.com>
731 * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
732 TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
734 2021-02-25 Patrick Palka <ppalka@redhat.com>
737 * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
738 (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
740 2021-02-25 Marek Polacek <polacek@redhat.com>
744 * constexpr.c (is_std_construct_at): New overload.
745 (is_std_allocator_allocate): New overload.
746 (cxx_eval_call_expression): Use the new overloads.
747 (cxx_eval_constant_expression): Reject casting
748 from void * as per DR 1312. Don't check can_convert.
750 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
753 * coroutines.cc (struct param_info): Track rvalue refs.
754 (morph_fn_to_coro): Track rvalue refs, and call the promise
755 CTOR with the frame copy of passed parms.
757 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
760 * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
761 set throwing_cleanup marker.
763 2021-02-25 Nathan Sidwell <nathan@acm.org>
766 * module.cc (module_state::inform_cmi_p): Renamed field.
767 (module_state::do_import): Adjust.
768 (init_modules, finish_module_processing): Likewise.
769 (handle_module_option): Likewise.
771 2021-02-25 Nathan Sidwell <nathan@acm.org>
774 * mapper-client.cc (module_client::open_module_client): Fix typo
777 2021-02-24 Nathan Sidwell <nathan@acm.org>
780 * module.cc (ool): New indirection vector.
781 (loc_spans::maybe_propagate): Location is not optional.
782 (loc_spans::open): Likewise. Assert monotonically advancing.
783 (module_for_ordinary_loc): Use ool indirection vector.
784 (module_state::write_prepare_maps): Do not count empty macro
785 expansions. Elide empty spans.
786 (module_state::write_macro_maps): Skip empty expansions.
787 (ool_cmp): New qsort comparator.
788 (module_state::write): Create and destroy ool vector.
789 (name_pending_imports): Fix dump push/pop.
790 (preprocess_module): Likewise. Add more dumping.
791 (preprocessed_module): Likewise.
793 2021-02-24 Iain Sandoe <iain@sandoe.co.uk>
796 * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
797 error reporting when instantiating for a constexpr.
799 2021-02-23 Nathan Sidwell <nathan@acm.org>
802 * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
805 2021-02-23 Patrick Palka <ppalka@redhat.com>
808 * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
809 over from tsubst_copy.
811 2021-02-23 Patrick Palka <ppalka@redhat.com>
813 * pt.c (instantiation_dependent_expression_p): Check
814 processing_template_decl before calling
815 potential_constant_expression.
817 2021-02-22 Nathan Sidwell <nathan@acm.org>
820 * module.cc (struct module_state): Add visited_p flag.
821 (name_pending_imports): Use it to avoid duplicate requests.
822 (preprocess_module): Don't read preprocessor state if we failed to
823 load a module's config.
825 2021-02-22 Nathan Sidwell <nathan@acm.org>
828 * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
830 * module.cc (set_defining_module): Add assert.
832 2021-02-19 Nathan Sidwell <nathan@acm.org>
835 * module.cc (pending_imports): New.
836 (declare_module): Adjust test condition.
837 (name_pending_imports): New.
838 (preprocess_module): Reimplement using pending_imports.
839 (preprocessed_module): Move name-getting to name_pending_imports.
840 * name-lookup.c (append_imported_binding_slot): Assert module
841 ordering is increasing.
843 2021-02-19 Nathan Sidwell <nathan@acm.org>
845 * module.cc (note_cmis): New.
846 (struct module_state): Add inform_read_p bit.
847 (module_state::do_import): Inform of CMI location, if enabled.
848 (init_modules): Canonicalize note_cmis entries.
849 (handle_module_option): Handle -flang-info-module-read=FOO.
851 2021-02-19 Jason Merrill <jason@redhat.com>
854 * call.c (perfect_conversion_p): Limit rvalueness
855 test to reference bindings.
857 2021-02-19 Jason Merrill <jason@redhat.com>
860 * call.c (perfect_conversion_p): New.
861 (perfect_candidate_p): New.
862 (add_candidates): Ignore templates after a perfect non-template.
864 2021-02-18 Nathan Sidwell <nathan@acm.org>
867 * module.cc (canonicalize_header_name): Use
868 cpp_probe_header_unit.
869 (maybe_translate_include): Fix note_includes comparison.
870 (init_modules): Fix note_includes string termination.
872 2021-02-18 Jakub Jelinek <jakub@redhat.com>
875 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
876 cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
877 for immediate function calls.
879 2021-02-17 Nathan Sidwell <nathan@acm.org>
882 * module.cc (struct macro_export): Add GTY markers.
883 (macro_exports): Likewise, us a va_gc Vector.
885 2021-02-17 Jakub Jelinek <jakub@redhat.com>
888 * init.c (build_zero_init_1): For flexible array members just return
889 NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
892 2021-02-17 Nathan Sidwell <nathan@acm.org>
895 * name-lookup.c (do_pushdecl): Don't peek under template_parm
897 (set_identifier_type_value_with_scope): ... or here.
898 (do_pushtag): Only set_identifier_type_value_with_scope at
899 non-class template parm scope, and use parent scope.
901 2021-02-17 Nathan Sidwell <nathan@acm.org>
904 * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
907 2021-02-17 Patrick Palka <ppalka@redhat.com>
911 * tree.c (build_aggr_init_expr): Revert r10-7718 change.
913 2021-02-12 Nathan Sidwell <nathan@acm.org>
915 * module.cc (module_state::write_cluster): Check bindings for
916 imported using-decls.
918 2021-02-12 Nathan Sidwell <nathan@acm.org>
921 * module.cc (trees_in::decl_value): Call add_module_namespace_decl
922 for new namespace-scope entities.
923 (module_state::read_cluster): Don't call add_module_decl here.
924 * name-lookup.h (add_module_decl): Rename to ...
925 (add_module_namespace_decl): ... this.
926 * name-lookup.c (newbinding_bookkeeping): Move into ...
927 (do_pushdecl): ... here. Its only remaining caller.
928 (add_module_decl): Rename to ...
929 (add_module_namespace_decl): ... here. Add checking-assert for
930 circularity. Don't call newbinding_bookkeeping, just extern_c
931 checking and incomplete var checking.
933 2021-02-12 Nathan Sidwell <nathan@acm.org>
937 * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
938 (global_type_node): Delete.
939 (IDENTIFIER_TYPE_VALUE): Delete.
940 (IDENTIFIER_HAS_TYPE_VALUE): Delete.
941 (get_type_value): Delete.
942 * name-lookup.h (identifier_type_value): Delete.
943 * name-lookup.c (check_module_override): Don't
944 SET_IDENTIFIER_TYPE_VALUE here.
945 (do_pushdecl): Nor here.
946 (identifier_type_value_1, identifier_type_value): Delete.
947 (set_identifier_type_value_with_scope): Only
948 SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
949 (pushdecl_nanmespace_level): Remove shadow stack nadgering.
950 (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
951 * call.c (check_dtor_name): Use lookup_name.
952 * decl.c (cxx_init_decl_processing): Drop global_type_node.
953 * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
955 * init.c (get_type_value): Delete.
956 * pt.c (instantiate_class_template_1): Don't call pushtag or
957 SET_IDENTIFIER_TYPE_VALUE here.
958 (tsubst): Assert never an identifier.
959 (dependent_type_p): Drop global_type_node assert.
960 * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
961 to determine ctorness.
963 2021-02-12 Jakub Jelinek <jakub@redhat.com>
966 * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
969 2021-02-12 Jason Merrill <jason@redhat.com>
973 * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
974 (register_parameter_specializations): Not here.
976 2021-02-11 Marek Polacek <polacek@redhat.com>
979 * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
980 for the partial instantiation.
982 2021-02-11 Jakub Jelinek <jakub@redhat.com>
985 * init.c (build_zero_init_1): Handle zero initialiation of
986 flexible array members like initialization of [0] arrays.
987 Use integer_minus_onep instead of comparison to integer_minus_one_node
988 and integer_zerop instead of comparison against size_zero_node.
991 2021-02-11 Marek Polacek <polacek@redhat.com>
994 * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
996 2021-02-11 Patrick Palka <ppalka@redhat.com>
999 * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
1000 lookup result by discarding it if the first element is a
1001 class-scope declaration, otherwise return it.
1002 (push_operator_bindings): Handle an ambiguous lookup result by
1003 doing push_local_binding on each element in the list.
1005 2021-02-11 Marek Polacek <polacek@redhat.com>
1007 * parser.c (cp_parser_selection_statement): Use vec_free.
1009 2021-02-10 Jakub Jelinek <jakub@redhat.com>
1013 * constexpr.c: Include cgraph.h.
1014 (cxx_eval_call_expression): Call varpool_node::finalize_decl on
1015 heap artificial vars.
1016 (cxx_eval_outermost_constant_expr): Remove varpool nodes for
1017 heap artificial vars.
1019 2021-02-10 Nathan Sidwell <nathan@acm.org>
1022 * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
1023 answer if there's no local specialization.
1025 2021-02-09 Nathan Sidwell <nathan@acm.org>
1028 * module.cc (module_state::is_rooted): Rename to ...
1029 (module_state::has_location): ... here. Adjust callers.
1030 (module_state::read_partitions): Adjust validity check.
1031 Don't overwrite a known location.
1033 2021-02-09 Jason Merrill <jason@redhat.com>
1036 * pt.c (mark_decl_instantiated): Exit early if consteval.
1038 2021-02-09 Jason Merrill <jason@redhat.com>
1042 * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
1045 2021-02-09 Jason Merrill <jason@redhat.com>
1049 * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
1052 2021-02-08 Nathan Sidwell <nathan@acm.org>
1054 * decl.c (start_cleanup_fn): Push function into
1057 2021-02-08 Nathan Sidwell <nathan@acm.org>
1060 * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
1061 * decl.c (push_abi_namespace, pop_abi_namespace): Moved
1062 from rtti.c, add default namespace arg.
1063 (check_redeclaration_exception_specification): Allow a lazy
1064 builtin's eh spec to differ from an lready-declared user
1066 (declare_global_var): Use push/pop_abi_namespace.
1067 (get_atexit_node): Push the fndecl into a namespace.
1068 * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
1071 2021-02-08 Marek Polacek <polacek@redhat.com>
1073 * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
1075 2021-02-05 Marek Polacek <polacek@redhat.com>
1078 * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
1080 * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
1081 issuing the -Wvolatile warning. Only set TREE_THIS_VOLATILE if
1082 a warning was emitted.
1084 2021-02-05 Marek Polacek <polacek@redhat.com>
1087 * name-lookup.c (lookup_using_decl): Hoist the destructor check.
1089 2021-02-05 Jakub Jelinek <jakub@redhat.com>
1092 * decl.c (check_array_initializer): For structured bindings, require
1093 the array type to be complete.
1095 2021-02-04 Jason Merrill <jason@redhat.com>
1098 * constraint.cc (build_concept_check_arguments): Remove assert.
1099 (build_concept_check): Allow empty args.
1101 2021-02-04 Tom Greenslade (thomgree) <thomgree@cisco.com>
1104 * call.c (can_convert_array): Extend to handle all valid aggregate
1105 initializers of an array; including by string literals, not just by
1107 (build_aggr_conv): Call can_convert_array more often, not just in
1108 brace-init-list case.
1109 * typeck2.c (array_string_literal_compatible_p): New function.
1110 (digest_init_r): call array_string_literal_compatible_p
1111 * cp-tree.h: (array_string_literal_compatible_p): Declare.
1113 2021-02-04 Jason Merrill <jason@redhat.com>
1116 * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
1118 2021-02-04 Jason Merrill <jason@redhat.com>
1121 * pt.c (tsubst_attribute): Handle error.
1122 (apply_late_template_attributes): Return false on error.
1123 (tsubst_function_decl): Check its return value.
1124 (tsubst_decl): Likewise.
1125 (push_template_decl): Assert current_template_parms.
1126 (tsubst_template_decl): Set current_template_parms.
1128 2021-02-03 Marek Polacek <polacek@redhat.com>
1131 * call.c (struct z_candidate): Mark rewritten and reversed as const.
1132 (struct NonPublicField): Mark operator() as const.
1133 (struct NonTrivialField): Likewise.
1135 2021-02-03 Jason Merrill <jason@redhat.com>
1139 * pt.c (spec_hasher::equal): Set processing_template_decl.
1140 * Make-lang.in (check-g++-strict-gc): Add --param
1141 hash-table-verification-limit=10000.
1143 2021-02-03 Marek Polacek <polacek@redhat.com>
1146 * parser.c (cp_parser_class_specifier_1): Use any possible
1147 DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
1148 (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
1149 * pt.c (tsubst_exception_specification): Stash new_specs into
1150 DEFPARSE_INSTANTIATIONS.
1151 * tree.c (fixup_deferred_exception_variants): Use
1152 UNPARSED_NOEXCEPT_SPEC_P.
1154 2021-02-02 Jason Merrill <jason@redhat.com>
1158 * error.c (dump_expr): Ignore dummy object.
1159 * pt.c (tsubst_baselink): Handle dependent scope.
1161 2021-02-01 Patrick Palka <ppalka@redhat.com>
1164 * constexpr.c (cxx_eval_array_reference): Also set
1165 new_ctx.object when setting new_ctx.ctor.
1167 2021-02-01 Marek Polacek <polacek@redhat.com>
1170 * parser.c (cp_parser_has_attribute_expression): Use
1171 uses_template_parms instead of type_dependent_expression_p.
1173 2021-02-01 Jason Merrill <jason@redhat.com>
1176 * cp-tree.h: Declare it.
1177 * pt.c (comparing_dependent_aliases): New flag.
1178 (template_args_equal, spec_hasher::equal): Set it.
1179 (dependent_alias_template_spec_p): Assert that we don't
1180 get non-types other than error_mark_node.
1181 (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
1182 on complex alias specializations. Set TYPE_DEPENDENT_P here.
1183 (tsubst_decl): Not here.
1184 * module.cc (module_state::read_cluster): Set
1185 comparing_dependent_aliases instead of
1186 comparing_specializations.
1187 * tree.c (cp_tree_equal): Remove comparing_specializations
1189 * typeck.c (structural_comptypes): Adjust.
1190 (comptypes): Remove comparing_specializations handling.
1192 2021-01-29 Nathan Sidwell <nathan@acm.org>
1195 * module.cc (module_state_config): Add num_entities field.
1196 (module_state::read_entities): The entity_ary span is
1198 (module_state::write_config): Write num_entities.
1199 (module_state::read_config): Read num_entities.
1200 (module_state::write): Set config's num_entities.
1201 (module_state::read_initial): Allocate the entity ary
1203 (module_state::read_language): Do not set entity_lwm
1206 2021-01-29 Marek Polacek <polacek@redhat.com>
1209 * parser.c (cp_parser_class_name): If parser->scope is
1210 error_mark_node, return it, otherwise continue.
1212 2021-01-28 Jakub Jelinek <jakub@redhat.com>
1215 * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
1217 2021-01-28 Jakub Jelinek <jakub@redhat.com>
1221 * decl.c (cp_finish_decl): For register vars with asmspec in templates
1222 call set_user_assembler_name and set DECL_HARD_REGISTER.
1223 * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
1224 pass asmspec_tree to cp_finish_decl.
1226 2021-01-28 Nathan Sidwell <nathan@acm.org>
1229 * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
1231 (trees_in::decl_value): Do typedef frobbing only when installing
1232 a new typedef, adjust is_matching_decl call. Swap is_typedef
1234 (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
1235 names and deal with typedef checking.
1237 2021-01-27 Jason Merrill <jason@redhat.com>
1240 * name-lookup.c (lookup_using_decl): Clean up handling
1241 of dependency and inherited constructors.
1242 (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
1243 * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
1245 2021-01-26 Jason Merrill <jason@redhat.com>
1248 * call.c (type_passed_as): Don't mark invisiref restrict.
1250 2021-01-26 Jason Merrill <jason@redhat.com>
1254 * class.c (layout_class_type): An empty field gets size 0.
1255 (is_empty_field): New.
1256 (check_bases): Check it.
1257 * cp-tree.h (is_empty_field): Declare it.
1258 * constexpr.c (cxx_eval_store_expression): Check it.
1259 (cx_check_missing_mem_inits): Likewise.
1260 * init.c (perform_member_init): Likewise.
1261 * typeck2.c (process_init_constructor_record): Likewise.
1263 2021-01-25 Martin Sebor <msebor@redhat.com>
1266 * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
1268 2021-01-25 Jason Merrill <jason@redhat.com>
1271 * constexpr.c (get_or_insert_ctor_field): Add check.
1272 (cxx_eval_store_expression): Handle discontinuity of refs.
1274 2021-01-23 Anthony Sharp <anthonysharp15@gmail.com>
1276 * call.c (complain_about_access): Altered function.
1277 * cp-tree.h (complain_about_access): Changed parameters of function.
1278 (get_parent_with_private_access): Declared new function.
1279 * search.c (get_parent_with_private_access): Defined new function.
1280 * semantics.c (enforce_access): Modified function.
1281 * typeck.c (complain_about_unrecognized_member): Updated function
1282 arguments in complain_about_access.
1284 2021-01-23 Patrick Palka <ppalka@redhat.com>
1287 * cp-tree.h (shared_member_p): Adjust declaration.
1288 * parser.c (cp_parser_init_declarator): If the storage class
1289 specifier is sc_static, pass true for static_p to
1290 cp_parser_declarator.
1291 (cp_parser_direct_declarator): Don't do inject_this_parm when
1292 the declarator is a friend.
1293 * search.c (shared_member_p): Change return type to bool and
1294 adjust function body accordingly. Return false for a dependent
1295 USING_DECL instead of aborting.
1296 * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
1297 even when type-dependent.
1299 2021-01-22 Marek Polacek <polacek@redhat.com>
1302 * parser.c (inject_parm_decls): Remove a redundant assignment.
1303 (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
1304 before calling inject_parm_decls.
1306 2021-01-22 Jason Merrill <jason@redhat.com>
1309 * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
1311 2021-01-22 Jakub Jelinek <jakub@redhat.com>
1314 * init.c (build_zero_init_1): Revert the 2018-03-06 change to
1315 return build_zero_cst for reference types.
1316 * typeck2.c (process_init_constructor_record): Instead call
1317 build_zero_cst here during error recovery instead of build_zero_init.
1319 2021-01-22 Marek Polacek <polacek@redhat.com>
1322 * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
1323 warnings regardless of abi_version_at_least.
1324 (write_expression): When the expression is a dependent name
1325 and an operator name, write "on" before writing its name.
1327 2021-01-22 Marek Polacek <polacek@redhat.com>
1330 * pt.c (instantiate_class_template_1): Instantiate members
1331 marked with attribute used only after we're done instantiating
1334 2021-01-21 Patrick Palka <ppalka@redhat.com>
1337 * semantics.c (finish_decltype_type): Set up a cp_unevaluated
1338 sentinel at the start of the function. Remove a now-redundant
1339 manual adjustment of cp_unevaluated_operand.
1341 2021-01-21 Nathan Sidwell <nathan@acm.org>
1344 * module.cc (depset::hash::find_dependencies): Add
1346 (trees_out::core_vals): Check state before calling
1348 (sort_cluster, module_state::write): Adjust
1349 find_dependencies call.
1351 2021-01-21 Jakub Jelinek <jakub@redhat.com>
1354 * constexpr.c (check_for_return_continue_data): Add break_stmt member.
1355 (check_for_return_continue): Also look for BREAK_STMT. Handle
1356 SWITCH_STMT by ignoring break_stmt from its body.
1357 (potential_constant_expression_1) <case FOR_STMT>,
1358 <case WHILE_STMT>: If the condition isn't constant true, check if
1359 the loop body can contain a return stmt.
1360 <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
1361 <case IF_STMT>: If recursion with tf_none is successful,
1362 merge *jump_target from the branches - returns with highest priority,
1363 breaks or continues lower. If then branch is potentially constant and
1364 doesn't return, check the else branch if it could return, break or
1367 2021-01-21 Nathan Sidwell <nathan@acm.org>
1370 * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
1372 2021-01-20 Nathan Sidwell <nathan@acm.org>
1374 * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
1377 2021-01-20 Patrick Palka <ppalka@redhat.com>
1380 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
1381 CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
1382 adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
1384 2021-01-20 Patrick Palka <ppalka@redhat.com>
1387 * parser.c (cp_parser_class_head): Defer access checking when
1388 parsing the base-clause until all bases are seen and attached
1390 * pt.c (instantiate_class_template): Likewise when substituting
1391 into dependent bases.
1393 2021-01-20 Jakub Jelinek <jakub@redhat.com>
1396 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
1397 error_operand_p, remove clause without further checking. Check
1398 for non-NULL TYPE_NAME.
1400 2021-01-19 Marek Polacek <polacek@redhat.com>
1403 * pt.c (maybe_instantiate_noexcept): Return false if FN is
1406 2021-01-19 Marek Polacek <polacek@redhat.com>
1409 * name-lookup.c (push_using_decl_bindings): New, broken out of...
1410 (finish_nonmember_using_decl): ...here.
1411 * name-lookup.h (push_using_decl_bindings): Update declaration.
1412 * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
1414 2021-01-19 Patrick Palka <ppalka@redhat.com>
1418 * search.c (friend_accessible_p): If scope is a hidden friend
1419 defined inside a dependent class, consider access from the
1421 * parser.c (cp_parser_late_parsing_for_member): Don't push a
1422 dk_no_check access state.
1424 2021-01-19 Marek Polacek <polacek@redhat.com>
1427 * parser.c (cp_parser_class_specifier_1): Perform late-parsing
1428 of NSDMIs before late-parsing of noexcept-specifiers.
1430 2021-01-19 Nathan Sidwell <nathan@acm.org>
1432 * module.cc (identifier): Merge overloads.
1434 2021-01-19 Nathan Sidwell <nathan@acm.org>
1437 * module.cc (trees_out::write_location): Make static.
1439 2021-01-16 Kwok Cheung Yeung <kcy@codesourcery.com>
1441 * parser.c (cp_parser_omp_clause_detach): New.
1442 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
1443 (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
1444 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
1445 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
1446 Prevent use of detach with mergeable and overriding the data sharing
1447 mode of the event handle.
1449 2021-01-15 Nathan Sidwell <nathan@acm.org>
1452 * tree.c (cp_build_qualified_type_real): Propagate an array's
1453 dependentness to the copy, if known.
1455 2021-01-15 Jason Merrill <jason@redhat.com>
1458 * call.c (unsafe_return_slot_p): Return int.
1459 (init_by_return_slot_p): Split out from...
1460 (unsafe_copy_elision_p): ...here.
1461 (unsafe_copy_elision_p_opt): New name for old meaning.
1462 (build_over_call): Adjust.
1463 (make_safe_copy_elision): New.
1464 * typeck2.c (split_nonconstant_init_1): Elide copy from safe
1465 list-initialization.
1466 * cp-tree.h: Adjust.
1468 2021-01-15 Jason Merrill <jason@redhat.com>
1470 * call.c (base_ctor_for, make_base_init_ok): New.
1471 (build_over_call): Use make_base_init_ok.
1473 2021-01-15 Jason Merrill <jason@redhat.com>
1476 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
1477 if we got a CONSTRUCTOR.
1479 2021-01-15 Nathan Sidwell <nathan@acm.org>
1482 * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
1484 2021-01-14 Jason Merrill <jason@redhat.com>
1486 * typeck2.c (process_init_constructor_record): Use fldtype
1487 variable consistently.
1489 2021-01-14 Nathan Sidwell <nathan@acm.org>
1492 * tree.c (cp_tree_equal): Correct map_context logic.
1494 2021-01-13 Marek Polacek <polacek@redhat.com>
1497 * name-lookup.c (push_using_decl_bindings): New.
1498 * name-lookup.h (push_using_decl_bindings): Declare.
1499 * pt.c (tsubst_expr): Call push_using_decl_bindings.
1501 2021-01-13 Nathan Sidwell <nathan@acm.org>
1504 * module.cc (module_add_import_initializers): Pass a
1505 zero-element argument vector.
1507 2021-01-12 Patrick Palka <ppalka@redhat.com>
1510 * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
1511 the template of a CTAD placeholder.
1513 2021-01-12 Marek Polacek <polacek@redhat.com>
1516 * typeck2.c (process_init_constructor_record): Don't emit
1517 -Wmissing-field-initializers warnings in unevaluated contexts.
1519 2021-01-11 Jakub Jelinek <jakub@redhat.com>
1522 * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
1524 (mark_abi_tags_r): Likewise.
1525 * decl2.c (min_vis_r): Likewise.
1526 * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
1529 2021-01-08 Patrick Palka <ppalka@redhat.com>
1532 * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
1533 instead of AGGREGATE_TYPE_P before calling replace_result_decl.
1535 2021-01-08 Patrick Palka <ppalka@redhat.com>
1538 * semantics.c (check_accessibility_of_qualified_id): Punt if
1539 we're checking access of a scoped non-static member inside a
1542 2021-01-07 Jakub Jelinek <jakub@redhat.com>
1545 * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
1546 cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
1548 (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
1550 2021-01-07 Marek Polacek <polacek@redhat.com>
1553 * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
1554 !late_return_type block.
1556 2021-01-07 Jason Merrill <jason@redhat.com>
1558 * constexpr.c (cxx_bind_parameters_in_call): Add comment.
1559 (cxx_eval_store_expression): Add comment.
1561 2021-01-07 Jason Merrill <jason@redhat.com>
1563 * call.c (has_next): Factor out from...
1564 (next_conversion): ...here.
1565 (strip_standard_conversion): And here.
1566 (is_subseq): And here.
1567 (build_conv): Check it.
1568 (standard_conversion): Don't call build_conv
1571 2021-01-06 Martin Sebor <msebor@redhat.com>
1574 * error.c (dump_expr): Call c_pretty_printer::unary_expression.
1576 2021-01-05 Patrick Palka <ppalka@redhat.com>
1578 * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
1579 the type of the NTTP, substitute into the type again. If the
1580 type is still dependent, don't unify the NTTP.
1582 2021-01-05 Jakub Jelinek <jakub@redhat.com>
1584 * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
1585 $(CODYLIB) after $(BACKEND).
1587 2021-01-05 Jakub Jelinek <jakub@redhat.com>
1590 * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
1591 Punt if lval is true.
1592 * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
1593 the result if it has a class type.
1595 2021-01-05 Marek Polacek <polacek@redhat.com>
1598 * pt.c (resolve_overloaded_unification): Call
1599 maybe_instantiate_noexcept after instantiating the function
1602 2021-01-05 Nathan Sidwell <nathan@acm.org>
1604 * parser.c (cp_parser_module_declaration): Alter diagnostic
1605 text to say where is permissable.
1607 2021-01-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1610 * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
1612 2021-01-02 Jan Hubicka <jh@suse.cz>
1614 * cp-tree.h (cp_tree_c_finish_parsing): Declare.
1615 * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
1616 * tree.c (cp_tree_c_finish_parsing): New function.
1618 2021-01-01 Jakub Jelinek <jakub@redhat.com>
1620 * ChangeLog-2020: Rotate ChangeLog. New file.
1623 Copyright (C) 2021 Free Software Foundation, Inc.
1625 Copying and distribution of this file, with or without modification,
1626 are permitted in any medium without royalty provided the copyright
1627 notice and this notice are preserved.