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