]> gcc.gnu.org Git - gcc.git/blob - gcc/cp/ChangeLog
e49d1a14b9381cdfeacf0f7c8baf6cef903a18bd
[gcc.git] / gcc / cp / ChangeLog
1 2020-12-21 Nathan Sidwell <nathan@acm.org>
2
3 * module.cc (create_dirs): Add logging.
4 (finish_module_processing): Unlink before rename.
5
6 2020-12-21 Nathan Sidwell <nathan@acm.org>
7
8 PR bootstrap/98412
9 * mapper-client.cc: INCLUDE_STRING, INCLUDE_VECTOR.
10 (module_client::open_module_client): Avoid std::stoul.
11 * mapper-resolver.cc: INCLUDE_STRING, INCLUDE_VECTOR.
12
13 2020-12-18 Kwok Cheung Yeung <kcy@codesourcery.com>
14
15 * cp-lang.c (cxx_get_decl_init): New.
16 (cxx_omp_finish_decl_inits): New.
17 (LANG_HOOKS_GET_DECL_INIT): New.
18 (LANG_HOOKS_OMP_FINISH_DECL_INITS): New.
19 * cp-tree.h (dynamic_initializers): New.
20 * decl.c (dynamic_initializers): New.
21 * decl2.c (c_parse_final_cleanups): Add initializer entries
22 from vars to dynamic_initializers.
23
24 2020-12-18 Nathan Sidwell <nathan@acm.org>
25
26 * module.cc (O_CLOEXEC, O_BINARY): Add window's support.
27 (elf_in::defrost, module_state::do_import)
28 (finish_module_processing): Use O_BINARY.
29
30 2020-12-18 Jakub Jelinek <jakub@redhat.com>
31
32 PR c++/98343
33 * cp-gimplify.c (source_location_table_entry_hash::pch_nx): Override
34 static member functions from ggc_remove.
35
36 2020-12-18 Patrick Palka <ppalka@redhat.com>
37
38 * constraint.cc (satisfying_constraint): Move up definition
39 and give it bool type.
40 (failed_type_completion_count): Replace with ...
41 (failed_type_completions): ... this.
42 (note_failed_type_completion_for_satisfaction): Append the
43 supplied argument to failed_type_completions.
44 (some_type_complete_p): Define.
45 (sat_entry::maybe_unstable): Replace with ...
46 (sat_entry::ftc_begin, sat_entry::ftc_end): ... these.
47 (satisfaction_cache::ftc_count): Replace with ...
48 (satisfaction_cache::ftc_begin): ... this.
49 (satisfaction_cache::satisfaction_cache): Adjust accordingly.
50 (satisfaction_cache::get): Adjust accordingly, using
51 some_type_complete_p.
52 (satisfaction_cache::save): Adjust accordingly.
53 (satisfying_constraint_p): Remove unused function.
54 (satisfy_constraint): Set satisfying_constraint.
55 (satisfy_declaration_constraints): Likewise.
56 * decl.c (require_deduced_type): Call
57 note_failed_type_completion_for_satisfaction.
58
59 2020-12-18 Patrick Palka <ppalka@redhat.com>
60
61 * constraint.cc (sat_entry::evaluating): New member.
62 (satisfaction_cache::get): If entry->evaluating, diagnose
63 self-recursive satisfaction. Otherwise, set entry->evaluating
64 if we're not reusing a cached satisfaction result.
65 (satisfaction_cache::save): Clear entry->evaluating.
66 (satisfy_atom): Set up diagnosing_failed_constraint before the
67 first call to get().
68
69 2020-12-18 Patrick Palka <ppalka@redhat.com>
70
71 * constraint.cc (failed_type_completion_count): New.
72 (note_failed_type_completion_for_satisfaction): New.
73 (sat_entry::constr): Rename to ...
74 (sat_entry::atom): ... this.
75 (sat_entry::location): New member.
76 (sat_entry::maybe_unstable): New member.
77 (sat_entry::diagnose_instability): New member.
78 (struct sat_hasher): Adjust after the above renaming.
79 (get_satisfaction, save_satisfaction): Remove.
80 (satisfaction_cache): Rewrite completely.
81 (satisfy_atom): When instantiation of the parameter mapping
82 fails, set diagnose_instability. Propagate location from
83 inst_cache.entry to cache.entry if the secondary lookup
84 succeeded.
85 (satisfy_declaration_constraints): When
86 failed_type_completion_count differs before and after
87 satisfaction, then don't cache the satisfaction result.
88 * cp-tree.h (note_failed_type_completion_for_satisfaction):
89 Declare.
90 * pt.c (tsubst) <case TYPENAME_TYPE>: Use
91 complete_type_or_maybe_complain instead of open-coding it.
92 * typeck.c (complete_type_or_maybe_complain): Call
93 note_failed_type_completion_for_satisfaction when type
94 completion fails.
95
96 2020-12-17 Nathan Sidwell <nathan@acm.org>
97
98 PR c++/98340
99 * module.cc (uintset<T>::hash::add): Use uintset (0u).MEMBER,
100 rather than uintset::MEMBER.
101
102 2020-12-17 Nathan Sidwell <nathan@acm.org>
103
104 PR bootstrap/98300
105 * module.cc: Fix ::read, ::write result signedness comparisons.
106
107 2020-12-16 Nathan Sidwell <nathan@acm.org>
108
109 * mapper-resolver.cc: Remove early include of
110 sys/socket.h. Specify no CODY_NETWORKING instead.
111 * module.cc: Specify no CODY_NETWORKING.
112
113 2020-12-16 Nathan Sidwell <nathan@acm.org>
114
115 * parser.c (cp_parser_elaborated_type_specifier): Test
116 BOUND_TEMPLATE_TEMPLATE_PARM before checking for instantiation.
117
118 2020-12-16 Nathan Sidwell <nathan@acm.org>
119
120 * module.cc (dumper::push): Clangify offsetof use.
121
122 2020-12-16 Nathan Sidwell <nathan@acm.org>
123
124 * mapper-resolver.cc: #include sys/socket before system.h
125 due to poisoned bcopy use.
126
127 2020-12-16 Nathan Sidwell <nathan@acm.org>
128
129 * module.cc (loc_spans): Make spans a pointer, not inline.
130 Adjust all accesses.
131
132 2020-12-16 Nathan Sidwell <nathan@acm.org>
133
134 * mapper-client.cc: Include sys/socket.h before system.h.
135
136 2020-12-15 Patrick Palka <ppalka@redhat.com>
137
138 * pt.c (in_template_function): Inspect cfun->decl instead of
139 current_function_decl.
140
141 2020-12-15 Nathan Sidwell <nathan@acm.org>
142
143 * module.cc: Replace stubs with implementation.
144
145 2020-12-15 Nathan Sidwell <nathan@acm.org>
146
147 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add mapper-client &
148 mapper-resolver.
149 * mapper-client.h: New.
150 * mapper-client.cc: New.
151 * mapper-resolver.cc: New.
152
153 2020-12-15 Nathan Sidwell <nathan@acm.org>
154
155 * name-lookup.c (do_namespace_alias): Set originating module
156 before pushing.
157
158 2020-12-11 Jason Merrill <jason@redhat.com>
159
160 PR libstdc++/97600
161 * call.c (build_user_type_conversion_1): Avoid considering
162 conversion functions that return a clearly unsuitable type.
163
164 2020-12-11 Jason Merrill <jason@redhat.com>
165
166 * cp-tree.h (make_binding_vec): Add CXX_MEM_STAT_INFO.
167
168 2020-12-11 Nathan Sidwell <nathan@acm.org>
169
170 * config-lang.in (gtfiles): Add cp/module.cc.
171 * decl2.c (c_parse_final_cleanups): Add module support.
172 * lambda.c (record_lambda_scope): Call maybe_attach_decl.
173 * module.cc (maybe_attach_decl, lazy_load_specializations): Stubs.
174 (finish_module_procesing): Stub.
175 * pt.c (lookup_template_class_1): Lazy load specializations.
176 (instantiate_template_1): Likewise.
177
178 2020-12-11 Nathan Sidwell <nathan@acm.org>
179
180 * decl2.c (c_parse_final_cleanups): Refactor loop.
181
182 2020-12-11 Nathan Sidwell <nathan@acm.org>
183
184 * cp-tree.h (map_context_from, map_context_to): Declare.
185 * module.cc (map_context_from, map_context_to): Define.
186 * tree.c (cp_tree_equal): Check map_context_{from,to} for parm
187 context difference. Allow NON_LVALUE_EXPR and VIEW_CONVERT_EXPR
188 with null types.
189
190 2020-12-11 Nathan Sidwell <nathan@acm.org>
191
192 * cp-lang.c (LANG_HOOKS_PREPROCESS_MAIN_FILE): Override.
193 (LANG_HOOKS_PREPROCESS_OPTIONS): Override.
194 (LANG_HOOKS_PREPROCESS_TOKEN): Override.
195 * cp-objcp-common.c (cp_register_dumps): Add module dump.
196 (cp_handle_option): New.
197 * cp-objcp-common.h (cp_handle_option): Declare.
198 (LANG_HOOKS_HANDLE_OPTION): Override.
199 * cp-tree.h (module_dump_id): Declare.
200 * module.cc (module_dump_id): Define.
201 (module_begin_main_file, handle_module_option)
202 (module_preproces_options): Stubs.
203
204 2020-12-11 Nathan Sidwell <nathan@acm.org>
205
206 * module.cc (lazy_specializations_p): Stub.
207 * name-lookup.h (append_imported_binding_slot)
208 (mergeable_namespacE_slots, lookup_class_binding)
209 (walk_module_binding, import_module_binding, set_module_binding)
210 (note_pending_specializations, load_pending_specializations)
211 (add_module_decl, add_imported_namespace): Declare.
212 (get_cxx_dialect_name): Declare.
213 (enum WMB_flags): New.
214 * name-lookup.c (append_imported_binding_slot)
215 (mergeable_namespacE_slots, lookup_class_binding)
216 (walk_module_binding, import_module_binding, set_module_binding)
217 (note_pending_specializations, load_pending_specializations)
218 (add_module_decl, add_imported_namespace): New.
219 (get_cxx_dialect_name): Make extern.
220
221 2020-12-11 Patrick Palka <ppalka@redhat.com>
222
223 PR c++/78173
224 * typeck.c (pointer_diff): Use complete_type_or_maybe_complain
225 instead of complete_type_or_else.
226
227 2020-12-10 Jason Merrill <jason@redhat.com>
228
229 * cp-tree.h (struct type_identity): New.
230 (make_temp_override): New.
231 * decl.c (grokdeclarator): Use it.
232 * except.c (maybe_noexcept_warning): Use it.
233 * parser.c (cp_parser_enum_specifier): Use it.
234 (cp_parser_parameter_declaration_clause): Use it.
235 (cp_parser_gnu_attributes_opt): Use it.
236 (cp_parser_std_attribute): Use it.
237
238 2020-12-10 Nathan Sidwell <nathan@acm.org>
239
240 * name-lookup.c (do_nonmember_using_decl): Add INSERT_P parm.
241 Deal with exporting using decls.
242 (finish_nonmember_using_decl): Examine BINDING_VECTOR.
243
244 2020-12-10 Nathan Sidwell <nathan@acm.org>
245
246 * cp-tree.h (visible_instantiation_path): Renamed.
247 * module.cc (get_originating_module_decl, lazy_load_binding)
248 (lazy_load_members, visible_instantiation_path): Stubs.
249 * name-lookup.c (STAT_TYPE_VISIBLE_P, STAT_VISIBLE): New.
250 (search_imported_binding_slot, init_global_partition)
251 (get_fixed_binding_slot): New.
252 (name_lookup::process_module_binding): New.
253 (name_lookup::search_namespace_only): Search BINDING_VECTOR.
254 (name_lookup::adl_namespace_fns): Likewise.
255 (name_lookip::search_adl): Search visible instantiation path.
256 (maybe_lazily_declare): Maybe lazy load members.
257 (implicitly_exporT_namespace): New.
258 (maybe_record_mergeable_decl): New.
259 (check_module_override): New.
260 (do_pushdecl): Deal with BINDING_VECTOR, check override.
261 (add_mergeable_namespace_entity): New.
262 (get_namespace_binding): Deal with BINDING_VECTOR.
263 (do_namespace_alias): Call set_originating_module.
264 (lookup_elaborated_type_1): Deal with BINDING_VECTOR.
265 (do_pushtag): Call set_originating_module.
266 (reuse_namespace): New.
267 (make_namespace_finish): Add FROM_IMPORT parm.
268 (push_namespace): Deal with BINDING_VECTOR & namespace reuse.
269 (maybe_save_operator_binding): Save when module CMI in play.
270 * name-lookup.h (add_mergeable_namespace_entity): Declare.
271
272 2020-12-10 Nathan Sidwell <nathan@acm.org>
273
274 * name-lookup.c: Include bitmap.h.
275 (enum binding_slots): New.
276 (maybe_add_fuzzy_binding): Return bool true if found.
277 (consider_binding_level): Add module support.
278 * module.cc (get_import_bitmap): Stub.
279
280 2020-12-10 Nathan Sidwell <nathan@acm.org>
281
282 * name-lookup.c (pop_local_binding): Check for IDENTIFIER_ANON_P.
283 (update_binding): Level may be null, don't add namespaces to
284 level.
285 (newbinding_bookkeeping): New, broken out of ...
286 (do_pushdecl): ... here, call it. Don't push anonymous decls.
287 (pushdecl, add_using_namespace): Correct comments.
288 (do_push_nested_namespace): Remove assert.
289 (make_namespace, make_namespace_finish): New, broken out of ...
290 (push_namespace): ... here. Call them. Add namespace to level
291 here.
292
293 2020-12-10 Nathan Sidwell <nathan@acm.org>
294
295 * error.c (dump_module_suffix): New.
296 (dump_aggr_type, dump_simple_decl, dump_function_name): Call it.
297 * ptree.c (cxx_print_decl): Print module information.
298 * module.cc (module_name, get_importing_module): Stubs.
299
300 2020-12-10 Nathan Sidwell <nathan@acm.org>
301
302 * name-lookup.h (set_class_bindings): Return vector, take signed
303 'extra' parm.
304 * name-lookup.c (maybe_lazily_declare): Break out ...
305 (get_class_binding): .. of here, call it.
306 (find_member_slot): Adjust get_class_bindings call.
307 (set_class_bindings): Allow -ve extra. Return the vector.
308 (set_identifier_type_value_with_scope): Remove checking assert.
309 (lookup_using_decl): Set decl's context.
310 (do_pushtag): Adjust set_identifier_type_value_with_scope handling.
311
312 2020-12-09 Nathan Sidwell <nathan@acm.org>
313
314 * parser.h (struct cp_token): Add main_source_p field.
315 * parser.c (cp_lexer_new_main): Pass thought module token filter.
316 Check macros.
317 (cp_lexer_get_preprocessor_token): Set main_source_p.
318 (enum module_parse): New.
319 (cp_parser_diagnose_invalid_type_name): Deal with unrecognized
320 module-directives.
321 (cp_parser_skip_to_closing_parenthesize_1): Skip module-directivres.
322 (cp_parser_skip_to_end_of_statement): Likewise.
323 (cp_parser_skiup_to_end_of_block_or_statement): Likewise.
324 (cp_parser_translation_unit): Add module parsing calls.
325 (cp_parser_module_name, cp_parser_module_declaration): New.
326 (cp_parser_import_declaration, cp_parser_module_export): New.
327 (cp_parser_declaration): Add module export detection.
328 (cp_parser_template_declaration): Adjust 'export' error message.
329 (cp_parser_function_definition_after_declarator): Add
330 module-specific logic.
331 * module.cc (import_module, declare_module)
332 (maybe_check_all_macros): Stubs.
333
334 2020-12-09 Marek Polacek <polacek@redhat.com>
335
336 PR c++/97517
337 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier): Handle
338 NULLPTR_TYPE.
339 (pp_cxx_type_specifier_seq): Likewise.
340 (cxx_pretty_printer::type_id): Likewise.
341
342 2020-12-09 Nathan Sidwell <nathan@acm.org>
343
344 * decl.c (duplicate_decls): Add module-specific redeclaration
345 logic.
346 (cxx_init_decl_processing): Export the global namespace, maybe
347 initialize modules.
348 (start_decl): Reject local-extern in a module, adjust linkage of
349 template var.
350 (xref_tag_1): Add module-specific redeclaration logic.
351 (start_enum): Likewise.
352 (finish_enum_value_list): Export unscoped members of an exported
353 enum.
354 (grokmethod): Implement p1779 linkage of in-class defined
355 functions.
356 * decl2.c (no_linkage_error): Imports are ok.
357 (c_parse_final_cleanups): Call fini_modules.
358 * lex.c (cxx_dup_lang_specific): Clear some module flags in the
359 copy.
360 * module.cc (module_kind): Define.
361 (module_may_redeclare, set_defining_module): Stubs.
362 (init_modules): Error on modules.
363 (fini_modules): Stub.
364 * rtti.c (push_abi_namespace): Save and reset module_kind.
365 (pop_abi_namespace): Restore module kind.
366 (build_dynamic_cast_1, tinfo_base_init): Adjust.
367 * semantics.c (begin_class_definition): Add module-specific logic.
368 (expand_or_defer_fn_1): Keep bodies of more fns when modules_p.
369
370 2020-12-09 Tobias Burnus <tobias@codesourcery.com>
371
372 * parser.c (cp_parser_omp_allocate): New.
373 (cp_parser_omp_construct, cp_parser_pragma): Call it.
374
375 2020-12-09 Jason Merrill <jason@redhat.com>
376
377 PR c++/98019
378 * cvt.c (maybe_warn_nodiscard): Check c_inhibit_evaluation_warnings.
379
380 2020-12-09 Jason Merrill <jason@redhat.com>
381
382 PR c++/59238
383 * init.c (expand_default_init): Pass tf_no_cleanup when building
384 a TARGET_EXPR to go on the RHS of an INIT_EXPR.
385 * typeck.c (cp_build_modify_expr): Likewise.
386
387 2020-12-08 Marek Polacek <polacek@redhat.com>
388
389 PR c++/98103
390 * constexpr.c (cxx_eval_dynamic_cast_fn): If the evaluating of vtable
391 yields a null pointer, give an error and return. Use objtype.
392
393 2020-12-08 Nathan Sidwell <nathan@acm.org>
394
395 * class.c (layout_class_type): Call set_instantiating_module.
396 (build_self_reference): Likewise.
397 * decl.c (grokfndecl): Call set_originating_module.
398 (grokvardecl): Likewise.
399 (grokdeclarator): Likewise.
400 * pt.c (maybe_new_partial_specialization): Call
401 set_instantiating_module, propagate DECL_MODULE_EXPORT_P.
402 (lookup_template_class_1): Likewise.
403 (tsubst_function_decl): Likewise.
404 (tsubst_decl, instantiate_template_1): Likewise.
405 (build_template_decl): Propagate module flags.
406 (tsubst_template_dcl): Likewise.
407 (finish_concept_definition): Call set_originating_module.
408 * module.cc (set_instantiating_module, set_originating_module): Stubs.
409
410 2020-12-08 Jason Merrill <jason@redhat.com>
411
412 PR c++/96299
413 * cp-tree.h (build_new_op): Add overload that omits some parms.
414 (genericize_spaceship): Add location_t parm.
415 * constexpr.c (cxx_eval_binary_expression): Pass it.
416 * cp-gimplify.c (genericize_spaceship): Pass it.
417 * method.c (genericize_spaceship): Handle class-type arguments.
418 (build_comparison_op): Fall back to op</== when appropriate.
419
420 2020-12-08 Jason Merrill <jason@redhat.com>
421
422 * call.c (build_new_op_1): Set *overload for ambiguity.
423 (build_new_method_call_1): Likewise.
424
425 2020-12-08 Bernd Edlinger <bernd.edlinger@hotmail.de>
426
427 * decl2.c: (is_atomic_expensive_p): New helper function.
428 (build_atomic_load_byte): Rename to...
429 (build_atomic_load_type): ... and add new parameter type.
430 (get_guard_cond): Skip the atomic here if that is expensive.
431 Use the correct type for the atomic load on certain targets.
432
433 2020-12-08 Nathan Sidwell <nathan@acm.org>
434
435 * cp-tree.h (struct tinst_level): Add path & visible fields.
436 (build_cdtor_clones): Declare.
437 (match_mergeable_specialization): Use a spec_entry, add insert parm.
438 * class.c (build_cdtor_clones): Externalize.
439 * pt.c (push_tinst_level_loc): Clear new fields.
440 (match_mergeable_specialization): Adjust API.
441
442 2020-12-08 Nathan Sidwell <nathan@acm.org>
443
444 * decl2.c (start_objects): Refactor and adjust for named module
445 initializers.
446 (finish_objects): Likewise.
447 (generate_ctor_or_dtor_function): Likewise.
448 * module.cc (module_initializer_kind)
449 (module_add_import_initializers): Stubs.
450
451 2020-12-08 Nathan Sidwell <nathan@acm.org>
452
453 * Make-lang.in (MODULE_VERSION): Override when DEVPHASE not empty.
454 * module.cc: Comment.
455
456 2020-12-08 Nathan Sidwell <nathan@acm.org>
457
458 * cp-tree.h (mangle_module_substitution, mangle_identifier)
459 (mangle_module_global_init): Declare.
460 * mangle.c (struct globals): Add mod field.
461 (mangle_module_substitution, mangle_identifier)
462 (mangle_module_global_init): Define.
463 (write_module, maybe_write_module): New.
464 (write_name): Call it.
465 (start_mangling): Clear mod field.
466 (finish_mangling_internal): Adjust.
467 * module.cc (mangle_module, mangle_module_fini)
468 (get_originating_module): Stubs.
469
470 2020-12-08 Nathan Sidwell <nathan@acm.org>
471
472 * cp-tree.h (module_token_pre, module_token_cdtor)
473 (module_token_lang): Declare.
474 * lex.c: Include langhooks.
475 (struct module_token_filter): New.
476 * cp-tree.h (module_token_pre, module_token_cdtor)
477 (module_token_lang): Define.
478 * module.cc (get_module, preprocess_module, preprocessed_module):
479 Nop stubs.
480
481 2020-12-08 Nathan Sidwell <nathan@acm.org>
482
483 * Make-lang.in (MODULE_VERSION): Define.
484 * module.cc: Add includes.
485
486 2020-12-08 Jakub Jelinek <jakub@redhat.com>
487
488 PR c++/98187
489 * parser.c (cp_parser_omp_parallel): For parallel master with
490 -fopenmp-simd only, just call cp_parser_omp_master instead of
491 wrapping it in OMP_PARALLEL.
492
493 2020-12-07 Marek Polacek <polacek@redhat.com>
494
495 PR c++/98043
496 * decl.c (pop_switch): If SWITCH_STMT_TYPE is a scoped enum type,
497 set it to the type of SWITCH_STMT_COND.
498
499 2020-12-07 Nathan Sidwell <nathan@acm.org>
500
501 * cp-tree.h (build_cplus_array_type): Add defaulted DEP parm.
502 * tree.c (set_array_type_common): Add DEP parm.
503 (build_cplus_array_type): Add DEP parm, determine dependency if
504 needed. Mark dependency of new types.
505 (cp_build_qualified_type_real): Adjust array-building call, assert
506 no surprising dependency.
507 (strip_typedefs): Likewise.
508
509 2020-12-07 Nathan Sidwell <nathan@acm.org>
510
511 PR c++/98116
512 * typeck.c (structural_comptypes): Move early outs to comptype.
513 Always check template-alias match when comparing_specializations.
514 (comptypes): Do early out checking here.
515
516 2020-12-05 Patrick Palka <ppalka@redhat.com>
517
518 PR c++/97093
519 * constraint.cc (parameter_mapping_equivalent_p): Add some
520 sanity checks. Clarify comment.
521 (tsubst_nested_requirement): Always perform satisfaction
522 quietly first. If that yields an erroneous result, emit a
523 context message and replay satisfaction noisily with the
524 diagnostic normal form.
525 (finish_nested_requirement): Normalize the constraint-expression
526 twice, once with diagnostic information and once without. Store
527 them in a TREE_LIST within the TREE_TYPE.
528 (diagnose_nested_requirement): When replaying satisfaction, use
529 the diagnostic normal form instead of renormalizing on the spot.
530
531 2020-12-05 Patrick Palka <ppalka@redhat.com>
532
533 PR c++/97093
534 * constraint.cc (struct sat_info): Define.
535 (tsubst_nested_requirement): Pass a sat_info object to
536 satisfy_constraint.
537 (satisfy_constraint_r): Take a sat_info argument instead of
538 subst_info.
539 (satisfy_conjunction): Likewise.
540 (satisfy_disjunction): Likewise. Instead of first evaluating
541 each branch quietly, evaluate each branch only with
542 unsatisfaction diagnostics disabled. Exit early if evaluation
543 of a branch returns error_mark_node.
544 (satisfy_atom): Take a sat_info argument instead of subst_info.
545 Fix a comment. Check diagnose_unsatisfaction_p() instead of
546 noisy() before replaying a substitution failure.
547 (satisfy_constraint): Take a sat_info argument instead of
548 subst_info.
549 (satisfy_associated_constraints): Likewise.
550 (satisfy_constraint_expression): Likewise.
551 (satisfy_declaration_constraints): Likewise.
552 (constraint_satisfaction_value): Likewise and adjust
553 accordingly. Fix formatting.
554 (constraints_satisfied_p): Pass a sat_info object to
555 constraint_satisfaction_value.
556 (evaluate_concept_check): Pass a sat_info object to
557 satisfy_constraint_expression.
558 (diagnose_nested_requirement): Likewise.
559 (diagnose_constraints): Pass an appropriate sat_info object to
560 constraint_satisfaction_value.
561
562 2020-12-05 Jakub Jelinek <jakub@redhat.com>
563
564 PR c++/98122
565 * constexpr.c (cxx_union_active_member): New function.
566 (cxx_fold_indirect_ref_1): Add ctx argument, pass it through to
567 recursive call. Handle UNION_TYPE.
568 (cxx_fold_indirect_ref): Add ctx argument, pass it to recursive calls
569 and cxx_fold_indirect_ref_1.
570 (cxx_eval_indirect_ref): Adjust cxx_fold_indirect_ref calls.
571
572 2020-12-04 Jason Merrill <jason@redhat.com>
573
574 PR c++/93083
575 * pt.c (convert_template_argument): Handle equivalent placeholders.
576 (do_class_deduction): Look through EXPR_PACK_EXPANSION, too.
577
578 2020-12-04 Jason Merrill <jason@redhat.com>
579
580 * decl2.c (clear_consteval_vfns): Remove *.
581 * pt.c (do_auto_deduction): Remove *.
582 * parser.c (cp_parser_late_parsing_default_args): Change loop
583 to use range 'for'.
584
585 2020-12-04 Nathan Sidwell <nathan@acm.org>
586
587 PR c++/98116
588 * cp-tree.h (comparing_typenames): Delete.
589 (cplus_build_array_type): Remove default parm.
590 * pt.c (comparing_typenames): Delete.
591 (spec_hasher::equal): Don't increment it.
592 * tree.c (set_array_type_canon): Remove dep parm.
593 (build_cplus_array_type): Remove dep parm changes.
594 (cp_build_qualified_type_real): Remove dependent array type
595 changes.
596 (strip_typedefs): Likewise.
597 * typeck.c (structural_comptypes): Revert comparing_typename
598 changes.
599
600 2020-12-04 Nathan Sidwell <nathan@acm.org>
601
602 * cp-tree.h: Add various inline module state predicates, and
603 declare the API that will be provided by modules.cc
604
605 2020-12-04 Jakub Jelinek <jakub@redhat.com>
606
607 PR c++/80780
608 * cp-gimplify.c (fold_builtin_source_location): Use 2 instead of 0
609 as last argument to cxx_printable_name.
610
611 2020-12-03 Jason Merrill <jason@redhat.com>
612
613 * cp-tree.h (releasing_vec::operator[]): Change parameter type to
614 ptrdiff_t.
615
616 2020-12-03 Nathan Sidwell <nathan@acm.org>
617
618 * cp-tree.h (OVL_EXPORT): New.
619 (class ovl_iterator): Add get_using, exporting_p.
620 * tree.c (ovl_insert): Extend using_or_hidden meaning to include
621 an exported using.
622
623 2020-12-03 Nathan Sidwell <nathan@acm.org>
624
625 * cp-tree.h (DECL_UNINSTANTIATED_TEMPLATE_FRIEND): New.
626 * pt.c (push_template_decl): Set it.
627 (tsubst_friend_function): Clear it.
628
629 2020-12-03 Nathan Sidwell <nathan@acm.org>
630
631 * cp-tree.h (make_unbound_class_template_raw): Declare.
632 (canonical_type_parameter): Declare.
633 * decl.c (make_unbound_class_template_raw): Break out of ...
634 (make_unboud_class_template): ... here. Call it.
635 * pt.c (canonical_type_parameter): Externalize. Refactor & set
636 structural_equality for type parms.
637
638 2020-12-03 Nathan Sidwell <nathan@acm.org>
639
640 PR c++/98107
641 * tree.c (build_cplus_array_type): Mark dependency of new variant.
642 (cp_build_qualified_type_real, strip_typedefs): Assert
643 TYPE_DEPENDENT_P_VALID, or not a dependent type.
644
645 2020-12-03 Jakub Jelinek <jakub@redhat.com>
646
647 PR libstdc++/93121
648 * cp-tree.h (cp_build_bit_cast): Declare.
649 * cp-tree.def (BIT_CAST_EXPR): New tree code.
650 * cp-objcp-common.c (names_builtin_p): Handle RID_BUILTIN_BIT_CAST.
651 (cp_common_init_ts): Handle BIT_CAST_EXPR.
652 * cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
653 Likewise.
654 * parser.c (cp_parser_postfix_expression): Handle
655 RID_BUILTIN_BIT_CAST.
656 * semantics.c (cp_build_bit_cast): New function.
657 * tree.c (cp_tree_equal): Handle BIT_CAST_EXPR.
658 (cp_walk_subtrees): Likewise.
659 * pt.c (tsubst_copy): Likewise.
660 * constexpr.c (check_bit_cast_type, cxx_eval_bit_cast): New functions.
661 (cxx_eval_constant_expression): Handle BIT_CAST_EXPR.
662 (potential_constant_expression_1): Likewise.
663 * cp-gimplify.c (cp_genericize_r): Likewise.
664
665 2020-12-03 Jason Merrill <jason@redhat.com>
666
667 * parser.c (cp_parser_primary_expression): Distinguish
668 parms from vars in error.
669 (cp_parser_late_parsing_default_args): Pushdecl parms
670 as we go.
671
672 2020-12-03 Jason Merrill <jason@redhat.com>
673
674 * name-lookup.c (begin_scope): Set immediate_fn_ctx_p.
675 * parser.c (cp_parser_late_parsing_default_args): Push
676 sk_function_parms scope.
677
678 2020-12-03 Peter Bergner <bergner@linux.ibm.com>
679
680 PR c++/97947
681 * typeck2.c (digest_init_r): Handle OPAQUE_TYPE as an aggregate type.
682
683 2020-12-02 Jakub Jelinek <jakub@redhat.com>
684
685 PR c++/80780
686 PR c++/93093
687 * cp-tree.h (source_location_current_p): Declare.
688 * tree.c (source_location_current_p): New function.
689 * call.c (immediate_invocation_p): New function.
690 (build_over_call): Use it to resolve LWG3396.
691 * constexpr.c (cxx_eval_builtin_function_call): Temporarily set
692 current_function_decl from ctx->call->fundef->decl if any.
693 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Fold calls
694 to immediate function std::source_location::current ().
695
696 2020-12-02 Jason Merrill <jason@redhat.com>
697
698 * decl.c (grokdeclarator): Improve diagnostic for
699 disallowed CTAD placeholder.
700
701 2020-12-02 Jason Merrill <jason@redhat.com>
702
703 * decl.c (check_initializer): Also look through STMT_EXPR
704 and BIND_EXPR.
705
706 2020-12-02 Nathan Sidwell <nathan@acm.org>
707
708 * cp-tree.h (comparing_typenames): Declare.
709 * pt.c (comparing_typenames): Define.
710 (spec_hasher::equal): Increment it around comparisons.
711 * typeck.c (structural_comptypes): Adjust TYPENAME resolution
712 check.
713
714 2020-12-02 Marek Polacek <polacek@redhat.com>
715
716 PR c++/97975
717 * constexpr.c (fold_non_dependent_init): Add a tree parameter.
718 Use it.
719 * cp-tree.h (fold_non_dependent_init): Add a tree parameter with
720 a default value.
721 * typeck2.c (store_init_value): Call fold_non_dependent_expr
722 only when checking the initializer for constexpr variables.
723 Call fold_non_dependent_init instead of maybe_constant_init.
724
725 2020-12-02 Marek Polacek <polacek@redhat.com>
726
727 PR c++/97187
728 PR c++/97993
729 * pt.c (tsubst_copy_and_build) <case NEW_EXPR>: Return error_mark_node
730 if init is erroneous.
731
732 2020-12-02 Nathan Sidwell <nathan@acm.org>
733
734 * cp-tree.h (DECL_MODULE_PURVIEW_P, DECL_MODULE_IMPORT_P)
735 (DECL_MODULE_ENTITY_P): New.
736 (DECL_MODULE_PENDING_SPECIALIZATIONS_P): New.
737 (DECL_MODULE_PENDING_MEMBERS_P): New.
738 (DECL_MODULE_ATTACHMENTS_P): New.
739 (DECL_MODULE_EXPORT_P): New.
740 (struct lang_decl_base): Shrink sel field. Add new
741 module-specific fields.
742
743 2020-12-02 Nathan Sidwell <nathan@acm.org>
744
745 * cp-tree.h (DECL_TINFO_P): Also for TYPE_DECLs.
746 (get_tinfo_decl_direct): Declare.
747 (get_pseudo_tinfo_index, get_pseudo_tinfo_type): Declare.
748 * rtti.c (get_tinfo_decl_direct): Externalize.
749 (get_tinfo_desc): Set DECL_TINFO_P on the typedef.
750 (get_pseudo_tinfo_index, get_pseudo_tinfo_type): New.
751
752 2020-12-02 Nathan Sidwell <nathan@acm.org>
753
754 * cp-tree.h (maybe_add_lang_decl_raw, maybe_add_lang_type_raw):
755 Declare.
756 * lex.c (maybe_add_lang_decl_raw, maybe_add_lang_type_raw):
757 Externalize, reformat.
758
759 2020-12-02 Nathan Sidwell <nathan@acm.org>
760
761 * cp-tree.h (build_cplus_array_type): Add defaulted DEP parm.
762 * tree.c (set_array_type_common): Add DEP parm.
763 (build_cplus_array_type): Add DEP parm, determine dependency if
764 needed.
765 (cp_build_qualified_type_real): Adjust array-building call.
766 (strip_typedefs): Likewise.
767
768 2020-12-02 Nathan Sidwell <nathan@acm.org>
769
770 * ptree.c (cxx_print_xnode): Increase binding-vector prefix size.
771
772 2020-12-02 Nathan Sidwell <nathan@acm.org>
773
774 * cp-tree.def (BINDING_VECTOR): New.
775 * name-lookup.h (struct binding_slot): New.
776 (BINDING_VECTOR_SLOTS_PER_CLUSTER): New.
777 (struct binding_index, struct binding_cluster): New.
778 (BINDING_VECTOR_ALLOC_CLUSTERS, BINDING_VECTOR_CLUSTER_BASE)
779 (BINDING_VECTOR_CLUSTER): New.
780 (struct tree_binding_vec): New.
781 (BINDING_VECTOR_NAME, BINDING_VECTOR_GLOBAL_DUPS_P)
782 (BINDING_VECTOR_PARTITION_DUPS_P): New.
783 (BINDING_BINDING_GLOBAL_P, BINDING_BINDING_PARTITION_P): New.
784 (BINDING_VECTOR_PENDING_SPECIALIZATIONS)
785 (BINDING_VECTOR_PENDING_IS_HEADER_P)
786 (BINDING_VECTOR_PENDING_IS_PARTITION_P): New.
787 * cp-tree.h (enum cp_tree_node_structure_enum): Add
788 TS_CP_BINDING_VECTOR.
789 (union lang_tree_node): Add binding_vec field.
790 (make_binding_vec): Declare.
791 (named_decl_hash::hash, named_decl_hash::equal): Check for binding
792 vector.
793 * decl.c (cp_tree_node_structure): Add BINDING_VECTOR case.
794 * ptree.c (cxx_print_xnode): Add BINDING_VECTOR case.
795 * tree.c (make_binding_vec): New.
796
797 2020-12-01 Ville Voutilainen <ville.voutilainen@gmail.com>
798
799 PR c++/98054
800 * cxx-pretty-print.c (pp_cxx_trait_expression):
801 Add support for __is_nothrow_{assignable,constructible}.
802
803 2020-12-01 Jakub Jelinek <jakub@redhat.com>
804
805 PR c++/98072
806 * parser.c (cp_parser_omp_depobj): Suppress location wrappers when
807 parsing depend clause.
808
809 2020-12-01 Nathan Sidwell <nathan@acm.org>
810
811 * lex.c (init_reswords): Maybe enable module keywords.
812
813 2020-12-01 Nathan Sidwell <nathan@acm.org>
814
815 * lang-specs.h: Add module-related options.
816
817 2020-12-01 Iain Sandoe <iain@sandoe.co.uk>
818
819 * parser.c (cp_parser_declaration): Add a not about where
820 attributes may be placed.
821
822 2020-11-27 Martin Sebor <msebor@redhat.com>
823
824 * error.c (add_quotes): Revert previous change and use pragma to
825 suppress -Wformat-diag.
826
827 2020-11-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
828
829 * g++spec.c (TIMELIB, TIME_LIBRARY): Remove.
830 (lang_specific_driver): Remove TIME_LIBRARY handling.
831
832 2020-11-26 Thomas Schwinge <thomas@codesourcery.com>
833
834 * parser.c (cp_parser_omp_var_list_no_open): Assert that array
835 section's 'low_bound', 'length' are not location wrapper nodes.
836 (cp_parser_oacc_all_clauses, cp_parser_oacc_cache): Instantiate
837 'auto_suppress_location_wrappers'.
838
839 2020-11-25 Martin Sebor <msebor@redhat.com>
840
841 PR bootstrap/94982
842 * constraint.cc (debug_argument_list): Avoid -Wformat-diag.
843 * error.c (function_category): Same.
844 (print_template_differences): Same.
845 * logic.cc (debug): Same.
846 * name-lookup.c (lookup_using_decl): Same.
847 * parser.c (maybe_add_cast_fixit): Same.
848 (cp_parser_template_introduction): Same.
849 * typeck.c (access_failure_info::add_fixit_hint): Same.
850
851 2020-11-25 Thomas Schwinge <thomas@codesourcery.com>
852
853 * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE__CACHE_'.
854 (tsubst_expr): Handle 'OACC_CACHE'.
855
856 2020-11-24 Jason Merrill <jason@redhat.com>
857
858 PR c++/97899
859 * typeck2.c (store_init_value): Don't split_nonconstant_init in a
860 template.
861
862 2020-11-24 Jakub Jelinek <jakub@redhat.com>
863
864 PR tree-optimization/96929
865 * constexpr.c (cxx_eval_binary_expression): For shifts by constant
866 with MSB set, emulate older wide_int_binop behavior to preserve
867 diagnostics and -fpermissive behavior.
868
869 2020-11-23 Nathan Sidwell <nathan@acm.org>
870
871 * module.cc: New dummy file.
872 * Make-lang.in: Add rules to build module.o
873
874 2020-11-23 Jozef Lawrynowicz <jozef.l@mittosystems.com>
875
876 * decl.c (start_decl): Set DECL_INITIAL for initialized decls
877 before attribute processing.
878
879 2020-11-23 Richard Sandiford <richard.sandiford@arm.com>
880
881 PR c++/97904
882 * pt.c (tsubst): Use verify_type_context to check the type
883 of an array element.
884
885 2020-11-21 Marek Polacek <polacek@redhat.com>
886
887 PR c++/94695
888 * parser.c (warn_for_range_copy): Warn when the loop variable is
889 initialized with a value of a different type resulting in a copy.
890
891 2020-11-21 Marek Polacek <polacek@redhat.com>
892
893 PR c++/97846
894 * constexpr.c (potential_constant_expression_1): Reject
895 LABEL_EXPRs that use non-artifical LABEL_DECLs.
896
897 2020-11-21 Marek Polacek <polacek@redhat.com>
898
899 PR c++/97881
900 * parser.c (warn_about_ambiguous_parse): Only assume "int" if we
901 actually saw any type-specifiers.
902
903 2020-11-21 Marek Polacek <polacek@redhat.com>
904
905 PR c++/97839
906 * parser.c (cp_parser_lambda_declarator_opt): Don't require ().
907
908 2020-11-21 Marek Polacek <polacek@redhat.com>
909
910 PR c++/97427
911 * constexpr.c (cxx_set_object_constness): New function.
912 (cxx_eval_call_expression): Set new_obj for destructors too.
913 Call cxx_set_object_constness to set/unset TREE_READONLY of
914 the object under construction/destruction.
915
916 2020-11-21 Aaron Sawdey <acsawdey@linux.ibm.com>
917
918 * error.c (dump_type): Handle opaque types.
919 (dump_type_prefix): Handle opaque types.
920 (dump_type_suffix): Handle opaque types.
921 (dump_expr): Handle opaque types.
922 * pt.c (tsubst): Allow opaque types in templates.
923 (unify): Allow opaque types in templates.
924 * typeck.c (structural_comptypes): Handle comparison
925 of opaque types.
926
927 2020-11-20 Jakub Jelinek <jakub@redhat.com>
928
929 PR other/97911
930 * Make-lang.in (c++.serial): Change from goal to a variable.
931 (.PHONY): Drop c++.serial and c++.prev.
932 (cc1plus$(exeext)): Depend on $(c++.serial) rather than c++.serial.
933
934 2020-11-19 Nathan Sidwell <nathan@acm.org>
935
936 * cp-tree.h (struct spec_entry): Moved from pt.c.
937 (walk_specializations, match_mergeable_specialization)
938 (get_mergeable_specialization_flags)
939 (add_mergeable_specialization): Declare.
940 * pt.c (struct spec_entry): Moved to cp-tree.h.
941 (walk_specializations, match_mergeable_specialization)
942 (get_mergeable_specialization_flags)
943 (add_mergeable_specialization): New.
944
945 2020-11-19 Nathan Sidwell <nathan@acm.org>
946
947 * cp-tree.h (struct constexpr_fundef): Moved from constexpr.c.
948 (maybe_save_constexpr_fundef): Declare.
949 (register_constexpr_fundef): Take constexpr_fundef object, return
950 void.
951 * decl.c (mabe_save_function_definition): Delete, functionality
952 moved to maybe_save_constexpr_fundef.
953 (emit_coro_helper, finish_function): Adjust.
954 * constexpr.c (struct constexpr_fundef): Moved to cp-tree.h.
955 (constexpr_fundef_hasher::equal): Constify.
956 (constexpr_fundef_hasher::hash): Constify.
957 (retrieve_constexpr_fundef): Make non-static.
958 (maybe_save_constexpr_fundef): Break out checking and duplication
959 from ...
960 (register_constexpr_fundef): ... here. Just register the constexpr.
961
962 2020-11-19 Marek Polacek <polacek@redhat.com>
963
964 PR c++/97523
965 * init.c (build_new): When value-initializing an array new,
966 leave the INIT as an empty vector.
967
968 2020-11-19 Marek Polacek <polacek@redhat.com>
969
970 PR c++/97895
971 * pt.c (do_auto_deduction): Don't crash when the constructor has
972 zero elements.
973
974 2020-11-19 Nathan Sidwell <nathan@acm.org>
975
976 PR c++/97905
977 * decl.c (duplicate_decls): Relax new assert.
978
979 2020-11-18 Iain Sandoe <iain@sandoe.co.uk>
980
981 * parser.c (cp_parser_objc_valid_prefix_attributes): Check
982 for empty attributes.
983
984 2020-11-18 Jakub Jelinek <jakub@redhat.com>
985
986 * Make-lang.in (c++.serial): New goal.
987 (.PHONY): Add c++.serial c++.prev.
988 (cc1plus$(exeext)): Depend on c++.prev. Call LINK_PROGRESS.
989
990 2020-11-17 Nathan Sidwell <nathan@acm.org>
991
992 PR c++/97877
993 * decl.c (duplicate_decls): Deal with duplicated DECL_LOCAL_DECL_P
994 decls. Extend decl_lang_specific checking assert.
995
996 2020-11-17 Nathan Sidwell <nathan@acm.org>
997
998 * cp-tree.h (enum cp_tree_index): Reorder to place lazy fields
999 after newly-added CPTI_MODULE_HWM.
1000
1001 2020-11-17 Iain Sandoe <iain@sandoe.co.uk>
1002
1003 PR c++/97871
1004 * parser.c (cp_parser_declaration): Remove checking assert.
1005
1006 2020-11-15 Jason Merrill <jason@redhat.com>
1007
1008 * decl.c (cp_finish_decl): Only check abstractness on definition.
1009 (require_complete_types_for_parms): Check abstractness here.
1010 (create_array_type_for_decl): Not here.
1011 (grokdeclarator, grokparms, complete_vars): Not here.
1012 * pt.c (tsubst, tsubst_arg_types, tsubst_function_type): Not here.
1013 * typeck2.c (struct pending_abstract_type): Remove.
1014 (struct abstract_type_hasher): Remove.
1015 (abstract_pending_vars, complete_type_check_abstract): Remove.
1016 (abstract_virtuals_error_sfinae): Handle arrays.
1017 * call.c (conv_is_prvalue): Split out from...
1018 (conv_binds_ref_to_prvalue): ...here.
1019 (implicit_conversion_1): Rename from implicit_conversion.
1020 (implicit_conversion): An abstract prvalue is bad.
1021 (convert_like_internal): Don't complain if expr is already
1022 error_mark_node.
1023
1024 2020-11-13 Jason Merrill <jason@redhat.com>
1025
1026 * cp-tree.h (USING_DECL_UNRELATED_P): New.
1027 (CONST_DECL_USING_P): New.
1028 * class.c (handle_using_decl): If USING_DECL_UNRELATED_P,
1029 clone the CONST_DECL.
1030 * name-lookup.c (supplement_binding_1): A clone hides its
1031 using-declaration.
1032 (lookup_using_decl): Rewrite to separate lookup and validation.
1033 (do_class_using_decl): Adjust.
1034 (finish_nonmember_using_decl): Adjust.
1035 * parser.c (make_location): Add cp_token overload.
1036 (finish_using_decl): Split out from...
1037 (cp_parser_using_declaration): ...here. Don't look through enums.
1038 (cp_parser_using_enum): New.
1039 (cp_parser_block_declaration): Call it.
1040 (cp_parser_member_declaration): Call it.
1041 * semantics.c (finish_id_expression_1): Handle enumerator
1042 used from class scope.
1043
1044 2020-11-13 Vladimir N. Makarov <vmakarov@redhat.com>
1045
1046 * parser.c (cp_parser_asm_definition): Parse outputs for asm
1047 goto too.
1048
1049 2020-11-13 Iain Sandoe <iain@sandoe.co.uk>
1050
1051 PR objc/77404
1052 * parser.c (cp_parser_objc_class_interface): Pass the
1053 location of the class name to the interface declaration.
1054
1055 2020-11-13 Patrick Palka <ppalka@redhat.com>
1056
1057 * semantics.c (finish_compound_literal): Don't wrap the original
1058 compound literal in a TARGET_EXPR when inside a template.
1059
1060 2020-11-12 Jakub Jelinek <jakub@redhat.com>
1061
1062 PR c++/97790
1063 * constexpr.c (cxx_eval_constant_expression) <case CLEANUP_POINT_EXPR,
1064 case TRY_FINALLY_EXPR, case CLEANUP_STMT>: Don't pass jump_target to
1065 cxx_eval_constant_expression when evaluating the cleanups.
1066
1067 2020-11-11 Iain Sandoe <iain@sandoe.co.uk>
1068
1069 * parser.c (cp_parser_declaration): Unless we are compiling for
1070 Ojective-C++, warn about and discard any attributes that prefix
1071 a linkage specification.
1072
1073 2020-11-11 Patrick Palka <ppalka@redhat.com>
1074
1075 PR c++/88115
1076 * mangle.c (write_expression): Mangle __alignof_ differently
1077 from alignof when the ABI version is at least 15.
1078
1079 2020-11-11 Patrick Palka <ppalka@redhat.com>
1080
1081 PR c++/88115
1082 * cp-tree.h (cxx_sizeof_or_alignof_expr): Add bool parameter.
1083 * decl.c (fold_sizeof_expr): Pass false to
1084 cxx_sizeof_or_alignof_expr.
1085 * parser.c (cp_parser_unary_expression): Pass std_alignof to
1086 cxx_sizeof_or_alignof_expr.
1087 * pt.c (tsubst_copy): Pass false to cxx_sizeof_or_alignof_expr.
1088 (tsubst_copy_and_build): Pass std_alignof to
1089 cxx_sizeof_or_alignof_expr.
1090 * typeck.c (cxx_alignof_expr): Add std_alignof bool parameter
1091 and pass it to cxx_sizeof_or_alignof_type. Set ALIGNOF_EXPR_STD_P
1092 appropriately.
1093 (cxx_sizeof_or_alignof_expr): Add std_alignof bool parameter
1094 and pass it to cxx_alignof_expr. Assert op is either
1095 SIZEOF_EXPR or ALIGNOF_EXPR.
1096
1097 2020-11-11 Marek Polacek <polacek@redhat.com>
1098
1099 PR c++/97518
1100 * pt.c (tsubst_qualified_id): Use EXPR_LOCATION of the qualified-id.
1101 Use it to maybe_wrap_with_location the final expression.
1102
1103 2020-11-10 Marek Polacek <polacek@redhat.com>
1104
1105 PR c++/97518
1106 * cp-tree.h (finish_static_assert): Adjust declaration.
1107 * parser.c (cp_parser_static_assert): Pass false to
1108 finish_static_assert.
1109 * pt.c (tsubst_expr): Pass true to finish_static_assert.
1110 * semantics.c (find_failing_clause_r): New function.
1111 (find_failing_clause): New function.
1112 (finish_static_assert): Add a bool parameter. Use
1113 iloc_sentinel. Call contextual_conv_bool instead of
1114 perform_implicit_conversion_flags. Don't check for INTEGER_CST before
1115 calling integer_zerop. Call find_failing_clause and maybe use its
1116 location. Print the original condition or the failing clause if
1117 SHOW_EXPR_P.
1118
1119 2020-11-10 Strager Neds <strager.nds@gmail.com>
1120
1121 * decl.c (duplicate_decls): Use new overload of
1122 set_decl_section_name.
1123 * method.c (use_thunk): Same.
1124 * optimize.c (maybe_clone_body): Same.
1125 * coroutines.cc (act_des_fn): Same.
1126
1127 2020-11-10 Jakub Jelinek <jakub@redhat.com>
1128
1129 PR c/97748
1130 * cvt.c (convert_to_void): Check (complain & tf_warning) in the outer
1131 if rather than twice times in the inner one. Use warn_if_unused_value.
1132 Formatting fix.
1133
1134 2020-11-10 Chung-Lin Tang <cltang@codesourcery.com>
1135
1136 * parser.c (cp_parser_omp_target_data): Add use of
1137 new c_omp_adjust_map_clauses function. Add GOMP_MAP_ATTACH_DETACH as
1138 handled map clause kind.
1139 (cp_parser_omp_target_enter_data): Likewise.
1140 (cp_parser_omp_target_exit_data): Likewise.
1141 (cp_parser_omp_target): Likewise.
1142 * semantics.c (handle_omp_array_sections): Adjust COMPONENT_REF case to
1143 use GOMP_MAP_ATTACH_DETACH map kind for C_ORT_OMP region type. Fix
1144 interaction between reference case and attach/detach.
1145 (finish_omp_clauses): Adjust bitmap checks to allow struct decl and
1146 same struct field access to co-exist on OpenMP construct.
1147
1148 2020-11-09 Marek Polacek <polacek@redhat.com>
1149
1150 DR 1914
1151 * parser.c (cp_parser_check_std_attribute): Return bool. Add a
1152 location_t parameter. Return true if the attribute wasn't duplicated.
1153 Give a warning instead of an error. Check more attributes.
1154 (cp_parser_std_attribute_list): Don't add duplicated attributes to
1155 the list. Pass location to cp_parser_check_std_attribute.
1156
1157 2020-11-09 Patrick Palka <ppalka@redhat.com>
1158
1159 * constraint.cc (norm_info::norm_info): Initialize orig_decl.
1160 (norm_info::orig_decl): New data member.
1161 (normalize_atom): When caching an atom for the first time,
1162 compute a list of template parameters used in the targets of the
1163 parameter mapping and store it in the TREE_TYPE of the mapping.
1164 (get_normalized_constraints_from_decl): Set current_function_decl
1165 appropriately when normalizing. As an optimization, don't
1166 set up a push_nested_class_guard when decl has no constraints.
1167 (sat_hasher::hash): Use this list to hash only the template
1168 arguments that are relevant to the atom.
1169 (satisfy_atom): Use this list to compare only the template
1170 arguments that are relevant to the atom.
1171 * pt.c (keep_template_parm): Do a sanity check on the parameter's
1172 index when flag_checking.
1173
1174 2020-11-09 Patrick Palka <ppalka@redhat.com>
1175
1176 * cp-tree.h (ATOMIC_CONSTR_MAP_INSTANTIATED_P): Define this flag
1177 for ATOMIC_CONSTRs.
1178 * constraint.cc (sat_hasher::hash): Use hash_atomic_constraint
1179 if the flag is set, otherwise keep using a pointer hash.
1180 (sat_hasher::equal): Return false if the flag's setting differs
1181 on two atoms. Call atomic_constraints_identical_p if the flag
1182 is set, otherwise keep using a pointer equality test.
1183 (satisfy_atom): After instantiating the parameter mapping, form
1184 another ATOMIC_CONSTR using the instantiated mapping and query
1185 the cache again. Cache the satisfaction value of both atoms.
1186 (diagnose_atomic_constraint): Simplify now that the supplied
1187 atom has an instantiated mapping.
1188
1189 2020-11-09 Patrick Palka <ppalka@redhat.com>
1190
1191 * constraint.cc (atom_cache): Define this deletable hash_table.
1192 (normalize_atom): Use it to cache ATOMIC_CONSTRs when not
1193 generating diagnostics.
1194 (sat_hasher::hash): Use htab_hash_pointer instead of
1195 hash_atomic_constraint.
1196 (sat_hasher::equal): Test for pointer equality instead of
1197 atomic_constraints_identical_p.
1198 * cp-tree.h (struct atom_hasher): Moved and renamed from ...
1199 * logic.cc (struct constraint_hash): ... here.
1200 (clause::m_set): Adjust accordingly.
1201
1202 2020-11-09 Patrick Palka <ppalka@redhat.com>
1203
1204 PR c++/93907
1205 * constraint.cc (tsubst_parameter_mapping): Also canonicalize
1206 the type arguments of a TYPE_ARGUMENT_PACk.
1207
1208 2020-11-09 Jason Merrill <jason@redhat.com>
1209
1210 * pt.c (tsubst): Replace *_ARGUMENT_PACK code with
1211 a call to tsubst_argument_pack.
1212
1213 2020-11-09 Jason Merrill <jason@redhat.com>
1214
1215 * class.c (handle_using_decl): Add an iloc_sentinel.
1216
1217 2020-11-09 Marek Polacek <polacek@redhat.com>
1218
1219 PR c++/97762
1220 * parser.c (warn_about_ambiguous_parse): Handle the case when
1221 there is no type in the decl-specifiers.
1222
1223 2020-11-09 Nathan Sidwell <nathan@acm.org>
1224
1225 * cp-tree.h (LOOKUP_FOUND_P): Add ENUMERAL_TYPE.
1226 * name-lookup.c (class name_lookup): Add comments.
1227 (name_lookup::adl_namespace_only): Replace with ...
1228 (name_lookup::adl_class_fns): ... this and ...
1229 (name_lookup::adl_namespace_fns): ... this.
1230 (name_lookup::adl_namespace): Deal with inline nests here.
1231 (name_lookup::adl_class): Complete the type here.
1232 (name_lookup::adl_type): Call broken-out enum ..
1233 (name_lookup::adl_enum): New. No need to call the namespace adl
1234 if it is class-scope.
1235 (name_lookup::search_adl): Iterate over collected scopes here.
1236
1237 2020-11-09 Nathan Sidwell <nathan@acm.org>
1238
1239 * name-lookup.c (lookup_qualified_name): Expose an overload of a
1240 singleton with known type.
1241 (lookup_name_1): Just check the overload's type to expose it.
1242 * parser.c (cp_parser_lookup_name): Do not do that check here.
1243
1244 2020-11-08 Iain Sandoe <iain@sandoe.co.uk>
1245
1246 * parser.c (cp_parser_objc_at_property_declaration): Handle
1247 class keywords in @property attribute context.
1248
1249 2020-11-06 Marek Polacek <polacek@redhat.com>
1250
1251 PR c++/81660
1252 * except.c (can_convert_eh): Change the return type to bool. If
1253 the type TO and FROM are the same, return true.
1254
1255 2020-11-06 Iain Sandoe <iain@sandoe.co.uk>
1256
1257 * parser.c (cp_parser_objc_at_property_declaration):
1258 Improve parsing fidelity. Associate better location info
1259 with @property attributes. Clean up the interface to
1260 objc_add_property_declaration ().
1261
1262 2020-11-06 Jakub Jelinek <jakub@redhat.com>
1263
1264 PR c++/67453
1265 * decl.c (duplicate_decls): Propagate DECL_ATTRIBUTES and
1266 DECL_PRESERVE_P from olddecl to its clones if any.
1267
1268 2020-11-06 Nathan Sidwell <nathan@acm.org>
1269
1270 * cp-tree.h (DECL_UNDECLARED_BUILTIN_P): Delete.
1271 * cp-objcp-common.c (names_bultin_p): Rename
1272 DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
1273 * decl.c (decls_match): Likewise. Replace
1274 DECL_UNDECLARED_BUILTIN_P with DECL_IS_UNDECLARED_BUILTIN.
1275 (duplicate_decls): Likewise.
1276 * decl2.c (collect_source_refs): Likewise.
1277 * name-lookup.c (anticipated_builtin_p, print_binding_level)
1278 (do_nonmember_using_decl): Likewise.
1279 * pt.c (builtin_pack_fn_p): Likewise.
1280 * typeck.c (error_args_num): Likewise.
1281
1282 2020-11-06 Nathan Sidwell <nathan@acm.org>
1283
1284 * parser.c (cp_parser_template_declaration): Adjust 'export' warning.
1285 (cp_parser_explicit_specialization): Remove unneeded bool setting.
1286
1287 2020-11-06 Jan Hubicka <jh@suse.cz>
1288
1289 * tree.c (cp_fix_function_decl_p): Do not access ipa_ref_list dirrectly.
1290
1291 2020-11-06 Tobias Burnus <tobias@codesourcery.com>
1292
1293 * parser.c (cp_parser_omp_atomic): Add openacc parameter and update
1294 OpenACC matching.
1295 (cp_parser_omp_construct): Update call.
1296
1297 2020-11-05 Marek Polacek <polacek@redhat.com>
1298
1299 * except.c (check_handlers_1): Add auto_diagnostic_group.
1300
1301 2020-11-05 Marek Polacek <polacek@redhat.com>
1302
1303 PR c++/78209
1304 * pt.c (do_auto_deduction): If init is REFERENCE_REF_P, use its
1305 first operand.
1306
1307 2020-11-05 Marek Polacek <polacek@redhat.com>
1308
1309 PR c++/97675
1310 * except.c (check_handlers_1): Use OPT_Wexceptions for the
1311 warning. Use inform for the second part of the warning.
1312
1313 2020-11-05 Marek Polacek <polacek@redhat.com>
1314
1315 PR c++/25814
1316 * cp-tree.h (enum cp_tree_index): Add CPTI_EXPLICIT_VOID_LIST.
1317 (explicit_void_list_node): Define.
1318 (PARENTHESIZED_LIST_P): New macro.
1319 (struct cp_declarator): Add function::parens_loc.
1320 * decl.c (cxx_init_decl_processing): Initialize explicit_void_list_node.
1321 (grokparms): Also break when explicit_void_list_node.
1322 * parser.c (make_call_declarator): New location_t parameter. Use it
1323 to set declarator->u.function.parens_loc.
1324 (cp_parser_lambda_declarator_opt): Pass UNKNOWN_LOCATION to
1325 make_call_declarator.
1326 (warn_about_ambiguous_parse): New function.
1327 (cp_parser_init_declarator): Call warn_about_ambiguous_parse.
1328 (cp_parser_declarator): Set *parenthesized_p to false rather than to
1329 true.
1330 (cp_parser_direct_declarator): Create a location for the function's
1331 parentheses and pass it to make_call_declarator.
1332 (cp_parser_parameter_declaration_clause): Return explicit_void_list_node
1333 for (void).
1334 (cp_parser_parameter_declaration_list): Set PARENTHESIZED_LIST_P
1335 in the parameters tree.
1336
1337 2020-11-04 Jakub Jelinek <jakub@redhat.com>
1338
1339 PR c++/97670
1340 * semantics.c (finish_omp_clauses): Look through array reductions to
1341 find underlying decl to clear in the aligned_head bitmap. Use
1342 DECL_UID (t) instead of DECL_UID (OMP_CLAUSE_DECL (c)) when clearing
1343 in the bitmap. Only diagnose errors about allocate vars not being
1344 privatized on the same construct on allocate clause if it has
1345 a DECL_P OMP_CLAUSE_DECL.
1346
1347 2020-11-04 Iain Sandoe <iain@sandoe.co.uk>
1348
1349 * constexpr.c (potential_constant_expression_1): Handle
1350 expressions known to be non-constant for Objective-C.
1351
1352 2020-11-03 Jason Merrill <jason@redhat.com>
1353
1354 * tree.c (is_byte_access_type): Don't use char_type_p.
1355
1356 2020-11-03 Jakub Jelinek <jakub@redhat.com>
1357
1358 PR c++/97663
1359 * parser.c (cp_parser_init_declarator): Don't try to parse
1360 C++17 deduction guides if there are any type specifiers even when
1361 type is NULL.
1362
1363 2020-11-03 Kamlesh Kumar <kamleshbhalui@gmail.com>
1364 Jason Merrill <jason@redhat.com>
1365
1366 PR c++/97453
1367 DR2303
1368 * pt.c (get_template_base): Consider closest base in template
1369 deduction when base of base also matches.
1370
1371 2020-11-03 Nathan Sidwell <nathan@acm.org>
1372
1373 * pt.c (tsubst_expr): Simplify using decl instantiation, add
1374 asserts.
1375
1376 2020-11-03 Nathan Sidwell <nathan@acm.org>
1377
1378 * class.c (copy_fndecl_with_name): Always not top level.
1379 (build_cdtor_clones): Add update_methods parm, use it to
1380 conditionally update the method vec. Return void
1381 (clone_cdtor): Adjust.
1382 (clone_constructors_and_destructors): Adjust comment.
1383
1384 2020-11-03 Nathan Sidwell <nathan@acm.org>
1385
1386 * pt.c (primary_template_specialization_p): Use
1387 VAR_OR_FUNCTION_DECL_P.
1388 (tsubst_template_decl): Check for FUNCTION_DECL, not !TYPE && !VAR
1389 for registering a specialization.
1390
1391 2020-11-03 Nathan Sidwell <nathan@acm.org>
1392
1393 * cp-tree.h (fixup_deferred_exception_variants): Declare.
1394 * parser.c (cp_parser_class_specifier_1): Call it when
1395 completing deferred parses rather than creating a variant.
1396 (cp_parser_member_declaration): Move comment from ...
1397 (cp_parser_noexcept_specification_opt): ... here. Refactor the
1398 deferred parse.
1399 * tree.c (fixup_deferred_exception_variants): New.
1400
1401 2020-11-03 Nathan Sidwell <nathan@acm.org>
1402
1403 * pt.c (tsubst_lambda_expr): Reorder extra-scope handling to match
1404 the non-template case.
1405 (instantiate_body): Move a couple of declarations to their
1406 initializers.
1407
1408 2020-11-03 Nathan Sidwell <nathan@acm.org>
1409
1410 * decl.c (duplicate_decls): Return error_mark_node fo extern-c
1411 mismatch.
1412
1413 2020-11-03 Marek Polacek <polacek@redhat.com>
1414
1415 * constexpr.c (potential_constant_expression_1): Treat
1416 __PRETTY_FUNCTION__ inside a template function as
1417 potentially-constant.
1418 * pt.c (uses_template_parms): Call
1419 instantiation_dependent_expression_p instead of
1420 value_dependent_expression_p.
1421 (instantiation_dependent_expression_p): Check
1422 potential_constant_expression before calling
1423 value_dependent_expression_p.
1424
1425 2020-11-03 Marek Polacek <polacek@redhat.com>
1426
1427 PR c++/97632
1428 * init.c (build_new_1): Disable -Winit-list-lifetime for an unevaluated
1429 operand.
1430
1431 2020-11-03 Nathan Sidwell <nathan@acm.org>
1432
1433 * tree.c (bind_template_template_parm): Mark the parm as a
1434 template parm.
1435 (cp_tree_equal): Refactor CALL_EXPR. Use comp_template_args for
1436 TREE_VECs.
1437
1438 2020-11-03 Nathan Sidwell <nathan@acm.org>
1439
1440 * rtti.c (init_rtti_processing): Move var decl to its init.
1441 (get_tinfo_decl): Likewise. Break out creation to called helper
1442 ...
1443 (get_tinfo_decl_direct): ... here.
1444 (build_dynamic_cast_1): Move var decls to their initializers.
1445 (tinfo_base_init): Set decl's location to BUILTINS_LOCATION.
1446 (get_tinfo_desc): Only push ABI namespace when needed. Set type's
1447 context.
1448
1449 2020-11-02 Nathan Sidwell <nathan@acm.org>
1450
1451 * decl.c (start_decl_1): Refactor declarations. Fixup some
1452 whitespace.
1453 (lookup_and_check_tag): Fixup some whitespace.
1454
1455 2020-11-02 Nathan Sidwell <nathan@acm.org>
1456
1457 * decl.c (duplicate_decls): Refactor some template & builtin
1458 handling.
1459
1460 2020-11-02 Nathan Sidwell <nathan@acm.org>
1461
1462 * cp-tree.h (struct cxx_int_tree_map): Delete.
1463 (struct cxx_int_tree_map_hasher): Delete.
1464 * cp-gimplify.c (cxx_int_tree_map_hasher::equal): Delete.
1465 (cxx_int_tree_map_hasher::hash): Delete.
1466
1467 2020-11-02 Patrick Palka <ppalka@redhat.com>
1468
1469 * class.c (finish_struct_1): Don't call clear_satisfaction_cache.
1470 * constexpr.c (clear_cv_and_fold_caches): Likewise. Remove bool
1471 parameter.
1472 * constraint.cc (clear_satisfaction_cache): Remove definition.
1473 * cp-tree.h (clear_satisfaction_cache): Remove declaration.
1474 (clear_cv_and_fold_caches): Remove bool parameter.
1475 * typeck2.c (store_init_value): Remove argument to
1476 clear_cv_and_fold_caches.
1477
1478 2020-11-01 Iain Sandoe <iain@sandoe.co.uk>
1479
1480 * parser.c (cp_parser_objc_at_property_declaration): Use any
1481 exisiting syntax error to suppress complaints about a missing
1482 closing parenthesis in parsing property attributes.
1483
1484 2020-10-30 Jakub Jelinek <jakub@redhat.com>
1485
1486 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_ALLOCATE>: Handle
1487 non-static members in methods.
1488 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_ALLOCATE.
1489
1490 2020-10-29 Marek Polacek <polacek@redhat.com>
1491
1492 DR 625
1493 PR c++/97479
1494 * parser.c (cp_parser_type_id_1): Reject using auto as
1495 a template-argument in C++20.
1496
1497 2020-10-29 Marek Polacek <polacek@redhat.com>
1498
1499 PR c++/93107
1500 * pt.c (do_auto_deduction): Call resolve_nondeduced_context for
1501 the elements of a { } list.
1502
1503 2020-10-29 Marek Polacek <polacek@redhat.com>
1504
1505 * typeck.c (do_warn_enum_conversions): Don't warn for SPACESHIP_EXPR.
1506 (cp_build_binary_op): Reject float <=> enum or enum <=> float. Use
1507 CP_INTEGRAL_TYPE_P instead of INTEGRAL_OR_ENUMERATION_TYPE_P.
1508
1509 2020-10-29 Patrick Palka <ppalka@redhat.com>
1510
1511 * constraint.cc (get_normalized_constraints): Remove 'args'
1512 parameter. Pass NULL_TREE as the initial template arguments to
1513 normalize_expression.
1514 (get_normalized_constraints_from_info): Remove 'args' parameter
1515 and adjust the call to get_normalized_constraints.
1516 (get_normalized_constraints_from_decl): Remove 'args' local
1517 variable and adjust call to get_normalized_constraints_from_info.
1518 (normalize_concept_definition): Remove 'args' local variable
1519 and adjust call to get_normalized_constraints.
1520 (normalize_constraint_expression): Remove the two-parameter
1521 overload. Remove 'args' parameter from the three-parameter
1522 overload and update function comment accordingly. Remove
1523 default argument from 'diag' parameter. Adjust call to
1524 get_normalized_constraints.
1525 (finish_nested_requirement): Adjust call to
1526 normalize_constraint_expression.
1527 (strictly_subsumes): Remove 'args' parameter. Adjust call to
1528 get_normalized_constraints_from_info.
1529 (weakly_subsumes): Likewise.
1530 * cp-tree.h (strictly_subsumes): Remove 'args' parameter.
1531 (weakly_subsumes): Likewise.
1532 * pt.c (process_partial_specialization): Adjust call to
1533 strictly_subsumes.
1534 (is_compatible_template_arg): Adjust call to weakly_subsumes.
1535
1536 2020-10-29 Patrick Palka <ppalka@redhat.com>
1537
1538 PR c++/97412
1539 * constraint.cc (normalize_concept_check): Don't call
1540 tsubst_template_args when 'args' is NULL.
1541
1542 2020-10-29 Jason Merrill <jason@redhat.com>
1543
1544 PR c++/97388
1545 * constexpr.c (cxx_eval_outermost_constant_expr): Revert to
1546 original expression if evaluation sets non_constant_p.
1547
1548 2020-10-29 Jakub Jelinek <jakub@redhat.com>
1549 Jason Merrill <jason@redhat.com>
1550
1551 PR c++/97388
1552 * constexpr.c (cxx_bind_parameters_in_call): Set non_constant_args
1553 if the parameter type has a non-trivial destructor.
1554 (cxx_eval_call_expression): Only unshare arguments if we're
1555 memoizing this evaluation.
1556
1557 2020-10-29 Jakub Jelinek <jakub@redhat.com>
1558
1559 PR c++/95808
1560 * cp-tree.h (enum cp_tree_index): Add CPTI_HEAP_VEC_UNINIT_IDENTIFIER
1561 and CPTI_HEAP_VEC_IDENTIFIER.
1562 (heap_vec_uninit_identifier, heap_vec_identifier): Define.
1563 * decl.c (initialize_predefined_identifiers): Initialize those
1564 identifiers.
1565 * constexpr.c (cxx_eval_call_expression): Reject array allocations
1566 deallocated with non-array deallocation or non-array allocations
1567 deallocated with array deallocation.
1568 (non_const_var_error): Handle heap_vec_uninit_identifier and
1569 heap_vec_identifier too.
1570 (cxx_eval_constant_expression): Handle also heap_vec_uninit_identifier
1571 and in that case during initialization replace it with
1572 heap_vec_identifier.
1573 (find_heap_var_refs): Handle heap_vec_uninit_identifier and
1574 heap_vec_identifier too.
1575
1576 2020-10-29 Nathan Sidwell <nathan@acm.org>
1577
1578 * pt.c (push_template_decl): Do not give function-scope entities
1579 other than implicit typedefs a template header. Do not readd
1580 template info to a redeclared template.
1581
1582 2020-10-28 Marek Polacek <polacek@redhat.com>
1583
1584 * decl.c (grokdeclarator): Offer a fix-it hint for the "unnecessary
1585 parentheses in declaration" warning.
1586 * parser.c (cp_parser_direct_declarator): When setting
1587 declarator->parenthesized, use a location range.
1588
1589 2020-10-28 Marek Polacek <polacek@redhat.com>
1590
1591 PR c++/97573
1592 * call.c (build_conditional_expr_1): Warn about the deprecated
1593 enum/real type conversion in C++20. Also warn about a non-enumerated
1594 and enumerated type in ?: when -Wenum-conversion is on.
1595 * typeck.c (do_warn_enum_conversions): New function.
1596 (cp_build_binary_op): Call it.
1597
1598 2020-10-28 Marek Polacek <polacek@redhat.com>
1599
1600 PR c++/96675
1601 PR c++/96742
1602 * pt.c (tsubst_copy_and_build): Call value_dependent_expression_p or
1603 type_dependent_expression_p instead of type_dependent_expression_p_push.
1604 But only call value_dependent_expression_p for expressions that are
1605 potential_constant_expression.
1606
1607 2020-10-28 Marek Polacek <polacek@redhat.com>
1608
1609 PR c++/94799
1610 * parser.c (cp_parser_class_name): Use parser->scope when
1611 setting typename_p.
1612
1613 2020-10-28 Marek Polacek <polacek@redhat.com>
1614
1615 PR c++/86773
1616 * parser.c (cp_parser_fold_expression): Return error_mark_node
1617 if a left fold is preceded by an expression.
1618
1619 2020-10-28 Nathan Sidwell <nathan@acm.org>
1620
1621 * parser.c (cp_parser_omp_declare_reduction): Set
1622 DECL_LOCAL_DECL_P before push_template_decl.
1623 * pt.c (instantiate_body): Nested fns do not have template_info.
1624
1625 2020-10-28 Patrick Palka <ppalka@redhat.com>
1626
1627 PR c++/95132
1628 * decl2.c (mark_used): Move up the constraints_satisfied_p check
1629 so that we check constraints before calling maybe_instantiate_decl.
1630
1631 2020-10-28 Nathan Sidwell <nathan@acm.org>
1632
1633 * pt.c (push_template_decl): Refactor for some RAII.
1634
1635 2020-10-28 Jakub Jelinek <jakub@redhat.com>
1636
1637 * parser.c (cp_parser_omp_clause_name): Handle allocate.
1638 (cp_parser_omp_clause_allocate): New function.
1639 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ALLOCATE.
1640 (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
1641 OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK,
1642 OMP_TASK_CLAUSE_MASK, OMP_TASKGROUP_CLAUSE_MASK,
1643 OMP_DISTRIBUTE_CLAUSE_MASK, OMP_TEAMS_CLAUSE_MASK,
1644 OMP_TARGET_CLAUSE_MASK, OMP_TASKLOOP_CLAUSE_MASK): Add
1645 PRAGMA_OMP_CLAUSE_ALLOCATE.
1646 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_ALLOCATE.
1647 * pt.c (tsubst_omp_clauses): Likewise.
1648
1649 2020-10-27 Nathan Sidwell <nathan@acm.org>
1650
1651 * cp-tree.h (struct lang_type): Delete nested_udts field.
1652 (CLASSTYPE_NESTED_UTDS): Delete.
1653 * name-lookup.h (binding_table, binding_entry): Delete typedefs.
1654 (bt_foreach_proc): Likewise.
1655 (struct binding_entry_s): Delete.
1656 (SCOPE_DEFAULT_HT_SIZE, CLASS_SCOPE_HT_SIZE)
1657 (NAMESPACE_ORDINARY_HT_SIZE, NAMESPACE_STD_HT_SIZE)
1658 (GLOBAL_SCOPE_HT_SIZE): Delete.
1659 (binding_table_foreach, binding_table_find): Delete declarations.
1660 * name-lookup.c (ENTRY_INDEX): Delete.
1661 (free_binding_entry): Delete.
1662 (binding_entry_make, binding_entry_free): Delete.
1663 (struct binding_table_s): Delete.
1664 (binding_table_construct, binding_table_free): Delete.
1665 (binding_table_new, binding_table_expand): Delete.
1666 (binding_table_insert, binding_table_find): Delete.
1667 (binding_table_foreach): Delete.
1668 (maybe_process_template_type_declaration): Delete
1669 CLASSTYPE_NESTED_UTDS insertion.
1670 (do_pushtag): Likewise.
1671 * decl2.c (bt_reset_linkage_1): Fold into reset_type_linkage_1.
1672 (reset_type_linkage_2, bt_reset_linkage_2): Fold into
1673 reset_type_linkage.
1674 * pt.c (instantiate_class_template_1): Delete NESTED_UTDs comment.
1675 (bt_instantiate_type_proc): Delete.
1676 (do_type_instantiation): Instantiate implicit typedef fields.
1677 Delete NESTED_UTD walk.
1678 * search.c (lookup_field_r): Delete unreachable NESTED_UTD
1679 search.
1680
1681 2020-10-27 Nathan Sidwell <nathan@acm.org>
1682
1683 * parser.c (cp_parser_explicit_instantiation): Refactor some RAII.
1684 * pt.c (bt_instantiate_type_proc): DATA is the tree, pass type to
1685 do_type_instantiation.
1686 (do_type_instantiation): Require T to be a type. Refactor for
1687 some RAII.
1688
1689 2020-10-26 Ville Voutilainen <ville.voutilainen@gmail.com>
1690
1691 * cp-tree.h (CPTK_IS_NOTHROW_ASSIGNABLE): New.
1692 (CPTK_IS_NOTHROW_CONSTRUCTIBLE): Likewise.
1693 (is_nothrow_xible): Likewise.
1694 * method.c (is_nothrow_xible): New.
1695 (is_trivially_xible): Tweak.
1696 * parser.c (cp_parser_primary_expression): Handle the new RID_*.
1697 (cp_parser_trait_expr): Likewise.
1698 * semantics.c (trait_expr_value): Handle the new RID_*.
1699 (finish_trait_expr): Likewise.
1700
1701 2020-10-24 Marek Polacek <polacek@redhat.com>
1702
1703 PR c++/96241
1704 * constexpr.c (cxx_eval_array_reference): Set up ctx->ctor if we
1705 are initializing an aggregate. Call free_constructor on the new
1706 CONSTRUCTOR if it isn't returned from cxx_eval_constant_expression.
1707
1708 2020-10-23 Marek Polacek <polacek@redhat.com>
1709
1710 PR c++/91741
1711 * typeck.c (cp_build_binary_op): Implement -Wsizeof-array-div.
1712
1713 2020-10-22 Patrick Palka <ppalka@redhat.com>
1714
1715 PR c++/97328
1716 * constexpr.c (init_subob_ctx): Don't punt on RANGE_EXPR
1717 indexes, instead build a sub-aggregate initialization context
1718 with no subobject.
1719
1720 2020-10-22 Patrick Palka <ppalka@redhat.com>
1721
1722 PR c++/96575
1723 * constexpr.c (cxx_eval_constant_expression)
1724 <case EMPTY_CLASS_EXPR>: Lower it to a CONSTRUCTOR.
1725 (potential_constant_expression_1) <case COMPOUND_EXPR>: Remove
1726 now-redundant handling of COMPOUND_EXPR with EMPTY_CLASS_EXPR
1727 second operand.
1728 <case EMPTY_CLASS_EXPR>: Return true instead of false.
1729
1730 2020-10-22 Patrick Palka <ppalka@redhat.com>
1731
1732 PR c++/97511
1733 * decl.c (duplicate_decls): Return NULL_TREE if
1734 DECL_TEMPLATE_PARM_P differ.
1735
1736 2020-10-20 Nathan Sidwell <nathan@acm.org>
1737
1738 * name-lookup.c (push_local_extern_decl_alias): Reconstextualize
1739 alias' parm decls. Drop any default args.
1740
1741 2020-10-19 Iain Sandoe <iain@sandoe.co.uk>
1742
1743 PR c++/97438
1744 * coroutines.cc (struct coroutine_info): Add a field to
1745 record that we emitted a promise type error.
1746 (coro_promise_type_found_p): Check for the case that the
1747 promise type contains both return_void and return_value.
1748 Emit an error if so, with information about the wrong
1749 type methods.
1750
1751 2020-10-16 Nathan Sidwell <nathan@acm.org>
1752
1753 PR c++/97460
1754 * pt.c (push_template_decl): Check DECL_LANG_SPECIFIC in friend
1755 case.
1756
1757 2020-10-16 Nathan Sidwell <nathan@acm.org>
1758
1759 PR c++/96258
1760 * parser.c (cp_parser_declaration): Make token2 point to EOF if
1761 token1 was EOF.
1762
1763 2020-10-15 Jason Merrill <jason@redhat.com>
1764
1765 PR c++/95844
1766 * decl.c (copy_fn_p): Return false for a function that is neither a
1767 constructor nor an assignment operator.
1768 (move_signature_fn_p): Likewise.
1769
1770 2020-10-15 Marek Polacek <polacek@redhat.com>
1771
1772 PR c++/97406
1773 PR c++/85901
1774 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Handle OFFSET_TYPE.
1775 (cxx_pretty_printer::abstract_declarator): Fix the printing of ')'.
1776 (cxx_pretty_printer::direct_abstract_declarator): Handle OFFSET_TYPE.
1777 (cxx_pretty_printer::type_id): Likewise. Print the abstract declarator
1778 for pointers-to-members.
1779
1780 2020-10-14 Jason Merrill <jason@redhat.com>
1781
1782 PR c++/97358
1783 * pt.c (check_for_bare_parameter_packs): Diagnose use of
1784 capture pack.
1785
1786 2020-10-14 Nathan Sidwell <nathan@acm.org>
1787
1788 * cp-tree.h (struct lang_decl_fn): Adjust context comment.
1789 (DECL_FRIEND_P): Replace with ...
1790 (DECL_UNIQUE_FRIEND_P): ... this. Only for FUNCTION_DECLs.
1791 (DECL_FRIEND_CONTEXT): Adjust.
1792 * class.c (add_implicitly_declared_members): Detect friendly
1793 spaceship from context.
1794 * constraint.cc (remove_constraints): Use a checking assert.
1795 (maybe_substitute_reqs_for): Use DECL_UNIQUE_FRIEND_P.
1796 * decl.c (check_no_redeclaration_friend_default_args):
1797 DECL_UNIQUE_FRIEND_P is signficant, not hiddenness.
1798 (duplicate_decls): Adjust DECL_UNIQUE_FRIEND_P clearing.
1799 (redeclaration_error_message): Use DECL_UNIQUE_FRIEND_P.
1800 (start_preparsed_function): Correct in-class friend processing.
1801 Refactor some initializers.
1802 (grokmethod): Directly check friend decl-spec.
1803 * decl2.c (grokfield): Check DECL_UNIQUE_FRIEND_P.
1804 * friend.c (do_friend): Set DECL_UNIQUE_FRIEND_P first, remove
1805 extraneous conditions. Don't re set it afterwards.
1806 * name-lookup.c (lookup_elaborated_type_1): Simplify revealing
1807 code.
1808 (do_pushtag): Likewise.
1809 * pt.c (optimize_specialization_lookup_p): Check
1810 DECL_UNIQUE_FRIEND_P.
1811 (push_template_decl): Likewise. Drop unneeded friend setting.
1812 (type_dependent_expression_p): Check DECL_UNIQUE_FRIEND_P.
1813
1814 2020-10-14 Nathan Sidwell <nathan@acm.org>
1815
1816 * name-lookup.c (push_local_extern_decl_alias): Push into alias's
1817 namespace and use pushdecl.
1818 (do_pushdecl_with_scope): Clarify behaviour.
1819
1820 2020-10-12 Martin Sebor <msebor@redhat.com>
1821
1822 PR c++/97201
1823 * error.c (dump_type_suffix): Handle both the C and C++ forms of
1824 zero-length arrays.
1825
1826 2020-10-12 Martin Sebor <msebor@redhat.com>
1827
1828 PR c++/96511
1829 PR middle-end/96384
1830 * init.c (warn_placement_new_too_small): Call builtin_objsize instead
1831 of duplicating what it does.
1832
1833 2020-10-08 Jason Merrill <jason@redhat.com>
1834
1835 PR c++/96805
1836 PR c++/96199
1837 * pt.c (tsubst_aggr_type): Don't build a TYPENAME_TYPE when
1838 entering_scope.
1839 (tsubst_template_decl): Use tsubst_aggr_type.
1840
1841 2020-10-08 Patrick Palka <ppalka@redhat.com>
1842
1843 PR c++/97052
1844 * constraint.cc (build_type_constraint): Temporarily increment
1845 processing_template_decl before calling build_concept_check.
1846 * pt.c (make_constrained_placeholder_type): Likewise.
1847
1848 2020-10-08 Patrick Palka <ppalka@redhat.com>
1849
1850 PR c++/96229
1851 * parser.c (cp_parser_class_specifier_1): Move call to
1852 associate_classtype_constraints from here to ...
1853 (cp_parser_class_head): ... here.
1854 * pt.c (is_compatible_template_arg): Correct documentation to
1855 say "argument is _no_ more constrained than the parameter".
1856
1857 2020-10-07 Marek Polacek <polacek@redhat.com>
1858
1859 PR c++/97010
1860 * pt.c (tsubst_copy_and_build) <case TEMPLATE_ID_EXPR>: Call
1861 tsubst_copy_and_build explicitly instead of using the RECUR macro.
1862 Handle a TEMPLATE_ID_EXPR with an IDENTIFIER_NODE as its operand.
1863 <case CALL_EXPR>: Perform ADL for a TEMPLATE_ID_EXPR with an
1864 IDENTIFIER_NODE as its operand.
1865
1866 2020-10-07 Patrick Palka <ppalka@redhat.com>
1867
1868 PR c++/88115
1869 PR libstdc++/97273
1870 * tree.c (cp_tree_equal) <case ALIGNOF_EXPR>: Return false if
1871 ALIGNOF_EXPR_STD_P differ.
1872
1873 2020-10-07 Nathan Sidwell <nathan@acm.org>
1874
1875 * cp-tree.h (struct language_function): Delete extern_decl_map.
1876 (DECL_LOCAL_DECL_ALIAS): New.
1877 * name-lookup.h (is_local_extern): Delete.
1878 * name-lookup.c (set_local_extern_decl_linkage): Replace with ...
1879 (push_local_extern_decl): ... this new function.
1880 (do_pushdecl): Call new function after pushing new decl. Unhide
1881 hidden non-functions.
1882 (is_local_extern): Delete.
1883 * decl.c (layout_var_decl): Do not allow VLA local externs.
1884 * decl2.c (mark_used): Also mark DECL_LOCAL_DECL_ALIAS. Drop old
1885 local-extern treatment.
1886 * parser.c (cp_parser_oacc_declare): Deal with local extern aliases.
1887 * pt.c (tsubst_expr): Adjust local extern instantiation.
1888 * cp-gimplify.c (cp_genericize_r): Remap DECL_LOCAL_DECLs.
1889
1890 2020-10-07 Nathan Sidwell <nathan@acm.org>
1891
1892 * cp-tree.h (DECL_BUILTIN_P): Rename to ...
1893 (DECL_UNDECLARED_BUILTIN_P): ... here.
1894 * decl.c (duplicate_decls): Adjust.
1895 * name-lookup.c (anticipated_builtin_p): Adjust.
1896 (do_nonmember_using_decl): Likewise.
1897
1898 2020-10-07 Nathan Sidwell <nathan@acm.org>
1899
1900 * tree.c (build_cp_fntype_variant): Clear
1901 TYPE_DEPENDENT_P_VALID if necessary.
1902
1903 2020-10-06 Marek Polacek <polacek@redhat.com>
1904
1905 PR c++/97297
1906 * parser.c (cp_parser_direct_declarator): When checking if a
1907 name is a function template declaration for the P0634R3 case,
1908 look in uninstantiated templates too.
1909
1910 2020-10-05 Marek Polacek <polacek@redhat.com>
1911
1912 * cp-tree.h (NON_UNION_CLASS_TYPE_P): Fix typo in a comment.
1913
1914 2020-10-05 Richard Biener <rguenther@suse.de>
1915 Jakub Jelinek <jakub@redhat.com>
1916
1917 PR c++/97197
1918 * error.c (dump_expr): Handle TARGET_MEM_REF.
1919
1920 2020-10-05 Nathan Sidwell <nathan@acm.org>
1921
1922 * name-lookup.c (maybe_add_fuzzy_decl): New.
1923 (maybe_add_fuzzy_binding): New.
1924 (consider_binding_level): Use intermediate sortable vector for
1925 namespace bindings.
1926
1927 2020-10-02 Marek Polacek <polacek@redhat.com>
1928
1929 PR c++/97014
1930 * cxx-pretty-print.c (pp_cxx_template_argument_list): If the
1931 argument is template_parm_object_p, print its DECL_INITIAL.
1932
1933 2020-10-02 Nathan Sidwell <nathan@acm.org>
1934
1935 * cp-tree.h (lang_decl_base): anticipated_p is not used for
1936 anticipatedness.
1937 (DECL_ANTICIPATED): Delete.
1938 * decl.c (duplicate_decls): Delete DECL_ANTICIPATED_management,
1939 use was_hidden.
1940 (cxx_builtin_function): Drop DECL_ANTICIPATED setting.
1941 (xref_tag_1): Drop DECL_ANTICIPATED assert.
1942 * name-lookup.c (name_lookup::adl_class_only): Drop
1943 DECL_ANTICIPATED check.
1944 (name_lookup::search_adl): Always dedup.
1945 (anticipated_builtin_p): Reimplement.
1946 (do_pushdecl): Drop DECL_ANTICIPATED asserts & update.
1947 (lookup_elaborated_type_1): Drop DECL_ANTICIPATED update.
1948 (do_pushtag): Drop DECL_ANTICIPATED setting.
1949 * pt.c (push_template_decl): Likewise.
1950 (tsubst_friend_class): Likewise.
1951
1952 2020-10-02 Nathan Sidwell <nathan@acm.org>
1953
1954 * name-lookup.c (consider_decl): New, broken out of ...
1955 (consider_binding_level): ... here. Iterate the hash table for
1956 namespace bindings.
1957
1958 2020-10-02 Nathan Sidwell <nathan@acm.org>
1959
1960 * cp-tree.h (base_ctor_omit_inherited_parms): Declare.
1961 * class.c (add_method): Refactor main loop, only pass fns to
1962 ctor_omit_inherited_parms.
1963 (build_cdtor_clones): Rename bool parms.
1964 (clone_cdtor): Call base_ctor_omit_inherited_parms.
1965 * method.c (base_ctor_omit_inherited_parms): New, broken out of
1966 ...
1967 (ctor_omit_inherited_parms): ... here, call it with
1968 DECL_CLONED_FUNCTION.
1969
1970 2020-10-02 Nathan Sidwell <nathan@acm.org>
1971
1972 * cp-tree.h (cp_fname_init): Delete declaration.
1973 * decl.c (cp_fname_init): Merge into only caller ...
1974 (cp_make_fname): ... here & refactor.
1975
1976 2020-10-02 Jason Merril <jason@redhat.com>
1977
1978 * call.c (build_operator_new_call): Set CALL_FROM_NEW_OR_DELETE_P.
1979 (build_op_delete_call): Likewise.
1980 * init.c (build_new_1, build_vec_delete_1, build_delete): Not here.
1981 (build_delete):
1982
1983 2020-10-02 Jason Merril <jason@redhat.com>
1984
1985 * lambda.c (call_from_lambda_thunk_p): New.
1986 * cp-gimplify.c (cp_genericize_r): Use it.
1987 * pt.c (tsubst_copy_and_build): Use it.
1988 * typeck.c (check_return_expr): Use it.
1989 * cp-tree.h: Declare it.
1990 (CALL_FROM_NEW_OR_DELETE_P): Move to gcc/tree.h.
1991
1992 2020-10-01 Nathan Sidwell <nathan@acm.org>
1993
1994 * cp-tree.h (DECL_ANTICIPATED): Adjust comment.
1995 (DECL_HIDDEN_P, TYPE_HIDDEN_P): Delete.
1996 * tree.c (ovl_insert): Delete DECL_HIDDEN_P assert.
1997 (ovl_skip_hidden): Likewise.
1998
1999 2020-10-01 Nathan Sidwell <nathan@acm.org>
2000
2001 * name-lookup.c (pushdecl_top_level): Assert incoming context is
2002 null, add global_namespace context.
2003 (pushdecl_top_level_and_finish): Likewise.
2004 * pt.c (get_template_parm_object): Clear decl context before
2005 pushing.
2006 * semantics.c (finish_compound_literal): Likewise.
2007
2008 2020-10-01 Nathan Sidwell <nathan@acm.org>
2009
2010 * decl.c (lookup_and_check_tag): Refactor.
2011
2012 2020-10-01 Jakub Jelinek <jakub@redhat.com>
2013
2014 PR c++/96994
2015 * call.c (build_over_call): If obj_arg is non-NULL, return INIT_EXPR
2016 setting obj_arg to call.
2017
2018 2020-10-01 Jakub Jelinek <jakub@redhat.com>
2019
2020 PR c++/97195
2021 * constexpr.c (cxx_eval_call_expression): Don't VERIFY_CONSTANT the
2022 second argument.
2023
2024 2020-10-01 Marek Polacek <polacek@redhat.com>
2025
2026 PR c++/90210
2027 * pt.c (do_class_deduction): Don't prune explicit deduction guides
2028 in copy-list-initialization. In copy-list-initialization, if an
2029 explicit deduction guide was selected, give an error.
2030
2031 2020-09-30 Nathan Sidwell <nathan@acm.org>
2032
2033 * cp-tree.h (struct lang_decl_fn): Remove hidden_friend_p.
2034 (DECL_HIDDEN_FRIEND_P): Delete.
2035 * call.c (add_function_candidate): Drop assert about anticipated
2036 decl.
2037 (build_new_op_1): Drop koenig lookup flagging for hidden friend.
2038 * decl.c (duplicate_decls): Drop HIDDEN_FRIEND_P updating.
2039 * name-lookup.c (do_pushdecl): Likewise.
2040 (set_decl_namespace): Discover hiddenness from OVL_HIDDEN_P.
2041 * pt.c (check_explicit_specialization): Record found_hidden
2042 explicitly.
2043
2044 2020-09-29 Marek Polacek <polacek@redhat.com>
2045
2046 PR c++/94695
2047 * call.c (ref_conv_binds_directly_p): New function.
2048 * cp-tree.h (ref_conv_binds_directly_p): Declare.
2049 * parser.c (warn_for_range_copy): New function.
2050 (cp_convert_range_for): Call it.
2051
2052 2020-09-29 Nathan Sidwell <nathan@acm.org>
2053
2054 * cp-tree.h (ovl_insert): Change final parm to hidden-or-using
2055 indicator.
2056 * name-lookup.h (HIDDEN_TYPE_BINDING_P): New.
2057 (struct cxx_binding): Add type_is_hidden flag.
2058 * tree.c (ovl_insert): Change using_p parm to using_or_hidden,
2059 adjust.
2060 (ovl_skip_hidden): Assert we never see a naked hidden decl.
2061 * decl.c (xref_tag_1): Delete unhiding friend from here (moved to
2062 lookup_elaborated_type_1).
2063 * name-lookup.c (STAT_TYPE_HIDDEN_P, STAT_DECL_HIDDEN_P): New.
2064 (name_lookup::search_namespace_only): Check new hidden markers.
2065 (cxx_binding_make): Clear HIDDEN_TYPE_BINDING_P.
2066 (update_binding): Update new hidden markers.
2067 (lookup_name_1): Check HIDDEN_TYPE_BINDING_P and simplify friend
2068 ignoring.
2069 (lookup_elaborated_type_1): Use new hidden markers. Reveal the
2070 decl here.
2071
2072 2020-09-29 Nathan Sidwell <nathan@acm.org>
2073
2074 * name-lookup.c (create_local_binding): Do not clear
2075 INHERITED_VALUE_BINDING_P here.
2076 (name_lookup::process_binding): Move done hidden-decl triage to ...
2077 (name_lookup::search_namespace_only): ... here, its only caller.
2078 (cxx_binding_make): Clear flags here.
2079 (push_binding): Not here.
2080 (pop_local_binding): RAII.
2081 (update_binding): Refactor.
2082 (do_pushdecl): Assert we're never revealing a local binding.
2083 (do_pushdecl_with_scope): Directly call do_pushdecl.
2084 (get_class_binding): Do not clear LOCAL_BINDING_P here.
2085 * pt.c (push_template_decl): Set friend & anticipated before
2086 pushing.
2087
2088 2020-09-29 Nathan Sidwell <nathan@acm.org>
2089
2090 * name-lookup.c (update_binding): We never meet two implicit
2091 typedefs.
2092 (do_pushdecl): Adjust set_identifier_type_value_with_scope calls.
2093 (set_identifier_type_value_with_scope): Do not update binding in
2094 the namespace-case. Assert it is already there.
2095
2096 2020-09-25 Nathan Sidwell <nathan@acm.org>
2097
2098 * cp-tree.h (duplicate_decls): Replace 'is_friend' with 'hiding'
2099 and add 'was_hidden'.
2100 * name-lookup.h (pushdecl_namespace_level): Replace 'is_friend'
2101 with 'hiding'.
2102 (pushdecl): Likewise.
2103 (pushdecl_top_level): Drop is_friend parm.
2104 * decl.c (check_no_redeclaration_friend_default_args): Rename parm
2105 olddelc_hidden_p.
2106 (duplicate_decls): Replace 'is_friend' with 'hiding'
2107 and 'was_hidden'. Do minimal adjustments in body.
2108 (cxx_builtin_function): Pass 'hiding' to pushdecl.
2109 * friend.c (do_friend): Pass 'hiding' to pushdecl.
2110 * name-lookup.c (supplement_binding_1): Drop defaulted arg to
2111 duplicate_decls.
2112 (update_binding): Replace 'is_friend' with 'hiding'. Drop
2113 defaulted arg to duplicate_decls.
2114 (do_pushdecl): Replace 'is_friend' with 'hiding'. Assert no
2115 surprise hidhing. Adjust duplicate_decls calls to inform of old
2116 decl's hiddennes.
2117 (pushdecl): Replace 'is_friend' with 'hiding'.
2118 (set_identifier_type_value_with_scope): Adjust update_binding
2119 call.
2120 (do_pushdecl_with_scope): Replace 'is_friend' with 'hiding'.
2121 (pushdecl_outermost_localscope): Drop default arg to
2122 do_pushdecl_with_scope.
2123 (pushdecl_namespace_level): Replace 'is_friend' with 'hiding'.
2124 (pushdecl_top_level): Drop is_friend parm.
2125 * pt.c (register_specialization): Comment duplicate_decls call
2126 args.
2127 (push_template_decl): Commont pushdecl_namespace_level.
2128 (tsubst_friend_function, tsubst_friend_class): Likewise.
2129
2130 2020-09-25 Nathan Sidwell <nathan@acm.org>
2131
2132 * name-lookup.h (enum tag_scope): Replace with ...
2133 (enum class TAG_how): ... this. Add HIDDEN_FRIEND value.
2134 (lookup_type_scope): Replace with ...
2135 (lookup_elaborated_type): ... this.
2136 (pushtag): Use TAG_how, not tag_scope.
2137 * cp-tree.h (xref_tag): Parameter is TAG_how, not tag_scope.
2138 * decl.c (lookup_and_check_tag): Likewise. Adjust.
2139 (xref_tag_1, xref_tag): Likewise. adjust.
2140 (start_enum): Adjust lookup_and_check_tag call.
2141 * name-lookup.c (lookup_type_scope_1): Rename to ...
2142 (lookup_elaborated_type_1) ... here. Use TAG_how, not tag_scope.
2143 (lookup_type_scope): Rename to ...
2144 (lookup_elaborated_type): ... here. Use TAG_how, not tag_scope.
2145 (do_pushtag): Use TAG_how, not tag_scope. Adjust.
2146 (pushtag): Likewise.
2147 * parser.c (cp_parser_elaborated_type_specifier): Adjust.
2148 (cp_parser_class_head): Likewise.
2149
2150 2020-09-25 Nathan Sidwell <nathan@acm.org>
2151
2152 * cp-tree.h (DECL_BUILTIN_P): New.
2153 * decl.c (duplicate_decls): Use it. Do not treat omp-udr as a
2154 builtin.
2155 * name-lookup.c (anticipated_builtin): Use it.
2156 (set_decl_context_in_fn): Function-scope OMP UDRs have function context.
2157 (do_nonmember_using_decl): Use DECL_BUILTIN_P.
2158 * parser.c (cp_parser_omp_declare_reduction): Function-scope OMP
2159 UDRs have function context. Assert we never find a valid duplicate.
2160 * pt.c (tsubst_expr): Function-scope OMP UDRs have function context.
2161
2162 2020-09-24 Nathan Sidwell <nathan@acm.org>
2163
2164 * cp-tree.h (duplicate_decls): Default is_friend to false.
2165 (xref_tag): Default tag_scope & tpl_header_p to ts_current & false.
2166 (push_template_decl_real): Default is_friend to false. Rename to
2167 ...
2168 (push_template_decl): ... here. Delete original decl.
2169 * name-lookup.h (pushdecl_namespace_level): Default is_friend to
2170 false.
2171 (pushtag): Default tag_scope to ts_current.
2172 * coroutines.cc (morph_fn_to_coro): Drop default args to xref_tag.
2173 * decl.c (start_decl): Drop default args to duplicate_decls.
2174 (start_enum): Drop default arg to pushtag & xref_tag.
2175 (start_preparsed_function): Pass DECL_FRIEND_P to
2176 push_template_decl.
2177 (grokmethod): Likewise.
2178 * friend.c (do_friend): Rename push_template_decl_real calls.
2179 * lambda.c (begin_lamnbda_type): Drop default args to xref_tag.
2180 (vla_capture_type): Likewise.
2181 * name-lookup.c (maybe_process_template_type_declaration): Rename
2182 push_template_decl_real call.
2183 (pushdecl_top_level_and_finish): Drop default arg to
2184 pushdecl_namespace_level.
2185 * pt.c (push_template_decl_real): Assert no surprising friend
2186 functions. Rename to ...
2187 (push_template_decl): ... here. Delete original function.
2188 (lookup_template_class_1): Drop default args from pushtag.
2189 (instantiate_class_template_1): Likewise.
2190 * ptree.c (debug_overload): Print hidden and using markers.
2191 * rtti.c (init_rtti_processing): Drop refault args from xref_tag.
2192 (build_dynamic_cast_1, tinfo_base_init): Likewise.
2193 * semantics.c (begin_class_definition): Drop default args to
2194 pushtag.
2195
2196 2020-09-24 Nathan Sidwell <nathan@acm.org>
2197
2198 PR c++/97186
2199 * pt.c (maybe_instantiate_noexcept): Local externs are never
2200 member fns.
2201
2202 2020-09-23 Nathan Sidwell <nathan@acm.org>
2203
2204 * name-lookup.h (typedef cxx_binding): Delete tdef.
2205 (typedef cp_binding_level): Likewise.
2206 (struct cxx_binding): Flags are bools.
2207
2208 2020-09-23 Nathan Sidwell <nathan@acm.org>
2209
2210 PR c++/97171
2211 * pt.c (tsubst_copy) [FUNCTION_DECL,VAR_DECL]: Retrieve local
2212 specialization for DECL_LOCAL_P decls.
2213
2214 2020-09-22 Patrick Palka <ppalka@redhat.com>
2215
2216 PR c++/95310
2217 * pt.c (corresponding_template_parameter): Define.
2218 (keep_template_parm): Use it to adjust the given template
2219 parameter to the corresponding in-scope one from ctx_parms.
2220
2221 2020-09-22 Nathan Sidwell <nathan@acm.org>
2222
2223 * cp-tree.h (xref_tag_from_type): Don't declare.
2224 * decl.c (xref_tag_from_type): Delete.
2225 * pt.c (lookup_template_class_1): Erroneously located class
2226 definitions just give error_mark, don't try and inject it into the
2227 namespace.
2228
2229 2020-09-22 Jakub Jelinek <jakub@redhat.com>
2230
2231 PR c++/97145
2232 * constexpr.c (cxx_eval_builtin_function_call): Return void_node for
2233 calls to __sanitize_ptr_{sub,cmp} builtins.
2234
2235 2020-09-22 Nathan Sidwell <nathan@acm.org>
2236
2237 * pt.c (instantiate_class_template_1): Do not repush and unhide
2238 injected friend.
2239
2240 2020-09-21 Marek Polacek <polacek@redhat.com>
2241
2242 PR c++/90583
2243 DR 1722
2244 * lambda.c (maybe_add_lambda_conv_op): Mark the conversion function
2245 as noexcept.
2246
2247 2020-09-21 Marek Polacek <polacek@redhat.com>
2248
2249 * pt.c (deduction_guides_for): Add a bool parameter. Set it.
2250 (do_class_deduction): Warn when CTAD succeeds but the type doesn't
2251 have any explicit deduction guides.
2252
2253 2020-09-21 Nathan Sidwell <nathan@acm.org>
2254
2255 * decl.c (xref_tag_1): Use IDENTIFIER_LAMBDA_P to detect lambdas.
2256 * lambda.c (begin_lambda_type): Use ts_current to push the tag.
2257 * name-lookup.h (enum tag_scope): Drop ts_lambda.
2258
2259 2020-09-21 Marek Polacek <polacek@redhat.com>
2260
2261 PR c++/97099
2262 * decl.c (redeclaration_error_message): Detect a redeclaration of
2263 deduction guides.
2264
2265 2020-09-19 Sandra Loosemore <sandra@codesourcery.com>
2266
2267 * cp-gimplify.c (enum bc_t, bc_label): Move to c-family.
2268 (begin_bc_block, finish_bc_block, get_bc_label): Likewise.
2269 (genericize_cp_loop): Likewise.
2270 (genericize_for_stmt, genericize_while_stmt): Likewise.
2271 (genericize_do_stmt, genericize_switch_stmt): Likewise.
2272 (genericize_continue_stmt, genericize_break_stmt): Likewise.
2273 (genericize_omp_for_stmt): Likewise.
2274 (cp_genericize_r): Call c_genericize_control_stmt instead of
2275 above functions directly.
2276 (cp_genericize): Call save_bc_state and restore_bc_state instead
2277 of manipulating bc_label directly.
2278 * cp-objcp-common.c (cxx_block_may_fallthru): Defer to
2279 c_block_may_fallthru instead of handling SWITCH_STMT here.
2280 (cp_common_init_ts): Move handling of loop and switch-related
2281 statements to c-family.
2282 * cp-tree.def (FOR_STMT, WHILE_STMT, DO_STMT): Move to c-family.
2283 (BREAK_STMT, CONTINUE_STMT, SWITCH_STMT): Likewise.
2284 * cp-tree.h (LABEL_DECL_BREAK, LABEL_DECL_CONTINUE): Likewise.
2285 (WHILE_COND, WHILE_BODY): Likewise.
2286 (DO_COND, DO_BODY): Likewise.
2287 (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY, FOR_SCOPE): Likewise.
2288 (SWITCH_STMT_COND, SWITCH_STMT_BODY): Likewise.
2289 (SWITCH_STMT_TYPE, SWITCH_STMT_SCOPE): Likewise.
2290 (SWITCH_STMT_ALL_CASES_P, SWITCH_STMT_NO_BREAK_P): Likewise.
2291 * cxx-pretty-print.c (cxx_pretty_printer::statement): Move code
2292 to handle structured loop and switch tree nodes to c-family.
2293 * dump.c (cp_dump_tree): Likewise.
2294
2295 2020-09-19 Patrick Palka <ppalka@redhat.com>
2296
2297 PR c++/96531
2298 PR c++/97103
2299 * constraint.cc (map_arguments): Call template_parm_to_arg
2300 in the self-mapping case.
2301 (finish_shorthand_constraint): No need to build a TREE_LIST
2302 before calling template_parm_to_arg.
2303 * pt.c (template_parm_to_arg): Rewrite to handle TEMPLATE_PARM_P
2304 nodes as well as DECL_TEMPLATE_PARM_P nodes, and to make the
2305 overlying TREE_LIST node optional.
2306 (keep_template_parm): Don't record a BOUND_TEMPLATE_TEMPLATE_PARM,
2307 instead record its corresponding TEMPLATE_TEMPLATE_PARM.
2308 (convert_generic_types_to_packs): Don't call
2309 template_parm_to_arg.
2310
2311 2020-09-19 Patrick Palka <ppalka@redhat.com>
2312
2313 PR c++/97051
2314 * constraint.cc (satisfy_atom): Pass true as the
2315 manifestly_const_eval argument to maybe_constant_value.
2316
2317 2020-09-18 Jason Merrill <jason@redhat.com>
2318
2319 PR bootstrap/97118
2320 * decl.c (complete_vars): Only call layout_var_decl if completing
2321 the type succeeded.
2322
2323 2020-09-18 Jason Merrill <jason@redhat.com>
2324
2325 * decl.c (complete_vars): Call layout_var_decl.
2326
2327 2020-09-17 Patrick Palka <ppalka@redhat.com>
2328
2329 PR c++/96409
2330 PR c++/96410
2331 * constraint.cc (tsubst_requires_expr): Use REQUIRES_EXPR_PARMS
2332 and REQUIRES_EXPR_REQS. Use REQUIRES_EXPR_EXTRA_ARGS,
2333 add_extra_args and build_extra_args to defer substitution until
2334 we have all the template arguments.
2335 (finish_requires_expr): Adjust the call to build_min so that
2336 REQUIRES_EXPR_EXTRA_ARGS gets set to NULL_TREE.
2337 * cp-tree.def (REQUIRES_EXPR): Give it a third operand.
2338 * cp-tree.h (REQUIRES_EXPR_PARMS, REQUIRES_EXPR_REQS,
2339 REQUIRES_EXPR_EXTRA_ARGS): Define.
2340 (add_extra_args, build_extra_args): Declare.
2341
2342 2020-09-16 Nathan Sidwell <nathan@acm.org>
2343
2344 * cp-tree.h (cp_check_omp_declare_reduction): Return bool.
2345 * semantics.c (cp_check_omp_declare_reduction): Return true on for
2346 success.
2347 * pt.c (push_template_decl_real): OMP reductions do not get a
2348 template header.
2349 (tsubst_function_decl): Remove special casing for local decl omp
2350 reductions.
2351 (tsubst_expr): Call instantiate_body for a local omp reduction.
2352 (instantiate_body): Add nested_p parm, and deal with such
2353 instantiations.
2354 (instantiate_decl): Reject FUNCTION_SCOPE entities, adjust
2355 instantiate_body call.
2356
2357 2020-09-16 Nathan Sidwell <nathan@acm.org>
2358
2359 * pt.c (instantiate_body): Remove 'nested' var, simplify
2360 push_to_top logic.
2361
2362 2020-09-16 Nathan Sidwell <nathan@acm.org>
2363
2364 * pt.c (instantiate_body): New, broken out of ..
2365 (instantiate_decl): ... here. Call it.
2366
2367 2020-09-15 Nathan Sidwell <nathan@acm.org>
2368
2369 * pt.c (push_template_decl_real): OMP reductions retain a template
2370 header.
2371 (tsubst_function_decl): Likewise.
2372
2373 2020-09-15 Tobias Burnus <tobias@codesourcery.com>
2374
2375 PR fortran/96668
2376 * cp-gimplify.c (cxx_omp_finish_clause): Add bool openacc arg.
2377 * cp-tree.h (cxx_omp_finish_clause): Likewise
2378 * semantics.c (handle_omp_for_class_iterator): Update call.
2379
2380 2020-09-14 Marek Polacek <polacek@redhat.com>
2381
2382 * pt.c (push_template_decl_real): Use VAR_OR_FUNCTION_DECL_P.
2383
2384 2020-09-14 Nathan Sidwell <nathan@acm.org>
2385
2386 * pt.c (push_template_decl_real): Don't attach a template head to
2387 local externs.
2388 (tsubst_function_decl): Add support for headless local extern
2389 decls.
2390 (tsubst_decl): Add support for headless local extern decls.
2391
2392 2020-09-11 Nathan Sidwell <nathan@acm.org>
2393
2394 * decl.c (grokfndecl): Don't attach to local extern.
2395
2396 2020-09-11 Nathan Sidwell <nathan@acm.org>
2397
2398 * parser.c (cp_parser_objc_method_definition_list): Reimplement
2399 loop, make sure we pop scope.
2400
2401 2020-09-11 Marek Polacek <polacek@redhat.com>
2402
2403 * cp-tree.h (LOOKUP_CONSTINIT): Remove.
2404 (LOOKUP_REWRITTEN): Adjust.
2405 * decl.c (duplicate_decls): Set DECL_DECLARED_CONSTINIT_P.
2406 (check_initializer): Use DECL_DECLARED_CONSTINIT_P instead of
2407 LOOKUP_CONSTINIT.
2408 (cp_finish_decl): Don't set DECL_DECLARED_CONSTINIT_P. Use
2409 DECL_DECLARED_CONSTINIT_P instead of LOOKUP_CONSTINIT.
2410 (grokdeclarator): Set DECL_DECLARED_CONSTINIT_P.
2411 * decl2.c (grokfield): Don't handle LOOKUP_CONSTINIT.
2412 * parser.c (cp_parser_decomposition_declaration): Remove
2413 LOOKUP_CONSTINIT handling.
2414 (cp_parser_init_declarator): Likewise.
2415 * pt.c (tsubst_expr): Likewise.
2416 (instantiate_decl): Likewise.
2417 * typeck2.c (store_init_value): Use DECL_DECLARED_CONSTINIT_P instead
2418 of LOOKUP_CONSTINIT.
2419
2420 2020-09-10 Nathan Sidwell <nathan@acm.org>
2421
2422 * cp-tree.h (TINFO_VAR_DECLARED_CONSTINIT): Replace with ...
2423 (DECL_DECLARED_CONSTINIT_P): ... this.
2424 * decl.c (start_decl): No need to retrofit_lang_decl for constinit
2425 flag.
2426 (cp_finish_decl): Use DECL_DECLARED_CONSTINIT_P.
2427 * pt.c (tsubst_decl): No need to handle constinit flag
2428 propagation.
2429 (tsubst_expr): Or here.
2430
2431 2020-09-10 Nathan Sidwell <nathan@acm.org>
2432
2433 * cp-tree.h (DECL_LOCAL_FUNCTION_P): Rename to ...
2434 (DECL_LOCAL_DECL_P): ... here. Accept both fns and vars.
2435 * decl.c (start_decl): Set DECL_LOCAL_DECL_P for local externs.
2436 (omp_declare_variant_finalize_one): Use DECL_LOCAL_DECL_P.
2437 (local_variable_p): Simplify.
2438 * name-lookup.c (set_decl_context_in_fn): Assert DECL_LOCAL_DECL_P
2439 is as expected. Simplify.
2440 (do_pushdecl): Don't set decl_context_in_fn for friends.
2441 (is_local_extern): Simplify.
2442 * call.c (equal_functions): Use DECL_LOCAL_DECL_P.
2443 * parser.c (cp_parser_postfix_expression): Likewise.
2444 (cp_parser_omp_declare_reduction): Likewise.
2445 * pt.c (check_default_tmpl_args): Likewise.
2446 (tsubst_expr): Assert nested reduction function is local.
2447 (type_dependent_expression_p): Use DECL_LOCAL_DECL_P.
2448 * semantics.c (finish_call_expr): Likewise.
2449
2450 2020-09-09 Marek Polacek <polacek@redhat.com>
2451
2452 PR c++/77841
2453 * decl.c (reshape_init): If we're initializing a char array from
2454 a string-literal that is enclosed in braces, unwrap it.
2455 * init.c (build_new_1): Don't handle string-initializers here.
2456 (build_new): Handle new-expression with paren-init when the
2457 array bound is known. Always pass string constants to build_new_1
2458 enclosed in braces. Don't handle string-initializers in any
2459 special way.
2460
2461 2020-09-09 Marek Polacek <polacek@redhat.com>
2462
2463 PR c++/95164
2464 * decl.c (reshape_init_r): When initializing an aggregate member
2465 with an initializer from an initializer-list, also consider
2466 COMPOUND_LITERAL_P.
2467
2468 2020-09-09 Nathan Sidwell <nathan@acm.org>
2469
2470 * parser.c (cp_parser_omp_declare_reduction): Refactor to avoid
2471 code duplication. Update DECL_TI_TEMPLATE's context.
2472 * pt.c (tsubst_expr): For OMP reduction function, set context to
2473 global_namespace before pushing.
2474 (tsubst_omp_udr): Assert current_function_decl, add comment about
2475 decl context.
2476
2477 2020-09-09 Patrick Palka <ppalka@redhat.com>
2478
2479 PR c++/96647
2480 * class.c (resolve_address_of_overloaded_function): Check
2481 constraints_satisfied_p and perform return-type deduction via
2482 maybe_instantiate_decl when considering non-template functions
2483 in the overload set.
2484 * cp-tree.h (maybe_instantiate_decl): Declare.
2485 * decl2.c (maybe_instantiate_decl): Remove static.
2486
2487 2020-09-04 Jason Merrill <jason@redhat.com>
2488
2489 * expr.c (mark_use): Use iloc_sentinel.
2490
2491 2020-09-03 Jakub Jelinek <jakub@redhat.com>
2492
2493 PR c++/96901
2494 * constexpr.c (fundef_copies_table): Change type from
2495 hash_map<tree, tree> * to decl_tree_map *.
2496
2497 2020-09-03 Marek Polacek <polacek@redhat.com>
2498
2499 PR c++/92812
2500 * cp-tree.h (do_aggregate_paren_init): Declare.
2501 * decl.c (do_aggregate_paren_init): New.
2502 (grok_reference_init): Use it.
2503 (check_initializer): Likewise.
2504 * init.c (perform_member_init): Handle initializing an array from
2505 a ()-list. Use do_aggregate_paren_init.
2506
2507 2020-09-03 Jakub Jelinek <jakub@redhat.com>
2508
2509 PR c++/96862
2510 * constexpr.c (cxx_eval_outermost_constant_expr): Temporarily disable
2511 flag_rounding_math during manifestly constant evaluation.
2512
2513 2020-09-01 Marek Polacek <polacek@redhat.com>
2514
2515 PR c++/77841
2516 * init.c (build_new_1): Call reshape_init.
2517
2518 2020-09-01 Jakub Jelinek <jakub@redhat.com>
2519
2520 PR c++/96867
2521 * semantics.c (handle_omp_array_sections_1): Test
2522 DECL_ARRAY_PARAMETER_P only on PARM_DECLs.
2523
2524 2020-08-31 Marek Polacek <polacek@redhat.com>
2525 Jason Merrill <jason@redhat.com>
2526
2527 PR c++/93529
2528 * call.c (build_new_method_call_1): Use build_constructor_from_vec
2529 instead of build_tree_list_vec + build_constructor_from_list.
2530 * init.c (build_new_1): Handle new char[]{"foo"}. Use
2531 build_constructor_from_vec instead of build_tree_list_vec +
2532 build_constructor_from_list.
2533 (build_new): Deduce the array size in new-expression if not
2534 present. Handle ()-init. Handle initializing an array from
2535 a string literal.
2536 * parser.c (cp_parser_new_type_id): Leave [] alone.
2537 (cp_parser_direct_new_declarator): Allow [].
2538 * pt.c (type_dependent_expression_p): In a NEW_EXPR, consider
2539 array types whose dimension has to be deduced type-dependent.
2540
2541 2020-08-27 Martin Liska <mliska@suse.cz>
2542
2543 * class.c (build_vtbl_initializer): Set exact argument of a vector
2544 growth function to true.
2545 * constraint.cc (get_mapped_args): Likewise.
2546 * decl.c (cp_maybe_mangle_decomp): Likewise.
2547 (cp_finish_decomp): Likewise.
2548 * parser.c (cp_parser_omp_for_loop): Likewise.
2549 * pt.c (canonical_type_parameter): Likewise.
2550 * rtti.c (get_pseudo_ti_init): Likewise.
2551
2552 2020-08-26 Nathan Sidwell <nathan@acm.org>
2553
2554 * decl.c (poplevel): A local-binding tree list holds the name in
2555 TREE_PURPOSE.
2556 * name-lookup.c (update_local_overload): Add id to TREE_PURPOSE.
2557 (lookup_name_1): Deal with local-binding error_mark_node marker.
2558 (op_unqualified_lookup): Return error_mark_node for 'nothing
2559 found'. Retain global binding, check class binding here.
2560 (maybe_save_operator_binding): Reimplement to always cache a
2561 result.
2562 (push_operator_bindings): Deal with 'ignore' marker.
2563
2564 2020-08-25 Tobias Burnus <tobias@codesourcery.com>
2565
2566 PR c/96678
2567 * semantics.c (handle_omp_array_sections_1): Talk about
2568 array function parameter in the error message.
2569
2570 2020-08-25 Jakub Jelinek <jakub@redhat.com>
2571
2572 PR c++/96721
2573 * cp-tree.h (build_trivial_dtor_call): Add bool argument defaulted
2574 to false.
2575 * call.c (build_trivial_dtor_call): Add NO_PTR_DEREF argument. If
2576 instance is a pointer and NO_PTR_DEREF is true, clobber the pointer
2577 rather than what it points to.
2578 * semantics.c (finish_call_expr): Call build_trivial_dtor_call with
2579 true as NO_PTR_DEREF.
2580
2581 2020-08-25 Jason Merrill <jason@redhat.com>
2582
2583 PR c++/95428
2584 * optimize.c (populate_clone_array): Revert PR70462 change.
2585 (maybe_clone_body): Likewise.
2586
2587 2020-08-24 Nathan Sidwell <nathan@acm.org>
2588
2589 * ptree.c (debug_overload): New.
2590
2591 2020-08-19 Jason Merrill <jason@redhat.com>
2592
2593 DR 2369
2594 * cp-tree.h (push_tinst_level, push_tinst_level_loc): Declare.
2595 * constraint.cc (satisfy_declaration_constraints):
2596 Use add_outermost_template_args and push_tinst_level.
2597 * pt.c (add_outermost_template_args): Handle getting
2598 a TEMPLATE_DECL as the first argument.
2599 (push_tinst_level, push_tinst_level_loc): No longer static.
2600 (fn_type_unification): Check satisfaction before non-dependent
2601 conversions.
2602
2603 2020-08-18 Nathan Sidwell <nathan@acm.org>
2604
2605 * cp-tree.h (SET_TYPE_TEMPLTE_INFO): Do not deal with ALIAS templates.
2606 * pt.c (lookup_template_class_1): Special-case alias template
2607 template_info setting.
2608
2609 2020-08-18 Jason Merrill <jason@redhat.com>
2610
2611 PR c++/96199
2612 * pt.c (tsubst_aggr_type): Rewrite in C++17, too.
2613 (maybe_dependent_member_ref): Likewise.
2614 (build_deduction_guide): Re-substitute template parms.
2615 * cp-tree.h (struct push_nested_class_guard): New.
2616 * constraint.cc (get_normalized_constraints_from_decl): Use it.
2617
2618 2020-08-18 Jason Merrill <jason@redhat.com>
2619
2620 PR c++/96199
2621 * pt.c (maybe_dependent_member_ref): New.
2622 (tsubst_copy) [CONST_DECL]: Use it.
2623 [VAR_DECL]: Likewise.
2624 (tsubst_aggr_type): Handle nested type.
2625
2626 2020-08-18 Nathan Sidwell <nathan@acm.org>
2627
2628 * name-lookup.c (qualify_lookup): Drop lambda checking here.
2629 Reorder namespace & type checking.
2630 (lookup_name_1): Do hidden lambda checking here.
2631
2632 2020-08-14 Nathan Sidwell <nathan@acm.org>
2633
2634 * name-lookup.h (lookup_name_real, lookup_name_nonclass): Rename
2635 to ...
2636 (lookup_name): ... these new overloads.
2637 * name-lookup.c (identifier_type_value_1): Rename lookup_name_real
2638 call.
2639 (lookup_name_real_1): Rename to ...
2640 (lookup_name_1): ... here.
2641 (lookup_name_real): Rename to ...
2642 (lookup_name): ... here. Rename lookup_name_real_1 call.
2643 (lookup_name_nonclass): Delete.
2644 * call.c (build_operator_new_call): Rename lookup_name_real call.
2645 (add_operator_candidates): Likewise.
2646 (build_op_delete_call): Rename lookup_name_nonclass call.
2647 * parser.c (cp_parser_lookup_name): Likewise.
2648 * pt.c (tsubst_friend_class, lookup_init_capture_pack): Likewise.
2649 (tsubst_expr): Likewise.
2650 * semantics.c (capture_decltype): Likewise.
2651
2652 2020-08-14 Nathan Sidwell <nathan@acm.org>
2653
2654 * cp-tree.h (LOOKUP_HIDDEN): Delete.
2655 (LOOKUP_PREFER_RVALUE): Adjust initializer.
2656 * name-lookup.h (enum class LOOK_want): Add HIDDEN_FRIEND and
2657 HIDDEN_LAMBDA flags.
2658 (lookup_name_real): Drop flags parm.
2659 (lookup_qualified_name): Drop find_hidden parm.
2660 * name-lookup.c (class name_lookup): Drop hidden field, adjust
2661 ctors.
2662 (name_lookup::add_overload): Check want for hiddenness.
2663 (name_lookup::process_binding): Likewise.
2664 (name_lookup::search_unqualified): Likewise.
2665 (identifier_type_value_1): Adjust lookup_name_real call.
2666 (set_decl_namespace): Adjust name_lookup ctor.
2667 (qualify_lookup): Drop flags parm, use want for hiddenness.
2668 (lookup_qualified_name): Drop find_hidden parm.
2669 (lookup_name_real_1): Drop flags parm, adjust qualify_lookup
2670 calls.
2671 (lookup_name_real): Drop flags parm.
2672 (lookup_name_nonclass, lookup_name): Adjust lookup_name_real
2673 calls.
2674 (lookup_type_scope_1): Adjust qualify_lookup calls.
2675 * call.c (build_operator_new_call): Adjust lookup_name_real call.
2676 (add_operator_candidates): Likewise.
2677 * coroutines.cc (morph_fn_to_coro): Adjust lookup_qualified_name
2678 call.
2679 * parser.c (cp_parser_lookup_name): Adjust lookup_name_real calls.
2680 * pt.c (check_explicit_specialization): Adjust
2681 lookup_qualified_name call.
2682 (deduction_guides_for): Likewise.
2683 (tsubst_friend_class): Adjust lookup_name_real call.
2684 (lookup_init_capture_pack): Likewise.
2685 (tsubst_expr): Likewise, don't look in namespaces.
2686 * semantics.c (capture_decltype): Adjust lookup_name_real. Don't
2687 look in namespaces.
2688
2689 2020-08-14 Jason Merrill <jason@redhat.com>
2690
2691 PR c++/90254
2692 PR c++/93711
2693 * cp-tree.h (unsafe_return_slot_p): Declare.
2694 * call.c (is_base_field_ref): Rename to unsafe_return_slot_p.
2695 (build_over_call): Check unsafe_return_slot_p.
2696 (build_special_member_call): Likewise.
2697 * init.c (expand_default_init): Likewise.
2698 * typeck2.c (split_nonconstant_init_1): Likewise.
2699
2700 2020-08-14 Nathan Sidwell <nathan@acm.org>
2701
2702 * cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES)
2703 (LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY)
2704 (LOOKUP_QUALIFIERS_ONL): Delete.
2705 (LOOKUP_HIDDEN): Adjust.
2706 * name-lookup.h (enum class LOOK_want): New.
2707 (operator|, operator&): Overloads for it.
2708 (lookup_name_real): Replace prefer_type & namespaces_only with
2709 LOOK_want parm.
2710 (lookup_qualified_name): Replace prefer_type with LOOK_want.
2711 (lookup_name_prefer_type): Replace with ...
2712 (lookup_name): ... this. New overload with LOOK_want parm.
2713 * name-lookup.c (struct name_lookup): Replace flags with want and
2714 hidden fields. Adjust constructors.
2715 (name_lookyp::add_overload): Correct hidden stripping test. Update
2716 for new LOOK_want type.
2717 (name_lookup::process_binding): Likewise.
2718 (name_lookup::search_unqualified): Use hidden flag.
2719 (identifier_type_value_1): Adjust lookup_name_real call.
2720 (set_decl_namespace): Adjust name_lookup ctor.
2721 (lookup_flags): Delete.
2722 (qualify_lookup): Add LOOK_want parm, adjust.
2723 (lookup_qualified_name): Replace prefer_type parm with LOOK_want.
2724 (lookup_name_real_1): Replace prefer_type and namespaces_only with
2725 LOOK_want parm.
2726 (lookup_name_real): Likewise.
2727 (lookup_name_nonclass, lookup_name): Adjust lookup_name_real call.
2728 (lookup_name_prefer_type): Rename to ...
2729 (lookup_name): ... here. New overload with LOOK_want parm.
2730 (lookup_type_scope_1): Adjust qualify_lookup calls.
2731 * call.c (build_operator_new_call)
2732 (add_operator_candidates): Adjust lookup_name_real calls.
2733 * coroutines.cc (find_coro_traits_template_decl)
2734 (find_coro_handle_template_decl, morph_fn_to_coro): Adjust
2735 lookup_qualified_name calls.
2736 * cp-objcp-common.c (identifier_global_tag): Likewise.
2737 * decl.c (get_tuple_size, get_tuple_decomp_init): Likewise.
2738 (lookup_and_check_tag): Use lookup_name overload.
2739 * parser.c (cp_parser_userdef_numeric_literal): Adjust
2740 lookup_qualified_name call.
2741 (prefer_arg_type): Drop template_mem_access parm, return LOOK_want
2742 value.
2743 (cp_parser_lookup_name): Adjust lookup_member, lookup_name_real
2744 calls.
2745 * pt.c (check_explicit_specialization): Adjust lookup_qualified_name
2746 call.
2747 (tsubst_copy_and_build, tsubst_qualified_name): Likewise
2748 (deduction_guides_for): Likewise.
2749 (tsubst_friend_class): Adjust lookup_name_real call.
2750 (lookup_init_capture, tsubst_expr): Likewise.
2751 * rtti.c (emit_support_tinfos): Adjust lookup_qualified_name call.
2752 * semantics.c (omp_reduction_lookup): Likewise.
2753 (capture_decltype): Adjust lookup_name_real call.
2754
2755 2020-08-13 Nathan Sidwell <nathan@acm.org>
2756
2757 * name-lookup.h (enum class LOOK_where): New.
2758 (operator|, operator&): Overloads for it.
2759 (lookup_name_real): Replace NONCLASS & BLOCK_P parms with WHERE.
2760 * name-lookup.c (identifier_type_value_w): Adjust
2761 lookup_name_real call.
2762 (lookup_name_real_1): Replace NONCLASS and BLOCK_P parameters
2763 with WHERE bitmask. Don't search namespaces if not asked to.
2764 (lookup_name_real): Adjust lookup_name_real_1 call.
2765 (lookup_name_nonclass, lookup_name)
2766 (lookup_name_prefer_type): Likewise.
2767 * call.c (build_operator_new_call)
2768 (add_operator_candidates): Adjust lookup_name_real calls.
2769 * parser.c (cp_parser_lookup_name): Likewise.
2770 * pt.c (tsubst_friend_class, lookup_init_capture_pack)
2771 (tsubst_expr): Likewise.
2772 * semantics.c (capture_decltype): Likewise.
2773
2774 2020-08-13 Marek Polacek <polacek@redhat.com>
2775
2776 PR c++/92812
2777 * typeck.c (build_static_cast_1): Implement P1975R0 by allowing
2778 static_cast to aggregate type.
2779
2780 2020-08-10 Jakub Jelinek <jakub@redhat.com>
2781
2782 PR c++/96497
2783 * constexpr.c (cxx_eval_binary_expression): For SPACESHIP_EXPR, tail
2784 call cxx_eval_constant_expression after genericize_spaceship to avoid
2785 undesirable further VERIFY_CONSTANT.
2786
2787 2020-08-10 Patrick Palka <ppalka@redhat.com>
2788
2789 * pt.c (resolve_overloaded_unification): Drop functions with
2790 unsatisfied constraints.
2791 (resolve_nondeduced_context): Likewise.
2792
2793 2020-08-05 Patrick Palka <ppalka@redhat.com>
2794 Jason Merrill <jason@redhat.com>
2795
2796 PR c++/96282
2797 * constexpr.c (cxx_eval_vec_init_1): Truncate ctx->ctor and
2798 then clear CONSTRUCTOR_NO_CLEARING on each appended element
2799 initializer if we're initializing a previously zero-initialized
2800 array object.
2801
2802 2020-08-04 Marek Polacek <polacek@redhat.com>
2803
2804 PR c++/96082
2805 * parser.c (cp_parser_elaborated_type_specifier): Allow
2806 'template' following ::.
2807
2808 2020-08-04 Nathan Sidwell <nathan@acm.org>
2809
2810 * parser.c (cp_parser_explicit_specialization): Refactor
2811 to avoid leak of num_template_parameter_lists value.
2812
2813 2020-08-04 Patrick Palka <ppalka@redhat.com>
2814
2815 PR c++/94024
2816 * init.c (sort_mem_initializers): Preserve TREE_TYPE of the
2817 member initializer list node.
2818 (emit_mem_initializers): Set input_location when performing each
2819 member initialization.
2820 * parser.c (cp_parser_mem_initializer): Attach the source
2821 location of this initializer to a dummy EMPTY_CLASS_EXPR
2822 within the TREE_TYPE of the list node.
2823 * pt.c (tsubst_initializer_list): Preserve TREE_TYPE of the
2824 member initializer list node.
2825
2826 2020-08-03 Marek Polacek <polacek@redhat.com>
2827
2828 * cp-tree.h (after_nsdmi_defaulted_late_checks): Remove.
2829
2830 2020-08-03 Marek Polacek <polacek@redhat.com>
2831
2832 DR 2032
2833 PR c++/96218
2834 * pt.c (check_default_tmpl_args): Also consider variable
2835 templates.
2836
2837 2020-07-31 Jakub Jelinek <jakub@redhat.com>
2838
2839 PR c++/96182
2840 * decl.c (finish_function): In constexpr functions use for C++14 and
2841 later error instead of warning if no return statement is present and
2842 diagnose it regardless of warn_return_type. Move the warn_return_type
2843 diagnostics earlier in the function.
2844
2845 2020-07-31 Martin Sebor <msebor@redhat.com>
2846
2847 PR c++/96003
2848 * class.c (build_base_path): Set no-warning bit on the synthesized
2849 conditional expression in static_cast.
2850
2851 2020-07-31 Richard Biener <rguenther@suse.de>
2852
2853 PR debug/96383
2854 * cp-objcp-common.h (LANG_HOOKS_FINALIZE_EARLY_DEBUG):
2855 Define to c_common_finalize_early_debug.
2856
2857 2020-07-31 Patrick Palka <ppalka@redhat.com>
2858
2859 PR c++/96197
2860 * constexpr.c (cxx_eval_constant_expression) <case CONST_DECL>:
2861 Pass false to decl_constant_value and decl_really_constant_value
2862 so that they don't unshare their result.
2863 * cp-tree.h (decl_constant_value): New declaration with an added
2864 bool parameter.
2865 (decl_really_constant_value): Add bool parameter defaulting to
2866 true to existing declaration.
2867 * init.c (constant_value_1): Add bool parameter which controls
2868 whether to unshare the initializer before returning. Call
2869 unshare_expr at most once.
2870 (scalar_constant_value): Pass true to constant_value_1's new
2871 bool parameter.
2872 (decl_really_constant_value): Add bool parameter and forward it
2873 to constant_value_1.
2874 (decl_constant_value): Likewise, but instead define a new
2875 overload with an added bool parameter.
2876
2877 2020-07-30 Patrick Palka <ppalka@redhat.com>
2878
2879 PR c++/64194
2880 * pt.c (resolve_overloaded_unification): If the function
2881 template specialization has a placeholder return type,
2882 then instantiate it before attempting unification.
2883
2884 2020-07-30 Patrick Palka <ppalka@redhat.com>
2885
2886 PR c++/95486
2887 * pt.c (alias_ctad_tweaks): Call remove_constraints before
2888 calling set_constraints.
2889
2890 2020-07-30 Patrick Palka <ppalka@redhat.com>
2891
2892 PR c++/96106
2893 * pt.c (reduce_template_parm_level): Propagate DECL_VIRTUAL_P
2894 from the original TEMPLATE_PARM_DECL to the new lowered one.
2895
2896 2020-07-30 Patrick Palka <ppalka@redhat.com>
2897
2898 PR c++/96164
2899 * constraint.cc (constraints_satisfied_p): Return true if
2900 !flags_concepts.
2901 * pt.c (do_type_instantiation): Update a paragraph taken from
2902 [temp.explicit] to reflect the latest specification. Don't
2903 instantiate a member with unsatisfied constraints.
2904
2905 2020-07-29 Jason Merrill <jason@redhat.com>
2906
2907 PR c++/91427
2908 * cp-tree.h (IMPLICIT_RVALUE_P): New.
2909 (enum cp_lvalue_kind_flags): Add clk_implicit_rval.
2910 (implicit_rvalue_p, set_implicit_rvalue_p): New.
2911 * call.c (reference_binding): Check clk_implicit_rval.
2912 (build_over_call): Adjust C++20 implicit move.
2913 * coroutines.cc (finish_co_return_stmt): Simplify implicit move.
2914 * except.c (build_throw): Adjust C++20 implicit move.
2915 * pt.c (tsubst_copy_and_build) [STATIC_CAST_EXPR]: Propagate
2916 IMPLICIT_RVALUE_P.
2917 * tree.c (lvalue_kind): Set clk_implicit_rval.
2918 * typeck.c (treat_lvalue_as_rvalue_p): Overhaul.
2919 (maybe_warn_pessimizing_move): Adjust.
2920 (check_return_expr): Adjust C++20 implicit move.
2921
2922 2020-07-29 Jason Merrill <jason@redhat.com>
2923
2924 PR c++/91212
2925 * call.c (build_over_call): Don't call a const ref
2926 overload for implicit move.
2927
2928 2020-07-28 Nathan Sidwell <nathan@acm.org>
2929
2930 * cp-gimplify.c (cp_genericize_r): Set IMPORTED_DECL's context.
2931 * cp-objcp-common.c (cp_pushdecl): Set decl's context.
2932 * decl.c (grokfndecl): Make DECL_CONTEXT setting clearer.
2933
2934 2020-07-28 Nathan Sidwell <nathan@acm.org>
2935
2936 * class.c (fixup_type_variants): Copy TYPE_SIZE and
2937 TYPE_SIZE_UINIT.
2938 (finish_struct): Call it.
2939
2940 2020-07-28 Nathan Sidwell <nathan@acm.org>
2941
2942 * ptree.c (cxx_print_decl): Better indentation.
2943
2944 2020-07-28 Jakub Jelinek <jakub@redhat.com>
2945 Mark Wielaard <mark@klomp.org>
2946
2947 PR c++/96328
2948 * parser.c (cp_lexer_safe_previous_token): Don't call
2949 cp_lexer_previous_token, instead inline it by hand and return NULL
2950 instead of failing assertion if all previous tokens until the first
2951 one are purged.
2952 (cp_parser_error_1): Optimize - only call cp_lexer_safe_previous_token
2953 if token->type is CPP_NAME. Use cp_lexer_safe_previous_token instead
2954 of cp_lexer_previous_token for the missing_token_desc != RT_NONE
2955 case too.
2956
2957 2020-07-27 Nathan Sidwell <nathan@acm.org>
2958
2959 * cp-tree.h (enum cp_tree_index): Add CPTI_AS_BASE_IDENTIFIER.
2960 (as_base_identifier): Define.
2961 * decl.c (initialize_predifined_identifiers): Initialize as_base
2962 identifier.
2963 * class.c (layout_class_type): Name the as-base type. Zap
2964 NSDMI its fields may have.
2965
2966 2020-07-22 Nathan Sidwell <nathan@acm.org>
2967
2968 * class.c (maybe_add_class_template_decl_list): Don't add CONST_DECLs.
2969
2970 2020-07-22 Nathan Sidwell <nathan@acm.org>
2971
2972 * typeck.c (structural_comptypes): [DECLTYPE_TYPE] break
2973 apart complex if.
2974 [UNDERLYING_TYPE]: Use an if.
2975 [TYPEOF_TYPE]: New.
2976
2977 2020-07-22 Nathan Sidwell <nathan@acm.org>
2978
2979 * decl.c (decls_match): Move variables into scopes
2980 they're needed in.
2981 (duplicate_decls): Use STRIP_TEMPLATE.
2982 (build_typename_type): Move var decls to their assignments.
2983 (begin_function_body): Likewise.
2984 * decl2.c (get_guard): Likewise.
2985 (mark_used): Use true for truthiness.
2986 * error.c (dump_aggr_type): Hold the decl in a var called
2987 'decl', not 'name'.
2988
2989 2020-07-22 Nathan Sidwell <nathan@acm.org>
2990
2991 * cp-tree.h (struct tree_lambda_expr): Shrink
2992 default_capture_mode & discriminator.
2993
2994 2020-07-22 Nathan Sidwell <nathan@acm.org>
2995
2996 * mangle.c (decl_is_template_id): Rename to ...
2997 (maybe_template_info): ... here. Return the template info,
2998 rather than use a pointer. Adjust all callers.
2999 (find_substitution): Use template_args_equal, rather than
3000 local check.
3001
3002 2020-07-22 Tobias Burnus <tobias@codesourcery.com>
3003
3004 * parser.c (cp_parser_omp_clause_hint): Require nonnegative hint.
3005 (cp_parser_omp_critical): Permit hint(0) clause without named critical.
3006 * pt.c (tsubst_expr): Re-check the latter for templates.
3007
3008 2020-07-21 Sunil K Pandey <skpgkp2@gmail.com>
3009
3010 PR target/95237
3011 * decl.c (cp_finish_decl): Call target hook
3012 lower_local_decl_alignment to lower local decl alignment.
3013
3014 2020-07-21 Nathan Sidwell <nathan@acm.org>
3015
3016 * parser.c (cp_lexer_consume_token): Drop PRAGMA_EOL assert.
3017 (cp_parser_skip_to_closing_parenthesis_1): Only pass start token
3018 to pragma skipper if recovering.
3019 (cp_parser_skip_to_pragma_eol): Only purge and change pragma
3020 state when recovering.
3021
3022 2020-07-20 Jason Merrill <jason@redhat.com>
3023
3024 * pt.c (type_dependent_expression_p): A pseudo-dtor can be
3025 dependent.
3026 * semantics.c (finish_call_expr): Use build_trivial_dtor_call for
3027 pseudo-destructor.
3028 (finish_pseudo_destructor_expr): Leave type NULL for dependent arg.
3029
3030 2020-07-20 Jason Merrill <jason@redhat.com>
3031
3032 * mangle.c (write_base_ref): New.
3033 (write_expression): Use it for base field COMPONENT_REFs.
3034 * pt.c (invalid_tparm_referent_p): Canonicalize the type
3035 of array offsets. Allow subobjects.
3036
3037 2020-07-20 Jason Merrill <jason@redhat.com>
3038
3039 * pt.c (collect_ctor_idx_types): Add 'const' when deducing from
3040 a string constant.
3041
3042 2020-07-17 Marek Polacek <polacek@redhat.com>
3043
3044 PR c++/79815
3045 * decl.c (grokdeclarator): Detect cv-qual decltype(auto).
3046 * pt.c (do_auto_deduction): Likewise.
3047
3048 2020-07-16 Iain Sandoe <iain@sandoe.co.uk>
3049
3050 PR c++/95591
3051 PR c++/95599
3052 PR c++/95823
3053 PR c++/95824
3054 PR c++/95895
3055 * coroutines.cc (struct coro_ret_data): Delete.
3056 (coro_maybe_expand_co_return): Delete.
3057 (co_return_expander): Delete.
3058 (expand_co_returns): Delete.
3059 (co_await_find_in_subtree): Remove unused name.
3060 (build_actor_fn): Remove unused parm, remove handling
3061 for co_return expansion.
3062 (register_await_info): Demote duplicate info message to a
3063 warning.
3064 (coro_make_frame_entry): Move closer to use site.
3065 (struct susp_frame_data): Add fields for final suspend label
3066 and a flag to indicate await expressions with initializers.
3067 (captures_temporary): Delete.
3068 (register_awaits): Remove unused code, update comments.
3069 (find_any_await): New.
3070 (tmp_target_expr_p): New.
3071 (struct interesting): New.
3072 (find_interesting_subtree): New.
3073 (struct var_nest_node): New.
3074 (flatten_await_stmt): New.
3075 (handle_nested_conditionals): New.
3076 (process_conditional): New.
3077 (replace_statement_captures): Rename to...
3078 (maybe_promote_temps): ... this.
3079 (maybe_promote_captured_temps): Delete.
3080 (analyze_expression_awaits): Check for await expressions with
3081 initializers. Simplify handling for truth-and/or-if.
3082 (expand_one_truth_if): Simplify (map cases that need expansion
3083 to COND_EXPR).
3084 (await_statement_walker): Handle CO_RETURN_EXPR. Simplify the
3085 handling for truth-and/or-if expressions.
3086 (register_local_var_uses): Ensure that we create names in the
3087 implementation namespace.
3088 (morph_fn_to_coro): Add final suspend label to suspend frame
3089 callback data and remove it from the build_actor_fn call.
3090
3091 2020-07-16 Marek Polacek <polacek@redhat.com>
3092
3093 * call.c (convert_like): Remove macro and introduce a new
3094 wrapper instead.
3095 (convert_like_with_context): Likewise.
3096 (convert_like_real): Rename to convert_like.
3097 (convert_like_real_1): Rename to convert_like_internal. Call
3098 convert_like instead of convert_like_real therein.
3099 (perform_direct_initialization_if_possible): Call convert_like
3100 instead of convert_like_real.
3101
3102 2020-07-16 Iain Sandoe <iain@sandoe.co.uk>
3103
3104 * coroutines.cc: Correct some spelling errors
3105 in comments.
3106
3107 2020-07-15 Nathan Sidwell <nathan@acm.org>
3108
3109 * parser.c (cp_parser_declaration): Avoid copying tokens.
3110 (cp_parser_block_declaration): RAII token pointer.
3111
3112 2020-07-15 Nathan Sidwell <nathan@acm.org>
3113
3114 * parser.c (cp_parser_skip_to_closing_parenthesis_1): Deal with
3115 meeting a deferred pragma.
3116 (cp_parser_skip_to_end_of_statement): Likewise.
3117 (cp_parser_skip_to_end_of_block_or_statement): Likewise.
3118 (cp_parser_skip_to_pragma_eol): We should never meet EOF.
3119 (cp_parser_omp_declare_simd): Likewise.
3120 (cp_parser_omp_declare_reduction, cp_parser_oacc_routine)
3121 (pragma_lex): Likewise.
3122
3123 2020-07-14 Marek Polacek <polacek@redhat.com>
3124
3125 PR c++/95789
3126 PR c++/96104
3127 PR c++/96179
3128 * call.c (convert_like_real_1): Renamed from convert_like_real.
3129 (convert_like_real): New wrapper for convert_like_real_1.
3130
3131 2020-07-14 Nathan Sidwell <nathan@acm.org>
3132
3133 * parser.c (cp_lexer_alloc): Do not deal with PCH here.
3134 (cp_lexer_new_main): Deal with PCH here. Store the tokens directly
3135 into the buffer.
3136 (cp_lexer_new_from_tokens): Assert last token isn't purged either.
3137 (cp_lexer_get_preprocessor_token): Change first arg to flags, adjust.
3138 (cp_parser_new): Pass the lexer in, don't create it here.
3139 (cp_parser_translation_unit): Initialize access checks here.
3140 (cp_parser_initial_pragma): First token is provided by caller,
3141 don't deal with PCH stopping here. Adjust error message.
3142 (c_parse_file): Adjust, change error message to avoid C++20 module
3143 confusion.
3144
3145 2020-07-14 Nathan Sidwell <nathan@acm.org>
3146
3147 * ptree.c (cxx_print_type): Add TYPEOF_TYPE and BASES.
3148
3149 2020-07-14 Nathan Sidwell <nathan@acm.org>
3150
3151 * class.c (build_base_field_1): Cache CLASSTYPE_AS_BASE.
3152 (build_self_reference): Rename value -> decl.
3153 (dump_class_hierarchy_1): Cache CLASSTYPE_AS_BASE.
3154
3155 2020-07-14 Marek Polacek <polacek@redhat.com>
3156
3157 PR c++/95820
3158 * decl.c (grokdeclarator) <case cdk_function>: Check also
3159 pointers/references/... to functions.
3160
3161 2020-07-14 Nathan Sidwell <nathan@acm.org>
3162
3163 * cp-tree.h: Correct some tree lang flag comments,
3164 reformat some structure definitions. Note some structure
3165 sizes. Clarify some comments.
3166 (yyungetc): Delete. Not been a thing for some time.
3167 * class.c (copy_fndecl_with_name): Comment.
3168 (check_bases_and_members): Unnecessary {}.
3169 (layout_class_type): Comment.
3170 * cp-tree.def (UNBOUND_CLASS_TEMPLATE): Adjust comment.
3171 * decl.c: Fix some formatting & whitespace issues.
3172 (function_requirements_equivalent_p): Note why
3173 substitutions are needed.
3174 * decl2.c (no_linkage_error): Note that heroics about
3175 'typedef struct { ... };' are no longer needed.
3176 * method.c: Whitespace.
3177 * name-lookup.c: Whitespace.
3178 (add_decl_to_level): Reformat a line.
3179 (print_binding_stack): Mark as DEBUG_FUNCTION.
3180 (has_using_namespace_std_directive_p): Delete comment.
3181 * pt.c: Whitespace
3182 * ptree.c: Whitespace.
3183 * rtti.c: Whitespace & comment.
3184 * tree.c: Comment.
3185 * typeck.c (structural_comptypes): Add comment.
3186
3187 2020-07-13 Nathan Sidwell <nathan@acm.org>
3188
3189 * Make-lang.in (c++.disclean): Likewise.
3190
3191 2020-07-13 Marek Polacek <polacek@redhat.com>
3192
3193 PR c++/96077
3194 * parser.c (cp_parser_enum_specifier): Commit to tentative parse
3195 after we've seen an opening brace.
3196
3197 2020-07-10 Jason Merrill <jason@redhat.com>
3198
3199 * tree.c (structural_type_p): Allow unions.
3200 * mangle.c (write_expression): Express unions with a designator.
3201
3202 2020-07-10 Jason Merrill <jason@redhat.com>
3203
3204 * pt.c (convert_nontype_argument): Handle REAL_TYPE.
3205 (invalid_nontype_parm_type_p): Allow all structural types.
3206 * tree.c (structural_type_p): Use SCALAR_TYPE_P.
3207
3208 2020-07-10 Jason Merrill <jason@redhat.com>
3209
3210 PR c++/96105
3211 PR c++/96052
3212 PR c++/95976
3213 * class.c (check_field_decls): An array of empty classes is not an
3214 empty data member.
3215 (layout_empty_base_or_field): Handle explicit alignment.
3216 Fix union handling.
3217
3218 2020-07-09 Julian Brown <julian@codesourcery.com>
3219 Thomas Schwinge <thomas@codesourcery.com>
3220
3221 PR middle-end/95270
3222 * semantics.c (finish_omp_clauses): Likewise.
3223
3224 2020-07-09 Patrick Palka <ppalka@redhat.com>
3225
3226 PR c++/96132
3227 * constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
3228 Restore dependent_type_p check that guarded the call to
3229 is_really_empty_class.
3230
3231 2020-07-08 Patrick Palka <ppalka@redhat.com>
3232
3233 PR c++/95497
3234 * constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
3235 When processing_template_decl, check COMPLETE_TYPE_P before
3236 calling is_really_empty_class. Don't check dependent_type_p.
3237
3238 2020-07-08 Marek Polacek <polacek@redhat.com>
3239
3240 PR c++/96103
3241 * parser.c (cp_parser_decltype): Print error about using decltype(auto)
3242 in C++11. Check that the token following "auto" is ")".
3243
3244 2020-07-07 Patrick Palka <ppalka@redhat.com>
3245
3246 PR c++/95303
3247 * cxx-pretty-print.c (pp_cxx_unqualified_id): Check
3248 PRIMARY_TEMPLATE_P before printing the innermost template
3249 arguments.
3250
3251 2020-07-07 Martin Sebor <msebor@redhat.com>
3252
3253 PR c++/96063
3254 * parser.c (class_decl_loc_t::diag_mismatched_tags): Print notes only
3255 if warning_at returns nonzero.
3256
3257 2020-07-06 Martin Sebor <msebor@redhat.com>
3258
3259 PR c++/95984
3260 * call.c (build_over_call): Check calls only when tf_warning is set.
3261
3262 2020-07-06 Nathan Sidwell <nathan@acm.org>
3263
3264 * decl.c (push_library_fn): Return the decl pushdecl_toplevel returns.
3265 * except.c (verify_library_fn): Replace with ...
3266 (declare_library_fn_1): ... this fn. Always push the fn.
3267 (declare_library_fn): Call it.
3268 (build_throw): Call declare_library_fn_1.
3269
3270 2020-07-06 Jonathan Wakely <jwakely@redhat.com>
3271
3272 PR c++/96068
3273 * parser.c (cp_parser_toplevel_declaration): Only do pedwarn for
3274 empty-declaration in C++98.
3275
3276 2020-07-02 Jason Merrill <jason@redhat.com>
3277 Jakub Jelinek <jakub@redhat.com>
3278
3279 * decl.c (grokfndecl): Allow consteval virtual.
3280 * search.c (check_final_overrider): Check consteval mismatch.
3281 * constexpr.c (cxx_eval_thunk_call): New.
3282 (cxx_eval_call_expression): Call it.
3283 * cvt.c (cp_get_fndecl_from_callee): Handle FDESC_EXPR.
3284 * decl2.c (mark_vtable_entries): Track vtables with consteval.
3285 (maybe_emit_vtables): Pass consteval_vtables through.
3286 (clear_consteval_vfns): Replace consteval with nullptr.
3287 (c_parse_final_cleanups): Call it.
3288
3289 2020-07-01 Nathan Sidwell <nathan@acm.org>
3290
3291 * class.c (copy_fndecl_with_name): Add additional predicate args, do
3292 not deduce them locally.
3293 (copy_operator_fn): Adjust copy_fndecl_with_name call.
3294 (build_clone): Add vtt and inherited predicate args. Pass through
3295 to copy_fndecl_with_name call.
3296 (build_cdtor_clones): Likewise, pass through to build_clone as
3297 needed.
3298 (build_cdtor): Determine vtt and inherited here.
3299 * cp-tree.h (DECL_NEEDS_CTT_PARM_P): Delete.
3300
3301 2020-06-30 Nathan Sidwell <nathan@acm.org>
3302
3303 * cp-tree.h (copy_fndecl_with_name): Rename to ...
3304 (copy_operatorn_fn): ... this. Change arg type.
3305 (clone_function_decl): Rename to ...
3306 (clone_cdtor): ... this.
3307 * class.c (copy_fndecl_with_name): Make static.
3308 (copy_operator_fn): New wrapper.
3309 (build_clones): Rename to ...
3310 (build_cdtor_clones): ... this.
3311 (clone_function_decl): Rename to ...
3312 (clone_cdtor): ... this. Adjust build_clones calls.
3313 (clone_constructors_and_destructors): Adjust clone_function_decl
3314 calls.
3315 * method.c (implicitly_declare_fn): Adjust copy_fndecl_with_name
3316 call.
3317 (lazily_declare_fn): Adjust clone_function_decl call.
3318 * pt.c (tsubst_function_decl): Likewise.
3319 (instantiate_template_1): Likewise.
3320
3321 2020-06-30 Iain Sandoe <iain@sandoe.co.uk>
3322
3323 * coroutines.cc (morph_fn_to_coro): Remove trailing
3324 space in a diagnostic.
3325
3326 2020-06-30 Iain Sandoe <iain@sandoe.co.uk>
3327
3328 * coroutines.cc (expand_one_await_expression): Remove
3329 code dealing with initial suspend.
3330 (build_actor_fn): Remove code special-casing initial
3331 and final suspend. Handle the final suspend and marking
3332 of the coroutine as done.
3333 (coro_rewrite_function_body): New.
3334 (bind_expr_find_in_subtree): Remove.
3335 (coro_body_contains_bind_expr_p): Remove.
3336 (morph_fn_to_coro): Split the rewrite of the original
3337 function into coro_rewrite_function_body and call it.
3338
3339 2020-06-29 Marek Polacek <polacek@redhat.com>
3340
3341 PR c++/94553
3342 * decl.c (duplicate_decls): Make sure a concept or a variable
3343 template is unique in its declarative region.
3344
3345 2020-06-29 Marek Polacek <polacek@redhat.com>
3346
3347 PR c++/95568
3348 * pt.c (collect_ctor_idx_types): Use TREE_TYPE.
3349
3350 2020-06-28 Iain Sandoe <iain@sandoe.co.uk>
3351
3352 PR c++/95711
3353 * coroutines.cc (register_local_var_uses): Skip past
3354 namespace decls.
3355
3356 2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
3357
3358 PR c++/95736
3359 * coroutines.cc (get_awaitable_var): New helper.
3360 (build_co_await): Check more carefully before
3361 copying an awaitable.
3362 (expand_one_await_expression): No initializer
3363 is required when the awaitable is not a temp.
3364 (register_awaits): Remove handling that is now
3365 completed when the await expression is built.
3366
3367 2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
3368
3369 * coroutines.cc (morph_fn_to_coro): Diagnose unavailable
3370 get_return_object_on_allocation_failure.
3371
3372 2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
3373
3374 PR c++/95519
3375 * coroutines.cc (struct coroutine_info):Add a field
3376 to hold computed p.return_void expressions.
3377 (coro_build_promise_expression): New.
3378 (get_coroutine_return_void_expr): New.
3379 (finish_co_yield_expr): Build the promise expression
3380 using coro_build_promise_expression.
3381 (finish_co_return_stmt): Likewise.
3382 (build_init_or_final_await): Likewise.
3383 (morph_fn_to_coro): Likewise, for several cases.
3384
3385 2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
3386
3387 * coroutines.cc (morph_fn_to_coro): Handle error
3388 returns in building g-r-o-o-a-f expressions.
3389
3390 2020-06-24 Nicholas Krause <xerofoify@gmail.com>
3391
3392 PR c++/95672
3393 * typeck2.c (cxx_incomplete_type_diagnostic): Add missing
3394 TYPE_EXPANSION_PACK check for diagnosing incomplete types in
3395 cxx_incomplete_type_diagnostic.
3396
3397 2020-06-24 Iain Sandoe <iain@sandoe.co.uk>
3398
3399 PR c++/95518
3400 PR c++/95813
3401 * coroutines.cc (act_des_fn): Copy function
3402 attributes onto the outlined coroutine helpers.
3403
3404 2020-06-24 Jason Merrill <jason@redhat.com>
3405
3406 * call.c (build_over_call): Only call build_base_path once.
3407
3408 2020-06-24 Jason Merrill <jason@redhat.com>
3409
3410 PR c++/95719
3411 * call.c (build_over_call): Look up the overrider in base_binfo.
3412 * class.c (lookup_vfn_in_binfo): Look through BINFO_PRIMARY_P.
3413
3414 2020-06-23 Jason Merrill <jason@redhat.com>
3415
3416 PR c++/93976
3417 Implement C++20 P2082R1, Fixing CTAD for aggregates.
3418 * cp-tree.h (TPARMS_PRIMARY_TEMPLATE): Split out from...
3419 (DECL_PRIMARY_TEMPLATE): ...here.
3420 (builtin_guide_p): Declare.
3421 * decl.c (reshape_init_class): Handle bases of a template.
3422 (reshape_init_r): An array with dependent bound takes a single
3423 initializer.
3424 * pt.c (tsubst_default_argument): Shortcut {}.
3425 (unify_pack_expansion): Allow omitted arguments to trailing pack.
3426 (builtin_guide_p): New.
3427 (collect_ctor_idx_types): Give a trailing pack a {} default
3428 argument. Handle arrays better.
3429
3430 2020-06-23 Iain Sandoe <iain@sandoe.co.uk>
3431
3432 PR c++/95477
3433 * coroutines.cc (morph_fn_to_coro): Apply a cleanup to
3434 the get return object when the DTOR is non-trivial.
3435
3436 2020-06-20 Iain Sandoe <iain@sandoe.co.uk>
3437
3438 PR c++/95505
3439 * coroutines.cc (morph_fn_to_coro): Update handling of
3440 get-return-object-on-allocation-fail and diagnose missing
3441 std::nothrow.
3442
3443 2020-06-20 Jason Merrill <jason@redhat.com>
3444
3445 * call.c (joust): Only compare constraints for non-template
3446 candidates with matching parameters.
3447 * pt.c (tsubst_pack_expansion): Fix getting a type parameter
3448 pack.
3449 (more_specialized_fn): Only compare constraints for candidates with
3450 matching parameters.
3451
3452 2020-06-19 Jason Merrill <jason@redhat.com>
3453
3454 * method.c (early_check_defaulted_comparison): Allow defaulting
3455 comparison outside class. Complain if non-member operator isn't a
3456 friend.
3457
3458 2020-06-18 Jason Merrill <jason@redhat.com>
3459
3460 * method.c (early_check_defaulted_comparison): Check for &&.
3461 (build_comparison_op): Allow empty union. Diagnose non-category
3462 type.
3463 (common_comparison_type): Remove handling for non-category type.
3464
3465 2020-06-18 Marek Polacek <polacek@redhat.com>
3466
3467 PR c++/95735
3468 * pt.c (finish_template_variable): Return if
3469 coerce_innermost_template_parms return error_mark_node.
3470
3471 2020-06-18 Marek Polacek <polacek@redhat.com>
3472
3473 PR c++/95728
3474 * pt.c (tsubst_copy_and_build) <case NEW_EXPR>: Return error_mark_node
3475 if placement is erroneous.
3476
3477 2020-06-17 Jonathan Wakely <jwakely@redhat.com>
3478
3479 PR c++/66159
3480 * parser.c (cp_parser_elaborated_type_specifier): Do not warn
3481 unless in a declaration.
3482
3483 2020-06-17 Jason Merrill <jason@redhat.com>
3484
3485 * cp-tree.h (copy_fndecl_with_name): Declare.
3486 * class.c (copy_fndecl_with_name): Split out from...
3487 (build_clone): ...here.
3488 (add_implicitly_declared_members): Add op== to TYPE_FIELDS.
3489 * method.c (implicitly_declare_fn): Use copy_fndecl_with_name.
3490
3491 2020-06-17 Jason Merrill <jason@redhat.com>
3492
3493 * call.c (build_new_op_1): Don't look for a CALL_EXPR when
3494 calling a consteval function.
3495
3496 2020-06-17 Jason Merrill <jason@redhat.com>
3497
3498 * decl2.c (grokfield): Pass SD_DEFAULTED and SD_DELETED.
3499 * decl.c (duplicate_decls): Reduce error for delete
3500 after earlier declaration to pedwarn.
3501
3502 2020-06-17 Marek Polacek <polacek@redhat.com>
3503
3504 PR c++/95508
3505 * constexpr.c (maybe_fold_non_dependent_expr): New.
3506 * cp-tree.h (maybe_fold_non_dependent_expr): Declare.
3507 * typeck.c (cp_build_array_ref): Call maybe_fold_non_dependent_expr
3508 instead of maybe_constant_value.
3509
3510 2020-06-16 Marek Polacek <polacek@redhat.com>
3511
3512 PR c++/95369
3513 * call.c (add_list_candidates): Return if a designated initializer
3514 is used with a non-aggregate.
3515 (implicit_conversion_error): Give an error for the case above.
3516
3517 2020-06-16 Marek Polacek <polacek@redhat.com>
3518
3519 PR c++/95560
3520 * name-lookup.c (check_local_shadow): Check if types are
3521 non-null before calling same_type_p.
3522
3523 2020-06-16 Jakub Jelinek <jakub@redhat.com>
3524
3525 * semantics.c (handle_omp_for_class_iterator): Adjust
3526 c_omp_check_loop_iv_exprs caller.
3527 (finish_omp_for): Likewise. Don't call fold_build_cleanup_point_expr
3528 before calling c_finish_omp_for and c_omp_check_loop_iv, move it
3529 after those calls.
3530 * pt.c (tsubst_omp_for_iterator): Handle non-rectangular loops.
3531
3532 2020-06-16 Jakub Jelinek <jakub@redhat.com>
3533
3534 * parser.c (cp_parser_omp_clause_schedule): Reject modifier separated
3535 from kind by comma rather than colon.
3536
3537 2020-06-16 Patrick Palka <ppalka@redhat.com>
3538
3539 * pt.c (perform_instantiation_time_access_checks): No need to
3540 tsubst into decl.
3541 * semantics.c (enforce_access): Verify that decl is not
3542 dependent.
3543
3544 2020-06-16 Patrick Palka <ppalka@redhat.com>
3545
3546 PR c++/41437
3547 PR c++/47346
3548 * cp-tree.h (qualified_typedef_usage_s): Delete.
3549 (qualified_typedef_usage_t): Delete.
3550 (deferred_access_check): Move up in file.
3551 (tree_template_info::typedefs_needing_access_checking): Delete.
3552 (tree_template_info::deferred_access_checks): New field.
3553 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): Rename to ...
3554 (TI_DEFERRED_ACCESS_CHECKS): ... this, and adjust accordingly.
3555 * pt.c (perform_typedefs_access_check): Rename to ...
3556 (perform_instantiation_time_access_checks): ... this, and adjust
3557 accordingly. Remove unnecessary tree tests.
3558 (instantiate_class_template_1): Adjust accordingly.
3559 (instantiate_decl): Likewise.
3560 * semantics.c (enforce_access): Likewise.
3561
3562 2020-06-16 Patrick Palka <ppalka@redhat.com>
3563
3564 PR c++/41437
3565 PR c++/47346
3566 * call.c (enforce_access): Move to semantics.c.
3567 * cp-tree.h (enforce_access): Delete.
3568 (get_types_needing_access_check): Delete.
3569 (add_typedef_to_current_template_for_access_check): Delete.
3570 * decl.c (make_typename_type): Adjust accordingly. Use
3571 check_accessibility_of_qualified_id instead of directly using
3572 perform_or_defer_access_check.
3573 * parser.c (cp_parser_template_declaration_after_parameters):
3574 Don't push a dk_no_check access state when parsing a template.
3575 * pt.c (get_types_needing_access_check): Delete.
3576 (append_type_to_template_for_access_check_1): Delete.
3577 (perform_typedefs_access_check): Adjust. If type_decl is a
3578 FIELD_DECL, also check its DECL_CONTEXT for dependence. Use
3579 tsubst_copy instead of tsubst to substitute into type_decl so
3580 that we substitute into the DECL_CONTEXT of a FIELD_DECL.
3581 (append_type_to_template_for_access_check): Delete.
3582 * search.c (accessible_p): Remove the processing_template_decl
3583 early exit.
3584 * semantics.c (enforce_access): Moved from call.c. If we're
3585 parsing a template and the access check failed, add the check to
3586 TI_TYPEDEFS_NEEDING_ACCESS_CHECKING.
3587 (perform_or_defer_access_check): Adjust comment.
3588 (add_typedef_to_current_template_for_access_check): Delete.
3589 (check_accessibility_of_qualified_id): Adjust accordingly.
3590 Exit early if the scope is dependent.
3591
3592 2020-06-11 Patrick Palka <ppalka@redhat.com>
3593
3594 PR c++/93467
3595 * constraint.cc (associate_classtype_constraints): If there is a
3596 discrepancy between the current template depth and the template
3597 depth of the original declaration, then adjust the template
3598 parameter depth within the current constraints appropriately.
3599 * pt.c (tsubst_friend_class): Substitute into and set the
3600 constraints on the injected declaration.
3601
3602 2020-06-11 Iain Sandoe <iain@sandoe.co.uk>
3603
3604 * coroutines.cc (instantiate_coro_traits): Pass a reference
3605 to lambda closure objects to traits instantiation.
3606 (morph_fn_to_coro): Likewise for promise parameter
3607 preview and allocator lookup.
3608
3609 2020-06-10 Iain Sandoe <iain@sandoe.co.uk>
3610
3611 PR c++/95440
3612 * call.c (add_candidates): Use vec_safe_length() for
3613 testing the arguments list.
3614 (build_new_method_call_1): Use vec_safe_is_empty() when
3615 checking for an empty args list.
3616
3617 2020-06-10 Marek Polacek <polacek@redhat.com>
3618
3619 PR c++/95562
3620 * parser.c (cp_parser_direct_declarator): Clear
3621 CP_PARSER_FLAGS_DELAY_NOEXCEPT if the declarator kind is not
3622 cdk_id.
3623
3624 2020-06-09 Iain Sandoe <iain@sandoe.co.uk>
3625
3626 PR c++/95137
3627 * coroutines.cc (expand_one_await_expression): Build separate
3628 DTOR trees for the awaitable object on the destroy and resume
3629 paths.
3630
3631 2020-06-09 Jason Merrill <jason@redhat.com>
3632
3633 PR c++/95552
3634 * cp-gimplify.c (predeclare_vla): Only predeclare a VLA if it's
3635 wrapped in a pointer type.
3636
3637 2020-06-05 Marek Polacek <polacek@redhat.com>
3638
3639 PR c++/95369
3640 * call.c (build_converted_constant_expr_internal): Allow
3641 list-initialization.
3642
3643 2020-06-05 Iain Sandoe <iain@sandoe.co.uk>
3644
3645 * cp-tree.def (CO_RETURN_EXPR): Correct the class
3646 to use tcc_statement.
3647
3648 2020-06-05 Jason Merrill <jason@redhat.com>
3649
3650 * error.c (dump_binary_op): Handle negative operand to
3651 POINTER_PLUS_EXPR.
3652
3653 2020-06-04 Jason Merrill <jason@redhat.com>
3654
3655 PR c++/93310
3656 * constexpr.c (cxx_eval_constant_expression) [OBJ_TYPE_REF]:
3657 Evaluate OBJ_TYPE_REF_EXPR.
3658
3659 2020-06-04 Jason Merrill <jason@redhat.com>
3660
3661 PR c++/95158
3662 * class.c (lookup_vfn_in_binfo): New.
3663 * call.c (build_over_call): Use it.
3664 * cp-tree.h (resolves_to_fixed_type_p): Add default argument.
3665 (lookup_vfn_in_binfo): Declare.
3666
3667 2020-06-04 Iain Sandoe <iain@sandoe.co.uk>
3668
3669 PR c++/95346
3670 * coroutines.cc (morph_fn_to_coro): Ensure that the get-
3671 return-object is constructed correctly; When it is not the
3672 final return value, pass it to the CTOR of the return type
3673 as an rvalue, per the standard comment.
3674
3675 2020-06-04 Jakub Jelinek <jakub@redhat.com>
3676
3677 PR c++/82304
3678 PR c++/95307
3679 * constexpr.c (cxx_eval_constant_expression): Diagnose CONVERT_EXPR
3680 conversions from pointer types to arithmetic types here...
3681 (cxx_eval_outermost_constant_expr): ... instead of here.
3682
3683 2020-06-03 Mark Wielaard <mark@klomp.org>
3684
3685 * parser.c (cp_lexer_safe_previous_token): New function.
3686 (cp_parser_error_1): Add name_hint if the previous token is
3687 a string literal and next token is a CPP_NAME and we have a
3688 missing header suggestion for the name.
3689
3690 2020-06-03 Patrick Palka <ppalka@redhat.com>
3691
3692 * pt.c (process_partial_specialization): Pass the full set of
3693 generic template arguments to strictly_subsumes.
3694
3695 2020-06-03 Patrick Palka <ppalka@redhat.com>
3696
3697 PR c++/92103
3698 * pt.c (most_specialized_partial_spec): Reorganize the loop over
3699 DECL_TEMPLATE_SPECIALIZATIONS. Check constraints_satisfied_p on
3700 the original template declaration, not on the tsubsted one.
3701
3702 2020-06-03 Iain Sandoe <iain@sandoe.co.uk>
3703
3704 PR c++/95345
3705 * coroutines.cc (finish_co_await_expr): Revise to allow for
3706 parameter packs.
3707 (finish_co_yield_expr): Likewise.
3708
3709 2020-06-03 Jason Merrill <jason@redhat.com>
3710
3711 PR c++/95232
3712 * cp-tree.h (predeclare_vla): Declare.
3713 * cp-gimplify.c (predeclare_vla): Handle getting a decl.
3714 * pt.c (tsubst_expr) [DECL_EXPR]: Use it.
3715
3716 2020-06-03 Tobias Burnus <tobias@codesourcery.com>
3717
3718 * cp-gimplify.c (cxx_omp_predetermined_mapping): New.
3719 * cp-objcp-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redfine.
3720 * cp-tree.h (cxx_omp_predetermined_mapping): Declare.
3721
3722 2020-06-02 Jason Merrill <jason@redhat.com>
3723
3724 PR c++/95193
3725 * pt.c (tsubst_decl): Relax assert.
3726
3727 2020-06-02 Iain Sandoe <iain@sandoe.co.uk>
3728
3729 PR c++/95050
3730 * coroutines.cc (build_co_await): Wrap the co_await expression
3731 in a TARGET_EXPR, where needed.
3732 (finish_co_yield_expr): Likewise.
3733
3734 2020-06-02 Patrick Palka <ppalka@redhat.com>
3735
3736 PR c++/92633
3737 PR c++/92838
3738 * pt.c (tsubst_function_decl): Don't do set_constraints when
3739 regenerating a lambda.
3740 (tsubst_lambda_expr): Substitute into the lambda's constraints
3741 and do set_constraints here.
3742
3743 2020-06-01 Jason Merrill <jason@redhat.com>
3744
3745 PR c++/95466
3746 PR c++/95311
3747 PR c++/95221
3748 * class.c (build_vfn_ref): Revert 95311 change.
3749 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): Build a
3750 COMPOUND_EXPR.
3751
3752 2020-06-01 Iain Sandoe <iain@sandoe.co.uk>
3753
3754 PR c++/95350
3755 * coroutines.cc (struct param_info): Remove rv_ref field.
3756 (build_actor_fn): Remove specifial rvalue ref handling.
3757 (morph_fn_to_coro): Likewise.
3758
3759 2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
3760
3761 PR c++/95087
3762 * coroutines.cc (morph_fn_to_coro): If we see an
3763 early fatal error, drop the erroneous function body.
3764
3765 2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
3766
3767 * coroutines.cc (build_co_await): Remove unused
3768 variable.
3769 (finish_co_await_expr): Likewise.
3770 (finish_co_yield_expr): Likewise; revise comment.
3771
3772 2020-05-30 Iain Sandoe <iain@sandoe.co.uk>
3773
3774 * coroutines.cc (morph_fn_to_coro): Revise initialization
3775 of the frame pointer to avoid an unused value.
3776
3777 2020-05-30 Patrick Palka <ppalka@redhat.com>
3778
3779 PR c++/95386
3780 * constraint.cc (satisfaction_value): Accept INTEGER_CST of any
3781 boolean type.
3782
3783 2020-05-29 Patrick Palka <ppalka@redhat.com>
3784 Jason Merrill <jason@redhat.com>
3785
3786 PR c++/95181
3787 * class.c (add_method): Let special member function templates
3788 coexist if they are not equivalently constrained, or in a class
3789 template.
3790
3791 2020-05-29 Jason Merrill <jason@redhat.com>
3792
3793 PR c++/95371
3794 * pt.c (process_template_parm): Set DECL_TEMPLATE_INFO
3795 on the DECL_TEMPLATE_RESULT.
3796
3797 2020-05-29 Marek Polacek <polacek@redhat.com>
3798
3799 PR c++/95344
3800 * cp-gimplify.c (cp_fold) <case MODIFY_EXPR>: Don't set
3801 TREE_THIS_VOLATILE here.
3802 (cp_fold): Set it here along with TREE_NO_WARNING.
3803
3804 2020-05-29 Jason Merrill <jason@redhat.com>
3805
3806 PR c++/95311
3807 PR c++/95221
3808 * class.c (build_vfn_ref): Don't fold the INDIRECT_REF.
3809
3810 2020-05-29 Patrick Palka <ppalka@redhat.com>
3811
3812 PR c++/92652
3813 PR c++/93698
3814 PR c++/94128
3815 * parser.c (cp_parser_requires_clause_expression): Temporarily
3816 increment processing_template_decl only if it is 0.
3817 (cp_parser_constraint_expression): Likewise.
3818 (cp_parser_requires_expression): Likewise.
3819
3820 2020-05-29 Patrick Palka <ppalka@redhat.com>
3821
3822 PR c++/95241
3823 * constexpr.c (get_or_insert_ctor_field): Add limited support
3824 for RANGE_EXPR index lookups.
3825
3826 2020-05-28 Jakub Jelinek <jakub@redhat.com>
3827
3828 PR c++/95328
3829 * decl.c (cp_finish_decomp): Call complete_type before checking
3830 COMPLETE_TYPE_P.
3831
3832 2020-05-28 Jason Merrill <jason@redhat.com>
3833
3834 PR c++/94926
3835 * decl.c (cp_finish_decl): Revert r9-297 change.
3836 (check_static_variable_definition): Likewise.
3837 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
3838 * pt.c (instantiate_decl): Return early on type error.
3839
3840 2020-05-27 Jason Merrill <jason@redhat.com>
3841
3842 PR c++/95319
3843 * decl.c (reshape_init_array_1): Don't reuse in overload context.
3844
3845 2020-05-27 Jason Merrill <jason@redhat.com>
3846
3847 PR c++/95242
3848 * call.c (build_new_op_1): Suppress
3849 warn_zero_as_null_pointer_constant across comparison of <=> result
3850 to 0.
3851
3852 2020-05-27 Jason Merrill <jason@redhat.com>
3853
3854 PR c++/95222
3855 * decl.c (grokdeclarator): Don't shift attributes in TYPENAME
3856 context.
3857
3858 2020-05-27 Nathan Sidwell <nathan@acm.org>
3859
3860 PR c++/95263
3861 * pt.c (lookup_template_class_1): Restore alias template mutation.
3862
3863 2020-05-26 Jakub Jelinek <jakub@redhat.com>
3864
3865 PR c++/95197
3866 * cp-gimplify.c: Include omp-general.h.
3867 (cp_genericize_r) <case OMP_DISTRIBUTE>: For class iteration
3868 variables in composite distribute parallel for, instantiate copy
3869 ctor of their types.
3870
3871 2020-05-23 Patrick Palka <ppalka@redhat.com>
3872
3873 PR c++/94038
3874 * constexpr.c (cxx_eval_constant_expression)
3875 <case TEMPLATE_ID_EXPR>: Don't evaluate the concept when
3876 constexpr evaluation is uid-sensitive.
3877
3878 2020-05-22 Jason Merrill <jason@redhat.com>
3879
3880 * cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Don't preevaluate
3881 the function address if the call used operator syntax.
3882
3883 2020-05-21 Jason Merrill <jason@redhat.com>
3884
3885 PR c++/95221
3886 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): For a virtual
3887 call, instrument the OBJ_TYPE_REF.
3888
3889 * decl.c (compute_array_index_type_loc): Diagnose expressions
3890 in a template that can't be constant.
3891 * parser.c (cp_parser_direct_declarator): Don't check
3892 non-constant array bounds here.
3893
3894 * cp-tree.h (is_rvalue_constant_expression): Declare.
3895 * constexpr.c (is_rvalue_constant_expression): New.
3896 * parser.c (cp_parser_constant_expression): Use it.
3897 * decl.c (cp_finish_decl): Try to treat a constexpr initializer in a
3898 template as constant.
3899
3900 * typeck.c (build_x_modify_expr): Handle error_mark_node arguments.
3901
3902 * decl.c (grokparms): Return NULL_TREE if any parms were erroneous.
3903
3904 2020-05-21 Iain Sandoe <iain@sandoe.co.uk>
3905
3906 * coroutines.cc (finish_co_return_stmt): Revert change to use
3907 finish_expr_stmt.
3908
3909 2020-05-21 Patrick Palka <ppalka@redhat.com>
3910
3911 PR c++/94038
3912 * constexpr.c (constexpr_ctx::uid_sensitive): Remove field.
3913 (uid_sensitive_constexpr_evaluation_value): Define.
3914 (uid_sensitive_constexpr_evaluation_true_counter): Define.
3915 (uid_sensitive_constexpr_evaluation_p): Define.
3916 (uid_sensitive_constexpr_evaluation_sentinel): Define its
3917 constructor.
3918 (uid_sensitive_constexpr_evaluation_checker): Define its
3919 constructor and its evaluation_restricted_p method.
3920 (get_fundef_copy): Remove 'ctx' parameter. Use u_s_c_e_p
3921 instead of constexpr_ctx::uid_sensitive.
3922 (cxx_eval_call_expression): Use u_s_c_e_p instead, and test it
3923 last. Adjust call to get_fundef_copy.
3924 (instantiate_cx_fn_r): Test u_s_c_e_p so that we increment the
3925 counter if necessary.
3926 (cxx_eval_outermost_constant_expr): Remove 'uid_sensitive'
3927 parameter. Adjust function body accordingly.
3928 (maybe_constant_value): Remove 'uid_sensitive' parameter and
3929 adjust function body accordingly. Set up a
3930 uid_sensitive_constexpr_evaluation_checker, and use it to
3931 conditionally update the cv_cache.
3932 * cp-gimplify.c (cp_fold): Set up a
3933 uid_sensitive_constexpr_evaluation_checker, and use it to
3934 conditionally update the fold_cache.
3935 * cp-tree.h (maybe_constant_value): Update declaration.
3936 (struct uid_sensitive_constexpr_evaluation_sentinel): Define.
3937 (struct sensitive_constexpr_evaluation_checker): Define.
3938 * expr.c (fold_for_warn): Set up a
3939 uid_sensitive_constexpr_evaluation_sentinel before calling
3940 the folding subroutines. Drop all but the first argument to
3941 maybe_constant_value.
3942
3943 2020-05-20 Marek Polacek <polacek@redhat.com>
3944
3945 DR 2237
3946 * parser.c (cp_parser_unqualified_id): Reject simple-template-id as
3947 the declarator-id of a destructor.
3948 (cp_parser_constructor_declarator_p): Reject simple-template-id as
3949 the declarator-id of a constructor.
3950
3951 2020-05-20 Marek Polacek <polacek@redhat.com>
3952
3953 DR 2289
3954 PR c++/94553
3955 * cp-tree.h (SD_DECOMPOSITION): New flag.
3956 * decl.c (duplicate_decls): Make sure a structured binding is unique
3957 in its declarative region.
3958 (start_decl): If INITIALIZED is SD_DECOMPOSITION, call
3959 fit_decomposition_lang_decl.
3960 (grokdeclarator): Compare INITIALIZED directly to SD_* flags.
3961 * parser.c (cp_parser_decomposition_declaration): Pass SD_DECOMPOSITION
3962 to start_decl.
3963
3964 2020-05-20 Patrick Palka <ppalka@redhat.com>
3965
3966 PR c++/95223
3967 * typeck.c (structural_comptypes): Don't perform
3968 context-dependent resolution of TYPENAME_TYPEs when
3969 comparing_specializations.
3970
3971 2020-05-19 Nathan Sidwell <nathan@acm.org>
3972
3973 * pt.c (lookup_template_class_1): Do not reinit template_info of an
3974 alias here.
3975
3976 2020-05-18 Martin Sebor <msebor@redhat.com>
3977
3978 PR c++/94923
3979 * call.c ((maybe_warn_class_memaccess): Use is_byte_access_type.
3980 * cp-tree.h (is_dummy_object): Return bool.
3981 (is_byte_access_type): Declare new function.
3982 * tree.c (is_dummy_object): Return bool.
3983 (is_byte_access_type): Define new function.
3984
3985 2020-05-19 Patrick Palka <ppalka@redhat.com>
3986
3987 PR c++/87847
3988 * pt.c (init_template_processing): Enable sanitization for
3989 decl_specializations and type_specializations.
3990
3991 PR c++/66439
3992 * pt.c (fn_type_unification): Pass 'fn' instead of NULL_TREE as
3993 the 'in_decl' parameter to coerce_template_parms.
3994
3995 2020-05-18 Marek Polacek <polacek@redhat.com>
3996
3997 PR c++/94955
3998 * typeck.c (cp_build_binary_op): Use fold_for_warn instead of
3999 cp_fold_rvalue.
4000
4001 2020-05-18 Marek Polacek <polacek@redhat.com>
4002
4003 PR c++/94937
4004 * cvt.c (cp_get_fndecl_from_callee): Return NULL_TREE if the function
4005 type is not INDIRECT_TYPE_P.
4006 * decl.c (omp_declare_variant_finalize_one): Call
4007 cp_get_callee_fndecl_nofold instead of looking for the function decl
4008 manually.
4009
4010 2020-05-18 Marek Polacek <polacek@redhat.com>
4011
4012 PR c++/90915
4013 * parser.c (cp_parser_has_attribute_expression): Sorry on a
4014 type-dependent argument.
4015
4016 2020-05-18 Marek Polacek <polacek@redhat.com>
4017
4018 DR 1512
4019 PR c++/87699
4020 * call.c (add_builtin_candidate) <case EQ_EXPR>: Create candidate
4021 operator functions when type is std::nullptr_t for ==/!=.
4022 * typeck.c (composite_pointer_type_r): Add a bool * parameter. Use it
4023 to maybe add "const" to the pointer type.
4024 (composite_pointer_type): Update the call to composite_pointer_type_r.
4025 (cp_build_binary_op): Turn two warning_at into error_at. Print the
4026 types.
4027
4028 2020-05-18 Jason Merrill <jason@redhat.com>
4029
4030 * call.c (build_over_call): Remove unnecessary
4031 cp_stabilize_reference.
4032
4033 2020-05-18 Marek Polacek <polacek@redhat.com>
4034
4035 * call.c (add_builtin_candidate): Don't create a builtin overload
4036 candidate for ++ when type is bool in C++17.
4037
4038 2020-05-18 Marek Polacek <polacek@redhat.com>
4039
4040 * cfns.h: Regenerated.
4041
4042 2020-05-17 Iain Sandoe <iain@sandoe.co.uk>
4043
4044 * coroutines.cc (morph_fn_to_coro): Initialize the gro variable.
4045
4046 2020-05-16 Iain Sandoe <iain@sandoe.co.uk>
4047
4048 * coroutines.cc (finish_co_return_stmt): Implement rules
4049 from [class.copy.elision] /3.
4050
4051 2020-05-16 Patrick Palka <ppalka@redhat.com>
4052
4053 PR c++/57943
4054 * semantics.c (finish_decltype_type): Call
4055 instantiate_non_dependent_expr_sfinae on the expression.
4056
4057 2020-05-15 Patrick Palka <ppalka@redhat.com>
4058
4059 Revert:
4060
4061 2020-04-07 Patrick Palka <ppalka@redhat.com>
4062
4063 PR c++/90996
4064 * typeck2.c (process_init_constructor_array): Propagate
4065 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
4066 the array initializer.
4067
4068 2020-05-15 Jason Merrill <jason@redhat.com>
4069
4070 PR c++/93286 - ICE with __is_constructible and variadic template.
4071 * pt.c (tsubst_tree_list): New.
4072 (tsubst, tsubst_copy_and_build): Use it.
4073 * decl2.c (is_late_template_attribute): Handle error_mark_node args.
4074
4075 2020-05-15 Nathan Sidwell <nathan@acm.org>
4076
4077 * pt.c (template_args_equal): Fix thinkos in previous 'cleanup'.
4078
4079 2020-05-14 Jason Merrill <jason@redhat.com>
4080
4081 PR c++/93901
4082 * pt.c (maybe_instantiate_noexcept): Change clone handling.
4083
4084 2020-05-14 Patrick Palka <ppalka@redhat.com>
4085
4086 PR c++/78446
4087 * call.c (build_op_call): Pass complain to lookup_fnfields.
4088 (build_special_member_call): Likewise.
4089 * class.c (type_requires_array_cookie): Pass tf_warning_or_error
4090 to lookup_fnfields.
4091 * cp-tree.h (lookup_fnfields): Add tsubst_flags_t parameter.
4092 * except.c (build_throw): Pass tf_warning_or_error to
4093 lookup_fnfields.
4094 * init.c (build_new_1): Pass complain to lookup_fnfields.
4095 * method.c (locate_fn_flags): Likewise.
4096 * name-lookup.c (lookup_name_real_1): Pass tf_warning_or_error
4097 to lookup_fnfields.
4098 * pt.c (tsubst_baselink): Pass complain to lookup_fnfields.
4099 * search.c (lookup_fnfields): New 'complain' parameter. Pass it
4100 to lookup_member.
4101
4102 2020-05-14 Nathan Sidwell <nathan@acm.org>
4103
4104 * parser.c (cp_parser_diagnose_invalid_typename): Mention
4105 std=c++20 not 2a, reformat dependent binfo inform loops.
4106
4107 * pt.c (tsubst_template_decl): Reorder and commonize some control
4108 paths.
4109
4110 * pt.c (tsubst_friend_function): Simplify control flow.
4111
4112 * pt.c (lookup_template_class_1): Remove unnecessary else by
4113 simply grabbing TYPE_NAME earlier.
4114
4115 * pt.c (push_template_decl_real): Adjust friend pushing logic.
4116 Reinit template type.
4117
4118 * pt.c (build_template_decl): Init DECL_TEMPLATE_RESULT &
4119 TREE_TYPE here ...
4120 (process_partial_specialization): ... not here ...
4121 (push_template_decl_real, add_inherited_template_parms)
4122 (build_deduction_guide): ... or here.
4123
4124 2020-05-14 Jakub Jelinek <jakub@redhat.com>
4125
4126 * cp-gimplify.c (cp_genericize_r): Set cfun->has_omp_target.
4127
4128 2020-05-13 Patrick Palka <ppalka@redhat.com>
4129
4130 PR c++/79706
4131 * init.c (build_vec_delete_1): Just return error_mark_node if
4132 deallocate_expr is error_mark_node.
4133 (build_delete): Just return error_mark_node if do_delete is
4134 error_mark_node.
4135
4136 2020-05-13 Patrick Palka <ppalka@redhat.com>
4137
4138 PR c++/95020
4139 * constraint.cc (tsubst_requires_expr): Produce a new
4140 requires-expression when processing_template_decl, even if
4141 template arguments are not dependent.
4142
4143 2020-05-13 Marek Polacek <polacek@redhat.com>
4144
4145 PR c++/95066
4146 * decl.c (duplicate_decls): Set DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
4147
4148 2020-05-13 Nathan Sidwell <nathan@acm.org>
4149
4150 * pt.c (template_args_equal): Reorder category checking for
4151 clarity.
4152
4153 * pt.c (perform_typedefs_access_check): Cache expensively
4154 calculated object references.
4155 (check_auto_in_tmpl_args): Just assert we do not get unexpected
4156 nodes, rather than silently do nothing.
4157 (append_type_to_template_for_access): Likewise, cache expensie
4158 object reference.
4159
4160 * pt.c (canonical_type_parameter): Simplify.
4161
4162 Formatting fixups & some simplifications.
4163 * pt.c (spec_hash_table): New typedef.
4164 (decl_specializations, type_specializations): Use it.
4165 (retrieve_specialization): Likewise.
4166 (register_specialization): Remove unnecessary casts.
4167 (push_template_decl_real): Reformat.
4168 (instantiate_class_template_1): Use more RAII.
4169 (make_argument_pack): Simplify.
4170 (instantiate_template_1): Use gcc_checking_assert for expensive
4171 asserts.
4172 (instantiate_decl): Likewise.
4173 (resolve_typename_type): Reformat comment.
4174 * semantics.c (struct deferred_access): Remove unnecessary GTY on
4175 member.
4176 (begin_class_definition): Fix formatting.
4177
4178 2020-05-13 Jason Merrill <jason@redhat.com>
4179
4180 * call.c, class.c, constexpr.c, constraint.cc, decl.c, init.c,
4181 lambda.c, lex.c, method.c, name-lookup.c, parser.c, pt.c, tree.c,
4182 typeck2.c: Change cxx2a to cxx20.
4183
4184 2020-05-12 Marek Polacek <polacek@redhat.com>
4185
4186 PR c++/95074
4187 * parser.c (cp_parser_postfix_expression) <case CPP_OPEN_PAREN>: When
4188 looking for a block-scope function declaration, look through the whole
4189 set, not just the first function in the overload set.
4190
4191 2020-05-12 Jakub Jelinek <jakub@redhat.com>
4192
4193 PR c++/95063
4194 * pt.c (tsubst_decl): Deal with DECL_OMP_PRIVATIZED_MEMBER for
4195 a bit-field.
4196
4197 2020-05-11 Jason Merrill <jason@redhat.com>
4198
4199 Resolve C++20 NB comment CA104
4200 * pt.c (determine_specialization): Compare constraints for
4201 specialization of member template of class instantiation.
4202
4203 2020-05-11 Jason Merrill <jason@redhat.com>
4204
4205 PR c++/92583
4206 PR c++/92654
4207 * tree.c (cp_walk_subtrees): Stop at typedefs.
4208 Handle TYPENAME_TYPE here.
4209 * pt.c (find_parameter_packs_r): Not here.
4210 (for_each_template_parm_r): Clear *walk_subtrees.
4211 * decl2.c (min_vis_r): Look through typedefs.
4212
4213 2020-05-11 Jason Merrill <jason@redhat.com>
4214
4215 * call.c (implicit_conversion_error): Split out from...
4216 (perform_implicit_conversion_flags): ...here.
4217 (build_converted_constant_expr_internal): Use it.
4218
4219 2020-05-11 Jason Merrill <jason@redhat.com>
4220
4221 PR c++/90748
4222 * parser.c (inject_parm_decls): Set current_class_ptr here.
4223 (cp_parser_direct_declarator): And here.
4224 (cp_parser_late_return_type_opt): Not here.
4225 (cp_parser_noexcept_specification_opt): Nor here.
4226 (cp_parser_exception_specification_opt)
4227 (cp_parser_late_noexcept_specifier): Remove unneeded parameters.
4228
4229 2020-05-11 Jason Merrill <jason@redhat.com>
4230
4231 * decl.c (cxx_init_decl_processing): Call declare_weak for
4232 __cxa_pure_virtual.
4233
4234 2020-05-11 Jason Merrill <jason@redhat.com>
4235
4236 * pt.c (instantiate_class_template_1): Call tsubst_expr for
4237 STATIC_ASSERT member.
4238 * ptree.c (cxx_print_xnode): Handle STATIC_ASSERT.
4239
4240 2020-05-11 Jason Merrill <jason@redhat.com>
4241
4242 * pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Remove redundant
4243 walking of capture list.
4244
4245 2020-05-11 Jason Merrill <jason@redhat.com>
4246
4247 * cp-tree.h (LOOKUP_EXPLICIT_TMPL_ARGS): Remove.
4248 * call.c (build_new_function_call): Don't set it.
4249 (build_new_method_call_1): Likewise.
4250 (build_over_call): Check cand->explicit_targs instead.
4251
4252 2020-05-11 Jason Merrill <jason@redhat.com>
4253
4254 * decl.c (compute_array_index_type_loc): Stabilize before building
4255 the MINUS_EXPR.
4256
4257 2020-05-11 Jason Merrill <jason@redhat.com>
4258
4259 * decl.c (grokdeclarator): Adjust deprecated_state here.
4260 (start_decl): Not here.
4261
4262 2020-05-08 Iain Sandoe <iain@sandoe.co.uk>
4263
4264 PR c++/95003
4265 * coroutines.cc (build_actor_fn): Ensure that bind scopes
4266 are marked as having side-effects where necessary.
4267 (replace_statement_captures): Likewise.
4268 (morph_fn_to_coro): Likewise.
4269
4270 2020-05-08 Nathan Sidwell <nathan@acm.org>
4271
4272 * NEWS: Delete, it is so stale.
4273
4274 * parser.c (cp_lexer_set_source_position_from_token): EOF has a
4275 location too.
4276
4277 2020-05-07 Iain Sandoe <iain@sandoe.co.uk>
4278
4279 PR c++/94817
4280 PR c++/94829
4281 * coroutines.cc (morph_fn_to_coro): Set unformed outline
4282 functions to error_mark_node. For early error returns suppress
4283 warnings about missing ramp return values. Fix reinstatement
4284 of the function body on pre-existing initial error.
4285 * decl.c (finish_function): Use the normal error path for fails
4286 in the ramp function, do not try to compile the helpers if the
4287 transform fails.
4288
4289 2020-05-07 Marek Polacek <polacek@redhat.com>
4290
4291 PR c++/94590 - Detect long double -> double narrowing.
4292 * typeck2.c (check_narrowing): Detect long double -> double
4293 narrowing even when double and long double have the same
4294 precision. Make it handle conversions to float too.
4295
4296 2020-05-07 Marek Polacek <polacek@redhat.com>
4297
4298 PR c++/94255
4299 * parser.c (cp_parser_class_specifier_1): Check that the scope is
4300 nested inside current scope before pushing it.
4301
4302 2020-05-07 Marek Polacek <polacek@redhat.com>
4303
4304 P1957R2
4305 * typeck2.c (check_narrowing): Consider T* to bool narrowing
4306 in C++11 and up.
4307
4308 2020-05-07 Marek Polacek <polacek@redhat.com>
4309
4310 * decl.c (grok_op_properties): Fix spelling of non-static.
4311 * typeck.c (build_class_member_access_expr): Likewise.
4312
4313 2020-05-07 Richard Biener <rguenther@suse.de>
4314
4315 PR middle-end/94703
4316 * optimize.c (update_cloned_parm): Copy DECL_NOT_GIMPLE_REG_P.
4317
4318 2020-05-06 Marek Polacek <polacek@redhat.com>
4319
4320 PR c++/94938
4321 * pt.c (tsubst_copy_and_build): Call type_dependent_expression_p_push
4322 instead of uses_template_parms. Move the warning_sentinels after the
4323 RECURs.
4324
4325 2020-05-06 Jakub Jelinek <jakub@redhat.com>
4326
4327 PR c++/94951
4328 * typeck.c (cp_strict_aliasing_warning): New function.
4329 (cp_build_indirect_ref_1, build_reinterpret_cast_1): Use
4330 it instead of strict_aliasing_warning.
4331
4332 PR c++/94907
4333 * method.c (defaulted_late_check): Don't call synthesize_method
4334 on constexpr sfk_comparison if it has been called on it already.
4335
4336 2020-05-06 Nathan Sidwell <nathan@acm.org>
4337
4338 PR c++/94946
4339 * decl.c (grokdeclarator): Don't splice template attributes in
4340 parm context -- they can apply to the parm.
4341
4342 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
4343
4344 * coroutines.cc: Remove references to n4849 throughout.
4345
4346 2020-05-05 Jason Merrill <jason@redhat.com>
4347
4348 CWG 2235
4349 * pt.c (more_specialized_fn): Do consider parms with no deducible
4350 template parameters.
4351
4352 2020-05-05 Jason Merrill <jason@redhat.com>
4353
4354 PR c++/90212
4355 * constexpr.c (potential_constant_expression_1): In a lambda
4356 function, consider a captured variable directly.
4357
4358 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
4359
4360 * coroutines.cc (transform_await_wrapper): Check that we have
4361 no unlowered co_yields.
4362 (captures_temporary): Likewise.
4363 (register_awaits): Likewise.
4364
4365 2020-05-05 Nathan Sidwell <nathan@acm.org>
4366
4367 PR c++/94807
4368 * coroutines.cc (morph_fn_to_coro): Just check for
4369 closure_identifier.
4370 * pt.c (tsubst_function_decl): Update lambda fn's this_ptr name.
4371
4372 2020-05-05 Marek Polacek <polacek@redhat.com>
4373 Jason Merrill <jason@redhat.com>
4374
4375 PR c++/94799
4376 * parser.c (cp_parser_postfix_dot_deref_expression): If we have
4377 a type-dependent object of class type, stash it to
4378 parser->context->object_type. If the postfix expression doesn't have
4379 a type, use typeof.
4380 (cp_parser_class_name): Consider object scope too.
4381 (cp_parser_lookup_name): Remove code dealing with the case when
4382 object_type is unknown_type_node.
4383
4384 2020-05-04 Patrick Palka <ppalka@redhat.com>
4385
4386 PR c++/94038
4387 * cp-gimplify.c (cp_fold) <case CALL_EXPR>: Move some variable
4388 declarations closer to their uses. Copy the CALL_EXPR only
4389 when one of its arguments has changed.
4390 <case TREE_VEC>: Instead of first collecting the folded
4391 arguments into a releasing_vec, just make a copy of the TREE_VEC
4392 as soon as folding changes one of its arguments.
4393
4394 2020-05-04 Iain Sandoe <iain@sandoe.co.uk>
4395
4396 * coroutines.cc (morph_fn_to_coro): Mark the coro.gro variable
4397 as artificial and ignored.
4398
4399 2020-05-04 Nathan Sidwell <nathan@acm.org>
4400
4401 pt.c (process_template_parm): Don't walk the template list twice,
4402 remember the final node instead.
4403 (end_template_parm_list): Refactor. Comment on why we do a pop
4404 and a push.
4405
4406 PR c++/94827 -- don't save parms in nested requirement
4407 * constraint.cc (tsubst_nested_requirement): TYPE directly holds
4408 notmalized requirement.
4409 (finish_nested_requirement): Don't stash current tpl parms into
4410 the requirement.
4411 (diagnose_nested_requirement): TYPE directly holds notmalized
4412 requirement.
4413
4414 2020-05-01 Patrick Palka <ppalka@redhat.com>
4415
4416 PR c++/90880
4417 * cp-tree.h (check_accessibility_of_qualified_id): Add
4418 tsubst_flags_t parameter and change return type to bool.
4419 * parser.c (cp_parser_lookup_name): Pass tf_warning_to_error to
4420 check_accessibility_of_qualified_id.
4421 * pt.c (tsubst_qualified_id): Return error_mark_node if
4422 check_accessibility_of_qualified_id returns false.
4423 * semantics.c (check_accessibility_of_qualified_id): Add
4424 complain parameter. Pass complain instead of
4425 tf_warning_or_error to perform_or_defer_access_check. Return
4426 true unless perform_or_defer_access_check returns false.
4427
4428 2020-05-01 Marek Polacek <polacek@redhat.com>
4429
4430 PR c++/94885
4431 * typeck2.c (process_init_constructor_record): Return PICFLAG_ERRONEOUS
4432 if an initializer element was erroneous.
4433
4434 2020-05-01 Jason Merrill <jason@redhat.com>
4435
4436 PR c++/90479
4437 * init.c (get_nsdmi): Don't push_to_top_level for a local class.
4438
4439 2020-05-01 Jason Merrill <jason@redhat.com>
4440
4441 PR c++/91529
4442 * decl.c (cp_finish_decl): Also clear TREE_READONLY if
4443 -fmerge-all-constants.
4444
4445 2020-05-01 Jason Merrill <jason@redhat.com>
4446
4447 PR c++/93822
4448 * pt.c (tsubst_decl): Make sure DECL_VALUE_EXPR continues to have
4449 the same type as the variable.
4450
4451 2020-04-30 Jason Merrill <jason@redhat.com>
4452 Nathan Sidwell <nathan@acm.org>
4453
4454 PR c++/94827
4455 * constraint.cc (map_arguments): If ARGS is null, it's a
4456 self-mapping of parms.
4457 (finish_nested_requirement): Do not pass argified
4458 current_template_parms to normalization.
4459 (tsubst_nested_requirement): Don't assert no template parms.
4460
4461 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
4462
4463 PR c++/94886
4464 * coroutines.cc (transform_local_var_uses): Defer walking
4465 the DECL_INITIALs of BIND_EXPR vars until all the frame
4466 allocations have been made.
4467
4468 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
4469
4470 PR c++/94883
4471 * coroutines.cc (register_awaits): Update target
4472 expressions for awaitable and suspend handle
4473 initializers.
4474
4475 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
4476
4477 PR c++/94879
4478 * coroutines.cc (build_co_await): Account for variables
4479 with DECL_VALUE_EXPRs.
4480 (captures_temporary): Likewise.
4481 (register_awaits): Likewise.
4482
4483 2020-04-29 Patrick Palka <ppalka@redhat.com>
4484
4485 PR c++/94830
4486 * pt.c (find_template_parameter_info::parm_list): New field.
4487 (keep_template_parm): Use the new field to build up the
4488 parameter list here instead of ...
4489 (find_template_parameters): ... here. Return ftpi.parm_list.
4490
4491 2020-04-29 Jakub Jelinek <jakub@redhat.com>
4492
4493 PR target/94707
4494 * class.c (build_base_field): Set DECL_FIELD_ABI_IGNORED on C++17 empty
4495 base artificial FIELD_DECLs.
4496 (layout_class_type): Set DECL_FIELD_ABI_IGNORED on empty class
4497 field_poverlapping_p FIELD_DECLs.
4498
4499 2020-04-29 Patrick Palka <ppalka@redhat.com>
4500
4501 PR c++/94819
4502 * constraint.cc (satisfy_declaration_constraints): Use saved_t
4503 instead of t as the key to decl_satisfied_cache.
4504
4505 PR c++/94808
4506 * error.c (print_requires_expression_info): Print the dependent
4507 form of the parameter list with its template parameter mapping,
4508 rather than printing the substituted form.
4509
4510 2020-04-28 Jason Merrill <jason@redhat.com>
4511
4512 PR c++/94583
4513 * decl.c (use_eh_spec_block): Check nothrow type after
4514 DECL_DEFAULTED_FN.
4515 * pt.c (maybe_instantiate_noexcept): Call synthesize_method for
4516 DECL_MAYBE_DELETED fns here.
4517 * decl2.c (mark_used): Not here.
4518 * method.c (get_defaulted_eh_spec): Reject DECL_MAYBE_DELETED here.
4519
4520 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
4521
4522 PR c++/94760
4523 * coroutines.cc (instantiate_coro_traits): Pass a reference to
4524 object type rather than a pointer type for 'this', for method
4525 coroutines.
4526 (struct param_info): Add a field to hold that the parm is a lambda
4527 closure pointer.
4528 (morph_fn_to_coro): Check for lambda closure pointers in the
4529 args. Use a reference to *this when building the args list for the
4530 promise allocator lookup.
4531
4532 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
4533
4534 PR c++/94759
4535 * coroutines.cc (coro_promise_type_found_p): Do not
4536 exclude non-classes here (this needs to be handled in the
4537 coroutine header).
4538 (morph_fn_to_coro): Allow for the case where the coroutine
4539 returns void.
4540
4541 2020-04-27 Iain Sandoe <iain@sandoe.co.uk>
4542
4543 PR c++/94701
4544 * coroutines.cc (struct local_var_info): Add fields for static
4545 variables and those with DECL_VALUE_EXPR redirection.
4546 (transform_local_var_uses): Skip past typedefs and static vars
4547 and then account for redirected variables.
4548 (register_local_var_uses): Likewise.
4549
4550 2020-04-27 Jason Merrill <jason@redhat.com>
4551
4552 PR c++/90750
4553 PR c++/79585
4554 * decl.c (grokdeclarator): Move dependent attribute to decl.
4555 * decl2.c (splice_template_attributes): No longer static.
4556
4557 2020-04-27 Patrick Palka <ppalka@redhat.com>
4558
4559 PR c++/94772
4560 * constexpr.c (cxx_eval_call_expression): Don't set new_obj if we're
4561 evaluating the target constructor of a delegating constructor.
4562 (cxx_eval_store_expression): Don't set TREE_READONLY if the LHS of the
4563 INIT_EXPR is '*this'.
4564
4565 2020-04-26 Marek Polacek <polacek@redhat.com>
4566
4567 PR c++/90320
4568 * call.c (struct conversion): Add copy_init_p.
4569 (standard_conversion): Set copy_init_p in ck_base and ck_rvalue
4570 if FLAGS demands LOOKUP_ONLYCONVERTING.
4571 (convert_like_real) <case ck_base>: If copy_init_p is set, or
4572 LOOKUP_ONLYCONVERTING into FLAGS.
4573
4574 2020-04-26 Iain Sandoe <iain@sandoe.co.uk>
4575
4576 PR c++/94752
4577 * coroutines.cc (morph_fn_to_coro): Ensure that
4578 unnamed function params have a usable and distinct
4579 frame field name.
4580
4581 2020-04-24 Jason Merrill <jason@redhat.com>
4582
4583 PR c++/94583
4584 * decl.c (redeclaration_error_message): Reject defaulted comparison
4585 operator that has been previously declared.
4586
4587 2020-04-25 Patrick Palka <ppalka@redhat.com>
4588
4589 * parser.c (cp_parser_diagnose_invalid_type_name): Suggest enabling
4590 concepts if the invalid identifier is 'requires'.
4591
4592 2020-04-25 Jakub Jelinek <jakub@redhat.com>
4593
4594 PR c++/94742
4595 * semantics.c (finish_call_expr): When looking if all overloads
4596 are noreturn, use STRIP_TEMPLATE to look through TEMPLATE_DECLs.
4597
4598 2020-04-24 Martin Liska <mliska@suse.cz>
4599
4600 * coroutines.cc: Fix compilation error for release checking
4601 where we miss declaration of ‘coro_body_contains_bind_expr_p’.
4602
4603 2020-04-23 Patrick Palka <ppalka@redhat.com>
4604
4605 * tree.c (zero_init_expr_p): Use uses_template_parms instead of
4606 dependent_type_p.
4607
4608 PR c++/94645
4609 * pt.c (template_class_depth): Walk into the DECL_FRIEND_CONTEXT of a
4610 friend declaration rather than into its CP_DECL_CONTEXT.
4611
4612 2020-04-23 Iain Sandoe <iain@sandoe.co.uk>
4613
4614 PR c++/94288
4615 * coroutines.cc (await_statement_expander): Simplify cases.
4616 (struct susp_frame_data): Add fields for truth and/or if
4617 cases, rename one field.
4618 (analyze_expression_awaits): New.
4619 (expand_one_truth_if): New.
4620 (add_var_to_bind): New helper.
4621 (coro_build_add_if_not_cond_break): New helper.
4622 (await_statement_walker): Handle conditional expressions,
4623 handle expansion of truth-and/or-if cases.
4624 (bind_expr_find_in_subtree): New, checking-only.
4625 (coro_body_contains_bind_expr_p): New, checking-only.
4626 (morph_fn_to_coro): Ensure that we have a top level bind
4627 expression.
4628
4629 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
4630
4631 PR translation/94698
4632 * class.c (check_field_decls): Change "define" to "declare" in
4633 -Weffc++ diagnostics.
4634
4635 2020-04-22 Patrick Palka <ppalka@redhat.com>
4636
4637 PR c++/94719
4638 PR c++/94549
4639 * constraint.cc (satisfy_declaration_constraints): If the inherited
4640 constructor points to an instantiation of a constructor template,
4641 remember and use its attached template arguments.
4642
4643 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
4644
4645 PR translation/94698
4646 * class.c (check_field_decls): Change "override" to "define" in
4647 -Weffc++ diagnostics.
4648
4649 2020-04-22 Iain Sandoe <iain@sandoe.co.uk>
4650
4651 PR c++/94682
4652 * coroutines.cc (struct param_info): Add a field to note that
4653 the param is 'this'.
4654 (morph_fn_to_coro): Convert this to a reference before using it
4655 in the promise parameter preview.
4656
4657 2020-04-22 Jason Merrill <jason@redhat.com>
4658
4659 PR c++/94546
4660 * pt.c (register_parameter_specializations): If the instantiation is
4661 still a parameter pack, don't wrap it in a NONTYPE_ARGUMENT_PACK.
4662 (tsubst_pack_expansion, tsubst_expr): Adjust.
4663
4664 2020-04-22 Martin Sebor <msebor@redhat.com>
4665 Jason Merrill <jason@redhat.com>
4666
4667 PR c++/94510
4668 * decl.c (reshape_init_array_1): Avoid stripping redundant trailing
4669 zero initializers...
4670 * mangle.c (write_expression): ...and handle them here even for
4671 pointers to members by calling zero_init_expr_p.
4672 * cp-tree.h (zero_init_expr_p): Declare.
4673 * tree.c (zero_init_expr_p): Define.
4674 (type_initializer_zero_p): Remove.
4675 * pt.c (tparm_obj_values): New hash_map.
4676 (get_template_parm_object): Store to it.
4677 (tparm_object_argument): New.
4678
4679 2020-04-22 Patrick Palka <ppalka@redhat.com>
4680
4681 PR c++/67825
4682 * constraint.cc (diagnose_valid_expression): Check convert_to_void here
4683 as well as in tsubst_valid_expression_requirement.
4684
4685 2020-04-21 Patrick Palka <ppalka@redhat.com>
4686
4687 PR c++/94549
4688 * constraint.cc (satisfy_declaration_constraints): Don't strip the
4689 inherited constructor if it already has template information.
4690
4691 PR c++/94597
4692 * pt.c (any_template_parm_r) <case IDENTIFIER_NODE>: New case. If this
4693 is a conversion operator, visit its TREE_TYPE.
4694
4695 2020-04-21 Nathan Sidwell <nathan@acm.org>
4696
4697 * pt.c (tsubst_copy_and_build) [POINTER_PLUS_EXPR]: Check for
4698 error_mark_node.
4699
4700 2020-04-21 Iain Sandoe <iain@sandoe.co.uk>
4701
4702 PR c++/94661
4703 * coroutines.cc (morph_fn_to_coro): Simplify return
4704 value computation.
4705
4706 2020-04-17 Marek Polacek <polacek@redhat.com>
4707
4708 PR c++/94592
4709 * constexpr.c (cxx_eval_outermost_constant_expr): Return when T is
4710 a BRACE_ENCLOSED_INITIALIZER_P.
4711 (is_nondependent_constant_expression): Don't check
4712 BRACE_ENCLOSED_INITIALIZER_P.
4713 (is_nondependent_static_init_expression): Likewise.
4714
4715 2020-04-20 Patrick Palka <ppalka@redhat.com>
4716
4717 PR c++/94628
4718 * cp-tree.h (lss_policy::lss_nop): New enumerator.
4719 * pt.c (local_specialization_stack::local_specialization_stack): Handle
4720 an lss_nop policy.
4721 (local_specialization_stack::~local_specialization_stack): Likewise.
4722 (tsubst_pack_expansion): Use a local_specialization_stack instead of
4723 manually saving and restoring local_specializations. Conditionally
4724 replace local_specializations sooner, before the handling of the
4725 unsubstituted_packs case.
4726
4727 2020-04-20 Marek Polacek <polacek@redhat.com>
4728
4729 PR c++/94505 - bogus -Wparentheses warning with fold-expression.
4730 * pt.c (fold_expression): Add warning_sentinel for -Wparentheses
4731 before calling build_x_binary_op.
4732
4733 2020-04-20 Marek Polacek <polacek@redhat.com>
4734
4735 * coroutines.cc (captures_temporary): Don't assign the result of
4736 STRIP_NOPS to the same variable.
4737
4738 2020-04-20 Nathan Sidwell <nathan@acm.org>
4739
4740 PR c++/94454 - tpl-tpl-parms are not canonicalizable types
4741 * pt.c (canonical_type_parameter): Assert not a tpl-tpl-parm.
4742 (process_template_parm): tpl-tpl-parms are structural.
4743 (rewrite_template_parm): Propagate structuralness.
4744
4745 PR c++/94454 - Expr pack expansion equality
4746 * tree.c (cp_tree_equal) [TEMPLATE_ID_EXPR, default]: Refactor.
4747 [EXPR_PACK_EXPANSION]: Add.
4748
4749 PR c++/94454 Template Argument Hashing
4750 * pt.c (iterative_hash_template_arg): Strip nodes as
4751 template_args_equal does.
4752 [ARGUMENT_PACK_SELECT, TREE_VEC, CONSTRUCTOR]: Refactor.
4753 [node_class:TEMPLATE_TEMPLATE_PARM]: Hash by level & index.
4754 [node_class:default]: Refactor.
4755
4756 2020-04-18 Patrick Palka <ppalka@redhat.com>
4757
4758 PR c++/94632
4759 * tree.c (cp_tree_equal) <case PARM_DECL>: Ignore
4760 comparing_specializations if the parameters' contexts are identical.
4761
4762 PR c++/92187
4763 * pt.c (splice_late_return_type): Propagate cv-qualifiers and
4764 PLACEHOLDER_TYPE_CONSTRAINTS from the original auto node to the new one.
4765
4766 2020-04-17 Patrick Palka <ppalka@redhat.com>
4767
4768 PR c++/94483
4769 * lambda.c (lambda_capture_field_type): Avoid doing auto deduction if
4770 the explicit initializer has parameter packs.
4771
4772 PR c++/88754
4773 * parser.c (cp_parser_check_template_parameters): Before issuing a hard
4774 error, first try simulating an error instead.
4775
4776 2020-04-17 Jakub Jelinek <jakub@redhat.com>
4777
4778 PR other/94629
4779 * call.c (build_conditional_expr_1): Remove redundant assignment to
4780 arg2.
4781
4782 2020-04-16 Patrick Palka <ppalka@redhat.com>
4783
4784 PR c++/94475
4785 * cvt.c (ocp_convert): If the result of scalar_constant_value is
4786 erroneous, ignore it and use the original expression.
4787
4788 2020-04-16 Jakub Jelinek <jakub@redhat.com>
4789
4790 PR c++/94571
4791 * parser.c (cp_parser_simple_declaration): Fix up a pasto in
4792 diagnostics.
4793
4794 2020-04-15 Jakub Jelinek <jakub@redhat.com>
4795
4796 PR c/94593
4797 * parser.c (cp_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
4798 requires directive when not at file or namespace scope.
4799
4800 2020-04-14 Iain Sandoe <iain@sandoe.co.uk>
4801
4802 PR c++/94359
4803 * coroutines.cc (build_actor_fn): Check that the target can
4804 support the resume tailcall before mandating it.
4805
4806 2020-04-14 Patrick Palka <ppalka@redhat.com>
4807
4808 PR c++/85278
4809 * cxx-pretty-print.c (cxx_pretty_printer:simple_type_specifier)
4810 <case DECLTYPE_TYPE>: Handle DECLTYPE_TYPE here instead of ...
4811 (pp_cxx_type_specifier_seq) <case DECLTYPE_TYPE>: ... here.
4812 (cxx_pretty_printer::direct_abstract_declarator) <case DECLTYPE_TYPE>:
4813 New no-op case.
4814
4815 PR c++/94034
4816 * constexpr.c (replace_result_decl_data): New struct.
4817 (replace_result_decl_data_r): New function.
4818 (replace_result_decl): New function.
4819 (cxx_eval_call_expression): Use it.
4820 * tree.c (build_aggr_init_expr): Set the location of the AGGR_INIT_EXPR
4821 to that of its initializer.
4822
4823 2020-04-13 Marek Polacek <polacek@redhat.com>
4824
4825 PR c++/94588
4826 * name-lookup.c (check_local_shadow): Add an inform call.
4827
4828 2020-04-13 Patrick Palka <ppalka@redhat.com>
4829
4830 PR c++/94521
4831 * error.c (dump_scope): Pass TFF_NO_FUNCTION_ARGUMENTS to
4832 dump_function_decl when printing a function template instantiation as a
4833 scope.
4834
4835 PR c++/94470
4836 * constexpr.c (get_or_insert_ctor_field): Set default value of parameter
4837 'pos_hint' to -1.
4838 (cxx_eval_bare_aggregate): Use get_or_insert_ctor_field instead of
4839 assuming the the next index belongs at the end of the new CONSTRUCTOR.
4840 (cxx_eval_store_expression): Revert PR c++/78572 fix.
4841
4842 2020-04-13 Nathan Sidwell <nathan@acm.org>
4843
4844 PR c++/94426 lambdas with internal linkage are different to no-linkage
4845 * decl2.c (determine_visibility): A lambda's visibility is
4846 affected by its extra scope.
4847 * pt.c (instantiate_decl): Determine var's visibility before
4848 instantiating its initializer.
4849 * tree.c (no_linkage_check): Revert code looking at visibility of
4850 lambda's extra scope.
4851 `
4852 2020-04-10 Iain Sandoe <iain@sandoe.co.uk>
4853
4854 PR c++/94528
4855 * coroutines.cc (co_await_expander): Remove.
4856 (expand_one_await_expression): New.
4857 (process_one_statement): New.
4858 (await_statement_expander): New.
4859 (build_actor_fn): Revise to use per-statement expander.
4860 (struct susp_frame_data): Reorder and comment.
4861 (register_awaits): Factor code.
4862 (replace_statement_captures): New, factored from...
4863 (maybe_promote_captured_temps):.. here.
4864 (await_statement_walker): Revise to process per statement.
4865 (morph_fn_to_coro): Use revised susp_frame_data layout.
4866
4867 2020-04-10 Marek Polacek <polacek@redhat.com>
4868
4869 PR c++/94149
4870 * method.c (constructible_expr): In C++20, try using parenthesized
4871 initialization of aggregates to determine the result of
4872 __is_constructible.
4873
4874 2020-04-10 Bin Cheng <bin.cheng@linux.alibaba.com>
4875
4876 * coroutines.cc (co_await_expander): Simplify.
4877
4878 2020-04-09 Jason Merrill <jason@redhat.com>
4879
4880 PR c++/94523
4881 * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]: Look at
4882 ctx->object and ctx->global->values first.
4883
4884 2020-04-09 Marek Polacek <polacek@redhat.com>
4885
4886 PR c++/93790
4887 * call.c (initialize_reference): If the reference binding failed, maybe
4888 try initializing from { }.
4889 * decl.c (grok_reference_init): For T& t(e), set
4890 LOOKUP_AGGREGATE_PAREN_INIT but don't build up a constructor yet.
4891
4892 2020-04-08 Iain Sandoe <iain@sandoe.co.uk>
4893 Jun Ma <JunMa@linux.alibaba.com>
4894
4895 * coroutines.cc (maybe_promote_captured_temps): Add a cleanup
4896 expression, if needed, to any call from which we promoted
4897 temporaries captured by reference.
4898
4899 2020-04-08 Marek Polacek <polacek@redhat.com>
4900
4901 PR c++/94507 - ICE-on-invalid with lambda template.
4902 * pt.c (tsubst_lambda_expr): Cope when tsubst_template_decl or
4903 tsubst_function_decl returns error_mark_node.
4904
4905 2020-04-08 Martin Liska <mliska@suse.cz>
4906
4907 PR c++/94314
4908 * decl.c (duplicate_decls): Duplicate also DECL_IS_REPLACEABLE_OPERATOR.
4909 (cxx_init_decl_processing): Mark replaceable all implicitly defined
4910 operators.
4911
4912 2020-04-08 Patrick Palka <ppalka@redhat.com>
4913
4914 Core issues 1001 and 1322
4915 PR c++/92010
4916 * pt.c (rebuild_function_or_method_type): Split function out from ...
4917 (tsubst_function_type): ... here.
4918 (maybe_rebuild_function_decl_type): New function.
4919 (tsubst_function_decl): Use it.
4920
4921 2020-04-08 Jakub Jelinek <jakub@redhat.com>
4922
4923 PR c++/94325
4924 * decl.c (begin_destructor_body): For CLASSTYPE_VBASECLASSES class
4925 dtors, if CLASSTYPE_PRIMARY_BINFO is non-NULL, but not BINFO_VIRTUAL_P,
4926 look at CLASSTYPE_PRIMARY_BINFO of its BINFO_TYPE if it is not
4927 BINFO_VIRTUAL_P, and so on.
4928
4929 2020-04-08 Marek Polacek <polacek@redhat.com>
4930
4931 PR c++/94478 - ICE with defaulted comparison operator
4932 * method.c (early_check_defaulted_comparison): Give an error when the
4933 context is null.
4934
4935 2020-04-08 Tobias Burnus <tobias@codesourcery.com>
4936
4937 PR middle-end/94120
4938 * paser.c (cp_parser_oacc_declare): Add check that variables
4939 are declared in the same scope as the directive.
4940
4941 2020-04-07 Jason Merrill <jason@redhat.com>
4942
4943 PR c++/94480
4944 * parser.c (cp_parser_requires_expression): Use tentative_firewall.
4945
4946 PR c++/94481
4947 * parser.c (cp_parser_placeholder_type_specifier): Use
4948 matching_parens.
4949
4950 2020-04-07 Iain Sandoe <iain@sandoe.co.uk>
4951
4952 * coroutines.cc (maybe_promote_captured_temps): Ensure that
4953 reference capture placeholder vars are properly declared.
4954
4955 2020-04-07 Patrick Palka <ppalka@redhat.com>
4956
4957 PR c++/90996
4958 * tree.c (replace_placeholders): Look through all handled components,
4959 not just COMPONENT_REFs.
4960 * typeck2.c (process_init_constructor_array): Propagate
4961 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
4962 the array initializer.
4963
4964 2020-04-07 Jakub Jelinek <jakub@redhat.com>
4965
4966 PR c++/94512
4967 * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
4968 if cp_parser_omp_master succeeded.
4969
4970 2020-04-06 Jason Merrill <jason@redhat.com>
4971
4972 PR c++/94462
4973 * decl.c (duplicate_decls): Fix handling of DECL_HIDDEN_FRIEND_P.
4974
4975 2020-04-04 Marek Polacek <polacek@redhat.com>
4976 Jason Merrill <jason@redhat.com>
4977
4978 PR c++/94155 - crash in gimplifier with paren init of aggregates.
4979 * init.c (build_vec_init): Fill in indexes.
4980
4981 2020-04-04 Jason Merrill <jason@redhat.com>
4982
4983 PR c++/91377
4984 * mangle.c (write_expression): Skip IMPLICIT_CONV_EXPR.
4985
4986 2020-04-04 Patrick Palka <ppalka@redhat.com>
4987
4988 PR c++/94205
4989 PR c++/79937
4990 * constexpr.c (struct constexpr_ctx): New field 'parent'.
4991 (cxx_eval_bare_aggregate): Propagate CONSTRUCTOR_PLACEHOLDER_BOUNDARY
4992 flag from the original constructor to the reduced constructor.
4993 (lookup_placeholder): Prefer to return the outermost matching object
4994 by recursively calling lookup_placeholder on the 'parent' context,
4995 but don't cross CONSTRUCTOR_PLACEHOLDER_BOUNDARY constructors.
4996 (cxx_eval_constant_expression): Link the 'ctx' context to the 'new_ctx'
4997 context via 'new_ctx.parent' when being expanded without an explicit
4998 target. Don't call replace_placeholders.
4999 (cxx_eval_outermost_constant_expr): Initialize 'ctx.parent' to NULL.
5000
5001 PR c++/94219
5002 PR c++/94205
5003 * constexpr.c (get_or_insert_ctor_field): Split out (while adding
5004 support for VECTOR_TYPEs, and optimizations for the common case)
5005 from ...
5006 (cxx_eval_store_expression): ... here. Rename local variable
5007 'changed_active_union_member_p' to 'activated_union_member_p'. Record
5008 the sequence of indexes into 'indexes' that yields the subobject we're
5009 assigning to. Record the integer offsets of the constructor indexes
5010 we're assigning through into 'index_pos_hints'. After evaluating the
5011 initializer of the store expression, recompute 'valp' using 'indexes'
5012 and using 'index_pos_hints' as hints.
5013 (cxx_eval_bare_aggregate): Tweak comments. Use get_or_insert_ctor_field
5014 to recompute the constructor_elt pointer we're assigning through after
5015 evaluating each initializer.
5016
5017 2020-04-04 Jason Merrill <jason@redhat.com>
5018
5019 PR c++/67825
5020 * constraint.cc (tsubst_valid_expression_requirement): Call
5021 convert_to_void.
5022
5023 2020-04-04 Jason Merrill <jason@redhat.com>
5024
5025 PR c++/94453
5026 * constexpr.c (maybe_constant_value): Use break_out_target_exprs.
5027 * expr.c (mark_use) [VIEW_CONVERT_EXPR]: Don't wrap a TARGET_EXPR in
5028 NON_LVALUE_EXPR.
5029
5030 2020-04-04 Jakub Jelinek <jakub@redhat.com>
5031
5032 PR debug/94441
5033 * parser.c (cp_parser_omp_for_loop): Use
5034 protected_set_expr_location_if_unset.
5035 * cp-gimplify.c (genericize_if_stmt, genericize_cp_loop): Likewise.
5036
5037 PR c++/94477
5038 * pt.c (tsubst_expr) <case OMP_MASTER>: Clear
5039 omp_parallel_combined_clauses.
5040
5041 2020-04-03 Jason Merrill <jason@redhat.com>
5042
5043 PR c++/91966
5044 * pt.c (complex_pack_expansion_r): New.
5045 (complex_alias_template_p): Use it.
5046
5047 2020-03-31 Jason Merrill <jason@redhat.com>
5048
5049 PR c++/94205
5050 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Call
5051 replace_placeholders.
5052 * typeck2.c (store_init_value): Fix arguments to
5053 fold_non_dependent_expr.
5054
5055 2020-03-31 Jason Merrill <jason@redhat.com>
5056
5057 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Use
5058 local variables.
5059
5060 2020-03-30 Jason Merrill <jason@redhat.com>
5061
5062 PR c++/90711
5063 * tree.c (cp_tree_equal) [CALL_EXPR]: Compare KOENIG_LOOKUP_P.
5064 (called_fns_equal): Check DECL_CONTEXT.
5065
5066 2020-03-30 Jakub Jelinek <jakub@redhat.com>
5067
5068 PR c++/94385
5069 * semantics.c (add_stmt): Only set STMT_IS_FULL_EXPR_P on trees with
5070 STATEMENT_CODE_P code.
5071
5072 2020-03-28 Patrick Palka <ppalka@redhat.com>
5073
5074 PR c++/94306
5075 * parser.c (cp_parser_requires_clause_opt): Diagnose and recover from
5076 "requires {" when "requires requires {" was probably intended.
5077
5078 PR c++/94252
5079 * constraint.cc (tsubst_compound_requirement): Always suppress errors
5080 from type_deducible_p and expression_convertible_p, as they're not
5081 substitution errors.
5082 (diagnose_atomic_constraint) <case INTEGER_CST>: Remove this case so
5083 that we diagnose INTEGER_CST expressions of non-bool type via the
5084 default case.
5085 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: New case.
5086 * parser.c (cp_parser_requires_expression): Always parse the requirement
5087 body as if we're processing a template, by temporarily incrementing
5088 processing_template_decl. Afterwards, if we're not actually in a
5089 template context, perform semantic processing to diagnose any invalid
5090 types and expressions.
5091 * pt.c (tsubst_copy_and_build) <case REQUIRES_EXPR>: Remove dead code.
5092 * semantics.c (finish_static_assert): Explain an assertion failure
5093 when the condition is a REQUIRES_EXPR like we do when it is a concept
5094 check.
5095
5096 * constraint.cc (diagnose_compound_requirement): When diagnosing a
5097 compound requirement, maybe replay the satisfaction failure, subject to
5098 the current diagnosis depth.
5099
5100 * constraint.cc (finish_constraint_binary_op): Set the location of EXPR
5101 as well as its range, because build_x_binary_op doesn't always do so.
5102 (current_constraint_diagnosis_depth): New.
5103 (concepts_diagnostics_max_depth_exceeded_p): New.
5104 (collect_operands_of_disjunction): New.
5105 (satisfy_disjunction): When diagnosing a satisfaction failure, maybe
5106 replay each branch of the disjunction, subject to the current diagnosis
5107 depth.
5108 (diagnose_valid_expression): When diagnosing a satisfaction failure,
5109 maybe replay the substitution error, subject to the current diagnosis
5110 recursion.
5111 (diagnose_valid_type): Likewise.
5112 (diagnose_nested_requiremnet): Likewise.
5113 (diagnosing_failed_constraint::diagnosing_failed_constraint): Increment
5114 current_constraint_diagnosis_depth when diagnosing.
5115 (diagnosing_failed_constraint::~diagnosing_failed_constraint): Decrement
5116 current_constraint_diagnosis_depth when diagnosing.
5117 (diagnosing_failed_constraint::replay_errors_p): New static member
5118 function.
5119 (diagnose_constraints): Don't diagnose if concepts_diagnostics_max_depth
5120 is 0. Emit a one-off note to increase -fconcepts-diagnostics-depth if
5121 the limit was exceeded.
5122 * cp-tree.h (diagnosing_failed_constraint::replay_errors_p): Declare.
5123
5124 2020-03-27 Nathan Sidwell <nathan@acm.org>
5125
5126 PR c++/84733
5127 * name-lookup.c (do_pushdecl): Look through cleanp levels.
5128
5129 2020-03-27 Martin Sebor <msebor@redhat.com>
5130
5131 PR c++/94078
5132 PR c++/93824
5133 PR c++/93810
5134 * cp-tree.h (most_specialized_partial_spec): Declare.
5135 * parser.c (cp_parser_elaborated_type_specifier): Distinguish alias
5136 from declarations.
5137 (specialization_of): New function.
5138 (cp_parser_check_class_key): Move code...
5139 (class_decl_loc_t::add): ...to here. Add parameters. Avoid issuing
5140 -Wredundant-tags on first-time declarations in other declarators.
5141 Correct handling of template specializations.
5142 (class_decl_loc_t::diag_mismatched_tags): Also expect to be called
5143 when -Wredundant-tags is enabled. Use primary template or partial
5144 specialization as the guide for uses of implicit instantiations.
5145 * pt.c (most_specialized_partial_spec): Declare extern.
5146
5147 2020-03-27 Nathan Sidwell <nathan@acm.org>
5148
5149 PR c++/94257
5150 * name-lookup.c (push_namespace): Triage ambiguous lookups that
5151 contain namespaces.
5152
5153 2020-03-27 Jakub Jelinek <jakub@redhat.com>
5154
5155 PR c++/94326
5156 * call.c (set_flags_from_callee): Don't update
5157 cp_function_chain->can_throw or current_function_returns_abnormally
5158 if cp_unevaluated_operand.
5159
5160 PR c++/94339
5161 * cvt.c (ocp_convert): Handle COMPOUND_EXPR by recursion on the second
5162 operand and creating a new COMPOUND_EXPR if anything changed.
5163
5164 2020-03-26 Marek Polacek <polacek@redhat.com>
5165
5166 PR c++/94336 - template keyword accepted before destructor names.
5167 * parser.c (cp_parser_unqualified_id): Give an error when 'template'
5168 is followed by a destructor name.
5169
5170 2020-03-27 Patrick Palka <ppalka@redhat.com>
5171
5172 * decl.c (compute_array_index_type_loc): Remove redundant
5173 type_dependent_expression_p check that is subsumed by
5174 value_dependent_expression_p.
5175 * decl2.c (is_late_template_attribute): Likewise.
5176 * pt.c (uses_template_parms): Likewise.
5177 (dependent_template_arg_p): Likewise.
5178
5179 2020-03-26 Marek Polacek <polacek@redhat.com>
5180
5181 DR 1710
5182 PR c++/94057 - template keyword in a typename-specifier.
5183 * parser.c (check_template_keyword_in_nested_name_spec): New.
5184 (cp_parser_nested_name_specifier_opt): Implement DR1710, optional
5185 'template'. Call check_template_keyword_in_nested_name_spec.
5186 (cp_parser_simple_type_specifier): Assume that a <
5187 following a qualified-id in a typename-specifier begins
5188 a template argument list.
5189
5190 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
5191
5192 * coroutines.cc (coro_init_identifiers): Initialize an identifier
5193 for the cororoutine handle 'address' method name.
5194 (struct coro_aw_data): Add fields to cover the continuations.
5195 (co_await_expander): Determine the kind of await_suspend in use.
5196 If we have the case that returns a continuation handle, then save
5197 this and make the target for 'scope exit without cleanup' be the
5198 continuation resume label.
5199 (expand_co_awaits): Remove.
5200 (struct suspend_point_info): Remove fields that kept the returned
5201 await_suspend handle type.
5202 (transform_await_expr): Remove code tracking continuation handles.
5203 (build_actor_fn): Add the continuation handle as an actor-function
5204 scope var. Build the symmetric transfer continuation point. Call
5205 the tree walk for co_await expansion directly, rather than via a
5206 trivial shim function.
5207 (register_await_info): Remove fields tracking continuation handles.
5208 (get_await_suspend_return_type): Remove.
5209 (register_awaits): Remove code tracking continuation handles.
5210 (morph_fn_to_coro): Remove code tracking continuation handles.
5211
5212 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
5213
5214 * coroutines.cc (co_await_expander): If we are expanding the
5215 initial await expression, set a boolean flag to show that we
5216 have now reached the initial await_resume() method call.
5217 (expand_co_awaits): Handle the 'initial await resume called' flag.
5218 (build_actor_fn): Insert the initial await expression into the
5219 start of the user-authored function-body. Handle the 'initial await
5220 resume called' flag.
5221 (morph_fn_to_coro): Initialise the 'initial await resume called'
5222 flag. Modify the unhandled exception catch clause to recognise
5223 exceptions that occur before the initial await_resume() and re-
5224 throw them.
5225
5226 2020-03-26 Jakub Jelinek <jakub@redhat.com>
5227
5228 PR c++/81349
5229 * class.c (user_provided_p): Use STRIP_TEMPLATE instead of returning
5230 true for all TEMPLATE_DECLs.
5231
5232 PR c++/94272
5233 * cp-gimplify.c (cp_genericize_r): Handle STATEMENT_LIST.
5234
5235 2020-03-25 Patrick Palka <ppalka@redhat.com>
5236
5237 PR c++/94265
5238 * parser.c (cp_parser_selection_statement) <case RID_IF>: Invalidate the
5239 current condition chain when the if-statement has a non-empty
5240 init-statement.
5241
5242 2020-03-25 Iain Sandoe <iain@sandoe.co.uk>
5243
5244 PR c++/94319
5245 * coroutines.cc (captures_temporary): Fix a missing dereference.
5246
5247 2020-03-24 Marek Polacek <polacek@redhat.com>
5248
5249 PR c++/94190 - wrong no post-decrement operator error in template.
5250 * call.c (convert_like_real): Use convert_from_reference on the result.
5251
5252 2020-03-24 Jason Merrill <jason@redhat.com>
5253
5254 PR c++/94186
5255 * constraint.cc (constraint_satisfaction_value): Repeat noisily on
5256 error.
5257 (tsubst_nested_requirement): Likewise.
5258 (get_constraint_error_location): Allow missing context.
5259 (diagnose_atomic_constraint): Diagnose non-bool constraint here.
5260 (satisfy_atom): Not here. Only diagnose non-constant when noisy.
5261
5262 2020-03-24 Jason Merrill <jason@redhat.com>
5263
5264 * pt.c (any_template_parm_r): Look into the type of a non-type
5265 template parm.
5266
5267 2020-03-24 Jason Merrill <jason@redhat.com>
5268
5269 * cp-tree.h (cp_expr): When constructing from an expr and a
5270 location, call protected_set_expr_location.
5271
5272 2020-03-23 Patrick Palka <ppalka@redhat.com>
5273
5274 PR c++/93805
5275 * except.c (maybe_noexcept_warning): Add TODO.
5276 * method.c (walk_field_subobs): Pass tf_none to expr_noexcept_p.
5277
5278 2020-03-23 nathans <nathan@acm.org>
5279
5280 PR c++/94044
5281 * tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
5282 operand.
5283
5284 2020-03-21 Patrick Palka <ppalka@redhat.com>
5285
5286 PR c++/94066
5287 * constexpr.c (reduced_constant_expression_p) [CONSTRUCTOR]: Properly
5288 handle unions without an initializer.
5289 (cxx_eval_component_reference): Emit a different diagnostic when the
5290 constructor element corresponding to a union member is NULL.
5291 (cxx_eval_bare_aggregate): When constructing a union, always set the
5292 active union member before evaluating the initializer. Relax assertion
5293 that verifies the index of the constructor element we're initializing
5294 hasn't been changed.
5295 (cxx_eval_store_expression): Diagnose changing the active union member
5296 while the union is in the process of being initialized. After setting
5297 an active union member, clear CONSTRUCTOR_NO_CLEARING on the underlying
5298 CONSTRUCTOR.
5299 (cxx_eval_constant_expression) [PLACEHOLDER_EXPR]: Don't re-reduce a
5300 CONSTRUCTOR returned by lookup_placeholder.
5301
5302 2020-03-20 Patrick Palka <ppalka@redhat.com>
5303
5304 * cxx-pretty-print.c (pp_cxx_parameter_mapping): Make extern. Move
5305 the "[with ]" bits to here from ...
5306 (pp_cxx_atomic_constraint): ... here.
5307 * cxx-pretty-print.h (pp_cxx_parameter_mapping): Declare.
5308 * error.c (rebuild_concept_check): Delete.
5309 (print_concept_check_info): Print the dependent form of the constraint and the
5310 preferably substituted parameter mapping alongside it.
5311
5312 2020-03-19 Jason Merrill <jason@redhat.com>
5313
5314 PR c++/94175
5315 * cp-gimplify.c (simple_empty_class_p): Look through
5316 SIMPLE_TARGET_EXPR_P.
5317 (cp_gimplify_expr) [MODIFY_EXPR]: Likewise.
5318 [RETURN_EXPR]: Avoid producing 'return *retval;'.
5319 * call.c (build_call_a): Strip TARGET_EXPR from empty class arg.
5320 * cp-tree.h (SIMPLE_TARGET_EXPR_P): Check that TARGET_EXPR_INITIAL
5321 is non-null.
5322
5323 2020-03-19 Jakub Jelinek <jakub@redhat.com>
5324
5325 PR c++/93931
5326 * parser.c (cp_parser_omp_var_list_no_open): Call process_outer_var_ref
5327 on outer_automatic_var_p decls.
5328 * cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also for
5329 capture proxy decls.
5330
5331 2020-03-18 Nathan Sidwell <nathan@acm.org>
5332
5333 PR c++/94147 - mangling of lambdas assigned to globals
5334 * parser.c (cp_parser_init_declarator): Namespace-scope variables
5335 provide a lambda scope.
5336 * tree.c (no_linkage_check): Lambdas with a variable for extra
5337 scope have a linkage from the variable.
5338
5339 2020-03-18 Jakub Jelinek <jakub@redhat.com>
5340
5341 * constraint.cc (resolve_function_concept_check, subsumes_constraints,
5342 strictly_subsumes): Fix up duplicated word issue in a comment.
5343 * coroutines.cc (build_init_or_final_await, captures_temporary):
5344 Likewise.
5345 * logic.cc (dnf_size_r, cnf_size_r): Likewise.
5346 * pt.c (append_type_to_template_for_access_check): Likewise.
5347
5348 PR c++/91759
5349 * decl.c (grokfndecl): Restore old diagnostics about deduction
5350 guide declared in different scope if in_namespace is NULL_TREE.
5351
5352 2020-03-17 Jakub Jelinek <jakub@redhat.com>
5353
5354 PR c++/90995
5355 * parser.c (cp_parser_enum_specifier): Use temp_override for
5356 parser->colon_corrects_to_scope_p, replace goto out with return.
5357 If scoped enum or enum with underlying type is not followed by
5358 { or ;, call cp_parser_commit_to_tentative_parse before calling
5359 cp_parser_error and make sure to return error_mark_node instead of
5360 NULL_TREE. Formatting fixes.
5361
5362 2020-03-17 Ville Voutilainen <ville.voutilainen@gmail.com>
5363
5364 PR c++/94197
5365 * method.c (assignable_expr): Use cp_unevaluated.
5366 (is_xible_helper): Push a non-deferred access check for
5367 the stub objects created by assignable_expr and constructible_expr.
5368
5369 2020-03-17 Jakub Jelinek <jakub@redhat.com>
5370
5371 * pt.c (tsubst): Fix up duplicated word issue in a diagnostic message.
5372 (lookup_template_class_1, tsubst_expr): Fix up duplicated word issue
5373 in a comment.
5374 * parser.c (cp_parser_statement, cp_parser_linkage_specification,
5375 cp_parser_placeholder_type_specifier,
5376 cp_parser_constraint_requires_parens): Likewise.
5377 * name-lookup.c (suggest_alternative_in_explicit_scope): Likewise.
5378
5379 2020-03-15 Iain Sandoe <iain@sandoe.co.uk>
5380
5381 * coroutines.cc (co_await_expander): Fix indentation.
5382
5383 2020-03-14 Jason Merrill <jason@redhat.com>
5384
5385 PR c++/92068
5386 * pt.c (process_partial_specialization): Error rather than crash on
5387 extra pack expansion.
5388
5389 2020-03-14 Jason Merrill <jason@redhat.com>
5390
5391 PR c++/92909
5392 * pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
5393 DECL_ORIGINAL_TYPE of a typedef.
5394
5395 2020-03-14 Jason Merrill <jason@redhat.com>
5396
5397 PR c++/93248
5398 * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
5399 substituting DECL_ARGUMENTS.
5400
5401 2020-03-14 Jakub Jelinek <jakub@redhat.com>
5402
5403 * logic.cc (formula::formula): Change "a an" to "an" in a comment.
5404 * parser.c (cp_debug_parser): Change "a an" to "an" in a string
5405 literal.
5406
5407 2020-03-13 Patrick Palka <ppalka@redhat.com>
5408
5409 PR c++/67960
5410 * call.c (build_over_call): Use a warning_sentinel to disable
5411 warn_deprecated_decl before calling build_addr_func.
5412
5413 2020-03-12 Jakub Jelinek <jakub@redhat.com>
5414
5415 PR c++/94124
5416 * decl.c (reshape_init_array_1): Don't unshare constructor if there
5417 aren't any trailing zero elts, otherwise only unshare the first
5418 nelts.
5419
5420 2020-03-11 Jason Merrill <jason@redhat.com>
5421
5422 PR c++/93907
5423 * constraint.cc (tsubst_parameter_mapping): Canonicalize type
5424 argument.
5425
5426 2020-03-11 Marek Polacek <polacek@redhat.com>
5427 Jason Merrill <jason@redhat.com>
5428
5429 PR c++/94074 - wrong modifying const object error for COMPONENT_REF.
5430 * constexpr.c (cref_has_const_field): New function.
5431 (modifying_const_object_p): Consider a COMPONENT_REF
5432 const only if any of its fields are const.
5433 (cxx_eval_store_expression): Mark a CONSTRUCTOR of a const type
5434 as readonly after its initialization has been done.
5435
5436 2020-03-10 Marek Polacek <polacek@redhat.com>
5437
5438 PR c++/94124 - wrong conversion error with non-viable overload.
5439 * decl.c (reshape_init_array_1): Unshare a constructor if we
5440 stripped trailing zero-initializers.
5441
5442 2020-03-10 Jason Merrill <jason@redhat.com>
5443
5444 PR c++/93901
5445 * pt.c (maybe_instantiate_noexcept): Always update clones.
5446
5447 2020-03-10 Jason Merrill <jason@redhat.com>
5448
5449 PR c++/93596
5450 * pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
5451
5452 2020-03-10 Jason Merrill <jason@redhat.com>
5453
5454 PR c++/93922
5455 PR c++/94041
5456 PR c++/52320
5457 PR c++/66139
5458 * cp-gimplify.c (cp_gimplify_init_expr): Partially revert patch for
5459 66139: Don't split_nonconstant_init. Remove pre_p parameter.
5460
5461 2020-03-09 Marek Polacek <polacek@redhat.com>
5462
5463 PR c++/92031 - bogus taking address of rvalue error.
5464 PR c++/91465 - ICE with template codes in check_narrowing.
5465 PR c++/93870 - wrong error when converting template non-type arg.
5466 PR c++/94068 - ICE with template codes in check_narrowing.
5467 * call.c (convert_like_real): Return IMPLICIT_CONV_EXPR
5468 in a template when not ck_identity and we're dealing with a class.
5469 (convert_like_real) <case ck_ref_bind>: Return IMPLICIT_CONV_EXPR
5470 in a template if we need a temporary.
5471 * decl.c (compute_array_index_type_loc): Remove
5472 instantiate_non_dependent_expr_sfinae call. Call
5473 fold_non_dependent_expr instead of maybe_constant_value.
5474 (build_explicit_specifier): Don't instantiate or create a sentinel
5475 before converting the expression.
5476 * except.c (build_noexcept_spec): Likewise.
5477 * pt.c (convert_nontype_argument): Don't build IMPLICIT_CONV_EXPR.
5478 Set IMPLICIT_CONV_EXPR_NONTYPE_ARG if that's what
5479 build_converted_constant_expr returned.
5480 * typeck2.c (check_narrowing): Call fold_non_dependent_expr instead
5481 of maybe_constant_value.
5482
5483 2020-03-09 Jakub Jelinek <jakub@redhat.com>
5484
5485 PR c++/94067
5486 Revert
5487 2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
5488
5489 * constexpr.c (cxx_eval_constant_expression): Do not handle
5490 RROTATE_EXPR and LROTATE_EXPR.
5491
5492 2020-03-09 Marek Polacek <polacek@redhat.com>
5493
5494 PR c++/94050 - ABI issue with alignas on armv7hl.
5495 * class.c (layout_class_type): Don't replace a class's
5496 CLASSTYPE_AS_BASE if their TYPE_USER_ALIGN don't match.
5497
5498 2020-03-09 Bin Cheng <bin.cheng@linux.alibaba.com>
5499
5500 * coroutines.cc (build_actor_fn): Factor out code inserting the
5501 default return_void call to...
5502 (morph_fn_to_coro): ...here, also hoist local var declarations.
5503
5504 2020-03-08 Patrick Palka <ppalka@redhat.com>
5505
5506 PR c++/93729
5507 * call.c (convert_like_real): Check complain before emitting an error
5508 about binding a bit-field to a reference.
5509
5510 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
5511 [TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
5512 TYPE_NAME.
5513
5514 2020-03-06 Nathan Sidwell <nathan@acm.org>
5515
5516 PR c++/94027
5517 * mangle.c (find_substitution): Don't call same_type_p on template
5518 args that cannot match.
5519
5520 2020-03-04 Martin Sebor <msebor@redhat.com>
5521
5522 PR c++/90938
5523 * tree.c (type_initializer_zero_p): Fail for structs initialized
5524 with non-structs.
5525
5526 2020-03-04 Jason Merrill <jason@redhat.com>
5527
5528 PR c++/90432
5529 * init.c (perform_member_init): Don't do aggregate initialization of
5530 empty field.
5531 * constexpr.c (cx_check_missing_mem_inits): Don't enforce
5532 initialization of empty field.
5533
5534 2020-03-04 Martin Liska <mliska@suse.cz>
5535
5536 * method.c: Wrap array in ctor with braces in order
5537 to silent clang warnings.
5538
5539 2020-03-03 Jason Merrill <jason@redhat.com>
5540 Marek Polacek <polacek@redhat.com>
5541
5542 PR c++/90505 - mismatch in template argument deduction.
5543 * pt.c (tsubst): Don't reduce the template level of template
5544 parameters when tf_partial.
5545
5546 2020-03-03 Jakub Jelinek <jakub@redhat.com>
5547
5548 PR c++/93998
5549 * constexpr.c (cxx_eval_constant_expression)
5550 <case TARGET_EXPR, case SAVE_EXPR>: Don't record anything if
5551 *non_constant_p is true.
5552
5553 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
5554
5555 * coroutines.cc (captures_temporary): Strip component_ref
5556 to its base object.
5557
5558 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
5559
5560 * coroutines.cc (finish_co_await_expr): Build co_await_expr
5561 with unknown_type_node.
5562 (finish_co_yield_expr): Ditto.
5563 *pt.c (type_dependent_expression_p): Set co_await/yield_expr
5564 with unknown type as dependent.
5565
5566 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
5567
5568 * coroutines.cc (struct local_var_info): Adjust to remove the
5569 reference to the captured var, and just to note that this is a
5570 lambda capture proxy.
5571 (transform_local_var_uses): Handle lambda captures specially.
5572 (struct param_frame_data): Add a visited set.
5573 (register_param_uses): Also check for param uses in lambda
5574 capture proxies.
5575 (struct local_vars_frame_data): Remove captures list.
5576 (register_local_var_uses): Handle lambda capture proxies by
5577 noting and bypassing them.
5578 (morph_fn_to_coro): Update to remove lifetime extension of
5579 lambda capture-by-copy vars.
5580
5581 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
5582
5583 * coroutines.cc (build_co_await): Do not build frame
5584 awaitable proxy vars when the co_await expression is
5585 a function parameter or local var.
5586 (co_await_expander): Do not initialise a frame var with
5587 itself.
5588 (transform_await_expr): Only substitute the awaitable
5589 frame var if it's needed.
5590 (register_awaits): Do not make frame copies for param
5591 or local vars that are awaitables.
5592
5593 2020-02-28 Jason Merrill <jason@redhat.com>
5594
5595 Implement P2092R0, Disambiguating Nested-Requirements
5596 * parser.c (cp_parser_requirement_parameter_list): Pass
5597 CP_PARSER_FLAGS_TYPENAME_OPTIONAL.
5598
5599 * call.c (build_user_type_conversion_1): Don't look at the second
5600 conversion of a non-viable candidate.
5601
5602 2020-02-28 Jakub Jelinek <jakub@redhat.com>
5603
5604 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
5605 * typeck.c (cp_build_addr_expr_1): Allow taking address of immediate
5606 functions in unevaluated contexts.
5607
5608 2020-02-27 Nathan Sidwell <nathan@acm.org>
5609
5610 PR c++/93933
5611 * pt.c (template_args_equal): Pass ARGUMENT_PACKS through to
5612 cp_tree_equal.
5613 * tree.c (cp_tree_equal): Compare ARGUMENT_PACKS here,
5614 * typeck.c (comptypes): Assert we don't get any argument packs.
5615
5616 * class.c (adjust_clone_args): Correct arg-checking assert.
5617 * typeck.c (comptypes): Assert not nulls.
5618
5619 2020-02-26 Marek Polacek <polacek@redhat.com>
5620
5621 PR c++/93789 - ICE with invalid array bounds.
5622 * decl.c (compute_array_index_type_loc): Don't use the folded
5623 size when folding cleared TREE_CONSTANT.
5624
5625 2020-02-26 Iain Sandoe <iain@sandoe.co.uk>
5626
5627 * class.c (classtype_has_non_deleted_copy_ctor): New.
5628 * coroutines.cc (struct param_info): Keep track of params
5629 that are references, and cache the original type and whether
5630 the DTOR is trivial.
5631 (build_actor_fn): Handle param copies always, and adjust the
5632 handling for references.
5633 (register_param_uses): Only handle uses here.
5634 (classtype_has_non_deleted_copy_ctor): New.
5635 (morph_fn_to_coro): Adjust param copy handling to match n4849
5636 by reordering ahead of the promise CTOR and always making a
5637 frame copy, even if the param is unused in the coroutine body.
5638 * cp-tree.h (classtype_has_non_deleted_copy_ctor): New.
5639
5640 2020-02-26 Patrick Palka <ppalka@redhat.com>
5641
5642 * constraint.cc (finish_constraint_binary_op): Set expr's location range
5643 to the range of its operands.
5644 (satisfy_atom): Pass MAP instead of ARGS to diagnose_atomic_constraint.
5645 (diagnose_trait_expr): Take the instantiated parameter mapping MAP
5646 instead of the corresponding template arguments ARGS and adjust body
5647 accordingly.
5648 (diagnose_requires_expr): Likewise.
5649 (diagnose_atomic_constraint): Likewise. When printing an atomic
5650 constraint expression, print the instantiated parameter mapping
5651 alongside it.
5652 * cxx-pretty-print.cc (cxx_pretty_printer::expression)
5653 [NONTYPE_ARGUMENT_PACK]: Print braces around a NONTYPE_ARGUMENT_PACK.
5654 (cxx_pretty_printer::type_id): Handle TYPE_ARGUMENT_PACK.
5655
5656 2020-02-26 Marek Polacek <polacek@redhat.com>
5657
5658 PR c++/93676 - value-init crash in template.
5659 * init.c (build_new_1): Don't call build_vec_init in a template.
5660
5661 2020-02-26 Marek Polacek <polacek@redhat.com>
5662
5663 PR c++/93862 - ICE with static_cast when converting from int[].
5664 * call.c (reference_compatible_p): No longer static.
5665 * cp-tree.h (reference_compatible_p): Declare.
5666 * typeck.c (build_static_cast_1): Use reference_compatible_p instead
5667 of reference_related_p.
5668
5669 2020-02-26 Marek Polacek <polacek@redhat.com>
5670
5671 PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
5672 * constexpr.c (reduced_constant_expression_p): Don't crash on a null
5673 field.
5674
5675 2020-02-24 Martin Sebor <msebor@redhat.com>
5676
5677 PR c++/93804
5678 * parser.c (cp_parser_check_class_key): Avoid issuing -Wredundant-tags
5679 in shared C/C++ code in headers.
5680 Remove a duplicate hunk of code.
5681
5682 2020-02-24 Marek Polacek <polacek@redhat.com>
5683
5684 PR c++/93869 - ICE with -Wmismatched-tags.
5685 * parser.c (cp_parser_check_class_key): Check class_key earlier.
5686
5687 2020-02-24 Marek Polacek <polacek@redhat.com>
5688
5689 PR c++/93712 - ICE with ill-formed array list-initialization.
5690 * call.c (next_conversion): Return NULL for ck_aggr.
5691 (build_aggr_conv): Set u.expr instead of u.next.
5692 (build_array_conv): Likewise.
5693 (build_complex_conv): Likewise.
5694 (conv_get_original_expr): Handle ck_aggr.
5695
5696 2020-02-24 Jakub Jelinek <jakub@redhat.com>
5697
5698 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
5699 * call.c (build_over_call): Don't evaluate immediate functions in
5700 unevaluated operands.
5701
5702 2020-02-24 Jason Merrill <jason@redhat.com>
5703
5704 P0780R2: Resolve lambda init-capture pack grammar.
5705 * parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than
5706 ...&x=y.
5707
5708 2020-02-22 Marek Polacek <polacek@redhat.com>
5709
5710 PR c++/93882
5711 * decl.c (grokdeclarator): Use %qs in a diagnostic message.
5712
5713 2020-02-21 Martin Sebor <msebor@redhat.com>
5714
5715 PR gcov-profile/93753
5716 * class.c (check_flexarrays): Tighten up a test for potential members
5717 of anonymous structs or unions.
5718
5719 2020-02-20 Martin Sebor <msebor@redhat.com>
5720
5721 PR c++/93801
5722 * parser.c (cp_parser_check_class_key): Only handle true C++ class-keys.
5723
5724 2020-02-20 Martin Liska <mliska@suse.cz>
5725
5726 PR translation/93841
5727 * config/or1k/or1k.opt: Remove superfluous word.
5728 * doc/invoke.texi: Likewise.
5729
5730 2020-02-20 Martin Liska <mliska@suse.cz>
5731
5732 PR translation/93838
5733 * parser.c (cp_parser_decl_specifier_seq): Remove trailing space.
5734
5735 2020-02-19 Marek Polacek <polacek@redhat.com>
5736
5737 PR c++/93169 - wrong-code with a non-constexpr constructor.
5738 * constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY
5739 on constant CONSTRUCTORs.
5740
5741 2020-02-15 Marek Polacek <polacek@redhat.com>
5742
5743 PR c++/93710 - poor diagnostic for array initializer.
5744 * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
5745 for an error call.
5746
5747 2020-02-15 Jason Merrill <jason@redhat.com>
5748
5749 PR c++/92556
5750 * pt.c (any_template_parm_r): Look into lambda body.
5751
5752 PR c++/92583
5753 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
5754
5755 2020-02-14 Jakub Jelinek <jakub@redhat.com>
5756
5757 PR c++/61414
5758 * class.c (enum_min_precision): Change prec type from int to int &.
5759
5760 PR libstdc++/92906
5761 * cp-tree.h (enum cp_tree_index): Add CPTI_FALLBACK_DFLOAT32_TYPE,
5762 CPTI_FALLBACK_DFLOAT64_TYPE and CPTI_FALLBACK_DFLOAT128_TYPE.
5763 (fallback_dfloat32_type, fallback_dfloat64_type,
5764 fallback_dfloat128_type): Define.
5765 * mangle.c (write_builtin_type): Handle fallback_dfloat*_type like
5766 dfloat*_type_node.
5767 * rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
5768 is disabled for compatibility.
5769
5770 2020-02-13 Jason Merrill <jason@redhat.com>
5771
5772 PR c++/93713
5773 * name-lookup.c (matching_fn_p): A function does not match a
5774 template.
5775
5776 PR c++/93643
5777 PR c++/91476
5778 * tree.c (decl_linkage): Always lk_none for locals.
5779
5780 2020-02-12 Jason Merrill <jason@redhat.com>
5781
5782 PR c++/92583
5783 PR c++/92654
5784 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
5785 * pt.c (find_parameter_packs_r): Not here.
5786
5787 2020-02-12 Iain Sandoe <iain@sandoe.co.uk>
5788
5789 * coroutines.cc (build_actor_fn): Implement deallocation function
5790 selection per n4849, dcl.fct.def.coroutine bullet 12.
5791 (morph_fn_to_coro): Implement allocation function selection per
5792 n4849, dcl.fct.def.coroutine bullets 9 and 10.
5793
5794 2020-02-12 Marek Polacek <polacek@redhat.com>
5795
5796 PR c++/93684 - ICE-on-invalid with broken attribute.
5797 * parser.c (cp_parser_std_attribute): Peek a token first before
5798 consuming it.
5799
5800 2020-02-11 Jason Merrill <jason@redhat.com>
5801
5802 PR c++/93675
5803 * class.c (add_implicitly_declared_members): Use do_friend.
5804 * method.c (implicitly_declare_fn): Fix friend handling.
5805 (decl_remember_implicit_trigger_p): New.
5806 (synthesize_method): Use it.
5807 * decl2.c (mark_used): Use it.
5808
5809 2020-02-11 Jason Merrill <jason@redhat.com>
5810
5811 PR c++/93650
5812 PR c++/90691
5813 * constexpr.c (maybe_constant_value): Correct earlier change.
5814 (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
5815 * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.
5816
5817 2020-02-12 Patrick Palka <ppalka@redhat.com>
5818
5819 PR c++/69448
5820 PR c++/80471
5821 * type-utils.h (find_type_usage): Refactor to take a tree * and to
5822 return a tree *, and update documentation accordingly.
5823 * pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
5824 decltype(auto) node.
5825 (make_constrained_decltype_auto): No need to explicitly set
5826 AUTO_IS_DECLTYPE anymore.
5827 (splice_late_return_type): Use find_type_usage to find and
5828 replace a possibly nested auto node instead of using is_auto.
5829 Check test for is_auto into an assert when deciding whether
5830 to late_return_type.
5831 (type_uses_auto): Adjust the call to find_type_usage.
5832 * parser.c (cp_parser_decltype): No need to explicitly set
5833 AUTO_IS_DECLTYPE anymore.
5834
5835 * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
5836 (dump_simple_decl): Handle standard concept definitions as well as
5837 variable concept definitions.
5838
5839 2020-02-10 Jakub Jelinek <jakub@redhat.com>
5840
5841 PR other/93641
5842 * error.c (dump_decl_name): Fix up last argument to strncmp.
5843
5844 2020-02-10 Jason Merrill <jason@redhat.com>
5845
5846 PR c++/93618
5847 * tree.c (array_of_unknown_bound_p): New.
5848 * init.c (perform_member_init): Do nothing for flexible arrays.
5849
5850 2020-02-09 Jakub Jelinek <jakub@redhat.com>
5851
5852 PR c++/93633
5853 * constexpr.c (cxx_eval_constant_expression): If obj is heap var with
5854 ARRAY_TYPE, use the element type. Punt if objtype after that is not
5855 a class type.
5856
5857 2020-02-08 Jason Merrill <jason@redhat.com>
5858
5859 PR c++/90691
5860 * expr.c (fold_for_warn): Call maybe_constant_value.
5861 * constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
5862 (maybe_constant_value): Add uid_sensitive parm.
5863 (get_fundef_copy): Don't copy if it's true.
5864 (cxx_eval_call_expression): Don't instantiate if it's true.
5865 (cxx_eval_outermost_constant_expr): Likewise.
5866
5867 PR c++/92852
5868 * constexpr.c (maybe_constant_value): Don't unshare if the cached
5869 value is the same as the argument.
5870
5871 * typeck.c (maybe_warn_about_returning_address_of_local): Add
5872 location parameter.
5873
5874 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
5875 if appropriate.
5876
5877 2020-02-08 Jakub Jelinek <jakub@redhat.com>
5878
5879 PR c++/93549
5880 * constexpr.c (find_array_ctor_elt): If last element has no index,
5881 for flag_checking verify all elts have no index. If i is within the
5882 elts, return it directly, if it is right after the last elt, append
5883 if NULL index, otherwise force indexes on all elts.
5884 (cxx_eval_store_expression): Allow cep->index to be NULL.
5885
5886 2020-02-07 Marek Polacek <polacek@redhat.com>
5887
5888 PR c++/92947 - Paren init of aggregates in unevaluated context.
5889 * call.c (build_new_method_call_1): Don't check
5890 cp_unevaluated_operand. Check the return value of digest_init.
5891
5892 2020-02-06 Jason Merrill <jason@redhat.com>
5893
5894 PR c++/92654
5895 * tree.c (cp_walk_subtrees): Walk into type template arguments.
5896 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
5897 instead of TYPE_ALIAS_P.
5898 * pt.c (push_template_decl_real): Likewise.
5899 (find_parameter_packs_r): Likewise. Remove dead code.
5900 * error.c (find_typenames_r): Remove dead code.
5901
5902 2020-02-06 Jason Merrill <jason@redhat.com>
5903
5904 PR c++/92517
5905 * parser.c (cp_parser_constraint_primary_expression): Do the main
5906 parse non-tentatively.
5907
5908 2020-02-06 Marek Polacek <polacek@redhat.com>
5909
5910 PR c++/93597 - ICE with lambda in operator function.
5911 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
5912
5913 2020-02-05 Jason Merrill <jason@redhat.com>
5914
5915 PR c++/93140
5916 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
5917 handling of TREE_CHAIN for empty pack.
5918
5919 2020-02-05 Jakub Jelinek <jakub@redhat.com>
5920
5921 PR c++/93557
5922 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
5923 prior to passing it to c_build_vec_convert.
5924
5925 2020-02-05 Marek Polacek <polacek@redhat.com>
5926
5927 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
5928 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
5929 TREE_SIDE_EFFECTS.
5930
5931 2020-02-05 Jason Merrill <jason@redhat.com>
5932
5933 PR c++/92593
5934 * decl.c (grokdeclarator): Reject field of current class type even
5935 in a template.
5936
5937 2020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
5938
5939 * coroutines.cc (maybe_promote_captured_temps): Increase the index
5940 number for temporary variables' name.
5941
5942 2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
5943
5944 * coroutines.cc (build_co_await): Call convert_from_reference
5945 to wrap co_await_expr with indirect_ref which avoid
5946 reference/non-reference type confusion.
5947
5948 (co_await_expander): Sink to call_expr if await_resume
5949 is wrapped by indirect_ref.
5950
5951 2020-02-04 Jason Merrill <jason@redhat.com>
5952
5953 PR c++/93551
5954 * constraint.cc (satisfy_declaration_constraints): Check return
5955 value of push_tinst_level.
5956
5957 PR c++/90951
5958 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
5959 elements instead of value-initializing them.
5960
5961 PR c++/86917
5962 * init.c (perform_member_init): Simplify.
5963 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
5964 flexarray.
5965 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
5966
5967 2020-02-04 Iain Sandoe <iain@sandoe.co.uk>
5968
5969 * coroutines.cc (find_promise_type): Delete unused forward
5970 declaration.
5971 (struct coroutine_info): Add a bool for no promise type error.
5972 (coro_promise_type_found_p): Only emit the error for a missing
5973 promise once in each affected coroutine.
5974
5975 2020-02-03 Jason Merrill <jason@redhat.com>
5976
5977 PR c++/66477
5978 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
5979 defer loading the value of a reference.
5980
5981 2020-02-03 Jason Merrill <jason@redhat.com>
5982
5983 PR c++/91953
5984 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
5985 empty class type.
5986 [COMPONENT_REF]: A member function reference doesn't use the object
5987 as an rvalue.
5988
5989 2020-02-03 Iain Sandoe <iain@sandoe.co.uk>
5990
5991 PR c++/93458
5992 * coroutines.cc (struct coroutine_info): Add a bool flag to note
5993 that we emitted an error for a bad function return type.
5994 (get_coroutine_info): Tolerate an unset info table in case of
5995 missing traits.
5996 (find_coro_traits_template_decl): In case of error or if we didn't
5997 find a type template, note we emitted the error and suppress
5998 duplicates.
5999 (find_coro_handle_template_decl): Likewise.
6000 (instantiate_coro_traits): Only check for error_mark_node in the
6001 return from lookup_qualified_name.
6002 (coro_promise_type_found_p): Reorder initialization so that we check
6003 for the traits and their usability before allocation of the info
6004 table. Check for a suitable return type and emit a diagnostic for
6005 here instead of relying on the lookup machinery. This allows the
6006 error to have a better location, and means we can suppress multiple
6007 copies.
6008 (coro_function_valid_p): Re-check for a valid promise (and thus the
6009 traits) before proceeding. Tolerate missing info as a fatal error.
6010
6011 2020-02-03 Jason Merrill <jason@redhat.com>
6012
6013 PR c++/88256
6014 * cp-gimplify.c (predeclare_vla): New.
6015 (cp_genericize_r) [NOP_EXPR]: Call it.
6016
6017 2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
6018
6019 * coroutines.cc (transform_await_wrapper): Set actor funcion as
6020 new context of label_decl.
6021 (build_actor_fn): Fill new field of await_xform_data.
6022
6023 2020-02-02 Marek Polacek <polacek@redhat.com>
6024
6025 PR c++/93530 - ICE on invalid alignas in a template.
6026 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
6027 decl_attributes.
6028
6029 2020-01-31 Jason Merrill <jason@redhat.com>
6030
6031 PR c++/86216
6032 * semantics.c (process_outer_var_ref): Capture VLAs even in
6033 unevaluated context.
6034
6035 PR c++/14179
6036 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
6037 non-aggregate elements.
6038 (reshape_init_array): Add first_initializer_p parm.
6039 (reshape_init_r): Change first_initializer_p from bool to tree.
6040 (reshape_init): Pass init to it.
6041
6042 PR c++/14179
6043 * parser.c (cp_parser_initializer_list): Suppress location wrappers
6044 after 256 elements.
6045
6046 2020-01-29 Jason Merrill <jason@redhat.com>
6047
6048 PR c++/82521
6049 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
6050 the expression was dependent before substitution.
6051
6052 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
6053
6054 * coroutines.cc (act_des_fn): New.
6055 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
6056 Access promise via actor function's frame pointer argument.
6057 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
6058
6059 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
6060
6061 * coroutines.cc (co_await_expander): Handle type conversion case.
6062
6063 2020-01-29 Jason Merrill <jason@redhat.com>
6064
6065 PR c++/90333
6066 PR c++/89640
6067 PR c++/60503
6068 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
6069 a trailing return type.
6070 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
6071 parens.
6072
6073 2020-01-29 Marek Polacek <polacek@redhat.com>
6074
6075 PR c++/91754 - Fix template arguments comparison with class NTTP.
6076 * pt.c (class_nttp_const_wrapper_p): New.
6077 (template_args_equal): See through class_nttp_const_wrapper_p
6078 arguments.
6079
6080 2020-01-29 Marek Polacek <polacek@redhat.com>
6081
6082 PR c++/92948 - Fix class NTTP with template arguments.
6083 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
6084 converting a value-dependent expression to a class type.
6085 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
6086 as the result of the tsubst_copy call.
6087
6088 2020-01-29 Jakub Jelinek <jakub@redhat.com>
6089
6090 PR c++/91118
6091 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
6092 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
6093
6094 2020-01-28 Jason Merrill <jason@redhat.com>
6095
6096 PR c++/93442
6097 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
6098
6099 PR c++/93477
6100 PR c++/91476
6101 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
6102
6103 PR c++/90546
6104 * call.c (build_user_type_conversion_1): Allow a template conversion
6105 returning an rvalue reference to bind directly to an lvalue.
6106
6107 PR c++/90731
6108 * decl.c (grokdeclarator): Propagate eh spec from typedef.
6109
6110 2020-01-28 Martin Liska <mliska@suse.cz>
6111
6112 PR c++/92440
6113 * pt.c (redeclare_class_template): Group couple of
6114 errors and inform messages with auto_diagnostic_group.
6115
6116 2020-01-28 Martin Liska <mliska@suse.cz>
6117
6118 PR c++/92440
6119 * pt.c (redeclare_class_template): Use inform
6120 for the second location.
6121
6122 2020-01-27 Jason Merrill <jason@redhat.com>
6123
6124 PR c++/90966
6125 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
6126
6127 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
6128
6129 PR c++/93443
6130 * coroutines.cc (morph_fn_to_coro): Check the ramp return
6131 value when it is constructed from the 'get return object'.
6132
6133 2020-01-27 Nathan Sidwell <nathan@acm.org>
6134
6135 PR c++/91826
6136 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
6137
6138 2020-01-26 Jason Merrill <jason@redhat.com>
6139
6140 PR c++/90992
6141 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
6142 temporarily enable -Wsystem-headers. Change second warning to
6143 conditional inform.
6144
6145 PR c++/90997
6146 * semantics.c (finish_call_expr): Don't call
6147 instantiate_non_dependent_expr before warn_for_memset.
6148
6149 2020-01-25 Marek Polacek <polacek@redhat.com>
6150
6151 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
6152 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
6153 dynamic_cast diagnostic.
6154
6155 2020-01-24 Jason Merrill <jason@redhat.com>
6156
6157 PR c++/93400 - ICE with constrained friend.
6158 * constraint.cc (maybe_substitute_reqs_for): New.
6159 * decl.c (function_requirements_equivalent_p): Call it.
6160 * pt.c (tsubst_friend_function): Only substitute
6161 TEMPLATE_PARMS_CONSTRAINTS.
6162 (tsubst_template_parms): Copy constraints.
6163
6164 2020-01-24 Jason Merrill <jason@redhat.com>
6165
6166 PR c++/93279 - ICE with lambda in member operator.
6167 * name-lookup.c (maybe_save_operator_binding): Don't remember
6168 class-scope bindings.
6169
6170 2020-01-24 Jason Merrill <jason@redhat.com>
6171
6172 PR c++/93377 - ICE with member alias in constraint.
6173 * pt.c (any_template_parm_r): Look at template arguments for all
6174 aliases, not only alias templates.
6175
6176 2020-01-24 Marek Polacek <polacek@redhat.com>
6177
6178 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
6179 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
6180
6181 2020-01-24 Jason Merrill <jason@redhat.com>
6182
6183 PR c++/92852 - ICE with generic lambda and reference var.
6184 * constexpr.c (maybe_constant_value): Likewise.
6185
6186 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
6187
6188 PR c++/92804
6189 * parser.c (cp_parser_nested_name_specifier_opt): Properly
6190 diagnose concept-ids.
6191
6192 2020-01-23 Jason Merrill <jason@redhat.com>
6193
6194 PR c++/93331 - ICE with __builtin_strchr.
6195 * constexpr.c (cxx_eval_builtin_function_call): Use the original
6196 argument if we didn't manage to extract a STRING_CST.
6197
6198 PR c++/93345 - ICE with defaulted dtor and template.
6199 PR c++/33799
6200 * decl.c (cxx_maybe_build_cleanup): Don't try to set
6201 throwing_cleanup in a template.
6202
6203 2020-01-22 Marek Polacek <polacek@redhat.com>
6204
6205 PR c++/92907 - noexcept does not consider "const" in member functions.
6206 * g++.dg/cpp0x/noexcept56.C: New test.
6207
6208 2020-01-22 Marek Polacek <polacek@redhat.com>
6209
6210 PR c++/93324 - ICE with -Wall on constexpr if.
6211 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
6212
6213 2020-01-22 Patrick Palka <ppalka@redhat.com>
6214
6215 * constraint.cc (get_mapped_args): Avoid using auto_vec
6216 as a vector element. Release the vectors inside the lists
6217 vector.
6218 * parser.c (cp_literal_operator_id): Free the buffer.
6219
6220 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
6221
6222 * coroutines.cc (finish_co_await_expr): Add error check on return
6223 value of build_co_await.
6224 (finish_co_yield_expr,): Ditto.
6225
6226 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
6227
6228 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
6229 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
6230 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
6231
6232 2020-01-21 Jason Merrill <jason@redhat.com>
6233
6234 PR c++/60855 - ICE with sizeof VLA capture.
6235 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
6236
6237 PR c++/90732 - ICE with VLA capture and generic lambda.
6238 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
6239
6240 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
6241 Bin Cheng <bin.cheng@linux.alibaba.com>
6242
6243 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
6244 from complete_type_or_else.
6245 (register_param_uses): Likewise.
6246 (build_co_await): Do not try to use complete_type_or_else for void
6247 types, otherwise for incomplete types, check for NULL return from
6248 complete_type_or_else.
6249
6250 2020-01-21 Jason Merrill <jason@redhat.com>
6251
6252 PR c++/91476 - anon-namespace reference temp clash between TUs.
6253 * decl2.c (copy_linkage): Factor out of get_guard.
6254 * call.c (make_temporary_var_for_ref_to_temp): Use it.
6255 * decl.c (cp_finish_decomp): Use it.
6256 (cp_finish_decl): determine_visibility sooner.
6257
6258 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
6259
6260 * coroutines.cc (finish_co_await_expr): Set return value flag.
6261 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
6262
6263 2020-01-19 Jason Merrill <jason@redhat.com>
6264
6265 PR c++/33799 - destroy return value, take 2.
6266 * cp-tree.h (current_retval_sentinel): New macro.
6267 (struct language_function): Add throwing_cleanup bitfield.
6268 * decl.c (cxx_maybe_build_cleanup): Set it.
6269 * except.c (maybe_set_retval_sentinel)
6270 (maybe_splice_retval_cleanup): New functions.
6271 * parser.c (cp_parser_compound_statement): Call
6272 maybe_splice_retval_cleanup.
6273 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
6274
6275 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
6276
6277 2020-01-18 Jakub Jelinek <jakub@redhat.com>
6278
6279 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
6280 but non-NO_DOLLAR_IN_LABEL case build.
6281
6282 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
6283
6284 * Make-lang.in: Add coroutines.o.
6285 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
6286 (DECL_COROUTINE_P): New.
6287 * lex.c (init_reswords): Enable keywords when the coroutine flag
6288 is set,
6289 * operators.def (co_await): New operator.
6290 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
6291 (op_error): Likewise.
6292 (build_new_op_1): Likewise.
6293 (build_new_function_call): Validate coroutine builtin arguments.
6294 * constexpr.c (potential_constant_expression_1): Handle
6295 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
6296 * coroutines.cc: New file.
6297 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
6298 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
6299 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
6300 * cp-tree.h (coro_validate_builtin_call): New.
6301 * decl.c (emit_coro_helper): New.
6302 (finish_function): Handle the case when a function is found to
6303 be a coroutine, perform the outlining and emit the outlined
6304 functions. Set a bit to signal that this is a coroutine component.
6305 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
6306 (cp_parser_unary_expression): Handle co_await.
6307 (cp_parser_assignment_expression): Handle co_yield.
6308 (cp_parser_statement): Handle RID_CO_RETURN.
6309 (cp_parser_jump_statement): Handle co_return.
6310 (cp_parser_operator): Handle co_await operator.
6311 (cp_parser_yield_expression): New.
6312 (cp_parser_required_error): Handle RT_CO_YIELD.
6313 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
6314 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
6315 CO_RETURN_EXPRs.
6316 * tree.c (cp_walk_subtrees): Likewise.
6317
6318 2020-01-17 Jason Merrill <jason@redhat.com>
6319
6320 PR c++/92531 - ICE with noexcept(lambda).
6321 * pt.c (uses_template_parms): Don't try to enumerate all the
6322 expression cases.
6323
6324 2020-01-17 Jakub Jelinek <jakub@redhat.com>
6325
6326 PR c++/93228
6327 * parser.c (cp_parser_template_name): Look up deprecated attribute
6328 in DECL_TEMPLATE_RESULT or its type's attributes.
6329
6330 2020-01-16 Jason Merrill <jason@redhat.com>
6331
6332 PR c++/93286 - ICE with __is_constructible and variadic template.
6333 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
6334 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
6335
6336 PR c++/93280 - ICE with aggregate assignment and DMI.
6337 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
6338 * typeck2.c (digest_nsdmi_init): Not here.
6339
6340 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
6341
6342 PR c++/91073
6343 * cp-tree.h (is_constrained_auto): New.
6344 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
6345 handle concept-check expressions; take a cp_decl_specifier_seq*
6346 instead of a bool.
6347 (cp_parser_condition): Update call.
6348 (cp_parser_simple_declaration): Likewise.
6349 (cp_parser_placeholder_type_specifier): Correctly handle
6350 concept-check expressions.
6351
6352 2020-01-15 Jason Merrill <jason@redhat.com>
6353
6354 Revert
6355 PR c++/33799 - destroy return value if local cleanup throws.
6356 * cp-tree.h (current_retval_sentinel): New macro.
6357 * decl.c (start_preparsed_function): Set up cleanup for retval.
6358 * typeck.c (check_return_expr): Set current_retval_sentinel.
6359
6360 PR c++/93257 - consteval void function.
6361 * constexpr.c (verify_constant): Allow void_node.
6362
6363 PR c++/92871 - bad code with xvalue and GNU ?: extension.
6364 * call.c (prevent_lifetime_extension): New.
6365 (build_conditional_expr_1): Use it.
6366
6367 2020-01-14 Nathan Sidwell <nathan@acm.org>
6368
6369 PR c++/90916
6370 * pt.c (retrieve_specialization): Use get_template_info, not open
6371 coding access.
6372
6373 PR c++/90916
6374 * pt.c (retrieve_specialization): Get the TI from the decl or the
6375 classtype as appropriate.
6376
6377 2020-01-14 David Malcolm <dmalcolm@redhat.com>
6378
6379 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
6380 New static constant.
6381 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
6382 (struct named_label_hash::empty_zero_p): Likewise.
6383 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
6384
6385 2020-01-14 Jason Merrill <jason@redhat.com>
6386
6387 PR c++/92590 - wrong handling of inherited default ctor.
6388 * class.c (add_method): A constrained inherited ctor doesn't hide an
6389 implicit derived ctor.
6390 Revert:
6391 PR c++/92552 - ICE with inherited constrained default ctor.
6392 * pt.c (instantiate_class_template_1): Copy
6393 TYPE_HAS_USER_CONSTRUCTOR.
6394 PR c++/91930 - ICE with constrained inherited default ctor.
6395 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
6396 for inherited constructor.
6397 PR c++/92594 - ICE with inherited trivial default ctor.
6398 * method.c (trivial_fn_p): Treat an inherited default constructor
6399 like a normal default constructor.
6400
6401 PR c++/92594 - ICE with inherited trivial default ctor.
6402 * method.c (trivial_fn_p): Treat an inherited default constructor
6403 like a normal default constructor.
6404
6405 PR c++/92009 - ICE with punning of typeid.
6406 * rtti.c (get_tinfo_desc): Call xref_basetypes.
6407 * constexpr.c (cxx_fold_indirect_ref): Don't strip
6408 REINTERPRET_CAST_P.
6409
6410 2020-01-13 Jason Merrill <jason@redhat.com>
6411
6412 PR c++/92746 - ICE with noexcept of function concept check.
6413 * except.c (check_noexcept_r): Handle concept-check.
6414
6415 PR c++/92582 - ICE with member template as requirement.
6416 * pt.c (struct find_template_parameter_info): Add ctx_parms.
6417 (any_template_parm_r): Handle TEMPLATE_DECL.
6418 (find_template_parameters): Take parms instead of their depth.
6419 * constraint.cc (build_parameter_mapping): Pass them.
6420
6421 PR c++/33799 - destroy return value if local cleanup throws.
6422 * cp-tree.h (current_retval_sentinel): New macro.
6423 * decl.c (start_preparsed_function): Set up cleanup for retval.
6424 * typeck.c (check_return_expr): Set current_retval_sentinel.
6425
6426 PR c++/93238 - short right-shift with enum.
6427 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
6428
6429 2020-01-10 Jason Merrill <jason@redhat.com>
6430
6431 * typeck.c (cp_build_binary_op): Restore short_shift code.
6432
6433 PR c++/93143 - incorrect tree sharing with constexpr.
6434 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
6435 CONSTRUCTORs are already unshared.
6436
6437 PR c++/93173 - incorrect tree sharing.
6438 PR c++/93033
6439 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
6440 copy_if_shared after cp_genericize_tree.
6441 * typeck2.c (split_nonconstant_init): Don't unshare here.
6442
6443 2020-01-08 Jason Merrill <jason@redhat.com>
6444
6445 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
6446 TARGET_EXPR_DIRECT_INIT_P.
6447 * constexpr.c (cxx_eval_constant_expression): Likewise.
6448
6449 2020-01-08 Jason Merrill <jason@redhat.com>
6450
6451 PR c++/91369 - constexpr destructor and member initializer.
6452 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
6453 when not preevaluating.
6454
6455 2020-01-08 Jason Merrill <jason@redhat.com>
6456
6457 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
6458 support.
6459
6460 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
6461
6462 * init.c (build_new): Add location_t parameter and use it throughout.
6463 (build_raw_new_expr): Likewise.
6464 * parser.c (cp_parser_new_expression): Pass the combined_loc.
6465 * pt.c (tsubst_copy_and_build): Adjust call.
6466 * cp-tree.h: Update declarations.
6467
6468 2020-01-07 Jason Merrill <jason@redhat.com>
6469
6470 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
6471 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
6472 explicit class visibility for a template.
6473
6474 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
6475
6476 * mangle.c (mangle_type_attribute_p): New function, split out from...
6477 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
6478 that contain a space.
6479
6480 2020-01-07 Jakub Jelinek <jakub@redhat.com>
6481
6482 PR c++/91369
6483 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
6484 member, initialize it to zero in ctor.
6485 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
6486 a heap object. Don't cache calls to functions which allocate some
6487 heap objects and don't deallocate them or deallocate some heap
6488 objects they didn't allocate.
6489
6490 2020-01-06 Jason Merrill <jason@redhat.com>
6491
6492 PR c++/92552 - ICE with inherited constrained default ctor.
6493 * pt.c (instantiate_class_template_1): Copy
6494 TYPE_HAS_USER_CONSTRUCTOR.
6495 * class.c (one_inherited_ctor): Don't set it here.
6496
6497 2020-01-06 Andrew Sutton <asutton@lock3software.com>
6498
6499 PR c++/92739 - parsing requires clause with attributes.
6500 * parser.c (cp_parser_constraint_requires_parens): Exclude
6501 attributes as postfix expressions.
6502
6503 2020-01-05 Jakub Jelinek <jakub@redhat.com>
6504
6505 PR c++/93138
6506 * parser.c (cp_parser_check_class_key): Disable access checks for the
6507 simple name lookup.
6508 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
6509 !warn_redundant_tags.
6510
6511 2010-01-05 Jakub Jelinek <jakub@redhat.com>
6512
6513 PR c++/93046
6514 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
6515 TARGET_EXPR if it has been gimplified already.
6516
6517 2020-01-03 Jason Merrill <jason@redhat.com>
6518
6519 PR c++/93033 - incorrect tree node sharing with array init.
6520 * typeck2.c (split_nonconstant_init): Unshare non-decl.
6521 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
6522
6523 2020-01-02 Jason Merrill <jason@redhat.com>
6524
6525 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
6526 C++17.
6527
6528 2020-01-02 Jakub Jelinek <jakub@redhat.com>
6529
6530 PR c/90677
6531 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
6532 has not been found, rather than error_mark_node.
6533
6534 2020-01-01 Jakub Jelinek <jakub@redhat.com>
6535
6536 Update copyright years.
6537 \f
6538 Copyright (C) 2020 Free Software Foundation, Inc.
6539
6540 Copying and distribution of this file, with or without modification,
6541 are permitted in any medium without royalty provided the copyright
6542 notice and this notice are preserved.
This page took 0.327913 seconds and 5 git commands to generate.