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