1 2020-12-09 Nathan Sidwell <nathan@acm.org>
3 * parser.h (struct cp_token): Add main_source_p field.
4 * parser.c (cp_lexer_new_main): Pass thought module token filter.
6 (cp_lexer_get_preprocessor_token): Set main_source_p.
7 (enum module_parse): New.
8 (cp_parser_diagnose_invalid_type_name): Deal with unrecognized
10 (cp_parser_skip_to_closing_parenthesize_1): Skip module-directivres.
11 (cp_parser_skip_to_end_of_statement): Likewise.
12 (cp_parser_skiup_to_end_of_block_or_statement): Likewise.
13 (cp_parser_translation_unit): Add module parsing calls.
14 (cp_parser_module_name, cp_parser_module_declaration): New.
15 (cp_parser_import_declaration, cp_parser_module_export): New.
16 (cp_parser_declaration): Add module export detection.
17 (cp_parser_template_declaration): Adjust 'export' error message.
18 (cp_parser_function_definition_after_declarator): Add
19 module-specific logic.
20 * module.cc (import_module, declare_module)
21 (maybe_check_all_macros): Stubs.
23 2020-12-09 Marek Polacek <polacek@redhat.com>
26 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier): Handle
28 (pp_cxx_type_specifier_seq): Likewise.
29 (cxx_pretty_printer::type_id): Likewise.
31 2020-12-09 Nathan Sidwell <nathan@acm.org>
33 * decl.c (duplicate_decls): Add module-specific redeclaration
35 (cxx_init_decl_processing): Export the global namespace, maybe
37 (start_decl): Reject local-extern in a module, adjust linkage of
39 (xref_tag_1): Add module-specific redeclaration logic.
40 (start_enum): Likewise.
41 (finish_enum_value_list): Export unscoped members of an exported
43 (grokmethod): Implement p1779 linkage of in-class defined
45 * decl2.c (no_linkage_error): Imports are ok.
46 (c_parse_final_cleanups): Call fini_modules.
47 * lex.c (cxx_dup_lang_specific): Clear some module flags in the
49 * module.cc (module_kind): Define.
50 (module_may_redeclare, set_defining_module): Stubs.
51 (init_modules): Error on modules.
53 * rtti.c (push_abi_namespace): Save and reset module_kind.
54 (pop_abi_namespace): Restore module kind.
55 (build_dynamic_cast_1, tinfo_base_init): Adjust.
56 * semantics.c (begin_class_definition): Add module-specific logic.
57 (expand_or_defer_fn_1): Keep bodies of more fns when modules_p.
59 2020-12-09 Tobias Burnus <tobias@codesourcery.com>
61 * parser.c (cp_parser_omp_allocate): New.
62 (cp_parser_omp_construct, cp_parser_pragma): Call it.
64 2020-12-09 Jason Merrill <jason@redhat.com>
67 * cvt.c (maybe_warn_nodiscard): Check c_inhibit_evaluation_warnings.
69 2020-12-09 Jason Merrill <jason@redhat.com>
72 * init.c (expand_default_init): Pass tf_no_cleanup when building
73 a TARGET_EXPR to go on the RHS of an INIT_EXPR.
74 * typeck.c (cp_build_modify_expr): Likewise.
76 2020-12-08 Marek Polacek <polacek@redhat.com>
79 * constexpr.c (cxx_eval_dynamic_cast_fn): If the evaluating of vtable
80 yields a null pointer, give an error and return. Use objtype.
82 2020-12-08 Nathan Sidwell <nathan@acm.org>
84 * class.c (layout_class_type): Call set_instantiating_module.
85 (build_self_reference): Likewise.
86 * decl.c (grokfndecl): Call set_originating_module.
87 (grokvardecl): Likewise.
88 (grokdeclarator): Likewise.
89 * pt.c (maybe_new_partial_specialization): Call
90 set_instantiating_module, propagate DECL_MODULE_EXPORT_P.
91 (lookup_template_class_1): Likewise.
92 (tsubst_function_decl): Likewise.
93 (tsubst_decl, instantiate_template_1): Likewise.
94 (build_template_decl): Propagate module flags.
95 (tsubst_template_dcl): Likewise.
96 (finish_concept_definition): Call set_originating_module.
97 * module.cc (set_instantiating_module, set_originating_module): Stubs.
99 2020-12-08 Jason Merrill <jason@redhat.com>
102 * cp-tree.h (build_new_op): Add overload that omits some parms.
103 (genericize_spaceship): Add location_t parm.
104 * constexpr.c (cxx_eval_binary_expression): Pass it.
105 * cp-gimplify.c (genericize_spaceship): Pass it.
106 * method.c (genericize_spaceship): Handle class-type arguments.
107 (build_comparison_op): Fall back to op</== when appropriate.
109 2020-12-08 Jason Merrill <jason@redhat.com>
111 * call.c (build_new_op_1): Set *overload for ambiguity.
112 (build_new_method_call_1): Likewise.
114 2020-12-08 Bernd Edlinger <bernd.edlinger@hotmail.de>
116 * decl2.c: (is_atomic_expensive_p): New helper function.
117 (build_atomic_load_byte): Rename to...
118 (build_atomic_load_type): ... and add new parameter type.
119 (get_guard_cond): Skip the atomic here if that is expensive.
120 Use the correct type for the atomic load on certain targets.
122 2020-12-08 Nathan Sidwell <nathan@acm.org>
124 * cp-tree.h (struct tinst_level): Add path & visible fields.
125 (build_cdtor_clones): Declare.
126 (match_mergeable_specialization): Use a spec_entry, add insert parm.
127 * class.c (build_cdtor_clones): Externalize.
128 * pt.c (push_tinst_level_loc): Clear new fields.
129 (match_mergeable_specialization): Adjust API.
131 2020-12-08 Nathan Sidwell <nathan@acm.org>
133 * decl2.c (start_objects): Refactor and adjust for named module
135 (finish_objects): Likewise.
136 (generate_ctor_or_dtor_function): Likewise.
137 * module.cc (module_initializer_kind)
138 (module_add_import_initializers): Stubs.
140 2020-12-08 Nathan Sidwell <nathan@acm.org>
142 * Make-lang.in (MODULE_VERSION): Override when DEVPHASE not empty.
143 * module.cc: Comment.
145 2020-12-08 Nathan Sidwell <nathan@acm.org>
147 * cp-tree.h (mangle_module_substitution, mangle_identifier)
148 (mangle_module_global_init): Declare.
149 * mangle.c (struct globals): Add mod field.
150 (mangle_module_substitution, mangle_identifier)
151 (mangle_module_global_init): Define.
152 (write_module, maybe_write_module): New.
153 (write_name): Call it.
154 (start_mangling): Clear mod field.
155 (finish_mangling_internal): Adjust.
156 * module.cc (mangle_module, mangle_module_fini)
157 (get_originating_module): Stubs.
159 2020-12-08 Nathan Sidwell <nathan@acm.org>
161 * cp-tree.h (module_token_pre, module_token_cdtor)
162 (module_token_lang): Declare.
163 * lex.c: Include langhooks.
164 (struct module_token_filter): New.
165 * cp-tree.h (module_token_pre, module_token_cdtor)
166 (module_token_lang): Define.
167 * module.cc (get_module, preprocess_module, preprocessed_module):
170 2020-12-08 Nathan Sidwell <nathan@acm.org>
172 * Make-lang.in (MODULE_VERSION): Define.
173 * module.cc: Add includes.
175 2020-12-08 Jakub Jelinek <jakub@redhat.com>
178 * parser.c (cp_parser_omp_parallel): For parallel master with
179 -fopenmp-simd only, just call cp_parser_omp_master instead of
180 wrapping it in OMP_PARALLEL.
182 2020-12-07 Marek Polacek <polacek@redhat.com>
185 * decl.c (pop_switch): If SWITCH_STMT_TYPE is a scoped enum type,
186 set it to the type of SWITCH_STMT_COND.
188 2020-12-07 Nathan Sidwell <nathan@acm.org>
190 * cp-tree.h (build_cplus_array_type): Add defaulted DEP parm.
191 * tree.c (set_array_type_common): Add DEP parm.
192 (build_cplus_array_type): Add DEP parm, determine dependency if
193 needed. Mark dependency of new types.
194 (cp_build_qualified_type_real): Adjust array-building call, assert
195 no surprising dependency.
196 (strip_typedefs): Likewise.
198 2020-12-07 Nathan Sidwell <nathan@acm.org>
201 * typeck.c (structural_comptypes): Move early outs to comptype.
202 Always check template-alias match when comparing_specializations.
203 (comptypes): Do early out checking here.
205 2020-12-05 Patrick Palka <ppalka@redhat.com>
208 * constraint.cc (parameter_mapping_equivalent_p): Add some
209 sanity checks. Clarify comment.
210 (tsubst_nested_requirement): Always perform satisfaction
211 quietly first. If that yields an erroneous result, emit a
212 context message and replay satisfaction noisily with the
213 diagnostic normal form.
214 (finish_nested_requirement): Normalize the constraint-expression
215 twice, once with diagnostic information and once without. Store
216 them in a TREE_LIST within the TREE_TYPE.
217 (diagnose_nested_requirement): When replaying satisfaction, use
218 the diagnostic normal form instead of renormalizing on the spot.
220 2020-12-05 Patrick Palka <ppalka@redhat.com>
223 * constraint.cc (struct sat_info): Define.
224 (tsubst_nested_requirement): Pass a sat_info object to
226 (satisfy_constraint_r): Take a sat_info argument instead of
228 (satisfy_conjunction): Likewise.
229 (satisfy_disjunction): Likewise. Instead of first evaluating
230 each branch quietly, evaluate each branch only with
231 unsatisfaction diagnostics disabled. Exit early if evaluation
232 of a branch returns error_mark_node.
233 (satisfy_atom): Take a sat_info argument instead of subst_info.
234 Fix a comment. Check diagnose_unsatisfaction_p() instead of
235 noisy() before replaying a substitution failure.
236 (satisfy_constraint): Take a sat_info argument instead of
238 (satisfy_associated_constraints): Likewise.
239 (satisfy_constraint_expression): Likewise.
240 (satisfy_declaration_constraints): Likewise.
241 (constraint_satisfaction_value): Likewise and adjust
242 accordingly. Fix formatting.
243 (constraints_satisfied_p): Pass a sat_info object to
244 constraint_satisfaction_value.
245 (evaluate_concept_check): Pass a sat_info object to
246 satisfy_constraint_expression.
247 (diagnose_nested_requirement): Likewise.
248 (diagnose_constraints): Pass an appropriate sat_info object to
249 constraint_satisfaction_value.
251 2020-12-05 Jakub Jelinek <jakub@redhat.com>
254 * constexpr.c (cxx_union_active_member): New function.
255 (cxx_fold_indirect_ref_1): Add ctx argument, pass it through to
256 recursive call. Handle UNION_TYPE.
257 (cxx_fold_indirect_ref): Add ctx argument, pass it to recursive calls
258 and cxx_fold_indirect_ref_1.
259 (cxx_eval_indirect_ref): Adjust cxx_fold_indirect_ref calls.
261 2020-12-04 Jason Merrill <jason@redhat.com>
264 * pt.c (convert_template_argument): Handle equivalent placeholders.
265 (do_class_deduction): Look through EXPR_PACK_EXPANSION, too.
267 2020-12-04 Jason Merrill <jason@redhat.com>
269 * decl2.c (clear_consteval_vfns): Remove *.
270 * pt.c (do_auto_deduction): Remove *.
271 * parser.c (cp_parser_late_parsing_default_args): Change loop
274 2020-12-04 Nathan Sidwell <nathan@acm.org>
277 * cp-tree.h (comparing_typenames): Delete.
278 (cplus_build_array_type): Remove default parm.
279 * pt.c (comparing_typenames): Delete.
280 (spec_hasher::equal): Don't increment it.
281 * tree.c (set_array_type_canon): Remove dep parm.
282 (build_cplus_array_type): Remove dep parm changes.
283 (cp_build_qualified_type_real): Remove dependent array type
285 (strip_typedefs): Likewise.
286 * typeck.c (structural_comptypes): Revert comparing_typename
289 2020-12-04 Nathan Sidwell <nathan@acm.org>
291 * cp-tree.h: Add various inline module state predicates, and
292 declare the API that will be provided by modules.cc
294 2020-12-04 Jakub Jelinek <jakub@redhat.com>
297 * cp-gimplify.c (fold_builtin_source_location): Use 2 instead of 0
298 as last argument to cxx_printable_name.
300 2020-12-03 Jason Merrill <jason@redhat.com>
302 * cp-tree.h (releasing_vec::operator[]): Change parameter type to
305 2020-12-03 Nathan Sidwell <nathan@acm.org>
307 * cp-tree.h (OVL_EXPORT): New.
308 (class ovl_iterator): Add get_using, exporting_p.
309 * tree.c (ovl_insert): Extend using_or_hidden meaning to include
312 2020-12-03 Nathan Sidwell <nathan@acm.org>
314 * cp-tree.h (DECL_UNINSTANTIATED_TEMPLATE_FRIEND): New.
315 * pt.c (push_template_decl): Set it.
316 (tsubst_friend_function): Clear it.
318 2020-12-03 Nathan Sidwell <nathan@acm.org>
320 * cp-tree.h (make_unbound_class_template_raw): Declare.
321 (canonical_type_parameter): Declare.
322 * decl.c (make_unbound_class_template_raw): Break out of ...
323 (make_unboud_class_template): ... here. Call it.
324 * pt.c (canonical_type_parameter): Externalize. Refactor & set
325 structural_equality for type parms.
327 2020-12-03 Nathan Sidwell <nathan@acm.org>
330 * tree.c (build_cplus_array_type): Mark dependency of new variant.
331 (cp_build_qualified_type_real, strip_typedefs): Assert
332 TYPE_DEPENDENT_P_VALID, or not a dependent type.
334 2020-12-03 Jakub Jelinek <jakub@redhat.com>
337 * cp-tree.h (cp_build_bit_cast): Declare.
338 * cp-tree.def (BIT_CAST_EXPR): New tree code.
339 * cp-objcp-common.c (names_builtin_p): Handle RID_BUILTIN_BIT_CAST.
340 (cp_common_init_ts): Handle BIT_CAST_EXPR.
341 * cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
343 * parser.c (cp_parser_postfix_expression): Handle
344 RID_BUILTIN_BIT_CAST.
345 * semantics.c (cp_build_bit_cast): New function.
346 * tree.c (cp_tree_equal): Handle BIT_CAST_EXPR.
347 (cp_walk_subtrees): Likewise.
348 * pt.c (tsubst_copy): Likewise.
349 * constexpr.c (check_bit_cast_type, cxx_eval_bit_cast): New functions.
350 (cxx_eval_constant_expression): Handle BIT_CAST_EXPR.
351 (potential_constant_expression_1): Likewise.
352 * cp-gimplify.c (cp_genericize_r): Likewise.
354 2020-12-03 Jason Merrill <jason@redhat.com>
356 * parser.c (cp_parser_primary_expression): Distinguish
357 parms from vars in error.
358 (cp_parser_late_parsing_default_args): Pushdecl parms
361 2020-12-03 Jason Merrill <jason@redhat.com>
363 * name-lookup.c (begin_scope): Set immediate_fn_ctx_p.
364 * parser.c (cp_parser_late_parsing_default_args): Push
365 sk_function_parms scope.
367 2020-12-03 Peter Bergner <bergner@linux.ibm.com>
370 * typeck2.c (digest_init_r): Handle OPAQUE_TYPE as an aggregate type.
372 2020-12-02 Jakub Jelinek <jakub@redhat.com>
376 * cp-tree.h (source_location_current_p): Declare.
377 * tree.c (source_location_current_p): New function.
378 * call.c (immediate_invocation_p): New function.
379 (build_over_call): Use it to resolve LWG3396.
380 * constexpr.c (cxx_eval_builtin_function_call): Temporarily set
381 current_function_decl from ctx->call->fundef->decl if any.
382 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Fold calls
383 to immediate function std::source_location::current ().
385 2020-12-02 Jason Merrill <jason@redhat.com>
387 * decl.c (grokdeclarator): Improve diagnostic for
388 disallowed CTAD placeholder.
390 2020-12-02 Jason Merrill <jason@redhat.com>
392 * decl.c (check_initializer): Also look through STMT_EXPR
395 2020-12-02 Nathan Sidwell <nathan@acm.org>
397 * cp-tree.h (comparing_typenames): Declare.
398 * pt.c (comparing_typenames): Define.
399 (spec_hasher::equal): Increment it around comparisons.
400 * typeck.c (structural_comptypes): Adjust TYPENAME resolution
403 2020-12-02 Marek Polacek <polacek@redhat.com>
406 * constexpr.c (fold_non_dependent_init): Add a tree parameter.
408 * cp-tree.h (fold_non_dependent_init): Add a tree parameter with
410 * typeck2.c (store_init_value): Call fold_non_dependent_expr
411 only when checking the initializer for constexpr variables.
412 Call fold_non_dependent_init instead of maybe_constant_init.
414 2020-12-02 Marek Polacek <polacek@redhat.com>
418 * pt.c (tsubst_copy_and_build) <case NEW_EXPR>: Return error_mark_node
419 if init is erroneous.
421 2020-12-02 Nathan Sidwell <nathan@acm.org>
423 * cp-tree.h (DECL_MODULE_PURVIEW_P, DECL_MODULE_IMPORT_P)
424 (DECL_MODULE_ENTITY_P): New.
425 (DECL_MODULE_PENDING_SPECIALIZATIONS_P): New.
426 (DECL_MODULE_PENDING_MEMBERS_P): New.
427 (DECL_MODULE_ATTACHMENTS_P): New.
428 (DECL_MODULE_EXPORT_P): New.
429 (struct lang_decl_base): Shrink sel field. Add new
430 module-specific fields.
432 2020-12-02 Nathan Sidwell <nathan@acm.org>
434 * cp-tree.h (DECL_TINFO_P): Also for TYPE_DECLs.
435 (get_tinfo_decl_direct): Declare.
436 (get_pseudo_tinfo_index, get_pseudo_tinfo_type): Declare.
437 * rtti.c (get_tinfo_decl_direct): Externalize.
438 (get_tinfo_desc): Set DECL_TINFO_P on the typedef.
439 (get_pseudo_tinfo_index, get_pseudo_tinfo_type): New.
441 2020-12-02 Nathan Sidwell <nathan@acm.org>
443 * cp-tree.h (maybe_add_lang_decl_raw, maybe_add_lang_type_raw):
445 * lex.c (maybe_add_lang_decl_raw, maybe_add_lang_type_raw):
446 Externalize, reformat.
448 2020-12-02 Nathan Sidwell <nathan@acm.org>
450 * cp-tree.h (build_cplus_array_type): Add defaulted DEP parm.
451 * tree.c (set_array_type_common): Add DEP parm.
452 (build_cplus_array_type): Add DEP parm, determine dependency if
454 (cp_build_qualified_type_real): Adjust array-building call.
455 (strip_typedefs): Likewise.
457 2020-12-02 Nathan Sidwell <nathan@acm.org>
459 * ptree.c (cxx_print_xnode): Increase binding-vector prefix size.
461 2020-12-02 Nathan Sidwell <nathan@acm.org>
463 * cp-tree.def (BINDING_VECTOR): New.
464 * name-lookup.h (struct binding_slot): New.
465 (BINDING_VECTOR_SLOTS_PER_CLUSTER): New.
466 (struct binding_index, struct binding_cluster): New.
467 (BINDING_VECTOR_ALLOC_CLUSTERS, BINDING_VECTOR_CLUSTER_BASE)
468 (BINDING_VECTOR_CLUSTER): New.
469 (struct tree_binding_vec): New.
470 (BINDING_VECTOR_NAME, BINDING_VECTOR_GLOBAL_DUPS_P)
471 (BINDING_VECTOR_PARTITION_DUPS_P): New.
472 (BINDING_BINDING_GLOBAL_P, BINDING_BINDING_PARTITION_P): New.
473 (BINDING_VECTOR_PENDING_SPECIALIZATIONS)
474 (BINDING_VECTOR_PENDING_IS_HEADER_P)
475 (BINDING_VECTOR_PENDING_IS_PARTITION_P): New.
476 * cp-tree.h (enum cp_tree_node_structure_enum): Add
477 TS_CP_BINDING_VECTOR.
478 (union lang_tree_node): Add binding_vec field.
479 (make_binding_vec): Declare.
480 (named_decl_hash::hash, named_decl_hash::equal): Check for binding
482 * decl.c (cp_tree_node_structure): Add BINDING_VECTOR case.
483 * ptree.c (cxx_print_xnode): Add BINDING_VECTOR case.
484 * tree.c (make_binding_vec): New.
486 2020-12-01 Ville Voutilainen <ville.voutilainen@gmail.com>
489 * cxx-pretty-print.c (pp_cxx_trait_expression):
490 Add support for __is_nothrow_{assignable,constructible}.
492 2020-12-01 Jakub Jelinek <jakub@redhat.com>
495 * parser.c (cp_parser_omp_depobj): Suppress location wrappers when
496 parsing depend clause.
498 2020-12-01 Nathan Sidwell <nathan@acm.org>
500 * lex.c (init_reswords): Maybe enable module keywords.
502 2020-12-01 Nathan Sidwell <nathan@acm.org>
504 * lang-specs.h: Add module-related options.
506 2020-12-01 Iain Sandoe <iain@sandoe.co.uk>
508 * parser.c (cp_parser_declaration): Add a not about where
509 attributes may be placed.
511 2020-11-27 Martin Sebor <msebor@redhat.com>
513 * error.c (add_quotes): Revert previous change and use pragma to
514 suppress -Wformat-diag.
516 2020-11-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
518 * g++spec.c (TIMELIB, TIME_LIBRARY): Remove.
519 (lang_specific_driver): Remove TIME_LIBRARY handling.
521 2020-11-26 Thomas Schwinge <thomas@codesourcery.com>
523 * parser.c (cp_parser_omp_var_list_no_open): Assert that array
524 section's 'low_bound', 'length' are not location wrapper nodes.
525 (cp_parser_oacc_all_clauses, cp_parser_oacc_cache): Instantiate
526 'auto_suppress_location_wrappers'.
528 2020-11-25 Martin Sebor <msebor@redhat.com>
531 * constraint.cc (debug_argument_list): Avoid -Wformat-diag.
532 * error.c (function_category): Same.
533 (print_template_differences): Same.
534 * logic.cc (debug): Same.
535 * name-lookup.c (lookup_using_decl): Same.
536 * parser.c (maybe_add_cast_fixit): Same.
537 (cp_parser_template_introduction): Same.
538 * typeck.c (access_failure_info::add_fixit_hint): Same.
540 2020-11-25 Thomas Schwinge <thomas@codesourcery.com>
542 * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE__CACHE_'.
543 (tsubst_expr): Handle 'OACC_CACHE'.
545 2020-11-24 Jason Merrill <jason@redhat.com>
548 * typeck2.c (store_init_value): Don't split_nonconstant_init in a
551 2020-11-24 Jakub Jelinek <jakub@redhat.com>
553 PR tree-optimization/96929
554 * constexpr.c (cxx_eval_binary_expression): For shifts by constant
555 with MSB set, emulate older wide_int_binop behavior to preserve
556 diagnostics and -fpermissive behavior.
558 2020-11-23 Nathan Sidwell <nathan@acm.org>
560 * module.cc: New dummy file.
561 * Make-lang.in: Add rules to build module.o
563 2020-11-23 Jozef Lawrynowicz <jozef.l@mittosystems.com>
565 * decl.c (start_decl): Set DECL_INITIAL for initialized decls
566 before attribute processing.
568 2020-11-23 Richard Sandiford <richard.sandiford@arm.com>
571 * pt.c (tsubst): Use verify_type_context to check the type
574 2020-11-21 Marek Polacek <polacek@redhat.com>
577 * parser.c (warn_for_range_copy): Warn when the loop variable is
578 initialized with a value of a different type resulting in a copy.
580 2020-11-21 Marek Polacek <polacek@redhat.com>
583 * constexpr.c (potential_constant_expression_1): Reject
584 LABEL_EXPRs that use non-artifical LABEL_DECLs.
586 2020-11-21 Marek Polacek <polacek@redhat.com>
589 * parser.c (warn_about_ambiguous_parse): Only assume "int" if we
590 actually saw any type-specifiers.
592 2020-11-21 Marek Polacek <polacek@redhat.com>
595 * parser.c (cp_parser_lambda_declarator_opt): Don't require ().
597 2020-11-21 Marek Polacek <polacek@redhat.com>
600 * constexpr.c (cxx_set_object_constness): New function.
601 (cxx_eval_call_expression): Set new_obj for destructors too.
602 Call cxx_set_object_constness to set/unset TREE_READONLY of
603 the object under construction/destruction.
605 2020-11-21 Aaron Sawdey <acsawdey@linux.ibm.com>
607 * error.c (dump_type): Handle opaque types.
608 (dump_type_prefix): Handle opaque types.
609 (dump_type_suffix): Handle opaque types.
610 (dump_expr): Handle opaque types.
611 * pt.c (tsubst): Allow opaque types in templates.
612 (unify): Allow opaque types in templates.
613 * typeck.c (structural_comptypes): Handle comparison
616 2020-11-20 Jakub Jelinek <jakub@redhat.com>
619 * Make-lang.in (c++.serial): Change from goal to a variable.
620 (.PHONY): Drop c++.serial and c++.prev.
621 (cc1plus$(exeext)): Depend on $(c++.serial) rather than c++.serial.
623 2020-11-19 Nathan Sidwell <nathan@acm.org>
625 * cp-tree.h (struct spec_entry): Moved from pt.c.
626 (walk_specializations, match_mergeable_specialization)
627 (get_mergeable_specialization_flags)
628 (add_mergeable_specialization): Declare.
629 * pt.c (struct spec_entry): Moved to cp-tree.h.
630 (walk_specializations, match_mergeable_specialization)
631 (get_mergeable_specialization_flags)
632 (add_mergeable_specialization): New.
634 2020-11-19 Nathan Sidwell <nathan@acm.org>
636 * cp-tree.h (struct constexpr_fundef): Moved from constexpr.c.
637 (maybe_save_constexpr_fundef): Declare.
638 (register_constexpr_fundef): Take constexpr_fundef object, return
640 * decl.c (mabe_save_function_definition): Delete, functionality
641 moved to maybe_save_constexpr_fundef.
642 (emit_coro_helper, finish_function): Adjust.
643 * constexpr.c (struct constexpr_fundef): Moved to cp-tree.h.
644 (constexpr_fundef_hasher::equal): Constify.
645 (constexpr_fundef_hasher::hash): Constify.
646 (retrieve_constexpr_fundef): Make non-static.
647 (maybe_save_constexpr_fundef): Break out checking and duplication
649 (register_constexpr_fundef): ... here. Just register the constexpr.
651 2020-11-19 Marek Polacek <polacek@redhat.com>
654 * init.c (build_new): When value-initializing an array new,
655 leave the INIT as an empty vector.
657 2020-11-19 Marek Polacek <polacek@redhat.com>
660 * pt.c (do_auto_deduction): Don't crash when the constructor has
663 2020-11-19 Nathan Sidwell <nathan@acm.org>
666 * decl.c (duplicate_decls): Relax new assert.
668 2020-11-18 Iain Sandoe <iain@sandoe.co.uk>
670 * parser.c (cp_parser_objc_valid_prefix_attributes): Check
671 for empty attributes.
673 2020-11-18 Jakub Jelinek <jakub@redhat.com>
675 * Make-lang.in (c++.serial): New goal.
676 (.PHONY): Add c++.serial c++.prev.
677 (cc1plus$(exeext)): Depend on c++.prev. Call LINK_PROGRESS.
679 2020-11-17 Nathan Sidwell <nathan@acm.org>
682 * decl.c (duplicate_decls): Deal with duplicated DECL_LOCAL_DECL_P
683 decls. Extend decl_lang_specific checking assert.
685 2020-11-17 Nathan Sidwell <nathan@acm.org>
687 * cp-tree.h (enum cp_tree_index): Reorder to place lazy fields
688 after newly-added CPTI_MODULE_HWM.
690 2020-11-17 Iain Sandoe <iain@sandoe.co.uk>
693 * parser.c (cp_parser_declaration): Remove checking assert.
695 2020-11-15 Jason Merrill <jason@redhat.com>
697 * decl.c (cp_finish_decl): Only check abstractness on definition.
698 (require_complete_types_for_parms): Check abstractness here.
699 (create_array_type_for_decl): Not here.
700 (grokdeclarator, grokparms, complete_vars): Not here.
701 * pt.c (tsubst, tsubst_arg_types, tsubst_function_type): Not here.
702 * typeck2.c (struct pending_abstract_type): Remove.
703 (struct abstract_type_hasher): Remove.
704 (abstract_pending_vars, complete_type_check_abstract): Remove.
705 (abstract_virtuals_error_sfinae): Handle arrays.
706 * call.c (conv_is_prvalue): Split out from...
707 (conv_binds_ref_to_prvalue): ...here.
708 (implicit_conversion_1): Rename from implicit_conversion.
709 (implicit_conversion): An abstract prvalue is bad.
710 (convert_like_internal): Don't complain if expr is already
713 2020-11-13 Jason Merrill <jason@redhat.com>
715 * cp-tree.h (USING_DECL_UNRELATED_P): New.
716 (CONST_DECL_USING_P): New.
717 * class.c (handle_using_decl): If USING_DECL_UNRELATED_P,
718 clone the CONST_DECL.
719 * name-lookup.c (supplement_binding_1): A clone hides its
721 (lookup_using_decl): Rewrite to separate lookup and validation.
722 (do_class_using_decl): Adjust.
723 (finish_nonmember_using_decl): Adjust.
724 * parser.c (make_location): Add cp_token overload.
725 (finish_using_decl): Split out from...
726 (cp_parser_using_declaration): ...here. Don't look through enums.
727 (cp_parser_using_enum): New.
728 (cp_parser_block_declaration): Call it.
729 (cp_parser_member_declaration): Call it.
730 * semantics.c (finish_id_expression_1): Handle enumerator
731 used from class scope.
733 2020-11-13 Vladimir N. Makarov <vmakarov@redhat.com>
735 * parser.c (cp_parser_asm_definition): Parse outputs for asm
738 2020-11-13 Iain Sandoe <iain@sandoe.co.uk>
741 * parser.c (cp_parser_objc_class_interface): Pass the
742 location of the class name to the interface declaration.
744 2020-11-13 Patrick Palka <ppalka@redhat.com>
746 * semantics.c (finish_compound_literal): Don't wrap the original
747 compound literal in a TARGET_EXPR when inside a template.
749 2020-11-12 Jakub Jelinek <jakub@redhat.com>
752 * constexpr.c (cxx_eval_constant_expression) <case CLEANUP_POINT_EXPR,
753 case TRY_FINALLY_EXPR, case CLEANUP_STMT>: Don't pass jump_target to
754 cxx_eval_constant_expression when evaluating the cleanups.
756 2020-11-11 Iain Sandoe <iain@sandoe.co.uk>
758 * parser.c (cp_parser_declaration): Unless we are compiling for
759 Ojective-C++, warn about and discard any attributes that prefix
760 a linkage specification.
762 2020-11-11 Patrick Palka <ppalka@redhat.com>
765 * mangle.c (write_expression): Mangle __alignof_ differently
766 from alignof when the ABI version is at least 15.
768 2020-11-11 Patrick Palka <ppalka@redhat.com>
771 * cp-tree.h (cxx_sizeof_or_alignof_expr): Add bool parameter.
772 * decl.c (fold_sizeof_expr): Pass false to
773 cxx_sizeof_or_alignof_expr.
774 * parser.c (cp_parser_unary_expression): Pass std_alignof to
775 cxx_sizeof_or_alignof_expr.
776 * pt.c (tsubst_copy): Pass false to cxx_sizeof_or_alignof_expr.
777 (tsubst_copy_and_build): Pass std_alignof to
778 cxx_sizeof_or_alignof_expr.
779 * typeck.c (cxx_alignof_expr): Add std_alignof bool parameter
780 and pass it to cxx_sizeof_or_alignof_type. Set ALIGNOF_EXPR_STD_P
782 (cxx_sizeof_or_alignof_expr): Add std_alignof bool parameter
783 and pass it to cxx_alignof_expr. Assert op is either
784 SIZEOF_EXPR or ALIGNOF_EXPR.
786 2020-11-11 Marek Polacek <polacek@redhat.com>
789 * pt.c (tsubst_qualified_id): Use EXPR_LOCATION of the qualified-id.
790 Use it to maybe_wrap_with_location the final expression.
792 2020-11-10 Marek Polacek <polacek@redhat.com>
795 * cp-tree.h (finish_static_assert): Adjust declaration.
796 * parser.c (cp_parser_static_assert): Pass false to
797 finish_static_assert.
798 * pt.c (tsubst_expr): Pass true to finish_static_assert.
799 * semantics.c (find_failing_clause_r): New function.
800 (find_failing_clause): New function.
801 (finish_static_assert): Add a bool parameter. Use
802 iloc_sentinel. Call contextual_conv_bool instead of
803 perform_implicit_conversion_flags. Don't check for INTEGER_CST before
804 calling integer_zerop. Call find_failing_clause and maybe use its
805 location. Print the original condition or the failing clause if
808 2020-11-10 Strager Neds <strager.nds@gmail.com>
810 * decl.c (duplicate_decls): Use new overload of
811 set_decl_section_name.
812 * method.c (use_thunk): Same.
813 * optimize.c (maybe_clone_body): Same.
814 * coroutines.cc (act_des_fn): Same.
816 2020-11-10 Jakub Jelinek <jakub@redhat.com>
819 * cvt.c (convert_to_void): Check (complain & tf_warning) in the outer
820 if rather than twice times in the inner one. Use warn_if_unused_value.
823 2020-11-10 Chung-Lin Tang <cltang@codesourcery.com>
825 * parser.c (cp_parser_omp_target_data): Add use of
826 new c_omp_adjust_map_clauses function. Add GOMP_MAP_ATTACH_DETACH as
827 handled map clause kind.
828 (cp_parser_omp_target_enter_data): Likewise.
829 (cp_parser_omp_target_exit_data): Likewise.
830 (cp_parser_omp_target): Likewise.
831 * semantics.c (handle_omp_array_sections): Adjust COMPONENT_REF case to
832 use GOMP_MAP_ATTACH_DETACH map kind for C_ORT_OMP region type. Fix
833 interaction between reference case and attach/detach.
834 (finish_omp_clauses): Adjust bitmap checks to allow struct decl and
835 same struct field access to co-exist on OpenMP construct.
837 2020-11-09 Marek Polacek <polacek@redhat.com>
840 * parser.c (cp_parser_check_std_attribute): Return bool. Add a
841 location_t parameter. Return true if the attribute wasn't duplicated.
842 Give a warning instead of an error. Check more attributes.
843 (cp_parser_std_attribute_list): Don't add duplicated attributes to
844 the list. Pass location to cp_parser_check_std_attribute.
846 2020-11-09 Patrick Palka <ppalka@redhat.com>
848 * constraint.cc (norm_info::norm_info): Initialize orig_decl.
849 (norm_info::orig_decl): New data member.
850 (normalize_atom): When caching an atom for the first time,
851 compute a list of template parameters used in the targets of the
852 parameter mapping and store it in the TREE_TYPE of the mapping.
853 (get_normalized_constraints_from_decl): Set current_function_decl
854 appropriately when normalizing. As an optimization, don't
855 set up a push_nested_class_guard when decl has no constraints.
856 (sat_hasher::hash): Use this list to hash only the template
857 arguments that are relevant to the atom.
858 (satisfy_atom): Use this list to compare only the template
859 arguments that are relevant to the atom.
860 * pt.c (keep_template_parm): Do a sanity check on the parameter's
861 index when flag_checking.
863 2020-11-09 Patrick Palka <ppalka@redhat.com>
865 * cp-tree.h (ATOMIC_CONSTR_MAP_INSTANTIATED_P): Define this flag
867 * constraint.cc (sat_hasher::hash): Use hash_atomic_constraint
868 if the flag is set, otherwise keep using a pointer hash.
869 (sat_hasher::equal): Return false if the flag's setting differs
870 on two atoms. Call atomic_constraints_identical_p if the flag
871 is set, otherwise keep using a pointer equality test.
872 (satisfy_atom): After instantiating the parameter mapping, form
873 another ATOMIC_CONSTR using the instantiated mapping and query
874 the cache again. Cache the satisfaction value of both atoms.
875 (diagnose_atomic_constraint): Simplify now that the supplied
876 atom has an instantiated mapping.
878 2020-11-09 Patrick Palka <ppalka@redhat.com>
880 * constraint.cc (atom_cache): Define this deletable hash_table.
881 (normalize_atom): Use it to cache ATOMIC_CONSTRs when not
882 generating diagnostics.
883 (sat_hasher::hash): Use htab_hash_pointer instead of
884 hash_atomic_constraint.
885 (sat_hasher::equal): Test for pointer equality instead of
886 atomic_constraints_identical_p.
887 * cp-tree.h (struct atom_hasher): Moved and renamed from ...
888 * logic.cc (struct constraint_hash): ... here.
889 (clause::m_set): Adjust accordingly.
891 2020-11-09 Patrick Palka <ppalka@redhat.com>
894 * constraint.cc (tsubst_parameter_mapping): Also canonicalize
895 the type arguments of a TYPE_ARGUMENT_PACk.
897 2020-11-09 Jason Merrill <jason@redhat.com>
899 * pt.c (tsubst): Replace *_ARGUMENT_PACK code with
900 a call to tsubst_argument_pack.
902 2020-11-09 Jason Merrill <jason@redhat.com>
904 * class.c (handle_using_decl): Add an iloc_sentinel.
906 2020-11-09 Marek Polacek <polacek@redhat.com>
909 * parser.c (warn_about_ambiguous_parse): Handle the case when
910 there is no type in the decl-specifiers.
912 2020-11-09 Nathan Sidwell <nathan@acm.org>
914 * cp-tree.h (LOOKUP_FOUND_P): Add ENUMERAL_TYPE.
915 * name-lookup.c (class name_lookup): Add comments.
916 (name_lookup::adl_namespace_only): Replace with ...
917 (name_lookup::adl_class_fns): ... this and ...
918 (name_lookup::adl_namespace_fns): ... this.
919 (name_lookup::adl_namespace): Deal with inline nests here.
920 (name_lookup::adl_class): Complete the type here.
921 (name_lookup::adl_type): Call broken-out enum ..
922 (name_lookup::adl_enum): New. No need to call the namespace adl
923 if it is class-scope.
924 (name_lookup::search_adl): Iterate over collected scopes here.
926 2020-11-09 Nathan Sidwell <nathan@acm.org>
928 * name-lookup.c (lookup_qualified_name): Expose an overload of a
929 singleton with known type.
930 (lookup_name_1): Just check the overload's type to expose it.
931 * parser.c (cp_parser_lookup_name): Do not do that check here.
933 2020-11-08 Iain Sandoe <iain@sandoe.co.uk>
935 * parser.c (cp_parser_objc_at_property_declaration): Handle
936 class keywords in @property attribute context.
938 2020-11-06 Marek Polacek <polacek@redhat.com>
941 * except.c (can_convert_eh): Change the return type to bool. If
942 the type TO and FROM are the same, return true.
944 2020-11-06 Iain Sandoe <iain@sandoe.co.uk>
946 * parser.c (cp_parser_objc_at_property_declaration):
947 Improve parsing fidelity. Associate better location info
948 with @property attributes. Clean up the interface to
949 objc_add_property_declaration ().
951 2020-11-06 Jakub Jelinek <jakub@redhat.com>
954 * decl.c (duplicate_decls): Propagate DECL_ATTRIBUTES and
955 DECL_PRESERVE_P from olddecl to its clones if any.
957 2020-11-06 Nathan Sidwell <nathan@acm.org>
959 * cp-tree.h (DECL_UNDECLARED_BUILTIN_P): Delete.
960 * cp-objcp-common.c (names_bultin_p): Rename
961 DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
962 * decl.c (decls_match): Likewise. Replace
963 DECL_UNDECLARED_BUILTIN_P with DECL_IS_UNDECLARED_BUILTIN.
964 (duplicate_decls): Likewise.
965 * decl2.c (collect_source_refs): Likewise.
966 * name-lookup.c (anticipated_builtin_p, print_binding_level)
967 (do_nonmember_using_decl): Likewise.
968 * pt.c (builtin_pack_fn_p): Likewise.
969 * typeck.c (error_args_num): Likewise.
971 2020-11-06 Nathan Sidwell <nathan@acm.org>
973 * parser.c (cp_parser_template_declaration): Adjust 'export' warning.
974 (cp_parser_explicit_specialization): Remove unneeded bool setting.
976 2020-11-06 Jan Hubicka <jh@suse.cz>
978 * tree.c (cp_fix_function_decl_p): Do not access ipa_ref_list dirrectly.
980 2020-11-06 Tobias Burnus <tobias@codesourcery.com>
982 * parser.c (cp_parser_omp_atomic): Add openacc parameter and update
984 (cp_parser_omp_construct): Update call.
986 2020-11-05 Marek Polacek <polacek@redhat.com>
988 * except.c (check_handlers_1): Add auto_diagnostic_group.
990 2020-11-05 Marek Polacek <polacek@redhat.com>
993 * pt.c (do_auto_deduction): If init is REFERENCE_REF_P, use its
996 2020-11-05 Marek Polacek <polacek@redhat.com>
999 * except.c (check_handlers_1): Use OPT_Wexceptions for the
1000 warning. Use inform for the second part of the warning.
1002 2020-11-05 Marek Polacek <polacek@redhat.com>
1005 * cp-tree.h (enum cp_tree_index): Add CPTI_EXPLICIT_VOID_LIST.
1006 (explicit_void_list_node): Define.
1007 (PARENTHESIZED_LIST_P): New macro.
1008 (struct cp_declarator): Add function::parens_loc.
1009 * decl.c (cxx_init_decl_processing): Initialize explicit_void_list_node.
1010 (grokparms): Also break when explicit_void_list_node.
1011 * parser.c (make_call_declarator): New location_t parameter. Use it
1012 to set declarator->u.function.parens_loc.
1013 (cp_parser_lambda_declarator_opt): Pass UNKNOWN_LOCATION to
1014 make_call_declarator.
1015 (warn_about_ambiguous_parse): New function.
1016 (cp_parser_init_declarator): Call warn_about_ambiguous_parse.
1017 (cp_parser_declarator): Set *parenthesized_p to false rather than to
1019 (cp_parser_direct_declarator): Create a location for the function's
1020 parentheses and pass it to make_call_declarator.
1021 (cp_parser_parameter_declaration_clause): Return explicit_void_list_node
1023 (cp_parser_parameter_declaration_list): Set PARENTHESIZED_LIST_P
1024 in the parameters tree.
1026 2020-11-04 Jakub Jelinek <jakub@redhat.com>
1029 * semantics.c (finish_omp_clauses): Look through array reductions to
1030 find underlying decl to clear in the aligned_head bitmap. Use
1031 DECL_UID (t) instead of DECL_UID (OMP_CLAUSE_DECL (c)) when clearing
1032 in the bitmap. Only diagnose errors about allocate vars not being
1033 privatized on the same construct on allocate clause if it has
1034 a DECL_P OMP_CLAUSE_DECL.
1036 2020-11-04 Iain Sandoe <iain@sandoe.co.uk>
1038 * constexpr.c (potential_constant_expression_1): Handle
1039 expressions known to be non-constant for Objective-C.
1041 2020-11-03 Jason Merrill <jason@redhat.com>
1043 * tree.c (is_byte_access_type): Don't use char_type_p.
1045 2020-11-03 Jakub Jelinek <jakub@redhat.com>
1048 * parser.c (cp_parser_init_declarator): Don't try to parse
1049 C++17 deduction guides if there are any type specifiers even when
1052 2020-11-03 Kamlesh Kumar <kamleshbhalui@gmail.com>
1053 Jason Merrill <jason@redhat.com>
1057 * pt.c (get_template_base): Consider closest base in template
1058 deduction when base of base also matches.
1060 2020-11-03 Nathan Sidwell <nathan@acm.org>
1062 * pt.c (tsubst_expr): Simplify using decl instantiation, add
1065 2020-11-03 Nathan Sidwell <nathan@acm.org>
1067 * class.c (copy_fndecl_with_name): Always not top level.
1068 (build_cdtor_clones): Add update_methods parm, use it to
1069 conditionally update the method vec. Return void
1070 (clone_cdtor): Adjust.
1071 (clone_constructors_and_destructors): Adjust comment.
1073 2020-11-03 Nathan Sidwell <nathan@acm.org>
1075 * pt.c (primary_template_specialization_p): Use
1076 VAR_OR_FUNCTION_DECL_P.
1077 (tsubst_template_decl): Check for FUNCTION_DECL, not !TYPE && !VAR
1078 for registering a specialization.
1080 2020-11-03 Nathan Sidwell <nathan@acm.org>
1082 * cp-tree.h (fixup_deferred_exception_variants): Declare.
1083 * parser.c (cp_parser_class_specifier_1): Call it when
1084 completing deferred parses rather than creating a variant.
1085 (cp_parser_member_declaration): Move comment from ...
1086 (cp_parser_noexcept_specification_opt): ... here. Refactor the
1088 * tree.c (fixup_deferred_exception_variants): New.
1090 2020-11-03 Nathan Sidwell <nathan@acm.org>
1092 * pt.c (tsubst_lambda_expr): Reorder extra-scope handling to match
1093 the non-template case.
1094 (instantiate_body): Move a couple of declarations to their
1097 2020-11-03 Nathan Sidwell <nathan@acm.org>
1099 * decl.c (duplicate_decls): Return error_mark_node fo extern-c
1102 2020-11-03 Marek Polacek <polacek@redhat.com>
1104 * constexpr.c (potential_constant_expression_1): Treat
1105 __PRETTY_FUNCTION__ inside a template function as
1106 potentially-constant.
1107 * pt.c (uses_template_parms): Call
1108 instantiation_dependent_expression_p instead of
1109 value_dependent_expression_p.
1110 (instantiation_dependent_expression_p): Check
1111 potential_constant_expression before calling
1112 value_dependent_expression_p.
1114 2020-11-03 Marek Polacek <polacek@redhat.com>
1117 * init.c (build_new_1): Disable -Winit-list-lifetime for an unevaluated
1120 2020-11-03 Nathan Sidwell <nathan@acm.org>
1122 * tree.c (bind_template_template_parm): Mark the parm as a
1124 (cp_tree_equal): Refactor CALL_EXPR. Use comp_template_args for
1127 2020-11-03 Nathan Sidwell <nathan@acm.org>
1129 * rtti.c (init_rtti_processing): Move var decl to its init.
1130 (get_tinfo_decl): Likewise. Break out creation to called helper
1132 (get_tinfo_decl_direct): ... here.
1133 (build_dynamic_cast_1): Move var decls to their initializers.
1134 (tinfo_base_init): Set decl's location to BUILTINS_LOCATION.
1135 (get_tinfo_desc): Only push ABI namespace when needed. Set type's
1138 2020-11-02 Nathan Sidwell <nathan@acm.org>
1140 * decl.c (start_decl_1): Refactor declarations. Fixup some
1142 (lookup_and_check_tag): Fixup some whitespace.
1144 2020-11-02 Nathan Sidwell <nathan@acm.org>
1146 * decl.c (duplicate_decls): Refactor some template & builtin
1149 2020-11-02 Nathan Sidwell <nathan@acm.org>
1151 * cp-tree.h (struct cxx_int_tree_map): Delete.
1152 (struct cxx_int_tree_map_hasher): Delete.
1153 * cp-gimplify.c (cxx_int_tree_map_hasher::equal): Delete.
1154 (cxx_int_tree_map_hasher::hash): Delete.
1156 2020-11-02 Patrick Palka <ppalka@redhat.com>
1158 * class.c (finish_struct_1): Don't call clear_satisfaction_cache.
1159 * constexpr.c (clear_cv_and_fold_caches): Likewise. Remove bool
1161 * constraint.cc (clear_satisfaction_cache): Remove definition.
1162 * cp-tree.h (clear_satisfaction_cache): Remove declaration.
1163 (clear_cv_and_fold_caches): Remove bool parameter.
1164 * typeck2.c (store_init_value): Remove argument to
1165 clear_cv_and_fold_caches.
1167 2020-11-01 Iain Sandoe <iain@sandoe.co.uk>
1169 * parser.c (cp_parser_objc_at_property_declaration): Use any
1170 exisiting syntax error to suppress complaints about a missing
1171 closing parenthesis in parsing property attributes.
1173 2020-10-30 Jakub Jelinek <jakub@redhat.com>
1175 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_ALLOCATE>: Handle
1176 non-static members in methods.
1177 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_ALLOCATE.
1179 2020-10-29 Marek Polacek <polacek@redhat.com>
1183 * parser.c (cp_parser_type_id_1): Reject using auto as
1184 a template-argument in C++20.
1186 2020-10-29 Marek Polacek <polacek@redhat.com>
1189 * pt.c (do_auto_deduction): Call resolve_nondeduced_context for
1190 the elements of a { } list.
1192 2020-10-29 Marek Polacek <polacek@redhat.com>
1194 * typeck.c (do_warn_enum_conversions): Don't warn for SPACESHIP_EXPR.
1195 (cp_build_binary_op): Reject float <=> enum or enum <=> float. Use
1196 CP_INTEGRAL_TYPE_P instead of INTEGRAL_OR_ENUMERATION_TYPE_P.
1198 2020-10-29 Patrick Palka <ppalka@redhat.com>
1200 * constraint.cc (get_normalized_constraints): Remove 'args'
1201 parameter. Pass NULL_TREE as the initial template arguments to
1202 normalize_expression.
1203 (get_normalized_constraints_from_info): Remove 'args' parameter
1204 and adjust the call to get_normalized_constraints.
1205 (get_normalized_constraints_from_decl): Remove 'args' local
1206 variable and adjust call to get_normalized_constraints_from_info.
1207 (normalize_concept_definition): Remove 'args' local variable
1208 and adjust call to get_normalized_constraints.
1209 (normalize_constraint_expression): Remove the two-parameter
1210 overload. Remove 'args' parameter from the three-parameter
1211 overload and update function comment accordingly. Remove
1212 default argument from 'diag' parameter. Adjust call to
1213 get_normalized_constraints.
1214 (finish_nested_requirement): Adjust call to
1215 normalize_constraint_expression.
1216 (strictly_subsumes): Remove 'args' parameter. Adjust call to
1217 get_normalized_constraints_from_info.
1218 (weakly_subsumes): Likewise.
1219 * cp-tree.h (strictly_subsumes): Remove 'args' parameter.
1220 (weakly_subsumes): Likewise.
1221 * pt.c (process_partial_specialization): Adjust call to
1223 (is_compatible_template_arg): Adjust call to weakly_subsumes.
1225 2020-10-29 Patrick Palka <ppalka@redhat.com>
1228 * constraint.cc (normalize_concept_check): Don't call
1229 tsubst_template_args when 'args' is NULL.
1231 2020-10-29 Jason Merrill <jason@redhat.com>
1234 * constexpr.c (cxx_eval_outermost_constant_expr): Revert to
1235 original expression if evaluation sets non_constant_p.
1237 2020-10-29 Jakub Jelinek <jakub@redhat.com>
1238 Jason Merrill <jason@redhat.com>
1241 * constexpr.c (cxx_bind_parameters_in_call): Set non_constant_args
1242 if the parameter type has a non-trivial destructor.
1243 (cxx_eval_call_expression): Only unshare arguments if we're
1244 memoizing this evaluation.
1246 2020-10-29 Jakub Jelinek <jakub@redhat.com>
1249 * cp-tree.h (enum cp_tree_index): Add CPTI_HEAP_VEC_UNINIT_IDENTIFIER
1250 and CPTI_HEAP_VEC_IDENTIFIER.
1251 (heap_vec_uninit_identifier, heap_vec_identifier): Define.
1252 * decl.c (initialize_predefined_identifiers): Initialize those
1254 * constexpr.c (cxx_eval_call_expression): Reject array allocations
1255 deallocated with non-array deallocation or non-array allocations
1256 deallocated with array deallocation.
1257 (non_const_var_error): Handle heap_vec_uninit_identifier and
1258 heap_vec_identifier too.
1259 (cxx_eval_constant_expression): Handle also heap_vec_uninit_identifier
1260 and in that case during initialization replace it with
1261 heap_vec_identifier.
1262 (find_heap_var_refs): Handle heap_vec_uninit_identifier and
1263 heap_vec_identifier too.
1265 2020-10-29 Nathan Sidwell <nathan@acm.org>
1267 * pt.c (push_template_decl): Do not give function-scope entities
1268 other than implicit typedefs a template header. Do not readd
1269 template info to a redeclared template.
1271 2020-10-28 Marek Polacek <polacek@redhat.com>
1273 * decl.c (grokdeclarator): Offer a fix-it hint for the "unnecessary
1274 parentheses in declaration" warning.
1275 * parser.c (cp_parser_direct_declarator): When setting
1276 declarator->parenthesized, use a location range.
1278 2020-10-28 Marek Polacek <polacek@redhat.com>
1281 * call.c (build_conditional_expr_1): Warn about the deprecated
1282 enum/real type conversion in C++20. Also warn about a non-enumerated
1283 and enumerated type in ?: when -Wenum-conversion is on.
1284 * typeck.c (do_warn_enum_conversions): New function.
1285 (cp_build_binary_op): Call it.
1287 2020-10-28 Marek Polacek <polacek@redhat.com>
1291 * pt.c (tsubst_copy_and_build): Call value_dependent_expression_p or
1292 type_dependent_expression_p instead of type_dependent_expression_p_push.
1293 But only call value_dependent_expression_p for expressions that are
1294 potential_constant_expression.
1296 2020-10-28 Marek Polacek <polacek@redhat.com>
1299 * parser.c (cp_parser_class_name): Use parser->scope when
1302 2020-10-28 Marek Polacek <polacek@redhat.com>
1305 * parser.c (cp_parser_fold_expression): Return error_mark_node
1306 if a left fold is preceded by an expression.
1308 2020-10-28 Nathan Sidwell <nathan@acm.org>
1310 * parser.c (cp_parser_omp_declare_reduction): Set
1311 DECL_LOCAL_DECL_P before push_template_decl.
1312 * pt.c (instantiate_body): Nested fns do not have template_info.
1314 2020-10-28 Patrick Palka <ppalka@redhat.com>
1317 * decl2.c (mark_used): Move up the constraints_satisfied_p check
1318 so that we check constraints before calling maybe_instantiate_decl.
1320 2020-10-28 Nathan Sidwell <nathan@acm.org>
1322 * pt.c (push_template_decl): Refactor for some RAII.
1324 2020-10-28 Jakub Jelinek <jakub@redhat.com>
1326 * parser.c (cp_parser_omp_clause_name): Handle allocate.
1327 (cp_parser_omp_clause_allocate): New function.
1328 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ALLOCATE.
1329 (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
1330 OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK,
1331 OMP_TASK_CLAUSE_MASK, OMP_TASKGROUP_CLAUSE_MASK,
1332 OMP_DISTRIBUTE_CLAUSE_MASK, OMP_TEAMS_CLAUSE_MASK,
1333 OMP_TARGET_CLAUSE_MASK, OMP_TASKLOOP_CLAUSE_MASK): Add
1334 PRAGMA_OMP_CLAUSE_ALLOCATE.
1335 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_ALLOCATE.
1336 * pt.c (tsubst_omp_clauses): Likewise.
1338 2020-10-27 Nathan Sidwell <nathan@acm.org>
1340 * cp-tree.h (struct lang_type): Delete nested_udts field.
1341 (CLASSTYPE_NESTED_UTDS): Delete.
1342 * name-lookup.h (binding_table, binding_entry): Delete typedefs.
1343 (bt_foreach_proc): Likewise.
1344 (struct binding_entry_s): Delete.
1345 (SCOPE_DEFAULT_HT_SIZE, CLASS_SCOPE_HT_SIZE)
1346 (NAMESPACE_ORDINARY_HT_SIZE, NAMESPACE_STD_HT_SIZE)
1347 (GLOBAL_SCOPE_HT_SIZE): Delete.
1348 (binding_table_foreach, binding_table_find): Delete declarations.
1349 * name-lookup.c (ENTRY_INDEX): Delete.
1350 (free_binding_entry): Delete.
1351 (binding_entry_make, binding_entry_free): Delete.
1352 (struct binding_table_s): Delete.
1353 (binding_table_construct, binding_table_free): Delete.
1354 (binding_table_new, binding_table_expand): Delete.
1355 (binding_table_insert, binding_table_find): Delete.
1356 (binding_table_foreach): Delete.
1357 (maybe_process_template_type_declaration): Delete
1358 CLASSTYPE_NESTED_UTDS insertion.
1359 (do_pushtag): Likewise.
1360 * decl2.c (bt_reset_linkage_1): Fold into reset_type_linkage_1.
1361 (reset_type_linkage_2, bt_reset_linkage_2): Fold into
1363 * pt.c (instantiate_class_template_1): Delete NESTED_UTDs comment.
1364 (bt_instantiate_type_proc): Delete.
1365 (do_type_instantiation): Instantiate implicit typedef fields.
1366 Delete NESTED_UTD walk.
1367 * search.c (lookup_field_r): Delete unreachable NESTED_UTD
1370 2020-10-27 Nathan Sidwell <nathan@acm.org>
1372 * parser.c (cp_parser_explicit_instantiation): Refactor some RAII.
1373 * pt.c (bt_instantiate_type_proc): DATA is the tree, pass type to
1374 do_type_instantiation.
1375 (do_type_instantiation): Require T to be a type. Refactor for
1378 2020-10-26 Ville Voutilainen <ville.voutilainen@gmail.com>
1380 * cp-tree.h (CPTK_IS_NOTHROW_ASSIGNABLE): New.
1381 (CPTK_IS_NOTHROW_CONSTRUCTIBLE): Likewise.
1382 (is_nothrow_xible): Likewise.
1383 * method.c (is_nothrow_xible): New.
1384 (is_trivially_xible): Tweak.
1385 * parser.c (cp_parser_primary_expression): Handle the new RID_*.
1386 (cp_parser_trait_expr): Likewise.
1387 * semantics.c (trait_expr_value): Handle the new RID_*.
1388 (finish_trait_expr): Likewise.
1390 2020-10-24 Marek Polacek <polacek@redhat.com>
1393 * constexpr.c (cxx_eval_array_reference): Set up ctx->ctor if we
1394 are initializing an aggregate. Call free_constructor on the new
1395 CONSTRUCTOR if it isn't returned from cxx_eval_constant_expression.
1397 2020-10-23 Marek Polacek <polacek@redhat.com>
1400 * typeck.c (cp_build_binary_op): Implement -Wsizeof-array-div.
1402 2020-10-22 Patrick Palka <ppalka@redhat.com>
1405 * constexpr.c (init_subob_ctx): Don't punt on RANGE_EXPR
1406 indexes, instead build a sub-aggregate initialization context
1409 2020-10-22 Patrick Palka <ppalka@redhat.com>
1412 * constexpr.c (cxx_eval_constant_expression)
1413 <case EMPTY_CLASS_EXPR>: Lower it to a CONSTRUCTOR.
1414 (potential_constant_expression_1) <case COMPOUND_EXPR>: Remove
1415 now-redundant handling of COMPOUND_EXPR with EMPTY_CLASS_EXPR
1417 <case EMPTY_CLASS_EXPR>: Return true instead of false.
1419 2020-10-22 Patrick Palka <ppalka@redhat.com>
1422 * decl.c (duplicate_decls): Return NULL_TREE if
1423 DECL_TEMPLATE_PARM_P differ.
1425 2020-10-20 Nathan Sidwell <nathan@acm.org>
1427 * name-lookup.c (push_local_extern_decl_alias): Reconstextualize
1428 alias' parm decls. Drop any default args.
1430 2020-10-19 Iain Sandoe <iain@sandoe.co.uk>
1433 * coroutines.cc (struct coroutine_info): Add a field to
1434 record that we emitted a promise type error.
1435 (coro_promise_type_found_p): Check for the case that the
1436 promise type contains both return_void and return_value.
1437 Emit an error if so, with information about the wrong
1440 2020-10-16 Nathan Sidwell <nathan@acm.org>
1443 * pt.c (push_template_decl): Check DECL_LANG_SPECIFIC in friend
1446 2020-10-16 Nathan Sidwell <nathan@acm.org>
1449 * parser.c (cp_parser_declaration): Make token2 point to EOF if
1452 2020-10-15 Jason Merrill <jason@redhat.com>
1455 * decl.c (copy_fn_p): Return false for a function that is neither a
1456 constructor nor an assignment operator.
1457 (move_signature_fn_p): Likewise.
1459 2020-10-15 Marek Polacek <polacek@redhat.com>
1463 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Handle OFFSET_TYPE.
1464 (cxx_pretty_printer::abstract_declarator): Fix the printing of ')'.
1465 (cxx_pretty_printer::direct_abstract_declarator): Handle OFFSET_TYPE.
1466 (cxx_pretty_printer::type_id): Likewise. Print the abstract declarator
1467 for pointers-to-members.
1469 2020-10-14 Jason Merrill <jason@redhat.com>
1472 * pt.c (check_for_bare_parameter_packs): Diagnose use of
1475 2020-10-14 Nathan Sidwell <nathan@acm.org>
1477 * cp-tree.h (struct lang_decl_fn): Adjust context comment.
1478 (DECL_FRIEND_P): Replace with ...
1479 (DECL_UNIQUE_FRIEND_P): ... this. Only for FUNCTION_DECLs.
1480 (DECL_FRIEND_CONTEXT): Adjust.
1481 * class.c (add_implicitly_declared_members): Detect friendly
1482 spaceship from context.
1483 * constraint.cc (remove_constraints): Use a checking assert.
1484 (maybe_substitute_reqs_for): Use DECL_UNIQUE_FRIEND_P.
1485 * decl.c (check_no_redeclaration_friend_default_args):
1486 DECL_UNIQUE_FRIEND_P is signficant, not hiddenness.
1487 (duplicate_decls): Adjust DECL_UNIQUE_FRIEND_P clearing.
1488 (redeclaration_error_message): Use DECL_UNIQUE_FRIEND_P.
1489 (start_preparsed_function): Correct in-class friend processing.
1490 Refactor some initializers.
1491 (grokmethod): Directly check friend decl-spec.
1492 * decl2.c (grokfield): Check DECL_UNIQUE_FRIEND_P.
1493 * friend.c (do_friend): Set DECL_UNIQUE_FRIEND_P first, remove
1494 extraneous conditions. Don't re set it afterwards.
1495 * name-lookup.c (lookup_elaborated_type_1): Simplify revealing
1497 (do_pushtag): Likewise.
1498 * pt.c (optimize_specialization_lookup_p): Check
1499 DECL_UNIQUE_FRIEND_P.
1500 (push_template_decl): Likewise. Drop unneeded friend setting.
1501 (type_dependent_expression_p): Check DECL_UNIQUE_FRIEND_P.
1503 2020-10-14 Nathan Sidwell <nathan@acm.org>
1505 * name-lookup.c (push_local_extern_decl_alias): Push into alias's
1506 namespace and use pushdecl.
1507 (do_pushdecl_with_scope): Clarify behaviour.
1509 2020-10-12 Martin Sebor <msebor@redhat.com>
1512 * error.c (dump_type_suffix): Handle both the C and C++ forms of
1515 2020-10-12 Martin Sebor <msebor@redhat.com>
1519 * init.c (warn_placement_new_too_small): Call builtin_objsize instead
1520 of duplicating what it does.
1522 2020-10-08 Jason Merrill <jason@redhat.com>
1526 * pt.c (tsubst_aggr_type): Don't build a TYPENAME_TYPE when
1528 (tsubst_template_decl): Use tsubst_aggr_type.
1530 2020-10-08 Patrick Palka <ppalka@redhat.com>
1533 * constraint.cc (build_type_constraint): Temporarily increment
1534 processing_template_decl before calling build_concept_check.
1535 * pt.c (make_constrained_placeholder_type): Likewise.
1537 2020-10-08 Patrick Palka <ppalka@redhat.com>
1540 * parser.c (cp_parser_class_specifier_1): Move call to
1541 associate_classtype_constraints from here to ...
1542 (cp_parser_class_head): ... here.
1543 * pt.c (is_compatible_template_arg): Correct documentation to
1544 say "argument is _no_ more constrained than the parameter".
1546 2020-10-07 Marek Polacek <polacek@redhat.com>
1549 * pt.c (tsubst_copy_and_build) <case TEMPLATE_ID_EXPR>: Call
1550 tsubst_copy_and_build explicitly instead of using the RECUR macro.
1551 Handle a TEMPLATE_ID_EXPR with an IDENTIFIER_NODE as its operand.
1552 <case CALL_EXPR>: Perform ADL for a TEMPLATE_ID_EXPR with an
1553 IDENTIFIER_NODE as its operand.
1555 2020-10-07 Patrick Palka <ppalka@redhat.com>
1559 * tree.c (cp_tree_equal) <case ALIGNOF_EXPR>: Return false if
1560 ALIGNOF_EXPR_STD_P differ.
1562 2020-10-07 Nathan Sidwell <nathan@acm.org>
1564 * cp-tree.h (struct language_function): Delete extern_decl_map.
1565 (DECL_LOCAL_DECL_ALIAS): New.
1566 * name-lookup.h (is_local_extern): Delete.
1567 * name-lookup.c (set_local_extern_decl_linkage): Replace with ...
1568 (push_local_extern_decl): ... this new function.
1569 (do_pushdecl): Call new function after pushing new decl. Unhide
1570 hidden non-functions.
1571 (is_local_extern): Delete.
1572 * decl.c (layout_var_decl): Do not allow VLA local externs.
1573 * decl2.c (mark_used): Also mark DECL_LOCAL_DECL_ALIAS. Drop old
1574 local-extern treatment.
1575 * parser.c (cp_parser_oacc_declare): Deal with local extern aliases.
1576 * pt.c (tsubst_expr): Adjust local extern instantiation.
1577 * cp-gimplify.c (cp_genericize_r): Remap DECL_LOCAL_DECLs.
1579 2020-10-07 Nathan Sidwell <nathan@acm.org>
1581 * cp-tree.h (DECL_BUILTIN_P): Rename to ...
1582 (DECL_UNDECLARED_BUILTIN_P): ... here.
1583 * decl.c (duplicate_decls): Adjust.
1584 * name-lookup.c (anticipated_builtin_p): Adjust.
1585 (do_nonmember_using_decl): Likewise.
1587 2020-10-07 Nathan Sidwell <nathan@acm.org>
1589 * tree.c (build_cp_fntype_variant): Clear
1590 TYPE_DEPENDENT_P_VALID if necessary.
1592 2020-10-06 Marek Polacek <polacek@redhat.com>
1595 * parser.c (cp_parser_direct_declarator): When checking if a
1596 name is a function template declaration for the P0634R3 case,
1597 look in uninstantiated templates too.
1599 2020-10-05 Marek Polacek <polacek@redhat.com>
1601 * cp-tree.h (NON_UNION_CLASS_TYPE_P): Fix typo in a comment.
1603 2020-10-05 Richard Biener <rguenther@suse.de>
1604 Jakub Jelinek <jakub@redhat.com>
1607 * error.c (dump_expr): Handle TARGET_MEM_REF.
1609 2020-10-05 Nathan Sidwell <nathan@acm.org>
1611 * name-lookup.c (maybe_add_fuzzy_decl): New.
1612 (maybe_add_fuzzy_binding): New.
1613 (consider_binding_level): Use intermediate sortable vector for
1616 2020-10-02 Marek Polacek <polacek@redhat.com>
1619 * cxx-pretty-print.c (pp_cxx_template_argument_list): If the
1620 argument is template_parm_object_p, print its DECL_INITIAL.
1622 2020-10-02 Nathan Sidwell <nathan@acm.org>
1624 * cp-tree.h (lang_decl_base): anticipated_p is not used for
1626 (DECL_ANTICIPATED): Delete.
1627 * decl.c (duplicate_decls): Delete DECL_ANTICIPATED_management,
1629 (cxx_builtin_function): Drop DECL_ANTICIPATED setting.
1630 (xref_tag_1): Drop DECL_ANTICIPATED assert.
1631 * name-lookup.c (name_lookup::adl_class_only): Drop
1632 DECL_ANTICIPATED check.
1633 (name_lookup::search_adl): Always dedup.
1634 (anticipated_builtin_p): Reimplement.
1635 (do_pushdecl): Drop DECL_ANTICIPATED asserts & update.
1636 (lookup_elaborated_type_1): Drop DECL_ANTICIPATED update.
1637 (do_pushtag): Drop DECL_ANTICIPATED setting.
1638 * pt.c (push_template_decl): Likewise.
1639 (tsubst_friend_class): Likewise.
1641 2020-10-02 Nathan Sidwell <nathan@acm.org>
1643 * name-lookup.c (consider_decl): New, broken out of ...
1644 (consider_binding_level): ... here. Iterate the hash table for
1647 2020-10-02 Nathan Sidwell <nathan@acm.org>
1649 * cp-tree.h (base_ctor_omit_inherited_parms): Declare.
1650 * class.c (add_method): Refactor main loop, only pass fns to
1651 ctor_omit_inherited_parms.
1652 (build_cdtor_clones): Rename bool parms.
1653 (clone_cdtor): Call base_ctor_omit_inherited_parms.
1654 * method.c (base_ctor_omit_inherited_parms): New, broken out of
1656 (ctor_omit_inherited_parms): ... here, call it with
1657 DECL_CLONED_FUNCTION.
1659 2020-10-02 Nathan Sidwell <nathan@acm.org>
1661 * cp-tree.h (cp_fname_init): Delete declaration.
1662 * decl.c (cp_fname_init): Merge into only caller ...
1663 (cp_make_fname): ... here & refactor.
1665 2020-10-02 Jason Merril <jason@redhat.com>
1667 * call.c (build_operator_new_call): Set CALL_FROM_NEW_OR_DELETE_P.
1668 (build_op_delete_call): Likewise.
1669 * init.c (build_new_1, build_vec_delete_1, build_delete): Not here.
1672 2020-10-02 Jason Merril <jason@redhat.com>
1674 * lambda.c (call_from_lambda_thunk_p): New.
1675 * cp-gimplify.c (cp_genericize_r): Use it.
1676 * pt.c (tsubst_copy_and_build): Use it.
1677 * typeck.c (check_return_expr): Use it.
1678 * cp-tree.h: Declare it.
1679 (CALL_FROM_NEW_OR_DELETE_P): Move to gcc/tree.h.
1681 2020-10-01 Nathan Sidwell <nathan@acm.org>
1683 * cp-tree.h (DECL_ANTICIPATED): Adjust comment.
1684 (DECL_HIDDEN_P, TYPE_HIDDEN_P): Delete.
1685 * tree.c (ovl_insert): Delete DECL_HIDDEN_P assert.
1686 (ovl_skip_hidden): Likewise.
1688 2020-10-01 Nathan Sidwell <nathan@acm.org>
1690 * name-lookup.c (pushdecl_top_level): Assert incoming context is
1691 null, add global_namespace context.
1692 (pushdecl_top_level_and_finish): Likewise.
1693 * pt.c (get_template_parm_object): Clear decl context before
1695 * semantics.c (finish_compound_literal): Likewise.
1697 2020-10-01 Nathan Sidwell <nathan@acm.org>
1699 * decl.c (lookup_and_check_tag): Refactor.
1701 2020-10-01 Jakub Jelinek <jakub@redhat.com>
1704 * call.c (build_over_call): If obj_arg is non-NULL, return INIT_EXPR
1705 setting obj_arg to call.
1707 2020-10-01 Jakub Jelinek <jakub@redhat.com>
1710 * constexpr.c (cxx_eval_call_expression): Don't VERIFY_CONSTANT the
1713 2020-10-01 Marek Polacek <polacek@redhat.com>
1716 * pt.c (do_class_deduction): Don't prune explicit deduction guides
1717 in copy-list-initialization. In copy-list-initialization, if an
1718 explicit deduction guide was selected, give an error.
1720 2020-09-30 Nathan Sidwell <nathan@acm.org>
1722 * cp-tree.h (struct lang_decl_fn): Remove hidden_friend_p.
1723 (DECL_HIDDEN_FRIEND_P): Delete.
1724 * call.c (add_function_candidate): Drop assert about anticipated
1726 (build_new_op_1): Drop koenig lookup flagging for hidden friend.
1727 * decl.c (duplicate_decls): Drop HIDDEN_FRIEND_P updating.
1728 * name-lookup.c (do_pushdecl): Likewise.
1729 (set_decl_namespace): Discover hiddenness from OVL_HIDDEN_P.
1730 * pt.c (check_explicit_specialization): Record found_hidden
1733 2020-09-29 Marek Polacek <polacek@redhat.com>
1736 * call.c (ref_conv_binds_directly_p): New function.
1737 * cp-tree.h (ref_conv_binds_directly_p): Declare.
1738 * parser.c (warn_for_range_copy): New function.
1739 (cp_convert_range_for): Call it.
1741 2020-09-29 Nathan Sidwell <nathan@acm.org>
1743 * cp-tree.h (ovl_insert): Change final parm to hidden-or-using
1745 * name-lookup.h (HIDDEN_TYPE_BINDING_P): New.
1746 (struct cxx_binding): Add type_is_hidden flag.
1747 * tree.c (ovl_insert): Change using_p parm to using_or_hidden,
1749 (ovl_skip_hidden): Assert we never see a naked hidden decl.
1750 * decl.c (xref_tag_1): Delete unhiding friend from here (moved to
1751 lookup_elaborated_type_1).
1752 * name-lookup.c (STAT_TYPE_HIDDEN_P, STAT_DECL_HIDDEN_P): New.
1753 (name_lookup::search_namespace_only): Check new hidden markers.
1754 (cxx_binding_make): Clear HIDDEN_TYPE_BINDING_P.
1755 (update_binding): Update new hidden markers.
1756 (lookup_name_1): Check HIDDEN_TYPE_BINDING_P and simplify friend
1758 (lookup_elaborated_type_1): Use new hidden markers. Reveal the
1761 2020-09-29 Nathan Sidwell <nathan@acm.org>
1763 * name-lookup.c (create_local_binding): Do not clear
1764 INHERITED_VALUE_BINDING_P here.
1765 (name_lookup::process_binding): Move done hidden-decl triage to ...
1766 (name_lookup::search_namespace_only): ... here, its only caller.
1767 (cxx_binding_make): Clear flags here.
1768 (push_binding): Not here.
1769 (pop_local_binding): RAII.
1770 (update_binding): Refactor.
1771 (do_pushdecl): Assert we're never revealing a local binding.
1772 (do_pushdecl_with_scope): Directly call do_pushdecl.
1773 (get_class_binding): Do not clear LOCAL_BINDING_P here.
1774 * pt.c (push_template_decl): Set friend & anticipated before
1777 2020-09-29 Nathan Sidwell <nathan@acm.org>
1779 * name-lookup.c (update_binding): We never meet two implicit
1781 (do_pushdecl): Adjust set_identifier_type_value_with_scope calls.
1782 (set_identifier_type_value_with_scope): Do not update binding in
1783 the namespace-case. Assert it is already there.
1785 2020-09-25 Nathan Sidwell <nathan@acm.org>
1787 * cp-tree.h (duplicate_decls): Replace 'is_friend' with 'hiding'
1788 and add 'was_hidden'.
1789 * name-lookup.h (pushdecl_namespace_level): Replace 'is_friend'
1791 (pushdecl): Likewise.
1792 (pushdecl_top_level): Drop is_friend parm.
1793 * decl.c (check_no_redeclaration_friend_default_args): Rename parm
1795 (duplicate_decls): Replace 'is_friend' with 'hiding'
1796 and 'was_hidden'. Do minimal adjustments in body.
1797 (cxx_builtin_function): Pass 'hiding' to pushdecl.
1798 * friend.c (do_friend): Pass 'hiding' to pushdecl.
1799 * name-lookup.c (supplement_binding_1): Drop defaulted arg to
1801 (update_binding): Replace 'is_friend' with 'hiding'. Drop
1802 defaulted arg to duplicate_decls.
1803 (do_pushdecl): Replace 'is_friend' with 'hiding'. Assert no
1804 surprise hidhing. Adjust duplicate_decls calls to inform of old
1806 (pushdecl): Replace 'is_friend' with 'hiding'.
1807 (set_identifier_type_value_with_scope): Adjust update_binding
1809 (do_pushdecl_with_scope): Replace 'is_friend' with 'hiding'.
1810 (pushdecl_outermost_localscope): Drop default arg to
1811 do_pushdecl_with_scope.
1812 (pushdecl_namespace_level): Replace 'is_friend' with 'hiding'.
1813 (pushdecl_top_level): Drop is_friend parm.
1814 * pt.c (register_specialization): Comment duplicate_decls call
1816 (push_template_decl): Commont pushdecl_namespace_level.
1817 (tsubst_friend_function, tsubst_friend_class): Likewise.
1819 2020-09-25 Nathan Sidwell <nathan@acm.org>
1821 * name-lookup.h (enum tag_scope): Replace with ...
1822 (enum class TAG_how): ... this. Add HIDDEN_FRIEND value.
1823 (lookup_type_scope): Replace with ...
1824 (lookup_elaborated_type): ... this.
1825 (pushtag): Use TAG_how, not tag_scope.
1826 * cp-tree.h (xref_tag): Parameter is TAG_how, not tag_scope.
1827 * decl.c (lookup_and_check_tag): Likewise. Adjust.
1828 (xref_tag_1, xref_tag): Likewise. adjust.
1829 (start_enum): Adjust lookup_and_check_tag call.
1830 * name-lookup.c (lookup_type_scope_1): Rename to ...
1831 (lookup_elaborated_type_1) ... here. Use TAG_how, not tag_scope.
1832 (lookup_type_scope): Rename to ...
1833 (lookup_elaborated_type): ... here. Use TAG_how, not tag_scope.
1834 (do_pushtag): Use TAG_how, not tag_scope. Adjust.
1835 (pushtag): Likewise.
1836 * parser.c (cp_parser_elaborated_type_specifier): Adjust.
1837 (cp_parser_class_head): Likewise.
1839 2020-09-25 Nathan Sidwell <nathan@acm.org>
1841 * cp-tree.h (DECL_BUILTIN_P): New.
1842 * decl.c (duplicate_decls): Use it. Do not treat omp-udr as a
1844 * name-lookup.c (anticipated_builtin): Use it.
1845 (set_decl_context_in_fn): Function-scope OMP UDRs have function context.
1846 (do_nonmember_using_decl): Use DECL_BUILTIN_P.
1847 * parser.c (cp_parser_omp_declare_reduction): Function-scope OMP
1848 UDRs have function context. Assert we never find a valid duplicate.
1849 * pt.c (tsubst_expr): Function-scope OMP UDRs have function context.
1851 2020-09-24 Nathan Sidwell <nathan@acm.org>
1853 * cp-tree.h (duplicate_decls): Default is_friend to false.
1854 (xref_tag): Default tag_scope & tpl_header_p to ts_current & false.
1855 (push_template_decl_real): Default is_friend to false. Rename to
1857 (push_template_decl): ... here. Delete original decl.
1858 * name-lookup.h (pushdecl_namespace_level): Default is_friend to
1860 (pushtag): Default tag_scope to ts_current.
1861 * coroutines.cc (morph_fn_to_coro): Drop default args to xref_tag.
1862 * decl.c (start_decl): Drop default args to duplicate_decls.
1863 (start_enum): Drop default arg to pushtag & xref_tag.
1864 (start_preparsed_function): Pass DECL_FRIEND_P to
1866 (grokmethod): Likewise.
1867 * friend.c (do_friend): Rename push_template_decl_real calls.
1868 * lambda.c (begin_lamnbda_type): Drop default args to xref_tag.
1869 (vla_capture_type): Likewise.
1870 * name-lookup.c (maybe_process_template_type_declaration): Rename
1871 push_template_decl_real call.
1872 (pushdecl_top_level_and_finish): Drop default arg to
1873 pushdecl_namespace_level.
1874 * pt.c (push_template_decl_real): Assert no surprising friend
1875 functions. Rename to ...
1876 (push_template_decl): ... here. Delete original function.
1877 (lookup_template_class_1): Drop default args from pushtag.
1878 (instantiate_class_template_1): Likewise.
1879 * ptree.c (debug_overload): Print hidden and using markers.
1880 * rtti.c (init_rtti_processing): Drop refault args from xref_tag.
1881 (build_dynamic_cast_1, tinfo_base_init): Likewise.
1882 * semantics.c (begin_class_definition): Drop default args to
1885 2020-09-24 Nathan Sidwell <nathan@acm.org>
1888 * pt.c (maybe_instantiate_noexcept): Local externs are never
1891 2020-09-23 Nathan Sidwell <nathan@acm.org>
1893 * name-lookup.h (typedef cxx_binding): Delete tdef.
1894 (typedef cp_binding_level): Likewise.
1895 (struct cxx_binding): Flags are bools.
1897 2020-09-23 Nathan Sidwell <nathan@acm.org>
1900 * pt.c (tsubst_copy) [FUNCTION_DECL,VAR_DECL]: Retrieve local
1901 specialization for DECL_LOCAL_P decls.
1903 2020-09-22 Patrick Palka <ppalka@redhat.com>
1906 * pt.c (corresponding_template_parameter): Define.
1907 (keep_template_parm): Use it to adjust the given template
1908 parameter to the corresponding in-scope one from ctx_parms.
1910 2020-09-22 Nathan Sidwell <nathan@acm.org>
1912 * cp-tree.h (xref_tag_from_type): Don't declare.
1913 * decl.c (xref_tag_from_type): Delete.
1914 * pt.c (lookup_template_class_1): Erroneously located class
1915 definitions just give error_mark, don't try and inject it into the
1918 2020-09-22 Jakub Jelinek <jakub@redhat.com>
1921 * constexpr.c (cxx_eval_builtin_function_call): Return void_node for
1922 calls to __sanitize_ptr_{sub,cmp} builtins.
1924 2020-09-22 Nathan Sidwell <nathan@acm.org>
1926 * pt.c (instantiate_class_template_1): Do not repush and unhide
1929 2020-09-21 Marek Polacek <polacek@redhat.com>
1933 * lambda.c (maybe_add_lambda_conv_op): Mark the conversion function
1936 2020-09-21 Marek Polacek <polacek@redhat.com>
1938 * pt.c (deduction_guides_for): Add a bool parameter. Set it.
1939 (do_class_deduction): Warn when CTAD succeeds but the type doesn't
1940 have any explicit deduction guides.
1942 2020-09-21 Nathan Sidwell <nathan@acm.org>
1944 * decl.c (xref_tag_1): Use IDENTIFIER_LAMBDA_P to detect lambdas.
1945 * lambda.c (begin_lambda_type): Use ts_current to push the tag.
1946 * name-lookup.h (enum tag_scope): Drop ts_lambda.
1948 2020-09-21 Marek Polacek <polacek@redhat.com>
1951 * decl.c (redeclaration_error_message): Detect a redeclaration of
1954 2020-09-19 Sandra Loosemore <sandra@codesourcery.com>
1956 * cp-gimplify.c (enum bc_t, bc_label): Move to c-family.
1957 (begin_bc_block, finish_bc_block, get_bc_label): Likewise.
1958 (genericize_cp_loop): Likewise.
1959 (genericize_for_stmt, genericize_while_stmt): Likewise.
1960 (genericize_do_stmt, genericize_switch_stmt): Likewise.
1961 (genericize_continue_stmt, genericize_break_stmt): Likewise.
1962 (genericize_omp_for_stmt): Likewise.
1963 (cp_genericize_r): Call c_genericize_control_stmt instead of
1964 above functions directly.
1965 (cp_genericize): Call save_bc_state and restore_bc_state instead
1966 of manipulating bc_label directly.
1967 * cp-objcp-common.c (cxx_block_may_fallthru): Defer to
1968 c_block_may_fallthru instead of handling SWITCH_STMT here.
1969 (cp_common_init_ts): Move handling of loop and switch-related
1970 statements to c-family.
1971 * cp-tree.def (FOR_STMT, WHILE_STMT, DO_STMT): Move to c-family.
1972 (BREAK_STMT, CONTINUE_STMT, SWITCH_STMT): Likewise.
1973 * cp-tree.h (LABEL_DECL_BREAK, LABEL_DECL_CONTINUE): Likewise.
1974 (WHILE_COND, WHILE_BODY): Likewise.
1975 (DO_COND, DO_BODY): Likewise.
1976 (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY, FOR_SCOPE): Likewise.
1977 (SWITCH_STMT_COND, SWITCH_STMT_BODY): Likewise.
1978 (SWITCH_STMT_TYPE, SWITCH_STMT_SCOPE): Likewise.
1979 (SWITCH_STMT_ALL_CASES_P, SWITCH_STMT_NO_BREAK_P): Likewise.
1980 * cxx-pretty-print.c (cxx_pretty_printer::statement): Move code
1981 to handle structured loop and switch tree nodes to c-family.
1982 * dump.c (cp_dump_tree): Likewise.
1984 2020-09-19 Patrick Palka <ppalka@redhat.com>
1988 * constraint.cc (map_arguments): Call template_parm_to_arg
1989 in the self-mapping case.
1990 (finish_shorthand_constraint): No need to build a TREE_LIST
1991 before calling template_parm_to_arg.
1992 * pt.c (template_parm_to_arg): Rewrite to handle TEMPLATE_PARM_P
1993 nodes as well as DECL_TEMPLATE_PARM_P nodes, and to make the
1994 overlying TREE_LIST node optional.
1995 (keep_template_parm): Don't record a BOUND_TEMPLATE_TEMPLATE_PARM,
1996 instead record its corresponding TEMPLATE_TEMPLATE_PARM.
1997 (convert_generic_types_to_packs): Don't call
1998 template_parm_to_arg.
2000 2020-09-19 Patrick Palka <ppalka@redhat.com>
2003 * constraint.cc (satisfy_atom): Pass true as the
2004 manifestly_const_eval argument to maybe_constant_value.
2006 2020-09-18 Jason Merrill <jason@redhat.com>
2009 * decl.c (complete_vars): Only call layout_var_decl if completing
2012 2020-09-18 Jason Merrill <jason@redhat.com>
2014 * decl.c (complete_vars): Call layout_var_decl.
2016 2020-09-17 Patrick Palka <ppalka@redhat.com>
2020 * constraint.cc (tsubst_requires_expr): Use REQUIRES_EXPR_PARMS
2021 and REQUIRES_EXPR_REQS. Use REQUIRES_EXPR_EXTRA_ARGS,
2022 add_extra_args and build_extra_args to defer substitution until
2023 we have all the template arguments.
2024 (finish_requires_expr): Adjust the call to build_min so that
2025 REQUIRES_EXPR_EXTRA_ARGS gets set to NULL_TREE.
2026 * cp-tree.def (REQUIRES_EXPR): Give it a third operand.
2027 * cp-tree.h (REQUIRES_EXPR_PARMS, REQUIRES_EXPR_REQS,
2028 REQUIRES_EXPR_EXTRA_ARGS): Define.
2029 (add_extra_args, build_extra_args): Declare.
2031 2020-09-16 Nathan Sidwell <nathan@acm.org>
2033 * cp-tree.h (cp_check_omp_declare_reduction): Return bool.
2034 * semantics.c (cp_check_omp_declare_reduction): Return true on for
2036 * pt.c (push_template_decl_real): OMP reductions do not get a
2038 (tsubst_function_decl): Remove special casing for local decl omp
2040 (tsubst_expr): Call instantiate_body for a local omp reduction.
2041 (instantiate_body): Add nested_p parm, and deal with such
2043 (instantiate_decl): Reject FUNCTION_SCOPE entities, adjust
2044 instantiate_body call.
2046 2020-09-16 Nathan Sidwell <nathan@acm.org>
2048 * pt.c (instantiate_body): Remove 'nested' var, simplify
2051 2020-09-16 Nathan Sidwell <nathan@acm.org>
2053 * pt.c (instantiate_body): New, broken out of ..
2054 (instantiate_decl): ... here. Call it.
2056 2020-09-15 Nathan Sidwell <nathan@acm.org>
2058 * pt.c (push_template_decl_real): OMP reductions retain a template
2060 (tsubst_function_decl): Likewise.
2062 2020-09-15 Tobias Burnus <tobias@codesourcery.com>
2065 * cp-gimplify.c (cxx_omp_finish_clause): Add bool openacc arg.
2066 * cp-tree.h (cxx_omp_finish_clause): Likewise
2067 * semantics.c (handle_omp_for_class_iterator): Update call.
2069 2020-09-14 Marek Polacek <polacek@redhat.com>
2071 * pt.c (push_template_decl_real): Use VAR_OR_FUNCTION_DECL_P.
2073 2020-09-14 Nathan Sidwell <nathan@acm.org>
2075 * pt.c (push_template_decl_real): Don't attach a template head to
2077 (tsubst_function_decl): Add support for headless local extern
2079 (tsubst_decl): Add support for headless local extern decls.
2081 2020-09-11 Nathan Sidwell <nathan@acm.org>
2083 * decl.c (grokfndecl): Don't attach to local extern.
2085 2020-09-11 Nathan Sidwell <nathan@acm.org>
2087 * parser.c (cp_parser_objc_method_definition_list): Reimplement
2088 loop, make sure we pop scope.
2090 2020-09-11 Marek Polacek <polacek@redhat.com>
2092 * cp-tree.h (LOOKUP_CONSTINIT): Remove.
2093 (LOOKUP_REWRITTEN): Adjust.
2094 * decl.c (duplicate_decls): Set DECL_DECLARED_CONSTINIT_P.
2095 (check_initializer): Use DECL_DECLARED_CONSTINIT_P instead of
2097 (cp_finish_decl): Don't set DECL_DECLARED_CONSTINIT_P. Use
2098 DECL_DECLARED_CONSTINIT_P instead of LOOKUP_CONSTINIT.
2099 (grokdeclarator): Set DECL_DECLARED_CONSTINIT_P.
2100 * decl2.c (grokfield): Don't handle LOOKUP_CONSTINIT.
2101 * parser.c (cp_parser_decomposition_declaration): Remove
2102 LOOKUP_CONSTINIT handling.
2103 (cp_parser_init_declarator): Likewise.
2104 * pt.c (tsubst_expr): Likewise.
2105 (instantiate_decl): Likewise.
2106 * typeck2.c (store_init_value): Use DECL_DECLARED_CONSTINIT_P instead
2107 of LOOKUP_CONSTINIT.
2109 2020-09-10 Nathan Sidwell <nathan@acm.org>
2111 * cp-tree.h (TINFO_VAR_DECLARED_CONSTINIT): Replace with ...
2112 (DECL_DECLARED_CONSTINIT_P): ... this.
2113 * decl.c (start_decl): No need to retrofit_lang_decl for constinit
2115 (cp_finish_decl): Use DECL_DECLARED_CONSTINIT_P.
2116 * pt.c (tsubst_decl): No need to handle constinit flag
2118 (tsubst_expr): Or here.
2120 2020-09-10 Nathan Sidwell <nathan@acm.org>
2122 * cp-tree.h (DECL_LOCAL_FUNCTION_P): Rename to ...
2123 (DECL_LOCAL_DECL_P): ... here. Accept both fns and vars.
2124 * decl.c (start_decl): Set DECL_LOCAL_DECL_P for local externs.
2125 (omp_declare_variant_finalize_one): Use DECL_LOCAL_DECL_P.
2126 (local_variable_p): Simplify.
2127 * name-lookup.c (set_decl_context_in_fn): Assert DECL_LOCAL_DECL_P
2128 is as expected. Simplify.
2129 (do_pushdecl): Don't set decl_context_in_fn for friends.
2130 (is_local_extern): Simplify.
2131 * call.c (equal_functions): Use DECL_LOCAL_DECL_P.
2132 * parser.c (cp_parser_postfix_expression): Likewise.
2133 (cp_parser_omp_declare_reduction): Likewise.
2134 * pt.c (check_default_tmpl_args): Likewise.
2135 (tsubst_expr): Assert nested reduction function is local.
2136 (type_dependent_expression_p): Use DECL_LOCAL_DECL_P.
2137 * semantics.c (finish_call_expr): Likewise.
2139 2020-09-09 Marek Polacek <polacek@redhat.com>
2142 * decl.c (reshape_init): If we're initializing a char array from
2143 a string-literal that is enclosed in braces, unwrap it.
2144 * init.c (build_new_1): Don't handle string-initializers here.
2145 (build_new): Handle new-expression with paren-init when the
2146 array bound is known. Always pass string constants to build_new_1
2147 enclosed in braces. Don't handle string-initializers in any
2150 2020-09-09 Marek Polacek <polacek@redhat.com>
2153 * decl.c (reshape_init_r): When initializing an aggregate member
2154 with an initializer from an initializer-list, also consider
2157 2020-09-09 Nathan Sidwell <nathan@acm.org>
2159 * parser.c (cp_parser_omp_declare_reduction): Refactor to avoid
2160 code duplication. Update DECL_TI_TEMPLATE's context.
2161 * pt.c (tsubst_expr): For OMP reduction function, set context to
2162 global_namespace before pushing.
2163 (tsubst_omp_udr): Assert current_function_decl, add comment about
2166 2020-09-09 Patrick Palka <ppalka@redhat.com>
2169 * class.c (resolve_address_of_overloaded_function): Check
2170 constraints_satisfied_p and perform return-type deduction via
2171 maybe_instantiate_decl when considering non-template functions
2172 in the overload set.
2173 * cp-tree.h (maybe_instantiate_decl): Declare.
2174 * decl2.c (maybe_instantiate_decl): Remove static.
2176 2020-09-04 Jason Merrill <jason@redhat.com>
2178 * expr.c (mark_use): Use iloc_sentinel.
2180 2020-09-03 Jakub Jelinek <jakub@redhat.com>
2183 * constexpr.c (fundef_copies_table): Change type from
2184 hash_map<tree, tree> * to decl_tree_map *.
2186 2020-09-03 Marek Polacek <polacek@redhat.com>
2189 * cp-tree.h (do_aggregate_paren_init): Declare.
2190 * decl.c (do_aggregate_paren_init): New.
2191 (grok_reference_init): Use it.
2192 (check_initializer): Likewise.
2193 * init.c (perform_member_init): Handle initializing an array from
2194 a ()-list. Use do_aggregate_paren_init.
2196 2020-09-03 Jakub Jelinek <jakub@redhat.com>
2199 * constexpr.c (cxx_eval_outermost_constant_expr): Temporarily disable
2200 flag_rounding_math during manifestly constant evaluation.
2202 2020-09-01 Marek Polacek <polacek@redhat.com>
2205 * init.c (build_new_1): Call reshape_init.
2207 2020-09-01 Jakub Jelinek <jakub@redhat.com>
2210 * semantics.c (handle_omp_array_sections_1): Test
2211 DECL_ARRAY_PARAMETER_P only on PARM_DECLs.
2213 2020-08-31 Marek Polacek <polacek@redhat.com>
2214 Jason Merrill <jason@redhat.com>
2217 * call.c (build_new_method_call_1): Use build_constructor_from_vec
2218 instead of build_tree_list_vec + build_constructor_from_list.
2219 * init.c (build_new_1): Handle new char[]{"foo"}. Use
2220 build_constructor_from_vec instead of build_tree_list_vec +
2221 build_constructor_from_list.
2222 (build_new): Deduce the array size in new-expression if not
2223 present. Handle ()-init. Handle initializing an array from
2225 * parser.c (cp_parser_new_type_id): Leave [] alone.
2226 (cp_parser_direct_new_declarator): Allow [].
2227 * pt.c (type_dependent_expression_p): In a NEW_EXPR, consider
2228 array types whose dimension has to be deduced type-dependent.
2230 2020-08-27 Martin Liska <mliska@suse.cz>
2232 * class.c (build_vtbl_initializer): Set exact argument of a vector
2233 growth function to true.
2234 * constraint.cc (get_mapped_args): Likewise.
2235 * decl.c (cp_maybe_mangle_decomp): Likewise.
2236 (cp_finish_decomp): Likewise.
2237 * parser.c (cp_parser_omp_for_loop): Likewise.
2238 * pt.c (canonical_type_parameter): Likewise.
2239 * rtti.c (get_pseudo_ti_init): Likewise.
2241 2020-08-26 Nathan Sidwell <nathan@acm.org>
2243 * decl.c (poplevel): A local-binding tree list holds the name in
2245 * name-lookup.c (update_local_overload): Add id to TREE_PURPOSE.
2246 (lookup_name_1): Deal with local-binding error_mark_node marker.
2247 (op_unqualified_lookup): Return error_mark_node for 'nothing
2248 found'. Retain global binding, check class binding here.
2249 (maybe_save_operator_binding): Reimplement to always cache a
2251 (push_operator_bindings): Deal with 'ignore' marker.
2253 2020-08-25 Tobias Burnus <tobias@codesourcery.com>
2256 * semantics.c (handle_omp_array_sections_1): Talk about
2257 array function parameter in the error message.
2259 2020-08-25 Jakub Jelinek <jakub@redhat.com>
2262 * cp-tree.h (build_trivial_dtor_call): Add bool argument defaulted
2264 * call.c (build_trivial_dtor_call): Add NO_PTR_DEREF argument. If
2265 instance is a pointer and NO_PTR_DEREF is true, clobber the pointer
2266 rather than what it points to.
2267 * semantics.c (finish_call_expr): Call build_trivial_dtor_call with
2268 true as NO_PTR_DEREF.
2270 2020-08-25 Jason Merrill <jason@redhat.com>
2273 * optimize.c (populate_clone_array): Revert PR70462 change.
2274 (maybe_clone_body): Likewise.
2276 2020-08-24 Nathan Sidwell <nathan@acm.org>
2278 * ptree.c (debug_overload): New.
2280 2020-08-19 Jason Merrill <jason@redhat.com>
2283 * cp-tree.h (push_tinst_level, push_tinst_level_loc): Declare.
2284 * constraint.cc (satisfy_declaration_constraints):
2285 Use add_outermost_template_args and push_tinst_level.
2286 * pt.c (add_outermost_template_args): Handle getting
2287 a TEMPLATE_DECL as the first argument.
2288 (push_tinst_level, push_tinst_level_loc): No longer static.
2289 (fn_type_unification): Check satisfaction before non-dependent
2292 2020-08-18 Nathan Sidwell <nathan@acm.org>
2294 * cp-tree.h (SET_TYPE_TEMPLTE_INFO): Do not deal with ALIAS templates.
2295 * pt.c (lookup_template_class_1): Special-case alias template
2296 template_info setting.
2298 2020-08-18 Jason Merrill <jason@redhat.com>
2301 * pt.c (tsubst_aggr_type): Rewrite in C++17, too.
2302 (maybe_dependent_member_ref): Likewise.
2303 (build_deduction_guide): Re-substitute template parms.
2304 * cp-tree.h (struct push_nested_class_guard): New.
2305 * constraint.cc (get_normalized_constraints_from_decl): Use it.
2307 2020-08-18 Jason Merrill <jason@redhat.com>
2310 * pt.c (maybe_dependent_member_ref): New.
2311 (tsubst_copy) [CONST_DECL]: Use it.
2312 [VAR_DECL]: Likewise.
2313 (tsubst_aggr_type): Handle nested type.
2315 2020-08-18 Nathan Sidwell <nathan@acm.org>
2317 * name-lookup.c (qualify_lookup): Drop lambda checking here.
2318 Reorder namespace & type checking.
2319 (lookup_name_1): Do hidden lambda checking here.
2321 2020-08-14 Nathan Sidwell <nathan@acm.org>
2323 * name-lookup.h (lookup_name_real, lookup_name_nonclass): Rename
2325 (lookup_name): ... these new overloads.
2326 * name-lookup.c (identifier_type_value_1): Rename lookup_name_real
2328 (lookup_name_real_1): Rename to ...
2329 (lookup_name_1): ... here.
2330 (lookup_name_real): Rename to ...
2331 (lookup_name): ... here. Rename lookup_name_real_1 call.
2332 (lookup_name_nonclass): Delete.
2333 * call.c (build_operator_new_call): Rename lookup_name_real call.
2334 (add_operator_candidates): Likewise.
2335 (build_op_delete_call): Rename lookup_name_nonclass call.
2336 * parser.c (cp_parser_lookup_name): Likewise.
2337 * pt.c (tsubst_friend_class, lookup_init_capture_pack): Likewise.
2338 (tsubst_expr): Likewise.
2339 * semantics.c (capture_decltype): Likewise.
2341 2020-08-14 Nathan Sidwell <nathan@acm.org>
2343 * cp-tree.h (LOOKUP_HIDDEN): Delete.
2344 (LOOKUP_PREFER_RVALUE): Adjust initializer.
2345 * name-lookup.h (enum class LOOK_want): Add HIDDEN_FRIEND and
2346 HIDDEN_LAMBDA flags.
2347 (lookup_name_real): Drop flags parm.
2348 (lookup_qualified_name): Drop find_hidden parm.
2349 * name-lookup.c (class name_lookup): Drop hidden field, adjust
2351 (name_lookup::add_overload): Check want for hiddenness.
2352 (name_lookup::process_binding): Likewise.
2353 (name_lookup::search_unqualified): Likewise.
2354 (identifier_type_value_1): Adjust lookup_name_real call.
2355 (set_decl_namespace): Adjust name_lookup ctor.
2356 (qualify_lookup): Drop flags parm, use want for hiddenness.
2357 (lookup_qualified_name): Drop find_hidden parm.
2358 (lookup_name_real_1): Drop flags parm, adjust qualify_lookup
2360 (lookup_name_real): Drop flags parm.
2361 (lookup_name_nonclass, lookup_name): Adjust lookup_name_real
2363 (lookup_type_scope_1): Adjust qualify_lookup calls.
2364 * call.c (build_operator_new_call): Adjust lookup_name_real call.
2365 (add_operator_candidates): Likewise.
2366 * coroutines.cc (morph_fn_to_coro): Adjust lookup_qualified_name
2368 * parser.c (cp_parser_lookup_name): Adjust lookup_name_real calls.
2369 * pt.c (check_explicit_specialization): Adjust
2370 lookup_qualified_name call.
2371 (deduction_guides_for): Likewise.
2372 (tsubst_friend_class): Adjust lookup_name_real call.
2373 (lookup_init_capture_pack): Likewise.
2374 (tsubst_expr): Likewise, don't look in namespaces.
2375 * semantics.c (capture_decltype): Adjust lookup_name_real. Don't
2378 2020-08-14 Jason Merrill <jason@redhat.com>
2382 * cp-tree.h (unsafe_return_slot_p): Declare.
2383 * call.c (is_base_field_ref): Rename to unsafe_return_slot_p.
2384 (build_over_call): Check unsafe_return_slot_p.
2385 (build_special_member_call): Likewise.
2386 * init.c (expand_default_init): Likewise.
2387 * typeck2.c (split_nonconstant_init_1): Likewise.
2389 2020-08-14 Nathan Sidwell <nathan@acm.org>
2391 * cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES)
2392 (LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY)
2393 (LOOKUP_QUALIFIERS_ONL): Delete.
2394 (LOOKUP_HIDDEN): Adjust.
2395 * name-lookup.h (enum class LOOK_want): New.
2396 (operator|, operator&): Overloads for it.
2397 (lookup_name_real): Replace prefer_type & namespaces_only with
2399 (lookup_qualified_name): Replace prefer_type with LOOK_want.
2400 (lookup_name_prefer_type): Replace with ...
2401 (lookup_name): ... this. New overload with LOOK_want parm.
2402 * name-lookup.c (struct name_lookup): Replace flags with want and
2403 hidden fields. Adjust constructors.
2404 (name_lookyp::add_overload): Correct hidden stripping test. Update
2405 for new LOOK_want type.
2406 (name_lookup::process_binding): Likewise.
2407 (name_lookup::search_unqualified): Use hidden flag.
2408 (identifier_type_value_1): Adjust lookup_name_real call.
2409 (set_decl_namespace): Adjust name_lookup ctor.
2410 (lookup_flags): Delete.
2411 (qualify_lookup): Add LOOK_want parm, adjust.
2412 (lookup_qualified_name): Replace prefer_type parm with LOOK_want.
2413 (lookup_name_real_1): Replace prefer_type and namespaces_only with
2415 (lookup_name_real): Likewise.
2416 (lookup_name_nonclass, lookup_name): Adjust lookup_name_real call.
2417 (lookup_name_prefer_type): Rename to ...
2418 (lookup_name): ... here. New overload with LOOK_want parm.
2419 (lookup_type_scope_1): Adjust qualify_lookup calls.
2420 * call.c (build_operator_new_call)
2421 (add_operator_candidates): Adjust lookup_name_real calls.
2422 * coroutines.cc (find_coro_traits_template_decl)
2423 (find_coro_handle_template_decl, morph_fn_to_coro): Adjust
2424 lookup_qualified_name calls.
2425 * cp-objcp-common.c (identifier_global_tag): Likewise.
2426 * decl.c (get_tuple_size, get_tuple_decomp_init): Likewise.
2427 (lookup_and_check_tag): Use lookup_name overload.
2428 * parser.c (cp_parser_userdef_numeric_literal): Adjust
2429 lookup_qualified_name call.
2430 (prefer_arg_type): Drop template_mem_access parm, return LOOK_want
2432 (cp_parser_lookup_name): Adjust lookup_member, lookup_name_real
2434 * pt.c (check_explicit_specialization): Adjust lookup_qualified_name
2436 (tsubst_copy_and_build, tsubst_qualified_name): Likewise
2437 (deduction_guides_for): Likewise.
2438 (tsubst_friend_class): Adjust lookup_name_real call.
2439 (lookup_init_capture, tsubst_expr): Likewise.
2440 * rtti.c (emit_support_tinfos): Adjust lookup_qualified_name call.
2441 * semantics.c (omp_reduction_lookup): Likewise.
2442 (capture_decltype): Adjust lookup_name_real call.
2444 2020-08-13 Nathan Sidwell <nathan@acm.org>
2446 * name-lookup.h (enum class LOOK_where): New.
2447 (operator|, operator&): Overloads for it.
2448 (lookup_name_real): Replace NONCLASS & BLOCK_P parms with WHERE.
2449 * name-lookup.c (identifier_type_value_w): Adjust
2450 lookup_name_real call.
2451 (lookup_name_real_1): Replace NONCLASS and BLOCK_P parameters
2452 with WHERE bitmask. Don't search namespaces if not asked to.
2453 (lookup_name_real): Adjust lookup_name_real_1 call.
2454 (lookup_name_nonclass, lookup_name)
2455 (lookup_name_prefer_type): Likewise.
2456 * call.c (build_operator_new_call)
2457 (add_operator_candidates): Adjust lookup_name_real calls.
2458 * parser.c (cp_parser_lookup_name): Likewise.
2459 * pt.c (tsubst_friend_class, lookup_init_capture_pack)
2460 (tsubst_expr): Likewise.
2461 * semantics.c (capture_decltype): Likewise.
2463 2020-08-13 Marek Polacek <polacek@redhat.com>
2466 * typeck.c (build_static_cast_1): Implement P1975R0 by allowing
2467 static_cast to aggregate type.
2469 2020-08-10 Jakub Jelinek <jakub@redhat.com>
2472 * constexpr.c (cxx_eval_binary_expression): For SPACESHIP_EXPR, tail
2473 call cxx_eval_constant_expression after genericize_spaceship to avoid
2474 undesirable further VERIFY_CONSTANT.
2476 2020-08-10 Patrick Palka <ppalka@redhat.com>
2478 * pt.c (resolve_overloaded_unification): Drop functions with
2479 unsatisfied constraints.
2480 (resolve_nondeduced_context): Likewise.
2482 2020-08-05 Patrick Palka <ppalka@redhat.com>
2483 Jason Merrill <jason@redhat.com>
2486 * constexpr.c (cxx_eval_vec_init_1): Truncate ctx->ctor and
2487 then clear CONSTRUCTOR_NO_CLEARING on each appended element
2488 initializer if we're initializing a previously zero-initialized
2491 2020-08-04 Marek Polacek <polacek@redhat.com>
2494 * parser.c (cp_parser_elaborated_type_specifier): Allow
2495 'template' following ::.
2497 2020-08-04 Nathan Sidwell <nathan@acm.org>
2499 * parser.c (cp_parser_explicit_specialization): Refactor
2500 to avoid leak of num_template_parameter_lists value.
2502 2020-08-04 Patrick Palka <ppalka@redhat.com>
2505 * init.c (sort_mem_initializers): Preserve TREE_TYPE of the
2506 member initializer list node.
2507 (emit_mem_initializers): Set input_location when performing each
2508 member initialization.
2509 * parser.c (cp_parser_mem_initializer): Attach the source
2510 location of this initializer to a dummy EMPTY_CLASS_EXPR
2511 within the TREE_TYPE of the list node.
2512 * pt.c (tsubst_initializer_list): Preserve TREE_TYPE of the
2513 member initializer list node.
2515 2020-08-03 Marek Polacek <polacek@redhat.com>
2517 * cp-tree.h (after_nsdmi_defaulted_late_checks): Remove.
2519 2020-08-03 Marek Polacek <polacek@redhat.com>
2523 * pt.c (check_default_tmpl_args): Also consider variable
2526 2020-07-31 Jakub Jelinek <jakub@redhat.com>
2529 * decl.c (finish_function): In constexpr functions use for C++14 and
2530 later error instead of warning if no return statement is present and
2531 diagnose it regardless of warn_return_type. Move the warn_return_type
2532 diagnostics earlier in the function.
2534 2020-07-31 Martin Sebor <msebor@redhat.com>
2537 * class.c (build_base_path): Set no-warning bit on the synthesized
2538 conditional expression in static_cast.
2540 2020-07-31 Richard Biener <rguenther@suse.de>
2543 * cp-objcp-common.h (LANG_HOOKS_FINALIZE_EARLY_DEBUG):
2544 Define to c_common_finalize_early_debug.
2546 2020-07-31 Patrick Palka <ppalka@redhat.com>
2549 * constexpr.c (cxx_eval_constant_expression) <case CONST_DECL>:
2550 Pass false to decl_constant_value and decl_really_constant_value
2551 so that they don't unshare their result.
2552 * cp-tree.h (decl_constant_value): New declaration with an added
2554 (decl_really_constant_value): Add bool parameter defaulting to
2555 true to existing declaration.
2556 * init.c (constant_value_1): Add bool parameter which controls
2557 whether to unshare the initializer before returning. Call
2558 unshare_expr at most once.
2559 (scalar_constant_value): Pass true to constant_value_1's new
2561 (decl_really_constant_value): Add bool parameter and forward it
2562 to constant_value_1.
2563 (decl_constant_value): Likewise, but instead define a new
2564 overload with an added bool parameter.
2566 2020-07-30 Patrick Palka <ppalka@redhat.com>
2569 * pt.c (resolve_overloaded_unification): If the function
2570 template specialization has a placeholder return type,
2571 then instantiate it before attempting unification.
2573 2020-07-30 Patrick Palka <ppalka@redhat.com>
2576 * pt.c (alias_ctad_tweaks): Call remove_constraints before
2577 calling set_constraints.
2579 2020-07-30 Patrick Palka <ppalka@redhat.com>
2582 * pt.c (reduce_template_parm_level): Propagate DECL_VIRTUAL_P
2583 from the original TEMPLATE_PARM_DECL to the new lowered one.
2585 2020-07-30 Patrick Palka <ppalka@redhat.com>
2588 * constraint.cc (constraints_satisfied_p): Return true if
2590 * pt.c (do_type_instantiation): Update a paragraph taken from
2591 [temp.explicit] to reflect the latest specification. Don't
2592 instantiate a member with unsatisfied constraints.
2594 2020-07-29 Jason Merrill <jason@redhat.com>
2597 * cp-tree.h (IMPLICIT_RVALUE_P): New.
2598 (enum cp_lvalue_kind_flags): Add clk_implicit_rval.
2599 (implicit_rvalue_p, set_implicit_rvalue_p): New.
2600 * call.c (reference_binding): Check clk_implicit_rval.
2601 (build_over_call): Adjust C++20 implicit move.
2602 * coroutines.cc (finish_co_return_stmt): Simplify implicit move.
2603 * except.c (build_throw): Adjust C++20 implicit move.
2604 * pt.c (tsubst_copy_and_build) [STATIC_CAST_EXPR]: Propagate
2606 * tree.c (lvalue_kind): Set clk_implicit_rval.
2607 * typeck.c (treat_lvalue_as_rvalue_p): Overhaul.
2608 (maybe_warn_pessimizing_move): Adjust.
2609 (check_return_expr): Adjust C++20 implicit move.
2611 2020-07-29 Jason Merrill <jason@redhat.com>
2614 * call.c (build_over_call): Don't call a const ref
2615 overload for implicit move.
2617 2020-07-28 Nathan Sidwell <nathan@acm.org>
2619 * cp-gimplify.c (cp_genericize_r): Set IMPORTED_DECL's context.
2620 * cp-objcp-common.c (cp_pushdecl): Set decl's context.
2621 * decl.c (grokfndecl): Make DECL_CONTEXT setting clearer.
2623 2020-07-28 Nathan Sidwell <nathan@acm.org>
2625 * class.c (fixup_type_variants): Copy TYPE_SIZE and
2627 (finish_struct): Call it.
2629 2020-07-28 Nathan Sidwell <nathan@acm.org>
2631 * ptree.c (cxx_print_decl): Better indentation.
2633 2020-07-28 Jakub Jelinek <jakub@redhat.com>
2634 Mark Wielaard <mark@klomp.org>
2637 * parser.c (cp_lexer_safe_previous_token): Don't call
2638 cp_lexer_previous_token, instead inline it by hand and return NULL
2639 instead of failing assertion if all previous tokens until the first
2641 (cp_parser_error_1): Optimize - only call cp_lexer_safe_previous_token
2642 if token->type is CPP_NAME. Use cp_lexer_safe_previous_token instead
2643 of cp_lexer_previous_token for the missing_token_desc != RT_NONE
2646 2020-07-27 Nathan Sidwell <nathan@acm.org>
2648 * cp-tree.h (enum cp_tree_index): Add CPTI_AS_BASE_IDENTIFIER.
2649 (as_base_identifier): Define.
2650 * decl.c (initialize_predifined_identifiers): Initialize as_base
2652 * class.c (layout_class_type): Name the as-base type. Zap
2653 NSDMI its fields may have.
2655 2020-07-22 Nathan Sidwell <nathan@acm.org>
2657 * class.c (maybe_add_class_template_decl_list): Don't add CONST_DECLs.
2659 2020-07-22 Nathan Sidwell <nathan@acm.org>
2661 * typeck.c (structural_comptypes): [DECLTYPE_TYPE] break
2663 [UNDERLYING_TYPE]: Use an if.
2666 2020-07-22 Nathan Sidwell <nathan@acm.org>
2668 * decl.c (decls_match): Move variables into scopes
2670 (duplicate_decls): Use STRIP_TEMPLATE.
2671 (build_typename_type): Move var decls to their assignments.
2672 (begin_function_body): Likewise.
2673 * decl2.c (get_guard): Likewise.
2674 (mark_used): Use true for truthiness.
2675 * error.c (dump_aggr_type): Hold the decl in a var called
2678 2020-07-22 Nathan Sidwell <nathan@acm.org>
2680 * cp-tree.h (struct tree_lambda_expr): Shrink
2681 default_capture_mode & discriminator.
2683 2020-07-22 Nathan Sidwell <nathan@acm.org>
2685 * mangle.c (decl_is_template_id): Rename to ...
2686 (maybe_template_info): ... here. Return the template info,
2687 rather than use a pointer. Adjust all callers.
2688 (find_substitution): Use template_args_equal, rather than
2691 2020-07-22 Tobias Burnus <tobias@codesourcery.com>
2693 * parser.c (cp_parser_omp_clause_hint): Require nonnegative hint.
2694 (cp_parser_omp_critical): Permit hint(0) clause without named critical.
2695 * pt.c (tsubst_expr): Re-check the latter for templates.
2697 2020-07-21 Sunil K Pandey <skpgkp2@gmail.com>
2700 * decl.c (cp_finish_decl): Call target hook
2701 lower_local_decl_alignment to lower local decl alignment.
2703 2020-07-21 Nathan Sidwell <nathan@acm.org>
2705 * parser.c (cp_lexer_consume_token): Drop PRAGMA_EOL assert.
2706 (cp_parser_skip_to_closing_parenthesis_1): Only pass start token
2707 to pragma skipper if recovering.
2708 (cp_parser_skip_to_pragma_eol): Only purge and change pragma
2709 state when recovering.
2711 2020-07-20 Jason Merrill <jason@redhat.com>
2713 * pt.c (type_dependent_expression_p): A pseudo-dtor can be
2715 * semantics.c (finish_call_expr): Use build_trivial_dtor_call for
2717 (finish_pseudo_destructor_expr): Leave type NULL for dependent arg.
2719 2020-07-20 Jason Merrill <jason@redhat.com>
2721 * mangle.c (write_base_ref): New.
2722 (write_expression): Use it for base field COMPONENT_REFs.
2723 * pt.c (invalid_tparm_referent_p): Canonicalize the type
2724 of array offsets. Allow subobjects.
2726 2020-07-20 Jason Merrill <jason@redhat.com>
2728 * pt.c (collect_ctor_idx_types): Add 'const' when deducing from
2731 2020-07-17 Marek Polacek <polacek@redhat.com>
2734 * decl.c (grokdeclarator): Detect cv-qual decltype(auto).
2735 * pt.c (do_auto_deduction): Likewise.
2737 2020-07-16 Iain Sandoe <iain@sandoe.co.uk>
2744 * coroutines.cc (struct coro_ret_data): Delete.
2745 (coro_maybe_expand_co_return): Delete.
2746 (co_return_expander): Delete.
2747 (expand_co_returns): Delete.
2748 (co_await_find_in_subtree): Remove unused name.
2749 (build_actor_fn): Remove unused parm, remove handling
2750 for co_return expansion.
2751 (register_await_info): Demote duplicate info message to a
2753 (coro_make_frame_entry): Move closer to use site.
2754 (struct susp_frame_data): Add fields for final suspend label
2755 and a flag to indicate await expressions with initializers.
2756 (captures_temporary): Delete.
2757 (register_awaits): Remove unused code, update comments.
2758 (find_any_await): New.
2759 (tmp_target_expr_p): New.
2760 (struct interesting): New.
2761 (find_interesting_subtree): New.
2762 (struct var_nest_node): New.
2763 (flatten_await_stmt): New.
2764 (handle_nested_conditionals): New.
2765 (process_conditional): New.
2766 (replace_statement_captures): Rename to...
2767 (maybe_promote_temps): ... this.
2768 (maybe_promote_captured_temps): Delete.
2769 (analyze_expression_awaits): Check for await expressions with
2770 initializers. Simplify handling for truth-and/or-if.
2771 (expand_one_truth_if): Simplify (map cases that need expansion
2773 (await_statement_walker): Handle CO_RETURN_EXPR. Simplify the
2774 handling for truth-and/or-if expressions.
2775 (register_local_var_uses): Ensure that we create names in the
2776 implementation namespace.
2777 (morph_fn_to_coro): Add final suspend label to suspend frame
2778 callback data and remove it from the build_actor_fn call.
2780 2020-07-16 Marek Polacek <polacek@redhat.com>
2782 * call.c (convert_like): Remove macro and introduce a new
2784 (convert_like_with_context): Likewise.
2785 (convert_like_real): Rename to convert_like.
2786 (convert_like_real_1): Rename to convert_like_internal. Call
2787 convert_like instead of convert_like_real therein.
2788 (perform_direct_initialization_if_possible): Call convert_like
2789 instead of convert_like_real.
2791 2020-07-16 Iain Sandoe <iain@sandoe.co.uk>
2793 * coroutines.cc: Correct some spelling errors
2796 2020-07-15 Nathan Sidwell <nathan@acm.org>
2798 * parser.c (cp_parser_declaration): Avoid copying tokens.
2799 (cp_parser_block_declaration): RAII token pointer.
2801 2020-07-15 Nathan Sidwell <nathan@acm.org>
2803 * parser.c (cp_parser_skip_to_closing_parenthesis_1): Deal with
2804 meeting a deferred pragma.
2805 (cp_parser_skip_to_end_of_statement): Likewise.
2806 (cp_parser_skip_to_end_of_block_or_statement): Likewise.
2807 (cp_parser_skip_to_pragma_eol): We should never meet EOF.
2808 (cp_parser_omp_declare_simd): Likewise.
2809 (cp_parser_omp_declare_reduction, cp_parser_oacc_routine)
2810 (pragma_lex): Likewise.
2812 2020-07-14 Marek Polacek <polacek@redhat.com>
2817 * call.c (convert_like_real_1): Renamed from convert_like_real.
2818 (convert_like_real): New wrapper for convert_like_real_1.
2820 2020-07-14 Nathan Sidwell <nathan@acm.org>
2822 * parser.c (cp_lexer_alloc): Do not deal with PCH here.
2823 (cp_lexer_new_main): Deal with PCH here. Store the tokens directly
2825 (cp_lexer_new_from_tokens): Assert last token isn't purged either.
2826 (cp_lexer_get_preprocessor_token): Change first arg to flags, adjust.
2827 (cp_parser_new): Pass the lexer in, don't create it here.
2828 (cp_parser_translation_unit): Initialize access checks here.
2829 (cp_parser_initial_pragma): First token is provided by caller,
2830 don't deal with PCH stopping here. Adjust error message.
2831 (c_parse_file): Adjust, change error message to avoid C++20 module
2834 2020-07-14 Nathan Sidwell <nathan@acm.org>
2836 * ptree.c (cxx_print_type): Add TYPEOF_TYPE and BASES.
2838 2020-07-14 Nathan Sidwell <nathan@acm.org>
2840 * class.c (build_base_field_1): Cache CLASSTYPE_AS_BASE.
2841 (build_self_reference): Rename value -> decl.
2842 (dump_class_hierarchy_1): Cache CLASSTYPE_AS_BASE.
2844 2020-07-14 Marek Polacek <polacek@redhat.com>
2847 * decl.c (grokdeclarator) <case cdk_function>: Check also
2848 pointers/references/... to functions.
2850 2020-07-14 Nathan Sidwell <nathan@acm.org>
2852 * cp-tree.h: Correct some tree lang flag comments,
2853 reformat some structure definitions. Note some structure
2854 sizes. Clarify some comments.
2855 (yyungetc): Delete. Not been a thing for some time.
2856 * class.c (copy_fndecl_with_name): Comment.
2857 (check_bases_and_members): Unnecessary {}.
2858 (layout_class_type): Comment.
2859 * cp-tree.def (UNBOUND_CLASS_TEMPLATE): Adjust comment.
2860 * decl.c: Fix some formatting & whitespace issues.
2861 (function_requirements_equivalent_p): Note why
2862 substitutions are needed.
2863 * decl2.c (no_linkage_error): Note that heroics about
2864 'typedef struct { ... };' are no longer needed.
2865 * method.c: Whitespace.
2866 * name-lookup.c: Whitespace.
2867 (add_decl_to_level): Reformat a line.
2868 (print_binding_stack): Mark as DEBUG_FUNCTION.
2869 (has_using_namespace_std_directive_p): Delete comment.
2871 * ptree.c: Whitespace.
2872 * rtti.c: Whitespace & comment.
2874 * typeck.c (structural_comptypes): Add comment.
2876 2020-07-13 Nathan Sidwell <nathan@acm.org>
2878 * Make-lang.in (c++.disclean): Likewise.
2880 2020-07-13 Marek Polacek <polacek@redhat.com>
2883 * parser.c (cp_parser_enum_specifier): Commit to tentative parse
2884 after we've seen an opening brace.
2886 2020-07-10 Jason Merrill <jason@redhat.com>
2888 * tree.c (structural_type_p): Allow unions.
2889 * mangle.c (write_expression): Express unions with a designator.
2891 2020-07-10 Jason Merrill <jason@redhat.com>
2893 * pt.c (convert_nontype_argument): Handle REAL_TYPE.
2894 (invalid_nontype_parm_type_p): Allow all structural types.
2895 * tree.c (structural_type_p): Use SCALAR_TYPE_P.
2897 2020-07-10 Jason Merrill <jason@redhat.com>
2902 * class.c (check_field_decls): An array of empty classes is not an
2904 (layout_empty_base_or_field): Handle explicit alignment.
2907 2020-07-09 Julian Brown <julian@codesourcery.com>
2908 Thomas Schwinge <thomas@codesourcery.com>
2911 * semantics.c (finish_omp_clauses): Likewise.
2913 2020-07-09 Patrick Palka <ppalka@redhat.com>
2916 * constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
2917 Restore dependent_type_p check that guarded the call to
2918 is_really_empty_class.
2920 2020-07-08 Patrick Palka <ppalka@redhat.com>
2923 * constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
2924 When processing_template_decl, check COMPLETE_TYPE_P before
2925 calling is_really_empty_class. Don't check dependent_type_p.
2927 2020-07-08 Marek Polacek <polacek@redhat.com>
2930 * parser.c (cp_parser_decltype): Print error about using decltype(auto)
2931 in C++11. Check that the token following "auto" is ")".
2933 2020-07-07 Patrick Palka <ppalka@redhat.com>
2936 * cxx-pretty-print.c (pp_cxx_unqualified_id): Check
2937 PRIMARY_TEMPLATE_P before printing the innermost template
2940 2020-07-07 Martin Sebor <msebor@redhat.com>
2943 * parser.c (class_decl_loc_t::diag_mismatched_tags): Print notes only
2944 if warning_at returns nonzero.
2946 2020-07-06 Martin Sebor <msebor@redhat.com>
2949 * call.c (build_over_call): Check calls only when tf_warning is set.
2951 2020-07-06 Nathan Sidwell <nathan@acm.org>
2953 * decl.c (push_library_fn): Return the decl pushdecl_toplevel returns.
2954 * except.c (verify_library_fn): Replace with ...
2955 (declare_library_fn_1): ... this fn. Always push the fn.
2956 (declare_library_fn): Call it.
2957 (build_throw): Call declare_library_fn_1.
2959 2020-07-06 Jonathan Wakely <jwakely@redhat.com>
2962 * parser.c (cp_parser_toplevel_declaration): Only do pedwarn for
2963 empty-declaration in C++98.
2965 2020-07-02 Jason Merrill <jason@redhat.com>
2966 Jakub Jelinek <jakub@redhat.com>
2968 * decl.c (grokfndecl): Allow consteval virtual.
2969 * search.c (check_final_overrider): Check consteval mismatch.
2970 * constexpr.c (cxx_eval_thunk_call): New.
2971 (cxx_eval_call_expression): Call it.
2972 * cvt.c (cp_get_fndecl_from_callee): Handle FDESC_EXPR.
2973 * decl2.c (mark_vtable_entries): Track vtables with consteval.
2974 (maybe_emit_vtables): Pass consteval_vtables through.
2975 (clear_consteval_vfns): Replace consteval with nullptr.
2976 (c_parse_final_cleanups): Call it.
2978 2020-07-01 Nathan Sidwell <nathan@acm.org>
2980 * class.c (copy_fndecl_with_name): Add additional predicate args, do
2981 not deduce them locally.
2982 (copy_operator_fn): Adjust copy_fndecl_with_name call.
2983 (build_clone): Add vtt and inherited predicate args. Pass through
2984 to copy_fndecl_with_name call.
2985 (build_cdtor_clones): Likewise, pass through to build_clone as
2987 (build_cdtor): Determine vtt and inherited here.
2988 * cp-tree.h (DECL_NEEDS_CTT_PARM_P): Delete.
2990 2020-06-30 Nathan Sidwell <nathan@acm.org>
2992 * cp-tree.h (copy_fndecl_with_name): Rename to ...
2993 (copy_operatorn_fn): ... this. Change arg type.
2994 (clone_function_decl): Rename to ...
2995 (clone_cdtor): ... this.
2996 * class.c (copy_fndecl_with_name): Make static.
2997 (copy_operator_fn): New wrapper.
2998 (build_clones): Rename to ...
2999 (build_cdtor_clones): ... this.
3000 (clone_function_decl): Rename to ...
3001 (clone_cdtor): ... this. Adjust build_clones calls.
3002 (clone_constructors_and_destructors): Adjust clone_function_decl
3004 * method.c (implicitly_declare_fn): Adjust copy_fndecl_with_name
3006 (lazily_declare_fn): Adjust clone_function_decl call.
3007 * pt.c (tsubst_function_decl): Likewise.
3008 (instantiate_template_1): Likewise.
3010 2020-06-30 Iain Sandoe <iain@sandoe.co.uk>
3012 * coroutines.cc (morph_fn_to_coro): Remove trailing
3013 space in a diagnostic.
3015 2020-06-30 Iain Sandoe <iain@sandoe.co.uk>
3017 * coroutines.cc (expand_one_await_expression): Remove
3018 code dealing with initial suspend.
3019 (build_actor_fn): Remove code special-casing initial
3020 and final suspend. Handle the final suspend and marking
3021 of the coroutine as done.
3022 (coro_rewrite_function_body): New.
3023 (bind_expr_find_in_subtree): Remove.
3024 (coro_body_contains_bind_expr_p): Remove.
3025 (morph_fn_to_coro): Split the rewrite of the original
3026 function into coro_rewrite_function_body and call it.
3028 2020-06-29 Marek Polacek <polacek@redhat.com>
3031 * decl.c (duplicate_decls): Make sure a concept or a variable
3032 template is unique in its declarative region.
3034 2020-06-29 Marek Polacek <polacek@redhat.com>
3037 * pt.c (collect_ctor_idx_types): Use TREE_TYPE.
3039 2020-06-28 Iain Sandoe <iain@sandoe.co.uk>
3042 * coroutines.cc (register_local_var_uses): Skip past
3045 2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
3048 * coroutines.cc (get_awaitable_var): New helper.
3049 (build_co_await): Check more carefully before
3050 copying an awaitable.
3051 (expand_one_await_expression): No initializer
3052 is required when the awaitable is not a temp.
3053 (register_awaits): Remove handling that is now
3054 completed when the await expression is built.
3056 2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
3058 * coroutines.cc (morph_fn_to_coro): Diagnose unavailable
3059 get_return_object_on_allocation_failure.
3061 2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
3064 * coroutines.cc (struct coroutine_info):Add a field
3065 to hold computed p.return_void expressions.
3066 (coro_build_promise_expression): New.
3067 (get_coroutine_return_void_expr): New.
3068 (finish_co_yield_expr): Build the promise expression
3069 using coro_build_promise_expression.
3070 (finish_co_return_stmt): Likewise.
3071 (build_init_or_final_await): Likewise.
3072 (morph_fn_to_coro): Likewise, for several cases.
3074 2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
3076 * coroutines.cc (morph_fn_to_coro): Handle error
3077 returns in building g-r-o-o-a-f expressions.
3079 2020-06-24 Nicholas Krause <xerofoify@gmail.com>
3082 * typeck2.c (cxx_incomplete_type_diagnostic): Add missing
3083 TYPE_EXPANSION_PACK check for diagnosing incomplete types in
3084 cxx_incomplete_type_diagnostic.
3086 2020-06-24 Iain Sandoe <iain@sandoe.co.uk>
3090 * coroutines.cc (act_des_fn): Copy function
3091 attributes onto the outlined coroutine helpers.
3093 2020-06-24 Jason Merrill <jason@redhat.com>
3095 * call.c (build_over_call): Only call build_base_path once.
3097 2020-06-24 Jason Merrill <jason@redhat.com>
3100 * call.c (build_over_call): Look up the overrider in base_binfo.
3101 * class.c (lookup_vfn_in_binfo): Look through BINFO_PRIMARY_P.
3103 2020-06-23 Jason Merrill <jason@redhat.com>
3106 Implement C++20 P2082R1, Fixing CTAD for aggregates.
3107 * cp-tree.h (TPARMS_PRIMARY_TEMPLATE): Split out from...
3108 (DECL_PRIMARY_TEMPLATE): ...here.
3109 (builtin_guide_p): Declare.
3110 * decl.c (reshape_init_class): Handle bases of a template.
3111 (reshape_init_r): An array with dependent bound takes a single
3113 * pt.c (tsubst_default_argument): Shortcut {}.
3114 (unify_pack_expansion): Allow omitted arguments to trailing pack.
3115 (builtin_guide_p): New.
3116 (collect_ctor_idx_types): Give a trailing pack a {} default
3117 argument. Handle arrays better.
3119 2020-06-23 Iain Sandoe <iain@sandoe.co.uk>
3122 * coroutines.cc (morph_fn_to_coro): Apply a cleanup to
3123 the get return object when the DTOR is non-trivial.
3125 2020-06-20 Iain Sandoe <iain@sandoe.co.uk>
3128 * coroutines.cc (morph_fn_to_coro): Update handling of
3129 get-return-object-on-allocation-fail and diagnose missing
3132 2020-06-20 Jason Merrill <jason@redhat.com>
3134 * call.c (joust): Only compare constraints for non-template
3135 candidates with matching parameters.
3136 * pt.c (tsubst_pack_expansion): Fix getting a type parameter
3138 (more_specialized_fn): Only compare constraints for candidates with
3139 matching parameters.
3141 2020-06-19 Jason Merrill <jason@redhat.com>
3143 * method.c (early_check_defaulted_comparison): Allow defaulting
3144 comparison outside class. Complain if non-member operator isn't a
3147 2020-06-18 Jason Merrill <jason@redhat.com>
3149 * method.c (early_check_defaulted_comparison): Check for &&.
3150 (build_comparison_op): Allow empty union. Diagnose non-category
3152 (common_comparison_type): Remove handling for non-category type.
3154 2020-06-18 Marek Polacek <polacek@redhat.com>
3157 * pt.c (finish_template_variable): Return if
3158 coerce_innermost_template_parms return error_mark_node.
3160 2020-06-18 Marek Polacek <polacek@redhat.com>
3163 * pt.c (tsubst_copy_and_build) <case NEW_EXPR>: Return error_mark_node
3164 if placement is erroneous.
3166 2020-06-17 Jonathan Wakely <jwakely@redhat.com>
3169 * parser.c (cp_parser_elaborated_type_specifier): Do not warn
3170 unless in a declaration.
3172 2020-06-17 Jason Merrill <jason@redhat.com>
3174 * cp-tree.h (copy_fndecl_with_name): Declare.
3175 * class.c (copy_fndecl_with_name): Split out from...
3176 (build_clone): ...here.
3177 (add_implicitly_declared_members): Add op== to TYPE_FIELDS.
3178 * method.c (implicitly_declare_fn): Use copy_fndecl_with_name.
3180 2020-06-17 Jason Merrill <jason@redhat.com>
3182 * call.c (build_new_op_1): Don't look for a CALL_EXPR when
3183 calling a consteval function.
3185 2020-06-17 Jason Merrill <jason@redhat.com>
3187 * decl2.c (grokfield): Pass SD_DEFAULTED and SD_DELETED.
3188 * decl.c (duplicate_decls): Reduce error for delete
3189 after earlier declaration to pedwarn.
3191 2020-06-17 Marek Polacek <polacek@redhat.com>
3194 * constexpr.c (maybe_fold_non_dependent_expr): New.
3195 * cp-tree.h (maybe_fold_non_dependent_expr): Declare.
3196 * typeck.c (cp_build_array_ref): Call maybe_fold_non_dependent_expr
3197 instead of maybe_constant_value.
3199 2020-06-16 Marek Polacek <polacek@redhat.com>
3202 * call.c (add_list_candidates): Return if a designated initializer
3203 is used with a non-aggregate.
3204 (implicit_conversion_error): Give an error for the case above.
3206 2020-06-16 Marek Polacek <polacek@redhat.com>
3209 * name-lookup.c (check_local_shadow): Check if types are
3210 non-null before calling same_type_p.
3212 2020-06-16 Jakub Jelinek <jakub@redhat.com>
3214 * semantics.c (handle_omp_for_class_iterator): Adjust
3215 c_omp_check_loop_iv_exprs caller.
3216 (finish_omp_for): Likewise. Don't call fold_build_cleanup_point_expr
3217 before calling c_finish_omp_for and c_omp_check_loop_iv, move it
3219 * pt.c (tsubst_omp_for_iterator): Handle non-rectangular loops.
3221 2020-06-16 Jakub Jelinek <jakub@redhat.com>
3223 * parser.c (cp_parser_omp_clause_schedule): Reject modifier separated
3224 from kind by comma rather than colon.
3226 2020-06-16 Patrick Palka <ppalka@redhat.com>
3228 * pt.c (perform_instantiation_time_access_checks): No need to
3230 * semantics.c (enforce_access): Verify that decl is not
3233 2020-06-16 Patrick Palka <ppalka@redhat.com>
3237 * cp-tree.h (qualified_typedef_usage_s): Delete.
3238 (qualified_typedef_usage_t): Delete.
3239 (deferred_access_check): Move up in file.
3240 (tree_template_info::typedefs_needing_access_checking): Delete.
3241 (tree_template_info::deferred_access_checks): New field.
3242 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): Rename to ...
3243 (TI_DEFERRED_ACCESS_CHECKS): ... this, and adjust accordingly.
3244 * pt.c (perform_typedefs_access_check): Rename to ...
3245 (perform_instantiation_time_access_checks): ... this, and adjust
3246 accordingly. Remove unnecessary tree tests.
3247 (instantiate_class_template_1): Adjust accordingly.
3248 (instantiate_decl): Likewise.
3249 * semantics.c (enforce_access): Likewise.
3251 2020-06-16 Patrick Palka <ppalka@redhat.com>
3255 * call.c (enforce_access): Move to semantics.c.
3256 * cp-tree.h (enforce_access): Delete.
3257 (get_types_needing_access_check): Delete.
3258 (add_typedef_to_current_template_for_access_check): Delete.
3259 * decl.c (make_typename_type): Adjust accordingly. Use
3260 check_accessibility_of_qualified_id instead of directly using
3261 perform_or_defer_access_check.
3262 * parser.c (cp_parser_template_declaration_after_parameters):
3263 Don't push a dk_no_check access state when parsing a template.
3264 * pt.c (get_types_needing_access_check): Delete.
3265 (append_type_to_template_for_access_check_1): Delete.
3266 (perform_typedefs_access_check): Adjust. If type_decl is a
3267 FIELD_DECL, also check its DECL_CONTEXT for dependence. Use
3268 tsubst_copy instead of tsubst to substitute into type_decl so
3269 that we substitute into the DECL_CONTEXT of a FIELD_DECL.
3270 (append_type_to_template_for_access_check): Delete.
3271 * search.c (accessible_p): Remove the processing_template_decl
3273 * semantics.c (enforce_access): Moved from call.c. If we're
3274 parsing a template and the access check failed, add the check to
3275 TI_TYPEDEFS_NEEDING_ACCESS_CHECKING.
3276 (perform_or_defer_access_check): Adjust comment.
3277 (add_typedef_to_current_template_for_access_check): Delete.
3278 (check_accessibility_of_qualified_id): Adjust accordingly.
3279 Exit early if the scope is dependent.
3281 2020-06-11 Patrick Palka <ppalka@redhat.com>
3284 * constraint.cc (associate_classtype_constraints): If there is a
3285 discrepancy between the current template depth and the template
3286 depth of the original declaration, then adjust the template
3287 parameter depth within the current constraints appropriately.
3288 * pt.c (tsubst_friend_class): Substitute into and set the
3289 constraints on the injected declaration.
3291 2020-06-11 Iain Sandoe <iain@sandoe.co.uk>
3293 * coroutines.cc (instantiate_coro_traits): Pass a reference
3294 to lambda closure objects to traits instantiation.
3295 (morph_fn_to_coro): Likewise for promise parameter
3296 preview and allocator lookup.
3298 2020-06-10 Iain Sandoe <iain@sandoe.co.uk>
3301 * call.c (add_candidates): Use vec_safe_length() for
3302 testing the arguments list.
3303 (build_new_method_call_1): Use vec_safe_is_empty() when
3304 checking for an empty args list.
3306 2020-06-10 Marek Polacek <polacek@redhat.com>
3309 * parser.c (cp_parser_direct_declarator): Clear
3310 CP_PARSER_FLAGS_DELAY_NOEXCEPT if the declarator kind is not
3313 2020-06-09 Iain Sandoe <iain@sandoe.co.uk>
3316 * coroutines.cc (expand_one_await_expression): Build separate
3317 DTOR trees for the awaitable object on the destroy and resume
3320 2020-06-09 Jason Merrill <jason@redhat.com>
3323 * cp-gimplify.c (predeclare_vla): Only predeclare a VLA if it's
3324 wrapped in a pointer type.
3326 2020-06-05 Marek Polacek <polacek@redhat.com>
3329 * call.c (build_converted_constant_expr_internal): Allow
3330 list-initialization.
3332 2020-06-05 Iain Sandoe <iain@sandoe.co.uk>
3334 * cp-tree.def (CO_RETURN_EXPR): Correct the class
3335 to use tcc_statement.
3337 2020-06-05 Jason Merrill <jason@redhat.com>
3339 * error.c (dump_binary_op): Handle negative operand to
3342 2020-06-04 Jason Merrill <jason@redhat.com>
3345 * constexpr.c (cxx_eval_constant_expression) [OBJ_TYPE_REF]:
3346 Evaluate OBJ_TYPE_REF_EXPR.
3348 2020-06-04 Jason Merrill <jason@redhat.com>
3351 * class.c (lookup_vfn_in_binfo): New.
3352 * call.c (build_over_call): Use it.
3353 * cp-tree.h (resolves_to_fixed_type_p): Add default argument.
3354 (lookup_vfn_in_binfo): Declare.
3356 2020-06-04 Iain Sandoe <iain@sandoe.co.uk>
3359 * coroutines.cc (morph_fn_to_coro): Ensure that the get-
3360 return-object is constructed correctly; When it is not the
3361 final return value, pass it to the CTOR of the return type
3362 as an rvalue, per the standard comment.
3364 2020-06-04 Jakub Jelinek <jakub@redhat.com>
3368 * constexpr.c (cxx_eval_constant_expression): Diagnose CONVERT_EXPR
3369 conversions from pointer types to arithmetic types here...
3370 (cxx_eval_outermost_constant_expr): ... instead of here.
3372 2020-06-03 Mark Wielaard <mark@klomp.org>
3374 * parser.c (cp_lexer_safe_previous_token): New function.
3375 (cp_parser_error_1): Add name_hint if the previous token is
3376 a string literal and next token is a CPP_NAME and we have a
3377 missing header suggestion for the name.
3379 2020-06-03 Patrick Palka <ppalka@redhat.com>
3381 * pt.c (process_partial_specialization): Pass the full set of
3382 generic template arguments to strictly_subsumes.
3384 2020-06-03 Patrick Palka <ppalka@redhat.com>
3387 * pt.c (most_specialized_partial_spec): Reorganize the loop over
3388 DECL_TEMPLATE_SPECIALIZATIONS. Check constraints_satisfied_p on
3389 the original template declaration, not on the tsubsted one.
3391 2020-06-03 Iain Sandoe <iain@sandoe.co.uk>
3394 * coroutines.cc (finish_co_await_expr): Revise to allow for
3396 (finish_co_yield_expr): Likewise.
3398 2020-06-03 Jason Merrill <jason@redhat.com>
3401 * cp-tree.h (predeclare_vla): Declare.
3402 * cp-gimplify.c (predeclare_vla): Handle getting a decl.
3403 * pt.c (tsubst_expr) [DECL_EXPR]: Use it.
3405 2020-06-03 Tobias Burnus <tobias@codesourcery.com>
3407 * cp-gimplify.c (cxx_omp_predetermined_mapping): New.
3408 * cp-objcp-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redfine.
3409 * cp-tree.h (cxx_omp_predetermined_mapping): Declare.
3411 2020-06-02 Jason Merrill <jason@redhat.com>
3414 * pt.c (tsubst_decl): Relax assert.
3416 2020-06-02 Iain Sandoe <iain@sandoe.co.uk>
3419 * coroutines.cc (build_co_await): Wrap the co_await expression
3420 in a TARGET_EXPR, where needed.
3421 (finish_co_yield_expr): Likewise.
3423 2020-06-02 Patrick Palka <ppalka@redhat.com>
3427 * pt.c (tsubst_function_decl): Don't do set_constraints when
3428 regenerating a lambda.
3429 (tsubst_lambda_expr): Substitute into the lambda's constraints
3430 and do set_constraints here.
3432 2020-06-01 Jason Merrill <jason@redhat.com>
3437 * class.c (build_vfn_ref): Revert 95311 change.
3438 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): Build a
3441 2020-06-01 Iain Sandoe <iain@sandoe.co.uk>
3444 * coroutines.cc (struct param_info): Remove rv_ref field.
3445 (build_actor_fn): Remove specifial rvalue ref handling.
3446 (morph_fn_to_coro): Likewise.
3448 2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
3451 * coroutines.cc (morph_fn_to_coro): If we see an
3452 early fatal error, drop the erroneous function body.
3454 2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
3456 * coroutines.cc (build_co_await): Remove unused
3458 (finish_co_await_expr): Likewise.
3459 (finish_co_yield_expr): Likewise; revise comment.
3461 2020-05-30 Iain Sandoe <iain@sandoe.co.uk>
3463 * coroutines.cc (morph_fn_to_coro): Revise initialization
3464 of the frame pointer to avoid an unused value.
3466 2020-05-30 Patrick Palka <ppalka@redhat.com>
3469 * constraint.cc (satisfaction_value): Accept INTEGER_CST of any
3472 2020-05-29 Patrick Palka <ppalka@redhat.com>
3473 Jason Merrill <jason@redhat.com>
3476 * class.c (add_method): Let special member function templates
3477 coexist if they are not equivalently constrained, or in a class
3480 2020-05-29 Jason Merrill <jason@redhat.com>
3483 * pt.c (process_template_parm): Set DECL_TEMPLATE_INFO
3484 on the DECL_TEMPLATE_RESULT.
3486 2020-05-29 Marek Polacek <polacek@redhat.com>
3489 * cp-gimplify.c (cp_fold) <case MODIFY_EXPR>: Don't set
3490 TREE_THIS_VOLATILE here.
3491 (cp_fold): Set it here along with TREE_NO_WARNING.
3493 2020-05-29 Jason Merrill <jason@redhat.com>
3497 * class.c (build_vfn_ref): Don't fold the INDIRECT_REF.
3499 2020-05-29 Patrick Palka <ppalka@redhat.com>
3504 * parser.c (cp_parser_requires_clause_expression): Temporarily
3505 increment processing_template_decl only if it is 0.
3506 (cp_parser_constraint_expression): Likewise.
3507 (cp_parser_requires_expression): Likewise.
3509 2020-05-29 Patrick Palka <ppalka@redhat.com>
3512 * constexpr.c (get_or_insert_ctor_field): Add limited support
3513 for RANGE_EXPR index lookups.
3515 2020-05-28 Jakub Jelinek <jakub@redhat.com>
3518 * decl.c (cp_finish_decomp): Call complete_type before checking
3521 2020-05-28 Jason Merrill <jason@redhat.com>
3524 * decl.c (cp_finish_decl): Revert r9-297 change.
3525 (check_static_variable_definition): Likewise.
3526 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
3527 * pt.c (instantiate_decl): Return early on type error.
3529 2020-05-27 Jason Merrill <jason@redhat.com>
3532 * decl.c (reshape_init_array_1): Don't reuse in overload context.
3534 2020-05-27 Jason Merrill <jason@redhat.com>
3537 * call.c (build_new_op_1): Suppress
3538 warn_zero_as_null_pointer_constant across comparison of <=> result
3541 2020-05-27 Jason Merrill <jason@redhat.com>
3544 * decl.c (grokdeclarator): Don't shift attributes in TYPENAME
3547 2020-05-27 Nathan Sidwell <nathan@acm.org>
3550 * pt.c (lookup_template_class_1): Restore alias template mutation.
3552 2020-05-26 Jakub Jelinek <jakub@redhat.com>
3555 * cp-gimplify.c: Include omp-general.h.
3556 (cp_genericize_r) <case OMP_DISTRIBUTE>: For class iteration
3557 variables in composite distribute parallel for, instantiate copy
3558 ctor of their types.
3560 2020-05-23 Patrick Palka <ppalka@redhat.com>
3563 * constexpr.c (cxx_eval_constant_expression)
3564 <case TEMPLATE_ID_EXPR>: Don't evaluate the concept when
3565 constexpr evaluation is uid-sensitive.
3567 2020-05-22 Jason Merrill <jason@redhat.com>
3569 * cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Don't preevaluate
3570 the function address if the call used operator syntax.
3572 2020-05-21 Jason Merrill <jason@redhat.com>
3575 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): For a virtual
3576 call, instrument the OBJ_TYPE_REF.
3578 * decl.c (compute_array_index_type_loc): Diagnose expressions
3579 in a template that can't be constant.
3580 * parser.c (cp_parser_direct_declarator): Don't check
3581 non-constant array bounds here.
3583 * cp-tree.h (is_rvalue_constant_expression): Declare.
3584 * constexpr.c (is_rvalue_constant_expression): New.
3585 * parser.c (cp_parser_constant_expression): Use it.
3586 * decl.c (cp_finish_decl): Try to treat a constexpr initializer in a
3587 template as constant.
3589 * typeck.c (build_x_modify_expr): Handle error_mark_node arguments.
3591 * decl.c (grokparms): Return NULL_TREE if any parms were erroneous.
3593 2020-05-21 Iain Sandoe <iain@sandoe.co.uk>
3595 * coroutines.cc (finish_co_return_stmt): Revert change to use
3598 2020-05-21 Patrick Palka <ppalka@redhat.com>
3601 * constexpr.c (constexpr_ctx::uid_sensitive): Remove field.
3602 (uid_sensitive_constexpr_evaluation_value): Define.
3603 (uid_sensitive_constexpr_evaluation_true_counter): Define.
3604 (uid_sensitive_constexpr_evaluation_p): Define.
3605 (uid_sensitive_constexpr_evaluation_sentinel): Define its
3607 (uid_sensitive_constexpr_evaluation_checker): Define its
3608 constructor and its evaluation_restricted_p method.
3609 (get_fundef_copy): Remove 'ctx' parameter. Use u_s_c_e_p
3610 instead of constexpr_ctx::uid_sensitive.
3611 (cxx_eval_call_expression): Use u_s_c_e_p instead, and test it
3612 last. Adjust call to get_fundef_copy.
3613 (instantiate_cx_fn_r): Test u_s_c_e_p so that we increment the
3614 counter if necessary.
3615 (cxx_eval_outermost_constant_expr): Remove 'uid_sensitive'
3616 parameter. Adjust function body accordingly.
3617 (maybe_constant_value): Remove 'uid_sensitive' parameter and
3618 adjust function body accordingly. Set up a
3619 uid_sensitive_constexpr_evaluation_checker, and use it to
3620 conditionally update the cv_cache.
3621 * cp-gimplify.c (cp_fold): Set up a
3622 uid_sensitive_constexpr_evaluation_checker, and use it to
3623 conditionally update the fold_cache.
3624 * cp-tree.h (maybe_constant_value): Update declaration.
3625 (struct uid_sensitive_constexpr_evaluation_sentinel): Define.
3626 (struct sensitive_constexpr_evaluation_checker): Define.
3627 * expr.c (fold_for_warn): Set up a
3628 uid_sensitive_constexpr_evaluation_sentinel before calling
3629 the folding subroutines. Drop all but the first argument to
3630 maybe_constant_value.
3632 2020-05-20 Marek Polacek <polacek@redhat.com>
3635 * parser.c (cp_parser_unqualified_id): Reject simple-template-id as
3636 the declarator-id of a destructor.
3637 (cp_parser_constructor_declarator_p): Reject simple-template-id as
3638 the declarator-id of a constructor.
3640 2020-05-20 Marek Polacek <polacek@redhat.com>
3644 * cp-tree.h (SD_DECOMPOSITION): New flag.
3645 * decl.c (duplicate_decls): Make sure a structured binding is unique
3646 in its declarative region.
3647 (start_decl): If INITIALIZED is SD_DECOMPOSITION, call
3648 fit_decomposition_lang_decl.
3649 (grokdeclarator): Compare INITIALIZED directly to SD_* flags.
3650 * parser.c (cp_parser_decomposition_declaration): Pass SD_DECOMPOSITION
3653 2020-05-20 Patrick Palka <ppalka@redhat.com>
3656 * typeck.c (structural_comptypes): Don't perform
3657 context-dependent resolution of TYPENAME_TYPEs when
3658 comparing_specializations.
3660 2020-05-19 Nathan Sidwell <nathan@acm.org>
3662 * pt.c (lookup_template_class_1): Do not reinit template_info of an
3665 2020-05-18 Martin Sebor <msebor@redhat.com>
3668 * call.c ((maybe_warn_class_memaccess): Use is_byte_access_type.
3669 * cp-tree.h (is_dummy_object): Return bool.
3670 (is_byte_access_type): Declare new function.
3671 * tree.c (is_dummy_object): Return bool.
3672 (is_byte_access_type): Define new function.
3674 2020-05-19 Patrick Palka <ppalka@redhat.com>
3677 * pt.c (init_template_processing): Enable sanitization for
3678 decl_specializations and type_specializations.
3681 * pt.c (fn_type_unification): Pass 'fn' instead of NULL_TREE as
3682 the 'in_decl' parameter to coerce_template_parms.
3684 2020-05-18 Marek Polacek <polacek@redhat.com>
3687 * typeck.c (cp_build_binary_op): Use fold_for_warn instead of
3690 2020-05-18 Marek Polacek <polacek@redhat.com>
3693 * cvt.c (cp_get_fndecl_from_callee): Return NULL_TREE if the function
3694 type is not INDIRECT_TYPE_P.
3695 * decl.c (omp_declare_variant_finalize_one): Call
3696 cp_get_callee_fndecl_nofold instead of looking for the function decl
3699 2020-05-18 Marek Polacek <polacek@redhat.com>
3702 * parser.c (cp_parser_has_attribute_expression): Sorry on a
3703 type-dependent argument.
3705 2020-05-18 Marek Polacek <polacek@redhat.com>
3709 * call.c (add_builtin_candidate) <case EQ_EXPR>: Create candidate
3710 operator functions when type is std::nullptr_t for ==/!=.
3711 * typeck.c (composite_pointer_type_r): Add a bool * parameter. Use it
3712 to maybe add "const" to the pointer type.
3713 (composite_pointer_type): Update the call to composite_pointer_type_r.
3714 (cp_build_binary_op): Turn two warning_at into error_at. Print the
3717 2020-05-18 Jason Merrill <jason@redhat.com>
3719 * call.c (build_over_call): Remove unnecessary
3720 cp_stabilize_reference.
3722 2020-05-18 Marek Polacek <polacek@redhat.com>
3724 * call.c (add_builtin_candidate): Don't create a builtin overload
3725 candidate for ++ when type is bool in C++17.
3727 2020-05-18 Marek Polacek <polacek@redhat.com>
3729 * cfns.h: Regenerated.
3731 2020-05-17 Iain Sandoe <iain@sandoe.co.uk>
3733 * coroutines.cc (morph_fn_to_coro): Initialize the gro variable.
3735 2020-05-16 Iain Sandoe <iain@sandoe.co.uk>
3737 * coroutines.cc (finish_co_return_stmt): Implement rules
3738 from [class.copy.elision] /3.
3740 2020-05-16 Patrick Palka <ppalka@redhat.com>
3743 * semantics.c (finish_decltype_type): Call
3744 instantiate_non_dependent_expr_sfinae on the expression.
3746 2020-05-15 Patrick Palka <ppalka@redhat.com>
3750 2020-04-07 Patrick Palka <ppalka@redhat.com>
3753 * typeck2.c (process_init_constructor_array): Propagate
3754 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
3755 the array initializer.
3757 2020-05-15 Jason Merrill <jason@redhat.com>
3759 PR c++/93286 - ICE with __is_constructible and variadic template.
3760 * pt.c (tsubst_tree_list): New.
3761 (tsubst, tsubst_copy_and_build): Use it.
3762 * decl2.c (is_late_template_attribute): Handle error_mark_node args.
3764 2020-05-15 Nathan Sidwell <nathan@acm.org>
3766 * pt.c (template_args_equal): Fix thinkos in previous 'cleanup'.
3768 2020-05-14 Jason Merrill <jason@redhat.com>
3771 * pt.c (maybe_instantiate_noexcept): Change clone handling.
3773 2020-05-14 Patrick Palka <ppalka@redhat.com>
3776 * call.c (build_op_call): Pass complain to lookup_fnfields.
3777 (build_special_member_call): Likewise.
3778 * class.c (type_requires_array_cookie): Pass tf_warning_or_error
3780 * cp-tree.h (lookup_fnfields): Add tsubst_flags_t parameter.
3781 * except.c (build_throw): Pass tf_warning_or_error to
3783 * init.c (build_new_1): Pass complain to lookup_fnfields.
3784 * method.c (locate_fn_flags): Likewise.
3785 * name-lookup.c (lookup_name_real_1): Pass tf_warning_or_error
3787 * pt.c (tsubst_baselink): Pass complain to lookup_fnfields.
3788 * search.c (lookup_fnfields): New 'complain' parameter. Pass it
3791 2020-05-14 Nathan Sidwell <nathan@acm.org>
3793 * parser.c (cp_parser_diagnose_invalid_typename): Mention
3794 std=c++20 not 2a, reformat dependent binfo inform loops.
3796 * pt.c (tsubst_template_decl): Reorder and commonize some control
3799 * pt.c (tsubst_friend_function): Simplify control flow.
3801 * pt.c (lookup_template_class_1): Remove unnecessary else by
3802 simply grabbing TYPE_NAME earlier.
3804 * pt.c (push_template_decl_real): Adjust friend pushing logic.
3805 Reinit template type.
3807 * pt.c (build_template_decl): Init DECL_TEMPLATE_RESULT &
3809 (process_partial_specialization): ... not here ...
3810 (push_template_decl_real, add_inherited_template_parms)
3811 (build_deduction_guide): ... or here.
3813 2020-05-14 Jakub Jelinek <jakub@redhat.com>
3815 * cp-gimplify.c (cp_genericize_r): Set cfun->has_omp_target.
3817 2020-05-13 Patrick Palka <ppalka@redhat.com>
3820 * init.c (build_vec_delete_1): Just return error_mark_node if
3821 deallocate_expr is error_mark_node.
3822 (build_delete): Just return error_mark_node if do_delete is
3825 2020-05-13 Patrick Palka <ppalka@redhat.com>
3828 * constraint.cc (tsubst_requires_expr): Produce a new
3829 requires-expression when processing_template_decl, even if
3830 template arguments are not dependent.
3832 2020-05-13 Marek Polacek <polacek@redhat.com>
3835 * decl.c (duplicate_decls): Set DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
3837 2020-05-13 Nathan Sidwell <nathan@acm.org>
3839 * pt.c (template_args_equal): Reorder category checking for
3842 * pt.c (perform_typedefs_access_check): Cache expensively
3843 calculated object references.
3844 (check_auto_in_tmpl_args): Just assert we do not get unexpected
3845 nodes, rather than silently do nothing.
3846 (append_type_to_template_for_access): Likewise, cache expensie
3849 * pt.c (canonical_type_parameter): Simplify.
3851 Formatting fixups & some simplifications.
3852 * pt.c (spec_hash_table): New typedef.
3853 (decl_specializations, type_specializations): Use it.
3854 (retrieve_specialization): Likewise.
3855 (register_specialization): Remove unnecessary casts.
3856 (push_template_decl_real): Reformat.
3857 (instantiate_class_template_1): Use more RAII.
3858 (make_argument_pack): Simplify.
3859 (instantiate_template_1): Use gcc_checking_assert for expensive
3861 (instantiate_decl): Likewise.
3862 (resolve_typename_type): Reformat comment.
3863 * semantics.c (struct deferred_access): Remove unnecessary GTY on
3865 (begin_class_definition): Fix formatting.
3867 2020-05-13 Jason Merrill <jason@redhat.com>
3869 * call.c, class.c, constexpr.c, constraint.cc, decl.c, init.c,
3870 lambda.c, lex.c, method.c, name-lookup.c, parser.c, pt.c, tree.c,
3871 typeck2.c: Change cxx2a to cxx20.
3873 2020-05-12 Marek Polacek <polacek@redhat.com>
3876 * parser.c (cp_parser_postfix_expression) <case CPP_OPEN_PAREN>: When
3877 looking for a block-scope function declaration, look through the whole
3878 set, not just the first function in the overload set.
3880 2020-05-12 Jakub Jelinek <jakub@redhat.com>
3883 * pt.c (tsubst_decl): Deal with DECL_OMP_PRIVATIZED_MEMBER for
3886 2020-05-11 Jason Merrill <jason@redhat.com>
3888 Resolve C++20 NB comment CA104
3889 * pt.c (determine_specialization): Compare constraints for
3890 specialization of member template of class instantiation.
3892 2020-05-11 Jason Merrill <jason@redhat.com>
3896 * tree.c (cp_walk_subtrees): Stop at typedefs.
3897 Handle TYPENAME_TYPE here.
3898 * pt.c (find_parameter_packs_r): Not here.
3899 (for_each_template_parm_r): Clear *walk_subtrees.
3900 * decl2.c (min_vis_r): Look through typedefs.
3902 2020-05-11 Jason Merrill <jason@redhat.com>
3904 * call.c (implicit_conversion_error): Split out from...
3905 (perform_implicit_conversion_flags): ...here.
3906 (build_converted_constant_expr_internal): Use it.
3908 2020-05-11 Jason Merrill <jason@redhat.com>
3911 * parser.c (inject_parm_decls): Set current_class_ptr here.
3912 (cp_parser_direct_declarator): And here.
3913 (cp_parser_late_return_type_opt): Not here.
3914 (cp_parser_noexcept_specification_opt): Nor here.
3915 (cp_parser_exception_specification_opt)
3916 (cp_parser_late_noexcept_specifier): Remove unneeded parameters.
3918 2020-05-11 Jason Merrill <jason@redhat.com>
3920 * decl.c (cxx_init_decl_processing): Call declare_weak for
3923 2020-05-11 Jason Merrill <jason@redhat.com>
3925 * pt.c (instantiate_class_template_1): Call tsubst_expr for
3926 STATIC_ASSERT member.
3927 * ptree.c (cxx_print_xnode): Handle STATIC_ASSERT.
3929 2020-05-11 Jason Merrill <jason@redhat.com>
3931 * pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Remove redundant
3932 walking of capture list.
3934 2020-05-11 Jason Merrill <jason@redhat.com>
3936 * cp-tree.h (LOOKUP_EXPLICIT_TMPL_ARGS): Remove.
3937 * call.c (build_new_function_call): Don't set it.
3938 (build_new_method_call_1): Likewise.
3939 (build_over_call): Check cand->explicit_targs instead.
3941 2020-05-11 Jason Merrill <jason@redhat.com>
3943 * decl.c (compute_array_index_type_loc): Stabilize before building
3946 2020-05-11 Jason Merrill <jason@redhat.com>
3948 * decl.c (grokdeclarator): Adjust deprecated_state here.
3949 (start_decl): Not here.
3951 2020-05-08 Iain Sandoe <iain@sandoe.co.uk>
3954 * coroutines.cc (build_actor_fn): Ensure that bind scopes
3955 are marked as having side-effects where necessary.
3956 (replace_statement_captures): Likewise.
3957 (morph_fn_to_coro): Likewise.
3959 2020-05-08 Nathan Sidwell <nathan@acm.org>
3961 * NEWS: Delete, it is so stale.
3963 * parser.c (cp_lexer_set_source_position_from_token): EOF has a
3966 2020-05-07 Iain Sandoe <iain@sandoe.co.uk>
3970 * coroutines.cc (morph_fn_to_coro): Set unformed outline
3971 functions to error_mark_node. For early error returns suppress
3972 warnings about missing ramp return values. Fix reinstatement
3973 of the function body on pre-existing initial error.
3974 * decl.c (finish_function): Use the normal error path for fails
3975 in the ramp function, do not try to compile the helpers if the
3978 2020-05-07 Marek Polacek <polacek@redhat.com>
3980 PR c++/94590 - Detect long double -> double narrowing.
3981 * typeck2.c (check_narrowing): Detect long double -> double
3982 narrowing even when double and long double have the same
3983 precision. Make it handle conversions to float too.
3985 2020-05-07 Marek Polacek <polacek@redhat.com>
3988 * parser.c (cp_parser_class_specifier_1): Check that the scope is
3989 nested inside current scope before pushing it.
3991 2020-05-07 Marek Polacek <polacek@redhat.com>
3994 * typeck2.c (check_narrowing): Consider T* to bool narrowing
3997 2020-05-07 Marek Polacek <polacek@redhat.com>
3999 * decl.c (grok_op_properties): Fix spelling of non-static.
4000 * typeck.c (build_class_member_access_expr): Likewise.
4002 2020-05-07 Richard Biener <rguenther@suse.de>
4005 * optimize.c (update_cloned_parm): Copy DECL_NOT_GIMPLE_REG_P.
4007 2020-05-06 Marek Polacek <polacek@redhat.com>
4010 * pt.c (tsubst_copy_and_build): Call type_dependent_expression_p_push
4011 instead of uses_template_parms. Move the warning_sentinels after the
4014 2020-05-06 Jakub Jelinek <jakub@redhat.com>
4017 * typeck.c (cp_strict_aliasing_warning): New function.
4018 (cp_build_indirect_ref_1, build_reinterpret_cast_1): Use
4019 it instead of strict_aliasing_warning.
4022 * method.c (defaulted_late_check): Don't call synthesize_method
4023 on constexpr sfk_comparison if it has been called on it already.
4025 2020-05-06 Nathan Sidwell <nathan@acm.org>
4028 * decl.c (grokdeclarator): Don't splice template attributes in
4029 parm context -- they can apply to the parm.
4031 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
4033 * coroutines.cc: Remove references to n4849 throughout.
4035 2020-05-05 Jason Merrill <jason@redhat.com>
4038 * pt.c (more_specialized_fn): Do consider parms with no deducible
4039 template parameters.
4041 2020-05-05 Jason Merrill <jason@redhat.com>
4044 * constexpr.c (potential_constant_expression_1): In a lambda
4045 function, consider a captured variable directly.
4047 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
4049 * coroutines.cc (transform_await_wrapper): Check that we have
4050 no unlowered co_yields.
4051 (captures_temporary): Likewise.
4052 (register_awaits): Likewise.
4054 2020-05-05 Nathan Sidwell <nathan@acm.org>
4057 * coroutines.cc (morph_fn_to_coro): Just check for
4059 * pt.c (tsubst_function_decl): Update lambda fn's this_ptr name.
4061 2020-05-05 Marek Polacek <polacek@redhat.com>
4062 Jason Merrill <jason@redhat.com>
4065 * parser.c (cp_parser_postfix_dot_deref_expression): If we have
4066 a type-dependent object of class type, stash it to
4067 parser->context->object_type. If the postfix expression doesn't have
4069 (cp_parser_class_name): Consider object scope too.
4070 (cp_parser_lookup_name): Remove code dealing with the case when
4071 object_type is unknown_type_node.
4073 2020-05-04 Patrick Palka <ppalka@redhat.com>
4076 * cp-gimplify.c (cp_fold) <case CALL_EXPR>: Move some variable
4077 declarations closer to their uses. Copy the CALL_EXPR only
4078 when one of its arguments has changed.
4079 <case TREE_VEC>: Instead of first collecting the folded
4080 arguments into a releasing_vec, just make a copy of the TREE_VEC
4081 as soon as folding changes one of its arguments.
4083 2020-05-04 Iain Sandoe <iain@sandoe.co.uk>
4085 * coroutines.cc (morph_fn_to_coro): Mark the coro.gro variable
4086 as artificial and ignored.
4088 2020-05-04 Nathan Sidwell <nathan@acm.org>
4090 pt.c (process_template_parm): Don't walk the template list twice,
4091 remember the final node instead.
4092 (end_template_parm_list): Refactor. Comment on why we do a pop
4095 PR c++/94827 -- don't save parms in nested requirement
4096 * constraint.cc (tsubst_nested_requirement): TYPE directly holds
4097 notmalized requirement.
4098 (finish_nested_requirement): Don't stash current tpl parms into
4100 (diagnose_nested_requirement): TYPE directly holds notmalized
4103 2020-05-01 Patrick Palka <ppalka@redhat.com>
4106 * cp-tree.h (check_accessibility_of_qualified_id): Add
4107 tsubst_flags_t parameter and change return type to bool.
4108 * parser.c (cp_parser_lookup_name): Pass tf_warning_to_error to
4109 check_accessibility_of_qualified_id.
4110 * pt.c (tsubst_qualified_id): Return error_mark_node if
4111 check_accessibility_of_qualified_id returns false.
4112 * semantics.c (check_accessibility_of_qualified_id): Add
4113 complain parameter. Pass complain instead of
4114 tf_warning_or_error to perform_or_defer_access_check. Return
4115 true unless perform_or_defer_access_check returns false.
4117 2020-05-01 Marek Polacek <polacek@redhat.com>
4120 * typeck2.c (process_init_constructor_record): Return PICFLAG_ERRONEOUS
4121 if an initializer element was erroneous.
4123 2020-05-01 Jason Merrill <jason@redhat.com>
4126 * init.c (get_nsdmi): Don't push_to_top_level for a local class.
4128 2020-05-01 Jason Merrill <jason@redhat.com>
4131 * decl.c (cp_finish_decl): Also clear TREE_READONLY if
4132 -fmerge-all-constants.
4134 2020-05-01 Jason Merrill <jason@redhat.com>
4137 * pt.c (tsubst_decl): Make sure DECL_VALUE_EXPR continues to have
4138 the same type as the variable.
4140 2020-04-30 Jason Merrill <jason@redhat.com>
4141 Nathan Sidwell <nathan@acm.org>
4144 * constraint.cc (map_arguments): If ARGS is null, it's a
4145 self-mapping of parms.
4146 (finish_nested_requirement): Do not pass argified
4147 current_template_parms to normalization.
4148 (tsubst_nested_requirement): Don't assert no template parms.
4150 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
4153 * coroutines.cc (transform_local_var_uses): Defer walking
4154 the DECL_INITIALs of BIND_EXPR vars until all the frame
4155 allocations have been made.
4157 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
4160 * coroutines.cc (register_awaits): Update target
4161 expressions for awaitable and suspend handle
4164 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
4167 * coroutines.cc (build_co_await): Account for variables
4168 with DECL_VALUE_EXPRs.
4169 (captures_temporary): Likewise.
4170 (register_awaits): Likewise.
4172 2020-04-29 Patrick Palka <ppalka@redhat.com>
4175 * pt.c (find_template_parameter_info::parm_list): New field.
4176 (keep_template_parm): Use the new field to build up the
4177 parameter list here instead of ...
4178 (find_template_parameters): ... here. Return ftpi.parm_list.
4180 2020-04-29 Jakub Jelinek <jakub@redhat.com>
4183 * class.c (build_base_field): Set DECL_FIELD_ABI_IGNORED on C++17 empty
4184 base artificial FIELD_DECLs.
4185 (layout_class_type): Set DECL_FIELD_ABI_IGNORED on empty class
4186 field_poverlapping_p FIELD_DECLs.
4188 2020-04-29 Patrick Palka <ppalka@redhat.com>
4191 * constraint.cc (satisfy_declaration_constraints): Use saved_t
4192 instead of t as the key to decl_satisfied_cache.
4195 * error.c (print_requires_expression_info): Print the dependent
4196 form of the parameter list with its template parameter mapping,
4197 rather than printing the substituted form.
4199 2020-04-28 Jason Merrill <jason@redhat.com>
4202 * decl.c (use_eh_spec_block): Check nothrow type after
4204 * pt.c (maybe_instantiate_noexcept): Call synthesize_method for
4205 DECL_MAYBE_DELETED fns here.
4206 * decl2.c (mark_used): Not here.
4207 * method.c (get_defaulted_eh_spec): Reject DECL_MAYBE_DELETED here.
4209 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
4212 * coroutines.cc (instantiate_coro_traits): Pass a reference to
4213 object type rather than a pointer type for 'this', for method
4215 (struct param_info): Add a field to hold that the parm is a lambda
4217 (morph_fn_to_coro): Check for lambda closure pointers in the
4218 args. Use a reference to *this when building the args list for the
4219 promise allocator lookup.
4221 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
4224 * coroutines.cc (coro_promise_type_found_p): Do not
4225 exclude non-classes here (this needs to be handled in the
4227 (morph_fn_to_coro): Allow for the case where the coroutine
4230 2020-04-27 Iain Sandoe <iain@sandoe.co.uk>
4233 * coroutines.cc (struct local_var_info): Add fields for static
4234 variables and those with DECL_VALUE_EXPR redirection.
4235 (transform_local_var_uses): Skip past typedefs and static vars
4236 and then account for redirected variables.
4237 (register_local_var_uses): Likewise.
4239 2020-04-27 Jason Merrill <jason@redhat.com>
4243 * decl.c (grokdeclarator): Move dependent attribute to decl.
4244 * decl2.c (splice_template_attributes): No longer static.
4246 2020-04-27 Patrick Palka <ppalka@redhat.com>
4249 * constexpr.c (cxx_eval_call_expression): Don't set new_obj if we're
4250 evaluating the target constructor of a delegating constructor.
4251 (cxx_eval_store_expression): Don't set TREE_READONLY if the LHS of the
4252 INIT_EXPR is '*this'.
4254 2020-04-26 Marek Polacek <polacek@redhat.com>
4257 * call.c (struct conversion): Add copy_init_p.
4258 (standard_conversion): Set copy_init_p in ck_base and ck_rvalue
4259 if FLAGS demands LOOKUP_ONLYCONVERTING.
4260 (convert_like_real) <case ck_base>: If copy_init_p is set, or
4261 LOOKUP_ONLYCONVERTING into FLAGS.
4263 2020-04-26 Iain Sandoe <iain@sandoe.co.uk>
4266 * coroutines.cc (morph_fn_to_coro): Ensure that
4267 unnamed function params have a usable and distinct
4270 2020-04-24 Jason Merrill <jason@redhat.com>
4273 * decl.c (redeclaration_error_message): Reject defaulted comparison
4274 operator that has been previously declared.
4276 2020-04-25 Patrick Palka <ppalka@redhat.com>
4278 * parser.c (cp_parser_diagnose_invalid_type_name): Suggest enabling
4279 concepts if the invalid identifier is 'requires'.
4281 2020-04-25 Jakub Jelinek <jakub@redhat.com>
4284 * semantics.c (finish_call_expr): When looking if all overloads
4285 are noreturn, use STRIP_TEMPLATE to look through TEMPLATE_DECLs.
4287 2020-04-24 Martin Liska <mliska@suse.cz>
4289 * coroutines.cc: Fix compilation error for release checking
4290 where we miss declaration of ‘coro_body_contains_bind_expr_p’.
4292 2020-04-23 Patrick Palka <ppalka@redhat.com>
4294 * tree.c (zero_init_expr_p): Use uses_template_parms instead of
4298 * pt.c (template_class_depth): Walk into the DECL_FRIEND_CONTEXT of a
4299 friend declaration rather than into its CP_DECL_CONTEXT.
4301 2020-04-23 Iain Sandoe <iain@sandoe.co.uk>
4304 * coroutines.cc (await_statement_expander): Simplify cases.
4305 (struct susp_frame_data): Add fields for truth and/or if
4306 cases, rename one field.
4307 (analyze_expression_awaits): New.
4308 (expand_one_truth_if): New.
4309 (add_var_to_bind): New helper.
4310 (coro_build_add_if_not_cond_break): New helper.
4311 (await_statement_walker): Handle conditional expressions,
4312 handle expansion of truth-and/or-if cases.
4313 (bind_expr_find_in_subtree): New, checking-only.
4314 (coro_body_contains_bind_expr_p): New, checking-only.
4315 (morph_fn_to_coro): Ensure that we have a top level bind
4318 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
4320 PR translation/94698
4321 * class.c (check_field_decls): Change "define" to "declare" in
4322 -Weffc++ diagnostics.
4324 2020-04-22 Patrick Palka <ppalka@redhat.com>
4328 * constraint.cc (satisfy_declaration_constraints): If the inherited
4329 constructor points to an instantiation of a constructor template,
4330 remember and use its attached template arguments.
4332 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
4334 PR translation/94698
4335 * class.c (check_field_decls): Change "override" to "define" in
4336 -Weffc++ diagnostics.
4338 2020-04-22 Iain Sandoe <iain@sandoe.co.uk>
4341 * coroutines.cc (struct param_info): Add a field to note that
4342 the param is 'this'.
4343 (morph_fn_to_coro): Convert this to a reference before using it
4344 in the promise parameter preview.
4346 2020-04-22 Jason Merrill <jason@redhat.com>
4349 * pt.c (register_parameter_specializations): If the instantiation is
4350 still a parameter pack, don't wrap it in a NONTYPE_ARGUMENT_PACK.
4351 (tsubst_pack_expansion, tsubst_expr): Adjust.
4353 2020-04-22 Martin Sebor <msebor@redhat.com>
4354 Jason Merrill <jason@redhat.com>
4357 * decl.c (reshape_init_array_1): Avoid stripping redundant trailing
4358 zero initializers...
4359 * mangle.c (write_expression): ...and handle them here even for
4360 pointers to members by calling zero_init_expr_p.
4361 * cp-tree.h (zero_init_expr_p): Declare.
4362 * tree.c (zero_init_expr_p): Define.
4363 (type_initializer_zero_p): Remove.
4364 * pt.c (tparm_obj_values): New hash_map.
4365 (get_template_parm_object): Store to it.
4366 (tparm_object_argument): New.
4368 2020-04-22 Patrick Palka <ppalka@redhat.com>
4371 * constraint.cc (diagnose_valid_expression): Check convert_to_void here
4372 as well as in tsubst_valid_expression_requirement.
4374 2020-04-21 Patrick Palka <ppalka@redhat.com>
4377 * constraint.cc (satisfy_declaration_constraints): Don't strip the
4378 inherited constructor if it already has template information.
4381 * pt.c (any_template_parm_r) <case IDENTIFIER_NODE>: New case. If this
4382 is a conversion operator, visit its TREE_TYPE.
4384 2020-04-21 Nathan Sidwell <nathan@acm.org>
4386 * pt.c (tsubst_copy_and_build) [POINTER_PLUS_EXPR]: Check for
4389 2020-04-21 Iain Sandoe <iain@sandoe.co.uk>
4392 * coroutines.cc (morph_fn_to_coro): Simplify return
4395 2020-04-17 Marek Polacek <polacek@redhat.com>
4398 * constexpr.c (cxx_eval_outermost_constant_expr): Return when T is
4399 a BRACE_ENCLOSED_INITIALIZER_P.
4400 (is_nondependent_constant_expression): Don't check
4401 BRACE_ENCLOSED_INITIALIZER_P.
4402 (is_nondependent_static_init_expression): Likewise.
4404 2020-04-20 Patrick Palka <ppalka@redhat.com>
4407 * cp-tree.h (lss_policy::lss_nop): New enumerator.
4408 * pt.c (local_specialization_stack::local_specialization_stack): Handle
4410 (local_specialization_stack::~local_specialization_stack): Likewise.
4411 (tsubst_pack_expansion): Use a local_specialization_stack instead of
4412 manually saving and restoring local_specializations. Conditionally
4413 replace local_specializations sooner, before the handling of the
4414 unsubstituted_packs case.
4416 2020-04-20 Marek Polacek <polacek@redhat.com>
4418 PR c++/94505 - bogus -Wparentheses warning with fold-expression.
4419 * pt.c (fold_expression): Add warning_sentinel for -Wparentheses
4420 before calling build_x_binary_op.
4422 2020-04-20 Marek Polacek <polacek@redhat.com>
4424 * coroutines.cc (captures_temporary): Don't assign the result of
4425 STRIP_NOPS to the same variable.
4427 2020-04-20 Nathan Sidwell <nathan@acm.org>
4429 PR c++/94454 - tpl-tpl-parms are not canonicalizable types
4430 * pt.c (canonical_type_parameter): Assert not a tpl-tpl-parm.
4431 (process_template_parm): tpl-tpl-parms are structural.
4432 (rewrite_template_parm): Propagate structuralness.
4434 PR c++/94454 - Expr pack expansion equality
4435 * tree.c (cp_tree_equal) [TEMPLATE_ID_EXPR, default]: Refactor.
4436 [EXPR_PACK_EXPANSION]: Add.
4438 PR c++/94454 Template Argument Hashing
4439 * pt.c (iterative_hash_template_arg): Strip nodes as
4440 template_args_equal does.
4441 [ARGUMENT_PACK_SELECT, TREE_VEC, CONSTRUCTOR]: Refactor.
4442 [node_class:TEMPLATE_TEMPLATE_PARM]: Hash by level & index.
4443 [node_class:default]: Refactor.
4445 2020-04-18 Patrick Palka <ppalka@redhat.com>
4448 * tree.c (cp_tree_equal) <case PARM_DECL>: Ignore
4449 comparing_specializations if the parameters' contexts are identical.
4452 * pt.c (splice_late_return_type): Propagate cv-qualifiers and
4453 PLACEHOLDER_TYPE_CONSTRAINTS from the original auto node to the new one.
4455 2020-04-17 Patrick Palka <ppalka@redhat.com>
4458 * lambda.c (lambda_capture_field_type): Avoid doing auto deduction if
4459 the explicit initializer has parameter packs.
4462 * parser.c (cp_parser_check_template_parameters): Before issuing a hard
4463 error, first try simulating an error instead.
4465 2020-04-17 Jakub Jelinek <jakub@redhat.com>
4468 * call.c (build_conditional_expr_1): Remove redundant assignment to
4471 2020-04-16 Patrick Palka <ppalka@redhat.com>
4474 * cvt.c (ocp_convert): If the result of scalar_constant_value is
4475 erroneous, ignore it and use the original expression.
4477 2020-04-16 Jakub Jelinek <jakub@redhat.com>
4480 * parser.c (cp_parser_simple_declaration): Fix up a pasto in
4483 2020-04-15 Jakub Jelinek <jakub@redhat.com>
4486 * parser.c (cp_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
4487 requires directive when not at file or namespace scope.
4489 2020-04-14 Iain Sandoe <iain@sandoe.co.uk>
4492 * coroutines.cc (build_actor_fn): Check that the target can
4493 support the resume tailcall before mandating it.
4495 2020-04-14 Patrick Palka <ppalka@redhat.com>
4498 * cxx-pretty-print.c (cxx_pretty_printer:simple_type_specifier)
4499 <case DECLTYPE_TYPE>: Handle DECLTYPE_TYPE here instead of ...
4500 (pp_cxx_type_specifier_seq) <case DECLTYPE_TYPE>: ... here.
4501 (cxx_pretty_printer::direct_abstract_declarator) <case DECLTYPE_TYPE>:
4505 * constexpr.c (replace_result_decl_data): New struct.
4506 (replace_result_decl_data_r): New function.
4507 (replace_result_decl): New function.
4508 (cxx_eval_call_expression): Use it.
4509 * tree.c (build_aggr_init_expr): Set the location of the AGGR_INIT_EXPR
4510 to that of its initializer.
4512 2020-04-13 Marek Polacek <polacek@redhat.com>
4515 * name-lookup.c (check_local_shadow): Add an inform call.
4517 2020-04-13 Patrick Palka <ppalka@redhat.com>
4520 * error.c (dump_scope): Pass TFF_NO_FUNCTION_ARGUMENTS to
4521 dump_function_decl when printing a function template instantiation as a
4525 * constexpr.c (get_or_insert_ctor_field): Set default value of parameter
4527 (cxx_eval_bare_aggregate): Use get_or_insert_ctor_field instead of
4528 assuming the the next index belongs at the end of the new CONSTRUCTOR.
4529 (cxx_eval_store_expression): Revert PR c++/78572 fix.
4531 2020-04-13 Nathan Sidwell <nathan@acm.org>
4533 PR c++/94426 lambdas with internal linkage are different to no-linkage
4534 * decl2.c (determine_visibility): A lambda's visibility is
4535 affected by its extra scope.
4536 * pt.c (instantiate_decl): Determine var's visibility before
4537 instantiating its initializer.
4538 * tree.c (no_linkage_check): Revert code looking at visibility of
4539 lambda's extra scope.
4541 2020-04-10 Iain Sandoe <iain@sandoe.co.uk>
4544 * coroutines.cc (co_await_expander): Remove.
4545 (expand_one_await_expression): New.
4546 (process_one_statement): New.
4547 (await_statement_expander): New.
4548 (build_actor_fn): Revise to use per-statement expander.
4549 (struct susp_frame_data): Reorder and comment.
4550 (register_awaits): Factor code.
4551 (replace_statement_captures): New, factored from...
4552 (maybe_promote_captured_temps):.. here.
4553 (await_statement_walker): Revise to process per statement.
4554 (morph_fn_to_coro): Use revised susp_frame_data layout.
4556 2020-04-10 Marek Polacek <polacek@redhat.com>
4559 * method.c (constructible_expr): In C++20, try using parenthesized
4560 initialization of aggregates to determine the result of
4563 2020-04-10 Bin Cheng <bin.cheng@linux.alibaba.com>
4565 * coroutines.cc (co_await_expander): Simplify.
4567 2020-04-09 Jason Merrill <jason@redhat.com>
4570 * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]: Look at
4571 ctx->object and ctx->global->values first.
4573 2020-04-09 Marek Polacek <polacek@redhat.com>
4576 * call.c (initialize_reference): If the reference binding failed, maybe
4577 try initializing from { }.
4578 * decl.c (grok_reference_init): For T& t(e), set
4579 LOOKUP_AGGREGATE_PAREN_INIT but don't build up a constructor yet.
4581 2020-04-08 Iain Sandoe <iain@sandoe.co.uk>
4582 Jun Ma <JunMa@linux.alibaba.com>
4584 * coroutines.cc (maybe_promote_captured_temps): Add a cleanup
4585 expression, if needed, to any call from which we promoted
4586 temporaries captured by reference.
4588 2020-04-08 Marek Polacek <polacek@redhat.com>
4590 PR c++/94507 - ICE-on-invalid with lambda template.
4591 * pt.c (tsubst_lambda_expr): Cope when tsubst_template_decl or
4592 tsubst_function_decl returns error_mark_node.
4594 2020-04-08 Martin Liska <mliska@suse.cz>
4597 * decl.c (duplicate_decls): Duplicate also DECL_IS_REPLACEABLE_OPERATOR.
4598 (cxx_init_decl_processing): Mark replaceable all implicitly defined
4601 2020-04-08 Patrick Palka <ppalka@redhat.com>
4603 Core issues 1001 and 1322
4605 * pt.c (rebuild_function_or_method_type): Split function out from ...
4606 (tsubst_function_type): ... here.
4607 (maybe_rebuild_function_decl_type): New function.
4608 (tsubst_function_decl): Use it.
4610 2020-04-08 Jakub Jelinek <jakub@redhat.com>
4613 * decl.c (begin_destructor_body): For CLASSTYPE_VBASECLASSES class
4614 dtors, if CLASSTYPE_PRIMARY_BINFO is non-NULL, but not BINFO_VIRTUAL_P,
4615 look at CLASSTYPE_PRIMARY_BINFO of its BINFO_TYPE if it is not
4616 BINFO_VIRTUAL_P, and so on.
4618 2020-04-08 Marek Polacek <polacek@redhat.com>
4620 PR c++/94478 - ICE with defaulted comparison operator
4621 * method.c (early_check_defaulted_comparison): Give an error when the
4624 2020-04-08 Tobias Burnus <tobias@codesourcery.com>
4627 * paser.c (cp_parser_oacc_declare): Add check that variables
4628 are declared in the same scope as the directive.
4630 2020-04-07 Jason Merrill <jason@redhat.com>
4633 * parser.c (cp_parser_requires_expression): Use tentative_firewall.
4636 * parser.c (cp_parser_placeholder_type_specifier): Use
4639 2020-04-07 Iain Sandoe <iain@sandoe.co.uk>
4641 * coroutines.cc (maybe_promote_captured_temps): Ensure that
4642 reference capture placeholder vars are properly declared.
4644 2020-04-07 Patrick Palka <ppalka@redhat.com>
4647 * tree.c (replace_placeholders): Look through all handled components,
4648 not just COMPONENT_REFs.
4649 * typeck2.c (process_init_constructor_array): Propagate
4650 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
4651 the array initializer.
4653 2020-04-07 Jakub Jelinek <jakub@redhat.com>
4656 * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
4657 if cp_parser_omp_master succeeded.
4659 2020-04-06 Jason Merrill <jason@redhat.com>
4662 * decl.c (duplicate_decls): Fix handling of DECL_HIDDEN_FRIEND_P.
4664 2020-04-04 Marek Polacek <polacek@redhat.com>
4665 Jason Merrill <jason@redhat.com>
4667 PR c++/94155 - crash in gimplifier with paren init of aggregates.
4668 * init.c (build_vec_init): Fill in indexes.
4670 2020-04-04 Jason Merrill <jason@redhat.com>
4673 * mangle.c (write_expression): Skip IMPLICIT_CONV_EXPR.
4675 2020-04-04 Patrick Palka <ppalka@redhat.com>
4679 * constexpr.c (struct constexpr_ctx): New field 'parent'.
4680 (cxx_eval_bare_aggregate): Propagate CONSTRUCTOR_PLACEHOLDER_BOUNDARY
4681 flag from the original constructor to the reduced constructor.
4682 (lookup_placeholder): Prefer to return the outermost matching object
4683 by recursively calling lookup_placeholder on the 'parent' context,
4684 but don't cross CONSTRUCTOR_PLACEHOLDER_BOUNDARY constructors.
4685 (cxx_eval_constant_expression): Link the 'ctx' context to the 'new_ctx'
4686 context via 'new_ctx.parent' when being expanded without an explicit
4687 target. Don't call replace_placeholders.
4688 (cxx_eval_outermost_constant_expr): Initialize 'ctx.parent' to NULL.
4692 * constexpr.c (get_or_insert_ctor_field): Split out (while adding
4693 support for VECTOR_TYPEs, and optimizations for the common case)
4695 (cxx_eval_store_expression): ... here. Rename local variable
4696 'changed_active_union_member_p' to 'activated_union_member_p'. Record
4697 the sequence of indexes into 'indexes' that yields the subobject we're
4698 assigning to. Record the integer offsets of the constructor indexes
4699 we're assigning through into 'index_pos_hints'. After evaluating the
4700 initializer of the store expression, recompute 'valp' using 'indexes'
4701 and using 'index_pos_hints' as hints.
4702 (cxx_eval_bare_aggregate): Tweak comments. Use get_or_insert_ctor_field
4703 to recompute the constructor_elt pointer we're assigning through after
4704 evaluating each initializer.
4706 2020-04-04 Jason Merrill <jason@redhat.com>
4709 * constraint.cc (tsubst_valid_expression_requirement): Call
4712 2020-04-04 Jason Merrill <jason@redhat.com>
4715 * constexpr.c (maybe_constant_value): Use break_out_target_exprs.
4716 * expr.c (mark_use) [VIEW_CONVERT_EXPR]: Don't wrap a TARGET_EXPR in
4719 2020-04-04 Jakub Jelinek <jakub@redhat.com>
4722 * parser.c (cp_parser_omp_for_loop): Use
4723 protected_set_expr_location_if_unset.
4724 * cp-gimplify.c (genericize_if_stmt, genericize_cp_loop): Likewise.
4727 * pt.c (tsubst_expr) <case OMP_MASTER>: Clear
4728 omp_parallel_combined_clauses.
4730 2020-04-03 Jason Merrill <jason@redhat.com>
4733 * pt.c (complex_pack_expansion_r): New.
4734 (complex_alias_template_p): Use it.
4736 2020-03-31 Jason Merrill <jason@redhat.com>
4739 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Call
4740 replace_placeholders.
4741 * typeck2.c (store_init_value): Fix arguments to
4742 fold_non_dependent_expr.
4744 2020-03-31 Jason Merrill <jason@redhat.com>
4746 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Use
4749 2020-03-30 Jason Merrill <jason@redhat.com>
4752 * tree.c (cp_tree_equal) [CALL_EXPR]: Compare KOENIG_LOOKUP_P.
4753 (called_fns_equal): Check DECL_CONTEXT.
4755 2020-03-30 Jakub Jelinek <jakub@redhat.com>
4758 * semantics.c (add_stmt): Only set STMT_IS_FULL_EXPR_P on trees with
4759 STATEMENT_CODE_P code.
4761 2020-03-28 Patrick Palka <ppalka@redhat.com>
4764 * parser.c (cp_parser_requires_clause_opt): Diagnose and recover from
4765 "requires {" when "requires requires {" was probably intended.
4768 * constraint.cc (tsubst_compound_requirement): Always suppress errors
4769 from type_deducible_p and expression_convertible_p, as they're not
4770 substitution errors.
4771 (diagnose_atomic_constraint) <case INTEGER_CST>: Remove this case so
4772 that we diagnose INTEGER_CST expressions of non-bool type via the
4774 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: New case.
4775 * parser.c (cp_parser_requires_expression): Always parse the requirement
4776 body as if we're processing a template, by temporarily incrementing
4777 processing_template_decl. Afterwards, if we're not actually in a
4778 template context, perform semantic processing to diagnose any invalid
4779 types and expressions.
4780 * pt.c (tsubst_copy_and_build) <case REQUIRES_EXPR>: Remove dead code.
4781 * semantics.c (finish_static_assert): Explain an assertion failure
4782 when the condition is a REQUIRES_EXPR like we do when it is a concept
4785 * constraint.cc (diagnose_compound_requirement): When diagnosing a
4786 compound requirement, maybe replay the satisfaction failure, subject to
4787 the current diagnosis depth.
4789 * constraint.cc (finish_constraint_binary_op): Set the location of EXPR
4790 as well as its range, because build_x_binary_op doesn't always do so.
4791 (current_constraint_diagnosis_depth): New.
4792 (concepts_diagnostics_max_depth_exceeded_p): New.
4793 (collect_operands_of_disjunction): New.
4794 (satisfy_disjunction): When diagnosing a satisfaction failure, maybe
4795 replay each branch of the disjunction, subject to the current diagnosis
4797 (diagnose_valid_expression): When diagnosing a satisfaction failure,
4798 maybe replay the substitution error, subject to the current diagnosis
4800 (diagnose_valid_type): Likewise.
4801 (diagnose_nested_requiremnet): Likewise.
4802 (diagnosing_failed_constraint::diagnosing_failed_constraint): Increment
4803 current_constraint_diagnosis_depth when diagnosing.
4804 (diagnosing_failed_constraint::~diagnosing_failed_constraint): Decrement
4805 current_constraint_diagnosis_depth when diagnosing.
4806 (diagnosing_failed_constraint::replay_errors_p): New static member
4808 (diagnose_constraints): Don't diagnose if concepts_diagnostics_max_depth
4809 is 0. Emit a one-off note to increase -fconcepts-diagnostics-depth if
4810 the limit was exceeded.
4811 * cp-tree.h (diagnosing_failed_constraint::replay_errors_p): Declare.
4813 2020-03-27 Nathan Sidwell <nathan@acm.org>
4816 * name-lookup.c (do_pushdecl): Look through cleanp levels.
4818 2020-03-27 Martin Sebor <msebor@redhat.com>
4823 * cp-tree.h (most_specialized_partial_spec): Declare.
4824 * parser.c (cp_parser_elaborated_type_specifier): Distinguish alias
4826 (specialization_of): New function.
4827 (cp_parser_check_class_key): Move code...
4828 (class_decl_loc_t::add): ...to here. Add parameters. Avoid issuing
4829 -Wredundant-tags on first-time declarations in other declarators.
4830 Correct handling of template specializations.
4831 (class_decl_loc_t::diag_mismatched_tags): Also expect to be called
4832 when -Wredundant-tags is enabled. Use primary template or partial
4833 specialization as the guide for uses of implicit instantiations.
4834 * pt.c (most_specialized_partial_spec): Declare extern.
4836 2020-03-27 Nathan Sidwell <nathan@acm.org>
4839 * name-lookup.c (push_namespace): Triage ambiguous lookups that
4842 2020-03-27 Jakub Jelinek <jakub@redhat.com>
4845 * call.c (set_flags_from_callee): Don't update
4846 cp_function_chain->can_throw or current_function_returns_abnormally
4847 if cp_unevaluated_operand.
4850 * cvt.c (ocp_convert): Handle COMPOUND_EXPR by recursion on the second
4851 operand and creating a new COMPOUND_EXPR if anything changed.
4853 2020-03-26 Marek Polacek <polacek@redhat.com>
4855 PR c++/94336 - template keyword accepted before destructor names.
4856 * parser.c (cp_parser_unqualified_id): Give an error when 'template'
4857 is followed by a destructor name.
4859 2020-03-27 Patrick Palka <ppalka@redhat.com>
4861 * decl.c (compute_array_index_type_loc): Remove redundant
4862 type_dependent_expression_p check that is subsumed by
4863 value_dependent_expression_p.
4864 * decl2.c (is_late_template_attribute): Likewise.
4865 * pt.c (uses_template_parms): Likewise.
4866 (dependent_template_arg_p): Likewise.
4868 2020-03-26 Marek Polacek <polacek@redhat.com>
4871 PR c++/94057 - template keyword in a typename-specifier.
4872 * parser.c (check_template_keyword_in_nested_name_spec): New.
4873 (cp_parser_nested_name_specifier_opt): Implement DR1710, optional
4874 'template'. Call check_template_keyword_in_nested_name_spec.
4875 (cp_parser_simple_type_specifier): Assume that a <
4876 following a qualified-id in a typename-specifier begins
4877 a template argument list.
4879 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
4881 * coroutines.cc (coro_init_identifiers): Initialize an identifier
4882 for the cororoutine handle 'address' method name.
4883 (struct coro_aw_data): Add fields to cover the continuations.
4884 (co_await_expander): Determine the kind of await_suspend in use.
4885 If we have the case that returns a continuation handle, then save
4886 this and make the target for 'scope exit without cleanup' be the
4887 continuation resume label.
4888 (expand_co_awaits): Remove.
4889 (struct suspend_point_info): Remove fields that kept the returned
4890 await_suspend handle type.
4891 (transform_await_expr): Remove code tracking continuation handles.
4892 (build_actor_fn): Add the continuation handle as an actor-function
4893 scope var. Build the symmetric transfer continuation point. Call
4894 the tree walk for co_await expansion directly, rather than via a
4895 trivial shim function.
4896 (register_await_info): Remove fields tracking continuation handles.
4897 (get_await_suspend_return_type): Remove.
4898 (register_awaits): Remove code tracking continuation handles.
4899 (morph_fn_to_coro): Remove code tracking continuation handles.
4901 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
4903 * coroutines.cc (co_await_expander): If we are expanding the
4904 initial await expression, set a boolean flag to show that we
4905 have now reached the initial await_resume() method call.
4906 (expand_co_awaits): Handle the 'initial await resume called' flag.
4907 (build_actor_fn): Insert the initial await expression into the
4908 start of the user-authored function-body. Handle the 'initial await
4909 resume called' flag.
4910 (morph_fn_to_coro): Initialise the 'initial await resume called'
4911 flag. Modify the unhandled exception catch clause to recognise
4912 exceptions that occur before the initial await_resume() and re-
4915 2020-03-26 Jakub Jelinek <jakub@redhat.com>
4918 * class.c (user_provided_p): Use STRIP_TEMPLATE instead of returning
4919 true for all TEMPLATE_DECLs.
4922 * cp-gimplify.c (cp_genericize_r): Handle STATEMENT_LIST.
4924 2020-03-25 Patrick Palka <ppalka@redhat.com>
4927 * parser.c (cp_parser_selection_statement) <case RID_IF>: Invalidate the
4928 current condition chain when the if-statement has a non-empty
4931 2020-03-25 Iain Sandoe <iain@sandoe.co.uk>
4934 * coroutines.cc (captures_temporary): Fix a missing dereference.
4936 2020-03-24 Marek Polacek <polacek@redhat.com>
4938 PR c++/94190 - wrong no post-decrement operator error in template.
4939 * call.c (convert_like_real): Use convert_from_reference on the result.
4941 2020-03-24 Jason Merrill <jason@redhat.com>
4944 * constraint.cc (constraint_satisfaction_value): Repeat noisily on
4946 (tsubst_nested_requirement): Likewise.
4947 (get_constraint_error_location): Allow missing context.
4948 (diagnose_atomic_constraint): Diagnose non-bool constraint here.
4949 (satisfy_atom): Not here. Only diagnose non-constant when noisy.
4951 2020-03-24 Jason Merrill <jason@redhat.com>
4953 * pt.c (any_template_parm_r): Look into the type of a non-type
4956 2020-03-24 Jason Merrill <jason@redhat.com>
4958 * cp-tree.h (cp_expr): When constructing from an expr and a
4959 location, call protected_set_expr_location.
4961 2020-03-23 Patrick Palka <ppalka@redhat.com>
4964 * except.c (maybe_noexcept_warning): Add TODO.
4965 * method.c (walk_field_subobs): Pass tf_none to expr_noexcept_p.
4967 2020-03-23 nathans <nathan@acm.org>
4970 * tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
4973 2020-03-21 Patrick Palka <ppalka@redhat.com>
4976 * constexpr.c (reduced_constant_expression_p) [CONSTRUCTOR]: Properly
4977 handle unions without an initializer.
4978 (cxx_eval_component_reference): Emit a different diagnostic when the
4979 constructor element corresponding to a union member is NULL.
4980 (cxx_eval_bare_aggregate): When constructing a union, always set the
4981 active union member before evaluating the initializer. Relax assertion
4982 that verifies the index of the constructor element we're initializing
4983 hasn't been changed.
4984 (cxx_eval_store_expression): Diagnose changing the active union member
4985 while the union is in the process of being initialized. After setting
4986 an active union member, clear CONSTRUCTOR_NO_CLEARING on the underlying
4988 (cxx_eval_constant_expression) [PLACEHOLDER_EXPR]: Don't re-reduce a
4989 CONSTRUCTOR returned by lookup_placeholder.
4991 2020-03-20 Patrick Palka <ppalka@redhat.com>
4993 * cxx-pretty-print.c (pp_cxx_parameter_mapping): Make extern. Move
4994 the "[with ]" bits to here from ...
4995 (pp_cxx_atomic_constraint): ... here.
4996 * cxx-pretty-print.h (pp_cxx_parameter_mapping): Declare.
4997 * error.c (rebuild_concept_check): Delete.
4998 (print_concept_check_info): Print the dependent form of the constraint and the
4999 preferably substituted parameter mapping alongside it.
5001 2020-03-19 Jason Merrill <jason@redhat.com>
5004 * cp-gimplify.c (simple_empty_class_p): Look through
5005 SIMPLE_TARGET_EXPR_P.
5006 (cp_gimplify_expr) [MODIFY_EXPR]: Likewise.
5007 [RETURN_EXPR]: Avoid producing 'return *retval;'.
5008 * call.c (build_call_a): Strip TARGET_EXPR from empty class arg.
5009 * cp-tree.h (SIMPLE_TARGET_EXPR_P): Check that TARGET_EXPR_INITIAL
5012 2020-03-19 Jakub Jelinek <jakub@redhat.com>
5015 * parser.c (cp_parser_omp_var_list_no_open): Call process_outer_var_ref
5016 on outer_automatic_var_p decls.
5017 * cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also for
5018 capture proxy decls.
5020 2020-03-18 Nathan Sidwell <nathan@acm.org>
5022 PR c++/94147 - mangling of lambdas assigned to globals
5023 * parser.c (cp_parser_init_declarator): Namespace-scope variables
5024 provide a lambda scope.
5025 * tree.c (no_linkage_check): Lambdas with a variable for extra
5026 scope have a linkage from the variable.
5028 2020-03-18 Jakub Jelinek <jakub@redhat.com>
5030 * constraint.cc (resolve_function_concept_check, subsumes_constraints,
5031 strictly_subsumes): Fix up duplicated word issue in a comment.
5032 * coroutines.cc (build_init_or_final_await, captures_temporary):
5034 * logic.cc (dnf_size_r, cnf_size_r): Likewise.
5035 * pt.c (append_type_to_template_for_access_check): Likewise.
5038 * decl.c (grokfndecl): Restore old diagnostics about deduction
5039 guide declared in different scope if in_namespace is NULL_TREE.
5041 2020-03-17 Jakub Jelinek <jakub@redhat.com>
5044 * parser.c (cp_parser_enum_specifier): Use temp_override for
5045 parser->colon_corrects_to_scope_p, replace goto out with return.
5046 If scoped enum or enum with underlying type is not followed by
5047 { or ;, call cp_parser_commit_to_tentative_parse before calling
5048 cp_parser_error and make sure to return error_mark_node instead of
5049 NULL_TREE. Formatting fixes.
5051 2020-03-17 Ville Voutilainen <ville.voutilainen@gmail.com>
5054 * method.c (assignable_expr): Use cp_unevaluated.
5055 (is_xible_helper): Push a non-deferred access check for
5056 the stub objects created by assignable_expr and constructible_expr.
5058 2020-03-17 Jakub Jelinek <jakub@redhat.com>
5060 * pt.c (tsubst): Fix up duplicated word issue in a diagnostic message.
5061 (lookup_template_class_1, tsubst_expr): Fix up duplicated word issue
5063 * parser.c (cp_parser_statement, cp_parser_linkage_specification,
5064 cp_parser_placeholder_type_specifier,
5065 cp_parser_constraint_requires_parens): Likewise.
5066 * name-lookup.c (suggest_alternative_in_explicit_scope): Likewise.
5068 2020-03-15 Iain Sandoe <iain@sandoe.co.uk>
5070 * coroutines.cc (co_await_expander): Fix indentation.
5072 2020-03-14 Jason Merrill <jason@redhat.com>
5075 * pt.c (process_partial_specialization): Error rather than crash on
5076 extra pack expansion.
5078 2020-03-14 Jason Merrill <jason@redhat.com>
5081 * pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
5082 DECL_ORIGINAL_TYPE of a typedef.
5084 2020-03-14 Jason Merrill <jason@redhat.com>
5087 * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
5088 substituting DECL_ARGUMENTS.
5090 2020-03-14 Jakub Jelinek <jakub@redhat.com>
5092 * logic.cc (formula::formula): Change "a an" to "an" in a comment.
5093 * parser.c (cp_debug_parser): Change "a an" to "an" in a string
5096 2020-03-13 Patrick Palka <ppalka@redhat.com>
5099 * call.c (build_over_call): Use a warning_sentinel to disable
5100 warn_deprecated_decl before calling build_addr_func.
5102 2020-03-12 Jakub Jelinek <jakub@redhat.com>
5105 * decl.c (reshape_init_array_1): Don't unshare constructor if there
5106 aren't any trailing zero elts, otherwise only unshare the first
5109 2020-03-11 Jason Merrill <jason@redhat.com>
5112 * constraint.cc (tsubst_parameter_mapping): Canonicalize type
5115 2020-03-11 Marek Polacek <polacek@redhat.com>
5116 Jason Merrill <jason@redhat.com>
5118 PR c++/94074 - wrong modifying const object error for COMPONENT_REF.
5119 * constexpr.c (cref_has_const_field): New function.
5120 (modifying_const_object_p): Consider a COMPONENT_REF
5121 const only if any of its fields are const.
5122 (cxx_eval_store_expression): Mark a CONSTRUCTOR of a const type
5123 as readonly after its initialization has been done.
5125 2020-03-10 Marek Polacek <polacek@redhat.com>
5127 PR c++/94124 - wrong conversion error with non-viable overload.
5128 * decl.c (reshape_init_array_1): Unshare a constructor if we
5129 stripped trailing zero-initializers.
5131 2020-03-10 Jason Merrill <jason@redhat.com>
5134 * pt.c (maybe_instantiate_noexcept): Always update clones.
5136 2020-03-10 Jason Merrill <jason@redhat.com>
5139 * pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
5141 2020-03-10 Jason Merrill <jason@redhat.com>
5147 * cp-gimplify.c (cp_gimplify_init_expr): Partially revert patch for
5148 66139: Don't split_nonconstant_init. Remove pre_p parameter.
5150 2020-03-09 Marek Polacek <polacek@redhat.com>
5152 PR c++/92031 - bogus taking address of rvalue error.
5153 PR c++/91465 - ICE with template codes in check_narrowing.
5154 PR c++/93870 - wrong error when converting template non-type arg.
5155 PR c++/94068 - ICE with template codes in check_narrowing.
5156 * call.c (convert_like_real): Return IMPLICIT_CONV_EXPR
5157 in a template when not ck_identity and we're dealing with a class.
5158 (convert_like_real) <case ck_ref_bind>: Return IMPLICIT_CONV_EXPR
5159 in a template if we need a temporary.
5160 * decl.c (compute_array_index_type_loc): Remove
5161 instantiate_non_dependent_expr_sfinae call. Call
5162 fold_non_dependent_expr instead of maybe_constant_value.
5163 (build_explicit_specifier): Don't instantiate or create a sentinel
5164 before converting the expression.
5165 * except.c (build_noexcept_spec): Likewise.
5166 * pt.c (convert_nontype_argument): Don't build IMPLICIT_CONV_EXPR.
5167 Set IMPLICIT_CONV_EXPR_NONTYPE_ARG if that's what
5168 build_converted_constant_expr returned.
5169 * typeck2.c (check_narrowing): Call fold_non_dependent_expr instead
5170 of maybe_constant_value.
5172 2020-03-09 Jakub Jelinek <jakub@redhat.com>
5176 2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
5178 * constexpr.c (cxx_eval_constant_expression): Do not handle
5179 RROTATE_EXPR and LROTATE_EXPR.
5181 2020-03-09 Marek Polacek <polacek@redhat.com>
5183 PR c++/94050 - ABI issue with alignas on armv7hl.
5184 * class.c (layout_class_type): Don't replace a class's
5185 CLASSTYPE_AS_BASE if their TYPE_USER_ALIGN don't match.
5187 2020-03-09 Bin Cheng <bin.cheng@linux.alibaba.com>
5189 * coroutines.cc (build_actor_fn): Factor out code inserting the
5190 default return_void call to...
5191 (morph_fn_to_coro): ...here, also hoist local var declarations.
5193 2020-03-08 Patrick Palka <ppalka@redhat.com>
5196 * call.c (convert_like_real): Check complain before emitting an error
5197 about binding a bit-field to a reference.
5199 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
5200 [TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
5203 2020-03-06 Nathan Sidwell <nathan@acm.org>
5206 * mangle.c (find_substitution): Don't call same_type_p on template
5207 args that cannot match.
5209 2020-03-04 Martin Sebor <msebor@redhat.com>
5212 * tree.c (type_initializer_zero_p): Fail for structs initialized
5215 2020-03-04 Jason Merrill <jason@redhat.com>
5218 * init.c (perform_member_init): Don't do aggregate initialization of
5220 * constexpr.c (cx_check_missing_mem_inits): Don't enforce
5221 initialization of empty field.
5223 2020-03-04 Martin Liska <mliska@suse.cz>
5225 * method.c: Wrap array in ctor with braces in order
5226 to silent clang warnings.
5228 2020-03-03 Jason Merrill <jason@redhat.com>
5229 Marek Polacek <polacek@redhat.com>
5231 PR c++/90505 - mismatch in template argument deduction.
5232 * pt.c (tsubst): Don't reduce the template level of template
5233 parameters when tf_partial.
5235 2020-03-03 Jakub Jelinek <jakub@redhat.com>
5238 * constexpr.c (cxx_eval_constant_expression)
5239 <case TARGET_EXPR, case SAVE_EXPR>: Don't record anything if
5240 *non_constant_p is true.
5242 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
5244 * coroutines.cc (captures_temporary): Strip component_ref
5247 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
5249 * coroutines.cc (finish_co_await_expr): Build co_await_expr
5250 with unknown_type_node.
5251 (finish_co_yield_expr): Ditto.
5252 *pt.c (type_dependent_expression_p): Set co_await/yield_expr
5253 with unknown type as dependent.
5255 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
5257 * coroutines.cc (struct local_var_info): Adjust to remove the
5258 reference to the captured var, and just to note that this is a
5259 lambda capture proxy.
5260 (transform_local_var_uses): Handle lambda captures specially.
5261 (struct param_frame_data): Add a visited set.
5262 (register_param_uses): Also check for param uses in lambda
5264 (struct local_vars_frame_data): Remove captures list.
5265 (register_local_var_uses): Handle lambda capture proxies by
5266 noting and bypassing them.
5267 (morph_fn_to_coro): Update to remove lifetime extension of
5268 lambda capture-by-copy vars.
5270 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
5272 * coroutines.cc (build_co_await): Do not build frame
5273 awaitable proxy vars when the co_await expression is
5274 a function parameter or local var.
5275 (co_await_expander): Do not initialise a frame var with
5277 (transform_await_expr): Only substitute the awaitable
5278 frame var if it's needed.
5279 (register_awaits): Do not make frame copies for param
5280 or local vars that are awaitables.
5282 2020-02-28 Jason Merrill <jason@redhat.com>
5284 Implement P2092R0, Disambiguating Nested-Requirements
5285 * parser.c (cp_parser_requirement_parameter_list): Pass
5286 CP_PARSER_FLAGS_TYPENAME_OPTIONAL.
5288 * call.c (build_user_type_conversion_1): Don't look at the second
5289 conversion of a non-viable candidate.
5291 2020-02-28 Jakub Jelinek <jakub@redhat.com>
5293 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
5294 * typeck.c (cp_build_addr_expr_1): Allow taking address of immediate
5295 functions in unevaluated contexts.
5297 2020-02-27 Nathan Sidwell <nathan@acm.org>
5300 * pt.c (template_args_equal): Pass ARGUMENT_PACKS through to
5302 * tree.c (cp_tree_equal): Compare ARGUMENT_PACKS here,
5303 * typeck.c (comptypes): Assert we don't get any argument packs.
5305 * class.c (adjust_clone_args): Correct arg-checking assert.
5306 * typeck.c (comptypes): Assert not nulls.
5308 2020-02-26 Marek Polacek <polacek@redhat.com>
5310 PR c++/93789 - ICE with invalid array bounds.
5311 * decl.c (compute_array_index_type_loc): Don't use the folded
5312 size when folding cleared TREE_CONSTANT.
5314 2020-02-26 Iain Sandoe <iain@sandoe.co.uk>
5316 * class.c (classtype_has_non_deleted_copy_ctor): New.
5317 * coroutines.cc (struct param_info): Keep track of params
5318 that are references, and cache the original type and whether
5319 the DTOR is trivial.
5320 (build_actor_fn): Handle param copies always, and adjust the
5321 handling for references.
5322 (register_param_uses): Only handle uses here.
5323 (classtype_has_non_deleted_copy_ctor): New.
5324 (morph_fn_to_coro): Adjust param copy handling to match n4849
5325 by reordering ahead of the promise CTOR and always making a
5326 frame copy, even if the param is unused in the coroutine body.
5327 * cp-tree.h (classtype_has_non_deleted_copy_ctor): New.
5329 2020-02-26 Patrick Palka <ppalka@redhat.com>
5331 * constraint.cc (finish_constraint_binary_op): Set expr's location range
5332 to the range of its operands.
5333 (satisfy_atom): Pass MAP instead of ARGS to diagnose_atomic_constraint.
5334 (diagnose_trait_expr): Take the instantiated parameter mapping MAP
5335 instead of the corresponding template arguments ARGS and adjust body
5337 (diagnose_requires_expr): Likewise.
5338 (diagnose_atomic_constraint): Likewise. When printing an atomic
5339 constraint expression, print the instantiated parameter mapping
5341 * cxx-pretty-print.cc (cxx_pretty_printer::expression)
5342 [NONTYPE_ARGUMENT_PACK]: Print braces around a NONTYPE_ARGUMENT_PACK.
5343 (cxx_pretty_printer::type_id): Handle TYPE_ARGUMENT_PACK.
5345 2020-02-26 Marek Polacek <polacek@redhat.com>
5347 PR c++/93676 - value-init crash in template.
5348 * init.c (build_new_1): Don't call build_vec_init in a template.
5350 2020-02-26 Marek Polacek <polacek@redhat.com>
5352 PR c++/93862 - ICE with static_cast when converting from int[].
5353 * call.c (reference_compatible_p): No longer static.
5354 * cp-tree.h (reference_compatible_p): Declare.
5355 * typeck.c (build_static_cast_1): Use reference_compatible_p instead
5356 of reference_related_p.
5358 2020-02-26 Marek Polacek <polacek@redhat.com>
5360 PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
5361 * constexpr.c (reduced_constant_expression_p): Don't crash on a null
5364 2020-02-24 Martin Sebor <msebor@redhat.com>
5367 * parser.c (cp_parser_check_class_key): Avoid issuing -Wredundant-tags
5368 in shared C/C++ code in headers.
5369 Remove a duplicate hunk of code.
5371 2020-02-24 Marek Polacek <polacek@redhat.com>
5373 PR c++/93869 - ICE with -Wmismatched-tags.
5374 * parser.c (cp_parser_check_class_key): Check class_key earlier.
5376 2020-02-24 Marek Polacek <polacek@redhat.com>
5378 PR c++/93712 - ICE with ill-formed array list-initialization.
5379 * call.c (next_conversion): Return NULL for ck_aggr.
5380 (build_aggr_conv): Set u.expr instead of u.next.
5381 (build_array_conv): Likewise.
5382 (build_complex_conv): Likewise.
5383 (conv_get_original_expr): Handle ck_aggr.
5385 2020-02-24 Jakub Jelinek <jakub@redhat.com>
5387 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
5388 * call.c (build_over_call): Don't evaluate immediate functions in
5389 unevaluated operands.
5391 2020-02-24 Jason Merrill <jason@redhat.com>
5393 P0780R2: Resolve lambda init-capture pack grammar.
5394 * parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than
5397 2020-02-22 Marek Polacek <polacek@redhat.com>
5400 * decl.c (grokdeclarator): Use %qs in a diagnostic message.
5402 2020-02-21 Martin Sebor <msebor@redhat.com>
5404 PR gcov-profile/93753
5405 * class.c (check_flexarrays): Tighten up a test for potential members
5406 of anonymous structs or unions.
5408 2020-02-20 Martin Sebor <msebor@redhat.com>
5411 * parser.c (cp_parser_check_class_key): Only handle true C++ class-keys.
5413 2020-02-20 Martin Liska <mliska@suse.cz>
5415 PR translation/93841
5416 * config/or1k/or1k.opt: Remove superfluous word.
5417 * doc/invoke.texi: Likewise.
5419 2020-02-20 Martin Liska <mliska@suse.cz>
5421 PR translation/93838
5422 * parser.c (cp_parser_decl_specifier_seq): Remove trailing space.
5424 2020-02-19 Marek Polacek <polacek@redhat.com>
5426 PR c++/93169 - wrong-code with a non-constexpr constructor.
5427 * constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY
5428 on constant CONSTRUCTORs.
5430 2020-02-15 Marek Polacek <polacek@redhat.com>
5432 PR c++/93710 - poor diagnostic for array initializer.
5433 * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
5436 2020-02-15 Jason Merrill <jason@redhat.com>
5439 * pt.c (any_template_parm_r): Look into lambda body.
5442 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
5444 2020-02-14 Jakub Jelinek <jakub@redhat.com>
5447 * class.c (enum_min_precision): Change prec type from int to int &.
5450 * cp-tree.h (enum cp_tree_index): Add CPTI_FALLBACK_DFLOAT32_TYPE,
5451 CPTI_FALLBACK_DFLOAT64_TYPE and CPTI_FALLBACK_DFLOAT128_TYPE.
5452 (fallback_dfloat32_type, fallback_dfloat64_type,
5453 fallback_dfloat128_type): Define.
5454 * mangle.c (write_builtin_type): Handle fallback_dfloat*_type like
5456 * rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
5457 is disabled for compatibility.
5459 2020-02-13 Jason Merrill <jason@redhat.com>
5462 * name-lookup.c (matching_fn_p): A function does not match a
5467 * tree.c (decl_linkage): Always lk_none for locals.
5469 2020-02-12 Jason Merrill <jason@redhat.com>
5473 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
5474 * pt.c (find_parameter_packs_r): Not here.
5476 2020-02-12 Iain Sandoe <iain@sandoe.co.uk>
5478 * coroutines.cc (build_actor_fn): Implement deallocation function
5479 selection per n4849, dcl.fct.def.coroutine bullet 12.
5480 (morph_fn_to_coro): Implement allocation function selection per
5481 n4849, dcl.fct.def.coroutine bullets 9 and 10.
5483 2020-02-12 Marek Polacek <polacek@redhat.com>
5485 PR c++/93684 - ICE-on-invalid with broken attribute.
5486 * parser.c (cp_parser_std_attribute): Peek a token first before
5489 2020-02-11 Jason Merrill <jason@redhat.com>
5492 * class.c (add_implicitly_declared_members): Use do_friend.
5493 * method.c (implicitly_declare_fn): Fix friend handling.
5494 (decl_remember_implicit_trigger_p): New.
5495 (synthesize_method): Use it.
5496 * decl2.c (mark_used): Use it.
5498 2020-02-11 Jason Merrill <jason@redhat.com>
5502 * constexpr.c (maybe_constant_value): Correct earlier change.
5503 (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
5504 * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.
5506 2020-02-12 Patrick Palka <ppalka@redhat.com>
5510 * type-utils.h (find_type_usage): Refactor to take a tree * and to
5511 return a tree *, and update documentation accordingly.
5512 * pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
5513 decltype(auto) node.
5514 (make_constrained_decltype_auto): No need to explicitly set
5515 AUTO_IS_DECLTYPE anymore.
5516 (splice_late_return_type): Use find_type_usage to find and
5517 replace a possibly nested auto node instead of using is_auto.
5518 Check test for is_auto into an assert when deciding whether
5519 to late_return_type.
5520 (type_uses_auto): Adjust the call to find_type_usage.
5521 * parser.c (cp_parser_decltype): No need to explicitly set
5522 AUTO_IS_DECLTYPE anymore.
5524 * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
5525 (dump_simple_decl): Handle standard concept definitions as well as
5526 variable concept definitions.
5528 2020-02-10 Jakub Jelinek <jakub@redhat.com>
5531 * error.c (dump_decl_name): Fix up last argument to strncmp.
5533 2020-02-10 Jason Merrill <jason@redhat.com>
5536 * tree.c (array_of_unknown_bound_p): New.
5537 * init.c (perform_member_init): Do nothing for flexible arrays.
5539 2020-02-09 Jakub Jelinek <jakub@redhat.com>
5542 * constexpr.c (cxx_eval_constant_expression): If obj is heap var with
5543 ARRAY_TYPE, use the element type. Punt if objtype after that is not
5546 2020-02-08 Jason Merrill <jason@redhat.com>
5549 * expr.c (fold_for_warn): Call maybe_constant_value.
5550 * constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
5551 (maybe_constant_value): Add uid_sensitive parm.
5552 (get_fundef_copy): Don't copy if it's true.
5553 (cxx_eval_call_expression): Don't instantiate if it's true.
5554 (cxx_eval_outermost_constant_expr): Likewise.
5557 * constexpr.c (maybe_constant_value): Don't unshare if the cached
5558 value is the same as the argument.
5560 * typeck.c (maybe_warn_about_returning_address_of_local): Add
5563 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
5566 2020-02-08 Jakub Jelinek <jakub@redhat.com>
5569 * constexpr.c (find_array_ctor_elt): If last element has no index,
5570 for flag_checking verify all elts have no index. If i is within the
5571 elts, return it directly, if it is right after the last elt, append
5572 if NULL index, otherwise force indexes on all elts.
5573 (cxx_eval_store_expression): Allow cep->index to be NULL.
5575 2020-02-07 Marek Polacek <polacek@redhat.com>
5577 PR c++/92947 - Paren init of aggregates in unevaluated context.
5578 * call.c (build_new_method_call_1): Don't check
5579 cp_unevaluated_operand. Check the return value of digest_init.
5581 2020-02-06 Jason Merrill <jason@redhat.com>
5584 * tree.c (cp_walk_subtrees): Walk into type template arguments.
5585 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
5586 instead of TYPE_ALIAS_P.
5587 * pt.c (push_template_decl_real): Likewise.
5588 (find_parameter_packs_r): Likewise. Remove dead code.
5589 * error.c (find_typenames_r): Remove dead code.
5591 2020-02-06 Jason Merrill <jason@redhat.com>
5594 * parser.c (cp_parser_constraint_primary_expression): Do the main
5595 parse non-tentatively.
5597 2020-02-06 Marek Polacek <polacek@redhat.com>
5599 PR c++/93597 - ICE with lambda in operator function.
5600 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
5602 2020-02-05 Jason Merrill <jason@redhat.com>
5605 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
5606 handling of TREE_CHAIN for empty pack.
5608 2020-02-05 Jakub Jelinek <jakub@redhat.com>
5611 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
5612 prior to passing it to c_build_vec_convert.
5614 2020-02-05 Marek Polacek <polacek@redhat.com>
5616 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
5617 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
5620 2020-02-05 Jason Merrill <jason@redhat.com>
5623 * decl.c (grokdeclarator): Reject field of current class type even
5626 2020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
5628 * coroutines.cc (maybe_promote_captured_temps): Increase the index
5629 number for temporary variables' name.
5631 2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
5633 * coroutines.cc (build_co_await): Call convert_from_reference
5634 to wrap co_await_expr with indirect_ref which avoid
5635 reference/non-reference type confusion.
5637 (co_await_expander): Sink to call_expr if await_resume
5638 is wrapped by indirect_ref.
5640 2020-02-04 Jason Merrill <jason@redhat.com>
5643 * constraint.cc (satisfy_declaration_constraints): Check return
5644 value of push_tinst_level.
5647 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
5648 elements instead of value-initializing them.
5651 * init.c (perform_member_init): Simplify.
5652 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
5654 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
5656 2020-02-04 Iain Sandoe <iain@sandoe.co.uk>
5658 * coroutines.cc (find_promise_type): Delete unused forward
5660 (struct coroutine_info): Add a bool for no promise type error.
5661 (coro_promise_type_found_p): Only emit the error for a missing
5662 promise once in each affected coroutine.
5664 2020-02-03 Jason Merrill <jason@redhat.com>
5667 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
5668 defer loading the value of a reference.
5670 2020-02-03 Jason Merrill <jason@redhat.com>
5673 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
5675 [COMPONENT_REF]: A member function reference doesn't use the object
5678 2020-02-03 Iain Sandoe <iain@sandoe.co.uk>
5681 * coroutines.cc (struct coroutine_info): Add a bool flag to note
5682 that we emitted an error for a bad function return type.
5683 (get_coroutine_info): Tolerate an unset info table in case of
5685 (find_coro_traits_template_decl): In case of error or if we didn't
5686 find a type template, note we emitted the error and suppress
5688 (find_coro_handle_template_decl): Likewise.
5689 (instantiate_coro_traits): Only check for error_mark_node in the
5690 return from lookup_qualified_name.
5691 (coro_promise_type_found_p): Reorder initialization so that we check
5692 for the traits and their usability before allocation of the info
5693 table. Check for a suitable return type and emit a diagnostic for
5694 here instead of relying on the lookup machinery. This allows the
5695 error to have a better location, and means we can suppress multiple
5697 (coro_function_valid_p): Re-check for a valid promise (and thus the
5698 traits) before proceeding. Tolerate missing info as a fatal error.
5700 2020-02-03 Jason Merrill <jason@redhat.com>
5703 * cp-gimplify.c (predeclare_vla): New.
5704 (cp_genericize_r) [NOP_EXPR]: Call it.
5706 2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
5708 * coroutines.cc (transform_await_wrapper): Set actor funcion as
5709 new context of label_decl.
5710 (build_actor_fn): Fill new field of await_xform_data.
5712 2020-02-02 Marek Polacek <polacek@redhat.com>
5714 PR c++/93530 - ICE on invalid alignas in a template.
5715 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
5718 2020-01-31 Jason Merrill <jason@redhat.com>
5721 * semantics.c (process_outer_var_ref): Capture VLAs even in
5722 unevaluated context.
5725 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
5726 non-aggregate elements.
5727 (reshape_init_array): Add first_initializer_p parm.
5728 (reshape_init_r): Change first_initializer_p from bool to tree.
5729 (reshape_init): Pass init to it.
5732 * parser.c (cp_parser_initializer_list): Suppress location wrappers
5735 2020-01-29 Jason Merrill <jason@redhat.com>
5738 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
5739 the expression was dependent before substitution.
5741 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
5743 * coroutines.cc (act_des_fn): New.
5744 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
5745 Access promise via actor function's frame pointer argument.
5746 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
5748 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
5750 * coroutines.cc (co_await_expander): Handle type conversion case.
5752 2020-01-29 Jason Merrill <jason@redhat.com>
5757 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
5758 a trailing return type.
5759 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
5762 2020-01-29 Marek Polacek <polacek@redhat.com>
5764 PR c++/91754 - Fix template arguments comparison with class NTTP.
5765 * pt.c (class_nttp_const_wrapper_p): New.
5766 (template_args_equal): See through class_nttp_const_wrapper_p
5769 2020-01-29 Marek Polacek <polacek@redhat.com>
5771 PR c++/92948 - Fix class NTTP with template arguments.
5772 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
5773 converting a value-dependent expression to a class type.
5774 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
5775 as the result of the tsubst_copy call.
5777 2020-01-29 Jakub Jelinek <jakub@redhat.com>
5780 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
5781 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
5783 2020-01-28 Jason Merrill <jason@redhat.com>
5786 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
5790 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
5793 * call.c (build_user_type_conversion_1): Allow a template conversion
5794 returning an rvalue reference to bind directly to an lvalue.
5797 * decl.c (grokdeclarator): Propagate eh spec from typedef.
5799 2020-01-28 Martin Liska <mliska@suse.cz>
5802 * pt.c (redeclare_class_template): Group couple of
5803 errors and inform messages with auto_diagnostic_group.
5805 2020-01-28 Martin Liska <mliska@suse.cz>
5808 * pt.c (redeclare_class_template): Use inform
5809 for the second location.
5811 2020-01-27 Jason Merrill <jason@redhat.com>
5814 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
5816 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
5819 * coroutines.cc (morph_fn_to_coro): Check the ramp return
5820 value when it is constructed from the 'get return object'.
5822 2020-01-27 Nathan Sidwell <nathan@acm.org>
5825 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
5827 2020-01-26 Jason Merrill <jason@redhat.com>
5830 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
5831 temporarily enable -Wsystem-headers. Change second warning to
5835 * semantics.c (finish_call_expr): Don't call
5836 instantiate_non_dependent_expr before warn_for_memset.
5838 2020-01-25 Marek Polacek <polacek@redhat.com>
5840 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
5841 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
5842 dynamic_cast diagnostic.
5844 2020-01-24 Jason Merrill <jason@redhat.com>
5846 PR c++/93400 - ICE with constrained friend.
5847 * constraint.cc (maybe_substitute_reqs_for): New.
5848 * decl.c (function_requirements_equivalent_p): Call it.
5849 * pt.c (tsubst_friend_function): Only substitute
5850 TEMPLATE_PARMS_CONSTRAINTS.
5851 (tsubst_template_parms): Copy constraints.
5853 2020-01-24 Jason Merrill <jason@redhat.com>
5855 PR c++/93279 - ICE with lambda in member operator.
5856 * name-lookup.c (maybe_save_operator_binding): Don't remember
5857 class-scope bindings.
5859 2020-01-24 Jason Merrill <jason@redhat.com>
5861 PR c++/93377 - ICE with member alias in constraint.
5862 * pt.c (any_template_parm_r): Look at template arguments for all
5863 aliases, not only alias templates.
5865 2020-01-24 Marek Polacek <polacek@redhat.com>
5867 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
5868 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
5870 2020-01-24 Jason Merrill <jason@redhat.com>
5872 PR c++/92852 - ICE with generic lambda and reference var.
5873 * constexpr.c (maybe_constant_value): Likewise.
5875 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
5878 * parser.c (cp_parser_nested_name_specifier_opt): Properly
5879 diagnose concept-ids.
5881 2020-01-23 Jason Merrill <jason@redhat.com>
5883 PR c++/93331 - ICE with __builtin_strchr.
5884 * constexpr.c (cxx_eval_builtin_function_call): Use the original
5885 argument if we didn't manage to extract a STRING_CST.
5887 PR c++/93345 - ICE with defaulted dtor and template.
5889 * decl.c (cxx_maybe_build_cleanup): Don't try to set
5890 throwing_cleanup in a template.
5892 2020-01-22 Marek Polacek <polacek@redhat.com>
5894 PR c++/92907 - noexcept does not consider "const" in member functions.
5895 * g++.dg/cpp0x/noexcept56.C: New test.
5897 2020-01-22 Marek Polacek <polacek@redhat.com>
5899 PR c++/93324 - ICE with -Wall on constexpr if.
5900 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
5902 2020-01-22 Patrick Palka <ppalka@redhat.com>
5904 * constraint.cc (get_mapped_args): Avoid using auto_vec
5905 as a vector element. Release the vectors inside the lists
5907 * parser.c (cp_literal_operator_id): Free the buffer.
5909 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
5911 * coroutines.cc (finish_co_await_expr): Add error check on return
5912 value of build_co_await.
5913 (finish_co_yield_expr,): Ditto.
5915 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
5917 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
5918 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
5919 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
5921 2020-01-21 Jason Merrill <jason@redhat.com>
5923 PR c++/60855 - ICE with sizeof VLA capture.
5924 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
5926 PR c++/90732 - ICE with VLA capture and generic lambda.
5927 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
5929 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
5930 Bin Cheng <bin.cheng@linux.alibaba.com>
5932 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
5933 from complete_type_or_else.
5934 (register_param_uses): Likewise.
5935 (build_co_await): Do not try to use complete_type_or_else for void
5936 types, otherwise for incomplete types, check for NULL return from
5937 complete_type_or_else.
5939 2020-01-21 Jason Merrill <jason@redhat.com>
5941 PR c++/91476 - anon-namespace reference temp clash between TUs.
5942 * decl2.c (copy_linkage): Factor out of get_guard.
5943 * call.c (make_temporary_var_for_ref_to_temp): Use it.
5944 * decl.c (cp_finish_decomp): Use it.
5945 (cp_finish_decl): determine_visibility sooner.
5947 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
5949 * coroutines.cc (finish_co_await_expr): Set return value flag.
5950 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
5952 2020-01-19 Jason Merrill <jason@redhat.com>
5954 PR c++/33799 - destroy return value, take 2.
5955 * cp-tree.h (current_retval_sentinel): New macro.
5956 (struct language_function): Add throwing_cleanup bitfield.
5957 * decl.c (cxx_maybe_build_cleanup): Set it.
5958 * except.c (maybe_set_retval_sentinel)
5959 (maybe_splice_retval_cleanup): New functions.
5960 * parser.c (cp_parser_compound_statement): Call
5961 maybe_splice_retval_cleanup.
5962 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
5964 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
5966 2020-01-18 Jakub Jelinek <jakub@redhat.com>
5968 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
5969 but non-NO_DOLLAR_IN_LABEL case build.
5971 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
5973 * Make-lang.in: Add coroutines.o.
5974 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
5975 (DECL_COROUTINE_P): New.
5976 * lex.c (init_reswords): Enable keywords when the coroutine flag
5978 * operators.def (co_await): New operator.
5979 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
5980 (op_error): Likewise.
5981 (build_new_op_1): Likewise.
5982 (build_new_function_call): Validate coroutine builtin arguments.
5983 * constexpr.c (potential_constant_expression_1): Handle
5984 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
5985 * coroutines.cc: New file.
5986 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
5987 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
5988 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
5989 * cp-tree.h (coro_validate_builtin_call): New.
5990 * decl.c (emit_coro_helper): New.
5991 (finish_function): Handle the case when a function is found to
5992 be a coroutine, perform the outlining and emit the outlined
5993 functions. Set a bit to signal that this is a coroutine component.
5994 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
5995 (cp_parser_unary_expression): Handle co_await.
5996 (cp_parser_assignment_expression): Handle co_yield.
5997 (cp_parser_statement): Handle RID_CO_RETURN.
5998 (cp_parser_jump_statement): Handle co_return.
5999 (cp_parser_operator): Handle co_await operator.
6000 (cp_parser_yield_expression): New.
6001 (cp_parser_required_error): Handle RT_CO_YIELD.
6002 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
6003 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
6005 * tree.c (cp_walk_subtrees): Likewise.
6007 2020-01-17 Jason Merrill <jason@redhat.com>
6009 PR c++/92531 - ICE with noexcept(lambda).
6010 * pt.c (uses_template_parms): Don't try to enumerate all the
6013 2020-01-17 Jakub Jelinek <jakub@redhat.com>
6016 * parser.c (cp_parser_template_name): Look up deprecated attribute
6017 in DECL_TEMPLATE_RESULT or its type's attributes.
6019 2020-01-16 Jason Merrill <jason@redhat.com>
6021 PR c++/93286 - ICE with __is_constructible and variadic template.
6022 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
6023 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
6025 PR c++/93280 - ICE with aggregate assignment and DMI.
6026 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
6027 * typeck2.c (digest_nsdmi_init): Not here.
6029 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
6032 * cp-tree.h (is_constrained_auto): New.
6033 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
6034 handle concept-check expressions; take a cp_decl_specifier_seq*
6036 (cp_parser_condition): Update call.
6037 (cp_parser_simple_declaration): Likewise.
6038 (cp_parser_placeholder_type_specifier): Correctly handle
6039 concept-check expressions.
6041 2020-01-15 Jason Merrill <jason@redhat.com>
6044 PR c++/33799 - destroy return value if local cleanup throws.
6045 * cp-tree.h (current_retval_sentinel): New macro.
6046 * decl.c (start_preparsed_function): Set up cleanup for retval.
6047 * typeck.c (check_return_expr): Set current_retval_sentinel.
6049 PR c++/93257 - consteval void function.
6050 * constexpr.c (verify_constant): Allow void_node.
6052 PR c++/92871 - bad code with xvalue and GNU ?: extension.
6053 * call.c (prevent_lifetime_extension): New.
6054 (build_conditional_expr_1): Use it.
6056 2020-01-14 Nathan Sidwell <nathan@acm.org>
6059 * pt.c (retrieve_specialization): Use get_template_info, not open
6063 * pt.c (retrieve_specialization): Get the TI from the decl or the
6064 classtype as appropriate.
6066 2020-01-14 David Malcolm <dmalcolm@redhat.com>
6068 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
6069 New static constant.
6070 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
6071 (struct named_label_hash::empty_zero_p): Likewise.
6072 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
6074 2020-01-14 Jason Merrill <jason@redhat.com>
6076 PR c++/92590 - wrong handling of inherited default ctor.
6077 * class.c (add_method): A constrained inherited ctor doesn't hide an
6078 implicit derived ctor.
6080 PR c++/92552 - ICE with inherited constrained default ctor.
6081 * pt.c (instantiate_class_template_1): Copy
6082 TYPE_HAS_USER_CONSTRUCTOR.
6083 PR c++/91930 - ICE with constrained inherited default ctor.
6084 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
6085 for inherited constructor.
6086 PR c++/92594 - ICE with inherited trivial default ctor.
6087 * method.c (trivial_fn_p): Treat an inherited default constructor
6088 like a normal default constructor.
6090 PR c++/92594 - ICE with inherited trivial default ctor.
6091 * method.c (trivial_fn_p): Treat an inherited default constructor
6092 like a normal default constructor.
6094 PR c++/92009 - ICE with punning of typeid.
6095 * rtti.c (get_tinfo_desc): Call xref_basetypes.
6096 * constexpr.c (cxx_fold_indirect_ref): Don't strip
6099 2020-01-13 Jason Merrill <jason@redhat.com>
6101 PR c++/92746 - ICE with noexcept of function concept check.
6102 * except.c (check_noexcept_r): Handle concept-check.
6104 PR c++/92582 - ICE with member template as requirement.
6105 * pt.c (struct find_template_parameter_info): Add ctx_parms.
6106 (any_template_parm_r): Handle TEMPLATE_DECL.
6107 (find_template_parameters): Take parms instead of their depth.
6108 * constraint.cc (build_parameter_mapping): Pass them.
6110 PR c++/33799 - destroy return value if local cleanup throws.
6111 * cp-tree.h (current_retval_sentinel): New macro.
6112 * decl.c (start_preparsed_function): Set up cleanup for retval.
6113 * typeck.c (check_return_expr): Set current_retval_sentinel.
6115 PR c++/93238 - short right-shift with enum.
6116 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
6118 2020-01-10 Jason Merrill <jason@redhat.com>
6120 * typeck.c (cp_build_binary_op): Restore short_shift code.
6122 PR c++/93143 - incorrect tree sharing with constexpr.
6123 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
6124 CONSTRUCTORs are already unshared.
6126 PR c++/93173 - incorrect tree sharing.
6128 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
6129 copy_if_shared after cp_genericize_tree.
6130 * typeck2.c (split_nonconstant_init): Don't unshare here.
6132 2020-01-08 Jason Merrill <jason@redhat.com>
6134 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
6135 TARGET_EXPR_DIRECT_INIT_P.
6136 * constexpr.c (cxx_eval_constant_expression): Likewise.
6138 2020-01-08 Jason Merrill <jason@redhat.com>
6140 PR c++/91369 - constexpr destructor and member initializer.
6141 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
6142 when not preevaluating.
6144 2020-01-08 Jason Merrill <jason@redhat.com>
6146 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
6149 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
6151 * init.c (build_new): Add location_t parameter and use it throughout.
6152 (build_raw_new_expr): Likewise.
6153 * parser.c (cp_parser_new_expression): Pass the combined_loc.
6154 * pt.c (tsubst_copy_and_build): Adjust call.
6155 * cp-tree.h: Update declarations.
6157 2020-01-07 Jason Merrill <jason@redhat.com>
6159 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
6160 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
6161 explicit class visibility for a template.
6163 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
6165 * mangle.c (mangle_type_attribute_p): New function, split out from...
6166 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
6167 that contain a space.
6169 2020-01-07 Jakub Jelinek <jakub@redhat.com>
6172 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
6173 member, initialize it to zero in ctor.
6174 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
6175 a heap object. Don't cache calls to functions which allocate some
6176 heap objects and don't deallocate them or deallocate some heap
6177 objects they didn't allocate.
6179 2020-01-06 Jason Merrill <jason@redhat.com>
6181 PR c++/92552 - ICE with inherited constrained default ctor.
6182 * pt.c (instantiate_class_template_1): Copy
6183 TYPE_HAS_USER_CONSTRUCTOR.
6184 * class.c (one_inherited_ctor): Don't set it here.
6186 2020-01-06 Andrew Sutton <asutton@lock3software.com>
6188 PR c++/92739 - parsing requires clause with attributes.
6189 * parser.c (cp_parser_constraint_requires_parens): Exclude
6190 attributes as postfix expressions.
6192 2020-01-05 Jakub Jelinek <jakub@redhat.com>
6195 * parser.c (cp_parser_check_class_key): Disable access checks for the
6197 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
6198 !warn_redundant_tags.
6200 2010-01-05 Jakub Jelinek <jakub@redhat.com>
6203 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
6204 TARGET_EXPR if it has been gimplified already.
6206 2020-01-03 Jason Merrill <jason@redhat.com>
6208 PR c++/93033 - incorrect tree node sharing with array init.
6209 * typeck2.c (split_nonconstant_init): Unshare non-decl.
6210 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
6212 2020-01-02 Jason Merrill <jason@redhat.com>
6214 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
6217 2020-01-02 Jakub Jelinek <jakub@redhat.com>
6220 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
6221 has not been found, rather than error_mark_node.
6223 2020-01-01 Jakub Jelinek <jakub@redhat.com>
6225 Update copyright years.
6227 Copyright (C) 2020 Free Software Foundation, Inc.
6229 Copying and distribution of this file, with or without modification,
6230 are permitted in any medium without royalty provided the copyright
6231 notice and this notice are preserved.