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