1 2020-12-24 Iain Sandoe <iain@sandoe.co.uk>
3 * g++spec.c (LIBCXX, LIBCXX_PROFILE, LIBCXX_STATIC): New.
4 (LIBCXXABI, LIBCXXABI_PROFILE, LIBCXXABI_STATIC): New.
5 (enum stdcxxlib_kind): New.
6 (lang_specific_driver): Allow selection amongst multiple
9 2020-12-23 Nathan Sidwell <nathan@acm.org>
12 * parser.c (cp_lexer_new_main): Adjust EOF token location.
14 2020-12-23 Jason Merrill <jason@redhat.com>
17 * class.c (is_empty_base_ref): New.
18 (build_base_path): Add NOP_EXPR after offset.
19 * cp-tree.h (is_empty_base_ref): Declare it.
20 * call.c (unsafe_return_slot_p): Call it.
22 2020-12-23 Jakub Jelinek <jakub@redhat.com>
25 * init.c (build_zero_init_1): Use build_zero_cst for SCALAR_TYPE_P
28 2020-12-23 Jason Merrill <jason@redhat.com>
31 * constexpr.c (unshare_constructor): Check for NULL.
32 (cxx_eval_vec_init_1): Always exit early if non-constant.
34 2020-12-22 Nathan Sidwell <nathan@acm.org>
36 * module.cc (has_definition): Check DECL_LANG_SPECIFIC.
38 2020-12-22 Jakub Jelinek <jakub@redhat.com>
41 * method.c (common_comparison_type): If comps[i] is a TREE_LIST,
42 use its TREE_VALUE instead.
43 (build_comparison_op): Handle array members.
45 2020-12-22 Gerald Pfeifer <gerald@pfeifer.com>
47 * module.cc (INCLUDE_STRING): Define.
48 (INCLUDE_VECTOR): Ditto.
50 2020-12-22 Jason Merrill <jason@redhat.com>
52 * mangle.c (write_member_name): Add assert.
53 (write_expression): Add asserts.
55 2020-12-21 Nathan Sidwell <nathan@acm.org>
57 * module.cc (create_dirs): Add logging.
58 (finish_module_processing): Unlink before rename.
60 2020-12-21 Nathan Sidwell <nathan@acm.org>
63 * mapper-client.cc: INCLUDE_STRING, INCLUDE_VECTOR.
64 (module_client::open_module_client): Avoid std::stoul.
65 * mapper-resolver.cc: INCLUDE_STRING, INCLUDE_VECTOR.
67 2020-12-18 Kwok Cheung Yeung <kcy@codesourcery.com>
69 * cp-lang.c (cxx_get_decl_init): New.
70 (cxx_omp_finish_decl_inits): New.
71 (LANG_HOOKS_GET_DECL_INIT): New.
72 (LANG_HOOKS_OMP_FINISH_DECL_INITS): New.
73 * cp-tree.h (dynamic_initializers): New.
74 * decl.c (dynamic_initializers): New.
75 * decl2.c (c_parse_final_cleanups): Add initializer entries
76 from vars to dynamic_initializers.
78 2020-12-18 Nathan Sidwell <nathan@acm.org>
80 * module.cc (O_CLOEXEC, O_BINARY): Add window's support.
81 (elf_in::defrost, module_state::do_import)
82 (finish_module_processing): Use O_BINARY.
84 2020-12-18 Jakub Jelinek <jakub@redhat.com>
87 * cp-gimplify.c (source_location_table_entry_hash::pch_nx): Override
88 static member functions from ggc_remove.
90 2020-12-18 Patrick Palka <ppalka@redhat.com>
92 * constraint.cc (satisfying_constraint): Move up definition
93 and give it bool type.
94 (failed_type_completion_count): Replace with ...
95 (failed_type_completions): ... this.
96 (note_failed_type_completion_for_satisfaction): Append the
97 supplied argument to failed_type_completions.
98 (some_type_complete_p): Define.
99 (sat_entry::maybe_unstable): Replace with ...
100 (sat_entry::ftc_begin, sat_entry::ftc_end): ... these.
101 (satisfaction_cache::ftc_count): Replace with ...
102 (satisfaction_cache::ftc_begin): ... this.
103 (satisfaction_cache::satisfaction_cache): Adjust accordingly.
104 (satisfaction_cache::get): Adjust accordingly, using
105 some_type_complete_p.
106 (satisfaction_cache::save): Adjust accordingly.
107 (satisfying_constraint_p): Remove unused function.
108 (satisfy_constraint): Set satisfying_constraint.
109 (satisfy_declaration_constraints): Likewise.
110 * decl.c (require_deduced_type): Call
111 note_failed_type_completion_for_satisfaction.
113 2020-12-18 Patrick Palka <ppalka@redhat.com>
115 * constraint.cc (sat_entry::evaluating): New member.
116 (satisfaction_cache::get): If entry->evaluating, diagnose
117 self-recursive satisfaction. Otherwise, set entry->evaluating
118 if we're not reusing a cached satisfaction result.
119 (satisfaction_cache::save): Clear entry->evaluating.
120 (satisfy_atom): Set up diagnosing_failed_constraint before the
123 2020-12-18 Patrick Palka <ppalka@redhat.com>
125 * constraint.cc (failed_type_completion_count): New.
126 (note_failed_type_completion_for_satisfaction): New.
127 (sat_entry::constr): Rename to ...
128 (sat_entry::atom): ... this.
129 (sat_entry::location): New member.
130 (sat_entry::maybe_unstable): New member.
131 (sat_entry::diagnose_instability): New member.
132 (struct sat_hasher): Adjust after the above renaming.
133 (get_satisfaction, save_satisfaction): Remove.
134 (satisfaction_cache): Rewrite completely.
135 (satisfy_atom): When instantiation of the parameter mapping
136 fails, set diagnose_instability. Propagate location from
137 inst_cache.entry to cache.entry if the secondary lookup
139 (satisfy_declaration_constraints): When
140 failed_type_completion_count differs before and after
141 satisfaction, then don't cache the satisfaction result.
142 * cp-tree.h (note_failed_type_completion_for_satisfaction):
144 * pt.c (tsubst) <case TYPENAME_TYPE>: Use
145 complete_type_or_maybe_complain instead of open-coding it.
146 * typeck.c (complete_type_or_maybe_complain): Call
147 note_failed_type_completion_for_satisfaction when type
150 2020-12-17 Nathan Sidwell <nathan@acm.org>
153 * module.cc (uintset<T>::hash::add): Use uintset (0u).MEMBER,
154 rather than uintset::MEMBER.
156 2020-12-17 Nathan Sidwell <nathan@acm.org>
159 * module.cc: Fix ::read, ::write result signedness comparisons.
161 2020-12-16 Nathan Sidwell <nathan@acm.org>
163 * mapper-resolver.cc: Remove early include of
164 sys/socket.h. Specify no CODY_NETWORKING instead.
165 * module.cc: Specify no CODY_NETWORKING.
167 2020-12-16 Nathan Sidwell <nathan@acm.org>
169 * parser.c (cp_parser_elaborated_type_specifier): Test
170 BOUND_TEMPLATE_TEMPLATE_PARM before checking for instantiation.
172 2020-12-16 Nathan Sidwell <nathan@acm.org>
174 * module.cc (dumper::push): Clangify offsetof use.
176 2020-12-16 Nathan Sidwell <nathan@acm.org>
178 * mapper-resolver.cc: #include sys/socket before system.h
179 due to poisoned bcopy use.
181 2020-12-16 Nathan Sidwell <nathan@acm.org>
183 * module.cc (loc_spans): Make spans a pointer, not inline.
186 2020-12-16 Nathan Sidwell <nathan@acm.org>
188 * mapper-client.cc: Include sys/socket.h before system.h.
190 2020-12-15 Patrick Palka <ppalka@redhat.com>
192 * pt.c (in_template_function): Inspect cfun->decl instead of
193 current_function_decl.
195 2020-12-15 Nathan Sidwell <nathan@acm.org>
197 * module.cc: Replace stubs with implementation.
199 2020-12-15 Nathan Sidwell <nathan@acm.org>
201 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add mapper-client &
203 * mapper-client.h: New.
204 * mapper-client.cc: New.
205 * mapper-resolver.cc: New.
207 2020-12-15 Nathan Sidwell <nathan@acm.org>
209 * name-lookup.c (do_namespace_alias): Set originating module
212 2020-12-11 Jason Merrill <jason@redhat.com>
215 * call.c (build_user_type_conversion_1): Avoid considering
216 conversion functions that return a clearly unsuitable type.
218 2020-12-11 Jason Merrill <jason@redhat.com>
220 * cp-tree.h (make_binding_vec): Add CXX_MEM_STAT_INFO.
222 2020-12-11 Nathan Sidwell <nathan@acm.org>
224 * config-lang.in (gtfiles): Add cp/module.cc.
225 * decl2.c (c_parse_final_cleanups): Add module support.
226 * lambda.c (record_lambda_scope): Call maybe_attach_decl.
227 * module.cc (maybe_attach_decl, lazy_load_specializations): Stubs.
228 (finish_module_procesing): Stub.
229 * pt.c (lookup_template_class_1): Lazy load specializations.
230 (instantiate_template_1): Likewise.
232 2020-12-11 Nathan Sidwell <nathan@acm.org>
234 * decl2.c (c_parse_final_cleanups): Refactor loop.
236 2020-12-11 Nathan Sidwell <nathan@acm.org>
238 * cp-tree.h (map_context_from, map_context_to): Declare.
239 * module.cc (map_context_from, map_context_to): Define.
240 * tree.c (cp_tree_equal): Check map_context_{from,to} for parm
241 context difference. Allow NON_LVALUE_EXPR and VIEW_CONVERT_EXPR
244 2020-12-11 Nathan Sidwell <nathan@acm.org>
246 * cp-lang.c (LANG_HOOKS_PREPROCESS_MAIN_FILE): Override.
247 (LANG_HOOKS_PREPROCESS_OPTIONS): Override.
248 (LANG_HOOKS_PREPROCESS_TOKEN): Override.
249 * cp-objcp-common.c (cp_register_dumps): Add module dump.
250 (cp_handle_option): New.
251 * cp-objcp-common.h (cp_handle_option): Declare.
252 (LANG_HOOKS_HANDLE_OPTION): Override.
253 * cp-tree.h (module_dump_id): Declare.
254 * module.cc (module_dump_id): Define.
255 (module_begin_main_file, handle_module_option)
256 (module_preproces_options): Stubs.
258 2020-12-11 Nathan Sidwell <nathan@acm.org>
260 * module.cc (lazy_specializations_p): Stub.
261 * name-lookup.h (append_imported_binding_slot)
262 (mergeable_namespacE_slots, lookup_class_binding)
263 (walk_module_binding, import_module_binding, set_module_binding)
264 (note_pending_specializations, load_pending_specializations)
265 (add_module_decl, add_imported_namespace): Declare.
266 (get_cxx_dialect_name): Declare.
267 (enum WMB_flags): New.
268 * name-lookup.c (append_imported_binding_slot)
269 (mergeable_namespacE_slots, lookup_class_binding)
270 (walk_module_binding, import_module_binding, set_module_binding)
271 (note_pending_specializations, load_pending_specializations)
272 (add_module_decl, add_imported_namespace): New.
273 (get_cxx_dialect_name): Make extern.
275 2020-12-11 Patrick Palka <ppalka@redhat.com>
278 * typeck.c (pointer_diff): Use complete_type_or_maybe_complain
279 instead of complete_type_or_else.
281 2020-12-10 Jason Merrill <jason@redhat.com>
283 * cp-tree.h (struct type_identity): New.
284 (make_temp_override): New.
285 * decl.c (grokdeclarator): Use it.
286 * except.c (maybe_noexcept_warning): Use it.
287 * parser.c (cp_parser_enum_specifier): Use it.
288 (cp_parser_parameter_declaration_clause): Use it.
289 (cp_parser_gnu_attributes_opt): Use it.
290 (cp_parser_std_attribute): Use it.
292 2020-12-10 Nathan Sidwell <nathan@acm.org>
294 * name-lookup.c (do_nonmember_using_decl): Add INSERT_P parm.
295 Deal with exporting using decls.
296 (finish_nonmember_using_decl): Examine BINDING_VECTOR.
298 2020-12-10 Nathan Sidwell <nathan@acm.org>
300 * cp-tree.h (visible_instantiation_path): Renamed.
301 * module.cc (get_originating_module_decl, lazy_load_binding)
302 (lazy_load_members, visible_instantiation_path): Stubs.
303 * name-lookup.c (STAT_TYPE_VISIBLE_P, STAT_VISIBLE): New.
304 (search_imported_binding_slot, init_global_partition)
305 (get_fixed_binding_slot): New.
306 (name_lookup::process_module_binding): New.
307 (name_lookup::search_namespace_only): Search BINDING_VECTOR.
308 (name_lookup::adl_namespace_fns): Likewise.
309 (name_lookip::search_adl): Search visible instantiation path.
310 (maybe_lazily_declare): Maybe lazy load members.
311 (implicitly_exporT_namespace): New.
312 (maybe_record_mergeable_decl): New.
313 (check_module_override): New.
314 (do_pushdecl): Deal with BINDING_VECTOR, check override.
315 (add_mergeable_namespace_entity): New.
316 (get_namespace_binding): Deal with BINDING_VECTOR.
317 (do_namespace_alias): Call set_originating_module.
318 (lookup_elaborated_type_1): Deal with BINDING_VECTOR.
319 (do_pushtag): Call set_originating_module.
320 (reuse_namespace): New.
321 (make_namespace_finish): Add FROM_IMPORT parm.
322 (push_namespace): Deal with BINDING_VECTOR & namespace reuse.
323 (maybe_save_operator_binding): Save when module CMI in play.
324 * name-lookup.h (add_mergeable_namespace_entity): Declare.
326 2020-12-10 Nathan Sidwell <nathan@acm.org>
328 * name-lookup.c: Include bitmap.h.
329 (enum binding_slots): New.
330 (maybe_add_fuzzy_binding): Return bool true if found.
331 (consider_binding_level): Add module support.
332 * module.cc (get_import_bitmap): Stub.
334 2020-12-10 Nathan Sidwell <nathan@acm.org>
336 * name-lookup.c (pop_local_binding): Check for IDENTIFIER_ANON_P.
337 (update_binding): Level may be null, don't add namespaces to
339 (newbinding_bookkeeping): New, broken out of ...
340 (do_pushdecl): ... here, call it. Don't push anonymous decls.
341 (pushdecl, add_using_namespace): Correct comments.
342 (do_push_nested_namespace): Remove assert.
343 (make_namespace, make_namespace_finish): New, broken out of ...
344 (push_namespace): ... here. Call them. Add namespace to level
347 2020-12-10 Nathan Sidwell <nathan@acm.org>
349 * error.c (dump_module_suffix): New.
350 (dump_aggr_type, dump_simple_decl, dump_function_name): Call it.
351 * ptree.c (cxx_print_decl): Print module information.
352 * module.cc (module_name, get_importing_module): Stubs.
354 2020-12-10 Nathan Sidwell <nathan@acm.org>
356 * name-lookup.h (set_class_bindings): Return vector, take signed
358 * name-lookup.c (maybe_lazily_declare): Break out ...
359 (get_class_binding): .. of here, call it.
360 (find_member_slot): Adjust get_class_bindings call.
361 (set_class_bindings): Allow -ve extra. Return the vector.
362 (set_identifier_type_value_with_scope): Remove checking assert.
363 (lookup_using_decl): Set decl's context.
364 (do_pushtag): Adjust set_identifier_type_value_with_scope handling.
366 2020-12-09 Nathan Sidwell <nathan@acm.org>
368 * parser.h (struct cp_token): Add main_source_p field.
369 * parser.c (cp_lexer_new_main): Pass thought module token filter.
371 (cp_lexer_get_preprocessor_token): Set main_source_p.
372 (enum module_parse): New.
373 (cp_parser_diagnose_invalid_type_name): Deal with unrecognized
375 (cp_parser_skip_to_closing_parenthesize_1): Skip module-directivres.
376 (cp_parser_skip_to_end_of_statement): Likewise.
377 (cp_parser_skiup_to_end_of_block_or_statement): Likewise.
378 (cp_parser_translation_unit): Add module parsing calls.
379 (cp_parser_module_name, cp_parser_module_declaration): New.
380 (cp_parser_import_declaration, cp_parser_module_export): New.
381 (cp_parser_declaration): Add module export detection.
382 (cp_parser_template_declaration): Adjust 'export' error message.
383 (cp_parser_function_definition_after_declarator): Add
384 module-specific logic.
385 * module.cc (import_module, declare_module)
386 (maybe_check_all_macros): Stubs.
388 2020-12-09 Marek Polacek <polacek@redhat.com>
391 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier): Handle
393 (pp_cxx_type_specifier_seq): Likewise.
394 (cxx_pretty_printer::type_id): Likewise.
396 2020-12-09 Nathan Sidwell <nathan@acm.org>
398 * decl.c (duplicate_decls): Add module-specific redeclaration
400 (cxx_init_decl_processing): Export the global namespace, maybe
402 (start_decl): Reject local-extern in a module, adjust linkage of
404 (xref_tag_1): Add module-specific redeclaration logic.
405 (start_enum): Likewise.
406 (finish_enum_value_list): Export unscoped members of an exported
408 (grokmethod): Implement p1779 linkage of in-class defined
410 * decl2.c (no_linkage_error): Imports are ok.
411 (c_parse_final_cleanups): Call fini_modules.
412 * lex.c (cxx_dup_lang_specific): Clear some module flags in the
414 * module.cc (module_kind): Define.
415 (module_may_redeclare, set_defining_module): Stubs.
416 (init_modules): Error on modules.
417 (fini_modules): Stub.
418 * rtti.c (push_abi_namespace): Save and reset module_kind.
419 (pop_abi_namespace): Restore module kind.
420 (build_dynamic_cast_1, tinfo_base_init): Adjust.
421 * semantics.c (begin_class_definition): Add module-specific logic.
422 (expand_or_defer_fn_1): Keep bodies of more fns when modules_p.
424 2020-12-09 Tobias Burnus <tobias@codesourcery.com>
426 * parser.c (cp_parser_omp_allocate): New.
427 (cp_parser_omp_construct, cp_parser_pragma): Call it.
429 2020-12-09 Jason Merrill <jason@redhat.com>
432 * cvt.c (maybe_warn_nodiscard): Check c_inhibit_evaluation_warnings.
434 2020-12-09 Jason Merrill <jason@redhat.com>
437 * init.c (expand_default_init): Pass tf_no_cleanup when building
438 a TARGET_EXPR to go on the RHS of an INIT_EXPR.
439 * typeck.c (cp_build_modify_expr): Likewise.
441 2020-12-08 Marek Polacek <polacek@redhat.com>
444 * constexpr.c (cxx_eval_dynamic_cast_fn): If the evaluating of vtable
445 yields a null pointer, give an error and return. Use objtype.
447 2020-12-08 Nathan Sidwell <nathan@acm.org>
449 * class.c (layout_class_type): Call set_instantiating_module.
450 (build_self_reference): Likewise.
451 * decl.c (grokfndecl): Call set_originating_module.
452 (grokvardecl): Likewise.
453 (grokdeclarator): Likewise.
454 * pt.c (maybe_new_partial_specialization): Call
455 set_instantiating_module, propagate DECL_MODULE_EXPORT_P.
456 (lookup_template_class_1): Likewise.
457 (tsubst_function_decl): Likewise.
458 (tsubst_decl, instantiate_template_1): Likewise.
459 (build_template_decl): Propagate module flags.
460 (tsubst_template_dcl): Likewise.
461 (finish_concept_definition): Call set_originating_module.
462 * module.cc (set_instantiating_module, set_originating_module): Stubs.
464 2020-12-08 Jason Merrill <jason@redhat.com>
467 * cp-tree.h (build_new_op): Add overload that omits some parms.
468 (genericize_spaceship): Add location_t parm.
469 * constexpr.c (cxx_eval_binary_expression): Pass it.
470 * cp-gimplify.c (genericize_spaceship): Pass it.
471 * method.c (genericize_spaceship): Handle class-type arguments.
472 (build_comparison_op): Fall back to op</== when appropriate.
474 2020-12-08 Jason Merrill <jason@redhat.com>
476 * call.c (build_new_op_1): Set *overload for ambiguity.
477 (build_new_method_call_1): Likewise.
479 2020-12-08 Bernd Edlinger <bernd.edlinger@hotmail.de>
481 * decl2.c: (is_atomic_expensive_p): New helper function.
482 (build_atomic_load_byte): Rename to...
483 (build_atomic_load_type): ... and add new parameter type.
484 (get_guard_cond): Skip the atomic here if that is expensive.
485 Use the correct type for the atomic load on certain targets.
487 2020-12-08 Nathan Sidwell <nathan@acm.org>
489 * cp-tree.h (struct tinst_level): Add path & visible fields.
490 (build_cdtor_clones): Declare.
491 (match_mergeable_specialization): Use a spec_entry, add insert parm.
492 * class.c (build_cdtor_clones): Externalize.
493 * pt.c (push_tinst_level_loc): Clear new fields.
494 (match_mergeable_specialization): Adjust API.
496 2020-12-08 Nathan Sidwell <nathan@acm.org>
498 * decl2.c (start_objects): Refactor and adjust for named module
500 (finish_objects): Likewise.
501 (generate_ctor_or_dtor_function): Likewise.
502 * module.cc (module_initializer_kind)
503 (module_add_import_initializers): Stubs.
505 2020-12-08 Nathan Sidwell <nathan@acm.org>
507 * Make-lang.in (MODULE_VERSION): Override when DEVPHASE not empty.
508 * module.cc: Comment.
510 2020-12-08 Nathan Sidwell <nathan@acm.org>
512 * cp-tree.h (mangle_module_substitution, mangle_identifier)
513 (mangle_module_global_init): Declare.
514 * mangle.c (struct globals): Add mod field.
515 (mangle_module_substitution, mangle_identifier)
516 (mangle_module_global_init): Define.
517 (write_module, maybe_write_module): New.
518 (write_name): Call it.
519 (start_mangling): Clear mod field.
520 (finish_mangling_internal): Adjust.
521 * module.cc (mangle_module, mangle_module_fini)
522 (get_originating_module): Stubs.
524 2020-12-08 Nathan Sidwell <nathan@acm.org>
526 * cp-tree.h (module_token_pre, module_token_cdtor)
527 (module_token_lang): Declare.
528 * lex.c: Include langhooks.
529 (struct module_token_filter): New.
530 * cp-tree.h (module_token_pre, module_token_cdtor)
531 (module_token_lang): Define.
532 * module.cc (get_module, preprocess_module, preprocessed_module):
535 2020-12-08 Nathan Sidwell <nathan@acm.org>
537 * Make-lang.in (MODULE_VERSION): Define.
538 * module.cc: Add includes.
540 2020-12-08 Jakub Jelinek <jakub@redhat.com>
543 * parser.c (cp_parser_omp_parallel): For parallel master with
544 -fopenmp-simd only, just call cp_parser_omp_master instead of
545 wrapping it in OMP_PARALLEL.
547 2020-12-07 Marek Polacek <polacek@redhat.com>
550 * decl.c (pop_switch): If SWITCH_STMT_TYPE is a scoped enum type,
551 set it to the type of SWITCH_STMT_COND.
553 2020-12-07 Nathan Sidwell <nathan@acm.org>
555 * cp-tree.h (build_cplus_array_type): Add defaulted DEP parm.
556 * tree.c (set_array_type_common): Add DEP parm.
557 (build_cplus_array_type): Add DEP parm, determine dependency if
558 needed. Mark dependency of new types.
559 (cp_build_qualified_type_real): Adjust array-building call, assert
560 no surprising dependency.
561 (strip_typedefs): Likewise.
563 2020-12-07 Nathan Sidwell <nathan@acm.org>
566 * typeck.c (structural_comptypes): Move early outs to comptype.
567 Always check template-alias match when comparing_specializations.
568 (comptypes): Do early out checking here.
570 2020-12-05 Patrick Palka <ppalka@redhat.com>
573 * constraint.cc (parameter_mapping_equivalent_p): Add some
574 sanity checks. Clarify comment.
575 (tsubst_nested_requirement): Always perform satisfaction
576 quietly first. If that yields an erroneous result, emit a
577 context message and replay satisfaction noisily with the
578 diagnostic normal form.
579 (finish_nested_requirement): Normalize the constraint-expression
580 twice, once with diagnostic information and once without. Store
581 them in a TREE_LIST within the TREE_TYPE.
582 (diagnose_nested_requirement): When replaying satisfaction, use
583 the diagnostic normal form instead of renormalizing on the spot.
585 2020-12-05 Patrick Palka <ppalka@redhat.com>
588 * constraint.cc (struct sat_info): Define.
589 (tsubst_nested_requirement): Pass a sat_info object to
591 (satisfy_constraint_r): Take a sat_info argument instead of
593 (satisfy_conjunction): Likewise.
594 (satisfy_disjunction): Likewise. Instead of first evaluating
595 each branch quietly, evaluate each branch only with
596 unsatisfaction diagnostics disabled. Exit early if evaluation
597 of a branch returns error_mark_node.
598 (satisfy_atom): Take a sat_info argument instead of subst_info.
599 Fix a comment. Check diagnose_unsatisfaction_p() instead of
600 noisy() before replaying a substitution failure.
601 (satisfy_constraint): Take a sat_info argument instead of
603 (satisfy_associated_constraints): Likewise.
604 (satisfy_constraint_expression): Likewise.
605 (satisfy_declaration_constraints): Likewise.
606 (constraint_satisfaction_value): Likewise and adjust
607 accordingly. Fix formatting.
608 (constraints_satisfied_p): Pass a sat_info object to
609 constraint_satisfaction_value.
610 (evaluate_concept_check): Pass a sat_info object to
611 satisfy_constraint_expression.
612 (diagnose_nested_requirement): Likewise.
613 (diagnose_constraints): Pass an appropriate sat_info object to
614 constraint_satisfaction_value.
616 2020-12-05 Jakub Jelinek <jakub@redhat.com>
619 * constexpr.c (cxx_union_active_member): New function.
620 (cxx_fold_indirect_ref_1): Add ctx argument, pass it through to
621 recursive call. Handle UNION_TYPE.
622 (cxx_fold_indirect_ref): Add ctx argument, pass it to recursive calls
623 and cxx_fold_indirect_ref_1.
624 (cxx_eval_indirect_ref): Adjust cxx_fold_indirect_ref calls.
626 2020-12-04 Jason Merrill <jason@redhat.com>
629 * pt.c (convert_template_argument): Handle equivalent placeholders.
630 (do_class_deduction): Look through EXPR_PACK_EXPANSION, too.
632 2020-12-04 Jason Merrill <jason@redhat.com>
634 * decl2.c (clear_consteval_vfns): Remove *.
635 * pt.c (do_auto_deduction): Remove *.
636 * parser.c (cp_parser_late_parsing_default_args): Change loop
639 2020-12-04 Nathan Sidwell <nathan@acm.org>
642 * cp-tree.h (comparing_typenames): Delete.
643 (cplus_build_array_type): Remove default parm.
644 * pt.c (comparing_typenames): Delete.
645 (spec_hasher::equal): Don't increment it.
646 * tree.c (set_array_type_canon): Remove dep parm.
647 (build_cplus_array_type): Remove dep parm changes.
648 (cp_build_qualified_type_real): Remove dependent array type
650 (strip_typedefs): Likewise.
651 * typeck.c (structural_comptypes): Revert comparing_typename
654 2020-12-04 Nathan Sidwell <nathan@acm.org>
656 * cp-tree.h: Add various inline module state predicates, and
657 declare the API that will be provided by modules.cc
659 2020-12-04 Jakub Jelinek <jakub@redhat.com>
662 * cp-gimplify.c (fold_builtin_source_location): Use 2 instead of 0
663 as last argument to cxx_printable_name.
665 2020-12-03 Jason Merrill <jason@redhat.com>
667 * cp-tree.h (releasing_vec::operator[]): Change parameter type to
670 2020-12-03 Nathan Sidwell <nathan@acm.org>
672 * cp-tree.h (OVL_EXPORT): New.
673 (class ovl_iterator): Add get_using, exporting_p.
674 * tree.c (ovl_insert): Extend using_or_hidden meaning to include
677 2020-12-03 Nathan Sidwell <nathan@acm.org>
679 * cp-tree.h (DECL_UNINSTANTIATED_TEMPLATE_FRIEND): New.
680 * pt.c (push_template_decl): Set it.
681 (tsubst_friend_function): Clear it.
683 2020-12-03 Nathan Sidwell <nathan@acm.org>
685 * cp-tree.h (make_unbound_class_template_raw): Declare.
686 (canonical_type_parameter): Declare.
687 * decl.c (make_unbound_class_template_raw): Break out of ...
688 (make_unboud_class_template): ... here. Call it.
689 * pt.c (canonical_type_parameter): Externalize. Refactor & set
690 structural_equality for type parms.
692 2020-12-03 Nathan Sidwell <nathan@acm.org>
695 * tree.c (build_cplus_array_type): Mark dependency of new variant.
696 (cp_build_qualified_type_real, strip_typedefs): Assert
697 TYPE_DEPENDENT_P_VALID, or not a dependent type.
699 2020-12-03 Jakub Jelinek <jakub@redhat.com>
702 * cp-tree.h (cp_build_bit_cast): Declare.
703 * cp-tree.def (BIT_CAST_EXPR): New tree code.
704 * cp-objcp-common.c (names_builtin_p): Handle RID_BUILTIN_BIT_CAST.
705 (cp_common_init_ts): Handle BIT_CAST_EXPR.
706 * cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
708 * parser.c (cp_parser_postfix_expression): Handle
709 RID_BUILTIN_BIT_CAST.
710 * semantics.c (cp_build_bit_cast): New function.
711 * tree.c (cp_tree_equal): Handle BIT_CAST_EXPR.
712 (cp_walk_subtrees): Likewise.
713 * pt.c (tsubst_copy): Likewise.
714 * constexpr.c (check_bit_cast_type, cxx_eval_bit_cast): New functions.
715 (cxx_eval_constant_expression): Handle BIT_CAST_EXPR.
716 (potential_constant_expression_1): Likewise.
717 * cp-gimplify.c (cp_genericize_r): Likewise.
719 2020-12-03 Jason Merrill <jason@redhat.com>
721 * parser.c (cp_parser_primary_expression): Distinguish
722 parms from vars in error.
723 (cp_parser_late_parsing_default_args): Pushdecl parms
726 2020-12-03 Jason Merrill <jason@redhat.com>
728 * name-lookup.c (begin_scope): Set immediate_fn_ctx_p.
729 * parser.c (cp_parser_late_parsing_default_args): Push
730 sk_function_parms scope.
732 2020-12-03 Peter Bergner <bergner@linux.ibm.com>
735 * typeck2.c (digest_init_r): Handle OPAQUE_TYPE as an aggregate type.
737 2020-12-02 Jakub Jelinek <jakub@redhat.com>
741 * cp-tree.h (source_location_current_p): Declare.
742 * tree.c (source_location_current_p): New function.
743 * call.c (immediate_invocation_p): New function.
744 (build_over_call): Use it to resolve LWG3396.
745 * constexpr.c (cxx_eval_builtin_function_call): Temporarily set
746 current_function_decl from ctx->call->fundef->decl if any.
747 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Fold calls
748 to immediate function std::source_location::current ().
750 2020-12-02 Jason Merrill <jason@redhat.com>
752 * decl.c (grokdeclarator): Improve diagnostic for
753 disallowed CTAD placeholder.
755 2020-12-02 Jason Merrill <jason@redhat.com>
757 * decl.c (check_initializer): Also look through STMT_EXPR
760 2020-12-02 Nathan Sidwell <nathan@acm.org>
762 * cp-tree.h (comparing_typenames): Declare.
763 * pt.c (comparing_typenames): Define.
764 (spec_hasher::equal): Increment it around comparisons.
765 * typeck.c (structural_comptypes): Adjust TYPENAME resolution
768 2020-12-02 Marek Polacek <polacek@redhat.com>
771 * constexpr.c (fold_non_dependent_init): Add a tree parameter.
773 * cp-tree.h (fold_non_dependent_init): Add a tree parameter with
775 * typeck2.c (store_init_value): Call fold_non_dependent_expr
776 only when checking the initializer for constexpr variables.
777 Call fold_non_dependent_init instead of maybe_constant_init.
779 2020-12-02 Marek Polacek <polacek@redhat.com>
783 * pt.c (tsubst_copy_and_build) <case NEW_EXPR>: Return error_mark_node
784 if init is erroneous.
786 2020-12-02 Nathan Sidwell <nathan@acm.org>
788 * cp-tree.h (DECL_MODULE_PURVIEW_P, DECL_MODULE_IMPORT_P)
789 (DECL_MODULE_ENTITY_P): New.
790 (DECL_MODULE_PENDING_SPECIALIZATIONS_P): New.
791 (DECL_MODULE_PENDING_MEMBERS_P): New.
792 (DECL_MODULE_ATTACHMENTS_P): New.
793 (DECL_MODULE_EXPORT_P): New.
794 (struct lang_decl_base): Shrink sel field. Add new
795 module-specific fields.
797 2020-12-02 Nathan Sidwell <nathan@acm.org>
799 * cp-tree.h (DECL_TINFO_P): Also for TYPE_DECLs.
800 (get_tinfo_decl_direct): Declare.
801 (get_pseudo_tinfo_index, get_pseudo_tinfo_type): Declare.
802 * rtti.c (get_tinfo_decl_direct): Externalize.
803 (get_tinfo_desc): Set DECL_TINFO_P on the typedef.
804 (get_pseudo_tinfo_index, get_pseudo_tinfo_type): New.
806 2020-12-02 Nathan Sidwell <nathan@acm.org>
808 * cp-tree.h (maybe_add_lang_decl_raw, maybe_add_lang_type_raw):
810 * lex.c (maybe_add_lang_decl_raw, maybe_add_lang_type_raw):
811 Externalize, reformat.
813 2020-12-02 Nathan Sidwell <nathan@acm.org>
815 * cp-tree.h (build_cplus_array_type): Add defaulted DEP parm.
816 * tree.c (set_array_type_common): Add DEP parm.
817 (build_cplus_array_type): Add DEP parm, determine dependency if
819 (cp_build_qualified_type_real): Adjust array-building call.
820 (strip_typedefs): Likewise.
822 2020-12-02 Nathan Sidwell <nathan@acm.org>
824 * ptree.c (cxx_print_xnode): Increase binding-vector prefix size.
826 2020-12-02 Nathan Sidwell <nathan@acm.org>
828 * cp-tree.def (BINDING_VECTOR): New.
829 * name-lookup.h (struct binding_slot): New.
830 (BINDING_VECTOR_SLOTS_PER_CLUSTER): New.
831 (struct binding_index, struct binding_cluster): New.
832 (BINDING_VECTOR_ALLOC_CLUSTERS, BINDING_VECTOR_CLUSTER_BASE)
833 (BINDING_VECTOR_CLUSTER): New.
834 (struct tree_binding_vec): New.
835 (BINDING_VECTOR_NAME, BINDING_VECTOR_GLOBAL_DUPS_P)
836 (BINDING_VECTOR_PARTITION_DUPS_P): New.
837 (BINDING_BINDING_GLOBAL_P, BINDING_BINDING_PARTITION_P): New.
838 (BINDING_VECTOR_PENDING_SPECIALIZATIONS)
839 (BINDING_VECTOR_PENDING_IS_HEADER_P)
840 (BINDING_VECTOR_PENDING_IS_PARTITION_P): New.
841 * cp-tree.h (enum cp_tree_node_structure_enum): Add
842 TS_CP_BINDING_VECTOR.
843 (union lang_tree_node): Add binding_vec field.
844 (make_binding_vec): Declare.
845 (named_decl_hash::hash, named_decl_hash::equal): Check for binding
847 * decl.c (cp_tree_node_structure): Add BINDING_VECTOR case.
848 * ptree.c (cxx_print_xnode): Add BINDING_VECTOR case.
849 * tree.c (make_binding_vec): New.
851 2020-12-01 Ville Voutilainen <ville.voutilainen@gmail.com>
854 * cxx-pretty-print.c (pp_cxx_trait_expression):
855 Add support for __is_nothrow_{assignable,constructible}.
857 2020-12-01 Jakub Jelinek <jakub@redhat.com>
860 * parser.c (cp_parser_omp_depobj): Suppress location wrappers when
861 parsing depend clause.
863 2020-12-01 Nathan Sidwell <nathan@acm.org>
865 * lex.c (init_reswords): Maybe enable module keywords.
867 2020-12-01 Nathan Sidwell <nathan@acm.org>
869 * lang-specs.h: Add module-related options.
871 2020-12-01 Iain Sandoe <iain@sandoe.co.uk>
873 * parser.c (cp_parser_declaration): Add a not about where
874 attributes may be placed.
876 2020-11-27 Martin Sebor <msebor@redhat.com>
878 * error.c (add_quotes): Revert previous change and use pragma to
879 suppress -Wformat-diag.
881 2020-11-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
883 * g++spec.c (TIMELIB, TIME_LIBRARY): Remove.
884 (lang_specific_driver): Remove TIME_LIBRARY handling.
886 2020-11-26 Thomas Schwinge <thomas@codesourcery.com>
888 * parser.c (cp_parser_omp_var_list_no_open): Assert that array
889 section's 'low_bound', 'length' are not location wrapper nodes.
890 (cp_parser_oacc_all_clauses, cp_parser_oacc_cache): Instantiate
891 'auto_suppress_location_wrappers'.
893 2020-11-25 Martin Sebor <msebor@redhat.com>
896 * constraint.cc (debug_argument_list): Avoid -Wformat-diag.
897 * error.c (function_category): Same.
898 (print_template_differences): Same.
899 * logic.cc (debug): Same.
900 * name-lookup.c (lookup_using_decl): Same.
901 * parser.c (maybe_add_cast_fixit): Same.
902 (cp_parser_template_introduction): Same.
903 * typeck.c (access_failure_info::add_fixit_hint): Same.
905 2020-11-25 Thomas Schwinge <thomas@codesourcery.com>
907 * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE__CACHE_'.
908 (tsubst_expr): Handle 'OACC_CACHE'.
910 2020-11-24 Jason Merrill <jason@redhat.com>
913 * typeck2.c (store_init_value): Don't split_nonconstant_init in a
916 2020-11-24 Jakub Jelinek <jakub@redhat.com>
918 PR tree-optimization/96929
919 * constexpr.c (cxx_eval_binary_expression): For shifts by constant
920 with MSB set, emulate older wide_int_binop behavior to preserve
921 diagnostics and -fpermissive behavior.
923 2020-11-23 Nathan Sidwell <nathan@acm.org>
925 * module.cc: New dummy file.
926 * Make-lang.in: Add rules to build module.o
928 2020-11-23 Jozef Lawrynowicz <jozef.l@mittosystems.com>
930 * decl.c (start_decl): Set DECL_INITIAL for initialized decls
931 before attribute processing.
933 2020-11-23 Richard Sandiford <richard.sandiford@arm.com>
936 * pt.c (tsubst): Use verify_type_context to check the type
939 2020-11-21 Marek Polacek <polacek@redhat.com>
942 * parser.c (warn_for_range_copy): Warn when the loop variable is
943 initialized with a value of a different type resulting in a copy.
945 2020-11-21 Marek Polacek <polacek@redhat.com>
948 * constexpr.c (potential_constant_expression_1): Reject
949 LABEL_EXPRs that use non-artifical LABEL_DECLs.
951 2020-11-21 Marek Polacek <polacek@redhat.com>
954 * parser.c (warn_about_ambiguous_parse): Only assume "int" if we
955 actually saw any type-specifiers.
957 2020-11-21 Marek Polacek <polacek@redhat.com>
960 * parser.c (cp_parser_lambda_declarator_opt): Don't require ().
962 2020-11-21 Marek Polacek <polacek@redhat.com>
965 * constexpr.c (cxx_set_object_constness): New function.
966 (cxx_eval_call_expression): Set new_obj for destructors too.
967 Call cxx_set_object_constness to set/unset TREE_READONLY of
968 the object under construction/destruction.
970 2020-11-21 Aaron Sawdey <acsawdey@linux.ibm.com>
972 * error.c (dump_type): Handle opaque types.
973 (dump_type_prefix): Handle opaque types.
974 (dump_type_suffix): Handle opaque types.
975 (dump_expr): Handle opaque types.
976 * pt.c (tsubst): Allow opaque types in templates.
977 (unify): Allow opaque types in templates.
978 * typeck.c (structural_comptypes): Handle comparison
981 2020-11-20 Jakub Jelinek <jakub@redhat.com>
984 * Make-lang.in (c++.serial): Change from goal to a variable.
985 (.PHONY): Drop c++.serial and c++.prev.
986 (cc1plus$(exeext)): Depend on $(c++.serial) rather than c++.serial.
988 2020-11-19 Nathan Sidwell <nathan@acm.org>
990 * cp-tree.h (struct spec_entry): Moved from pt.c.
991 (walk_specializations, match_mergeable_specialization)
992 (get_mergeable_specialization_flags)
993 (add_mergeable_specialization): Declare.
994 * pt.c (struct spec_entry): Moved to cp-tree.h.
995 (walk_specializations, match_mergeable_specialization)
996 (get_mergeable_specialization_flags)
997 (add_mergeable_specialization): New.
999 2020-11-19 Nathan Sidwell <nathan@acm.org>
1001 * cp-tree.h (struct constexpr_fundef): Moved from constexpr.c.
1002 (maybe_save_constexpr_fundef): Declare.
1003 (register_constexpr_fundef): Take constexpr_fundef object, return
1005 * decl.c (mabe_save_function_definition): Delete, functionality
1006 moved to maybe_save_constexpr_fundef.
1007 (emit_coro_helper, finish_function): Adjust.
1008 * constexpr.c (struct constexpr_fundef): Moved to cp-tree.h.
1009 (constexpr_fundef_hasher::equal): Constify.
1010 (constexpr_fundef_hasher::hash): Constify.
1011 (retrieve_constexpr_fundef): Make non-static.
1012 (maybe_save_constexpr_fundef): Break out checking and duplication
1014 (register_constexpr_fundef): ... here. Just register the constexpr.
1016 2020-11-19 Marek Polacek <polacek@redhat.com>
1019 * init.c (build_new): When value-initializing an array new,
1020 leave the INIT as an empty vector.
1022 2020-11-19 Marek Polacek <polacek@redhat.com>
1025 * pt.c (do_auto_deduction): Don't crash when the constructor has
1028 2020-11-19 Nathan Sidwell <nathan@acm.org>
1031 * decl.c (duplicate_decls): Relax new assert.
1033 2020-11-18 Iain Sandoe <iain@sandoe.co.uk>
1035 * parser.c (cp_parser_objc_valid_prefix_attributes): Check
1036 for empty attributes.
1038 2020-11-18 Jakub Jelinek <jakub@redhat.com>
1040 * Make-lang.in (c++.serial): New goal.
1041 (.PHONY): Add c++.serial c++.prev.
1042 (cc1plus$(exeext)): Depend on c++.prev. Call LINK_PROGRESS.
1044 2020-11-17 Nathan Sidwell <nathan@acm.org>
1047 * decl.c (duplicate_decls): Deal with duplicated DECL_LOCAL_DECL_P
1048 decls. Extend decl_lang_specific checking assert.
1050 2020-11-17 Nathan Sidwell <nathan@acm.org>
1052 * cp-tree.h (enum cp_tree_index): Reorder to place lazy fields
1053 after newly-added CPTI_MODULE_HWM.
1055 2020-11-17 Iain Sandoe <iain@sandoe.co.uk>
1058 * parser.c (cp_parser_declaration): Remove checking assert.
1060 2020-11-15 Jason Merrill <jason@redhat.com>
1062 * decl.c (cp_finish_decl): Only check abstractness on definition.
1063 (require_complete_types_for_parms): Check abstractness here.
1064 (create_array_type_for_decl): Not here.
1065 (grokdeclarator, grokparms, complete_vars): Not here.
1066 * pt.c (tsubst, tsubst_arg_types, tsubst_function_type): Not here.
1067 * typeck2.c (struct pending_abstract_type): Remove.
1068 (struct abstract_type_hasher): Remove.
1069 (abstract_pending_vars, complete_type_check_abstract): Remove.
1070 (abstract_virtuals_error_sfinae): Handle arrays.
1071 * call.c (conv_is_prvalue): Split out from...
1072 (conv_binds_ref_to_prvalue): ...here.
1073 (implicit_conversion_1): Rename from implicit_conversion.
1074 (implicit_conversion): An abstract prvalue is bad.
1075 (convert_like_internal): Don't complain if expr is already
1078 2020-11-13 Jason Merrill <jason@redhat.com>
1080 * cp-tree.h (USING_DECL_UNRELATED_P): New.
1081 (CONST_DECL_USING_P): New.
1082 * class.c (handle_using_decl): If USING_DECL_UNRELATED_P,
1083 clone the CONST_DECL.
1084 * name-lookup.c (supplement_binding_1): A clone hides its
1086 (lookup_using_decl): Rewrite to separate lookup and validation.
1087 (do_class_using_decl): Adjust.
1088 (finish_nonmember_using_decl): Adjust.
1089 * parser.c (make_location): Add cp_token overload.
1090 (finish_using_decl): Split out from...
1091 (cp_parser_using_declaration): ...here. Don't look through enums.
1092 (cp_parser_using_enum): New.
1093 (cp_parser_block_declaration): Call it.
1094 (cp_parser_member_declaration): Call it.
1095 * semantics.c (finish_id_expression_1): Handle enumerator
1096 used from class scope.
1098 2020-11-13 Vladimir N. Makarov <vmakarov@redhat.com>
1100 * parser.c (cp_parser_asm_definition): Parse outputs for asm
1103 2020-11-13 Iain Sandoe <iain@sandoe.co.uk>
1106 * parser.c (cp_parser_objc_class_interface): Pass the
1107 location of the class name to the interface declaration.
1109 2020-11-13 Patrick Palka <ppalka@redhat.com>
1111 * semantics.c (finish_compound_literal): Don't wrap the original
1112 compound literal in a TARGET_EXPR when inside a template.
1114 2020-11-12 Jakub Jelinek <jakub@redhat.com>
1117 * constexpr.c (cxx_eval_constant_expression) <case CLEANUP_POINT_EXPR,
1118 case TRY_FINALLY_EXPR, case CLEANUP_STMT>: Don't pass jump_target to
1119 cxx_eval_constant_expression when evaluating the cleanups.
1121 2020-11-11 Iain Sandoe <iain@sandoe.co.uk>
1123 * parser.c (cp_parser_declaration): Unless we are compiling for
1124 Ojective-C++, warn about and discard any attributes that prefix
1125 a linkage specification.
1127 2020-11-11 Patrick Palka <ppalka@redhat.com>
1130 * mangle.c (write_expression): Mangle __alignof_ differently
1131 from alignof when the ABI version is at least 15.
1133 2020-11-11 Patrick Palka <ppalka@redhat.com>
1136 * cp-tree.h (cxx_sizeof_or_alignof_expr): Add bool parameter.
1137 * decl.c (fold_sizeof_expr): Pass false to
1138 cxx_sizeof_or_alignof_expr.
1139 * parser.c (cp_parser_unary_expression): Pass std_alignof to
1140 cxx_sizeof_or_alignof_expr.
1141 * pt.c (tsubst_copy): Pass false to cxx_sizeof_or_alignof_expr.
1142 (tsubst_copy_and_build): Pass std_alignof to
1143 cxx_sizeof_or_alignof_expr.
1144 * typeck.c (cxx_alignof_expr): Add std_alignof bool parameter
1145 and pass it to cxx_sizeof_or_alignof_type. Set ALIGNOF_EXPR_STD_P
1147 (cxx_sizeof_or_alignof_expr): Add std_alignof bool parameter
1148 and pass it to cxx_alignof_expr. Assert op is either
1149 SIZEOF_EXPR or ALIGNOF_EXPR.
1151 2020-11-11 Marek Polacek <polacek@redhat.com>
1154 * pt.c (tsubst_qualified_id): Use EXPR_LOCATION of the qualified-id.
1155 Use it to maybe_wrap_with_location the final expression.
1157 2020-11-10 Marek Polacek <polacek@redhat.com>
1160 * cp-tree.h (finish_static_assert): Adjust declaration.
1161 * parser.c (cp_parser_static_assert): Pass false to
1162 finish_static_assert.
1163 * pt.c (tsubst_expr): Pass true to finish_static_assert.
1164 * semantics.c (find_failing_clause_r): New function.
1165 (find_failing_clause): New function.
1166 (finish_static_assert): Add a bool parameter. Use
1167 iloc_sentinel. Call contextual_conv_bool instead of
1168 perform_implicit_conversion_flags. Don't check for INTEGER_CST before
1169 calling integer_zerop. Call find_failing_clause and maybe use its
1170 location. Print the original condition or the failing clause if
1173 2020-11-10 Strager Neds <strager.nds@gmail.com>
1175 * decl.c (duplicate_decls): Use new overload of
1176 set_decl_section_name.
1177 * method.c (use_thunk): Same.
1178 * optimize.c (maybe_clone_body): Same.
1179 * coroutines.cc (act_des_fn): Same.
1181 2020-11-10 Jakub Jelinek <jakub@redhat.com>
1184 * cvt.c (convert_to_void): Check (complain & tf_warning) in the outer
1185 if rather than twice times in the inner one. Use warn_if_unused_value.
1188 2020-11-10 Chung-Lin Tang <cltang@codesourcery.com>
1190 * parser.c (cp_parser_omp_target_data): Add use of
1191 new c_omp_adjust_map_clauses function. Add GOMP_MAP_ATTACH_DETACH as
1192 handled map clause kind.
1193 (cp_parser_omp_target_enter_data): Likewise.
1194 (cp_parser_omp_target_exit_data): Likewise.
1195 (cp_parser_omp_target): Likewise.
1196 * semantics.c (handle_omp_array_sections): Adjust COMPONENT_REF case to
1197 use GOMP_MAP_ATTACH_DETACH map kind for C_ORT_OMP region type. Fix
1198 interaction between reference case and attach/detach.
1199 (finish_omp_clauses): Adjust bitmap checks to allow struct decl and
1200 same struct field access to co-exist on OpenMP construct.
1202 2020-11-09 Marek Polacek <polacek@redhat.com>
1205 * parser.c (cp_parser_check_std_attribute): Return bool. Add a
1206 location_t parameter. Return true if the attribute wasn't duplicated.
1207 Give a warning instead of an error. Check more attributes.
1208 (cp_parser_std_attribute_list): Don't add duplicated attributes to
1209 the list. Pass location to cp_parser_check_std_attribute.
1211 2020-11-09 Patrick Palka <ppalka@redhat.com>
1213 * constraint.cc (norm_info::norm_info): Initialize orig_decl.
1214 (norm_info::orig_decl): New data member.
1215 (normalize_atom): When caching an atom for the first time,
1216 compute a list of template parameters used in the targets of the
1217 parameter mapping and store it in the TREE_TYPE of the mapping.
1218 (get_normalized_constraints_from_decl): Set current_function_decl
1219 appropriately when normalizing. As an optimization, don't
1220 set up a push_nested_class_guard when decl has no constraints.
1221 (sat_hasher::hash): Use this list to hash only the template
1222 arguments that are relevant to the atom.
1223 (satisfy_atom): Use this list to compare only the template
1224 arguments that are relevant to the atom.
1225 * pt.c (keep_template_parm): Do a sanity check on the parameter's
1226 index when flag_checking.
1228 2020-11-09 Patrick Palka <ppalka@redhat.com>
1230 * cp-tree.h (ATOMIC_CONSTR_MAP_INSTANTIATED_P): Define this flag
1232 * constraint.cc (sat_hasher::hash): Use hash_atomic_constraint
1233 if the flag is set, otherwise keep using a pointer hash.
1234 (sat_hasher::equal): Return false if the flag's setting differs
1235 on two atoms. Call atomic_constraints_identical_p if the flag
1236 is set, otherwise keep using a pointer equality test.
1237 (satisfy_atom): After instantiating the parameter mapping, form
1238 another ATOMIC_CONSTR using the instantiated mapping and query
1239 the cache again. Cache the satisfaction value of both atoms.
1240 (diagnose_atomic_constraint): Simplify now that the supplied
1241 atom has an instantiated mapping.
1243 2020-11-09 Patrick Palka <ppalka@redhat.com>
1245 * constraint.cc (atom_cache): Define this deletable hash_table.
1246 (normalize_atom): Use it to cache ATOMIC_CONSTRs when not
1247 generating diagnostics.
1248 (sat_hasher::hash): Use htab_hash_pointer instead of
1249 hash_atomic_constraint.
1250 (sat_hasher::equal): Test for pointer equality instead of
1251 atomic_constraints_identical_p.
1252 * cp-tree.h (struct atom_hasher): Moved and renamed from ...
1253 * logic.cc (struct constraint_hash): ... here.
1254 (clause::m_set): Adjust accordingly.
1256 2020-11-09 Patrick Palka <ppalka@redhat.com>
1259 * constraint.cc (tsubst_parameter_mapping): Also canonicalize
1260 the type arguments of a TYPE_ARGUMENT_PACk.
1262 2020-11-09 Jason Merrill <jason@redhat.com>
1264 * pt.c (tsubst): Replace *_ARGUMENT_PACK code with
1265 a call to tsubst_argument_pack.
1267 2020-11-09 Jason Merrill <jason@redhat.com>
1269 * class.c (handle_using_decl): Add an iloc_sentinel.
1271 2020-11-09 Marek Polacek <polacek@redhat.com>
1274 * parser.c (warn_about_ambiguous_parse): Handle the case when
1275 there is no type in the decl-specifiers.
1277 2020-11-09 Nathan Sidwell <nathan@acm.org>
1279 * cp-tree.h (LOOKUP_FOUND_P): Add ENUMERAL_TYPE.
1280 * name-lookup.c (class name_lookup): Add comments.
1281 (name_lookup::adl_namespace_only): Replace with ...
1282 (name_lookup::adl_class_fns): ... this and ...
1283 (name_lookup::adl_namespace_fns): ... this.
1284 (name_lookup::adl_namespace): Deal with inline nests here.
1285 (name_lookup::adl_class): Complete the type here.
1286 (name_lookup::adl_type): Call broken-out enum ..
1287 (name_lookup::adl_enum): New. No need to call the namespace adl
1288 if it is class-scope.
1289 (name_lookup::search_adl): Iterate over collected scopes here.
1291 2020-11-09 Nathan Sidwell <nathan@acm.org>
1293 * name-lookup.c (lookup_qualified_name): Expose an overload of a
1294 singleton with known type.
1295 (lookup_name_1): Just check the overload's type to expose it.
1296 * parser.c (cp_parser_lookup_name): Do not do that check here.
1298 2020-11-08 Iain Sandoe <iain@sandoe.co.uk>
1300 * parser.c (cp_parser_objc_at_property_declaration): Handle
1301 class keywords in @property attribute context.
1303 2020-11-06 Marek Polacek <polacek@redhat.com>
1306 * except.c (can_convert_eh): Change the return type to bool. If
1307 the type TO and FROM are the same, return true.
1309 2020-11-06 Iain Sandoe <iain@sandoe.co.uk>
1311 * parser.c (cp_parser_objc_at_property_declaration):
1312 Improve parsing fidelity. Associate better location info
1313 with @property attributes. Clean up the interface to
1314 objc_add_property_declaration ().
1316 2020-11-06 Jakub Jelinek <jakub@redhat.com>
1319 * decl.c (duplicate_decls): Propagate DECL_ATTRIBUTES and
1320 DECL_PRESERVE_P from olddecl to its clones if any.
1322 2020-11-06 Nathan Sidwell <nathan@acm.org>
1324 * cp-tree.h (DECL_UNDECLARED_BUILTIN_P): Delete.
1325 * cp-objcp-common.c (names_bultin_p): Rename
1326 DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
1327 * decl.c (decls_match): Likewise. Replace
1328 DECL_UNDECLARED_BUILTIN_P with DECL_IS_UNDECLARED_BUILTIN.
1329 (duplicate_decls): Likewise.
1330 * decl2.c (collect_source_refs): Likewise.
1331 * name-lookup.c (anticipated_builtin_p, print_binding_level)
1332 (do_nonmember_using_decl): Likewise.
1333 * pt.c (builtin_pack_fn_p): Likewise.
1334 * typeck.c (error_args_num): Likewise.
1336 2020-11-06 Nathan Sidwell <nathan@acm.org>
1338 * parser.c (cp_parser_template_declaration): Adjust 'export' warning.
1339 (cp_parser_explicit_specialization): Remove unneeded bool setting.
1341 2020-11-06 Jan Hubicka <jh@suse.cz>
1343 * tree.c (cp_fix_function_decl_p): Do not access ipa_ref_list dirrectly.
1345 2020-11-06 Tobias Burnus <tobias@codesourcery.com>
1347 * parser.c (cp_parser_omp_atomic): Add openacc parameter and update
1349 (cp_parser_omp_construct): Update call.
1351 2020-11-05 Marek Polacek <polacek@redhat.com>
1353 * except.c (check_handlers_1): Add auto_diagnostic_group.
1355 2020-11-05 Marek Polacek <polacek@redhat.com>
1358 * pt.c (do_auto_deduction): If init is REFERENCE_REF_P, use its
1361 2020-11-05 Marek Polacek <polacek@redhat.com>
1364 * except.c (check_handlers_1): Use OPT_Wexceptions for the
1365 warning. Use inform for the second part of the warning.
1367 2020-11-05 Marek Polacek <polacek@redhat.com>
1370 * cp-tree.h (enum cp_tree_index): Add CPTI_EXPLICIT_VOID_LIST.
1371 (explicit_void_list_node): Define.
1372 (PARENTHESIZED_LIST_P): New macro.
1373 (struct cp_declarator): Add function::parens_loc.
1374 * decl.c (cxx_init_decl_processing): Initialize explicit_void_list_node.
1375 (grokparms): Also break when explicit_void_list_node.
1376 * parser.c (make_call_declarator): New location_t parameter. Use it
1377 to set declarator->u.function.parens_loc.
1378 (cp_parser_lambda_declarator_opt): Pass UNKNOWN_LOCATION to
1379 make_call_declarator.
1380 (warn_about_ambiguous_parse): New function.
1381 (cp_parser_init_declarator): Call warn_about_ambiguous_parse.
1382 (cp_parser_declarator): Set *parenthesized_p to false rather than to
1384 (cp_parser_direct_declarator): Create a location for the function's
1385 parentheses and pass it to make_call_declarator.
1386 (cp_parser_parameter_declaration_clause): Return explicit_void_list_node
1388 (cp_parser_parameter_declaration_list): Set PARENTHESIZED_LIST_P
1389 in the parameters tree.
1391 2020-11-04 Jakub Jelinek <jakub@redhat.com>
1394 * semantics.c (finish_omp_clauses): Look through array reductions to
1395 find underlying decl to clear in the aligned_head bitmap. Use
1396 DECL_UID (t) instead of DECL_UID (OMP_CLAUSE_DECL (c)) when clearing
1397 in the bitmap. Only diagnose errors about allocate vars not being
1398 privatized on the same construct on allocate clause if it has
1399 a DECL_P OMP_CLAUSE_DECL.
1401 2020-11-04 Iain Sandoe <iain@sandoe.co.uk>
1403 * constexpr.c (potential_constant_expression_1): Handle
1404 expressions known to be non-constant for Objective-C.
1406 2020-11-03 Jason Merrill <jason@redhat.com>
1408 * tree.c (is_byte_access_type): Don't use char_type_p.
1410 2020-11-03 Jakub Jelinek <jakub@redhat.com>
1413 * parser.c (cp_parser_init_declarator): Don't try to parse
1414 C++17 deduction guides if there are any type specifiers even when
1417 2020-11-03 Kamlesh Kumar <kamleshbhalui@gmail.com>
1418 Jason Merrill <jason@redhat.com>
1422 * pt.c (get_template_base): Consider closest base in template
1423 deduction when base of base also matches.
1425 2020-11-03 Nathan Sidwell <nathan@acm.org>
1427 * pt.c (tsubst_expr): Simplify using decl instantiation, add
1430 2020-11-03 Nathan Sidwell <nathan@acm.org>
1432 * class.c (copy_fndecl_with_name): Always not top level.
1433 (build_cdtor_clones): Add update_methods parm, use it to
1434 conditionally update the method vec. Return void
1435 (clone_cdtor): Adjust.
1436 (clone_constructors_and_destructors): Adjust comment.
1438 2020-11-03 Nathan Sidwell <nathan@acm.org>
1440 * pt.c (primary_template_specialization_p): Use
1441 VAR_OR_FUNCTION_DECL_P.
1442 (tsubst_template_decl): Check for FUNCTION_DECL, not !TYPE && !VAR
1443 for registering a specialization.
1445 2020-11-03 Nathan Sidwell <nathan@acm.org>
1447 * cp-tree.h (fixup_deferred_exception_variants): Declare.
1448 * parser.c (cp_parser_class_specifier_1): Call it when
1449 completing deferred parses rather than creating a variant.
1450 (cp_parser_member_declaration): Move comment from ...
1451 (cp_parser_noexcept_specification_opt): ... here. Refactor the
1453 * tree.c (fixup_deferred_exception_variants): New.
1455 2020-11-03 Nathan Sidwell <nathan@acm.org>
1457 * pt.c (tsubst_lambda_expr): Reorder extra-scope handling to match
1458 the non-template case.
1459 (instantiate_body): Move a couple of declarations to their
1462 2020-11-03 Nathan Sidwell <nathan@acm.org>
1464 * decl.c (duplicate_decls): Return error_mark_node fo extern-c
1467 2020-11-03 Marek Polacek <polacek@redhat.com>
1469 * constexpr.c (potential_constant_expression_1): Treat
1470 __PRETTY_FUNCTION__ inside a template function as
1471 potentially-constant.
1472 * pt.c (uses_template_parms): Call
1473 instantiation_dependent_expression_p instead of
1474 value_dependent_expression_p.
1475 (instantiation_dependent_expression_p): Check
1476 potential_constant_expression before calling
1477 value_dependent_expression_p.
1479 2020-11-03 Marek Polacek <polacek@redhat.com>
1482 * init.c (build_new_1): Disable -Winit-list-lifetime for an unevaluated
1485 2020-11-03 Nathan Sidwell <nathan@acm.org>
1487 * tree.c (bind_template_template_parm): Mark the parm as a
1489 (cp_tree_equal): Refactor CALL_EXPR. Use comp_template_args for
1492 2020-11-03 Nathan Sidwell <nathan@acm.org>
1494 * rtti.c (init_rtti_processing): Move var decl to its init.
1495 (get_tinfo_decl): Likewise. Break out creation to called helper
1497 (get_tinfo_decl_direct): ... here.
1498 (build_dynamic_cast_1): Move var decls to their initializers.
1499 (tinfo_base_init): Set decl's location to BUILTINS_LOCATION.
1500 (get_tinfo_desc): Only push ABI namespace when needed. Set type's
1503 2020-11-02 Nathan Sidwell <nathan@acm.org>
1505 * decl.c (start_decl_1): Refactor declarations. Fixup some
1507 (lookup_and_check_tag): Fixup some whitespace.
1509 2020-11-02 Nathan Sidwell <nathan@acm.org>
1511 * decl.c (duplicate_decls): Refactor some template & builtin
1514 2020-11-02 Nathan Sidwell <nathan@acm.org>
1516 * cp-tree.h (struct cxx_int_tree_map): Delete.
1517 (struct cxx_int_tree_map_hasher): Delete.
1518 * cp-gimplify.c (cxx_int_tree_map_hasher::equal): Delete.
1519 (cxx_int_tree_map_hasher::hash): Delete.
1521 2020-11-02 Patrick Palka <ppalka@redhat.com>
1523 * class.c (finish_struct_1): Don't call clear_satisfaction_cache.
1524 * constexpr.c (clear_cv_and_fold_caches): Likewise. Remove bool
1526 * constraint.cc (clear_satisfaction_cache): Remove definition.
1527 * cp-tree.h (clear_satisfaction_cache): Remove declaration.
1528 (clear_cv_and_fold_caches): Remove bool parameter.
1529 * typeck2.c (store_init_value): Remove argument to
1530 clear_cv_and_fold_caches.
1532 2020-11-01 Iain Sandoe <iain@sandoe.co.uk>
1534 * parser.c (cp_parser_objc_at_property_declaration): Use any
1535 exisiting syntax error to suppress complaints about a missing
1536 closing parenthesis in parsing property attributes.
1538 2020-10-30 Jakub Jelinek <jakub@redhat.com>
1540 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_ALLOCATE>: Handle
1541 non-static members in methods.
1542 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_ALLOCATE.
1544 2020-10-29 Marek Polacek <polacek@redhat.com>
1548 * parser.c (cp_parser_type_id_1): Reject using auto as
1549 a template-argument in C++20.
1551 2020-10-29 Marek Polacek <polacek@redhat.com>
1554 * pt.c (do_auto_deduction): Call resolve_nondeduced_context for
1555 the elements of a { } list.
1557 2020-10-29 Marek Polacek <polacek@redhat.com>
1559 * typeck.c (do_warn_enum_conversions): Don't warn for SPACESHIP_EXPR.
1560 (cp_build_binary_op): Reject float <=> enum or enum <=> float. Use
1561 CP_INTEGRAL_TYPE_P instead of INTEGRAL_OR_ENUMERATION_TYPE_P.
1563 2020-10-29 Patrick Palka <ppalka@redhat.com>
1565 * constraint.cc (get_normalized_constraints): Remove 'args'
1566 parameter. Pass NULL_TREE as the initial template arguments to
1567 normalize_expression.
1568 (get_normalized_constraints_from_info): Remove 'args' parameter
1569 and adjust the call to get_normalized_constraints.
1570 (get_normalized_constraints_from_decl): Remove 'args' local
1571 variable and adjust call to get_normalized_constraints_from_info.
1572 (normalize_concept_definition): Remove 'args' local variable
1573 and adjust call to get_normalized_constraints.
1574 (normalize_constraint_expression): Remove the two-parameter
1575 overload. Remove 'args' parameter from the three-parameter
1576 overload and update function comment accordingly. Remove
1577 default argument from 'diag' parameter. Adjust call to
1578 get_normalized_constraints.
1579 (finish_nested_requirement): Adjust call to
1580 normalize_constraint_expression.
1581 (strictly_subsumes): Remove 'args' parameter. Adjust call to
1582 get_normalized_constraints_from_info.
1583 (weakly_subsumes): Likewise.
1584 * cp-tree.h (strictly_subsumes): Remove 'args' parameter.
1585 (weakly_subsumes): Likewise.
1586 * pt.c (process_partial_specialization): Adjust call to
1588 (is_compatible_template_arg): Adjust call to weakly_subsumes.
1590 2020-10-29 Patrick Palka <ppalka@redhat.com>
1593 * constraint.cc (normalize_concept_check): Don't call
1594 tsubst_template_args when 'args' is NULL.
1596 2020-10-29 Jason Merrill <jason@redhat.com>
1599 * constexpr.c (cxx_eval_outermost_constant_expr): Revert to
1600 original expression if evaluation sets non_constant_p.
1602 2020-10-29 Jakub Jelinek <jakub@redhat.com>
1603 Jason Merrill <jason@redhat.com>
1606 * constexpr.c (cxx_bind_parameters_in_call): Set non_constant_args
1607 if the parameter type has a non-trivial destructor.
1608 (cxx_eval_call_expression): Only unshare arguments if we're
1609 memoizing this evaluation.
1611 2020-10-29 Jakub Jelinek <jakub@redhat.com>
1614 * cp-tree.h (enum cp_tree_index): Add CPTI_HEAP_VEC_UNINIT_IDENTIFIER
1615 and CPTI_HEAP_VEC_IDENTIFIER.
1616 (heap_vec_uninit_identifier, heap_vec_identifier): Define.
1617 * decl.c (initialize_predefined_identifiers): Initialize those
1619 * constexpr.c (cxx_eval_call_expression): Reject array allocations
1620 deallocated with non-array deallocation or non-array allocations
1621 deallocated with array deallocation.
1622 (non_const_var_error): Handle heap_vec_uninit_identifier and
1623 heap_vec_identifier too.
1624 (cxx_eval_constant_expression): Handle also heap_vec_uninit_identifier
1625 and in that case during initialization replace it with
1626 heap_vec_identifier.
1627 (find_heap_var_refs): Handle heap_vec_uninit_identifier and
1628 heap_vec_identifier too.
1630 2020-10-29 Nathan Sidwell <nathan@acm.org>
1632 * pt.c (push_template_decl): Do not give function-scope entities
1633 other than implicit typedefs a template header. Do not readd
1634 template info to a redeclared template.
1636 2020-10-28 Marek Polacek <polacek@redhat.com>
1638 * decl.c (grokdeclarator): Offer a fix-it hint for the "unnecessary
1639 parentheses in declaration" warning.
1640 * parser.c (cp_parser_direct_declarator): When setting
1641 declarator->parenthesized, use a location range.
1643 2020-10-28 Marek Polacek <polacek@redhat.com>
1646 * call.c (build_conditional_expr_1): Warn about the deprecated
1647 enum/real type conversion in C++20. Also warn about a non-enumerated
1648 and enumerated type in ?: when -Wenum-conversion is on.
1649 * typeck.c (do_warn_enum_conversions): New function.
1650 (cp_build_binary_op): Call it.
1652 2020-10-28 Marek Polacek <polacek@redhat.com>
1656 * pt.c (tsubst_copy_and_build): Call value_dependent_expression_p or
1657 type_dependent_expression_p instead of type_dependent_expression_p_push.
1658 But only call value_dependent_expression_p for expressions that are
1659 potential_constant_expression.
1661 2020-10-28 Marek Polacek <polacek@redhat.com>
1664 * parser.c (cp_parser_class_name): Use parser->scope when
1667 2020-10-28 Marek Polacek <polacek@redhat.com>
1670 * parser.c (cp_parser_fold_expression): Return error_mark_node
1671 if a left fold is preceded by an expression.
1673 2020-10-28 Nathan Sidwell <nathan@acm.org>
1675 * parser.c (cp_parser_omp_declare_reduction): Set
1676 DECL_LOCAL_DECL_P before push_template_decl.
1677 * pt.c (instantiate_body): Nested fns do not have template_info.
1679 2020-10-28 Patrick Palka <ppalka@redhat.com>
1682 * decl2.c (mark_used): Move up the constraints_satisfied_p check
1683 so that we check constraints before calling maybe_instantiate_decl.
1685 2020-10-28 Nathan Sidwell <nathan@acm.org>
1687 * pt.c (push_template_decl): Refactor for some RAII.
1689 2020-10-28 Jakub Jelinek <jakub@redhat.com>
1691 * parser.c (cp_parser_omp_clause_name): Handle allocate.
1692 (cp_parser_omp_clause_allocate): New function.
1693 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ALLOCATE.
1694 (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
1695 OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK,
1696 OMP_TASK_CLAUSE_MASK, OMP_TASKGROUP_CLAUSE_MASK,
1697 OMP_DISTRIBUTE_CLAUSE_MASK, OMP_TEAMS_CLAUSE_MASK,
1698 OMP_TARGET_CLAUSE_MASK, OMP_TASKLOOP_CLAUSE_MASK): Add
1699 PRAGMA_OMP_CLAUSE_ALLOCATE.
1700 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_ALLOCATE.
1701 * pt.c (tsubst_omp_clauses): Likewise.
1703 2020-10-27 Nathan Sidwell <nathan@acm.org>
1705 * cp-tree.h (struct lang_type): Delete nested_udts field.
1706 (CLASSTYPE_NESTED_UTDS): Delete.
1707 * name-lookup.h (binding_table, binding_entry): Delete typedefs.
1708 (bt_foreach_proc): Likewise.
1709 (struct binding_entry_s): Delete.
1710 (SCOPE_DEFAULT_HT_SIZE, CLASS_SCOPE_HT_SIZE)
1711 (NAMESPACE_ORDINARY_HT_SIZE, NAMESPACE_STD_HT_SIZE)
1712 (GLOBAL_SCOPE_HT_SIZE): Delete.
1713 (binding_table_foreach, binding_table_find): Delete declarations.
1714 * name-lookup.c (ENTRY_INDEX): Delete.
1715 (free_binding_entry): Delete.
1716 (binding_entry_make, binding_entry_free): Delete.
1717 (struct binding_table_s): Delete.
1718 (binding_table_construct, binding_table_free): Delete.
1719 (binding_table_new, binding_table_expand): Delete.
1720 (binding_table_insert, binding_table_find): Delete.
1721 (binding_table_foreach): Delete.
1722 (maybe_process_template_type_declaration): Delete
1723 CLASSTYPE_NESTED_UTDS insertion.
1724 (do_pushtag): Likewise.
1725 * decl2.c (bt_reset_linkage_1): Fold into reset_type_linkage_1.
1726 (reset_type_linkage_2, bt_reset_linkage_2): Fold into
1728 * pt.c (instantiate_class_template_1): Delete NESTED_UTDs comment.
1729 (bt_instantiate_type_proc): Delete.
1730 (do_type_instantiation): Instantiate implicit typedef fields.
1731 Delete NESTED_UTD walk.
1732 * search.c (lookup_field_r): Delete unreachable NESTED_UTD
1735 2020-10-27 Nathan Sidwell <nathan@acm.org>
1737 * parser.c (cp_parser_explicit_instantiation): Refactor some RAII.
1738 * pt.c (bt_instantiate_type_proc): DATA is the tree, pass type to
1739 do_type_instantiation.
1740 (do_type_instantiation): Require T to be a type. Refactor for
1743 2020-10-26 Ville Voutilainen <ville.voutilainen@gmail.com>
1745 * cp-tree.h (CPTK_IS_NOTHROW_ASSIGNABLE): New.
1746 (CPTK_IS_NOTHROW_CONSTRUCTIBLE): Likewise.
1747 (is_nothrow_xible): Likewise.
1748 * method.c (is_nothrow_xible): New.
1749 (is_trivially_xible): Tweak.
1750 * parser.c (cp_parser_primary_expression): Handle the new RID_*.
1751 (cp_parser_trait_expr): Likewise.
1752 * semantics.c (trait_expr_value): Handle the new RID_*.
1753 (finish_trait_expr): Likewise.
1755 2020-10-24 Marek Polacek <polacek@redhat.com>
1758 * constexpr.c (cxx_eval_array_reference): Set up ctx->ctor if we
1759 are initializing an aggregate. Call free_constructor on the new
1760 CONSTRUCTOR if it isn't returned from cxx_eval_constant_expression.
1762 2020-10-23 Marek Polacek <polacek@redhat.com>
1765 * typeck.c (cp_build_binary_op): Implement -Wsizeof-array-div.
1767 2020-10-22 Patrick Palka <ppalka@redhat.com>
1770 * constexpr.c (init_subob_ctx): Don't punt on RANGE_EXPR
1771 indexes, instead build a sub-aggregate initialization context
1774 2020-10-22 Patrick Palka <ppalka@redhat.com>
1777 * constexpr.c (cxx_eval_constant_expression)
1778 <case EMPTY_CLASS_EXPR>: Lower it to a CONSTRUCTOR.
1779 (potential_constant_expression_1) <case COMPOUND_EXPR>: Remove
1780 now-redundant handling of COMPOUND_EXPR with EMPTY_CLASS_EXPR
1782 <case EMPTY_CLASS_EXPR>: Return true instead of false.
1784 2020-10-22 Patrick Palka <ppalka@redhat.com>
1787 * decl.c (duplicate_decls): Return NULL_TREE if
1788 DECL_TEMPLATE_PARM_P differ.
1790 2020-10-20 Nathan Sidwell <nathan@acm.org>
1792 * name-lookup.c (push_local_extern_decl_alias): Reconstextualize
1793 alias' parm decls. Drop any default args.
1795 2020-10-19 Iain Sandoe <iain@sandoe.co.uk>
1798 * coroutines.cc (struct coroutine_info): Add a field to
1799 record that we emitted a promise type error.
1800 (coro_promise_type_found_p): Check for the case that the
1801 promise type contains both return_void and return_value.
1802 Emit an error if so, with information about the wrong
1805 2020-10-16 Nathan Sidwell <nathan@acm.org>
1808 * pt.c (push_template_decl): Check DECL_LANG_SPECIFIC in friend
1811 2020-10-16 Nathan Sidwell <nathan@acm.org>
1814 * parser.c (cp_parser_declaration): Make token2 point to EOF if
1817 2020-10-15 Jason Merrill <jason@redhat.com>
1820 * decl.c (copy_fn_p): Return false for a function that is neither a
1821 constructor nor an assignment operator.
1822 (move_signature_fn_p): Likewise.
1824 2020-10-15 Marek Polacek <polacek@redhat.com>
1828 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Handle OFFSET_TYPE.
1829 (cxx_pretty_printer::abstract_declarator): Fix the printing of ')'.
1830 (cxx_pretty_printer::direct_abstract_declarator): Handle OFFSET_TYPE.
1831 (cxx_pretty_printer::type_id): Likewise. Print the abstract declarator
1832 for pointers-to-members.
1834 2020-10-14 Jason Merrill <jason@redhat.com>
1837 * pt.c (check_for_bare_parameter_packs): Diagnose use of
1840 2020-10-14 Nathan Sidwell <nathan@acm.org>
1842 * cp-tree.h (struct lang_decl_fn): Adjust context comment.
1843 (DECL_FRIEND_P): Replace with ...
1844 (DECL_UNIQUE_FRIEND_P): ... this. Only for FUNCTION_DECLs.
1845 (DECL_FRIEND_CONTEXT): Adjust.
1846 * class.c (add_implicitly_declared_members): Detect friendly
1847 spaceship from context.
1848 * constraint.cc (remove_constraints): Use a checking assert.
1849 (maybe_substitute_reqs_for): Use DECL_UNIQUE_FRIEND_P.
1850 * decl.c (check_no_redeclaration_friend_default_args):
1851 DECL_UNIQUE_FRIEND_P is signficant, not hiddenness.
1852 (duplicate_decls): Adjust DECL_UNIQUE_FRIEND_P clearing.
1853 (redeclaration_error_message): Use DECL_UNIQUE_FRIEND_P.
1854 (start_preparsed_function): Correct in-class friend processing.
1855 Refactor some initializers.
1856 (grokmethod): Directly check friend decl-spec.
1857 * decl2.c (grokfield): Check DECL_UNIQUE_FRIEND_P.
1858 * friend.c (do_friend): Set DECL_UNIQUE_FRIEND_P first, remove
1859 extraneous conditions. Don't re set it afterwards.
1860 * name-lookup.c (lookup_elaborated_type_1): Simplify revealing
1862 (do_pushtag): Likewise.
1863 * pt.c (optimize_specialization_lookup_p): Check
1864 DECL_UNIQUE_FRIEND_P.
1865 (push_template_decl): Likewise. Drop unneeded friend setting.
1866 (type_dependent_expression_p): Check DECL_UNIQUE_FRIEND_P.
1868 2020-10-14 Nathan Sidwell <nathan@acm.org>
1870 * name-lookup.c (push_local_extern_decl_alias): Push into alias's
1871 namespace and use pushdecl.
1872 (do_pushdecl_with_scope): Clarify behaviour.
1874 2020-10-12 Martin Sebor <msebor@redhat.com>
1877 * error.c (dump_type_suffix): Handle both the C and C++ forms of
1880 2020-10-12 Martin Sebor <msebor@redhat.com>
1884 * init.c (warn_placement_new_too_small): Call builtin_objsize instead
1885 of duplicating what it does.
1887 2020-10-08 Jason Merrill <jason@redhat.com>
1891 * pt.c (tsubst_aggr_type): Don't build a TYPENAME_TYPE when
1893 (tsubst_template_decl): Use tsubst_aggr_type.
1895 2020-10-08 Patrick Palka <ppalka@redhat.com>
1898 * constraint.cc (build_type_constraint): Temporarily increment
1899 processing_template_decl before calling build_concept_check.
1900 * pt.c (make_constrained_placeholder_type): Likewise.
1902 2020-10-08 Patrick Palka <ppalka@redhat.com>
1905 * parser.c (cp_parser_class_specifier_1): Move call to
1906 associate_classtype_constraints from here to ...
1907 (cp_parser_class_head): ... here.
1908 * pt.c (is_compatible_template_arg): Correct documentation to
1909 say "argument is _no_ more constrained than the parameter".
1911 2020-10-07 Marek Polacek <polacek@redhat.com>
1914 * pt.c (tsubst_copy_and_build) <case TEMPLATE_ID_EXPR>: Call
1915 tsubst_copy_and_build explicitly instead of using the RECUR macro.
1916 Handle a TEMPLATE_ID_EXPR with an IDENTIFIER_NODE as its operand.
1917 <case CALL_EXPR>: Perform ADL for a TEMPLATE_ID_EXPR with an
1918 IDENTIFIER_NODE as its operand.
1920 2020-10-07 Patrick Palka <ppalka@redhat.com>
1924 * tree.c (cp_tree_equal) <case ALIGNOF_EXPR>: Return false if
1925 ALIGNOF_EXPR_STD_P differ.
1927 2020-10-07 Nathan Sidwell <nathan@acm.org>
1929 * cp-tree.h (struct language_function): Delete extern_decl_map.
1930 (DECL_LOCAL_DECL_ALIAS): New.
1931 * name-lookup.h (is_local_extern): Delete.
1932 * name-lookup.c (set_local_extern_decl_linkage): Replace with ...
1933 (push_local_extern_decl): ... this new function.
1934 (do_pushdecl): Call new function after pushing new decl. Unhide
1935 hidden non-functions.
1936 (is_local_extern): Delete.
1937 * decl.c (layout_var_decl): Do not allow VLA local externs.
1938 * decl2.c (mark_used): Also mark DECL_LOCAL_DECL_ALIAS. Drop old
1939 local-extern treatment.
1940 * parser.c (cp_parser_oacc_declare): Deal with local extern aliases.
1941 * pt.c (tsubst_expr): Adjust local extern instantiation.
1942 * cp-gimplify.c (cp_genericize_r): Remap DECL_LOCAL_DECLs.
1944 2020-10-07 Nathan Sidwell <nathan@acm.org>
1946 * cp-tree.h (DECL_BUILTIN_P): Rename to ...
1947 (DECL_UNDECLARED_BUILTIN_P): ... here.
1948 * decl.c (duplicate_decls): Adjust.
1949 * name-lookup.c (anticipated_builtin_p): Adjust.
1950 (do_nonmember_using_decl): Likewise.
1952 2020-10-07 Nathan Sidwell <nathan@acm.org>
1954 * tree.c (build_cp_fntype_variant): Clear
1955 TYPE_DEPENDENT_P_VALID if necessary.
1957 2020-10-06 Marek Polacek <polacek@redhat.com>
1960 * parser.c (cp_parser_direct_declarator): When checking if a
1961 name is a function template declaration for the P0634R3 case,
1962 look in uninstantiated templates too.
1964 2020-10-05 Marek Polacek <polacek@redhat.com>
1966 * cp-tree.h (NON_UNION_CLASS_TYPE_P): Fix typo in a comment.
1968 2020-10-05 Richard Biener <rguenther@suse.de>
1969 Jakub Jelinek <jakub@redhat.com>
1972 * error.c (dump_expr): Handle TARGET_MEM_REF.
1974 2020-10-05 Nathan Sidwell <nathan@acm.org>
1976 * name-lookup.c (maybe_add_fuzzy_decl): New.
1977 (maybe_add_fuzzy_binding): New.
1978 (consider_binding_level): Use intermediate sortable vector for
1981 2020-10-02 Marek Polacek <polacek@redhat.com>
1984 * cxx-pretty-print.c (pp_cxx_template_argument_list): If the
1985 argument is template_parm_object_p, print its DECL_INITIAL.
1987 2020-10-02 Nathan Sidwell <nathan@acm.org>
1989 * cp-tree.h (lang_decl_base): anticipated_p is not used for
1991 (DECL_ANTICIPATED): Delete.
1992 * decl.c (duplicate_decls): Delete DECL_ANTICIPATED_management,
1994 (cxx_builtin_function): Drop DECL_ANTICIPATED setting.
1995 (xref_tag_1): Drop DECL_ANTICIPATED assert.
1996 * name-lookup.c (name_lookup::adl_class_only): Drop
1997 DECL_ANTICIPATED check.
1998 (name_lookup::search_adl): Always dedup.
1999 (anticipated_builtin_p): Reimplement.
2000 (do_pushdecl): Drop DECL_ANTICIPATED asserts & update.
2001 (lookup_elaborated_type_1): Drop DECL_ANTICIPATED update.
2002 (do_pushtag): Drop DECL_ANTICIPATED setting.
2003 * pt.c (push_template_decl): Likewise.
2004 (tsubst_friend_class): Likewise.
2006 2020-10-02 Nathan Sidwell <nathan@acm.org>
2008 * name-lookup.c (consider_decl): New, broken out of ...
2009 (consider_binding_level): ... here. Iterate the hash table for
2012 2020-10-02 Nathan Sidwell <nathan@acm.org>
2014 * cp-tree.h (base_ctor_omit_inherited_parms): Declare.
2015 * class.c (add_method): Refactor main loop, only pass fns to
2016 ctor_omit_inherited_parms.
2017 (build_cdtor_clones): Rename bool parms.
2018 (clone_cdtor): Call base_ctor_omit_inherited_parms.
2019 * method.c (base_ctor_omit_inherited_parms): New, broken out of
2021 (ctor_omit_inherited_parms): ... here, call it with
2022 DECL_CLONED_FUNCTION.
2024 2020-10-02 Nathan Sidwell <nathan@acm.org>
2026 * cp-tree.h (cp_fname_init): Delete declaration.
2027 * decl.c (cp_fname_init): Merge into only caller ...
2028 (cp_make_fname): ... here & refactor.
2030 2020-10-02 Jason Merril <jason@redhat.com>
2032 * call.c (build_operator_new_call): Set CALL_FROM_NEW_OR_DELETE_P.
2033 (build_op_delete_call): Likewise.
2034 * init.c (build_new_1, build_vec_delete_1, build_delete): Not here.
2037 2020-10-02 Jason Merril <jason@redhat.com>
2039 * lambda.c (call_from_lambda_thunk_p): New.
2040 * cp-gimplify.c (cp_genericize_r): Use it.
2041 * pt.c (tsubst_copy_and_build): Use it.
2042 * typeck.c (check_return_expr): Use it.
2043 * cp-tree.h: Declare it.
2044 (CALL_FROM_NEW_OR_DELETE_P): Move to gcc/tree.h.
2046 2020-10-01 Nathan Sidwell <nathan@acm.org>
2048 * cp-tree.h (DECL_ANTICIPATED): Adjust comment.
2049 (DECL_HIDDEN_P, TYPE_HIDDEN_P): Delete.
2050 * tree.c (ovl_insert): Delete DECL_HIDDEN_P assert.
2051 (ovl_skip_hidden): Likewise.
2053 2020-10-01 Nathan Sidwell <nathan@acm.org>
2055 * name-lookup.c (pushdecl_top_level): Assert incoming context is
2056 null, add global_namespace context.
2057 (pushdecl_top_level_and_finish): Likewise.
2058 * pt.c (get_template_parm_object): Clear decl context before
2060 * semantics.c (finish_compound_literal): Likewise.
2062 2020-10-01 Nathan Sidwell <nathan@acm.org>
2064 * decl.c (lookup_and_check_tag): Refactor.
2066 2020-10-01 Jakub Jelinek <jakub@redhat.com>
2069 * call.c (build_over_call): If obj_arg is non-NULL, return INIT_EXPR
2070 setting obj_arg to call.
2072 2020-10-01 Jakub Jelinek <jakub@redhat.com>
2075 * constexpr.c (cxx_eval_call_expression): Don't VERIFY_CONSTANT the
2078 2020-10-01 Marek Polacek <polacek@redhat.com>
2081 * pt.c (do_class_deduction): Don't prune explicit deduction guides
2082 in copy-list-initialization. In copy-list-initialization, if an
2083 explicit deduction guide was selected, give an error.
2085 2020-09-30 Nathan Sidwell <nathan@acm.org>
2087 * cp-tree.h (struct lang_decl_fn): Remove hidden_friend_p.
2088 (DECL_HIDDEN_FRIEND_P): Delete.
2089 * call.c (add_function_candidate): Drop assert about anticipated
2091 (build_new_op_1): Drop koenig lookup flagging for hidden friend.
2092 * decl.c (duplicate_decls): Drop HIDDEN_FRIEND_P updating.
2093 * name-lookup.c (do_pushdecl): Likewise.
2094 (set_decl_namespace): Discover hiddenness from OVL_HIDDEN_P.
2095 * pt.c (check_explicit_specialization): Record found_hidden
2098 2020-09-29 Marek Polacek <polacek@redhat.com>
2101 * call.c (ref_conv_binds_directly_p): New function.
2102 * cp-tree.h (ref_conv_binds_directly_p): Declare.
2103 * parser.c (warn_for_range_copy): New function.
2104 (cp_convert_range_for): Call it.
2106 2020-09-29 Nathan Sidwell <nathan@acm.org>
2108 * cp-tree.h (ovl_insert): Change final parm to hidden-or-using
2110 * name-lookup.h (HIDDEN_TYPE_BINDING_P): New.
2111 (struct cxx_binding): Add type_is_hidden flag.
2112 * tree.c (ovl_insert): Change using_p parm to using_or_hidden,
2114 (ovl_skip_hidden): Assert we never see a naked hidden decl.
2115 * decl.c (xref_tag_1): Delete unhiding friend from here (moved to
2116 lookup_elaborated_type_1).
2117 * name-lookup.c (STAT_TYPE_HIDDEN_P, STAT_DECL_HIDDEN_P): New.
2118 (name_lookup::search_namespace_only): Check new hidden markers.
2119 (cxx_binding_make): Clear HIDDEN_TYPE_BINDING_P.
2120 (update_binding): Update new hidden markers.
2121 (lookup_name_1): Check HIDDEN_TYPE_BINDING_P and simplify friend
2123 (lookup_elaborated_type_1): Use new hidden markers. Reveal the
2126 2020-09-29 Nathan Sidwell <nathan@acm.org>
2128 * name-lookup.c (create_local_binding): Do not clear
2129 INHERITED_VALUE_BINDING_P here.
2130 (name_lookup::process_binding): Move done hidden-decl triage to ...
2131 (name_lookup::search_namespace_only): ... here, its only caller.
2132 (cxx_binding_make): Clear flags here.
2133 (push_binding): Not here.
2134 (pop_local_binding): RAII.
2135 (update_binding): Refactor.
2136 (do_pushdecl): Assert we're never revealing a local binding.
2137 (do_pushdecl_with_scope): Directly call do_pushdecl.
2138 (get_class_binding): Do not clear LOCAL_BINDING_P here.
2139 * pt.c (push_template_decl): Set friend & anticipated before
2142 2020-09-29 Nathan Sidwell <nathan@acm.org>
2144 * name-lookup.c (update_binding): We never meet two implicit
2146 (do_pushdecl): Adjust set_identifier_type_value_with_scope calls.
2147 (set_identifier_type_value_with_scope): Do not update binding in
2148 the namespace-case. Assert it is already there.
2150 2020-09-25 Nathan Sidwell <nathan@acm.org>
2152 * cp-tree.h (duplicate_decls): Replace 'is_friend' with 'hiding'
2153 and add 'was_hidden'.
2154 * name-lookup.h (pushdecl_namespace_level): Replace 'is_friend'
2156 (pushdecl): Likewise.
2157 (pushdecl_top_level): Drop is_friend parm.
2158 * decl.c (check_no_redeclaration_friend_default_args): Rename parm
2160 (duplicate_decls): Replace 'is_friend' with 'hiding'
2161 and 'was_hidden'. Do minimal adjustments in body.
2162 (cxx_builtin_function): Pass 'hiding' to pushdecl.
2163 * friend.c (do_friend): Pass 'hiding' to pushdecl.
2164 * name-lookup.c (supplement_binding_1): Drop defaulted arg to
2166 (update_binding): Replace 'is_friend' with 'hiding'. Drop
2167 defaulted arg to duplicate_decls.
2168 (do_pushdecl): Replace 'is_friend' with 'hiding'. Assert no
2169 surprise hidhing. Adjust duplicate_decls calls to inform of old
2171 (pushdecl): Replace 'is_friend' with 'hiding'.
2172 (set_identifier_type_value_with_scope): Adjust update_binding
2174 (do_pushdecl_with_scope): Replace 'is_friend' with 'hiding'.
2175 (pushdecl_outermost_localscope): Drop default arg to
2176 do_pushdecl_with_scope.
2177 (pushdecl_namespace_level): Replace 'is_friend' with 'hiding'.
2178 (pushdecl_top_level): Drop is_friend parm.
2179 * pt.c (register_specialization): Comment duplicate_decls call
2181 (push_template_decl): Commont pushdecl_namespace_level.
2182 (tsubst_friend_function, tsubst_friend_class): Likewise.
2184 2020-09-25 Nathan Sidwell <nathan@acm.org>
2186 * name-lookup.h (enum tag_scope): Replace with ...
2187 (enum class TAG_how): ... this. Add HIDDEN_FRIEND value.
2188 (lookup_type_scope): Replace with ...
2189 (lookup_elaborated_type): ... this.
2190 (pushtag): Use TAG_how, not tag_scope.
2191 * cp-tree.h (xref_tag): Parameter is TAG_how, not tag_scope.
2192 * decl.c (lookup_and_check_tag): Likewise. Adjust.
2193 (xref_tag_1, xref_tag): Likewise. adjust.
2194 (start_enum): Adjust lookup_and_check_tag call.
2195 * name-lookup.c (lookup_type_scope_1): Rename to ...
2196 (lookup_elaborated_type_1) ... here. Use TAG_how, not tag_scope.
2197 (lookup_type_scope): Rename to ...
2198 (lookup_elaborated_type): ... here. Use TAG_how, not tag_scope.
2199 (do_pushtag): Use TAG_how, not tag_scope. Adjust.
2200 (pushtag): Likewise.
2201 * parser.c (cp_parser_elaborated_type_specifier): Adjust.
2202 (cp_parser_class_head): Likewise.
2204 2020-09-25 Nathan Sidwell <nathan@acm.org>
2206 * cp-tree.h (DECL_BUILTIN_P): New.
2207 * decl.c (duplicate_decls): Use it. Do not treat omp-udr as a
2209 * name-lookup.c (anticipated_builtin): Use it.
2210 (set_decl_context_in_fn): Function-scope OMP UDRs have function context.
2211 (do_nonmember_using_decl): Use DECL_BUILTIN_P.
2212 * parser.c (cp_parser_omp_declare_reduction): Function-scope OMP
2213 UDRs have function context. Assert we never find a valid duplicate.
2214 * pt.c (tsubst_expr): Function-scope OMP UDRs have function context.
2216 2020-09-24 Nathan Sidwell <nathan@acm.org>
2218 * cp-tree.h (duplicate_decls): Default is_friend to false.
2219 (xref_tag): Default tag_scope & tpl_header_p to ts_current & false.
2220 (push_template_decl_real): Default is_friend to false. Rename to
2222 (push_template_decl): ... here. Delete original decl.
2223 * name-lookup.h (pushdecl_namespace_level): Default is_friend to
2225 (pushtag): Default tag_scope to ts_current.
2226 * coroutines.cc (morph_fn_to_coro): Drop default args to xref_tag.
2227 * decl.c (start_decl): Drop default args to duplicate_decls.
2228 (start_enum): Drop default arg to pushtag & xref_tag.
2229 (start_preparsed_function): Pass DECL_FRIEND_P to
2231 (grokmethod): Likewise.
2232 * friend.c (do_friend): Rename push_template_decl_real calls.
2233 * lambda.c (begin_lamnbda_type): Drop default args to xref_tag.
2234 (vla_capture_type): Likewise.
2235 * name-lookup.c (maybe_process_template_type_declaration): Rename
2236 push_template_decl_real call.
2237 (pushdecl_top_level_and_finish): Drop default arg to
2238 pushdecl_namespace_level.
2239 * pt.c (push_template_decl_real): Assert no surprising friend
2240 functions. Rename to ...
2241 (push_template_decl): ... here. Delete original function.
2242 (lookup_template_class_1): Drop default args from pushtag.
2243 (instantiate_class_template_1): Likewise.
2244 * ptree.c (debug_overload): Print hidden and using markers.
2245 * rtti.c (init_rtti_processing): Drop refault args from xref_tag.
2246 (build_dynamic_cast_1, tinfo_base_init): Likewise.
2247 * semantics.c (begin_class_definition): Drop default args to
2250 2020-09-24 Nathan Sidwell <nathan@acm.org>
2253 * pt.c (maybe_instantiate_noexcept): Local externs are never
2256 2020-09-23 Nathan Sidwell <nathan@acm.org>
2258 * name-lookup.h (typedef cxx_binding): Delete tdef.
2259 (typedef cp_binding_level): Likewise.
2260 (struct cxx_binding): Flags are bools.
2262 2020-09-23 Nathan Sidwell <nathan@acm.org>
2265 * pt.c (tsubst_copy) [FUNCTION_DECL,VAR_DECL]: Retrieve local
2266 specialization for DECL_LOCAL_P decls.
2268 2020-09-22 Patrick Palka <ppalka@redhat.com>
2271 * pt.c (corresponding_template_parameter): Define.
2272 (keep_template_parm): Use it to adjust the given template
2273 parameter to the corresponding in-scope one from ctx_parms.
2275 2020-09-22 Nathan Sidwell <nathan@acm.org>
2277 * cp-tree.h (xref_tag_from_type): Don't declare.
2278 * decl.c (xref_tag_from_type): Delete.
2279 * pt.c (lookup_template_class_1): Erroneously located class
2280 definitions just give error_mark, don't try and inject it into the
2283 2020-09-22 Jakub Jelinek <jakub@redhat.com>
2286 * constexpr.c (cxx_eval_builtin_function_call): Return void_node for
2287 calls to __sanitize_ptr_{sub,cmp} builtins.
2289 2020-09-22 Nathan Sidwell <nathan@acm.org>
2291 * pt.c (instantiate_class_template_1): Do not repush and unhide
2294 2020-09-21 Marek Polacek <polacek@redhat.com>
2298 * lambda.c (maybe_add_lambda_conv_op): Mark the conversion function
2301 2020-09-21 Marek Polacek <polacek@redhat.com>
2303 * pt.c (deduction_guides_for): Add a bool parameter. Set it.
2304 (do_class_deduction): Warn when CTAD succeeds but the type doesn't
2305 have any explicit deduction guides.
2307 2020-09-21 Nathan Sidwell <nathan@acm.org>
2309 * decl.c (xref_tag_1): Use IDENTIFIER_LAMBDA_P to detect lambdas.
2310 * lambda.c (begin_lambda_type): Use ts_current to push the tag.
2311 * name-lookup.h (enum tag_scope): Drop ts_lambda.
2313 2020-09-21 Marek Polacek <polacek@redhat.com>
2316 * decl.c (redeclaration_error_message): Detect a redeclaration of
2319 2020-09-19 Sandra Loosemore <sandra@codesourcery.com>
2321 * cp-gimplify.c (enum bc_t, bc_label): Move to c-family.
2322 (begin_bc_block, finish_bc_block, get_bc_label): Likewise.
2323 (genericize_cp_loop): Likewise.
2324 (genericize_for_stmt, genericize_while_stmt): Likewise.
2325 (genericize_do_stmt, genericize_switch_stmt): Likewise.
2326 (genericize_continue_stmt, genericize_break_stmt): Likewise.
2327 (genericize_omp_for_stmt): Likewise.
2328 (cp_genericize_r): Call c_genericize_control_stmt instead of
2329 above functions directly.
2330 (cp_genericize): Call save_bc_state and restore_bc_state instead
2331 of manipulating bc_label directly.
2332 * cp-objcp-common.c (cxx_block_may_fallthru): Defer to
2333 c_block_may_fallthru instead of handling SWITCH_STMT here.
2334 (cp_common_init_ts): Move handling of loop and switch-related
2335 statements to c-family.
2336 * cp-tree.def (FOR_STMT, WHILE_STMT, DO_STMT): Move to c-family.
2337 (BREAK_STMT, CONTINUE_STMT, SWITCH_STMT): Likewise.
2338 * cp-tree.h (LABEL_DECL_BREAK, LABEL_DECL_CONTINUE): Likewise.
2339 (WHILE_COND, WHILE_BODY): Likewise.
2340 (DO_COND, DO_BODY): Likewise.
2341 (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY, FOR_SCOPE): Likewise.
2342 (SWITCH_STMT_COND, SWITCH_STMT_BODY): Likewise.
2343 (SWITCH_STMT_TYPE, SWITCH_STMT_SCOPE): Likewise.
2344 (SWITCH_STMT_ALL_CASES_P, SWITCH_STMT_NO_BREAK_P): Likewise.
2345 * cxx-pretty-print.c (cxx_pretty_printer::statement): Move code
2346 to handle structured loop and switch tree nodes to c-family.
2347 * dump.c (cp_dump_tree): Likewise.
2349 2020-09-19 Patrick Palka <ppalka@redhat.com>
2353 * constraint.cc (map_arguments): Call template_parm_to_arg
2354 in the self-mapping case.
2355 (finish_shorthand_constraint): No need to build a TREE_LIST
2356 before calling template_parm_to_arg.
2357 * pt.c (template_parm_to_arg): Rewrite to handle TEMPLATE_PARM_P
2358 nodes as well as DECL_TEMPLATE_PARM_P nodes, and to make the
2359 overlying TREE_LIST node optional.
2360 (keep_template_parm): Don't record a BOUND_TEMPLATE_TEMPLATE_PARM,
2361 instead record its corresponding TEMPLATE_TEMPLATE_PARM.
2362 (convert_generic_types_to_packs): Don't call
2363 template_parm_to_arg.
2365 2020-09-19 Patrick Palka <ppalka@redhat.com>
2368 * constraint.cc (satisfy_atom): Pass true as the
2369 manifestly_const_eval argument to maybe_constant_value.
2371 2020-09-18 Jason Merrill <jason@redhat.com>
2374 * decl.c (complete_vars): Only call layout_var_decl if completing
2377 2020-09-18 Jason Merrill <jason@redhat.com>
2379 * decl.c (complete_vars): Call layout_var_decl.
2381 2020-09-17 Patrick Palka <ppalka@redhat.com>
2385 * constraint.cc (tsubst_requires_expr): Use REQUIRES_EXPR_PARMS
2386 and REQUIRES_EXPR_REQS. Use REQUIRES_EXPR_EXTRA_ARGS,
2387 add_extra_args and build_extra_args to defer substitution until
2388 we have all the template arguments.
2389 (finish_requires_expr): Adjust the call to build_min so that
2390 REQUIRES_EXPR_EXTRA_ARGS gets set to NULL_TREE.
2391 * cp-tree.def (REQUIRES_EXPR): Give it a third operand.
2392 * cp-tree.h (REQUIRES_EXPR_PARMS, REQUIRES_EXPR_REQS,
2393 REQUIRES_EXPR_EXTRA_ARGS): Define.
2394 (add_extra_args, build_extra_args): Declare.
2396 2020-09-16 Nathan Sidwell <nathan@acm.org>
2398 * cp-tree.h (cp_check_omp_declare_reduction): Return bool.
2399 * semantics.c (cp_check_omp_declare_reduction): Return true on for
2401 * pt.c (push_template_decl_real): OMP reductions do not get a
2403 (tsubst_function_decl): Remove special casing for local decl omp
2405 (tsubst_expr): Call instantiate_body for a local omp reduction.
2406 (instantiate_body): Add nested_p parm, and deal with such
2408 (instantiate_decl): Reject FUNCTION_SCOPE entities, adjust
2409 instantiate_body call.
2411 2020-09-16 Nathan Sidwell <nathan@acm.org>
2413 * pt.c (instantiate_body): Remove 'nested' var, simplify
2416 2020-09-16 Nathan Sidwell <nathan@acm.org>
2418 * pt.c (instantiate_body): New, broken out of ..
2419 (instantiate_decl): ... here. Call it.
2421 2020-09-15 Nathan Sidwell <nathan@acm.org>
2423 * pt.c (push_template_decl_real): OMP reductions retain a template
2425 (tsubst_function_decl): Likewise.
2427 2020-09-15 Tobias Burnus <tobias@codesourcery.com>
2430 * cp-gimplify.c (cxx_omp_finish_clause): Add bool openacc arg.
2431 * cp-tree.h (cxx_omp_finish_clause): Likewise
2432 * semantics.c (handle_omp_for_class_iterator): Update call.
2434 2020-09-14 Marek Polacek <polacek@redhat.com>
2436 * pt.c (push_template_decl_real): Use VAR_OR_FUNCTION_DECL_P.
2438 2020-09-14 Nathan Sidwell <nathan@acm.org>
2440 * pt.c (push_template_decl_real): Don't attach a template head to
2442 (tsubst_function_decl): Add support for headless local extern
2444 (tsubst_decl): Add support for headless local extern decls.
2446 2020-09-11 Nathan Sidwell <nathan@acm.org>
2448 * decl.c (grokfndecl): Don't attach to local extern.
2450 2020-09-11 Nathan Sidwell <nathan@acm.org>
2452 * parser.c (cp_parser_objc_method_definition_list): Reimplement
2453 loop, make sure we pop scope.
2455 2020-09-11 Marek Polacek <polacek@redhat.com>
2457 * cp-tree.h (LOOKUP_CONSTINIT): Remove.
2458 (LOOKUP_REWRITTEN): Adjust.
2459 * decl.c (duplicate_decls): Set DECL_DECLARED_CONSTINIT_P.
2460 (check_initializer): Use DECL_DECLARED_CONSTINIT_P instead of
2462 (cp_finish_decl): Don't set DECL_DECLARED_CONSTINIT_P. Use
2463 DECL_DECLARED_CONSTINIT_P instead of LOOKUP_CONSTINIT.
2464 (grokdeclarator): Set DECL_DECLARED_CONSTINIT_P.
2465 * decl2.c (grokfield): Don't handle LOOKUP_CONSTINIT.
2466 * parser.c (cp_parser_decomposition_declaration): Remove
2467 LOOKUP_CONSTINIT handling.
2468 (cp_parser_init_declarator): Likewise.
2469 * pt.c (tsubst_expr): Likewise.
2470 (instantiate_decl): Likewise.
2471 * typeck2.c (store_init_value): Use DECL_DECLARED_CONSTINIT_P instead
2472 of LOOKUP_CONSTINIT.
2474 2020-09-10 Nathan Sidwell <nathan@acm.org>
2476 * cp-tree.h (TINFO_VAR_DECLARED_CONSTINIT): Replace with ...
2477 (DECL_DECLARED_CONSTINIT_P): ... this.
2478 * decl.c (start_decl): No need to retrofit_lang_decl for constinit
2480 (cp_finish_decl): Use DECL_DECLARED_CONSTINIT_P.
2481 * pt.c (tsubst_decl): No need to handle constinit flag
2483 (tsubst_expr): Or here.
2485 2020-09-10 Nathan Sidwell <nathan@acm.org>
2487 * cp-tree.h (DECL_LOCAL_FUNCTION_P): Rename to ...
2488 (DECL_LOCAL_DECL_P): ... here. Accept both fns and vars.
2489 * decl.c (start_decl): Set DECL_LOCAL_DECL_P for local externs.
2490 (omp_declare_variant_finalize_one): Use DECL_LOCAL_DECL_P.
2491 (local_variable_p): Simplify.
2492 * name-lookup.c (set_decl_context_in_fn): Assert DECL_LOCAL_DECL_P
2493 is as expected. Simplify.
2494 (do_pushdecl): Don't set decl_context_in_fn for friends.
2495 (is_local_extern): Simplify.
2496 * call.c (equal_functions): Use DECL_LOCAL_DECL_P.
2497 * parser.c (cp_parser_postfix_expression): Likewise.
2498 (cp_parser_omp_declare_reduction): Likewise.
2499 * pt.c (check_default_tmpl_args): Likewise.
2500 (tsubst_expr): Assert nested reduction function is local.
2501 (type_dependent_expression_p): Use DECL_LOCAL_DECL_P.
2502 * semantics.c (finish_call_expr): Likewise.
2504 2020-09-09 Marek Polacek <polacek@redhat.com>
2507 * decl.c (reshape_init): If we're initializing a char array from
2508 a string-literal that is enclosed in braces, unwrap it.
2509 * init.c (build_new_1): Don't handle string-initializers here.
2510 (build_new): Handle new-expression with paren-init when the
2511 array bound is known. Always pass string constants to build_new_1
2512 enclosed in braces. Don't handle string-initializers in any
2515 2020-09-09 Marek Polacek <polacek@redhat.com>
2518 * decl.c (reshape_init_r): When initializing an aggregate member
2519 with an initializer from an initializer-list, also consider
2522 2020-09-09 Nathan Sidwell <nathan@acm.org>
2524 * parser.c (cp_parser_omp_declare_reduction): Refactor to avoid
2525 code duplication. Update DECL_TI_TEMPLATE's context.
2526 * pt.c (tsubst_expr): For OMP reduction function, set context to
2527 global_namespace before pushing.
2528 (tsubst_omp_udr): Assert current_function_decl, add comment about
2531 2020-09-09 Patrick Palka <ppalka@redhat.com>
2534 * class.c (resolve_address_of_overloaded_function): Check
2535 constraints_satisfied_p and perform return-type deduction via
2536 maybe_instantiate_decl when considering non-template functions
2537 in the overload set.
2538 * cp-tree.h (maybe_instantiate_decl): Declare.
2539 * decl2.c (maybe_instantiate_decl): Remove static.
2541 2020-09-04 Jason Merrill <jason@redhat.com>
2543 * expr.c (mark_use): Use iloc_sentinel.
2545 2020-09-03 Jakub Jelinek <jakub@redhat.com>
2548 * constexpr.c (fundef_copies_table): Change type from
2549 hash_map<tree, tree> * to decl_tree_map *.
2551 2020-09-03 Marek Polacek <polacek@redhat.com>
2554 * cp-tree.h (do_aggregate_paren_init): Declare.
2555 * decl.c (do_aggregate_paren_init): New.
2556 (grok_reference_init): Use it.
2557 (check_initializer): Likewise.
2558 * init.c (perform_member_init): Handle initializing an array from
2559 a ()-list. Use do_aggregate_paren_init.
2561 2020-09-03 Jakub Jelinek <jakub@redhat.com>
2564 * constexpr.c (cxx_eval_outermost_constant_expr): Temporarily disable
2565 flag_rounding_math during manifestly constant evaluation.
2567 2020-09-01 Marek Polacek <polacek@redhat.com>
2570 * init.c (build_new_1): Call reshape_init.
2572 2020-09-01 Jakub Jelinek <jakub@redhat.com>
2575 * semantics.c (handle_omp_array_sections_1): Test
2576 DECL_ARRAY_PARAMETER_P only on PARM_DECLs.
2578 2020-08-31 Marek Polacek <polacek@redhat.com>
2579 Jason Merrill <jason@redhat.com>
2582 * call.c (build_new_method_call_1): Use build_constructor_from_vec
2583 instead of build_tree_list_vec + build_constructor_from_list.
2584 * init.c (build_new_1): Handle new char[]{"foo"}. Use
2585 build_constructor_from_vec instead of build_tree_list_vec +
2586 build_constructor_from_list.
2587 (build_new): Deduce the array size in new-expression if not
2588 present. Handle ()-init. Handle initializing an array from
2590 * parser.c (cp_parser_new_type_id): Leave [] alone.
2591 (cp_parser_direct_new_declarator): Allow [].
2592 * pt.c (type_dependent_expression_p): In a NEW_EXPR, consider
2593 array types whose dimension has to be deduced type-dependent.
2595 2020-08-27 Martin Liska <mliska@suse.cz>
2597 * class.c (build_vtbl_initializer): Set exact argument of a vector
2598 growth function to true.
2599 * constraint.cc (get_mapped_args): Likewise.
2600 * decl.c (cp_maybe_mangle_decomp): Likewise.
2601 (cp_finish_decomp): Likewise.
2602 * parser.c (cp_parser_omp_for_loop): Likewise.
2603 * pt.c (canonical_type_parameter): Likewise.
2604 * rtti.c (get_pseudo_ti_init): Likewise.
2606 2020-08-26 Nathan Sidwell <nathan@acm.org>
2608 * decl.c (poplevel): A local-binding tree list holds the name in
2610 * name-lookup.c (update_local_overload): Add id to TREE_PURPOSE.
2611 (lookup_name_1): Deal with local-binding error_mark_node marker.
2612 (op_unqualified_lookup): Return error_mark_node for 'nothing
2613 found'. Retain global binding, check class binding here.
2614 (maybe_save_operator_binding): Reimplement to always cache a
2616 (push_operator_bindings): Deal with 'ignore' marker.
2618 2020-08-25 Tobias Burnus <tobias@codesourcery.com>
2621 * semantics.c (handle_omp_array_sections_1): Talk about
2622 array function parameter in the error message.
2624 2020-08-25 Jakub Jelinek <jakub@redhat.com>
2627 * cp-tree.h (build_trivial_dtor_call): Add bool argument defaulted
2629 * call.c (build_trivial_dtor_call): Add NO_PTR_DEREF argument. If
2630 instance is a pointer and NO_PTR_DEREF is true, clobber the pointer
2631 rather than what it points to.
2632 * semantics.c (finish_call_expr): Call build_trivial_dtor_call with
2633 true as NO_PTR_DEREF.
2635 2020-08-25 Jason Merrill <jason@redhat.com>
2638 * optimize.c (populate_clone_array): Revert PR70462 change.
2639 (maybe_clone_body): Likewise.
2641 2020-08-24 Nathan Sidwell <nathan@acm.org>
2643 * ptree.c (debug_overload): New.
2645 2020-08-19 Jason Merrill <jason@redhat.com>
2648 * cp-tree.h (push_tinst_level, push_tinst_level_loc): Declare.
2649 * constraint.cc (satisfy_declaration_constraints):
2650 Use add_outermost_template_args and push_tinst_level.
2651 * pt.c (add_outermost_template_args): Handle getting
2652 a TEMPLATE_DECL as the first argument.
2653 (push_tinst_level, push_tinst_level_loc): No longer static.
2654 (fn_type_unification): Check satisfaction before non-dependent
2657 2020-08-18 Nathan Sidwell <nathan@acm.org>
2659 * cp-tree.h (SET_TYPE_TEMPLTE_INFO): Do not deal with ALIAS templates.
2660 * pt.c (lookup_template_class_1): Special-case alias template
2661 template_info setting.
2663 2020-08-18 Jason Merrill <jason@redhat.com>
2666 * pt.c (tsubst_aggr_type): Rewrite in C++17, too.
2667 (maybe_dependent_member_ref): Likewise.
2668 (build_deduction_guide): Re-substitute template parms.
2669 * cp-tree.h (struct push_nested_class_guard): New.
2670 * constraint.cc (get_normalized_constraints_from_decl): Use it.
2672 2020-08-18 Jason Merrill <jason@redhat.com>
2675 * pt.c (maybe_dependent_member_ref): New.
2676 (tsubst_copy) [CONST_DECL]: Use it.
2677 [VAR_DECL]: Likewise.
2678 (tsubst_aggr_type): Handle nested type.
2680 2020-08-18 Nathan Sidwell <nathan@acm.org>
2682 * name-lookup.c (qualify_lookup): Drop lambda checking here.
2683 Reorder namespace & type checking.
2684 (lookup_name_1): Do hidden lambda checking here.
2686 2020-08-14 Nathan Sidwell <nathan@acm.org>
2688 * name-lookup.h (lookup_name_real, lookup_name_nonclass): Rename
2690 (lookup_name): ... these new overloads.
2691 * name-lookup.c (identifier_type_value_1): Rename lookup_name_real
2693 (lookup_name_real_1): Rename to ...
2694 (lookup_name_1): ... here.
2695 (lookup_name_real): Rename to ...
2696 (lookup_name): ... here. Rename lookup_name_real_1 call.
2697 (lookup_name_nonclass): Delete.
2698 * call.c (build_operator_new_call): Rename lookup_name_real call.
2699 (add_operator_candidates): Likewise.
2700 (build_op_delete_call): Rename lookup_name_nonclass call.
2701 * parser.c (cp_parser_lookup_name): Likewise.
2702 * pt.c (tsubst_friend_class, lookup_init_capture_pack): Likewise.
2703 (tsubst_expr): Likewise.
2704 * semantics.c (capture_decltype): Likewise.
2706 2020-08-14 Nathan Sidwell <nathan@acm.org>
2708 * cp-tree.h (LOOKUP_HIDDEN): Delete.
2709 (LOOKUP_PREFER_RVALUE): Adjust initializer.
2710 * name-lookup.h (enum class LOOK_want): Add HIDDEN_FRIEND and
2711 HIDDEN_LAMBDA flags.
2712 (lookup_name_real): Drop flags parm.
2713 (lookup_qualified_name): Drop find_hidden parm.
2714 * name-lookup.c (class name_lookup): Drop hidden field, adjust
2716 (name_lookup::add_overload): Check want for hiddenness.
2717 (name_lookup::process_binding): Likewise.
2718 (name_lookup::search_unqualified): Likewise.
2719 (identifier_type_value_1): Adjust lookup_name_real call.
2720 (set_decl_namespace): Adjust name_lookup ctor.
2721 (qualify_lookup): Drop flags parm, use want for hiddenness.
2722 (lookup_qualified_name): Drop find_hidden parm.
2723 (lookup_name_real_1): Drop flags parm, adjust qualify_lookup
2725 (lookup_name_real): Drop flags parm.
2726 (lookup_name_nonclass, lookup_name): Adjust lookup_name_real
2728 (lookup_type_scope_1): Adjust qualify_lookup calls.
2729 * call.c (build_operator_new_call): Adjust lookup_name_real call.
2730 (add_operator_candidates): Likewise.
2731 * coroutines.cc (morph_fn_to_coro): Adjust lookup_qualified_name
2733 * parser.c (cp_parser_lookup_name): Adjust lookup_name_real calls.
2734 * pt.c (check_explicit_specialization): Adjust
2735 lookup_qualified_name call.
2736 (deduction_guides_for): Likewise.
2737 (tsubst_friend_class): Adjust lookup_name_real call.
2738 (lookup_init_capture_pack): Likewise.
2739 (tsubst_expr): Likewise, don't look in namespaces.
2740 * semantics.c (capture_decltype): Adjust lookup_name_real. Don't
2743 2020-08-14 Jason Merrill <jason@redhat.com>
2747 * cp-tree.h (unsafe_return_slot_p): Declare.
2748 * call.c (is_base_field_ref): Rename to unsafe_return_slot_p.
2749 (build_over_call): Check unsafe_return_slot_p.
2750 (build_special_member_call): Likewise.
2751 * init.c (expand_default_init): Likewise.
2752 * typeck2.c (split_nonconstant_init_1): Likewise.
2754 2020-08-14 Nathan Sidwell <nathan@acm.org>
2756 * cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES)
2757 (LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY)
2758 (LOOKUP_QUALIFIERS_ONL): Delete.
2759 (LOOKUP_HIDDEN): Adjust.
2760 * name-lookup.h (enum class LOOK_want): New.
2761 (operator|, operator&): Overloads for it.
2762 (lookup_name_real): Replace prefer_type & namespaces_only with
2764 (lookup_qualified_name): Replace prefer_type with LOOK_want.
2765 (lookup_name_prefer_type): Replace with ...
2766 (lookup_name): ... this. New overload with LOOK_want parm.
2767 * name-lookup.c (struct name_lookup): Replace flags with want and
2768 hidden fields. Adjust constructors.
2769 (name_lookyp::add_overload): Correct hidden stripping test. Update
2770 for new LOOK_want type.
2771 (name_lookup::process_binding): Likewise.
2772 (name_lookup::search_unqualified): Use hidden flag.
2773 (identifier_type_value_1): Adjust lookup_name_real call.
2774 (set_decl_namespace): Adjust name_lookup ctor.
2775 (lookup_flags): Delete.
2776 (qualify_lookup): Add LOOK_want parm, adjust.
2777 (lookup_qualified_name): Replace prefer_type parm with LOOK_want.
2778 (lookup_name_real_1): Replace prefer_type and namespaces_only with
2780 (lookup_name_real): Likewise.
2781 (lookup_name_nonclass, lookup_name): Adjust lookup_name_real call.
2782 (lookup_name_prefer_type): Rename to ...
2783 (lookup_name): ... here. New overload with LOOK_want parm.
2784 (lookup_type_scope_1): Adjust qualify_lookup calls.
2785 * call.c (build_operator_new_call)
2786 (add_operator_candidates): Adjust lookup_name_real calls.
2787 * coroutines.cc (find_coro_traits_template_decl)
2788 (find_coro_handle_template_decl, morph_fn_to_coro): Adjust
2789 lookup_qualified_name calls.
2790 * cp-objcp-common.c (identifier_global_tag): Likewise.
2791 * decl.c (get_tuple_size, get_tuple_decomp_init): Likewise.
2792 (lookup_and_check_tag): Use lookup_name overload.
2793 * parser.c (cp_parser_userdef_numeric_literal): Adjust
2794 lookup_qualified_name call.
2795 (prefer_arg_type): Drop template_mem_access parm, return LOOK_want
2797 (cp_parser_lookup_name): Adjust lookup_member, lookup_name_real
2799 * pt.c (check_explicit_specialization): Adjust lookup_qualified_name
2801 (tsubst_copy_and_build, tsubst_qualified_name): Likewise
2802 (deduction_guides_for): Likewise.
2803 (tsubst_friend_class): Adjust lookup_name_real call.
2804 (lookup_init_capture, tsubst_expr): Likewise.
2805 * rtti.c (emit_support_tinfos): Adjust lookup_qualified_name call.
2806 * semantics.c (omp_reduction_lookup): Likewise.
2807 (capture_decltype): Adjust lookup_name_real call.
2809 2020-08-13 Nathan Sidwell <nathan@acm.org>
2811 * name-lookup.h (enum class LOOK_where): New.
2812 (operator|, operator&): Overloads for it.
2813 (lookup_name_real): Replace NONCLASS & BLOCK_P parms with WHERE.
2814 * name-lookup.c (identifier_type_value_w): Adjust
2815 lookup_name_real call.
2816 (lookup_name_real_1): Replace NONCLASS and BLOCK_P parameters
2817 with WHERE bitmask. Don't search namespaces if not asked to.
2818 (lookup_name_real): Adjust lookup_name_real_1 call.
2819 (lookup_name_nonclass, lookup_name)
2820 (lookup_name_prefer_type): Likewise.
2821 * call.c (build_operator_new_call)
2822 (add_operator_candidates): Adjust lookup_name_real calls.
2823 * parser.c (cp_parser_lookup_name): Likewise.
2824 * pt.c (tsubst_friend_class, lookup_init_capture_pack)
2825 (tsubst_expr): Likewise.
2826 * semantics.c (capture_decltype): Likewise.
2828 2020-08-13 Marek Polacek <polacek@redhat.com>
2831 * typeck.c (build_static_cast_1): Implement P1975R0 by allowing
2832 static_cast to aggregate type.
2834 2020-08-10 Jakub Jelinek <jakub@redhat.com>
2837 * constexpr.c (cxx_eval_binary_expression): For SPACESHIP_EXPR, tail
2838 call cxx_eval_constant_expression after genericize_spaceship to avoid
2839 undesirable further VERIFY_CONSTANT.
2841 2020-08-10 Patrick Palka <ppalka@redhat.com>
2843 * pt.c (resolve_overloaded_unification): Drop functions with
2844 unsatisfied constraints.
2845 (resolve_nondeduced_context): Likewise.
2847 2020-08-05 Patrick Palka <ppalka@redhat.com>
2848 Jason Merrill <jason@redhat.com>
2851 * constexpr.c (cxx_eval_vec_init_1): Truncate ctx->ctor and
2852 then clear CONSTRUCTOR_NO_CLEARING on each appended element
2853 initializer if we're initializing a previously zero-initialized
2856 2020-08-04 Marek Polacek <polacek@redhat.com>
2859 * parser.c (cp_parser_elaborated_type_specifier): Allow
2860 'template' following ::.
2862 2020-08-04 Nathan Sidwell <nathan@acm.org>
2864 * parser.c (cp_parser_explicit_specialization): Refactor
2865 to avoid leak of num_template_parameter_lists value.
2867 2020-08-04 Patrick Palka <ppalka@redhat.com>
2870 * init.c (sort_mem_initializers): Preserve TREE_TYPE of the
2871 member initializer list node.
2872 (emit_mem_initializers): Set input_location when performing each
2873 member initialization.
2874 * parser.c (cp_parser_mem_initializer): Attach the source
2875 location of this initializer to a dummy EMPTY_CLASS_EXPR
2876 within the TREE_TYPE of the list node.
2877 * pt.c (tsubst_initializer_list): Preserve TREE_TYPE of the
2878 member initializer list node.
2880 2020-08-03 Marek Polacek <polacek@redhat.com>
2882 * cp-tree.h (after_nsdmi_defaulted_late_checks): Remove.
2884 2020-08-03 Marek Polacek <polacek@redhat.com>
2888 * pt.c (check_default_tmpl_args): Also consider variable
2891 2020-07-31 Jakub Jelinek <jakub@redhat.com>
2894 * decl.c (finish_function): In constexpr functions use for C++14 and
2895 later error instead of warning if no return statement is present and
2896 diagnose it regardless of warn_return_type. Move the warn_return_type
2897 diagnostics earlier in the function.
2899 2020-07-31 Martin Sebor <msebor@redhat.com>
2902 * class.c (build_base_path): Set no-warning bit on the synthesized
2903 conditional expression in static_cast.
2905 2020-07-31 Richard Biener <rguenther@suse.de>
2908 * cp-objcp-common.h (LANG_HOOKS_FINALIZE_EARLY_DEBUG):
2909 Define to c_common_finalize_early_debug.
2911 2020-07-31 Patrick Palka <ppalka@redhat.com>
2914 * constexpr.c (cxx_eval_constant_expression) <case CONST_DECL>:
2915 Pass false to decl_constant_value and decl_really_constant_value
2916 so that they don't unshare their result.
2917 * cp-tree.h (decl_constant_value): New declaration with an added
2919 (decl_really_constant_value): Add bool parameter defaulting to
2920 true to existing declaration.
2921 * init.c (constant_value_1): Add bool parameter which controls
2922 whether to unshare the initializer before returning. Call
2923 unshare_expr at most once.
2924 (scalar_constant_value): Pass true to constant_value_1's new
2926 (decl_really_constant_value): Add bool parameter and forward it
2927 to constant_value_1.
2928 (decl_constant_value): Likewise, but instead define a new
2929 overload with an added bool parameter.
2931 2020-07-30 Patrick Palka <ppalka@redhat.com>
2934 * pt.c (resolve_overloaded_unification): If the function
2935 template specialization has a placeholder return type,
2936 then instantiate it before attempting unification.
2938 2020-07-30 Patrick Palka <ppalka@redhat.com>
2941 * pt.c (alias_ctad_tweaks): Call remove_constraints before
2942 calling set_constraints.
2944 2020-07-30 Patrick Palka <ppalka@redhat.com>
2947 * pt.c (reduce_template_parm_level): Propagate DECL_VIRTUAL_P
2948 from the original TEMPLATE_PARM_DECL to the new lowered one.
2950 2020-07-30 Patrick Palka <ppalka@redhat.com>
2953 * constraint.cc (constraints_satisfied_p): Return true if
2955 * pt.c (do_type_instantiation): Update a paragraph taken from
2956 [temp.explicit] to reflect the latest specification. Don't
2957 instantiate a member with unsatisfied constraints.
2959 2020-07-29 Jason Merrill <jason@redhat.com>
2962 * cp-tree.h (IMPLICIT_RVALUE_P): New.
2963 (enum cp_lvalue_kind_flags): Add clk_implicit_rval.
2964 (implicit_rvalue_p, set_implicit_rvalue_p): New.
2965 * call.c (reference_binding): Check clk_implicit_rval.
2966 (build_over_call): Adjust C++20 implicit move.
2967 * coroutines.cc (finish_co_return_stmt): Simplify implicit move.
2968 * except.c (build_throw): Adjust C++20 implicit move.
2969 * pt.c (tsubst_copy_and_build) [STATIC_CAST_EXPR]: Propagate
2971 * tree.c (lvalue_kind): Set clk_implicit_rval.
2972 * typeck.c (treat_lvalue_as_rvalue_p): Overhaul.
2973 (maybe_warn_pessimizing_move): Adjust.
2974 (check_return_expr): Adjust C++20 implicit move.
2976 2020-07-29 Jason Merrill <jason@redhat.com>
2979 * call.c (build_over_call): Don't call a const ref
2980 overload for implicit move.
2982 2020-07-28 Nathan Sidwell <nathan@acm.org>
2984 * cp-gimplify.c (cp_genericize_r): Set IMPORTED_DECL's context.
2985 * cp-objcp-common.c (cp_pushdecl): Set decl's context.
2986 * decl.c (grokfndecl): Make DECL_CONTEXT setting clearer.
2988 2020-07-28 Nathan Sidwell <nathan@acm.org>
2990 * class.c (fixup_type_variants): Copy TYPE_SIZE and
2992 (finish_struct): Call it.
2994 2020-07-28 Nathan Sidwell <nathan@acm.org>
2996 * ptree.c (cxx_print_decl): Better indentation.
2998 2020-07-28 Jakub Jelinek <jakub@redhat.com>
2999 Mark Wielaard <mark@klomp.org>
3002 * parser.c (cp_lexer_safe_previous_token): Don't call
3003 cp_lexer_previous_token, instead inline it by hand and return NULL
3004 instead of failing assertion if all previous tokens until the first
3006 (cp_parser_error_1): Optimize - only call cp_lexer_safe_previous_token
3007 if token->type is CPP_NAME. Use cp_lexer_safe_previous_token instead
3008 of cp_lexer_previous_token for the missing_token_desc != RT_NONE
3011 2020-07-27 Nathan Sidwell <nathan@acm.org>
3013 * cp-tree.h (enum cp_tree_index): Add CPTI_AS_BASE_IDENTIFIER.
3014 (as_base_identifier): Define.
3015 * decl.c (initialize_predifined_identifiers): Initialize as_base
3017 * class.c (layout_class_type): Name the as-base type. Zap
3018 NSDMI its fields may have.
3020 2020-07-22 Nathan Sidwell <nathan@acm.org>
3022 * class.c (maybe_add_class_template_decl_list): Don't add CONST_DECLs.
3024 2020-07-22 Nathan Sidwell <nathan@acm.org>
3026 * typeck.c (structural_comptypes): [DECLTYPE_TYPE] break
3028 [UNDERLYING_TYPE]: Use an if.
3031 2020-07-22 Nathan Sidwell <nathan@acm.org>
3033 * decl.c (decls_match): Move variables into scopes
3035 (duplicate_decls): Use STRIP_TEMPLATE.
3036 (build_typename_type): Move var decls to their assignments.
3037 (begin_function_body): Likewise.
3038 * decl2.c (get_guard): Likewise.
3039 (mark_used): Use true for truthiness.
3040 * error.c (dump_aggr_type): Hold the decl in a var called
3043 2020-07-22 Nathan Sidwell <nathan@acm.org>
3045 * cp-tree.h (struct tree_lambda_expr): Shrink
3046 default_capture_mode & discriminator.
3048 2020-07-22 Nathan Sidwell <nathan@acm.org>
3050 * mangle.c (decl_is_template_id): Rename to ...
3051 (maybe_template_info): ... here. Return the template info,
3052 rather than use a pointer. Adjust all callers.
3053 (find_substitution): Use template_args_equal, rather than
3056 2020-07-22 Tobias Burnus <tobias@codesourcery.com>
3058 * parser.c (cp_parser_omp_clause_hint): Require nonnegative hint.
3059 (cp_parser_omp_critical): Permit hint(0) clause without named critical.
3060 * pt.c (tsubst_expr): Re-check the latter for templates.
3062 2020-07-21 Sunil K Pandey <skpgkp2@gmail.com>
3065 * decl.c (cp_finish_decl): Call target hook
3066 lower_local_decl_alignment to lower local decl alignment.
3068 2020-07-21 Nathan Sidwell <nathan@acm.org>
3070 * parser.c (cp_lexer_consume_token): Drop PRAGMA_EOL assert.
3071 (cp_parser_skip_to_closing_parenthesis_1): Only pass start token
3072 to pragma skipper if recovering.
3073 (cp_parser_skip_to_pragma_eol): Only purge and change pragma
3074 state when recovering.
3076 2020-07-20 Jason Merrill <jason@redhat.com>
3078 * pt.c (type_dependent_expression_p): A pseudo-dtor can be
3080 * semantics.c (finish_call_expr): Use build_trivial_dtor_call for
3082 (finish_pseudo_destructor_expr): Leave type NULL for dependent arg.
3084 2020-07-20 Jason Merrill <jason@redhat.com>
3086 * mangle.c (write_base_ref): New.
3087 (write_expression): Use it for base field COMPONENT_REFs.
3088 * pt.c (invalid_tparm_referent_p): Canonicalize the type
3089 of array offsets. Allow subobjects.
3091 2020-07-20 Jason Merrill <jason@redhat.com>
3093 * pt.c (collect_ctor_idx_types): Add 'const' when deducing from
3096 2020-07-17 Marek Polacek <polacek@redhat.com>
3099 * decl.c (grokdeclarator): Detect cv-qual decltype(auto).
3100 * pt.c (do_auto_deduction): Likewise.
3102 2020-07-16 Iain Sandoe <iain@sandoe.co.uk>
3109 * coroutines.cc (struct coro_ret_data): Delete.
3110 (coro_maybe_expand_co_return): Delete.
3111 (co_return_expander): Delete.
3112 (expand_co_returns): Delete.
3113 (co_await_find_in_subtree): Remove unused name.
3114 (build_actor_fn): Remove unused parm, remove handling
3115 for co_return expansion.
3116 (register_await_info): Demote duplicate info message to a
3118 (coro_make_frame_entry): Move closer to use site.
3119 (struct susp_frame_data): Add fields for final suspend label
3120 and a flag to indicate await expressions with initializers.
3121 (captures_temporary): Delete.
3122 (register_awaits): Remove unused code, update comments.
3123 (find_any_await): New.
3124 (tmp_target_expr_p): New.
3125 (struct interesting): New.
3126 (find_interesting_subtree): New.
3127 (struct var_nest_node): New.
3128 (flatten_await_stmt): New.
3129 (handle_nested_conditionals): New.
3130 (process_conditional): New.
3131 (replace_statement_captures): Rename to...
3132 (maybe_promote_temps): ... this.
3133 (maybe_promote_captured_temps): Delete.
3134 (analyze_expression_awaits): Check for await expressions with
3135 initializers. Simplify handling for truth-and/or-if.
3136 (expand_one_truth_if): Simplify (map cases that need expansion
3138 (await_statement_walker): Handle CO_RETURN_EXPR. Simplify the
3139 handling for truth-and/or-if expressions.
3140 (register_local_var_uses): Ensure that we create names in the
3141 implementation namespace.
3142 (morph_fn_to_coro): Add final suspend label to suspend frame
3143 callback data and remove it from the build_actor_fn call.
3145 2020-07-16 Marek Polacek <polacek@redhat.com>
3147 * call.c (convert_like): Remove macro and introduce a new
3149 (convert_like_with_context): Likewise.
3150 (convert_like_real): Rename to convert_like.
3151 (convert_like_real_1): Rename to convert_like_internal. Call
3152 convert_like instead of convert_like_real therein.
3153 (perform_direct_initialization_if_possible): Call convert_like
3154 instead of convert_like_real.
3156 2020-07-16 Iain Sandoe <iain@sandoe.co.uk>
3158 * coroutines.cc: Correct some spelling errors
3161 2020-07-15 Nathan Sidwell <nathan@acm.org>
3163 * parser.c (cp_parser_declaration): Avoid copying tokens.
3164 (cp_parser_block_declaration): RAII token pointer.
3166 2020-07-15 Nathan Sidwell <nathan@acm.org>
3168 * parser.c (cp_parser_skip_to_closing_parenthesis_1): Deal with
3169 meeting a deferred pragma.
3170 (cp_parser_skip_to_end_of_statement): Likewise.
3171 (cp_parser_skip_to_end_of_block_or_statement): Likewise.
3172 (cp_parser_skip_to_pragma_eol): We should never meet EOF.
3173 (cp_parser_omp_declare_simd): Likewise.
3174 (cp_parser_omp_declare_reduction, cp_parser_oacc_routine)
3175 (pragma_lex): Likewise.
3177 2020-07-14 Marek Polacek <polacek@redhat.com>
3182 * call.c (convert_like_real_1): Renamed from convert_like_real.
3183 (convert_like_real): New wrapper for convert_like_real_1.
3185 2020-07-14 Nathan Sidwell <nathan@acm.org>
3187 * parser.c (cp_lexer_alloc): Do not deal with PCH here.
3188 (cp_lexer_new_main): Deal with PCH here. Store the tokens directly
3190 (cp_lexer_new_from_tokens): Assert last token isn't purged either.
3191 (cp_lexer_get_preprocessor_token): Change first arg to flags, adjust.
3192 (cp_parser_new): Pass the lexer in, don't create it here.
3193 (cp_parser_translation_unit): Initialize access checks here.
3194 (cp_parser_initial_pragma): First token is provided by caller,
3195 don't deal with PCH stopping here. Adjust error message.
3196 (c_parse_file): Adjust, change error message to avoid C++20 module
3199 2020-07-14 Nathan Sidwell <nathan@acm.org>
3201 * ptree.c (cxx_print_type): Add TYPEOF_TYPE and BASES.
3203 2020-07-14 Nathan Sidwell <nathan@acm.org>
3205 * class.c (build_base_field_1): Cache CLASSTYPE_AS_BASE.
3206 (build_self_reference): Rename value -> decl.
3207 (dump_class_hierarchy_1): Cache CLASSTYPE_AS_BASE.
3209 2020-07-14 Marek Polacek <polacek@redhat.com>
3212 * decl.c (grokdeclarator) <case cdk_function>: Check also
3213 pointers/references/... to functions.
3215 2020-07-14 Nathan Sidwell <nathan@acm.org>
3217 * cp-tree.h: Correct some tree lang flag comments,
3218 reformat some structure definitions. Note some structure
3219 sizes. Clarify some comments.
3220 (yyungetc): Delete. Not been a thing for some time.
3221 * class.c (copy_fndecl_with_name): Comment.
3222 (check_bases_and_members): Unnecessary {}.
3223 (layout_class_type): Comment.
3224 * cp-tree.def (UNBOUND_CLASS_TEMPLATE): Adjust comment.
3225 * decl.c: Fix some formatting & whitespace issues.
3226 (function_requirements_equivalent_p): Note why
3227 substitutions are needed.
3228 * decl2.c (no_linkage_error): Note that heroics about
3229 'typedef struct { ... };' are no longer needed.
3230 * method.c: Whitespace.
3231 * name-lookup.c: Whitespace.
3232 (add_decl_to_level): Reformat a line.
3233 (print_binding_stack): Mark as DEBUG_FUNCTION.
3234 (has_using_namespace_std_directive_p): Delete comment.
3236 * ptree.c: Whitespace.
3237 * rtti.c: Whitespace & comment.
3239 * typeck.c (structural_comptypes): Add comment.
3241 2020-07-13 Nathan Sidwell <nathan@acm.org>
3243 * Make-lang.in (c++.disclean): Likewise.
3245 2020-07-13 Marek Polacek <polacek@redhat.com>
3248 * parser.c (cp_parser_enum_specifier): Commit to tentative parse
3249 after we've seen an opening brace.
3251 2020-07-10 Jason Merrill <jason@redhat.com>
3253 * tree.c (structural_type_p): Allow unions.
3254 * mangle.c (write_expression): Express unions with a designator.
3256 2020-07-10 Jason Merrill <jason@redhat.com>
3258 * pt.c (convert_nontype_argument): Handle REAL_TYPE.
3259 (invalid_nontype_parm_type_p): Allow all structural types.
3260 * tree.c (structural_type_p): Use SCALAR_TYPE_P.
3262 2020-07-10 Jason Merrill <jason@redhat.com>
3267 * class.c (check_field_decls): An array of empty classes is not an
3269 (layout_empty_base_or_field): Handle explicit alignment.
3272 2020-07-09 Julian Brown <julian@codesourcery.com>
3273 Thomas Schwinge <thomas@codesourcery.com>
3276 * semantics.c (finish_omp_clauses): Likewise.
3278 2020-07-09 Patrick Palka <ppalka@redhat.com>
3281 * constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
3282 Restore dependent_type_p check that guarded the call to
3283 is_really_empty_class.
3285 2020-07-08 Patrick Palka <ppalka@redhat.com>
3288 * constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
3289 When processing_template_decl, check COMPLETE_TYPE_P before
3290 calling is_really_empty_class. Don't check dependent_type_p.
3292 2020-07-08 Marek Polacek <polacek@redhat.com>
3295 * parser.c (cp_parser_decltype): Print error about using decltype(auto)
3296 in C++11. Check that the token following "auto" is ")".
3298 2020-07-07 Patrick Palka <ppalka@redhat.com>
3301 * cxx-pretty-print.c (pp_cxx_unqualified_id): Check
3302 PRIMARY_TEMPLATE_P before printing the innermost template
3305 2020-07-07 Martin Sebor <msebor@redhat.com>
3308 * parser.c (class_decl_loc_t::diag_mismatched_tags): Print notes only
3309 if warning_at returns nonzero.
3311 2020-07-06 Martin Sebor <msebor@redhat.com>
3314 * call.c (build_over_call): Check calls only when tf_warning is set.
3316 2020-07-06 Nathan Sidwell <nathan@acm.org>
3318 * decl.c (push_library_fn): Return the decl pushdecl_toplevel returns.
3319 * except.c (verify_library_fn): Replace with ...
3320 (declare_library_fn_1): ... this fn. Always push the fn.
3321 (declare_library_fn): Call it.
3322 (build_throw): Call declare_library_fn_1.
3324 2020-07-06 Jonathan Wakely <jwakely@redhat.com>
3327 * parser.c (cp_parser_toplevel_declaration): Only do pedwarn for
3328 empty-declaration in C++98.
3330 2020-07-02 Jason Merrill <jason@redhat.com>
3331 Jakub Jelinek <jakub@redhat.com>
3333 * decl.c (grokfndecl): Allow consteval virtual.
3334 * search.c (check_final_overrider): Check consteval mismatch.
3335 * constexpr.c (cxx_eval_thunk_call): New.
3336 (cxx_eval_call_expression): Call it.
3337 * cvt.c (cp_get_fndecl_from_callee): Handle FDESC_EXPR.
3338 * decl2.c (mark_vtable_entries): Track vtables with consteval.
3339 (maybe_emit_vtables): Pass consteval_vtables through.
3340 (clear_consteval_vfns): Replace consteval with nullptr.
3341 (c_parse_final_cleanups): Call it.
3343 2020-07-01 Nathan Sidwell <nathan@acm.org>
3345 * class.c (copy_fndecl_with_name): Add additional predicate args, do
3346 not deduce them locally.
3347 (copy_operator_fn): Adjust copy_fndecl_with_name call.
3348 (build_clone): Add vtt and inherited predicate args. Pass through
3349 to copy_fndecl_with_name call.
3350 (build_cdtor_clones): Likewise, pass through to build_clone as
3352 (build_cdtor): Determine vtt and inherited here.
3353 * cp-tree.h (DECL_NEEDS_CTT_PARM_P): Delete.
3355 2020-06-30 Nathan Sidwell <nathan@acm.org>
3357 * cp-tree.h (copy_fndecl_with_name): Rename to ...
3358 (copy_operatorn_fn): ... this. Change arg type.
3359 (clone_function_decl): Rename to ...
3360 (clone_cdtor): ... this.
3361 * class.c (copy_fndecl_with_name): Make static.
3362 (copy_operator_fn): New wrapper.
3363 (build_clones): Rename to ...
3364 (build_cdtor_clones): ... this.
3365 (clone_function_decl): Rename to ...
3366 (clone_cdtor): ... this. Adjust build_clones calls.
3367 (clone_constructors_and_destructors): Adjust clone_function_decl
3369 * method.c (implicitly_declare_fn): Adjust copy_fndecl_with_name
3371 (lazily_declare_fn): Adjust clone_function_decl call.
3372 * pt.c (tsubst_function_decl): Likewise.
3373 (instantiate_template_1): Likewise.
3375 2020-06-30 Iain Sandoe <iain@sandoe.co.uk>
3377 * coroutines.cc (morph_fn_to_coro): Remove trailing
3378 space in a diagnostic.
3380 2020-06-30 Iain Sandoe <iain@sandoe.co.uk>
3382 * coroutines.cc (expand_one_await_expression): Remove
3383 code dealing with initial suspend.
3384 (build_actor_fn): Remove code special-casing initial
3385 and final suspend. Handle the final suspend and marking
3386 of the coroutine as done.
3387 (coro_rewrite_function_body): New.
3388 (bind_expr_find_in_subtree): Remove.
3389 (coro_body_contains_bind_expr_p): Remove.
3390 (morph_fn_to_coro): Split the rewrite of the original
3391 function into coro_rewrite_function_body and call it.
3393 2020-06-29 Marek Polacek <polacek@redhat.com>
3396 * decl.c (duplicate_decls): Make sure a concept or a variable
3397 template is unique in its declarative region.
3399 2020-06-29 Marek Polacek <polacek@redhat.com>
3402 * pt.c (collect_ctor_idx_types): Use TREE_TYPE.
3404 2020-06-28 Iain Sandoe <iain@sandoe.co.uk>
3407 * coroutines.cc (register_local_var_uses): Skip past
3410 2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
3413 * coroutines.cc (get_awaitable_var): New helper.
3414 (build_co_await): Check more carefully before
3415 copying an awaitable.
3416 (expand_one_await_expression): No initializer
3417 is required when the awaitable is not a temp.
3418 (register_awaits): Remove handling that is now
3419 completed when the await expression is built.
3421 2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
3423 * coroutines.cc (morph_fn_to_coro): Diagnose unavailable
3424 get_return_object_on_allocation_failure.
3426 2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
3429 * coroutines.cc (struct coroutine_info):Add a field
3430 to hold computed p.return_void expressions.
3431 (coro_build_promise_expression): New.
3432 (get_coroutine_return_void_expr): New.
3433 (finish_co_yield_expr): Build the promise expression
3434 using coro_build_promise_expression.
3435 (finish_co_return_stmt): Likewise.
3436 (build_init_or_final_await): Likewise.
3437 (morph_fn_to_coro): Likewise, for several cases.
3439 2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
3441 * coroutines.cc (morph_fn_to_coro): Handle error
3442 returns in building g-r-o-o-a-f expressions.
3444 2020-06-24 Nicholas Krause <xerofoify@gmail.com>
3447 * typeck2.c (cxx_incomplete_type_diagnostic): Add missing
3448 TYPE_EXPANSION_PACK check for diagnosing incomplete types in
3449 cxx_incomplete_type_diagnostic.
3451 2020-06-24 Iain Sandoe <iain@sandoe.co.uk>
3455 * coroutines.cc (act_des_fn): Copy function
3456 attributes onto the outlined coroutine helpers.
3458 2020-06-24 Jason Merrill <jason@redhat.com>
3460 * call.c (build_over_call): Only call build_base_path once.
3462 2020-06-24 Jason Merrill <jason@redhat.com>
3465 * call.c (build_over_call): Look up the overrider in base_binfo.
3466 * class.c (lookup_vfn_in_binfo): Look through BINFO_PRIMARY_P.
3468 2020-06-23 Jason Merrill <jason@redhat.com>
3471 Implement C++20 P2082R1, Fixing CTAD for aggregates.
3472 * cp-tree.h (TPARMS_PRIMARY_TEMPLATE): Split out from...
3473 (DECL_PRIMARY_TEMPLATE): ...here.
3474 (builtin_guide_p): Declare.
3475 * decl.c (reshape_init_class): Handle bases of a template.
3476 (reshape_init_r): An array with dependent bound takes a single
3478 * pt.c (tsubst_default_argument): Shortcut {}.
3479 (unify_pack_expansion): Allow omitted arguments to trailing pack.
3480 (builtin_guide_p): New.
3481 (collect_ctor_idx_types): Give a trailing pack a {} default
3482 argument. Handle arrays better.
3484 2020-06-23 Iain Sandoe <iain@sandoe.co.uk>
3487 * coroutines.cc (morph_fn_to_coro): Apply a cleanup to
3488 the get return object when the DTOR is non-trivial.
3490 2020-06-20 Iain Sandoe <iain@sandoe.co.uk>
3493 * coroutines.cc (morph_fn_to_coro): Update handling of
3494 get-return-object-on-allocation-fail and diagnose missing
3497 2020-06-20 Jason Merrill <jason@redhat.com>
3499 * call.c (joust): Only compare constraints for non-template
3500 candidates with matching parameters.
3501 * pt.c (tsubst_pack_expansion): Fix getting a type parameter
3503 (more_specialized_fn): Only compare constraints for candidates with
3504 matching parameters.
3506 2020-06-19 Jason Merrill <jason@redhat.com>
3508 * method.c (early_check_defaulted_comparison): Allow defaulting
3509 comparison outside class. Complain if non-member operator isn't a
3512 2020-06-18 Jason Merrill <jason@redhat.com>
3514 * method.c (early_check_defaulted_comparison): Check for &&.
3515 (build_comparison_op): Allow empty union. Diagnose non-category
3517 (common_comparison_type): Remove handling for non-category type.
3519 2020-06-18 Marek Polacek <polacek@redhat.com>
3522 * pt.c (finish_template_variable): Return if
3523 coerce_innermost_template_parms return error_mark_node.
3525 2020-06-18 Marek Polacek <polacek@redhat.com>
3528 * pt.c (tsubst_copy_and_build) <case NEW_EXPR>: Return error_mark_node
3529 if placement is erroneous.
3531 2020-06-17 Jonathan Wakely <jwakely@redhat.com>
3534 * parser.c (cp_parser_elaborated_type_specifier): Do not warn
3535 unless in a declaration.
3537 2020-06-17 Jason Merrill <jason@redhat.com>
3539 * cp-tree.h (copy_fndecl_with_name): Declare.
3540 * class.c (copy_fndecl_with_name): Split out from...
3541 (build_clone): ...here.
3542 (add_implicitly_declared_members): Add op== to TYPE_FIELDS.
3543 * method.c (implicitly_declare_fn): Use copy_fndecl_with_name.
3545 2020-06-17 Jason Merrill <jason@redhat.com>
3547 * call.c (build_new_op_1): Don't look for a CALL_EXPR when
3548 calling a consteval function.
3550 2020-06-17 Jason Merrill <jason@redhat.com>
3552 * decl2.c (grokfield): Pass SD_DEFAULTED and SD_DELETED.
3553 * decl.c (duplicate_decls): Reduce error for delete
3554 after earlier declaration to pedwarn.
3556 2020-06-17 Marek Polacek <polacek@redhat.com>
3559 * constexpr.c (maybe_fold_non_dependent_expr): New.
3560 * cp-tree.h (maybe_fold_non_dependent_expr): Declare.
3561 * typeck.c (cp_build_array_ref): Call maybe_fold_non_dependent_expr
3562 instead of maybe_constant_value.
3564 2020-06-16 Marek Polacek <polacek@redhat.com>
3567 * call.c (add_list_candidates): Return if a designated initializer
3568 is used with a non-aggregate.
3569 (implicit_conversion_error): Give an error for the case above.
3571 2020-06-16 Marek Polacek <polacek@redhat.com>
3574 * name-lookup.c (check_local_shadow): Check if types are
3575 non-null before calling same_type_p.
3577 2020-06-16 Jakub Jelinek <jakub@redhat.com>
3579 * semantics.c (handle_omp_for_class_iterator): Adjust
3580 c_omp_check_loop_iv_exprs caller.
3581 (finish_omp_for): Likewise. Don't call fold_build_cleanup_point_expr
3582 before calling c_finish_omp_for and c_omp_check_loop_iv, move it
3584 * pt.c (tsubst_omp_for_iterator): Handle non-rectangular loops.
3586 2020-06-16 Jakub Jelinek <jakub@redhat.com>
3588 * parser.c (cp_parser_omp_clause_schedule): Reject modifier separated
3589 from kind by comma rather than colon.
3591 2020-06-16 Patrick Palka <ppalka@redhat.com>
3593 * pt.c (perform_instantiation_time_access_checks): No need to
3595 * semantics.c (enforce_access): Verify that decl is not
3598 2020-06-16 Patrick Palka <ppalka@redhat.com>
3602 * cp-tree.h (qualified_typedef_usage_s): Delete.
3603 (qualified_typedef_usage_t): Delete.
3604 (deferred_access_check): Move up in file.
3605 (tree_template_info::typedefs_needing_access_checking): Delete.
3606 (tree_template_info::deferred_access_checks): New field.
3607 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): Rename to ...
3608 (TI_DEFERRED_ACCESS_CHECKS): ... this, and adjust accordingly.
3609 * pt.c (perform_typedefs_access_check): Rename to ...
3610 (perform_instantiation_time_access_checks): ... this, and adjust
3611 accordingly. Remove unnecessary tree tests.
3612 (instantiate_class_template_1): Adjust accordingly.
3613 (instantiate_decl): Likewise.
3614 * semantics.c (enforce_access): Likewise.
3616 2020-06-16 Patrick Palka <ppalka@redhat.com>
3620 * call.c (enforce_access): Move to semantics.c.
3621 * cp-tree.h (enforce_access): Delete.
3622 (get_types_needing_access_check): Delete.
3623 (add_typedef_to_current_template_for_access_check): Delete.
3624 * decl.c (make_typename_type): Adjust accordingly. Use
3625 check_accessibility_of_qualified_id instead of directly using
3626 perform_or_defer_access_check.
3627 * parser.c (cp_parser_template_declaration_after_parameters):
3628 Don't push a dk_no_check access state when parsing a template.
3629 * pt.c (get_types_needing_access_check): Delete.
3630 (append_type_to_template_for_access_check_1): Delete.
3631 (perform_typedefs_access_check): Adjust. If type_decl is a
3632 FIELD_DECL, also check its DECL_CONTEXT for dependence. Use
3633 tsubst_copy instead of tsubst to substitute into type_decl so
3634 that we substitute into the DECL_CONTEXT of a FIELD_DECL.
3635 (append_type_to_template_for_access_check): Delete.
3636 * search.c (accessible_p): Remove the processing_template_decl
3638 * semantics.c (enforce_access): Moved from call.c. If we're
3639 parsing a template and the access check failed, add the check to
3640 TI_TYPEDEFS_NEEDING_ACCESS_CHECKING.
3641 (perform_or_defer_access_check): Adjust comment.
3642 (add_typedef_to_current_template_for_access_check): Delete.
3643 (check_accessibility_of_qualified_id): Adjust accordingly.
3644 Exit early if the scope is dependent.
3646 2020-06-11 Patrick Palka <ppalka@redhat.com>
3649 * constraint.cc (associate_classtype_constraints): If there is a
3650 discrepancy between the current template depth and the template
3651 depth of the original declaration, then adjust the template
3652 parameter depth within the current constraints appropriately.
3653 * pt.c (tsubst_friend_class): Substitute into and set the
3654 constraints on the injected declaration.
3656 2020-06-11 Iain Sandoe <iain@sandoe.co.uk>
3658 * coroutines.cc (instantiate_coro_traits): Pass a reference
3659 to lambda closure objects to traits instantiation.
3660 (morph_fn_to_coro): Likewise for promise parameter
3661 preview and allocator lookup.
3663 2020-06-10 Iain Sandoe <iain@sandoe.co.uk>
3666 * call.c (add_candidates): Use vec_safe_length() for
3667 testing the arguments list.
3668 (build_new_method_call_1): Use vec_safe_is_empty() when
3669 checking for an empty args list.
3671 2020-06-10 Marek Polacek <polacek@redhat.com>
3674 * parser.c (cp_parser_direct_declarator): Clear
3675 CP_PARSER_FLAGS_DELAY_NOEXCEPT if the declarator kind is not
3678 2020-06-09 Iain Sandoe <iain@sandoe.co.uk>
3681 * coroutines.cc (expand_one_await_expression): Build separate
3682 DTOR trees for the awaitable object on the destroy and resume
3685 2020-06-09 Jason Merrill <jason@redhat.com>
3688 * cp-gimplify.c (predeclare_vla): Only predeclare a VLA if it's
3689 wrapped in a pointer type.
3691 2020-06-05 Marek Polacek <polacek@redhat.com>
3694 * call.c (build_converted_constant_expr_internal): Allow
3695 list-initialization.
3697 2020-06-05 Iain Sandoe <iain@sandoe.co.uk>
3699 * cp-tree.def (CO_RETURN_EXPR): Correct the class
3700 to use tcc_statement.
3702 2020-06-05 Jason Merrill <jason@redhat.com>
3704 * error.c (dump_binary_op): Handle negative operand to
3707 2020-06-04 Jason Merrill <jason@redhat.com>
3710 * constexpr.c (cxx_eval_constant_expression) [OBJ_TYPE_REF]:
3711 Evaluate OBJ_TYPE_REF_EXPR.
3713 2020-06-04 Jason Merrill <jason@redhat.com>
3716 * class.c (lookup_vfn_in_binfo): New.
3717 * call.c (build_over_call): Use it.
3718 * cp-tree.h (resolves_to_fixed_type_p): Add default argument.
3719 (lookup_vfn_in_binfo): Declare.
3721 2020-06-04 Iain Sandoe <iain@sandoe.co.uk>
3724 * coroutines.cc (morph_fn_to_coro): Ensure that the get-
3725 return-object is constructed correctly; When it is not the
3726 final return value, pass it to the CTOR of the return type
3727 as an rvalue, per the standard comment.
3729 2020-06-04 Jakub Jelinek <jakub@redhat.com>
3733 * constexpr.c (cxx_eval_constant_expression): Diagnose CONVERT_EXPR
3734 conversions from pointer types to arithmetic types here...
3735 (cxx_eval_outermost_constant_expr): ... instead of here.
3737 2020-06-03 Mark Wielaard <mark@klomp.org>
3739 * parser.c (cp_lexer_safe_previous_token): New function.
3740 (cp_parser_error_1): Add name_hint if the previous token is
3741 a string literal and next token is a CPP_NAME and we have a
3742 missing header suggestion for the name.
3744 2020-06-03 Patrick Palka <ppalka@redhat.com>
3746 * pt.c (process_partial_specialization): Pass the full set of
3747 generic template arguments to strictly_subsumes.
3749 2020-06-03 Patrick Palka <ppalka@redhat.com>
3752 * pt.c (most_specialized_partial_spec): Reorganize the loop over
3753 DECL_TEMPLATE_SPECIALIZATIONS. Check constraints_satisfied_p on
3754 the original template declaration, not on the tsubsted one.
3756 2020-06-03 Iain Sandoe <iain@sandoe.co.uk>
3759 * coroutines.cc (finish_co_await_expr): Revise to allow for
3761 (finish_co_yield_expr): Likewise.
3763 2020-06-03 Jason Merrill <jason@redhat.com>
3766 * cp-tree.h (predeclare_vla): Declare.
3767 * cp-gimplify.c (predeclare_vla): Handle getting a decl.
3768 * pt.c (tsubst_expr) [DECL_EXPR]: Use it.
3770 2020-06-03 Tobias Burnus <tobias@codesourcery.com>
3772 * cp-gimplify.c (cxx_omp_predetermined_mapping): New.
3773 * cp-objcp-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redfine.
3774 * cp-tree.h (cxx_omp_predetermined_mapping): Declare.
3776 2020-06-02 Jason Merrill <jason@redhat.com>
3779 * pt.c (tsubst_decl): Relax assert.
3781 2020-06-02 Iain Sandoe <iain@sandoe.co.uk>
3784 * coroutines.cc (build_co_await): Wrap the co_await expression
3785 in a TARGET_EXPR, where needed.
3786 (finish_co_yield_expr): Likewise.
3788 2020-06-02 Patrick Palka <ppalka@redhat.com>
3792 * pt.c (tsubst_function_decl): Don't do set_constraints when
3793 regenerating a lambda.
3794 (tsubst_lambda_expr): Substitute into the lambda's constraints
3795 and do set_constraints here.
3797 2020-06-01 Jason Merrill <jason@redhat.com>
3802 * class.c (build_vfn_ref): Revert 95311 change.
3803 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): Build a
3806 2020-06-01 Iain Sandoe <iain@sandoe.co.uk>
3809 * coroutines.cc (struct param_info): Remove rv_ref field.
3810 (build_actor_fn): Remove specifial rvalue ref handling.
3811 (morph_fn_to_coro): Likewise.
3813 2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
3816 * coroutines.cc (morph_fn_to_coro): If we see an
3817 early fatal error, drop the erroneous function body.
3819 2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
3821 * coroutines.cc (build_co_await): Remove unused
3823 (finish_co_await_expr): Likewise.
3824 (finish_co_yield_expr): Likewise; revise comment.
3826 2020-05-30 Iain Sandoe <iain@sandoe.co.uk>
3828 * coroutines.cc (morph_fn_to_coro): Revise initialization
3829 of the frame pointer to avoid an unused value.
3831 2020-05-30 Patrick Palka <ppalka@redhat.com>
3834 * constraint.cc (satisfaction_value): Accept INTEGER_CST of any
3837 2020-05-29 Patrick Palka <ppalka@redhat.com>
3838 Jason Merrill <jason@redhat.com>
3841 * class.c (add_method): Let special member function templates
3842 coexist if they are not equivalently constrained, or in a class
3845 2020-05-29 Jason Merrill <jason@redhat.com>
3848 * pt.c (process_template_parm): Set DECL_TEMPLATE_INFO
3849 on the DECL_TEMPLATE_RESULT.
3851 2020-05-29 Marek Polacek <polacek@redhat.com>
3854 * cp-gimplify.c (cp_fold) <case MODIFY_EXPR>: Don't set
3855 TREE_THIS_VOLATILE here.
3856 (cp_fold): Set it here along with TREE_NO_WARNING.
3858 2020-05-29 Jason Merrill <jason@redhat.com>
3862 * class.c (build_vfn_ref): Don't fold the INDIRECT_REF.
3864 2020-05-29 Patrick Palka <ppalka@redhat.com>
3869 * parser.c (cp_parser_requires_clause_expression): Temporarily
3870 increment processing_template_decl only if it is 0.
3871 (cp_parser_constraint_expression): Likewise.
3872 (cp_parser_requires_expression): Likewise.
3874 2020-05-29 Patrick Palka <ppalka@redhat.com>
3877 * constexpr.c (get_or_insert_ctor_field): Add limited support
3878 for RANGE_EXPR index lookups.
3880 2020-05-28 Jakub Jelinek <jakub@redhat.com>
3883 * decl.c (cp_finish_decomp): Call complete_type before checking
3886 2020-05-28 Jason Merrill <jason@redhat.com>
3889 * decl.c (cp_finish_decl): Revert r9-297 change.
3890 (check_static_variable_definition): Likewise.
3891 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
3892 * pt.c (instantiate_decl): Return early on type error.
3894 2020-05-27 Jason Merrill <jason@redhat.com>
3897 * decl.c (reshape_init_array_1): Don't reuse in overload context.
3899 2020-05-27 Jason Merrill <jason@redhat.com>
3902 * call.c (build_new_op_1): Suppress
3903 warn_zero_as_null_pointer_constant across comparison of <=> result
3906 2020-05-27 Jason Merrill <jason@redhat.com>
3909 * decl.c (grokdeclarator): Don't shift attributes in TYPENAME
3912 2020-05-27 Nathan Sidwell <nathan@acm.org>
3915 * pt.c (lookup_template_class_1): Restore alias template mutation.
3917 2020-05-26 Jakub Jelinek <jakub@redhat.com>
3920 * cp-gimplify.c: Include omp-general.h.
3921 (cp_genericize_r) <case OMP_DISTRIBUTE>: For class iteration
3922 variables in composite distribute parallel for, instantiate copy
3923 ctor of their types.
3925 2020-05-23 Patrick Palka <ppalka@redhat.com>
3928 * constexpr.c (cxx_eval_constant_expression)
3929 <case TEMPLATE_ID_EXPR>: Don't evaluate the concept when
3930 constexpr evaluation is uid-sensitive.
3932 2020-05-22 Jason Merrill <jason@redhat.com>
3934 * cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Don't preevaluate
3935 the function address if the call used operator syntax.
3937 2020-05-21 Jason Merrill <jason@redhat.com>
3940 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): For a virtual
3941 call, instrument the OBJ_TYPE_REF.
3943 * decl.c (compute_array_index_type_loc): Diagnose expressions
3944 in a template that can't be constant.
3945 * parser.c (cp_parser_direct_declarator): Don't check
3946 non-constant array bounds here.
3948 * cp-tree.h (is_rvalue_constant_expression): Declare.
3949 * constexpr.c (is_rvalue_constant_expression): New.
3950 * parser.c (cp_parser_constant_expression): Use it.
3951 * decl.c (cp_finish_decl): Try to treat a constexpr initializer in a
3952 template as constant.
3954 * typeck.c (build_x_modify_expr): Handle error_mark_node arguments.
3956 * decl.c (grokparms): Return NULL_TREE if any parms were erroneous.
3958 2020-05-21 Iain Sandoe <iain@sandoe.co.uk>
3960 * coroutines.cc (finish_co_return_stmt): Revert change to use
3963 2020-05-21 Patrick Palka <ppalka@redhat.com>
3966 * constexpr.c (constexpr_ctx::uid_sensitive): Remove field.
3967 (uid_sensitive_constexpr_evaluation_value): Define.
3968 (uid_sensitive_constexpr_evaluation_true_counter): Define.
3969 (uid_sensitive_constexpr_evaluation_p): Define.
3970 (uid_sensitive_constexpr_evaluation_sentinel): Define its
3972 (uid_sensitive_constexpr_evaluation_checker): Define its
3973 constructor and its evaluation_restricted_p method.
3974 (get_fundef_copy): Remove 'ctx' parameter. Use u_s_c_e_p
3975 instead of constexpr_ctx::uid_sensitive.
3976 (cxx_eval_call_expression): Use u_s_c_e_p instead, and test it
3977 last. Adjust call to get_fundef_copy.
3978 (instantiate_cx_fn_r): Test u_s_c_e_p so that we increment the
3979 counter if necessary.
3980 (cxx_eval_outermost_constant_expr): Remove 'uid_sensitive'
3981 parameter. Adjust function body accordingly.
3982 (maybe_constant_value): Remove 'uid_sensitive' parameter and
3983 adjust function body accordingly. Set up a
3984 uid_sensitive_constexpr_evaluation_checker, and use it to
3985 conditionally update the cv_cache.
3986 * cp-gimplify.c (cp_fold): Set up a
3987 uid_sensitive_constexpr_evaluation_checker, and use it to
3988 conditionally update the fold_cache.
3989 * cp-tree.h (maybe_constant_value): Update declaration.
3990 (struct uid_sensitive_constexpr_evaluation_sentinel): Define.
3991 (struct sensitive_constexpr_evaluation_checker): Define.
3992 * expr.c (fold_for_warn): Set up a
3993 uid_sensitive_constexpr_evaluation_sentinel before calling
3994 the folding subroutines. Drop all but the first argument to
3995 maybe_constant_value.
3997 2020-05-20 Marek Polacek <polacek@redhat.com>
4000 * parser.c (cp_parser_unqualified_id): Reject simple-template-id as
4001 the declarator-id of a destructor.
4002 (cp_parser_constructor_declarator_p): Reject simple-template-id as
4003 the declarator-id of a constructor.
4005 2020-05-20 Marek Polacek <polacek@redhat.com>
4009 * cp-tree.h (SD_DECOMPOSITION): New flag.
4010 * decl.c (duplicate_decls): Make sure a structured binding is unique
4011 in its declarative region.
4012 (start_decl): If INITIALIZED is SD_DECOMPOSITION, call
4013 fit_decomposition_lang_decl.
4014 (grokdeclarator): Compare INITIALIZED directly to SD_* flags.
4015 * parser.c (cp_parser_decomposition_declaration): Pass SD_DECOMPOSITION
4018 2020-05-20 Patrick Palka <ppalka@redhat.com>
4021 * typeck.c (structural_comptypes): Don't perform
4022 context-dependent resolution of TYPENAME_TYPEs when
4023 comparing_specializations.
4025 2020-05-19 Nathan Sidwell <nathan@acm.org>
4027 * pt.c (lookup_template_class_1): Do not reinit template_info of an
4030 2020-05-18 Martin Sebor <msebor@redhat.com>
4033 * call.c ((maybe_warn_class_memaccess): Use is_byte_access_type.
4034 * cp-tree.h (is_dummy_object): Return bool.
4035 (is_byte_access_type): Declare new function.
4036 * tree.c (is_dummy_object): Return bool.
4037 (is_byte_access_type): Define new function.
4039 2020-05-19 Patrick Palka <ppalka@redhat.com>
4042 * pt.c (init_template_processing): Enable sanitization for
4043 decl_specializations and type_specializations.
4046 * pt.c (fn_type_unification): Pass 'fn' instead of NULL_TREE as
4047 the 'in_decl' parameter to coerce_template_parms.
4049 2020-05-18 Marek Polacek <polacek@redhat.com>
4052 * typeck.c (cp_build_binary_op): Use fold_for_warn instead of
4055 2020-05-18 Marek Polacek <polacek@redhat.com>
4058 * cvt.c (cp_get_fndecl_from_callee): Return NULL_TREE if the function
4059 type is not INDIRECT_TYPE_P.
4060 * decl.c (omp_declare_variant_finalize_one): Call
4061 cp_get_callee_fndecl_nofold instead of looking for the function decl
4064 2020-05-18 Marek Polacek <polacek@redhat.com>
4067 * parser.c (cp_parser_has_attribute_expression): Sorry on a
4068 type-dependent argument.
4070 2020-05-18 Marek Polacek <polacek@redhat.com>
4074 * call.c (add_builtin_candidate) <case EQ_EXPR>: Create candidate
4075 operator functions when type is std::nullptr_t for ==/!=.
4076 * typeck.c (composite_pointer_type_r): Add a bool * parameter. Use it
4077 to maybe add "const" to the pointer type.
4078 (composite_pointer_type): Update the call to composite_pointer_type_r.
4079 (cp_build_binary_op): Turn two warning_at into error_at. Print the
4082 2020-05-18 Jason Merrill <jason@redhat.com>
4084 * call.c (build_over_call): Remove unnecessary
4085 cp_stabilize_reference.
4087 2020-05-18 Marek Polacek <polacek@redhat.com>
4089 * call.c (add_builtin_candidate): Don't create a builtin overload
4090 candidate for ++ when type is bool in C++17.
4092 2020-05-18 Marek Polacek <polacek@redhat.com>
4094 * cfns.h: Regenerated.
4096 2020-05-17 Iain Sandoe <iain@sandoe.co.uk>
4098 * coroutines.cc (morph_fn_to_coro): Initialize the gro variable.
4100 2020-05-16 Iain Sandoe <iain@sandoe.co.uk>
4102 * coroutines.cc (finish_co_return_stmt): Implement rules
4103 from [class.copy.elision] /3.
4105 2020-05-16 Patrick Palka <ppalka@redhat.com>
4108 * semantics.c (finish_decltype_type): Call
4109 instantiate_non_dependent_expr_sfinae on the expression.
4111 2020-05-15 Patrick Palka <ppalka@redhat.com>
4115 2020-04-07 Patrick Palka <ppalka@redhat.com>
4118 * typeck2.c (process_init_constructor_array): Propagate
4119 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
4120 the array initializer.
4122 2020-05-15 Jason Merrill <jason@redhat.com>
4124 PR c++/93286 - ICE with __is_constructible and variadic template.
4125 * pt.c (tsubst_tree_list): New.
4126 (tsubst, tsubst_copy_and_build): Use it.
4127 * decl2.c (is_late_template_attribute): Handle error_mark_node args.
4129 2020-05-15 Nathan Sidwell <nathan@acm.org>
4131 * pt.c (template_args_equal): Fix thinkos in previous 'cleanup'.
4133 2020-05-14 Jason Merrill <jason@redhat.com>
4136 * pt.c (maybe_instantiate_noexcept): Change clone handling.
4138 2020-05-14 Patrick Palka <ppalka@redhat.com>
4141 * call.c (build_op_call): Pass complain to lookup_fnfields.
4142 (build_special_member_call): Likewise.
4143 * class.c (type_requires_array_cookie): Pass tf_warning_or_error
4145 * cp-tree.h (lookup_fnfields): Add tsubst_flags_t parameter.
4146 * except.c (build_throw): Pass tf_warning_or_error to
4148 * init.c (build_new_1): Pass complain to lookup_fnfields.
4149 * method.c (locate_fn_flags): Likewise.
4150 * name-lookup.c (lookup_name_real_1): Pass tf_warning_or_error
4152 * pt.c (tsubst_baselink): Pass complain to lookup_fnfields.
4153 * search.c (lookup_fnfields): New 'complain' parameter. Pass it
4156 2020-05-14 Nathan Sidwell <nathan@acm.org>
4158 * parser.c (cp_parser_diagnose_invalid_typename): Mention
4159 std=c++20 not 2a, reformat dependent binfo inform loops.
4161 * pt.c (tsubst_template_decl): Reorder and commonize some control
4164 * pt.c (tsubst_friend_function): Simplify control flow.
4166 * pt.c (lookup_template_class_1): Remove unnecessary else by
4167 simply grabbing TYPE_NAME earlier.
4169 * pt.c (push_template_decl_real): Adjust friend pushing logic.
4170 Reinit template type.
4172 * pt.c (build_template_decl): Init DECL_TEMPLATE_RESULT &
4174 (process_partial_specialization): ... not here ...
4175 (push_template_decl_real, add_inherited_template_parms)
4176 (build_deduction_guide): ... or here.
4178 2020-05-14 Jakub Jelinek <jakub@redhat.com>
4180 * cp-gimplify.c (cp_genericize_r): Set cfun->has_omp_target.
4182 2020-05-13 Patrick Palka <ppalka@redhat.com>
4185 * init.c (build_vec_delete_1): Just return error_mark_node if
4186 deallocate_expr is error_mark_node.
4187 (build_delete): Just return error_mark_node if do_delete is
4190 2020-05-13 Patrick Palka <ppalka@redhat.com>
4193 * constraint.cc (tsubst_requires_expr): Produce a new
4194 requires-expression when processing_template_decl, even if
4195 template arguments are not dependent.
4197 2020-05-13 Marek Polacek <polacek@redhat.com>
4200 * decl.c (duplicate_decls): Set DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
4202 2020-05-13 Nathan Sidwell <nathan@acm.org>
4204 * pt.c (template_args_equal): Reorder category checking for
4207 * pt.c (perform_typedefs_access_check): Cache expensively
4208 calculated object references.
4209 (check_auto_in_tmpl_args): Just assert we do not get unexpected
4210 nodes, rather than silently do nothing.
4211 (append_type_to_template_for_access): Likewise, cache expensie
4214 * pt.c (canonical_type_parameter): Simplify.
4216 Formatting fixups & some simplifications.
4217 * pt.c (spec_hash_table): New typedef.
4218 (decl_specializations, type_specializations): Use it.
4219 (retrieve_specialization): Likewise.
4220 (register_specialization): Remove unnecessary casts.
4221 (push_template_decl_real): Reformat.
4222 (instantiate_class_template_1): Use more RAII.
4223 (make_argument_pack): Simplify.
4224 (instantiate_template_1): Use gcc_checking_assert for expensive
4226 (instantiate_decl): Likewise.
4227 (resolve_typename_type): Reformat comment.
4228 * semantics.c (struct deferred_access): Remove unnecessary GTY on
4230 (begin_class_definition): Fix formatting.
4232 2020-05-13 Jason Merrill <jason@redhat.com>
4234 * call.c, class.c, constexpr.c, constraint.cc, decl.c, init.c,
4235 lambda.c, lex.c, method.c, name-lookup.c, parser.c, pt.c, tree.c,
4236 typeck2.c: Change cxx2a to cxx20.
4238 2020-05-12 Marek Polacek <polacek@redhat.com>
4241 * parser.c (cp_parser_postfix_expression) <case CPP_OPEN_PAREN>: When
4242 looking for a block-scope function declaration, look through the whole
4243 set, not just the first function in the overload set.
4245 2020-05-12 Jakub Jelinek <jakub@redhat.com>
4248 * pt.c (tsubst_decl): Deal with DECL_OMP_PRIVATIZED_MEMBER for
4251 2020-05-11 Jason Merrill <jason@redhat.com>
4253 Resolve C++20 NB comment CA104
4254 * pt.c (determine_specialization): Compare constraints for
4255 specialization of member template of class instantiation.
4257 2020-05-11 Jason Merrill <jason@redhat.com>
4261 * tree.c (cp_walk_subtrees): Stop at typedefs.
4262 Handle TYPENAME_TYPE here.
4263 * pt.c (find_parameter_packs_r): Not here.
4264 (for_each_template_parm_r): Clear *walk_subtrees.
4265 * decl2.c (min_vis_r): Look through typedefs.
4267 2020-05-11 Jason Merrill <jason@redhat.com>
4269 * call.c (implicit_conversion_error): Split out from...
4270 (perform_implicit_conversion_flags): ...here.
4271 (build_converted_constant_expr_internal): Use it.
4273 2020-05-11 Jason Merrill <jason@redhat.com>
4276 * parser.c (inject_parm_decls): Set current_class_ptr here.
4277 (cp_parser_direct_declarator): And here.
4278 (cp_parser_late_return_type_opt): Not here.
4279 (cp_parser_noexcept_specification_opt): Nor here.
4280 (cp_parser_exception_specification_opt)
4281 (cp_parser_late_noexcept_specifier): Remove unneeded parameters.
4283 2020-05-11 Jason Merrill <jason@redhat.com>
4285 * decl.c (cxx_init_decl_processing): Call declare_weak for
4288 2020-05-11 Jason Merrill <jason@redhat.com>
4290 * pt.c (instantiate_class_template_1): Call tsubst_expr for
4291 STATIC_ASSERT member.
4292 * ptree.c (cxx_print_xnode): Handle STATIC_ASSERT.
4294 2020-05-11 Jason Merrill <jason@redhat.com>
4296 * pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Remove redundant
4297 walking of capture list.
4299 2020-05-11 Jason Merrill <jason@redhat.com>
4301 * cp-tree.h (LOOKUP_EXPLICIT_TMPL_ARGS): Remove.
4302 * call.c (build_new_function_call): Don't set it.
4303 (build_new_method_call_1): Likewise.
4304 (build_over_call): Check cand->explicit_targs instead.
4306 2020-05-11 Jason Merrill <jason@redhat.com>
4308 * decl.c (compute_array_index_type_loc): Stabilize before building
4311 2020-05-11 Jason Merrill <jason@redhat.com>
4313 * decl.c (grokdeclarator): Adjust deprecated_state here.
4314 (start_decl): Not here.
4316 2020-05-08 Iain Sandoe <iain@sandoe.co.uk>
4319 * coroutines.cc (build_actor_fn): Ensure that bind scopes
4320 are marked as having side-effects where necessary.
4321 (replace_statement_captures): Likewise.
4322 (morph_fn_to_coro): Likewise.
4324 2020-05-08 Nathan Sidwell <nathan@acm.org>
4326 * NEWS: Delete, it is so stale.
4328 * parser.c (cp_lexer_set_source_position_from_token): EOF has a
4331 2020-05-07 Iain Sandoe <iain@sandoe.co.uk>
4335 * coroutines.cc (morph_fn_to_coro): Set unformed outline
4336 functions to error_mark_node. For early error returns suppress
4337 warnings about missing ramp return values. Fix reinstatement
4338 of the function body on pre-existing initial error.
4339 * decl.c (finish_function): Use the normal error path for fails
4340 in the ramp function, do not try to compile the helpers if the
4343 2020-05-07 Marek Polacek <polacek@redhat.com>
4345 PR c++/94590 - Detect long double -> double narrowing.
4346 * typeck2.c (check_narrowing): Detect long double -> double
4347 narrowing even when double and long double have the same
4348 precision. Make it handle conversions to float too.
4350 2020-05-07 Marek Polacek <polacek@redhat.com>
4353 * parser.c (cp_parser_class_specifier_1): Check that the scope is
4354 nested inside current scope before pushing it.
4356 2020-05-07 Marek Polacek <polacek@redhat.com>
4359 * typeck2.c (check_narrowing): Consider T* to bool narrowing
4362 2020-05-07 Marek Polacek <polacek@redhat.com>
4364 * decl.c (grok_op_properties): Fix spelling of non-static.
4365 * typeck.c (build_class_member_access_expr): Likewise.
4367 2020-05-07 Richard Biener <rguenther@suse.de>
4370 * optimize.c (update_cloned_parm): Copy DECL_NOT_GIMPLE_REG_P.
4372 2020-05-06 Marek Polacek <polacek@redhat.com>
4375 * pt.c (tsubst_copy_and_build): Call type_dependent_expression_p_push
4376 instead of uses_template_parms. Move the warning_sentinels after the
4379 2020-05-06 Jakub Jelinek <jakub@redhat.com>
4382 * typeck.c (cp_strict_aliasing_warning): New function.
4383 (cp_build_indirect_ref_1, build_reinterpret_cast_1): Use
4384 it instead of strict_aliasing_warning.
4387 * method.c (defaulted_late_check): Don't call synthesize_method
4388 on constexpr sfk_comparison if it has been called on it already.
4390 2020-05-06 Nathan Sidwell <nathan@acm.org>
4393 * decl.c (grokdeclarator): Don't splice template attributes in
4394 parm context -- they can apply to the parm.
4396 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
4398 * coroutines.cc: Remove references to n4849 throughout.
4400 2020-05-05 Jason Merrill <jason@redhat.com>
4403 * pt.c (more_specialized_fn): Do consider parms with no deducible
4404 template parameters.
4406 2020-05-05 Jason Merrill <jason@redhat.com>
4409 * constexpr.c (potential_constant_expression_1): In a lambda
4410 function, consider a captured variable directly.
4412 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
4414 * coroutines.cc (transform_await_wrapper): Check that we have
4415 no unlowered co_yields.
4416 (captures_temporary): Likewise.
4417 (register_awaits): Likewise.
4419 2020-05-05 Nathan Sidwell <nathan@acm.org>
4422 * coroutines.cc (morph_fn_to_coro): Just check for
4424 * pt.c (tsubst_function_decl): Update lambda fn's this_ptr name.
4426 2020-05-05 Marek Polacek <polacek@redhat.com>
4427 Jason Merrill <jason@redhat.com>
4430 * parser.c (cp_parser_postfix_dot_deref_expression): If we have
4431 a type-dependent object of class type, stash it to
4432 parser->context->object_type. If the postfix expression doesn't have
4434 (cp_parser_class_name): Consider object scope too.
4435 (cp_parser_lookup_name): Remove code dealing with the case when
4436 object_type is unknown_type_node.
4438 2020-05-04 Patrick Palka <ppalka@redhat.com>
4441 * cp-gimplify.c (cp_fold) <case CALL_EXPR>: Move some variable
4442 declarations closer to their uses. Copy the CALL_EXPR only
4443 when one of its arguments has changed.
4444 <case TREE_VEC>: Instead of first collecting the folded
4445 arguments into a releasing_vec, just make a copy of the TREE_VEC
4446 as soon as folding changes one of its arguments.
4448 2020-05-04 Iain Sandoe <iain@sandoe.co.uk>
4450 * coroutines.cc (morph_fn_to_coro): Mark the coro.gro variable
4451 as artificial and ignored.
4453 2020-05-04 Nathan Sidwell <nathan@acm.org>
4455 pt.c (process_template_parm): Don't walk the template list twice,
4456 remember the final node instead.
4457 (end_template_parm_list): Refactor. Comment on why we do a pop
4460 PR c++/94827 -- don't save parms in nested requirement
4461 * constraint.cc (tsubst_nested_requirement): TYPE directly holds
4462 notmalized requirement.
4463 (finish_nested_requirement): Don't stash current tpl parms into
4465 (diagnose_nested_requirement): TYPE directly holds notmalized
4468 2020-05-01 Patrick Palka <ppalka@redhat.com>
4471 * cp-tree.h (check_accessibility_of_qualified_id): Add
4472 tsubst_flags_t parameter and change return type to bool.
4473 * parser.c (cp_parser_lookup_name): Pass tf_warning_to_error to
4474 check_accessibility_of_qualified_id.
4475 * pt.c (tsubst_qualified_id): Return error_mark_node if
4476 check_accessibility_of_qualified_id returns false.
4477 * semantics.c (check_accessibility_of_qualified_id): Add
4478 complain parameter. Pass complain instead of
4479 tf_warning_or_error to perform_or_defer_access_check. Return
4480 true unless perform_or_defer_access_check returns false.
4482 2020-05-01 Marek Polacek <polacek@redhat.com>
4485 * typeck2.c (process_init_constructor_record): Return PICFLAG_ERRONEOUS
4486 if an initializer element was erroneous.
4488 2020-05-01 Jason Merrill <jason@redhat.com>
4491 * init.c (get_nsdmi): Don't push_to_top_level for a local class.
4493 2020-05-01 Jason Merrill <jason@redhat.com>
4496 * decl.c (cp_finish_decl): Also clear TREE_READONLY if
4497 -fmerge-all-constants.
4499 2020-05-01 Jason Merrill <jason@redhat.com>
4502 * pt.c (tsubst_decl): Make sure DECL_VALUE_EXPR continues to have
4503 the same type as the variable.
4505 2020-04-30 Jason Merrill <jason@redhat.com>
4506 Nathan Sidwell <nathan@acm.org>
4509 * constraint.cc (map_arguments): If ARGS is null, it's a
4510 self-mapping of parms.
4511 (finish_nested_requirement): Do not pass argified
4512 current_template_parms to normalization.
4513 (tsubst_nested_requirement): Don't assert no template parms.
4515 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
4518 * coroutines.cc (transform_local_var_uses): Defer walking
4519 the DECL_INITIALs of BIND_EXPR vars until all the frame
4520 allocations have been made.
4522 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
4525 * coroutines.cc (register_awaits): Update target
4526 expressions for awaitable and suspend handle
4529 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
4532 * coroutines.cc (build_co_await): Account for variables
4533 with DECL_VALUE_EXPRs.
4534 (captures_temporary): Likewise.
4535 (register_awaits): Likewise.
4537 2020-04-29 Patrick Palka <ppalka@redhat.com>
4540 * pt.c (find_template_parameter_info::parm_list): New field.
4541 (keep_template_parm): Use the new field to build up the
4542 parameter list here instead of ...
4543 (find_template_parameters): ... here. Return ftpi.parm_list.
4545 2020-04-29 Jakub Jelinek <jakub@redhat.com>
4548 * class.c (build_base_field): Set DECL_FIELD_ABI_IGNORED on C++17 empty
4549 base artificial FIELD_DECLs.
4550 (layout_class_type): Set DECL_FIELD_ABI_IGNORED on empty class
4551 field_poverlapping_p FIELD_DECLs.
4553 2020-04-29 Patrick Palka <ppalka@redhat.com>
4556 * constraint.cc (satisfy_declaration_constraints): Use saved_t
4557 instead of t as the key to decl_satisfied_cache.
4560 * error.c (print_requires_expression_info): Print the dependent
4561 form of the parameter list with its template parameter mapping,
4562 rather than printing the substituted form.
4564 2020-04-28 Jason Merrill <jason@redhat.com>
4567 * decl.c (use_eh_spec_block): Check nothrow type after
4569 * pt.c (maybe_instantiate_noexcept): Call synthesize_method for
4570 DECL_MAYBE_DELETED fns here.
4571 * decl2.c (mark_used): Not here.
4572 * method.c (get_defaulted_eh_spec): Reject DECL_MAYBE_DELETED here.
4574 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
4577 * coroutines.cc (instantiate_coro_traits): Pass a reference to
4578 object type rather than a pointer type for 'this', for method
4580 (struct param_info): Add a field to hold that the parm is a lambda
4582 (morph_fn_to_coro): Check for lambda closure pointers in the
4583 args. Use a reference to *this when building the args list for the
4584 promise allocator lookup.
4586 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
4589 * coroutines.cc (coro_promise_type_found_p): Do not
4590 exclude non-classes here (this needs to be handled in the
4592 (morph_fn_to_coro): Allow for the case where the coroutine
4595 2020-04-27 Iain Sandoe <iain@sandoe.co.uk>
4598 * coroutines.cc (struct local_var_info): Add fields for static
4599 variables and those with DECL_VALUE_EXPR redirection.
4600 (transform_local_var_uses): Skip past typedefs and static vars
4601 and then account for redirected variables.
4602 (register_local_var_uses): Likewise.
4604 2020-04-27 Jason Merrill <jason@redhat.com>
4608 * decl.c (grokdeclarator): Move dependent attribute to decl.
4609 * decl2.c (splice_template_attributes): No longer static.
4611 2020-04-27 Patrick Palka <ppalka@redhat.com>
4614 * constexpr.c (cxx_eval_call_expression): Don't set new_obj if we're
4615 evaluating the target constructor of a delegating constructor.
4616 (cxx_eval_store_expression): Don't set TREE_READONLY if the LHS of the
4617 INIT_EXPR is '*this'.
4619 2020-04-26 Marek Polacek <polacek@redhat.com>
4622 * call.c (struct conversion): Add copy_init_p.
4623 (standard_conversion): Set copy_init_p in ck_base and ck_rvalue
4624 if FLAGS demands LOOKUP_ONLYCONVERTING.
4625 (convert_like_real) <case ck_base>: If copy_init_p is set, or
4626 LOOKUP_ONLYCONVERTING into FLAGS.
4628 2020-04-26 Iain Sandoe <iain@sandoe.co.uk>
4631 * coroutines.cc (morph_fn_to_coro): Ensure that
4632 unnamed function params have a usable and distinct
4635 2020-04-24 Jason Merrill <jason@redhat.com>
4638 * decl.c (redeclaration_error_message): Reject defaulted comparison
4639 operator that has been previously declared.
4641 2020-04-25 Patrick Palka <ppalka@redhat.com>
4643 * parser.c (cp_parser_diagnose_invalid_type_name): Suggest enabling
4644 concepts if the invalid identifier is 'requires'.
4646 2020-04-25 Jakub Jelinek <jakub@redhat.com>
4649 * semantics.c (finish_call_expr): When looking if all overloads
4650 are noreturn, use STRIP_TEMPLATE to look through TEMPLATE_DECLs.
4652 2020-04-24 Martin Liska <mliska@suse.cz>
4654 * coroutines.cc: Fix compilation error for release checking
4655 where we miss declaration of ‘coro_body_contains_bind_expr_p’.
4657 2020-04-23 Patrick Palka <ppalka@redhat.com>
4659 * tree.c (zero_init_expr_p): Use uses_template_parms instead of
4663 * pt.c (template_class_depth): Walk into the DECL_FRIEND_CONTEXT of a
4664 friend declaration rather than into its CP_DECL_CONTEXT.
4666 2020-04-23 Iain Sandoe <iain@sandoe.co.uk>
4669 * coroutines.cc (await_statement_expander): Simplify cases.
4670 (struct susp_frame_data): Add fields for truth and/or if
4671 cases, rename one field.
4672 (analyze_expression_awaits): New.
4673 (expand_one_truth_if): New.
4674 (add_var_to_bind): New helper.
4675 (coro_build_add_if_not_cond_break): New helper.
4676 (await_statement_walker): Handle conditional expressions,
4677 handle expansion of truth-and/or-if cases.
4678 (bind_expr_find_in_subtree): New, checking-only.
4679 (coro_body_contains_bind_expr_p): New, checking-only.
4680 (morph_fn_to_coro): Ensure that we have a top level bind
4683 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
4685 PR translation/94698
4686 * class.c (check_field_decls): Change "define" to "declare" in
4687 -Weffc++ diagnostics.
4689 2020-04-22 Patrick Palka <ppalka@redhat.com>
4693 * constraint.cc (satisfy_declaration_constraints): If the inherited
4694 constructor points to an instantiation of a constructor template,
4695 remember and use its attached template arguments.
4697 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
4699 PR translation/94698
4700 * class.c (check_field_decls): Change "override" to "define" in
4701 -Weffc++ diagnostics.
4703 2020-04-22 Iain Sandoe <iain@sandoe.co.uk>
4706 * coroutines.cc (struct param_info): Add a field to note that
4707 the param is 'this'.
4708 (morph_fn_to_coro): Convert this to a reference before using it
4709 in the promise parameter preview.
4711 2020-04-22 Jason Merrill <jason@redhat.com>
4714 * pt.c (register_parameter_specializations): If the instantiation is
4715 still a parameter pack, don't wrap it in a NONTYPE_ARGUMENT_PACK.
4716 (tsubst_pack_expansion, tsubst_expr): Adjust.
4718 2020-04-22 Martin Sebor <msebor@redhat.com>
4719 Jason Merrill <jason@redhat.com>
4722 * decl.c (reshape_init_array_1): Avoid stripping redundant trailing
4723 zero initializers...
4724 * mangle.c (write_expression): ...and handle them here even for
4725 pointers to members by calling zero_init_expr_p.
4726 * cp-tree.h (zero_init_expr_p): Declare.
4727 * tree.c (zero_init_expr_p): Define.
4728 (type_initializer_zero_p): Remove.
4729 * pt.c (tparm_obj_values): New hash_map.
4730 (get_template_parm_object): Store to it.
4731 (tparm_object_argument): New.
4733 2020-04-22 Patrick Palka <ppalka@redhat.com>
4736 * constraint.cc (diagnose_valid_expression): Check convert_to_void here
4737 as well as in tsubst_valid_expression_requirement.
4739 2020-04-21 Patrick Palka <ppalka@redhat.com>
4742 * constraint.cc (satisfy_declaration_constraints): Don't strip the
4743 inherited constructor if it already has template information.
4746 * pt.c (any_template_parm_r) <case IDENTIFIER_NODE>: New case. If this
4747 is a conversion operator, visit its TREE_TYPE.
4749 2020-04-21 Nathan Sidwell <nathan@acm.org>
4751 * pt.c (tsubst_copy_and_build) [POINTER_PLUS_EXPR]: Check for
4754 2020-04-21 Iain Sandoe <iain@sandoe.co.uk>
4757 * coroutines.cc (morph_fn_to_coro): Simplify return
4760 2020-04-17 Marek Polacek <polacek@redhat.com>
4763 * constexpr.c (cxx_eval_outermost_constant_expr): Return when T is
4764 a BRACE_ENCLOSED_INITIALIZER_P.
4765 (is_nondependent_constant_expression): Don't check
4766 BRACE_ENCLOSED_INITIALIZER_P.
4767 (is_nondependent_static_init_expression): Likewise.
4769 2020-04-20 Patrick Palka <ppalka@redhat.com>
4772 * cp-tree.h (lss_policy::lss_nop): New enumerator.
4773 * pt.c (local_specialization_stack::local_specialization_stack): Handle
4775 (local_specialization_stack::~local_specialization_stack): Likewise.
4776 (tsubst_pack_expansion): Use a local_specialization_stack instead of
4777 manually saving and restoring local_specializations. Conditionally
4778 replace local_specializations sooner, before the handling of the
4779 unsubstituted_packs case.
4781 2020-04-20 Marek Polacek <polacek@redhat.com>
4783 PR c++/94505 - bogus -Wparentheses warning with fold-expression.
4784 * pt.c (fold_expression): Add warning_sentinel for -Wparentheses
4785 before calling build_x_binary_op.
4787 2020-04-20 Marek Polacek <polacek@redhat.com>
4789 * coroutines.cc (captures_temporary): Don't assign the result of
4790 STRIP_NOPS to the same variable.
4792 2020-04-20 Nathan Sidwell <nathan@acm.org>
4794 PR c++/94454 - tpl-tpl-parms are not canonicalizable types
4795 * pt.c (canonical_type_parameter): Assert not a tpl-tpl-parm.
4796 (process_template_parm): tpl-tpl-parms are structural.
4797 (rewrite_template_parm): Propagate structuralness.
4799 PR c++/94454 - Expr pack expansion equality
4800 * tree.c (cp_tree_equal) [TEMPLATE_ID_EXPR, default]: Refactor.
4801 [EXPR_PACK_EXPANSION]: Add.
4803 PR c++/94454 Template Argument Hashing
4804 * pt.c (iterative_hash_template_arg): Strip nodes as
4805 template_args_equal does.
4806 [ARGUMENT_PACK_SELECT, TREE_VEC, CONSTRUCTOR]: Refactor.
4807 [node_class:TEMPLATE_TEMPLATE_PARM]: Hash by level & index.
4808 [node_class:default]: Refactor.
4810 2020-04-18 Patrick Palka <ppalka@redhat.com>
4813 * tree.c (cp_tree_equal) <case PARM_DECL>: Ignore
4814 comparing_specializations if the parameters' contexts are identical.
4817 * pt.c (splice_late_return_type): Propagate cv-qualifiers and
4818 PLACEHOLDER_TYPE_CONSTRAINTS from the original auto node to the new one.
4820 2020-04-17 Patrick Palka <ppalka@redhat.com>
4823 * lambda.c (lambda_capture_field_type): Avoid doing auto deduction if
4824 the explicit initializer has parameter packs.
4827 * parser.c (cp_parser_check_template_parameters): Before issuing a hard
4828 error, first try simulating an error instead.
4830 2020-04-17 Jakub Jelinek <jakub@redhat.com>
4833 * call.c (build_conditional_expr_1): Remove redundant assignment to
4836 2020-04-16 Patrick Palka <ppalka@redhat.com>
4839 * cvt.c (ocp_convert): If the result of scalar_constant_value is
4840 erroneous, ignore it and use the original expression.
4842 2020-04-16 Jakub Jelinek <jakub@redhat.com>
4845 * parser.c (cp_parser_simple_declaration): Fix up a pasto in
4848 2020-04-15 Jakub Jelinek <jakub@redhat.com>
4851 * parser.c (cp_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
4852 requires directive when not at file or namespace scope.
4854 2020-04-14 Iain Sandoe <iain@sandoe.co.uk>
4857 * coroutines.cc (build_actor_fn): Check that the target can
4858 support the resume tailcall before mandating it.
4860 2020-04-14 Patrick Palka <ppalka@redhat.com>
4863 * cxx-pretty-print.c (cxx_pretty_printer:simple_type_specifier)
4864 <case DECLTYPE_TYPE>: Handle DECLTYPE_TYPE here instead of ...
4865 (pp_cxx_type_specifier_seq) <case DECLTYPE_TYPE>: ... here.
4866 (cxx_pretty_printer::direct_abstract_declarator) <case DECLTYPE_TYPE>:
4870 * constexpr.c (replace_result_decl_data): New struct.
4871 (replace_result_decl_data_r): New function.
4872 (replace_result_decl): New function.
4873 (cxx_eval_call_expression): Use it.
4874 * tree.c (build_aggr_init_expr): Set the location of the AGGR_INIT_EXPR
4875 to that of its initializer.
4877 2020-04-13 Marek Polacek <polacek@redhat.com>
4880 * name-lookup.c (check_local_shadow): Add an inform call.
4882 2020-04-13 Patrick Palka <ppalka@redhat.com>
4885 * error.c (dump_scope): Pass TFF_NO_FUNCTION_ARGUMENTS to
4886 dump_function_decl when printing a function template instantiation as a
4890 * constexpr.c (get_or_insert_ctor_field): Set default value of parameter
4892 (cxx_eval_bare_aggregate): Use get_or_insert_ctor_field instead of
4893 assuming the the next index belongs at the end of the new CONSTRUCTOR.
4894 (cxx_eval_store_expression): Revert PR c++/78572 fix.
4896 2020-04-13 Nathan Sidwell <nathan@acm.org>
4898 PR c++/94426 lambdas with internal linkage are different to no-linkage
4899 * decl2.c (determine_visibility): A lambda's visibility is
4900 affected by its extra scope.
4901 * pt.c (instantiate_decl): Determine var's visibility before
4902 instantiating its initializer.
4903 * tree.c (no_linkage_check): Revert code looking at visibility of
4904 lambda's extra scope.
4906 2020-04-10 Iain Sandoe <iain@sandoe.co.uk>
4909 * coroutines.cc (co_await_expander): Remove.
4910 (expand_one_await_expression): New.
4911 (process_one_statement): New.
4912 (await_statement_expander): New.
4913 (build_actor_fn): Revise to use per-statement expander.
4914 (struct susp_frame_data): Reorder and comment.
4915 (register_awaits): Factor code.
4916 (replace_statement_captures): New, factored from...
4917 (maybe_promote_captured_temps):.. here.
4918 (await_statement_walker): Revise to process per statement.
4919 (morph_fn_to_coro): Use revised susp_frame_data layout.
4921 2020-04-10 Marek Polacek <polacek@redhat.com>
4924 * method.c (constructible_expr): In C++20, try using parenthesized
4925 initialization of aggregates to determine the result of
4928 2020-04-10 Bin Cheng <bin.cheng@linux.alibaba.com>
4930 * coroutines.cc (co_await_expander): Simplify.
4932 2020-04-09 Jason Merrill <jason@redhat.com>
4935 * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]: Look at
4936 ctx->object and ctx->global->values first.
4938 2020-04-09 Marek Polacek <polacek@redhat.com>
4941 * call.c (initialize_reference): If the reference binding failed, maybe
4942 try initializing from { }.
4943 * decl.c (grok_reference_init): For T& t(e), set
4944 LOOKUP_AGGREGATE_PAREN_INIT but don't build up a constructor yet.
4946 2020-04-08 Iain Sandoe <iain@sandoe.co.uk>
4947 Jun Ma <JunMa@linux.alibaba.com>
4949 * coroutines.cc (maybe_promote_captured_temps): Add a cleanup
4950 expression, if needed, to any call from which we promoted
4951 temporaries captured by reference.
4953 2020-04-08 Marek Polacek <polacek@redhat.com>
4955 PR c++/94507 - ICE-on-invalid with lambda template.
4956 * pt.c (tsubst_lambda_expr): Cope when tsubst_template_decl or
4957 tsubst_function_decl returns error_mark_node.
4959 2020-04-08 Martin Liska <mliska@suse.cz>
4962 * decl.c (duplicate_decls): Duplicate also DECL_IS_REPLACEABLE_OPERATOR.
4963 (cxx_init_decl_processing): Mark replaceable all implicitly defined
4966 2020-04-08 Patrick Palka <ppalka@redhat.com>
4968 Core issues 1001 and 1322
4970 * pt.c (rebuild_function_or_method_type): Split function out from ...
4971 (tsubst_function_type): ... here.
4972 (maybe_rebuild_function_decl_type): New function.
4973 (tsubst_function_decl): Use it.
4975 2020-04-08 Jakub Jelinek <jakub@redhat.com>
4978 * decl.c (begin_destructor_body): For CLASSTYPE_VBASECLASSES class
4979 dtors, if CLASSTYPE_PRIMARY_BINFO is non-NULL, but not BINFO_VIRTUAL_P,
4980 look at CLASSTYPE_PRIMARY_BINFO of its BINFO_TYPE if it is not
4981 BINFO_VIRTUAL_P, and so on.
4983 2020-04-08 Marek Polacek <polacek@redhat.com>
4985 PR c++/94478 - ICE with defaulted comparison operator
4986 * method.c (early_check_defaulted_comparison): Give an error when the
4989 2020-04-08 Tobias Burnus <tobias@codesourcery.com>
4992 * paser.c (cp_parser_oacc_declare): Add check that variables
4993 are declared in the same scope as the directive.
4995 2020-04-07 Jason Merrill <jason@redhat.com>
4998 * parser.c (cp_parser_requires_expression): Use tentative_firewall.
5001 * parser.c (cp_parser_placeholder_type_specifier): Use
5004 2020-04-07 Iain Sandoe <iain@sandoe.co.uk>
5006 * coroutines.cc (maybe_promote_captured_temps): Ensure that
5007 reference capture placeholder vars are properly declared.
5009 2020-04-07 Patrick Palka <ppalka@redhat.com>
5012 * tree.c (replace_placeholders): Look through all handled components,
5013 not just COMPONENT_REFs.
5014 * typeck2.c (process_init_constructor_array): Propagate
5015 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
5016 the array initializer.
5018 2020-04-07 Jakub Jelinek <jakub@redhat.com>
5021 * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
5022 if cp_parser_omp_master succeeded.
5024 2020-04-06 Jason Merrill <jason@redhat.com>
5027 * decl.c (duplicate_decls): Fix handling of DECL_HIDDEN_FRIEND_P.
5029 2020-04-04 Marek Polacek <polacek@redhat.com>
5030 Jason Merrill <jason@redhat.com>
5032 PR c++/94155 - crash in gimplifier with paren init of aggregates.
5033 * init.c (build_vec_init): Fill in indexes.
5035 2020-04-04 Jason Merrill <jason@redhat.com>
5038 * mangle.c (write_expression): Skip IMPLICIT_CONV_EXPR.
5040 2020-04-04 Patrick Palka <ppalka@redhat.com>
5044 * constexpr.c (struct constexpr_ctx): New field 'parent'.
5045 (cxx_eval_bare_aggregate): Propagate CONSTRUCTOR_PLACEHOLDER_BOUNDARY
5046 flag from the original constructor to the reduced constructor.
5047 (lookup_placeholder): Prefer to return the outermost matching object
5048 by recursively calling lookup_placeholder on the 'parent' context,
5049 but don't cross CONSTRUCTOR_PLACEHOLDER_BOUNDARY constructors.
5050 (cxx_eval_constant_expression): Link the 'ctx' context to the 'new_ctx'
5051 context via 'new_ctx.parent' when being expanded without an explicit
5052 target. Don't call replace_placeholders.
5053 (cxx_eval_outermost_constant_expr): Initialize 'ctx.parent' to NULL.
5057 * constexpr.c (get_or_insert_ctor_field): Split out (while adding
5058 support for VECTOR_TYPEs, and optimizations for the common case)
5060 (cxx_eval_store_expression): ... here. Rename local variable
5061 'changed_active_union_member_p' to 'activated_union_member_p'. Record
5062 the sequence of indexes into 'indexes' that yields the subobject we're
5063 assigning to. Record the integer offsets of the constructor indexes
5064 we're assigning through into 'index_pos_hints'. After evaluating the
5065 initializer of the store expression, recompute 'valp' using 'indexes'
5066 and using 'index_pos_hints' as hints.
5067 (cxx_eval_bare_aggregate): Tweak comments. Use get_or_insert_ctor_field
5068 to recompute the constructor_elt pointer we're assigning through after
5069 evaluating each initializer.
5071 2020-04-04 Jason Merrill <jason@redhat.com>
5074 * constraint.cc (tsubst_valid_expression_requirement): Call
5077 2020-04-04 Jason Merrill <jason@redhat.com>
5080 * constexpr.c (maybe_constant_value): Use break_out_target_exprs.
5081 * expr.c (mark_use) [VIEW_CONVERT_EXPR]: Don't wrap a TARGET_EXPR in
5084 2020-04-04 Jakub Jelinek <jakub@redhat.com>
5087 * parser.c (cp_parser_omp_for_loop): Use
5088 protected_set_expr_location_if_unset.
5089 * cp-gimplify.c (genericize_if_stmt, genericize_cp_loop): Likewise.
5092 * pt.c (tsubst_expr) <case OMP_MASTER>: Clear
5093 omp_parallel_combined_clauses.
5095 2020-04-03 Jason Merrill <jason@redhat.com>
5098 * pt.c (complex_pack_expansion_r): New.
5099 (complex_alias_template_p): Use it.
5101 2020-03-31 Jason Merrill <jason@redhat.com>
5104 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Call
5105 replace_placeholders.
5106 * typeck2.c (store_init_value): Fix arguments to
5107 fold_non_dependent_expr.
5109 2020-03-31 Jason Merrill <jason@redhat.com>
5111 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Use
5114 2020-03-30 Jason Merrill <jason@redhat.com>
5117 * tree.c (cp_tree_equal) [CALL_EXPR]: Compare KOENIG_LOOKUP_P.
5118 (called_fns_equal): Check DECL_CONTEXT.
5120 2020-03-30 Jakub Jelinek <jakub@redhat.com>
5123 * semantics.c (add_stmt): Only set STMT_IS_FULL_EXPR_P on trees with
5124 STATEMENT_CODE_P code.
5126 2020-03-28 Patrick Palka <ppalka@redhat.com>
5129 * parser.c (cp_parser_requires_clause_opt): Diagnose and recover from
5130 "requires {" when "requires requires {" was probably intended.
5133 * constraint.cc (tsubst_compound_requirement): Always suppress errors
5134 from type_deducible_p and expression_convertible_p, as they're not
5135 substitution errors.
5136 (diagnose_atomic_constraint) <case INTEGER_CST>: Remove this case so
5137 that we diagnose INTEGER_CST expressions of non-bool type via the
5139 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: New case.
5140 * parser.c (cp_parser_requires_expression): Always parse the requirement
5141 body as if we're processing a template, by temporarily incrementing
5142 processing_template_decl. Afterwards, if we're not actually in a
5143 template context, perform semantic processing to diagnose any invalid
5144 types and expressions.
5145 * pt.c (tsubst_copy_and_build) <case REQUIRES_EXPR>: Remove dead code.
5146 * semantics.c (finish_static_assert): Explain an assertion failure
5147 when the condition is a REQUIRES_EXPR like we do when it is a concept
5150 * constraint.cc (diagnose_compound_requirement): When diagnosing a
5151 compound requirement, maybe replay the satisfaction failure, subject to
5152 the current diagnosis depth.
5154 * constraint.cc (finish_constraint_binary_op): Set the location of EXPR
5155 as well as its range, because build_x_binary_op doesn't always do so.
5156 (current_constraint_diagnosis_depth): New.
5157 (concepts_diagnostics_max_depth_exceeded_p): New.
5158 (collect_operands_of_disjunction): New.
5159 (satisfy_disjunction): When diagnosing a satisfaction failure, maybe
5160 replay each branch of the disjunction, subject to the current diagnosis
5162 (diagnose_valid_expression): When diagnosing a satisfaction failure,
5163 maybe replay the substitution error, subject to the current diagnosis
5165 (diagnose_valid_type): Likewise.
5166 (diagnose_nested_requiremnet): Likewise.
5167 (diagnosing_failed_constraint::diagnosing_failed_constraint): Increment
5168 current_constraint_diagnosis_depth when diagnosing.
5169 (diagnosing_failed_constraint::~diagnosing_failed_constraint): Decrement
5170 current_constraint_diagnosis_depth when diagnosing.
5171 (diagnosing_failed_constraint::replay_errors_p): New static member
5173 (diagnose_constraints): Don't diagnose if concepts_diagnostics_max_depth
5174 is 0. Emit a one-off note to increase -fconcepts-diagnostics-depth if
5175 the limit was exceeded.
5176 * cp-tree.h (diagnosing_failed_constraint::replay_errors_p): Declare.
5178 2020-03-27 Nathan Sidwell <nathan@acm.org>
5181 * name-lookup.c (do_pushdecl): Look through cleanp levels.
5183 2020-03-27 Martin Sebor <msebor@redhat.com>
5188 * cp-tree.h (most_specialized_partial_spec): Declare.
5189 * parser.c (cp_parser_elaborated_type_specifier): Distinguish alias
5191 (specialization_of): New function.
5192 (cp_parser_check_class_key): Move code...
5193 (class_decl_loc_t::add): ...to here. Add parameters. Avoid issuing
5194 -Wredundant-tags on first-time declarations in other declarators.
5195 Correct handling of template specializations.
5196 (class_decl_loc_t::diag_mismatched_tags): Also expect to be called
5197 when -Wredundant-tags is enabled. Use primary template or partial
5198 specialization as the guide for uses of implicit instantiations.
5199 * pt.c (most_specialized_partial_spec): Declare extern.
5201 2020-03-27 Nathan Sidwell <nathan@acm.org>
5204 * name-lookup.c (push_namespace): Triage ambiguous lookups that
5207 2020-03-27 Jakub Jelinek <jakub@redhat.com>
5210 * call.c (set_flags_from_callee): Don't update
5211 cp_function_chain->can_throw or current_function_returns_abnormally
5212 if cp_unevaluated_operand.
5215 * cvt.c (ocp_convert): Handle COMPOUND_EXPR by recursion on the second
5216 operand and creating a new COMPOUND_EXPR if anything changed.
5218 2020-03-26 Marek Polacek <polacek@redhat.com>
5220 PR c++/94336 - template keyword accepted before destructor names.
5221 * parser.c (cp_parser_unqualified_id): Give an error when 'template'
5222 is followed by a destructor name.
5224 2020-03-27 Patrick Palka <ppalka@redhat.com>
5226 * decl.c (compute_array_index_type_loc): Remove redundant
5227 type_dependent_expression_p check that is subsumed by
5228 value_dependent_expression_p.
5229 * decl2.c (is_late_template_attribute): Likewise.
5230 * pt.c (uses_template_parms): Likewise.
5231 (dependent_template_arg_p): Likewise.
5233 2020-03-26 Marek Polacek <polacek@redhat.com>
5236 PR c++/94057 - template keyword in a typename-specifier.
5237 * parser.c (check_template_keyword_in_nested_name_spec): New.
5238 (cp_parser_nested_name_specifier_opt): Implement DR1710, optional
5239 'template'. Call check_template_keyword_in_nested_name_spec.
5240 (cp_parser_simple_type_specifier): Assume that a <
5241 following a qualified-id in a typename-specifier begins
5242 a template argument list.
5244 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
5246 * coroutines.cc (coro_init_identifiers): Initialize an identifier
5247 for the cororoutine handle 'address' method name.
5248 (struct coro_aw_data): Add fields to cover the continuations.
5249 (co_await_expander): Determine the kind of await_suspend in use.
5250 If we have the case that returns a continuation handle, then save
5251 this and make the target for 'scope exit without cleanup' be the
5252 continuation resume label.
5253 (expand_co_awaits): Remove.
5254 (struct suspend_point_info): Remove fields that kept the returned
5255 await_suspend handle type.
5256 (transform_await_expr): Remove code tracking continuation handles.
5257 (build_actor_fn): Add the continuation handle as an actor-function
5258 scope var. Build the symmetric transfer continuation point. Call
5259 the tree walk for co_await expansion directly, rather than via a
5260 trivial shim function.
5261 (register_await_info): Remove fields tracking continuation handles.
5262 (get_await_suspend_return_type): Remove.
5263 (register_awaits): Remove code tracking continuation handles.
5264 (morph_fn_to_coro): Remove code tracking continuation handles.
5266 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
5268 * coroutines.cc (co_await_expander): If we are expanding the
5269 initial await expression, set a boolean flag to show that we
5270 have now reached the initial await_resume() method call.
5271 (expand_co_awaits): Handle the 'initial await resume called' flag.
5272 (build_actor_fn): Insert the initial await expression into the
5273 start of the user-authored function-body. Handle the 'initial await
5274 resume called' flag.
5275 (morph_fn_to_coro): Initialise the 'initial await resume called'
5276 flag. Modify the unhandled exception catch clause to recognise
5277 exceptions that occur before the initial await_resume() and re-
5280 2020-03-26 Jakub Jelinek <jakub@redhat.com>
5283 * class.c (user_provided_p): Use STRIP_TEMPLATE instead of returning
5284 true for all TEMPLATE_DECLs.
5287 * cp-gimplify.c (cp_genericize_r): Handle STATEMENT_LIST.
5289 2020-03-25 Patrick Palka <ppalka@redhat.com>
5292 * parser.c (cp_parser_selection_statement) <case RID_IF>: Invalidate the
5293 current condition chain when the if-statement has a non-empty
5296 2020-03-25 Iain Sandoe <iain@sandoe.co.uk>
5299 * coroutines.cc (captures_temporary): Fix a missing dereference.
5301 2020-03-24 Marek Polacek <polacek@redhat.com>
5303 PR c++/94190 - wrong no post-decrement operator error in template.
5304 * call.c (convert_like_real): Use convert_from_reference on the result.
5306 2020-03-24 Jason Merrill <jason@redhat.com>
5309 * constraint.cc (constraint_satisfaction_value): Repeat noisily on
5311 (tsubst_nested_requirement): Likewise.
5312 (get_constraint_error_location): Allow missing context.
5313 (diagnose_atomic_constraint): Diagnose non-bool constraint here.
5314 (satisfy_atom): Not here. Only diagnose non-constant when noisy.
5316 2020-03-24 Jason Merrill <jason@redhat.com>
5318 * pt.c (any_template_parm_r): Look into the type of a non-type
5321 2020-03-24 Jason Merrill <jason@redhat.com>
5323 * cp-tree.h (cp_expr): When constructing from an expr and a
5324 location, call protected_set_expr_location.
5326 2020-03-23 Patrick Palka <ppalka@redhat.com>
5329 * except.c (maybe_noexcept_warning): Add TODO.
5330 * method.c (walk_field_subobs): Pass tf_none to expr_noexcept_p.
5332 2020-03-23 nathans <nathan@acm.org>
5335 * tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
5338 2020-03-21 Patrick Palka <ppalka@redhat.com>
5341 * constexpr.c (reduced_constant_expression_p) [CONSTRUCTOR]: Properly
5342 handle unions without an initializer.
5343 (cxx_eval_component_reference): Emit a different diagnostic when the
5344 constructor element corresponding to a union member is NULL.
5345 (cxx_eval_bare_aggregate): When constructing a union, always set the
5346 active union member before evaluating the initializer. Relax assertion
5347 that verifies the index of the constructor element we're initializing
5348 hasn't been changed.
5349 (cxx_eval_store_expression): Diagnose changing the active union member
5350 while the union is in the process of being initialized. After setting
5351 an active union member, clear CONSTRUCTOR_NO_CLEARING on the underlying
5353 (cxx_eval_constant_expression) [PLACEHOLDER_EXPR]: Don't re-reduce a
5354 CONSTRUCTOR returned by lookup_placeholder.
5356 2020-03-20 Patrick Palka <ppalka@redhat.com>
5358 * cxx-pretty-print.c (pp_cxx_parameter_mapping): Make extern. Move
5359 the "[with ]" bits to here from ...
5360 (pp_cxx_atomic_constraint): ... here.
5361 * cxx-pretty-print.h (pp_cxx_parameter_mapping): Declare.
5362 * error.c (rebuild_concept_check): Delete.
5363 (print_concept_check_info): Print the dependent form of the constraint and the
5364 preferably substituted parameter mapping alongside it.
5366 2020-03-19 Jason Merrill <jason@redhat.com>
5369 * cp-gimplify.c (simple_empty_class_p): Look through
5370 SIMPLE_TARGET_EXPR_P.
5371 (cp_gimplify_expr) [MODIFY_EXPR]: Likewise.
5372 [RETURN_EXPR]: Avoid producing 'return *retval;'.
5373 * call.c (build_call_a): Strip TARGET_EXPR from empty class arg.
5374 * cp-tree.h (SIMPLE_TARGET_EXPR_P): Check that TARGET_EXPR_INITIAL
5377 2020-03-19 Jakub Jelinek <jakub@redhat.com>
5380 * parser.c (cp_parser_omp_var_list_no_open): Call process_outer_var_ref
5381 on outer_automatic_var_p decls.
5382 * cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also for
5383 capture proxy decls.
5385 2020-03-18 Nathan Sidwell <nathan@acm.org>
5387 PR c++/94147 - mangling of lambdas assigned to globals
5388 * parser.c (cp_parser_init_declarator): Namespace-scope variables
5389 provide a lambda scope.
5390 * tree.c (no_linkage_check): Lambdas with a variable for extra
5391 scope have a linkage from the variable.
5393 2020-03-18 Jakub Jelinek <jakub@redhat.com>
5395 * constraint.cc (resolve_function_concept_check, subsumes_constraints,
5396 strictly_subsumes): Fix up duplicated word issue in a comment.
5397 * coroutines.cc (build_init_or_final_await, captures_temporary):
5399 * logic.cc (dnf_size_r, cnf_size_r): Likewise.
5400 * pt.c (append_type_to_template_for_access_check): Likewise.
5403 * decl.c (grokfndecl): Restore old diagnostics about deduction
5404 guide declared in different scope if in_namespace is NULL_TREE.
5406 2020-03-17 Jakub Jelinek <jakub@redhat.com>
5409 * parser.c (cp_parser_enum_specifier): Use temp_override for
5410 parser->colon_corrects_to_scope_p, replace goto out with return.
5411 If scoped enum or enum with underlying type is not followed by
5412 { or ;, call cp_parser_commit_to_tentative_parse before calling
5413 cp_parser_error and make sure to return error_mark_node instead of
5414 NULL_TREE. Formatting fixes.
5416 2020-03-17 Ville Voutilainen <ville.voutilainen@gmail.com>
5419 * method.c (assignable_expr): Use cp_unevaluated.
5420 (is_xible_helper): Push a non-deferred access check for
5421 the stub objects created by assignable_expr and constructible_expr.
5423 2020-03-17 Jakub Jelinek <jakub@redhat.com>
5425 * pt.c (tsubst): Fix up duplicated word issue in a diagnostic message.
5426 (lookup_template_class_1, tsubst_expr): Fix up duplicated word issue
5428 * parser.c (cp_parser_statement, cp_parser_linkage_specification,
5429 cp_parser_placeholder_type_specifier,
5430 cp_parser_constraint_requires_parens): Likewise.
5431 * name-lookup.c (suggest_alternative_in_explicit_scope): Likewise.
5433 2020-03-15 Iain Sandoe <iain@sandoe.co.uk>
5435 * coroutines.cc (co_await_expander): Fix indentation.
5437 2020-03-14 Jason Merrill <jason@redhat.com>
5440 * pt.c (process_partial_specialization): Error rather than crash on
5441 extra pack expansion.
5443 2020-03-14 Jason Merrill <jason@redhat.com>
5446 * pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
5447 DECL_ORIGINAL_TYPE of a typedef.
5449 2020-03-14 Jason Merrill <jason@redhat.com>
5452 * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
5453 substituting DECL_ARGUMENTS.
5455 2020-03-14 Jakub Jelinek <jakub@redhat.com>
5457 * logic.cc (formula::formula): Change "a an" to "an" in a comment.
5458 * parser.c (cp_debug_parser): Change "a an" to "an" in a string
5461 2020-03-13 Patrick Palka <ppalka@redhat.com>
5464 * call.c (build_over_call): Use a warning_sentinel to disable
5465 warn_deprecated_decl before calling build_addr_func.
5467 2020-03-12 Jakub Jelinek <jakub@redhat.com>
5470 * decl.c (reshape_init_array_1): Don't unshare constructor if there
5471 aren't any trailing zero elts, otherwise only unshare the first
5474 2020-03-11 Jason Merrill <jason@redhat.com>
5477 * constraint.cc (tsubst_parameter_mapping): Canonicalize type
5480 2020-03-11 Marek Polacek <polacek@redhat.com>
5481 Jason Merrill <jason@redhat.com>
5483 PR c++/94074 - wrong modifying const object error for COMPONENT_REF.
5484 * constexpr.c (cref_has_const_field): New function.
5485 (modifying_const_object_p): Consider a COMPONENT_REF
5486 const only if any of its fields are const.
5487 (cxx_eval_store_expression): Mark a CONSTRUCTOR of a const type
5488 as readonly after its initialization has been done.
5490 2020-03-10 Marek Polacek <polacek@redhat.com>
5492 PR c++/94124 - wrong conversion error with non-viable overload.
5493 * decl.c (reshape_init_array_1): Unshare a constructor if we
5494 stripped trailing zero-initializers.
5496 2020-03-10 Jason Merrill <jason@redhat.com>
5499 * pt.c (maybe_instantiate_noexcept): Always update clones.
5501 2020-03-10 Jason Merrill <jason@redhat.com>
5504 * pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
5506 2020-03-10 Jason Merrill <jason@redhat.com>
5512 * cp-gimplify.c (cp_gimplify_init_expr): Partially revert patch for
5513 66139: Don't split_nonconstant_init. Remove pre_p parameter.
5515 2020-03-09 Marek Polacek <polacek@redhat.com>
5517 PR c++/92031 - bogus taking address of rvalue error.
5518 PR c++/91465 - ICE with template codes in check_narrowing.
5519 PR c++/93870 - wrong error when converting template non-type arg.
5520 PR c++/94068 - ICE with template codes in check_narrowing.
5521 * call.c (convert_like_real): Return IMPLICIT_CONV_EXPR
5522 in a template when not ck_identity and we're dealing with a class.
5523 (convert_like_real) <case ck_ref_bind>: Return IMPLICIT_CONV_EXPR
5524 in a template if we need a temporary.
5525 * decl.c (compute_array_index_type_loc): Remove
5526 instantiate_non_dependent_expr_sfinae call. Call
5527 fold_non_dependent_expr instead of maybe_constant_value.
5528 (build_explicit_specifier): Don't instantiate or create a sentinel
5529 before converting the expression.
5530 * except.c (build_noexcept_spec): Likewise.
5531 * pt.c (convert_nontype_argument): Don't build IMPLICIT_CONV_EXPR.
5532 Set IMPLICIT_CONV_EXPR_NONTYPE_ARG if that's what
5533 build_converted_constant_expr returned.
5534 * typeck2.c (check_narrowing): Call fold_non_dependent_expr instead
5535 of maybe_constant_value.
5537 2020-03-09 Jakub Jelinek <jakub@redhat.com>
5541 2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
5543 * constexpr.c (cxx_eval_constant_expression): Do not handle
5544 RROTATE_EXPR and LROTATE_EXPR.
5546 2020-03-09 Marek Polacek <polacek@redhat.com>
5548 PR c++/94050 - ABI issue with alignas on armv7hl.
5549 * class.c (layout_class_type): Don't replace a class's
5550 CLASSTYPE_AS_BASE if their TYPE_USER_ALIGN don't match.
5552 2020-03-09 Bin Cheng <bin.cheng@linux.alibaba.com>
5554 * coroutines.cc (build_actor_fn): Factor out code inserting the
5555 default return_void call to...
5556 (morph_fn_to_coro): ...here, also hoist local var declarations.
5558 2020-03-08 Patrick Palka <ppalka@redhat.com>
5561 * call.c (convert_like_real): Check complain before emitting an error
5562 about binding a bit-field to a reference.
5564 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
5565 [TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
5568 2020-03-06 Nathan Sidwell <nathan@acm.org>
5571 * mangle.c (find_substitution): Don't call same_type_p on template
5572 args that cannot match.
5574 2020-03-04 Martin Sebor <msebor@redhat.com>
5577 * tree.c (type_initializer_zero_p): Fail for structs initialized
5580 2020-03-04 Jason Merrill <jason@redhat.com>
5583 * init.c (perform_member_init): Don't do aggregate initialization of
5585 * constexpr.c (cx_check_missing_mem_inits): Don't enforce
5586 initialization of empty field.
5588 2020-03-04 Martin Liska <mliska@suse.cz>
5590 * method.c: Wrap array in ctor with braces in order
5591 to silent clang warnings.
5593 2020-03-03 Jason Merrill <jason@redhat.com>
5594 Marek Polacek <polacek@redhat.com>
5596 PR c++/90505 - mismatch in template argument deduction.
5597 * pt.c (tsubst): Don't reduce the template level of template
5598 parameters when tf_partial.
5600 2020-03-03 Jakub Jelinek <jakub@redhat.com>
5603 * constexpr.c (cxx_eval_constant_expression)
5604 <case TARGET_EXPR, case SAVE_EXPR>: Don't record anything if
5605 *non_constant_p is true.
5607 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
5609 * coroutines.cc (captures_temporary): Strip component_ref
5612 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
5614 * coroutines.cc (finish_co_await_expr): Build co_await_expr
5615 with unknown_type_node.
5616 (finish_co_yield_expr): Ditto.
5617 *pt.c (type_dependent_expression_p): Set co_await/yield_expr
5618 with unknown type as dependent.
5620 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
5622 * coroutines.cc (struct local_var_info): Adjust to remove the
5623 reference to the captured var, and just to note that this is a
5624 lambda capture proxy.
5625 (transform_local_var_uses): Handle lambda captures specially.
5626 (struct param_frame_data): Add a visited set.
5627 (register_param_uses): Also check for param uses in lambda
5629 (struct local_vars_frame_data): Remove captures list.
5630 (register_local_var_uses): Handle lambda capture proxies by
5631 noting and bypassing them.
5632 (morph_fn_to_coro): Update to remove lifetime extension of
5633 lambda capture-by-copy vars.
5635 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
5637 * coroutines.cc (build_co_await): Do not build frame
5638 awaitable proxy vars when the co_await expression is
5639 a function parameter or local var.
5640 (co_await_expander): Do not initialise a frame var with
5642 (transform_await_expr): Only substitute the awaitable
5643 frame var if it's needed.
5644 (register_awaits): Do not make frame copies for param
5645 or local vars that are awaitables.
5647 2020-02-28 Jason Merrill <jason@redhat.com>
5649 Implement P2092R0, Disambiguating Nested-Requirements
5650 * parser.c (cp_parser_requirement_parameter_list): Pass
5651 CP_PARSER_FLAGS_TYPENAME_OPTIONAL.
5653 * call.c (build_user_type_conversion_1): Don't look at the second
5654 conversion of a non-viable candidate.
5656 2020-02-28 Jakub Jelinek <jakub@redhat.com>
5658 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
5659 * typeck.c (cp_build_addr_expr_1): Allow taking address of immediate
5660 functions in unevaluated contexts.
5662 2020-02-27 Nathan Sidwell <nathan@acm.org>
5665 * pt.c (template_args_equal): Pass ARGUMENT_PACKS through to
5667 * tree.c (cp_tree_equal): Compare ARGUMENT_PACKS here,
5668 * typeck.c (comptypes): Assert we don't get any argument packs.
5670 * class.c (adjust_clone_args): Correct arg-checking assert.
5671 * typeck.c (comptypes): Assert not nulls.
5673 2020-02-26 Marek Polacek <polacek@redhat.com>
5675 PR c++/93789 - ICE with invalid array bounds.
5676 * decl.c (compute_array_index_type_loc): Don't use the folded
5677 size when folding cleared TREE_CONSTANT.
5679 2020-02-26 Iain Sandoe <iain@sandoe.co.uk>
5681 * class.c (classtype_has_non_deleted_copy_ctor): New.
5682 * coroutines.cc (struct param_info): Keep track of params
5683 that are references, and cache the original type and whether
5684 the DTOR is trivial.
5685 (build_actor_fn): Handle param copies always, and adjust the
5686 handling for references.
5687 (register_param_uses): Only handle uses here.
5688 (classtype_has_non_deleted_copy_ctor): New.
5689 (morph_fn_to_coro): Adjust param copy handling to match n4849
5690 by reordering ahead of the promise CTOR and always making a
5691 frame copy, even if the param is unused in the coroutine body.
5692 * cp-tree.h (classtype_has_non_deleted_copy_ctor): New.
5694 2020-02-26 Patrick Palka <ppalka@redhat.com>
5696 * constraint.cc (finish_constraint_binary_op): Set expr's location range
5697 to the range of its operands.
5698 (satisfy_atom): Pass MAP instead of ARGS to diagnose_atomic_constraint.
5699 (diagnose_trait_expr): Take the instantiated parameter mapping MAP
5700 instead of the corresponding template arguments ARGS and adjust body
5702 (diagnose_requires_expr): Likewise.
5703 (diagnose_atomic_constraint): Likewise. When printing an atomic
5704 constraint expression, print the instantiated parameter mapping
5706 * cxx-pretty-print.cc (cxx_pretty_printer::expression)
5707 [NONTYPE_ARGUMENT_PACK]: Print braces around a NONTYPE_ARGUMENT_PACK.
5708 (cxx_pretty_printer::type_id): Handle TYPE_ARGUMENT_PACK.
5710 2020-02-26 Marek Polacek <polacek@redhat.com>
5712 PR c++/93676 - value-init crash in template.
5713 * init.c (build_new_1): Don't call build_vec_init in a template.
5715 2020-02-26 Marek Polacek <polacek@redhat.com>
5717 PR c++/93862 - ICE with static_cast when converting from int[].
5718 * call.c (reference_compatible_p): No longer static.
5719 * cp-tree.h (reference_compatible_p): Declare.
5720 * typeck.c (build_static_cast_1): Use reference_compatible_p instead
5721 of reference_related_p.
5723 2020-02-26 Marek Polacek <polacek@redhat.com>
5725 PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
5726 * constexpr.c (reduced_constant_expression_p): Don't crash on a null
5729 2020-02-24 Martin Sebor <msebor@redhat.com>
5732 * parser.c (cp_parser_check_class_key): Avoid issuing -Wredundant-tags
5733 in shared C/C++ code in headers.
5734 Remove a duplicate hunk of code.
5736 2020-02-24 Marek Polacek <polacek@redhat.com>
5738 PR c++/93869 - ICE with -Wmismatched-tags.
5739 * parser.c (cp_parser_check_class_key): Check class_key earlier.
5741 2020-02-24 Marek Polacek <polacek@redhat.com>
5743 PR c++/93712 - ICE with ill-formed array list-initialization.
5744 * call.c (next_conversion): Return NULL for ck_aggr.
5745 (build_aggr_conv): Set u.expr instead of u.next.
5746 (build_array_conv): Likewise.
5747 (build_complex_conv): Likewise.
5748 (conv_get_original_expr): Handle ck_aggr.
5750 2020-02-24 Jakub Jelinek <jakub@redhat.com>
5752 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
5753 * call.c (build_over_call): Don't evaluate immediate functions in
5754 unevaluated operands.
5756 2020-02-24 Jason Merrill <jason@redhat.com>
5758 P0780R2: Resolve lambda init-capture pack grammar.
5759 * parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than
5762 2020-02-22 Marek Polacek <polacek@redhat.com>
5765 * decl.c (grokdeclarator): Use %qs in a diagnostic message.
5767 2020-02-21 Martin Sebor <msebor@redhat.com>
5769 PR gcov-profile/93753
5770 * class.c (check_flexarrays): Tighten up a test for potential members
5771 of anonymous structs or unions.
5773 2020-02-20 Martin Sebor <msebor@redhat.com>
5776 * parser.c (cp_parser_check_class_key): Only handle true C++ class-keys.
5778 2020-02-20 Martin Liska <mliska@suse.cz>
5780 PR translation/93841
5781 * config/or1k/or1k.opt: Remove superfluous word.
5782 * doc/invoke.texi: Likewise.
5784 2020-02-20 Martin Liska <mliska@suse.cz>
5786 PR translation/93838
5787 * parser.c (cp_parser_decl_specifier_seq): Remove trailing space.
5789 2020-02-19 Marek Polacek <polacek@redhat.com>
5791 PR c++/93169 - wrong-code with a non-constexpr constructor.
5792 * constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY
5793 on constant CONSTRUCTORs.
5795 2020-02-15 Marek Polacek <polacek@redhat.com>
5797 PR c++/93710 - poor diagnostic for array initializer.
5798 * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
5801 2020-02-15 Jason Merrill <jason@redhat.com>
5804 * pt.c (any_template_parm_r): Look into lambda body.
5807 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
5809 2020-02-14 Jakub Jelinek <jakub@redhat.com>
5812 * class.c (enum_min_precision): Change prec type from int to int &.
5815 * cp-tree.h (enum cp_tree_index): Add CPTI_FALLBACK_DFLOAT32_TYPE,
5816 CPTI_FALLBACK_DFLOAT64_TYPE and CPTI_FALLBACK_DFLOAT128_TYPE.
5817 (fallback_dfloat32_type, fallback_dfloat64_type,
5818 fallback_dfloat128_type): Define.
5819 * mangle.c (write_builtin_type): Handle fallback_dfloat*_type like
5821 * rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
5822 is disabled for compatibility.
5824 2020-02-13 Jason Merrill <jason@redhat.com>
5827 * name-lookup.c (matching_fn_p): A function does not match a
5832 * tree.c (decl_linkage): Always lk_none for locals.
5834 2020-02-12 Jason Merrill <jason@redhat.com>
5838 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
5839 * pt.c (find_parameter_packs_r): Not here.
5841 2020-02-12 Iain Sandoe <iain@sandoe.co.uk>
5843 * coroutines.cc (build_actor_fn): Implement deallocation function
5844 selection per n4849, dcl.fct.def.coroutine bullet 12.
5845 (morph_fn_to_coro): Implement allocation function selection per
5846 n4849, dcl.fct.def.coroutine bullets 9 and 10.
5848 2020-02-12 Marek Polacek <polacek@redhat.com>
5850 PR c++/93684 - ICE-on-invalid with broken attribute.
5851 * parser.c (cp_parser_std_attribute): Peek a token first before
5854 2020-02-11 Jason Merrill <jason@redhat.com>
5857 * class.c (add_implicitly_declared_members): Use do_friend.
5858 * method.c (implicitly_declare_fn): Fix friend handling.
5859 (decl_remember_implicit_trigger_p): New.
5860 (synthesize_method): Use it.
5861 * decl2.c (mark_used): Use it.
5863 2020-02-11 Jason Merrill <jason@redhat.com>
5867 * constexpr.c (maybe_constant_value): Correct earlier change.
5868 (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
5869 * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.
5871 2020-02-12 Patrick Palka <ppalka@redhat.com>
5875 * type-utils.h (find_type_usage): Refactor to take a tree * and to
5876 return a tree *, and update documentation accordingly.
5877 * pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
5878 decltype(auto) node.
5879 (make_constrained_decltype_auto): No need to explicitly set
5880 AUTO_IS_DECLTYPE anymore.
5881 (splice_late_return_type): Use find_type_usage to find and
5882 replace a possibly nested auto node instead of using is_auto.
5883 Check test for is_auto into an assert when deciding whether
5884 to late_return_type.
5885 (type_uses_auto): Adjust the call to find_type_usage.
5886 * parser.c (cp_parser_decltype): No need to explicitly set
5887 AUTO_IS_DECLTYPE anymore.
5889 * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
5890 (dump_simple_decl): Handle standard concept definitions as well as
5891 variable concept definitions.
5893 2020-02-10 Jakub Jelinek <jakub@redhat.com>
5896 * error.c (dump_decl_name): Fix up last argument to strncmp.
5898 2020-02-10 Jason Merrill <jason@redhat.com>
5901 * tree.c (array_of_unknown_bound_p): New.
5902 * init.c (perform_member_init): Do nothing for flexible arrays.
5904 2020-02-09 Jakub Jelinek <jakub@redhat.com>
5907 * constexpr.c (cxx_eval_constant_expression): If obj is heap var with
5908 ARRAY_TYPE, use the element type. Punt if objtype after that is not
5911 2020-02-08 Jason Merrill <jason@redhat.com>
5914 * expr.c (fold_for_warn): Call maybe_constant_value.
5915 * constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
5916 (maybe_constant_value): Add uid_sensitive parm.
5917 (get_fundef_copy): Don't copy if it's true.
5918 (cxx_eval_call_expression): Don't instantiate if it's true.
5919 (cxx_eval_outermost_constant_expr): Likewise.
5922 * constexpr.c (maybe_constant_value): Don't unshare if the cached
5923 value is the same as the argument.
5925 * typeck.c (maybe_warn_about_returning_address_of_local): Add
5928 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
5931 2020-02-08 Jakub Jelinek <jakub@redhat.com>
5934 * constexpr.c (find_array_ctor_elt): If last element has no index,
5935 for flag_checking verify all elts have no index. If i is within the
5936 elts, return it directly, if it is right after the last elt, append
5937 if NULL index, otherwise force indexes on all elts.
5938 (cxx_eval_store_expression): Allow cep->index to be NULL.
5940 2020-02-07 Marek Polacek <polacek@redhat.com>
5942 PR c++/92947 - Paren init of aggregates in unevaluated context.
5943 * call.c (build_new_method_call_1): Don't check
5944 cp_unevaluated_operand. Check the return value of digest_init.
5946 2020-02-06 Jason Merrill <jason@redhat.com>
5949 * tree.c (cp_walk_subtrees): Walk into type template arguments.
5950 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
5951 instead of TYPE_ALIAS_P.
5952 * pt.c (push_template_decl_real): Likewise.
5953 (find_parameter_packs_r): Likewise. Remove dead code.
5954 * error.c (find_typenames_r): Remove dead code.
5956 2020-02-06 Jason Merrill <jason@redhat.com>
5959 * parser.c (cp_parser_constraint_primary_expression): Do the main
5960 parse non-tentatively.
5962 2020-02-06 Marek Polacek <polacek@redhat.com>
5964 PR c++/93597 - ICE with lambda in operator function.
5965 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
5967 2020-02-05 Jason Merrill <jason@redhat.com>
5970 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
5971 handling of TREE_CHAIN for empty pack.
5973 2020-02-05 Jakub Jelinek <jakub@redhat.com>
5976 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
5977 prior to passing it to c_build_vec_convert.
5979 2020-02-05 Marek Polacek <polacek@redhat.com>
5981 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
5982 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
5985 2020-02-05 Jason Merrill <jason@redhat.com>
5988 * decl.c (grokdeclarator): Reject field of current class type even
5991 2020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
5993 * coroutines.cc (maybe_promote_captured_temps): Increase the index
5994 number for temporary variables' name.
5996 2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
5998 * coroutines.cc (build_co_await): Call convert_from_reference
5999 to wrap co_await_expr with indirect_ref which avoid
6000 reference/non-reference type confusion.
6002 (co_await_expander): Sink to call_expr if await_resume
6003 is wrapped by indirect_ref.
6005 2020-02-04 Jason Merrill <jason@redhat.com>
6008 * constraint.cc (satisfy_declaration_constraints): Check return
6009 value of push_tinst_level.
6012 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
6013 elements instead of value-initializing them.
6016 * init.c (perform_member_init): Simplify.
6017 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
6019 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
6021 2020-02-04 Iain Sandoe <iain@sandoe.co.uk>
6023 * coroutines.cc (find_promise_type): Delete unused forward
6025 (struct coroutine_info): Add a bool for no promise type error.
6026 (coro_promise_type_found_p): Only emit the error for a missing
6027 promise once in each affected coroutine.
6029 2020-02-03 Jason Merrill <jason@redhat.com>
6032 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
6033 defer loading the value of a reference.
6035 2020-02-03 Jason Merrill <jason@redhat.com>
6038 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
6040 [COMPONENT_REF]: A member function reference doesn't use the object
6043 2020-02-03 Iain Sandoe <iain@sandoe.co.uk>
6046 * coroutines.cc (struct coroutine_info): Add a bool flag to note
6047 that we emitted an error for a bad function return type.
6048 (get_coroutine_info): Tolerate an unset info table in case of
6050 (find_coro_traits_template_decl): In case of error or if we didn't
6051 find a type template, note we emitted the error and suppress
6053 (find_coro_handle_template_decl): Likewise.
6054 (instantiate_coro_traits): Only check for error_mark_node in the
6055 return from lookup_qualified_name.
6056 (coro_promise_type_found_p): Reorder initialization so that we check
6057 for the traits and their usability before allocation of the info
6058 table. Check for a suitable return type and emit a diagnostic for
6059 here instead of relying on the lookup machinery. This allows the
6060 error to have a better location, and means we can suppress multiple
6062 (coro_function_valid_p): Re-check for a valid promise (and thus the
6063 traits) before proceeding. Tolerate missing info as a fatal error.
6065 2020-02-03 Jason Merrill <jason@redhat.com>
6068 * cp-gimplify.c (predeclare_vla): New.
6069 (cp_genericize_r) [NOP_EXPR]: Call it.
6071 2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
6073 * coroutines.cc (transform_await_wrapper): Set actor funcion as
6074 new context of label_decl.
6075 (build_actor_fn): Fill new field of await_xform_data.
6077 2020-02-02 Marek Polacek <polacek@redhat.com>
6079 PR c++/93530 - ICE on invalid alignas in a template.
6080 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
6083 2020-01-31 Jason Merrill <jason@redhat.com>
6086 * semantics.c (process_outer_var_ref): Capture VLAs even in
6087 unevaluated context.
6090 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
6091 non-aggregate elements.
6092 (reshape_init_array): Add first_initializer_p parm.
6093 (reshape_init_r): Change first_initializer_p from bool to tree.
6094 (reshape_init): Pass init to it.
6097 * parser.c (cp_parser_initializer_list): Suppress location wrappers
6100 2020-01-29 Jason Merrill <jason@redhat.com>
6103 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
6104 the expression was dependent before substitution.
6106 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
6108 * coroutines.cc (act_des_fn): New.
6109 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
6110 Access promise via actor function's frame pointer argument.
6111 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
6113 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
6115 * coroutines.cc (co_await_expander): Handle type conversion case.
6117 2020-01-29 Jason Merrill <jason@redhat.com>
6122 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
6123 a trailing return type.
6124 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
6127 2020-01-29 Marek Polacek <polacek@redhat.com>
6129 PR c++/91754 - Fix template arguments comparison with class NTTP.
6130 * pt.c (class_nttp_const_wrapper_p): New.
6131 (template_args_equal): See through class_nttp_const_wrapper_p
6134 2020-01-29 Marek Polacek <polacek@redhat.com>
6136 PR c++/92948 - Fix class NTTP with template arguments.
6137 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
6138 converting a value-dependent expression to a class type.
6139 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
6140 as the result of the tsubst_copy call.
6142 2020-01-29 Jakub Jelinek <jakub@redhat.com>
6145 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
6146 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
6148 2020-01-28 Jason Merrill <jason@redhat.com>
6151 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
6155 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
6158 * call.c (build_user_type_conversion_1): Allow a template conversion
6159 returning an rvalue reference to bind directly to an lvalue.
6162 * decl.c (grokdeclarator): Propagate eh spec from typedef.
6164 2020-01-28 Martin Liska <mliska@suse.cz>
6167 * pt.c (redeclare_class_template): Group couple of
6168 errors and inform messages with auto_diagnostic_group.
6170 2020-01-28 Martin Liska <mliska@suse.cz>
6173 * pt.c (redeclare_class_template): Use inform
6174 for the second location.
6176 2020-01-27 Jason Merrill <jason@redhat.com>
6179 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
6181 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
6184 * coroutines.cc (morph_fn_to_coro): Check the ramp return
6185 value when it is constructed from the 'get return object'.
6187 2020-01-27 Nathan Sidwell <nathan@acm.org>
6190 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
6192 2020-01-26 Jason Merrill <jason@redhat.com>
6195 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
6196 temporarily enable -Wsystem-headers. Change second warning to
6200 * semantics.c (finish_call_expr): Don't call
6201 instantiate_non_dependent_expr before warn_for_memset.
6203 2020-01-25 Marek Polacek <polacek@redhat.com>
6205 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
6206 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
6207 dynamic_cast diagnostic.
6209 2020-01-24 Jason Merrill <jason@redhat.com>
6211 PR c++/93400 - ICE with constrained friend.
6212 * constraint.cc (maybe_substitute_reqs_for): New.
6213 * decl.c (function_requirements_equivalent_p): Call it.
6214 * pt.c (tsubst_friend_function): Only substitute
6215 TEMPLATE_PARMS_CONSTRAINTS.
6216 (tsubst_template_parms): Copy constraints.
6218 2020-01-24 Jason Merrill <jason@redhat.com>
6220 PR c++/93279 - ICE with lambda in member operator.
6221 * name-lookup.c (maybe_save_operator_binding): Don't remember
6222 class-scope bindings.
6224 2020-01-24 Jason Merrill <jason@redhat.com>
6226 PR c++/93377 - ICE with member alias in constraint.
6227 * pt.c (any_template_parm_r): Look at template arguments for all
6228 aliases, not only alias templates.
6230 2020-01-24 Marek Polacek <polacek@redhat.com>
6232 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
6233 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
6235 2020-01-24 Jason Merrill <jason@redhat.com>
6237 PR c++/92852 - ICE with generic lambda and reference var.
6238 * constexpr.c (maybe_constant_value): Likewise.
6240 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
6243 * parser.c (cp_parser_nested_name_specifier_opt): Properly
6244 diagnose concept-ids.
6246 2020-01-23 Jason Merrill <jason@redhat.com>
6248 PR c++/93331 - ICE with __builtin_strchr.
6249 * constexpr.c (cxx_eval_builtin_function_call): Use the original
6250 argument if we didn't manage to extract a STRING_CST.
6252 PR c++/93345 - ICE with defaulted dtor and template.
6254 * decl.c (cxx_maybe_build_cleanup): Don't try to set
6255 throwing_cleanup in a template.
6257 2020-01-22 Marek Polacek <polacek@redhat.com>
6259 PR c++/92907 - noexcept does not consider "const" in member functions.
6260 * g++.dg/cpp0x/noexcept56.C: New test.
6262 2020-01-22 Marek Polacek <polacek@redhat.com>
6264 PR c++/93324 - ICE with -Wall on constexpr if.
6265 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
6267 2020-01-22 Patrick Palka <ppalka@redhat.com>
6269 * constraint.cc (get_mapped_args): Avoid using auto_vec
6270 as a vector element. Release the vectors inside the lists
6272 * parser.c (cp_literal_operator_id): Free the buffer.
6274 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
6276 * coroutines.cc (finish_co_await_expr): Add error check on return
6277 value of build_co_await.
6278 (finish_co_yield_expr,): Ditto.
6280 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
6282 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
6283 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
6284 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
6286 2020-01-21 Jason Merrill <jason@redhat.com>
6288 PR c++/60855 - ICE with sizeof VLA capture.
6289 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
6291 PR c++/90732 - ICE with VLA capture and generic lambda.
6292 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
6294 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
6295 Bin Cheng <bin.cheng@linux.alibaba.com>
6297 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
6298 from complete_type_or_else.
6299 (register_param_uses): Likewise.
6300 (build_co_await): Do not try to use complete_type_or_else for void
6301 types, otherwise for incomplete types, check for NULL return from
6302 complete_type_or_else.
6304 2020-01-21 Jason Merrill <jason@redhat.com>
6306 PR c++/91476 - anon-namespace reference temp clash between TUs.
6307 * decl2.c (copy_linkage): Factor out of get_guard.
6308 * call.c (make_temporary_var_for_ref_to_temp): Use it.
6309 * decl.c (cp_finish_decomp): Use it.
6310 (cp_finish_decl): determine_visibility sooner.
6312 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
6314 * coroutines.cc (finish_co_await_expr): Set return value flag.
6315 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
6317 2020-01-19 Jason Merrill <jason@redhat.com>
6319 PR c++/33799 - destroy return value, take 2.
6320 * cp-tree.h (current_retval_sentinel): New macro.
6321 (struct language_function): Add throwing_cleanup bitfield.
6322 * decl.c (cxx_maybe_build_cleanup): Set it.
6323 * except.c (maybe_set_retval_sentinel)
6324 (maybe_splice_retval_cleanup): New functions.
6325 * parser.c (cp_parser_compound_statement): Call
6326 maybe_splice_retval_cleanup.
6327 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
6329 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
6331 2020-01-18 Jakub Jelinek <jakub@redhat.com>
6333 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
6334 but non-NO_DOLLAR_IN_LABEL case build.
6336 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
6338 * Make-lang.in: Add coroutines.o.
6339 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
6340 (DECL_COROUTINE_P): New.
6341 * lex.c (init_reswords): Enable keywords when the coroutine flag
6343 * operators.def (co_await): New operator.
6344 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
6345 (op_error): Likewise.
6346 (build_new_op_1): Likewise.
6347 (build_new_function_call): Validate coroutine builtin arguments.
6348 * constexpr.c (potential_constant_expression_1): Handle
6349 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
6350 * coroutines.cc: New file.
6351 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
6352 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
6353 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
6354 * cp-tree.h (coro_validate_builtin_call): New.
6355 * decl.c (emit_coro_helper): New.
6356 (finish_function): Handle the case when a function is found to
6357 be a coroutine, perform the outlining and emit the outlined
6358 functions. Set a bit to signal that this is a coroutine component.
6359 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
6360 (cp_parser_unary_expression): Handle co_await.
6361 (cp_parser_assignment_expression): Handle co_yield.
6362 (cp_parser_statement): Handle RID_CO_RETURN.
6363 (cp_parser_jump_statement): Handle co_return.
6364 (cp_parser_operator): Handle co_await operator.
6365 (cp_parser_yield_expression): New.
6366 (cp_parser_required_error): Handle RT_CO_YIELD.
6367 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
6368 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
6370 * tree.c (cp_walk_subtrees): Likewise.
6372 2020-01-17 Jason Merrill <jason@redhat.com>
6374 PR c++/92531 - ICE with noexcept(lambda).
6375 * pt.c (uses_template_parms): Don't try to enumerate all the
6378 2020-01-17 Jakub Jelinek <jakub@redhat.com>
6381 * parser.c (cp_parser_template_name): Look up deprecated attribute
6382 in DECL_TEMPLATE_RESULT or its type's attributes.
6384 2020-01-16 Jason Merrill <jason@redhat.com>
6386 PR c++/93286 - ICE with __is_constructible and variadic template.
6387 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
6388 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
6390 PR c++/93280 - ICE with aggregate assignment and DMI.
6391 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
6392 * typeck2.c (digest_nsdmi_init): Not here.
6394 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
6397 * cp-tree.h (is_constrained_auto): New.
6398 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
6399 handle concept-check expressions; take a cp_decl_specifier_seq*
6401 (cp_parser_condition): Update call.
6402 (cp_parser_simple_declaration): Likewise.
6403 (cp_parser_placeholder_type_specifier): Correctly handle
6404 concept-check expressions.
6406 2020-01-15 Jason Merrill <jason@redhat.com>
6409 PR c++/33799 - destroy return value if local cleanup throws.
6410 * cp-tree.h (current_retval_sentinel): New macro.
6411 * decl.c (start_preparsed_function): Set up cleanup for retval.
6412 * typeck.c (check_return_expr): Set current_retval_sentinel.
6414 PR c++/93257 - consteval void function.
6415 * constexpr.c (verify_constant): Allow void_node.
6417 PR c++/92871 - bad code with xvalue and GNU ?: extension.
6418 * call.c (prevent_lifetime_extension): New.
6419 (build_conditional_expr_1): Use it.
6421 2020-01-14 Nathan Sidwell <nathan@acm.org>
6424 * pt.c (retrieve_specialization): Use get_template_info, not open
6428 * pt.c (retrieve_specialization): Get the TI from the decl or the
6429 classtype as appropriate.
6431 2020-01-14 David Malcolm <dmalcolm@redhat.com>
6433 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
6434 New static constant.
6435 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
6436 (struct named_label_hash::empty_zero_p): Likewise.
6437 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
6439 2020-01-14 Jason Merrill <jason@redhat.com>
6441 PR c++/92590 - wrong handling of inherited default ctor.
6442 * class.c (add_method): A constrained inherited ctor doesn't hide an
6443 implicit derived ctor.
6445 PR c++/92552 - ICE with inherited constrained default ctor.
6446 * pt.c (instantiate_class_template_1): Copy
6447 TYPE_HAS_USER_CONSTRUCTOR.
6448 PR c++/91930 - ICE with constrained inherited default ctor.
6449 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
6450 for inherited constructor.
6451 PR c++/92594 - ICE with inherited trivial default ctor.
6452 * method.c (trivial_fn_p): Treat an inherited default constructor
6453 like a normal default constructor.
6455 PR c++/92594 - ICE with inherited trivial default ctor.
6456 * method.c (trivial_fn_p): Treat an inherited default constructor
6457 like a normal default constructor.
6459 PR c++/92009 - ICE with punning of typeid.
6460 * rtti.c (get_tinfo_desc): Call xref_basetypes.
6461 * constexpr.c (cxx_fold_indirect_ref): Don't strip
6464 2020-01-13 Jason Merrill <jason@redhat.com>
6466 PR c++/92746 - ICE with noexcept of function concept check.
6467 * except.c (check_noexcept_r): Handle concept-check.
6469 PR c++/92582 - ICE with member template as requirement.
6470 * pt.c (struct find_template_parameter_info): Add ctx_parms.
6471 (any_template_parm_r): Handle TEMPLATE_DECL.
6472 (find_template_parameters): Take parms instead of their depth.
6473 * constraint.cc (build_parameter_mapping): Pass them.
6475 PR c++/33799 - destroy return value if local cleanup throws.
6476 * cp-tree.h (current_retval_sentinel): New macro.
6477 * decl.c (start_preparsed_function): Set up cleanup for retval.
6478 * typeck.c (check_return_expr): Set current_retval_sentinel.
6480 PR c++/93238 - short right-shift with enum.
6481 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
6483 2020-01-10 Jason Merrill <jason@redhat.com>
6485 * typeck.c (cp_build_binary_op): Restore short_shift code.
6487 PR c++/93143 - incorrect tree sharing with constexpr.
6488 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
6489 CONSTRUCTORs are already unshared.
6491 PR c++/93173 - incorrect tree sharing.
6493 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
6494 copy_if_shared after cp_genericize_tree.
6495 * typeck2.c (split_nonconstant_init): Don't unshare here.
6497 2020-01-08 Jason Merrill <jason@redhat.com>
6499 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
6500 TARGET_EXPR_DIRECT_INIT_P.
6501 * constexpr.c (cxx_eval_constant_expression): Likewise.
6503 2020-01-08 Jason Merrill <jason@redhat.com>
6505 PR c++/91369 - constexpr destructor and member initializer.
6506 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
6507 when not preevaluating.
6509 2020-01-08 Jason Merrill <jason@redhat.com>
6511 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
6514 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
6516 * init.c (build_new): Add location_t parameter and use it throughout.
6517 (build_raw_new_expr): Likewise.
6518 * parser.c (cp_parser_new_expression): Pass the combined_loc.
6519 * pt.c (tsubst_copy_and_build): Adjust call.
6520 * cp-tree.h: Update declarations.
6522 2020-01-07 Jason Merrill <jason@redhat.com>
6524 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
6525 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
6526 explicit class visibility for a template.
6528 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
6530 * mangle.c (mangle_type_attribute_p): New function, split out from...
6531 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
6532 that contain a space.
6534 2020-01-07 Jakub Jelinek <jakub@redhat.com>
6537 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
6538 member, initialize it to zero in ctor.
6539 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
6540 a heap object. Don't cache calls to functions which allocate some
6541 heap objects and don't deallocate them or deallocate some heap
6542 objects they didn't allocate.
6544 2020-01-06 Jason Merrill <jason@redhat.com>
6546 PR c++/92552 - ICE with inherited constrained default ctor.
6547 * pt.c (instantiate_class_template_1): Copy
6548 TYPE_HAS_USER_CONSTRUCTOR.
6549 * class.c (one_inherited_ctor): Don't set it here.
6551 2020-01-06 Andrew Sutton <asutton@lock3software.com>
6553 PR c++/92739 - parsing requires clause with attributes.
6554 * parser.c (cp_parser_constraint_requires_parens): Exclude
6555 attributes as postfix expressions.
6557 2020-01-05 Jakub Jelinek <jakub@redhat.com>
6560 * parser.c (cp_parser_check_class_key): Disable access checks for the
6562 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
6563 !warn_redundant_tags.
6565 2010-01-05 Jakub Jelinek <jakub@redhat.com>
6568 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
6569 TARGET_EXPR if it has been gimplified already.
6571 2020-01-03 Jason Merrill <jason@redhat.com>
6573 PR c++/93033 - incorrect tree node sharing with array init.
6574 * typeck2.c (split_nonconstant_init): Unshare non-decl.
6575 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
6577 2020-01-02 Jason Merrill <jason@redhat.com>
6579 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
6582 2020-01-02 Jakub Jelinek <jakub@redhat.com>
6585 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
6586 has not been found, rather than error_mark_node.
6588 2020-01-01 Jakub Jelinek <jakub@redhat.com>
6590 Update copyright years.
6592 Copyright (C) 2020 Free Software Foundation, Inc.
6594 Copying and distribution of this file, with or without modification,
6595 are permitted in any medium without royalty provided the copyright
6596 notice and this notice are preserved.