1 2021-02-01 Patrick Palka <ppalka@redhat.com>
4 * constexpr.c (cxx_eval_array_reference): Also set
5 new_ctx.object when setting new_ctx.ctor.
7 2021-02-01 Marek Polacek <polacek@redhat.com>
10 * parser.c (cp_parser_has_attribute_expression): Use
11 uses_template_parms instead of type_dependent_expression_p.
13 2021-02-01 Jason Merrill <jason@redhat.com>
16 * cp-tree.h: Declare it.
17 * pt.c (comparing_dependent_aliases): New flag.
18 (template_args_equal, spec_hasher::equal): Set it.
19 (dependent_alias_template_spec_p): Assert that we don't
20 get non-types other than error_mark_node.
21 (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
22 on complex alias specializations. Set TYPE_DEPENDENT_P here.
23 (tsubst_decl): Not here.
24 * module.cc (module_state::read_cluster): Set
25 comparing_dependent_aliases instead of
26 comparing_specializations.
27 * tree.c (cp_tree_equal): Remove comparing_specializations
29 * typeck.c (structural_comptypes): Adjust.
30 (comptypes): Remove comparing_specializations handling.
32 2021-01-29 Nathan Sidwell <nathan@acm.org>
35 * module.cc (module_state_config): Add num_entities field.
36 (module_state::read_entities): The entity_ary span is
38 (module_state::write_config): Write num_entities.
39 (module_state::read_config): Read num_entities.
40 (module_state::write): Set config's num_entities.
41 (module_state::read_initial): Allocate the entity ary
43 (module_state::read_language): Do not set entity_lwm
46 2021-01-29 Marek Polacek <polacek@redhat.com>
49 * parser.c (cp_parser_class_name): If parser->scope is
50 error_mark_node, return it, otherwise continue.
52 2021-01-28 Jakub Jelinek <jakub@redhat.com>
55 * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
57 2021-01-28 Jakub Jelinek <jakub@redhat.com>
61 * decl.c (cp_finish_decl): For register vars with asmspec in templates
62 call set_user_assembler_name and set DECL_HARD_REGISTER.
63 * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
64 pass asmspec_tree to cp_finish_decl.
66 2021-01-28 Nathan Sidwell <nathan@acm.org>
69 * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
71 (trees_in::decl_value): Do typedef frobbing only when installing
72 a new typedef, adjust is_matching_decl call. Swap is_typedef
74 (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
75 names and deal with typedef checking.
77 2021-01-27 Jason Merrill <jason@redhat.com>
80 * name-lookup.c (lookup_using_decl): Clean up handling
81 of dependency and inherited constructors.
82 (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
83 * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
85 2021-01-26 Jason Merrill <jason@redhat.com>
88 * call.c (type_passed_as): Don't mark invisiref restrict.
90 2021-01-26 Jason Merrill <jason@redhat.com>
94 * class.c (layout_class_type): An empty field gets size 0.
95 (is_empty_field): New.
96 (check_bases): Check it.
97 * cp-tree.h (is_empty_field): Declare it.
98 * constexpr.c (cxx_eval_store_expression): Check it.
99 (cx_check_missing_mem_inits): Likewise.
100 * init.c (perform_member_init): Likewise.
101 * typeck2.c (process_init_constructor_record): Likewise.
103 2021-01-25 Martin Sebor <msebor@redhat.com>
106 * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
108 2021-01-25 Jason Merrill <jason@redhat.com>
111 * constexpr.c (get_or_insert_ctor_field): Add check.
112 (cxx_eval_store_expression): Handle discontinuity of refs.
114 2021-01-23 Anthony Sharp <anthonysharp15@gmail.com>
116 * call.c (complain_about_access): Altered function.
117 * cp-tree.h (complain_about_access): Changed parameters of function.
118 (get_parent_with_private_access): Declared new function.
119 * search.c (get_parent_with_private_access): Defined new function.
120 * semantics.c (enforce_access): Modified function.
121 * typeck.c (complain_about_unrecognized_member): Updated function
122 arguments in complain_about_access.
124 2021-01-23 Patrick Palka <ppalka@redhat.com>
127 * cp-tree.h (shared_member_p): Adjust declaration.
128 * parser.c (cp_parser_init_declarator): If the storage class
129 specifier is sc_static, pass true for static_p to
130 cp_parser_declarator.
131 (cp_parser_direct_declarator): Don't do inject_this_parm when
132 the declarator is a friend.
133 * search.c (shared_member_p): Change return type to bool and
134 adjust function body accordingly. Return false for a dependent
135 USING_DECL instead of aborting.
136 * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
137 even when type-dependent.
139 2021-01-22 Marek Polacek <polacek@redhat.com>
142 * parser.c (inject_parm_decls): Remove a redundant assignment.
143 (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
144 before calling inject_parm_decls.
146 2021-01-22 Jason Merrill <jason@redhat.com>
149 * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
151 2021-01-22 Jakub Jelinek <jakub@redhat.com>
154 * init.c (build_zero_init_1): Revert the 2018-03-06 change to
155 return build_zero_cst for reference types.
156 * typeck2.c (process_init_constructor_record): Instead call
157 build_zero_cst here during error recovery instead of build_zero_init.
159 2021-01-22 Marek Polacek <polacek@redhat.com>
162 * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
163 warnings regardless of abi_version_at_least.
164 (write_expression): When the expression is a dependent name
165 and an operator name, write "on" before writing its name.
167 2021-01-22 Marek Polacek <polacek@redhat.com>
170 * pt.c (instantiate_class_template_1): Instantiate members
171 marked with attribute used only after we're done instantiating
174 2021-01-21 Patrick Palka <ppalka@redhat.com>
177 * semantics.c (finish_decltype_type): Set up a cp_unevaluated
178 sentinel at the start of the function. Remove a now-redundant
179 manual adjustment of cp_unevaluated_operand.
181 2021-01-21 Nathan Sidwell <nathan@acm.org>
184 * module.cc (depset::hash::find_dependencies): Add
186 (trees_out::core_vals): Check state before calling
188 (sort_cluster, module_state::write): Adjust
189 find_dependencies call.
191 2021-01-21 Jakub Jelinek <jakub@redhat.com>
194 * constexpr.c (check_for_return_continue_data): Add break_stmt member.
195 (check_for_return_continue): Also look for BREAK_STMT. Handle
196 SWITCH_STMT by ignoring break_stmt from its body.
197 (potential_constant_expression_1) <case FOR_STMT>,
198 <case WHILE_STMT>: If the condition isn't constant true, check if
199 the loop body can contain a return stmt.
200 <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
201 <case IF_STMT>: If recursion with tf_none is successful,
202 merge *jump_target from the branches - returns with highest priority,
203 breaks or continues lower. If then branch is potentially constant and
204 doesn't return, check the else branch if it could return, break or
207 2021-01-21 Nathan Sidwell <nathan@acm.org>
210 * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
212 2021-01-20 Nathan Sidwell <nathan@acm.org>
214 * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
217 2021-01-20 Patrick Palka <ppalka@redhat.com>
220 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
221 CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
222 adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
224 2021-01-20 Patrick Palka <ppalka@redhat.com>
227 * parser.c (cp_parser_class_head): Defer access checking when
228 parsing the base-clause until all bases are seen and attached
230 * pt.c (instantiate_class_template): Likewise when substituting
231 into dependent bases.
233 2021-01-20 Jakub Jelinek <jakub@redhat.com>
236 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
237 error_operand_p, remove clause without further checking. Check
238 for non-NULL TYPE_NAME.
240 2021-01-19 Marek Polacek <polacek@redhat.com>
243 * pt.c (maybe_instantiate_noexcept): Return false if FN is
246 2021-01-19 Marek Polacek <polacek@redhat.com>
249 * name-lookup.c (push_using_decl_bindings): New, broken out of...
250 (finish_nonmember_using_decl): ...here.
251 * name-lookup.h (push_using_decl_bindings): Update declaration.
252 * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
254 2021-01-19 Patrick Palka <ppalka@redhat.com>
258 * search.c (friend_accessible_p): If scope is a hidden friend
259 defined inside a dependent class, consider access from the
261 * parser.c (cp_parser_late_parsing_for_member): Don't push a
262 dk_no_check access state.
264 2021-01-19 Marek Polacek <polacek@redhat.com>
267 * parser.c (cp_parser_class_specifier_1): Perform late-parsing
268 of NSDMIs before late-parsing of noexcept-specifiers.
270 2021-01-19 Nathan Sidwell <nathan@acm.org>
272 * module.cc (identifier): Merge overloads.
274 2021-01-19 Nathan Sidwell <nathan@acm.org>
277 * module.cc (trees_out::write_location): Make static.
279 2021-01-16 Kwok Cheung Yeung <kcy@codesourcery.com>
281 * parser.c (cp_parser_omp_clause_detach): New.
282 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
283 (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
284 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
285 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
286 Prevent use of detach with mergeable and overriding the data sharing
287 mode of the event handle.
289 2021-01-15 Nathan Sidwell <nathan@acm.org>
292 * tree.c (cp_build_qualified_type_real): Propagate an array's
293 dependentness to the copy, if known.
295 2021-01-15 Jason Merrill <jason@redhat.com>
298 * call.c (unsafe_return_slot_p): Return int.
299 (init_by_return_slot_p): Split out from...
300 (unsafe_copy_elision_p): ...here.
301 (unsafe_copy_elision_p_opt): New name for old meaning.
302 (build_over_call): Adjust.
303 (make_safe_copy_elision): New.
304 * typeck2.c (split_nonconstant_init_1): Elide copy from safe
308 2021-01-15 Jason Merrill <jason@redhat.com>
310 * call.c (base_ctor_for, make_base_init_ok): New.
311 (build_over_call): Use make_base_init_ok.
313 2021-01-15 Jason Merrill <jason@redhat.com>
316 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
317 if we got a CONSTRUCTOR.
319 2021-01-15 Nathan Sidwell <nathan@acm.org>
322 * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
324 2021-01-14 Jason Merrill <jason@redhat.com>
326 * typeck2.c (process_init_constructor_record): Use fldtype
327 variable consistently.
329 2021-01-14 Nathan Sidwell <nathan@acm.org>
332 * tree.c (cp_tree_equal): Correct map_context logic.
334 2021-01-13 Marek Polacek <polacek@redhat.com>
337 * name-lookup.c (push_using_decl_bindings): New.
338 * name-lookup.h (push_using_decl_bindings): Declare.
339 * pt.c (tsubst_expr): Call push_using_decl_bindings.
341 2021-01-13 Nathan Sidwell <nathan@acm.org>
344 * module.cc (module_add_import_initializers): Pass a
345 zero-element argument vector.
347 2021-01-12 Patrick Palka <ppalka@redhat.com>
350 * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
351 the template of a CTAD placeholder.
353 2021-01-12 Marek Polacek <polacek@redhat.com>
356 * typeck2.c (process_init_constructor_record): Don't emit
357 -Wmissing-field-initializers warnings in unevaluated contexts.
359 2021-01-11 Jakub Jelinek <jakub@redhat.com>
362 * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
364 (mark_abi_tags_r): Likewise.
365 * decl2.c (min_vis_r): Likewise.
366 * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
369 2021-01-08 Patrick Palka <ppalka@redhat.com>
372 * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
373 instead of AGGREGATE_TYPE_P before calling replace_result_decl.
375 2021-01-08 Patrick Palka <ppalka@redhat.com>
378 * semantics.c (check_accessibility_of_qualified_id): Punt if
379 we're checking access of a scoped non-static member inside a
382 2021-01-07 Jakub Jelinek <jakub@redhat.com>
385 * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
386 cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
388 (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
390 2021-01-07 Marek Polacek <polacek@redhat.com>
393 * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
394 !late_return_type block.
396 2021-01-07 Jason Merrill <jason@redhat.com>
398 * constexpr.c (cxx_bind_parameters_in_call): Add comment.
399 (cxx_eval_store_expression): Add comment.
401 2021-01-07 Jason Merrill <jason@redhat.com>
403 * call.c (has_next): Factor out from...
404 (next_conversion): ...here.
405 (strip_standard_conversion): And here.
406 (is_subseq): And here.
407 (build_conv): Check it.
408 (standard_conversion): Don't call build_conv
411 2021-01-06 Martin Sebor <msebor@redhat.com>
414 * error.c (dump_expr): Call c_pretty_printer::unary_expression.
416 2021-01-05 Patrick Palka <ppalka@redhat.com>
418 * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
419 the type of the NTTP, substitute into the type again. If the
420 type is still dependent, don't unify the NTTP.
422 2021-01-05 Jakub Jelinek <jakub@redhat.com>
424 * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
425 $(CODYLIB) after $(BACKEND).
427 2021-01-05 Jakub Jelinek <jakub@redhat.com>
430 * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
431 Punt if lval is true.
432 * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
433 the result if it has a class type.
435 2021-01-05 Marek Polacek <polacek@redhat.com>
438 * pt.c (resolve_overloaded_unification): Call
439 maybe_instantiate_noexcept after instantiating the function
442 2021-01-05 Nathan Sidwell <nathan@acm.org>
444 * parser.c (cp_parser_module_declaration): Alter diagnostic
445 text to say where is permissable.
447 2021-01-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
450 * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
452 2021-01-02 Jan Hubicka <jh@suse.cz>
454 * cp-tree.h (cp_tree_c_finish_parsing): Declare.
455 * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
456 * tree.c (cp_tree_c_finish_parsing): New function.
458 2021-01-01 Jakub Jelinek <jakub@redhat.com>
460 * ChangeLog-2020: Rotate ChangeLog. New file.
463 Copyright (C) 2021 Free Software Foundation, Inc.
465 Copying and distribution of this file, with or without modification,
466 are permitted in any medium without royalty provided the copyright
467 notice and this notice are preserved.