1 2021-12-12 Jonathan Wakely <jwakely@redhat.com>
3 * error.c: Define INCLUDE_MEMORY instead of
6 * name-lookup.c: Likewise.
7 (class namespace_limit_reached): Use std::unique_ptr instead of
9 (suggest_alternatives_for): Use std::move instead of gnu::move.
10 (suggest_alternatives_in_other_namespaces): Likewise.
11 * parser.c: Define INCLUDE_MEMORY instead of INCLUDE_UNIQUE_PTR.
13 2021-12-09 Marek Polacek <polacek@redhat.com>
16 * parser.c (cp_parser_decltype): Clear
17 auto_is_implicit_function_template_parm_p.
18 (cp_parser_type_id_1): Give errors only when !cp_parser_simulate_error.
19 (cp_parser_parameter_declaration): Clear
20 auto_is_implicit_function_template_parm_p after parsing the
22 (cp_parser_sizeof_operand): Clear
23 auto_is_implicit_function_template_parm_p.
25 2021-12-09 Jakub Jelinek <jakub@redhat.com>
28 * module.cc (nop): Add another void * argument.
29 * name-lookup.c (resort_member_name_cmp): Pass the same pointer twice
30 to resort_data.new_value.
32 2021-12-08 Chung-Lin Tang <cltang@codesourcery.com>
34 * parser.c (struct omp_dim): New struct type for use inside
35 cp_parser_omp_var_list_no_open.
36 (cp_parser_omp_var_list_no_open): Allow multiple levels of array and
37 component accesses in array section base-pointer expression.
38 (cp_parser_omp_all_clauses): Set 'allow_deref' to true in call to
39 cp_parser_omp_var_list for to/from clauses.
40 * semantics.c (handle_omp_array_sections_1): Extend allowed range
41 of base-pointer expressions involving INDIRECT/MEM/ARRAY_REF and
43 (handle_omp_array_sections): Adjust pointer map generation of
45 (finish_omp_clauses): Extend allowed ranged of expressions
46 involving INDIRECT/MEM/ARRAY_REF and POINTER_PLUS_EXPR.
48 2021-12-08 Chung-Lin Tang <cltang@codesourcery.com>
51 * cp-tree.h (finish_omp_target): New declaration.
52 (finish_omp_target_clauses): Likewise.
53 * parser.c (cp_parser_omp_clause_map): Adjust call to
54 cp_parser_omp_var_list_no_open to set 'allow_deref' argument to true.
55 (cp_parser_omp_target): Factor out code, adjust into calls to new
56 function finish_omp_target.
57 * pt.c (tsubst_expr): Add call to finish_omp_target_clauses for
59 * semantics.c (handle_omp_array_sections_1): Add handling to create
60 'this->member' from 'member' FIELD_DECL. Remove case of rejecting
61 'this' when not in declare simd.
62 (handle_omp_array_sections): Likewise.
63 (finish_omp_clauses): Likewise. Adjust to allow 'this[]' in OpenMP
64 map clauses. Handle 'A->member' case in map clauses. Remove case of
65 rejecting 'this' when not in declare simd.
66 (struct omp_target_walk_data): New struct for walking over
67 target-directive tree body.
68 (finish_omp_target_clauses_r): New function for tree walk.
69 (finish_omp_target_clauses): New function.
70 (finish_omp_target): New function.
72 2021-12-07 Marek Polacek <polacek@redhat.com>
75 * typeck.c (is_bitfield_expr_with_lowered_type) <case MODIFY_EXPR>:
76 Handle UNARY_PLUS_EXPR, NEGATE_EXPR, NON_LVALUE_EXPR, BIT_NOT_EXPR,
79 2021-12-04 Jakub Jelinek <jakub@redhat.com>
81 * cp-tree.h (is_byte_access_type_not_plain_char): Declare.
82 * tree.c (is_byte_access_type_not_plain_char): New function.
83 * constexpr.c (clear_uchar_or_std_byte_in_mask): New function.
84 (cxx_eval_bit_cast): Don't error about padding bits if target
85 type is unsigned char or std::byte, instead return no clearing
86 ctor. Use clear_uchar_or_std_byte_in_mask.
88 2021-12-03 Jason Merrill <jason@redhat.com>
90 * error.c (current_dump_scope): New variable.
91 (dump_scope): Check it.
92 (dump_function_decl): Set it.
94 2021-12-03 Marek Polacek <polacek@redhat.com>
97 * cp-gimplify.c (cp_fold): Don't recurse if maybe_undo_parenthesized_ref
98 doesn't change its argument.
99 * pt.c (do_auto_deduction): Don't strip REFERENCE_REF_P trees if they
100 are REF_PARENTHESIZED_P. Use stripped_init when checking for
102 * semantics.c (force_paren_expr): Set REF_PARENTHESIZED_P on
103 REFERENCE_REF_P trees too.
104 (maybe_undo_parenthesized_ref): Remove dead code.
106 2021-12-02 Marek Polacek <polacek@redhat.com>
109 * pt.c (expand_integer_pack): Call
110 instantiate_non_dependent_expr_sfinae.
112 2021-12-02 Marek Polacek <polacek@redhat.com>
115 * cxx-pretty-print.c (pp_cxx_parameter_mapping): Print "<unnamed>"
116 rather than crash on an unnamed template parameter.
118 2021-12-01 Jason Merrill <jason@redhat.com>
121 * constexpr.c (cxx_eval_binary_expression): Use
122 fold_binary_initializer_loc if manifestly cxeval.
124 2021-11-30 Jason Merrill <jason@redhat.com>
126 * cp-gimplify.c (genericize_if_stmt): Always build a COND_EXPR.
128 2021-11-30 Richard Biener <rguenther@suse.de>
130 * logic.cc (cnf_size_r): Remove unreachable and inconsistently
131 placed gcc_unreachable ()s.
132 * pt.c (iterative_hash_template_arg): Remove unreachable
133 gcc_unreachable and return.
135 2021-11-30 Thomas Schwinge <thomas@codesourcery.com>
137 * semantics.c (finish_omp_clauses): Remove "gang reduction on an
138 orphan loop" checking.
140 2021-11-30 Cesar Philippidis <cesar@codesourcery.com>
141 Thomas Schwinge <thomas@codesourcery.com>
143 * semantics.c (finish_omp_clauses): Emit an error on orphan
144 OpenACC gang reductions.
146 2021-11-30 Jakub Jelinek <jakub@redhat.com>
148 * cp-gimplify.c (cp_fold_r): Perform folding of
149 std::source_location::current() calls here...
150 (cp_fold): ... rather than here.
152 2021-11-30 Richard Biener <rguenther@suse.de>
154 * parser.c (cp_parser_postfix_expression): Remove
156 * pt.c (tsubst_expr): Remove unreachable breaks.
158 2021-11-29 Eric Gallager <egallager@gcc.gnu.org>
161 * Make-lang.in: Use ETAGS variable in TAGS target.
163 2021-11-29 Patrick Palka <ppalka@redhat.com>
166 * parser.c (cp_parser_lambda_introducer): In C++17, don't
167 diagnose a redundant 'this' capture alongside a by-copy
168 capture default unless -pedantic. Move the diagnostic into
169 -Wc++20-extensions and adjust wording accordingly.
171 2021-11-26 Jakub Jelinek <jakub@redhat.com>
174 * cp-tree.h (struct ptrmem_cst): Add locus member.
175 (PTRMEM_CST_LOCATION): Define.
176 * tree.c (make_ptrmem_cst): Set PTRMEM_CST_LOCATION to input_location.
177 (cp_expr_location): Return PTRMEM_CST_LOCATION for PTRMEM_CST.
178 * typeck.c (build_x_unary_op): Overwrite PTRMEM_CST_LOCATION for
179 PTRMEM_CST instead of calling maybe_wrap_with_location.
180 (cp_build_addr_expr_1): Don't diagnose taking address of
181 immediate functions here. Instead when taking their address make
182 sure the returned ADDR_EXPR has EXPR_LOCATION set.
183 (expand_ptrmemfunc_cst): Copy over PTRMEM_CST_LOCATION to ADDR_EXPR's
185 (convert_for_assignment): Use cp_expr_loc_or_input_loc instead of
187 * pt.c (tsubst_copy): Use build1_loc instead of build1. Ensure
188 ADDR_EXPR of immediate function has EXPR_LOCATION set.
189 * cp-gimplify.c (cp_fold_r): Diagnose taking address of immediate
190 functions here. For consteval if don't walk THEN_CLAUSE.
191 (cp_genericize_r): Move evaluation of calls to
192 std::source_location::current from here to...
193 (cp_fold): ... here. Don't assert calls to immediate functions must
194 be source_location_current_p, instead only constant evaluate
195 calls to source_location_current_p.
197 2021-11-25 Jakub Jelinek <jakub@redhat.com>
200 * pt.c (apply_late_template_attributes): Return early if there are no
201 dependent attributes.
203 2021-11-25 Jakub Jelinek <jakub@redhat.com>
206 * cp-tree.h (build_op_subscript): Implement P2128R6
207 - Multidimensional subscript operator. Declare.
208 (class releasing_vec): Add release method.
209 (grok_array_decl): Remove bool argument, add vec<tree, va_gc> **
210 and tsubst_flags_t arguments.
211 (build_min_non_dep_op_overload): Declare another overload.
212 * parser.c (cp_parser_parenthesized_expression_list_elt): New function.
213 (cp_parser_postfix_open_square_expression): Mention C++23 syntax in
214 function comment. For C++23 parse zero or more than one initializer
215 clauses in expression list, adjust grok_array_decl caller.
216 (cp_parser_parenthesized_expression_list): Use
217 cp_parser_parenthesized_expression_list_elt.
218 (cp_parser_builtin_offsetof): Adjust grok_array_decl caller.
219 * decl.c (grok_op_properties): For C++23 don't check number
220 of arguments of operator[].
221 * decl2.c (grok_array_decl): Remove decltype_p argument, add
222 index_exp_list and complain arguments. If index_exp is NULL,
223 handle *index_exp_list as the subscript expression list.
224 * tree.c (build_min_non_dep_op_overload): New overload.
225 * call.c (add_operator_candidates, build_over_call): Adjust comments
226 for removal of build_new_op_1.
227 (build_op_subscript): New function.
228 * pt.c (tsubst_copy_and_build_call_args): New function.
229 (tsubst_copy_and_build) <case ARRAY_REF>: If second
230 operand is magic CALL_EXPR with ovl_op_identifier (ARRAY_REF)
231 as CALL_EXPR_FN, tsubst CALL_EXPR arguments including expanding
232 pack expressions in it and call grok_array_decl instead of
234 <case CALL_EXPR>: Use tsubst_copy_and_build_call_args.
235 * semantics.c (handle_omp_array_sections_1): Adjust grok_array_decl
238 2021-11-24 Marek Polacek <polacek@redhat.com>
241 * cp-tree.h (struct cp_declarator): Add a location_t member.
242 (maybe_warn_cpp0x): Add a location_t parameter with a default argument.
243 (loc_or_input_loc): New.
244 * decl.c (grokdeclarator): Use loc_or_input_loc. Pass init_loc down
246 * error.c (maybe_warn_cpp0x): Add a location_t parameter. Use it.
247 * parser.c (make_declarator): Initialize init_loc.
248 (cp_parser_member_declaration): Set init_loc.
249 (cp_parser_condition): Likewise.
250 (cp_parser_init_declarator): Likewise.
251 (cp_parser_parameter_declaration): Likewise.
253 2021-11-24 Jason Merrill <jason@redhat.com>
258 Use auto_cond_timevar instead of timevar_cond_start/stop.
259 Remove wrapper functions.
261 2021-11-23 Martin Sebor <msebor@redhat.com>
264 * typeck.c (warn_for_null_address): Handle reference members.
266 2021-11-23 Marek Polacek <polacek@redhat.com>
269 * init.c (emit_mem_initializers): Don't add is_really_empty_class
270 members into uninitialized.
272 2021-11-23 Jakub Jelinek <jakub@redhat.com>
274 * semantics.c (clone_omp_udr): Don't initialize
275 id.transform_lang_insert_block.
276 * optimize.c (clone_body): Likewise.
278 2021-11-22 Jason Merrill <jason@redhat.com>
280 * typeck.c (build_x_unary_op): Set address location.
281 (convert_member_func_to_ptr): Handle location wrapper.
282 * pt.c (convert_nontype_argument): Likewise.
284 2021-11-22 Jason Merrill <jason@redhat.com>
286 * typeck.c (check_return_expr): Only strip location wrapper during
289 2021-11-22 Jakub Jelinek <jakub@redhat.com>
292 * parser.c (cp_parser_late_parsing_oacc_routine): Set
293 parser->oacc_routine->fndecl_seen here, rather than ...
294 (cp_finalize_oacc_routine): ... here. Don't error if
295 parser->oacc_routine->fndecl_seen is set for FUNCTION_DECLs.
297 2021-11-22 Jakub Jelinek <jakub@redhat.com>
300 * constexpr.c (potential_constant_expression_1): Punt on OMP_MASKED.
302 2021-11-19 Jakub Jelinek <jakub@redhat.com>
305 * pt.c (apply_late_template_attributes): Temporarily override
306 current_optimize_pragma, optimization_current_node,
307 current_target_pragma and scope_chain->omp_declare_target_attribute,
308 so that cplus_decl_attributes doesn't add implicit attributes.
310 2021-11-19 Martin Sebor <msebor@redhat.com>
314 * typeck.c (warn_for_null_address): Suppress warnings for code
315 resulting from macro expansion.
317 2021-11-19 Martin Liska <mliska@suse.cz>
320 2021-11-19 Martin Liska <mliska@suse.cz>
322 * parser.c (add_debug_begin_stmt): Use option directly.
324 2021-11-19 Patrick Palka <ppalka@redhat.com>
326 * tree.c (cp_walk_subtrees) <case *_CAST_EXPR>: Don't explicitly
329 2021-11-19 Patrick Palka <ppalka@redhat.com>
332 * lambda.c (lambda_capture_field_type): Simplify by handling the
333 is_this case first. When capturing by-value a capture proxy,
334 consider the type of the corresponding field instead.
336 2021-11-19 Richard Biener <rguenther@suse.de>
339 * pt.c (tsubst_copy): Handle VECTOR_CST.
341 2021-11-19 Jakub Jelinek <jakub@redhat.com>
344 * cp-gimplify.c (cp_gimplify_arg): New function.
345 (cp_gimplify_expr): Use cp_gimplify_arg instead of gimplify_arg,
346 pass true as last argument to it if there are any following
347 arguments in strong evaluation order with side-effects.
349 2021-11-19 Marek Polacek <polacek@redhat.com>
353 * init.c (perform_member_init): Remove a forward declaration.
354 Walk the initializer using find_uninit_fields_r. New parameter
355 to track uninitialized fields. If a member is initialized,
356 remove it from the hash set.
357 (perform_target_ctor): Return the initializer.
358 (struct find_uninit_data): New class.
359 (find_uninit_fields_r): New function.
360 (find_uninit_fields): New function.
361 (emit_mem_initializers): Keep and initialize a set holding fields
362 that are not initialized. When handling delegating constructors,
363 walk the constructor tree using find_uninit_fields_r. Also when
364 initializing base clases. Pass uninitialized down to
367 2021-11-19 Patrick Palka <ppalka@redhat.com>
370 * pt.c (any_template_parm_r): Walk the TREE_TYPE of a dummy
373 2021-11-18 Marek Polacek <polacek@redhat.com>
376 * semantics.c (finish_compound_literal): Accept C++23 auto{x}.
377 * typeck2.c (build_functional_cast_1): Accept C++23 auto(x).
379 2021-11-18 Patrick Palka <ppalka@redhat.com>
381 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Disable the
382 -fpermissive fallback for C++20 template-id ADL, but keep the
385 2021-11-18 Jan Hubicka <hubicka@ucw.cz>
387 * decl.c (finish_function): Update use of decl_replaceable_p.
389 2021-11-18 Patrick Palka <ppalka@redhat.com>
392 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Don't diagnose
393 name lookup failure if the arguments to an unresolved template
394 name are still dependent.
396 2021-11-18 Patrick Palka <ppalka@redhat.com>
399 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When looking
400 for an identifier callee in the koenig_p case, also look through
401 TEMPLATE_ID_EXPR. Use tsubst_copy to substitute through the
402 template arguments of the template-id.
404 2021-11-18 Matthias Kretz <m.kretz@gsi.de>
406 * constexpr.c (cxx_eval_constant_expression): Handle PAREN_EXPR
407 via cxx_eval_constant_expression.
408 * cp-objcp-common.c (names_builtin_p): Handle
409 RID_BUILTIN_ASSOC_BARRIER.
410 * cp-tree.h: Adjust TREE_LANG_FLAG documentation to include
411 PAREN_EXPR in REF_PARENTHESIZED_P.
412 (REF_PARENTHESIZED_P): Add PAREN_EXPR.
413 * parser.c (cp_parser_postfix_expression): Handle
414 RID_BUILTIN_ASSOC_BARRIER.
415 * pt.c (tsubst_copy_and_build): If the PAREN_EXPR is not a
416 parenthesized initializer, build a new PAREN_EXPR.
417 * semantics.c (force_paren_expr): Simplify conditionals. Set
418 REF_PARENTHESIZED_P on PAREN_EXPR.
419 (maybe_undo_parenthesized_ref): Test PAREN_EXPR for
422 2021-11-18 Martin Liska <mliska@suse.cz>
424 * parser.c (add_debug_begin_stmt): Use option directly.
426 2021-11-16 Jason Merrill <jason@redhat.com>
428 * ptree.c (cxx_print_xnode): Handle PTRMEM_CST.
430 2021-11-15 Jason Merrill <jason@redhat.com>
432 * cp-tree.h (struct lang_decl_fn): Add implicit_constexpr.
433 (decl_implicit_constexpr_p): New.
434 * class.c (type_maybe_constexpr_destructor): Use
435 TYPE_HAS_TRIVIAL_DESTRUCTOR and maybe_constexpr_fn.
436 (finalize_literal_type_property): Simplify.
437 * constexpr.c (is_valid_constexpr_fn): Check for dtor.
438 (maybe_save_constexpr_fundef): Try to set DECL_DECLARED_CONSTEXPR_P
440 (cxx_eval_call_expression): Use maybe_constexpr_fn.
441 (maybe_constexpr_fn): Handle flag_implicit_constexpr.
442 (var_in_maybe_constexpr_fn): Use maybe_constexpr_fn.
443 (potential_constant_expression_1): Likewise.
444 (decl_implicit_constexpr_p): New.
445 * decl.c (validate_constexpr_redeclaration): Allow change with
446 -fimplicit-constexpr.
447 (grok_special_member_properties): Use maybe_constexpr_fn.
448 * error.c (dump_function_decl): Don't print 'constexpr'
450 * Make-lang.in (check-c++-all): Update.
452 2021-11-15 Jason Merrill <jason@redhat.com>
454 * typeck2.c (split_nonconstant_init_1): Handle flexarrays better.
456 2021-11-15 Jakub Jelinek <jakub@redhat.com>
458 * parser.c (OMP_TARGET_CLAUSE_MASK): Add
459 PRAGMA_OMP_CLAUSE_THREAD_LIMIT.
461 2021-11-15 Jason Merrill <jason@redhat.com>
463 * call.c (perform_implicit_conversion_flags): Use the location of
465 * lambda.c (build_lambda_object): Set location on the TARGET_EXPR.
467 2021-11-15 Jason Merrill <jason@redhat.com>
469 * constexpr.c (maybe_save_constexpr_fundef): Also check whether the
470 body of a constructor is potentially constant.
472 2021-11-15 Jason Merrill <jason@redhat.com>
474 * semantics.c (is_this_parameter): Check DECL_HAS_VALUE_EXPR_P
475 instead of is_capture_proxy.
477 2021-11-15 Jason Merrill <jason@redhat.com>
480 * init.c (build_vec_init): Check default_init_uninitialized_part in
483 2021-11-15 Jason Merrill <jason@redhat.com>
485 * constexpr.c (maybe_constant_value): Don't evaluate
486 in an unevaluated operand unless manifestly const-evaluated.
487 (fold_non_dependent_expr_template): Likewise.
488 * decl.c (compute_array_index_type_loc): This context is
489 manifestly constant-evaluated.
491 2021-11-15 Jason Merrill <jason@redhat.com>
493 * constexpr.c (cxx_eval_thunk_call): Error instead of ICE
494 on vbase thunk to constexpr function.
496 2021-11-11 Patrick Palka <ppalka@redhat.com>
498 * parser.c (cp_parser_template_argument_list): Use auto_vec
499 instead of manual memory management.
501 2021-11-11 Jakub Jelinek <jakub@redhat.com>
503 * parser.c (cp_parser_omp_clause_num_teams): Parse optional
504 lower-bound and store it into OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR.
505 Use OMP_CLAUSE_NUM_TEAMS_UPPER_EXPR instead of
506 OMP_CLAUSE_NUM_TEAMS_EXPR.
507 (cp_parser_omp_target): For OMP_CLAUSE_NUM_TEAMS evaluate before
508 combined target teams even lower-bound expression.
509 * semantics.c (finish_omp_clauses): Handle
510 OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR of OMP_CLAUSE_NUM_TEAMS clause.
511 * pt.c (tsubst_omp_clauses): Likewise.
512 (tsubst_expr): For OMP_CLAUSE_NUM_TEAMS evaluate before
513 combined target teams even lower-bound expression.
515 2021-11-09 Marek Polacek <polacek@redhat.com>
517 * class.c (default_init_uninitialized_part): Use
518 next_initializable_field.
519 * method.c (walk_field_subobs): Skip unnamed bit-fields.
521 2021-11-09 Jakub Jelinek <jakub@redhat.com>
524 * parser.c (cp_parser_userdef_numeric_literal): Use fold_build2
525 with COMPLEX_EXPR arg instead of build_complex, use build_zero_cst
526 instead of fold_convert from integer_zero_node.
528 2021-11-09 Patrick Palka <ppalka@redhat.com>
532 * parser.c (cp_parser_placeholder_type_specifier): Declare
533 static. Don't override tentative to false when tmpl is a
534 concept-id with empty argument list. Don't emit a "does not
535 constrain a type" error when tentative.
537 2021-11-09 Patrick Palka <ppalka@redhat.com>
540 * pt.c (push_template_decl): Check for bare parameter packs in
541 the argument list of a variable template partial specialization.
543 2021-11-09 Aldy Hernandez <aldyh@redhat.com>
545 * ptree.c (cxx_print_xnode): Add more space to pfx array.
547 2021-11-04 Jason Merrill <jason@redhat.com>
549 * call.c (build_array_conv): Use range-for.
550 (build_complex_conv): Likewise.
551 * constexpr.c (clear_no_implicit_zero)
552 (reduced_constant_expression_p): Likewise.
553 * decl.c (cp_complete_array_type): Likewise.
554 * decl2.c (mark_vtable_entries): Likewise.
555 * pt.c (iterative_hash_template_arg):
556 (invalid_tparm_referent_p, unify)
557 (type_dependent_expression_p): Likewise.
558 * typeck.c (build_ptrmemfunc_access_expr): Likewise.
560 2021-11-03 Joseph Myers <joseph@codesourcery.com>
563 * cvt.c (convert_init): New function.
565 2021-11-02 Richard Sandiford <richard.sandiford@arm.com>
567 * decl.c: Include langhooks-def.h.
568 (cxx_simulate_record_decl): New function.
569 * cp-objcp-common.h (cxx_simulate_record_decl): Declare.
570 (LANG_HOOKS_SIMULATE_RECORD_DECL): Override.
572 2021-10-29 Jakub Jelinek <jakub@redhat.com>
575 * semantics.c (maybe_zero_constructor_nelts): New function.
576 (finish_compound_literal): Implement DR2351 - void{}.
577 If type is cv void and compound_literal has no elements, return
578 void_node. If type is cv void and compound_literal might have no
579 elements after expansion, handle it like other dependent compound
582 2021-10-28 Patrick Palka <ppalka@redhat.com>
585 * parser.c (cp_parser_simple_type_specifier): Adjust diagnostic
586 for using auto in parameter declaration.
587 * pt.c (extract_autos_r): Ignore CTAD placeholders.
588 (extract_autos): Use range-based for.
589 (do_auto_deduction): Use extract_autos only for the concepts TS
590 and not also for standard concepts.
591 (type_uses_auto): Likewise with for_each_template_parm.
592 (check_auto_in_tmpl_args): Just return false outside of the
593 concepts TS. Simplify.
595 2021-10-28 Patrick Palka <ppalka@redhat.com>
598 * constexpr.c (potential_constant_expression_1) <case TRUTH_*_EXPR>:
599 When tf_error isn't set, preemptively check potentiality of the
600 second operand before performing trial evaluation of the first
602 (potential_constant_expression_1): When tf_error is set, first check
603 potentiality quietly and return true if successful, otherwise
604 proceed noisily to give errors.
606 2021-10-27 Jakub Jelinek <jakub@redhat.com>
609 * semantics.c (handle_omp_for_class_iterator,
610 finish_omp_for): Adjust c_omp_check_loop_iv_exprs caller.
612 2021-10-27 Jakub Jelinek <jakub@redhat.com>
615 * constexpr.c (cxx_eval_outermost_constant_expr): Perform
616 find_immediate_fndecl discovery if is_consteval or
617 in_immediate_context () rather than if is_consteval, t != r
618 and not in immediate function's body.
620 2021-10-27 Jakub Jelinek <jakub@redhat.com>
623 * cp-tree.h (saved_scope): Document that consteval_if_p member
624 is also set while processing immediate invocation.
625 (in_immediate_context): Declare.
626 * call.c (in_immediate_context): New function.
627 (immediate_invocation_p): Use it.
628 (struct in_consteval_if_p_temp_override): New class.
629 (build_over_call): Temporarily set in_consteval_if_p for processing
630 immediate invocation arguments.
631 * typeck.c (cp_build_addr_expr_1): Diagnose taking address of
632 an immediate method. Use t instead of TREE_OPERAND (arg, 1).
633 Use in_immediate_context function.
634 * constexpr.c (find_immediate_fndecl): Handle PTRMEM_CST
635 which refers to immediate function decl.
637 2021-10-26 Marek Polacek <polacek@redhat.com>
640 * parser.c (cp_parser_for): Maybe call cp_parser_init_statement
641 twice. Warn about range-based for loops with initializer here.
642 (cp_parser_init_statement): Don't duplicate code. Allow
643 alias-declaration in init-statement.
645 2021-10-22 Eric Gallager <egallager@gcc.gnu.org>
648 * Make-lang.in: Add dummy c++.install-dvi target.
650 2021-10-20 Jason Merrill <jason@redhat.com>
652 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
653 Pass true for declarator_p.
654 (cp_parser_nested_name_specifier_opt): Only look through
655 TYPENAME_TYPE if check_dependency_p is false.
657 2021-10-20 Jakub Jelinek <jakub@redhat.com>
660 * name-lookup.c (push_local_extern_decl_alias): Don't call
661 set_decl_tls_model on error_mark_node.
662 * decl.c (make_rtl_for_nonlocal_decl): Don't call
663 set_user_assembler_name on error_mark_node.
664 * parser.c (cp_parser_oacc_declare): Ignore DECL_LOCAL_DECL_ALIAS
665 if it is error_mark_node.
666 (cp_parser_omp_declare_target): Likewise.
668 2021-10-19 Jakub Jelinek <jakub@redhat.com>
671 * constexpr.c (cxx_eval_constant_expression): Don't reject
672 INTEGER_CSTs with type POINTER_TYPE to METHOD_TYPE.
674 2021-10-15 Jason Merrill <jason@redhat.com>
682 * pt.c (determine_specialization): Remove redundant code.
683 (fn_type_unification): Check for mismatched length.
684 (type_unification_real): Ignore terminal void.
685 (get_bindings): Don't stop at void_list_node.
686 * class.c (resolve_address_of_overloaded_function): Likewise.
688 2021-10-15 Jason Merrill <jason@redhat.com>
690 * constexpr.c (cxx_bind_parameters_in_call): Replace
691 new_call parameter with fun.
692 (cxx_eval_call_expression): Call it before instantiation.
693 (cxx_eval_outermost_constant_expr): Only instantiate fns
694 when manifestly_const_eval.
695 * typeck2.c (check_narrowing): This context is manifestly
698 2021-10-14 Kwok Cheung Yeung <kcy@codesourcery.com>
700 * decl.c (omp_declare_variant_finalize_one): Change call from
701 c_omp_mark_declare_variant to omp_mark_declare_variant.
702 * parser.c (cp_finish_omp_declare_variant): Change call from
703 c_omp_check_context_selector to omp_check_context_selector.
705 2021-10-09 Jakub Jelinek <jakub@redhat.com>
707 * parser.c (cp_parser_omp_structured_block): Remove disallow_omp_attrs
709 (cp_parser_omp_structured_block_sequence): New function.
710 (cp_parser_omp_scan_loop_body): Use it.
711 (cp_parser_omp_sections_scope): Likewise.
713 2021-10-08 Martin Liska <mliska@suse.cz>
715 * constexpr.c (maybe_warn_about_constant_value): Use new macro
717 * decl.c (redeclaration_error_message): Likewise.
718 (cxx_init_decl_processing): Likewise.
720 2021-10-08 Jakub Jelinek <jakub@redhat.com>
723 * parser.c (handle_omp_declare_target_clause): New function.
724 (cp_parser_omp_declare_target): Use it.
726 2021-10-07 Patrick Palka <ppalka@redhat.com>
729 * pt.c (convert_template_argument): Perform array/function to
730 pointer conversion on the substituted type of an NTTP.
732 2021-10-07 Patrick Palka <ppalka@redhat.com>
735 * pt.c (is_compatible_template_arg): Set processing_template_decl
736 around tsubst_constraint_info.
738 2021-10-07 Jonathan Wakely <jwakely@redhat.com>
741 * init.c (maybe_warn_list_ctor): Do not warn for a reference to
742 a non-const std::initializer_list.
744 2021-10-06 Jakub Jelinek <jakub@redhat.com>
747 * parser.c (cp_parser_jump_statement): Implement C++23 P2242R3.
748 Allow goto expressions in constexpr function bodies for C++23.
749 Adjust error message for older standards to mention it.
750 * decl.c (start_decl): Allow static and thread_local declarations
751 in constexpr function bodies for C++23. Adjust error message for
752 older standards to mention it.
753 * constexpr.c (ensure_literal_type_for_constexpr_object): Allow
754 declarations of variables with non-literal type in constexpr function
755 bodies for C++23. Adjust error message for older standards to mention
757 (cxx_eval_constant_expression) <case DECL_EXPR>: Diagnose declarations
758 of initialization of static or thread_local vars.
759 (cxx_eval_constant_expression) <case GOTO_EXPR>: Diagnose goto
760 statements for C++23.
761 (potential_constant_expression_1) <case DECL_EXPR>: Swap the
762 CP_DECL_THREAD_LOCAL_P and TREE_STATIC checks.
763 (potential_constant_expression_1) <case LABEL_EXPR>: Allow labels for
764 C++23. Adjust error message for older standards to mention it.
766 2021-10-06 Jakub Jelinek <jakub@redhat.com>
767 Jason Merrill <jason@redhat.com>
771 * cp-tree.h (maybe_synthesize_method): Declare.
772 * method.c (genericize_spaceship): Use
773 LOOKUP_NORMAL | LOOKUP_NONVIRTUAL | LOOKUP_DEFAULTED instead of
774 LOOKUP_NORMAL for flags.
775 (comp_info): Remove defining member. Add complain, code, retcat.
776 (comp_info::comp_info): Adjust.
777 (do_one_comp): Split out from build_comparison_op. Use
778 LOOKUP_NORMAL | LOOKUP_NONVIRTUAL | LOOKUP_DEFAULTED instead of
779 LOOKUP_NORMAL for flags.
780 (build_comparison_op): Add defining argument. Adjust comp_info
781 construction. Use defining instead of info.defining. Assert that
782 if defining, ctype is a complete type. Walk base binfos.
783 (synthesize_method, maybe_explain_implicit_delete,
784 explain_implicit_non_constexpr): Adjust build_comparison_op callers.
785 (maybe_synthesize_method): New function.
786 * class.c (check_bases_and_members): Don't call defaulted_late_check
788 (finish_struct_1): Call it here instead after class has been
790 * pt.c (maybe_instantiate_noexcept): Call maybe_synthesize_method
791 instead of synthesize_method.
793 2021-10-05 Jakub Jelinek <jakub@redhat.com>
796 * tree.c (apply_identity_attributes): Fix handling of the
797 case where an attribute in the list doesn't affect type
798 identity but some attribute before it does.
800 2021-10-05 Patrick Palka <ppalka@redhat.com>
803 * constexpr.c (potential_constant_expression_1): Handle
804 NONTYPE_ARGUMENT_PACK.
806 2021-10-05 Patrick Palka <ppalka@redhat.com>
809 * pt.c (has_value_dependent_address): Return true for a static
810 local variable from a function template.
812 2021-10-04 Marek Polacek <polacek@redhat.com>
815 * typeck.c (cp_build_binary_op): Call do_warn_array_compare.
817 2021-10-03 Iain Sandoe <iain@sandoe.co.uk>
820 * coroutines.cc (register_local_var_uses): Emit a sorry if
821 we encounter a VLA in the coroutine local variables.
823 2021-10-03 Iain Sandoe <iain@sandoe.co.uk>
826 * coroutines.cc (await_statement_walker): Report an error if
827 an await expression is found in a handler body.
829 2021-10-03 John Eivind Helset <jehelset@gmail.com>
832 * coroutines.cc (build_co_await): Guard against NULL
835 2021-10-03 Iain Sandoe <iain@sandoe.co.uk>
838 * coroutines.cc (build_co_await): Mark co_await_expr trees
839 with TREE_SIDE_EFFECTS, also mark any containing expression.
840 (finish_co_await_expr): Mark type-dependent co_await_expr
841 trees with TREE_SIDE_EFFECTS.
843 2021-10-03 Iain Sandoe <iain@sandoe.co.uk>
846 * coroutines.cc (build_co_await): Strip NOPs from
847 candidate awaiter expressions before testing to see
848 if they need a temporary.
850 2021-10-01 Martin Sebor <msebor@redhat.com>
853 * typeck.c (warn_for_null_address): Enhance.
854 (cp_build_binary_op): Call it also for member pointers.
856 2021-10-01 qingzhe huang <nickhuang99@hotmail.com>
859 * tree.c (cp_build_qualified_type_real): Exclude typedef from
862 2021-10-01 Jakub Jelinek <jakub@redhat.com>
863 Richard Biener <rguenther@suse.de>
866 * typeck.c (cp_build_binary_op): Call ubsan_instrument_division
867 for division even for SANITIZE_SI_OVERFLOW.
869 2021-10-01 Jakub Jelinek <jakub@redhat.com>
871 * parser.c (cp_parser_omp_clause_order): Set
872 OMP_CLAUSE_ORDER_REPRODUCIBLE for explicit reproducible: modifier.
874 2021-10-01 Jakub Jelinek <jakub@redhat.com>
877 * name-lookup.c (push_local_extern_decl_alias): Return early even for
878 tls vars with non-dependent type when processing_template_decl. For
879 CP_DECL_THREAD_LOCAL_P vars call set_decl_tls_model on alias.
881 2021-09-30 Patrick Palka <ppalka@redhat.com>
884 * method.c (is_xible_helper): Don't exit early for multi-arg
887 2021-09-30 Patrick Palka <ppalka@redhat.com>
889 * parser.c (cp_parser_trait_expr): Call nreverse on the reversed
890 list of trailing arguments.
892 2021-09-30 Patrick Palka <ppalka@redhat.com>
895 * method.c (build_comparison_op): Skip DECL_VIRTUAL_P fields.
897 2021-09-28 Patrick Palka <ppalka@redhat.com>
900 * pt.c (coerce_template_template_parms): Keep
901 processing_template_decl set around the call to unify as well.
903 2021-09-28 Iain Sandoe <iain@sandoe.co.uk>
906 * coroutines.cc (analyze_fn_parms): Clean up synthetic names for
907 unnamed function params.
908 (morph_fn_to_coro): Do not try to set a guard variable for param
909 DTORs in the ramp, unless we have exceptions active.
911 2021-09-27 Patrick Palka <ppalka@redhat.com>
914 * pt.c (rewrite_template_parm): Handle single-level tsubst_args.
915 Avoid a tree cycle when assigning the DECL_TEMPLATE_PARMS for a
917 (alias_ctad_tweaks): Set current_template_parms accordingly.
919 2021-09-23 Michel Morin <mimomorin@gmail.com>
921 * parser.c (cp_keyword_starts_decl_specifier_p): Do not
922 handle RID_ATTRIBUTE.
923 (cp_parser_constructor_declarator_p): Remove now-redundant
925 (cp_parser_lambda_declarator_opt): Likewise.
927 2021-09-23 Michel Morin <mimomorin@gmail.com>
930 * parser.c (cp_keyword_starts_decl_specifier_p): Handle more
931 decl-specifiers (typedef/inline/cv/explicit/virtual/friend).
933 2021-09-23 Patrick Palka <ppalka@redhat.com>
935 * ptree.c (cxx_print_decl): Dump the DECL_TEMPLATE_RESULT of
936 a TEMPLATE_DECL. Dump the DECL_TEMPLATE_INFO rather than just
937 printing its pointer value.
939 2021-09-23 Jakub Jelinek <jakub@redhat.com>
942 * parser.c (cp_parser_omp_directive_args): Diagnose if omp::directive
943 is not followed by a balanced token sequence starting with open paren.
945 2021-09-22 Patrick Palka <ppalka@redhat.com>
949 * constexpr.c (cxx_eval_constant_expression)
950 <case TEMPLATE_ID_EXPR>: Check value_dependent_expression_p
951 instead of processing_template_decl.
952 * pt.c (value_dependent_expression_p) <case TEMPLATE_ID_EXPR>:
953 Return true only if any_dependent_template_arguments_p.
954 (instantiation_dependent_r) <case CALL_EXPR>: Remove this case.
955 <case TEMPLATE_ID_EXPR>: Likewise.
957 2021-09-22 Jakub Jelinek <jakub@redhat.com>
959 * parser.c (cp_parser_omp_clause_allocate): Parse allocate clause
961 * semantics.c (finish_omp_clauses) <OMP_CLAUSE_ALLOCATE>: Perform
962 semantic analysis of OMP_CLAUSE_ALLOCATE_ALIGN.
963 * pt.c (tsubst_omp_clauses) <case OMP_CLAUSE_ALLOCATE>: Handle
964 also OMP_CLAUSE_ALLOCATE_ALIGN.
966 2021-09-22 Barrett Adair <barrettellisadair@gmail.com>
968 * pt.c (find_parm_usage_r): New walk_tree callback to find func
970 (any_template_arguments_need_structural_equality_p): New special
973 2021-09-21 wangpc <pc.wang@linux.alibaba.com>
975 * decl.c (start_decl_1): Move verify_type_context to ...
976 (cp_finish_decl): ... to here.
978 2021-09-18 Jakub Jelinek <jakub@redhat.com>
980 * parser.c (cp_parser_omp_clause_order): Parse unconstrained
981 and reproducible modifiers.
982 (OMP_DISTRIBUTE_CLAUSE_MASK): Add order clause.
984 2021-09-18 Jakub Jelinek <jakub@redhat.com>
986 * parser.c (cp_parser_omp_clause_default): Handle private and
987 firstprivate arguments, adjust diagnostics on unknown argument.
988 * cp-gimplify.c (cxx_omp_finish_clause): Handle OMP_CLAUSE_PRIVATE.
990 2021-09-18 Jason Merrill <jason@redhat.com>
992 * cp-tree.h (dependentish_scope_p): Declare.
993 * pt.c (dependentish_scope_p): New.
994 * parser.c (cp_parser_lookup_name): Return a TYPENAME_TYPE
995 for lookup of a type in a dependent object.
996 (cp_parser_template_id): Handle TYPENAME_TYPE.
997 (cp_parser_template_name): If we're looking for a type,
998 a name followed by < names a template.
1000 2021-09-18 Jason Merrill <jason@redhat.com>
1002 * cp-tree.h: Fix typo in LANG_FLAG list.
1004 2021-09-17 Jakub Jelinek <jakub@redhat.com>
1006 * cp-tree.h (finish_omp_atomic): Add r and weak arguments.
1007 * parser.c (cp_parser_omp_atomic): Update function comment for
1008 OpenMP 5.1 atomics, parse OpenMP 5.1 atomics and fail, compare and
1010 * semantics.c (finish_omp_atomic): Add r and weak arguments, handle
1011 them, handle COND_EXPRs.
1012 * pt.c (tsubst_expr): Adjust for COND_EXPR forms that
1013 finish_omp_atomic can now produce.
1015 2021-09-16 Patrick Palka <ppalka@redhat.com>
1018 * constraint.cc (get_normalized_constraints_from_decl): Always
1019 look up constraints using the most general template.
1020 * decl.c (grokdeclarator): Set constraints on a static data
1022 * pt.c (determine_specialization): Check constraints on a
1025 2021-09-16 Iain Sandoe <iain@sandoe.co.uk>
1027 * coroutines.cc (await_statement_walker): Code cleanups.
1029 2021-09-16 Jason Merrill <jason@redhat.com>
1031 * constexpr.c (cxx_eval_outermost_constant_expr): Use
1032 protected_set_expr_location.
1034 2021-09-15 Patrick Palka <ppalka@redhat.com>
1037 * call.c (build_user_type_conversion_1): Add tf_conv to complain.
1038 (add_candidates): When in a SFINAE context, instead of adding a
1039 candidate to bad_fns just mark it unviable.
1041 2021-09-15 Jason Merrill <jason@redhat.com>
1043 * cp-tree.h (parsing_function_declarator): Declare.
1044 * name-lookup.c (set_decl_context_in_fn): Use it.
1045 * parser.c (cp_parser_direct_declarator): Use it.
1046 (parsing_function_declarator): New.
1048 2021-09-15 Jakub Jelinek <jakub@redhat.com>
1052 * typeck2.c (split_nonconstant_init_1): Don't throw away empty
1053 initializers of flexible array members if they have non-zero type
1056 2021-09-15 Patrick Palka <ppalka@redhat.com>
1059 * decl.c (grok_special_member_properties): Set
1060 TYPE_HAS_COPY_CTOR, TYPE_HAS_DEFAULT_CONSTRUCTOR
1061 and TYPE_HAS_LIST_CTOR independently from each other.
1063 2021-09-15 Jason Merrill <jason@redhat.com>
1065 * decl.c (cxx_init_decl_processing): Only warn about odd
1066 interference sizes if they were specified with --param.
1068 2021-09-15 Jason Merrill <jason@redhat.com>
1071 * cp-tree.h (enum cp_tree_index): Remove CPTI_TYPE_INFO_PTR_TYPE.
1072 (type_info_ptr_type): Remove.
1073 * rtti.c (init_rtti_processing): Don't predeclare std::type_info.
1074 (typeid_ok_p): Check for null const_type_info_type_node.
1075 (type_info_ptr_type, get_void_tinfo_ptr): New fns.
1076 (get_tinfo_decl_dynamic, get_tinfo_ptr): Use them.
1077 (ptr_initializer, ptm_initializer, get_pseudo_ti_init): Use them.
1078 (get_tinfo_desc): Use const_ptr_type_node.
1080 2021-09-15 Jason Merrill <jason@redhat.com>
1082 * parser.c (cp_parser_template_name): Move object type.
1083 (cp_parser_pre_parsed_nested_name_specifier): Likewise.
1085 2021-09-15 Jason Merrill <jason@redhat.com>
1087 * parser.c (cp_parser_unqualified_id): Only complain about ~A<T> in
1090 2021-09-14 Iain Sandoe <iain@sandoe.co.uk>
1092 * coroutines.cc (struct param_info): Add copy_var.
1093 (build_actor_fn): Use simplified param references.
1094 (register_param_uses): Likewise.
1095 (rewrite_param_uses): Likewise.
1096 (analyze_fn_parms): New function.
1097 (coro_rewrite_function_body): Add proxies for the fn
1098 parameters to the outer bind scope of the rewritten code.
1099 (morph_fn_to_coro): Use simplified version of param ref.
1101 2021-09-14 Iain Sandoe <iain@sandoe.co.uk>
1103 * coroutines.cc (coro_resume_fn_id, coro_destroy_fn_id,
1104 coro_promise_id, coro_frame_needs_free_id, coro_resume_index_id,
1105 coro_self_handle_id, coro_actor_continue_id,
1106 coro_frame_i_a_r_c_id): New.
1107 (coro_init_identifiers): Initialize new name identifiers.
1108 (coro_promise_type_found_p): Use pre-built identifiers.
1109 (struct await_xform_data): Remove unused fields.
1110 (transform_await_expr): Delete code that is now unused.
1111 (build_actor_fn): Simplify interface, use pre-built identifiers and
1112 remove transforms that are no longer needed.
1113 (build_destroy_fn): Use revised field names.
1114 (register_local_var_uses): Use pre-built identifiers.
1115 (coro_rewrite_function_body): Simplify interface, use pre-built
1116 identifiers. Generate proxy vars in the outer bind expr scope for the
1117 implementation state that we wish to expose.
1118 (morph_fn_to_coro): Adjust comments for new variable names, use pre-
1119 built identifiers. Remove unused code to generate frame entries for
1120 the implementation state. Adjust call for build_actor_fn.
1122 2021-09-14 Patrick Palka <ppalka@redhat.com>
1125 * constexpr.c (cxx_eval_call_expression): After evaluating a
1126 subobject constructor call for an empty union member, produce a
1127 side effect that makes sure the member gets activated.
1129 2021-09-14 Jakub Jelinek <jakub@redhat.com>
1132 * decl.c (layout_var_decl): For aggregates ending with a flexible
1133 array member, add the size of the initializer for that member to
1134 DECL_SIZE and DECL_SIZE_UNIT.
1136 2021-09-14 Jakub Jelinek <jakub@redhat.com>
1139 * method.c (is_xible_helper): Call complete_type on to.
1141 2021-09-14 Jason Merrill <jason@redhat.com>
1143 * decl.c (cxx_init_decl_processing): Don't warn if L1 cache line
1144 size is smaller than maxalign.
1146 2021-09-13 Jason Merrill <jason@redhat.com>
1148 * constexpr.c (maybe_warn_about_constant_value):
1149 Complain about std::hardware_destructive_interference_size.
1150 (cxx_eval_constant_expression): Call it.
1151 * decl.c (cxx_init_decl_processing): Check
1152 --param *-interference-size values.
1154 2021-09-13 Patrick Palka <ppalka@redhat.com>
1157 * cp-tree.h (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): New accessor
1159 * pt.c (has_extra_args_mechanism_p): New function.
1160 (find_parameter_pack_data::found_extra_args_tree_p): New data
1162 (find_parameter_packs_r): Set ppd->found_extra_args_tree_p
1164 (make_pack_expansion): Set PACK_EXPANSION_FORCE_EXTRA_ARGS_P if
1165 ppd.found_extra_args_tree_p.
1166 (use_pack_expansion_extra_args_p): Return true if there were
1167 unsubstituted packs and PACK_EXPANSION_FORCE_EXTRA_ARGS_P.
1168 (tsubst_pack_expansion): Pass the pack expansion to
1169 use_pack_expansion_extra_args_p.
1171 2021-09-10 Jakub Jelinek <jakub@redhat.com>
1173 * parser.c (cp_parser_omp_atomic): Allow acq_rel on atomic read/write
1174 and acq_rel/acquire clauses on update.
1175 * semantics.c (finish_omp_atomic): Adjust c_finish_omp_atomic caller.
1177 2021-09-08 Richard Biener <rguenther@suse.de>
1180 * cp-tree.h (ANON_AGGR_TYPE_FIELD): New define.
1181 * decl.c (fixup_anonymous_aggr): Wipe RTTI info put in
1182 place on invalid code.
1183 * decl2.c (reset_type_linkage): Guard CLASSTYPE_TYPEINFO_VAR
1185 * module.cc (trees_in::read_class_def): Likewise. Reconstruct
1186 ANON_AGGR_TYPE_FIELD.
1187 * semantics.c (finish_member_declaration): Populate
1188 ANON_AGGR_TYPE_FIELD for anon aggregate typed members.
1189 * typeck.c (lookup_anon_field): Remove DFS search and return
1190 ANON_AGGR_TYPE_FIELD directly.
1192 2021-09-07 Jakub Jelinek <jakub@redhat.com>
1195 * constexpr.c (maybe_save_constexpr_fundef): Save body even for
1196 constexpr deleting dtors.
1197 (cxx_eval_call_expression): Don't use DECL_CLONED_FUNCTION for
1200 2021-09-07 Marcel Vollweiler <marcel@codesourcery.com>
1202 * parser.c (cp_parser_omp_flush): Parse 'seq_cst' clause on 'flush'
1204 * semantics.c (finish_omp_flush): Handle MEMMODEL_SEQ_CST.
1206 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
1208 * coroutines.cc (register_local_var_uses): Do not mangle
1209 frame entries for the outermost scope. Record the outer
1210 scope as nesting depth 0.
1212 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
1214 * coroutines.cc (coro_build_artificial_var): New.
1215 (build_actor_fn): Use var builder, rename vars to use
1216 implementation namespace.
1217 (coro_rewrite_function_body): Likewise.
1218 (morph_fn_to_coro): Likewise.
1220 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
1222 * coroutines.cc (transform_local_var_uses): Record
1223 frame offset expressions as DECL_VALUE_EXPRs instead of
1226 2021-09-03 Patrick Palka <ppalka@redhat.com>
1229 * call.c (build_this_conversion): New function, split out from
1230 add_function_candidate.
1231 (add_function_candidate): New parameter shortcut_bad_convs.
1232 Document it. Use build_this_conversion. Stop at the first bad
1233 argument conversion when shortcut_bad_convs is true.
1234 (add_template_candidate_real): New parameter shortcut_bad_convs.
1235 Use build_this_conversion to check the 'this' conversion before
1236 attempting deduction. When the rejection reason code is
1237 rr_bad_arg_conversion, pass -1 instead of 0 as the viable
1238 parameter to add_candidate. Pass 'convs' to add_candidate.
1239 (add_template_candidate): New parameter shortcut_bad_convs.
1240 (add_template_conv_candidate): Pass false as shortcut_bad_convs
1241 to add_template_candidate_real.
1242 (add_candidates): Prefer to shortcut bad conversions during
1243 overload resolution under the assumption that we'll eventually
1244 see a strictly viable candidate. If this assumption turns out
1245 to be false, re-process the non-strictly viable candidates
1246 without shortcutting those bad conversions.
1248 2021-09-03 Jason Merrill <jason@redhat.com>
1250 * pt.c (limit_bad_template_recursion): Suppress -Wunused for decls
1251 we decide not to instantiate.
1253 2021-09-03 Jakub Jelinek <jakub@redhat.com>
1256 * class.c (build_base_field): Use SET_DECL_FIELD_ABI_IGNORED
1257 instead of writing to DECL_FIELD_ABI_IGNORED.
1258 (layout_class_type): Likewise. In the place where zero-width
1259 bitfields used to be removed, use
1260 SET_DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD on those fields instead.
1262 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
1264 * call.c (build_over_call): Handle unavailable state in addition to
1266 * class.c (type_build_ctor_call): Likewise.
1267 (type_build_dtor_call): Likewise.
1268 * cp-tree.h: Rename cp_warn_deprecated_use to
1269 cp_handle_deprecated_or_unavailable.
1270 * decl.c (duplicate_decls): Merge unavailability.
1271 (grokdeclarator): Handle unavailability in addition to deprecation.
1272 (type_is_unavailable): New.
1273 (grokparms): Handle unavailability in addition to deprecation.
1274 * decl.h (enum deprecated_states): Add
1275 UNAVAILABLE_DEPRECATED_SUPPRESS.
1276 * decl2.c (cplus_decl_attributes): Propagate unavailability to
1278 (cp_warn_deprecated_use): Rename to ...
1279 (cp_handle_deprecated_or_unavailable): ... this and amend to handle
1280 the unavailable case. It remains a warning in the case of deprecation
1281 but becomes an error in the case of unavailability.
1282 (cp_warn_deprecated_use_scopes): Handle unavailability.
1283 (mark_used): Likewise.
1284 * parser.c (cp_parser_template_name): Likewise.
1285 (cp_parser_template_argument): Likewise.
1286 (cp_parser_parameter_declaration_list): Likewise.
1287 * typeck.c (build_class_member_access_expr): Likewise.
1288 (finish_class_member_access_expr): Likewise.
1289 * typeck2.c (build_functional_cast_1): Likewise.
1291 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
1293 * coroutines.cc (build_actor_fn): Add begin/finish clauses
1294 to the initial test in the actor function.
1296 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
1298 * coroutines.cc (await_statement_walker): Use build_stmt and
1299 add_stmt instead of build1 and finish_expr_stmt.
1301 2021-08-31 Jason Merrill <jason@redhat.com>
1303 * coroutines.cc (flatten_await_stmt): Fix copyo.
1304 * decl.c (reshape_init_class): Simplify.
1305 * module.cc (module_state::read_language): Add null check.
1306 * parser.c (build_range_temp): Avoid type_uses_auto.
1307 (cp_parser_class_specifier_1): Add null check.
1309 2021-08-31 Patrick Palka <ppalka@redhat.com>
1312 * call.c (rejection_reason::call_varargs_p): Rename this
1313 previously unused member to ...
1314 (rejection_reason::least_p): ... this.
1315 (arity_rejection): Add least_p parameter.
1316 (add_template_candidate_real): When there are explicit
1317 template arguments, check that the arity of the call agrees with
1318 the arity of the function before attempting deduction.
1319 (print_arity_information): Add least_p parameter.
1320 (print_z_candidate): Adjust call to print_arity_information.
1322 2021-08-31 Martin Sebor <msebor@redhat.com>
1324 * parser.c (cp_parser_selection_statement): Use direct initialization
1327 2021-08-31 Jason Merrill <jason@redhat.com>
1329 * constexpr.c (explain_invalid_constexpr_fn): Use iloc_sentinel.
1331 2021-08-31 Jason Merrill <jason@redhat.com>
1334 * cp-tree.h (FNDECL_MANIFESTLY_CONST_EVALUATED): New.
1335 * constexpr.c (cxx_eval_call_expression): Set it.
1336 * pt.c (neglectable_inst_p): Check it.
1338 2021-08-31 Marcel Vollweiler <marcel@codesourcery.com>
1340 * parser.c (cp_parser_omp_clause_device): Parse device-modifiers 'device_num'
1341 and 'ancestor' in 'target device' clauses.
1342 * semantics.c (finish_omp_clauses): Error handling. Constant device ids must
1343 evaluate to '1' if 'ancestor' is used.
1345 2021-08-30 Jason Merrill <jason@redhat.com>
1348 * cp-tree.h (struct lang_type): Add erroneous bit-field.
1349 (CLASSTYPE_ERRONEOUS): New.
1350 * pt.c (limit_bad_template_recursion): Check it.
1351 (instantiate_class_template_1): Set it.
1353 2021-08-30 Jason Merrill <jason@redhat.com>
1355 * constexpr.c (cxx_eval_outermost_constant_expr): Copy
1356 expr location to result.
1358 2021-08-30 Jason Merrill <jason@redhat.com>
1361 * cp-tree.h (cxx_constant_value_sfinae): Declare.
1362 * constexpr.c (cxx_constant_value_sfinae): New.
1363 * pt.c (fold_targs_r, maybe_fold_fn_template_args): New.
1364 (tsubst_copy_and_build) [CALL_EXPR]: Call
1365 maybe_fold_fn_template_args.
1367 2021-08-30 Jason Merrill <jason@redhat.com>
1369 * parser.c (cp_parser_simple_requirement): Warn about missing
1372 2021-08-27 Jason Merrill <jason@redhat.com>
1374 * typeck2.c (build_x_arrow): Do set TREE_TYPE when operand is
1375 a dependent pointer.
1377 2021-08-25 Andrew Pinski <apinski@marvell.com>
1380 * cp-objcp-common.c (cxx_block_may_fallthru): Handle
1381 CLEANUP_STMT for the case which will be try/finally.
1383 2021-08-25 Jakub Jelinek <jakub@redhat.com>
1386 * init.c (build_value_init_noctor): Ignore unnamed zero-width
1389 2021-08-23 Jakub Jelinek <jakub@redhat.com>
1391 * parser.c (cp_parser_omp_clause_num_tasks,
1392 cp_parser_omp_clause_grainsize): Parse the optional strict: modifier.
1394 2021-08-20 Jakub Jelinek <jakub@redhat.com>
1396 * parser.c (cp_parser_handle_statement_omp_attributes): Determine if
1397 PRAGMA_OMP_ERROR directive is C_OMP_DIR_STANDALONE.
1398 (cp_parser_omp_error): New function.
1399 (cp_parser_pragma): Handle PRAGMA_OMP_ERROR.
1401 2021-08-20 Jakub Jelinek <jakub@redhat.com>
1403 * parser.c (cp_parser_omp_clause_depend_sink): Reject spurious
1404 comma at the end of list. Don't parse closing paren here...
1405 (cp_parser_omp_clause_depend): ... but here instead.
1407 2021-08-19 Patrick Palka <ppalka@redhat.com>
1410 * cp-tree.h (CONSTRUCTOR_IS_PAREN_INIT): Clarify comment.
1412 2021-08-19 Jakub Jelinek <jakub@redhat.com>
1414 * parser.c (cp_parser_omp_requires): Don't call cp_lexer_nth_token_is
1415 and optionally consume token if current token is CPP_EOF,
1416 CPP_PRAGMA_EOL or CPP_CLOSE_PAREN.
1418 2021-08-19 Jakub Jelinek <jakub@redhat.com>
1420 * parser.c (cp_parser_omp_nothing): Use cp_parser_require_pragma_eol
1421 instead of cp_parser_skip_to_pragma_eol.
1423 2021-08-18 Patrick Palka <ppalka@redhat.com>
1427 * cp-tree.h (CONSTRUCTOR_BRACES_ELIDED_P): Define.
1428 * decl.c (reshape_init_r): Set it.
1429 * pt.c (collect_ctor_idx_types): Recurse into a sub-CONSTRUCTOR
1430 iff CONSTRUCTOR_BRACES_ELIDED_P.
1432 2021-08-18 Patrick Palka <ppalka@redhat.com>
1435 * pt.c (convert_template_argument): Pass LOOKUP_IMPLICIT to
1438 2021-08-18 Jakub Jelinek <jakub@redhat.com>
1440 * parser.c (cp_parser_omp_nothing): New function.
1441 (cp_parser_pragma): Handle PRAGMA_OMP_NOTHING.
1443 2021-08-18 Jakub Jelinek <jakub@redhat.com>
1445 * parser.c (cp_parser_omp_ordered): Return true instead of
1446 false after emitting errors that the directive is not allowed in
1447 pragma_stmt context.
1448 (cp_parser_omp_target_update): Likewise.
1449 (cp_parser_omp_cancellation_point): Change return type from void to
1450 bool, return false if the directive should be ignored in pragma_stmt
1452 (cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data):
1453 Change return type from tree to bool, return false if the
1454 directive should be ignored in pragma_stmt contexts.
1455 (cp_parser_omp_target): Adjust callers of cp_parser_omp_target_*_data,
1456 return their result directly.
1457 (cp_parser_pragma): For PRAGMA_OMP_CANCELLATION_POINT return what
1458 cp_parser_omp_cancellation_point returned. Return true instead of
1459 false after emitting errors that the directive is not allowed in
1460 pragma_stmt context.
1462 2021-08-17 Jakub Jelinek <jakub@redhat.com>
1465 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_LAYOUT_COMPATIBLE.
1466 (enum cp_built_in_function): Add CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
1467 (fold_builtin_is_corresponding_member, next_common_initial_seqence,
1468 layout_compatible_type_p): Declare.
1469 * parser.c (cp_parser_primary_expression): Handle
1470 RID_IS_LAYOUT_COMPATIBLE.
1471 (cp_parser_trait_expr): Likewise.
1472 * cp-objcp-common.c (names_builtin_p): Likewise.
1473 * constraint.cc (diagnose_trait_expr): Handle
1474 CPTK_IS_LAYOUT_COMPATIBLE.
1475 * decl.c (cxx_init_decl_processing): Register
1476 __builtin_is_corresponding_member builtin.
1477 * constexpr.c (cxx_eval_builtin_function_call): Handle
1478 CP_BUILT_IN_IS_CORRESPONDING_MEMBER builtin.
1479 * semantics.c (is_corresponding_member_union,
1480 is_corresponding_member_aggr, fold_builtin_is_corresponding_member):
1482 (trait_expr_value): Handle CPTK_IS_LAYOUT_COMPATIBLE.
1483 (finish_trait_expr): Likewise.
1484 * typeck.c (next_common_initial_seqence, layout_compatible_type_p):
1486 * cp-gimplify.c (cp_gimplify_expr): Fold
1487 CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
1488 (cp_fold): Likewise.
1489 * tree.c (builtin_valid_in_constant_expr_p): Handle
1490 CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
1491 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1492 CPTK_IS_LAYOUT_COMPATIBLE.
1493 * class.c (remove_zero_width_bit_fields): Remove.
1494 (layout_class_type): Don't call it.
1496 2021-08-17 Jakub Jelinek <jakub@redhat.com>
1498 * parser.c (OMP_SCOPE_CLAUSE_MASK): Define.
1499 (cp_parser_omp_scope): New function.
1500 (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_SCOPE.
1501 * pt.c (tsubst_expr): Handle OMP_SCOPE.
1503 2021-08-12 Jakub Jelinek <jakub@redhat.com>
1505 * parser.c (cp_parser_omp_clause_name): Parse filter clause name.
1506 (cp_parser_omp_clause_filter): New function.
1507 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FILTER.
1508 (OMP_MASKED_CLAUSE_MASK): Define.
1509 (cp_parser_omp_masked): New function.
1510 (cp_parser_omp_parallel): Handle parallel masked.
1511 (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_MASKED.
1512 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_FILTER.
1513 * pt.c (tsubst_omp_clauses): Likewise.
1514 (tsubst_expr): Handle OMP_MASKED.
1516 2021-08-12 Sergei Trofimovich <siarheit@google.com>
1519 * pt.c (tsubst_copy_and_build): Use build_ptrmemfunc_access_expr
1520 to construct ptrmemfunc expression instantiation.
1522 2021-08-12 Tobias Burnus <tobias@codesourcery.com>
1524 * parser.c (cp_parser_omp_clause_proc_bind): Accept
1525 'primary' as alias for 'master'.
1527 2021-08-12 Jakub Jelinek <jakub@redhat.com>
1529 * cp-tree.h (omp_declare_target_attr): New type.
1530 (struct saved_scope): Change type of omp_declare_target_attribute
1531 from int to vec<omp_declare_target_attr, va_gc> * and move it.
1532 * parser.c (cp_parser_omp_declare_target): Instead of
1533 incrementing scope_chain->omp_declare_target_attribute, push
1534 a struct containing parser->lexer->in_omp_attribute_pragma to
1536 (cp_parser_omp_end_declare_target): Instead of decrementing
1537 scope_chain->omp_declare_target_attribute, pop a structure
1538 from it. Diagnose mismatching declare target vs.
1539 end declare target syntax.
1540 * semantics.c (finish_translation_unit): Use vec_safe_length
1541 and vec_safe_truncate on scope_chain->omp_declare_target_attributes.
1542 * decl2.c (cplus_decl_attributes): Use vec_safe_length
1543 on scope_chain->omp_declare_target_attributes.
1545 2021-08-12 Jakub Jelinek <jakub@redhat.com>
1547 * parser.c (cp_parser_lambda_body): Add temp overrides
1548 for parser->{omp_declare_simd,oacc_routine,omp_attrs_forbidden_p}.
1549 (cp_parser_statement): Restore parser->omp_attrs_forbidden_p for
1550 cp_parser_declaration_statement.
1551 (cp_parser_default_argument): Add temp override for
1552 parser->omp_attrs_forbidden_p.
1553 (cp_parser_late_parsing_omp_declare_simd): Diagnose declare simd
1554 or declare variant in attribute syntax on a declaration immediately
1555 following an OpenMP construct in pragma syntax.
1557 2021-08-12 Jakub Jelinek <jakub@redhat.com>
1560 * method.c (cat_tag_for): Return cc_last for !CLASS_TYPE_P
1561 or for classes not in std namespace.
1563 2021-08-12 Jakub Jelinek <jakub@redhat.com>
1565 * name-lookup.c (finish_using_directive): Diagnose omp::directive
1566 or omp::sequence attributes on using-directive.
1568 2021-08-12 Jakub Jelinek <jakub@redhat.com>
1570 * parser.c (cp_parser_block_declaration): Call
1571 cp_parser_using_directive for C++11 attributes followed by
1572 using namespace tokens.
1573 (cp_parser_using_directive): Parse C++11 attributes at the start
1574 of the directive rather than at the end, only parse GNU attributes
1577 2021-08-12 Patrick Palka <ppalka@redhat.com>
1580 * constexpr.c (cxx_eval_store_expression): Handle the lval=true
1581 case in the early exit code path for empty stores with mismatched
1584 2021-08-11 Patrick Palka <ppalka@redhat.com>
1588 * cp-tree.h (unevaluated_p): Return true for REQUIRES_EXPR.
1589 * decl.c (local_variable_p_walkfn): Don't walk into unevaluated
1591 * parser.c (cp_parser_primary_expression) <case CPP_NAME>: Never
1592 reject uses of local variables in unevaluated contexts.
1593 * tree.c (cp_walk_subtrees) <case REQUIRES_EXPR>: Increment
1594 cp_unevaluated_operand. Use cp_walk_tree directly instead of
1595 WALK_SUBTREE to avoid the goto. Use REQUIRES_EXPR_REQS instead
1596 of TREE_OPERAND directly.
1598 2021-08-11 Jakub Jelinek <jakub@redhat.com>
1601 * decl2.c (var_defined_without_dynamic_init): Return true for
1602 DECL_DECLARED_CONSTINIT_P with complete type and trivial destructor.
1604 2021-08-11 Patrick Palka <ppalka@redhat.com>
1607 * parser.c (maybe_adjust_declarator_for_dguide): New, split
1609 (cp_parser_init_declarator): ... here.
1610 (cp_parser_member_declaration): Use it.
1612 2021-08-11 Patrick Palka <ppalka@redhat.com>
1615 * parser.c (cp_parser_parameter_declaration_list): Don't call
1616 grokdeclarator if cp_parser_error_occurred.
1617 (cp_parser_parameter_declaration): Simulate an error if we see
1618 the beginning of a CTAD form, i.e. if we see an opening brace
1619 after the decl-specifier-seq and the type is a CTAD placeholder.
1621 2021-08-10 Jakub Jelinek <jakub@redhat.com>
1623 * parser.c (cp_parser_member_declaration): Move odsd declaration
1624 before cp_parser_using_declaration call to avoid errors with
1627 2021-08-10 Jakub Jelinek <jakub@redhat.com>
1629 * parser.h (struct cp_omp_declare_simd_data): Remove
1630 in_omp_attribute_pragma and clauses members, add loc and attribs.
1631 (struct cp_oacc_routine_data): Remove loc member, add clauses
1633 * parser.c (cp_finalize_omp_declare_simd): New function.
1634 (cp_parser_handle_statement_omp_attributes): Mention in
1635 function comment the function is used also for
1636 attribute-declaration.
1637 (cp_parser_handle_directive_omp_attributes): New function.
1638 (cp_parser_statement): Don't call
1639 cp_parser_handle_statement_omp_attributes if statement doesn't
1640 have attribute-specifier-seq at the beginning at all or if
1641 if those attributes don't appertain to the statement.
1642 (cp_parser_simple_declaration): Call
1643 cp_parser_handle_directive_omp_attributes and
1644 cp_finalize_omp_declare_simd.
1645 (cp_parser_explicit_instantiation): Likewise.
1646 (cp_parser_init_declarator): Initialize prefix_attributes
1647 only after parsing declarators.
1648 (cp_parser_direct_declarator): Call
1649 cp_parser_handle_directive_omp_attributes and
1650 cp_finalize_omp_declare_simd.
1651 (cp_parser_member_declaration): Likewise.
1652 (cp_parser_single_declaration): Likewise.
1653 (cp_parser_omp_declare_simd): Don't initialize
1654 data.in_omp_attribute_pragma, instead initialize
1655 data.attribs[0] and data.attribs[1].
1656 (cp_finish_omp_declare_variant): Remove
1657 in_omp_attribute_pragma argument, instead use
1658 parser->lexer->in_omp_attribute_pragma.
1659 (cp_parser_late_parsing_omp_declare_simd): Adjust
1660 cp_finish_omp_declare_variant caller. Handle attribute-syntax
1661 declare simd/variant.
1663 2021-08-06 Tamar Christina <tamar.christina@arm.com>
1665 * cp-objcp-common.h (cxx_simulate_enum_decl): Pass vec<> by pointer.
1666 * decl.c (cxx_simulate_enum_decl): Likewise.
1668 2021-08-04 Jakub Jelinek <jakub@redhat.com>
1671 * parser.c (cp_parser_default_argument): Temporarily override
1672 parser->omp_declare_simd and parser->oacc_routine to NULL.
1674 2021-08-02 Patrick Palka <ppalka@redhat.com>
1677 * logic.cc (formula::formula): Use emplace_back instead of
1679 (formula::branch): Insert a copy of m_current directly after
1680 m_current instead of at the end of the list.
1681 (formula::erase): Define.
1682 (decompose_formula): Remove.
1683 (decompose_antecedents): Remove.
1684 (decompose_consequents): Remove.
1685 (derive_proofs): Remove.
1686 (max_problem_size): Remove.
1687 (diagnose_constraint_size): Remove.
1688 (subsumes_constraints_nonnull): Rewrite directly in terms of
1689 decompose_clause and derive_proof, interleaving decomposition
1690 with implication checking. Remove limit on constraint complexity.
1691 Use formula::erase to free the current clause before moving on to
1694 2021-07-31 Jason Merrill <jason@redhat.com>
1697 * decl.c (fixup_anonymous_aggr): Clear TYPE_NEEDS_CONSTRUCTING
1700 2021-07-31 Jason Merrill <jason@redhat.com>
1702 * ptree.c (cxx_print_type) [TYPE_PACK_EXPANSION]: Also print
1703 PACK_EXPANSION_PATTERN.
1705 2021-07-31 Jakub Jelinek <jakub@redhat.com>
1707 * parser.c (cp_parser_declaration): Handle OpenMP directives
1708 in attribute-declaration.
1710 2021-07-30 Jakub Jelinek <jakub@redhat.com>
1713 * cp-tree.h (enum cp_trait_kind): Add
1714 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1715 (enum cp_built_in_function): Add
1716 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.
1717 (fold_builtin_is_pointer_inverconvertible_with_class): Declare.
1718 * parser.c (cp_parser_primary_expression): Handle
1719 RID_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1720 (cp_parser_trait_expr): Likewise.
1721 * cp-objcp-common.c (names_builtin_p): Likewise.
1722 * constraint.cc (diagnose_trait_expr): Handle
1723 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1724 * decl.c (cxx_init_decl_processing): Register
1725 __builtin_is_pointer_interconvertible_with_class builtin.
1726 * constexpr.c (cxx_eval_builtin_function_call): Handle
1727 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS builtin.
1728 * semantics.c (pointer_interconvertible_base_of_p,
1729 first_nonstatic_data_member_p,
1730 fold_builtin_is_pointer_inverconvertible_with_class): New functions.
1731 (trait_expr_value): Handle CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1732 (finish_trait_expr): Likewise. Formatting fix.
1733 * cp-gimplify.c (cp_gimplify_expr): Fold
1734 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS. Call
1735 fndecl_built_in_p just once.
1736 (cp_fold): Likewise.
1737 * tree.c (builtin_valid_in_constant_expr_p): Handle
1738 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS. Call
1739 fndecl_built_in_p just once.
1740 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1741 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1743 2021-07-30 Jason Merrill <jason@redhat.com>
1745 * class.c (finish_struct_anon): Improve comment.
1746 * decl.c (fixup_anonymous_aggr): Reject anonymous struct
1749 2021-07-30 Jakub Jelinek <jakub@redhat.com>
1751 * parser.c (cp_parser_statement): Rollback attributes not just
1752 when std_attrs is non-NULL, but whenever
1753 cp_parser_std_attribute_spec_seq parsed any tokens.
1755 2021-07-30 Jakub Jelinek <jakub@redhat.com>
1758 * parser.c (cp_parser_skip_std_attribute_spec_seq): Add a forward
1760 (cp_parser_declaration): Parse empty-declaration and
1761 attribute-declaration.
1762 (cp_parser_toplevel_declaration): Don't parse empty-declaration here.
1764 2021-07-28 Martin Sebor <msebor@redhat.com>
1766 * init.c: Include new header.
1768 2021-07-27 Marek Polacek <polacek@redhat.com>
1772 * cp-gimplify.c (cp_fold): Remove {LE,LT,GE,GT_EXPR} from
1774 * typeck.c (cp_build_binary_op): Reject ordered comparison
1775 of two null pointers.
1777 2021-07-26 Jakub Jelinek <jakub@redhat.com>
1779 * parser.h (struct cp_lexer): Add orphan_p member.
1780 * parser.c (cp_parser_statement): Don't change in_omp_attribute_pragma
1781 upon restart from CPP_PRAGMA handling. Fix up condition when a lexer
1782 should be destroyed and adjust saved_tokens if it records tokens from
1783 the to be destroyed lexer.
1784 (cp_parser_omp_section_scan): New function.
1785 (cp_parser_omp_scan_loop_body): Use it. If
1786 parser->lexer->in_omp_attribute_pragma, allow optional comma
1788 (cp_parser_omp_sections_scope): Use cp_parser_omp_section_scan.
1790 2021-07-23 Jakub Jelinek <jakub@redhat.com>
1792 * parser.h (struct cp_parser): Add omp_attrs_forbidden_p member.
1793 * parser.c (cp_parser_handle_statement_omp_attributes): Diagnose
1794 mixing of attribute and pragma syntax directives when seeing
1795 omp::directive if parser->omp_attrs_forbidden_p or if attribute syntax
1796 directives are followed by OpenMP pragma.
1797 (cp_parser_statement): Clear parser->omp_attrs_forbidden_p after
1798 the cp_parser_handle_statement_omp_attributes call.
1799 (cp_parser_omp_structured_block): Add disallow_omp_attrs argument,
1800 if true, set parser->omp_attrs_forbidden_p.
1801 (cp_parser_omp_scan_loop_body, cp_parser_omp_sections_scope): Pass
1802 false as disallow_omp_attrs to cp_parser_omp_structured_block.
1803 (cp_parser_omp_parallel, cp_parser_omp_task): Set
1804 parser->omp_attrs_forbidden_p.
1806 2021-07-21 Thomas Schwinge <thomas@codesourcery.com>
1807 Joseph Myers <joseph@codesourcery.com>
1808 Cesar Philippidis <cesar@codesourcery.com>
1810 * parser.c (cp_parser_omp_clause_name): Handle 'nohost'.
1811 (cp_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
1812 (OACC_ROUTINE_CLAUSE_MASK): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
1813 * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
1814 * semantics.c (finish_omp_clauses): Likewise.
1816 2021-07-21 Jakub Jelinek <jakub@redhat.com>
1819 * semantics.c (finish_omp_reduction_clause): Also call
1820 complete_type_or_else and return true if it fails.
1822 2021-07-19 Iain Sandoe <iain@sandoe.co.uk>
1825 * coroutines.cc (struct coroutine_info): Add fields for
1826 actor and destroy function decls.
1828 (coro_get_ramp_function): New.
1829 (coro_get_actor_function): New.
1830 (coro_get_destroy_function): New.
1831 (act_des_fn): Set up mapping between ramp, actor and
1833 (morph_fn_to_coro): Adjust interface to the builder for
1834 helper function decls.
1835 * cp-tree.h (DECL_ACTOR_FN, DECL_DESTROY_FN, DECL_RAMP_FN,
1837 * mangle.c (write_encoding): Handle coroutine helpers.
1838 (write_unqualified_name): Handle lambda coroutine helpers.
1840 2021-07-16 Patrick Palka <ppalka@redhat.com>
1843 * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
1844 substituting DECL_ARGUMENTS.
1846 2021-07-16 Patrick Palka <ppalka@redhat.com>
1850 * search.c (check_final_overrider): Compare TYPE_REF_IS_RVALUE
1851 when the return types are references.
1853 2021-07-16 Marek Polacek <polacek@redhat.com>
1855 * typeck2.c (check_narrowing): Don't suppress the pedantic error
1858 2021-07-15 Jakub Jelinek <jakub@redhat.com>
1861 * cp-gimplify.c (cp_fold): For comparisons with NULLPTR_TYPE
1862 operands, fold them right away to true or false.
1864 2021-07-15 Jason Merrill <jason@redhat.com>
1867 * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
1868 (cp_tree_size): Remove redundant entries.
1870 2021-07-14 Patrick Palka <ppalka@redhat.com>
1873 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): Remove.
1874 * pt.c (push_template_decl): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
1876 (redeclare_class_template): Likewise.
1877 (forwarding_reference_p): Define.
1878 (maybe_adjust_types_for_deduction): Use it instead. Add 'tparms'
1880 (unify_one_argument): Pass tparms to
1881 maybe_adjust_types_for_deduction.
1882 (try_one_overload): Likewise.
1884 (rewrite_template_parm): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
1887 2021-07-14 Jason Merrill <jason@redhat.com>
1889 * class.c (struct find_final_overrider_data): Use auto_vec.
1890 (find_final_overrider): Remove explicit release.
1891 * coroutines.cc (process_conditional): Use auto_vec.
1892 * cp-gimplify.c (struct cp_genericize_data): Use auto_vec.
1893 (cp_genericize_tree): Remove explicit release.
1894 * parser.c (cp_parser_objc_at_property_declaration): Use
1896 * semantics.c (omp_reduction_lookup): Use auto_vec.
1898 2021-07-14 Marek Polacek <polacek@redhat.com>
1901 * constexpr.c (cxx_eval_array_reference): Create a new .object
1902 and .ctor for the non-aggregate non-scalar case too when
1905 2021-07-12 Patrick Palka <ppalka@redhat.com>
1909 * decl.c (grokfndecl): Don't require that deduction guides are
1910 declared at namespace scope. Check that class-scope deduction
1911 guides have the same access as the member class template.
1912 (grokdeclarator): Pretend class-scope deduction guides are static.
1913 * search.c (lookup_member): Don't use a BASELINK for (class-scope)
1916 2021-07-10 Patrick Palka <ppalka@redhat.com>
1919 * init.c (build_aggr_init): Return error_mark_node if
1920 expand_aggr_init_1 returns false.
1921 (expand_default_init): Change return type to bool. Return false
1922 on error, true on success.
1923 (expand_aggr_init_1): Likewise.
1925 2021-07-09 Jason Merrill <jason@redhat.com>
1928 * decl.c (function_requirements_equivalent_p): Only compare
1929 trailing requirements on a specialization.
1931 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
1933 * coroutines.cc (build_actor_fn): Move common code to
1935 (build_destroy_fn): Likewise.
1936 (act_des_fn): Build the void return here. Ensure that the
1937 source location matches the original function.
1939 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
1942 (coro_rewrite_function_body): Connect the replacement
1943 function block to the block nest correctly.
1945 2021-07-09 Patrick Palka <ppalka@redhat.com>
1948 * constraint.cc (tsubst_requires_expr): Pass complain/in_decl to
1950 * cp-tree.h (add_extra_args): Add complain/in_decl parameters.
1951 * pt.c (build_extra_args): Make a copy of args.
1952 (add_extra_args): Add complain/in_decl parameters. Enable the
1953 code for handling the case where the extra arguments are
1955 (tsubst_pack_expansion): Pass complain/in_decl to
1957 (tsubst_template_args): Handle missing template arguments.
1958 (tsubst_expr) <case IF_STMT>: Pass complain/in_decl to
1961 2021-07-09 Patrick Palka <ppalka@redhat.com>
1964 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Just walk the
1967 2021-07-08 Martin Sebor <msebor@redhat.com>
1970 * module.cc (identifier): Suppress warning.
1971 (module_state::read_macro_maps): Remove warning suppression.
1972 (module_state::install_macros): Ditto.
1974 2021-07-08 Marek Polacek <polacek@redhat.com>
1977 * cp-tree.h (unevaluated_p): New.
1978 * except.c (check_noexcept_r): Use it. Don't walk into
1979 unevaluated operands.
1981 2021-07-08 Martin Sebor <msebor@redhat.com>
1984 * module.cc (module_state::read_macro_maps): Temporarily disable
1986 (module_state::install_macros): Same.
1988 2021-07-06 Martin Sebor <msebor@redhat.com>
1990 * error.c (cp_printer): Remove support for %G and %K.
1992 2021-07-02 Jakub Jelinek <jakub@redhat.com>
1994 * parser.h (struct cp_lexer): Add in_omp_attribute_pragma member.
1995 (struct cp_omp_declare_simd_data): Likewise.
1996 * cp-tree.h (enum cp_tree_index): Add CPTI_OMP_IDENTIFIER.
1997 (omp_identifier): Define.
1998 * parser.c (cp_parser_skip_to_pragma_eol): Handle
1999 in_omp_attribute_pragma CPP_PRAGMA_EOL followed by CPP_EOF.
2000 (cp_parser_require_pragma_eol): Likewise.
2001 (struct cp_omp_attribute_data): New type.
2002 (cp_parser_handle_statement_omp_attributes): New function.
2003 (cp_parser_statement): Handle OpenMP directives in statement's
2004 attribute-specifier-seq.
2005 (cp_parser_omp_directive_args, cp_parser_omp_sequence_args): New
2007 (cp_parser_std_attribute): Handle omp::directive and omp::sequence
2009 (cp_parser_omp_all_clauses): If in_omp_attribute_pragma, allow
2010 a comma also before the first clause.
2011 (cp_parser_omp_allocate): Likewise.
2012 (cp_parser_omp_atomic): Likewise.
2013 (cp_parser_omp_depobj): Likewise.
2014 (cp_parser_omp_flush): Likewise.
2015 (cp_parser_omp_ordered): Likewise.
2016 (cp_parser_omp_declare_simd): Save in_omp_attribute_pragma
2017 into struct cp_omp_declare_simd_data.
2018 (cp_finish_omp_declare_variant): Add in_omp_attribute_pragma
2019 argument. If set, allow a comma also before match clause.
2020 (cp_parser_late_parsing_omp_declare_simd): If in_omp_attribute_pragma,
2021 allow a comma also before the first clause. Adjust
2022 cp_finish_omp_declare_variant caller.
2023 (cp_parser_omp_declare_target): If in_omp_attribute_pragma, allow
2024 a comma also before the first clause.
2025 (cp_parser_omp_declare_reduction_exprs): Likewise.
2026 (cp_parser_omp_requires): Likewise.
2027 * decl.c (initialize_predefined_identifiers): Initialize
2029 * decl2.c (cplus_decl_attributes): Reject omp::directive and
2030 omp::sequence attributes.
2032 2021-07-02 Jakub Jelinek <jakub@redhat.com>
2035 * parser.c (cp_parser_omp_atomic): Consume comma only if it
2036 appears before a CPP_NAME.
2038 2021-07-02 Patrick Palka <ppalka@redhat.com>
2041 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
2042 use common_enclosing_class and to not depend on the TREE_TYPE
2043 of outer levels pointing to the corresponding primary template.
2045 2021-07-01 Patrick Palka <ppalka@redhat.com>
2048 * constexpr.c (cxx_eval_array_reference): When the element type
2049 is an empty type and the corresponding element is omitted, just
2050 return an empty CONSTRUCTOR instead of attempting value
2053 2021-07-01 Patrick Palka <ppalka@redhat.com>
2056 * pt.c (finish_template_variable): Pass the partially
2057 instantiated template and its args to instantiate_template.
2058 (instantiate_class_template_1): No need to call
2059 push_nested_class and pop_nested_class around the call to
2060 most_specialized_partial_spec.
2061 (instantiate_template_1): Pass the partially instantiated
2062 template to lookup_template_variable.
2063 (most_specialized_partial_spec): Use push_access_scope_guard
2064 to set the access scope appropriately. Use
2065 deferring_access_check_sentinel to force access to get checked
2067 (instantiate_decl): Just pass the VAR_DECL to
2068 most_specialized_partial_spec.
2070 2021-06-30 Patrick Palka <ppalka@redhat.com>
2072 * constraint.cc (get_normalized_constraints_from_decl): Use
2073 push_access_scope_guard instead of push_nested_class_guard.
2074 * cp-tree.h (struct push_nested_class_guard): Replace with ...
2075 (struct push_access_scope_guard): ... this.
2076 * pt.c (push_access_scope): When the argument corresponds to
2077 a class type, push the class instead of its context.
2078 (pop_access_scope): Adjust accordingly.
2080 2021-06-30 Marek Polacek <polacek@redhat.com>
2084 * decl.c (create_array_type_for_decl): Allow array of auto.
2086 2021-06-29 Jason Merrill <jason@redhat.com>
2088 * pt.c (instantiate_decl): Only consider partial specializations of
2089 actual variable templates.
2091 2021-06-26 Patrick Palka <ppalka@redhat.com>
2094 * pt.c (instantiate_class_template_1): Enter the scope of the
2095 type when calling most_specialized_partial_spec.
2097 2021-06-26 Jason Merrill <jason@redhat.com>
2101 * class.c (is_empty_field): Handle null argument.
2102 * constexpr.c (cxx_eval_bare_aggregate): Discard initializer
2105 2021-06-26 Marek Polacek <polacek@redhat.com>
2108 * parser.c (cp_parser_declarator): Pass flags down to
2109 cp_parser_declarator. Also pass static_p/member_p.
2111 2021-06-25 Martin Sebor <msebor@redhat.com>
2113 * call.c (build_over_call): Replace direct uses of TREE_NO_WARNING
2114 with warning_suppressed_p, suppress_warning, and copy_no_warning, or
2115 nothing if not necessary.
2116 (set_up_extended_ref_temp): Same.
2117 * class.c (layout_class_type): Same.
2118 * constraint.cc (constraint_satisfaction_value): Same.
2119 * coroutines.cc (finish_co_await_expr): Same.
2120 (finish_co_yield_expr): Same.
2121 (finish_co_return_stmt): Same.
2122 (build_actor_fn): Same.
2123 (coro_rewrite_function_body): Same.
2124 (morph_fn_to_coro): Same.
2125 * cp-gimplify.c (genericize_eh_spec_block): Same.
2126 (gimplify_expr_stmt): Same.
2127 (cp_genericize_r): Same.
2129 * cp-ubsan.c (cp_ubsan_instrument_vptr): Same.
2130 * cvt.c (cp_fold_convert): Same.
2131 (convert_to_void): Same.
2132 * decl.c (wrapup_namespace_globals): Same.
2133 (grokdeclarator): Same.
2134 (finish_function): Same.
2135 (require_deduced_type): Same.
2136 * decl2.c (no_linkage_error): Same.
2137 (c_parse_final_cleanups): Same.
2138 * except.c (expand_end_catch_block): Same.
2139 * init.c (build_new_1): Same.
2141 (build_vec_delete_1): Same.
2142 (build_vec_init): Same.
2143 (build_delete): Same.
2144 * method.c (defaultable_fn_check): Same.
2145 * parser.c (cp_parser_fold_expression): Same.
2146 (cp_parser_primary_expression): Same.
2147 * pt.c (push_tinst_level_loc): Same.
2148 (tsubst_copy): Same.
2149 (tsubst_omp_udr): Same.
2150 (tsubst_copy_and_build): Same.
2151 * rtti.c (build_if_nonnull): Same.
2152 * semantics.c (maybe_convert_cond): Same.
2153 (finish_return_stmt): Same.
2154 (finish_parenthesized_expr): Same.
2155 (cp_check_omp_declare_reduction): Same.
2156 * tree.c (build_cplus_array_type): Same.
2157 * typeck.c (build_ptrmemfunc_access_expr): Same.
2158 (cp_build_indirect_ref_1): Same.
2159 (cp_build_function_call_vec): Same.
2160 (warn_for_null_address): Same.
2161 (cp_build_binary_op): Same.
2162 (unary_complex_lvalue): Same.
2163 (cp_build_modify_expr): Same.
2164 (build_x_modify_expr): Same.
2165 (convert_for_assignment): Same.
2167 2021-06-24 Patrick Palka <ppalka@redhat.com>
2170 * pt.c (maybe_aggr_guide): Handle alias templates appropriately.
2172 2021-06-24 Patrick Palka <ppalka@redhat.com>
2175 * constraint.cc (evaluate_requires_expr): Adjust function comment.
2176 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: Move to ...
2177 (cp_fold) <case REQUIRES_EXPR>: ... here.
2179 2021-06-24 Jakub Jelinek <jakub@redhat.com>
2181 * parser.c (cp_omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
2182 C_ORT_OMP for clauses on target construct.
2183 (OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
2184 (cp_parser_omp_target): For non-combined target add
2185 map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION. Pass
2186 C_ORT_OMP_TARGET to finish_omp_clauses.
2187 * semantics.c (handle_omp_array_sections_1): Adjust ort handling
2188 for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
2189 never present on C_ORT_*DECLARE_SIMD.
2190 (handle_omp_array_sections): Likewise.
2191 (finish_omp_clauses): Likewise. Handle OMP_CLAUSE_IN_REDUCTION
2192 on C_ORT_OMP_TARGET, set OMP_CLAUSE_MAP_IN_REDUCTION on
2193 corresponding map clauses.
2194 * pt.c (tsubst_expr): Pass C_ORT_OMP_TARGET instead of C_ORT_OMP for
2195 clauses on target construct.
2197 2021-06-23 Patrick Palka <ppalka@redhat.com>
2200 * pt.c (push_access_scope): For artificial deduction guides,
2201 set the access scope to that of the constructor.
2202 (pop_access_scope): Likewise.
2203 (build_deduction_guide): Don't set DECL_CONTEXT on the guide.
2205 2021-06-23 Patrick Palka <ppalka@redhat.com>
2208 * call.c (print_error_for_call_failure): Constify 'args' parameter.
2209 (perform_dguide_overload_resolution): Define.
2210 * cp-tree.h: (perform_dguide_overload_resolution): Declare.
2211 * pt.c (do_class_deduction): Use perform_dguide_overload_resolution
2212 instead of build_new_function_call. Don't use tf_decltype or
2213 set cp_unevaluated_operand. Remove unnecessary NULL_TREE tests.
2215 2021-06-21 Patrick Palka <ppalka@redhat.com>
2218 * typeck.c (check_return_expr): Call maybe_undo_parenthesized_ref
2219 sooner, before the NRVO handling.
2221 2021-06-21 Patrick Palka <ppalka@redhat.com>
2224 * tree.c (bot_replace): Use convert_to_base to build the
2225 conversion to the (morally) virtual base.
2227 2021-06-21 Jakub Jelinek <jakub@redhat.com>
2229 PR inline-asm/100785
2230 * typeck.c (cxx_mark_addressable): Diagnose trying to make
2231 bit-fields addressable.
2233 2021-06-17 Jason Merrill <jason@redhat.com>
2236 * decl.c (duplicate_decls): Make 'deleted after first declaration'
2237 pedwarn on by default.
2239 2021-06-17 Jason Merrill <jason@redhat.com>
2242 * init.c (build_vec_init): Preserve the type of base.
2244 2021-06-16 Jason Merrill <jason@redhat.com>
2248 * pt.c (tsubst_baselink): Update binfos in non-dependent case.
2250 2021-06-15 Robin Dapp <rdapp@linux.ibm.com>
2252 * decl.c (duplicate_decls): Likewise.
2254 2021-06-14 Tobias Burnus <tobias@codesourcery.com>
2257 * parser.c (cp_parser_omp_clause_affinity): No need to set iterator
2258 var in the error case.
2260 2021-06-13 Trevor Saunders <tbsaunde@tbsaunde.org>
2262 * constexpr.c (cxx_eval_call_expression): Iterate over vec<>
2263 with range based for.
2264 (cxx_eval_store_expression): Likewise.
2265 (cxx_eval_loop_expr): Likewise.
2266 * decl.c (wrapup_namespace_globals): Likewise.
2267 (cp_finish_decl): Likewise.
2268 (cxx_simulate_enum_decl): Likewise.
2269 * parser.c (cp_parser_postfix_expression): Likewise.
2271 2021-06-12 Jason Merrill <jason@redhat.com>
2274 * init.c (build_vec_init): Shortcut [0] case.
2276 2021-06-12 Jason Merrill <jason@redhat.com>
2278 * pt.c (lookup_template_class_1): Shortcut current_class_type.
2280 2021-06-11 Patrick Palka <ppalka@redhat.com>
2284 * pt.c (tsubst_arg_types): Rearrange so that we substitute into
2285 TYPE_ARG_TYPES in forward order while short circuiting
2286 appropriately. Adjust formatting.
2288 2021-06-11 Jakub Jelinek <jakub@redhat.com>
2291 * cp-tree.h (struct saved_scope): Add consteval_if_p
2292 member. Formatting fix for the discarded_stmt comment.
2293 (in_consteval_if_p, IF_STMT_CONSTEVAL_P): Define.
2294 * parser.c (cp_parser_lambda_expression): Temporarily disable
2295 in_consteval_if_p when parsing lambda body.
2296 (cp_parser_selection_statement): Parse consteval if.
2297 * decl.c (struct named_label_entry): Add in_consteval_if member.
2298 (level_for_consteval_if): New function.
2299 (poplevel_named_label_1, check_previous_goto_1, check_goto): Handle
2301 * constexpr.c (cxx_eval_builtin_function_call): Clarify in comment
2302 why CP_BUILT_IN_IS_CONSTANT_EVALUATED needs to *non_constant_p
2303 for !ctx->manifestly_const_eval.
2304 (cxx_eval_conditional_expression): For IF_STMT_CONSTEVAL_P evaluate
2305 condition as if it was __builtin_is_constant_evaluated call.
2306 (potential_constant_expression_1): For IF_STMT_CONSTEVAL_P always
2307 recurse on both branches.
2308 * cp-gimplify.c (genericize_if_stmt): Genericize IF_STMT_CONSTEVAL_P
2310 * pt.c (tsubst_expr) <case IF_STMT>: Copy IF_STMT_CONSTEVAL_P.
2311 Temporarily set in_consteval_if_p when recursing on
2312 IF_STMT_CONSTEVAL_P then branch.
2313 (tsubst_lambda_expr): Temporarily disable
2314 in_consteval_if_p when instantiating lambda body.
2315 * call.c (immediate_invocation_p): Return false when
2318 2021-06-11 Marek Polacek <polacek@redhat.com>
2321 * constexpr.c (maybe_constexpr_fn): New.
2322 * cp-tree.h (maybe_constexpr_fn): Declare.
2323 * semantics.c (find_std_constant_evaluated_r): New.
2324 (maybe_warn_for_constant_evaluated): New.
2325 (finish_if_stmt_cond): Call it.
2327 2021-06-10 Patrick Palka <ppalka@redhat.com>
2330 * pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
2331 the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
2332 a template template parameter, adjust to the
2333 TEMPLATE_TEMPLATE_PARAMETER before falling through.
2335 2021-06-10 Patrick Palka <ppalka@redhat.com>
2338 * constraint.cc (normalize_placeholder_type_constraints): When
2339 normalizing a non-templated return-type-requirement, add a dummy
2340 level to initial_parms.
2342 2021-06-08 Marek Polacek <polacek@redhat.com>
2345 * decl.c (grokdeclarator): Store a value-dependent
2346 explicit-specifier even for deduction guides.
2348 2021-06-08 Jason Merrill <jason@redhat.com>
2350 * parser.c (cp_parser_string_literal): Adjust diagnostic.
2352 2021-06-08 Jason Merrill <jason@redhat.com>
2355 * call.c (perfect_conversion_p): Check check_narrowing.
2357 2021-06-08 Jason Merrill <jason@redhat.com>
2360 * name-lookup.c (get_class_binding): Keep a BASELINK.
2361 (set_inherited_value_binding_p): Adjust.
2362 * lambda.c (is_lambda_ignored_entity): Adjust.
2363 * pt.c (lookup_template_function): Copy a BASELINK before
2366 2021-06-08 Jason Merrill <jason@redhat.com>
2369 * semantics.c (baselink_for_fns): Fix BASELINK_BINFO.
2371 2021-06-08 Jason Merrill <jason@redhat.com>
2373 * module.cc (duplicate_hash::hash): Comment out.
2374 (trees_in::tree_value): Adjust loop counter.
2376 2021-06-08 Jason Merrill <jason@redhat.com>
2379 * init.c (build_offset_ref): Return the BASELINK for a static
2382 2021-06-07 Patrick Palka <ppalka@redhat.com>
2385 * parser.c (cp_parser_lookup_name): Check access of the lookup
2386 result before we potentially adjust an injected-class-name to
2389 2021-06-06 Jakub Jelinek <jakub@redhat.com>
2392 * parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
2393 even when target is combined with other constructs.
2395 2021-06-04 Patrick Palka <ppalka@redhat.com>
2398 * pt.c (convert_template_argument): Strip top-level cv-quals
2399 on the substituted type of a non-type template parameter.
2401 2021-06-04 Patrick Palka <ppalka@redhat.com>
2404 * pt.c (tsubst_function_decl): Remove old code for reducing
2405 args when it has excess levels.
2407 2021-06-04 Jakub Jelinek <jakub@redhat.com>
2410 * name-lookup.c (maybe_save_operator_binding): Add op_attr after all
2411 ATTR_IS_DEPENDENT attributes in the DECL_ATTRIBUTES list rather than
2414 2021-06-03 Patrick Palka <ppalka@redhat.com>
2417 * decl.c (make_typename_type): After calling
2418 lookup_template_class, adjust the result to its TYPE_NAME and
2419 then consider the tf_keep_type_decl flag.
2421 2021-06-03 Patrick Palka <ppalka@redhat.com>
2424 * pt.c (set_current_access_from_decl): Move to ...
2425 * class.c (set_current_access_from_decl): ... here.
2426 (handle_using_decl): Use it to propagate the access of the
2427 using-enum decl to the copy of the imported enumerator.
2428 * cp-tree.h (set_current_access_from_decl): Declare.
2429 * decl.c (build_enumerator): Simplify using make_temp_override
2430 and set_current_access_from_decl.
2432 2021-06-03 Jakub Jelinek <jakub@redhat.com>
2435 * semantics.c (handle_omp_array_sections_1): For
2436 OMP_CLAUSE_{AFFINITY,DEPEND} handle FIELD_DECL base using
2437 finish_non_static_data_member and allow this as base.
2438 (finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
2439 after depend only cases. Let this be diagnosed by !lvalue_p
2440 case for OMP_CLAUSE_{AFFINITY,DEPEND} and remove useless
2442 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_AFFINITY.
2444 2021-06-02 Jason Merrill <jason@redhat.com>
2447 * call.c (convert_like_internal): Clear tf_no_cleanup when
2449 (build_user_type_conversion_1): Only add ck_rvalue if
2450 LOOKUP_ONLYCONVERTING.
2452 2021-06-01 Patrick Palka <ppalka@redhat.com>
2455 * init.c (expand_aggr_init_1): Check
2456 type_has_non_user_provided_default_constructor instead of
2457 type_has_user_provided_constructor.
2459 2021-06-01 Jason Merrill <jason@redhat.com>
2462 * call.c (build_op_delete_call): Don't set CALL_FROM_NEW_OR_DELETE_P
2463 for destroying delete.
2464 * init.c (build_delete): Don't clobber before destroying delete.
2466 2021-06-01 Jason Merrill <jason@redhat.com>
2469 * decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
2471 2021-05-31 Richard Biener <rguenther@suse.de>
2474 * cp-objcp-common.c (names_builtin_p): Handle
2475 RID_BUILTIN_SHUFFLEVECTOR.
2476 * cp-tree.h (build_x_shufflevector): Declare.
2477 * parser.c (cp_parser_postfix_expression): Handle
2478 RID_BUILTIN_SHUFFLEVECTOR.
2479 * pt.c (tsubst_copy_and_build): Handle IFN_SHUFFLEVECTOR.
2480 * typeck.c (build_x_shufflevector): Build either a lowered
2481 VEC_PERM_EXPR or an unlowered shufflevector via a temporary
2482 internal function IFN_SHUFFLEVECTOR.
2484 2021-05-28 Jason Merrill <jason@redhat.com>
2486 * constexpr.c (build_data_member_initialization): Use tsi_range.
2487 (build_constexpr_constructor_member_initializers): Likewise.
2488 (constexpr_fn_retval, cxx_eval_statement_list): Likewise.
2489 (potential_constant_expression_1): Likewise.
2490 * coroutines.cc (await_statement_expander): Likewise.
2491 (await_statement_walker): Likewise.
2492 * module.cc (trees_out::core_vals): Likewise.
2493 * pt.c (tsubst_expr): Likewise.
2494 * semantics.c (set_cleanup_locs): Likewise.
2496 2021-05-28 Jason Merrill <jason@redhat.com>
2500 * call.c (build_over_call): Adjust base_binfo in
2501 resolves_to_fixed_type_p case.
2503 2021-05-28 Jakub Jelinek <jakub@redhat.com>
2506 * semantics.c (handle_omp_array_sections): Copy
2507 OMP_CLAUSE_MAP_IMPLICIT.
2508 (finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
2509 marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT. Add
2510 map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
2511 maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
2512 present too. For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
2513 if present in map_head, map_field_head or map_firstprivate_head
2516 2021-05-28 Tobias Burnus <tobias@codesourcery.com>
2518 * parser.c (cp_parser_omp_clause_affinity): New.
2519 (cp_parser_omp_clause_name, cp_parser_omp_var_list_no_open,
2520 cp_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity
2522 * semantics.c (handle_omp_array_sections_1, handle_omp_array_sections,
2523 finish_omp_clauses): Likewise.
2525 2021-05-27 Matthias Kretz <kretz@kde.org>
2528 * error.c (dump_template_bindings): Include code to print
2529 "[with" and ']', conditional on whether anything is printed at
2530 all. This is tied to whether a semicolon is needed to separate
2531 multiple template parameters. If the template argument repeats
2532 the template parameter (T = T), then skip the parameter.
2533 (dump_substitution): Moved code to print "[with" and ']' to
2534 dump_template_bindings.
2535 (dump_function_decl): Partial revert of PR50828, which masked
2536 TFF_TEMPLATE_NAME for all of dump_function_decl. Now
2537 TFF_TEMPLATE_NAME is masked for the scope of the function and
2538 only carries through to dump_function_name.
2539 (dump_function_name): Avoid calling dump_template_parms if
2540 TFF_TEMPLATE_NAME is set.
2542 2021-05-27 Matthias Kretz <kretz@kde.org>
2545 * error.c: Call dump_scope when printing a typedef.
2547 2021-05-27 Patrick Palka <ppalka@redhat.com>
2550 * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
2552 2021-05-27 Jason Merrill <jason@redhat.com>
2555 * pt.c (use_pack_expansion_extra_args_p): Don't compare
2556 args from the same argument pack.
2558 2021-05-27 Patrick Palka <ppalka@redhat.com>
2563 * pt.c (process_partial_specialization): Don't error on a
2564 non-simple non-type template argument that involves template
2566 (for_each_template_parm_r): Don't walk TRAIT_EXPR, PLUS_EXPR,
2567 MULT_EXPR, or SCOPE_REF when include_nondeduced_p is false.
2569 2021-05-26 Patrick Palka <ppalka@redhat.com>
2572 * typeck.c (finish_class_member_access_expr): Disable ahead
2573 of time access checking during the member lookup.
2575 2021-05-26 Patrick Palka <ppalka@redhat.com>
2578 * tree.c (build_target_expr_with_type): Don't call force_rvalue
2579 on CALL_EXPR initializer. Simplify now that bot_manip is no
2581 (bot_manip): Use force_target_expr instead of
2582 build_target_expr_with_type.
2584 2021-05-26 Patrick Palka <ppalka@redhat.com>
2587 * cvt.c (noexcept_conv_p): Remove redundant checks and simplify.
2588 (fnptr_conv_p): Don't call non_reference. Use INDIRECT_TYPE_P
2589 instead of TYPE_PTR_P.
2590 * pt.c (convert_nontype_argument_function): Look through
2591 implicit INDIRECT_REFs before calling strip_fnptr_conv.
2593 2021-05-25 Jakub Jelinek <jakub@redhat.com>
2596 * call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
2597 and side-effects, temporarily disable -Wunused-result warning when
2598 building COMPOUND_EXPR.
2600 2021-05-21 Jakub Jelinek <jakub@redhat.com>
2603 * semantics.c (finish_omp_clauses): Move firstprivate clauses with
2604 OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain. Don't error
2605 if a decl is mentioned both in map clause and in such firstprivate
2606 clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
2608 2021-05-20 Jason Merrill <jason@redhat.com>
2610 * call.c (reference_binding): Check for designator.
2611 (implicit_conversion_1, build_special_member_call): Likewise.
2612 * decl.c (reshape_init_r): Likewise.
2613 * pt.c (do_class_deduction): Likewise.
2614 * typeck2.c (digest_init_r): Likewise.
2616 2021-05-20 Jason Merrill <jason@redhat.com>
2619 * decl.c (reshape_init_class): Handle designator for
2620 member of anonymous aggregate here.
2621 * typeck2.c (process_init_constructor_record): Not here.
2623 2021-05-20 Jonathan Wakely <jwakely@redhat.com>
2625 * call.c (maybe_warn_array_conv): Use new warning option.
2626 * decl.c (mark_inline_variable, grokdeclarator): Likewise.
2627 * error.c (maybe_warn_cpp0x): Likewise.
2628 * parser.c (cp_parser_primary_expression)
2629 (cp_parser_unqualified_id)
2630 (cp_parser_pseudo_destructor_name)
2631 (cp_parser_lambda_introducer)
2632 (cp_parser_lambda_declarator_opt)
2633 (cp_parser_selection_statement)
2634 (cp_parser_init_statement)
2635 (cp_parser_decomposition_declaration)
2636 (cp_parser_function_specifier_opt)
2637 (cp_parser_static_assert)
2638 (cp_parser_namespace_definition)
2639 (cp_parser_using_declaration)
2640 (cp_parser_asm_definition)
2641 (cp_parser_ctor_initializer_opt_and_function_body)
2642 (cp_parser_initializer_list)
2643 (cp_parser_type_parameter_key)
2644 (cp_parser_member_declaration)
2645 (cp_parser_try_block)
2646 (cp_parser_std_attribute_spec): Likewise.
2647 * pt.c (check_template_variable): Likewise.
2649 2021-05-20 Jason Merrill <jason@redhat.com>
2652 * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
2654 2021-05-20 Jason Merrill <jason@redhat.com>
2657 * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
2659 2021-05-19 Jason Merrill <jason@redhat.com>
2663 * method.c (genericize_spaceship): Use fold_build2 for scalar
2666 2021-05-19 Jason Merrill <jason@redhat.com>
2668 * pt.c (build_deduction_guide): Treat the implicit deduction guide
2669 as a member of the class.
2671 2021-05-19 Marek Polacek <polacek@redhat.com>
2674 * cp-tree.h (any_non_type_attribute_p): Remove.
2675 * decl.c (grokdeclarator): Turn an error into a warning and only
2676 warn for standard attributes.
2677 * decl2.c (any_non_type_attribute_p): Remove.
2678 * parser.c (cp_parser_elaborated_type_specifier): Turn an error
2679 into a warning and only warn for standard attributes.
2680 (cp_parser_member_declaration): Likewise.
2682 2021-05-19 Martin Liska <mliska@suse.cz>
2685 * mangle.c (write_encoding): Fix typos.
2687 2021-05-19 Jakub Jelinek <jakub@redhat.com>
2690 * parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
2691 master when combined with taskloop.
2692 (cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
2693 parallel master when not combined with taskloop.
2695 2021-05-19 Jason Merrill <jason@redhat.com>
2698 * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
2700 2021-05-19 Jason Merrill <jason@redhat.com>
2703 * tree.c (strip_typedefs): Only look at the pattern of a
2704 TYPE_PACK_EXPANSION if it's a type.
2706 2021-05-18 Marek Polacek <polacek@redhat.com>
2708 * class.c (classtype_has_non_deleted_copy_ctor): Remove.
2709 * constraint.cc (contains_wildcard_p): Likewise.
2710 (get_template_head_requirements): Likewise.
2711 (check_constrained_friend): Likewise.
2712 (subsumes_constraints): Likewise.
2713 * cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
2714 (push_void_library_fn): Likewise.
2715 (get_pattern_parm): Likewise.
2716 (get_template_parms_at_level): Likewise.
2717 (lambda_return_type): Likewise.
2718 (get_template_head_requirements): Likewise.
2719 (check_constrained_friend): Likewise.
2720 (subsumes_constraints): Likewise.
2721 * decl.c (push_void_library_fn): Likewise.
2722 * lambda.c (lambda_return_type): Likewise.
2723 * pt.c (get_template_parms_at_level): Likewise.
2724 (get_pattern_parm): Likewise.
2726 2021-05-18 Jason Merrill <jason@redhat.com>
2729 * call.c (perfect_candidate_p): An implicitly deleted move
2732 2021-05-18 Andreas Krebbel <krebbel@linux.ibm.com>
2735 * cvt.c (cp_convert_to_pointer): Use the size of the target
2737 * tree.c (cp_build_reference_type): Call
2738 cp_build_reference_type_for_mode with VOIDmode.
2739 (cp_build_reference_type_for_mode): Rename from
2740 cp_build_reference_type. Add MODE argument and invoke
2741 build_reference_type_for_mode.
2742 (strip_typedefs): Use build_pointer_type_for_mode and
2743 cp_build_reference_type_for_mode for pointers and references.
2745 2021-05-17 Jonathan Wakely <jwakely@redhat.com>
2748 * call.c (convert_like_internal): Print different diagnostic if
2749 the lvalue reference is const.
2751 2021-05-14 Jason Merrill <jason@redhat.com>
2754 * pt.c (enclosing_instantiation_of): Just compare
2755 DECL_SOURCE_LOCATION.
2756 (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
2758 2021-05-14 Marek Polacek <polacek@redhat.com>
2759 Jason Merrill <jason@redhat.com>
2762 * cp-tree.h (any_non_type_attribute_p): Declare.
2763 * decl.c (grokdeclarator): Diagnose when an attribute appertains to
2764 a friend declaration that is not a definition.
2765 * decl2.c (any_non_type_attribute_p): New.
2766 * parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
2767 in the middle of decl-specifiers.
2768 (cp_parser_elaborated_type_specifier): Diagnose when an attribute
2769 appertains to a friend declaration that is not a definition.
2770 (cp_parser_member_declaration): Likewise.
2772 2021-05-12 Marek Polacek <polacek@redhat.com>
2774 * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
2777 2021-05-12 Marcel Vollweiler <marcel@codesourcery.com>
2779 * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
2782 2021-05-11 Jason Merrill <jason@redhat.com>
2785 * typeck.c (build_reinterpret_cast_1): Check intype on
2788 2021-05-11 Patrick Palka <ppalka@redhat.com>
2791 * name-lookup.c (maybe_save_operator_binding): Unconditionally
2792 enable for all function templates, not just generic lambdas.
2793 Handle compound-assignment operator expressions.
2794 * typeck.c (build_x_compound_expr): Call maybe_save_operator_binding
2795 in the type-dependent case.
2796 (build_x_modify_expr): Likewise. Move declaration of 'op' closer
2799 2021-05-11 Patrick Palka <ppalka@redhat.com>
2802 * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
2803 (satisfy_atom): Set up iloc_sentinel before calling
2805 * pt.c (tsubst_pack_expansion): When returning a rebuilt pack
2806 expansion, carry over PACK_EXPANSION_LOCAL_P and
2807 PACK_EXPANSION_SIZEOF_P from the original pack expansion.
2809 2021-05-10 Richard Biener <rguenther@suse.de>
2811 PR middle-end/100464
2813 * call.c (set_up_extended_ref_temp): Mark the temporary
2814 addressable if the TARGET_EXPR was.
2816 2021-05-10 Martin Liska <mliska@suse.cz>
2818 * decl.c (duplicate_decls): Use startswith
2819 function instead of strncmp.
2820 (cxx_builtin_function): Likewise.
2821 (omp_declare_variant_finalize_one): Likewise.
2822 (grokfndecl): Likewise.
2823 * error.c (dump_decl_name): Likewise.
2824 * mangle.c (find_decomp_unqualified_name): Likewise.
2825 (write_guarded_var_name): Likewise.
2826 (decl_tls_wrapper_p): Likewise.
2827 * parser.c (cp_parser_simple_type_specifier): Likewise.
2828 (cp_parser_tx_qualifier_opt): Likewise.
2829 * pt.c (template_parm_object_p): Likewise.
2830 (dguide_name_p): Likewise.
2832 2021-05-10 Martin Liska <mliska@suse.cz>
2835 * decl.c (grokdeclarator): Remove redundant NULL check.
2837 2021-05-07 Jason Merrill <jason@redhat.com>
2839 * tree.c (rvalue): Assert expr is not a class lvalue.
2841 2021-05-07 Jason Merrill <jason@redhat.com>
2843 * cp-tree.h (build_stub_object): Declare.
2844 * method.c (build_stub_object): No longer static.
2845 * call.c (can_convert): Use it.
2846 * tree.c (build_dummy_object): Adjust comment.
2847 * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
2850 2021-05-07 Jason Merrill <jason@redhat.com>
2852 * coroutines.cc (build_co_await): Don't call 'rvalue'.
2853 (flatten_await_stmt): Simplify initialization.
2854 (morph_fn_to_coro): Change 'rvalue' to 'move'. Simplify.
2856 2021-05-04 Tobias Burnus <tobias@codesourcery.com>
2858 * semantics.c (finish_omp_reduction_clause): Accept float + complex
2859 for || and && reductions.
2861 2021-05-03 Patrick Palka <ppalka@redhat.com>
2864 * parser.c (cp_parser_class_head): Reinstate calls to pushclass
2865 and popclass when parsing the base-clause that were removed in
2868 2021-05-03 Patrick Palka <ppalka@redhat.com>
2872 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
2873 only when the callee is a FUNCTION_DECL.
2875 2021-05-03 Marek Polacek <polacek@redhat.com>
2878 * decl.c (grokfndecl): Check current_template_parms.
2880 2021-05-03 Marek Polacek <polacek@redhat.com>
2883 * constexpr.c (cxx_eval_constant_expression): Don't check
2886 2021-05-01 Jason Merrill <jason@redhat.com>
2888 * cp-tree.h (class ovl_iterator): Allow copying. Add op==.
2889 (class ovl_range, class lkp_range): New.
2890 * call.c (build_op_call_1, add_candidates): Use them.
2891 (build_op_delete_call, has_trivial_copy_assign_p): Likewise.
2892 (has_trivial_copy_p): Likewise.
2893 * class.c (handle_using_decl, get_basefndecls): Likewise.
2894 (maybe_warn_about_overly_private_class): Likewise.
2895 (warn_hidden, add_implicitly_declared_members): Likewise.
2896 (check_methods, clone_constructors_and_destructors): Likewise.
2897 (type_has_user_nondefault_constructor): Likewise.
2899 2021-04-29 Jason Merrill <jason@redhat.com>
2901 * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
2904 2021-04-29 Jason Merrill <jason@redhat.com>
2907 * decl2.c (grokfield): Call cplus_decl_attributes for friend.
2908 (save_template_attributes): Use chainon.
2909 * friend.c (do_friend): Remove attrlist parm.
2910 * cp-tree.h (do_friend): Adjust.
2911 * class.c (add_implicitly_declared_members): Adjust.
2912 * decl.c (grokdeclarator): Adjust.
2913 * pt.c (apply_late_template_attributes): Optimize.
2915 2021-04-29 Jason Merrill <jason@redhat.com>
2918 * class.c (finish_struct_anon_r): Drop complain parm.
2919 Remove non-field diagnostic.
2920 (finish_struct_anon): Adjust.
2921 * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here.
2923 2021-04-29 Jason Merrill <jason@redhat.com>
2925 * cp-tree.h (cp_evaluated): Add reset parm to constructor.
2926 * parser.c (cp_parser_constant_expression): Change
2927 allow_non_constant_p to int. Use cp_evaluated.
2928 (cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
2929 * semantics.c (finish_id_expression_1): Don't mess with
2930 cp_unevaluated_operand here.
2932 2021-04-29 Jason Merrill <jason@redhat.com>
2934 * cp-tree.h: Clarify comments.
2935 * pt.c (get_template_parm_object): Add assert.
2936 * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR.
2937 * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR.
2938 * typeck2.c (store_init_value): Likewise.
2940 2021-04-29 Patrick Palka <ppalka@redhat.com>
2943 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
2944 set tf_conv during the initial substitution into the function.
2946 2021-04-29 Jakub Jelinek <jakub@redhat.com>
2949 * semantics.c (finish_omp_clauses): Fix up check that variable
2950 mentioned in detach clause doesn't appear in data-sharing clauses.
2952 2021-04-28 Jakub Jelinek <jakub@redhat.com>
2954 * module.cc: Remove #error that triggers if DEV-PHASE is empty.
2956 2021-04-27 Jason Merrill <jason@redhat.com>
2959 * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
2962 2021-04-27 Patrick Palka <ppalka@redhat.com>
2965 * pt.c (tsubst_initializer_list): Correctly handle the case
2966 where an argument inside a base initializer pack expansion is
2967 itself a pack expansion.
2969 2021-04-26 Patrick Palka <ppalka@redhat.com>
2972 * constexpr.c (cxx_fold_indirect_ref): Try to canonicalize the
2973 object/offset pair for a POINTER_PLUS_EXPR of a COMPONENT_REF
2974 with a negative offset into one whose offset is nonnegative
2975 before calling cxx_fold_indirect_ref_1.
2977 2021-04-24 Patrick Palka <ppalka@redhat.com>
2984 * pt.c (do_class_deduction): Punt if the initializer is
2987 2021-04-24 Patrick Palka <ppalka@redhat.com>
2990 * parser.c (cp_parser_type_id_1): If we see a template
2991 placeholder, first try simulating an error before issuing
2994 2021-04-23 Patrick Palka <ppalka@redhat.com>
2997 * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
2998 Adjust parameter list loop to iterate over 'types' instead of
2999 'args'. Output the trailing '...' for a variadic function.
3000 Remove PARM_DECL support.
3001 (pp_cxx_requires_expr): Pretty print the parameter list directly
3002 instead of going through pp_cxx_parameter_declaration_clause.
3004 2021-04-23 Patrick Palka <ppalka@redhat.com>
3007 * decl.c (is_direct_enum_init): Check the implicit
3008 convertibility requirement added by CWG 2374.
3010 2021-04-23 Martin Liska <mliska@suse.cz>
3012 * cp-tree.h (STATIC_ASSERT): Prefer static assert.
3013 * lex.c (init_operators): Remove run-time check.
3015 2021-04-22 Marek Polacek <polacek@redhat.com>
3018 * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
3019 op1 separately for value- or type-dependence.
3021 2021-04-21 Marek Polacek <polacek@redhat.com>
3024 * parser.c (cp_parser_enum_specifier): Don't allow defining
3027 2021-04-21 Martin Liska <mliska@suse.cz>
3030 2021-04-21 Martin Liska <mliska@suse.cz>
3032 * error.c (dump_decl): Use flags in dump_generic_node call.
3034 2021-04-21 Martin Liska <mliska@suse.cz>
3036 * error.c (dump_decl): Use flags in dump_generic_node call.
3038 2021-04-21 Martin Liska <mliska@suse.cz>
3040 * error.c (dump_decl): Support anonymous labels.
3042 2021-04-20 Jason Merrill <jason@redhat.com>
3045 * pt.c (find_parameter_packs_r): Look into enum initializers.
3047 2021-04-19 Marek Polacek <polacek@redhat.com>
3050 * decl.c (grokvardecl): Given an error when a concept is not defined
3053 2021-04-16 Jakub Jelinek <jakub@redhat.com>
3056 * constexpr.c (cxx_eval_store_expression): Don't add CONSTRUCTORs
3057 for empty classes into *valp when types don't match even when *valp
3060 2021-04-16 Marek Polacek <polacek@redhat.com>
3063 * decl.c (make_typename_type): Give an error and return when
3064 name is is_overloaded_fn.
3065 * parser.c (cp_parser_class_name): Don't check is_overloaded_fn
3066 before calling make_typename_type.
3068 2021-04-16 Patrick Palka <ppalka@redhat.com>
3071 * constexpr.c (reduced_constant_expression_p): For array
3072 CONSTRUCTORs, use a dedicated loop that additionally verifies
3073 the CONSTRUCTOR spans the entire array.
3075 2021-04-16 Jakub Jelinek <jakub@redhat.com>
3078 * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
3079 If lambda_p, return pce_ok instead of pce_maybe_postfix.
3081 2021-04-16 Jakub Jelinek <jakub@redhat.com>
3084 * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
3085 binding, add to data.internal also all corresponding structured
3088 2021-04-16 Jason Merrill <jason@redhat.com>
3091 * cp-tree.h (first_field): Declare.
3092 * mangle.c (range_expr_nelts): New.
3093 (write_expression): Improve class NTTP mangling.
3094 * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
3095 * tree.c (zero_init_expr_p): Improve class NTTP handling.
3096 * decl.c: Adjust comment.
3098 2021-04-15 Jason Merrill <jason@redhat.com>
3101 * call.c (build_new_method_call_1): Check again for side-effects
3102 with a volatile object.
3104 2021-04-15 Jason Merrill <jason@redhat.com>
3108 * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
3109 TYPE_RAISES_EXCEPTIONS here.
3110 * tree.c (cp_walk_subtrees): Not here.
3112 2021-04-15 Jason Merrill <jason@redhat.com>
3116 * parser.c (cp_parser_default_type_template_argument): Set
3117 parser->local_variables_forbidden_p.
3119 2021-04-15 Richard Sandiford <richard.sandiford@arm.com>
3122 * typeck.c (merge_type_attributes_from): New function.
3123 (cp_common_type): Use it for vector types.
3125 2021-04-14 Jason Merrill <jason@redhat.com>
3129 * pt.c (uses_outer_template_parms): Also look at default
3132 2021-04-14 Jason Merrill <jason@redhat.com>
3135 * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
3136 for a non-static data member in a constant-expression.
3138 2021-04-14 Patrick Palka <ppalka@redhat.com>
3142 * pt.c (deducible_expression): Look through implicit
3143 INDIRECT_REFs as well.
3145 2021-04-14 Jason Merrill <jason@redhat.com>
3148 * parser.c (cp_parser_lambda_expression): Reject lambda
3149 in template parameter type.
3151 2021-04-14 Jason Merrill <jason@redhat.com>
3154 * decl.c (duplicate_decls): Don't propagate
3155 DECL_INITIALIZED_IN_CLASS_P to a specialization.
3157 2021-04-14 Jason Merrill <jason@redhat.com>
3162 * semantics.c (set_cleanup_locs): New.
3163 (do_poplevel): Call it.
3164 * parser.c (cp_parser_compound_statement): Consume the }
3165 before finish_compound_stmt.
3167 2021-04-13 Jason Merrill <jason@redhat.com>
3170 * pt.c (get_underlying_template): Compare TYPE_QUALS.
3172 2021-04-13 Jason Merrill <jason@redhat.com>
3176 * init.c (get_nsdmi): Do more context adjustment for local classes.
3178 2021-04-13 Patrick Palka <ppalka@redhat.com>
3181 * pt.c (do_class_deduction): Reject alias CTAD in C++17 mode
3182 rather than issuing a pedwarn.
3183 * typeck2.c (build_functional_cast_1): Handle CTAD uniformly
3184 for consistent diagnostics.
3186 2021-04-13 Jason Merrill <jason@redhat.com>
3189 * class.c (build_base_path): Shortcut simple non-pointer case.
3191 2021-04-13 Eric Botcazou <ebotcazou@adacore.com>
3193 * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
3195 (module_state::write_location): Likewise.
3197 2021-04-13 Patrick Palka <ppalka@redhat.com>
3200 * pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
3201 when checking if the initializer is an equivalent class
3202 placeholder template parameter.
3204 2021-04-13 Patrick Palka <ppalka@redhat.com>
3208 * constraint.cc (satisfy_normalized_constraints): Set
3210 * parser.c (cp_parser_concept_definition): Likewise.
3211 (cp_parser_requires_clause_opt): Likewise.
3213 2021-04-12 Jason Merrill <jason@redhat.com>
3216 * pt.c (uses_outer_template_parms): Handle non-type and template
3217 template parameters specifically.
3219 2021-04-11 Jason Merrill <jason@redhat.com>
3222 * decl.c (fixup_anonymous_aggr): Prune all functions from
3223 CLASSTYPE_MEMBER_VEC.
3225 2021-04-10 Jason Merrill <jason@redhat.com>
3229 * parser.c (cp_parser_direct_declarator): Don't
3230 inject_this_parameter if static_p.
3231 (cp_parser_omp_var_list_no_open): Parse 'this' even if
3232 current_class_ptr isn't set for a better diagnostic.
3234 2021-04-10 Jason Merrill <jason@redhat.com>
3241 * pt.c (alias_ctad_tweaks): Handle failure better.
3243 2021-04-10 Jason Merrill <jason@redhat.com>
3246 * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
3248 2021-04-09 Patrick Palka <ppalka@redhat.com>
3250 * cp-tree.h (LAMBDA_EXPR_REGENERATED_FROM)
3251 (LAMBDA_EXPR_REGENERATING_TARGS): Replace these with ...
3252 (LAMBDA_EXPR_REGEN_INFO): ... this.
3253 (tree_lambda_expr::regenerated_from)
3254 (tree_lambda_expr::regenerating_targs): Replace these with ...
3255 (tree_lambda_expr::regen_info): ... this.
3256 * constraint.cc (satisfy_declaration_constraints): Adjust
3258 * lambda.c (build_lambda_expr): Likewise.
3259 * pt.c (regenerated_lambda_fn_p): Likewise.
3260 (most_general_lambda): Likewise.
3261 (tsubst_lambda_expr): Likewise.
3263 2021-04-09 Marek Polacek <polacek@redhat.com>
3266 * parser.c (cp_parser_member_declaration): Call
3267 cp_parser_save_default_args even for function templates. Use
3268 STRIP_TEMPLATE on the declaration we're passing.
3270 2021-04-08 Patrick Palka <ppalka@redhat.com>
3273 * constraint.cc (get_normalized_constraints_from_decl): Handle
3274 regenerated lambdas.
3275 (satisfy_declaration_constraints): Likewise. Check for
3276 dependent args later.
3277 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): Replace with ...
3278 (LAMBDA_EXPR_REGENERATED_FROM): ... this.
3279 (LAMBDA_EXPR_REGENERATING_TARGS): New.
3280 (tree_lambda_expr::regenerated_from): New data member.
3281 (tree_lambda_expr::regenerating_targs): New data member.
3282 (add_to_template_args): Declare.
3283 (regenerated_lambda_fn_p): Likewise.
3284 (most_general_lambda): Likewise.
3285 * lambda.c (build_lambda_expr): Set LAMBDA_EXPR_REGENERATED_FROM
3286 and LAMBDA_EXPR_REGENERATING_TARGS.
3287 * pt.c (add_to_template_args): No longer static.
3288 (tsubst_function_decl): Unconditionally propagate constraints on
3289 the substituted function decl.
3290 (instantiated_lambda_fn_p): Rename to ...
3291 (regenerated_lambda_fn_p): ... this. Check
3292 LAMBDA_EXPR_REGENERATED_FROM instead of
3293 LAMBDA_EXPR_INSTANTIATED.
3294 (most_general_lambda): Define.
3295 (enclosing_instantiation_of): Adjust after renaming
3296 instantiated_lambda_fn_p.
3297 (tsubst_lambda_expr): Don't set LAMBDA_EXPR_INSTANTIATED. Set
3298 LAMBDA_EXPR_REGENERATED_FROM and LAMBDA_EXPR_REGENERATING_TARGS.
3299 Don't substitute or set constraints on the regenerated lambda.
3301 2021-04-08 Patrick Palka <ppalka@redhat.com>
3304 * pt.c (build_deduction_guide): Document OUTER_ARGS. Substitute
3305 them into the propagated constraints.
3307 2021-04-08 Jason Merrill <jason@redhat.com>
3310 * call.c (convert_like_internal): Improve reference diagnostic.
3312 2021-04-08 Jakub Jelinek <jakub@redhat.com>
3315 * constexpr.c (addr_of_non_const_var): New function.
3316 (cxx_bind_parameters_in_call): Set *non_constant_args to true
3317 even if cp_walk_tree on arg with addr_of_non_const_var callback
3320 2021-04-08 Jason Merrill <jason@redhat.com>
3323 * pt.c (determine_specialization): Improve diagnostic.
3325 2021-04-08 Marek Polacek <polacek@redhat.com>
3328 * decl.c (build_explicit_specifier): Call
3329 check_for_bare_parameter_packs.
3330 * except.c (build_noexcept_spec): Likewise.
3332 2021-04-07 Jason Merrill <jason@redhat.com>
3335 * parser.c (cp_parser_class_name): Check dependent_scope_p.
3337 2021-04-07 Jason Merrill <jason@redhat.com>
3340 * pt.c (maybe_process_partial_specialization): Check
3341 DECL_SELF_REFERENCE_P.
3343 2021-04-07 Jason Merrill <jason@redhat.com>
3346 * name-lookup.c (push_class_level_binding_1): Do overload a new
3347 function with a previous using-declaration.
3349 2021-04-06 Jason Merrill <jason@redhat.com>
3352 * init.c (get_nsdmi): Don't defer access checking.
3354 2021-04-06 Jason Merrill <jason@redhat.com>
3357 * decl.c (cp_finish_decl): mark_needed an implicitly inline
3358 static data member with an out-of-class redeclaration.
3360 2021-04-06 Jason Merrill <jason@redhat.com>
3363 * mangle.c (write_compact_number): Add sanity check.
3364 (write_local_name): Use list_length for parm number.
3366 2021-04-06 Patrick Palka <ppalka@redhat.com>
3369 * pt.c (do_auto_deduction): Don't exit early when deducing the
3370 array type of a structured binding. Also handle adc_decomp_type
3371 during constraint checking.
3373 2021-04-05 Jason Merrill <jason@redhat.com>
3376 * typeck.c (check_return_expr): Call mark_exp_read in dependent
3379 2021-04-05 Jason Merrill <jason@redhat.com>
3382 * typeck.c (build_reinterpret_cast_1): Don't perform
3383 temporary materialization.
3385 2021-04-05 Jason Merrill <jason@redhat.com>
3388 * pt.c (lookup_template_class_1): Do tsubst_enum when
3389 tsubsting a generic lambda.
3391 2021-04-05 Jason Merrill <jason@redhat.com>
3394 * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
3395 there is no enclosing non-lambda function.
3397 2021-04-05 Nathan Sidwell <nathan@acm.org>
3400 * module.cc (name_pending_imports): Drop 'atend' parm. Don't
3401 query export when not needed.
3402 (preprocess_module, preprocessed_module): Adjust.
3404 2021-04-05 Jason Merrill <jason@redhat.com>
3407 * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
3409 2021-04-05 Jason Merrill <jason@redhat.com>
3412 * pt.c (class el_data): Add visited field.
3413 (extract_local_specs): Pass it to cp_walk_tree.
3414 (extract_locals_r): Walk into the body of a lambda.
3416 2021-04-05 Jason Merrill <jason@redhat.com>
3418 * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
3421 2021-04-04 Jason Merrill <jason@redhat.com>
3424 * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
3426 2021-04-03 Marek Polacek <polacek@redhat.com>
3429 * parser.c: Create a GC root for attributes in a decl specifier.
3430 (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
3432 2021-04-03 Jason Merrill <jason@redhat.com>
3435 * pt.c (tsubst_lambda_expr): Skip the body block from
3438 2021-04-03 Jason Merrill <jason@redhat.com>
3441 * cvt.c (can_convert_qual): Check fnptr_conv_p.
3443 2021-04-03 Jason Merrill <jason@redhat.com>
3446 * pt.c (regenerate_decl_from_template): tsubst_decl
3449 2021-04-02 Patrick Palka <ppalka@redhat.com>
3452 * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
3453 to do_auto_deduction.
3455 2021-04-02 Patrick Palka <ppalka@redhat.com>
3458 * semantics.c (finish_compound_literal): Check
3459 template_placeholder_p instead of type_uses_auto.
3461 2021-04-02 Jason Merrill <jason@redhat.com>
3464 * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
3465 * lambda.c (add_capture): Set it.
3466 * pt.c (tsubst_pack_expansion): Handle it.
3468 2021-04-02 Nathan Sidwell <nathan@acm.org>
3470 * cp-tree.h (lang_decl_base): Correct module flag comment.
3471 * module.cc (trees_in::assert_definition): Break out
3473 (trees_out::lang_decl_bools): Do not write purview for header units.
3475 2021-04-01 Marek Polacek <polacek@redhat.com>
3478 * method.c (defaulted_late_check): ++ and -- function_depth around
3479 the call to synthesize_method.
3480 * pt.c: Remove the saved_trees global.
3482 2021-04-01 Jason Merrill <jason@redhat.com>
3486 * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
3487 TYPE_RAISES_EXCEPTIONS.
3489 2021-04-01 Iain Sandoe <iain@sandoe.co.uk>
3491 * mapper-client.cc (INCLUDE_MAP): New; require map to be
3492 included from system.h.
3493 * mapper-resolver.cc (INCLUDE_MAP): Likewise.
3495 2021-04-01 Jason Merrill <jason@redhat.com>
3498 * mangle.c (write_expression): Adjust.
3499 * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
3500 (mark_abi_tags_r): Likewise.
3502 2021-04-01 Nathan Sidwell <nathan@acm.org>
3505 * module.cc (trees_out::decl_node): Adjust importedness reference
3507 (module_state::intercluster_seed): New. Seed both imports and
3508 inter-cluster references. Broken out of ...
3509 (module_state::write_cluster): ... here. Call it.
3511 2021-03-31 Jason Merrill <jason@redhat.com>
3514 * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
3516 2021-03-31 Patrick Palka <ppalka@redhat.com>
3519 * mangle.c (write_expression): Adjust the mangling of
3522 2021-03-31 Patrick Palka <ppalka@redhat.com>
3525 * pt.c (placeholder_type_constraint_dependent_p): Expand
3526 argument packs to separate the first non-pack argument
3529 2021-03-30 Nathan Sidwell <nathan@acm.org>
3532 * module.cc (dumper::operator): Make less brittle.
3533 (trees_out::core_bools): VAR_DECLs always have a context.
3534 (trees_out::key_mergeable): Use same_type_p for asserting.
3535 (trees_in::read_var_def): Propagate
3536 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
3538 2021-03-30 Jakub Jelinek <jakub@redhat.com>
3541 * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
3543 2021-03-26 Marek Polacek <polacek@redhat.com>
3546 * method.c (implicitly_declare_fn): Pass &raises to
3547 synthesized_method_walk.
3549 2021-03-26 Nathan Sidwell <nathan@acm.org>
3552 * cp-tree.h (DECL_MODULE_CHECK): Ban TEMPLATE_DECL.
3553 (SET_TYPE_TEMPLATE_INFO): Restore Alias template setting.
3554 * decl.c (duplicate_decls): Remove template_decl module flag
3556 * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
3557 (dumper::impl::nested_name): Adjust for template-decl module flag
3559 (trees_in::assert_definition): Likewise.
3560 (trees_in::install_entity): Likewise.
3561 (trees_out::decl_value): Likewise. Remove alias template
3562 separation of template and type_decl.
3563 (trees_in::decl_value): Likewise.
3564 (trees_out::key_mergeable): Likewise,
3565 (trees_in::key_mergeable): Likewise.
3566 (trees_out::decl_node): Adjust for template-decl module flag
3568 (depset::hash::make_dependency): Likewise.
3569 (get_originating_module, module_may_redeclare): Likewise.
3570 (set_instantiating_module, set_defining_module): Likewise.
3571 * name-lookup.c (name_lookup::search_adl): Likewise.
3572 (do_pushdecl): Likewise.
3573 * pt.c (build_template_decl): Likewise.
3574 (lookup_template_class_1): Remove special alias_template handling
3575 of DECL_TI_TEMPLATE.
3576 (tsubst_template_decl): Likewise.
3578 2021-03-26 Jakub Jelinek <jakub@redhat.com>
3581 * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
3582 in DECL_EXPR or in BIND_EXPR_VARS.
3584 2021-03-25 Jakub Jelinek <jakub@redhat.com>
3587 * parser.c (cp_parser_postfix_expression): For calls, create
3588 combined_loc and temporarily set input_location to it before
3589 calling finish_call_expr.
3591 2021-03-25 Marek Polacek <polacek@redhat.com>
3594 * call.c (build_over_call): Maybe call mark_used in case
3595 deduce_inheriting_ctor fails and return error_mark_node.
3596 * cp-tree.h (deduce_inheriting_ctor): Adjust declaration.
3597 * method.c (deduce_inheriting_ctor): Return bool if the deduction
3599 (implicitly_declare_fn): If raises is error_mark_node, call
3600 synthesized_method_walk with diag being true.
3602 2021-03-25 Jakub Jelinek <jakub@redhat.com>
3605 * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
3606 packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
3608 2021-03-25 Marek Polacek <polacek@redhat.com>
3611 * call.c (build_converted_constant_expr_internal): Don't emit
3612 -Wconversion warnings.
3614 2021-03-25 Jakub Jelinek <jakub@redhat.com>
3617 * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
3619 * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
3622 2021-03-23 Nathan Sidwell <nathan@acm.org>
3625 * name-lookup.c (check_module_override): Set global or partition
3626 DUP on the binding vector.
3628 2021-03-23 Marek Polacek <polacek@redhat.com>
3631 * decl2.c (cp_warn_deprecated_use_scopes): Only call
3632 cp_warn_deprecated_use when decl is a namespace, class, or enum.
3634 2021-03-23 Nathan Sidwell <nathan@acm.org>
3637 * decl.c (duplicate_decls): Remove assert about maybe-imported
3640 2021-03-23 Jakub Jelinek <jakub@redhat.com>
3643 * decl.c (cp_finish_decomp): Diagnose void initializers when
3644 using tuple_element and get.
3646 2021-03-22 Nathan Sidwell <nathan@acm.org>
3649 * module.cc (depset::hash::make_dependency): Propagate flags for
3650 partial specialization.
3651 (module_may_redeclare): Handle partial specialization.
3653 2021-03-22 Nathan Sidwell <nathan@acm.org>
3656 * cp-tree.h (map_context_from, map_context_to): Delete.
3657 (add_mergeable_specialization): Add is_alias parm.
3658 * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
3659 * module.cc (map_context_from, map_context_to): Delete.
3660 (trees_in::decl_value): Add specializations later, adjust call.
3661 Drop useless alias lookup. Set duplicate fn parm context.
3662 (check_mergeable_decl): Drop context mapping.
3663 (trees_in::is_matching_decl): Likewise.
3664 (trees_in::read_function_def): Drop parameter context adjustment
3667 2021-03-22 Martin Liska <mliska@suse.cz>
3670 * module.cc (fini_modules): Call vec_free instead of delete.
3672 2021-03-20 Jakub Jelinek <jakub@redhat.com>
3675 * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
3676 special code, instead call c_genericize_control_stmt.
3678 2021-03-19 Jakub Jelinek <jakub@redhat.com>
3681 * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
3682 INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
3683 don't diagnose it, set *non_constant_p nor return t.
3685 2021-03-19 Marek Polacek <polacek@redhat.com>
3688 * parser.c (cp_parser_requirement_parameter_list): Handle
3691 2021-03-18 Marek Polacek <polacek@redhat.com>
3693 * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
3695 2021-03-18 Marek Polacek <polacek@redhat.com>
3697 * pt.c (tsubst_copy_and_build): Add assert.
3699 2021-03-18 Iain Sandoe <iain@sandoe.co.uk>
3702 * parser.c (cp_debug_parser): Add Objective-C++ message
3704 (cp_parser_nested_name_specifier_opt): Allow colon to
3705 terminate an assignment-expression when parsing Objective-
3707 (cp_parser_objc_message_expression): Set and clear message
3708 parsing state on entry and exit.
3709 * parser.h (struct cp_parser): Add a context flag for
3710 Objective-C++ message state.
3712 2021-03-18 Martin Liska <mliska@suse.cz>
3715 * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
3718 2021-03-17 Marek Polacek <polacek@redhat.com>
3721 * call.c (conv_unsafe_in_template_p): New.
3722 (convert_like): Use it.
3724 2021-03-17 Anthony Sharp <anthonysharp15@gmail.com>
3725 Jason Merrill <jason@redhat.com>
3727 * semantics.c (get_class_access_diagnostic_decl): New
3728 function that examines special cases when a parent
3729 class causes a private access failure.
3730 (enforce_access): Slightly modified to call function
3733 2021-03-16 Jason Merrill <jason@redhat.com>
3735 * tree.c (cp_tree_equal): Use real_identical.
3737 2021-03-16 Jakub Jelinek <jakub@redhat.com>
3740 * decl.c (expand_static_init): For thread guards, call __cxa_atexit
3741 before calling __cxa_guard_release rather than after it. Formatting
3744 2021-03-16 Martin Liska <mliska@suse.cz>
3745 Jason Merrill <jason@redhat.com>
3748 * call.c (get_function_version_dispatcher): Handle
3750 * decl.c (maybe_version_functions): Likewise.
3751 (maybe_mark_function_versioned): New.
3752 * name-lookup.c (push_local_extern_decl_alias): No longer static.
3753 * name-lookup.h (push_local_extern_decl_alias): Adjust.
3755 2021-03-16 Nathan Sidwell <nathan@acm.org>
3758 * module.cc (trees_out::decl_value): Adjust typedef streaming,
3759 indicate whether it is a dependent alias.
3760 (trees_in::decl_value): Likewise. Set as dependent alias, if it
3763 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
3766 * coroutines.cc (expand_one_await_expression): If the
3767 await_ready() expression is not a boolean then convert it
3770 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
3773 * coroutines.cc (build_actor_fn): Make destroy index 1
3774 correspond to the abnormal unhandled_exception() exit.
3775 Substitute the proxy for the resume index.
3776 (coro_rewrite_function_body): Arrange to reset the resume
3777 index and make done = true for a rethrown exception from
3778 unhandled_exception ().
3779 (morph_fn_to_coro): Adjust calls to build_actor_fn and
3780 coro_rewrite_function_body.
3782 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
3785 * coroutines.cc (replace_continue): Rewrite continue into
3787 (await_statement_walker): Handle await expressions in the
3788 initializer, condition and iteration expressions of for
3791 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
3794 * coroutines.cc (flatten_await_stmt): Allow for the case
3795 where a target expression variable only has uses in the
3796 second part of a compound expression.
3797 (maybe_promote_temps): Avoid emiting empty statements.
3799 2021-03-15 Tobias Burnus <tobias@codesourcery.com>
3802 * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
3803 ensure that the varpool node is marked as offloadable.
3805 2021-03-12 Nathan Sidwell <nathan@acm.org>
3808 * module.cc (depset::hash::add_binding_entity): Assert not
3810 (depset::add::add_specializations): Likewise.
3811 * name-lookup.c (name_lookup::dedup): New.
3812 (name_lookup::~name_lookup): Assert not deduping.
3813 (name_lookup::restore_state): Likewise.
3814 (name_lookup::add_overload): Replace outlined code with dedup
3816 (name_lookup::add_value): Likewise.
3817 (name_lookup::search_namespace_only): Likewise.
3818 (name_lookup::adl_namespace_fns): Likewise.
3819 (name_lookup::adl_class_fns): Likewise.
3820 (name_lookup::search_adl): Likewise. Add clearing dedup call.
3821 (name_lookup::search_qualified): Likewise.
3822 (name_lookup::search_unqualified): Likewise.
3824 2021-03-12 Jakub Jelinek <jakub@redhat.com>
3827 * call.c (build_over_call): For immediate evaluation of functions
3828 that return references, undo convert_from_reference effects before
3829 calling cxx_constant_value and call convert_from_reference
3832 2021-03-11 Nathan Sidwell <nathan@acm.org>
3835 * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
3836 when there's a binding vector.
3837 * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
3839 2021-03-11 Nathan Sidwell <nathan@acm.org>
3842 * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
3844 (trees_in::decl_value): Adjust add_mergeable_specialization call.
3845 (trees_out::get_merge_kind): Adjust detecting a partial template
3847 (trees_out::key_mergeable): Adjust handling same.
3848 (trees_in::key_mergeabvle): Likewise.
3850 2021-03-10 Nathan Sidwell <nathan@acm.org>
3853 * module.cc (post_load_processing): Assert not gcable.
3854 (laxy_load_pendings): Extend no-gc region around
3855 post_load_processing.
3857 2021-03-10 Nathan Sidwell <nathan@acm.org>
3860 * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
3861 assembler name to the ns alias.
3863 2021-03-09 Jakub Jelinek <jakub@redhat.com>
3866 * coroutines.cc (build_co_await): Look through NOP_EXPRs in
3867 build_special_member_call return value to find the CALL_EXPR.
3870 2021-03-09 Nathan Sidwell <nathan@acm.org>
3873 * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
3874 that C++20 does not yet imply modules.
3876 2021-03-08 Nathan Sidwell <nathan@acm.org>
3879 * name-lookup.c (get_cxx_dialect_name): Add cxx23.
3881 2021-03-08 Nathan Sidwell <nathan@acm.org>
3883 * lex.c (module_token_filter::resume): Ignore module-decls inside
3885 * parser.c (cp_parser_module_declaration): Reject in header-unit.
3887 2021-03-08 Nathan Sidwell <nathan@acm.org>
3890 * cp-tree.h (match_mergeable_specialization)
3891 (add_mergeable_specialization): Adjust parms.
3892 * module.cc (trees_in::decl_value): Adjust
3893 add_mergeable_specialization calls.
3894 (trees_out::key_mergeable): Adjust match_mergeable_specialization
3896 (specialization_add): Likewise.
3897 * pt.c (match_mergeable_specialization): Do not insert.
3898 (add_mergeable_specialization): Add to hash table here.
3900 2021-03-06 Patrick Palka <ppalka@redhat.com>
3901 Jakub Jelinek <jakub@redhat.com>
3904 * constexpr.c (cxx_eval_increment_expression): Pass lval when
3905 evaluating the MODIFY_EXPR, and update 'mod' with the result of
3906 this evaluation. Check *non_constant_p afterwards. For prefix
3907 ops, just return 'mod'.
3909 2021-03-06 Patrick Palka <ppalka@redhat.com>
3910 Jakub Jelinek <jakub@redhat.com>
3913 * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
3914 variable 'fn' to 'tmpl'. Handle a variable template-id by
3915 calling lookup_template_variable.
3917 2021-03-06 Patrick Palka <ppalka@redhat.com>
3920 * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
3921 outer_targs to do_auto_deduction.
3922 (placeholder_type_constraint_dependent_p): Define.
3923 (do_auto_deduction): When processing_template_decl != 0
3924 and context is adc_unify and we have constraints, pretend the
3925 constraints are satisfied instead of punting. Otherwise don't
3926 punt unless placeholder_type_constraint_dependent_p holds.
3927 Add some clarifying sanity checks. Add a hack to add missing
3928 outermost template levels to outer_args before checking
3929 satisfaction. Don't substitute outer_targs into type if it's
3932 2021-03-05 Marek Polacek <polacek@redhat.com>
3935 * call.c (standard_conversion): When converting pointers to
3936 member, don't return NULL when the bases are equivalent but
3939 2021-03-05 Marek Polacek <polacek@redhat.com>
3942 * name-lookup.c (check_local_shadow): Check if the type of decl
3943 is non-null before checking TYPE_PTR*.
3945 2021-03-05 Nathan Sidwell <nathan@acm.org>
3948 * module.cc (module_state::write_cluster): Relax binding assert.
3950 2021-03-05 Nathan Sidwell <nathan@acm.org>
3953 * pt.c (instantiate_decl): Call set_instantiating_module.
3955 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3958 * coroutines.cc (build_co_await): Use type_build_ctor_call()
3959 to determine cases when a CTOR needs to be built.
3960 (flatten_await_stmt): Likewise.
3961 (morph_fn_to_coro): Likewise.
3963 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3966 * coroutines.cc (coro_diagnose_throwing_fn): New helper.
3967 (coro_diagnose_throwing_final_aw_expr): New helper.
3968 (build_co_await): Diagnose throwing final await expression
3970 (build_init_or_final_await): Diagnose a throwing promise
3971 final_suspend() call.
3973 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3976 * coroutines.cc (struct param_info): Track parameter copies that need
3978 (coro_get_frame_dtor): New helper function factored from build_actor().
3979 (build_actor_fn): Use coro_get_frame_dtor().
3980 (morph_fn_to_coro): Track parameters that need DTORs on exception,
3981 likewise the frame promise and the return object. On exception, run the
3982 DTORs for these, destroy the frame and then rethrow the exception.
3984 2021-03-05 Nathan Sidwell <nathan@acm.org>
3987 * pt.c (instantiate_class_template_1): Set instantiating module
3990 2021-03-05 Tobias Burnus <tobias@codesourcery.com>
3993 * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
3995 2021-03-04 Jakub Jelinek <jakub@redhat.com>
3999 * cvt.c (convert_to_void): Revert 2019-10-17 changes. Clarify
4002 2021-03-04 Nathan Sidwell <nathan@acm.org>
4005 * module.cc (class uintset): Delete.
4006 (typedef attached_map_t): A hash map.
4007 (attached_table): Use attached_map_t. Adjust uses ...
4008 (trees_out::decl_value, trees_in::decl_value): ... here ...
4009 (trees_out::key_mergeable): ... here ...
4010 (trees_in::key_mergeable): ... here ...
4011 (maybe_attach_decl): ... here ...
4012 (direct_import): ... and here.
4014 2021-03-04 Nathan Sidwell <nathan@acm.org>
4018 * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
4020 * module.cc (class pending_key): New.
4021 (default_hash_traits<pending_key>): New specialization.
4022 (pending_map_t): New typedef.
4023 (pending_table): Replace old table.
4024 (trees_out::lang_decl_bools): Adjust.
4025 (trees_in::lang_decl_bools): Adjust.
4026 (trees_in::install_entity): Drop pending member and specialization
4028 (find_pending_key): New.
4029 (depset::hash::fiund_dependencies): Use it.
4030 (pendset_lazy_load): Delete.
4031 (module_state::write_cluster): Don't count pendings here. Bye
4032 Duff's device-like thing.
4033 (module_state::write_pendings): Reimplement.
4034 (module_state::read_pendings): Reimplement.
4035 (lazy_specializations_p): Delete.
4036 (module_state::write): Adjust write_pendings call.
4037 (lazy_load_pendings): New.
4038 (lazy_load_specializations): Delete.
4039 (lazy_load_members): Delete.
4040 (init_modules): Adjust.
4041 * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
4042 not lazy_load_members.
4043 (note_pending_specializations): Delete.
4044 (load_pending_specializations): Delete.
4045 * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
4046 (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
4047 (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
4048 (note_pending_specializations): Delete.
4049 (load_pending_specializations): Delete.
4050 * pt.c (lookup_template_class_1): Call lazy_load_pendings not
4051 lazy_load_specializations.
4052 (instantiate_template_class_1): Likewise.
4053 (instantiate_decl): Call lazy_load_pendings.
4054 * typeck.c (complete_type): Likewise.
4056 2021-03-03 Nathan Sidwell <nathan@acm.org>
4059 * module.cc (post_load_decls): New.
4060 (lazy_snum, recursive_lazy): Move earlier.
4061 (module_state::read_cluster): Push cloning onto post_load_decls.
4062 (post_load_processing): New. Do the cloning here.
4063 (module_state::read_inits): Call post_load_processing.
4064 (module_state::read_language): Likewise.
4065 (lazy_load_binding, lazy_load_specializations): Likewise
4066 (lazy_load_members): Likewise
4068 2021-03-03 Nathan Sidwell <nathan@acm.org>
4071 * module.cc (trees_out::decl_value): Stream specialization keys
4073 (trees_in::decl_value): Stream them back and insert after
4074 completing the decl.
4075 (trees_out::key_mergeable): Drop some streaming here ...
4076 (trees_in::key_mergeable): ... and here. Don't insert into
4077 specialization tables.
4079 2021-03-03 Patrick Palka <ppalka@redhat.com>
4081 * constraint.cc (struct sat_info): Document the different
4082 meanings of noisy() and diagnose_unsatisfaction_p() during
4083 satisfaction and requires-expression evaluation.
4084 (tsubst_valid_expression_requirement): Take a sat_info instead
4085 of a subst_info. Perform the substitution quietly first. Fold
4086 in error-replaying code from diagnose_valid_expression.
4087 (tsubst_simple_requirement): Take a sat_info instead of a
4089 (tsubst_type_requirement_1): New. Fold in error-replaying code
4090 from diagnose_valid_type.
4091 (tsubst_type_requirement): Use the above. Take a sat_info
4092 instead of a subst_info.
4093 (tsubst_compound_requirement): Likewise. Fold in
4094 error-replaying code from diagnose_compound_requirement.
4095 (tsubst_nested_requirement): Take a sat_info instead of a
4096 subst_info. Fold in error-replaying code from
4097 diagnose_nested_requirement.
4098 (tsubst_requirement): Take a sat_info instead of a subst_info.
4099 (tsubst_requires_expr): Split into two versions, one that takes
4100 a sat_info argument and another that takes a complain and
4101 in_decl argument. Remove outdated documentation. Document the
4102 effects of the sat_info argument. Don't short-circuit
4103 processing of requirements when diagnosing unsatisfaction,
4104 mirroring diagnose_requires_expr.
4105 (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
4106 assert, and se the three-parameter version of tsubst_requires_expr.
4107 (diagnose_trait_expr): Make static. Take a template argument
4108 vector instead of a parameter mapping.
4109 (diagnose_valid_expression): Remove.
4110 (diagnose_valid_type): Remove.
4111 (diagnose_simple_requirement): Remove.
4112 (diagnose_compound_requirement): Remove.
4113 (diagnose_type_requirement): Remove.
4114 (diagnose_nested_requirement): Remove.
4115 (diagnose_requirement): Remove.
4116 (diagnose_requires_expr): Remove.
4117 (diagnose_atomic_constraint): Take a sat_info instead of a
4118 subst_info. Adjust call to diagnose_trait_expr. Call
4119 tsubst_requires_expr instead of diagnose_requires_expr.
4120 (diagnose_constraints): Remove special casing of REQUIRES_EXPR
4121 and just always call constraint_satisfaction_value.
4123 2021-03-03 Patrick Palka <ppalka@redhat.com>
4125 * constexpr.c (cxx_eval_call_expression): Adjust call to
4126 evaluate_concept_check.
4127 (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
4128 evaluate_requires_expression instead of
4129 satisfy_constraint_expression.
4130 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
4131 * constraint.cc (struct sat_info): Adjust comment about which
4132 satisfaction entrypoints use noisy-unsat.
4133 (normalize_template_requirements): Remove (and adjust callers
4135 (normalize_nontemplate_requirements): Likewise.
4136 (tsubst_nested_requirement): Use constraint_satisfaction_value
4137 instead of satisfy_constraint_expression, which'll do the
4138 noisy replaying of ill-formed quiet satisfaction for us.
4139 (decl_satisfied_cache): Adjust comment.
4140 (satisfy_constraint): Rename to ...
4141 (satisfy_normalized_constraints): ... this.
4142 (satisfy_associated_constraints): Remove (and make its
4143 callers check for dependent arguments).
4144 (satisfy_constraint_expression): Rename to ...
4145 (satisfy_nondeclaration_constraints): ... this. Assert that
4146 'args' is empty when 't' is a concept-id. Removing handling
4147 bare constraint-expressions, and handle REQUIRES_EXPRs
4148 specially. Adjust comment accordingly.
4149 (satisfy_declaration_constraints): Assert in the two-parameter
4150 version that 't' is not a TEMPLATE_DECL. Adjust following
4151 removal of normalize_(non)?template_requirements and
4152 satisfy_asociated_constraints.
4153 (constraint_satisfaction_value): Combine the two- and
4154 three-parameter versions in the natural way.
4155 (constraints_satisfied_p): Combine the one- and two-parameter
4156 versions in the natural way. Improve documentation.
4157 (evaluate_requires_expr): Define.
4158 (evaluate_concept_check): Remove 'complain' parameter. Use
4159 constraint_satisfaction_value instead of
4160 satisfy_constraint_expression.
4161 (diagnose_nested_requirement): Adjust following renaming of
4162 satisfy_constraint_expression.
4163 (diagnose_constraints): Handle REQUIRES_EXPR by going through
4164 diagnose_requires_expr directly instead of treating it as a
4165 constraint-expression. Improve documentation.
4166 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
4167 to evaluate_concept_check.
4168 <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
4169 constraints_satisfied_p.
4170 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
4171 * cp-tree.h (evaluate_requires_expr): Declare.
4172 (evaluate_concept_check): Remove tsubst_flag_t parameter.
4173 (satisfy_constraint_expression): Remove declaration.
4174 (constraints_satisfied_p): Remove one-parameter declaration.
4175 Add a default argument to the two-parameter declaration.
4176 * cvt.c (convert_to_void): Adjust call to
4177 evaluate_concept_check.
4179 2021-03-03 Jakub Jelinek <jakub@redhat.com>
4182 * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
4185 2021-03-03 Marek Polacek <polacek@redhat.com>
4189 * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
4190 (maybe_aggr_guide): Use the original template type where needed. In
4191 a class member template, partially instantiate the result of
4192 collect_ctor_idx_types.
4193 (do_class_deduction): Defer the deduction until the enclosing
4194 scope is non-dependent.
4196 2021-03-03 Jason Merrill <jason@redhat.com>
4199 * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
4200 if it didn't get one before.
4202 2021-03-03 Nathan Sidwell <nathan@acm.org>
4205 * module.cc (trees_out::decl_node): Small refactor.
4206 (depset::hash::add_binding_entity): Return true on meeting an
4207 import. Set namespace's import here.
4208 (module_state:write_namespaces): Inform of purview too.
4209 (module_state:read_namespaces): Adjust.
4210 * name-lookup.c (implicitly_export_namespace): Delete.
4211 (do_pushdecl): Don't call it.
4212 (push_namespace): Likewise, set purview.
4213 (add_imported_namespace): Reorder parms.
4214 * name-lookup.h (add_imported_namespace): Alter param ordering.
4216 2021-03-02 Martin Sebor <msebor@redhat.com>
4219 * class.c (build_base_path): Call build_if_nonnull.
4220 * cp-tree.h (build_if_nonnull): Declare.
4221 * rtti.c (ifnonnull): Rename...
4222 (build_if_nonnull): ...to this. Set no-warning bit on COND_EXPR.
4223 (build_dynamic_cast_1): Adjust to name change.
4225 2021-03-02 Patrick Palka <ppalka@redhat.com>
4229 * constraint.cc (type_deducible_p): Don't substitute into the
4230 constraints, and instead just pass 'args' to do_auto_deduction
4231 as the outer template arguments.
4232 (tsubst_parameter_mapping): Remove confused code for handling
4233 placeholder type arguments.
4234 (normalize_placeholder_type_constraint): Define.
4235 (satisfy_constraint_expression): Use it to handle placeholder
4237 * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
4238 (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
4239 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
4240 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
4241 (make_constrained_placeholder_type): Set
4242 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
4243 (do_auto_deduction): Clarify comments about the outer_targs
4244 parameter. Rework satisfaction of a placeholder type constraint
4245 to pass in the complete set of template arguments directly to
4246 constraints_satisfied_p.
4247 (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
4248 instead. Also rebuild the the constraint info on the new auto.
4250 2021-03-02 Patrick Palka <ppalka@redhat.com>
4252 * constraint.cc (build_parameter_mapping): Rely on the caller to
4253 determine the in-scope template parameters.
4254 (norm_info::norm_info): Delegate the tsubst_flags_t constructor
4255 to the two-parameter constructor. In the two-parameter
4256 constructor, fold in the definition of make_context, set
4257 initial_parms appropriately, and don't set the now-removed
4259 (norm_info::make_context): Remove, now that its only use is
4260 inlined into the caller.
4261 (norm_info::update_context): Adjust call to
4262 build_parameter_mapping to pass in the relevant set of in-scope
4263 template parameters.
4264 (norm_info::ctx_parms): Define this member function.
4265 (norm_info::context): Initialize to NULL_TREE.
4266 (norm_info::orig_decl): Remove this data member.
4267 (norm_info::initial_parms): Define this data member.
4268 (normalize_atom): Adjust call to build_parameter_mapping to pass
4269 in the relevant set of in-scope template parameters. Use
4270 info.initial_parms instead of info.orig_decl.
4271 (normalize_constraint_expression): Take a norm_info object
4272 instead of a bool. Cache the result of normalization.
4273 (tsubst_nested_requirement): Call satisfy_constraint_expression
4274 instead of satisfy_constraint, so that we normalize on demand.
4275 (satisfy_constraint_expression): Handle a NESTED_REQ argument.
4276 Adjust call to normalize_constraint_expression.
4277 (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
4278 to current_template_parms.
4279 (diagnose_nested_requirements): Go through
4280 satisfy_constraint_expression, as with tsubst_nested_requirement.
4282 2021-03-02 Patrick Palka <ppalka@redhat.com>
4284 * constraint.cc (tsubst_parameter_mapping): Canonicalize the
4285 arguments of a substituted TYPE_ARGUMENT_PACK even if we've
4286 started with a TYPE_ARGUMENT_PACK.
4287 (finish_requires_expr): Don't set DECL_CONTEXT and
4288 CONSTRAINT_VAR_P on each of the introduced parameters here.
4289 * parser.c (cp_parser_requirement_parameter_list): Instead set
4290 these fields earlier, here.
4291 * pt.c (do_auto_deduction): Canonicalize the result of
4292 do_auto_deduction. Pass 'complain' to finish_decltype_type.
4294 2021-03-02 Patrick Palka <ppalka@redhat.com>
4296 * constraint.cc (tsubst_simple_requirement): Just return
4297 boolean_true_node on success.
4298 (tsubst_type_requirement): Likewise.
4299 (tsubst_compound_requirement): Likewise.
4300 (tsubst_nested_requirement): Likewise.
4301 (tsubst_requirement_body): Remove.
4302 (check_constaint_variables): Rename to ...
4303 (check_constraint_variables): ... this.
4304 (tsubst_constraint_variables): Adjust.
4305 (tsubst_requires_expr): Fold tsubst_requirement_body into here.
4307 2021-03-01 Nathan Sidwell <nathan@acm.org>
4310 * class.c (fixup_type_variants): Propagate mode, precision,
4311 alignment & emptiness.
4312 * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
4313 (trees_in::tree_node): Rematerialize alignment here.
4315 2021-02-27 Jason Merrill <jason@redhat.com>
4318 * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
4321 2021-02-26 Jakub Jelinek <jakub@redhat.com>
4323 * parser.c (cp_parser_lambda_declarator_opt): Implement
4324 P1102R2 - Down with ()! Make ()s optional before lambda specifiers
4325 for -std={c,gnu}++2b or with pedwarn in earlier versions.
4327 2021-02-26 Jakub Jelinek <jakub@redhat.com>
4330 * lambda.c (is_lambda_ignored_entity): Before checking for
4331 LAMBDA_FUNCTION_P, use OVL_FIRST. Drop FUNCTION_DECL check.
4333 2021-02-26 Jason Merrill <jason@redhat.com>
4336 * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
4337 to a class non-type template argument that needs it.
4339 2021-02-26 Patrick Palka <ppalka@redhat.com>
4342 * pt.c (splice_late_return_type): Rebuild the entire return type
4343 if we have to adjust the level of an auto within.
4344 (type_uses_auto): Adjust call to find_type_usage.
4345 * type-utils.h (find_type_usage): Revert r10-6571 change that
4346 made this function return a pointer to the auto node.
4348 2021-02-25 Patrick Palka <ppalka@redhat.com>
4352 * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
4353 TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
4355 2021-02-25 Patrick Palka <ppalka@redhat.com>
4358 * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
4359 (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
4361 2021-02-25 Marek Polacek <polacek@redhat.com>
4365 * constexpr.c (is_std_construct_at): New overload.
4366 (is_std_allocator_allocate): New overload.
4367 (cxx_eval_call_expression): Use the new overloads.
4368 (cxx_eval_constant_expression): Reject casting
4369 from void * as per DR 1312. Don't check can_convert.
4371 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
4374 * coroutines.cc (struct param_info): Track rvalue refs.
4375 (morph_fn_to_coro): Track rvalue refs, and call the promise
4376 CTOR with the frame copy of passed parms.
4378 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
4381 * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
4382 set throwing_cleanup marker.
4384 2021-02-25 Nathan Sidwell <nathan@acm.org>
4387 * module.cc (module_state::inform_cmi_p): Renamed field.
4388 (module_state::do_import): Adjust.
4389 (init_modules, finish_module_processing): Likewise.
4390 (handle_module_option): Likewise.
4392 2021-02-25 Nathan Sidwell <nathan@acm.org>
4395 * mapper-client.cc (module_client::open_module_client): Fix typo
4398 2021-02-24 Nathan Sidwell <nathan@acm.org>
4401 * module.cc (ool): New indirection vector.
4402 (loc_spans::maybe_propagate): Location is not optional.
4403 (loc_spans::open): Likewise. Assert monotonically advancing.
4404 (module_for_ordinary_loc): Use ool indirection vector.
4405 (module_state::write_prepare_maps): Do not count empty macro
4406 expansions. Elide empty spans.
4407 (module_state::write_macro_maps): Skip empty expansions.
4408 (ool_cmp): New qsort comparator.
4409 (module_state::write): Create and destroy ool vector.
4410 (name_pending_imports): Fix dump push/pop.
4411 (preprocess_module): Likewise. Add more dumping.
4412 (preprocessed_module): Likewise.
4414 2021-02-24 Iain Sandoe <iain@sandoe.co.uk>
4417 * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
4418 error reporting when instantiating for a constexpr.
4420 2021-02-23 Nathan Sidwell <nathan@acm.org>
4423 * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
4426 2021-02-23 Patrick Palka <ppalka@redhat.com>
4429 * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
4430 over from tsubst_copy.
4432 2021-02-23 Patrick Palka <ppalka@redhat.com>
4434 * pt.c (instantiation_dependent_expression_p): Check
4435 processing_template_decl before calling
4436 potential_constant_expression.
4438 2021-02-22 Nathan Sidwell <nathan@acm.org>
4441 * module.cc (struct module_state): Add visited_p flag.
4442 (name_pending_imports): Use it to avoid duplicate requests.
4443 (preprocess_module): Don't read preprocessor state if we failed to
4444 load a module's config.
4446 2021-02-22 Nathan Sidwell <nathan@acm.org>
4449 * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
4451 * module.cc (set_defining_module): Add assert.
4453 2021-02-19 Nathan Sidwell <nathan@acm.org>
4456 * module.cc (pending_imports): New.
4457 (declare_module): Adjust test condition.
4458 (name_pending_imports): New.
4459 (preprocess_module): Reimplement using pending_imports.
4460 (preprocessed_module): Move name-getting to name_pending_imports.
4461 * name-lookup.c (append_imported_binding_slot): Assert module
4462 ordering is increasing.
4464 2021-02-19 Nathan Sidwell <nathan@acm.org>
4466 * module.cc (note_cmis): New.
4467 (struct module_state): Add inform_read_p bit.
4468 (module_state::do_import): Inform of CMI location, if enabled.
4469 (init_modules): Canonicalize note_cmis entries.
4470 (handle_module_option): Handle -flang-info-module-read=FOO.
4472 2021-02-19 Jason Merrill <jason@redhat.com>
4475 * call.c (perfect_conversion_p): Limit rvalueness
4476 test to reference bindings.
4478 2021-02-19 Jason Merrill <jason@redhat.com>
4481 * call.c (perfect_conversion_p): New.
4482 (perfect_candidate_p): New.
4483 (add_candidates): Ignore templates after a perfect non-template.
4485 2021-02-18 Nathan Sidwell <nathan@acm.org>
4488 * module.cc (canonicalize_header_name): Use
4489 cpp_probe_header_unit.
4490 (maybe_translate_include): Fix note_includes comparison.
4491 (init_modules): Fix note_includes string termination.
4493 2021-02-18 Jakub Jelinek <jakub@redhat.com>
4496 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
4497 cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
4498 for immediate function calls.
4500 2021-02-17 Nathan Sidwell <nathan@acm.org>
4503 * module.cc (struct macro_export): Add GTY markers.
4504 (macro_exports): Likewise, us a va_gc Vector.
4506 2021-02-17 Jakub Jelinek <jakub@redhat.com>
4509 * init.c (build_zero_init_1): For flexible array members just return
4510 NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
4513 2021-02-17 Nathan Sidwell <nathan@acm.org>
4516 * name-lookup.c (do_pushdecl): Don't peek under template_parm
4518 (set_identifier_type_value_with_scope): ... or here.
4519 (do_pushtag): Only set_identifier_type_value_with_scope at
4520 non-class template parm scope, and use parent scope.
4522 2021-02-17 Nathan Sidwell <nathan@acm.org>
4525 * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
4528 2021-02-17 Patrick Palka <ppalka@redhat.com>
4532 * tree.c (build_aggr_init_expr): Revert r10-7718 change.
4534 2021-02-12 Nathan Sidwell <nathan@acm.org>
4536 * module.cc (module_state::write_cluster): Check bindings for
4537 imported using-decls.
4539 2021-02-12 Nathan Sidwell <nathan@acm.org>
4542 * module.cc (trees_in::decl_value): Call add_module_namespace_decl
4543 for new namespace-scope entities.
4544 (module_state::read_cluster): Don't call add_module_decl here.
4545 * name-lookup.h (add_module_decl): Rename to ...
4546 (add_module_namespace_decl): ... this.
4547 * name-lookup.c (newbinding_bookkeeping): Move into ...
4548 (do_pushdecl): ... here. Its only remaining caller.
4549 (add_module_decl): Rename to ...
4550 (add_module_namespace_decl): ... here. Add checking-assert for
4551 circularity. Don't call newbinding_bookkeeping, just extern_c
4552 checking and incomplete var checking.
4554 2021-02-12 Nathan Sidwell <nathan@acm.org>
4558 * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
4559 (global_type_node): Delete.
4560 (IDENTIFIER_TYPE_VALUE): Delete.
4561 (IDENTIFIER_HAS_TYPE_VALUE): Delete.
4562 (get_type_value): Delete.
4563 * name-lookup.h (identifier_type_value): Delete.
4564 * name-lookup.c (check_module_override): Don't
4565 SET_IDENTIFIER_TYPE_VALUE here.
4566 (do_pushdecl): Nor here.
4567 (identifier_type_value_1, identifier_type_value): Delete.
4568 (set_identifier_type_value_with_scope): Only
4569 SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
4570 (pushdecl_nanmespace_level): Remove shadow stack nadgering.
4571 (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
4572 * call.c (check_dtor_name): Use lookup_name.
4573 * decl.c (cxx_init_decl_processing): Drop global_type_node.
4574 * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
4576 * init.c (get_type_value): Delete.
4577 * pt.c (instantiate_class_template_1): Don't call pushtag or
4578 SET_IDENTIFIER_TYPE_VALUE here.
4579 (tsubst): Assert never an identifier.
4580 (dependent_type_p): Drop global_type_node assert.
4581 * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
4582 to determine ctorness.
4584 2021-02-12 Jakub Jelinek <jakub@redhat.com>
4587 * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
4590 2021-02-12 Jason Merrill <jason@redhat.com>
4594 * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
4595 (register_parameter_specializations): Not here.
4597 2021-02-11 Marek Polacek <polacek@redhat.com>
4600 * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
4601 for the partial instantiation.
4603 2021-02-11 Jakub Jelinek <jakub@redhat.com>
4606 * init.c (build_zero_init_1): Handle zero initialiation of
4607 flexible array members like initialization of [0] arrays.
4608 Use integer_minus_onep instead of comparison to integer_minus_one_node
4609 and integer_zerop instead of comparison against size_zero_node.
4612 2021-02-11 Marek Polacek <polacek@redhat.com>
4615 * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
4617 2021-02-11 Patrick Palka <ppalka@redhat.com>
4620 * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
4621 lookup result by discarding it if the first element is a
4622 class-scope declaration, otherwise return it.
4623 (push_operator_bindings): Handle an ambiguous lookup result by
4624 doing push_local_binding on each element in the list.
4626 2021-02-11 Marek Polacek <polacek@redhat.com>
4628 * parser.c (cp_parser_selection_statement): Use vec_free.
4630 2021-02-10 Jakub Jelinek <jakub@redhat.com>
4634 * constexpr.c: Include cgraph.h.
4635 (cxx_eval_call_expression): Call varpool_node::finalize_decl on
4636 heap artificial vars.
4637 (cxx_eval_outermost_constant_expr): Remove varpool nodes for
4638 heap artificial vars.
4640 2021-02-10 Nathan Sidwell <nathan@acm.org>
4643 * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
4644 answer if there's no local specialization.
4646 2021-02-09 Nathan Sidwell <nathan@acm.org>
4649 * module.cc (module_state::is_rooted): Rename to ...
4650 (module_state::has_location): ... here. Adjust callers.
4651 (module_state::read_partitions): Adjust validity check.
4652 Don't overwrite a known location.
4654 2021-02-09 Jason Merrill <jason@redhat.com>
4657 * pt.c (mark_decl_instantiated): Exit early if consteval.
4659 2021-02-09 Jason Merrill <jason@redhat.com>
4663 * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
4666 2021-02-09 Jason Merrill <jason@redhat.com>
4670 * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
4673 2021-02-08 Nathan Sidwell <nathan@acm.org>
4675 * decl.c (start_cleanup_fn): Push function into
4678 2021-02-08 Nathan Sidwell <nathan@acm.org>
4681 * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
4682 * decl.c (push_abi_namespace, pop_abi_namespace): Moved
4683 from rtti.c, add default namespace arg.
4684 (check_redeclaration_exception_specification): Allow a lazy
4685 builtin's eh spec to differ from an lready-declared user
4687 (declare_global_var): Use push/pop_abi_namespace.
4688 (get_atexit_node): Push the fndecl into a namespace.
4689 * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
4692 2021-02-08 Marek Polacek <polacek@redhat.com>
4694 * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
4696 2021-02-05 Marek Polacek <polacek@redhat.com>
4699 * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
4701 * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
4702 issuing the -Wvolatile warning. Only set TREE_THIS_VOLATILE if
4703 a warning was emitted.
4705 2021-02-05 Marek Polacek <polacek@redhat.com>
4708 * name-lookup.c (lookup_using_decl): Hoist the destructor check.
4710 2021-02-05 Jakub Jelinek <jakub@redhat.com>
4713 * decl.c (check_array_initializer): For structured bindings, require
4714 the array type to be complete.
4716 2021-02-04 Jason Merrill <jason@redhat.com>
4719 * constraint.cc (build_concept_check_arguments): Remove assert.
4720 (build_concept_check): Allow empty args.
4722 2021-02-04 Tom Greenslade (thomgree) <thomgree@cisco.com>
4725 * call.c (can_convert_array): Extend to handle all valid aggregate
4726 initializers of an array; including by string literals, not just by
4728 (build_aggr_conv): Call can_convert_array more often, not just in
4729 brace-init-list case.
4730 * typeck2.c (array_string_literal_compatible_p): New function.
4731 (digest_init_r): call array_string_literal_compatible_p
4732 * cp-tree.h: (array_string_literal_compatible_p): Declare.
4734 2021-02-04 Jason Merrill <jason@redhat.com>
4737 * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
4739 2021-02-04 Jason Merrill <jason@redhat.com>
4742 * pt.c (tsubst_attribute): Handle error.
4743 (apply_late_template_attributes): Return false on error.
4744 (tsubst_function_decl): Check its return value.
4745 (tsubst_decl): Likewise.
4746 (push_template_decl): Assert current_template_parms.
4747 (tsubst_template_decl): Set current_template_parms.
4749 2021-02-03 Marek Polacek <polacek@redhat.com>
4752 * call.c (struct z_candidate): Mark rewritten and reversed as const.
4753 (struct NonPublicField): Mark operator() as const.
4754 (struct NonTrivialField): Likewise.
4756 2021-02-03 Jason Merrill <jason@redhat.com>
4760 * pt.c (spec_hasher::equal): Set processing_template_decl.
4761 * Make-lang.in (check-g++-strict-gc): Add --param
4762 hash-table-verification-limit=10000.
4764 2021-02-03 Marek Polacek <polacek@redhat.com>
4767 * parser.c (cp_parser_class_specifier_1): Use any possible
4768 DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
4769 (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
4770 * pt.c (tsubst_exception_specification): Stash new_specs into
4771 DEFPARSE_INSTANTIATIONS.
4772 * tree.c (fixup_deferred_exception_variants): Use
4773 UNPARSED_NOEXCEPT_SPEC_P.
4775 2021-02-02 Jason Merrill <jason@redhat.com>
4779 * error.c (dump_expr): Ignore dummy object.
4780 * pt.c (tsubst_baselink): Handle dependent scope.
4782 2021-02-01 Patrick Palka <ppalka@redhat.com>
4785 * constexpr.c (cxx_eval_array_reference): Also set
4786 new_ctx.object when setting new_ctx.ctor.
4788 2021-02-01 Marek Polacek <polacek@redhat.com>
4791 * parser.c (cp_parser_has_attribute_expression): Use
4792 uses_template_parms instead of type_dependent_expression_p.
4794 2021-02-01 Jason Merrill <jason@redhat.com>
4797 * cp-tree.h: Declare it.
4798 * pt.c (comparing_dependent_aliases): New flag.
4799 (template_args_equal, spec_hasher::equal): Set it.
4800 (dependent_alias_template_spec_p): Assert that we don't
4801 get non-types other than error_mark_node.
4802 (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
4803 on complex alias specializations. Set TYPE_DEPENDENT_P here.
4804 (tsubst_decl): Not here.
4805 * module.cc (module_state::read_cluster): Set
4806 comparing_dependent_aliases instead of
4807 comparing_specializations.
4808 * tree.c (cp_tree_equal): Remove comparing_specializations
4810 * typeck.c (structural_comptypes): Adjust.
4811 (comptypes): Remove comparing_specializations handling.
4813 2021-01-29 Nathan Sidwell <nathan@acm.org>
4816 * module.cc (module_state_config): Add num_entities field.
4817 (module_state::read_entities): The entity_ary span is
4819 (module_state::write_config): Write num_entities.
4820 (module_state::read_config): Read num_entities.
4821 (module_state::write): Set config's num_entities.
4822 (module_state::read_initial): Allocate the entity ary
4824 (module_state::read_language): Do not set entity_lwm
4827 2021-01-29 Marek Polacek <polacek@redhat.com>
4830 * parser.c (cp_parser_class_name): If parser->scope is
4831 error_mark_node, return it, otherwise continue.
4833 2021-01-28 Jakub Jelinek <jakub@redhat.com>
4836 * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
4838 2021-01-28 Jakub Jelinek <jakub@redhat.com>
4842 * decl.c (cp_finish_decl): For register vars with asmspec in templates
4843 call set_user_assembler_name and set DECL_HARD_REGISTER.
4844 * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
4845 pass asmspec_tree to cp_finish_decl.
4847 2021-01-28 Nathan Sidwell <nathan@acm.org>
4850 * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
4852 (trees_in::decl_value): Do typedef frobbing only when installing
4853 a new typedef, adjust is_matching_decl call. Swap is_typedef
4855 (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
4856 names and deal with typedef checking.
4858 2021-01-27 Jason Merrill <jason@redhat.com>
4861 * name-lookup.c (lookup_using_decl): Clean up handling
4862 of dependency and inherited constructors.
4863 (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
4864 * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
4866 2021-01-26 Jason Merrill <jason@redhat.com>
4869 * call.c (type_passed_as): Don't mark invisiref restrict.
4871 2021-01-26 Jason Merrill <jason@redhat.com>
4875 * class.c (layout_class_type): An empty field gets size 0.
4876 (is_empty_field): New.
4877 (check_bases): Check it.
4878 * cp-tree.h (is_empty_field): Declare it.
4879 * constexpr.c (cxx_eval_store_expression): Check it.
4880 (cx_check_missing_mem_inits): Likewise.
4881 * init.c (perform_member_init): Likewise.
4882 * typeck2.c (process_init_constructor_record): Likewise.
4884 2021-01-25 Martin Sebor <msebor@redhat.com>
4887 * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
4889 2021-01-25 Jason Merrill <jason@redhat.com>
4892 * constexpr.c (get_or_insert_ctor_field): Add check.
4893 (cxx_eval_store_expression): Handle discontinuity of refs.
4895 2021-01-23 Anthony Sharp <anthonysharp15@gmail.com>
4897 * call.c (complain_about_access): Altered function.
4898 * cp-tree.h (complain_about_access): Changed parameters of function.
4899 (get_parent_with_private_access): Declared new function.
4900 * search.c (get_parent_with_private_access): Defined new function.
4901 * semantics.c (enforce_access): Modified function.
4902 * typeck.c (complain_about_unrecognized_member): Updated function
4903 arguments in complain_about_access.
4905 2021-01-23 Patrick Palka <ppalka@redhat.com>
4908 * cp-tree.h (shared_member_p): Adjust declaration.
4909 * parser.c (cp_parser_init_declarator): If the storage class
4910 specifier is sc_static, pass true for static_p to
4911 cp_parser_declarator.
4912 (cp_parser_direct_declarator): Don't do inject_this_parm when
4913 the declarator is a friend.
4914 * search.c (shared_member_p): Change return type to bool and
4915 adjust function body accordingly. Return false for a dependent
4916 USING_DECL instead of aborting.
4917 * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
4918 even when type-dependent.
4920 2021-01-22 Marek Polacek <polacek@redhat.com>
4923 * parser.c (inject_parm_decls): Remove a redundant assignment.
4924 (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
4925 before calling inject_parm_decls.
4927 2021-01-22 Jason Merrill <jason@redhat.com>
4930 * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
4932 2021-01-22 Jakub Jelinek <jakub@redhat.com>
4935 * init.c (build_zero_init_1): Revert the 2018-03-06 change to
4936 return build_zero_cst for reference types.
4937 * typeck2.c (process_init_constructor_record): Instead call
4938 build_zero_cst here during error recovery instead of build_zero_init.
4940 2021-01-22 Marek Polacek <polacek@redhat.com>
4943 * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
4944 warnings regardless of abi_version_at_least.
4945 (write_expression): When the expression is a dependent name
4946 and an operator name, write "on" before writing its name.
4948 2021-01-22 Marek Polacek <polacek@redhat.com>
4951 * pt.c (instantiate_class_template_1): Instantiate members
4952 marked with attribute used only after we're done instantiating
4955 2021-01-21 Patrick Palka <ppalka@redhat.com>
4958 * semantics.c (finish_decltype_type): Set up a cp_unevaluated
4959 sentinel at the start of the function. Remove a now-redundant
4960 manual adjustment of cp_unevaluated_operand.
4962 2021-01-21 Nathan Sidwell <nathan@acm.org>
4965 * module.cc (depset::hash::find_dependencies): Add
4967 (trees_out::core_vals): Check state before calling
4969 (sort_cluster, module_state::write): Adjust
4970 find_dependencies call.
4972 2021-01-21 Jakub Jelinek <jakub@redhat.com>
4975 * constexpr.c (check_for_return_continue_data): Add break_stmt member.
4976 (check_for_return_continue): Also look for BREAK_STMT. Handle
4977 SWITCH_STMT by ignoring break_stmt from its body.
4978 (potential_constant_expression_1) <case FOR_STMT>,
4979 <case WHILE_STMT>: If the condition isn't constant true, check if
4980 the loop body can contain a return stmt.
4981 <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
4982 <case IF_STMT>: If recursion with tf_none is successful,
4983 merge *jump_target from the branches - returns with highest priority,
4984 breaks or continues lower. If then branch is potentially constant and
4985 doesn't return, check the else branch if it could return, break or
4988 2021-01-21 Nathan Sidwell <nathan@acm.org>
4991 * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
4993 2021-01-20 Nathan Sidwell <nathan@acm.org>
4995 * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
4998 2021-01-20 Patrick Palka <ppalka@redhat.com>
5001 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
5002 CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
5003 adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
5005 2021-01-20 Patrick Palka <ppalka@redhat.com>
5008 * parser.c (cp_parser_class_head): Defer access checking when
5009 parsing the base-clause until all bases are seen and attached
5011 * pt.c (instantiate_class_template): Likewise when substituting
5012 into dependent bases.
5014 2021-01-20 Jakub Jelinek <jakub@redhat.com>
5017 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
5018 error_operand_p, remove clause without further checking. Check
5019 for non-NULL TYPE_NAME.
5021 2021-01-19 Marek Polacek <polacek@redhat.com>
5024 * pt.c (maybe_instantiate_noexcept): Return false if FN is
5027 2021-01-19 Marek Polacek <polacek@redhat.com>
5030 * name-lookup.c (push_using_decl_bindings): New, broken out of...
5031 (finish_nonmember_using_decl): ...here.
5032 * name-lookup.h (push_using_decl_bindings): Update declaration.
5033 * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
5035 2021-01-19 Patrick Palka <ppalka@redhat.com>
5039 * search.c (friend_accessible_p): If scope is a hidden friend
5040 defined inside a dependent class, consider access from the
5042 * parser.c (cp_parser_late_parsing_for_member): Don't push a
5043 dk_no_check access state.
5045 2021-01-19 Marek Polacek <polacek@redhat.com>
5048 * parser.c (cp_parser_class_specifier_1): Perform late-parsing
5049 of NSDMIs before late-parsing of noexcept-specifiers.
5051 2021-01-19 Nathan Sidwell <nathan@acm.org>
5053 * module.cc (identifier): Merge overloads.
5055 2021-01-19 Nathan Sidwell <nathan@acm.org>
5058 * module.cc (trees_out::write_location): Make static.
5060 2021-01-16 Kwok Cheung Yeung <kcy@codesourcery.com>
5062 * parser.c (cp_parser_omp_clause_detach): New.
5063 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
5064 (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
5065 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
5066 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
5067 Prevent use of detach with mergeable and overriding the data sharing
5068 mode of the event handle.
5070 2021-01-15 Nathan Sidwell <nathan@acm.org>
5073 * tree.c (cp_build_qualified_type_real): Propagate an array's
5074 dependentness to the copy, if known.
5076 2021-01-15 Jason Merrill <jason@redhat.com>
5079 * call.c (unsafe_return_slot_p): Return int.
5080 (init_by_return_slot_p): Split out from...
5081 (unsafe_copy_elision_p): ...here.
5082 (unsafe_copy_elision_p_opt): New name for old meaning.
5083 (build_over_call): Adjust.
5084 (make_safe_copy_elision): New.
5085 * typeck2.c (split_nonconstant_init_1): Elide copy from safe
5086 list-initialization.
5087 * cp-tree.h: Adjust.
5089 2021-01-15 Jason Merrill <jason@redhat.com>
5091 * call.c (base_ctor_for, make_base_init_ok): New.
5092 (build_over_call): Use make_base_init_ok.
5094 2021-01-15 Jason Merrill <jason@redhat.com>
5097 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
5098 if we got a CONSTRUCTOR.
5100 2021-01-15 Nathan Sidwell <nathan@acm.org>
5103 * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
5105 2021-01-14 Jason Merrill <jason@redhat.com>
5107 * typeck2.c (process_init_constructor_record): Use fldtype
5108 variable consistently.
5110 2021-01-14 Nathan Sidwell <nathan@acm.org>
5113 * tree.c (cp_tree_equal): Correct map_context logic.
5115 2021-01-13 Marek Polacek <polacek@redhat.com>
5118 * name-lookup.c (push_using_decl_bindings): New.
5119 * name-lookup.h (push_using_decl_bindings): Declare.
5120 * pt.c (tsubst_expr): Call push_using_decl_bindings.
5122 2021-01-13 Nathan Sidwell <nathan@acm.org>
5125 * module.cc (module_add_import_initializers): Pass a
5126 zero-element argument vector.
5128 2021-01-12 Patrick Palka <ppalka@redhat.com>
5131 * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
5132 the template of a CTAD placeholder.
5134 2021-01-12 Marek Polacek <polacek@redhat.com>
5137 * typeck2.c (process_init_constructor_record): Don't emit
5138 -Wmissing-field-initializers warnings in unevaluated contexts.
5140 2021-01-11 Jakub Jelinek <jakub@redhat.com>
5143 * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
5145 (mark_abi_tags_r): Likewise.
5146 * decl2.c (min_vis_r): Likewise.
5147 * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
5150 2021-01-08 Patrick Palka <ppalka@redhat.com>
5153 * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
5154 instead of AGGREGATE_TYPE_P before calling replace_result_decl.
5156 2021-01-08 Patrick Palka <ppalka@redhat.com>
5159 * semantics.c (check_accessibility_of_qualified_id): Punt if
5160 we're checking access of a scoped non-static member inside a
5163 2021-01-07 Jakub Jelinek <jakub@redhat.com>
5166 * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
5167 cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
5169 (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
5171 2021-01-07 Marek Polacek <polacek@redhat.com>
5174 * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
5175 !late_return_type block.
5177 2021-01-07 Jason Merrill <jason@redhat.com>
5179 * constexpr.c (cxx_bind_parameters_in_call): Add comment.
5180 (cxx_eval_store_expression): Add comment.
5182 2021-01-07 Jason Merrill <jason@redhat.com>
5184 * call.c (has_next): Factor out from...
5185 (next_conversion): ...here.
5186 (strip_standard_conversion): And here.
5187 (is_subseq): And here.
5188 (build_conv): Check it.
5189 (standard_conversion): Don't call build_conv
5192 2021-01-06 Martin Sebor <msebor@redhat.com>
5195 * error.c (dump_expr): Call c_pretty_printer::unary_expression.
5197 2021-01-05 Patrick Palka <ppalka@redhat.com>
5199 * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
5200 the type of the NTTP, substitute into the type again. If the
5201 type is still dependent, don't unify the NTTP.
5203 2021-01-05 Jakub Jelinek <jakub@redhat.com>
5205 * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
5206 $(CODYLIB) after $(BACKEND).
5208 2021-01-05 Jakub Jelinek <jakub@redhat.com>
5211 * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
5212 Punt if lval is true.
5213 * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
5214 the result if it has a class type.
5216 2021-01-05 Marek Polacek <polacek@redhat.com>
5219 * pt.c (resolve_overloaded_unification): Call
5220 maybe_instantiate_noexcept after instantiating the function
5223 2021-01-05 Nathan Sidwell <nathan@acm.org>
5225 * parser.c (cp_parser_module_declaration): Alter diagnostic
5226 text to say where is permissable.
5228 2021-01-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5231 * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
5233 2021-01-02 Jan Hubicka <jh@suse.cz>
5235 * cp-tree.h (cp_tree_c_finish_parsing): Declare.
5236 * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
5237 * tree.c (cp_tree_c_finish_parsing): New function.
5239 2021-01-01 Jakub Jelinek <jakub@redhat.com>
5241 * ChangeLog-2020: Rotate ChangeLog. New file.
5244 Copyright (C) 2021 Free Software Foundation, Inc.
5246 Copying and distribution of this file, with or without modification,
5247 are permitted in any medium without royalty provided the copyright
5248 notice and this notice are preserved.