1 2021-09-22 Patrick Palka <ppalka@redhat.com>
5 * constexpr.c (cxx_eval_constant_expression)
6 <case TEMPLATE_ID_EXPR>: Check value_dependent_expression_p
7 instead of processing_template_decl.
8 * pt.c (value_dependent_expression_p) <case TEMPLATE_ID_EXPR>:
9 Return true only if any_dependent_template_arguments_p.
10 (instantiation_dependent_r) <case CALL_EXPR>: Remove this case.
11 <case TEMPLATE_ID_EXPR>: Likewise.
13 2021-09-22 Jakub Jelinek <jakub@redhat.com>
15 * parser.c (cp_parser_omp_clause_allocate): Parse allocate clause
17 * semantics.c (finish_omp_clauses) <OMP_CLAUSE_ALLOCATE>: Perform
18 semantic analysis of OMP_CLAUSE_ALLOCATE_ALIGN.
19 * pt.c (tsubst_omp_clauses) <case OMP_CLAUSE_ALLOCATE>: Handle
20 also OMP_CLAUSE_ALLOCATE_ALIGN.
22 2021-09-22 Barrett Adair <barrettellisadair@gmail.com>
24 * pt.c (find_parm_usage_r): New walk_tree callback to find func
26 (any_template_arguments_need_structural_equality_p): New special
29 2021-09-21 wangpc <pc.wang@linux.alibaba.com>
31 * decl.c (start_decl_1): Move verify_type_context to ...
32 (cp_finish_decl): ... to here.
34 2021-09-18 Jakub Jelinek <jakub@redhat.com>
36 * parser.c (cp_parser_omp_clause_order): Parse unconstrained
37 and reproducible modifiers.
38 (OMP_DISTRIBUTE_CLAUSE_MASK): Add order clause.
40 2021-09-18 Jakub Jelinek <jakub@redhat.com>
42 * parser.c (cp_parser_omp_clause_default): Handle private and
43 firstprivate arguments, adjust diagnostics on unknown argument.
44 * cp-gimplify.c (cxx_omp_finish_clause): Handle OMP_CLAUSE_PRIVATE.
46 2021-09-18 Jason Merrill <jason@redhat.com>
48 * cp-tree.h (dependentish_scope_p): Declare.
49 * pt.c (dependentish_scope_p): New.
50 * parser.c (cp_parser_lookup_name): Return a TYPENAME_TYPE
51 for lookup of a type in a dependent object.
52 (cp_parser_template_id): Handle TYPENAME_TYPE.
53 (cp_parser_template_name): If we're looking for a type,
54 a name followed by < names a template.
56 2021-09-18 Jason Merrill <jason@redhat.com>
58 * cp-tree.h: Fix typo in LANG_FLAG list.
60 2021-09-17 Jakub Jelinek <jakub@redhat.com>
62 * cp-tree.h (finish_omp_atomic): Add r and weak arguments.
63 * parser.c (cp_parser_omp_atomic): Update function comment for
64 OpenMP 5.1 atomics, parse OpenMP 5.1 atomics and fail, compare and
66 * semantics.c (finish_omp_atomic): Add r and weak arguments, handle
67 them, handle COND_EXPRs.
68 * pt.c (tsubst_expr): Adjust for COND_EXPR forms that
69 finish_omp_atomic can now produce.
71 2021-09-16 Patrick Palka <ppalka@redhat.com>
74 * constraint.cc (get_normalized_constraints_from_decl): Always
75 look up constraints using the most general template.
76 * decl.c (grokdeclarator): Set constraints on a static data
78 * pt.c (determine_specialization): Check constraints on a
81 2021-09-16 Iain Sandoe <iain@sandoe.co.uk>
83 * coroutines.cc (await_statement_walker): Code cleanups.
85 2021-09-16 Jason Merrill <jason@redhat.com>
87 * constexpr.c (cxx_eval_outermost_constant_expr): Use
88 protected_set_expr_location.
90 2021-09-15 Patrick Palka <ppalka@redhat.com>
93 * call.c (build_user_type_conversion_1): Add tf_conv to complain.
94 (add_candidates): When in a SFINAE context, instead of adding a
95 candidate to bad_fns just mark it unviable.
97 2021-09-15 Jason Merrill <jason@redhat.com>
99 * cp-tree.h (parsing_function_declarator): Declare.
100 * name-lookup.c (set_decl_context_in_fn): Use it.
101 * parser.c (cp_parser_direct_declarator): Use it.
102 (parsing_function_declarator): New.
104 2021-09-15 Jakub Jelinek <jakub@redhat.com>
108 * typeck2.c (split_nonconstant_init_1): Don't throw away empty
109 initializers of flexible array members if they have non-zero type
112 2021-09-15 Patrick Palka <ppalka@redhat.com>
115 * decl.c (grok_special_member_properties): Set
116 TYPE_HAS_COPY_CTOR, TYPE_HAS_DEFAULT_CONSTRUCTOR
117 and TYPE_HAS_LIST_CTOR independently from each other.
119 2021-09-15 Jason Merrill <jason@redhat.com>
121 * decl.c (cxx_init_decl_processing): Only warn about odd
122 interference sizes if they were specified with --param.
124 2021-09-15 Jason Merrill <jason@redhat.com>
127 * cp-tree.h (enum cp_tree_index): Remove CPTI_TYPE_INFO_PTR_TYPE.
128 (type_info_ptr_type): Remove.
129 * rtti.c (init_rtti_processing): Don't predeclare std::type_info.
130 (typeid_ok_p): Check for null const_type_info_type_node.
131 (type_info_ptr_type, get_void_tinfo_ptr): New fns.
132 (get_tinfo_decl_dynamic, get_tinfo_ptr): Use them.
133 (ptr_initializer, ptm_initializer, get_pseudo_ti_init): Use them.
134 (get_tinfo_desc): Use const_ptr_type_node.
136 2021-09-15 Jason Merrill <jason@redhat.com>
138 * parser.c (cp_parser_template_name): Move object type.
139 (cp_parser_pre_parsed_nested_name_specifier): Likewise.
141 2021-09-15 Jason Merrill <jason@redhat.com>
143 * parser.c (cp_parser_unqualified_id): Only complain about ~A<T> in
146 2021-09-14 Iain Sandoe <iain@sandoe.co.uk>
148 * coroutines.cc (struct param_info): Add copy_var.
149 (build_actor_fn): Use simplified param references.
150 (register_param_uses): Likewise.
151 (rewrite_param_uses): Likewise.
152 (analyze_fn_parms): New function.
153 (coro_rewrite_function_body): Add proxies for the fn
154 parameters to the outer bind scope of the rewritten code.
155 (morph_fn_to_coro): Use simplified version of param ref.
157 2021-09-14 Iain Sandoe <iain@sandoe.co.uk>
159 * coroutines.cc (coro_resume_fn_id, coro_destroy_fn_id,
160 coro_promise_id, coro_frame_needs_free_id, coro_resume_index_id,
161 coro_self_handle_id, coro_actor_continue_id,
162 coro_frame_i_a_r_c_id): New.
163 (coro_init_identifiers): Initialize new name identifiers.
164 (coro_promise_type_found_p): Use pre-built identifiers.
165 (struct await_xform_data): Remove unused fields.
166 (transform_await_expr): Delete code that is now unused.
167 (build_actor_fn): Simplify interface, use pre-built identifiers and
168 remove transforms that are no longer needed.
169 (build_destroy_fn): Use revised field names.
170 (register_local_var_uses): Use pre-built identifiers.
171 (coro_rewrite_function_body): Simplify interface, use pre-built
172 identifiers. Generate proxy vars in the outer bind expr scope for the
173 implementation state that we wish to expose.
174 (morph_fn_to_coro): Adjust comments for new variable names, use pre-
175 built identifiers. Remove unused code to generate frame entries for
176 the implementation state. Adjust call for build_actor_fn.
178 2021-09-14 Patrick Palka <ppalka@redhat.com>
181 * constexpr.c (cxx_eval_call_expression): After evaluating a
182 subobject constructor call for an empty union member, produce a
183 side effect that makes sure the member gets activated.
185 2021-09-14 Jakub Jelinek <jakub@redhat.com>
188 * decl.c (layout_var_decl): For aggregates ending with a flexible
189 array member, add the size of the initializer for that member to
190 DECL_SIZE and DECL_SIZE_UNIT.
192 2021-09-14 Jakub Jelinek <jakub@redhat.com>
195 * method.c (is_xible_helper): Call complete_type on to.
197 2021-09-14 Jason Merrill <jason@redhat.com>
199 * decl.c (cxx_init_decl_processing): Don't warn if L1 cache line
200 size is smaller than maxalign.
202 2021-09-13 Jason Merrill <jason@redhat.com>
204 * constexpr.c (maybe_warn_about_constant_value):
205 Complain about std::hardware_destructive_interference_size.
206 (cxx_eval_constant_expression): Call it.
207 * decl.c (cxx_init_decl_processing): Check
208 --param *-interference-size values.
210 2021-09-13 Patrick Palka <ppalka@redhat.com>
213 * cp-tree.h (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): New accessor
215 * pt.c (has_extra_args_mechanism_p): New function.
216 (find_parameter_pack_data::found_extra_args_tree_p): New data
218 (find_parameter_packs_r): Set ppd->found_extra_args_tree_p
220 (make_pack_expansion): Set PACK_EXPANSION_FORCE_EXTRA_ARGS_P if
221 ppd.found_extra_args_tree_p.
222 (use_pack_expansion_extra_args_p): Return true if there were
223 unsubstituted packs and PACK_EXPANSION_FORCE_EXTRA_ARGS_P.
224 (tsubst_pack_expansion): Pass the pack expansion to
225 use_pack_expansion_extra_args_p.
227 2021-09-10 Jakub Jelinek <jakub@redhat.com>
229 * parser.c (cp_parser_omp_atomic): Allow acq_rel on atomic read/write
230 and acq_rel/acquire clauses on update.
231 * semantics.c (finish_omp_atomic): Adjust c_finish_omp_atomic caller.
233 2021-09-08 Richard Biener <rguenther@suse.de>
236 * cp-tree.h (ANON_AGGR_TYPE_FIELD): New define.
237 * decl.c (fixup_anonymous_aggr): Wipe RTTI info put in
238 place on invalid code.
239 * decl2.c (reset_type_linkage): Guard CLASSTYPE_TYPEINFO_VAR
241 * module.cc (trees_in::read_class_def): Likewise. Reconstruct
242 ANON_AGGR_TYPE_FIELD.
243 * semantics.c (finish_member_declaration): Populate
244 ANON_AGGR_TYPE_FIELD for anon aggregate typed members.
245 * typeck.c (lookup_anon_field): Remove DFS search and return
246 ANON_AGGR_TYPE_FIELD directly.
248 2021-09-07 Jakub Jelinek <jakub@redhat.com>
251 * constexpr.c (maybe_save_constexpr_fundef): Save body even for
252 constexpr deleting dtors.
253 (cxx_eval_call_expression): Don't use DECL_CLONED_FUNCTION for
256 2021-09-07 Marcel Vollweiler <marcel@codesourcery.com>
258 * parser.c (cp_parser_omp_flush): Parse 'seq_cst' clause on 'flush'
260 * semantics.c (finish_omp_flush): Handle MEMMODEL_SEQ_CST.
262 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
264 * coroutines.cc (register_local_var_uses): Do not mangle
265 frame entries for the outermost scope. Record the outer
266 scope as nesting depth 0.
268 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
270 * coroutines.cc (coro_build_artificial_var): New.
271 (build_actor_fn): Use var builder, rename vars to use
272 implementation namespace.
273 (coro_rewrite_function_body): Likewise.
274 (morph_fn_to_coro): Likewise.
276 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
278 * coroutines.cc (transform_local_var_uses): Record
279 frame offset expressions as DECL_VALUE_EXPRs instead of
282 2021-09-03 Patrick Palka <ppalka@redhat.com>
285 * call.c (build_this_conversion): New function, split out from
286 add_function_candidate.
287 (add_function_candidate): New parameter shortcut_bad_convs.
288 Document it. Use build_this_conversion. Stop at the first bad
289 argument conversion when shortcut_bad_convs is true.
290 (add_template_candidate_real): New parameter shortcut_bad_convs.
291 Use build_this_conversion to check the 'this' conversion before
292 attempting deduction. When the rejection reason code is
293 rr_bad_arg_conversion, pass -1 instead of 0 as the viable
294 parameter to add_candidate. Pass 'convs' to add_candidate.
295 (add_template_candidate): New parameter shortcut_bad_convs.
296 (add_template_conv_candidate): Pass false as shortcut_bad_convs
297 to add_template_candidate_real.
298 (add_candidates): Prefer to shortcut bad conversions during
299 overload resolution under the assumption that we'll eventually
300 see a strictly viable candidate. If this assumption turns out
301 to be false, re-process the non-strictly viable candidates
302 without shortcutting those bad conversions.
304 2021-09-03 Jason Merrill <jason@redhat.com>
306 * pt.c (limit_bad_template_recursion): Suppress -Wunused for decls
307 we decide not to instantiate.
309 2021-09-03 Jakub Jelinek <jakub@redhat.com>
312 * class.c (build_base_field): Use SET_DECL_FIELD_ABI_IGNORED
313 instead of writing to DECL_FIELD_ABI_IGNORED.
314 (layout_class_type): Likewise. In the place where zero-width
315 bitfields used to be removed, use
316 SET_DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD on those fields instead.
318 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
320 * call.c (build_over_call): Handle unavailable state in addition to
322 * class.c (type_build_ctor_call): Likewise.
323 (type_build_dtor_call): Likewise.
324 * cp-tree.h: Rename cp_warn_deprecated_use to
325 cp_handle_deprecated_or_unavailable.
326 * decl.c (duplicate_decls): Merge unavailability.
327 (grokdeclarator): Handle unavailability in addition to deprecation.
328 (type_is_unavailable): New.
329 (grokparms): Handle unavailability in addition to deprecation.
330 * decl.h (enum deprecated_states): Add
331 UNAVAILABLE_DEPRECATED_SUPPRESS.
332 * decl2.c (cplus_decl_attributes): Propagate unavailability to
334 (cp_warn_deprecated_use): Rename to ...
335 (cp_handle_deprecated_or_unavailable): ... this and amend to handle
336 the unavailable case. It remains a warning in the case of deprecation
337 but becomes an error in the case of unavailability.
338 (cp_warn_deprecated_use_scopes): Handle unavailability.
339 (mark_used): Likewise.
340 * parser.c (cp_parser_template_name): Likewise.
341 (cp_parser_template_argument): Likewise.
342 (cp_parser_parameter_declaration_list): Likewise.
343 * typeck.c (build_class_member_access_expr): Likewise.
344 (finish_class_member_access_expr): Likewise.
345 * typeck2.c (build_functional_cast_1): Likewise.
347 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
349 * coroutines.cc (build_actor_fn): Add begin/finish clauses
350 to the initial test in the actor function.
352 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
354 * coroutines.cc (await_statement_walker): Use build_stmt and
355 add_stmt instead of build1 and finish_expr_stmt.
357 2021-08-31 Jason Merrill <jason@redhat.com>
359 * coroutines.cc (flatten_await_stmt): Fix copyo.
360 * decl.c (reshape_init_class): Simplify.
361 * module.cc (module_state::read_language): Add null check.
362 * parser.c (build_range_temp): Avoid type_uses_auto.
363 (cp_parser_class_specifier_1): Add null check.
365 2021-08-31 Patrick Palka <ppalka@redhat.com>
368 * call.c (rejection_reason::call_varargs_p): Rename this
369 previously unused member to ...
370 (rejection_reason::least_p): ... this.
371 (arity_rejection): Add least_p parameter.
372 (add_template_candidate_real): When there are explicit
373 template arguments, check that the arity of the call agrees with
374 the arity of the function before attempting deduction.
375 (print_arity_information): Add least_p parameter.
376 (print_z_candidate): Adjust call to print_arity_information.
378 2021-08-31 Martin Sebor <msebor@redhat.com>
380 * parser.c (cp_parser_selection_statement): Use direct initialization
383 2021-08-31 Jason Merrill <jason@redhat.com>
385 * constexpr.c (explain_invalid_constexpr_fn): Use iloc_sentinel.
387 2021-08-31 Jason Merrill <jason@redhat.com>
390 * cp-tree.h (FNDECL_MANIFESTLY_CONST_EVALUATED): New.
391 * constexpr.c (cxx_eval_call_expression): Set it.
392 * pt.c (neglectable_inst_p): Check it.
394 2021-08-31 Marcel Vollweiler <marcel@codesourcery.com>
396 * parser.c (cp_parser_omp_clause_device): Parse device-modifiers 'device_num'
397 and 'ancestor' in 'target device' clauses.
398 * semantics.c (finish_omp_clauses): Error handling. Constant device ids must
399 evaluate to '1' if 'ancestor' is used.
401 2021-08-30 Jason Merrill <jason@redhat.com>
404 * cp-tree.h (struct lang_type): Add erroneous bit-field.
405 (CLASSTYPE_ERRONEOUS): New.
406 * pt.c (limit_bad_template_recursion): Check it.
407 (instantiate_class_template_1): Set it.
409 2021-08-30 Jason Merrill <jason@redhat.com>
411 * constexpr.c (cxx_eval_outermost_constant_expr): Copy
412 expr location to result.
414 2021-08-30 Jason Merrill <jason@redhat.com>
417 * cp-tree.h (cxx_constant_value_sfinae): Declare.
418 * constexpr.c (cxx_constant_value_sfinae): New.
419 * pt.c (fold_targs_r, maybe_fold_fn_template_args): New.
420 (tsubst_copy_and_build) [CALL_EXPR]: Call
421 maybe_fold_fn_template_args.
423 2021-08-30 Jason Merrill <jason@redhat.com>
425 * parser.c (cp_parser_simple_requirement): Warn about missing
428 2021-08-27 Jason Merrill <jason@redhat.com>
430 * typeck2.c (build_x_arrow): Do set TREE_TYPE when operand is
433 2021-08-25 Andrew Pinski <apinski@marvell.com>
436 * cp-objcp-common.c (cxx_block_may_fallthru): Handle
437 CLEANUP_STMT for the case which will be try/finally.
439 2021-08-25 Jakub Jelinek <jakub@redhat.com>
442 * init.c (build_value_init_noctor): Ignore unnamed zero-width
445 2021-08-23 Jakub Jelinek <jakub@redhat.com>
447 * parser.c (cp_parser_omp_clause_num_tasks,
448 cp_parser_omp_clause_grainsize): Parse the optional strict: modifier.
450 2021-08-20 Jakub Jelinek <jakub@redhat.com>
452 * parser.c (cp_parser_handle_statement_omp_attributes): Determine if
453 PRAGMA_OMP_ERROR directive is C_OMP_DIR_STANDALONE.
454 (cp_parser_omp_error): New function.
455 (cp_parser_pragma): Handle PRAGMA_OMP_ERROR.
457 2021-08-20 Jakub Jelinek <jakub@redhat.com>
459 * parser.c (cp_parser_omp_clause_depend_sink): Reject spurious
460 comma at the end of list. Don't parse closing paren here...
461 (cp_parser_omp_clause_depend): ... but here instead.
463 2021-08-19 Patrick Palka <ppalka@redhat.com>
466 * cp-tree.h (CONSTRUCTOR_IS_PAREN_INIT): Clarify comment.
468 2021-08-19 Jakub Jelinek <jakub@redhat.com>
470 * parser.c (cp_parser_omp_requires): Don't call cp_lexer_nth_token_is
471 and optionally consume token if current token is CPP_EOF,
472 CPP_PRAGMA_EOL or CPP_CLOSE_PAREN.
474 2021-08-19 Jakub Jelinek <jakub@redhat.com>
476 * parser.c (cp_parser_omp_nothing): Use cp_parser_require_pragma_eol
477 instead of cp_parser_skip_to_pragma_eol.
479 2021-08-18 Patrick Palka <ppalka@redhat.com>
483 * cp-tree.h (CONSTRUCTOR_BRACES_ELIDED_P): Define.
484 * decl.c (reshape_init_r): Set it.
485 * pt.c (collect_ctor_idx_types): Recurse into a sub-CONSTRUCTOR
486 iff CONSTRUCTOR_BRACES_ELIDED_P.
488 2021-08-18 Patrick Palka <ppalka@redhat.com>
491 * pt.c (convert_template_argument): Pass LOOKUP_IMPLICIT to
494 2021-08-18 Jakub Jelinek <jakub@redhat.com>
496 * parser.c (cp_parser_omp_nothing): New function.
497 (cp_parser_pragma): Handle PRAGMA_OMP_NOTHING.
499 2021-08-18 Jakub Jelinek <jakub@redhat.com>
501 * parser.c (cp_parser_omp_ordered): Return true instead of
502 false after emitting errors that the directive is not allowed in
504 (cp_parser_omp_target_update): Likewise.
505 (cp_parser_omp_cancellation_point): Change return type from void to
506 bool, return false if the directive should be ignored in pragma_stmt
508 (cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data):
509 Change return type from tree to bool, return false if the
510 directive should be ignored in pragma_stmt contexts.
511 (cp_parser_omp_target): Adjust callers of cp_parser_omp_target_*_data,
512 return their result directly.
513 (cp_parser_pragma): For PRAGMA_OMP_CANCELLATION_POINT return what
514 cp_parser_omp_cancellation_point returned. Return true instead of
515 false after emitting errors that the directive is not allowed in
518 2021-08-17 Jakub Jelinek <jakub@redhat.com>
521 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_LAYOUT_COMPATIBLE.
522 (enum cp_built_in_function): Add CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
523 (fold_builtin_is_corresponding_member, next_common_initial_seqence,
524 layout_compatible_type_p): Declare.
525 * parser.c (cp_parser_primary_expression): Handle
526 RID_IS_LAYOUT_COMPATIBLE.
527 (cp_parser_trait_expr): Likewise.
528 * cp-objcp-common.c (names_builtin_p): Likewise.
529 * constraint.cc (diagnose_trait_expr): Handle
530 CPTK_IS_LAYOUT_COMPATIBLE.
531 * decl.c (cxx_init_decl_processing): Register
532 __builtin_is_corresponding_member builtin.
533 * constexpr.c (cxx_eval_builtin_function_call): Handle
534 CP_BUILT_IN_IS_CORRESPONDING_MEMBER builtin.
535 * semantics.c (is_corresponding_member_union,
536 is_corresponding_member_aggr, fold_builtin_is_corresponding_member):
538 (trait_expr_value): Handle CPTK_IS_LAYOUT_COMPATIBLE.
539 (finish_trait_expr): Likewise.
540 * typeck.c (next_common_initial_seqence, layout_compatible_type_p):
542 * cp-gimplify.c (cp_gimplify_expr): Fold
543 CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
545 * tree.c (builtin_valid_in_constant_expr_p): Handle
546 CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
547 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
548 CPTK_IS_LAYOUT_COMPATIBLE.
549 * class.c (remove_zero_width_bit_fields): Remove.
550 (layout_class_type): Don't call it.
552 2021-08-17 Jakub Jelinek <jakub@redhat.com>
554 * parser.c (OMP_SCOPE_CLAUSE_MASK): Define.
555 (cp_parser_omp_scope): New function.
556 (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_SCOPE.
557 * pt.c (tsubst_expr): Handle OMP_SCOPE.
559 2021-08-12 Jakub Jelinek <jakub@redhat.com>
561 * parser.c (cp_parser_omp_clause_name): Parse filter clause name.
562 (cp_parser_omp_clause_filter): New function.
563 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FILTER.
564 (OMP_MASKED_CLAUSE_MASK): Define.
565 (cp_parser_omp_masked): New function.
566 (cp_parser_omp_parallel): Handle parallel masked.
567 (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_MASKED.
568 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_FILTER.
569 * pt.c (tsubst_omp_clauses): Likewise.
570 (tsubst_expr): Handle OMP_MASKED.
572 2021-08-12 Sergei Trofimovich <siarheit@google.com>
575 * pt.c (tsubst_copy_and_build): Use build_ptrmemfunc_access_expr
576 to construct ptrmemfunc expression instantiation.
578 2021-08-12 Tobias Burnus <tobias@codesourcery.com>
580 * parser.c (cp_parser_omp_clause_proc_bind): Accept
581 'primary' as alias for 'master'.
583 2021-08-12 Jakub Jelinek <jakub@redhat.com>
585 * cp-tree.h (omp_declare_target_attr): New type.
586 (struct saved_scope): Change type of omp_declare_target_attribute
587 from int to vec<omp_declare_target_attr, va_gc> * and move it.
588 * parser.c (cp_parser_omp_declare_target): Instead of
589 incrementing scope_chain->omp_declare_target_attribute, push
590 a struct containing parser->lexer->in_omp_attribute_pragma to
592 (cp_parser_omp_end_declare_target): Instead of decrementing
593 scope_chain->omp_declare_target_attribute, pop a structure
594 from it. Diagnose mismatching declare target vs.
595 end declare target syntax.
596 * semantics.c (finish_translation_unit): Use vec_safe_length
597 and vec_safe_truncate on scope_chain->omp_declare_target_attributes.
598 * decl2.c (cplus_decl_attributes): Use vec_safe_length
599 on scope_chain->omp_declare_target_attributes.
601 2021-08-12 Jakub Jelinek <jakub@redhat.com>
603 * parser.c (cp_parser_lambda_body): Add temp overrides
604 for parser->{omp_declare_simd,oacc_routine,omp_attrs_forbidden_p}.
605 (cp_parser_statement): Restore parser->omp_attrs_forbidden_p for
606 cp_parser_declaration_statement.
607 (cp_parser_default_argument): Add temp override for
608 parser->omp_attrs_forbidden_p.
609 (cp_parser_late_parsing_omp_declare_simd): Diagnose declare simd
610 or declare variant in attribute syntax on a declaration immediately
611 following an OpenMP construct in pragma syntax.
613 2021-08-12 Jakub Jelinek <jakub@redhat.com>
616 * method.c (cat_tag_for): Return cc_last for !CLASS_TYPE_P
617 or for classes not in std namespace.
619 2021-08-12 Jakub Jelinek <jakub@redhat.com>
621 * name-lookup.c (finish_using_directive): Diagnose omp::directive
622 or omp::sequence attributes on using-directive.
624 2021-08-12 Jakub Jelinek <jakub@redhat.com>
626 * parser.c (cp_parser_block_declaration): Call
627 cp_parser_using_directive for C++11 attributes followed by
628 using namespace tokens.
629 (cp_parser_using_directive): Parse C++11 attributes at the start
630 of the directive rather than at the end, only parse GNU attributes
633 2021-08-12 Patrick Palka <ppalka@redhat.com>
636 * constexpr.c (cxx_eval_store_expression): Handle the lval=true
637 case in the early exit code path for empty stores with mismatched
640 2021-08-11 Patrick Palka <ppalka@redhat.com>
644 * cp-tree.h (unevaluated_p): Return true for REQUIRES_EXPR.
645 * decl.c (local_variable_p_walkfn): Don't walk into unevaluated
647 * parser.c (cp_parser_primary_expression) <case CPP_NAME>: Never
648 reject uses of local variables in unevaluated contexts.
649 * tree.c (cp_walk_subtrees) <case REQUIRES_EXPR>: Increment
650 cp_unevaluated_operand. Use cp_walk_tree directly instead of
651 WALK_SUBTREE to avoid the goto. Use REQUIRES_EXPR_REQS instead
652 of TREE_OPERAND directly.
654 2021-08-11 Jakub Jelinek <jakub@redhat.com>
657 * decl2.c (var_defined_without_dynamic_init): Return true for
658 DECL_DECLARED_CONSTINIT_P with complete type and trivial destructor.
660 2021-08-11 Patrick Palka <ppalka@redhat.com>
663 * parser.c (maybe_adjust_declarator_for_dguide): New, split
665 (cp_parser_init_declarator): ... here.
666 (cp_parser_member_declaration): Use it.
668 2021-08-11 Patrick Palka <ppalka@redhat.com>
671 * parser.c (cp_parser_parameter_declaration_list): Don't call
672 grokdeclarator if cp_parser_error_occurred.
673 (cp_parser_parameter_declaration): Simulate an error if we see
674 the beginning of a CTAD form, i.e. if we see an opening brace
675 after the decl-specifier-seq and the type is a CTAD placeholder.
677 2021-08-10 Jakub Jelinek <jakub@redhat.com>
679 * parser.c (cp_parser_member_declaration): Move odsd declaration
680 before cp_parser_using_declaration call to avoid errors with
683 2021-08-10 Jakub Jelinek <jakub@redhat.com>
685 * parser.h (struct cp_omp_declare_simd_data): Remove
686 in_omp_attribute_pragma and clauses members, add loc and attribs.
687 (struct cp_oacc_routine_data): Remove loc member, add clauses
689 * parser.c (cp_finalize_omp_declare_simd): New function.
690 (cp_parser_handle_statement_omp_attributes): Mention in
691 function comment the function is used also for
692 attribute-declaration.
693 (cp_parser_handle_directive_omp_attributes): New function.
694 (cp_parser_statement): Don't call
695 cp_parser_handle_statement_omp_attributes if statement doesn't
696 have attribute-specifier-seq at the beginning at all or if
697 if those attributes don't appertain to the statement.
698 (cp_parser_simple_declaration): Call
699 cp_parser_handle_directive_omp_attributes and
700 cp_finalize_omp_declare_simd.
701 (cp_parser_explicit_instantiation): Likewise.
702 (cp_parser_init_declarator): Initialize prefix_attributes
703 only after parsing declarators.
704 (cp_parser_direct_declarator): Call
705 cp_parser_handle_directive_omp_attributes and
706 cp_finalize_omp_declare_simd.
707 (cp_parser_member_declaration): Likewise.
708 (cp_parser_single_declaration): Likewise.
709 (cp_parser_omp_declare_simd): Don't initialize
710 data.in_omp_attribute_pragma, instead initialize
711 data.attribs[0] and data.attribs[1].
712 (cp_finish_omp_declare_variant): Remove
713 in_omp_attribute_pragma argument, instead use
714 parser->lexer->in_omp_attribute_pragma.
715 (cp_parser_late_parsing_omp_declare_simd): Adjust
716 cp_finish_omp_declare_variant caller. Handle attribute-syntax
717 declare simd/variant.
719 2021-08-06 Tamar Christina <tamar.christina@arm.com>
721 * cp-objcp-common.h (cxx_simulate_enum_decl): Pass vec<> by pointer.
722 * decl.c (cxx_simulate_enum_decl): Likewise.
724 2021-08-04 Jakub Jelinek <jakub@redhat.com>
727 * parser.c (cp_parser_default_argument): Temporarily override
728 parser->omp_declare_simd and parser->oacc_routine to NULL.
730 2021-08-02 Patrick Palka <ppalka@redhat.com>
733 * logic.cc (formula::formula): Use emplace_back instead of
735 (formula::branch): Insert a copy of m_current directly after
736 m_current instead of at the end of the list.
737 (formula::erase): Define.
738 (decompose_formula): Remove.
739 (decompose_antecedents): Remove.
740 (decompose_consequents): Remove.
741 (derive_proofs): Remove.
742 (max_problem_size): Remove.
743 (diagnose_constraint_size): Remove.
744 (subsumes_constraints_nonnull): Rewrite directly in terms of
745 decompose_clause and derive_proof, interleaving decomposition
746 with implication checking. Remove limit on constraint complexity.
747 Use formula::erase to free the current clause before moving on to
750 2021-07-31 Jason Merrill <jason@redhat.com>
753 * decl.c (fixup_anonymous_aggr): Clear TYPE_NEEDS_CONSTRUCTING
756 2021-07-31 Jason Merrill <jason@redhat.com>
758 * ptree.c (cxx_print_type) [TYPE_PACK_EXPANSION]: Also print
759 PACK_EXPANSION_PATTERN.
761 2021-07-31 Jakub Jelinek <jakub@redhat.com>
763 * parser.c (cp_parser_declaration): Handle OpenMP directives
764 in attribute-declaration.
766 2021-07-30 Jakub Jelinek <jakub@redhat.com>
769 * cp-tree.h (enum cp_trait_kind): Add
770 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
771 (enum cp_built_in_function): Add
772 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.
773 (fold_builtin_is_pointer_inverconvertible_with_class): Declare.
774 * parser.c (cp_parser_primary_expression): Handle
775 RID_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
776 (cp_parser_trait_expr): Likewise.
777 * cp-objcp-common.c (names_builtin_p): Likewise.
778 * constraint.cc (diagnose_trait_expr): Handle
779 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
780 * decl.c (cxx_init_decl_processing): Register
781 __builtin_is_pointer_interconvertible_with_class builtin.
782 * constexpr.c (cxx_eval_builtin_function_call): Handle
783 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS builtin.
784 * semantics.c (pointer_interconvertible_base_of_p,
785 first_nonstatic_data_member_p,
786 fold_builtin_is_pointer_inverconvertible_with_class): New functions.
787 (trait_expr_value): Handle CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
788 (finish_trait_expr): Likewise. Formatting fix.
789 * cp-gimplify.c (cp_gimplify_expr): Fold
790 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS. Call
791 fndecl_built_in_p just once.
793 * tree.c (builtin_valid_in_constant_expr_p): Handle
794 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS. Call
795 fndecl_built_in_p just once.
796 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
797 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
799 2021-07-30 Jason Merrill <jason@redhat.com>
801 * class.c (finish_struct_anon): Improve comment.
802 * decl.c (fixup_anonymous_aggr): Reject anonymous struct
805 2021-07-30 Jakub Jelinek <jakub@redhat.com>
807 * parser.c (cp_parser_statement): Rollback attributes not just
808 when std_attrs is non-NULL, but whenever
809 cp_parser_std_attribute_spec_seq parsed any tokens.
811 2021-07-30 Jakub Jelinek <jakub@redhat.com>
814 * parser.c (cp_parser_skip_std_attribute_spec_seq): Add a forward
816 (cp_parser_declaration): Parse empty-declaration and
817 attribute-declaration.
818 (cp_parser_toplevel_declaration): Don't parse empty-declaration here.
820 2021-07-28 Martin Sebor <msebor@redhat.com>
822 * init.c: Include new header.
824 2021-07-27 Marek Polacek <polacek@redhat.com>
828 * cp-gimplify.c (cp_fold): Remove {LE,LT,GE,GT_EXPR} from
830 * typeck.c (cp_build_binary_op): Reject ordered comparison
831 of two null pointers.
833 2021-07-26 Jakub Jelinek <jakub@redhat.com>
835 * parser.h (struct cp_lexer): Add orphan_p member.
836 * parser.c (cp_parser_statement): Don't change in_omp_attribute_pragma
837 upon restart from CPP_PRAGMA handling. Fix up condition when a lexer
838 should be destroyed and adjust saved_tokens if it records tokens from
839 the to be destroyed lexer.
840 (cp_parser_omp_section_scan): New function.
841 (cp_parser_omp_scan_loop_body): Use it. If
842 parser->lexer->in_omp_attribute_pragma, allow optional comma
844 (cp_parser_omp_sections_scope): Use cp_parser_omp_section_scan.
846 2021-07-23 Jakub Jelinek <jakub@redhat.com>
848 * parser.h (struct cp_parser): Add omp_attrs_forbidden_p member.
849 * parser.c (cp_parser_handle_statement_omp_attributes): Diagnose
850 mixing of attribute and pragma syntax directives when seeing
851 omp::directive if parser->omp_attrs_forbidden_p or if attribute syntax
852 directives are followed by OpenMP pragma.
853 (cp_parser_statement): Clear parser->omp_attrs_forbidden_p after
854 the cp_parser_handle_statement_omp_attributes call.
855 (cp_parser_omp_structured_block): Add disallow_omp_attrs argument,
856 if true, set parser->omp_attrs_forbidden_p.
857 (cp_parser_omp_scan_loop_body, cp_parser_omp_sections_scope): Pass
858 false as disallow_omp_attrs to cp_parser_omp_structured_block.
859 (cp_parser_omp_parallel, cp_parser_omp_task): Set
860 parser->omp_attrs_forbidden_p.
862 2021-07-21 Thomas Schwinge <thomas@codesourcery.com>
863 Joseph Myers <joseph@codesourcery.com>
864 Cesar Philippidis <cesar@codesourcery.com>
866 * parser.c (cp_parser_omp_clause_name): Handle 'nohost'.
867 (cp_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
868 (OACC_ROUTINE_CLAUSE_MASK): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
869 * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
870 * semantics.c (finish_omp_clauses): Likewise.
872 2021-07-21 Jakub Jelinek <jakub@redhat.com>
875 * semantics.c (finish_omp_reduction_clause): Also call
876 complete_type_or_else and return true if it fails.
878 2021-07-19 Iain Sandoe <iain@sandoe.co.uk>
881 * coroutines.cc (struct coroutine_info): Add fields for
882 actor and destroy function decls.
884 (coro_get_ramp_function): New.
885 (coro_get_actor_function): New.
886 (coro_get_destroy_function): New.
887 (act_des_fn): Set up mapping between ramp, actor and
889 (morph_fn_to_coro): Adjust interface to the builder for
890 helper function decls.
891 * cp-tree.h (DECL_ACTOR_FN, DECL_DESTROY_FN, DECL_RAMP_FN,
893 * mangle.c (write_encoding): Handle coroutine helpers.
894 (write_unqualified_name): Handle lambda coroutine helpers.
896 2021-07-16 Patrick Palka <ppalka@redhat.com>
899 * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
900 substituting DECL_ARGUMENTS.
902 2021-07-16 Patrick Palka <ppalka@redhat.com>
906 * search.c (check_final_overrider): Compare TYPE_REF_IS_RVALUE
907 when the return types are references.
909 2021-07-16 Marek Polacek <polacek@redhat.com>
911 * typeck2.c (check_narrowing): Don't suppress the pedantic error
914 2021-07-15 Jakub Jelinek <jakub@redhat.com>
917 * cp-gimplify.c (cp_fold): For comparisons with NULLPTR_TYPE
918 operands, fold them right away to true or false.
920 2021-07-15 Jason Merrill <jason@redhat.com>
923 * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
924 (cp_tree_size): Remove redundant entries.
926 2021-07-14 Patrick Palka <ppalka@redhat.com>
929 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): Remove.
930 * pt.c (push_template_decl): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
932 (redeclare_class_template): Likewise.
933 (forwarding_reference_p): Define.
934 (maybe_adjust_types_for_deduction): Use it instead. Add 'tparms'
936 (unify_one_argument): Pass tparms to
937 maybe_adjust_types_for_deduction.
938 (try_one_overload): Likewise.
940 (rewrite_template_parm): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
943 2021-07-14 Jason Merrill <jason@redhat.com>
945 * class.c (struct find_final_overrider_data): Use auto_vec.
946 (find_final_overrider): Remove explicit release.
947 * coroutines.cc (process_conditional): Use auto_vec.
948 * cp-gimplify.c (struct cp_genericize_data): Use auto_vec.
949 (cp_genericize_tree): Remove explicit release.
950 * parser.c (cp_parser_objc_at_property_declaration): Use
952 * semantics.c (omp_reduction_lookup): Use auto_vec.
954 2021-07-14 Marek Polacek <polacek@redhat.com>
957 * constexpr.c (cxx_eval_array_reference): Create a new .object
958 and .ctor for the non-aggregate non-scalar case too when
961 2021-07-12 Patrick Palka <ppalka@redhat.com>
965 * decl.c (grokfndecl): Don't require that deduction guides are
966 declared at namespace scope. Check that class-scope deduction
967 guides have the same access as the member class template.
968 (grokdeclarator): Pretend class-scope deduction guides are static.
969 * search.c (lookup_member): Don't use a BASELINK for (class-scope)
972 2021-07-10 Patrick Palka <ppalka@redhat.com>
975 * init.c (build_aggr_init): Return error_mark_node if
976 expand_aggr_init_1 returns false.
977 (expand_default_init): Change return type to bool. Return false
978 on error, true on success.
979 (expand_aggr_init_1): Likewise.
981 2021-07-09 Jason Merrill <jason@redhat.com>
984 * decl.c (function_requirements_equivalent_p): Only compare
985 trailing requirements on a specialization.
987 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
989 * coroutines.cc (build_actor_fn): Move common code to
991 (build_destroy_fn): Likewise.
992 (act_des_fn): Build the void return here. Ensure that the
993 source location matches the original function.
995 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
998 (coro_rewrite_function_body): Connect the replacement
999 function block to the block nest correctly.
1001 2021-07-09 Patrick Palka <ppalka@redhat.com>
1004 * constraint.cc (tsubst_requires_expr): Pass complain/in_decl to
1006 * cp-tree.h (add_extra_args): Add complain/in_decl parameters.
1007 * pt.c (build_extra_args): Make a copy of args.
1008 (add_extra_args): Add complain/in_decl parameters. Enable the
1009 code for handling the case where the extra arguments are
1011 (tsubst_pack_expansion): Pass complain/in_decl to
1013 (tsubst_template_args): Handle missing template arguments.
1014 (tsubst_expr) <case IF_STMT>: Pass complain/in_decl to
1017 2021-07-09 Patrick Palka <ppalka@redhat.com>
1020 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Just walk the
1023 2021-07-08 Martin Sebor <msebor@redhat.com>
1026 * module.cc (identifier): Suppress warning.
1027 (module_state::read_macro_maps): Remove warning suppression.
1028 (module_state::install_macros): Ditto.
1030 2021-07-08 Marek Polacek <polacek@redhat.com>
1033 * cp-tree.h (unevaluated_p): New.
1034 * except.c (check_noexcept_r): Use it. Don't walk into
1035 unevaluated operands.
1037 2021-07-08 Martin Sebor <msebor@redhat.com>
1040 * module.cc (module_state::read_macro_maps): Temporarily disable
1042 (module_state::install_macros): Same.
1044 2021-07-06 Martin Sebor <msebor@redhat.com>
1046 * error.c (cp_printer): Remove support for %G and %K.
1048 2021-07-02 Jakub Jelinek <jakub@redhat.com>
1050 * parser.h (struct cp_lexer): Add in_omp_attribute_pragma member.
1051 (struct cp_omp_declare_simd_data): Likewise.
1052 * cp-tree.h (enum cp_tree_index): Add CPTI_OMP_IDENTIFIER.
1053 (omp_identifier): Define.
1054 * parser.c (cp_parser_skip_to_pragma_eol): Handle
1055 in_omp_attribute_pragma CPP_PRAGMA_EOL followed by CPP_EOF.
1056 (cp_parser_require_pragma_eol): Likewise.
1057 (struct cp_omp_attribute_data): New type.
1058 (cp_parser_handle_statement_omp_attributes): New function.
1059 (cp_parser_statement): Handle OpenMP directives in statement's
1060 attribute-specifier-seq.
1061 (cp_parser_omp_directive_args, cp_parser_omp_sequence_args): New
1063 (cp_parser_std_attribute): Handle omp::directive and omp::sequence
1065 (cp_parser_omp_all_clauses): If in_omp_attribute_pragma, allow
1066 a comma also before the first clause.
1067 (cp_parser_omp_allocate): Likewise.
1068 (cp_parser_omp_atomic): Likewise.
1069 (cp_parser_omp_depobj): Likewise.
1070 (cp_parser_omp_flush): Likewise.
1071 (cp_parser_omp_ordered): Likewise.
1072 (cp_parser_omp_declare_simd): Save in_omp_attribute_pragma
1073 into struct cp_omp_declare_simd_data.
1074 (cp_finish_omp_declare_variant): Add in_omp_attribute_pragma
1075 argument. If set, allow a comma also before match clause.
1076 (cp_parser_late_parsing_omp_declare_simd): If in_omp_attribute_pragma,
1077 allow a comma also before the first clause. Adjust
1078 cp_finish_omp_declare_variant caller.
1079 (cp_parser_omp_declare_target): If in_omp_attribute_pragma, allow
1080 a comma also before the first clause.
1081 (cp_parser_omp_declare_reduction_exprs): Likewise.
1082 (cp_parser_omp_requires): Likewise.
1083 * decl.c (initialize_predefined_identifiers): Initialize
1085 * decl2.c (cplus_decl_attributes): Reject omp::directive and
1086 omp::sequence attributes.
1088 2021-07-02 Jakub Jelinek <jakub@redhat.com>
1091 * parser.c (cp_parser_omp_atomic): Consume comma only if it
1092 appears before a CPP_NAME.
1094 2021-07-02 Patrick Palka <ppalka@redhat.com>
1097 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
1098 use common_enclosing_class and to not depend on the TREE_TYPE
1099 of outer levels pointing to the corresponding primary template.
1101 2021-07-01 Patrick Palka <ppalka@redhat.com>
1104 * constexpr.c (cxx_eval_array_reference): When the element type
1105 is an empty type and the corresponding element is omitted, just
1106 return an empty CONSTRUCTOR instead of attempting value
1109 2021-07-01 Patrick Palka <ppalka@redhat.com>
1112 * pt.c (finish_template_variable): Pass the partially
1113 instantiated template and its args to instantiate_template.
1114 (instantiate_class_template_1): No need to call
1115 push_nested_class and pop_nested_class around the call to
1116 most_specialized_partial_spec.
1117 (instantiate_template_1): Pass the partially instantiated
1118 template to lookup_template_variable.
1119 (most_specialized_partial_spec): Use push_access_scope_guard
1120 to set the access scope appropriately. Use
1121 deferring_access_check_sentinel to force access to get checked
1123 (instantiate_decl): Just pass the VAR_DECL to
1124 most_specialized_partial_spec.
1126 2021-06-30 Patrick Palka <ppalka@redhat.com>
1128 * constraint.cc (get_normalized_constraints_from_decl): Use
1129 push_access_scope_guard instead of push_nested_class_guard.
1130 * cp-tree.h (struct push_nested_class_guard): Replace with ...
1131 (struct push_access_scope_guard): ... this.
1132 * pt.c (push_access_scope): When the argument corresponds to
1133 a class type, push the class instead of its context.
1134 (pop_access_scope): Adjust accordingly.
1136 2021-06-30 Marek Polacek <polacek@redhat.com>
1140 * decl.c (create_array_type_for_decl): Allow array of auto.
1142 2021-06-29 Jason Merrill <jason@redhat.com>
1144 * pt.c (instantiate_decl): Only consider partial specializations of
1145 actual variable templates.
1147 2021-06-26 Patrick Palka <ppalka@redhat.com>
1150 * pt.c (instantiate_class_template_1): Enter the scope of the
1151 type when calling most_specialized_partial_spec.
1153 2021-06-26 Jason Merrill <jason@redhat.com>
1157 * class.c (is_empty_field): Handle null argument.
1158 * constexpr.c (cxx_eval_bare_aggregate): Discard initializer
1161 2021-06-26 Marek Polacek <polacek@redhat.com>
1164 * parser.c (cp_parser_declarator): Pass flags down to
1165 cp_parser_declarator. Also pass static_p/member_p.
1167 2021-06-25 Martin Sebor <msebor@redhat.com>
1169 * call.c (build_over_call): Replace direct uses of TREE_NO_WARNING
1170 with warning_suppressed_p, suppress_warning, and copy_no_warning, or
1171 nothing if not necessary.
1172 (set_up_extended_ref_temp): Same.
1173 * class.c (layout_class_type): Same.
1174 * constraint.cc (constraint_satisfaction_value): Same.
1175 * coroutines.cc (finish_co_await_expr): Same.
1176 (finish_co_yield_expr): Same.
1177 (finish_co_return_stmt): Same.
1178 (build_actor_fn): Same.
1179 (coro_rewrite_function_body): Same.
1180 (morph_fn_to_coro): Same.
1181 * cp-gimplify.c (genericize_eh_spec_block): Same.
1182 (gimplify_expr_stmt): Same.
1183 (cp_genericize_r): Same.
1185 * cp-ubsan.c (cp_ubsan_instrument_vptr): Same.
1186 * cvt.c (cp_fold_convert): Same.
1187 (convert_to_void): Same.
1188 * decl.c (wrapup_namespace_globals): Same.
1189 (grokdeclarator): Same.
1190 (finish_function): Same.
1191 (require_deduced_type): Same.
1192 * decl2.c (no_linkage_error): Same.
1193 (c_parse_final_cleanups): Same.
1194 * except.c (expand_end_catch_block): Same.
1195 * init.c (build_new_1): Same.
1197 (build_vec_delete_1): Same.
1198 (build_vec_init): Same.
1199 (build_delete): Same.
1200 * method.c (defaultable_fn_check): Same.
1201 * parser.c (cp_parser_fold_expression): Same.
1202 (cp_parser_primary_expression): Same.
1203 * pt.c (push_tinst_level_loc): Same.
1204 (tsubst_copy): Same.
1205 (tsubst_omp_udr): Same.
1206 (tsubst_copy_and_build): Same.
1207 * rtti.c (build_if_nonnull): Same.
1208 * semantics.c (maybe_convert_cond): Same.
1209 (finish_return_stmt): Same.
1210 (finish_parenthesized_expr): Same.
1211 (cp_check_omp_declare_reduction): Same.
1212 * tree.c (build_cplus_array_type): Same.
1213 * typeck.c (build_ptrmemfunc_access_expr): Same.
1214 (cp_build_indirect_ref_1): Same.
1215 (cp_build_function_call_vec): Same.
1216 (warn_for_null_address): Same.
1217 (cp_build_binary_op): Same.
1218 (unary_complex_lvalue): Same.
1219 (cp_build_modify_expr): Same.
1220 (build_x_modify_expr): Same.
1221 (convert_for_assignment): Same.
1223 2021-06-24 Patrick Palka <ppalka@redhat.com>
1226 * pt.c (maybe_aggr_guide): Handle alias templates appropriately.
1228 2021-06-24 Patrick Palka <ppalka@redhat.com>
1231 * constraint.cc (evaluate_requires_expr): Adjust function comment.
1232 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: Move to ...
1233 (cp_fold) <case REQUIRES_EXPR>: ... here.
1235 2021-06-24 Jakub Jelinek <jakub@redhat.com>
1237 * parser.c (cp_omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
1238 C_ORT_OMP for clauses on target construct.
1239 (OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
1240 (cp_parser_omp_target): For non-combined target add
1241 map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION. Pass
1242 C_ORT_OMP_TARGET to finish_omp_clauses.
1243 * semantics.c (handle_omp_array_sections_1): Adjust ort handling
1244 for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
1245 never present on C_ORT_*DECLARE_SIMD.
1246 (handle_omp_array_sections): Likewise.
1247 (finish_omp_clauses): Likewise. Handle OMP_CLAUSE_IN_REDUCTION
1248 on C_ORT_OMP_TARGET, set OMP_CLAUSE_MAP_IN_REDUCTION on
1249 corresponding map clauses.
1250 * pt.c (tsubst_expr): Pass C_ORT_OMP_TARGET instead of C_ORT_OMP for
1251 clauses on target construct.
1253 2021-06-23 Patrick Palka <ppalka@redhat.com>
1256 * pt.c (push_access_scope): For artificial deduction guides,
1257 set the access scope to that of the constructor.
1258 (pop_access_scope): Likewise.
1259 (build_deduction_guide): Don't set DECL_CONTEXT on the guide.
1261 2021-06-23 Patrick Palka <ppalka@redhat.com>
1264 * call.c (print_error_for_call_failure): Constify 'args' parameter.
1265 (perform_dguide_overload_resolution): Define.
1266 * cp-tree.h: (perform_dguide_overload_resolution): Declare.
1267 * pt.c (do_class_deduction): Use perform_dguide_overload_resolution
1268 instead of build_new_function_call. Don't use tf_decltype or
1269 set cp_unevaluated_operand. Remove unnecessary NULL_TREE tests.
1271 2021-06-21 Patrick Palka <ppalka@redhat.com>
1274 * typeck.c (check_return_expr): Call maybe_undo_parenthesized_ref
1275 sooner, before the NRVO handling.
1277 2021-06-21 Patrick Palka <ppalka@redhat.com>
1280 * tree.c (bot_replace): Use convert_to_base to build the
1281 conversion to the (morally) virtual base.
1283 2021-06-21 Jakub Jelinek <jakub@redhat.com>
1285 PR inline-asm/100785
1286 * typeck.c (cxx_mark_addressable): Diagnose trying to make
1287 bit-fields addressable.
1289 2021-06-17 Jason Merrill <jason@redhat.com>
1292 * decl.c (duplicate_decls): Make 'deleted after first declaration'
1293 pedwarn on by default.
1295 2021-06-17 Jason Merrill <jason@redhat.com>
1298 * init.c (build_vec_init): Preserve the type of base.
1300 2021-06-16 Jason Merrill <jason@redhat.com>
1304 * pt.c (tsubst_baselink): Update binfos in non-dependent case.
1306 2021-06-15 Robin Dapp <rdapp@linux.ibm.com>
1308 * decl.c (duplicate_decls): Likewise.
1310 2021-06-14 Tobias Burnus <tobias@codesourcery.com>
1313 * parser.c (cp_parser_omp_clause_affinity): No need to set iterator
1314 var in the error case.
1316 2021-06-13 Trevor Saunders <tbsaunde@tbsaunde.org>
1318 * constexpr.c (cxx_eval_call_expression): Iterate over vec<>
1319 with range based for.
1320 (cxx_eval_store_expression): Likewise.
1321 (cxx_eval_loop_expr): Likewise.
1322 * decl.c (wrapup_namespace_globals): Likewise.
1323 (cp_finish_decl): Likewise.
1324 (cxx_simulate_enum_decl): Likewise.
1325 * parser.c (cp_parser_postfix_expression): Likewise.
1327 2021-06-12 Jason Merrill <jason@redhat.com>
1330 * init.c (build_vec_init): Shortcut [0] case.
1332 2021-06-12 Jason Merrill <jason@redhat.com>
1334 * pt.c (lookup_template_class_1): Shortcut current_class_type.
1336 2021-06-11 Patrick Palka <ppalka@redhat.com>
1340 * pt.c (tsubst_arg_types): Rearrange so that we substitute into
1341 TYPE_ARG_TYPES in forward order while short circuiting
1342 appropriately. Adjust formatting.
1344 2021-06-11 Jakub Jelinek <jakub@redhat.com>
1347 * cp-tree.h (struct saved_scope): Add consteval_if_p
1348 member. Formatting fix for the discarded_stmt comment.
1349 (in_consteval_if_p, IF_STMT_CONSTEVAL_P): Define.
1350 * parser.c (cp_parser_lambda_expression): Temporarily disable
1351 in_consteval_if_p when parsing lambda body.
1352 (cp_parser_selection_statement): Parse consteval if.
1353 * decl.c (struct named_label_entry): Add in_consteval_if member.
1354 (level_for_consteval_if): New function.
1355 (poplevel_named_label_1, check_previous_goto_1, check_goto): Handle
1357 * constexpr.c (cxx_eval_builtin_function_call): Clarify in comment
1358 why CP_BUILT_IN_IS_CONSTANT_EVALUATED needs to *non_constant_p
1359 for !ctx->manifestly_const_eval.
1360 (cxx_eval_conditional_expression): For IF_STMT_CONSTEVAL_P evaluate
1361 condition as if it was __builtin_is_constant_evaluated call.
1362 (potential_constant_expression_1): For IF_STMT_CONSTEVAL_P always
1363 recurse on both branches.
1364 * cp-gimplify.c (genericize_if_stmt): Genericize IF_STMT_CONSTEVAL_P
1366 * pt.c (tsubst_expr) <case IF_STMT>: Copy IF_STMT_CONSTEVAL_P.
1367 Temporarily set in_consteval_if_p when recursing on
1368 IF_STMT_CONSTEVAL_P then branch.
1369 (tsubst_lambda_expr): Temporarily disable
1370 in_consteval_if_p when instantiating lambda body.
1371 * call.c (immediate_invocation_p): Return false when
1374 2021-06-11 Marek Polacek <polacek@redhat.com>
1377 * constexpr.c (maybe_constexpr_fn): New.
1378 * cp-tree.h (maybe_constexpr_fn): Declare.
1379 * semantics.c (find_std_constant_evaluated_r): New.
1380 (maybe_warn_for_constant_evaluated): New.
1381 (finish_if_stmt_cond): Call it.
1383 2021-06-10 Patrick Palka <ppalka@redhat.com>
1386 * pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
1387 the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
1388 a template template parameter, adjust to the
1389 TEMPLATE_TEMPLATE_PARAMETER before falling through.
1391 2021-06-10 Patrick Palka <ppalka@redhat.com>
1394 * constraint.cc (normalize_placeholder_type_constraints): When
1395 normalizing a non-templated return-type-requirement, add a dummy
1396 level to initial_parms.
1398 2021-06-08 Marek Polacek <polacek@redhat.com>
1401 * decl.c (grokdeclarator): Store a value-dependent
1402 explicit-specifier even for deduction guides.
1404 2021-06-08 Jason Merrill <jason@redhat.com>
1406 * parser.c (cp_parser_string_literal): Adjust diagnostic.
1408 2021-06-08 Jason Merrill <jason@redhat.com>
1411 * call.c (perfect_conversion_p): Check check_narrowing.
1413 2021-06-08 Jason Merrill <jason@redhat.com>
1416 * name-lookup.c (get_class_binding): Keep a BASELINK.
1417 (set_inherited_value_binding_p): Adjust.
1418 * lambda.c (is_lambda_ignored_entity): Adjust.
1419 * pt.c (lookup_template_function): Copy a BASELINK before
1422 2021-06-08 Jason Merrill <jason@redhat.com>
1425 * semantics.c (baselink_for_fns): Fix BASELINK_BINFO.
1427 2021-06-08 Jason Merrill <jason@redhat.com>
1429 * module.cc (duplicate_hash::hash): Comment out.
1430 (trees_in::tree_value): Adjust loop counter.
1432 2021-06-08 Jason Merrill <jason@redhat.com>
1435 * init.c (build_offset_ref): Return the BASELINK for a static
1438 2021-06-07 Patrick Palka <ppalka@redhat.com>
1441 * parser.c (cp_parser_lookup_name): Check access of the lookup
1442 result before we potentially adjust an injected-class-name to
1445 2021-06-06 Jakub Jelinek <jakub@redhat.com>
1448 * parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
1449 even when target is combined with other constructs.
1451 2021-06-04 Patrick Palka <ppalka@redhat.com>
1454 * pt.c (convert_template_argument): Strip top-level cv-quals
1455 on the substituted type of a non-type template parameter.
1457 2021-06-04 Patrick Palka <ppalka@redhat.com>
1460 * pt.c (tsubst_function_decl): Remove old code for reducing
1461 args when it has excess levels.
1463 2021-06-04 Jakub Jelinek <jakub@redhat.com>
1466 * name-lookup.c (maybe_save_operator_binding): Add op_attr after all
1467 ATTR_IS_DEPENDENT attributes in the DECL_ATTRIBUTES list rather than
1470 2021-06-03 Patrick Palka <ppalka@redhat.com>
1473 * decl.c (make_typename_type): After calling
1474 lookup_template_class, adjust the result to its TYPE_NAME and
1475 then consider the tf_keep_type_decl flag.
1477 2021-06-03 Patrick Palka <ppalka@redhat.com>
1480 * pt.c (set_current_access_from_decl): Move to ...
1481 * class.c (set_current_access_from_decl): ... here.
1482 (handle_using_decl): Use it to propagate the access of the
1483 using-enum decl to the copy of the imported enumerator.
1484 * cp-tree.h (set_current_access_from_decl): Declare.
1485 * decl.c (build_enumerator): Simplify using make_temp_override
1486 and set_current_access_from_decl.
1488 2021-06-03 Jakub Jelinek <jakub@redhat.com>
1491 * semantics.c (handle_omp_array_sections_1): For
1492 OMP_CLAUSE_{AFFINITY,DEPEND} handle FIELD_DECL base using
1493 finish_non_static_data_member and allow this as base.
1494 (finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
1495 after depend only cases. Let this be diagnosed by !lvalue_p
1496 case for OMP_CLAUSE_{AFFINITY,DEPEND} and remove useless
1498 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_AFFINITY.
1500 2021-06-02 Jason Merrill <jason@redhat.com>
1503 * call.c (convert_like_internal): Clear tf_no_cleanup when
1505 (build_user_type_conversion_1): Only add ck_rvalue if
1506 LOOKUP_ONLYCONVERTING.
1508 2021-06-01 Patrick Palka <ppalka@redhat.com>
1511 * init.c (expand_aggr_init_1): Check
1512 type_has_non_user_provided_default_constructor instead of
1513 type_has_user_provided_constructor.
1515 2021-06-01 Jason Merrill <jason@redhat.com>
1518 * call.c (build_op_delete_call): Don't set CALL_FROM_NEW_OR_DELETE_P
1519 for destroying delete.
1520 * init.c (build_delete): Don't clobber before destroying delete.
1522 2021-06-01 Jason Merrill <jason@redhat.com>
1525 * decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
1527 2021-05-31 Richard Biener <rguenther@suse.de>
1530 * cp-objcp-common.c (names_builtin_p): Handle
1531 RID_BUILTIN_SHUFFLEVECTOR.
1532 * cp-tree.h (build_x_shufflevector): Declare.
1533 * parser.c (cp_parser_postfix_expression): Handle
1534 RID_BUILTIN_SHUFFLEVECTOR.
1535 * pt.c (tsubst_copy_and_build): Handle IFN_SHUFFLEVECTOR.
1536 * typeck.c (build_x_shufflevector): Build either a lowered
1537 VEC_PERM_EXPR or an unlowered shufflevector via a temporary
1538 internal function IFN_SHUFFLEVECTOR.
1540 2021-05-28 Jason Merrill <jason@redhat.com>
1542 * constexpr.c (build_data_member_initialization): Use tsi_range.
1543 (build_constexpr_constructor_member_initializers): Likewise.
1544 (constexpr_fn_retval, cxx_eval_statement_list): Likewise.
1545 (potential_constant_expression_1): Likewise.
1546 * coroutines.cc (await_statement_expander): Likewise.
1547 (await_statement_walker): Likewise.
1548 * module.cc (trees_out::core_vals): Likewise.
1549 * pt.c (tsubst_expr): Likewise.
1550 * semantics.c (set_cleanup_locs): Likewise.
1552 2021-05-28 Jason Merrill <jason@redhat.com>
1556 * call.c (build_over_call): Adjust base_binfo in
1557 resolves_to_fixed_type_p case.
1559 2021-05-28 Jakub Jelinek <jakub@redhat.com>
1562 * semantics.c (handle_omp_array_sections): Copy
1563 OMP_CLAUSE_MAP_IMPLICIT.
1564 (finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
1565 marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT. Add
1566 map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
1567 maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
1568 present too. For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
1569 if present in map_head, map_field_head or map_firstprivate_head
1572 2021-05-28 Tobias Burnus <tobias@codesourcery.com>
1574 * parser.c (cp_parser_omp_clause_affinity): New.
1575 (cp_parser_omp_clause_name, cp_parser_omp_var_list_no_open,
1576 cp_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity
1578 * semantics.c (handle_omp_array_sections_1, handle_omp_array_sections,
1579 finish_omp_clauses): Likewise.
1581 2021-05-27 Matthias Kretz <kretz@kde.org>
1584 * error.c (dump_template_bindings): Include code to print
1585 "[with" and ']', conditional on whether anything is printed at
1586 all. This is tied to whether a semicolon is needed to separate
1587 multiple template parameters. If the template argument repeats
1588 the template parameter (T = T), then skip the parameter.
1589 (dump_substitution): Moved code to print "[with" and ']' to
1590 dump_template_bindings.
1591 (dump_function_decl): Partial revert of PR50828, which masked
1592 TFF_TEMPLATE_NAME for all of dump_function_decl. Now
1593 TFF_TEMPLATE_NAME is masked for the scope of the function and
1594 only carries through to dump_function_name.
1595 (dump_function_name): Avoid calling dump_template_parms if
1596 TFF_TEMPLATE_NAME is set.
1598 2021-05-27 Matthias Kretz <kretz@kde.org>
1601 * error.c: Call dump_scope when printing a typedef.
1603 2021-05-27 Patrick Palka <ppalka@redhat.com>
1606 * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
1608 2021-05-27 Jason Merrill <jason@redhat.com>
1611 * pt.c (use_pack_expansion_extra_args_p): Don't compare
1612 args from the same argument pack.
1614 2021-05-27 Patrick Palka <ppalka@redhat.com>
1619 * pt.c (process_partial_specialization): Don't error on a
1620 non-simple non-type template argument that involves template
1622 (for_each_template_parm_r): Don't walk TRAIT_EXPR, PLUS_EXPR,
1623 MULT_EXPR, or SCOPE_REF when include_nondeduced_p is false.
1625 2021-05-26 Patrick Palka <ppalka@redhat.com>
1628 * typeck.c (finish_class_member_access_expr): Disable ahead
1629 of time access checking during the member lookup.
1631 2021-05-26 Patrick Palka <ppalka@redhat.com>
1634 * tree.c (build_target_expr_with_type): Don't call force_rvalue
1635 on CALL_EXPR initializer. Simplify now that bot_manip is no
1637 (bot_manip): Use force_target_expr instead of
1638 build_target_expr_with_type.
1640 2021-05-26 Patrick Palka <ppalka@redhat.com>
1643 * cvt.c (noexcept_conv_p): Remove redundant checks and simplify.
1644 (fnptr_conv_p): Don't call non_reference. Use INDIRECT_TYPE_P
1645 instead of TYPE_PTR_P.
1646 * pt.c (convert_nontype_argument_function): Look through
1647 implicit INDIRECT_REFs before calling strip_fnptr_conv.
1649 2021-05-25 Jakub Jelinek <jakub@redhat.com>
1652 * call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
1653 and side-effects, temporarily disable -Wunused-result warning when
1654 building COMPOUND_EXPR.
1656 2021-05-21 Jakub Jelinek <jakub@redhat.com>
1659 * semantics.c (finish_omp_clauses): Move firstprivate clauses with
1660 OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain. Don't error
1661 if a decl is mentioned both in map clause and in such firstprivate
1662 clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
1664 2021-05-20 Jason Merrill <jason@redhat.com>
1666 * call.c (reference_binding): Check for designator.
1667 (implicit_conversion_1, build_special_member_call): Likewise.
1668 * decl.c (reshape_init_r): Likewise.
1669 * pt.c (do_class_deduction): Likewise.
1670 * typeck2.c (digest_init_r): Likewise.
1672 2021-05-20 Jason Merrill <jason@redhat.com>
1675 * decl.c (reshape_init_class): Handle designator for
1676 member of anonymous aggregate here.
1677 * typeck2.c (process_init_constructor_record): Not here.
1679 2021-05-20 Jonathan Wakely <jwakely@redhat.com>
1681 * call.c (maybe_warn_array_conv): Use new warning option.
1682 * decl.c (mark_inline_variable, grokdeclarator): Likewise.
1683 * error.c (maybe_warn_cpp0x): Likewise.
1684 * parser.c (cp_parser_primary_expression)
1685 (cp_parser_unqualified_id)
1686 (cp_parser_pseudo_destructor_name)
1687 (cp_parser_lambda_introducer)
1688 (cp_parser_lambda_declarator_opt)
1689 (cp_parser_selection_statement)
1690 (cp_parser_init_statement)
1691 (cp_parser_decomposition_declaration)
1692 (cp_parser_function_specifier_opt)
1693 (cp_parser_static_assert)
1694 (cp_parser_namespace_definition)
1695 (cp_parser_using_declaration)
1696 (cp_parser_asm_definition)
1697 (cp_parser_ctor_initializer_opt_and_function_body)
1698 (cp_parser_initializer_list)
1699 (cp_parser_type_parameter_key)
1700 (cp_parser_member_declaration)
1701 (cp_parser_try_block)
1702 (cp_parser_std_attribute_spec): Likewise.
1703 * pt.c (check_template_variable): Likewise.
1705 2021-05-20 Jason Merrill <jason@redhat.com>
1708 * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
1710 2021-05-20 Jason Merrill <jason@redhat.com>
1713 * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
1715 2021-05-19 Jason Merrill <jason@redhat.com>
1719 * method.c (genericize_spaceship): Use fold_build2 for scalar
1722 2021-05-19 Jason Merrill <jason@redhat.com>
1724 * pt.c (build_deduction_guide): Treat the implicit deduction guide
1725 as a member of the class.
1727 2021-05-19 Marek Polacek <polacek@redhat.com>
1730 * cp-tree.h (any_non_type_attribute_p): Remove.
1731 * decl.c (grokdeclarator): Turn an error into a warning and only
1732 warn for standard attributes.
1733 * decl2.c (any_non_type_attribute_p): Remove.
1734 * parser.c (cp_parser_elaborated_type_specifier): Turn an error
1735 into a warning and only warn for standard attributes.
1736 (cp_parser_member_declaration): Likewise.
1738 2021-05-19 Martin Liska <mliska@suse.cz>
1741 * mangle.c (write_encoding): Fix typos.
1743 2021-05-19 Jakub Jelinek <jakub@redhat.com>
1746 * parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
1747 master when combined with taskloop.
1748 (cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
1749 parallel master when not combined with taskloop.
1751 2021-05-19 Jason Merrill <jason@redhat.com>
1754 * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
1756 2021-05-19 Jason Merrill <jason@redhat.com>
1759 * tree.c (strip_typedefs): Only look at the pattern of a
1760 TYPE_PACK_EXPANSION if it's a type.
1762 2021-05-18 Marek Polacek <polacek@redhat.com>
1764 * class.c (classtype_has_non_deleted_copy_ctor): Remove.
1765 * constraint.cc (contains_wildcard_p): Likewise.
1766 (get_template_head_requirements): Likewise.
1767 (check_constrained_friend): Likewise.
1768 (subsumes_constraints): Likewise.
1769 * cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
1770 (push_void_library_fn): Likewise.
1771 (get_pattern_parm): Likewise.
1772 (get_template_parms_at_level): Likewise.
1773 (lambda_return_type): Likewise.
1774 (get_template_head_requirements): Likewise.
1775 (check_constrained_friend): Likewise.
1776 (subsumes_constraints): Likewise.
1777 * decl.c (push_void_library_fn): Likewise.
1778 * lambda.c (lambda_return_type): Likewise.
1779 * pt.c (get_template_parms_at_level): Likewise.
1780 (get_pattern_parm): Likewise.
1782 2021-05-18 Jason Merrill <jason@redhat.com>
1785 * call.c (perfect_candidate_p): An implicitly deleted move
1788 2021-05-18 Andreas Krebbel <krebbel@linux.ibm.com>
1791 * cvt.c (cp_convert_to_pointer): Use the size of the target
1793 * tree.c (cp_build_reference_type): Call
1794 cp_build_reference_type_for_mode with VOIDmode.
1795 (cp_build_reference_type_for_mode): Rename from
1796 cp_build_reference_type. Add MODE argument and invoke
1797 build_reference_type_for_mode.
1798 (strip_typedefs): Use build_pointer_type_for_mode and
1799 cp_build_reference_type_for_mode for pointers and references.
1801 2021-05-17 Jonathan Wakely <jwakely@redhat.com>
1804 * call.c (convert_like_internal): Print different diagnostic if
1805 the lvalue reference is const.
1807 2021-05-14 Jason Merrill <jason@redhat.com>
1810 * pt.c (enclosing_instantiation_of): Just compare
1811 DECL_SOURCE_LOCATION.
1812 (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
1814 2021-05-14 Marek Polacek <polacek@redhat.com>
1815 Jason Merrill <jason@redhat.com>
1818 * cp-tree.h (any_non_type_attribute_p): Declare.
1819 * decl.c (grokdeclarator): Diagnose when an attribute appertains to
1820 a friend declaration that is not a definition.
1821 * decl2.c (any_non_type_attribute_p): New.
1822 * parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
1823 in the middle of decl-specifiers.
1824 (cp_parser_elaborated_type_specifier): Diagnose when an attribute
1825 appertains to a friend declaration that is not a definition.
1826 (cp_parser_member_declaration): Likewise.
1828 2021-05-12 Marek Polacek <polacek@redhat.com>
1830 * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
1833 2021-05-12 Marcel Vollweiler <marcel@codesourcery.com>
1835 * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
1838 2021-05-11 Jason Merrill <jason@redhat.com>
1841 * typeck.c (build_reinterpret_cast_1): Check intype on
1844 2021-05-11 Patrick Palka <ppalka@redhat.com>
1847 * name-lookup.c (maybe_save_operator_binding): Unconditionally
1848 enable for all function templates, not just generic lambdas.
1849 Handle compound-assignment operator expressions.
1850 * typeck.c (build_x_compound_expr): Call maybe_save_operator_binding
1851 in the type-dependent case.
1852 (build_x_modify_expr): Likewise. Move declaration of 'op' closer
1855 2021-05-11 Patrick Palka <ppalka@redhat.com>
1858 * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
1859 (satisfy_atom): Set up iloc_sentinel before calling
1861 * pt.c (tsubst_pack_expansion): When returning a rebuilt pack
1862 expansion, carry over PACK_EXPANSION_LOCAL_P and
1863 PACK_EXPANSION_SIZEOF_P from the original pack expansion.
1865 2021-05-10 Richard Biener <rguenther@suse.de>
1867 PR middle-end/100464
1869 * call.c (set_up_extended_ref_temp): Mark the temporary
1870 addressable if the TARGET_EXPR was.
1872 2021-05-10 Martin Liska <mliska@suse.cz>
1874 * decl.c (duplicate_decls): Use startswith
1875 function instead of strncmp.
1876 (cxx_builtin_function): Likewise.
1877 (omp_declare_variant_finalize_one): Likewise.
1878 (grokfndecl): Likewise.
1879 * error.c (dump_decl_name): Likewise.
1880 * mangle.c (find_decomp_unqualified_name): Likewise.
1881 (write_guarded_var_name): Likewise.
1882 (decl_tls_wrapper_p): Likewise.
1883 * parser.c (cp_parser_simple_type_specifier): Likewise.
1884 (cp_parser_tx_qualifier_opt): Likewise.
1885 * pt.c (template_parm_object_p): Likewise.
1886 (dguide_name_p): Likewise.
1888 2021-05-10 Martin Liska <mliska@suse.cz>
1891 * decl.c (grokdeclarator): Remove redundant NULL check.
1893 2021-05-07 Jason Merrill <jason@redhat.com>
1895 * tree.c (rvalue): Assert expr is not a class lvalue.
1897 2021-05-07 Jason Merrill <jason@redhat.com>
1899 * cp-tree.h (build_stub_object): Declare.
1900 * method.c (build_stub_object): No longer static.
1901 * call.c (can_convert): Use it.
1902 * tree.c (build_dummy_object): Adjust comment.
1903 * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
1906 2021-05-07 Jason Merrill <jason@redhat.com>
1908 * coroutines.cc (build_co_await): Don't call 'rvalue'.
1909 (flatten_await_stmt): Simplify initialization.
1910 (morph_fn_to_coro): Change 'rvalue' to 'move'. Simplify.
1912 2021-05-04 Tobias Burnus <tobias@codesourcery.com>
1914 * semantics.c (finish_omp_reduction_clause): Accept float + complex
1915 for || and && reductions.
1917 2021-05-03 Patrick Palka <ppalka@redhat.com>
1920 * parser.c (cp_parser_class_head): Reinstate calls to pushclass
1921 and popclass when parsing the base-clause that were removed in
1924 2021-05-03 Patrick Palka <ppalka@redhat.com>
1928 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
1929 only when the callee is a FUNCTION_DECL.
1931 2021-05-03 Marek Polacek <polacek@redhat.com>
1934 * decl.c (grokfndecl): Check current_template_parms.
1936 2021-05-03 Marek Polacek <polacek@redhat.com>
1939 * constexpr.c (cxx_eval_constant_expression): Don't check
1942 2021-05-01 Jason Merrill <jason@redhat.com>
1944 * cp-tree.h (class ovl_iterator): Allow copying. Add op==.
1945 (class ovl_range, class lkp_range): New.
1946 * call.c (build_op_call_1, add_candidates): Use them.
1947 (build_op_delete_call, has_trivial_copy_assign_p): Likewise.
1948 (has_trivial_copy_p): Likewise.
1949 * class.c (handle_using_decl, get_basefndecls): Likewise.
1950 (maybe_warn_about_overly_private_class): Likewise.
1951 (warn_hidden, add_implicitly_declared_members): Likewise.
1952 (check_methods, clone_constructors_and_destructors): Likewise.
1953 (type_has_user_nondefault_constructor): Likewise.
1955 2021-04-29 Jason Merrill <jason@redhat.com>
1957 * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
1960 2021-04-29 Jason Merrill <jason@redhat.com>
1963 * decl2.c (grokfield): Call cplus_decl_attributes for friend.
1964 (save_template_attributes): Use chainon.
1965 * friend.c (do_friend): Remove attrlist parm.
1966 * cp-tree.h (do_friend): Adjust.
1967 * class.c (add_implicitly_declared_members): Adjust.
1968 * decl.c (grokdeclarator): Adjust.
1969 * pt.c (apply_late_template_attributes): Optimize.
1971 2021-04-29 Jason Merrill <jason@redhat.com>
1974 * class.c (finish_struct_anon_r): Drop complain parm.
1975 Remove non-field diagnostic.
1976 (finish_struct_anon): Adjust.
1977 * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here.
1979 2021-04-29 Jason Merrill <jason@redhat.com>
1981 * cp-tree.h (cp_evaluated): Add reset parm to constructor.
1982 * parser.c (cp_parser_constant_expression): Change
1983 allow_non_constant_p to int. Use cp_evaluated.
1984 (cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
1985 * semantics.c (finish_id_expression_1): Don't mess with
1986 cp_unevaluated_operand here.
1988 2021-04-29 Jason Merrill <jason@redhat.com>
1990 * cp-tree.h: Clarify comments.
1991 * pt.c (get_template_parm_object): Add assert.
1992 * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR.
1993 * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR.
1994 * typeck2.c (store_init_value): Likewise.
1996 2021-04-29 Patrick Palka <ppalka@redhat.com>
1999 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
2000 set tf_conv during the initial substitution into the function.
2002 2021-04-29 Jakub Jelinek <jakub@redhat.com>
2005 * semantics.c (finish_omp_clauses): Fix up check that variable
2006 mentioned in detach clause doesn't appear in data-sharing clauses.
2008 2021-04-28 Jakub Jelinek <jakub@redhat.com>
2010 * module.cc: Remove #error that triggers if DEV-PHASE is empty.
2012 2021-04-27 Jason Merrill <jason@redhat.com>
2015 * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
2018 2021-04-27 Patrick Palka <ppalka@redhat.com>
2021 * pt.c (tsubst_initializer_list): Correctly handle the case
2022 where an argument inside a base initializer pack expansion is
2023 itself a pack expansion.
2025 2021-04-26 Patrick Palka <ppalka@redhat.com>
2028 * constexpr.c (cxx_fold_indirect_ref): Try to canonicalize the
2029 object/offset pair for a POINTER_PLUS_EXPR of a COMPONENT_REF
2030 with a negative offset into one whose offset is nonnegative
2031 before calling cxx_fold_indirect_ref_1.
2033 2021-04-24 Patrick Palka <ppalka@redhat.com>
2040 * pt.c (do_class_deduction): Punt if the initializer is
2043 2021-04-24 Patrick Palka <ppalka@redhat.com>
2046 * parser.c (cp_parser_type_id_1): If we see a template
2047 placeholder, first try simulating an error before issuing
2050 2021-04-23 Patrick Palka <ppalka@redhat.com>
2053 * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
2054 Adjust parameter list loop to iterate over 'types' instead of
2055 'args'. Output the trailing '...' for a variadic function.
2056 Remove PARM_DECL support.
2057 (pp_cxx_requires_expr): Pretty print the parameter list directly
2058 instead of going through pp_cxx_parameter_declaration_clause.
2060 2021-04-23 Patrick Palka <ppalka@redhat.com>
2063 * decl.c (is_direct_enum_init): Check the implicit
2064 convertibility requirement added by CWG 2374.
2066 2021-04-23 Martin Liska <mliska@suse.cz>
2068 * cp-tree.h (STATIC_ASSERT): Prefer static assert.
2069 * lex.c (init_operators): Remove run-time check.
2071 2021-04-22 Marek Polacek <polacek@redhat.com>
2074 * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
2075 op1 separately for value- or type-dependence.
2077 2021-04-21 Marek Polacek <polacek@redhat.com>
2080 * parser.c (cp_parser_enum_specifier): Don't allow defining
2083 2021-04-21 Martin Liska <mliska@suse.cz>
2086 2021-04-21 Martin Liska <mliska@suse.cz>
2088 * error.c (dump_decl): Use flags in dump_generic_node call.
2090 2021-04-21 Martin Liska <mliska@suse.cz>
2092 * error.c (dump_decl): Use flags in dump_generic_node call.
2094 2021-04-21 Martin Liska <mliska@suse.cz>
2096 * error.c (dump_decl): Support anonymous labels.
2098 2021-04-20 Jason Merrill <jason@redhat.com>
2101 * pt.c (find_parameter_packs_r): Look into enum initializers.
2103 2021-04-19 Marek Polacek <polacek@redhat.com>
2106 * decl.c (grokvardecl): Given an error when a concept is not defined
2109 2021-04-16 Jakub Jelinek <jakub@redhat.com>
2112 * constexpr.c (cxx_eval_store_expression): Don't add CONSTRUCTORs
2113 for empty classes into *valp when types don't match even when *valp
2116 2021-04-16 Marek Polacek <polacek@redhat.com>
2119 * decl.c (make_typename_type): Give an error and return when
2120 name is is_overloaded_fn.
2121 * parser.c (cp_parser_class_name): Don't check is_overloaded_fn
2122 before calling make_typename_type.
2124 2021-04-16 Patrick Palka <ppalka@redhat.com>
2127 * constexpr.c (reduced_constant_expression_p): For array
2128 CONSTRUCTORs, use a dedicated loop that additionally verifies
2129 the CONSTRUCTOR spans the entire array.
2131 2021-04-16 Jakub Jelinek <jakub@redhat.com>
2134 * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
2135 If lambda_p, return pce_ok instead of pce_maybe_postfix.
2137 2021-04-16 Jakub Jelinek <jakub@redhat.com>
2140 * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
2141 binding, add to data.internal also all corresponding structured
2144 2021-04-16 Jason Merrill <jason@redhat.com>
2147 * cp-tree.h (first_field): Declare.
2148 * mangle.c (range_expr_nelts): New.
2149 (write_expression): Improve class NTTP mangling.
2150 * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
2151 * tree.c (zero_init_expr_p): Improve class NTTP handling.
2152 * decl.c: Adjust comment.
2154 2021-04-15 Jason Merrill <jason@redhat.com>
2157 * call.c (build_new_method_call_1): Check again for side-effects
2158 with a volatile object.
2160 2021-04-15 Jason Merrill <jason@redhat.com>
2164 * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
2165 TYPE_RAISES_EXCEPTIONS here.
2166 * tree.c (cp_walk_subtrees): Not here.
2168 2021-04-15 Jason Merrill <jason@redhat.com>
2172 * parser.c (cp_parser_default_type_template_argument): Set
2173 parser->local_variables_forbidden_p.
2175 2021-04-15 Richard Sandiford <richard.sandiford@arm.com>
2178 * typeck.c (merge_type_attributes_from): New function.
2179 (cp_common_type): Use it for vector types.
2181 2021-04-14 Jason Merrill <jason@redhat.com>
2185 * pt.c (uses_outer_template_parms): Also look at default
2188 2021-04-14 Jason Merrill <jason@redhat.com>
2191 * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
2192 for a non-static data member in a constant-expression.
2194 2021-04-14 Patrick Palka <ppalka@redhat.com>
2198 * pt.c (deducible_expression): Look through implicit
2199 INDIRECT_REFs as well.
2201 2021-04-14 Jason Merrill <jason@redhat.com>
2204 * parser.c (cp_parser_lambda_expression): Reject lambda
2205 in template parameter type.
2207 2021-04-14 Jason Merrill <jason@redhat.com>
2210 * decl.c (duplicate_decls): Don't propagate
2211 DECL_INITIALIZED_IN_CLASS_P to a specialization.
2213 2021-04-14 Jason Merrill <jason@redhat.com>
2218 * semantics.c (set_cleanup_locs): New.
2219 (do_poplevel): Call it.
2220 * parser.c (cp_parser_compound_statement): Consume the }
2221 before finish_compound_stmt.
2223 2021-04-13 Jason Merrill <jason@redhat.com>
2226 * pt.c (get_underlying_template): Compare TYPE_QUALS.
2228 2021-04-13 Jason Merrill <jason@redhat.com>
2232 * init.c (get_nsdmi): Do more context adjustment for local classes.
2234 2021-04-13 Patrick Palka <ppalka@redhat.com>
2237 * pt.c (do_class_deduction): Reject alias CTAD in C++17 mode
2238 rather than issuing a pedwarn.
2239 * typeck2.c (build_functional_cast_1): Handle CTAD uniformly
2240 for consistent diagnostics.
2242 2021-04-13 Jason Merrill <jason@redhat.com>
2245 * class.c (build_base_path): Shortcut simple non-pointer case.
2247 2021-04-13 Eric Botcazou <ebotcazou@adacore.com>
2249 * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
2251 (module_state::write_location): Likewise.
2253 2021-04-13 Patrick Palka <ppalka@redhat.com>
2256 * pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
2257 when checking if the initializer is an equivalent class
2258 placeholder template parameter.
2260 2021-04-13 Patrick Palka <ppalka@redhat.com>
2264 * constraint.cc (satisfy_normalized_constraints): Set
2266 * parser.c (cp_parser_concept_definition): Likewise.
2267 (cp_parser_requires_clause_opt): Likewise.
2269 2021-04-12 Jason Merrill <jason@redhat.com>
2272 * pt.c (uses_outer_template_parms): Handle non-type and template
2273 template parameters specifically.
2275 2021-04-11 Jason Merrill <jason@redhat.com>
2278 * decl.c (fixup_anonymous_aggr): Prune all functions from
2279 CLASSTYPE_MEMBER_VEC.
2281 2021-04-10 Jason Merrill <jason@redhat.com>
2285 * parser.c (cp_parser_direct_declarator): Don't
2286 inject_this_parameter if static_p.
2287 (cp_parser_omp_var_list_no_open): Parse 'this' even if
2288 current_class_ptr isn't set for a better diagnostic.
2290 2021-04-10 Jason Merrill <jason@redhat.com>
2297 * pt.c (alias_ctad_tweaks): Handle failure better.
2299 2021-04-10 Jason Merrill <jason@redhat.com>
2302 * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
2304 2021-04-09 Patrick Palka <ppalka@redhat.com>
2306 * cp-tree.h (LAMBDA_EXPR_REGENERATED_FROM)
2307 (LAMBDA_EXPR_REGENERATING_TARGS): Replace these with ...
2308 (LAMBDA_EXPR_REGEN_INFO): ... this.
2309 (tree_lambda_expr::regenerated_from)
2310 (tree_lambda_expr::regenerating_targs): Replace these with ...
2311 (tree_lambda_expr::regen_info): ... this.
2312 * constraint.cc (satisfy_declaration_constraints): Adjust
2314 * lambda.c (build_lambda_expr): Likewise.
2315 * pt.c (regenerated_lambda_fn_p): Likewise.
2316 (most_general_lambda): Likewise.
2317 (tsubst_lambda_expr): Likewise.
2319 2021-04-09 Marek Polacek <polacek@redhat.com>
2322 * parser.c (cp_parser_member_declaration): Call
2323 cp_parser_save_default_args even for function templates. Use
2324 STRIP_TEMPLATE on the declaration we're passing.
2326 2021-04-08 Patrick Palka <ppalka@redhat.com>
2329 * constraint.cc (get_normalized_constraints_from_decl): Handle
2330 regenerated lambdas.
2331 (satisfy_declaration_constraints): Likewise. Check for
2332 dependent args later.
2333 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): Replace with ...
2334 (LAMBDA_EXPR_REGENERATED_FROM): ... this.
2335 (LAMBDA_EXPR_REGENERATING_TARGS): New.
2336 (tree_lambda_expr::regenerated_from): New data member.
2337 (tree_lambda_expr::regenerating_targs): New data member.
2338 (add_to_template_args): Declare.
2339 (regenerated_lambda_fn_p): Likewise.
2340 (most_general_lambda): Likewise.
2341 * lambda.c (build_lambda_expr): Set LAMBDA_EXPR_REGENERATED_FROM
2342 and LAMBDA_EXPR_REGENERATING_TARGS.
2343 * pt.c (add_to_template_args): No longer static.
2344 (tsubst_function_decl): Unconditionally propagate constraints on
2345 the substituted function decl.
2346 (instantiated_lambda_fn_p): Rename to ...
2347 (regenerated_lambda_fn_p): ... this. Check
2348 LAMBDA_EXPR_REGENERATED_FROM instead of
2349 LAMBDA_EXPR_INSTANTIATED.
2350 (most_general_lambda): Define.
2351 (enclosing_instantiation_of): Adjust after renaming
2352 instantiated_lambda_fn_p.
2353 (tsubst_lambda_expr): Don't set LAMBDA_EXPR_INSTANTIATED. Set
2354 LAMBDA_EXPR_REGENERATED_FROM and LAMBDA_EXPR_REGENERATING_TARGS.
2355 Don't substitute or set constraints on the regenerated lambda.
2357 2021-04-08 Patrick Palka <ppalka@redhat.com>
2360 * pt.c (build_deduction_guide): Document OUTER_ARGS. Substitute
2361 them into the propagated constraints.
2363 2021-04-08 Jason Merrill <jason@redhat.com>
2366 * call.c (convert_like_internal): Improve reference diagnostic.
2368 2021-04-08 Jakub Jelinek <jakub@redhat.com>
2371 * constexpr.c (addr_of_non_const_var): New function.
2372 (cxx_bind_parameters_in_call): Set *non_constant_args to true
2373 even if cp_walk_tree on arg with addr_of_non_const_var callback
2376 2021-04-08 Jason Merrill <jason@redhat.com>
2379 * pt.c (determine_specialization): Improve diagnostic.
2381 2021-04-08 Marek Polacek <polacek@redhat.com>
2384 * decl.c (build_explicit_specifier): Call
2385 check_for_bare_parameter_packs.
2386 * except.c (build_noexcept_spec): Likewise.
2388 2021-04-07 Jason Merrill <jason@redhat.com>
2391 * parser.c (cp_parser_class_name): Check dependent_scope_p.
2393 2021-04-07 Jason Merrill <jason@redhat.com>
2396 * pt.c (maybe_process_partial_specialization): Check
2397 DECL_SELF_REFERENCE_P.
2399 2021-04-07 Jason Merrill <jason@redhat.com>
2402 * name-lookup.c (push_class_level_binding_1): Do overload a new
2403 function with a previous using-declaration.
2405 2021-04-06 Jason Merrill <jason@redhat.com>
2408 * init.c (get_nsdmi): Don't defer access checking.
2410 2021-04-06 Jason Merrill <jason@redhat.com>
2413 * decl.c (cp_finish_decl): mark_needed an implicitly inline
2414 static data member with an out-of-class redeclaration.
2416 2021-04-06 Jason Merrill <jason@redhat.com>
2419 * mangle.c (write_compact_number): Add sanity check.
2420 (write_local_name): Use list_length for parm number.
2422 2021-04-06 Patrick Palka <ppalka@redhat.com>
2425 * pt.c (do_auto_deduction): Don't exit early when deducing the
2426 array type of a structured binding. Also handle adc_decomp_type
2427 during constraint checking.
2429 2021-04-05 Jason Merrill <jason@redhat.com>
2432 * typeck.c (check_return_expr): Call mark_exp_read in dependent
2435 2021-04-05 Jason Merrill <jason@redhat.com>
2438 * typeck.c (build_reinterpret_cast_1): Don't perform
2439 temporary materialization.
2441 2021-04-05 Jason Merrill <jason@redhat.com>
2444 * pt.c (lookup_template_class_1): Do tsubst_enum when
2445 tsubsting a generic lambda.
2447 2021-04-05 Jason Merrill <jason@redhat.com>
2450 * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
2451 there is no enclosing non-lambda function.
2453 2021-04-05 Nathan Sidwell <nathan@acm.org>
2456 * module.cc (name_pending_imports): Drop 'atend' parm. Don't
2457 query export when not needed.
2458 (preprocess_module, preprocessed_module): Adjust.
2460 2021-04-05 Jason Merrill <jason@redhat.com>
2463 * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
2465 2021-04-05 Jason Merrill <jason@redhat.com>
2468 * pt.c (class el_data): Add visited field.
2469 (extract_local_specs): Pass it to cp_walk_tree.
2470 (extract_locals_r): Walk into the body of a lambda.
2472 2021-04-05 Jason Merrill <jason@redhat.com>
2474 * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
2477 2021-04-04 Jason Merrill <jason@redhat.com>
2480 * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
2482 2021-04-03 Marek Polacek <polacek@redhat.com>
2485 * parser.c: Create a GC root for attributes in a decl specifier.
2486 (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
2488 2021-04-03 Jason Merrill <jason@redhat.com>
2491 * pt.c (tsubst_lambda_expr): Skip the body block from
2494 2021-04-03 Jason Merrill <jason@redhat.com>
2497 * cvt.c (can_convert_qual): Check fnptr_conv_p.
2499 2021-04-03 Jason Merrill <jason@redhat.com>
2502 * pt.c (regenerate_decl_from_template): tsubst_decl
2505 2021-04-02 Patrick Palka <ppalka@redhat.com>
2508 * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
2509 to do_auto_deduction.
2511 2021-04-02 Patrick Palka <ppalka@redhat.com>
2514 * semantics.c (finish_compound_literal): Check
2515 template_placeholder_p instead of type_uses_auto.
2517 2021-04-02 Jason Merrill <jason@redhat.com>
2520 * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
2521 * lambda.c (add_capture): Set it.
2522 * pt.c (tsubst_pack_expansion): Handle it.
2524 2021-04-02 Nathan Sidwell <nathan@acm.org>
2526 * cp-tree.h (lang_decl_base): Correct module flag comment.
2527 * module.cc (trees_in::assert_definition): Break out
2529 (trees_out::lang_decl_bools): Do not write purview for header units.
2531 2021-04-01 Marek Polacek <polacek@redhat.com>
2534 * method.c (defaulted_late_check): ++ and -- function_depth around
2535 the call to synthesize_method.
2536 * pt.c: Remove the saved_trees global.
2538 2021-04-01 Jason Merrill <jason@redhat.com>
2542 * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
2543 TYPE_RAISES_EXCEPTIONS.
2545 2021-04-01 Iain Sandoe <iain@sandoe.co.uk>
2547 * mapper-client.cc (INCLUDE_MAP): New; require map to be
2548 included from system.h.
2549 * mapper-resolver.cc (INCLUDE_MAP): Likewise.
2551 2021-04-01 Jason Merrill <jason@redhat.com>
2554 * mangle.c (write_expression): Adjust.
2555 * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
2556 (mark_abi_tags_r): Likewise.
2558 2021-04-01 Nathan Sidwell <nathan@acm.org>
2561 * module.cc (trees_out::decl_node): Adjust importedness reference
2563 (module_state::intercluster_seed): New. Seed both imports and
2564 inter-cluster references. Broken out of ...
2565 (module_state::write_cluster): ... here. Call it.
2567 2021-03-31 Jason Merrill <jason@redhat.com>
2570 * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
2572 2021-03-31 Patrick Palka <ppalka@redhat.com>
2575 * mangle.c (write_expression): Adjust the mangling of
2578 2021-03-31 Patrick Palka <ppalka@redhat.com>
2581 * pt.c (placeholder_type_constraint_dependent_p): Expand
2582 argument packs to separate the first non-pack argument
2585 2021-03-30 Nathan Sidwell <nathan@acm.org>
2588 * module.cc (dumper::operator): Make less brittle.
2589 (trees_out::core_bools): VAR_DECLs always have a context.
2590 (trees_out::key_mergeable): Use same_type_p for asserting.
2591 (trees_in::read_var_def): Propagate
2592 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2594 2021-03-30 Jakub Jelinek <jakub@redhat.com>
2597 * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
2599 2021-03-26 Marek Polacek <polacek@redhat.com>
2602 * method.c (implicitly_declare_fn): Pass &raises to
2603 synthesized_method_walk.
2605 2021-03-26 Nathan Sidwell <nathan@acm.org>
2608 * cp-tree.h (DECL_MODULE_CHECK): Ban TEMPLATE_DECL.
2609 (SET_TYPE_TEMPLATE_INFO): Restore Alias template setting.
2610 * decl.c (duplicate_decls): Remove template_decl module flag
2612 * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
2613 (dumper::impl::nested_name): Adjust for template-decl module flag
2615 (trees_in::assert_definition): Likewise.
2616 (trees_in::install_entity): Likewise.
2617 (trees_out::decl_value): Likewise. Remove alias template
2618 separation of template and type_decl.
2619 (trees_in::decl_value): Likewise.
2620 (trees_out::key_mergeable): Likewise,
2621 (trees_in::key_mergeable): Likewise.
2622 (trees_out::decl_node): Adjust for template-decl module flag
2624 (depset::hash::make_dependency): Likewise.
2625 (get_originating_module, module_may_redeclare): Likewise.
2626 (set_instantiating_module, set_defining_module): Likewise.
2627 * name-lookup.c (name_lookup::search_adl): Likewise.
2628 (do_pushdecl): Likewise.
2629 * pt.c (build_template_decl): Likewise.
2630 (lookup_template_class_1): Remove special alias_template handling
2631 of DECL_TI_TEMPLATE.
2632 (tsubst_template_decl): Likewise.
2634 2021-03-26 Jakub Jelinek <jakub@redhat.com>
2637 * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
2638 in DECL_EXPR or in BIND_EXPR_VARS.
2640 2021-03-25 Jakub Jelinek <jakub@redhat.com>
2643 * parser.c (cp_parser_postfix_expression): For calls, create
2644 combined_loc and temporarily set input_location to it before
2645 calling finish_call_expr.
2647 2021-03-25 Marek Polacek <polacek@redhat.com>
2650 * call.c (build_over_call): Maybe call mark_used in case
2651 deduce_inheriting_ctor fails and return error_mark_node.
2652 * cp-tree.h (deduce_inheriting_ctor): Adjust declaration.
2653 * method.c (deduce_inheriting_ctor): Return bool if the deduction
2655 (implicitly_declare_fn): If raises is error_mark_node, call
2656 synthesized_method_walk with diag being true.
2658 2021-03-25 Jakub Jelinek <jakub@redhat.com>
2661 * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
2662 packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
2664 2021-03-25 Marek Polacek <polacek@redhat.com>
2667 * call.c (build_converted_constant_expr_internal): Don't emit
2668 -Wconversion warnings.
2670 2021-03-25 Jakub Jelinek <jakub@redhat.com>
2673 * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
2675 * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
2678 2021-03-23 Nathan Sidwell <nathan@acm.org>
2681 * name-lookup.c (check_module_override): Set global or partition
2682 DUP on the binding vector.
2684 2021-03-23 Marek Polacek <polacek@redhat.com>
2687 * decl2.c (cp_warn_deprecated_use_scopes): Only call
2688 cp_warn_deprecated_use when decl is a namespace, class, or enum.
2690 2021-03-23 Nathan Sidwell <nathan@acm.org>
2693 * decl.c (duplicate_decls): Remove assert about maybe-imported
2696 2021-03-23 Jakub Jelinek <jakub@redhat.com>
2699 * decl.c (cp_finish_decomp): Diagnose void initializers when
2700 using tuple_element and get.
2702 2021-03-22 Nathan Sidwell <nathan@acm.org>
2705 * module.cc (depset::hash::make_dependency): Propagate flags for
2706 partial specialization.
2707 (module_may_redeclare): Handle partial specialization.
2709 2021-03-22 Nathan Sidwell <nathan@acm.org>
2712 * cp-tree.h (map_context_from, map_context_to): Delete.
2713 (add_mergeable_specialization): Add is_alias parm.
2714 * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
2715 * module.cc (map_context_from, map_context_to): Delete.
2716 (trees_in::decl_value): Add specializations later, adjust call.
2717 Drop useless alias lookup. Set duplicate fn parm context.
2718 (check_mergeable_decl): Drop context mapping.
2719 (trees_in::is_matching_decl): Likewise.
2720 (trees_in::read_function_def): Drop parameter context adjustment
2723 2021-03-22 Martin Liska <mliska@suse.cz>
2726 * module.cc (fini_modules): Call vec_free instead of delete.
2728 2021-03-20 Jakub Jelinek <jakub@redhat.com>
2731 * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
2732 special code, instead call c_genericize_control_stmt.
2734 2021-03-19 Jakub Jelinek <jakub@redhat.com>
2737 * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
2738 INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
2739 don't diagnose it, set *non_constant_p nor return t.
2741 2021-03-19 Marek Polacek <polacek@redhat.com>
2744 * parser.c (cp_parser_requirement_parameter_list): Handle
2747 2021-03-18 Marek Polacek <polacek@redhat.com>
2749 * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
2751 2021-03-18 Marek Polacek <polacek@redhat.com>
2753 * pt.c (tsubst_copy_and_build): Add assert.
2755 2021-03-18 Iain Sandoe <iain@sandoe.co.uk>
2758 * parser.c (cp_debug_parser): Add Objective-C++ message
2760 (cp_parser_nested_name_specifier_opt): Allow colon to
2761 terminate an assignment-expression when parsing Objective-
2763 (cp_parser_objc_message_expression): Set and clear message
2764 parsing state on entry and exit.
2765 * parser.h (struct cp_parser): Add a context flag for
2766 Objective-C++ message state.
2768 2021-03-18 Martin Liska <mliska@suse.cz>
2771 * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
2774 2021-03-17 Marek Polacek <polacek@redhat.com>
2777 * call.c (conv_unsafe_in_template_p): New.
2778 (convert_like): Use it.
2780 2021-03-17 Anthony Sharp <anthonysharp15@gmail.com>
2781 Jason Merrill <jason@redhat.com>
2783 * semantics.c (get_class_access_diagnostic_decl): New
2784 function that examines special cases when a parent
2785 class causes a private access failure.
2786 (enforce_access): Slightly modified to call function
2789 2021-03-16 Jason Merrill <jason@redhat.com>
2791 * tree.c (cp_tree_equal): Use real_identical.
2793 2021-03-16 Jakub Jelinek <jakub@redhat.com>
2796 * decl.c (expand_static_init): For thread guards, call __cxa_atexit
2797 before calling __cxa_guard_release rather than after it. Formatting
2800 2021-03-16 Martin Liska <mliska@suse.cz>
2801 Jason Merrill <jason@redhat.com>
2804 * call.c (get_function_version_dispatcher): Handle
2806 * decl.c (maybe_version_functions): Likewise.
2807 (maybe_mark_function_versioned): New.
2808 * name-lookup.c (push_local_extern_decl_alias): No longer static.
2809 * name-lookup.h (push_local_extern_decl_alias): Adjust.
2811 2021-03-16 Nathan Sidwell <nathan@acm.org>
2814 * module.cc (trees_out::decl_value): Adjust typedef streaming,
2815 indicate whether it is a dependent alias.
2816 (trees_in::decl_value): Likewise. Set as dependent alias, if it
2819 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2822 * coroutines.cc (expand_one_await_expression): If the
2823 await_ready() expression is not a boolean then convert it
2826 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2829 * coroutines.cc (build_actor_fn): Make destroy index 1
2830 correspond to the abnormal unhandled_exception() exit.
2831 Substitute the proxy for the resume index.
2832 (coro_rewrite_function_body): Arrange to reset the resume
2833 index and make done = true for a rethrown exception from
2834 unhandled_exception ().
2835 (morph_fn_to_coro): Adjust calls to build_actor_fn and
2836 coro_rewrite_function_body.
2838 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2841 * coroutines.cc (replace_continue): Rewrite continue into
2843 (await_statement_walker): Handle await expressions in the
2844 initializer, condition and iteration expressions of for
2847 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2850 * coroutines.cc (flatten_await_stmt): Allow for the case
2851 where a target expression variable only has uses in the
2852 second part of a compound expression.
2853 (maybe_promote_temps): Avoid emiting empty statements.
2855 2021-03-15 Tobias Burnus <tobias@codesourcery.com>
2858 * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
2859 ensure that the varpool node is marked as offloadable.
2861 2021-03-12 Nathan Sidwell <nathan@acm.org>
2864 * module.cc (depset::hash::add_binding_entity): Assert not
2866 (depset::add::add_specializations): Likewise.
2867 * name-lookup.c (name_lookup::dedup): New.
2868 (name_lookup::~name_lookup): Assert not deduping.
2869 (name_lookup::restore_state): Likewise.
2870 (name_lookup::add_overload): Replace outlined code with dedup
2872 (name_lookup::add_value): Likewise.
2873 (name_lookup::search_namespace_only): Likewise.
2874 (name_lookup::adl_namespace_fns): Likewise.
2875 (name_lookup::adl_class_fns): Likewise.
2876 (name_lookup::search_adl): Likewise. Add clearing dedup call.
2877 (name_lookup::search_qualified): Likewise.
2878 (name_lookup::search_unqualified): Likewise.
2880 2021-03-12 Jakub Jelinek <jakub@redhat.com>
2883 * call.c (build_over_call): For immediate evaluation of functions
2884 that return references, undo convert_from_reference effects before
2885 calling cxx_constant_value and call convert_from_reference
2888 2021-03-11 Nathan Sidwell <nathan@acm.org>
2891 * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
2892 when there's a binding vector.
2893 * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
2895 2021-03-11 Nathan Sidwell <nathan@acm.org>
2898 * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
2900 (trees_in::decl_value): Adjust add_mergeable_specialization call.
2901 (trees_out::get_merge_kind): Adjust detecting a partial template
2903 (trees_out::key_mergeable): Adjust handling same.
2904 (trees_in::key_mergeabvle): Likewise.
2906 2021-03-10 Nathan Sidwell <nathan@acm.org>
2909 * module.cc (post_load_processing): Assert not gcable.
2910 (laxy_load_pendings): Extend no-gc region around
2911 post_load_processing.
2913 2021-03-10 Nathan Sidwell <nathan@acm.org>
2916 * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
2917 assembler name to the ns alias.
2919 2021-03-09 Jakub Jelinek <jakub@redhat.com>
2922 * coroutines.cc (build_co_await): Look through NOP_EXPRs in
2923 build_special_member_call return value to find the CALL_EXPR.
2926 2021-03-09 Nathan Sidwell <nathan@acm.org>
2929 * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
2930 that C++20 does not yet imply modules.
2932 2021-03-08 Nathan Sidwell <nathan@acm.org>
2935 * name-lookup.c (get_cxx_dialect_name): Add cxx23.
2937 2021-03-08 Nathan Sidwell <nathan@acm.org>
2939 * lex.c (module_token_filter::resume): Ignore module-decls inside
2941 * parser.c (cp_parser_module_declaration): Reject in header-unit.
2943 2021-03-08 Nathan Sidwell <nathan@acm.org>
2946 * cp-tree.h (match_mergeable_specialization)
2947 (add_mergeable_specialization): Adjust parms.
2948 * module.cc (trees_in::decl_value): Adjust
2949 add_mergeable_specialization calls.
2950 (trees_out::key_mergeable): Adjust match_mergeable_specialization
2952 (specialization_add): Likewise.
2953 * pt.c (match_mergeable_specialization): Do not insert.
2954 (add_mergeable_specialization): Add to hash table here.
2956 2021-03-06 Patrick Palka <ppalka@redhat.com>
2957 Jakub Jelinek <jakub@redhat.com>
2960 * constexpr.c (cxx_eval_increment_expression): Pass lval when
2961 evaluating the MODIFY_EXPR, and update 'mod' with the result of
2962 this evaluation. Check *non_constant_p afterwards. For prefix
2963 ops, just return 'mod'.
2965 2021-03-06 Patrick Palka <ppalka@redhat.com>
2966 Jakub Jelinek <jakub@redhat.com>
2969 * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
2970 variable 'fn' to 'tmpl'. Handle a variable template-id by
2971 calling lookup_template_variable.
2973 2021-03-06 Patrick Palka <ppalka@redhat.com>
2976 * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
2977 outer_targs to do_auto_deduction.
2978 (placeholder_type_constraint_dependent_p): Define.
2979 (do_auto_deduction): When processing_template_decl != 0
2980 and context is adc_unify and we have constraints, pretend the
2981 constraints are satisfied instead of punting. Otherwise don't
2982 punt unless placeholder_type_constraint_dependent_p holds.
2983 Add some clarifying sanity checks. Add a hack to add missing
2984 outermost template levels to outer_args before checking
2985 satisfaction. Don't substitute outer_targs into type if it's
2988 2021-03-05 Marek Polacek <polacek@redhat.com>
2991 * call.c (standard_conversion): When converting pointers to
2992 member, don't return NULL when the bases are equivalent but
2995 2021-03-05 Marek Polacek <polacek@redhat.com>
2998 * name-lookup.c (check_local_shadow): Check if the type of decl
2999 is non-null before checking TYPE_PTR*.
3001 2021-03-05 Nathan Sidwell <nathan@acm.org>
3004 * module.cc (module_state::write_cluster): Relax binding assert.
3006 2021-03-05 Nathan Sidwell <nathan@acm.org>
3009 * pt.c (instantiate_decl): Call set_instantiating_module.
3011 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3014 * coroutines.cc (build_co_await): Use type_build_ctor_call()
3015 to determine cases when a CTOR needs to be built.
3016 (flatten_await_stmt): Likewise.
3017 (morph_fn_to_coro): Likewise.
3019 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3022 * coroutines.cc (coro_diagnose_throwing_fn): New helper.
3023 (coro_diagnose_throwing_final_aw_expr): New helper.
3024 (build_co_await): Diagnose throwing final await expression
3026 (build_init_or_final_await): Diagnose a throwing promise
3027 final_suspend() call.
3029 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3032 * coroutines.cc (struct param_info): Track parameter copies that need
3034 (coro_get_frame_dtor): New helper function factored from build_actor().
3035 (build_actor_fn): Use coro_get_frame_dtor().
3036 (morph_fn_to_coro): Track parameters that need DTORs on exception,
3037 likewise the frame promise and the return object. On exception, run the
3038 DTORs for these, destroy the frame and then rethrow the exception.
3040 2021-03-05 Nathan Sidwell <nathan@acm.org>
3043 * pt.c (instantiate_class_template_1): Set instantiating module
3046 2021-03-05 Tobias Burnus <tobias@codesourcery.com>
3049 * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
3051 2021-03-04 Jakub Jelinek <jakub@redhat.com>
3055 * cvt.c (convert_to_void): Revert 2019-10-17 changes. Clarify
3058 2021-03-04 Nathan Sidwell <nathan@acm.org>
3061 * module.cc (class uintset): Delete.
3062 (typedef attached_map_t): A hash map.
3063 (attached_table): Use attached_map_t. Adjust uses ...
3064 (trees_out::decl_value, trees_in::decl_value): ... here ...
3065 (trees_out::key_mergeable): ... here ...
3066 (trees_in::key_mergeable): ... here ...
3067 (maybe_attach_decl): ... here ...
3068 (direct_import): ... and here.
3070 2021-03-04 Nathan Sidwell <nathan@acm.org>
3074 * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
3076 * module.cc (class pending_key): New.
3077 (default_hash_traits<pending_key>): New specialization.
3078 (pending_map_t): New typedef.
3079 (pending_table): Replace old table.
3080 (trees_out::lang_decl_bools): Adjust.
3081 (trees_in::lang_decl_bools): Adjust.
3082 (trees_in::install_entity): Drop pending member and specialization
3084 (find_pending_key): New.
3085 (depset::hash::fiund_dependencies): Use it.
3086 (pendset_lazy_load): Delete.
3087 (module_state::write_cluster): Don't count pendings here. Bye
3088 Duff's device-like thing.
3089 (module_state::write_pendings): Reimplement.
3090 (module_state::read_pendings): Reimplement.
3091 (lazy_specializations_p): Delete.
3092 (module_state::write): Adjust write_pendings call.
3093 (lazy_load_pendings): New.
3094 (lazy_load_specializations): Delete.
3095 (lazy_load_members): Delete.
3096 (init_modules): Adjust.
3097 * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
3098 not lazy_load_members.
3099 (note_pending_specializations): Delete.
3100 (load_pending_specializations): Delete.
3101 * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
3102 (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
3103 (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
3104 (note_pending_specializations): Delete.
3105 (load_pending_specializations): Delete.
3106 * pt.c (lookup_template_class_1): Call lazy_load_pendings not
3107 lazy_load_specializations.
3108 (instantiate_template_class_1): Likewise.
3109 (instantiate_decl): Call lazy_load_pendings.
3110 * typeck.c (complete_type): Likewise.
3112 2021-03-03 Nathan Sidwell <nathan@acm.org>
3115 * module.cc (post_load_decls): New.
3116 (lazy_snum, recursive_lazy): Move earlier.
3117 (module_state::read_cluster): Push cloning onto post_load_decls.
3118 (post_load_processing): New. Do the cloning here.
3119 (module_state::read_inits): Call post_load_processing.
3120 (module_state::read_language): Likewise.
3121 (lazy_load_binding, lazy_load_specializations): Likewise
3122 (lazy_load_members): Likewise
3124 2021-03-03 Nathan Sidwell <nathan@acm.org>
3127 * module.cc (trees_out::decl_value): Stream specialization keys
3129 (trees_in::decl_value): Stream them back and insert after
3130 completing the decl.
3131 (trees_out::key_mergeable): Drop some streaming here ...
3132 (trees_in::key_mergeable): ... and here. Don't insert into
3133 specialization tables.
3135 2021-03-03 Patrick Palka <ppalka@redhat.com>
3137 * constraint.cc (struct sat_info): Document the different
3138 meanings of noisy() and diagnose_unsatisfaction_p() during
3139 satisfaction and requires-expression evaluation.
3140 (tsubst_valid_expression_requirement): Take a sat_info instead
3141 of a subst_info. Perform the substitution quietly first. Fold
3142 in error-replaying code from diagnose_valid_expression.
3143 (tsubst_simple_requirement): Take a sat_info instead of a
3145 (tsubst_type_requirement_1): New. Fold in error-replaying code
3146 from diagnose_valid_type.
3147 (tsubst_type_requirement): Use the above. Take a sat_info
3148 instead of a subst_info.
3149 (tsubst_compound_requirement): Likewise. Fold in
3150 error-replaying code from diagnose_compound_requirement.
3151 (tsubst_nested_requirement): Take a sat_info instead of a
3152 subst_info. Fold in error-replaying code from
3153 diagnose_nested_requirement.
3154 (tsubst_requirement): Take a sat_info instead of a subst_info.
3155 (tsubst_requires_expr): Split into two versions, one that takes
3156 a sat_info argument and another that takes a complain and
3157 in_decl argument. Remove outdated documentation. Document the
3158 effects of the sat_info argument. Don't short-circuit
3159 processing of requirements when diagnosing unsatisfaction,
3160 mirroring diagnose_requires_expr.
3161 (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
3162 assert, and se the three-parameter version of tsubst_requires_expr.
3163 (diagnose_trait_expr): Make static. Take a template argument
3164 vector instead of a parameter mapping.
3165 (diagnose_valid_expression): Remove.
3166 (diagnose_valid_type): Remove.
3167 (diagnose_simple_requirement): Remove.
3168 (diagnose_compound_requirement): Remove.
3169 (diagnose_type_requirement): Remove.
3170 (diagnose_nested_requirement): Remove.
3171 (diagnose_requirement): Remove.
3172 (diagnose_requires_expr): Remove.
3173 (diagnose_atomic_constraint): Take a sat_info instead of a
3174 subst_info. Adjust call to diagnose_trait_expr. Call
3175 tsubst_requires_expr instead of diagnose_requires_expr.
3176 (diagnose_constraints): Remove special casing of REQUIRES_EXPR
3177 and just always call constraint_satisfaction_value.
3179 2021-03-03 Patrick Palka <ppalka@redhat.com>
3181 * constexpr.c (cxx_eval_call_expression): Adjust call to
3182 evaluate_concept_check.
3183 (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
3184 evaluate_requires_expression instead of
3185 satisfy_constraint_expression.
3186 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3187 * constraint.cc (struct sat_info): Adjust comment about which
3188 satisfaction entrypoints use noisy-unsat.
3189 (normalize_template_requirements): Remove (and adjust callers
3191 (normalize_nontemplate_requirements): Likewise.
3192 (tsubst_nested_requirement): Use constraint_satisfaction_value
3193 instead of satisfy_constraint_expression, which'll do the
3194 noisy replaying of ill-formed quiet satisfaction for us.
3195 (decl_satisfied_cache): Adjust comment.
3196 (satisfy_constraint): Rename to ...
3197 (satisfy_normalized_constraints): ... this.
3198 (satisfy_associated_constraints): Remove (and make its
3199 callers check for dependent arguments).
3200 (satisfy_constraint_expression): Rename to ...
3201 (satisfy_nondeclaration_constraints): ... this. Assert that
3202 'args' is empty when 't' is a concept-id. Removing handling
3203 bare constraint-expressions, and handle REQUIRES_EXPRs
3204 specially. Adjust comment accordingly.
3205 (satisfy_declaration_constraints): Assert in the two-parameter
3206 version that 't' is not a TEMPLATE_DECL. Adjust following
3207 removal of normalize_(non)?template_requirements and
3208 satisfy_asociated_constraints.
3209 (constraint_satisfaction_value): Combine the two- and
3210 three-parameter versions in the natural way.
3211 (constraints_satisfied_p): Combine the one- and two-parameter
3212 versions in the natural way. Improve documentation.
3213 (evaluate_requires_expr): Define.
3214 (evaluate_concept_check): Remove 'complain' parameter. Use
3215 constraint_satisfaction_value instead of
3216 satisfy_constraint_expression.
3217 (diagnose_nested_requirement): Adjust following renaming of
3218 satisfy_constraint_expression.
3219 (diagnose_constraints): Handle REQUIRES_EXPR by going through
3220 diagnose_requires_expr directly instead of treating it as a
3221 constraint-expression. Improve documentation.
3222 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
3223 to evaluate_concept_check.
3224 <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
3225 constraints_satisfied_p.
3226 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3227 * cp-tree.h (evaluate_requires_expr): Declare.
3228 (evaluate_concept_check): Remove tsubst_flag_t parameter.
3229 (satisfy_constraint_expression): Remove declaration.
3230 (constraints_satisfied_p): Remove one-parameter declaration.
3231 Add a default argument to the two-parameter declaration.
3232 * cvt.c (convert_to_void): Adjust call to
3233 evaluate_concept_check.
3235 2021-03-03 Jakub Jelinek <jakub@redhat.com>
3238 * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
3241 2021-03-03 Marek Polacek <polacek@redhat.com>
3245 * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
3246 (maybe_aggr_guide): Use the original template type where needed. In
3247 a class member template, partially instantiate the result of
3248 collect_ctor_idx_types.
3249 (do_class_deduction): Defer the deduction until the enclosing
3250 scope is non-dependent.
3252 2021-03-03 Jason Merrill <jason@redhat.com>
3255 * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
3256 if it didn't get one before.
3258 2021-03-03 Nathan Sidwell <nathan@acm.org>
3261 * module.cc (trees_out::decl_node): Small refactor.
3262 (depset::hash::add_binding_entity): Return true on meeting an
3263 import. Set namespace's import here.
3264 (module_state:write_namespaces): Inform of purview too.
3265 (module_state:read_namespaces): Adjust.
3266 * name-lookup.c (implicitly_export_namespace): Delete.
3267 (do_pushdecl): Don't call it.
3268 (push_namespace): Likewise, set purview.
3269 (add_imported_namespace): Reorder parms.
3270 * name-lookup.h (add_imported_namespace): Alter param ordering.
3272 2021-03-02 Martin Sebor <msebor@redhat.com>
3275 * class.c (build_base_path): Call build_if_nonnull.
3276 * cp-tree.h (build_if_nonnull): Declare.
3277 * rtti.c (ifnonnull): Rename...
3278 (build_if_nonnull): ...to this. Set no-warning bit on COND_EXPR.
3279 (build_dynamic_cast_1): Adjust to name change.
3281 2021-03-02 Patrick Palka <ppalka@redhat.com>
3285 * constraint.cc (type_deducible_p): Don't substitute into the
3286 constraints, and instead just pass 'args' to do_auto_deduction
3287 as the outer template arguments.
3288 (tsubst_parameter_mapping): Remove confused code for handling
3289 placeholder type arguments.
3290 (normalize_placeholder_type_constraint): Define.
3291 (satisfy_constraint_expression): Use it to handle placeholder
3293 * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
3294 (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
3295 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
3296 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3297 (make_constrained_placeholder_type): Set
3298 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3299 (do_auto_deduction): Clarify comments about the outer_targs
3300 parameter. Rework satisfaction of a placeholder type constraint
3301 to pass in the complete set of template arguments directly to
3302 constraints_satisfied_p.
3303 (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
3304 instead. Also rebuild the the constraint info on the new auto.
3306 2021-03-02 Patrick Palka <ppalka@redhat.com>
3308 * constraint.cc (build_parameter_mapping): Rely on the caller to
3309 determine the in-scope template parameters.
3310 (norm_info::norm_info): Delegate the tsubst_flags_t constructor
3311 to the two-parameter constructor. In the two-parameter
3312 constructor, fold in the definition of make_context, set
3313 initial_parms appropriately, and don't set the now-removed
3315 (norm_info::make_context): Remove, now that its only use is
3316 inlined into the caller.
3317 (norm_info::update_context): Adjust call to
3318 build_parameter_mapping to pass in the relevant set of in-scope
3319 template parameters.
3320 (norm_info::ctx_parms): Define this member function.
3321 (norm_info::context): Initialize to NULL_TREE.
3322 (norm_info::orig_decl): Remove this data member.
3323 (norm_info::initial_parms): Define this data member.
3324 (normalize_atom): Adjust call to build_parameter_mapping to pass
3325 in the relevant set of in-scope template parameters. Use
3326 info.initial_parms instead of info.orig_decl.
3327 (normalize_constraint_expression): Take a norm_info object
3328 instead of a bool. Cache the result of normalization.
3329 (tsubst_nested_requirement): Call satisfy_constraint_expression
3330 instead of satisfy_constraint, so that we normalize on demand.
3331 (satisfy_constraint_expression): Handle a NESTED_REQ argument.
3332 Adjust call to normalize_constraint_expression.
3333 (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
3334 to current_template_parms.
3335 (diagnose_nested_requirements): Go through
3336 satisfy_constraint_expression, as with tsubst_nested_requirement.
3338 2021-03-02 Patrick Palka <ppalka@redhat.com>
3340 * constraint.cc (tsubst_parameter_mapping): Canonicalize the
3341 arguments of a substituted TYPE_ARGUMENT_PACK even if we've
3342 started with a TYPE_ARGUMENT_PACK.
3343 (finish_requires_expr): Don't set DECL_CONTEXT and
3344 CONSTRAINT_VAR_P on each of the introduced parameters here.
3345 * parser.c (cp_parser_requirement_parameter_list): Instead set
3346 these fields earlier, here.
3347 * pt.c (do_auto_deduction): Canonicalize the result of
3348 do_auto_deduction. Pass 'complain' to finish_decltype_type.
3350 2021-03-02 Patrick Palka <ppalka@redhat.com>
3352 * constraint.cc (tsubst_simple_requirement): Just return
3353 boolean_true_node on success.
3354 (tsubst_type_requirement): Likewise.
3355 (tsubst_compound_requirement): Likewise.
3356 (tsubst_nested_requirement): Likewise.
3357 (tsubst_requirement_body): Remove.
3358 (check_constaint_variables): Rename to ...
3359 (check_constraint_variables): ... this.
3360 (tsubst_constraint_variables): Adjust.
3361 (tsubst_requires_expr): Fold tsubst_requirement_body into here.
3363 2021-03-01 Nathan Sidwell <nathan@acm.org>
3366 * class.c (fixup_type_variants): Propagate mode, precision,
3367 alignment & emptiness.
3368 * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
3369 (trees_in::tree_node): Rematerialize alignment here.
3371 2021-02-27 Jason Merrill <jason@redhat.com>
3374 * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
3377 2021-02-26 Jakub Jelinek <jakub@redhat.com>
3379 * parser.c (cp_parser_lambda_declarator_opt): Implement
3380 P1102R2 - Down with ()! Make ()s optional before lambda specifiers
3381 for -std={c,gnu}++2b or with pedwarn in earlier versions.
3383 2021-02-26 Jakub Jelinek <jakub@redhat.com>
3386 * lambda.c (is_lambda_ignored_entity): Before checking for
3387 LAMBDA_FUNCTION_P, use OVL_FIRST. Drop FUNCTION_DECL check.
3389 2021-02-26 Jason Merrill <jason@redhat.com>
3392 * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
3393 to a class non-type template argument that needs it.
3395 2021-02-26 Patrick Palka <ppalka@redhat.com>
3398 * pt.c (splice_late_return_type): Rebuild the entire return type
3399 if we have to adjust the level of an auto within.
3400 (type_uses_auto): Adjust call to find_type_usage.
3401 * type-utils.h (find_type_usage): Revert r10-6571 change that
3402 made this function return a pointer to the auto node.
3404 2021-02-25 Patrick Palka <ppalka@redhat.com>
3408 * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
3409 TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
3411 2021-02-25 Patrick Palka <ppalka@redhat.com>
3414 * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
3415 (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
3417 2021-02-25 Marek Polacek <polacek@redhat.com>
3421 * constexpr.c (is_std_construct_at): New overload.
3422 (is_std_allocator_allocate): New overload.
3423 (cxx_eval_call_expression): Use the new overloads.
3424 (cxx_eval_constant_expression): Reject casting
3425 from void * as per DR 1312. Don't check can_convert.
3427 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
3430 * coroutines.cc (struct param_info): Track rvalue refs.
3431 (morph_fn_to_coro): Track rvalue refs, and call the promise
3432 CTOR with the frame copy of passed parms.
3434 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
3437 * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
3438 set throwing_cleanup marker.
3440 2021-02-25 Nathan Sidwell <nathan@acm.org>
3443 * module.cc (module_state::inform_cmi_p): Renamed field.
3444 (module_state::do_import): Adjust.
3445 (init_modules, finish_module_processing): Likewise.
3446 (handle_module_option): Likewise.
3448 2021-02-25 Nathan Sidwell <nathan@acm.org>
3451 * mapper-client.cc (module_client::open_module_client): Fix typo
3454 2021-02-24 Nathan Sidwell <nathan@acm.org>
3457 * module.cc (ool): New indirection vector.
3458 (loc_spans::maybe_propagate): Location is not optional.
3459 (loc_spans::open): Likewise. Assert monotonically advancing.
3460 (module_for_ordinary_loc): Use ool indirection vector.
3461 (module_state::write_prepare_maps): Do not count empty macro
3462 expansions. Elide empty spans.
3463 (module_state::write_macro_maps): Skip empty expansions.
3464 (ool_cmp): New qsort comparator.
3465 (module_state::write): Create and destroy ool vector.
3466 (name_pending_imports): Fix dump push/pop.
3467 (preprocess_module): Likewise. Add more dumping.
3468 (preprocessed_module): Likewise.
3470 2021-02-24 Iain Sandoe <iain@sandoe.co.uk>
3473 * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
3474 error reporting when instantiating for a constexpr.
3476 2021-02-23 Nathan Sidwell <nathan@acm.org>
3479 * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
3482 2021-02-23 Patrick Palka <ppalka@redhat.com>
3485 * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
3486 over from tsubst_copy.
3488 2021-02-23 Patrick Palka <ppalka@redhat.com>
3490 * pt.c (instantiation_dependent_expression_p): Check
3491 processing_template_decl before calling
3492 potential_constant_expression.
3494 2021-02-22 Nathan Sidwell <nathan@acm.org>
3497 * module.cc (struct module_state): Add visited_p flag.
3498 (name_pending_imports): Use it to avoid duplicate requests.
3499 (preprocess_module): Don't read preprocessor state if we failed to
3500 load a module's config.
3502 2021-02-22 Nathan Sidwell <nathan@acm.org>
3505 * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
3507 * module.cc (set_defining_module): Add assert.
3509 2021-02-19 Nathan Sidwell <nathan@acm.org>
3512 * module.cc (pending_imports): New.
3513 (declare_module): Adjust test condition.
3514 (name_pending_imports): New.
3515 (preprocess_module): Reimplement using pending_imports.
3516 (preprocessed_module): Move name-getting to name_pending_imports.
3517 * name-lookup.c (append_imported_binding_slot): Assert module
3518 ordering is increasing.
3520 2021-02-19 Nathan Sidwell <nathan@acm.org>
3522 * module.cc (note_cmis): New.
3523 (struct module_state): Add inform_read_p bit.
3524 (module_state::do_import): Inform of CMI location, if enabled.
3525 (init_modules): Canonicalize note_cmis entries.
3526 (handle_module_option): Handle -flang-info-module-read=FOO.
3528 2021-02-19 Jason Merrill <jason@redhat.com>
3531 * call.c (perfect_conversion_p): Limit rvalueness
3532 test to reference bindings.
3534 2021-02-19 Jason Merrill <jason@redhat.com>
3537 * call.c (perfect_conversion_p): New.
3538 (perfect_candidate_p): New.
3539 (add_candidates): Ignore templates after a perfect non-template.
3541 2021-02-18 Nathan Sidwell <nathan@acm.org>
3544 * module.cc (canonicalize_header_name): Use
3545 cpp_probe_header_unit.
3546 (maybe_translate_include): Fix note_includes comparison.
3547 (init_modules): Fix note_includes string termination.
3549 2021-02-18 Jakub Jelinek <jakub@redhat.com>
3552 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
3553 cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
3554 for immediate function calls.
3556 2021-02-17 Nathan Sidwell <nathan@acm.org>
3559 * module.cc (struct macro_export): Add GTY markers.
3560 (macro_exports): Likewise, us a va_gc Vector.
3562 2021-02-17 Jakub Jelinek <jakub@redhat.com>
3565 * init.c (build_zero_init_1): For flexible array members just return
3566 NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
3569 2021-02-17 Nathan Sidwell <nathan@acm.org>
3572 * name-lookup.c (do_pushdecl): Don't peek under template_parm
3574 (set_identifier_type_value_with_scope): ... or here.
3575 (do_pushtag): Only set_identifier_type_value_with_scope at
3576 non-class template parm scope, and use parent scope.
3578 2021-02-17 Nathan Sidwell <nathan@acm.org>
3581 * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
3584 2021-02-17 Patrick Palka <ppalka@redhat.com>
3588 * tree.c (build_aggr_init_expr): Revert r10-7718 change.
3590 2021-02-12 Nathan Sidwell <nathan@acm.org>
3592 * module.cc (module_state::write_cluster): Check bindings for
3593 imported using-decls.
3595 2021-02-12 Nathan Sidwell <nathan@acm.org>
3598 * module.cc (trees_in::decl_value): Call add_module_namespace_decl
3599 for new namespace-scope entities.
3600 (module_state::read_cluster): Don't call add_module_decl here.
3601 * name-lookup.h (add_module_decl): Rename to ...
3602 (add_module_namespace_decl): ... this.
3603 * name-lookup.c (newbinding_bookkeeping): Move into ...
3604 (do_pushdecl): ... here. Its only remaining caller.
3605 (add_module_decl): Rename to ...
3606 (add_module_namespace_decl): ... here. Add checking-assert for
3607 circularity. Don't call newbinding_bookkeeping, just extern_c
3608 checking and incomplete var checking.
3610 2021-02-12 Nathan Sidwell <nathan@acm.org>
3614 * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
3615 (global_type_node): Delete.
3616 (IDENTIFIER_TYPE_VALUE): Delete.
3617 (IDENTIFIER_HAS_TYPE_VALUE): Delete.
3618 (get_type_value): Delete.
3619 * name-lookup.h (identifier_type_value): Delete.
3620 * name-lookup.c (check_module_override): Don't
3621 SET_IDENTIFIER_TYPE_VALUE here.
3622 (do_pushdecl): Nor here.
3623 (identifier_type_value_1, identifier_type_value): Delete.
3624 (set_identifier_type_value_with_scope): Only
3625 SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
3626 (pushdecl_nanmespace_level): Remove shadow stack nadgering.
3627 (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
3628 * call.c (check_dtor_name): Use lookup_name.
3629 * decl.c (cxx_init_decl_processing): Drop global_type_node.
3630 * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
3632 * init.c (get_type_value): Delete.
3633 * pt.c (instantiate_class_template_1): Don't call pushtag or
3634 SET_IDENTIFIER_TYPE_VALUE here.
3635 (tsubst): Assert never an identifier.
3636 (dependent_type_p): Drop global_type_node assert.
3637 * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
3638 to determine ctorness.
3640 2021-02-12 Jakub Jelinek <jakub@redhat.com>
3643 * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
3646 2021-02-12 Jason Merrill <jason@redhat.com>
3650 * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
3651 (register_parameter_specializations): Not here.
3653 2021-02-11 Marek Polacek <polacek@redhat.com>
3656 * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
3657 for the partial instantiation.
3659 2021-02-11 Jakub Jelinek <jakub@redhat.com>
3662 * init.c (build_zero_init_1): Handle zero initialiation of
3663 flexible array members like initialization of [0] arrays.
3664 Use integer_minus_onep instead of comparison to integer_minus_one_node
3665 and integer_zerop instead of comparison against size_zero_node.
3668 2021-02-11 Marek Polacek <polacek@redhat.com>
3671 * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
3673 2021-02-11 Patrick Palka <ppalka@redhat.com>
3676 * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
3677 lookup result by discarding it if the first element is a
3678 class-scope declaration, otherwise return it.
3679 (push_operator_bindings): Handle an ambiguous lookup result by
3680 doing push_local_binding on each element in the list.
3682 2021-02-11 Marek Polacek <polacek@redhat.com>
3684 * parser.c (cp_parser_selection_statement): Use vec_free.
3686 2021-02-10 Jakub Jelinek <jakub@redhat.com>
3690 * constexpr.c: Include cgraph.h.
3691 (cxx_eval_call_expression): Call varpool_node::finalize_decl on
3692 heap artificial vars.
3693 (cxx_eval_outermost_constant_expr): Remove varpool nodes for
3694 heap artificial vars.
3696 2021-02-10 Nathan Sidwell <nathan@acm.org>
3699 * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
3700 answer if there's no local specialization.
3702 2021-02-09 Nathan Sidwell <nathan@acm.org>
3705 * module.cc (module_state::is_rooted): Rename to ...
3706 (module_state::has_location): ... here. Adjust callers.
3707 (module_state::read_partitions): Adjust validity check.
3708 Don't overwrite a known location.
3710 2021-02-09 Jason Merrill <jason@redhat.com>
3713 * pt.c (mark_decl_instantiated): Exit early if consteval.
3715 2021-02-09 Jason Merrill <jason@redhat.com>
3719 * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
3722 2021-02-09 Jason Merrill <jason@redhat.com>
3726 * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
3729 2021-02-08 Nathan Sidwell <nathan@acm.org>
3731 * decl.c (start_cleanup_fn): Push function into
3734 2021-02-08 Nathan Sidwell <nathan@acm.org>
3737 * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
3738 * decl.c (push_abi_namespace, pop_abi_namespace): Moved
3739 from rtti.c, add default namespace arg.
3740 (check_redeclaration_exception_specification): Allow a lazy
3741 builtin's eh spec to differ from an lready-declared user
3743 (declare_global_var): Use push/pop_abi_namespace.
3744 (get_atexit_node): Push the fndecl into a namespace.
3745 * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
3748 2021-02-08 Marek Polacek <polacek@redhat.com>
3750 * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
3752 2021-02-05 Marek Polacek <polacek@redhat.com>
3755 * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
3757 * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
3758 issuing the -Wvolatile warning. Only set TREE_THIS_VOLATILE if
3759 a warning was emitted.
3761 2021-02-05 Marek Polacek <polacek@redhat.com>
3764 * name-lookup.c (lookup_using_decl): Hoist the destructor check.
3766 2021-02-05 Jakub Jelinek <jakub@redhat.com>
3769 * decl.c (check_array_initializer): For structured bindings, require
3770 the array type to be complete.
3772 2021-02-04 Jason Merrill <jason@redhat.com>
3775 * constraint.cc (build_concept_check_arguments): Remove assert.
3776 (build_concept_check): Allow empty args.
3778 2021-02-04 Tom Greenslade (thomgree) <thomgree@cisco.com>
3781 * call.c (can_convert_array): Extend to handle all valid aggregate
3782 initializers of an array; including by string literals, not just by
3784 (build_aggr_conv): Call can_convert_array more often, not just in
3785 brace-init-list case.
3786 * typeck2.c (array_string_literal_compatible_p): New function.
3787 (digest_init_r): call array_string_literal_compatible_p
3788 * cp-tree.h: (array_string_literal_compatible_p): Declare.
3790 2021-02-04 Jason Merrill <jason@redhat.com>
3793 * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
3795 2021-02-04 Jason Merrill <jason@redhat.com>
3798 * pt.c (tsubst_attribute): Handle error.
3799 (apply_late_template_attributes): Return false on error.
3800 (tsubst_function_decl): Check its return value.
3801 (tsubst_decl): Likewise.
3802 (push_template_decl): Assert current_template_parms.
3803 (tsubst_template_decl): Set current_template_parms.
3805 2021-02-03 Marek Polacek <polacek@redhat.com>
3808 * call.c (struct z_candidate): Mark rewritten and reversed as const.
3809 (struct NonPublicField): Mark operator() as const.
3810 (struct NonTrivialField): Likewise.
3812 2021-02-03 Jason Merrill <jason@redhat.com>
3816 * pt.c (spec_hasher::equal): Set processing_template_decl.
3817 * Make-lang.in (check-g++-strict-gc): Add --param
3818 hash-table-verification-limit=10000.
3820 2021-02-03 Marek Polacek <polacek@redhat.com>
3823 * parser.c (cp_parser_class_specifier_1): Use any possible
3824 DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
3825 (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
3826 * pt.c (tsubst_exception_specification): Stash new_specs into
3827 DEFPARSE_INSTANTIATIONS.
3828 * tree.c (fixup_deferred_exception_variants): Use
3829 UNPARSED_NOEXCEPT_SPEC_P.
3831 2021-02-02 Jason Merrill <jason@redhat.com>
3835 * error.c (dump_expr): Ignore dummy object.
3836 * pt.c (tsubst_baselink): Handle dependent scope.
3838 2021-02-01 Patrick Palka <ppalka@redhat.com>
3841 * constexpr.c (cxx_eval_array_reference): Also set
3842 new_ctx.object when setting new_ctx.ctor.
3844 2021-02-01 Marek Polacek <polacek@redhat.com>
3847 * parser.c (cp_parser_has_attribute_expression): Use
3848 uses_template_parms instead of type_dependent_expression_p.
3850 2021-02-01 Jason Merrill <jason@redhat.com>
3853 * cp-tree.h: Declare it.
3854 * pt.c (comparing_dependent_aliases): New flag.
3855 (template_args_equal, spec_hasher::equal): Set it.
3856 (dependent_alias_template_spec_p): Assert that we don't
3857 get non-types other than error_mark_node.
3858 (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
3859 on complex alias specializations. Set TYPE_DEPENDENT_P here.
3860 (tsubst_decl): Not here.
3861 * module.cc (module_state::read_cluster): Set
3862 comparing_dependent_aliases instead of
3863 comparing_specializations.
3864 * tree.c (cp_tree_equal): Remove comparing_specializations
3866 * typeck.c (structural_comptypes): Adjust.
3867 (comptypes): Remove comparing_specializations handling.
3869 2021-01-29 Nathan Sidwell <nathan@acm.org>
3872 * module.cc (module_state_config): Add num_entities field.
3873 (module_state::read_entities): The entity_ary span is
3875 (module_state::write_config): Write num_entities.
3876 (module_state::read_config): Read num_entities.
3877 (module_state::write): Set config's num_entities.
3878 (module_state::read_initial): Allocate the entity ary
3880 (module_state::read_language): Do not set entity_lwm
3883 2021-01-29 Marek Polacek <polacek@redhat.com>
3886 * parser.c (cp_parser_class_name): If parser->scope is
3887 error_mark_node, return it, otherwise continue.
3889 2021-01-28 Jakub Jelinek <jakub@redhat.com>
3892 * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
3894 2021-01-28 Jakub Jelinek <jakub@redhat.com>
3898 * decl.c (cp_finish_decl): For register vars with asmspec in templates
3899 call set_user_assembler_name and set DECL_HARD_REGISTER.
3900 * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
3901 pass asmspec_tree to cp_finish_decl.
3903 2021-01-28 Nathan Sidwell <nathan@acm.org>
3906 * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
3908 (trees_in::decl_value): Do typedef frobbing only when installing
3909 a new typedef, adjust is_matching_decl call. Swap is_typedef
3911 (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
3912 names and deal with typedef checking.
3914 2021-01-27 Jason Merrill <jason@redhat.com>
3917 * name-lookup.c (lookup_using_decl): Clean up handling
3918 of dependency and inherited constructors.
3919 (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
3920 * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
3922 2021-01-26 Jason Merrill <jason@redhat.com>
3925 * call.c (type_passed_as): Don't mark invisiref restrict.
3927 2021-01-26 Jason Merrill <jason@redhat.com>
3931 * class.c (layout_class_type): An empty field gets size 0.
3932 (is_empty_field): New.
3933 (check_bases): Check it.
3934 * cp-tree.h (is_empty_field): Declare it.
3935 * constexpr.c (cxx_eval_store_expression): Check it.
3936 (cx_check_missing_mem_inits): Likewise.
3937 * init.c (perform_member_init): Likewise.
3938 * typeck2.c (process_init_constructor_record): Likewise.
3940 2021-01-25 Martin Sebor <msebor@redhat.com>
3943 * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
3945 2021-01-25 Jason Merrill <jason@redhat.com>
3948 * constexpr.c (get_or_insert_ctor_field): Add check.
3949 (cxx_eval_store_expression): Handle discontinuity of refs.
3951 2021-01-23 Anthony Sharp <anthonysharp15@gmail.com>
3953 * call.c (complain_about_access): Altered function.
3954 * cp-tree.h (complain_about_access): Changed parameters of function.
3955 (get_parent_with_private_access): Declared new function.
3956 * search.c (get_parent_with_private_access): Defined new function.
3957 * semantics.c (enforce_access): Modified function.
3958 * typeck.c (complain_about_unrecognized_member): Updated function
3959 arguments in complain_about_access.
3961 2021-01-23 Patrick Palka <ppalka@redhat.com>
3964 * cp-tree.h (shared_member_p): Adjust declaration.
3965 * parser.c (cp_parser_init_declarator): If the storage class
3966 specifier is sc_static, pass true for static_p to
3967 cp_parser_declarator.
3968 (cp_parser_direct_declarator): Don't do inject_this_parm when
3969 the declarator is a friend.
3970 * search.c (shared_member_p): Change return type to bool and
3971 adjust function body accordingly. Return false for a dependent
3972 USING_DECL instead of aborting.
3973 * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
3974 even when type-dependent.
3976 2021-01-22 Marek Polacek <polacek@redhat.com>
3979 * parser.c (inject_parm_decls): Remove a redundant assignment.
3980 (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
3981 before calling inject_parm_decls.
3983 2021-01-22 Jason Merrill <jason@redhat.com>
3986 * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
3988 2021-01-22 Jakub Jelinek <jakub@redhat.com>
3991 * init.c (build_zero_init_1): Revert the 2018-03-06 change to
3992 return build_zero_cst for reference types.
3993 * typeck2.c (process_init_constructor_record): Instead call
3994 build_zero_cst here during error recovery instead of build_zero_init.
3996 2021-01-22 Marek Polacek <polacek@redhat.com>
3999 * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
4000 warnings regardless of abi_version_at_least.
4001 (write_expression): When the expression is a dependent name
4002 and an operator name, write "on" before writing its name.
4004 2021-01-22 Marek Polacek <polacek@redhat.com>
4007 * pt.c (instantiate_class_template_1): Instantiate members
4008 marked with attribute used only after we're done instantiating
4011 2021-01-21 Patrick Palka <ppalka@redhat.com>
4014 * semantics.c (finish_decltype_type): Set up a cp_unevaluated
4015 sentinel at the start of the function. Remove a now-redundant
4016 manual adjustment of cp_unevaluated_operand.
4018 2021-01-21 Nathan Sidwell <nathan@acm.org>
4021 * module.cc (depset::hash::find_dependencies): Add
4023 (trees_out::core_vals): Check state before calling
4025 (sort_cluster, module_state::write): Adjust
4026 find_dependencies call.
4028 2021-01-21 Jakub Jelinek <jakub@redhat.com>
4031 * constexpr.c (check_for_return_continue_data): Add break_stmt member.
4032 (check_for_return_continue): Also look for BREAK_STMT. Handle
4033 SWITCH_STMT by ignoring break_stmt from its body.
4034 (potential_constant_expression_1) <case FOR_STMT>,
4035 <case WHILE_STMT>: If the condition isn't constant true, check if
4036 the loop body can contain a return stmt.
4037 <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
4038 <case IF_STMT>: If recursion with tf_none is successful,
4039 merge *jump_target from the branches - returns with highest priority,
4040 breaks or continues lower. If then branch is potentially constant and
4041 doesn't return, check the else branch if it could return, break or
4044 2021-01-21 Nathan Sidwell <nathan@acm.org>
4047 * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
4049 2021-01-20 Nathan Sidwell <nathan@acm.org>
4051 * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
4054 2021-01-20 Patrick Palka <ppalka@redhat.com>
4057 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
4058 CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
4059 adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
4061 2021-01-20 Patrick Palka <ppalka@redhat.com>
4064 * parser.c (cp_parser_class_head): Defer access checking when
4065 parsing the base-clause until all bases are seen and attached
4067 * pt.c (instantiate_class_template): Likewise when substituting
4068 into dependent bases.
4070 2021-01-20 Jakub Jelinek <jakub@redhat.com>
4073 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
4074 error_operand_p, remove clause without further checking. Check
4075 for non-NULL TYPE_NAME.
4077 2021-01-19 Marek Polacek <polacek@redhat.com>
4080 * pt.c (maybe_instantiate_noexcept): Return false if FN is
4083 2021-01-19 Marek Polacek <polacek@redhat.com>
4086 * name-lookup.c (push_using_decl_bindings): New, broken out of...
4087 (finish_nonmember_using_decl): ...here.
4088 * name-lookup.h (push_using_decl_bindings): Update declaration.
4089 * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
4091 2021-01-19 Patrick Palka <ppalka@redhat.com>
4095 * search.c (friend_accessible_p): If scope is a hidden friend
4096 defined inside a dependent class, consider access from the
4098 * parser.c (cp_parser_late_parsing_for_member): Don't push a
4099 dk_no_check access state.
4101 2021-01-19 Marek Polacek <polacek@redhat.com>
4104 * parser.c (cp_parser_class_specifier_1): Perform late-parsing
4105 of NSDMIs before late-parsing of noexcept-specifiers.
4107 2021-01-19 Nathan Sidwell <nathan@acm.org>
4109 * module.cc (identifier): Merge overloads.
4111 2021-01-19 Nathan Sidwell <nathan@acm.org>
4114 * module.cc (trees_out::write_location): Make static.
4116 2021-01-16 Kwok Cheung Yeung <kcy@codesourcery.com>
4118 * parser.c (cp_parser_omp_clause_detach): New.
4119 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
4120 (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
4121 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4122 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4123 Prevent use of detach with mergeable and overriding the data sharing
4124 mode of the event handle.
4126 2021-01-15 Nathan Sidwell <nathan@acm.org>
4129 * tree.c (cp_build_qualified_type_real): Propagate an array's
4130 dependentness to the copy, if known.
4132 2021-01-15 Jason Merrill <jason@redhat.com>
4135 * call.c (unsafe_return_slot_p): Return int.
4136 (init_by_return_slot_p): Split out from...
4137 (unsafe_copy_elision_p): ...here.
4138 (unsafe_copy_elision_p_opt): New name for old meaning.
4139 (build_over_call): Adjust.
4140 (make_safe_copy_elision): New.
4141 * typeck2.c (split_nonconstant_init_1): Elide copy from safe
4142 list-initialization.
4143 * cp-tree.h: Adjust.
4145 2021-01-15 Jason Merrill <jason@redhat.com>
4147 * call.c (base_ctor_for, make_base_init_ok): New.
4148 (build_over_call): Use make_base_init_ok.
4150 2021-01-15 Jason Merrill <jason@redhat.com>
4153 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
4154 if we got a CONSTRUCTOR.
4156 2021-01-15 Nathan Sidwell <nathan@acm.org>
4159 * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
4161 2021-01-14 Jason Merrill <jason@redhat.com>
4163 * typeck2.c (process_init_constructor_record): Use fldtype
4164 variable consistently.
4166 2021-01-14 Nathan Sidwell <nathan@acm.org>
4169 * tree.c (cp_tree_equal): Correct map_context logic.
4171 2021-01-13 Marek Polacek <polacek@redhat.com>
4174 * name-lookup.c (push_using_decl_bindings): New.
4175 * name-lookup.h (push_using_decl_bindings): Declare.
4176 * pt.c (tsubst_expr): Call push_using_decl_bindings.
4178 2021-01-13 Nathan Sidwell <nathan@acm.org>
4181 * module.cc (module_add_import_initializers): Pass a
4182 zero-element argument vector.
4184 2021-01-12 Patrick Palka <ppalka@redhat.com>
4187 * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
4188 the template of a CTAD placeholder.
4190 2021-01-12 Marek Polacek <polacek@redhat.com>
4193 * typeck2.c (process_init_constructor_record): Don't emit
4194 -Wmissing-field-initializers warnings in unevaluated contexts.
4196 2021-01-11 Jakub Jelinek <jakub@redhat.com>
4199 * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
4201 (mark_abi_tags_r): Likewise.
4202 * decl2.c (min_vis_r): Likewise.
4203 * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
4206 2021-01-08 Patrick Palka <ppalka@redhat.com>
4209 * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
4210 instead of AGGREGATE_TYPE_P before calling replace_result_decl.
4212 2021-01-08 Patrick Palka <ppalka@redhat.com>
4215 * semantics.c (check_accessibility_of_qualified_id): Punt if
4216 we're checking access of a scoped non-static member inside a
4219 2021-01-07 Jakub Jelinek <jakub@redhat.com>
4222 * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
4223 cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
4225 (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
4227 2021-01-07 Marek Polacek <polacek@redhat.com>
4230 * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
4231 !late_return_type block.
4233 2021-01-07 Jason Merrill <jason@redhat.com>
4235 * constexpr.c (cxx_bind_parameters_in_call): Add comment.
4236 (cxx_eval_store_expression): Add comment.
4238 2021-01-07 Jason Merrill <jason@redhat.com>
4240 * call.c (has_next): Factor out from...
4241 (next_conversion): ...here.
4242 (strip_standard_conversion): And here.
4243 (is_subseq): And here.
4244 (build_conv): Check it.
4245 (standard_conversion): Don't call build_conv
4248 2021-01-06 Martin Sebor <msebor@redhat.com>
4251 * error.c (dump_expr): Call c_pretty_printer::unary_expression.
4253 2021-01-05 Patrick Palka <ppalka@redhat.com>
4255 * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
4256 the type of the NTTP, substitute into the type again. If the
4257 type is still dependent, don't unify the NTTP.
4259 2021-01-05 Jakub Jelinek <jakub@redhat.com>
4261 * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
4262 $(CODYLIB) after $(BACKEND).
4264 2021-01-05 Jakub Jelinek <jakub@redhat.com>
4267 * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
4268 Punt if lval is true.
4269 * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
4270 the result if it has a class type.
4272 2021-01-05 Marek Polacek <polacek@redhat.com>
4275 * pt.c (resolve_overloaded_unification): Call
4276 maybe_instantiate_noexcept after instantiating the function
4279 2021-01-05 Nathan Sidwell <nathan@acm.org>
4281 * parser.c (cp_parser_module_declaration): Alter diagnostic
4282 text to say where is permissable.
4284 2021-01-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4287 * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
4289 2021-01-02 Jan Hubicka <jh@suse.cz>
4291 * cp-tree.h (cp_tree_c_finish_parsing): Declare.
4292 * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
4293 * tree.c (cp_tree_c_finish_parsing): New function.
4295 2021-01-01 Jakub Jelinek <jakub@redhat.com>
4297 * ChangeLog-2020: Rotate ChangeLog. New file.
4300 Copyright (C) 2021 Free Software Foundation, Inc.
4302 Copying and distribution of this file, with or without modification,
4303 are permitted in any medium without royalty provided the copyright
4304 notice and this notice are preserved.