]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/cp/ChangeLog
Daily bump.
[thirdparty/gcc.git] / gcc / cp / ChangeLog
1 2021-09-22 Patrick Palka <ppalka@redhat.com>
2
3 DR 2446
4 PR c++/102412
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.
12
13 2021-09-22 Jakub Jelinek <jakub@redhat.com>
14
15 * parser.c (cp_parser_omp_clause_allocate): Parse allocate clause
16 modifiers.
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.
21
22 2021-09-22 Barrett Adair <barrettellisadair@gmail.com>
23
24 * pt.c (find_parm_usage_r): New walk_tree callback to find func
25 parms.
26 (any_template_arguments_need_structural_equality_p): New special
27 case.
28
29 2021-09-21 wangpc <pc.wang@linux.alibaba.com>
30
31 * decl.c (start_decl_1): Move verify_type_context to ...
32 (cp_finish_decl): ... to here.
33
34 2021-09-18 Jakub Jelinek <jakub@redhat.com>
35
36 * parser.c (cp_parser_omp_clause_order): Parse unconstrained
37 and reproducible modifiers.
38 (OMP_DISTRIBUTE_CLAUSE_MASK): Add order clause.
39
40 2021-09-18 Jakub Jelinek <jakub@redhat.com>
41
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.
45
46 2021-09-18 Jason Merrill <jason@redhat.com>
47
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.
55
56 2021-09-18 Jason Merrill <jason@redhat.com>
57
58 * cp-tree.h: Fix typo in LANG_FLAG list.
59
60 2021-09-17 Jakub Jelinek <jakub@redhat.com>
61
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
65 weak clauses.
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.
70
71 2021-09-16 Patrick Palka <ppalka@redhat.com>
72
73 PR c++/98486
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
77 member template.
78 * pt.c (determine_specialization): Check constraints on a
79 variable template.
80
81 2021-09-16 Iain Sandoe <iain@sandoe.co.uk>
82
83 * coroutines.cc (await_statement_walker): Code cleanups.
84
85 2021-09-16 Jason Merrill <jason@redhat.com>
86
87 * constexpr.c (cxx_eval_outermost_constant_expr): Use
88 protected_set_expr_location.
89
90 2021-09-15 Patrick Palka <ppalka@redhat.com>
91
92 PR c++/101904
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.
96
97 2021-09-15 Jason Merrill <jason@redhat.com>
98
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.
103
104 2021-09-15 Jakub Jelinek <jakub@redhat.com>
105
106 PR c++/88578
107 PR c++/102295
108 * typeck2.c (split_nonconstant_init_1): Don't throw away empty
109 initializers of flexible array members if they have non-zero type
110 size.
111
112 2021-09-15 Patrick Palka <ppalka@redhat.com>
113
114 PR c++/102050
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.
118
119 2021-09-15 Jason Merrill <jason@redhat.com>
120
121 * decl.c (cxx_init_decl_processing): Only warn about odd
122 interference sizes if they were specified with --param.
123
124 2021-09-15 Jason Merrill <jason@redhat.com>
125
126 PR c++/48396
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.
135
136 2021-09-15 Jason Merrill <jason@redhat.com>
137
138 * parser.c (cp_parser_template_name): Move object type.
139 (cp_parser_pre_parsed_nested_name_specifier): Likewise.
140
141 2021-09-15 Jason Merrill <jason@redhat.com>
142
143 * parser.c (cp_parser_unqualified_id): Only complain about ~A<T> in
144 a declarator.
145
146 2021-09-14 Iain Sandoe <iain@sandoe.co.uk>
147
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.
156
157 2021-09-14 Iain Sandoe <iain@sandoe.co.uk>
158
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.
177
178 2021-09-14 Patrick Palka <ppalka@redhat.com>
179
180 PR c++/102163
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.
184
185 2021-09-14 Jakub Jelinek <jakub@redhat.com>
186
187 PR c++/102295
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.
191
192 2021-09-14 Jakub Jelinek <jakub@redhat.com>
193
194 PR c++/102305
195 * method.c (is_xible_helper): Call complete_type on to.
196
197 2021-09-14 Jason Merrill <jason@redhat.com>
198
199 * decl.c (cxx_init_decl_processing): Don't warn if L1 cache line
200 size is smaller than maxalign.
201
202 2021-09-13 Jason Merrill <jason@redhat.com>
203
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.
209
210 2021-09-13 Patrick Palka <ppalka@redhat.com>
211
212 PR c++/101764
213 * cp-tree.h (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): New accessor
214 macro.
215 * pt.c (has_extra_args_mechanism_p): New function.
216 (find_parameter_pack_data::found_extra_args_tree_p): New data
217 member.
218 (find_parameter_packs_r): Set ppd->found_extra_args_tree_p
219 appropriately.
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.
226
227 2021-09-10 Jakub Jelinek <jakub@redhat.com>
228
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.
232
233 2021-09-08 Richard Biener <rguenther@suse.de>
234
235 PR c++/102228
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
240 access.
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.
247
248 2021-09-07 Jakub Jelinek <jakub@redhat.com>
249
250 PR c++/100495
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
254 deleting dtors.
255
256 2021-09-07 Marcel Vollweiler <marcel@codesourcery.com>
257
258 * parser.c (cp_parser_omp_flush): Parse 'seq_cst' clause on 'flush'
259 directive.
260 * semantics.c (finish_omp_flush): Handle MEMMODEL_SEQ_CST.
261
262 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
263
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.
267
268 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
269
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.
275
276 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
277
278 * coroutines.cc (transform_local_var_uses): Record
279 frame offset expressions as DECL_VALUE_EXPRs instead of
280 rewriting them.
281
282 2021-09-03 Patrick Palka <ppalka@redhat.com>
283
284 PR c++/101904
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.
303
304 2021-09-03 Jason Merrill <jason@redhat.com>
305
306 * pt.c (limit_bad_template_recursion): Suppress -Wunused for decls
307 we decide not to instantiate.
308
309 2021-09-03 Jakub Jelinek <jakub@redhat.com>
310
311 PR target/102024
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.
317
318 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
319
320 * call.c (build_over_call): Handle unavailable state in addition to
321 deprecation.
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
333 templates.
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.
346
347 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
348
349 * coroutines.cc (build_actor_fn): Add begin/finish clauses
350 to the initial test in the actor function.
351
352 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
353
354 * coroutines.cc (await_statement_walker): Use build_stmt and
355 add_stmt instead of build1 and finish_expr_stmt.
356
357 2021-08-31 Jason Merrill <jason@redhat.com>
358
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.
364
365 2021-08-31 Patrick Palka <ppalka@redhat.com>
366
367 PR c++/12672
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.
377
378 2021-08-31 Martin Sebor <msebor@redhat.com>
379
380 * parser.c (cp_parser_selection_statement): Use direct initialization
381 instead of copy.
382
383 2021-08-31 Jason Merrill <jason@redhat.com>
384
385 * constexpr.c (explain_invalid_constexpr_fn): Use iloc_sentinel.
386
387 2021-08-31 Jason Merrill <jason@redhat.com>
388
389 PR c++/92193
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.
393
394 2021-08-31 Marcel Vollweiler <marcel@codesourcery.com>
395
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.
400
401 2021-08-30 Jason Merrill <jason@redhat.com>
402
403 PR c++/96286
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.
408
409 2021-08-30 Jason Merrill <jason@redhat.com>
410
411 * constexpr.c (cxx_eval_outermost_constant_expr): Copy
412 expr location to result.
413
414 2021-08-30 Jason Merrill <jason@redhat.com>
415
416 PR c++/101460
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.
422
423 2021-08-30 Jason Merrill <jason@redhat.com>
424
425 * parser.c (cp_parser_simple_requirement): Warn about missing
426 requires.
427
428 2021-08-27 Jason Merrill <jason@redhat.com>
429
430 * typeck2.c (build_x_arrow): Do set TREE_TYPE when operand is
431 a dependent pointer.
432
433 2021-08-25 Andrew Pinski <apinski@marvell.com>
434
435 PR c++/66590
436 * cp-objcp-common.c (cxx_block_may_fallthru): Handle
437 CLEANUP_STMT for the case which will be try/finally.
438
439 2021-08-25 Jakub Jelinek <jakub@redhat.com>
440
441 PR c++/102019
442 * init.c (build_value_init_noctor): Ignore unnamed zero-width
443 bitfields.
444
445 2021-08-23 Jakub Jelinek <jakub@redhat.com>
446
447 * parser.c (cp_parser_omp_clause_num_tasks,
448 cp_parser_omp_clause_grainsize): Parse the optional strict: modifier.
449
450 2021-08-20 Jakub Jelinek <jakub@redhat.com>
451
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.
456
457 2021-08-20 Jakub Jelinek <jakub@redhat.com>
458
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.
462
463 2021-08-19 Patrick Palka <ppalka@redhat.com>
464
465 PR c++/101803
466 * cp-tree.h (CONSTRUCTOR_IS_PAREN_INIT): Clarify comment.
467
468 2021-08-19 Jakub Jelinek <jakub@redhat.com>
469
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.
473
474 2021-08-19 Jakub Jelinek <jakub@redhat.com>
475
476 * parser.c (cp_parser_omp_nothing): Use cp_parser_require_pragma_eol
477 instead of cp_parser_skip_to_pragma_eol.
478
479 2021-08-18 Patrick Palka <ppalka@redhat.com>
480
481 PR c++/101344
482 PR c++/101803
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.
487
488 2021-08-18 Patrick Palka <ppalka@redhat.com>
489
490 PR c++/101883
491 * pt.c (convert_template_argument): Pass LOOKUP_IMPLICIT to
492 do_auto_deduction.
493
494 2021-08-18 Jakub Jelinek <jakub@redhat.com>
495
496 * parser.c (cp_parser_omp_nothing): New function.
497 (cp_parser_pragma): Handle PRAGMA_OMP_NOTHING.
498
499 2021-08-18 Jakub Jelinek <jakub@redhat.com>
500
501 * parser.c (cp_parser_omp_ordered): Return true instead of
502 false after emitting errors that the directive is not allowed in
503 pragma_stmt context.
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
507 contexts.
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
516 pragma_stmt context.
517
518 2021-08-17 Jakub Jelinek <jakub@redhat.com>
519
520 PR c++/101539
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):
537 New functions.
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):
541 New functions.
542 * cp-gimplify.c (cp_gimplify_expr): Fold
543 CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
544 (cp_fold): Likewise.
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.
551
552 2021-08-17 Jakub Jelinek <jakub@redhat.com>
553
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.
558
559 2021-08-12 Jakub Jelinek <jakub@redhat.com>
560
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.
571
572 2021-08-12 Sergei Trofimovich <siarheit@google.com>
573
574 PR c++/101219
575 * pt.c (tsubst_copy_and_build): Use build_ptrmemfunc_access_expr
576 to construct ptrmemfunc expression instantiation.
577
578 2021-08-12 Tobias Burnus <tobias@codesourcery.com>
579
580 * parser.c (cp_parser_omp_clause_proc_bind): Accept
581 'primary' as alias for 'master'.
582
583 2021-08-12 Jakub Jelinek <jakub@redhat.com>
584
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
591 the vector.
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.
600
601 2021-08-12 Jakub Jelinek <jakub@redhat.com>
602
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.
612
613 2021-08-12 Jakub Jelinek <jakub@redhat.com>
614
615 PR c++/94162
616 * method.c (cat_tag_for): Return cc_last for !CLASS_TYPE_P
617 or for classes not in std namespace.
618
619 2021-08-12 Jakub Jelinek <jakub@redhat.com>
620
621 * name-lookup.c (finish_using_directive): Diagnose omp::directive
622 or omp::sequence attributes on using-directive.
623
624 2021-08-12 Jakub Jelinek <jakub@redhat.com>
625
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
631 at the end.
632
633 2021-08-12 Patrick Palka <ppalka@redhat.com>
634
635 PR c++/101663
636 * constexpr.c (cxx_eval_store_expression): Handle the lval=true
637 case in the early exit code path for empty stores with mismatched
638 types.
639
640 2021-08-11 Patrick Palka <ppalka@redhat.com>
641
642 PR c++/101725
643 DR 2082
644 * cp-tree.h (unevaluated_p): Return true for REQUIRES_EXPR.
645 * decl.c (local_variable_p_walkfn): Don't walk into unevaluated
646 operands.
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.
653
654 2021-08-11 Jakub Jelinek <jakub@redhat.com>
655
656 PR c++/101786
657 * decl2.c (var_defined_without_dynamic_init): Return true for
658 DECL_DECLARED_CONSTINIT_P with complete type and trivial destructor.
659
660 2021-08-11 Patrick Palka <ppalka@redhat.com>
661
662 PR c++/79501
663 * parser.c (maybe_adjust_declarator_for_dguide): New, split
664 out from ...
665 (cp_parser_init_declarator): ... here.
666 (cp_parser_member_declaration): Use it.
667
668 2021-08-11 Patrick Palka <ppalka@redhat.com>
669
670 PR c++/89062
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.
676
677 2021-08-10 Jakub Jelinek <jakub@redhat.com>
678
679 * parser.c (cp_parser_member_declaration): Move odsd declaration
680 before cp_parser_using_declaration call to avoid errors with
681 GCC 4.8 to 6.
682
683 2021-08-10 Jakub Jelinek <jakub@redhat.com>
684
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
688 member.
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.
718
719 2021-08-06 Tamar Christina <tamar.christina@arm.com>
720
721 * cp-objcp-common.h (cxx_simulate_enum_decl): Pass vec<> by pointer.
722 * decl.c (cxx_simulate_enum_decl): Likewise.
723
724 2021-08-04 Jakub Jelinek <jakub@redhat.com>
725
726 PR c++/101759
727 * parser.c (cp_parser_default_argument): Temporarily override
728 parser->omp_declare_simd and parser->oacc_routine to NULL.
729
730 2021-08-02 Patrick Palka <ppalka@redhat.com>
731
732 PR c++/100828
733 * logic.cc (formula::formula): Use emplace_back instead of
734 push_back.
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
748 the next one.
749
750 2021-07-31 Jason Merrill <jason@redhat.com>
751
752 PR c++/96636
753 * decl.c (fixup_anonymous_aggr): Clear TYPE_NEEDS_CONSTRUCTING
754 after error.
755
756 2021-07-31 Jason Merrill <jason@redhat.com>
757
758 * ptree.c (cxx_print_type) [TYPE_PACK_EXPANSION]: Also print
759 PACK_EXPANSION_PATTERN.
760
761 2021-07-31 Jakub Jelinek <jakub@redhat.com>
762
763 * parser.c (cp_parser_declaration): Handle OpenMP directives
764 in attribute-declaration.
765
766 2021-07-30 Jakub Jelinek <jakub@redhat.com>
767
768 PR c++/101539
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.
792 (cp_fold): Likewise.
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.
798
799 2021-07-30 Jason Merrill <jason@redhat.com>
800
801 * class.c (finish_struct_anon): Improve comment.
802 * decl.c (fixup_anonymous_aggr): Reject anonymous struct
803 with bases.
804
805 2021-07-30 Jakub Jelinek <jakub@redhat.com>
806
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.
810
811 2021-07-30 Jakub Jelinek <jakub@redhat.com>
812
813 PR c++/101582
814 * parser.c (cp_parser_skip_std_attribute_spec_seq): Add a forward
815 declaration.
816 (cp_parser_declaration): Parse empty-declaration and
817 attribute-declaration.
818 (cp_parser_toplevel_declaration): Don't parse empty-declaration here.
819
820 2021-07-28 Martin Sebor <msebor@redhat.com>
821
822 * init.c: Include new header.
823
824 2021-07-27 Marek Polacek <polacek@redhat.com>
825
826 DR 1512
827 PR c++/99701
828 * cp-gimplify.c (cp_fold): Remove {LE,LT,GE,GT_EXPR} from
829 a switch.
830 * typeck.c (cp_build_binary_op): Reject ordered comparison
831 of two null pointers.
832
833 2021-07-26 Jakub Jelinek <jakub@redhat.com>
834
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
843 after scan.
844 (cp_parser_omp_sections_scope): Use cp_parser_omp_section_scan.
845
846 2021-07-23 Jakub Jelinek <jakub@redhat.com>
847
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.
861
862 2021-07-21 Thomas Schwinge <thomas@codesourcery.com>
863 Joseph Myers <joseph@codesourcery.com>
864 Cesar Philippidis <cesar@codesourcery.com>
865
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.
871
872 2021-07-21 Jakub Jelinek <jakub@redhat.com>
873
874 PR c++/101516
875 * semantics.c (finish_omp_reduction_clause): Also call
876 complete_type_or_else and return true if it fails.
877
878 2021-07-19 Iain Sandoe <iain@sandoe.co.uk>
879
880 PR c++/95520
881 * coroutines.cc (struct coroutine_info): Add fields for
882 actor and destroy function decls.
883 (to_ramp): New.
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
888 destroy functions.
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,
892 JOIN_STR): New.
893 * mangle.c (write_encoding): Handle coroutine helpers.
894 (write_unqualified_name): Handle lambda coroutine helpers.
895
896 2021-07-16 Patrick Palka <ppalka@redhat.com>
897
898 PR c++/101233
899 * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
900 substituting DECL_ARGUMENTS.
901
902 2021-07-16 Patrick Palka <ppalka@redhat.com>
903
904 DR 960
905 PR c++/99664
906 * search.c (check_final_overrider): Compare TYPE_REF_IS_RVALUE
907 when the return types are references.
908
909 2021-07-16 Marek Polacek <polacek@redhat.com>
910
911 * typeck2.c (check_narrowing): Don't suppress the pedantic error
912 in system headers.
913
914 2021-07-15 Jakub Jelinek <jakub@redhat.com>
915
916 PR c++/101443
917 * cp-gimplify.c (cp_fold): For comparisons with NULLPTR_TYPE
918 operands, fold them right away to true or false.
919
920 2021-07-15 Jason Merrill <jason@redhat.com>
921
922 PR c++/101095
923 * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
924 (cp_tree_size): Remove redundant entries.
925
926 2021-07-14 Patrick Palka <ppalka@redhat.com>
927
928 PR c++/88252
929 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): Remove.
930 * pt.c (push_template_decl): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
931 handling.
932 (redeclare_class_template): Likewise.
933 (forwarding_reference_p): Define.
934 (maybe_adjust_types_for_deduction): Use it instead. Add 'tparms'
935 parameter.
936 (unify_one_argument): Pass tparms to
937 maybe_adjust_types_for_deduction.
938 (try_one_overload): Likewise.
939 (unify): Likewise.
940 (rewrite_template_parm): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
941 handling.
942
943 2021-07-14 Jason Merrill <jason@redhat.com>
944
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
951 auto_delete_vec.
952 * semantics.c (omp_reduction_lookup): Use auto_vec.
953
954 2021-07-14 Marek Polacek <polacek@redhat.com>
955
956 PR c++/101371
957 * constexpr.c (cxx_eval_array_reference): Create a new .object
958 and .ctor for the non-aggregate non-scalar case too when
959 value-initializing.
960
961 2021-07-12 Patrick Palka <ppalka@redhat.com>
962
963 PR c++/79501
964 PR c++/100983
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)
970 deduction guides.
971
972 2021-07-10 Patrick Palka <ppalka@redhat.com>
973
974 PR c++/82110
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.
980
981 2021-07-09 Jason Merrill <jason@redhat.com>
982
983 PR c++/101098
984 * decl.c (function_requirements_equivalent_p): Only compare
985 trailing requirements on a specialization.
986
987 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
988
989 * coroutines.cc (build_actor_fn): Move common code to
990 act_des_fn.
991 (build_destroy_fn): Likewise.
992 (act_des_fn): Build the void return here. Ensure that the
993 source location matches the original function.
994
995 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
996
997 * coroutines.cc
998 (coro_rewrite_function_body): Connect the replacement
999 function block to the block nest correctly.
1000
1001 2021-07-09 Patrick Palka <ppalka@redhat.com>
1002
1003 PR c++/101181
1004 * constraint.cc (tsubst_requires_expr): Pass complain/in_decl to
1005 add_extra_args.
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
1010 dependent.
1011 (tsubst_pack_expansion): Pass complain/in_decl to
1012 add_extra_args.
1013 (tsubst_template_args): Handle missing template arguments.
1014 (tsubst_expr) <case IF_STMT>: Pass complain/in_decl to
1015 add_extra_args.
1016
1017 2021-07-09 Patrick Palka <ppalka@redhat.com>
1018
1019 PR c++/101247
1020 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Just walk the
1021 DECL_CONTEXT.
1022
1023 2021-07-08 Martin Sebor <msebor@redhat.com>
1024
1025 PR bootstrap/101372
1026 * module.cc (identifier): Suppress warning.
1027 (module_state::read_macro_maps): Remove warning suppression.
1028 (module_state::install_macros): Ditto.
1029
1030 2021-07-08 Marek Polacek <polacek@redhat.com>
1031
1032 PR c++/101087
1033 * cp-tree.h (unevaluated_p): New.
1034 * except.c (check_noexcept_r): Use it. Don't walk into
1035 unevaluated operands.
1036
1037 2021-07-08 Martin Sebor <msebor@redhat.com>
1038
1039 PR bootstrap/101374
1040 * module.cc (module_state::read_macro_maps): Temporarily disable
1041 -Warray-bounds.
1042 (module_state::install_macros): Same.
1043
1044 2021-07-06 Martin Sebor <msebor@redhat.com>
1045
1046 * error.c (cp_printer): Remove support for %G and %K.
1047
1048 2021-07-02 Jakub Jelinek <jakub@redhat.com>
1049
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
1062 functions.
1063 (cp_parser_std_attribute): Handle omp::directive and omp::sequence
1064 attributes.
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
1084 omp_identifier.
1085 * decl2.c (cplus_decl_attributes): Reject omp::directive and
1086 omp::sequence attributes.
1087
1088 2021-07-02 Jakub Jelinek <jakub@redhat.com>
1089
1090 PR c/101297
1091 * parser.c (cp_parser_omp_atomic): Consume comma only if it
1092 appears before a CPP_NAME.
1093
1094 2021-07-02 Patrick Palka <ppalka@redhat.com>
1095
1096 PR c++/101247
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.
1100
1101 2021-07-01 Patrick Palka <ppalka@redhat.com>
1102
1103 PR c++/101194
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
1107 initialization.
1108
1109 2021-07-01 Patrick Palka <ppalka@redhat.com>
1110
1111 PR c++/96204
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
1122 immediately.
1123 (instantiate_decl): Just pass the VAR_DECL to
1124 most_specialized_partial_spec.
1125
1126 2021-06-30 Patrick Palka <ppalka@redhat.com>
1127
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.
1135
1136 2021-06-30 Marek Polacek <polacek@redhat.com>
1137
1138 PR c++/100975
1139 DR 2397
1140 * decl.c (create_array_type_for_decl): Allow array of auto.
1141
1142 2021-06-29 Jason Merrill <jason@redhat.com>
1143
1144 * pt.c (instantiate_decl): Only consider partial specializations of
1145 actual variable templates.
1146
1147 2021-06-26 Patrick Palka <ppalka@redhat.com>
1148
1149 PR c++/96204
1150 * pt.c (instantiate_class_template_1): Enter the scope of the
1151 type when calling most_specialized_partial_spec.
1152
1153 2021-06-26 Jason Merrill <jason@redhat.com>
1154
1155 PR c++/101040
1156 PR c++/97566
1157 * class.c (is_empty_field): Handle null argument.
1158 * constexpr.c (cxx_eval_bare_aggregate): Discard initializer
1159 for empty field.
1160
1161 2021-06-26 Marek Polacek <polacek@redhat.com>
1162
1163 PR c++/100752
1164 * parser.c (cp_parser_declarator): Pass flags down to
1165 cp_parser_declarator. Also pass static_p/member_p.
1166
1167 2021-06-25 Martin Sebor <msebor@redhat.com>
1168
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.
1184 (cp_fold): 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.
1196 (build_new): 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.
1222
1223 2021-06-24 Patrick Palka <ppalka@redhat.com>
1224
1225 PR c++/98832
1226 * pt.c (maybe_aggr_guide): Handle alias templates appropriately.
1227
1228 2021-06-24 Patrick Palka <ppalka@redhat.com>
1229
1230 PR c++/101182
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.
1234
1235 2021-06-24 Jakub Jelinek <jakub@redhat.com>
1236
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.
1252
1253 2021-06-23 Patrick Palka <ppalka@redhat.com>
1254
1255 PR c++/101174
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.
1260
1261 2021-06-23 Patrick Palka <ppalka@redhat.com>
1262
1263 PR c++/86439
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.
1270
1271 2021-06-21 Patrick Palka <ppalka@redhat.com>
1272
1273 PR c++/67302
1274 * typeck.c (check_return_expr): Call maybe_undo_parenthesized_ref
1275 sooner, before the NRVO handling.
1276
1277 2021-06-21 Patrick Palka <ppalka@redhat.com>
1278
1279 PR c++/80431
1280 * tree.c (bot_replace): Use convert_to_base to build the
1281 conversion to the (morally) virtual base.
1282
1283 2021-06-21 Jakub Jelinek <jakub@redhat.com>
1284
1285 PR inline-asm/100785
1286 * typeck.c (cxx_mark_addressable): Diagnose trying to make
1287 bit-fields addressable.
1288
1289 2021-06-17 Jason Merrill <jason@redhat.com>
1290
1291 PR c++/101106
1292 * decl.c (duplicate_decls): Make 'deleted after first declaration'
1293 pedwarn on by default.
1294
1295 2021-06-17 Jason Merrill <jason@redhat.com>
1296
1297 PR c++/101029
1298 * init.c (build_vec_init): Preserve the type of base.
1299
1300 2021-06-16 Jason Merrill <jason@redhat.com>
1301
1302 PR c++/101078
1303 PR c++/91706
1304 * pt.c (tsubst_baselink): Update binfos in non-dependent case.
1305
1306 2021-06-15 Robin Dapp <rdapp@linux.ibm.com>
1307
1308 * decl.c (duplicate_decls): Likewise.
1309
1310 2021-06-14 Tobias Burnus <tobias@codesourcery.com>
1311
1312 PR c/100913
1313 * parser.c (cp_parser_omp_clause_affinity): No need to set iterator
1314 var in the error case.
1315
1316 2021-06-13 Trevor Saunders <tbsaunde@tbsaunde.org>
1317
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.
1326
1327 2021-06-12 Jason Merrill <jason@redhat.com>
1328
1329 PR c++/101029
1330 * init.c (build_vec_init): Shortcut [0] case.
1331
1332 2021-06-12 Jason Merrill <jason@redhat.com>
1333
1334 * pt.c (lookup_template_class_1): Shortcut current_class_type.
1335
1336 2021-06-11 Patrick Palka <ppalka@redhat.com>
1337
1338 DR 1227
1339 PR c++/96560
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.
1343
1344 2021-06-11 Jakub Jelinek <jakub@redhat.com>
1345
1346 PR c++/100974
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
1356 consteval if.
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
1365 as the else branch.
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
1372 in_consteval_if_p.
1373
1374 2021-06-11 Marek Polacek <polacek@redhat.com>
1375
1376 PR c++/100995
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.
1382
1383 2021-06-10 Patrick Palka <ppalka@redhat.com>
1384
1385 PR c++/67829
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.
1390
1391 2021-06-10 Patrick Palka <ppalka@redhat.com>
1392
1393 PR c++/100946
1394 * constraint.cc (normalize_placeholder_type_constraints): When
1395 normalizing a non-templated return-type-requirement, add a dummy
1396 level to initial_parms.
1397
1398 2021-06-08 Marek Polacek <polacek@redhat.com>
1399
1400 PR c++/100065
1401 * decl.c (grokdeclarator): Store a value-dependent
1402 explicit-specifier even for deduction guides.
1403
1404 2021-06-08 Jason Merrill <jason@redhat.com>
1405
1406 * parser.c (cp_parser_string_literal): Adjust diagnostic.
1407
1408 2021-06-08 Jason Merrill <jason@redhat.com>
1409
1410 PR c++/100963
1411 * call.c (perfect_conversion_p): Check check_narrowing.
1412
1413 2021-06-08 Jason Merrill <jason@redhat.com>
1414
1415 PR c++/91706
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
1420 modifying it.
1421
1422 2021-06-08 Jason Merrill <jason@redhat.com>
1423
1424 PR c++/91706
1425 * semantics.c (baselink_for_fns): Fix BASELINK_BINFO.
1426
1427 2021-06-08 Jason Merrill <jason@redhat.com>
1428
1429 * module.cc (duplicate_hash::hash): Comment out.
1430 (trees_in::tree_value): Adjust loop counter.
1431
1432 2021-06-08 Jason Merrill <jason@redhat.com>
1433
1434 PR c++/100102
1435 * init.c (build_offset_ref): Return the BASELINK for a static
1436 member function.
1437
1438 2021-06-07 Patrick Palka <ppalka@redhat.com>
1439
1440 PR c++/100918
1441 * parser.c (cp_parser_lookup_name): Check access of the lookup
1442 result before we potentially adjust an injected-class-name to
1443 its TEMPLATE_DECL.
1444
1445 2021-06-06 Jakub Jelinek <jakub@redhat.com>
1446
1447 PR c/100902
1448 * parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
1449 even when target is combined with other constructs.
1450
1451 2021-06-04 Patrick Palka <ppalka@redhat.com>
1452
1453 PR c++/100893
1454 * pt.c (convert_template_argument): Strip top-level cv-quals
1455 on the substituted type of a non-type template parameter.
1456
1457 2021-06-04 Patrick Palka <ppalka@redhat.com>
1458
1459 PR c++/100102
1460 * pt.c (tsubst_function_decl): Remove old code for reducing
1461 args when it has excess levels.
1462
1463 2021-06-04 Jakub Jelinek <jakub@redhat.com>
1464
1465 PR c++/100872
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
1468 to the start.
1469
1470 2021-06-03 Patrick Palka <ppalka@redhat.com>
1471
1472 PR c++/100592
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.
1476
1477 2021-06-03 Patrick Palka <ppalka@redhat.com>
1478
1479 PR c++/100862
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.
1487
1488 2021-06-03 Jakub Jelinek <jakub@redhat.com>
1489
1490 PR c++/100859
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
1497 assert.
1498 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_AFFINITY.
1499
1500 2021-06-02 Jason Merrill <jason@redhat.com>
1501
1502 PR c++/100838
1503 * call.c (convert_like_internal): Clear tf_no_cleanup when
1504 recursing.
1505 (build_user_type_conversion_1): Only add ck_rvalue if
1506 LOOKUP_ONLYCONVERTING.
1507
1508 2021-06-01 Patrick Palka <ppalka@redhat.com>
1509
1510 PR c++/65816
1511 * init.c (expand_aggr_init_1): Check
1512 type_has_non_user_provided_default_constructor instead of
1513 type_has_user_provided_constructor.
1514
1515 2021-06-01 Jason Merrill <jason@redhat.com>
1516
1517 PR c++/91859
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.
1521
1522 2021-06-01 Jason Merrill <jason@redhat.com>
1523
1524 PR c++/94492
1525 * decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
1526
1527 2021-05-31 Richard Biener <rguenther@suse.de>
1528
1529 PR c++/88601
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.
1539
1540 2021-05-28 Jason Merrill <jason@redhat.com>
1541
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.
1551
1552 2021-05-28 Jason Merrill <jason@redhat.com>
1553
1554 PR c++/100797
1555 PR c++/95719
1556 * call.c (build_over_call): Adjust base_binfo in
1557 resolves_to_fixed_type_p case.
1558
1559 2021-05-28 Jakub Jelinek <jakub@redhat.com>
1560
1561 PR middle-end/99928
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
1570 bitmaps.
1571
1572 2021-05-28 Tobias Burnus <tobias@codesourcery.com>
1573
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
1577 clause.
1578 * semantics.c (handle_omp_array_sections_1, handle_omp_array_sections,
1579 finish_omp_clauses): Likewise.
1580
1581 2021-05-27 Matthias Kretz <kretz@kde.org>
1582
1583 PR c++/100716
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.
1597
1598 2021-05-27 Matthias Kretz <kretz@kde.org>
1599
1600 PR c++/100763
1601 * error.c: Call dump_scope when printing a typedef.
1602
1603 2021-05-27 Patrick Palka <ppalka@redhat.com>
1604
1605 PR c++/99893
1606 * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
1607
1608 2021-05-27 Jason Merrill <jason@redhat.com>
1609
1610 PR c++/86355
1611 * pt.c (use_pack_expansion_extra_args_p): Don't compare
1612 args from the same argument pack.
1613
1614 2021-05-27 Patrick Palka <ppalka@redhat.com>
1615
1616 DR 1315
1617 PR c++/67593
1618 PR c++/96555
1619 * pt.c (process_partial_specialization): Don't error on a
1620 non-simple non-type template argument that involves template
1621 parameters.
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.
1624
1625 2021-05-26 Patrick Palka <ppalka@redhat.com>
1626
1627 PR c++/100502
1628 * typeck.c (finish_class_member_access_expr): Disable ahead
1629 of time access checking during the member lookup.
1630
1631 2021-05-26 Patrick Palka <ppalka@redhat.com>
1632
1633 PR c++/100368
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
1636 longer a caller.
1637 (bot_manip): Use force_target_expr instead of
1638 build_target_expr_with_type.
1639
1640 2021-05-26 Patrick Palka <ppalka@redhat.com>
1641
1642 PR c++/97420
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.
1648
1649 2021-05-25 Jakub Jelinek <jakub@redhat.com>
1650
1651 PR c++/100666
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.
1655
1656 2021-05-21 Jakub Jelinek <jakub@redhat.com>
1657
1658 PR middle-end/99928
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.
1663
1664 2021-05-20 Jason Merrill <jason@redhat.com>
1665
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.
1671
1672 2021-05-20 Jason Merrill <jason@redhat.com>
1673
1674 PR c++/100489
1675 * decl.c (reshape_init_class): Handle designator for
1676 member of anonymous aggregate here.
1677 * typeck2.c (process_init_constructor_record): Not here.
1678
1679 2021-05-20 Jonathan Wakely <jwakely@redhat.com>
1680
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.
1704
1705 2021-05-20 Jason Merrill <jason@redhat.com>
1706
1707 PR c++/100634
1708 * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
1709
1710 2021-05-20 Jason Merrill <jason@redhat.com>
1711
1712 PR c++/100659
1713 * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
1714
1715 2021-05-19 Jason Merrill <jason@redhat.com>
1716
1717 PR c++/100367
1718 PR c++/96299
1719 * method.c (genericize_spaceship): Use fold_build2 for scalar
1720 operands.
1721
1722 2021-05-19 Jason Merrill <jason@redhat.com>
1723
1724 * pt.c (build_deduction_guide): Treat the implicit deduction guide
1725 as a member of the class.
1726
1727 2021-05-19 Marek Polacek <polacek@redhat.com>
1728
1729 PR c++/100596
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.
1737
1738 2021-05-19 Martin Liska <mliska@suse.cz>
1739
1740 PR testsuite/100658
1741 * mangle.c (write_encoding): Fix typos.
1742
1743 2021-05-19 Jakub Jelinek <jakub@redhat.com>
1744
1745 PR middle-end/99928
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.
1750
1751 2021-05-19 Jason Merrill <jason@redhat.com>
1752
1753 PR c++/100261
1754 * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
1755
1756 2021-05-19 Jason Merrill <jason@redhat.com>
1757
1758 PR c++/100372
1759 * tree.c (strip_typedefs): Only look at the pattern of a
1760 TYPE_PACK_EXPANSION if it's a type.
1761
1762 2021-05-18 Marek Polacek <polacek@redhat.com>
1763
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.
1781
1782 2021-05-18 Jason Merrill <jason@redhat.com>
1783
1784 PR c++/100644
1785 * call.c (perfect_candidate_p): An implicitly deleted move
1786 is not perfect.
1787
1788 2021-05-18 Andreas Krebbel <krebbel@linux.ibm.com>
1789
1790 PR c++/100281
1791 * cvt.c (cp_convert_to_pointer): Use the size of the target
1792 pointer type.
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.
1800
1801 2021-05-17 Jonathan Wakely <jwakely@redhat.com>
1802
1803 PR c++/100635
1804 * call.c (convert_like_internal): Print different diagnostic if
1805 the lvalue reference is const.
1806
1807 2021-05-14 Jason Merrill <jason@redhat.com>
1808
1809 PR c++/95870
1810 * pt.c (enclosing_instantiation_of): Just compare
1811 DECL_SOURCE_LOCATION.
1812 (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
1813
1814 2021-05-14 Marek Polacek <polacek@redhat.com>
1815 Jason Merrill <jason@redhat.com>
1816
1817 PR c++/99032
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.
1827
1828 2021-05-12 Marek Polacek <polacek@redhat.com>
1829
1830 * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
1831 sentinel.
1832
1833 2021-05-12 Marcel Vollweiler <marcel@codesourcery.com>
1834
1835 * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
1836 'close'.
1837
1838 2021-05-11 Jason Merrill <jason@redhat.com>
1839
1840 PR c++/100517
1841 * typeck.c (build_reinterpret_cast_1): Check intype on
1842 cast to vector.
1843
1844 2021-05-11 Patrick Palka <ppalka@redhat.com>
1845
1846 PR c++/51577
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
1853 to its first use.
1854
1855 2021-05-11 Patrick Palka <ppalka@redhat.com>
1856
1857 PR c++/100138
1858 * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
1859 (satisfy_atom): Set up iloc_sentinel before calling
1860 cxx_constant_value.
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.
1864
1865 2021-05-10 Richard Biener <rguenther@suse.de>
1866
1867 PR middle-end/100464
1868 PR c++/100468
1869 * call.c (set_up_extended_ref_temp): Mark the temporary
1870 addressable if the TARGET_EXPR was.
1871
1872 2021-05-10 Martin Liska <mliska@suse.cz>
1873
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.
1887
1888 2021-05-10 Martin Liska <mliska@suse.cz>
1889
1890 PR c++/99616
1891 * decl.c (grokdeclarator): Remove redundant NULL check.
1892
1893 2021-05-07 Jason Merrill <jason@redhat.com>
1894
1895 * tree.c (rvalue): Assert expr is not a class lvalue.
1896
1897 2021-05-07 Jason Merrill <jason@redhat.com>
1898
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
1904 TARGET_EXPR.
1905
1906 2021-05-07 Jason Merrill <jason@redhat.com>
1907
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.
1911
1912 2021-05-04 Tobias Burnus <tobias@codesourcery.com>
1913
1914 * semantics.c (finish_omp_reduction_clause): Accept float + complex
1915 for || and && reductions.
1916
1917 2021-05-03 Patrick Palka <ppalka@redhat.com>
1918
1919 PR c++/100362
1920 * parser.c (cp_parser_class_head): Reinstate calls to pushclass
1921 and popclass when parsing the base-clause that were removed in
1922 r11-6815.
1923
1924 2021-05-03 Patrick Palka <ppalka@redhat.com>
1925
1926 PR c++/68942
1927 PR c++/100344
1928 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
1929 only when the callee is a FUNCTION_DECL.
1930
1931 2021-05-03 Marek Polacek <polacek@redhat.com>
1932
1933 PR c++/100055
1934 * decl.c (grokfndecl): Check current_template_parms.
1935
1936 2021-05-03 Marek Polacek <polacek@redhat.com>
1937
1938 DR 1312
1939 * constexpr.c (cxx_eval_constant_expression): Don't check
1940 integer_zerop.
1941
1942 2021-05-01 Jason Merrill <jason@redhat.com>
1943
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.
1954
1955 2021-04-29 Jason Merrill <jason@redhat.com>
1956
1957 * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
1958 don't find a field.
1959
1960 2021-04-29 Jason Merrill <jason@redhat.com>
1961
1962 PR c++/51344
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.
1970
1971 2021-04-29 Jason Merrill <jason@redhat.com>
1972
1973 PR c++/97974
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.
1978
1979 2021-04-29 Jason Merrill <jason@redhat.com>
1980
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.
1987
1988 2021-04-29 Jason Merrill <jason@redhat.com>
1989
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.
1995
1996 2021-04-29 Patrick Palka <ppalka@redhat.com>
1997
1998 PR c++/68942
1999 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
2000 set tf_conv during the initial substitution into the function.
2001
2002 2021-04-29 Jakub Jelinek <jakub@redhat.com>
2003
2004 PR c++/100319
2005 * semantics.c (finish_omp_clauses): Fix up check that variable
2006 mentioned in detach clause doesn't appear in data-sharing clauses.
2007
2008 2021-04-28 Jakub Jelinek <jakub@redhat.com>
2009
2010 * module.cc: Remove #error that triggers if DEV-PHASE is empty.
2011
2012 2021-04-27 Jason Merrill <jason@redhat.com>
2013
2014 PR c++/92145
2015 * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
2016 of operator=.
2017
2018 2021-04-27 Patrick Palka <ppalka@redhat.com>
2019
2020 PR c++/88580
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.
2024
2025 2021-04-26 Patrick Palka <ppalka@redhat.com>
2026
2027 PR c++/100209
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.
2032
2033 2021-04-24 Patrick Palka <ppalka@redhat.com>
2034
2035 PR c++/89565
2036 PR c++/93383
2037 PR c++/95291
2038 PR c++/99200
2039 PR c++/99683
2040 * pt.c (do_class_deduction): Punt if the initializer is
2041 type-dependent.
2042
2043 2021-04-24 Patrick Palka <ppalka@redhat.com>
2044
2045 PR c++/87709
2046 * parser.c (cp_parser_type_id_1): If we see a template
2047 placeholder, first try simulating an error before issuing
2048 a real error.
2049
2050 2021-04-23 Patrick Palka <ppalka@redhat.com>
2051
2052 PR c++/98767
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.
2059
2060 2021-04-23 Patrick Palka <ppalka@redhat.com>
2061
2062 DR 2374
2063 * decl.c (is_direct_enum_init): Check the implicit
2064 convertibility requirement added by CWG 2374.
2065
2066 2021-04-23 Martin Liska <mliska@suse.cz>
2067
2068 * cp-tree.h (STATIC_ASSERT): Prefer static assert.
2069 * lex.c (init_operators): Remove run-time check.
2070
2071 2021-04-22 Marek Polacek <polacek@redhat.com>
2072
2073 PR c++/100161
2074 * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
2075 op1 separately for value- or type-dependence.
2076
2077 2021-04-21 Marek Polacek <polacek@redhat.com>
2078
2079 PR c++/96380
2080 * parser.c (cp_parser_enum_specifier): Don't allow defining
2081 types in enum-base.
2082
2083 2021-04-21 Martin Liska <mliska@suse.cz>
2084
2085 Revert:
2086 2021-04-21 Martin Liska <mliska@suse.cz>
2087
2088 * error.c (dump_decl): Use flags in dump_generic_node call.
2089
2090 2021-04-21 Martin Liska <mliska@suse.cz>
2091
2092 * error.c (dump_decl): Use flags in dump_generic_node call.
2093
2094 2021-04-21 Martin Liska <mliska@suse.cz>
2095
2096 * error.c (dump_decl): Support anonymous labels.
2097
2098 2021-04-20 Jason Merrill <jason@redhat.com>
2099
2100 PR c++/100109
2101 * pt.c (find_parameter_packs_r): Look into enum initializers.
2102
2103 2021-04-19 Marek Polacek <polacek@redhat.com>
2104
2105 PR c++/97536
2106 * decl.c (grokvardecl): Given an error when a concept is not defined
2107 at namespace scope.
2108
2109 2021-04-16 Jakub Jelinek <jakub@redhat.com>
2110
2111 PR c++/100111
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
2114 is NULL.
2115
2116 2021-04-16 Marek Polacek <polacek@redhat.com>
2117
2118 PR c++/99803
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.
2123
2124 2021-04-16 Patrick Palka <ppalka@redhat.com>
2125
2126 PR c++/99700
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.
2130
2131 2021-04-16 Jakub Jelinek <jakub@redhat.com>
2132
2133 PR c++/99850
2134 * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
2135 If lambda_p, return pce_ok instead of pce_maybe_postfix.
2136
2137 2021-04-16 Jakub Jelinek <jakub@redhat.com>
2138
2139 PR c++/99833
2140 * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
2141 binding, add to data.internal also all corresponding structured
2142 binding decls.
2143
2144 2021-04-16 Jason Merrill <jason@redhat.com>
2145
2146 PR c++/100079
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.
2153
2154 2021-04-15 Jason Merrill <jason@redhat.com>
2155
2156 PR c++/80456
2157 * call.c (build_new_method_call_1): Check again for side-effects
2158 with a volatile object.
2159
2160 2021-04-15 Jason Merrill <jason@redhat.com>
2161
2162 PR c++/100101
2163 PR c++/99583
2164 * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
2165 TYPE_RAISES_EXCEPTIONS here.
2166 * tree.c (cp_walk_subtrees): Not here.
2167
2168 2021-04-15 Jason Merrill <jason@redhat.com>
2169
2170 PR c++/100091
2171 PR c++/99478
2172 * parser.c (cp_parser_default_type_template_argument): Set
2173 parser->local_variables_forbidden_p.
2174
2175 2021-04-15 Richard Sandiford <richard.sandiford@arm.com>
2176
2177 PR c++/98852
2178 * typeck.c (merge_type_attributes_from): New function.
2179 (cp_common_type): Use it for vector types.
2180
2181 2021-04-14 Jason Merrill <jason@redhat.com>
2182
2183 PR c++/100078
2184 PR c++/93085
2185 * pt.c (uses_outer_template_parms): Also look at default
2186 template argument.
2187
2188 2021-04-14 Jason Merrill <jason@redhat.com>
2189
2190 PR c++/93314
2191 * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
2192 for a non-static data member in a constant-expression.
2193
2194 2021-04-14 Patrick Palka <ppalka@redhat.com>
2195
2196 PR c++/83476
2197 PR c++/99885
2198 * pt.c (deducible_expression): Look through implicit
2199 INDIRECT_REFs as well.
2200
2201 2021-04-14 Jason Merrill <jason@redhat.com>
2202
2203 PR c++/99478
2204 * parser.c (cp_parser_lambda_expression): Reject lambda
2205 in template parameter type.
2206
2207 2021-04-14 Jason Merrill <jason@redhat.com>
2208
2209 PR c++/90674
2210 * decl.c (duplicate_decls): Don't propagate
2211 DECL_INITIALIZED_IN_CLASS_P to a specialization.
2212
2213 2021-04-14 Jason Merrill <jason@redhat.com>
2214
2215 PR c++/88742
2216 PR c++/49951
2217 PR c++/58123
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.
2222
2223 2021-04-13 Jason Merrill <jason@redhat.com>
2224
2225 PR c++/100032
2226 * pt.c (get_underlying_template): Compare TYPE_QUALS.
2227
2228 2021-04-13 Jason Merrill <jason@redhat.com>
2229
2230 PR c++/100054
2231 PR c++/90479
2232 * init.c (get_nsdmi): Do more context adjustment for local classes.
2233
2234 2021-04-13 Patrick Palka <ppalka@redhat.com>
2235
2236 PR c++/99008
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.
2241
2242 2021-04-13 Jason Merrill <jason@redhat.com>
2243
2244 PR c++/91933
2245 * class.c (build_base_path): Shortcut simple non-pointer case.
2246
2247 2021-04-13 Eric Botcazou <ebotcazou@adacore.com>
2248
2249 * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
2250 of the linemap.
2251 (module_state::write_location): Likewise.
2252
2253 2021-04-13 Patrick Palka <ppalka@redhat.com>
2254
2255 PR c++/97134
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.
2259
2260 2021-04-13 Patrick Palka <ppalka@redhat.com>
2261
2262 PR c++/99961
2263 PR c++/99994
2264 * constraint.cc (satisfy_normalized_constraints): Set
2265 cp_unevaluated.
2266 * parser.c (cp_parser_concept_definition): Likewise.
2267 (cp_parser_requires_clause_opt): Likewise.
2268
2269 2021-04-12 Jason Merrill <jason@redhat.com>
2270
2271 PR c++/93085
2272 * pt.c (uses_outer_template_parms): Handle non-type and template
2273 template parameters specifically.
2274
2275 2021-04-11 Jason Merrill <jason@redhat.com>
2276
2277 PR c++/97974
2278 * decl.c (fixup_anonymous_aggr): Prune all functions from
2279 CLASSTYPE_MEMBER_VEC.
2280
2281 2021-04-10 Jason Merrill <jason@redhat.com>
2282
2283 PR c++/98800
2284 PR c++/97399
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.
2289
2290 2021-04-10 Jason Merrill <jason@redhat.com>
2291
2292 PR c++/99180
2293 PR c++/93295
2294 PR c++/93867
2295 PR c++/99118
2296 PR c++/96873
2297 * pt.c (alias_ctad_tweaks): Handle failure better.
2298
2299 2021-04-10 Jason Merrill <jason@redhat.com>
2300
2301 PR c++/100006
2302 * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
2303
2304 2021-04-09 Patrick Palka <ppalka@redhat.com>
2305
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
2313 accordingly.
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.
2318
2319 2021-04-09 Marek Polacek <polacek@redhat.com>
2320
2321 PR c++/99806
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.
2325
2326 2021-04-08 Patrick Palka <ppalka@redhat.com>
2327
2328 PR c++/99874
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.
2356
2357 2021-04-08 Patrick Palka <ppalka@redhat.com>
2358
2359 PR c++/97679
2360 * pt.c (build_deduction_guide): Document OUTER_ARGS. Substitute
2361 them into the propagated constraints.
2362
2363 2021-04-08 Jason Merrill <jason@redhat.com>
2364
2365 PR c++/91849
2366 * call.c (convert_like_internal): Improve reference diagnostic.
2367
2368 2021-04-08 Jakub Jelinek <jakub@redhat.com>
2369
2370 PR c++/99859
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
2374 returns true.
2375
2376 2021-04-08 Jason Merrill <jason@redhat.com>
2377
2378 PR c++/94529
2379 * pt.c (determine_specialization): Improve diagnostic.
2380
2381 2021-04-08 Marek Polacek <polacek@redhat.com>
2382
2383 PR c++/99844
2384 * decl.c (build_explicit_specifier): Call
2385 check_for_bare_parameter_packs.
2386 * except.c (build_noexcept_spec): Likewise.
2387
2388 2021-04-07 Jason Merrill <jason@redhat.com>
2389
2390 PR c++/41723
2391 * parser.c (cp_parser_class_name): Check dependent_scope_p.
2392
2393 2021-04-07 Jason Merrill <jason@redhat.com>
2394
2395 PR c++/52625
2396 * pt.c (maybe_process_partial_specialization): Check
2397 DECL_SELF_REFERENCE_P.
2398
2399 2021-04-07 Jason Merrill <jason@redhat.com>
2400
2401 PR c++/92918
2402 * name-lookup.c (push_class_level_binding_1): Do overload a new
2403 function with a previous using-declaration.
2404
2405 2021-04-06 Jason Merrill <jason@redhat.com>
2406
2407 PR c++/96673
2408 * init.c (get_nsdmi): Don't defer access checking.
2409
2410 2021-04-06 Jason Merrill <jason@redhat.com>
2411
2412 PR c++/99901
2413 * decl.c (cp_finish_decl): mark_needed an implicitly inline
2414 static data member with an out-of-class redeclaration.
2415
2416 2021-04-06 Jason Merrill <jason@redhat.com>
2417
2418 PR c++/91241
2419 * mangle.c (write_compact_number): Add sanity check.
2420 (write_local_name): Use list_length for parm number.
2421
2422 2021-04-06 Patrick Palka <ppalka@redhat.com>
2423
2424 PR c++/99899
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.
2428
2429 2021-04-05 Jason Merrill <jason@redhat.com>
2430
2431 PR c++/96311
2432 * typeck.c (check_return_expr): Call mark_exp_read in dependent
2433 case.
2434
2435 2021-04-05 Jason Merrill <jason@redhat.com>
2436
2437 PR c++/98440
2438 * typeck.c (build_reinterpret_cast_1): Don't perform
2439 temporary materialization.
2440
2441 2021-04-05 Jason Merrill <jason@redhat.com>
2442
2443 PR c++/95317
2444 * pt.c (lookup_template_class_1): Do tsubst_enum when
2445 tsubsting a generic lambda.
2446
2447 2021-04-05 Jason Merrill <jason@redhat.com>
2448
2449 PR c++/95870
2450 * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
2451 there is no enclosing non-lambda function.
2452
2453 2021-04-05 Nathan Sidwell <nathan@acm.org>
2454
2455 PR c++/99380
2456 * module.cc (name_pending_imports): Drop 'atend' parm. Don't
2457 query export when not needed.
2458 (preprocess_module, preprocessed_module): Adjust.
2459
2460 2021-04-05 Jason Merrill <jason@redhat.com>
2461
2462 PR c++/99066
2463 * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
2464
2465 2021-04-05 Jason Merrill <jason@redhat.com>
2466
2467 PR c++/99201
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.
2471
2472 2021-04-05 Jason Merrill <jason@redhat.com>
2473
2474 * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
2475 template result.
2476
2477 2021-04-04 Jason Merrill <jason@redhat.com>
2478
2479 PR c++/99643
2480 * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
2481
2482 2021-04-03 Marek Polacek <polacek@redhat.com>
2483
2484 PR c++/91416
2485 * parser.c: Create a GC root for attributes in a decl specifier.
2486 (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
2487
2488 2021-04-03 Jason Merrill <jason@redhat.com>
2489
2490 PR c++/91217
2491 * pt.c (tsubst_lambda_expr): Skip the body block from
2492 DECL_SAVED_TREE.
2493
2494 2021-04-03 Jason Merrill <jason@redhat.com>
2495
2496 PR c++/90664
2497 * cvt.c (can_convert_qual): Check fnptr_conv_p.
2498
2499 2021-04-03 Jason Merrill <jason@redhat.com>
2500
2501 PR c++/97900
2502 * pt.c (regenerate_decl_from_template): tsubst_decl
2503 the parms.
2504
2505 2021-04-02 Patrick Palka <ppalka@redhat.com>
2506
2507 PR c++/99869
2508 * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
2509 to do_auto_deduction.
2510
2511 2021-04-02 Patrick Palka <ppalka@redhat.com>
2512
2513 PR c++/99586
2514 * semantics.c (finish_compound_literal): Check
2515 template_placeholder_p instead of type_uses_auto.
2516
2517 2021-04-02 Jason Merrill <jason@redhat.com>
2518
2519 PR c++/97938
2520 * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
2521 * lambda.c (add_capture): Set it.
2522 * pt.c (tsubst_pack_expansion): Handle it.
2523
2524 2021-04-02 Nathan Sidwell <nathan@acm.org>
2525
2526 * cp-tree.h (lang_decl_base): Correct module flag comment.
2527 * module.cc (trees_in::assert_definition): Break out
2528 not_tmpl var.
2529 (trees_out::lang_decl_bools): Do not write purview for header units.
2530
2531 2021-04-01 Marek Polacek <polacek@redhat.com>
2532
2533 PR c++/99831
2534 * method.c (defaulted_late_check): ++ and -- function_depth around
2535 the call to synthesize_method.
2536 * pt.c: Remove the saved_trees global.
2537
2538 2021-04-01 Jason Merrill <jason@redhat.com>
2539
2540 PR c++/99583
2541 PR c++/99584
2542 * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
2543 TYPE_RAISES_EXCEPTIONS.
2544
2545 2021-04-01 Iain Sandoe <iain@sandoe.co.uk>
2546
2547 * mapper-client.cc (INCLUDE_MAP): New; require map to be
2548 included from system.h.
2549 * mapper-resolver.cc (INCLUDE_MAP): Likewise.
2550
2551 2021-04-01 Jason Merrill <jason@redhat.com>
2552
2553 PR c++/98481
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.
2557
2558 2021-04-01 Nathan Sidwell <nathan@acm.org>
2559
2560 PR c++/99283
2561 * module.cc (trees_out::decl_node): Adjust importedness reference
2562 assert.
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.
2566
2567 2021-03-31 Jason Merrill <jason@redhat.com>
2568
2569 PR c++/99445
2570 * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
2571
2572 2021-03-31 Patrick Palka <ppalka@redhat.com>
2573
2574 PR c++/88115
2575 * mangle.c (write_expression): Adjust the mangling of
2576 __alignof__.
2577
2578 2021-03-31 Patrick Palka <ppalka@redhat.com>
2579
2580 PR c++/99815
2581 * pt.c (placeholder_type_constraint_dependent_p): Expand
2582 argument packs to separate the first non-pack argument
2583 from the rest.
2584
2585 2021-03-30 Nathan Sidwell <nathan@acm.org>
2586
2587 PR c++/99283
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.
2593
2594 2021-03-30 Jakub Jelinek <jakub@redhat.com>
2595
2596 PR c++/99790
2597 * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
2598
2599 2021-03-26 Marek Polacek <polacek@redhat.com>
2600
2601 PR c++/98352
2602 * method.c (implicitly_declare_fn): Pass &raises to
2603 synthesized_method_walk.
2604
2605 2021-03-26 Nathan Sidwell <nathan@acm.org>
2606
2607 PR c++/99283
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
2611 propagation.
2612 * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
2613 (dumper::impl::nested_name): Adjust for template-decl module flag
2614 change.
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
2623 change.
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.
2633
2634 2021-03-26 Jakub Jelinek <jakub@redhat.com>
2635
2636 PR c++/99705
2637 * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
2638 in DECL_EXPR or in BIND_EXPR_VARS.
2639
2640 2021-03-25 Jakub Jelinek <jakub@redhat.com>
2641
2642 PR c++/99672
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.
2646
2647 2021-03-25 Marek Polacek <polacek@redhat.com>
2648
2649 PR c++/94751
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
2654 fails.
2655 (implicitly_declare_fn): If raises is error_mark_node, call
2656 synthesized_method_walk with diag being true.
2657
2658 2021-03-25 Jakub Jelinek <jakub@redhat.com>
2659
2660 PR c++/99745
2661 * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
2662 packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
2663
2664 2021-03-25 Marek Polacek <polacek@redhat.com>
2665
2666 PR c++/99331
2667 * call.c (build_converted_constant_expr_internal): Don't emit
2668 -Wconversion warnings.
2669
2670 2021-03-25 Jakub Jelinek <jakub@redhat.com>
2671
2672 PR c++/99565
2673 * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
2674 to operand_equal_p.
2675 * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
2676 or COMPOUND_EXPR.
2677
2678 2021-03-23 Nathan Sidwell <nathan@acm.org>
2679
2680 PR c++/99283
2681 * name-lookup.c (check_module_override): Set global or partition
2682 DUP on the binding vector.
2683
2684 2021-03-23 Marek Polacek <polacek@redhat.com>
2685
2686 PR c++/99318
2687 * decl2.c (cp_warn_deprecated_use_scopes): Only call
2688 cp_warn_deprecated_use when decl is a namespace, class, or enum.
2689
2690 2021-03-23 Nathan Sidwell <nathan@acm.org>
2691
2692 PR c++/99239
2693 * decl.c (duplicate_decls): Remove assert about maybe-imported
2694 artificial decls.
2695
2696 2021-03-23 Jakub Jelinek <jakub@redhat.com>
2697
2698 PR c++/99650
2699 * decl.c (cp_finish_decomp): Diagnose void initializers when
2700 using tuple_element and get.
2701
2702 2021-03-22 Nathan Sidwell <nathan@acm.org>
2703
2704 PR c++/99480
2705 * module.cc (depset::hash::make_dependency): Propagate flags for
2706 partial specialization.
2707 (module_may_redeclare): Handle partial specialization.
2708
2709 2021-03-22 Nathan Sidwell <nathan@acm.org>
2710
2711 PR c++/99425
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
2721 here.
2722
2723 2021-03-22 Martin Liska <mliska@suse.cz>
2724
2725 PR c++/99687
2726 * module.cc (fini_modules): Call vec_free instead of delete.
2727
2728 2021-03-20 Jakub Jelinek <jakub@redhat.com>
2729
2730 PR debug/99230
2731 * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
2732 special code, instead call c_genericize_control_stmt.
2733
2734 2021-03-19 Jakub Jelinek <jakub@redhat.com>
2735
2736 PR c++/99456
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.
2740
2741 2021-03-19 Marek Polacek <polacek@redhat.com>
2742
2743 PR c++/99500
2744 * parser.c (cp_parser_requirement_parameter_list): Handle
2745 error_mark_node.
2746
2747 2021-03-18 Marek Polacek <polacek@redhat.com>
2748
2749 * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
2750
2751 2021-03-18 Marek Polacek <polacek@redhat.com>
2752
2753 * pt.c (tsubst_copy_and_build): Add assert.
2754
2755 2021-03-18 Iain Sandoe <iain@sandoe.co.uk>
2756
2757 PR objc++/49070
2758 * parser.c (cp_debug_parser): Add Objective-C++ message
2759 state flag.
2760 (cp_parser_nested_name_specifier_opt): Allow colon to
2761 terminate an assignment-expression when parsing Objective-
2762 C++ messages.
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.
2767
2768 2021-03-18 Martin Liska <mliska@suse.cz>
2769
2770 PR c++/99617
2771 * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
2772 to NULL.
2773
2774 2021-03-17 Marek Polacek <polacek@redhat.com>
2775
2776 PR c++/97973
2777 * call.c (conv_unsafe_in_template_p): New.
2778 (convert_like): Use it.
2779
2780 2021-03-17 Anthony Sharp <anthonysharp15@gmail.com>
2781 Jason Merrill <jason@redhat.com>
2782
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
2787 above.
2788
2789 2021-03-16 Jason Merrill <jason@redhat.com>
2790
2791 * tree.c (cp_tree_equal): Use real_identical.
2792
2793 2021-03-16 Jakub Jelinek <jakub@redhat.com>
2794
2795 PR c++/99613
2796 * decl.c (expand_static_init): For thread guards, call __cxa_atexit
2797 before calling __cxa_guard_release rather than after it. Formatting
2798 fixes.
2799
2800 2021-03-16 Martin Liska <mliska@suse.cz>
2801 Jason Merrill <jason@redhat.com>
2802
2803 PR c++/99108
2804 * call.c (get_function_version_dispatcher): Handle
2805 DECL_LOCAL_DECL_P.
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.
2810
2811 2021-03-16 Nathan Sidwell <nathan@acm.org>
2812
2813 PR c++/99496
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
2817 is one.
2818
2819 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2820
2821 PR c++/99047
2822 * coroutines.cc (expand_one_await_expression): If the
2823 await_ready() expression is not a boolean then convert it
2824 as required.
2825
2826 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2827
2828 PR c++/98704
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.
2837
2838 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2839
2840 PR c++/98480
2841 * coroutines.cc (replace_continue): Rewrite continue into
2842 'goto label'.
2843 (await_statement_walker): Handle await expressions in the
2844 initializer, condition and iteration expressions of for
2845 loops.
2846
2847 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2848
2849 PR c++/96749
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.
2854
2855 2021-03-15 Tobias Burnus <tobias@codesourcery.com>
2856
2857 PR c++/99509
2858 * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
2859 ensure that the varpool node is marked as offloadable.
2860
2861 2021-03-12 Nathan Sidwell <nathan@acm.org>
2862
2863 PR c++/99238
2864 * module.cc (depset::hash::add_binding_entity): Assert not
2865 visited.
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
2871 call.
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.
2879
2880 2021-03-12 Jakub Jelinek <jakub@redhat.com>
2881
2882 PR c++/99507
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
2886 afterwards.
2887
2888 2021-03-11 Nathan Sidwell <nathan@acm.org>
2889
2890 PR c++/99248
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.
2894
2895 2021-03-11 Nathan Sidwell <nathan@acm.org>
2896
2897 PR c++/99528
2898 * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
2899 MK_decl_tmpl_spec.
2900 (trees_in::decl_value): Adjust add_mergeable_specialization call.
2901 (trees_out::get_merge_kind): Adjust detecting a partial template
2902 instantiation.
2903 (trees_out::key_mergeable): Adjust handling same.
2904 (trees_in::key_mergeabvle): Likewise.
2905
2906 2021-03-10 Nathan Sidwell <nathan@acm.org>
2907
2908 PR c++/99423
2909 * module.cc (post_load_processing): Assert not gcable.
2910 (laxy_load_pendings): Extend no-gc region around
2911 post_load_processing.
2912
2913 2021-03-10 Nathan Sidwell <nathan@acm.org>
2914
2915 PR c++/99508
2916 * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
2917 assembler name to the ns alias.
2918
2919 2021-03-09 Jakub Jelinek <jakub@redhat.com>
2920
2921 PR c++/99459
2922 * coroutines.cc (build_co_await): Look through NOP_EXPRs in
2923 build_special_member_call return value to find the CALL_EXPR.
2924 Simplify.
2925
2926 2021-03-09 Nathan Sidwell <nathan@acm.org>
2927
2928 PR c++/99472
2929 * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
2930 that C++20 does not yet imply modules.
2931
2932 2021-03-08 Nathan Sidwell <nathan@acm.org>
2933
2934 PR c++/99436
2935 * name-lookup.c (get_cxx_dialect_name): Add cxx23.
2936
2937 2021-03-08 Nathan Sidwell <nathan@acm.org>
2938
2939 * lex.c (module_token_filter::resume): Ignore module-decls inside
2940 header-unit.
2941 * parser.c (cp_parser_module_declaration): Reject in header-unit.
2942
2943 2021-03-08 Nathan Sidwell <nathan@acm.org>
2944
2945 PR c++/99285
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
2951 calls.
2952 (specialization_add): Likewise.
2953 * pt.c (match_mergeable_specialization): Do not insert.
2954 (add_mergeable_specialization): Add to hash table here.
2955
2956 2021-03-06 Patrick Palka <ppalka@redhat.com>
2957 Jakub Jelinek <jakub@redhat.com>
2958
2959 PR c++/99287
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'.
2964
2965 2021-03-06 Patrick Palka <ppalka@redhat.com>
2966 Jakub Jelinek <jakub@redhat.com>
2967
2968 PR c++/96330
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.
2972
2973 2021-03-06 Patrick Palka <ppalka@redhat.com>
2974
2975 PR c++/99365
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
2986 already been done.
2987
2988 2021-03-05 Marek Polacek <polacek@redhat.com>
2989
2990 PR c++/99374
2991 * call.c (standard_conversion): When converting pointers to
2992 member, don't return NULL when the bases are equivalent but
2993 incomplete.
2994
2995 2021-03-05 Marek Polacek <polacek@redhat.com>
2996
2997 PR c++/99120
2998 * name-lookup.c (check_local_shadow): Check if the type of decl
2999 is non-null before checking TYPE_PTR*.
3000
3001 2021-03-05 Nathan Sidwell <nathan@acm.org>
3002
3003 PR c++/99245
3004 * module.cc (module_state::write_cluster): Relax binding assert.
3005
3006 2021-03-05 Nathan Sidwell <nathan@acm.org>
3007
3008 PR c++/99377
3009 * pt.c (instantiate_decl): Call set_instantiating_module.
3010
3011 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3012
3013 PR c++/98118
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.
3018
3019 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3020
3021 PR c++/95616
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
3025 components.
3026 (build_init_or_final_await): Diagnose a throwing promise
3027 final_suspend() call.
3028
3029 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3030
3031 PR c++/95615
3032 * coroutines.cc (struct param_info): Track parameter copies that need
3033 a DTOR.
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.
3039
3040 2021-03-05 Nathan Sidwell <nathan@acm.org>
3041
3042 PR c++/99389
3043 * pt.c (instantiate_class_template_1): Set instantiating module
3044 here.
3045
3046 2021-03-05 Tobias Burnus <tobias@codesourcery.com>
3047
3048 PR c/99137
3049 * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
3050
3051 2021-03-04 Jakub Jelinek <jakub@redhat.com>
3052
3053 PR c++/88146
3054 PR c++/99362
3055 * cvt.c (convert_to_void): Revert 2019-10-17 changes. Clarify
3056 comment.
3057
3058 2021-03-04 Nathan Sidwell <nathan@acm.org>
3059
3060 PR c++/99170
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.
3069
3070 2021-03-04 Nathan Sidwell <nathan@acm.org>
3071
3072 PR c++/99170
3073 * cp-tree.h
3074 * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
3075 rename.
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
3083 handling.
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.
3111
3112 2021-03-03 Nathan Sidwell <nathan@acm.org>
3113
3114 PR c++/99170
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
3123
3124 2021-03-03 Nathan Sidwell <nathan@acm.org>
3125
3126 PR c++/99170
3127 * module.cc (trees_out::decl_value): Stream specialization keys
3128 after decl.
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.
3134
3135 2021-03-03 Patrick Palka <ppalka@redhat.com>
3136
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
3144 subst_info.
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.
3178
3179 2021-03-03 Patrick Palka <ppalka@redhat.com>
3180
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
3190 appropriately).
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.
3234
3235 2021-03-03 Jakub Jelinek <jakub@redhat.com>
3236
3237 PR c++/82959
3238 * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
3239 and COMPOUND_EXPR.
3240
3241 2021-03-03 Marek Polacek <polacek@redhat.com>
3242
3243 PR c++/97034
3244 PR c++/99009
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.
3251
3252 2021-03-03 Jason Merrill <jason@redhat.com>
3253
3254 PR c++/95675
3255 * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
3256 if it didn't get one before.
3257
3258 2021-03-03 Nathan Sidwell <nathan@acm.org>
3259
3260 PR c++/99344
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.
3271
3272 2021-03-02 Martin Sebor <msebor@redhat.com>
3273
3274 PR c++/99251
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.
3280
3281 2021-03-02 Patrick Palka <ppalka@redhat.com>
3282
3283 PR c++/96443
3284 PR c++/96960
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
3292 'auto' types.
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.
3305
3306 2021-03-02 Patrick Palka <ppalka@redhat.com>
3307
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
3314 orig_decl member.
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.
3337
3338 2021-03-02 Patrick Palka <ppalka@redhat.com>
3339
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.
3349
3350 2021-03-02 Patrick Palka <ppalka@redhat.com>
3351
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.
3362
3363 2021-03-01 Nathan Sidwell <nathan@acm.org>
3364
3365 PR c++/99294
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.
3370
3371 2021-02-27 Jason Merrill <jason@redhat.com>
3372
3373 PR c++/90333
3374 * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
3375 between () and ->.
3376
3377 2021-02-26 Jakub Jelinek <jakub@redhat.com>
3378
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.
3382
3383 2021-02-26 Jakub Jelinek <jakub@redhat.com>
3384
3385 PR c++/95451
3386 * lambda.c (is_lambda_ignored_entity): Before checking for
3387 LAMBDA_FUNCTION_P, use OVL_FIRST. Drop FUNCTION_DECL check.
3388
3389 2021-02-26 Jason Merrill <jason@redhat.com>
3390
3391 PR c++/98810
3392 * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
3393 to a class non-type template argument that needs it.
3394
3395 2021-02-26 Patrick Palka <ppalka@redhat.com>
3396
3397 PR c++/98990
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.
3403
3404 2021-02-25 Patrick Palka <ppalka@redhat.com>
3405
3406 PR c++/99213
3407 PR c++/94521
3408 * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
3409 TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
3410
3411 2021-02-25 Patrick Palka <ppalka@redhat.com>
3412
3413 PR c++/99103
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.
3416
3417 2021-02-25 Marek Polacek <polacek@redhat.com>
3418
3419 DR 1312
3420 PR c++/99176
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.
3426
3427 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
3428
3429 PR c++/97587
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.
3433
3434 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
3435
3436 PR c++/95822
3437 * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
3438 set throwing_cleanup marker.
3439
3440 2021-02-25 Nathan Sidwell <nathan@acm.org>
3441
3442 PR c++/99166
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.
3447
3448 2021-02-25 Nathan Sidwell <nathan@acm.org>
3449
3450 PR c++/98318
3451 * mapper-client.cc (module_client::open_module_client): Fix typo
3452 of fd init.
3453
3454 2021-02-24 Nathan Sidwell <nathan@acm.org>
3455
3456 PR c++/98718
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.
3469
3470 2021-02-24 Iain Sandoe <iain@sandoe.co.uk>
3471
3472 PR c++/96251
3473 * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
3474 error reporting when instantiating for a constexpr.
3475
3476 2021-02-23 Nathan Sidwell <nathan@acm.org>
3477
3478 PR c++/99208
3479 * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
3480 identity.
3481
3482 2021-02-23 Patrick Palka <ppalka@redhat.com>
3483
3484 PR c++/95468
3485 * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
3486 over from tsubst_copy.
3487
3488 2021-02-23 Patrick Palka <ppalka@redhat.com>
3489
3490 * pt.c (instantiation_dependent_expression_p): Check
3491 processing_template_decl before calling
3492 potential_constant_expression.
3493
3494 2021-02-22 Nathan Sidwell <nathan@acm.org>
3495
3496 PR c++/99174
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.
3501
3502 2021-02-22 Nathan Sidwell <nathan@acm.org>
3503
3504 PR c++/99153
3505 * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
3506 to common-path.
3507 * module.cc (set_defining_module): Add assert.
3508
3509 2021-02-19 Nathan Sidwell <nathan@acm.org>
3510
3511 PR c++/98741
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.
3519
3520 2021-02-19 Nathan Sidwell <nathan@acm.org>
3521
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.
3527
3528 2021-02-19 Jason Merrill <jason@redhat.com>
3529
3530 PR c++/96926
3531 * call.c (perfect_conversion_p): Limit rvalueness
3532 test to reference bindings.
3533
3534 2021-02-19 Jason Merrill <jason@redhat.com>
3535
3536 PR c++/96926
3537 * call.c (perfect_conversion_p): New.
3538 (perfect_candidate_p): New.
3539 (add_candidates): Ignore templates after a perfect non-template.
3540
3541 2021-02-18 Nathan Sidwell <nathan@acm.org>
3542
3543 PR c++/99023
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.
3548
3549 2021-02-18 Jakub Jelinek <jakub@redhat.com>
3550
3551 PR c++/99132
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.
3555
3556 2021-02-17 Nathan Sidwell <nathan@acm.org>
3557
3558 PR c++/99023
3559 * module.cc (struct macro_export): Add GTY markers.
3560 (macro_exports): Likewise, us a va_gc Vector.
3561
3562 2021-02-17 Jakub Jelinek <jakub@redhat.com>
3563
3564 PR sanitizer/99106
3565 * init.c (build_zero_init_1): For flexible array members just return
3566 NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
3567 ARRAY_TYPE.
3568
3569 2021-02-17 Nathan Sidwell <nathan@acm.org>
3570
3571 PR c++/99116
3572 * name-lookup.c (do_pushdecl): Don't peek under template_parm
3573 bindings here ...
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.
3577
3578 2021-02-17 Nathan Sidwell <nathan@acm.org>
3579
3580 PR c++/99071
3581 * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
3582 pointer.
3583
3584 2021-02-17 Patrick Palka <ppalka@redhat.com>
3585
3586 PR debug/96997
3587 PR c++/94034
3588 * tree.c (build_aggr_init_expr): Revert r10-7718 change.
3589
3590 2021-02-12 Nathan Sidwell <nathan@acm.org>
3591
3592 * module.cc (module_state::write_cluster): Check bindings for
3593 imported using-decls.
3594
3595 2021-02-12 Nathan Sidwell <nathan@acm.org>
3596
3597 PR c++/99040
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.
3609
3610 2021-02-12 Nathan Sidwell <nathan@acm.org>
3611
3612 PR c++/99039
3613 PR c++/99040
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
3631 here.
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.
3639
3640 2021-02-12 Jakub Jelinek <jakub@redhat.com>
3641
3642 PR c++/97742
3643 * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
3644 CPP_EOF.
3645
3646 2021-02-12 Jason Merrill <jason@redhat.com>
3647
3648 PR c++/97246
3649 PR c++/94546
3650 * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
3651 (register_parameter_specializations): Not here.
3652
3653 2021-02-11 Marek Polacek <polacek@redhat.com>
3654
3655 PR c++/95888
3656 * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
3657 for the partial instantiation.
3658
3659 2021-02-11 Jakub Jelinek <jakub@redhat.com>
3660
3661 PR c++/99033
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.
3666 Formatting fixes.
3667
3668 2021-02-11 Marek Polacek <polacek@redhat.com>
3669
3670 PR c++/99063
3671 * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
3672
3673 2021-02-11 Patrick Palka <ppalka@redhat.com>
3674
3675 PR c++/97582
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.
3681
3682 2021-02-11 Marek Polacek <polacek@redhat.com>
3683
3684 * parser.c (cp_parser_selection_statement): Use vec_free.
3685
3686 2021-02-10 Jakub Jelinek <jakub@redhat.com>
3687
3688 PR c++/98988
3689 PR c++/99031
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.
3695
3696 2021-02-10 Nathan Sidwell <nathan@acm.org>
3697
3698 PR c++/99030
3699 * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
3700 answer if there's no local specialization.
3701
3702 2021-02-09 Nathan Sidwell <nathan@acm.org>
3703
3704 PR c++/98944
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.
3709
3710 2021-02-09 Jason Merrill <jason@redhat.com>
3711
3712 PR c++/96905
3713 * pt.c (mark_decl_instantiated): Exit early if consteval.
3714
3715 2021-02-09 Jason Merrill <jason@redhat.com>
3716
3717 PR c++/98326
3718 PR c++/20408
3719 * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
3720 parm.
3721
3722 2021-02-09 Jason Merrill <jason@redhat.com>
3723
3724 PR c++/98994
3725 PR c++/97566
3726 * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
3727 RECORD_TYPE.
3728
3729 2021-02-08 Nathan Sidwell <nathan@acm.org>
3730
3731 * decl.c (start_cleanup_fn): Push function into
3732 namespace.
3733
3734 2021-02-08 Nathan Sidwell <nathan@acm.org>
3735
3736 PR c++/98531
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
3742 declaration.
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
3746 decl.c.
3747
3748 2021-02-08 Marek Polacek <polacek@redhat.com>
3749
3750 * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
3751
3752 2021-02-05 Marek Polacek <polacek@redhat.com>
3753
3754 PR c++/98947
3755 * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
3756 on arg2/arg3.
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.
3760
3761 2021-02-05 Marek Polacek <polacek@redhat.com>
3762
3763 PR c++/96462
3764 * name-lookup.c (lookup_using_decl): Hoist the destructor check.
3765
3766 2021-02-05 Jakub Jelinek <jakub@redhat.com>
3767
3768 PR c++/97878
3769 * decl.c (check_array_initializer): For structured bindings, require
3770 the array type to be complete.
3771
3772 2021-02-04 Jason Merrill <jason@redhat.com>
3773
3774 PR c++/98717
3775 * constraint.cc (build_concept_check_arguments): Remove assert.
3776 (build_concept_check): Allow empty args.
3777
3778 2021-02-04 Tom Greenslade (thomgree) <thomgree@cisco.com>
3779
3780 PR c++/90926
3781 * call.c (can_convert_array): Extend to handle all valid aggregate
3782 initializers of an array; including by string literals, not just by
3783 brace-init-list.
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.
3789
3790 2021-02-04 Jason Merrill <jason@redhat.com>
3791
3792 PR c++/98802
3793 * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
3794
3795 2021-02-04 Jason Merrill <jason@redhat.com>
3796
3797 PR c++/95192
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.
3804
3805 2021-02-03 Marek Polacek <polacek@redhat.com>
3806
3807 PR c++/98951
3808 * call.c (struct z_candidate): Mark rewritten and reversed as const.
3809 (struct NonPublicField): Mark operator() as const.
3810 (struct NonTrivialField): Likewise.
3811
3812 2021-02-03 Jason Merrill <jason@redhat.com>
3813
3814 PR c++/98926
3815 PR c++/98570
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.
3819
3820 2021-02-03 Marek Polacek <polacek@redhat.com>
3821
3822 PR c++/98899
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.
3830
3831 2021-02-02 Jason Merrill <jason@redhat.com>
3832
3833 PR c++/98929
3834 PR c++/96199
3835 * error.c (dump_expr): Ignore dummy object.
3836 * pt.c (tsubst_baselink): Handle dependent scope.
3837
3838 2021-02-01 Patrick Palka <ppalka@redhat.com>
3839
3840 PR c++/98295
3841 * constexpr.c (cxx_eval_array_reference): Also set
3842 new_ctx.object when setting new_ctx.ctor.
3843
3844 2021-02-01 Marek Polacek <polacek@redhat.com>
3845
3846 PR c++/98355
3847 * parser.c (cp_parser_has_attribute_expression): Use
3848 uses_template_parms instead of type_dependent_expression_p.
3849
3850 2021-02-01 Jason Merrill <jason@redhat.com>
3851
3852 PR c++/98570
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
3865 module handling.
3866 * typeck.c (structural_comptypes): Adjust.
3867 (comptypes): Remove comparing_specializations handling.
3868
3869 2021-01-29 Nathan Sidwell <nathan@acm.org>
3870
3871 PR c++/98843
3872 * module.cc (module_state_config): Add num_entities field.
3873 (module_state::read_entities): The entity_ary span is
3874 already allocated.
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
3879 span here.
3880 (module_state::read_language): Do not set entity_lwm
3881 here.
3882
3883 2021-01-29 Marek Polacek <polacek@redhat.com>
3884
3885 PR c++/96137
3886 * parser.c (cp_parser_class_name): If parser->scope is
3887 error_mark_node, return it, otherwise continue.
3888
3889 2021-01-28 Jakub Jelinek <jakub@redhat.com>
3890
3891 PR c++/98841
3892 * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
3893
3894 2021-01-28 Jakub Jelinek <jakub@redhat.com>
3895
3896 PR c++/33661
3897 PR c++/98847
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.
3902
3903 2021-01-28 Nathan Sidwell <nathan@acm.org>
3904
3905 PR c++/98770
3906 * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
3907 check order.
3908 (trees_in::decl_value): Do typedef frobbing only when installing
3909 a new typedef, adjust is_matching_decl call. Swap is_typedef
3910 & TYPE_NAME check.
3911 (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
3912 names and deal with typedef checking.
3913
3914 2021-01-27 Jason Merrill <jason@redhat.com>
3915
3916 PR c++/97874
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.
3921
3922 2021-01-26 Jason Merrill <jason@redhat.com>
3923
3924 PR c++/97474
3925 * call.c (type_passed_as): Don't mark invisiref restrict.
3926
3927 2021-01-26 Jason Merrill <jason@redhat.com>
3928
3929 PR c++/97566
3930 PR c++/98463
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.
3939
3940 2021-01-25 Martin Sebor <msebor@redhat.com>
3941
3942 PR c++/98646
3943 * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
3944
3945 2021-01-25 Jason Merrill <jason@redhat.com>
3946
3947 PR c++/98463
3948 * constexpr.c (get_or_insert_ctor_field): Add check.
3949 (cxx_eval_store_expression): Handle discontinuity of refs.
3950
3951 2021-01-23 Anthony Sharp <anthonysharp15@gmail.com>
3952
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.
3960
3961 2021-01-23 Patrick Palka <ppalka@redhat.com>
3962
3963 PR c++/97399
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.
3975
3976 2021-01-22 Marek Polacek <polacek@redhat.com>
3977
3978 PR c++/96623
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.
3982
3983 2021-01-22 Jason Merrill <jason@redhat.com>
3984
3985 PR c++/98744
3986 * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
3987
3988 2021-01-22 Jakub Jelinek <jakub@redhat.com>
3989
3990 PR sanitizer/95693
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.
3995
3996 2021-01-22 Marek Polacek <polacek@redhat.com>
3997
3998 PR c++/98545
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.
4003
4004 2021-01-22 Marek Polacek <polacek@redhat.com>
4005
4006 PR c++/97966
4007 * pt.c (instantiate_class_template_1): Instantiate members
4008 marked with attribute used only after we're done instantiating
4009 the class.
4010
4011 2021-01-21 Patrick Palka <ppalka@redhat.com>
4012
4013 PR c++/71879
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.
4017
4018 2021-01-21 Nathan Sidwell <nathan@acm.org>
4019
4020 PR c++/98624
4021 * module.cc (depset::hash::find_dependencies): Add
4022 module arg.
4023 (trees_out::core_vals): Check state before calling
4024 write_location.
4025 (sort_cluster, module_state::write): Adjust
4026 find_dependencies call.
4027
4028 2021-01-21 Jakub Jelinek <jakub@redhat.com>
4029
4030 PR c++/98672
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
4042 continue.
4043
4044 2021-01-21 Nathan Sidwell <nathan@acm.org>
4045
4046 PR c++/98530
4047 * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
4048
4049 2021-01-20 Nathan Sidwell <nathan@acm.org>
4050
4051 * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
4052 signed type.
4053
4054 2021-01-20 Patrick Palka <ppalka@redhat.com>
4055
4056 PR c++/95434
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.
4060
4061 2021-01-20 Patrick Palka <ppalka@redhat.com>
4062
4063 PR c++/82613
4064 * parser.c (cp_parser_class_head): Defer access checking when
4065 parsing the base-clause until all bases are seen and attached
4066 to the class type.
4067 * pt.c (instantiate_class_template): Likewise when substituting
4068 into dependent bases.
4069
4070 2021-01-20 Jakub Jelinek <jakub@redhat.com>
4071
4072 PR c++/98742
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.
4076
4077 2021-01-19 Marek Polacek <polacek@redhat.com>
4078
4079 PR c++/98659
4080 * pt.c (maybe_instantiate_noexcept): Return false if FN is
4081 error_mark_node.
4082
4083 2021-01-19 Marek Polacek <polacek@redhat.com>
4084
4085 PR c++/98687
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.
4090
4091 2021-01-19 Patrick Palka <ppalka@redhat.com>
4092
4093 PR c++/41437
4094 PR c++/58993
4095 * search.c (friend_accessible_p): If scope is a hidden friend
4096 defined inside a dependent class, consider access from the
4097 class.
4098 * parser.c (cp_parser_late_parsing_for_member): Don't push a
4099 dk_no_check access state.
4100
4101 2021-01-19 Marek Polacek <polacek@redhat.com>
4102
4103 PR c++/98333
4104 * parser.c (cp_parser_class_specifier_1): Perform late-parsing
4105 of NSDMIs before late-parsing of noexcept-specifiers.
4106
4107 2021-01-19 Nathan Sidwell <nathan@acm.org>
4108
4109 * module.cc (identifier): Merge overloads.
4110
4111 2021-01-19 Nathan Sidwell <nathan@acm.org>
4112
4113 PR c++/98624
4114 * module.cc (trees_out::write_location): Make static.
4115
4116 2021-01-16 Kwok Cheung Yeung <kcy@codesourcery.com>
4117
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.
4125
4126 2021-01-15 Nathan Sidwell <nathan@acm.org>
4127
4128 PR c++/98538
4129 * tree.c (cp_build_qualified_type_real): Propagate an array's
4130 dependentness to the copy, if known.
4131
4132 2021-01-15 Jason Merrill <jason@redhat.com>
4133
4134 PR c++/98642
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.
4144
4145 2021-01-15 Jason Merrill <jason@redhat.com>
4146
4147 * call.c (base_ctor_for, make_base_init_ok): New.
4148 (build_over_call): Use make_base_init_ok.
4149
4150 2021-01-15 Jason Merrill <jason@redhat.com>
4151
4152 PR c++/63707
4153 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
4154 if we got a CONSTRUCTOR.
4155
4156 2021-01-15 Nathan Sidwell <nathan@acm.org>
4157
4158 PR c++/98591
4159 * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
4160
4161 2021-01-14 Jason Merrill <jason@redhat.com>
4162
4163 * typeck2.c (process_init_constructor_record): Use fldtype
4164 variable consistently.
4165
4166 2021-01-14 Nathan Sidwell <nathan@acm.org>
4167
4168 PR c++/98372
4169 * tree.c (cp_tree_equal): Correct map_context logic.
4170
4171 2021-01-13 Marek Polacek <polacek@redhat.com>
4172
4173 PR c++/98231
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.
4177
4178 2021-01-13 Nathan Sidwell <nathan@acm.org>
4179
4180 PR c++/98626
4181 * module.cc (module_add_import_initializers): Pass a
4182 zero-element argument vector.
4183
4184 2021-01-12 Patrick Palka <ppalka@redhat.com>
4185
4186 PR c++/98611
4187 * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
4188 the template of a CTAD placeholder.
4189
4190 2021-01-12 Marek Polacek <polacek@redhat.com>
4191
4192 PR c++/98620
4193 * typeck2.c (process_init_constructor_record): Don't emit
4194 -Wmissing-field-initializers warnings in unevaluated contexts.
4195
4196 2021-01-11 Jakub Jelinek <jakub@redhat.com>
4197
4198 PR c++/98481
4199 * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
4200 for types.
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
4204 typedefs.
4205
4206 2021-01-08 Patrick Palka <ppalka@redhat.com>
4207
4208 PR c++/98551
4209 * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
4210 instead of AGGREGATE_TYPE_P before calling replace_result_decl.
4211
4212 2021-01-08 Patrick Palka <ppalka@redhat.com>
4213
4214 PR c++/98515
4215 * semantics.c (check_accessibility_of_qualified_id): Punt if
4216 we're checking access of a scoped non-static member inside a
4217 class template.
4218
4219 2021-01-07 Jakub Jelinek <jakub@redhat.com>
4220
4221 PR c++/98329
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
4224 its location.
4225 (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
4226
4227 2021-01-07 Marek Polacek <polacek@redhat.com>
4228
4229 PR c++/98441
4230 * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
4231 !late_return_type block.
4232
4233 2021-01-07 Jason Merrill <jason@redhat.com>
4234
4235 * constexpr.c (cxx_bind_parameters_in_call): Add comment.
4236 (cxx_eval_store_expression): Add comment.
4237
4238 2021-01-07 Jason Merrill <jason@redhat.com>
4239
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
4246 for ck_identity.
4247
4248 2021-01-06 Martin Sebor <msebor@redhat.com>
4249
4250 PR c++/95768
4251 * error.c (dump_expr): Call c_pretty_printer::unary_expression.
4252
4253 2021-01-05 Patrick Palka <ppalka@redhat.com>
4254
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.
4258
4259 2021-01-05 Jakub Jelinek <jakub@redhat.com>
4260
4261 * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
4262 $(CODYLIB) after $(BACKEND).
4263
4264 2021-01-05 Jakub Jelinek <jakub@redhat.com>
4265
4266 PR c++/98469
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.
4271
4272 2021-01-05 Marek Polacek <polacek@redhat.com>
4273
4274 PR c++/82099
4275 * pt.c (resolve_overloaded_unification): Call
4276 maybe_instantiate_noexcept after instantiating the function
4277 decl.
4278
4279 2021-01-05 Nathan Sidwell <nathan@acm.org>
4280
4281 * parser.c (cp_parser_module_declaration): Alter diagnostic
4282 text to say where is permissable.
4283
4284 2021-01-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4285
4286 PR c++/98316
4287 * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
4288
4289 2021-01-02 Jan Hubicka <jh@suse.cz>
4290
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.
4294
4295 2021-01-01 Jakub Jelinek <jakub@redhat.com>
4296
4297 * ChangeLog-2020: Rotate ChangeLog. New file.
4298
4299 \f
4300 Copyright (C) 2021 Free Software Foundation, Inc.
4301
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.