]> gcc.gnu.org Git - gcc.git/blob - gcc/cp/ChangeLog
Daily bump.
[gcc.git] / gcc / cp / ChangeLog
1 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2
3 PR c++/99047
4 * coroutines.cc (expand_one_await_expression): If the
5 await_ready() expression is not a boolean then convert it
6 as required.
7
8 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
9
10 PR c++/98704
11 * coroutines.cc (build_actor_fn): Make destroy index 1
12 correspond to the abnormal unhandled_exception() exit.
13 Substitute the proxy for the resume index.
14 (coro_rewrite_function_body): Arrange to reset the resume
15 index and make done = true for a rethrown exception from
16 unhandled_exception ().
17 (morph_fn_to_coro): Adjust calls to build_actor_fn and
18 coro_rewrite_function_body.
19
20 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
21
22 PR c++/98480
23 * coroutines.cc (replace_continue): Rewrite continue into
24 'goto label'.
25 (await_statement_walker): Handle await expressions in the
26 initializer, condition and iteration expressions of for
27 loops.
28
29 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
30
31 PR c++/96749
32 * coroutines.cc (flatten_await_stmt): Allow for the case
33 where a target expression variable only has uses in the
34 second part of a compound expression.
35 (maybe_promote_temps): Avoid emiting empty statements.
36
37 2021-03-15 Tobias Burnus <tobias@codesourcery.com>
38
39 PR c++/99509
40 * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
41 ensure that the varpool node is marked as offloadable.
42
43 2021-03-12 Nathan Sidwell <nathan@acm.org>
44
45 PR c++/99238
46 * module.cc (depset::hash::add_binding_entity): Assert not
47 visited.
48 (depset::add::add_specializations): Likewise.
49 * name-lookup.c (name_lookup::dedup): New.
50 (name_lookup::~name_lookup): Assert not deduping.
51 (name_lookup::restore_state): Likewise.
52 (name_lookup::add_overload): Replace outlined code with dedup
53 call.
54 (name_lookup::add_value): Likewise.
55 (name_lookup::search_namespace_only): Likewise.
56 (name_lookup::adl_namespace_fns): Likewise.
57 (name_lookup::adl_class_fns): Likewise.
58 (name_lookup::search_adl): Likewise. Add clearing dedup call.
59 (name_lookup::search_qualified): Likewise.
60 (name_lookup::search_unqualified): Likewise.
61
62 2021-03-12 Jakub Jelinek <jakub@redhat.com>
63
64 PR c++/99507
65 * call.c (build_over_call): For immediate evaluation of functions
66 that return references, undo convert_from_reference effects before
67 calling cxx_constant_value and call convert_from_reference
68 afterwards.
69
70 2021-03-11 Nathan Sidwell <nathan@acm.org>
71
72 PR c++/99248
73 * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
74 when there's a binding vector.
75 * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
76
77 2021-03-11 Nathan Sidwell <nathan@acm.org>
78
79 PR c++/99528
80 * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
81 MK_decl_tmpl_spec.
82 (trees_in::decl_value): Adjust add_mergeable_specialization call.
83 (trees_out::get_merge_kind): Adjust detecting a partial template
84 instantiation.
85 (trees_out::key_mergeable): Adjust handling same.
86 (trees_in::key_mergeabvle): Likewise.
87
88 2021-03-10 Nathan Sidwell <nathan@acm.org>
89
90 PR c++/99423
91 * module.cc (post_load_processing): Assert not gcable.
92 (laxy_load_pendings): Extend no-gc region around
93 post_load_processing.
94
95 2021-03-10 Nathan Sidwell <nathan@acm.org>
96
97 PR c++/99508
98 * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
99 assembler name to the ns alias.
100
101 2021-03-09 Jakub Jelinek <jakub@redhat.com>
102
103 PR c++/99459
104 * coroutines.cc (build_co_await): Look through NOP_EXPRs in
105 build_special_member_call return value to find the CALL_EXPR.
106 Simplify.
107
108 2021-03-09 Nathan Sidwell <nathan@acm.org>
109
110 PR c++/99472
111 * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
112 that C++20 does not yet imply modules.
113
114 2021-03-08 Nathan Sidwell <nathan@acm.org>
115
116 PR c++/99436
117 * name-lookup.c (get_cxx_dialect_name): Add cxx23.
118
119 2021-03-08 Nathan Sidwell <nathan@acm.org>
120
121 * lex.c (module_token_filter::resume): Ignore module-decls inside
122 header-unit.
123 * parser.c (cp_parser_module_declaration): Reject in header-unit.
124
125 2021-03-08 Nathan Sidwell <nathan@acm.org>
126
127 PR c++/99285
128 * cp-tree.h (match_mergeable_specialization)
129 (add_mergeable_specialization): Adjust parms.
130 * module.cc (trees_in::decl_value): Adjust
131 add_mergeable_specialization calls.
132 (trees_out::key_mergeable): Adjust match_mergeable_specialization
133 calls.
134 (specialization_add): Likewise.
135 * pt.c (match_mergeable_specialization): Do not insert.
136 (add_mergeable_specialization): Add to hash table here.
137
138 2021-03-06 Patrick Palka <ppalka@redhat.com>
139 Jakub Jelinek <jakub@redhat.com>
140
141 PR c++/99287
142 * constexpr.c (cxx_eval_increment_expression): Pass lval when
143 evaluating the MODIFY_EXPR, and update 'mod' with the result of
144 this evaluation. Check *non_constant_p afterwards. For prefix
145 ops, just return 'mod'.
146
147 2021-03-06 Patrick Palka <ppalka@redhat.com>
148 Jakub Jelinek <jakub@redhat.com>
149
150 PR c++/96330
151 * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
152 variable 'fn' to 'tmpl'. Handle a variable template-id by
153 calling lookup_template_variable.
154
155 2021-03-06 Patrick Palka <ppalka@redhat.com>
156
157 PR c++/99365
158 * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
159 outer_targs to do_auto_deduction.
160 (placeholder_type_constraint_dependent_p): Define.
161 (do_auto_deduction): When processing_template_decl != 0
162 and context is adc_unify and we have constraints, pretend the
163 constraints are satisfied instead of punting. Otherwise don't
164 punt unless placeholder_type_constraint_dependent_p holds.
165 Add some clarifying sanity checks. Add a hack to add missing
166 outermost template levels to outer_args before checking
167 satisfaction. Don't substitute outer_targs into type if it's
168 already been done.
169
170 2021-03-05 Marek Polacek <polacek@redhat.com>
171
172 PR c++/99374
173 * call.c (standard_conversion): When converting pointers to
174 member, don't return NULL when the bases are equivalent but
175 incomplete.
176
177 2021-03-05 Marek Polacek <polacek@redhat.com>
178
179 PR c++/99120
180 * name-lookup.c (check_local_shadow): Check if the type of decl
181 is non-null before checking TYPE_PTR*.
182
183 2021-03-05 Nathan Sidwell <nathan@acm.org>
184
185 PR c++/99245
186 * module.cc (module_state::write_cluster): Relax binding assert.
187
188 2021-03-05 Nathan Sidwell <nathan@acm.org>
189
190 PR c++/99377
191 * pt.c (instantiate_decl): Call set_instantiating_module.
192
193 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
194
195 PR c++/98118
196 * coroutines.cc (build_co_await): Use type_build_ctor_call()
197 to determine cases when a CTOR needs to be built.
198 (flatten_await_stmt): Likewise.
199 (morph_fn_to_coro): Likewise.
200
201 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
202
203 PR c++/95616
204 * coroutines.cc (coro_diagnose_throwing_fn): New helper.
205 (coro_diagnose_throwing_final_aw_expr): New helper.
206 (build_co_await): Diagnose throwing final await expression
207 components.
208 (build_init_or_final_await): Diagnose a throwing promise
209 final_suspend() call.
210
211 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
212
213 PR c++/95615
214 * coroutines.cc (struct param_info): Track parameter copies that need
215 a DTOR.
216 (coro_get_frame_dtor): New helper function factored from build_actor().
217 (build_actor_fn): Use coro_get_frame_dtor().
218 (morph_fn_to_coro): Track parameters that need DTORs on exception,
219 likewise the frame promise and the return object. On exception, run the
220 DTORs for these, destroy the frame and then rethrow the exception.
221
222 2021-03-05 Nathan Sidwell <nathan@acm.org>
223
224 PR c++/99389
225 * pt.c (instantiate_class_template_1): Set instantiating module
226 here.
227
228 2021-03-05 Tobias Burnus <tobias@codesourcery.com>
229
230 PR c/99137
231 * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
232
233 2021-03-04 Jakub Jelinek <jakub@redhat.com>
234
235 PR c++/88146
236 PR c++/99362
237 * cvt.c (convert_to_void): Revert 2019-10-17 changes. Clarify
238 comment.
239
240 2021-03-04 Nathan Sidwell <nathan@acm.org>
241
242 PR c++/99170
243 * module.cc (class uintset): Delete.
244 (typedef attached_map_t): A hash map.
245 (attached_table): Use attached_map_t. Adjust uses ...
246 (trees_out::decl_value, trees_in::decl_value): ... here ...
247 (trees_out::key_mergeable): ... here ...
248 (trees_in::key_mergeable): ... here ...
249 (maybe_attach_decl): ... here ...
250 (direct_import): ... and here.
251
252 2021-03-04 Nathan Sidwell <nathan@acm.org>
253
254 PR c++/99170
255 * cp-tree.h
256 * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
257 rename.
258 * module.cc (class pending_key): New.
259 (default_hash_traits<pending_key>): New specialization.
260 (pending_map_t): New typedef.
261 (pending_table): Replace old table.
262 (trees_out::lang_decl_bools): Adjust.
263 (trees_in::lang_decl_bools): Adjust.
264 (trees_in::install_entity): Drop pending member and specialization
265 handling.
266 (find_pending_key): New.
267 (depset::hash::fiund_dependencies): Use it.
268 (pendset_lazy_load): Delete.
269 (module_state::write_cluster): Don't count pendings here. Bye
270 Duff's device-like thing.
271 (module_state::write_pendings): Reimplement.
272 (module_state::read_pendings): Reimplement.
273 (lazy_specializations_p): Delete.
274 (module_state::write): Adjust write_pendings call.
275 (lazy_load_pendings): New.
276 (lazy_load_specializations): Delete.
277 (lazy_load_members): Delete.
278 (init_modules): Adjust.
279 * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
280 not lazy_load_members.
281 (note_pending_specializations): Delete.
282 (load_pending_specializations): Delete.
283 * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
284 (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
285 (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
286 (note_pending_specializations): Delete.
287 (load_pending_specializations): Delete.
288 * pt.c (lookup_template_class_1): Call lazy_load_pendings not
289 lazy_load_specializations.
290 (instantiate_template_class_1): Likewise.
291 (instantiate_decl): Call lazy_load_pendings.
292 * typeck.c (complete_type): Likewise.
293
294 2021-03-03 Nathan Sidwell <nathan@acm.org>
295
296 PR c++/99170
297 * module.cc (post_load_decls): New.
298 (lazy_snum, recursive_lazy): Move earlier.
299 (module_state::read_cluster): Push cloning onto post_load_decls.
300 (post_load_processing): New. Do the cloning here.
301 (module_state::read_inits): Call post_load_processing.
302 (module_state::read_language): Likewise.
303 (lazy_load_binding, lazy_load_specializations): Likewise
304 (lazy_load_members): Likewise
305
306 2021-03-03 Nathan Sidwell <nathan@acm.org>
307
308 PR c++/99170
309 * module.cc (trees_out::decl_value): Stream specialization keys
310 after decl.
311 (trees_in::decl_value): Stream them back and insert after
312 completing the decl.
313 (trees_out::key_mergeable): Drop some streaming here ...
314 (trees_in::key_mergeable): ... and here. Don't insert into
315 specialization tables.
316
317 2021-03-03 Patrick Palka <ppalka@redhat.com>
318
319 * constraint.cc (struct sat_info): Document the different
320 meanings of noisy() and diagnose_unsatisfaction_p() during
321 satisfaction and requires-expression evaluation.
322 (tsubst_valid_expression_requirement): Take a sat_info instead
323 of a subst_info. Perform the substitution quietly first. Fold
324 in error-replaying code from diagnose_valid_expression.
325 (tsubst_simple_requirement): Take a sat_info instead of a
326 subst_info.
327 (tsubst_type_requirement_1): New. Fold in error-replaying code
328 from diagnose_valid_type.
329 (tsubst_type_requirement): Use the above. Take a sat_info
330 instead of a subst_info.
331 (tsubst_compound_requirement): Likewise. Fold in
332 error-replaying code from diagnose_compound_requirement.
333 (tsubst_nested_requirement): Take a sat_info instead of a
334 subst_info. Fold in error-replaying code from
335 diagnose_nested_requirement.
336 (tsubst_requirement): Take a sat_info instead of a subst_info.
337 (tsubst_requires_expr): Split into two versions, one that takes
338 a sat_info argument and another that takes a complain and
339 in_decl argument. Remove outdated documentation. Document the
340 effects of the sat_info argument. Don't short-circuit
341 processing of requirements when diagnosing unsatisfaction,
342 mirroring diagnose_requires_expr.
343 (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
344 assert, and se the three-parameter version of tsubst_requires_expr.
345 (diagnose_trait_expr): Make static. Take a template argument
346 vector instead of a parameter mapping.
347 (diagnose_valid_expression): Remove.
348 (diagnose_valid_type): Remove.
349 (diagnose_simple_requirement): Remove.
350 (diagnose_compound_requirement): Remove.
351 (diagnose_type_requirement): Remove.
352 (diagnose_nested_requirement): Remove.
353 (diagnose_requirement): Remove.
354 (diagnose_requires_expr): Remove.
355 (diagnose_atomic_constraint): Take a sat_info instead of a
356 subst_info. Adjust call to diagnose_trait_expr. Call
357 tsubst_requires_expr instead of diagnose_requires_expr.
358 (diagnose_constraints): Remove special casing of REQUIRES_EXPR
359 and just always call constraint_satisfaction_value.
360
361 2021-03-03 Patrick Palka <ppalka@redhat.com>
362
363 * constexpr.c (cxx_eval_call_expression): Adjust call to
364 evaluate_concept_check.
365 (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
366 evaluate_requires_expression instead of
367 satisfy_constraint_expression.
368 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
369 * constraint.cc (struct sat_info): Adjust comment about which
370 satisfaction entrypoints use noisy-unsat.
371 (normalize_template_requirements): Remove (and adjust callers
372 appropriately).
373 (normalize_nontemplate_requirements): Likewise.
374 (tsubst_nested_requirement): Use constraint_satisfaction_value
375 instead of satisfy_constraint_expression, which'll do the
376 noisy replaying of ill-formed quiet satisfaction for us.
377 (decl_satisfied_cache): Adjust comment.
378 (satisfy_constraint): Rename to ...
379 (satisfy_normalized_constraints): ... this.
380 (satisfy_associated_constraints): Remove (and make its
381 callers check for dependent arguments).
382 (satisfy_constraint_expression): Rename to ...
383 (satisfy_nondeclaration_constraints): ... this. Assert that
384 'args' is empty when 't' is a concept-id. Removing handling
385 bare constraint-expressions, and handle REQUIRES_EXPRs
386 specially. Adjust comment accordingly.
387 (satisfy_declaration_constraints): Assert in the two-parameter
388 version that 't' is not a TEMPLATE_DECL. Adjust following
389 removal of normalize_(non)?template_requirements and
390 satisfy_asociated_constraints.
391 (constraint_satisfaction_value): Combine the two- and
392 three-parameter versions in the natural way.
393 (constraints_satisfied_p): Combine the one- and two-parameter
394 versions in the natural way. Improve documentation.
395 (evaluate_requires_expr): Define.
396 (evaluate_concept_check): Remove 'complain' parameter. Use
397 constraint_satisfaction_value instead of
398 satisfy_constraint_expression.
399 (diagnose_nested_requirement): Adjust following renaming of
400 satisfy_constraint_expression.
401 (diagnose_constraints): Handle REQUIRES_EXPR by going through
402 diagnose_requires_expr directly instead of treating it as a
403 constraint-expression. Improve documentation.
404 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
405 to evaluate_concept_check.
406 <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
407 constraints_satisfied_p.
408 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
409 * cp-tree.h (evaluate_requires_expr): Declare.
410 (evaluate_concept_check): Remove tsubst_flag_t parameter.
411 (satisfy_constraint_expression): Remove declaration.
412 (constraints_satisfied_p): Remove one-parameter declaration.
413 Add a default argument to the two-parameter declaration.
414 * cvt.c (convert_to_void): Adjust call to
415 evaluate_concept_check.
416
417 2021-03-03 Jakub Jelinek <jakub@redhat.com>
418
419 PR c++/82959
420 * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
421 and COMPOUND_EXPR.
422
423 2021-03-03 Marek Polacek <polacek@redhat.com>
424
425 PR c++/97034
426 PR c++/99009
427 * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
428 (maybe_aggr_guide): Use the original template type where needed. In
429 a class member template, partially instantiate the result of
430 collect_ctor_idx_types.
431 (do_class_deduction): Defer the deduction until the enclosing
432 scope is non-dependent.
433
434 2021-03-03 Jason Merrill <jason@redhat.com>
435
436 PR c++/95675
437 * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
438 if it didn't get one before.
439
440 2021-03-03 Nathan Sidwell <nathan@acm.org>
441
442 PR c++/99344
443 * module.cc (trees_out::decl_node): Small refactor.
444 (depset::hash::add_binding_entity): Return true on meeting an
445 import. Set namespace's import here.
446 (module_state:write_namespaces): Inform of purview too.
447 (module_state:read_namespaces): Adjust.
448 * name-lookup.c (implicitly_export_namespace): Delete.
449 (do_pushdecl): Don't call it.
450 (push_namespace): Likewise, set purview.
451 (add_imported_namespace): Reorder parms.
452 * name-lookup.h (add_imported_namespace): Alter param ordering.
453
454 2021-03-02 Martin Sebor <msebor@redhat.com>
455
456 PR c++/99251
457 * class.c (build_base_path): Call build_if_nonnull.
458 * cp-tree.h (build_if_nonnull): Declare.
459 * rtti.c (ifnonnull): Rename...
460 (build_if_nonnull): ...to this. Set no-warning bit on COND_EXPR.
461 (build_dynamic_cast_1): Adjust to name change.
462
463 2021-03-02 Patrick Palka <ppalka@redhat.com>
464
465 PR c++/96443
466 PR c++/96960
467 * constraint.cc (type_deducible_p): Don't substitute into the
468 constraints, and instead just pass 'args' to do_auto_deduction
469 as the outer template arguments.
470 (tsubst_parameter_mapping): Remove confused code for handling
471 placeholder type arguments.
472 (normalize_placeholder_type_constraint): Define.
473 (satisfy_constraint_expression): Use it to handle placeholder
474 'auto' types.
475 * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
476 (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
477 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
478 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
479 (make_constrained_placeholder_type): Set
480 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
481 (do_auto_deduction): Clarify comments about the outer_targs
482 parameter. Rework satisfaction of a placeholder type constraint
483 to pass in the complete set of template arguments directly to
484 constraints_satisfied_p.
485 (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
486 instead. Also rebuild the the constraint info on the new auto.
487
488 2021-03-02 Patrick Palka <ppalka@redhat.com>
489
490 * constraint.cc (build_parameter_mapping): Rely on the caller to
491 determine the in-scope template parameters.
492 (norm_info::norm_info): Delegate the tsubst_flags_t constructor
493 to the two-parameter constructor. In the two-parameter
494 constructor, fold in the definition of make_context, set
495 initial_parms appropriately, and don't set the now-removed
496 orig_decl member.
497 (norm_info::make_context): Remove, now that its only use is
498 inlined into the caller.
499 (norm_info::update_context): Adjust call to
500 build_parameter_mapping to pass in the relevant set of in-scope
501 template parameters.
502 (norm_info::ctx_parms): Define this member function.
503 (norm_info::context): Initialize to NULL_TREE.
504 (norm_info::orig_decl): Remove this data member.
505 (norm_info::initial_parms): Define this data member.
506 (normalize_atom): Adjust call to build_parameter_mapping to pass
507 in the relevant set of in-scope template parameters. Use
508 info.initial_parms instead of info.orig_decl.
509 (normalize_constraint_expression): Take a norm_info object
510 instead of a bool. Cache the result of normalization.
511 (tsubst_nested_requirement): Call satisfy_constraint_expression
512 instead of satisfy_constraint, so that we normalize on demand.
513 (satisfy_constraint_expression): Handle a NESTED_REQ argument.
514 Adjust call to normalize_constraint_expression.
515 (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
516 to current_template_parms.
517 (diagnose_nested_requirements): Go through
518 satisfy_constraint_expression, as with tsubst_nested_requirement.
519
520 2021-03-02 Patrick Palka <ppalka@redhat.com>
521
522 * constraint.cc (tsubst_parameter_mapping): Canonicalize the
523 arguments of a substituted TYPE_ARGUMENT_PACK even if we've
524 started with a TYPE_ARGUMENT_PACK.
525 (finish_requires_expr): Don't set DECL_CONTEXT and
526 CONSTRAINT_VAR_P on each of the introduced parameters here.
527 * parser.c (cp_parser_requirement_parameter_list): Instead set
528 these fields earlier, here.
529 * pt.c (do_auto_deduction): Canonicalize the result of
530 do_auto_deduction. Pass 'complain' to finish_decltype_type.
531
532 2021-03-02 Patrick Palka <ppalka@redhat.com>
533
534 * constraint.cc (tsubst_simple_requirement): Just return
535 boolean_true_node on success.
536 (tsubst_type_requirement): Likewise.
537 (tsubst_compound_requirement): Likewise.
538 (tsubst_nested_requirement): Likewise.
539 (tsubst_requirement_body): Remove.
540 (check_constaint_variables): Rename to ...
541 (check_constraint_variables): ... this.
542 (tsubst_constraint_variables): Adjust.
543 (tsubst_requires_expr): Fold tsubst_requirement_body into here.
544
545 2021-03-01 Nathan Sidwell <nathan@acm.org>
546
547 PR c++/99294
548 * class.c (fixup_type_variants): Propagate mode, precision,
549 alignment & emptiness.
550 * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
551 (trees_in::tree_node): Rematerialize alignment here.
552
553 2021-02-27 Jason Merrill <jason@redhat.com>
554
555 PR c++/90333
556 * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
557 between () and ->.
558
559 2021-02-26 Jakub Jelinek <jakub@redhat.com>
560
561 * parser.c (cp_parser_lambda_declarator_opt): Implement
562 P1102R2 - Down with ()! Make ()s optional before lambda specifiers
563 for -std={c,gnu}++2b or with pedwarn in earlier versions.
564
565 2021-02-26 Jakub Jelinek <jakub@redhat.com>
566
567 PR c++/95451
568 * lambda.c (is_lambda_ignored_entity): Before checking for
569 LAMBDA_FUNCTION_P, use OVL_FIRST. Drop FUNCTION_DECL check.
570
571 2021-02-26 Jason Merrill <jason@redhat.com>
572
573 PR c++/98810
574 * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
575 to a class non-type template argument that needs it.
576
577 2021-02-26 Patrick Palka <ppalka@redhat.com>
578
579 PR c++/98990
580 * pt.c (splice_late_return_type): Rebuild the entire return type
581 if we have to adjust the level of an auto within.
582 (type_uses_auto): Adjust call to find_type_usage.
583 * type-utils.h (find_type_usage): Revert r10-6571 change that
584 made this function return a pointer to the auto node.
585
586 2021-02-25 Patrick Palka <ppalka@redhat.com>
587
588 PR c++/99213
589 PR c++/94521
590 * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
591 TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
592
593 2021-02-25 Patrick Palka <ppalka@redhat.com>
594
595 PR c++/99103
596 * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
597 (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
598
599 2021-02-25 Marek Polacek <polacek@redhat.com>
600
601 DR 1312
602 PR c++/99176
603 * constexpr.c (is_std_construct_at): New overload.
604 (is_std_allocator_allocate): New overload.
605 (cxx_eval_call_expression): Use the new overloads.
606 (cxx_eval_constant_expression): Reject casting
607 from void * as per DR 1312. Don't check can_convert.
608
609 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
610
611 PR c++/97587
612 * coroutines.cc (struct param_info): Track rvalue refs.
613 (morph_fn_to_coro): Track rvalue refs, and call the promise
614 CTOR with the frame copy of passed parms.
615
616 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
617
618 PR c++/95822
619 * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
620 set throwing_cleanup marker.
621
622 2021-02-25 Nathan Sidwell <nathan@acm.org>
623
624 PR c++/99166
625 * module.cc (module_state::inform_cmi_p): Renamed field.
626 (module_state::do_import): Adjust.
627 (init_modules, finish_module_processing): Likewise.
628 (handle_module_option): Likewise.
629
630 2021-02-25 Nathan Sidwell <nathan@acm.org>
631
632 PR c++/98318
633 * mapper-client.cc (module_client::open_module_client): Fix typo
634 of fd init.
635
636 2021-02-24 Nathan Sidwell <nathan@acm.org>
637
638 PR c++/98718
639 * module.cc (ool): New indirection vector.
640 (loc_spans::maybe_propagate): Location is not optional.
641 (loc_spans::open): Likewise. Assert monotonically advancing.
642 (module_for_ordinary_loc): Use ool indirection vector.
643 (module_state::write_prepare_maps): Do not count empty macro
644 expansions. Elide empty spans.
645 (module_state::write_macro_maps): Skip empty expansions.
646 (ool_cmp): New qsort comparator.
647 (module_state::write): Create and destroy ool vector.
648 (name_pending_imports): Fix dump push/pop.
649 (preprocess_module): Likewise. Add more dumping.
650 (preprocessed_module): Likewise.
651
652 2021-02-24 Iain Sandoe <iain@sandoe.co.uk>
653
654 PR c++/96251
655 * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
656 error reporting when instantiating for a constexpr.
657
658 2021-02-23 Nathan Sidwell <nathan@acm.org>
659
660 PR c++/99208
661 * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
662 identity.
663
664 2021-02-23 Patrick Palka <ppalka@redhat.com>
665
666 PR c++/95468
667 * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
668 over from tsubst_copy.
669
670 2021-02-23 Patrick Palka <ppalka@redhat.com>
671
672 * pt.c (instantiation_dependent_expression_p): Check
673 processing_template_decl before calling
674 potential_constant_expression.
675
676 2021-02-22 Nathan Sidwell <nathan@acm.org>
677
678 PR c++/99174
679 * module.cc (struct module_state): Add visited_p flag.
680 (name_pending_imports): Use it to avoid duplicate requests.
681 (preprocess_module): Don't read preprocessor state if we failed to
682 load a module's config.
683
684 2021-02-22 Nathan Sidwell <nathan@acm.org>
685
686 PR c++/99153
687 * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
688 to common-path.
689 * module.cc (set_defining_module): Add assert.
690
691 2021-02-19 Nathan Sidwell <nathan@acm.org>
692
693 PR c++/98741
694 * module.cc (pending_imports): New.
695 (declare_module): Adjust test condition.
696 (name_pending_imports): New.
697 (preprocess_module): Reimplement using pending_imports.
698 (preprocessed_module): Move name-getting to name_pending_imports.
699 * name-lookup.c (append_imported_binding_slot): Assert module
700 ordering is increasing.
701
702 2021-02-19 Nathan Sidwell <nathan@acm.org>
703
704 * module.cc (note_cmis): New.
705 (struct module_state): Add inform_read_p bit.
706 (module_state::do_import): Inform of CMI location, if enabled.
707 (init_modules): Canonicalize note_cmis entries.
708 (handle_module_option): Handle -flang-info-module-read=FOO.
709
710 2021-02-19 Jason Merrill <jason@redhat.com>
711
712 PR c++/96926
713 * call.c (perfect_conversion_p): Limit rvalueness
714 test to reference bindings.
715
716 2021-02-19 Jason Merrill <jason@redhat.com>
717
718 PR c++/96926
719 * call.c (perfect_conversion_p): New.
720 (perfect_candidate_p): New.
721 (add_candidates): Ignore templates after a perfect non-template.
722
723 2021-02-18 Nathan Sidwell <nathan@acm.org>
724
725 PR c++/99023
726 * module.cc (canonicalize_header_name): Use
727 cpp_probe_header_unit.
728 (maybe_translate_include): Fix note_includes comparison.
729 (init_modules): Fix note_includes string termination.
730
731 2021-02-18 Jakub Jelinek <jakub@redhat.com>
732
733 PR c++/99132
734 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
735 cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
736 for immediate function calls.
737
738 2021-02-17 Nathan Sidwell <nathan@acm.org>
739
740 PR c++/99023
741 * module.cc (struct macro_export): Add GTY markers.
742 (macro_exports): Likewise, us a va_gc Vector.
743
744 2021-02-17 Jakub Jelinek <jakub@redhat.com>
745
746 PR sanitizer/99106
747 * init.c (build_zero_init_1): For flexible array members just return
748 NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
749 ARRAY_TYPE.
750
751 2021-02-17 Nathan Sidwell <nathan@acm.org>
752
753 PR c++/99116
754 * name-lookup.c (do_pushdecl): Don't peek under template_parm
755 bindings here ...
756 (set_identifier_type_value_with_scope): ... or here.
757 (do_pushtag): Only set_identifier_type_value_with_scope at
758 non-class template parm scope, and use parent scope.
759
760 2021-02-17 Nathan Sidwell <nathan@acm.org>
761
762 PR c++/99071
763 * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
764 pointer.
765
766 2021-02-17 Patrick Palka <ppalka@redhat.com>
767
768 PR debug/96997
769 PR c++/94034
770 * tree.c (build_aggr_init_expr): Revert r10-7718 change.
771
772 2021-02-12 Nathan Sidwell <nathan@acm.org>
773
774 * module.cc (module_state::write_cluster): Check bindings for
775 imported using-decls.
776
777 2021-02-12 Nathan Sidwell <nathan@acm.org>
778
779 PR c++/99040
780 * module.cc (trees_in::decl_value): Call add_module_namespace_decl
781 for new namespace-scope entities.
782 (module_state::read_cluster): Don't call add_module_decl here.
783 * name-lookup.h (add_module_decl): Rename to ...
784 (add_module_namespace_decl): ... this.
785 * name-lookup.c (newbinding_bookkeeping): Move into ...
786 (do_pushdecl): ... here. Its only remaining caller.
787 (add_module_decl): Rename to ...
788 (add_module_namespace_decl): ... here. Add checking-assert for
789 circularity. Don't call newbinding_bookkeeping, just extern_c
790 checking and incomplete var checking.
791
792 2021-02-12 Nathan Sidwell <nathan@acm.org>
793
794 PR c++/99039
795 PR c++/99040
796 * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
797 (global_type_node): Delete.
798 (IDENTIFIER_TYPE_VALUE): Delete.
799 (IDENTIFIER_HAS_TYPE_VALUE): Delete.
800 (get_type_value): Delete.
801 * name-lookup.h (identifier_type_value): Delete.
802 * name-lookup.c (check_module_override): Don't
803 SET_IDENTIFIER_TYPE_VALUE here.
804 (do_pushdecl): Nor here.
805 (identifier_type_value_1, identifier_type_value): Delete.
806 (set_identifier_type_value_with_scope): Only
807 SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
808 (pushdecl_nanmespace_level): Remove shadow stack nadgering.
809 (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
810 * call.c (check_dtor_name): Use lookup_name.
811 * decl.c (cxx_init_decl_processing): Drop global_type_node.
812 * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
813 here.
814 * init.c (get_type_value): Delete.
815 * pt.c (instantiate_class_template_1): Don't call pushtag or
816 SET_IDENTIFIER_TYPE_VALUE here.
817 (tsubst): Assert never an identifier.
818 (dependent_type_p): Drop global_type_node assert.
819 * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
820 to determine ctorness.
821
822 2021-02-12 Jakub Jelinek <jakub@redhat.com>
823
824 PR c++/97742
825 * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
826 CPP_EOF.
827
828 2021-02-12 Jason Merrill <jason@redhat.com>
829
830 PR c++/97246
831 PR c++/94546
832 * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
833 (register_parameter_specializations): Not here.
834
835 2021-02-11 Marek Polacek <polacek@redhat.com>
836
837 PR c++/95888
838 * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
839 for the partial instantiation.
840
841 2021-02-11 Jakub Jelinek <jakub@redhat.com>
842
843 PR c++/99033
844 * init.c (build_zero_init_1): Handle zero initialiation of
845 flexible array members like initialization of [0] arrays.
846 Use integer_minus_onep instead of comparison to integer_minus_one_node
847 and integer_zerop instead of comparison against size_zero_node.
848 Formatting fixes.
849
850 2021-02-11 Marek Polacek <polacek@redhat.com>
851
852 PR c++/99063
853 * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
854
855 2021-02-11 Patrick Palka <ppalka@redhat.com>
856
857 PR c++/97582
858 * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
859 lookup result by discarding it if the first element is a
860 class-scope declaration, otherwise return it.
861 (push_operator_bindings): Handle an ambiguous lookup result by
862 doing push_local_binding on each element in the list.
863
864 2021-02-11 Marek Polacek <polacek@redhat.com>
865
866 * parser.c (cp_parser_selection_statement): Use vec_free.
867
868 2021-02-10 Jakub Jelinek <jakub@redhat.com>
869
870 PR c++/98988
871 PR c++/99031
872 * constexpr.c: Include cgraph.h.
873 (cxx_eval_call_expression): Call varpool_node::finalize_decl on
874 heap artificial vars.
875 (cxx_eval_outermost_constant_expr): Remove varpool nodes for
876 heap artificial vars.
877
878 2021-02-10 Nathan Sidwell <nathan@acm.org>
879
880 PR c++/99030
881 * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
882 answer if there's no local specialization.
883
884 2021-02-09 Nathan Sidwell <nathan@acm.org>
885
886 PR c++/98944
887 * module.cc (module_state::is_rooted): Rename to ...
888 (module_state::has_location): ... here. Adjust callers.
889 (module_state::read_partitions): Adjust validity check.
890 Don't overwrite a known location.
891
892 2021-02-09 Jason Merrill <jason@redhat.com>
893
894 PR c++/96905
895 * pt.c (mark_decl_instantiated): Exit early if consteval.
896
897 2021-02-09 Jason Merrill <jason@redhat.com>
898
899 PR c++/98326
900 PR c++/20408
901 * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
902 parm.
903
904 2021-02-09 Jason Merrill <jason@redhat.com>
905
906 PR c++/98994
907 PR c++/97566
908 * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
909 RECORD_TYPE.
910
911 2021-02-08 Nathan Sidwell <nathan@acm.org>
912
913 * decl.c (start_cleanup_fn): Push function into
914 namespace.
915
916 2021-02-08 Nathan Sidwell <nathan@acm.org>
917
918 PR c++/98531
919 * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
920 * decl.c (push_abi_namespace, pop_abi_namespace): Moved
921 from rtti.c, add default namespace arg.
922 (check_redeclaration_exception_specification): Allow a lazy
923 builtin's eh spec to differ from an lready-declared user
924 declaration.
925 (declare_global_var): Use push/pop_abi_namespace.
926 (get_atexit_node): Push the fndecl into a namespace.
927 * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
928 decl.c.
929
930 2021-02-08 Marek Polacek <polacek@redhat.com>
931
932 * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
933
934 2021-02-05 Marek Polacek <polacek@redhat.com>
935
936 PR c++/98947
937 * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
938 on arg2/arg3.
939 * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
940 issuing the -Wvolatile warning. Only set TREE_THIS_VOLATILE if
941 a warning was emitted.
942
943 2021-02-05 Marek Polacek <polacek@redhat.com>
944
945 PR c++/96462
946 * name-lookup.c (lookup_using_decl): Hoist the destructor check.
947
948 2021-02-05 Jakub Jelinek <jakub@redhat.com>
949
950 PR c++/97878
951 * decl.c (check_array_initializer): For structured bindings, require
952 the array type to be complete.
953
954 2021-02-04 Jason Merrill <jason@redhat.com>
955
956 PR c++/98717
957 * constraint.cc (build_concept_check_arguments): Remove assert.
958 (build_concept_check): Allow empty args.
959
960 2021-02-04 Tom Greenslade (thomgree) <thomgree@cisco.com>
961
962 PR c++/90926
963 * call.c (can_convert_array): Extend to handle all valid aggregate
964 initializers of an array; including by string literals, not just by
965 brace-init-list.
966 (build_aggr_conv): Call can_convert_array more often, not just in
967 brace-init-list case.
968 * typeck2.c (array_string_literal_compatible_p): New function.
969 (digest_init_r): call array_string_literal_compatible_p
970 * cp-tree.h: (array_string_literal_compatible_p): Declare.
971
972 2021-02-04 Jason Merrill <jason@redhat.com>
973
974 PR c++/98802
975 * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
976
977 2021-02-04 Jason Merrill <jason@redhat.com>
978
979 PR c++/95192
980 * pt.c (tsubst_attribute): Handle error.
981 (apply_late_template_attributes): Return false on error.
982 (tsubst_function_decl): Check its return value.
983 (tsubst_decl): Likewise.
984 (push_template_decl): Assert current_template_parms.
985 (tsubst_template_decl): Set current_template_parms.
986
987 2021-02-03 Marek Polacek <polacek@redhat.com>
988
989 PR c++/98951
990 * call.c (struct z_candidate): Mark rewritten and reversed as const.
991 (struct NonPublicField): Mark operator() as const.
992 (struct NonTrivialField): Likewise.
993
994 2021-02-03 Jason Merrill <jason@redhat.com>
995
996 PR c++/98926
997 PR c++/98570
998 * pt.c (spec_hasher::equal): Set processing_template_decl.
999 * Make-lang.in (check-g++-strict-gc): Add --param
1000 hash-table-verification-limit=10000.
1001
1002 2021-02-03 Marek Polacek <polacek@redhat.com>
1003
1004 PR c++/98899
1005 * parser.c (cp_parser_class_specifier_1): Use any possible
1006 DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
1007 (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
1008 * pt.c (tsubst_exception_specification): Stash new_specs into
1009 DEFPARSE_INSTANTIATIONS.
1010 * tree.c (fixup_deferred_exception_variants): Use
1011 UNPARSED_NOEXCEPT_SPEC_P.
1012
1013 2021-02-02 Jason Merrill <jason@redhat.com>
1014
1015 PR c++/98929
1016 PR c++/96199
1017 * error.c (dump_expr): Ignore dummy object.
1018 * pt.c (tsubst_baselink): Handle dependent scope.
1019
1020 2021-02-01 Patrick Palka <ppalka@redhat.com>
1021
1022 PR c++/98295
1023 * constexpr.c (cxx_eval_array_reference): Also set
1024 new_ctx.object when setting new_ctx.ctor.
1025
1026 2021-02-01 Marek Polacek <polacek@redhat.com>
1027
1028 PR c++/98355
1029 * parser.c (cp_parser_has_attribute_expression): Use
1030 uses_template_parms instead of type_dependent_expression_p.
1031
1032 2021-02-01 Jason Merrill <jason@redhat.com>
1033
1034 PR c++/98570
1035 * cp-tree.h: Declare it.
1036 * pt.c (comparing_dependent_aliases): New flag.
1037 (template_args_equal, spec_hasher::equal): Set it.
1038 (dependent_alias_template_spec_p): Assert that we don't
1039 get non-types other than error_mark_node.
1040 (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
1041 on complex alias specializations. Set TYPE_DEPENDENT_P here.
1042 (tsubst_decl): Not here.
1043 * module.cc (module_state::read_cluster): Set
1044 comparing_dependent_aliases instead of
1045 comparing_specializations.
1046 * tree.c (cp_tree_equal): Remove comparing_specializations
1047 module handling.
1048 * typeck.c (structural_comptypes): Adjust.
1049 (comptypes): Remove comparing_specializations handling.
1050
1051 2021-01-29 Nathan Sidwell <nathan@acm.org>
1052
1053 PR c++/98843
1054 * module.cc (module_state_config): Add num_entities field.
1055 (module_state::read_entities): The entity_ary span is
1056 already allocated.
1057 (module_state::write_config): Write num_entities.
1058 (module_state::read_config): Read num_entities.
1059 (module_state::write): Set config's num_entities.
1060 (module_state::read_initial): Allocate the entity ary
1061 span here.
1062 (module_state::read_language): Do not set entity_lwm
1063 here.
1064
1065 2021-01-29 Marek Polacek <polacek@redhat.com>
1066
1067 PR c++/96137
1068 * parser.c (cp_parser_class_name): If parser->scope is
1069 error_mark_node, return it, otherwise continue.
1070
1071 2021-01-28 Jakub Jelinek <jakub@redhat.com>
1072
1073 PR c++/98841
1074 * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
1075
1076 2021-01-28 Jakub Jelinek <jakub@redhat.com>
1077
1078 PR c++/33661
1079 PR c++/98847
1080 * decl.c (cp_finish_decl): For register vars with asmspec in templates
1081 call set_user_assembler_name and set DECL_HARD_REGISTER.
1082 * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
1083 pass asmspec_tree to cp_finish_decl.
1084
1085 2021-01-28 Nathan Sidwell <nathan@acm.org>
1086
1087 PR c++/98770
1088 * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
1089 check order.
1090 (trees_in::decl_value): Do typedef frobbing only when installing
1091 a new typedef, adjust is_matching_decl call. Swap is_typedef
1092 & TYPE_NAME check.
1093 (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
1094 names and deal with typedef checking.
1095
1096 2021-01-27 Jason Merrill <jason@redhat.com>
1097
1098 PR c++/97874
1099 * name-lookup.c (lookup_using_decl): Clean up handling
1100 of dependency and inherited constructors.
1101 (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
1102 * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
1103
1104 2021-01-26 Jason Merrill <jason@redhat.com>
1105
1106 PR c++/97474
1107 * call.c (type_passed_as): Don't mark invisiref restrict.
1108
1109 2021-01-26 Jason Merrill <jason@redhat.com>
1110
1111 PR c++/97566
1112 PR c++/98463
1113 * class.c (layout_class_type): An empty field gets size 0.
1114 (is_empty_field): New.
1115 (check_bases): Check it.
1116 * cp-tree.h (is_empty_field): Declare it.
1117 * constexpr.c (cxx_eval_store_expression): Check it.
1118 (cx_check_missing_mem_inits): Likewise.
1119 * init.c (perform_member_init): Likewise.
1120 * typeck2.c (process_init_constructor_record): Likewise.
1121
1122 2021-01-25 Martin Sebor <msebor@redhat.com>
1123
1124 PR c++/98646
1125 * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
1126
1127 2021-01-25 Jason Merrill <jason@redhat.com>
1128
1129 PR c++/98463
1130 * constexpr.c (get_or_insert_ctor_field): Add check.
1131 (cxx_eval_store_expression): Handle discontinuity of refs.
1132
1133 2021-01-23 Anthony Sharp <anthonysharp15@gmail.com>
1134
1135 * call.c (complain_about_access): Altered function.
1136 * cp-tree.h (complain_about_access): Changed parameters of function.
1137 (get_parent_with_private_access): Declared new function.
1138 * search.c (get_parent_with_private_access): Defined new function.
1139 * semantics.c (enforce_access): Modified function.
1140 * typeck.c (complain_about_unrecognized_member): Updated function
1141 arguments in complain_about_access.
1142
1143 2021-01-23 Patrick Palka <ppalka@redhat.com>
1144
1145 PR c++/97399
1146 * cp-tree.h (shared_member_p): Adjust declaration.
1147 * parser.c (cp_parser_init_declarator): If the storage class
1148 specifier is sc_static, pass true for static_p to
1149 cp_parser_declarator.
1150 (cp_parser_direct_declarator): Don't do inject_this_parm when
1151 the declarator is a friend.
1152 * search.c (shared_member_p): Change return type to bool and
1153 adjust function body accordingly. Return false for a dependent
1154 USING_DECL instead of aborting.
1155 * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
1156 even when type-dependent.
1157
1158 2021-01-22 Marek Polacek <polacek@redhat.com>
1159
1160 PR c++/96623
1161 * parser.c (inject_parm_decls): Remove a redundant assignment.
1162 (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
1163 before calling inject_parm_decls.
1164
1165 2021-01-22 Jason Merrill <jason@redhat.com>
1166
1167 PR c++/98744
1168 * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
1169
1170 2021-01-22 Jakub Jelinek <jakub@redhat.com>
1171
1172 PR sanitizer/95693
1173 * init.c (build_zero_init_1): Revert the 2018-03-06 change to
1174 return build_zero_cst for reference types.
1175 * typeck2.c (process_init_constructor_record): Instead call
1176 build_zero_cst here during error recovery instead of build_zero_init.
1177
1178 2021-01-22 Marek Polacek <polacek@redhat.com>
1179
1180 PR c++/98545
1181 * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
1182 warnings regardless of abi_version_at_least.
1183 (write_expression): When the expression is a dependent name
1184 and an operator name, write "on" before writing its name.
1185
1186 2021-01-22 Marek Polacek <polacek@redhat.com>
1187
1188 PR c++/97966
1189 * pt.c (instantiate_class_template_1): Instantiate members
1190 marked with attribute used only after we're done instantiating
1191 the class.
1192
1193 2021-01-21 Patrick Palka <ppalka@redhat.com>
1194
1195 PR c++/71879
1196 * semantics.c (finish_decltype_type): Set up a cp_unevaluated
1197 sentinel at the start of the function. Remove a now-redundant
1198 manual adjustment of cp_unevaluated_operand.
1199
1200 2021-01-21 Nathan Sidwell <nathan@acm.org>
1201
1202 PR c++/98624
1203 * module.cc (depset::hash::find_dependencies): Add
1204 module arg.
1205 (trees_out::core_vals): Check state before calling
1206 write_location.
1207 (sort_cluster, module_state::write): Adjust
1208 find_dependencies call.
1209
1210 2021-01-21 Jakub Jelinek <jakub@redhat.com>
1211
1212 PR c++/98672
1213 * constexpr.c (check_for_return_continue_data): Add break_stmt member.
1214 (check_for_return_continue): Also look for BREAK_STMT. Handle
1215 SWITCH_STMT by ignoring break_stmt from its body.
1216 (potential_constant_expression_1) <case FOR_STMT>,
1217 <case WHILE_STMT>: If the condition isn't constant true, check if
1218 the loop body can contain a return stmt.
1219 <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
1220 <case IF_STMT>: If recursion with tf_none is successful,
1221 merge *jump_target from the branches - returns with highest priority,
1222 breaks or continues lower. If then branch is potentially constant and
1223 doesn't return, check the else branch if it could return, break or
1224 continue.
1225
1226 2021-01-21 Nathan Sidwell <nathan@acm.org>
1227
1228 PR c++/98530
1229 * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
1230
1231 2021-01-20 Nathan Sidwell <nathan@acm.org>
1232
1233 * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
1234 signed type.
1235
1236 2021-01-20 Patrick Palka <ppalka@redhat.com>
1237
1238 PR c++/95434
1239 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
1240 CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
1241 adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
1242
1243 2021-01-20 Patrick Palka <ppalka@redhat.com>
1244
1245 PR c++/82613
1246 * parser.c (cp_parser_class_head): Defer access checking when
1247 parsing the base-clause until all bases are seen and attached
1248 to the class type.
1249 * pt.c (instantiate_class_template): Likewise when substituting
1250 into dependent bases.
1251
1252 2021-01-20 Jakub Jelinek <jakub@redhat.com>
1253
1254 PR c++/98742
1255 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
1256 error_operand_p, remove clause without further checking. Check
1257 for non-NULL TYPE_NAME.
1258
1259 2021-01-19 Marek Polacek <polacek@redhat.com>
1260
1261 PR c++/98659
1262 * pt.c (maybe_instantiate_noexcept): Return false if FN is
1263 error_mark_node.
1264
1265 2021-01-19 Marek Polacek <polacek@redhat.com>
1266
1267 PR c++/98687
1268 * name-lookup.c (push_using_decl_bindings): New, broken out of...
1269 (finish_nonmember_using_decl): ...here.
1270 * name-lookup.h (push_using_decl_bindings): Update declaration.
1271 * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
1272
1273 2021-01-19 Patrick Palka <ppalka@redhat.com>
1274
1275 PR c++/41437
1276 PR c++/58993
1277 * search.c (friend_accessible_p): If scope is a hidden friend
1278 defined inside a dependent class, consider access from the
1279 class.
1280 * parser.c (cp_parser_late_parsing_for_member): Don't push a
1281 dk_no_check access state.
1282
1283 2021-01-19 Marek Polacek <polacek@redhat.com>
1284
1285 PR c++/98333
1286 * parser.c (cp_parser_class_specifier_1): Perform late-parsing
1287 of NSDMIs before late-parsing of noexcept-specifiers.
1288
1289 2021-01-19 Nathan Sidwell <nathan@acm.org>
1290
1291 * module.cc (identifier): Merge overloads.
1292
1293 2021-01-19 Nathan Sidwell <nathan@acm.org>
1294
1295 PR c++/98624
1296 * module.cc (trees_out::write_location): Make static.
1297
1298 2021-01-16 Kwok Cheung Yeung <kcy@codesourcery.com>
1299
1300 * parser.c (cp_parser_omp_clause_detach): New.
1301 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
1302 (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
1303 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
1304 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
1305 Prevent use of detach with mergeable and overriding the data sharing
1306 mode of the event handle.
1307
1308 2021-01-15 Nathan Sidwell <nathan@acm.org>
1309
1310 PR c++/98538
1311 * tree.c (cp_build_qualified_type_real): Propagate an array's
1312 dependentness to the copy, if known.
1313
1314 2021-01-15 Jason Merrill <jason@redhat.com>
1315
1316 PR c++/98642
1317 * call.c (unsafe_return_slot_p): Return int.
1318 (init_by_return_slot_p): Split out from...
1319 (unsafe_copy_elision_p): ...here.
1320 (unsafe_copy_elision_p_opt): New name for old meaning.
1321 (build_over_call): Adjust.
1322 (make_safe_copy_elision): New.
1323 * typeck2.c (split_nonconstant_init_1): Elide copy from safe
1324 list-initialization.
1325 * cp-tree.h: Adjust.
1326
1327 2021-01-15 Jason Merrill <jason@redhat.com>
1328
1329 * call.c (base_ctor_for, make_base_init_ok): New.
1330 (build_over_call): Use make_base_init_ok.
1331
1332 2021-01-15 Jason Merrill <jason@redhat.com>
1333
1334 PR c++/63707
1335 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
1336 if we got a CONSTRUCTOR.
1337
1338 2021-01-15 Nathan Sidwell <nathan@acm.org>
1339
1340 PR c++/98591
1341 * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
1342
1343 2021-01-14 Jason Merrill <jason@redhat.com>
1344
1345 * typeck2.c (process_init_constructor_record): Use fldtype
1346 variable consistently.
1347
1348 2021-01-14 Nathan Sidwell <nathan@acm.org>
1349
1350 PR c++/98372
1351 * tree.c (cp_tree_equal): Correct map_context logic.
1352
1353 2021-01-13 Marek Polacek <polacek@redhat.com>
1354
1355 PR c++/98231
1356 * name-lookup.c (push_using_decl_bindings): New.
1357 * name-lookup.h (push_using_decl_bindings): Declare.
1358 * pt.c (tsubst_expr): Call push_using_decl_bindings.
1359
1360 2021-01-13 Nathan Sidwell <nathan@acm.org>
1361
1362 PR c++/98626
1363 * module.cc (module_add_import_initializers): Pass a
1364 zero-element argument vector.
1365
1366 2021-01-12 Patrick Palka <ppalka@redhat.com>
1367
1368 PR c++/98611
1369 * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
1370 the template of a CTAD placeholder.
1371
1372 2021-01-12 Marek Polacek <polacek@redhat.com>
1373
1374 PR c++/98620
1375 * typeck2.c (process_init_constructor_record): Don't emit
1376 -Wmissing-field-initializers warnings in unevaluated contexts.
1377
1378 2021-01-11 Jakub Jelinek <jakub@redhat.com>
1379
1380 PR c++/98481
1381 * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
1382 for types.
1383 (mark_abi_tags_r): Likewise.
1384 * decl2.c (min_vis_r): Likewise.
1385 * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
1386 typedefs.
1387
1388 2021-01-08 Patrick Palka <ppalka@redhat.com>
1389
1390 PR c++/98551
1391 * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
1392 instead of AGGREGATE_TYPE_P before calling replace_result_decl.
1393
1394 2021-01-08 Patrick Palka <ppalka@redhat.com>
1395
1396 PR c++/98515
1397 * semantics.c (check_accessibility_of_qualified_id): Punt if
1398 we're checking access of a scoped non-static member inside a
1399 class template.
1400
1401 2021-01-07 Jakub Jelinek <jakub@redhat.com>
1402
1403 PR c++/98329
1404 * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
1405 cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
1406 its location.
1407 (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
1408
1409 2021-01-07 Marek Polacek <polacek@redhat.com>
1410
1411 PR c++/98441
1412 * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
1413 !late_return_type block.
1414
1415 2021-01-07 Jason Merrill <jason@redhat.com>
1416
1417 * constexpr.c (cxx_bind_parameters_in_call): Add comment.
1418 (cxx_eval_store_expression): Add comment.
1419
1420 2021-01-07 Jason Merrill <jason@redhat.com>
1421
1422 * call.c (has_next): Factor out from...
1423 (next_conversion): ...here.
1424 (strip_standard_conversion): And here.
1425 (is_subseq): And here.
1426 (build_conv): Check it.
1427 (standard_conversion): Don't call build_conv
1428 for ck_identity.
1429
1430 2021-01-06 Martin Sebor <msebor@redhat.com>
1431
1432 PR c++/95768
1433 * error.c (dump_expr): Call c_pretty_printer::unary_expression.
1434
1435 2021-01-05 Patrick Palka <ppalka@redhat.com>
1436
1437 * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
1438 the type of the NTTP, substitute into the type again. If the
1439 type is still dependent, don't unify the NTTP.
1440
1441 2021-01-05 Jakub Jelinek <jakub@redhat.com>
1442
1443 * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
1444 $(CODYLIB) after $(BACKEND).
1445
1446 2021-01-05 Jakub Jelinek <jakub@redhat.com>
1447
1448 PR c++/98469
1449 * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
1450 Punt if lval is true.
1451 * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
1452 the result if it has a class type.
1453
1454 2021-01-05 Marek Polacek <polacek@redhat.com>
1455
1456 PR c++/82099
1457 * pt.c (resolve_overloaded_unification): Call
1458 maybe_instantiate_noexcept after instantiating the function
1459 decl.
1460
1461 2021-01-05 Nathan Sidwell <nathan@acm.org>
1462
1463 * parser.c (cp_parser_module_declaration): Alter diagnostic
1464 text to say where is permissable.
1465
1466 2021-01-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1467
1468 PR c++/98316
1469 * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
1470
1471 2021-01-02 Jan Hubicka <jh@suse.cz>
1472
1473 * cp-tree.h (cp_tree_c_finish_parsing): Declare.
1474 * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
1475 * tree.c (cp_tree_c_finish_parsing): New function.
1476
1477 2021-01-01 Jakub Jelinek <jakub@redhat.com>
1478
1479 * ChangeLog-2020: Rotate ChangeLog. New file.
1480
1481 \f
1482 Copyright (C) 2021 Free Software Foundation, Inc.
1483
1484 Copying and distribution of this file, with or without modification,
1485 are permitted in any medium without royalty provided the copyright
1486 notice and this notice are preserved.
This page took 0.108672 seconds and 6 git commands to generate.