]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/cp/ChangeLog
Daily bump.
[thirdparty/gcc.git] / gcc / cp / ChangeLog
1 2021-09-27 Patrick Palka <ppalka@redhat.com>
2
3 PR c++/102479
4 * pt.c (rewrite_template_parm): Handle single-level tsubst_args.
5 Avoid a tree cycle when assigning the DECL_TEMPLATE_PARMS for a
6 rewritten ttp.
7 (alias_ctad_tweaks): Set current_template_parms accordingly.
8
9 2021-09-23 Michel Morin <mimomorin@gmail.com>
10
11 * parser.c (cp_keyword_starts_decl_specifier_p): Do not
12 handle RID_ATTRIBUTE.
13 (cp_parser_constructor_declarator_p): Remove now-redundant
14 checks.
15 (cp_parser_lambda_declarator_opt): Likewise.
16
17 2021-09-23 Michel Morin <mimomorin@gmail.com>
18
19 PR c++/77565
20 * parser.c (cp_keyword_starts_decl_specifier_p): Handle more
21 decl-specifiers (typedef/inline/cv/explicit/virtual/friend).
22
23 2021-09-23 Patrick Palka <ppalka@redhat.com>
24
25 * ptree.c (cxx_print_decl): Dump the DECL_TEMPLATE_RESULT of
26 a TEMPLATE_DECL. Dump the DECL_TEMPLATE_INFO rather than just
27 printing its pointer value.
28
29 2021-09-23 Jakub Jelinek <jakub@redhat.com>
30
31 PR c++/102413
32 * parser.c (cp_parser_omp_directive_args): Diagnose if omp::directive
33 is not followed by a balanced token sequence starting with open paren.
34
35 2021-09-22 Patrick Palka <ppalka@redhat.com>
36
37 DR 2446
38 PR c++/102412
39 * constexpr.c (cxx_eval_constant_expression)
40 <case TEMPLATE_ID_EXPR>: Check value_dependent_expression_p
41 instead of processing_template_decl.
42 * pt.c (value_dependent_expression_p) <case TEMPLATE_ID_EXPR>:
43 Return true only if any_dependent_template_arguments_p.
44 (instantiation_dependent_r) <case CALL_EXPR>: Remove this case.
45 <case TEMPLATE_ID_EXPR>: Likewise.
46
47 2021-09-22 Jakub Jelinek <jakub@redhat.com>
48
49 * parser.c (cp_parser_omp_clause_allocate): Parse allocate clause
50 modifiers.
51 * semantics.c (finish_omp_clauses) <OMP_CLAUSE_ALLOCATE>: Perform
52 semantic analysis of OMP_CLAUSE_ALLOCATE_ALIGN.
53 * pt.c (tsubst_omp_clauses) <case OMP_CLAUSE_ALLOCATE>: Handle
54 also OMP_CLAUSE_ALLOCATE_ALIGN.
55
56 2021-09-22 Barrett Adair <barrettellisadair@gmail.com>
57
58 * pt.c (find_parm_usage_r): New walk_tree callback to find func
59 parms.
60 (any_template_arguments_need_structural_equality_p): New special
61 case.
62
63 2021-09-21 wangpc <pc.wang@linux.alibaba.com>
64
65 * decl.c (start_decl_1): Move verify_type_context to ...
66 (cp_finish_decl): ... to here.
67
68 2021-09-18 Jakub Jelinek <jakub@redhat.com>
69
70 * parser.c (cp_parser_omp_clause_order): Parse unconstrained
71 and reproducible modifiers.
72 (OMP_DISTRIBUTE_CLAUSE_MASK): Add order clause.
73
74 2021-09-18 Jakub Jelinek <jakub@redhat.com>
75
76 * parser.c (cp_parser_omp_clause_default): Handle private and
77 firstprivate arguments, adjust diagnostics on unknown argument.
78 * cp-gimplify.c (cxx_omp_finish_clause): Handle OMP_CLAUSE_PRIVATE.
79
80 2021-09-18 Jason Merrill <jason@redhat.com>
81
82 * cp-tree.h (dependentish_scope_p): Declare.
83 * pt.c (dependentish_scope_p): New.
84 * parser.c (cp_parser_lookup_name): Return a TYPENAME_TYPE
85 for lookup of a type in a dependent object.
86 (cp_parser_template_id): Handle TYPENAME_TYPE.
87 (cp_parser_template_name): If we're looking for a type,
88 a name followed by < names a template.
89
90 2021-09-18 Jason Merrill <jason@redhat.com>
91
92 * cp-tree.h: Fix typo in LANG_FLAG list.
93
94 2021-09-17 Jakub Jelinek <jakub@redhat.com>
95
96 * cp-tree.h (finish_omp_atomic): Add r and weak arguments.
97 * parser.c (cp_parser_omp_atomic): Update function comment for
98 OpenMP 5.1 atomics, parse OpenMP 5.1 atomics and fail, compare and
99 weak clauses.
100 * semantics.c (finish_omp_atomic): Add r and weak arguments, handle
101 them, handle COND_EXPRs.
102 * pt.c (tsubst_expr): Adjust for COND_EXPR forms that
103 finish_omp_atomic can now produce.
104
105 2021-09-16 Patrick Palka <ppalka@redhat.com>
106
107 PR c++/98486
108 * constraint.cc (get_normalized_constraints_from_decl): Always
109 look up constraints using the most general template.
110 * decl.c (grokdeclarator): Set constraints on a static data
111 member template.
112 * pt.c (determine_specialization): Check constraints on a
113 variable template.
114
115 2021-09-16 Iain Sandoe <iain@sandoe.co.uk>
116
117 * coroutines.cc (await_statement_walker): Code cleanups.
118
119 2021-09-16 Jason Merrill <jason@redhat.com>
120
121 * constexpr.c (cxx_eval_outermost_constant_expr): Use
122 protected_set_expr_location.
123
124 2021-09-15 Patrick Palka <ppalka@redhat.com>
125
126 PR c++/101904
127 * call.c (build_user_type_conversion_1): Add tf_conv to complain.
128 (add_candidates): When in a SFINAE context, instead of adding a
129 candidate to bad_fns just mark it unviable.
130
131 2021-09-15 Jason Merrill <jason@redhat.com>
132
133 * cp-tree.h (parsing_function_declarator): Declare.
134 * name-lookup.c (set_decl_context_in_fn): Use it.
135 * parser.c (cp_parser_direct_declarator): Use it.
136 (parsing_function_declarator): New.
137
138 2021-09-15 Jakub Jelinek <jakub@redhat.com>
139
140 PR c++/88578
141 PR c++/102295
142 * typeck2.c (split_nonconstant_init_1): Don't throw away empty
143 initializers of flexible array members if they have non-zero type
144 size.
145
146 2021-09-15 Patrick Palka <ppalka@redhat.com>
147
148 PR c++/102050
149 * decl.c (grok_special_member_properties): Set
150 TYPE_HAS_COPY_CTOR, TYPE_HAS_DEFAULT_CONSTRUCTOR
151 and TYPE_HAS_LIST_CTOR independently from each other.
152
153 2021-09-15 Jason Merrill <jason@redhat.com>
154
155 * decl.c (cxx_init_decl_processing): Only warn about odd
156 interference sizes if they were specified with --param.
157
158 2021-09-15 Jason Merrill <jason@redhat.com>
159
160 PR c++/48396
161 * cp-tree.h (enum cp_tree_index): Remove CPTI_TYPE_INFO_PTR_TYPE.
162 (type_info_ptr_type): Remove.
163 * rtti.c (init_rtti_processing): Don't predeclare std::type_info.
164 (typeid_ok_p): Check for null const_type_info_type_node.
165 (type_info_ptr_type, get_void_tinfo_ptr): New fns.
166 (get_tinfo_decl_dynamic, get_tinfo_ptr): Use them.
167 (ptr_initializer, ptm_initializer, get_pseudo_ti_init): Use them.
168 (get_tinfo_desc): Use const_ptr_type_node.
169
170 2021-09-15 Jason Merrill <jason@redhat.com>
171
172 * parser.c (cp_parser_template_name): Move object type.
173 (cp_parser_pre_parsed_nested_name_specifier): Likewise.
174
175 2021-09-15 Jason Merrill <jason@redhat.com>
176
177 * parser.c (cp_parser_unqualified_id): Only complain about ~A<T> in
178 a declarator.
179
180 2021-09-14 Iain Sandoe <iain@sandoe.co.uk>
181
182 * coroutines.cc (struct param_info): Add copy_var.
183 (build_actor_fn): Use simplified param references.
184 (register_param_uses): Likewise.
185 (rewrite_param_uses): Likewise.
186 (analyze_fn_parms): New function.
187 (coro_rewrite_function_body): Add proxies for the fn
188 parameters to the outer bind scope of the rewritten code.
189 (morph_fn_to_coro): Use simplified version of param ref.
190
191 2021-09-14 Iain Sandoe <iain@sandoe.co.uk>
192
193 * coroutines.cc (coro_resume_fn_id, coro_destroy_fn_id,
194 coro_promise_id, coro_frame_needs_free_id, coro_resume_index_id,
195 coro_self_handle_id, coro_actor_continue_id,
196 coro_frame_i_a_r_c_id): New.
197 (coro_init_identifiers): Initialize new name identifiers.
198 (coro_promise_type_found_p): Use pre-built identifiers.
199 (struct await_xform_data): Remove unused fields.
200 (transform_await_expr): Delete code that is now unused.
201 (build_actor_fn): Simplify interface, use pre-built identifiers and
202 remove transforms that are no longer needed.
203 (build_destroy_fn): Use revised field names.
204 (register_local_var_uses): Use pre-built identifiers.
205 (coro_rewrite_function_body): Simplify interface, use pre-built
206 identifiers. Generate proxy vars in the outer bind expr scope for the
207 implementation state that we wish to expose.
208 (morph_fn_to_coro): Adjust comments for new variable names, use pre-
209 built identifiers. Remove unused code to generate frame entries for
210 the implementation state. Adjust call for build_actor_fn.
211
212 2021-09-14 Patrick Palka <ppalka@redhat.com>
213
214 PR c++/102163
215 * constexpr.c (cxx_eval_call_expression): After evaluating a
216 subobject constructor call for an empty union member, produce a
217 side effect that makes sure the member gets activated.
218
219 2021-09-14 Jakub Jelinek <jakub@redhat.com>
220
221 PR c++/102295
222 * decl.c (layout_var_decl): For aggregates ending with a flexible
223 array member, add the size of the initializer for that member to
224 DECL_SIZE and DECL_SIZE_UNIT.
225
226 2021-09-14 Jakub Jelinek <jakub@redhat.com>
227
228 PR c++/102305
229 * method.c (is_xible_helper): Call complete_type on to.
230
231 2021-09-14 Jason Merrill <jason@redhat.com>
232
233 * decl.c (cxx_init_decl_processing): Don't warn if L1 cache line
234 size is smaller than maxalign.
235
236 2021-09-13 Jason Merrill <jason@redhat.com>
237
238 * constexpr.c (maybe_warn_about_constant_value):
239 Complain about std::hardware_destructive_interference_size.
240 (cxx_eval_constant_expression): Call it.
241 * decl.c (cxx_init_decl_processing): Check
242 --param *-interference-size values.
243
244 2021-09-13 Patrick Palka <ppalka@redhat.com>
245
246 PR c++/101764
247 * cp-tree.h (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): New accessor
248 macro.
249 * pt.c (has_extra_args_mechanism_p): New function.
250 (find_parameter_pack_data::found_extra_args_tree_p): New data
251 member.
252 (find_parameter_packs_r): Set ppd->found_extra_args_tree_p
253 appropriately.
254 (make_pack_expansion): Set PACK_EXPANSION_FORCE_EXTRA_ARGS_P if
255 ppd.found_extra_args_tree_p.
256 (use_pack_expansion_extra_args_p): Return true if there were
257 unsubstituted packs and PACK_EXPANSION_FORCE_EXTRA_ARGS_P.
258 (tsubst_pack_expansion): Pass the pack expansion to
259 use_pack_expansion_extra_args_p.
260
261 2021-09-10 Jakub Jelinek <jakub@redhat.com>
262
263 * parser.c (cp_parser_omp_atomic): Allow acq_rel on atomic read/write
264 and acq_rel/acquire clauses on update.
265 * semantics.c (finish_omp_atomic): Adjust c_finish_omp_atomic caller.
266
267 2021-09-08 Richard Biener <rguenther@suse.de>
268
269 PR c++/102228
270 * cp-tree.h (ANON_AGGR_TYPE_FIELD): New define.
271 * decl.c (fixup_anonymous_aggr): Wipe RTTI info put in
272 place on invalid code.
273 * decl2.c (reset_type_linkage): Guard CLASSTYPE_TYPEINFO_VAR
274 access.
275 * module.cc (trees_in::read_class_def): Likewise. Reconstruct
276 ANON_AGGR_TYPE_FIELD.
277 * semantics.c (finish_member_declaration): Populate
278 ANON_AGGR_TYPE_FIELD for anon aggregate typed members.
279 * typeck.c (lookup_anon_field): Remove DFS search and return
280 ANON_AGGR_TYPE_FIELD directly.
281
282 2021-09-07 Jakub Jelinek <jakub@redhat.com>
283
284 PR c++/100495
285 * constexpr.c (maybe_save_constexpr_fundef): Save body even for
286 constexpr deleting dtors.
287 (cxx_eval_call_expression): Don't use DECL_CLONED_FUNCTION for
288 deleting dtors.
289
290 2021-09-07 Marcel Vollweiler <marcel@codesourcery.com>
291
292 * parser.c (cp_parser_omp_flush): Parse 'seq_cst' clause on 'flush'
293 directive.
294 * semantics.c (finish_omp_flush): Handle MEMMODEL_SEQ_CST.
295
296 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
297
298 * coroutines.cc (register_local_var_uses): Do not mangle
299 frame entries for the outermost scope. Record the outer
300 scope as nesting depth 0.
301
302 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
303
304 * coroutines.cc (coro_build_artificial_var): New.
305 (build_actor_fn): Use var builder, rename vars to use
306 implementation namespace.
307 (coro_rewrite_function_body): Likewise.
308 (morph_fn_to_coro): Likewise.
309
310 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
311
312 * coroutines.cc (transform_local_var_uses): Record
313 frame offset expressions as DECL_VALUE_EXPRs instead of
314 rewriting them.
315
316 2021-09-03 Patrick Palka <ppalka@redhat.com>
317
318 PR c++/101904
319 * call.c (build_this_conversion): New function, split out from
320 add_function_candidate.
321 (add_function_candidate): New parameter shortcut_bad_convs.
322 Document it. Use build_this_conversion. Stop at the first bad
323 argument conversion when shortcut_bad_convs is true.
324 (add_template_candidate_real): New parameter shortcut_bad_convs.
325 Use build_this_conversion to check the 'this' conversion before
326 attempting deduction. When the rejection reason code is
327 rr_bad_arg_conversion, pass -1 instead of 0 as the viable
328 parameter to add_candidate. Pass 'convs' to add_candidate.
329 (add_template_candidate): New parameter shortcut_bad_convs.
330 (add_template_conv_candidate): Pass false as shortcut_bad_convs
331 to add_template_candidate_real.
332 (add_candidates): Prefer to shortcut bad conversions during
333 overload resolution under the assumption that we'll eventually
334 see a strictly viable candidate. If this assumption turns out
335 to be false, re-process the non-strictly viable candidates
336 without shortcutting those bad conversions.
337
338 2021-09-03 Jason Merrill <jason@redhat.com>
339
340 * pt.c (limit_bad_template_recursion): Suppress -Wunused for decls
341 we decide not to instantiate.
342
343 2021-09-03 Jakub Jelinek <jakub@redhat.com>
344
345 PR target/102024
346 * class.c (build_base_field): Use SET_DECL_FIELD_ABI_IGNORED
347 instead of writing to DECL_FIELD_ABI_IGNORED.
348 (layout_class_type): Likewise. In the place where zero-width
349 bitfields used to be removed, use
350 SET_DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD on those fields instead.
351
352 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
353
354 * call.c (build_over_call): Handle unavailable state in addition to
355 deprecation.
356 * class.c (type_build_ctor_call): Likewise.
357 (type_build_dtor_call): Likewise.
358 * cp-tree.h: Rename cp_warn_deprecated_use to
359 cp_handle_deprecated_or_unavailable.
360 * decl.c (duplicate_decls): Merge unavailability.
361 (grokdeclarator): Handle unavailability in addition to deprecation.
362 (type_is_unavailable): New.
363 (grokparms): Handle unavailability in addition to deprecation.
364 * decl.h (enum deprecated_states): Add
365 UNAVAILABLE_DEPRECATED_SUPPRESS.
366 * decl2.c (cplus_decl_attributes): Propagate unavailability to
367 templates.
368 (cp_warn_deprecated_use): Rename to ...
369 (cp_handle_deprecated_or_unavailable): ... this and amend to handle
370 the unavailable case. It remains a warning in the case of deprecation
371 but becomes an error in the case of unavailability.
372 (cp_warn_deprecated_use_scopes): Handle unavailability.
373 (mark_used): Likewise.
374 * parser.c (cp_parser_template_name): Likewise.
375 (cp_parser_template_argument): Likewise.
376 (cp_parser_parameter_declaration_list): Likewise.
377 * typeck.c (build_class_member_access_expr): Likewise.
378 (finish_class_member_access_expr): Likewise.
379 * typeck2.c (build_functional_cast_1): Likewise.
380
381 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
382
383 * coroutines.cc (build_actor_fn): Add begin/finish clauses
384 to the initial test in the actor function.
385
386 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
387
388 * coroutines.cc (await_statement_walker): Use build_stmt and
389 add_stmt instead of build1 and finish_expr_stmt.
390
391 2021-08-31 Jason Merrill <jason@redhat.com>
392
393 * coroutines.cc (flatten_await_stmt): Fix copyo.
394 * decl.c (reshape_init_class): Simplify.
395 * module.cc (module_state::read_language): Add null check.
396 * parser.c (build_range_temp): Avoid type_uses_auto.
397 (cp_parser_class_specifier_1): Add null check.
398
399 2021-08-31 Patrick Palka <ppalka@redhat.com>
400
401 PR c++/12672
402 * call.c (rejection_reason::call_varargs_p): Rename this
403 previously unused member to ...
404 (rejection_reason::least_p): ... this.
405 (arity_rejection): Add least_p parameter.
406 (add_template_candidate_real): When there are explicit
407 template arguments, check that the arity of the call agrees with
408 the arity of the function before attempting deduction.
409 (print_arity_information): Add least_p parameter.
410 (print_z_candidate): Adjust call to print_arity_information.
411
412 2021-08-31 Martin Sebor <msebor@redhat.com>
413
414 * parser.c (cp_parser_selection_statement): Use direct initialization
415 instead of copy.
416
417 2021-08-31 Jason Merrill <jason@redhat.com>
418
419 * constexpr.c (explain_invalid_constexpr_fn): Use iloc_sentinel.
420
421 2021-08-31 Jason Merrill <jason@redhat.com>
422
423 PR c++/92193
424 * cp-tree.h (FNDECL_MANIFESTLY_CONST_EVALUATED): New.
425 * constexpr.c (cxx_eval_call_expression): Set it.
426 * pt.c (neglectable_inst_p): Check it.
427
428 2021-08-31 Marcel Vollweiler <marcel@codesourcery.com>
429
430 * parser.c (cp_parser_omp_clause_device): Parse device-modifiers 'device_num'
431 and 'ancestor' in 'target device' clauses.
432 * semantics.c (finish_omp_clauses): Error handling. Constant device ids must
433 evaluate to '1' if 'ancestor' is used.
434
435 2021-08-30 Jason Merrill <jason@redhat.com>
436
437 PR c++/96286
438 * cp-tree.h (struct lang_type): Add erroneous bit-field.
439 (CLASSTYPE_ERRONEOUS): New.
440 * pt.c (limit_bad_template_recursion): Check it.
441 (instantiate_class_template_1): Set it.
442
443 2021-08-30 Jason Merrill <jason@redhat.com>
444
445 * constexpr.c (cxx_eval_outermost_constant_expr): Copy
446 expr location to result.
447
448 2021-08-30 Jason Merrill <jason@redhat.com>
449
450 PR c++/101460
451 * cp-tree.h (cxx_constant_value_sfinae): Declare.
452 * constexpr.c (cxx_constant_value_sfinae): New.
453 * pt.c (fold_targs_r, maybe_fold_fn_template_args): New.
454 (tsubst_copy_and_build) [CALL_EXPR]: Call
455 maybe_fold_fn_template_args.
456
457 2021-08-30 Jason Merrill <jason@redhat.com>
458
459 * parser.c (cp_parser_simple_requirement): Warn about missing
460 requires.
461
462 2021-08-27 Jason Merrill <jason@redhat.com>
463
464 * typeck2.c (build_x_arrow): Do set TREE_TYPE when operand is
465 a dependent pointer.
466
467 2021-08-25 Andrew Pinski <apinski@marvell.com>
468
469 PR c++/66590
470 * cp-objcp-common.c (cxx_block_may_fallthru): Handle
471 CLEANUP_STMT for the case which will be try/finally.
472
473 2021-08-25 Jakub Jelinek <jakub@redhat.com>
474
475 PR c++/102019
476 * init.c (build_value_init_noctor): Ignore unnamed zero-width
477 bitfields.
478
479 2021-08-23 Jakub Jelinek <jakub@redhat.com>
480
481 * parser.c (cp_parser_omp_clause_num_tasks,
482 cp_parser_omp_clause_grainsize): Parse the optional strict: modifier.
483
484 2021-08-20 Jakub Jelinek <jakub@redhat.com>
485
486 * parser.c (cp_parser_handle_statement_omp_attributes): Determine if
487 PRAGMA_OMP_ERROR directive is C_OMP_DIR_STANDALONE.
488 (cp_parser_omp_error): New function.
489 (cp_parser_pragma): Handle PRAGMA_OMP_ERROR.
490
491 2021-08-20 Jakub Jelinek <jakub@redhat.com>
492
493 * parser.c (cp_parser_omp_clause_depend_sink): Reject spurious
494 comma at the end of list. Don't parse closing paren here...
495 (cp_parser_omp_clause_depend): ... but here instead.
496
497 2021-08-19 Patrick Palka <ppalka@redhat.com>
498
499 PR c++/101803
500 * cp-tree.h (CONSTRUCTOR_IS_PAREN_INIT): Clarify comment.
501
502 2021-08-19 Jakub Jelinek <jakub@redhat.com>
503
504 * parser.c (cp_parser_omp_requires): Don't call cp_lexer_nth_token_is
505 and optionally consume token if current token is CPP_EOF,
506 CPP_PRAGMA_EOL or CPP_CLOSE_PAREN.
507
508 2021-08-19 Jakub Jelinek <jakub@redhat.com>
509
510 * parser.c (cp_parser_omp_nothing): Use cp_parser_require_pragma_eol
511 instead of cp_parser_skip_to_pragma_eol.
512
513 2021-08-18 Patrick Palka <ppalka@redhat.com>
514
515 PR c++/101344
516 PR c++/101803
517 * cp-tree.h (CONSTRUCTOR_BRACES_ELIDED_P): Define.
518 * decl.c (reshape_init_r): Set it.
519 * pt.c (collect_ctor_idx_types): Recurse into a sub-CONSTRUCTOR
520 iff CONSTRUCTOR_BRACES_ELIDED_P.
521
522 2021-08-18 Patrick Palka <ppalka@redhat.com>
523
524 PR c++/101883
525 * pt.c (convert_template_argument): Pass LOOKUP_IMPLICIT to
526 do_auto_deduction.
527
528 2021-08-18 Jakub Jelinek <jakub@redhat.com>
529
530 * parser.c (cp_parser_omp_nothing): New function.
531 (cp_parser_pragma): Handle PRAGMA_OMP_NOTHING.
532
533 2021-08-18 Jakub Jelinek <jakub@redhat.com>
534
535 * parser.c (cp_parser_omp_ordered): Return true instead of
536 false after emitting errors that the directive is not allowed in
537 pragma_stmt context.
538 (cp_parser_omp_target_update): Likewise.
539 (cp_parser_omp_cancellation_point): Change return type from void to
540 bool, return false if the directive should be ignored in pragma_stmt
541 contexts.
542 (cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data):
543 Change return type from tree to bool, return false if the
544 directive should be ignored in pragma_stmt contexts.
545 (cp_parser_omp_target): Adjust callers of cp_parser_omp_target_*_data,
546 return their result directly.
547 (cp_parser_pragma): For PRAGMA_OMP_CANCELLATION_POINT return what
548 cp_parser_omp_cancellation_point returned. Return true instead of
549 false after emitting errors that the directive is not allowed in
550 pragma_stmt context.
551
552 2021-08-17 Jakub Jelinek <jakub@redhat.com>
553
554 PR c++/101539
555 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_LAYOUT_COMPATIBLE.
556 (enum cp_built_in_function): Add CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
557 (fold_builtin_is_corresponding_member, next_common_initial_seqence,
558 layout_compatible_type_p): Declare.
559 * parser.c (cp_parser_primary_expression): Handle
560 RID_IS_LAYOUT_COMPATIBLE.
561 (cp_parser_trait_expr): Likewise.
562 * cp-objcp-common.c (names_builtin_p): Likewise.
563 * constraint.cc (diagnose_trait_expr): Handle
564 CPTK_IS_LAYOUT_COMPATIBLE.
565 * decl.c (cxx_init_decl_processing): Register
566 __builtin_is_corresponding_member builtin.
567 * constexpr.c (cxx_eval_builtin_function_call): Handle
568 CP_BUILT_IN_IS_CORRESPONDING_MEMBER builtin.
569 * semantics.c (is_corresponding_member_union,
570 is_corresponding_member_aggr, fold_builtin_is_corresponding_member):
571 New functions.
572 (trait_expr_value): Handle CPTK_IS_LAYOUT_COMPATIBLE.
573 (finish_trait_expr): Likewise.
574 * typeck.c (next_common_initial_seqence, layout_compatible_type_p):
575 New functions.
576 * cp-gimplify.c (cp_gimplify_expr): Fold
577 CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
578 (cp_fold): Likewise.
579 * tree.c (builtin_valid_in_constant_expr_p): Handle
580 CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
581 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
582 CPTK_IS_LAYOUT_COMPATIBLE.
583 * class.c (remove_zero_width_bit_fields): Remove.
584 (layout_class_type): Don't call it.
585
586 2021-08-17 Jakub Jelinek <jakub@redhat.com>
587
588 * parser.c (OMP_SCOPE_CLAUSE_MASK): Define.
589 (cp_parser_omp_scope): New function.
590 (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_SCOPE.
591 * pt.c (tsubst_expr): Handle OMP_SCOPE.
592
593 2021-08-12 Jakub Jelinek <jakub@redhat.com>
594
595 * parser.c (cp_parser_omp_clause_name): Parse filter clause name.
596 (cp_parser_omp_clause_filter): New function.
597 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FILTER.
598 (OMP_MASKED_CLAUSE_MASK): Define.
599 (cp_parser_omp_masked): New function.
600 (cp_parser_omp_parallel): Handle parallel masked.
601 (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_MASKED.
602 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_FILTER.
603 * pt.c (tsubst_omp_clauses): Likewise.
604 (tsubst_expr): Handle OMP_MASKED.
605
606 2021-08-12 Sergei Trofimovich <siarheit@google.com>
607
608 PR c++/101219
609 * pt.c (tsubst_copy_and_build): Use build_ptrmemfunc_access_expr
610 to construct ptrmemfunc expression instantiation.
611
612 2021-08-12 Tobias Burnus <tobias@codesourcery.com>
613
614 * parser.c (cp_parser_omp_clause_proc_bind): Accept
615 'primary' as alias for 'master'.
616
617 2021-08-12 Jakub Jelinek <jakub@redhat.com>
618
619 * cp-tree.h (omp_declare_target_attr): New type.
620 (struct saved_scope): Change type of omp_declare_target_attribute
621 from int to vec<omp_declare_target_attr, va_gc> * and move it.
622 * parser.c (cp_parser_omp_declare_target): Instead of
623 incrementing scope_chain->omp_declare_target_attribute, push
624 a struct containing parser->lexer->in_omp_attribute_pragma to
625 the vector.
626 (cp_parser_omp_end_declare_target): Instead of decrementing
627 scope_chain->omp_declare_target_attribute, pop a structure
628 from it. Diagnose mismatching declare target vs.
629 end declare target syntax.
630 * semantics.c (finish_translation_unit): Use vec_safe_length
631 and vec_safe_truncate on scope_chain->omp_declare_target_attributes.
632 * decl2.c (cplus_decl_attributes): Use vec_safe_length
633 on scope_chain->omp_declare_target_attributes.
634
635 2021-08-12 Jakub Jelinek <jakub@redhat.com>
636
637 * parser.c (cp_parser_lambda_body): Add temp overrides
638 for parser->{omp_declare_simd,oacc_routine,omp_attrs_forbidden_p}.
639 (cp_parser_statement): Restore parser->omp_attrs_forbidden_p for
640 cp_parser_declaration_statement.
641 (cp_parser_default_argument): Add temp override for
642 parser->omp_attrs_forbidden_p.
643 (cp_parser_late_parsing_omp_declare_simd): Diagnose declare simd
644 or declare variant in attribute syntax on a declaration immediately
645 following an OpenMP construct in pragma syntax.
646
647 2021-08-12 Jakub Jelinek <jakub@redhat.com>
648
649 PR c++/94162
650 * method.c (cat_tag_for): Return cc_last for !CLASS_TYPE_P
651 or for classes not in std namespace.
652
653 2021-08-12 Jakub Jelinek <jakub@redhat.com>
654
655 * name-lookup.c (finish_using_directive): Diagnose omp::directive
656 or omp::sequence attributes on using-directive.
657
658 2021-08-12 Jakub Jelinek <jakub@redhat.com>
659
660 * parser.c (cp_parser_block_declaration): Call
661 cp_parser_using_directive for C++11 attributes followed by
662 using namespace tokens.
663 (cp_parser_using_directive): Parse C++11 attributes at the start
664 of the directive rather than at the end, only parse GNU attributes
665 at the end.
666
667 2021-08-12 Patrick Palka <ppalka@redhat.com>
668
669 PR c++/101663
670 * constexpr.c (cxx_eval_store_expression): Handle the lval=true
671 case in the early exit code path for empty stores with mismatched
672 types.
673
674 2021-08-11 Patrick Palka <ppalka@redhat.com>
675
676 PR c++/101725
677 DR 2082
678 * cp-tree.h (unevaluated_p): Return true for REQUIRES_EXPR.
679 * decl.c (local_variable_p_walkfn): Don't walk into unevaluated
680 operands.
681 * parser.c (cp_parser_primary_expression) <case CPP_NAME>: Never
682 reject uses of local variables in unevaluated contexts.
683 * tree.c (cp_walk_subtrees) <case REQUIRES_EXPR>: Increment
684 cp_unevaluated_operand. Use cp_walk_tree directly instead of
685 WALK_SUBTREE to avoid the goto. Use REQUIRES_EXPR_REQS instead
686 of TREE_OPERAND directly.
687
688 2021-08-11 Jakub Jelinek <jakub@redhat.com>
689
690 PR c++/101786
691 * decl2.c (var_defined_without_dynamic_init): Return true for
692 DECL_DECLARED_CONSTINIT_P with complete type and trivial destructor.
693
694 2021-08-11 Patrick Palka <ppalka@redhat.com>
695
696 PR c++/79501
697 * parser.c (maybe_adjust_declarator_for_dguide): New, split
698 out from ...
699 (cp_parser_init_declarator): ... here.
700 (cp_parser_member_declaration): Use it.
701
702 2021-08-11 Patrick Palka <ppalka@redhat.com>
703
704 PR c++/89062
705 * parser.c (cp_parser_parameter_declaration_list): Don't call
706 grokdeclarator if cp_parser_error_occurred.
707 (cp_parser_parameter_declaration): Simulate an error if we see
708 the beginning of a CTAD form, i.e. if we see an opening brace
709 after the decl-specifier-seq and the type is a CTAD placeholder.
710
711 2021-08-10 Jakub Jelinek <jakub@redhat.com>
712
713 * parser.c (cp_parser_member_declaration): Move odsd declaration
714 before cp_parser_using_declaration call to avoid errors with
715 GCC 4.8 to 6.
716
717 2021-08-10 Jakub Jelinek <jakub@redhat.com>
718
719 * parser.h (struct cp_omp_declare_simd_data): Remove
720 in_omp_attribute_pragma and clauses members, add loc and attribs.
721 (struct cp_oacc_routine_data): Remove loc member, add clauses
722 member.
723 * parser.c (cp_finalize_omp_declare_simd): New function.
724 (cp_parser_handle_statement_omp_attributes): Mention in
725 function comment the function is used also for
726 attribute-declaration.
727 (cp_parser_handle_directive_omp_attributes): New function.
728 (cp_parser_statement): Don't call
729 cp_parser_handle_statement_omp_attributes if statement doesn't
730 have attribute-specifier-seq at the beginning at all or if
731 if those attributes don't appertain to the statement.
732 (cp_parser_simple_declaration): Call
733 cp_parser_handle_directive_omp_attributes and
734 cp_finalize_omp_declare_simd.
735 (cp_parser_explicit_instantiation): Likewise.
736 (cp_parser_init_declarator): Initialize prefix_attributes
737 only after parsing declarators.
738 (cp_parser_direct_declarator): Call
739 cp_parser_handle_directive_omp_attributes and
740 cp_finalize_omp_declare_simd.
741 (cp_parser_member_declaration): Likewise.
742 (cp_parser_single_declaration): Likewise.
743 (cp_parser_omp_declare_simd): Don't initialize
744 data.in_omp_attribute_pragma, instead initialize
745 data.attribs[0] and data.attribs[1].
746 (cp_finish_omp_declare_variant): Remove
747 in_omp_attribute_pragma argument, instead use
748 parser->lexer->in_omp_attribute_pragma.
749 (cp_parser_late_parsing_omp_declare_simd): Adjust
750 cp_finish_omp_declare_variant caller. Handle attribute-syntax
751 declare simd/variant.
752
753 2021-08-06 Tamar Christina <tamar.christina@arm.com>
754
755 * cp-objcp-common.h (cxx_simulate_enum_decl): Pass vec<> by pointer.
756 * decl.c (cxx_simulate_enum_decl): Likewise.
757
758 2021-08-04 Jakub Jelinek <jakub@redhat.com>
759
760 PR c++/101759
761 * parser.c (cp_parser_default_argument): Temporarily override
762 parser->omp_declare_simd and parser->oacc_routine to NULL.
763
764 2021-08-02 Patrick Palka <ppalka@redhat.com>
765
766 PR c++/100828
767 * logic.cc (formula::formula): Use emplace_back instead of
768 push_back.
769 (formula::branch): Insert a copy of m_current directly after
770 m_current instead of at the end of the list.
771 (formula::erase): Define.
772 (decompose_formula): Remove.
773 (decompose_antecedents): Remove.
774 (decompose_consequents): Remove.
775 (derive_proofs): Remove.
776 (max_problem_size): Remove.
777 (diagnose_constraint_size): Remove.
778 (subsumes_constraints_nonnull): Rewrite directly in terms of
779 decompose_clause and derive_proof, interleaving decomposition
780 with implication checking. Remove limit on constraint complexity.
781 Use formula::erase to free the current clause before moving on to
782 the next one.
783
784 2021-07-31 Jason Merrill <jason@redhat.com>
785
786 PR c++/96636
787 * decl.c (fixup_anonymous_aggr): Clear TYPE_NEEDS_CONSTRUCTING
788 after error.
789
790 2021-07-31 Jason Merrill <jason@redhat.com>
791
792 * ptree.c (cxx_print_type) [TYPE_PACK_EXPANSION]: Also print
793 PACK_EXPANSION_PATTERN.
794
795 2021-07-31 Jakub Jelinek <jakub@redhat.com>
796
797 * parser.c (cp_parser_declaration): Handle OpenMP directives
798 in attribute-declaration.
799
800 2021-07-30 Jakub Jelinek <jakub@redhat.com>
801
802 PR c++/101539
803 * cp-tree.h (enum cp_trait_kind): Add
804 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
805 (enum cp_built_in_function): Add
806 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.
807 (fold_builtin_is_pointer_inverconvertible_with_class): Declare.
808 * parser.c (cp_parser_primary_expression): Handle
809 RID_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
810 (cp_parser_trait_expr): Likewise.
811 * cp-objcp-common.c (names_builtin_p): Likewise.
812 * constraint.cc (diagnose_trait_expr): Handle
813 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
814 * decl.c (cxx_init_decl_processing): Register
815 __builtin_is_pointer_interconvertible_with_class builtin.
816 * constexpr.c (cxx_eval_builtin_function_call): Handle
817 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS builtin.
818 * semantics.c (pointer_interconvertible_base_of_p,
819 first_nonstatic_data_member_p,
820 fold_builtin_is_pointer_inverconvertible_with_class): New functions.
821 (trait_expr_value): Handle CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
822 (finish_trait_expr): Likewise. Formatting fix.
823 * cp-gimplify.c (cp_gimplify_expr): Fold
824 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS. Call
825 fndecl_built_in_p just once.
826 (cp_fold): Likewise.
827 * tree.c (builtin_valid_in_constant_expr_p): Handle
828 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS. Call
829 fndecl_built_in_p just once.
830 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
831 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
832
833 2021-07-30 Jason Merrill <jason@redhat.com>
834
835 * class.c (finish_struct_anon): Improve comment.
836 * decl.c (fixup_anonymous_aggr): Reject anonymous struct
837 with bases.
838
839 2021-07-30 Jakub Jelinek <jakub@redhat.com>
840
841 * parser.c (cp_parser_statement): Rollback attributes not just
842 when std_attrs is non-NULL, but whenever
843 cp_parser_std_attribute_spec_seq parsed any tokens.
844
845 2021-07-30 Jakub Jelinek <jakub@redhat.com>
846
847 PR c++/101582
848 * parser.c (cp_parser_skip_std_attribute_spec_seq): Add a forward
849 declaration.
850 (cp_parser_declaration): Parse empty-declaration and
851 attribute-declaration.
852 (cp_parser_toplevel_declaration): Don't parse empty-declaration here.
853
854 2021-07-28 Martin Sebor <msebor@redhat.com>
855
856 * init.c: Include new header.
857
858 2021-07-27 Marek Polacek <polacek@redhat.com>
859
860 DR 1512
861 PR c++/99701
862 * cp-gimplify.c (cp_fold): Remove {LE,LT,GE,GT_EXPR} from
863 a switch.
864 * typeck.c (cp_build_binary_op): Reject ordered comparison
865 of two null pointers.
866
867 2021-07-26 Jakub Jelinek <jakub@redhat.com>
868
869 * parser.h (struct cp_lexer): Add orphan_p member.
870 * parser.c (cp_parser_statement): Don't change in_omp_attribute_pragma
871 upon restart from CPP_PRAGMA handling. Fix up condition when a lexer
872 should be destroyed and adjust saved_tokens if it records tokens from
873 the to be destroyed lexer.
874 (cp_parser_omp_section_scan): New function.
875 (cp_parser_omp_scan_loop_body): Use it. If
876 parser->lexer->in_omp_attribute_pragma, allow optional comma
877 after scan.
878 (cp_parser_omp_sections_scope): Use cp_parser_omp_section_scan.
879
880 2021-07-23 Jakub Jelinek <jakub@redhat.com>
881
882 * parser.h (struct cp_parser): Add omp_attrs_forbidden_p member.
883 * parser.c (cp_parser_handle_statement_omp_attributes): Diagnose
884 mixing of attribute and pragma syntax directives when seeing
885 omp::directive if parser->omp_attrs_forbidden_p or if attribute syntax
886 directives are followed by OpenMP pragma.
887 (cp_parser_statement): Clear parser->omp_attrs_forbidden_p after
888 the cp_parser_handle_statement_omp_attributes call.
889 (cp_parser_omp_structured_block): Add disallow_omp_attrs argument,
890 if true, set parser->omp_attrs_forbidden_p.
891 (cp_parser_omp_scan_loop_body, cp_parser_omp_sections_scope): Pass
892 false as disallow_omp_attrs to cp_parser_omp_structured_block.
893 (cp_parser_omp_parallel, cp_parser_omp_task): Set
894 parser->omp_attrs_forbidden_p.
895
896 2021-07-21 Thomas Schwinge <thomas@codesourcery.com>
897 Joseph Myers <joseph@codesourcery.com>
898 Cesar Philippidis <cesar@codesourcery.com>
899
900 * parser.c (cp_parser_omp_clause_name): Handle 'nohost'.
901 (cp_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
902 (OACC_ROUTINE_CLAUSE_MASK): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
903 * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
904 * semantics.c (finish_omp_clauses): Likewise.
905
906 2021-07-21 Jakub Jelinek <jakub@redhat.com>
907
908 PR c++/101516
909 * semantics.c (finish_omp_reduction_clause): Also call
910 complete_type_or_else and return true if it fails.
911
912 2021-07-19 Iain Sandoe <iain@sandoe.co.uk>
913
914 PR c++/95520
915 * coroutines.cc (struct coroutine_info): Add fields for
916 actor and destroy function decls.
917 (to_ramp): New.
918 (coro_get_ramp_function): New.
919 (coro_get_actor_function): New.
920 (coro_get_destroy_function): New.
921 (act_des_fn): Set up mapping between ramp, actor and
922 destroy functions.
923 (morph_fn_to_coro): Adjust interface to the builder for
924 helper function decls.
925 * cp-tree.h (DECL_ACTOR_FN, DECL_DESTROY_FN, DECL_RAMP_FN,
926 JOIN_STR): New.
927 * mangle.c (write_encoding): Handle coroutine helpers.
928 (write_unqualified_name): Handle lambda coroutine helpers.
929
930 2021-07-16 Patrick Palka <ppalka@redhat.com>
931
932 PR c++/101233
933 * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
934 substituting DECL_ARGUMENTS.
935
936 2021-07-16 Patrick Palka <ppalka@redhat.com>
937
938 DR 960
939 PR c++/99664
940 * search.c (check_final_overrider): Compare TYPE_REF_IS_RVALUE
941 when the return types are references.
942
943 2021-07-16 Marek Polacek <polacek@redhat.com>
944
945 * typeck2.c (check_narrowing): Don't suppress the pedantic error
946 in system headers.
947
948 2021-07-15 Jakub Jelinek <jakub@redhat.com>
949
950 PR c++/101443
951 * cp-gimplify.c (cp_fold): For comparisons with NULLPTR_TYPE
952 operands, fold them right away to true or false.
953
954 2021-07-15 Jason Merrill <jason@redhat.com>
955
956 PR c++/101095
957 * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
958 (cp_tree_size): Remove redundant entries.
959
960 2021-07-14 Patrick Palka <ppalka@redhat.com>
961
962 PR c++/88252
963 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): Remove.
964 * pt.c (push_template_decl): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
965 handling.
966 (redeclare_class_template): Likewise.
967 (forwarding_reference_p): Define.
968 (maybe_adjust_types_for_deduction): Use it instead. Add 'tparms'
969 parameter.
970 (unify_one_argument): Pass tparms to
971 maybe_adjust_types_for_deduction.
972 (try_one_overload): Likewise.
973 (unify): Likewise.
974 (rewrite_template_parm): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
975 handling.
976
977 2021-07-14 Jason Merrill <jason@redhat.com>
978
979 * class.c (struct find_final_overrider_data): Use auto_vec.
980 (find_final_overrider): Remove explicit release.
981 * coroutines.cc (process_conditional): Use auto_vec.
982 * cp-gimplify.c (struct cp_genericize_data): Use auto_vec.
983 (cp_genericize_tree): Remove explicit release.
984 * parser.c (cp_parser_objc_at_property_declaration): Use
985 auto_delete_vec.
986 * semantics.c (omp_reduction_lookup): Use auto_vec.
987
988 2021-07-14 Marek Polacek <polacek@redhat.com>
989
990 PR c++/101371
991 * constexpr.c (cxx_eval_array_reference): Create a new .object
992 and .ctor for the non-aggregate non-scalar case too when
993 value-initializing.
994
995 2021-07-12 Patrick Palka <ppalka@redhat.com>
996
997 PR c++/79501
998 PR c++/100983
999 * decl.c (grokfndecl): Don't require that deduction guides are
1000 declared at namespace scope. Check that class-scope deduction
1001 guides have the same access as the member class template.
1002 (grokdeclarator): Pretend class-scope deduction guides are static.
1003 * search.c (lookup_member): Don't use a BASELINK for (class-scope)
1004 deduction guides.
1005
1006 2021-07-10 Patrick Palka <ppalka@redhat.com>
1007
1008 PR c++/82110
1009 * init.c (build_aggr_init): Return error_mark_node if
1010 expand_aggr_init_1 returns false.
1011 (expand_default_init): Change return type to bool. Return false
1012 on error, true on success.
1013 (expand_aggr_init_1): Likewise.
1014
1015 2021-07-09 Jason Merrill <jason@redhat.com>
1016
1017 PR c++/101098
1018 * decl.c (function_requirements_equivalent_p): Only compare
1019 trailing requirements on a specialization.
1020
1021 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
1022
1023 * coroutines.cc (build_actor_fn): Move common code to
1024 act_des_fn.
1025 (build_destroy_fn): Likewise.
1026 (act_des_fn): Build the void return here. Ensure that the
1027 source location matches the original function.
1028
1029 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
1030
1031 * coroutines.cc
1032 (coro_rewrite_function_body): Connect the replacement
1033 function block to the block nest correctly.
1034
1035 2021-07-09 Patrick Palka <ppalka@redhat.com>
1036
1037 PR c++/101181
1038 * constraint.cc (tsubst_requires_expr): Pass complain/in_decl to
1039 add_extra_args.
1040 * cp-tree.h (add_extra_args): Add complain/in_decl parameters.
1041 * pt.c (build_extra_args): Make a copy of args.
1042 (add_extra_args): Add complain/in_decl parameters. Enable the
1043 code for handling the case where the extra arguments are
1044 dependent.
1045 (tsubst_pack_expansion): Pass complain/in_decl to
1046 add_extra_args.
1047 (tsubst_template_args): Handle missing template arguments.
1048 (tsubst_expr) <case IF_STMT>: Pass complain/in_decl to
1049 add_extra_args.
1050
1051 2021-07-09 Patrick Palka <ppalka@redhat.com>
1052
1053 PR c++/101247
1054 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Just walk the
1055 DECL_CONTEXT.
1056
1057 2021-07-08 Martin Sebor <msebor@redhat.com>
1058
1059 PR bootstrap/101372
1060 * module.cc (identifier): Suppress warning.
1061 (module_state::read_macro_maps): Remove warning suppression.
1062 (module_state::install_macros): Ditto.
1063
1064 2021-07-08 Marek Polacek <polacek@redhat.com>
1065
1066 PR c++/101087
1067 * cp-tree.h (unevaluated_p): New.
1068 * except.c (check_noexcept_r): Use it. Don't walk into
1069 unevaluated operands.
1070
1071 2021-07-08 Martin Sebor <msebor@redhat.com>
1072
1073 PR bootstrap/101374
1074 * module.cc (module_state::read_macro_maps): Temporarily disable
1075 -Warray-bounds.
1076 (module_state::install_macros): Same.
1077
1078 2021-07-06 Martin Sebor <msebor@redhat.com>
1079
1080 * error.c (cp_printer): Remove support for %G and %K.
1081
1082 2021-07-02 Jakub Jelinek <jakub@redhat.com>
1083
1084 * parser.h (struct cp_lexer): Add in_omp_attribute_pragma member.
1085 (struct cp_omp_declare_simd_data): Likewise.
1086 * cp-tree.h (enum cp_tree_index): Add CPTI_OMP_IDENTIFIER.
1087 (omp_identifier): Define.
1088 * parser.c (cp_parser_skip_to_pragma_eol): Handle
1089 in_omp_attribute_pragma CPP_PRAGMA_EOL followed by CPP_EOF.
1090 (cp_parser_require_pragma_eol): Likewise.
1091 (struct cp_omp_attribute_data): New type.
1092 (cp_parser_handle_statement_omp_attributes): New function.
1093 (cp_parser_statement): Handle OpenMP directives in statement's
1094 attribute-specifier-seq.
1095 (cp_parser_omp_directive_args, cp_parser_omp_sequence_args): New
1096 functions.
1097 (cp_parser_std_attribute): Handle omp::directive and omp::sequence
1098 attributes.
1099 (cp_parser_omp_all_clauses): If in_omp_attribute_pragma, allow
1100 a comma also before the first clause.
1101 (cp_parser_omp_allocate): Likewise.
1102 (cp_parser_omp_atomic): Likewise.
1103 (cp_parser_omp_depobj): Likewise.
1104 (cp_parser_omp_flush): Likewise.
1105 (cp_parser_omp_ordered): Likewise.
1106 (cp_parser_omp_declare_simd): Save in_omp_attribute_pragma
1107 into struct cp_omp_declare_simd_data.
1108 (cp_finish_omp_declare_variant): Add in_omp_attribute_pragma
1109 argument. If set, allow a comma also before match clause.
1110 (cp_parser_late_parsing_omp_declare_simd): If in_omp_attribute_pragma,
1111 allow a comma also before the first clause. Adjust
1112 cp_finish_omp_declare_variant caller.
1113 (cp_parser_omp_declare_target): If in_omp_attribute_pragma, allow
1114 a comma also before the first clause.
1115 (cp_parser_omp_declare_reduction_exprs): Likewise.
1116 (cp_parser_omp_requires): Likewise.
1117 * decl.c (initialize_predefined_identifiers): Initialize
1118 omp_identifier.
1119 * decl2.c (cplus_decl_attributes): Reject omp::directive and
1120 omp::sequence attributes.
1121
1122 2021-07-02 Jakub Jelinek <jakub@redhat.com>
1123
1124 PR c/101297
1125 * parser.c (cp_parser_omp_atomic): Consume comma only if it
1126 appears before a CPP_NAME.
1127
1128 2021-07-02 Patrick Palka <ppalka@redhat.com>
1129
1130 PR c++/101247
1131 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
1132 use common_enclosing_class and to not depend on the TREE_TYPE
1133 of outer levels pointing to the corresponding primary template.
1134
1135 2021-07-01 Patrick Palka <ppalka@redhat.com>
1136
1137 PR c++/101194
1138 * constexpr.c (cxx_eval_array_reference): When the element type
1139 is an empty type and the corresponding element is omitted, just
1140 return an empty CONSTRUCTOR instead of attempting value
1141 initialization.
1142
1143 2021-07-01 Patrick Palka <ppalka@redhat.com>
1144
1145 PR c++/96204
1146 * pt.c (finish_template_variable): Pass the partially
1147 instantiated template and its args to instantiate_template.
1148 (instantiate_class_template_1): No need to call
1149 push_nested_class and pop_nested_class around the call to
1150 most_specialized_partial_spec.
1151 (instantiate_template_1): Pass the partially instantiated
1152 template to lookup_template_variable.
1153 (most_specialized_partial_spec): Use push_access_scope_guard
1154 to set the access scope appropriately. Use
1155 deferring_access_check_sentinel to force access to get checked
1156 immediately.
1157 (instantiate_decl): Just pass the VAR_DECL to
1158 most_specialized_partial_spec.
1159
1160 2021-06-30 Patrick Palka <ppalka@redhat.com>
1161
1162 * constraint.cc (get_normalized_constraints_from_decl): Use
1163 push_access_scope_guard instead of push_nested_class_guard.
1164 * cp-tree.h (struct push_nested_class_guard): Replace with ...
1165 (struct push_access_scope_guard): ... this.
1166 * pt.c (push_access_scope): When the argument corresponds to
1167 a class type, push the class instead of its context.
1168 (pop_access_scope): Adjust accordingly.
1169
1170 2021-06-30 Marek Polacek <polacek@redhat.com>
1171
1172 PR c++/100975
1173 DR 2397
1174 * decl.c (create_array_type_for_decl): Allow array of auto.
1175
1176 2021-06-29 Jason Merrill <jason@redhat.com>
1177
1178 * pt.c (instantiate_decl): Only consider partial specializations of
1179 actual variable templates.
1180
1181 2021-06-26 Patrick Palka <ppalka@redhat.com>
1182
1183 PR c++/96204
1184 * pt.c (instantiate_class_template_1): Enter the scope of the
1185 type when calling most_specialized_partial_spec.
1186
1187 2021-06-26 Jason Merrill <jason@redhat.com>
1188
1189 PR c++/101040
1190 PR c++/97566
1191 * class.c (is_empty_field): Handle null argument.
1192 * constexpr.c (cxx_eval_bare_aggregate): Discard initializer
1193 for empty field.
1194
1195 2021-06-26 Marek Polacek <polacek@redhat.com>
1196
1197 PR c++/100752
1198 * parser.c (cp_parser_declarator): Pass flags down to
1199 cp_parser_declarator. Also pass static_p/member_p.
1200
1201 2021-06-25 Martin Sebor <msebor@redhat.com>
1202
1203 * call.c (build_over_call): Replace direct uses of TREE_NO_WARNING
1204 with warning_suppressed_p, suppress_warning, and copy_no_warning, or
1205 nothing if not necessary.
1206 (set_up_extended_ref_temp): Same.
1207 * class.c (layout_class_type): Same.
1208 * constraint.cc (constraint_satisfaction_value): Same.
1209 * coroutines.cc (finish_co_await_expr): Same.
1210 (finish_co_yield_expr): Same.
1211 (finish_co_return_stmt): Same.
1212 (build_actor_fn): Same.
1213 (coro_rewrite_function_body): Same.
1214 (morph_fn_to_coro): Same.
1215 * cp-gimplify.c (genericize_eh_spec_block): Same.
1216 (gimplify_expr_stmt): Same.
1217 (cp_genericize_r): Same.
1218 (cp_fold): Same.
1219 * cp-ubsan.c (cp_ubsan_instrument_vptr): Same.
1220 * cvt.c (cp_fold_convert): Same.
1221 (convert_to_void): Same.
1222 * decl.c (wrapup_namespace_globals): Same.
1223 (grokdeclarator): Same.
1224 (finish_function): Same.
1225 (require_deduced_type): Same.
1226 * decl2.c (no_linkage_error): Same.
1227 (c_parse_final_cleanups): Same.
1228 * except.c (expand_end_catch_block): Same.
1229 * init.c (build_new_1): Same.
1230 (build_new): Same.
1231 (build_vec_delete_1): Same.
1232 (build_vec_init): Same.
1233 (build_delete): Same.
1234 * method.c (defaultable_fn_check): Same.
1235 * parser.c (cp_parser_fold_expression): Same.
1236 (cp_parser_primary_expression): Same.
1237 * pt.c (push_tinst_level_loc): Same.
1238 (tsubst_copy): Same.
1239 (tsubst_omp_udr): Same.
1240 (tsubst_copy_and_build): Same.
1241 * rtti.c (build_if_nonnull): Same.
1242 * semantics.c (maybe_convert_cond): Same.
1243 (finish_return_stmt): Same.
1244 (finish_parenthesized_expr): Same.
1245 (cp_check_omp_declare_reduction): Same.
1246 * tree.c (build_cplus_array_type): Same.
1247 * typeck.c (build_ptrmemfunc_access_expr): Same.
1248 (cp_build_indirect_ref_1): Same.
1249 (cp_build_function_call_vec): Same.
1250 (warn_for_null_address): Same.
1251 (cp_build_binary_op): Same.
1252 (unary_complex_lvalue): Same.
1253 (cp_build_modify_expr): Same.
1254 (build_x_modify_expr): Same.
1255 (convert_for_assignment): Same.
1256
1257 2021-06-24 Patrick Palka <ppalka@redhat.com>
1258
1259 PR c++/98832
1260 * pt.c (maybe_aggr_guide): Handle alias templates appropriately.
1261
1262 2021-06-24 Patrick Palka <ppalka@redhat.com>
1263
1264 PR c++/101182
1265 * constraint.cc (evaluate_requires_expr): Adjust function comment.
1266 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: Move to ...
1267 (cp_fold) <case REQUIRES_EXPR>: ... here.
1268
1269 2021-06-24 Jakub Jelinek <jakub@redhat.com>
1270
1271 * parser.c (cp_omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
1272 C_ORT_OMP for clauses on target construct.
1273 (OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
1274 (cp_parser_omp_target): For non-combined target add
1275 map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION. Pass
1276 C_ORT_OMP_TARGET to finish_omp_clauses.
1277 * semantics.c (handle_omp_array_sections_1): Adjust ort handling
1278 for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
1279 never present on C_ORT_*DECLARE_SIMD.
1280 (handle_omp_array_sections): Likewise.
1281 (finish_omp_clauses): Likewise. Handle OMP_CLAUSE_IN_REDUCTION
1282 on C_ORT_OMP_TARGET, set OMP_CLAUSE_MAP_IN_REDUCTION on
1283 corresponding map clauses.
1284 * pt.c (tsubst_expr): Pass C_ORT_OMP_TARGET instead of C_ORT_OMP for
1285 clauses on target construct.
1286
1287 2021-06-23 Patrick Palka <ppalka@redhat.com>
1288
1289 PR c++/101174
1290 * pt.c (push_access_scope): For artificial deduction guides,
1291 set the access scope to that of the constructor.
1292 (pop_access_scope): Likewise.
1293 (build_deduction_guide): Don't set DECL_CONTEXT on the guide.
1294
1295 2021-06-23 Patrick Palka <ppalka@redhat.com>
1296
1297 PR c++/86439
1298 * call.c (print_error_for_call_failure): Constify 'args' parameter.
1299 (perform_dguide_overload_resolution): Define.
1300 * cp-tree.h: (perform_dguide_overload_resolution): Declare.
1301 * pt.c (do_class_deduction): Use perform_dguide_overload_resolution
1302 instead of build_new_function_call. Don't use tf_decltype or
1303 set cp_unevaluated_operand. Remove unnecessary NULL_TREE tests.
1304
1305 2021-06-21 Patrick Palka <ppalka@redhat.com>
1306
1307 PR c++/67302
1308 * typeck.c (check_return_expr): Call maybe_undo_parenthesized_ref
1309 sooner, before the NRVO handling.
1310
1311 2021-06-21 Patrick Palka <ppalka@redhat.com>
1312
1313 PR c++/80431
1314 * tree.c (bot_replace): Use convert_to_base to build the
1315 conversion to the (morally) virtual base.
1316
1317 2021-06-21 Jakub Jelinek <jakub@redhat.com>
1318
1319 PR inline-asm/100785
1320 * typeck.c (cxx_mark_addressable): Diagnose trying to make
1321 bit-fields addressable.
1322
1323 2021-06-17 Jason Merrill <jason@redhat.com>
1324
1325 PR c++/101106
1326 * decl.c (duplicate_decls): Make 'deleted after first declaration'
1327 pedwarn on by default.
1328
1329 2021-06-17 Jason Merrill <jason@redhat.com>
1330
1331 PR c++/101029
1332 * init.c (build_vec_init): Preserve the type of base.
1333
1334 2021-06-16 Jason Merrill <jason@redhat.com>
1335
1336 PR c++/101078
1337 PR c++/91706
1338 * pt.c (tsubst_baselink): Update binfos in non-dependent case.
1339
1340 2021-06-15 Robin Dapp <rdapp@linux.ibm.com>
1341
1342 * decl.c (duplicate_decls): Likewise.
1343
1344 2021-06-14 Tobias Burnus <tobias@codesourcery.com>
1345
1346 PR c/100913
1347 * parser.c (cp_parser_omp_clause_affinity): No need to set iterator
1348 var in the error case.
1349
1350 2021-06-13 Trevor Saunders <tbsaunde@tbsaunde.org>
1351
1352 * constexpr.c (cxx_eval_call_expression): Iterate over vec<>
1353 with range based for.
1354 (cxx_eval_store_expression): Likewise.
1355 (cxx_eval_loop_expr): Likewise.
1356 * decl.c (wrapup_namespace_globals): Likewise.
1357 (cp_finish_decl): Likewise.
1358 (cxx_simulate_enum_decl): Likewise.
1359 * parser.c (cp_parser_postfix_expression): Likewise.
1360
1361 2021-06-12 Jason Merrill <jason@redhat.com>
1362
1363 PR c++/101029
1364 * init.c (build_vec_init): Shortcut [0] case.
1365
1366 2021-06-12 Jason Merrill <jason@redhat.com>
1367
1368 * pt.c (lookup_template_class_1): Shortcut current_class_type.
1369
1370 2021-06-11 Patrick Palka <ppalka@redhat.com>
1371
1372 DR 1227
1373 PR c++/96560
1374 * pt.c (tsubst_arg_types): Rearrange so that we substitute into
1375 TYPE_ARG_TYPES in forward order while short circuiting
1376 appropriately. Adjust formatting.
1377
1378 2021-06-11 Jakub Jelinek <jakub@redhat.com>
1379
1380 PR c++/100974
1381 * cp-tree.h (struct saved_scope): Add consteval_if_p
1382 member. Formatting fix for the discarded_stmt comment.
1383 (in_consteval_if_p, IF_STMT_CONSTEVAL_P): Define.
1384 * parser.c (cp_parser_lambda_expression): Temporarily disable
1385 in_consteval_if_p when parsing lambda body.
1386 (cp_parser_selection_statement): Parse consteval if.
1387 * decl.c (struct named_label_entry): Add in_consteval_if member.
1388 (level_for_consteval_if): New function.
1389 (poplevel_named_label_1, check_previous_goto_1, check_goto): Handle
1390 consteval if.
1391 * constexpr.c (cxx_eval_builtin_function_call): Clarify in comment
1392 why CP_BUILT_IN_IS_CONSTANT_EVALUATED needs to *non_constant_p
1393 for !ctx->manifestly_const_eval.
1394 (cxx_eval_conditional_expression): For IF_STMT_CONSTEVAL_P evaluate
1395 condition as if it was __builtin_is_constant_evaluated call.
1396 (potential_constant_expression_1): For IF_STMT_CONSTEVAL_P always
1397 recurse on both branches.
1398 * cp-gimplify.c (genericize_if_stmt): Genericize IF_STMT_CONSTEVAL_P
1399 as the else branch.
1400 * pt.c (tsubst_expr) <case IF_STMT>: Copy IF_STMT_CONSTEVAL_P.
1401 Temporarily set in_consteval_if_p when recursing on
1402 IF_STMT_CONSTEVAL_P then branch.
1403 (tsubst_lambda_expr): Temporarily disable
1404 in_consteval_if_p when instantiating lambda body.
1405 * call.c (immediate_invocation_p): Return false when
1406 in_consteval_if_p.
1407
1408 2021-06-11 Marek Polacek <polacek@redhat.com>
1409
1410 PR c++/100995
1411 * constexpr.c (maybe_constexpr_fn): New.
1412 * cp-tree.h (maybe_constexpr_fn): Declare.
1413 * semantics.c (find_std_constant_evaluated_r): New.
1414 (maybe_warn_for_constant_evaluated): New.
1415 (finish_if_stmt_cond): Call it.
1416
1417 2021-06-10 Patrick Palka <ppalka@redhat.com>
1418
1419 PR c++/67829
1420 * pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
1421 the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
1422 a template template parameter, adjust to the
1423 TEMPLATE_TEMPLATE_PARAMETER before falling through.
1424
1425 2021-06-10 Patrick Palka <ppalka@redhat.com>
1426
1427 PR c++/100946
1428 * constraint.cc (normalize_placeholder_type_constraints): When
1429 normalizing a non-templated return-type-requirement, add a dummy
1430 level to initial_parms.
1431
1432 2021-06-08 Marek Polacek <polacek@redhat.com>
1433
1434 PR c++/100065
1435 * decl.c (grokdeclarator): Store a value-dependent
1436 explicit-specifier even for deduction guides.
1437
1438 2021-06-08 Jason Merrill <jason@redhat.com>
1439
1440 * parser.c (cp_parser_string_literal): Adjust diagnostic.
1441
1442 2021-06-08 Jason Merrill <jason@redhat.com>
1443
1444 PR c++/100963
1445 * call.c (perfect_conversion_p): Check check_narrowing.
1446
1447 2021-06-08 Jason Merrill <jason@redhat.com>
1448
1449 PR c++/91706
1450 * name-lookup.c (get_class_binding): Keep a BASELINK.
1451 (set_inherited_value_binding_p): Adjust.
1452 * lambda.c (is_lambda_ignored_entity): Adjust.
1453 * pt.c (lookup_template_function): Copy a BASELINK before
1454 modifying it.
1455
1456 2021-06-08 Jason Merrill <jason@redhat.com>
1457
1458 PR c++/91706
1459 * semantics.c (baselink_for_fns): Fix BASELINK_BINFO.
1460
1461 2021-06-08 Jason Merrill <jason@redhat.com>
1462
1463 * module.cc (duplicate_hash::hash): Comment out.
1464 (trees_in::tree_value): Adjust loop counter.
1465
1466 2021-06-08 Jason Merrill <jason@redhat.com>
1467
1468 PR c++/100102
1469 * init.c (build_offset_ref): Return the BASELINK for a static
1470 member function.
1471
1472 2021-06-07 Patrick Palka <ppalka@redhat.com>
1473
1474 PR c++/100918
1475 * parser.c (cp_parser_lookup_name): Check access of the lookup
1476 result before we potentially adjust an injected-class-name to
1477 its TEMPLATE_DECL.
1478
1479 2021-06-06 Jakub Jelinek <jakub@redhat.com>
1480
1481 PR c/100902
1482 * parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
1483 even when target is combined with other constructs.
1484
1485 2021-06-04 Patrick Palka <ppalka@redhat.com>
1486
1487 PR c++/100893
1488 * pt.c (convert_template_argument): Strip top-level cv-quals
1489 on the substituted type of a non-type template parameter.
1490
1491 2021-06-04 Patrick Palka <ppalka@redhat.com>
1492
1493 PR c++/100102
1494 * pt.c (tsubst_function_decl): Remove old code for reducing
1495 args when it has excess levels.
1496
1497 2021-06-04 Jakub Jelinek <jakub@redhat.com>
1498
1499 PR c++/100872
1500 * name-lookup.c (maybe_save_operator_binding): Add op_attr after all
1501 ATTR_IS_DEPENDENT attributes in the DECL_ATTRIBUTES list rather than
1502 to the start.
1503
1504 2021-06-03 Patrick Palka <ppalka@redhat.com>
1505
1506 PR c++/100592
1507 * decl.c (make_typename_type): After calling
1508 lookup_template_class, adjust the result to its TYPE_NAME and
1509 then consider the tf_keep_type_decl flag.
1510
1511 2021-06-03 Patrick Palka <ppalka@redhat.com>
1512
1513 PR c++/100862
1514 * pt.c (set_current_access_from_decl): Move to ...
1515 * class.c (set_current_access_from_decl): ... here.
1516 (handle_using_decl): Use it to propagate the access of the
1517 using-enum decl to the copy of the imported enumerator.
1518 * cp-tree.h (set_current_access_from_decl): Declare.
1519 * decl.c (build_enumerator): Simplify using make_temp_override
1520 and set_current_access_from_decl.
1521
1522 2021-06-03 Jakub Jelinek <jakub@redhat.com>
1523
1524 PR c++/100859
1525 * semantics.c (handle_omp_array_sections_1): For
1526 OMP_CLAUSE_{AFFINITY,DEPEND} handle FIELD_DECL base using
1527 finish_non_static_data_member and allow this as base.
1528 (finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
1529 after depend only cases. Let this be diagnosed by !lvalue_p
1530 case for OMP_CLAUSE_{AFFINITY,DEPEND} and remove useless
1531 assert.
1532 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_AFFINITY.
1533
1534 2021-06-02 Jason Merrill <jason@redhat.com>
1535
1536 PR c++/100838
1537 * call.c (convert_like_internal): Clear tf_no_cleanup when
1538 recursing.
1539 (build_user_type_conversion_1): Only add ck_rvalue if
1540 LOOKUP_ONLYCONVERTING.
1541
1542 2021-06-01 Patrick Palka <ppalka@redhat.com>
1543
1544 PR c++/65816
1545 * init.c (expand_aggr_init_1): Check
1546 type_has_non_user_provided_default_constructor instead of
1547 type_has_user_provided_constructor.
1548
1549 2021-06-01 Jason Merrill <jason@redhat.com>
1550
1551 PR c++/91859
1552 * call.c (build_op_delete_call): Don't set CALL_FROM_NEW_OR_DELETE_P
1553 for destroying delete.
1554 * init.c (build_delete): Don't clobber before destroying delete.
1555
1556 2021-06-01 Jason Merrill <jason@redhat.com>
1557
1558 PR c++/94492
1559 * decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
1560
1561 2021-05-31 Richard Biener <rguenther@suse.de>
1562
1563 PR c++/88601
1564 * cp-objcp-common.c (names_builtin_p): Handle
1565 RID_BUILTIN_SHUFFLEVECTOR.
1566 * cp-tree.h (build_x_shufflevector): Declare.
1567 * parser.c (cp_parser_postfix_expression): Handle
1568 RID_BUILTIN_SHUFFLEVECTOR.
1569 * pt.c (tsubst_copy_and_build): Handle IFN_SHUFFLEVECTOR.
1570 * typeck.c (build_x_shufflevector): Build either a lowered
1571 VEC_PERM_EXPR or an unlowered shufflevector via a temporary
1572 internal function IFN_SHUFFLEVECTOR.
1573
1574 2021-05-28 Jason Merrill <jason@redhat.com>
1575
1576 * constexpr.c (build_data_member_initialization): Use tsi_range.
1577 (build_constexpr_constructor_member_initializers): Likewise.
1578 (constexpr_fn_retval, cxx_eval_statement_list): Likewise.
1579 (potential_constant_expression_1): Likewise.
1580 * coroutines.cc (await_statement_expander): Likewise.
1581 (await_statement_walker): Likewise.
1582 * module.cc (trees_out::core_vals): Likewise.
1583 * pt.c (tsubst_expr): Likewise.
1584 * semantics.c (set_cleanup_locs): Likewise.
1585
1586 2021-05-28 Jason Merrill <jason@redhat.com>
1587
1588 PR c++/100797
1589 PR c++/95719
1590 * call.c (build_over_call): Adjust base_binfo in
1591 resolves_to_fixed_type_p case.
1592
1593 2021-05-28 Jakub Jelinek <jakub@redhat.com>
1594
1595 PR middle-end/99928
1596 * semantics.c (handle_omp_array_sections): Copy
1597 OMP_CLAUSE_MAP_IMPLICIT.
1598 (finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
1599 marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT. Add
1600 map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
1601 maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
1602 present too. For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
1603 if present in map_head, map_field_head or map_firstprivate_head
1604 bitmaps.
1605
1606 2021-05-28 Tobias Burnus <tobias@codesourcery.com>
1607
1608 * parser.c (cp_parser_omp_clause_affinity): New.
1609 (cp_parser_omp_clause_name, cp_parser_omp_var_list_no_open,
1610 cp_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity
1611 clause.
1612 * semantics.c (handle_omp_array_sections_1, handle_omp_array_sections,
1613 finish_omp_clauses): Likewise.
1614
1615 2021-05-27 Matthias Kretz <kretz@kde.org>
1616
1617 PR c++/100716
1618 * error.c (dump_template_bindings): Include code to print
1619 "[with" and ']', conditional on whether anything is printed at
1620 all. This is tied to whether a semicolon is needed to separate
1621 multiple template parameters. If the template argument repeats
1622 the template parameter (T = T), then skip the parameter.
1623 (dump_substitution): Moved code to print "[with" and ']' to
1624 dump_template_bindings.
1625 (dump_function_decl): Partial revert of PR50828, which masked
1626 TFF_TEMPLATE_NAME for all of dump_function_decl. Now
1627 TFF_TEMPLATE_NAME is masked for the scope of the function and
1628 only carries through to dump_function_name.
1629 (dump_function_name): Avoid calling dump_template_parms if
1630 TFF_TEMPLATE_NAME is set.
1631
1632 2021-05-27 Matthias Kretz <kretz@kde.org>
1633
1634 PR c++/100763
1635 * error.c: Call dump_scope when printing a typedef.
1636
1637 2021-05-27 Patrick Palka <ppalka@redhat.com>
1638
1639 PR c++/99893
1640 * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
1641
1642 2021-05-27 Jason Merrill <jason@redhat.com>
1643
1644 PR c++/86355
1645 * pt.c (use_pack_expansion_extra_args_p): Don't compare
1646 args from the same argument pack.
1647
1648 2021-05-27 Patrick Palka <ppalka@redhat.com>
1649
1650 DR 1315
1651 PR c++/67593
1652 PR c++/96555
1653 * pt.c (process_partial_specialization): Don't error on a
1654 non-simple non-type template argument that involves template
1655 parameters.
1656 (for_each_template_parm_r): Don't walk TRAIT_EXPR, PLUS_EXPR,
1657 MULT_EXPR, or SCOPE_REF when include_nondeduced_p is false.
1658
1659 2021-05-26 Patrick Palka <ppalka@redhat.com>
1660
1661 PR c++/100502
1662 * typeck.c (finish_class_member_access_expr): Disable ahead
1663 of time access checking during the member lookup.
1664
1665 2021-05-26 Patrick Palka <ppalka@redhat.com>
1666
1667 PR c++/100368
1668 * tree.c (build_target_expr_with_type): Don't call force_rvalue
1669 on CALL_EXPR initializer. Simplify now that bot_manip is no
1670 longer a caller.
1671 (bot_manip): Use force_target_expr instead of
1672 build_target_expr_with_type.
1673
1674 2021-05-26 Patrick Palka <ppalka@redhat.com>
1675
1676 PR c++/97420
1677 * cvt.c (noexcept_conv_p): Remove redundant checks and simplify.
1678 (fnptr_conv_p): Don't call non_reference. Use INDIRECT_TYPE_P
1679 instead of TYPE_PTR_P.
1680 * pt.c (convert_nontype_argument_function): Look through
1681 implicit INDIRECT_REFs before calling strip_fnptr_conv.
1682
1683 2021-05-25 Jakub Jelinek <jakub@redhat.com>
1684
1685 PR c++/100666
1686 * call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
1687 and side-effects, temporarily disable -Wunused-result warning when
1688 building COMPOUND_EXPR.
1689
1690 2021-05-21 Jakub Jelinek <jakub@redhat.com>
1691
1692 PR middle-end/99928
1693 * semantics.c (finish_omp_clauses): Move firstprivate clauses with
1694 OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain. Don't error
1695 if a decl is mentioned both in map clause and in such firstprivate
1696 clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
1697
1698 2021-05-20 Jason Merrill <jason@redhat.com>
1699
1700 * call.c (reference_binding): Check for designator.
1701 (implicit_conversion_1, build_special_member_call): Likewise.
1702 * decl.c (reshape_init_r): Likewise.
1703 * pt.c (do_class_deduction): Likewise.
1704 * typeck2.c (digest_init_r): Likewise.
1705
1706 2021-05-20 Jason Merrill <jason@redhat.com>
1707
1708 PR c++/100489
1709 * decl.c (reshape_init_class): Handle designator for
1710 member of anonymous aggregate here.
1711 * typeck2.c (process_init_constructor_record): Not here.
1712
1713 2021-05-20 Jonathan Wakely <jwakely@redhat.com>
1714
1715 * call.c (maybe_warn_array_conv): Use new warning option.
1716 * decl.c (mark_inline_variable, grokdeclarator): Likewise.
1717 * error.c (maybe_warn_cpp0x): Likewise.
1718 * parser.c (cp_parser_primary_expression)
1719 (cp_parser_unqualified_id)
1720 (cp_parser_pseudo_destructor_name)
1721 (cp_parser_lambda_introducer)
1722 (cp_parser_lambda_declarator_opt)
1723 (cp_parser_selection_statement)
1724 (cp_parser_init_statement)
1725 (cp_parser_decomposition_declaration)
1726 (cp_parser_function_specifier_opt)
1727 (cp_parser_static_assert)
1728 (cp_parser_namespace_definition)
1729 (cp_parser_using_declaration)
1730 (cp_parser_asm_definition)
1731 (cp_parser_ctor_initializer_opt_and_function_body)
1732 (cp_parser_initializer_list)
1733 (cp_parser_type_parameter_key)
1734 (cp_parser_member_declaration)
1735 (cp_parser_try_block)
1736 (cp_parser_std_attribute_spec): Likewise.
1737 * pt.c (check_template_variable): Likewise.
1738
1739 2021-05-20 Jason Merrill <jason@redhat.com>
1740
1741 PR c++/100634
1742 * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
1743
1744 2021-05-20 Jason Merrill <jason@redhat.com>
1745
1746 PR c++/100659
1747 * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
1748
1749 2021-05-19 Jason Merrill <jason@redhat.com>
1750
1751 PR c++/100367
1752 PR c++/96299
1753 * method.c (genericize_spaceship): Use fold_build2 for scalar
1754 operands.
1755
1756 2021-05-19 Jason Merrill <jason@redhat.com>
1757
1758 * pt.c (build_deduction_guide): Treat the implicit deduction guide
1759 as a member of the class.
1760
1761 2021-05-19 Marek Polacek <polacek@redhat.com>
1762
1763 PR c++/100596
1764 * cp-tree.h (any_non_type_attribute_p): Remove.
1765 * decl.c (grokdeclarator): Turn an error into a warning and only
1766 warn for standard attributes.
1767 * decl2.c (any_non_type_attribute_p): Remove.
1768 * parser.c (cp_parser_elaborated_type_specifier): Turn an error
1769 into a warning and only warn for standard attributes.
1770 (cp_parser_member_declaration): Likewise.
1771
1772 2021-05-19 Martin Liska <mliska@suse.cz>
1773
1774 PR testsuite/100658
1775 * mangle.c (write_encoding): Fix typos.
1776
1777 2021-05-19 Jakub Jelinek <jakub@redhat.com>
1778
1779 PR middle-end/99928
1780 * parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
1781 master when combined with taskloop.
1782 (cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
1783 parallel master when not combined with taskloop.
1784
1785 2021-05-19 Jason Merrill <jason@redhat.com>
1786
1787 PR c++/100261
1788 * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
1789
1790 2021-05-19 Jason Merrill <jason@redhat.com>
1791
1792 PR c++/100372
1793 * tree.c (strip_typedefs): Only look at the pattern of a
1794 TYPE_PACK_EXPANSION if it's a type.
1795
1796 2021-05-18 Marek Polacek <polacek@redhat.com>
1797
1798 * class.c (classtype_has_non_deleted_copy_ctor): Remove.
1799 * constraint.cc (contains_wildcard_p): Likewise.
1800 (get_template_head_requirements): Likewise.
1801 (check_constrained_friend): Likewise.
1802 (subsumes_constraints): Likewise.
1803 * cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
1804 (push_void_library_fn): Likewise.
1805 (get_pattern_parm): Likewise.
1806 (get_template_parms_at_level): Likewise.
1807 (lambda_return_type): Likewise.
1808 (get_template_head_requirements): Likewise.
1809 (check_constrained_friend): Likewise.
1810 (subsumes_constraints): Likewise.
1811 * decl.c (push_void_library_fn): Likewise.
1812 * lambda.c (lambda_return_type): Likewise.
1813 * pt.c (get_template_parms_at_level): Likewise.
1814 (get_pattern_parm): Likewise.
1815
1816 2021-05-18 Jason Merrill <jason@redhat.com>
1817
1818 PR c++/100644
1819 * call.c (perfect_candidate_p): An implicitly deleted move
1820 is not perfect.
1821
1822 2021-05-18 Andreas Krebbel <krebbel@linux.ibm.com>
1823
1824 PR c++/100281
1825 * cvt.c (cp_convert_to_pointer): Use the size of the target
1826 pointer type.
1827 * tree.c (cp_build_reference_type): Call
1828 cp_build_reference_type_for_mode with VOIDmode.
1829 (cp_build_reference_type_for_mode): Rename from
1830 cp_build_reference_type. Add MODE argument and invoke
1831 build_reference_type_for_mode.
1832 (strip_typedefs): Use build_pointer_type_for_mode and
1833 cp_build_reference_type_for_mode for pointers and references.
1834
1835 2021-05-17 Jonathan Wakely <jwakely@redhat.com>
1836
1837 PR c++/100635
1838 * call.c (convert_like_internal): Print different diagnostic if
1839 the lvalue reference is const.
1840
1841 2021-05-14 Jason Merrill <jason@redhat.com>
1842
1843 PR c++/95870
1844 * pt.c (enclosing_instantiation_of): Just compare
1845 DECL_SOURCE_LOCATION.
1846 (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
1847
1848 2021-05-14 Marek Polacek <polacek@redhat.com>
1849 Jason Merrill <jason@redhat.com>
1850
1851 PR c++/99032
1852 * cp-tree.h (any_non_type_attribute_p): Declare.
1853 * decl.c (grokdeclarator): Diagnose when an attribute appertains to
1854 a friend declaration that is not a definition.
1855 * decl2.c (any_non_type_attribute_p): New.
1856 * parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
1857 in the middle of decl-specifiers.
1858 (cp_parser_elaborated_type_specifier): Diagnose when an attribute
1859 appertains to a friend declaration that is not a definition.
1860 (cp_parser_member_declaration): Likewise.
1861
1862 2021-05-12 Marek Polacek <polacek@redhat.com>
1863
1864 * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
1865 sentinel.
1866
1867 2021-05-12 Marcel Vollweiler <marcel@codesourcery.com>
1868
1869 * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
1870 'close'.
1871
1872 2021-05-11 Jason Merrill <jason@redhat.com>
1873
1874 PR c++/100517
1875 * typeck.c (build_reinterpret_cast_1): Check intype on
1876 cast to vector.
1877
1878 2021-05-11 Patrick Palka <ppalka@redhat.com>
1879
1880 PR c++/51577
1881 * name-lookup.c (maybe_save_operator_binding): Unconditionally
1882 enable for all function templates, not just generic lambdas.
1883 Handle compound-assignment operator expressions.
1884 * typeck.c (build_x_compound_expr): Call maybe_save_operator_binding
1885 in the type-dependent case.
1886 (build_x_modify_expr): Likewise. Move declaration of 'op' closer
1887 to its first use.
1888
1889 2021-05-11 Patrick Palka <ppalka@redhat.com>
1890
1891 PR c++/100138
1892 * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
1893 (satisfy_atom): Set up iloc_sentinel before calling
1894 cxx_constant_value.
1895 * pt.c (tsubst_pack_expansion): When returning a rebuilt pack
1896 expansion, carry over PACK_EXPANSION_LOCAL_P and
1897 PACK_EXPANSION_SIZEOF_P from the original pack expansion.
1898
1899 2021-05-10 Richard Biener <rguenther@suse.de>
1900
1901 PR middle-end/100464
1902 PR c++/100468
1903 * call.c (set_up_extended_ref_temp): Mark the temporary
1904 addressable if the TARGET_EXPR was.
1905
1906 2021-05-10 Martin Liska <mliska@suse.cz>
1907
1908 * decl.c (duplicate_decls): Use startswith
1909 function instead of strncmp.
1910 (cxx_builtin_function): Likewise.
1911 (omp_declare_variant_finalize_one): Likewise.
1912 (grokfndecl): Likewise.
1913 * error.c (dump_decl_name): Likewise.
1914 * mangle.c (find_decomp_unqualified_name): Likewise.
1915 (write_guarded_var_name): Likewise.
1916 (decl_tls_wrapper_p): Likewise.
1917 * parser.c (cp_parser_simple_type_specifier): Likewise.
1918 (cp_parser_tx_qualifier_opt): Likewise.
1919 * pt.c (template_parm_object_p): Likewise.
1920 (dguide_name_p): Likewise.
1921
1922 2021-05-10 Martin Liska <mliska@suse.cz>
1923
1924 PR c++/99616
1925 * decl.c (grokdeclarator): Remove redundant NULL check.
1926
1927 2021-05-07 Jason Merrill <jason@redhat.com>
1928
1929 * tree.c (rvalue): Assert expr is not a class lvalue.
1930
1931 2021-05-07 Jason Merrill <jason@redhat.com>
1932
1933 * cp-tree.h (build_stub_object): Declare.
1934 * method.c (build_stub_object): No longer static.
1935 * call.c (can_convert): Use it.
1936 * tree.c (build_dummy_object): Adjust comment.
1937 * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
1938 TARGET_EXPR.
1939
1940 2021-05-07 Jason Merrill <jason@redhat.com>
1941
1942 * coroutines.cc (build_co_await): Don't call 'rvalue'.
1943 (flatten_await_stmt): Simplify initialization.
1944 (morph_fn_to_coro): Change 'rvalue' to 'move'. Simplify.
1945
1946 2021-05-04 Tobias Burnus <tobias@codesourcery.com>
1947
1948 * semantics.c (finish_omp_reduction_clause): Accept float + complex
1949 for || and && reductions.
1950
1951 2021-05-03 Patrick Palka <ppalka@redhat.com>
1952
1953 PR c++/100362
1954 * parser.c (cp_parser_class_head): Reinstate calls to pushclass
1955 and popclass when parsing the base-clause that were removed in
1956 r11-6815.
1957
1958 2021-05-03 Patrick Palka <ppalka@redhat.com>
1959
1960 PR c++/68942
1961 PR c++/100344
1962 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
1963 only when the callee is a FUNCTION_DECL.
1964
1965 2021-05-03 Marek Polacek <polacek@redhat.com>
1966
1967 PR c++/100055
1968 * decl.c (grokfndecl): Check current_template_parms.
1969
1970 2021-05-03 Marek Polacek <polacek@redhat.com>
1971
1972 DR 1312
1973 * constexpr.c (cxx_eval_constant_expression): Don't check
1974 integer_zerop.
1975
1976 2021-05-01 Jason Merrill <jason@redhat.com>
1977
1978 * cp-tree.h (class ovl_iterator): Allow copying. Add op==.
1979 (class ovl_range, class lkp_range): New.
1980 * call.c (build_op_call_1, add_candidates): Use them.
1981 (build_op_delete_call, has_trivial_copy_assign_p): Likewise.
1982 (has_trivial_copy_p): Likewise.
1983 * class.c (handle_using_decl, get_basefndecls): Likewise.
1984 (maybe_warn_about_overly_private_class): Likewise.
1985 (warn_hidden, add_implicitly_declared_members): Likewise.
1986 (check_methods, clone_constructors_and_destructors): Likewise.
1987 (type_has_user_nondefault_constructor): Likewise.
1988
1989 2021-04-29 Jason Merrill <jason@redhat.com>
1990
1991 * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
1992 don't find a field.
1993
1994 2021-04-29 Jason Merrill <jason@redhat.com>
1995
1996 PR c++/51344
1997 * decl2.c (grokfield): Call cplus_decl_attributes for friend.
1998 (save_template_attributes): Use chainon.
1999 * friend.c (do_friend): Remove attrlist parm.
2000 * cp-tree.h (do_friend): Adjust.
2001 * class.c (add_implicitly_declared_members): Adjust.
2002 * decl.c (grokdeclarator): Adjust.
2003 * pt.c (apply_late_template_attributes): Optimize.
2004
2005 2021-04-29 Jason Merrill <jason@redhat.com>
2006
2007 PR c++/97974
2008 * class.c (finish_struct_anon_r): Drop complain parm.
2009 Remove non-field diagnostic.
2010 (finish_struct_anon): Adjust.
2011 * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here.
2012
2013 2021-04-29 Jason Merrill <jason@redhat.com>
2014
2015 * cp-tree.h (cp_evaluated): Add reset parm to constructor.
2016 * parser.c (cp_parser_constant_expression): Change
2017 allow_non_constant_p to int. Use cp_evaluated.
2018 (cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
2019 * semantics.c (finish_id_expression_1): Don't mess with
2020 cp_unevaluated_operand here.
2021
2022 2021-04-29 Jason Merrill <jason@redhat.com>
2023
2024 * cp-tree.h: Clarify comments.
2025 * pt.c (get_template_parm_object): Add assert.
2026 * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR.
2027 * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR.
2028 * typeck2.c (store_init_value): Likewise.
2029
2030 2021-04-29 Patrick Palka <ppalka@redhat.com>
2031
2032 PR c++/68942
2033 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
2034 set tf_conv during the initial substitution into the function.
2035
2036 2021-04-29 Jakub Jelinek <jakub@redhat.com>
2037
2038 PR c++/100319
2039 * semantics.c (finish_omp_clauses): Fix up check that variable
2040 mentioned in detach clause doesn't appear in data-sharing clauses.
2041
2042 2021-04-28 Jakub Jelinek <jakub@redhat.com>
2043
2044 * module.cc: Remove #error that triggers if DEV-PHASE is empty.
2045
2046 2021-04-27 Jason Merrill <jason@redhat.com>
2047
2048 PR c++/92145
2049 * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
2050 of operator=.
2051
2052 2021-04-27 Patrick Palka <ppalka@redhat.com>
2053
2054 PR c++/88580
2055 * pt.c (tsubst_initializer_list): Correctly handle the case
2056 where an argument inside a base initializer pack expansion is
2057 itself a pack expansion.
2058
2059 2021-04-26 Patrick Palka <ppalka@redhat.com>
2060
2061 PR c++/100209
2062 * constexpr.c (cxx_fold_indirect_ref): Try to canonicalize the
2063 object/offset pair for a POINTER_PLUS_EXPR of a COMPONENT_REF
2064 with a negative offset into one whose offset is nonnegative
2065 before calling cxx_fold_indirect_ref_1.
2066
2067 2021-04-24 Patrick Palka <ppalka@redhat.com>
2068
2069 PR c++/89565
2070 PR c++/93383
2071 PR c++/95291
2072 PR c++/99200
2073 PR c++/99683
2074 * pt.c (do_class_deduction): Punt if the initializer is
2075 type-dependent.
2076
2077 2021-04-24 Patrick Palka <ppalka@redhat.com>
2078
2079 PR c++/87709
2080 * parser.c (cp_parser_type_id_1): If we see a template
2081 placeholder, first try simulating an error before issuing
2082 a real error.
2083
2084 2021-04-23 Patrick Palka <ppalka@redhat.com>
2085
2086 PR c++/98767
2087 * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
2088 Adjust parameter list loop to iterate over 'types' instead of
2089 'args'. Output the trailing '...' for a variadic function.
2090 Remove PARM_DECL support.
2091 (pp_cxx_requires_expr): Pretty print the parameter list directly
2092 instead of going through pp_cxx_parameter_declaration_clause.
2093
2094 2021-04-23 Patrick Palka <ppalka@redhat.com>
2095
2096 DR 2374
2097 * decl.c (is_direct_enum_init): Check the implicit
2098 convertibility requirement added by CWG 2374.
2099
2100 2021-04-23 Martin Liska <mliska@suse.cz>
2101
2102 * cp-tree.h (STATIC_ASSERT): Prefer static assert.
2103 * lex.c (init_operators): Remove run-time check.
2104
2105 2021-04-22 Marek Polacek <polacek@redhat.com>
2106
2107 PR c++/100161
2108 * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
2109 op1 separately for value- or type-dependence.
2110
2111 2021-04-21 Marek Polacek <polacek@redhat.com>
2112
2113 PR c++/96380
2114 * parser.c (cp_parser_enum_specifier): Don't allow defining
2115 types in enum-base.
2116
2117 2021-04-21 Martin Liska <mliska@suse.cz>
2118
2119 Revert:
2120 2021-04-21 Martin Liska <mliska@suse.cz>
2121
2122 * error.c (dump_decl): Use flags in dump_generic_node call.
2123
2124 2021-04-21 Martin Liska <mliska@suse.cz>
2125
2126 * error.c (dump_decl): Use flags in dump_generic_node call.
2127
2128 2021-04-21 Martin Liska <mliska@suse.cz>
2129
2130 * error.c (dump_decl): Support anonymous labels.
2131
2132 2021-04-20 Jason Merrill <jason@redhat.com>
2133
2134 PR c++/100109
2135 * pt.c (find_parameter_packs_r): Look into enum initializers.
2136
2137 2021-04-19 Marek Polacek <polacek@redhat.com>
2138
2139 PR c++/97536
2140 * decl.c (grokvardecl): Given an error when a concept is not defined
2141 at namespace scope.
2142
2143 2021-04-16 Jakub Jelinek <jakub@redhat.com>
2144
2145 PR c++/100111
2146 * constexpr.c (cxx_eval_store_expression): Don't add CONSTRUCTORs
2147 for empty classes into *valp when types don't match even when *valp
2148 is NULL.
2149
2150 2021-04-16 Marek Polacek <polacek@redhat.com>
2151
2152 PR c++/99803
2153 * decl.c (make_typename_type): Give an error and return when
2154 name is is_overloaded_fn.
2155 * parser.c (cp_parser_class_name): Don't check is_overloaded_fn
2156 before calling make_typename_type.
2157
2158 2021-04-16 Patrick Palka <ppalka@redhat.com>
2159
2160 PR c++/99700
2161 * constexpr.c (reduced_constant_expression_p): For array
2162 CONSTRUCTORs, use a dedicated loop that additionally verifies
2163 the CONSTRUCTOR spans the entire array.
2164
2165 2021-04-16 Jakub Jelinek <jakub@redhat.com>
2166
2167 PR c++/99850
2168 * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
2169 If lambda_p, return pce_ok instead of pce_maybe_postfix.
2170
2171 2021-04-16 Jakub Jelinek <jakub@redhat.com>
2172
2173 PR c++/99833
2174 * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
2175 binding, add to data.internal also all corresponding structured
2176 binding decls.
2177
2178 2021-04-16 Jason Merrill <jason@redhat.com>
2179
2180 PR c++/100079
2181 * cp-tree.h (first_field): Declare.
2182 * mangle.c (range_expr_nelts): New.
2183 (write_expression): Improve class NTTP mangling.
2184 * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
2185 * tree.c (zero_init_expr_p): Improve class NTTP handling.
2186 * decl.c: Adjust comment.
2187
2188 2021-04-15 Jason Merrill <jason@redhat.com>
2189
2190 PR c++/80456
2191 * call.c (build_new_method_call_1): Check again for side-effects
2192 with a volatile object.
2193
2194 2021-04-15 Jason Merrill <jason@redhat.com>
2195
2196 PR c++/100101
2197 PR c++/99583
2198 * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
2199 TYPE_RAISES_EXCEPTIONS here.
2200 * tree.c (cp_walk_subtrees): Not here.
2201
2202 2021-04-15 Jason Merrill <jason@redhat.com>
2203
2204 PR c++/100091
2205 PR c++/99478
2206 * parser.c (cp_parser_default_type_template_argument): Set
2207 parser->local_variables_forbidden_p.
2208
2209 2021-04-15 Richard Sandiford <richard.sandiford@arm.com>
2210
2211 PR c++/98852
2212 * typeck.c (merge_type_attributes_from): New function.
2213 (cp_common_type): Use it for vector types.
2214
2215 2021-04-14 Jason Merrill <jason@redhat.com>
2216
2217 PR c++/100078
2218 PR c++/93085
2219 * pt.c (uses_outer_template_parms): Also look at default
2220 template argument.
2221
2222 2021-04-14 Jason Merrill <jason@redhat.com>
2223
2224 PR c++/93314
2225 * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
2226 for a non-static data member in a constant-expression.
2227
2228 2021-04-14 Patrick Palka <ppalka@redhat.com>
2229
2230 PR c++/83476
2231 PR c++/99885
2232 * pt.c (deducible_expression): Look through implicit
2233 INDIRECT_REFs as well.
2234
2235 2021-04-14 Jason Merrill <jason@redhat.com>
2236
2237 PR c++/99478
2238 * parser.c (cp_parser_lambda_expression): Reject lambda
2239 in template parameter type.
2240
2241 2021-04-14 Jason Merrill <jason@redhat.com>
2242
2243 PR c++/90674
2244 * decl.c (duplicate_decls): Don't propagate
2245 DECL_INITIALIZED_IN_CLASS_P to a specialization.
2246
2247 2021-04-14 Jason Merrill <jason@redhat.com>
2248
2249 PR c++/88742
2250 PR c++/49951
2251 PR c++/58123
2252 * semantics.c (set_cleanup_locs): New.
2253 (do_poplevel): Call it.
2254 * parser.c (cp_parser_compound_statement): Consume the }
2255 before finish_compound_stmt.
2256
2257 2021-04-13 Jason Merrill <jason@redhat.com>
2258
2259 PR c++/100032
2260 * pt.c (get_underlying_template): Compare TYPE_QUALS.
2261
2262 2021-04-13 Jason Merrill <jason@redhat.com>
2263
2264 PR c++/100054
2265 PR c++/90479
2266 * init.c (get_nsdmi): Do more context adjustment for local classes.
2267
2268 2021-04-13 Patrick Palka <ppalka@redhat.com>
2269
2270 PR c++/99008
2271 * pt.c (do_class_deduction): Reject alias CTAD in C++17 mode
2272 rather than issuing a pedwarn.
2273 * typeck2.c (build_functional_cast_1): Handle CTAD uniformly
2274 for consistent diagnostics.
2275
2276 2021-04-13 Jason Merrill <jason@redhat.com>
2277
2278 PR c++/91933
2279 * class.c (build_base_path): Shortcut simple non-pointer case.
2280
2281 2021-04-13 Eric Botcazou <ebotcazou@adacore.com>
2282
2283 * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
2284 of the linemap.
2285 (module_state::write_location): Likewise.
2286
2287 2021-04-13 Patrick Palka <ppalka@redhat.com>
2288
2289 PR c++/97134
2290 * pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
2291 when checking if the initializer is an equivalent class
2292 placeholder template parameter.
2293
2294 2021-04-13 Patrick Palka <ppalka@redhat.com>
2295
2296 PR c++/99961
2297 PR c++/99994
2298 * constraint.cc (satisfy_normalized_constraints): Set
2299 cp_unevaluated.
2300 * parser.c (cp_parser_concept_definition): Likewise.
2301 (cp_parser_requires_clause_opt): Likewise.
2302
2303 2021-04-12 Jason Merrill <jason@redhat.com>
2304
2305 PR c++/93085
2306 * pt.c (uses_outer_template_parms): Handle non-type and template
2307 template parameters specifically.
2308
2309 2021-04-11 Jason Merrill <jason@redhat.com>
2310
2311 PR c++/97974
2312 * decl.c (fixup_anonymous_aggr): Prune all functions from
2313 CLASSTYPE_MEMBER_VEC.
2314
2315 2021-04-10 Jason Merrill <jason@redhat.com>
2316
2317 PR c++/98800
2318 PR c++/97399
2319 * parser.c (cp_parser_direct_declarator): Don't
2320 inject_this_parameter if static_p.
2321 (cp_parser_omp_var_list_no_open): Parse 'this' even if
2322 current_class_ptr isn't set for a better diagnostic.
2323
2324 2021-04-10 Jason Merrill <jason@redhat.com>
2325
2326 PR c++/99180
2327 PR c++/93295
2328 PR c++/93867
2329 PR c++/99118
2330 PR c++/96873
2331 * pt.c (alias_ctad_tweaks): Handle failure better.
2332
2333 2021-04-10 Jason Merrill <jason@redhat.com>
2334
2335 PR c++/100006
2336 * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
2337
2338 2021-04-09 Patrick Palka <ppalka@redhat.com>
2339
2340 * cp-tree.h (LAMBDA_EXPR_REGENERATED_FROM)
2341 (LAMBDA_EXPR_REGENERATING_TARGS): Replace these with ...
2342 (LAMBDA_EXPR_REGEN_INFO): ... this.
2343 (tree_lambda_expr::regenerated_from)
2344 (tree_lambda_expr::regenerating_targs): Replace these with ...
2345 (tree_lambda_expr::regen_info): ... this.
2346 * constraint.cc (satisfy_declaration_constraints): Adjust
2347 accordingly.
2348 * lambda.c (build_lambda_expr): Likewise.
2349 * pt.c (regenerated_lambda_fn_p): Likewise.
2350 (most_general_lambda): Likewise.
2351 (tsubst_lambda_expr): Likewise.
2352
2353 2021-04-09 Marek Polacek <polacek@redhat.com>
2354
2355 PR c++/99806
2356 * parser.c (cp_parser_member_declaration): Call
2357 cp_parser_save_default_args even for function templates. Use
2358 STRIP_TEMPLATE on the declaration we're passing.
2359
2360 2021-04-08 Patrick Palka <ppalka@redhat.com>
2361
2362 PR c++/99874
2363 * constraint.cc (get_normalized_constraints_from_decl): Handle
2364 regenerated lambdas.
2365 (satisfy_declaration_constraints): Likewise. Check for
2366 dependent args later.
2367 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): Replace with ...
2368 (LAMBDA_EXPR_REGENERATED_FROM): ... this.
2369 (LAMBDA_EXPR_REGENERATING_TARGS): New.
2370 (tree_lambda_expr::regenerated_from): New data member.
2371 (tree_lambda_expr::regenerating_targs): New data member.
2372 (add_to_template_args): Declare.
2373 (regenerated_lambda_fn_p): Likewise.
2374 (most_general_lambda): Likewise.
2375 * lambda.c (build_lambda_expr): Set LAMBDA_EXPR_REGENERATED_FROM
2376 and LAMBDA_EXPR_REGENERATING_TARGS.
2377 * pt.c (add_to_template_args): No longer static.
2378 (tsubst_function_decl): Unconditionally propagate constraints on
2379 the substituted function decl.
2380 (instantiated_lambda_fn_p): Rename to ...
2381 (regenerated_lambda_fn_p): ... this. Check
2382 LAMBDA_EXPR_REGENERATED_FROM instead of
2383 LAMBDA_EXPR_INSTANTIATED.
2384 (most_general_lambda): Define.
2385 (enclosing_instantiation_of): Adjust after renaming
2386 instantiated_lambda_fn_p.
2387 (tsubst_lambda_expr): Don't set LAMBDA_EXPR_INSTANTIATED. Set
2388 LAMBDA_EXPR_REGENERATED_FROM and LAMBDA_EXPR_REGENERATING_TARGS.
2389 Don't substitute or set constraints on the regenerated lambda.
2390
2391 2021-04-08 Patrick Palka <ppalka@redhat.com>
2392
2393 PR c++/97679
2394 * pt.c (build_deduction_guide): Document OUTER_ARGS. Substitute
2395 them into the propagated constraints.
2396
2397 2021-04-08 Jason Merrill <jason@redhat.com>
2398
2399 PR c++/91849
2400 * call.c (convert_like_internal): Improve reference diagnostic.
2401
2402 2021-04-08 Jakub Jelinek <jakub@redhat.com>
2403
2404 PR c++/99859
2405 * constexpr.c (addr_of_non_const_var): New function.
2406 (cxx_bind_parameters_in_call): Set *non_constant_args to true
2407 even if cp_walk_tree on arg with addr_of_non_const_var callback
2408 returns true.
2409
2410 2021-04-08 Jason Merrill <jason@redhat.com>
2411
2412 PR c++/94529
2413 * pt.c (determine_specialization): Improve diagnostic.
2414
2415 2021-04-08 Marek Polacek <polacek@redhat.com>
2416
2417 PR c++/99844
2418 * decl.c (build_explicit_specifier): Call
2419 check_for_bare_parameter_packs.
2420 * except.c (build_noexcept_spec): Likewise.
2421
2422 2021-04-07 Jason Merrill <jason@redhat.com>
2423
2424 PR c++/41723
2425 * parser.c (cp_parser_class_name): Check dependent_scope_p.
2426
2427 2021-04-07 Jason Merrill <jason@redhat.com>
2428
2429 PR c++/52625
2430 * pt.c (maybe_process_partial_specialization): Check
2431 DECL_SELF_REFERENCE_P.
2432
2433 2021-04-07 Jason Merrill <jason@redhat.com>
2434
2435 PR c++/92918
2436 * name-lookup.c (push_class_level_binding_1): Do overload a new
2437 function with a previous using-declaration.
2438
2439 2021-04-06 Jason Merrill <jason@redhat.com>
2440
2441 PR c++/96673
2442 * init.c (get_nsdmi): Don't defer access checking.
2443
2444 2021-04-06 Jason Merrill <jason@redhat.com>
2445
2446 PR c++/99901
2447 * decl.c (cp_finish_decl): mark_needed an implicitly inline
2448 static data member with an out-of-class redeclaration.
2449
2450 2021-04-06 Jason Merrill <jason@redhat.com>
2451
2452 PR c++/91241
2453 * mangle.c (write_compact_number): Add sanity check.
2454 (write_local_name): Use list_length for parm number.
2455
2456 2021-04-06 Patrick Palka <ppalka@redhat.com>
2457
2458 PR c++/99899
2459 * pt.c (do_auto_deduction): Don't exit early when deducing the
2460 array type of a structured binding. Also handle adc_decomp_type
2461 during constraint checking.
2462
2463 2021-04-05 Jason Merrill <jason@redhat.com>
2464
2465 PR c++/96311
2466 * typeck.c (check_return_expr): Call mark_exp_read in dependent
2467 case.
2468
2469 2021-04-05 Jason Merrill <jason@redhat.com>
2470
2471 PR c++/98440
2472 * typeck.c (build_reinterpret_cast_1): Don't perform
2473 temporary materialization.
2474
2475 2021-04-05 Jason Merrill <jason@redhat.com>
2476
2477 PR c++/95317
2478 * pt.c (lookup_template_class_1): Do tsubst_enum when
2479 tsubsting a generic lambda.
2480
2481 2021-04-05 Jason Merrill <jason@redhat.com>
2482
2483 PR c++/95870
2484 * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
2485 there is no enclosing non-lambda function.
2486
2487 2021-04-05 Nathan Sidwell <nathan@acm.org>
2488
2489 PR c++/99380
2490 * module.cc (name_pending_imports): Drop 'atend' parm. Don't
2491 query export when not needed.
2492 (preprocess_module, preprocessed_module): Adjust.
2493
2494 2021-04-05 Jason Merrill <jason@redhat.com>
2495
2496 PR c++/99066
2497 * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
2498
2499 2021-04-05 Jason Merrill <jason@redhat.com>
2500
2501 PR c++/99201
2502 * pt.c (class el_data): Add visited field.
2503 (extract_local_specs): Pass it to cp_walk_tree.
2504 (extract_locals_r): Walk into the body of a lambda.
2505
2506 2021-04-05 Jason Merrill <jason@redhat.com>
2507
2508 * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
2509 template result.
2510
2511 2021-04-04 Jason Merrill <jason@redhat.com>
2512
2513 PR c++/99643
2514 * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
2515
2516 2021-04-03 Marek Polacek <polacek@redhat.com>
2517
2518 PR c++/91416
2519 * parser.c: Create a GC root for attributes in a decl specifier.
2520 (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
2521
2522 2021-04-03 Jason Merrill <jason@redhat.com>
2523
2524 PR c++/91217
2525 * pt.c (tsubst_lambda_expr): Skip the body block from
2526 DECL_SAVED_TREE.
2527
2528 2021-04-03 Jason Merrill <jason@redhat.com>
2529
2530 PR c++/90664
2531 * cvt.c (can_convert_qual): Check fnptr_conv_p.
2532
2533 2021-04-03 Jason Merrill <jason@redhat.com>
2534
2535 PR c++/97900
2536 * pt.c (regenerate_decl_from_template): tsubst_decl
2537 the parms.
2538
2539 2021-04-02 Patrick Palka <ppalka@redhat.com>
2540
2541 PR c++/99869
2542 * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
2543 to do_auto_deduction.
2544
2545 2021-04-02 Patrick Palka <ppalka@redhat.com>
2546
2547 PR c++/99586
2548 * semantics.c (finish_compound_literal): Check
2549 template_placeholder_p instead of type_uses_auto.
2550
2551 2021-04-02 Jason Merrill <jason@redhat.com>
2552
2553 PR c++/97938
2554 * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
2555 * lambda.c (add_capture): Set it.
2556 * pt.c (tsubst_pack_expansion): Handle it.
2557
2558 2021-04-02 Nathan Sidwell <nathan@acm.org>
2559
2560 * cp-tree.h (lang_decl_base): Correct module flag comment.
2561 * module.cc (trees_in::assert_definition): Break out
2562 not_tmpl var.
2563 (trees_out::lang_decl_bools): Do not write purview for header units.
2564
2565 2021-04-01 Marek Polacek <polacek@redhat.com>
2566
2567 PR c++/99831
2568 * method.c (defaulted_late_check): ++ and -- function_depth around
2569 the call to synthesize_method.
2570 * pt.c: Remove the saved_trees global.
2571
2572 2021-04-01 Jason Merrill <jason@redhat.com>
2573
2574 PR c++/99583
2575 PR c++/99584
2576 * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
2577 TYPE_RAISES_EXCEPTIONS.
2578
2579 2021-04-01 Iain Sandoe <iain@sandoe.co.uk>
2580
2581 * mapper-client.cc (INCLUDE_MAP): New; require map to be
2582 included from system.h.
2583 * mapper-resolver.cc (INCLUDE_MAP): Likewise.
2584
2585 2021-04-01 Jason Merrill <jason@redhat.com>
2586
2587 PR c++/98481
2588 * mangle.c (write_expression): Adjust.
2589 * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
2590 (mark_abi_tags_r): Likewise.
2591
2592 2021-04-01 Nathan Sidwell <nathan@acm.org>
2593
2594 PR c++/99283
2595 * module.cc (trees_out::decl_node): Adjust importedness reference
2596 assert.
2597 (module_state::intercluster_seed): New. Seed both imports and
2598 inter-cluster references. Broken out of ...
2599 (module_state::write_cluster): ... here. Call it.
2600
2601 2021-03-31 Jason Merrill <jason@redhat.com>
2602
2603 PR c++/99445
2604 * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
2605
2606 2021-03-31 Patrick Palka <ppalka@redhat.com>
2607
2608 PR c++/88115
2609 * mangle.c (write_expression): Adjust the mangling of
2610 __alignof__.
2611
2612 2021-03-31 Patrick Palka <ppalka@redhat.com>
2613
2614 PR c++/99815
2615 * pt.c (placeholder_type_constraint_dependent_p): Expand
2616 argument packs to separate the first non-pack argument
2617 from the rest.
2618
2619 2021-03-30 Nathan Sidwell <nathan@acm.org>
2620
2621 PR c++/99283
2622 * module.cc (dumper::operator): Make less brittle.
2623 (trees_out::core_bools): VAR_DECLs always have a context.
2624 (trees_out::key_mergeable): Use same_type_p for asserting.
2625 (trees_in::read_var_def): Propagate
2626 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2627
2628 2021-03-30 Jakub Jelinek <jakub@redhat.com>
2629
2630 PR c++/99790
2631 * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
2632
2633 2021-03-26 Marek Polacek <polacek@redhat.com>
2634
2635 PR c++/98352
2636 * method.c (implicitly_declare_fn): Pass &raises to
2637 synthesized_method_walk.
2638
2639 2021-03-26 Nathan Sidwell <nathan@acm.org>
2640
2641 PR c++/99283
2642 * cp-tree.h (DECL_MODULE_CHECK): Ban TEMPLATE_DECL.
2643 (SET_TYPE_TEMPLATE_INFO): Restore Alias template setting.
2644 * decl.c (duplicate_decls): Remove template_decl module flag
2645 propagation.
2646 * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
2647 (dumper::impl::nested_name): Adjust for template-decl module flag
2648 change.
2649 (trees_in::assert_definition): Likewise.
2650 (trees_in::install_entity): Likewise.
2651 (trees_out::decl_value): Likewise. Remove alias template
2652 separation of template and type_decl.
2653 (trees_in::decl_value): Likewise.
2654 (trees_out::key_mergeable): Likewise,
2655 (trees_in::key_mergeable): Likewise.
2656 (trees_out::decl_node): Adjust for template-decl module flag
2657 change.
2658 (depset::hash::make_dependency): Likewise.
2659 (get_originating_module, module_may_redeclare): Likewise.
2660 (set_instantiating_module, set_defining_module): Likewise.
2661 * name-lookup.c (name_lookup::search_adl): Likewise.
2662 (do_pushdecl): Likewise.
2663 * pt.c (build_template_decl): Likewise.
2664 (lookup_template_class_1): Remove special alias_template handling
2665 of DECL_TI_TEMPLATE.
2666 (tsubst_template_decl): Likewise.
2667
2668 2021-03-26 Jakub Jelinek <jakub@redhat.com>
2669
2670 PR c++/99705
2671 * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
2672 in DECL_EXPR or in BIND_EXPR_VARS.
2673
2674 2021-03-25 Jakub Jelinek <jakub@redhat.com>
2675
2676 PR c++/99672
2677 * parser.c (cp_parser_postfix_expression): For calls, create
2678 combined_loc and temporarily set input_location to it before
2679 calling finish_call_expr.
2680
2681 2021-03-25 Marek Polacek <polacek@redhat.com>
2682
2683 PR c++/94751
2684 * call.c (build_over_call): Maybe call mark_used in case
2685 deduce_inheriting_ctor fails and return error_mark_node.
2686 * cp-tree.h (deduce_inheriting_ctor): Adjust declaration.
2687 * method.c (deduce_inheriting_ctor): Return bool if the deduction
2688 fails.
2689 (implicitly_declare_fn): If raises is error_mark_node, call
2690 synthesized_method_walk with diag being true.
2691
2692 2021-03-25 Jakub Jelinek <jakub@redhat.com>
2693
2694 PR c++/99745
2695 * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
2696 packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
2697
2698 2021-03-25 Marek Polacek <polacek@redhat.com>
2699
2700 PR c++/99331
2701 * call.c (build_converted_constant_expr_internal): Don't emit
2702 -Wconversion warnings.
2703
2704 2021-03-25 Jakub Jelinek <jakub@redhat.com>
2705
2706 PR c++/99565
2707 * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
2708 to operand_equal_p.
2709 * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
2710 or COMPOUND_EXPR.
2711
2712 2021-03-23 Nathan Sidwell <nathan@acm.org>
2713
2714 PR c++/99283
2715 * name-lookup.c (check_module_override): Set global or partition
2716 DUP on the binding vector.
2717
2718 2021-03-23 Marek Polacek <polacek@redhat.com>
2719
2720 PR c++/99318
2721 * decl2.c (cp_warn_deprecated_use_scopes): Only call
2722 cp_warn_deprecated_use when decl is a namespace, class, or enum.
2723
2724 2021-03-23 Nathan Sidwell <nathan@acm.org>
2725
2726 PR c++/99239
2727 * decl.c (duplicate_decls): Remove assert about maybe-imported
2728 artificial decls.
2729
2730 2021-03-23 Jakub Jelinek <jakub@redhat.com>
2731
2732 PR c++/99650
2733 * decl.c (cp_finish_decomp): Diagnose void initializers when
2734 using tuple_element and get.
2735
2736 2021-03-22 Nathan Sidwell <nathan@acm.org>
2737
2738 PR c++/99480
2739 * module.cc (depset::hash::make_dependency): Propagate flags for
2740 partial specialization.
2741 (module_may_redeclare): Handle partial specialization.
2742
2743 2021-03-22 Nathan Sidwell <nathan@acm.org>
2744
2745 PR c++/99425
2746 * cp-tree.h (map_context_from, map_context_to): Delete.
2747 (add_mergeable_specialization): Add is_alias parm.
2748 * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
2749 * module.cc (map_context_from, map_context_to): Delete.
2750 (trees_in::decl_value): Add specializations later, adjust call.
2751 Drop useless alias lookup. Set duplicate fn parm context.
2752 (check_mergeable_decl): Drop context mapping.
2753 (trees_in::is_matching_decl): Likewise.
2754 (trees_in::read_function_def): Drop parameter context adjustment
2755 here.
2756
2757 2021-03-22 Martin Liska <mliska@suse.cz>
2758
2759 PR c++/99687
2760 * module.cc (fini_modules): Call vec_free instead of delete.
2761
2762 2021-03-20 Jakub Jelinek <jakub@redhat.com>
2763
2764 PR debug/99230
2765 * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
2766 special code, instead call c_genericize_control_stmt.
2767
2768 2021-03-19 Jakub Jelinek <jakub@redhat.com>
2769
2770 PR c++/99456
2771 * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
2772 INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
2773 don't diagnose it, set *non_constant_p nor return t.
2774
2775 2021-03-19 Marek Polacek <polacek@redhat.com>
2776
2777 PR c++/99500
2778 * parser.c (cp_parser_requirement_parameter_list): Handle
2779 error_mark_node.
2780
2781 2021-03-18 Marek Polacek <polacek@redhat.com>
2782
2783 * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
2784
2785 2021-03-18 Marek Polacek <polacek@redhat.com>
2786
2787 * pt.c (tsubst_copy_and_build): Add assert.
2788
2789 2021-03-18 Iain Sandoe <iain@sandoe.co.uk>
2790
2791 PR objc++/49070
2792 * parser.c (cp_debug_parser): Add Objective-C++ message
2793 state flag.
2794 (cp_parser_nested_name_specifier_opt): Allow colon to
2795 terminate an assignment-expression when parsing Objective-
2796 C++ messages.
2797 (cp_parser_objc_message_expression): Set and clear message
2798 parsing state on entry and exit.
2799 * parser.h (struct cp_parser): Add a context flag for
2800 Objective-C++ message state.
2801
2802 2021-03-18 Martin Liska <mliska@suse.cz>
2803
2804 PR c++/99617
2805 * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
2806 to NULL.
2807
2808 2021-03-17 Marek Polacek <polacek@redhat.com>
2809
2810 PR c++/97973
2811 * call.c (conv_unsafe_in_template_p): New.
2812 (convert_like): Use it.
2813
2814 2021-03-17 Anthony Sharp <anthonysharp15@gmail.com>
2815 Jason Merrill <jason@redhat.com>
2816
2817 * semantics.c (get_class_access_diagnostic_decl): New
2818 function that examines special cases when a parent
2819 class causes a private access failure.
2820 (enforce_access): Slightly modified to call function
2821 above.
2822
2823 2021-03-16 Jason Merrill <jason@redhat.com>
2824
2825 * tree.c (cp_tree_equal): Use real_identical.
2826
2827 2021-03-16 Jakub Jelinek <jakub@redhat.com>
2828
2829 PR c++/99613
2830 * decl.c (expand_static_init): For thread guards, call __cxa_atexit
2831 before calling __cxa_guard_release rather than after it. Formatting
2832 fixes.
2833
2834 2021-03-16 Martin Liska <mliska@suse.cz>
2835 Jason Merrill <jason@redhat.com>
2836
2837 PR c++/99108
2838 * call.c (get_function_version_dispatcher): Handle
2839 DECL_LOCAL_DECL_P.
2840 * decl.c (maybe_version_functions): Likewise.
2841 (maybe_mark_function_versioned): New.
2842 * name-lookup.c (push_local_extern_decl_alias): No longer static.
2843 * name-lookup.h (push_local_extern_decl_alias): Adjust.
2844
2845 2021-03-16 Nathan Sidwell <nathan@acm.org>
2846
2847 PR c++/99496
2848 * module.cc (trees_out::decl_value): Adjust typedef streaming,
2849 indicate whether it is a dependent alias.
2850 (trees_in::decl_value): Likewise. Set as dependent alias, if it
2851 is one.
2852
2853 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2854
2855 PR c++/99047
2856 * coroutines.cc (expand_one_await_expression): If the
2857 await_ready() expression is not a boolean then convert it
2858 as required.
2859
2860 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2861
2862 PR c++/98704
2863 * coroutines.cc (build_actor_fn): Make destroy index 1
2864 correspond to the abnormal unhandled_exception() exit.
2865 Substitute the proxy for the resume index.
2866 (coro_rewrite_function_body): Arrange to reset the resume
2867 index and make done = true for a rethrown exception from
2868 unhandled_exception ().
2869 (morph_fn_to_coro): Adjust calls to build_actor_fn and
2870 coro_rewrite_function_body.
2871
2872 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2873
2874 PR c++/98480
2875 * coroutines.cc (replace_continue): Rewrite continue into
2876 'goto label'.
2877 (await_statement_walker): Handle await expressions in the
2878 initializer, condition and iteration expressions of for
2879 loops.
2880
2881 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2882
2883 PR c++/96749
2884 * coroutines.cc (flatten_await_stmt): Allow for the case
2885 where a target expression variable only has uses in the
2886 second part of a compound expression.
2887 (maybe_promote_temps): Avoid emiting empty statements.
2888
2889 2021-03-15 Tobias Burnus <tobias@codesourcery.com>
2890
2891 PR c++/99509
2892 * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
2893 ensure that the varpool node is marked as offloadable.
2894
2895 2021-03-12 Nathan Sidwell <nathan@acm.org>
2896
2897 PR c++/99238
2898 * module.cc (depset::hash::add_binding_entity): Assert not
2899 visited.
2900 (depset::add::add_specializations): Likewise.
2901 * name-lookup.c (name_lookup::dedup): New.
2902 (name_lookup::~name_lookup): Assert not deduping.
2903 (name_lookup::restore_state): Likewise.
2904 (name_lookup::add_overload): Replace outlined code with dedup
2905 call.
2906 (name_lookup::add_value): Likewise.
2907 (name_lookup::search_namespace_only): Likewise.
2908 (name_lookup::adl_namespace_fns): Likewise.
2909 (name_lookup::adl_class_fns): Likewise.
2910 (name_lookup::search_adl): Likewise. Add clearing dedup call.
2911 (name_lookup::search_qualified): Likewise.
2912 (name_lookup::search_unqualified): Likewise.
2913
2914 2021-03-12 Jakub Jelinek <jakub@redhat.com>
2915
2916 PR c++/99507
2917 * call.c (build_over_call): For immediate evaluation of functions
2918 that return references, undo convert_from_reference effects before
2919 calling cxx_constant_value and call convert_from_reference
2920 afterwards.
2921
2922 2021-03-11 Nathan Sidwell <nathan@acm.org>
2923
2924 PR c++/99248
2925 * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
2926 when there's a binding vector.
2927 * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
2928
2929 2021-03-11 Nathan Sidwell <nathan@acm.org>
2930
2931 PR c++/99528
2932 * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
2933 MK_decl_tmpl_spec.
2934 (trees_in::decl_value): Adjust add_mergeable_specialization call.
2935 (trees_out::get_merge_kind): Adjust detecting a partial template
2936 instantiation.
2937 (trees_out::key_mergeable): Adjust handling same.
2938 (trees_in::key_mergeabvle): Likewise.
2939
2940 2021-03-10 Nathan Sidwell <nathan@acm.org>
2941
2942 PR c++/99423
2943 * module.cc (post_load_processing): Assert not gcable.
2944 (laxy_load_pendings): Extend no-gc region around
2945 post_load_processing.
2946
2947 2021-03-10 Nathan Sidwell <nathan@acm.org>
2948
2949 PR c++/99508
2950 * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
2951 assembler name to the ns alias.
2952
2953 2021-03-09 Jakub Jelinek <jakub@redhat.com>
2954
2955 PR c++/99459
2956 * coroutines.cc (build_co_await): Look through NOP_EXPRs in
2957 build_special_member_call return value to find the CALL_EXPR.
2958 Simplify.
2959
2960 2021-03-09 Nathan Sidwell <nathan@acm.org>
2961
2962 PR c++/99472
2963 * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
2964 that C++20 does not yet imply modules.
2965
2966 2021-03-08 Nathan Sidwell <nathan@acm.org>
2967
2968 PR c++/99436
2969 * name-lookup.c (get_cxx_dialect_name): Add cxx23.
2970
2971 2021-03-08 Nathan Sidwell <nathan@acm.org>
2972
2973 * lex.c (module_token_filter::resume): Ignore module-decls inside
2974 header-unit.
2975 * parser.c (cp_parser_module_declaration): Reject in header-unit.
2976
2977 2021-03-08 Nathan Sidwell <nathan@acm.org>
2978
2979 PR c++/99285
2980 * cp-tree.h (match_mergeable_specialization)
2981 (add_mergeable_specialization): Adjust parms.
2982 * module.cc (trees_in::decl_value): Adjust
2983 add_mergeable_specialization calls.
2984 (trees_out::key_mergeable): Adjust match_mergeable_specialization
2985 calls.
2986 (specialization_add): Likewise.
2987 * pt.c (match_mergeable_specialization): Do not insert.
2988 (add_mergeable_specialization): Add to hash table here.
2989
2990 2021-03-06 Patrick Palka <ppalka@redhat.com>
2991 Jakub Jelinek <jakub@redhat.com>
2992
2993 PR c++/99287
2994 * constexpr.c (cxx_eval_increment_expression): Pass lval when
2995 evaluating the MODIFY_EXPR, and update 'mod' with the result of
2996 this evaluation. Check *non_constant_p afterwards. For prefix
2997 ops, just return 'mod'.
2998
2999 2021-03-06 Patrick Palka <ppalka@redhat.com>
3000 Jakub Jelinek <jakub@redhat.com>
3001
3002 PR c++/96330
3003 * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
3004 variable 'fn' to 'tmpl'. Handle a variable template-id by
3005 calling lookup_template_variable.
3006
3007 2021-03-06 Patrick Palka <ppalka@redhat.com>
3008
3009 PR c++/99365
3010 * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
3011 outer_targs to do_auto_deduction.
3012 (placeholder_type_constraint_dependent_p): Define.
3013 (do_auto_deduction): When processing_template_decl != 0
3014 and context is adc_unify and we have constraints, pretend the
3015 constraints are satisfied instead of punting. Otherwise don't
3016 punt unless placeholder_type_constraint_dependent_p holds.
3017 Add some clarifying sanity checks. Add a hack to add missing
3018 outermost template levels to outer_args before checking
3019 satisfaction. Don't substitute outer_targs into type if it's
3020 already been done.
3021
3022 2021-03-05 Marek Polacek <polacek@redhat.com>
3023
3024 PR c++/99374
3025 * call.c (standard_conversion): When converting pointers to
3026 member, don't return NULL when the bases are equivalent but
3027 incomplete.
3028
3029 2021-03-05 Marek Polacek <polacek@redhat.com>
3030
3031 PR c++/99120
3032 * name-lookup.c (check_local_shadow): Check if the type of decl
3033 is non-null before checking TYPE_PTR*.
3034
3035 2021-03-05 Nathan Sidwell <nathan@acm.org>
3036
3037 PR c++/99245
3038 * module.cc (module_state::write_cluster): Relax binding assert.
3039
3040 2021-03-05 Nathan Sidwell <nathan@acm.org>
3041
3042 PR c++/99377
3043 * pt.c (instantiate_decl): Call set_instantiating_module.
3044
3045 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3046
3047 PR c++/98118
3048 * coroutines.cc (build_co_await): Use type_build_ctor_call()
3049 to determine cases when a CTOR needs to be built.
3050 (flatten_await_stmt): Likewise.
3051 (morph_fn_to_coro): Likewise.
3052
3053 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3054
3055 PR c++/95616
3056 * coroutines.cc (coro_diagnose_throwing_fn): New helper.
3057 (coro_diagnose_throwing_final_aw_expr): New helper.
3058 (build_co_await): Diagnose throwing final await expression
3059 components.
3060 (build_init_or_final_await): Diagnose a throwing promise
3061 final_suspend() call.
3062
3063 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3064
3065 PR c++/95615
3066 * coroutines.cc (struct param_info): Track parameter copies that need
3067 a DTOR.
3068 (coro_get_frame_dtor): New helper function factored from build_actor().
3069 (build_actor_fn): Use coro_get_frame_dtor().
3070 (morph_fn_to_coro): Track parameters that need DTORs on exception,
3071 likewise the frame promise and the return object. On exception, run the
3072 DTORs for these, destroy the frame and then rethrow the exception.
3073
3074 2021-03-05 Nathan Sidwell <nathan@acm.org>
3075
3076 PR c++/99389
3077 * pt.c (instantiate_class_template_1): Set instantiating module
3078 here.
3079
3080 2021-03-05 Tobias Burnus <tobias@codesourcery.com>
3081
3082 PR c/99137
3083 * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
3084
3085 2021-03-04 Jakub Jelinek <jakub@redhat.com>
3086
3087 PR c++/88146
3088 PR c++/99362
3089 * cvt.c (convert_to_void): Revert 2019-10-17 changes. Clarify
3090 comment.
3091
3092 2021-03-04 Nathan Sidwell <nathan@acm.org>
3093
3094 PR c++/99170
3095 * module.cc (class uintset): Delete.
3096 (typedef attached_map_t): A hash map.
3097 (attached_table): Use attached_map_t. Adjust uses ...
3098 (trees_out::decl_value, trees_in::decl_value): ... here ...
3099 (trees_out::key_mergeable): ... here ...
3100 (trees_in::key_mergeable): ... here ...
3101 (maybe_attach_decl): ... here ...
3102 (direct_import): ... and here.
3103
3104 2021-03-04 Nathan Sidwell <nathan@acm.org>
3105
3106 PR c++/99170
3107 * cp-tree.h
3108 * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
3109 rename.
3110 * module.cc (class pending_key): New.
3111 (default_hash_traits<pending_key>): New specialization.
3112 (pending_map_t): New typedef.
3113 (pending_table): Replace old table.
3114 (trees_out::lang_decl_bools): Adjust.
3115 (trees_in::lang_decl_bools): Adjust.
3116 (trees_in::install_entity): Drop pending member and specialization
3117 handling.
3118 (find_pending_key): New.
3119 (depset::hash::fiund_dependencies): Use it.
3120 (pendset_lazy_load): Delete.
3121 (module_state::write_cluster): Don't count pendings here. Bye
3122 Duff's device-like thing.
3123 (module_state::write_pendings): Reimplement.
3124 (module_state::read_pendings): Reimplement.
3125 (lazy_specializations_p): Delete.
3126 (module_state::write): Adjust write_pendings call.
3127 (lazy_load_pendings): New.
3128 (lazy_load_specializations): Delete.
3129 (lazy_load_members): Delete.
3130 (init_modules): Adjust.
3131 * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
3132 not lazy_load_members.
3133 (note_pending_specializations): Delete.
3134 (load_pending_specializations): Delete.
3135 * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
3136 (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
3137 (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
3138 (note_pending_specializations): Delete.
3139 (load_pending_specializations): Delete.
3140 * pt.c (lookup_template_class_1): Call lazy_load_pendings not
3141 lazy_load_specializations.
3142 (instantiate_template_class_1): Likewise.
3143 (instantiate_decl): Call lazy_load_pendings.
3144 * typeck.c (complete_type): Likewise.
3145
3146 2021-03-03 Nathan Sidwell <nathan@acm.org>
3147
3148 PR c++/99170
3149 * module.cc (post_load_decls): New.
3150 (lazy_snum, recursive_lazy): Move earlier.
3151 (module_state::read_cluster): Push cloning onto post_load_decls.
3152 (post_load_processing): New. Do the cloning here.
3153 (module_state::read_inits): Call post_load_processing.
3154 (module_state::read_language): Likewise.
3155 (lazy_load_binding, lazy_load_specializations): Likewise
3156 (lazy_load_members): Likewise
3157
3158 2021-03-03 Nathan Sidwell <nathan@acm.org>
3159
3160 PR c++/99170
3161 * module.cc (trees_out::decl_value): Stream specialization keys
3162 after decl.
3163 (trees_in::decl_value): Stream them back and insert after
3164 completing the decl.
3165 (trees_out::key_mergeable): Drop some streaming here ...
3166 (trees_in::key_mergeable): ... and here. Don't insert into
3167 specialization tables.
3168
3169 2021-03-03 Patrick Palka <ppalka@redhat.com>
3170
3171 * constraint.cc (struct sat_info): Document the different
3172 meanings of noisy() and diagnose_unsatisfaction_p() during
3173 satisfaction and requires-expression evaluation.
3174 (tsubst_valid_expression_requirement): Take a sat_info instead
3175 of a subst_info. Perform the substitution quietly first. Fold
3176 in error-replaying code from diagnose_valid_expression.
3177 (tsubst_simple_requirement): Take a sat_info instead of a
3178 subst_info.
3179 (tsubst_type_requirement_1): New. Fold in error-replaying code
3180 from diagnose_valid_type.
3181 (tsubst_type_requirement): Use the above. Take a sat_info
3182 instead of a subst_info.
3183 (tsubst_compound_requirement): Likewise. Fold in
3184 error-replaying code from diagnose_compound_requirement.
3185 (tsubst_nested_requirement): Take a sat_info instead of a
3186 subst_info. Fold in error-replaying code from
3187 diagnose_nested_requirement.
3188 (tsubst_requirement): Take a sat_info instead of a subst_info.
3189 (tsubst_requires_expr): Split into two versions, one that takes
3190 a sat_info argument and another that takes a complain and
3191 in_decl argument. Remove outdated documentation. Document the
3192 effects of the sat_info argument. Don't short-circuit
3193 processing of requirements when diagnosing unsatisfaction,
3194 mirroring diagnose_requires_expr.
3195 (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
3196 assert, and se the three-parameter version of tsubst_requires_expr.
3197 (diagnose_trait_expr): Make static. Take a template argument
3198 vector instead of a parameter mapping.
3199 (diagnose_valid_expression): Remove.
3200 (diagnose_valid_type): Remove.
3201 (diagnose_simple_requirement): Remove.
3202 (diagnose_compound_requirement): Remove.
3203 (diagnose_type_requirement): Remove.
3204 (diagnose_nested_requirement): Remove.
3205 (diagnose_requirement): Remove.
3206 (diagnose_requires_expr): Remove.
3207 (diagnose_atomic_constraint): Take a sat_info instead of a
3208 subst_info. Adjust call to diagnose_trait_expr. Call
3209 tsubst_requires_expr instead of diagnose_requires_expr.
3210 (diagnose_constraints): Remove special casing of REQUIRES_EXPR
3211 and just always call constraint_satisfaction_value.
3212
3213 2021-03-03 Patrick Palka <ppalka@redhat.com>
3214
3215 * constexpr.c (cxx_eval_call_expression): Adjust call to
3216 evaluate_concept_check.
3217 (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
3218 evaluate_requires_expression instead of
3219 satisfy_constraint_expression.
3220 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3221 * constraint.cc (struct sat_info): Adjust comment about which
3222 satisfaction entrypoints use noisy-unsat.
3223 (normalize_template_requirements): Remove (and adjust callers
3224 appropriately).
3225 (normalize_nontemplate_requirements): Likewise.
3226 (tsubst_nested_requirement): Use constraint_satisfaction_value
3227 instead of satisfy_constraint_expression, which'll do the
3228 noisy replaying of ill-formed quiet satisfaction for us.
3229 (decl_satisfied_cache): Adjust comment.
3230 (satisfy_constraint): Rename to ...
3231 (satisfy_normalized_constraints): ... this.
3232 (satisfy_associated_constraints): Remove (and make its
3233 callers check for dependent arguments).
3234 (satisfy_constraint_expression): Rename to ...
3235 (satisfy_nondeclaration_constraints): ... this. Assert that
3236 'args' is empty when 't' is a concept-id. Removing handling
3237 bare constraint-expressions, and handle REQUIRES_EXPRs
3238 specially. Adjust comment accordingly.
3239 (satisfy_declaration_constraints): Assert in the two-parameter
3240 version that 't' is not a TEMPLATE_DECL. Adjust following
3241 removal of normalize_(non)?template_requirements and
3242 satisfy_asociated_constraints.
3243 (constraint_satisfaction_value): Combine the two- and
3244 three-parameter versions in the natural way.
3245 (constraints_satisfied_p): Combine the one- and two-parameter
3246 versions in the natural way. Improve documentation.
3247 (evaluate_requires_expr): Define.
3248 (evaluate_concept_check): Remove 'complain' parameter. Use
3249 constraint_satisfaction_value instead of
3250 satisfy_constraint_expression.
3251 (diagnose_nested_requirement): Adjust following renaming of
3252 satisfy_constraint_expression.
3253 (diagnose_constraints): Handle REQUIRES_EXPR by going through
3254 diagnose_requires_expr directly instead of treating it as a
3255 constraint-expression. Improve documentation.
3256 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
3257 to evaluate_concept_check.
3258 <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
3259 constraints_satisfied_p.
3260 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3261 * cp-tree.h (evaluate_requires_expr): Declare.
3262 (evaluate_concept_check): Remove tsubst_flag_t parameter.
3263 (satisfy_constraint_expression): Remove declaration.
3264 (constraints_satisfied_p): Remove one-parameter declaration.
3265 Add a default argument to the two-parameter declaration.
3266 * cvt.c (convert_to_void): Adjust call to
3267 evaluate_concept_check.
3268
3269 2021-03-03 Jakub Jelinek <jakub@redhat.com>
3270
3271 PR c++/82959
3272 * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
3273 and COMPOUND_EXPR.
3274
3275 2021-03-03 Marek Polacek <polacek@redhat.com>
3276
3277 PR c++/97034
3278 PR c++/99009
3279 * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
3280 (maybe_aggr_guide): Use the original template type where needed. In
3281 a class member template, partially instantiate the result of
3282 collect_ctor_idx_types.
3283 (do_class_deduction): Defer the deduction until the enclosing
3284 scope is non-dependent.
3285
3286 2021-03-03 Jason Merrill <jason@redhat.com>
3287
3288 PR c++/95675
3289 * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
3290 if it didn't get one before.
3291
3292 2021-03-03 Nathan Sidwell <nathan@acm.org>
3293
3294 PR c++/99344
3295 * module.cc (trees_out::decl_node): Small refactor.
3296 (depset::hash::add_binding_entity): Return true on meeting an
3297 import. Set namespace's import here.
3298 (module_state:write_namespaces): Inform of purview too.
3299 (module_state:read_namespaces): Adjust.
3300 * name-lookup.c (implicitly_export_namespace): Delete.
3301 (do_pushdecl): Don't call it.
3302 (push_namespace): Likewise, set purview.
3303 (add_imported_namespace): Reorder parms.
3304 * name-lookup.h (add_imported_namespace): Alter param ordering.
3305
3306 2021-03-02 Martin Sebor <msebor@redhat.com>
3307
3308 PR c++/99251
3309 * class.c (build_base_path): Call build_if_nonnull.
3310 * cp-tree.h (build_if_nonnull): Declare.
3311 * rtti.c (ifnonnull): Rename...
3312 (build_if_nonnull): ...to this. Set no-warning bit on COND_EXPR.
3313 (build_dynamic_cast_1): Adjust to name change.
3314
3315 2021-03-02 Patrick Palka <ppalka@redhat.com>
3316
3317 PR c++/96443
3318 PR c++/96960
3319 * constraint.cc (type_deducible_p): Don't substitute into the
3320 constraints, and instead just pass 'args' to do_auto_deduction
3321 as the outer template arguments.
3322 (tsubst_parameter_mapping): Remove confused code for handling
3323 placeholder type arguments.
3324 (normalize_placeholder_type_constraint): Define.
3325 (satisfy_constraint_expression): Use it to handle placeholder
3326 'auto' types.
3327 * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
3328 (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
3329 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
3330 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3331 (make_constrained_placeholder_type): Set
3332 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3333 (do_auto_deduction): Clarify comments about the outer_targs
3334 parameter. Rework satisfaction of a placeholder type constraint
3335 to pass in the complete set of template arguments directly to
3336 constraints_satisfied_p.
3337 (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
3338 instead. Also rebuild the the constraint info on the new auto.
3339
3340 2021-03-02 Patrick Palka <ppalka@redhat.com>
3341
3342 * constraint.cc (build_parameter_mapping): Rely on the caller to
3343 determine the in-scope template parameters.
3344 (norm_info::norm_info): Delegate the tsubst_flags_t constructor
3345 to the two-parameter constructor. In the two-parameter
3346 constructor, fold in the definition of make_context, set
3347 initial_parms appropriately, and don't set the now-removed
3348 orig_decl member.
3349 (norm_info::make_context): Remove, now that its only use is
3350 inlined into the caller.
3351 (norm_info::update_context): Adjust call to
3352 build_parameter_mapping to pass in the relevant set of in-scope
3353 template parameters.
3354 (norm_info::ctx_parms): Define this member function.
3355 (norm_info::context): Initialize to NULL_TREE.
3356 (norm_info::orig_decl): Remove this data member.
3357 (norm_info::initial_parms): Define this data member.
3358 (normalize_atom): Adjust call to build_parameter_mapping to pass
3359 in the relevant set of in-scope template parameters. Use
3360 info.initial_parms instead of info.orig_decl.
3361 (normalize_constraint_expression): Take a norm_info object
3362 instead of a bool. Cache the result of normalization.
3363 (tsubst_nested_requirement): Call satisfy_constraint_expression
3364 instead of satisfy_constraint, so that we normalize on demand.
3365 (satisfy_constraint_expression): Handle a NESTED_REQ argument.
3366 Adjust call to normalize_constraint_expression.
3367 (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
3368 to current_template_parms.
3369 (diagnose_nested_requirements): Go through
3370 satisfy_constraint_expression, as with tsubst_nested_requirement.
3371
3372 2021-03-02 Patrick Palka <ppalka@redhat.com>
3373
3374 * constraint.cc (tsubst_parameter_mapping): Canonicalize the
3375 arguments of a substituted TYPE_ARGUMENT_PACK even if we've
3376 started with a TYPE_ARGUMENT_PACK.
3377 (finish_requires_expr): Don't set DECL_CONTEXT and
3378 CONSTRAINT_VAR_P on each of the introduced parameters here.
3379 * parser.c (cp_parser_requirement_parameter_list): Instead set
3380 these fields earlier, here.
3381 * pt.c (do_auto_deduction): Canonicalize the result of
3382 do_auto_deduction. Pass 'complain' to finish_decltype_type.
3383
3384 2021-03-02 Patrick Palka <ppalka@redhat.com>
3385
3386 * constraint.cc (tsubst_simple_requirement): Just return
3387 boolean_true_node on success.
3388 (tsubst_type_requirement): Likewise.
3389 (tsubst_compound_requirement): Likewise.
3390 (tsubst_nested_requirement): Likewise.
3391 (tsubst_requirement_body): Remove.
3392 (check_constaint_variables): Rename to ...
3393 (check_constraint_variables): ... this.
3394 (tsubst_constraint_variables): Adjust.
3395 (tsubst_requires_expr): Fold tsubst_requirement_body into here.
3396
3397 2021-03-01 Nathan Sidwell <nathan@acm.org>
3398
3399 PR c++/99294
3400 * class.c (fixup_type_variants): Propagate mode, precision,
3401 alignment & emptiness.
3402 * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
3403 (trees_in::tree_node): Rematerialize alignment here.
3404
3405 2021-02-27 Jason Merrill <jason@redhat.com>
3406
3407 PR c++/90333
3408 * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
3409 between () and ->.
3410
3411 2021-02-26 Jakub Jelinek <jakub@redhat.com>
3412
3413 * parser.c (cp_parser_lambda_declarator_opt): Implement
3414 P1102R2 - Down with ()! Make ()s optional before lambda specifiers
3415 for -std={c,gnu}++2b or with pedwarn in earlier versions.
3416
3417 2021-02-26 Jakub Jelinek <jakub@redhat.com>
3418
3419 PR c++/95451
3420 * lambda.c (is_lambda_ignored_entity): Before checking for
3421 LAMBDA_FUNCTION_P, use OVL_FIRST. Drop FUNCTION_DECL check.
3422
3423 2021-02-26 Jason Merrill <jason@redhat.com>
3424
3425 PR c++/98810
3426 * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
3427 to a class non-type template argument that needs it.
3428
3429 2021-02-26 Patrick Palka <ppalka@redhat.com>
3430
3431 PR c++/98990
3432 * pt.c (splice_late_return_type): Rebuild the entire return type
3433 if we have to adjust the level of an auto within.
3434 (type_uses_auto): Adjust call to find_type_usage.
3435 * type-utils.h (find_type_usage): Revert r10-6571 change that
3436 made this function return a pointer to the auto node.
3437
3438 2021-02-25 Patrick Palka <ppalka@redhat.com>
3439
3440 PR c++/99213
3441 PR c++/94521
3442 * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
3443 TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
3444
3445 2021-02-25 Patrick Palka <ppalka@redhat.com>
3446
3447 PR c++/99103
3448 * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
3449 (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
3450
3451 2021-02-25 Marek Polacek <polacek@redhat.com>
3452
3453 DR 1312
3454 PR c++/99176
3455 * constexpr.c (is_std_construct_at): New overload.
3456 (is_std_allocator_allocate): New overload.
3457 (cxx_eval_call_expression): Use the new overloads.
3458 (cxx_eval_constant_expression): Reject casting
3459 from void * as per DR 1312. Don't check can_convert.
3460
3461 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
3462
3463 PR c++/97587
3464 * coroutines.cc (struct param_info): Track rvalue refs.
3465 (morph_fn_to_coro): Track rvalue refs, and call the promise
3466 CTOR with the frame copy of passed parms.
3467
3468 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
3469
3470 PR c++/95822
3471 * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
3472 set throwing_cleanup marker.
3473
3474 2021-02-25 Nathan Sidwell <nathan@acm.org>
3475
3476 PR c++/99166
3477 * module.cc (module_state::inform_cmi_p): Renamed field.
3478 (module_state::do_import): Adjust.
3479 (init_modules, finish_module_processing): Likewise.
3480 (handle_module_option): Likewise.
3481
3482 2021-02-25 Nathan Sidwell <nathan@acm.org>
3483
3484 PR c++/98318
3485 * mapper-client.cc (module_client::open_module_client): Fix typo
3486 of fd init.
3487
3488 2021-02-24 Nathan Sidwell <nathan@acm.org>
3489
3490 PR c++/98718
3491 * module.cc (ool): New indirection vector.
3492 (loc_spans::maybe_propagate): Location is not optional.
3493 (loc_spans::open): Likewise. Assert monotonically advancing.
3494 (module_for_ordinary_loc): Use ool indirection vector.
3495 (module_state::write_prepare_maps): Do not count empty macro
3496 expansions. Elide empty spans.
3497 (module_state::write_macro_maps): Skip empty expansions.
3498 (ool_cmp): New qsort comparator.
3499 (module_state::write): Create and destroy ool vector.
3500 (name_pending_imports): Fix dump push/pop.
3501 (preprocess_module): Likewise. Add more dumping.
3502 (preprocessed_module): Likewise.
3503
3504 2021-02-24 Iain Sandoe <iain@sandoe.co.uk>
3505
3506 PR c++/96251
3507 * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
3508 error reporting when instantiating for a constexpr.
3509
3510 2021-02-23 Nathan Sidwell <nathan@acm.org>
3511
3512 PR c++/99208
3513 * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
3514 identity.
3515
3516 2021-02-23 Patrick Palka <ppalka@redhat.com>
3517
3518 PR c++/95468
3519 * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
3520 over from tsubst_copy.
3521
3522 2021-02-23 Patrick Palka <ppalka@redhat.com>
3523
3524 * pt.c (instantiation_dependent_expression_p): Check
3525 processing_template_decl before calling
3526 potential_constant_expression.
3527
3528 2021-02-22 Nathan Sidwell <nathan@acm.org>
3529
3530 PR c++/99174
3531 * module.cc (struct module_state): Add visited_p flag.
3532 (name_pending_imports): Use it to avoid duplicate requests.
3533 (preprocess_module): Don't read preprocessor state if we failed to
3534 load a module's config.
3535
3536 2021-02-22 Nathan Sidwell <nathan@acm.org>
3537
3538 PR c++/99153
3539 * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
3540 to common-path.
3541 * module.cc (set_defining_module): Add assert.
3542
3543 2021-02-19 Nathan Sidwell <nathan@acm.org>
3544
3545 PR c++/98741
3546 * module.cc (pending_imports): New.
3547 (declare_module): Adjust test condition.
3548 (name_pending_imports): New.
3549 (preprocess_module): Reimplement using pending_imports.
3550 (preprocessed_module): Move name-getting to name_pending_imports.
3551 * name-lookup.c (append_imported_binding_slot): Assert module
3552 ordering is increasing.
3553
3554 2021-02-19 Nathan Sidwell <nathan@acm.org>
3555
3556 * module.cc (note_cmis): New.
3557 (struct module_state): Add inform_read_p bit.
3558 (module_state::do_import): Inform of CMI location, if enabled.
3559 (init_modules): Canonicalize note_cmis entries.
3560 (handle_module_option): Handle -flang-info-module-read=FOO.
3561
3562 2021-02-19 Jason Merrill <jason@redhat.com>
3563
3564 PR c++/96926
3565 * call.c (perfect_conversion_p): Limit rvalueness
3566 test to reference bindings.
3567
3568 2021-02-19 Jason Merrill <jason@redhat.com>
3569
3570 PR c++/96926
3571 * call.c (perfect_conversion_p): New.
3572 (perfect_candidate_p): New.
3573 (add_candidates): Ignore templates after a perfect non-template.
3574
3575 2021-02-18 Nathan Sidwell <nathan@acm.org>
3576
3577 PR c++/99023
3578 * module.cc (canonicalize_header_name): Use
3579 cpp_probe_header_unit.
3580 (maybe_translate_include): Fix note_includes comparison.
3581 (init_modules): Fix note_includes string termination.
3582
3583 2021-02-18 Jakub Jelinek <jakub@redhat.com>
3584
3585 PR c++/99132
3586 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
3587 cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
3588 for immediate function calls.
3589
3590 2021-02-17 Nathan Sidwell <nathan@acm.org>
3591
3592 PR c++/99023
3593 * module.cc (struct macro_export): Add GTY markers.
3594 (macro_exports): Likewise, us a va_gc Vector.
3595
3596 2021-02-17 Jakub Jelinek <jakub@redhat.com>
3597
3598 PR sanitizer/99106
3599 * init.c (build_zero_init_1): For flexible array members just return
3600 NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
3601 ARRAY_TYPE.
3602
3603 2021-02-17 Nathan Sidwell <nathan@acm.org>
3604
3605 PR c++/99116
3606 * name-lookup.c (do_pushdecl): Don't peek under template_parm
3607 bindings here ...
3608 (set_identifier_type_value_with_scope): ... or here.
3609 (do_pushtag): Only set_identifier_type_value_with_scope at
3610 non-class template parm scope, and use parent scope.
3611
3612 2021-02-17 Nathan Sidwell <nathan@acm.org>
3613
3614 PR c++/99071
3615 * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
3616 pointer.
3617
3618 2021-02-17 Patrick Palka <ppalka@redhat.com>
3619
3620 PR debug/96997
3621 PR c++/94034
3622 * tree.c (build_aggr_init_expr): Revert r10-7718 change.
3623
3624 2021-02-12 Nathan Sidwell <nathan@acm.org>
3625
3626 * module.cc (module_state::write_cluster): Check bindings for
3627 imported using-decls.
3628
3629 2021-02-12 Nathan Sidwell <nathan@acm.org>
3630
3631 PR c++/99040
3632 * module.cc (trees_in::decl_value): Call add_module_namespace_decl
3633 for new namespace-scope entities.
3634 (module_state::read_cluster): Don't call add_module_decl here.
3635 * name-lookup.h (add_module_decl): Rename to ...
3636 (add_module_namespace_decl): ... this.
3637 * name-lookup.c (newbinding_bookkeeping): Move into ...
3638 (do_pushdecl): ... here. Its only remaining caller.
3639 (add_module_decl): Rename to ...
3640 (add_module_namespace_decl): ... here. Add checking-assert for
3641 circularity. Don't call newbinding_bookkeeping, just extern_c
3642 checking and incomplete var checking.
3643
3644 2021-02-12 Nathan Sidwell <nathan@acm.org>
3645
3646 PR c++/99039
3647 PR c++/99040
3648 * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
3649 (global_type_node): Delete.
3650 (IDENTIFIER_TYPE_VALUE): Delete.
3651 (IDENTIFIER_HAS_TYPE_VALUE): Delete.
3652 (get_type_value): Delete.
3653 * name-lookup.h (identifier_type_value): Delete.
3654 * name-lookup.c (check_module_override): Don't
3655 SET_IDENTIFIER_TYPE_VALUE here.
3656 (do_pushdecl): Nor here.
3657 (identifier_type_value_1, identifier_type_value): Delete.
3658 (set_identifier_type_value_with_scope): Only
3659 SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
3660 (pushdecl_nanmespace_level): Remove shadow stack nadgering.
3661 (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
3662 * call.c (check_dtor_name): Use lookup_name.
3663 * decl.c (cxx_init_decl_processing): Drop global_type_node.
3664 * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
3665 here.
3666 * init.c (get_type_value): Delete.
3667 * pt.c (instantiate_class_template_1): Don't call pushtag or
3668 SET_IDENTIFIER_TYPE_VALUE here.
3669 (tsubst): Assert never an identifier.
3670 (dependent_type_p): Drop global_type_node assert.
3671 * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
3672 to determine ctorness.
3673
3674 2021-02-12 Jakub Jelinek <jakub@redhat.com>
3675
3676 PR c++/97742
3677 * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
3678 CPP_EOF.
3679
3680 2021-02-12 Jason Merrill <jason@redhat.com>
3681
3682 PR c++/97246
3683 PR c++/94546
3684 * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
3685 (register_parameter_specializations): Not here.
3686
3687 2021-02-11 Marek Polacek <polacek@redhat.com>
3688
3689 PR c++/95888
3690 * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
3691 for the partial instantiation.
3692
3693 2021-02-11 Jakub Jelinek <jakub@redhat.com>
3694
3695 PR c++/99033
3696 * init.c (build_zero_init_1): Handle zero initialiation of
3697 flexible array members like initialization of [0] arrays.
3698 Use integer_minus_onep instead of comparison to integer_minus_one_node
3699 and integer_zerop instead of comparison against size_zero_node.
3700 Formatting fixes.
3701
3702 2021-02-11 Marek Polacek <polacek@redhat.com>
3703
3704 PR c++/99063
3705 * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
3706
3707 2021-02-11 Patrick Palka <ppalka@redhat.com>
3708
3709 PR c++/97582
3710 * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
3711 lookup result by discarding it if the first element is a
3712 class-scope declaration, otherwise return it.
3713 (push_operator_bindings): Handle an ambiguous lookup result by
3714 doing push_local_binding on each element in the list.
3715
3716 2021-02-11 Marek Polacek <polacek@redhat.com>
3717
3718 * parser.c (cp_parser_selection_statement): Use vec_free.
3719
3720 2021-02-10 Jakub Jelinek <jakub@redhat.com>
3721
3722 PR c++/98988
3723 PR c++/99031
3724 * constexpr.c: Include cgraph.h.
3725 (cxx_eval_call_expression): Call varpool_node::finalize_decl on
3726 heap artificial vars.
3727 (cxx_eval_outermost_constant_expr): Remove varpool nodes for
3728 heap artificial vars.
3729
3730 2021-02-10 Nathan Sidwell <nathan@acm.org>
3731
3732 PR c++/99030
3733 * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
3734 answer if there's no local specialization.
3735
3736 2021-02-09 Nathan Sidwell <nathan@acm.org>
3737
3738 PR c++/98944
3739 * module.cc (module_state::is_rooted): Rename to ...
3740 (module_state::has_location): ... here. Adjust callers.
3741 (module_state::read_partitions): Adjust validity check.
3742 Don't overwrite a known location.
3743
3744 2021-02-09 Jason Merrill <jason@redhat.com>
3745
3746 PR c++/96905
3747 * pt.c (mark_decl_instantiated): Exit early if consteval.
3748
3749 2021-02-09 Jason Merrill <jason@redhat.com>
3750
3751 PR c++/98326
3752 PR c++/20408
3753 * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
3754 parm.
3755
3756 2021-02-09 Jason Merrill <jason@redhat.com>
3757
3758 PR c++/98994
3759 PR c++/97566
3760 * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
3761 RECORD_TYPE.
3762
3763 2021-02-08 Nathan Sidwell <nathan@acm.org>
3764
3765 * decl.c (start_cleanup_fn): Push function into
3766 namespace.
3767
3768 2021-02-08 Nathan Sidwell <nathan@acm.org>
3769
3770 PR c++/98531
3771 * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
3772 * decl.c (push_abi_namespace, pop_abi_namespace): Moved
3773 from rtti.c, add default namespace arg.
3774 (check_redeclaration_exception_specification): Allow a lazy
3775 builtin's eh spec to differ from an lready-declared user
3776 declaration.
3777 (declare_global_var): Use push/pop_abi_namespace.
3778 (get_atexit_node): Push the fndecl into a namespace.
3779 * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
3780 decl.c.
3781
3782 2021-02-08 Marek Polacek <polacek@redhat.com>
3783
3784 * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
3785
3786 2021-02-05 Marek Polacek <polacek@redhat.com>
3787
3788 PR c++/98947
3789 * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
3790 on arg2/arg3.
3791 * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
3792 issuing the -Wvolatile warning. Only set TREE_THIS_VOLATILE if
3793 a warning was emitted.
3794
3795 2021-02-05 Marek Polacek <polacek@redhat.com>
3796
3797 PR c++/96462
3798 * name-lookup.c (lookup_using_decl): Hoist the destructor check.
3799
3800 2021-02-05 Jakub Jelinek <jakub@redhat.com>
3801
3802 PR c++/97878
3803 * decl.c (check_array_initializer): For structured bindings, require
3804 the array type to be complete.
3805
3806 2021-02-04 Jason Merrill <jason@redhat.com>
3807
3808 PR c++/98717
3809 * constraint.cc (build_concept_check_arguments): Remove assert.
3810 (build_concept_check): Allow empty args.
3811
3812 2021-02-04 Tom Greenslade (thomgree) <thomgree@cisco.com>
3813
3814 PR c++/90926
3815 * call.c (can_convert_array): Extend to handle all valid aggregate
3816 initializers of an array; including by string literals, not just by
3817 brace-init-list.
3818 (build_aggr_conv): Call can_convert_array more often, not just in
3819 brace-init-list case.
3820 * typeck2.c (array_string_literal_compatible_p): New function.
3821 (digest_init_r): call array_string_literal_compatible_p
3822 * cp-tree.h: (array_string_literal_compatible_p): Declare.
3823
3824 2021-02-04 Jason Merrill <jason@redhat.com>
3825
3826 PR c++/98802
3827 * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
3828
3829 2021-02-04 Jason Merrill <jason@redhat.com>
3830
3831 PR c++/95192
3832 * pt.c (tsubst_attribute): Handle error.
3833 (apply_late_template_attributes): Return false on error.
3834 (tsubst_function_decl): Check its return value.
3835 (tsubst_decl): Likewise.
3836 (push_template_decl): Assert current_template_parms.
3837 (tsubst_template_decl): Set current_template_parms.
3838
3839 2021-02-03 Marek Polacek <polacek@redhat.com>
3840
3841 PR c++/98951
3842 * call.c (struct z_candidate): Mark rewritten and reversed as const.
3843 (struct NonPublicField): Mark operator() as const.
3844 (struct NonTrivialField): Likewise.
3845
3846 2021-02-03 Jason Merrill <jason@redhat.com>
3847
3848 PR c++/98926
3849 PR c++/98570
3850 * pt.c (spec_hasher::equal): Set processing_template_decl.
3851 * Make-lang.in (check-g++-strict-gc): Add --param
3852 hash-table-verification-limit=10000.
3853
3854 2021-02-03 Marek Polacek <polacek@redhat.com>
3855
3856 PR c++/98899
3857 * parser.c (cp_parser_class_specifier_1): Use any possible
3858 DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
3859 (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
3860 * pt.c (tsubst_exception_specification): Stash new_specs into
3861 DEFPARSE_INSTANTIATIONS.
3862 * tree.c (fixup_deferred_exception_variants): Use
3863 UNPARSED_NOEXCEPT_SPEC_P.
3864
3865 2021-02-02 Jason Merrill <jason@redhat.com>
3866
3867 PR c++/98929
3868 PR c++/96199
3869 * error.c (dump_expr): Ignore dummy object.
3870 * pt.c (tsubst_baselink): Handle dependent scope.
3871
3872 2021-02-01 Patrick Palka <ppalka@redhat.com>
3873
3874 PR c++/98295
3875 * constexpr.c (cxx_eval_array_reference): Also set
3876 new_ctx.object when setting new_ctx.ctor.
3877
3878 2021-02-01 Marek Polacek <polacek@redhat.com>
3879
3880 PR c++/98355
3881 * parser.c (cp_parser_has_attribute_expression): Use
3882 uses_template_parms instead of type_dependent_expression_p.
3883
3884 2021-02-01 Jason Merrill <jason@redhat.com>
3885
3886 PR c++/98570
3887 * cp-tree.h: Declare it.
3888 * pt.c (comparing_dependent_aliases): New flag.
3889 (template_args_equal, spec_hasher::equal): Set it.
3890 (dependent_alias_template_spec_p): Assert that we don't
3891 get non-types other than error_mark_node.
3892 (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
3893 on complex alias specializations. Set TYPE_DEPENDENT_P here.
3894 (tsubst_decl): Not here.
3895 * module.cc (module_state::read_cluster): Set
3896 comparing_dependent_aliases instead of
3897 comparing_specializations.
3898 * tree.c (cp_tree_equal): Remove comparing_specializations
3899 module handling.
3900 * typeck.c (structural_comptypes): Adjust.
3901 (comptypes): Remove comparing_specializations handling.
3902
3903 2021-01-29 Nathan Sidwell <nathan@acm.org>
3904
3905 PR c++/98843
3906 * module.cc (module_state_config): Add num_entities field.
3907 (module_state::read_entities): The entity_ary span is
3908 already allocated.
3909 (module_state::write_config): Write num_entities.
3910 (module_state::read_config): Read num_entities.
3911 (module_state::write): Set config's num_entities.
3912 (module_state::read_initial): Allocate the entity ary
3913 span here.
3914 (module_state::read_language): Do not set entity_lwm
3915 here.
3916
3917 2021-01-29 Marek Polacek <polacek@redhat.com>
3918
3919 PR c++/96137
3920 * parser.c (cp_parser_class_name): If parser->scope is
3921 error_mark_node, return it, otherwise continue.
3922
3923 2021-01-28 Jakub Jelinek <jakub@redhat.com>
3924
3925 PR c++/98841
3926 * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
3927
3928 2021-01-28 Jakub Jelinek <jakub@redhat.com>
3929
3930 PR c++/33661
3931 PR c++/98847
3932 * decl.c (cp_finish_decl): For register vars with asmspec in templates
3933 call set_user_assembler_name and set DECL_HARD_REGISTER.
3934 * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
3935 pass asmspec_tree to cp_finish_decl.
3936
3937 2021-01-28 Nathan Sidwell <nathan@acm.org>
3938
3939 PR c++/98770
3940 * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
3941 check order.
3942 (trees_in::decl_value): Do typedef frobbing only when installing
3943 a new typedef, adjust is_matching_decl call. Swap is_typedef
3944 & TYPE_NAME check.
3945 (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
3946 names and deal with typedef checking.
3947
3948 2021-01-27 Jason Merrill <jason@redhat.com>
3949
3950 PR c++/97874
3951 * name-lookup.c (lookup_using_decl): Clean up handling
3952 of dependency and inherited constructors.
3953 (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
3954 * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
3955
3956 2021-01-26 Jason Merrill <jason@redhat.com>
3957
3958 PR c++/97474
3959 * call.c (type_passed_as): Don't mark invisiref restrict.
3960
3961 2021-01-26 Jason Merrill <jason@redhat.com>
3962
3963 PR c++/97566
3964 PR c++/98463
3965 * class.c (layout_class_type): An empty field gets size 0.
3966 (is_empty_field): New.
3967 (check_bases): Check it.
3968 * cp-tree.h (is_empty_field): Declare it.
3969 * constexpr.c (cxx_eval_store_expression): Check it.
3970 (cx_check_missing_mem_inits): Likewise.
3971 * init.c (perform_member_init): Likewise.
3972 * typeck2.c (process_init_constructor_record): Likewise.
3973
3974 2021-01-25 Martin Sebor <msebor@redhat.com>
3975
3976 PR c++/98646
3977 * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
3978
3979 2021-01-25 Jason Merrill <jason@redhat.com>
3980
3981 PR c++/98463
3982 * constexpr.c (get_or_insert_ctor_field): Add check.
3983 (cxx_eval_store_expression): Handle discontinuity of refs.
3984
3985 2021-01-23 Anthony Sharp <anthonysharp15@gmail.com>
3986
3987 * call.c (complain_about_access): Altered function.
3988 * cp-tree.h (complain_about_access): Changed parameters of function.
3989 (get_parent_with_private_access): Declared new function.
3990 * search.c (get_parent_with_private_access): Defined new function.
3991 * semantics.c (enforce_access): Modified function.
3992 * typeck.c (complain_about_unrecognized_member): Updated function
3993 arguments in complain_about_access.
3994
3995 2021-01-23 Patrick Palka <ppalka@redhat.com>
3996
3997 PR c++/97399
3998 * cp-tree.h (shared_member_p): Adjust declaration.
3999 * parser.c (cp_parser_init_declarator): If the storage class
4000 specifier is sc_static, pass true for static_p to
4001 cp_parser_declarator.
4002 (cp_parser_direct_declarator): Don't do inject_this_parm when
4003 the declarator is a friend.
4004 * search.c (shared_member_p): Change return type to bool and
4005 adjust function body accordingly. Return false for a dependent
4006 USING_DECL instead of aborting.
4007 * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
4008 even when type-dependent.
4009
4010 2021-01-22 Marek Polacek <polacek@redhat.com>
4011
4012 PR c++/96623
4013 * parser.c (inject_parm_decls): Remove a redundant assignment.
4014 (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
4015 before calling inject_parm_decls.
4016
4017 2021-01-22 Jason Merrill <jason@redhat.com>
4018
4019 PR c++/98744
4020 * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
4021
4022 2021-01-22 Jakub Jelinek <jakub@redhat.com>
4023
4024 PR sanitizer/95693
4025 * init.c (build_zero_init_1): Revert the 2018-03-06 change to
4026 return build_zero_cst for reference types.
4027 * typeck2.c (process_init_constructor_record): Instead call
4028 build_zero_cst here during error recovery instead of build_zero_init.
4029
4030 2021-01-22 Marek Polacek <polacek@redhat.com>
4031
4032 PR c++/98545
4033 * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
4034 warnings regardless of abi_version_at_least.
4035 (write_expression): When the expression is a dependent name
4036 and an operator name, write "on" before writing its name.
4037
4038 2021-01-22 Marek Polacek <polacek@redhat.com>
4039
4040 PR c++/97966
4041 * pt.c (instantiate_class_template_1): Instantiate members
4042 marked with attribute used only after we're done instantiating
4043 the class.
4044
4045 2021-01-21 Patrick Palka <ppalka@redhat.com>
4046
4047 PR c++/71879
4048 * semantics.c (finish_decltype_type): Set up a cp_unevaluated
4049 sentinel at the start of the function. Remove a now-redundant
4050 manual adjustment of cp_unevaluated_operand.
4051
4052 2021-01-21 Nathan Sidwell <nathan@acm.org>
4053
4054 PR c++/98624
4055 * module.cc (depset::hash::find_dependencies): Add
4056 module arg.
4057 (trees_out::core_vals): Check state before calling
4058 write_location.
4059 (sort_cluster, module_state::write): Adjust
4060 find_dependencies call.
4061
4062 2021-01-21 Jakub Jelinek <jakub@redhat.com>
4063
4064 PR c++/98672
4065 * constexpr.c (check_for_return_continue_data): Add break_stmt member.
4066 (check_for_return_continue): Also look for BREAK_STMT. Handle
4067 SWITCH_STMT by ignoring break_stmt from its body.
4068 (potential_constant_expression_1) <case FOR_STMT>,
4069 <case WHILE_STMT>: If the condition isn't constant true, check if
4070 the loop body can contain a return stmt.
4071 <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
4072 <case IF_STMT>: If recursion with tf_none is successful,
4073 merge *jump_target from the branches - returns with highest priority,
4074 breaks or continues lower. If then branch is potentially constant and
4075 doesn't return, check the else branch if it could return, break or
4076 continue.
4077
4078 2021-01-21 Nathan Sidwell <nathan@acm.org>
4079
4080 PR c++/98530
4081 * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
4082
4083 2021-01-20 Nathan Sidwell <nathan@acm.org>
4084
4085 * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
4086 signed type.
4087
4088 2021-01-20 Patrick Palka <ppalka@redhat.com>
4089
4090 PR c++/95434
4091 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
4092 CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
4093 adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
4094
4095 2021-01-20 Patrick Palka <ppalka@redhat.com>
4096
4097 PR c++/82613
4098 * parser.c (cp_parser_class_head): Defer access checking when
4099 parsing the base-clause until all bases are seen and attached
4100 to the class type.
4101 * pt.c (instantiate_class_template): Likewise when substituting
4102 into dependent bases.
4103
4104 2021-01-20 Jakub Jelinek <jakub@redhat.com>
4105
4106 PR c++/98742
4107 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
4108 error_operand_p, remove clause without further checking. Check
4109 for non-NULL TYPE_NAME.
4110
4111 2021-01-19 Marek Polacek <polacek@redhat.com>
4112
4113 PR c++/98659
4114 * pt.c (maybe_instantiate_noexcept): Return false if FN is
4115 error_mark_node.
4116
4117 2021-01-19 Marek Polacek <polacek@redhat.com>
4118
4119 PR c++/98687
4120 * name-lookup.c (push_using_decl_bindings): New, broken out of...
4121 (finish_nonmember_using_decl): ...here.
4122 * name-lookup.h (push_using_decl_bindings): Update declaration.
4123 * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
4124
4125 2021-01-19 Patrick Palka <ppalka@redhat.com>
4126
4127 PR c++/41437
4128 PR c++/58993
4129 * search.c (friend_accessible_p): If scope is a hidden friend
4130 defined inside a dependent class, consider access from the
4131 class.
4132 * parser.c (cp_parser_late_parsing_for_member): Don't push a
4133 dk_no_check access state.
4134
4135 2021-01-19 Marek Polacek <polacek@redhat.com>
4136
4137 PR c++/98333
4138 * parser.c (cp_parser_class_specifier_1): Perform late-parsing
4139 of NSDMIs before late-parsing of noexcept-specifiers.
4140
4141 2021-01-19 Nathan Sidwell <nathan@acm.org>
4142
4143 * module.cc (identifier): Merge overloads.
4144
4145 2021-01-19 Nathan Sidwell <nathan@acm.org>
4146
4147 PR c++/98624
4148 * module.cc (trees_out::write_location): Make static.
4149
4150 2021-01-16 Kwok Cheung Yeung <kcy@codesourcery.com>
4151
4152 * parser.c (cp_parser_omp_clause_detach): New.
4153 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
4154 (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
4155 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4156 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4157 Prevent use of detach with mergeable and overriding the data sharing
4158 mode of the event handle.
4159
4160 2021-01-15 Nathan Sidwell <nathan@acm.org>
4161
4162 PR c++/98538
4163 * tree.c (cp_build_qualified_type_real): Propagate an array's
4164 dependentness to the copy, if known.
4165
4166 2021-01-15 Jason Merrill <jason@redhat.com>
4167
4168 PR c++/98642
4169 * call.c (unsafe_return_slot_p): Return int.
4170 (init_by_return_slot_p): Split out from...
4171 (unsafe_copy_elision_p): ...here.
4172 (unsafe_copy_elision_p_opt): New name for old meaning.
4173 (build_over_call): Adjust.
4174 (make_safe_copy_elision): New.
4175 * typeck2.c (split_nonconstant_init_1): Elide copy from safe
4176 list-initialization.
4177 * cp-tree.h: Adjust.
4178
4179 2021-01-15 Jason Merrill <jason@redhat.com>
4180
4181 * call.c (base_ctor_for, make_base_init_ok): New.
4182 (build_over_call): Use make_base_init_ok.
4183
4184 2021-01-15 Jason Merrill <jason@redhat.com>
4185
4186 PR c++/63707
4187 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
4188 if we got a CONSTRUCTOR.
4189
4190 2021-01-15 Nathan Sidwell <nathan@acm.org>
4191
4192 PR c++/98591
4193 * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
4194
4195 2021-01-14 Jason Merrill <jason@redhat.com>
4196
4197 * typeck2.c (process_init_constructor_record): Use fldtype
4198 variable consistently.
4199
4200 2021-01-14 Nathan Sidwell <nathan@acm.org>
4201
4202 PR c++/98372
4203 * tree.c (cp_tree_equal): Correct map_context logic.
4204
4205 2021-01-13 Marek Polacek <polacek@redhat.com>
4206
4207 PR c++/98231
4208 * name-lookup.c (push_using_decl_bindings): New.
4209 * name-lookup.h (push_using_decl_bindings): Declare.
4210 * pt.c (tsubst_expr): Call push_using_decl_bindings.
4211
4212 2021-01-13 Nathan Sidwell <nathan@acm.org>
4213
4214 PR c++/98626
4215 * module.cc (module_add_import_initializers): Pass a
4216 zero-element argument vector.
4217
4218 2021-01-12 Patrick Palka <ppalka@redhat.com>
4219
4220 PR c++/98611
4221 * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
4222 the template of a CTAD placeholder.
4223
4224 2021-01-12 Marek Polacek <polacek@redhat.com>
4225
4226 PR c++/98620
4227 * typeck2.c (process_init_constructor_record): Don't emit
4228 -Wmissing-field-initializers warnings in unevaluated contexts.
4229
4230 2021-01-11 Jakub Jelinek <jakub@redhat.com>
4231
4232 PR c++/98481
4233 * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
4234 for types.
4235 (mark_abi_tags_r): Likewise.
4236 * decl2.c (min_vis_r): Likewise.
4237 * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
4238 typedefs.
4239
4240 2021-01-08 Patrick Palka <ppalka@redhat.com>
4241
4242 PR c++/98551
4243 * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
4244 instead of AGGREGATE_TYPE_P before calling replace_result_decl.
4245
4246 2021-01-08 Patrick Palka <ppalka@redhat.com>
4247
4248 PR c++/98515
4249 * semantics.c (check_accessibility_of_qualified_id): Punt if
4250 we're checking access of a scoped non-static member inside a
4251 class template.
4252
4253 2021-01-07 Jakub Jelinek <jakub@redhat.com>
4254
4255 PR c++/98329
4256 * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
4257 cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
4258 its location.
4259 (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
4260
4261 2021-01-07 Marek Polacek <polacek@redhat.com>
4262
4263 PR c++/98441
4264 * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
4265 !late_return_type block.
4266
4267 2021-01-07 Jason Merrill <jason@redhat.com>
4268
4269 * constexpr.c (cxx_bind_parameters_in_call): Add comment.
4270 (cxx_eval_store_expression): Add comment.
4271
4272 2021-01-07 Jason Merrill <jason@redhat.com>
4273
4274 * call.c (has_next): Factor out from...
4275 (next_conversion): ...here.
4276 (strip_standard_conversion): And here.
4277 (is_subseq): And here.
4278 (build_conv): Check it.
4279 (standard_conversion): Don't call build_conv
4280 for ck_identity.
4281
4282 2021-01-06 Martin Sebor <msebor@redhat.com>
4283
4284 PR c++/95768
4285 * error.c (dump_expr): Call c_pretty_printer::unary_expression.
4286
4287 2021-01-05 Patrick Palka <ppalka@redhat.com>
4288
4289 * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
4290 the type of the NTTP, substitute into the type again. If the
4291 type is still dependent, don't unify the NTTP.
4292
4293 2021-01-05 Jakub Jelinek <jakub@redhat.com>
4294
4295 * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
4296 $(CODYLIB) after $(BACKEND).
4297
4298 2021-01-05 Jakub Jelinek <jakub@redhat.com>
4299
4300 PR c++/98469
4301 * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
4302 Punt if lval is true.
4303 * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
4304 the result if it has a class type.
4305
4306 2021-01-05 Marek Polacek <polacek@redhat.com>
4307
4308 PR c++/82099
4309 * pt.c (resolve_overloaded_unification): Call
4310 maybe_instantiate_noexcept after instantiating the function
4311 decl.
4312
4313 2021-01-05 Nathan Sidwell <nathan@acm.org>
4314
4315 * parser.c (cp_parser_module_declaration): Alter diagnostic
4316 text to say where is permissable.
4317
4318 2021-01-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4319
4320 PR c++/98316
4321 * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
4322
4323 2021-01-02 Jan Hubicka <jh@suse.cz>
4324
4325 * cp-tree.h (cp_tree_c_finish_parsing): Declare.
4326 * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
4327 * tree.c (cp_tree_c_finish_parsing): New function.
4328
4329 2021-01-01 Jakub Jelinek <jakub@redhat.com>
4330
4331 * ChangeLog-2020: Rotate ChangeLog. New file.
4332
4333 \f
4334 Copyright (C) 2021 Free Software Foundation, Inc.
4335
4336 Copying and distribution of this file, with or without modification,
4337 are permitted in any medium without royalty provided the copyright
4338 notice and this notice are preserved.