Daily bump.
[gcc.git] / gcc / cp / ChangeLog
1 2020-08-25 Tobias Burnus <tobias@codesourcery.com>
2
3 PR c/96678
4 * semantics.c (handle_omp_array_sections_1): Talk about
5 array function parameter in the error message.
6
7 2020-08-25 Jakub Jelinek <jakub@redhat.com>
8
9 PR c++/96721
10 * cp-tree.h (build_trivial_dtor_call): Add bool argument defaulted
11 to false.
12 * call.c (build_trivial_dtor_call): Add NO_PTR_DEREF argument. If
13 instance is a pointer and NO_PTR_DEREF is true, clobber the pointer
14 rather than what it points to.
15 * semantics.c (finish_call_expr): Call build_trivial_dtor_call with
16 true as NO_PTR_DEREF.
17
18 2020-08-25 Jason Merrill <jason@redhat.com>
19
20 PR c++/95428
21 * optimize.c (populate_clone_array): Revert PR70462 change.
22 (maybe_clone_body): Likewise.
23
24 2020-08-24 Nathan Sidwell <nathan@acm.org>
25
26 * ptree.c (debug_overload): New.
27
28 2020-08-19 Jason Merrill <jason@redhat.com>
29
30 DR 2369
31 * cp-tree.h (push_tinst_level, push_tinst_level_loc): Declare.
32 * constraint.cc (satisfy_declaration_constraints):
33 Use add_outermost_template_args and push_tinst_level.
34 * pt.c (add_outermost_template_args): Handle getting
35 a TEMPLATE_DECL as the first argument.
36 (push_tinst_level, push_tinst_level_loc): No longer static.
37 (fn_type_unification): Check satisfaction before non-dependent
38 conversions.
39
40 2020-08-18 Nathan Sidwell <nathan@acm.org>
41
42 * cp-tree.h (SET_TYPE_TEMPLTE_INFO): Do not deal with ALIAS templates.
43 * pt.c (lookup_template_class_1): Special-case alias template
44 template_info setting.
45
46 2020-08-18 Jason Merrill <jason@redhat.com>
47
48 PR c++/96199
49 * pt.c (tsubst_aggr_type): Rewrite in C++17, too.
50 (maybe_dependent_member_ref): Likewise.
51 (build_deduction_guide): Re-substitute template parms.
52 * cp-tree.h (struct push_nested_class_guard): New.
53 * constraint.cc (get_normalized_constraints_from_decl): Use it.
54
55 2020-08-18 Jason Merrill <jason@redhat.com>
56
57 PR c++/96199
58 * pt.c (maybe_dependent_member_ref): New.
59 (tsubst_copy) [CONST_DECL]: Use it.
60 [VAR_DECL]: Likewise.
61 (tsubst_aggr_type): Handle nested type.
62
63 2020-08-18 Nathan Sidwell <nathan@acm.org>
64
65 * name-lookup.c (qualify_lookup): Drop lambda checking here.
66 Reorder namespace & type checking.
67 (lookup_name_1): Do hidden lambda checking here.
68
69 2020-08-14 Nathan Sidwell <nathan@acm.org>
70
71 * name-lookup.h (lookup_name_real, lookup_name_nonclass): Rename
72 to ...
73 (lookup_name): ... these new overloads.
74 * name-lookup.c (identifier_type_value_1): Rename lookup_name_real
75 call.
76 (lookup_name_real_1): Rename to ...
77 (lookup_name_1): ... here.
78 (lookup_name_real): Rename to ...
79 (lookup_name): ... here. Rename lookup_name_real_1 call.
80 (lookup_name_nonclass): Delete.
81 * call.c (build_operator_new_call): Rename lookup_name_real call.
82 (add_operator_candidates): Likewise.
83 (build_op_delete_call): Rename lookup_name_nonclass call.
84 * parser.c (cp_parser_lookup_name): Likewise.
85 * pt.c (tsubst_friend_class, lookup_init_capture_pack): Likewise.
86 (tsubst_expr): Likewise.
87 * semantics.c (capture_decltype): Likewise.
88
89 2020-08-14 Nathan Sidwell <nathan@acm.org>
90
91 * cp-tree.h (LOOKUP_HIDDEN): Delete.
92 (LOOKUP_PREFER_RVALUE): Adjust initializer.
93 * name-lookup.h (enum class LOOK_want): Add HIDDEN_FRIEND and
94 HIDDEN_LAMBDA flags.
95 (lookup_name_real): Drop flags parm.
96 (lookup_qualified_name): Drop find_hidden parm.
97 * name-lookup.c (class name_lookup): Drop hidden field, adjust
98 ctors.
99 (name_lookup::add_overload): Check want for hiddenness.
100 (name_lookup::process_binding): Likewise.
101 (name_lookup::search_unqualified): Likewise.
102 (identifier_type_value_1): Adjust lookup_name_real call.
103 (set_decl_namespace): Adjust name_lookup ctor.
104 (qualify_lookup): Drop flags parm, use want for hiddenness.
105 (lookup_qualified_name): Drop find_hidden parm.
106 (lookup_name_real_1): Drop flags parm, adjust qualify_lookup
107 calls.
108 (lookup_name_real): Drop flags parm.
109 (lookup_name_nonclass, lookup_name): Adjust lookup_name_real
110 calls.
111 (lookup_type_scope_1): Adjust qualify_lookup calls.
112 * call.c (build_operator_new_call): Adjust lookup_name_real call.
113 (add_operator_candidates): Likewise.
114 * coroutines.cc (morph_fn_to_coro): Adjust lookup_qualified_name
115 call.
116 * parser.c (cp_parser_lookup_name): Adjust lookup_name_real calls.
117 * pt.c (check_explicit_specialization): Adjust
118 lookup_qualified_name call.
119 (deduction_guides_for): Likewise.
120 (tsubst_friend_class): Adjust lookup_name_real call.
121 (lookup_init_capture_pack): Likewise.
122 (tsubst_expr): Likewise, don't look in namespaces.
123 * semantics.c (capture_decltype): Adjust lookup_name_real. Don't
124 look in namespaces.
125
126 2020-08-14 Jason Merrill <jason@redhat.com>
127
128 PR c++/90254
129 PR c++/93711
130 * cp-tree.h (unsafe_return_slot_p): Declare.
131 * call.c (is_base_field_ref): Rename to unsafe_return_slot_p.
132 (build_over_call): Check unsafe_return_slot_p.
133 (build_special_member_call): Likewise.
134 * init.c (expand_default_init): Likewise.
135 * typeck2.c (split_nonconstant_init_1): Likewise.
136
137 2020-08-14 Nathan Sidwell <nathan@acm.org>
138
139 * cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES)
140 (LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY)
141 (LOOKUP_QUALIFIERS_ONL): Delete.
142 (LOOKUP_HIDDEN): Adjust.
143 * name-lookup.h (enum class LOOK_want): New.
144 (operator|, operator&): Overloads for it.
145 (lookup_name_real): Replace prefer_type & namespaces_only with
146 LOOK_want parm.
147 (lookup_qualified_name): Replace prefer_type with LOOK_want.
148 (lookup_name_prefer_type): Replace with ...
149 (lookup_name): ... this. New overload with LOOK_want parm.
150 * name-lookup.c (struct name_lookup): Replace flags with want and
151 hidden fields. Adjust constructors.
152 (name_lookyp::add_overload): Correct hidden stripping test. Update
153 for new LOOK_want type.
154 (name_lookup::process_binding): Likewise.
155 (name_lookup::search_unqualified): Use hidden flag.
156 (identifier_type_value_1): Adjust lookup_name_real call.
157 (set_decl_namespace): Adjust name_lookup ctor.
158 (lookup_flags): Delete.
159 (qualify_lookup): Add LOOK_want parm, adjust.
160 (lookup_qualified_name): Replace prefer_type parm with LOOK_want.
161 (lookup_name_real_1): Replace prefer_type and namespaces_only with
162 LOOK_want parm.
163 (lookup_name_real): Likewise.
164 (lookup_name_nonclass, lookup_name): Adjust lookup_name_real call.
165 (lookup_name_prefer_type): Rename to ...
166 (lookup_name): ... here. New overload with LOOK_want parm.
167 (lookup_type_scope_1): Adjust qualify_lookup calls.
168 * call.c (build_operator_new_call)
169 (add_operator_candidates): Adjust lookup_name_real calls.
170 * coroutines.cc (find_coro_traits_template_decl)
171 (find_coro_handle_template_decl, morph_fn_to_coro): Adjust
172 lookup_qualified_name calls.
173 * cp-objcp-common.c (identifier_global_tag): Likewise.
174 * decl.c (get_tuple_size, get_tuple_decomp_init): Likewise.
175 (lookup_and_check_tag): Use lookup_name overload.
176 * parser.c (cp_parser_userdef_numeric_literal): Adjust
177 lookup_qualified_name call.
178 (prefer_arg_type): Drop template_mem_access parm, return LOOK_want
179 value.
180 (cp_parser_lookup_name): Adjust lookup_member, lookup_name_real
181 calls.
182 * pt.c (check_explicit_specialization): Adjust lookup_qualified_name
183 call.
184 (tsubst_copy_and_build, tsubst_qualified_name): Likewise
185 (deduction_guides_for): Likewise.
186 (tsubst_friend_class): Adjust lookup_name_real call.
187 (lookup_init_capture, tsubst_expr): Likewise.
188 * rtti.c (emit_support_tinfos): Adjust lookup_qualified_name call.
189 * semantics.c (omp_reduction_lookup): Likewise.
190 (capture_decltype): Adjust lookup_name_real call.
191
192 2020-08-13 Nathan Sidwell <nathan@acm.org>
193
194 * name-lookup.h (enum class LOOK_where): New.
195 (operator|, operator&): Overloads for it.
196 (lookup_name_real): Replace NONCLASS & BLOCK_P parms with WHERE.
197 * name-lookup.c (identifier_type_value_w): Adjust
198 lookup_name_real call.
199 (lookup_name_real_1): Replace NONCLASS and BLOCK_P parameters
200 with WHERE bitmask. Don't search namespaces if not asked to.
201 (lookup_name_real): Adjust lookup_name_real_1 call.
202 (lookup_name_nonclass, lookup_name)
203 (lookup_name_prefer_type): Likewise.
204 * call.c (build_operator_new_call)
205 (add_operator_candidates): Adjust lookup_name_real calls.
206 * parser.c (cp_parser_lookup_name): Likewise.
207 * pt.c (tsubst_friend_class, lookup_init_capture_pack)
208 (tsubst_expr): Likewise.
209 * semantics.c (capture_decltype): Likewise.
210
211 2020-08-13 Marek Polacek <polacek@redhat.com>
212
213 PR c++/92812
214 * typeck.c (build_static_cast_1): Implement P1975R0 by allowing
215 static_cast to aggregate type.
216
217 2020-08-10 Jakub Jelinek <jakub@redhat.com>
218
219 PR c++/96497
220 * constexpr.c (cxx_eval_binary_expression): For SPACESHIP_EXPR, tail
221 call cxx_eval_constant_expression after genericize_spaceship to avoid
222 undesirable further VERIFY_CONSTANT.
223
224 2020-08-10 Patrick Palka <ppalka@redhat.com>
225
226 * pt.c (resolve_overloaded_unification): Drop functions with
227 unsatisfied constraints.
228 (resolve_nondeduced_context): Likewise.
229
230 2020-08-05 Patrick Palka <ppalka@redhat.com>
231 Jason Merrill <jason@redhat.com>
232
233 PR c++/96282
234 * constexpr.c (cxx_eval_vec_init_1): Truncate ctx->ctor and
235 then clear CONSTRUCTOR_NO_CLEARING on each appended element
236 initializer if we're initializing a previously zero-initialized
237 array object.
238
239 2020-08-04 Marek Polacek <polacek@redhat.com>
240
241 PR c++/96082
242 * parser.c (cp_parser_elaborated_type_specifier): Allow
243 'template' following ::.
244
245 2020-08-04 Nathan Sidwell <nathan@acm.org>
246
247 * parser.c (cp_parser_explicit_specialization): Refactor
248 to avoid leak of num_template_parameter_lists value.
249
250 2020-08-04 Patrick Palka <ppalka@redhat.com>
251
252 PR c++/94024
253 * init.c (sort_mem_initializers): Preserve TREE_TYPE of the
254 member initializer list node.
255 (emit_mem_initializers): Set input_location when performing each
256 member initialization.
257 * parser.c (cp_parser_mem_initializer): Attach the source
258 location of this initializer to a dummy EMPTY_CLASS_EXPR
259 within the TREE_TYPE of the list node.
260 * pt.c (tsubst_initializer_list): Preserve TREE_TYPE of the
261 member initializer list node.
262
263 2020-08-03 Marek Polacek <polacek@redhat.com>
264
265 * cp-tree.h (after_nsdmi_defaulted_late_checks): Remove.
266
267 2020-08-03 Marek Polacek <polacek@redhat.com>
268
269 DR 2032
270 PR c++/96218
271 * pt.c (check_default_tmpl_args): Also consider variable
272 templates.
273
274 2020-07-31 Jakub Jelinek <jakub@redhat.com>
275
276 PR c++/96182
277 * decl.c (finish_function): In constexpr functions use for C++14 and
278 later error instead of warning if no return statement is present and
279 diagnose it regardless of warn_return_type. Move the warn_return_type
280 diagnostics earlier in the function.
281
282 2020-07-31 Martin Sebor <msebor@redhat.com>
283
284 PR c++/96003
285 * class.c (build_base_path): Set no-warning bit on the synthesized
286 conditional expression in static_cast.
287
288 2020-07-31 Richard Biener <rguenther@suse.de>
289
290 PR debug/96383
291 * cp-objcp-common.h (LANG_HOOKS_FINALIZE_EARLY_DEBUG):
292 Define to c_common_finalize_early_debug.
293
294 2020-07-31 Patrick Palka <ppalka@redhat.com>
295
296 PR c++/96197
297 * constexpr.c (cxx_eval_constant_expression) <case CONST_DECL>:
298 Pass false to decl_constant_value and decl_really_constant_value
299 so that they don't unshare their result.
300 * cp-tree.h (decl_constant_value): New declaration with an added
301 bool parameter.
302 (decl_really_constant_value): Add bool parameter defaulting to
303 true to existing declaration.
304 * init.c (constant_value_1): Add bool parameter which controls
305 whether to unshare the initializer before returning. Call
306 unshare_expr at most once.
307 (scalar_constant_value): Pass true to constant_value_1's new
308 bool parameter.
309 (decl_really_constant_value): Add bool parameter and forward it
310 to constant_value_1.
311 (decl_constant_value): Likewise, but instead define a new
312 overload with an added bool parameter.
313
314 2020-07-30 Patrick Palka <ppalka@redhat.com>
315
316 PR c++/64194
317 * pt.c (resolve_overloaded_unification): If the function
318 template specialization has a placeholder return type,
319 then instantiate it before attempting unification.
320
321 2020-07-30 Patrick Palka <ppalka@redhat.com>
322
323 PR c++/95486
324 * pt.c (alias_ctad_tweaks): Call remove_constraints before
325 calling set_constraints.
326
327 2020-07-30 Patrick Palka <ppalka@redhat.com>
328
329 PR c++/96106
330 * pt.c (reduce_template_parm_level): Propagate DECL_VIRTUAL_P
331 from the original TEMPLATE_PARM_DECL to the new lowered one.
332
333 2020-07-30 Patrick Palka <ppalka@redhat.com>
334
335 PR c++/96164
336 * constraint.cc (constraints_satisfied_p): Return true if
337 !flags_concepts.
338 * pt.c (do_type_instantiation): Update a paragraph taken from
339 [temp.explicit] to reflect the latest specification. Don't
340 instantiate a member with unsatisfied constraints.
341
342 2020-07-29 Jason Merrill <jason@redhat.com>
343
344 PR c++/91427
345 * cp-tree.h (IMPLICIT_RVALUE_P): New.
346 (enum cp_lvalue_kind_flags): Add clk_implicit_rval.
347 (implicit_rvalue_p, set_implicit_rvalue_p): New.
348 * call.c (reference_binding): Check clk_implicit_rval.
349 (build_over_call): Adjust C++20 implicit move.
350 * coroutines.cc (finish_co_return_stmt): Simplify implicit move.
351 * except.c (build_throw): Adjust C++20 implicit move.
352 * pt.c (tsubst_copy_and_build) [STATIC_CAST_EXPR]: Propagate
353 IMPLICIT_RVALUE_P.
354 * tree.c (lvalue_kind): Set clk_implicit_rval.
355 * typeck.c (treat_lvalue_as_rvalue_p): Overhaul.
356 (maybe_warn_pessimizing_move): Adjust.
357 (check_return_expr): Adjust C++20 implicit move.
358
359 2020-07-29 Jason Merrill <jason@redhat.com>
360
361 PR c++/91212
362 * call.c (build_over_call): Don't call a const ref
363 overload for implicit move.
364
365 2020-07-28 Nathan Sidwell <nathan@acm.org>
366
367 * cp-gimplify.c (cp_genericize_r): Set IMPORTED_DECL's context.
368 * cp-objcp-common.c (cp_pushdecl): Set decl's context.
369 * decl.c (grokfndecl): Make DECL_CONTEXT setting clearer.
370
371 2020-07-28 Nathan Sidwell <nathan@acm.org>
372
373 * class.c (fixup_type_variants): Copy TYPE_SIZE and
374 TYPE_SIZE_UINIT.
375 (finish_struct): Call it.
376
377 2020-07-28 Nathan Sidwell <nathan@acm.org>
378
379 * ptree.c (cxx_print_decl): Better indentation.
380
381 2020-07-28 Jakub Jelinek <jakub@redhat.com>
382 Mark Wielaard <mark@klomp.org>
383
384 PR c++/96328
385 * parser.c (cp_lexer_safe_previous_token): Don't call
386 cp_lexer_previous_token, instead inline it by hand and return NULL
387 instead of failing assertion if all previous tokens until the first
388 one are purged.
389 (cp_parser_error_1): Optimize - only call cp_lexer_safe_previous_token
390 if token->type is CPP_NAME. Use cp_lexer_safe_previous_token instead
391 of cp_lexer_previous_token for the missing_token_desc != RT_NONE
392 case too.
393
394 2020-07-27 Nathan Sidwell <nathan@acm.org>
395
396 * cp-tree.h (enum cp_tree_index): Add CPTI_AS_BASE_IDENTIFIER.
397 (as_base_identifier): Define.
398 * decl.c (initialize_predifined_identifiers): Initialize as_base
399 identifier.
400 * class.c (layout_class_type): Name the as-base type. Zap
401 NSDMI its fields may have.
402
403 2020-07-22 Nathan Sidwell <nathan@acm.org>
404
405 * class.c (maybe_add_class_template_decl_list): Don't add CONST_DECLs.
406
407 2020-07-22 Nathan Sidwell <nathan@acm.org>
408
409 * typeck.c (structural_comptypes): [DECLTYPE_TYPE] break
410 apart complex if.
411 [UNDERLYING_TYPE]: Use an if.
412 [TYPEOF_TYPE]: New.
413
414 2020-07-22 Nathan Sidwell <nathan@acm.org>
415
416 * decl.c (decls_match): Move variables into scopes
417 they're needed in.
418 (duplicate_decls): Use STRIP_TEMPLATE.
419 (build_typename_type): Move var decls to their assignments.
420 (begin_function_body): Likewise.
421 * decl2.c (get_guard): Likewise.
422 (mark_used): Use true for truthiness.
423 * error.c (dump_aggr_type): Hold the decl in a var called
424 'decl', not 'name'.
425
426 2020-07-22 Nathan Sidwell <nathan@acm.org>
427
428 * cp-tree.h (struct tree_lambda_expr): Shrink
429 default_capture_mode & discriminator.
430
431 2020-07-22 Nathan Sidwell <nathan@acm.org>
432
433 * mangle.c (decl_is_template_id): Rename to ...
434 (maybe_template_info): ... here. Return the template info,
435 rather than use a pointer. Adjust all callers.
436 (find_substitution): Use template_args_equal, rather than
437 local check.
438
439 2020-07-22 Tobias Burnus <tobias@codesourcery.com>
440
441 * parser.c (cp_parser_omp_clause_hint): Require nonnegative hint.
442 (cp_parser_omp_critical): Permit hint(0) clause without named critical.
443 * pt.c (tsubst_expr): Re-check the latter for templates.
444
445 2020-07-21 Sunil K Pandey <skpgkp2@gmail.com>
446
447 PR target/95237
448 * decl.c (cp_finish_decl): Call target hook
449 lower_local_decl_alignment to lower local decl alignment.
450
451 2020-07-21 Nathan Sidwell <nathan@acm.org>
452
453 * parser.c (cp_lexer_consume_token): Drop PRAGMA_EOL assert.
454 (cp_parser_skip_to_closing_parenthesis_1): Only pass start token
455 to pragma skipper if recovering.
456 (cp_parser_skip_to_pragma_eol): Only purge and change pragma
457 state when recovering.
458
459 2020-07-20 Jason Merrill <jason@redhat.com>
460
461 * pt.c (type_dependent_expression_p): A pseudo-dtor can be
462 dependent.
463 * semantics.c (finish_call_expr): Use build_trivial_dtor_call for
464 pseudo-destructor.
465 (finish_pseudo_destructor_expr): Leave type NULL for dependent arg.
466
467 2020-07-20 Jason Merrill <jason@redhat.com>
468
469 * mangle.c (write_base_ref): New.
470 (write_expression): Use it for base field COMPONENT_REFs.
471 * pt.c (invalid_tparm_referent_p): Canonicalize the type
472 of array offsets. Allow subobjects.
473
474 2020-07-20 Jason Merrill <jason@redhat.com>
475
476 * pt.c (collect_ctor_idx_types): Add 'const' when deducing from
477 a string constant.
478
479 2020-07-17 Marek Polacek <polacek@redhat.com>
480
481 PR c++/79815
482 * decl.c (grokdeclarator): Detect cv-qual decltype(auto).
483 * pt.c (do_auto_deduction): Likewise.
484
485 2020-07-16 Iain Sandoe <iain@sandoe.co.uk>
486
487 PR c++/95591
488 PR c++/95599
489 PR c++/95823
490 PR c++/95824
491 PR c++/95895
492 * coroutines.cc (struct coro_ret_data): Delete.
493 (coro_maybe_expand_co_return): Delete.
494 (co_return_expander): Delete.
495 (expand_co_returns): Delete.
496 (co_await_find_in_subtree): Remove unused name.
497 (build_actor_fn): Remove unused parm, remove handling
498 for co_return expansion.
499 (register_await_info): Demote duplicate info message to a
500 warning.
501 (coro_make_frame_entry): Move closer to use site.
502 (struct susp_frame_data): Add fields for final suspend label
503 and a flag to indicate await expressions with initializers.
504 (captures_temporary): Delete.
505 (register_awaits): Remove unused code, update comments.
506 (find_any_await): New.
507 (tmp_target_expr_p): New.
508 (struct interesting): New.
509 (find_interesting_subtree): New.
510 (struct var_nest_node): New.
511 (flatten_await_stmt): New.
512 (handle_nested_conditionals): New.
513 (process_conditional): New.
514 (replace_statement_captures): Rename to...
515 (maybe_promote_temps): ... this.
516 (maybe_promote_captured_temps): Delete.
517 (analyze_expression_awaits): Check for await expressions with
518 initializers. Simplify handling for truth-and/or-if.
519 (expand_one_truth_if): Simplify (map cases that need expansion
520 to COND_EXPR).
521 (await_statement_walker): Handle CO_RETURN_EXPR. Simplify the
522 handling for truth-and/or-if expressions.
523 (register_local_var_uses): Ensure that we create names in the
524 implementation namespace.
525 (morph_fn_to_coro): Add final suspend label to suspend frame
526 callback data and remove it from the build_actor_fn call.
527
528 2020-07-16 Marek Polacek <polacek@redhat.com>
529
530 * call.c (convert_like): Remove macro and introduce a new
531 wrapper instead.
532 (convert_like_with_context): Likewise.
533 (convert_like_real): Rename to convert_like.
534 (convert_like_real_1): Rename to convert_like_internal. Call
535 convert_like instead of convert_like_real therein.
536 (perform_direct_initialization_if_possible): Call convert_like
537 instead of convert_like_real.
538
539 2020-07-16 Iain Sandoe <iain@sandoe.co.uk>
540
541 * coroutines.cc: Correct some spelling errors
542 in comments.
543
544 2020-07-15 Nathan Sidwell <nathan@acm.org>
545
546 * parser.c (cp_parser_declaration): Avoid copying tokens.
547 (cp_parser_block_declaration): RAII token pointer.
548
549 2020-07-15 Nathan Sidwell <nathan@acm.org>
550
551 * parser.c (cp_parser_skip_to_closing_parenthesis_1): Deal with
552 meeting a deferred pragma.
553 (cp_parser_skip_to_end_of_statement): Likewise.
554 (cp_parser_skip_to_end_of_block_or_statement): Likewise.
555 (cp_parser_skip_to_pragma_eol): We should never meet EOF.
556 (cp_parser_omp_declare_simd): Likewise.
557 (cp_parser_omp_declare_reduction, cp_parser_oacc_routine)
558 (pragma_lex): Likewise.
559
560 2020-07-14 Marek Polacek <polacek@redhat.com>
561
562 PR c++/95789
563 PR c++/96104
564 PR c++/96179
565 * call.c (convert_like_real_1): Renamed from convert_like_real.
566 (convert_like_real): New wrapper for convert_like_real_1.
567
568 2020-07-14 Nathan Sidwell <nathan@acm.org>
569
570 * parser.c (cp_lexer_alloc): Do not deal with PCH here.
571 (cp_lexer_new_main): Deal with PCH here. Store the tokens directly
572 into the buffer.
573 (cp_lexer_new_from_tokens): Assert last token isn't purged either.
574 (cp_lexer_get_preprocessor_token): Change first arg to flags, adjust.
575 (cp_parser_new): Pass the lexer in, don't create it here.
576 (cp_parser_translation_unit): Initialize access checks here.
577 (cp_parser_initial_pragma): First token is provided by caller,
578 don't deal with PCH stopping here. Adjust error message.
579 (c_parse_file): Adjust, change error message to avoid C++20 module
580 confusion.
581
582 2020-07-14 Nathan Sidwell <nathan@acm.org>
583
584 * ptree.c (cxx_print_type): Add TYPEOF_TYPE and BASES.
585
586 2020-07-14 Nathan Sidwell <nathan@acm.org>
587
588 * class.c (build_base_field_1): Cache CLASSTYPE_AS_BASE.
589 (build_self_reference): Rename value -> decl.
590 (dump_class_hierarchy_1): Cache CLASSTYPE_AS_BASE.
591
592 2020-07-14 Marek Polacek <polacek@redhat.com>
593
594 PR c++/95820
595 * decl.c (grokdeclarator) <case cdk_function>: Check also
596 pointers/references/... to functions.
597
598 2020-07-14 Nathan Sidwell <nathan@acm.org>
599
600 * cp-tree.h: Correct some tree lang flag comments,
601 reformat some structure definitions. Note some structure
602 sizes. Clarify some comments.
603 (yyungetc): Delete. Not been a thing for some time.
604 * class.c (copy_fndecl_with_name): Comment.
605 (check_bases_and_members): Unnecessary {}.
606 (layout_class_type): Comment.
607 * cp-tree.def (UNBOUND_CLASS_TEMPLATE): Adjust comment.
608 * decl.c: Fix some formatting & whitespace issues.
609 (function_requirements_equivalent_p): Note why
610 substitutions are needed.
611 * decl2.c (no_linkage_error): Note that heroics about
612 'typedef struct { ... };' are no longer needed.
613 * method.c: Whitespace.
614 * name-lookup.c: Whitespace.
615 (add_decl_to_level): Reformat a line.
616 (print_binding_stack): Mark as DEBUG_FUNCTION.
617 (has_using_namespace_std_directive_p): Delete comment.
618 * pt.c: Whitespace
619 * ptree.c: Whitespace.
620 * rtti.c: Whitespace & comment.
621 * tree.c: Comment.
622 * typeck.c (structural_comptypes): Add comment.
623
624 2020-07-13 Nathan Sidwell <nathan@acm.org>
625
626 * Make-lang.in (c++.disclean): Likewise.
627
628 2020-07-13 Marek Polacek <polacek@redhat.com>
629
630 PR c++/96077
631 * parser.c (cp_parser_enum_specifier): Commit to tentative parse
632 after we've seen an opening brace.
633
634 2020-07-10 Jason Merrill <jason@redhat.com>
635
636 * tree.c (structural_type_p): Allow unions.
637 * mangle.c (write_expression): Express unions with a designator.
638
639 2020-07-10 Jason Merrill <jason@redhat.com>
640
641 * pt.c (convert_nontype_argument): Handle REAL_TYPE.
642 (invalid_nontype_parm_type_p): Allow all structural types.
643 * tree.c (structural_type_p): Use SCALAR_TYPE_P.
644
645 2020-07-10 Jason Merrill <jason@redhat.com>
646
647 PR c++/96105
648 PR c++/96052
649 PR c++/95976
650 * class.c (check_field_decls): An array of empty classes is not an
651 empty data member.
652 (layout_empty_base_or_field): Handle explicit alignment.
653 Fix union handling.
654
655 2020-07-09 Julian Brown <julian@codesourcery.com>
656 Thomas Schwinge <thomas@codesourcery.com>
657
658 PR middle-end/95270
659 * semantics.c (finish_omp_clauses): Likewise.
660
661 2020-07-09 Patrick Palka <ppalka@redhat.com>
662
663 PR c++/96132
664 * constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
665 Restore dependent_type_p check that guarded the call to
666 is_really_empty_class.
667
668 2020-07-08 Patrick Palka <ppalka@redhat.com>
669
670 PR c++/95497
671 * constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
672 When processing_template_decl, check COMPLETE_TYPE_P before
673 calling is_really_empty_class. Don't check dependent_type_p.
674
675 2020-07-08 Marek Polacek <polacek@redhat.com>
676
677 PR c++/96103
678 * parser.c (cp_parser_decltype): Print error about using decltype(auto)
679 in C++11. Check that the token following "auto" is ")".
680
681 2020-07-07 Patrick Palka <ppalka@redhat.com>
682
683 PR c++/95303
684 * cxx-pretty-print.c (pp_cxx_unqualified_id): Check
685 PRIMARY_TEMPLATE_P before printing the innermost template
686 arguments.
687
688 2020-07-07 Martin Sebor <msebor@redhat.com>
689
690 PR c++/96063
691 * parser.c (class_decl_loc_t::diag_mismatched_tags): Print notes only
692 if warning_at returns nonzero.
693
694 2020-07-06 Martin Sebor <msebor@redhat.com>
695
696 PR c++/95984
697 * call.c (build_over_call): Check calls only when tf_warning is set.
698
699 2020-07-06 Nathan Sidwell <nathan@acm.org>
700
701 * decl.c (push_library_fn): Return the decl pushdecl_toplevel returns.
702 * except.c (verify_library_fn): Replace with ...
703 (declare_library_fn_1): ... this fn. Always push the fn.
704 (declare_library_fn): Call it.
705 (build_throw): Call declare_library_fn_1.
706
707 2020-07-06 Jonathan Wakely <jwakely@redhat.com>
708
709 PR c++/96068
710 * parser.c (cp_parser_toplevel_declaration): Only do pedwarn for
711 empty-declaration in C++98.
712
713 2020-07-02 Jason Merrill <jason@redhat.com>
714 Jakub Jelinek <jakub@redhat.com>
715
716 * decl.c (grokfndecl): Allow consteval virtual.
717 * search.c (check_final_overrider): Check consteval mismatch.
718 * constexpr.c (cxx_eval_thunk_call): New.
719 (cxx_eval_call_expression): Call it.
720 * cvt.c (cp_get_fndecl_from_callee): Handle FDESC_EXPR.
721 * decl2.c (mark_vtable_entries): Track vtables with consteval.
722 (maybe_emit_vtables): Pass consteval_vtables through.
723 (clear_consteval_vfns): Replace consteval with nullptr.
724 (c_parse_final_cleanups): Call it.
725
726 2020-07-01 Nathan Sidwell <nathan@acm.org>
727
728 * class.c (copy_fndecl_with_name): Add additional predicate args, do
729 not deduce them locally.
730 (copy_operator_fn): Adjust copy_fndecl_with_name call.
731 (build_clone): Add vtt and inherited predicate args. Pass through
732 to copy_fndecl_with_name call.
733 (build_cdtor_clones): Likewise, pass through to build_clone as
734 needed.
735 (build_cdtor): Determine vtt and inherited here.
736 * cp-tree.h (DECL_NEEDS_CTT_PARM_P): Delete.
737
738 2020-06-30 Nathan Sidwell <nathan@acm.org>
739
740 * cp-tree.h (copy_fndecl_with_name): Rename to ...
741 (copy_operatorn_fn): ... this. Change arg type.
742 (clone_function_decl): Rename to ...
743 (clone_cdtor): ... this.
744 * class.c (copy_fndecl_with_name): Make static.
745 (copy_operator_fn): New wrapper.
746 (build_clones): Rename to ...
747 (build_cdtor_clones): ... this.
748 (clone_function_decl): Rename to ...
749 (clone_cdtor): ... this. Adjust build_clones calls.
750 (clone_constructors_and_destructors): Adjust clone_function_decl
751 calls.
752 * method.c (implicitly_declare_fn): Adjust copy_fndecl_with_name
753 call.
754 (lazily_declare_fn): Adjust clone_function_decl call.
755 * pt.c (tsubst_function_decl): Likewise.
756 (instantiate_template_1): Likewise.
757
758 2020-06-30 Iain Sandoe <iain@sandoe.co.uk>
759
760 * coroutines.cc (morph_fn_to_coro): Remove trailing
761 space in a diagnostic.
762
763 2020-06-30 Iain Sandoe <iain@sandoe.co.uk>
764
765 * coroutines.cc (expand_one_await_expression): Remove
766 code dealing with initial suspend.
767 (build_actor_fn): Remove code special-casing initial
768 and final suspend. Handle the final suspend and marking
769 of the coroutine as done.
770 (coro_rewrite_function_body): New.
771 (bind_expr_find_in_subtree): Remove.
772 (coro_body_contains_bind_expr_p): Remove.
773 (morph_fn_to_coro): Split the rewrite of the original
774 function into coro_rewrite_function_body and call it.
775
776 2020-06-29 Marek Polacek <polacek@redhat.com>
777
778 PR c++/94553
779 * decl.c (duplicate_decls): Make sure a concept or a variable
780 template is unique in its declarative region.
781
782 2020-06-29 Marek Polacek <polacek@redhat.com>
783
784 PR c++/95568
785 * pt.c (collect_ctor_idx_types): Use TREE_TYPE.
786
787 2020-06-28 Iain Sandoe <iain@sandoe.co.uk>
788
789 PR c++/95711
790 * coroutines.cc (register_local_var_uses): Skip past
791 namespace decls.
792
793 2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
794
795 PR c++/95736
796 * coroutines.cc (get_awaitable_var): New helper.
797 (build_co_await): Check more carefully before
798 copying an awaitable.
799 (expand_one_await_expression): No initializer
800 is required when the awaitable is not a temp.
801 (register_awaits): Remove handling that is now
802 completed when the await expression is built.
803
804 2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
805
806 * coroutines.cc (morph_fn_to_coro): Diagnose unavailable
807 get_return_object_on_allocation_failure.
808
809 2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
810
811 PR c++/95519
812 * coroutines.cc (struct coroutine_info):Add a field
813 to hold computed p.return_void expressions.
814 (coro_build_promise_expression): New.
815 (get_coroutine_return_void_expr): New.
816 (finish_co_yield_expr): Build the promise expression
817 using coro_build_promise_expression.
818 (finish_co_return_stmt): Likewise.
819 (build_init_or_final_await): Likewise.
820 (morph_fn_to_coro): Likewise, for several cases.
821
822 2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
823
824 * coroutines.cc (morph_fn_to_coro): Handle error
825 returns in building g-r-o-o-a-f expressions.
826
827 2020-06-24 Nicholas Krause <xerofoify@gmail.com>
828
829 PR c++/95672
830 * typeck2.c (cxx_incomplete_type_diagnostic): Add missing
831 TYPE_EXPANSION_PACK check for diagnosing incomplete types in
832 cxx_incomplete_type_diagnostic.
833
834 2020-06-24 Iain Sandoe <iain@sandoe.co.uk>
835
836 PR c++/95518
837 PR c++/95813
838 * coroutines.cc (act_des_fn): Copy function
839 attributes onto the outlined coroutine helpers.
840
841 2020-06-24 Jason Merrill <jason@redhat.com>
842
843 * call.c (build_over_call): Only call build_base_path once.
844
845 2020-06-24 Jason Merrill <jason@redhat.com>
846
847 PR c++/95719
848 * call.c (build_over_call): Look up the overrider in base_binfo.
849 * class.c (lookup_vfn_in_binfo): Look through BINFO_PRIMARY_P.
850
851 2020-06-23 Jason Merrill <jason@redhat.com>
852
853 PR c++/93976
854 Implement C++20 P2082R1, Fixing CTAD for aggregates.
855 * cp-tree.h (TPARMS_PRIMARY_TEMPLATE): Split out from...
856 (DECL_PRIMARY_TEMPLATE): ...here.
857 (builtin_guide_p): Declare.
858 * decl.c (reshape_init_class): Handle bases of a template.
859 (reshape_init_r): An array with dependent bound takes a single
860 initializer.
861 * pt.c (tsubst_default_argument): Shortcut {}.
862 (unify_pack_expansion): Allow omitted arguments to trailing pack.
863 (builtin_guide_p): New.
864 (collect_ctor_idx_types): Give a trailing pack a {} default
865 argument. Handle arrays better.
866
867 2020-06-23 Iain Sandoe <iain@sandoe.co.uk>
868
869 PR c++/95477
870 * coroutines.cc (morph_fn_to_coro): Apply a cleanup to
871 the get return object when the DTOR is non-trivial.
872
873 2020-06-20 Iain Sandoe <iain@sandoe.co.uk>
874
875 PR c++/95505
876 * coroutines.cc (morph_fn_to_coro): Update handling of
877 get-return-object-on-allocation-fail and diagnose missing
878 std::nothrow.
879
880 2020-06-20 Jason Merrill <jason@redhat.com>
881
882 * call.c (joust): Only compare constraints for non-template
883 candidates with matching parameters.
884 * pt.c (tsubst_pack_expansion): Fix getting a type parameter
885 pack.
886 (more_specialized_fn): Only compare constraints for candidates with
887 matching parameters.
888
889 2020-06-19 Jason Merrill <jason@redhat.com>
890
891 * method.c (early_check_defaulted_comparison): Allow defaulting
892 comparison outside class. Complain if non-member operator isn't a
893 friend.
894
895 2020-06-18 Jason Merrill <jason@redhat.com>
896
897 * method.c (early_check_defaulted_comparison): Check for &&.
898 (build_comparison_op): Allow empty union. Diagnose non-category
899 type.
900 (common_comparison_type): Remove handling for non-category type.
901
902 2020-06-18 Marek Polacek <polacek@redhat.com>
903
904 PR c++/95735
905 * pt.c (finish_template_variable): Return if
906 coerce_innermost_template_parms return error_mark_node.
907
908 2020-06-18 Marek Polacek <polacek@redhat.com>
909
910 PR c++/95728
911 * pt.c (tsubst_copy_and_build) <case NEW_EXPR>: Return error_mark_node
912 if placement is erroneous.
913
914 2020-06-17 Jonathan Wakely <jwakely@redhat.com>
915
916 PR c++/66159
917 * parser.c (cp_parser_elaborated_type_specifier): Do not warn
918 unless in a declaration.
919
920 2020-06-17 Jason Merrill <jason@redhat.com>
921
922 * cp-tree.h (copy_fndecl_with_name): Declare.
923 * class.c (copy_fndecl_with_name): Split out from...
924 (build_clone): ...here.
925 (add_implicitly_declared_members): Add op== to TYPE_FIELDS.
926 * method.c (implicitly_declare_fn): Use copy_fndecl_with_name.
927
928 2020-06-17 Jason Merrill <jason@redhat.com>
929
930 * call.c (build_new_op_1): Don't look for a CALL_EXPR when
931 calling a consteval function.
932
933 2020-06-17 Jason Merrill <jason@redhat.com>
934
935 * decl2.c (grokfield): Pass SD_DEFAULTED and SD_DELETED.
936 * decl.c (duplicate_decls): Reduce error for delete
937 after earlier declaration to pedwarn.
938
939 2020-06-17 Marek Polacek <polacek@redhat.com>
940
941 PR c++/95508
942 * constexpr.c (maybe_fold_non_dependent_expr): New.
943 * cp-tree.h (maybe_fold_non_dependent_expr): Declare.
944 * typeck.c (cp_build_array_ref): Call maybe_fold_non_dependent_expr
945 instead of maybe_constant_value.
946
947 2020-06-16 Marek Polacek <polacek@redhat.com>
948
949 PR c++/95369
950 * call.c (add_list_candidates): Return if a designated initializer
951 is used with a non-aggregate.
952 (implicit_conversion_error): Give an error for the case above.
953
954 2020-06-16 Marek Polacek <polacek@redhat.com>
955
956 PR c++/95560
957 * name-lookup.c (check_local_shadow): Check if types are
958 non-null before calling same_type_p.
959
960 2020-06-16 Jakub Jelinek <jakub@redhat.com>
961
962 * semantics.c (handle_omp_for_class_iterator): Adjust
963 c_omp_check_loop_iv_exprs caller.
964 (finish_omp_for): Likewise. Don't call fold_build_cleanup_point_expr
965 before calling c_finish_omp_for and c_omp_check_loop_iv, move it
966 after those calls.
967 * pt.c (tsubst_omp_for_iterator): Handle non-rectangular loops.
968
969 2020-06-16 Jakub Jelinek <jakub@redhat.com>
970
971 * parser.c (cp_parser_omp_clause_schedule): Reject modifier separated
972 from kind by comma rather than colon.
973
974 2020-06-16 Patrick Palka <ppalka@redhat.com>
975
976 * pt.c (perform_instantiation_time_access_checks): No need to
977 tsubst into decl.
978 * semantics.c (enforce_access): Verify that decl is not
979 dependent.
980
981 2020-06-16 Patrick Palka <ppalka@redhat.com>
982
983 PR c++/41437
984 PR c++/47346
985 * cp-tree.h (qualified_typedef_usage_s): Delete.
986 (qualified_typedef_usage_t): Delete.
987 (deferred_access_check): Move up in file.
988 (tree_template_info::typedefs_needing_access_checking): Delete.
989 (tree_template_info::deferred_access_checks): New field.
990 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): Rename to ...
991 (TI_DEFERRED_ACCESS_CHECKS): ... this, and adjust accordingly.
992 * pt.c (perform_typedefs_access_check): Rename to ...
993 (perform_instantiation_time_access_checks): ... this, and adjust
994 accordingly. Remove unnecessary tree tests.
995 (instantiate_class_template_1): Adjust accordingly.
996 (instantiate_decl): Likewise.
997 * semantics.c (enforce_access): Likewise.
998
999 2020-06-16 Patrick Palka <ppalka@redhat.com>
1000
1001 PR c++/41437
1002 PR c++/47346
1003 * call.c (enforce_access): Move to semantics.c.
1004 * cp-tree.h (enforce_access): Delete.
1005 (get_types_needing_access_check): Delete.
1006 (add_typedef_to_current_template_for_access_check): Delete.
1007 * decl.c (make_typename_type): Adjust accordingly. Use
1008 check_accessibility_of_qualified_id instead of directly using
1009 perform_or_defer_access_check.
1010 * parser.c (cp_parser_template_declaration_after_parameters):
1011 Don't push a dk_no_check access state when parsing a template.
1012 * pt.c (get_types_needing_access_check): Delete.
1013 (append_type_to_template_for_access_check_1): Delete.
1014 (perform_typedefs_access_check): Adjust. If type_decl is a
1015 FIELD_DECL, also check its DECL_CONTEXT for dependence. Use
1016 tsubst_copy instead of tsubst to substitute into type_decl so
1017 that we substitute into the DECL_CONTEXT of a FIELD_DECL.
1018 (append_type_to_template_for_access_check): Delete.
1019 * search.c (accessible_p): Remove the processing_template_decl
1020 early exit.
1021 * semantics.c (enforce_access): Moved from call.c. If we're
1022 parsing a template and the access check failed, add the check to
1023 TI_TYPEDEFS_NEEDING_ACCESS_CHECKING.
1024 (perform_or_defer_access_check): Adjust comment.
1025 (add_typedef_to_current_template_for_access_check): Delete.
1026 (check_accessibility_of_qualified_id): Adjust accordingly.
1027 Exit early if the scope is dependent.
1028
1029 2020-06-11 Patrick Palka <ppalka@redhat.com>
1030
1031 PR c++/93467
1032 * constraint.cc (associate_classtype_constraints): If there is a
1033 discrepancy between the current template depth and the template
1034 depth of the original declaration, then adjust the template
1035 parameter depth within the current constraints appropriately.
1036 * pt.c (tsubst_friend_class): Substitute into and set the
1037 constraints on the injected declaration.
1038
1039 2020-06-11 Iain Sandoe <iain@sandoe.co.uk>
1040
1041 * coroutines.cc (instantiate_coro_traits): Pass a reference
1042 to lambda closure objects to traits instantiation.
1043 (morph_fn_to_coro): Likewise for promise parameter
1044 preview and allocator lookup.
1045
1046 2020-06-10 Iain Sandoe <iain@sandoe.co.uk>
1047
1048 PR c++/95440
1049 * call.c (add_candidates): Use vec_safe_length() for
1050 testing the arguments list.
1051 (build_new_method_call_1): Use vec_safe_is_empty() when
1052 checking for an empty args list.
1053
1054 2020-06-10 Marek Polacek <polacek@redhat.com>
1055
1056 PR c++/95562
1057 * parser.c (cp_parser_direct_declarator): Clear
1058 CP_PARSER_FLAGS_DELAY_NOEXCEPT if the declarator kind is not
1059 cdk_id.
1060
1061 2020-06-09 Iain Sandoe <iain@sandoe.co.uk>
1062
1063 PR c++/95137
1064 * coroutines.cc (expand_one_await_expression): Build separate
1065 DTOR trees for the awaitable object on the destroy and resume
1066 paths.
1067
1068 2020-06-09 Jason Merrill <jason@redhat.com>
1069
1070 PR c++/95552
1071 * cp-gimplify.c (predeclare_vla): Only predeclare a VLA if it's
1072 wrapped in a pointer type.
1073
1074 2020-06-05 Marek Polacek <polacek@redhat.com>
1075
1076 PR c++/95369
1077 * call.c (build_converted_constant_expr_internal): Allow
1078 list-initialization.
1079
1080 2020-06-05 Iain Sandoe <iain@sandoe.co.uk>
1081
1082 * cp-tree.def (CO_RETURN_EXPR): Correct the class
1083 to use tcc_statement.
1084
1085 2020-06-05 Jason Merrill <jason@redhat.com>
1086
1087 * error.c (dump_binary_op): Handle negative operand to
1088 POINTER_PLUS_EXPR.
1089
1090 2020-06-04 Jason Merrill <jason@redhat.com>
1091
1092 PR c++/93310
1093 * constexpr.c (cxx_eval_constant_expression) [OBJ_TYPE_REF]:
1094 Evaluate OBJ_TYPE_REF_EXPR.
1095
1096 2020-06-04 Jason Merrill <jason@redhat.com>
1097
1098 PR c++/95158
1099 * class.c (lookup_vfn_in_binfo): New.
1100 * call.c (build_over_call): Use it.
1101 * cp-tree.h (resolves_to_fixed_type_p): Add default argument.
1102 (lookup_vfn_in_binfo): Declare.
1103
1104 2020-06-04 Iain Sandoe <iain@sandoe.co.uk>
1105
1106 PR c++/95346
1107 * coroutines.cc (morph_fn_to_coro): Ensure that the get-
1108 return-object is constructed correctly; When it is not the
1109 final return value, pass it to the CTOR of the return type
1110 as an rvalue, per the standard comment.
1111
1112 2020-06-04 Jakub Jelinek <jakub@redhat.com>
1113
1114 PR c++/82304
1115 PR c++/95307
1116 * constexpr.c (cxx_eval_constant_expression): Diagnose CONVERT_EXPR
1117 conversions from pointer types to arithmetic types here...
1118 (cxx_eval_outermost_constant_expr): ... instead of here.
1119
1120 2020-06-03 Mark Wielaard <mark@klomp.org>
1121
1122 * parser.c (cp_lexer_safe_previous_token): New function.
1123 (cp_parser_error_1): Add name_hint if the previous token is
1124 a string literal and next token is a CPP_NAME and we have a
1125 missing header suggestion for the name.
1126
1127 2020-06-03 Patrick Palka <ppalka@redhat.com>
1128
1129 * pt.c (process_partial_specialization): Pass the full set of
1130 generic template arguments to strictly_subsumes.
1131
1132 2020-06-03 Patrick Palka <ppalka@redhat.com>
1133
1134 PR c++/92103
1135 * pt.c (most_specialized_partial_spec): Reorganize the loop over
1136 DECL_TEMPLATE_SPECIALIZATIONS. Check constraints_satisfied_p on
1137 the original template declaration, not on the tsubsted one.
1138
1139 2020-06-03 Iain Sandoe <iain@sandoe.co.uk>
1140
1141 PR c++/95345
1142 * coroutines.cc (finish_co_await_expr): Revise to allow for
1143 parameter packs.
1144 (finish_co_yield_expr): Likewise.
1145
1146 2020-06-03 Jason Merrill <jason@redhat.com>
1147
1148 PR c++/95232
1149 * cp-tree.h (predeclare_vla): Declare.
1150 * cp-gimplify.c (predeclare_vla): Handle getting a decl.
1151 * pt.c (tsubst_expr) [DECL_EXPR]: Use it.
1152
1153 2020-06-03 Tobias Burnus <tobias@codesourcery.com>
1154
1155 * cp-gimplify.c (cxx_omp_predetermined_mapping): New.
1156 * cp-objcp-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redfine.
1157 * cp-tree.h (cxx_omp_predetermined_mapping): Declare.
1158
1159 2020-06-02 Jason Merrill <jason@redhat.com>
1160
1161 PR c++/95193
1162 * pt.c (tsubst_decl): Relax assert.
1163
1164 2020-06-02 Iain Sandoe <iain@sandoe.co.uk>
1165
1166 PR c++/95050
1167 * coroutines.cc (build_co_await): Wrap the co_await expression
1168 in a TARGET_EXPR, where needed.
1169 (finish_co_yield_expr): Likewise.
1170
1171 2020-06-02 Patrick Palka <ppalka@redhat.com>
1172
1173 PR c++/92633
1174 PR c++/92838
1175 * pt.c (tsubst_function_decl): Don't do set_constraints when
1176 regenerating a lambda.
1177 (tsubst_lambda_expr): Substitute into the lambda's constraints
1178 and do set_constraints here.
1179
1180 2020-06-01 Jason Merrill <jason@redhat.com>
1181
1182 PR c++/95466
1183 PR c++/95311
1184 PR c++/95221
1185 * class.c (build_vfn_ref): Revert 95311 change.
1186 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): Build a
1187 COMPOUND_EXPR.
1188
1189 2020-06-01 Iain Sandoe <iain@sandoe.co.uk>
1190
1191 PR c++/95350
1192 * coroutines.cc (struct param_info): Remove rv_ref field.
1193 (build_actor_fn): Remove specifial rvalue ref handling.
1194 (morph_fn_to_coro): Likewise.
1195
1196 2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
1197
1198 PR c++/95087
1199 * coroutines.cc (morph_fn_to_coro): If we see an
1200 early fatal error, drop the erroneous function body.
1201
1202 2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
1203
1204 * coroutines.cc (build_co_await): Remove unused
1205 variable.
1206 (finish_co_await_expr): Likewise.
1207 (finish_co_yield_expr): Likewise; revise comment.
1208
1209 2020-05-30 Iain Sandoe <iain@sandoe.co.uk>
1210
1211 * coroutines.cc (morph_fn_to_coro): Revise initialization
1212 of the frame pointer to avoid an unused value.
1213
1214 2020-05-30 Patrick Palka <ppalka@redhat.com>
1215
1216 PR c++/95386
1217 * constraint.cc (satisfaction_value): Accept INTEGER_CST of any
1218 boolean type.
1219
1220 2020-05-29 Patrick Palka <ppalka@redhat.com>
1221 Jason Merrill <jason@redhat.com>
1222
1223 PR c++/95181
1224 * class.c (add_method): Let special member function templates
1225 coexist if they are not equivalently constrained, or in a class
1226 template.
1227
1228 2020-05-29 Jason Merrill <jason@redhat.com>
1229
1230 PR c++/95371
1231 * pt.c (process_template_parm): Set DECL_TEMPLATE_INFO
1232 on the DECL_TEMPLATE_RESULT.
1233
1234 2020-05-29 Marek Polacek <polacek@redhat.com>
1235
1236 PR c++/95344
1237 * cp-gimplify.c (cp_fold) <case MODIFY_EXPR>: Don't set
1238 TREE_THIS_VOLATILE here.
1239 (cp_fold): Set it here along with TREE_NO_WARNING.
1240
1241 2020-05-29 Jason Merrill <jason@redhat.com>
1242
1243 PR c++/95311
1244 PR c++/95221
1245 * class.c (build_vfn_ref): Don't fold the INDIRECT_REF.
1246
1247 2020-05-29 Patrick Palka <ppalka@redhat.com>
1248
1249 PR c++/92652
1250 PR c++/93698
1251 PR c++/94128
1252 * parser.c (cp_parser_requires_clause_expression): Temporarily
1253 increment processing_template_decl only if it is 0.
1254 (cp_parser_constraint_expression): Likewise.
1255 (cp_parser_requires_expression): Likewise.
1256
1257 2020-05-29 Patrick Palka <ppalka@redhat.com>
1258
1259 PR c++/95241
1260 * constexpr.c (get_or_insert_ctor_field): Add limited support
1261 for RANGE_EXPR index lookups.
1262
1263 2020-05-28 Jakub Jelinek <jakub@redhat.com>
1264
1265 PR c++/95328
1266 * decl.c (cp_finish_decomp): Call complete_type before checking
1267 COMPLETE_TYPE_P.
1268
1269 2020-05-28 Jason Merrill <jason@redhat.com>
1270
1271 PR c++/94926
1272 * decl.c (cp_finish_decl): Revert r9-297 change.
1273 (check_static_variable_definition): Likewise.
1274 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
1275 * pt.c (instantiate_decl): Return early on type error.
1276
1277 2020-05-27 Jason Merrill <jason@redhat.com>
1278
1279 PR c++/95319
1280 * decl.c (reshape_init_array_1): Don't reuse in overload context.
1281
1282 2020-05-27 Jason Merrill <jason@redhat.com>
1283
1284 PR c++/95242
1285 * call.c (build_new_op_1): Suppress
1286 warn_zero_as_null_pointer_constant across comparison of <=> result
1287 to 0.
1288
1289 2020-05-27 Jason Merrill <jason@redhat.com>
1290
1291 PR c++/95222
1292 * decl.c (grokdeclarator): Don't shift attributes in TYPENAME
1293 context.
1294
1295 2020-05-27 Nathan Sidwell <nathan@acm.org>
1296
1297 PR c++/95263
1298 * pt.c (lookup_template_class_1): Restore alias template mutation.
1299
1300 2020-05-26 Jakub Jelinek <jakub@redhat.com>
1301
1302 PR c++/95197
1303 * cp-gimplify.c: Include omp-general.h.
1304 (cp_genericize_r) <case OMP_DISTRIBUTE>: For class iteration
1305 variables in composite distribute parallel for, instantiate copy
1306 ctor of their types.
1307
1308 2020-05-23 Patrick Palka <ppalka@redhat.com>
1309
1310 PR c++/94038
1311 * constexpr.c (cxx_eval_constant_expression)
1312 <case TEMPLATE_ID_EXPR>: Don't evaluate the concept when
1313 constexpr evaluation is uid-sensitive.
1314
1315 2020-05-22 Jason Merrill <jason@redhat.com>
1316
1317 * cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Don't preevaluate
1318 the function address if the call used operator syntax.
1319
1320 2020-05-21 Jason Merrill <jason@redhat.com>
1321
1322 PR c++/95221
1323 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): For a virtual
1324 call, instrument the OBJ_TYPE_REF.
1325
1326 * decl.c (compute_array_index_type_loc): Diagnose expressions
1327 in a template that can't be constant.
1328 * parser.c (cp_parser_direct_declarator): Don't check
1329 non-constant array bounds here.
1330
1331 * cp-tree.h (is_rvalue_constant_expression): Declare.
1332 * constexpr.c (is_rvalue_constant_expression): New.
1333 * parser.c (cp_parser_constant_expression): Use it.
1334 * decl.c (cp_finish_decl): Try to treat a constexpr initializer in a
1335 template as constant.
1336
1337 * typeck.c (build_x_modify_expr): Handle error_mark_node arguments.
1338
1339 * decl.c (grokparms): Return NULL_TREE if any parms were erroneous.
1340
1341 2020-05-21 Iain Sandoe <iain@sandoe.co.uk>
1342
1343 * coroutines.cc (finish_co_return_stmt): Revert change to use
1344 finish_expr_stmt.
1345
1346 2020-05-21 Patrick Palka <ppalka@redhat.com>
1347
1348 PR c++/94038
1349 * constexpr.c (constexpr_ctx::uid_sensitive): Remove field.
1350 (uid_sensitive_constexpr_evaluation_value): Define.
1351 (uid_sensitive_constexpr_evaluation_true_counter): Define.
1352 (uid_sensitive_constexpr_evaluation_p): Define.
1353 (uid_sensitive_constexpr_evaluation_sentinel): Define its
1354 constructor.
1355 (uid_sensitive_constexpr_evaluation_checker): Define its
1356 constructor and its evaluation_restricted_p method.
1357 (get_fundef_copy): Remove 'ctx' parameter. Use u_s_c_e_p
1358 instead of constexpr_ctx::uid_sensitive.
1359 (cxx_eval_call_expression): Use u_s_c_e_p instead, and test it
1360 last. Adjust call to get_fundef_copy.
1361 (instantiate_cx_fn_r): Test u_s_c_e_p so that we increment the
1362 counter if necessary.
1363 (cxx_eval_outermost_constant_expr): Remove 'uid_sensitive'
1364 parameter. Adjust function body accordingly.
1365 (maybe_constant_value): Remove 'uid_sensitive' parameter and
1366 adjust function body accordingly. Set up a
1367 uid_sensitive_constexpr_evaluation_checker, and use it to
1368 conditionally update the cv_cache.
1369 * cp-gimplify.c (cp_fold): Set up a
1370 uid_sensitive_constexpr_evaluation_checker, and use it to
1371 conditionally update the fold_cache.
1372 * cp-tree.h (maybe_constant_value): Update declaration.
1373 (struct uid_sensitive_constexpr_evaluation_sentinel): Define.
1374 (struct sensitive_constexpr_evaluation_checker): Define.
1375 * expr.c (fold_for_warn): Set up a
1376 uid_sensitive_constexpr_evaluation_sentinel before calling
1377 the folding subroutines. Drop all but the first argument to
1378 maybe_constant_value.
1379
1380 2020-05-20 Marek Polacek <polacek@redhat.com>
1381
1382 DR 2237
1383 * parser.c (cp_parser_unqualified_id): Reject simple-template-id as
1384 the declarator-id of a destructor.
1385 (cp_parser_constructor_declarator_p): Reject simple-template-id as
1386 the declarator-id of a constructor.
1387
1388 2020-05-20 Marek Polacek <polacek@redhat.com>
1389
1390 DR 2289
1391 PR c++/94553
1392 * cp-tree.h (SD_DECOMPOSITION): New flag.
1393 * decl.c (duplicate_decls): Make sure a structured binding is unique
1394 in its declarative region.
1395 (start_decl): If INITIALIZED is SD_DECOMPOSITION, call
1396 fit_decomposition_lang_decl.
1397 (grokdeclarator): Compare INITIALIZED directly to SD_* flags.
1398 * parser.c (cp_parser_decomposition_declaration): Pass SD_DECOMPOSITION
1399 to start_decl.
1400
1401 2020-05-20 Patrick Palka <ppalka@redhat.com>
1402
1403 PR c++/95223
1404 * typeck.c (structural_comptypes): Don't perform
1405 context-dependent resolution of TYPENAME_TYPEs when
1406 comparing_specializations.
1407
1408 2020-05-19 Nathan Sidwell <nathan@acm.org>
1409
1410 * pt.c (lookup_template_class_1): Do not reinit template_info of an
1411 alias here.
1412
1413 2020-05-18 Martin Sebor <msebor@redhat.com>
1414
1415 PR c++/94923
1416 * call.c ((maybe_warn_class_memaccess): Use is_byte_access_type.
1417 * cp-tree.h (is_dummy_object): Return bool.
1418 (is_byte_access_type): Declare new function.
1419 * tree.c (is_dummy_object): Return bool.
1420 (is_byte_access_type): Define new function.
1421
1422 2020-05-19 Patrick Palka <ppalka@redhat.com>
1423
1424 PR c++/87847
1425 * pt.c (init_template_processing): Enable sanitization for
1426 decl_specializations and type_specializations.
1427
1428 PR c++/66439
1429 * pt.c (fn_type_unification): Pass 'fn' instead of NULL_TREE as
1430 the 'in_decl' parameter to coerce_template_parms.
1431
1432 2020-05-18 Marek Polacek <polacek@redhat.com>
1433
1434 PR c++/94955
1435 * typeck.c (cp_build_binary_op): Use fold_for_warn instead of
1436 cp_fold_rvalue.
1437
1438 2020-05-18 Marek Polacek <polacek@redhat.com>
1439
1440 PR c++/94937
1441 * cvt.c (cp_get_fndecl_from_callee): Return NULL_TREE if the function
1442 type is not INDIRECT_TYPE_P.
1443 * decl.c (omp_declare_variant_finalize_one): Call
1444 cp_get_callee_fndecl_nofold instead of looking for the function decl
1445 manually.
1446
1447 2020-05-18 Marek Polacek <polacek@redhat.com>
1448
1449 PR c++/90915
1450 * parser.c (cp_parser_has_attribute_expression): Sorry on a
1451 type-dependent argument.
1452
1453 2020-05-18 Marek Polacek <polacek@redhat.com>
1454
1455 DR 1512
1456 PR c++/87699
1457 * call.c (add_builtin_candidate) <case EQ_EXPR>: Create candidate
1458 operator functions when type is std::nullptr_t for ==/!=.
1459 * typeck.c (composite_pointer_type_r): Add a bool * parameter. Use it
1460 to maybe add "const" to the pointer type.
1461 (composite_pointer_type): Update the call to composite_pointer_type_r.
1462 (cp_build_binary_op): Turn two warning_at into error_at. Print the
1463 types.
1464
1465 2020-05-18 Jason Merrill <jason@redhat.com>
1466
1467 * call.c (build_over_call): Remove unnecessary
1468 cp_stabilize_reference.
1469
1470 2020-05-18 Marek Polacek <polacek@redhat.com>
1471
1472 * call.c (add_builtin_candidate): Don't create a builtin overload
1473 candidate for ++ when type is bool in C++17.
1474
1475 2020-05-18 Marek Polacek <polacek@redhat.com>
1476
1477 * cfns.h: Regenerated.
1478
1479 2020-05-17 Iain Sandoe <iain@sandoe.co.uk>
1480
1481 * coroutines.cc (morph_fn_to_coro): Initialize the gro variable.
1482
1483 2020-05-16 Iain Sandoe <iain@sandoe.co.uk>
1484
1485 * coroutines.cc (finish_co_return_stmt): Implement rules
1486 from [class.copy.elision] /3.
1487
1488 2020-05-16 Patrick Palka <ppalka@redhat.com>
1489
1490 PR c++/57943
1491 * semantics.c (finish_decltype_type): Call
1492 instantiate_non_dependent_expr_sfinae on the expression.
1493
1494 2020-05-15 Patrick Palka <ppalka@redhat.com>
1495
1496 Revert:
1497
1498 2020-04-07 Patrick Palka <ppalka@redhat.com>
1499
1500 PR c++/90996
1501 * typeck2.c (process_init_constructor_array): Propagate
1502 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
1503 the array initializer.
1504
1505 2020-05-15 Jason Merrill <jason@redhat.com>
1506
1507 PR c++/93286 - ICE with __is_constructible and variadic template.
1508 * pt.c (tsubst_tree_list): New.
1509 (tsubst, tsubst_copy_and_build): Use it.
1510 * decl2.c (is_late_template_attribute): Handle error_mark_node args.
1511
1512 2020-05-15 Nathan Sidwell <nathan@acm.org>
1513
1514 * pt.c (template_args_equal): Fix thinkos in previous 'cleanup'.
1515
1516 2020-05-14 Jason Merrill <jason@redhat.com>
1517
1518 PR c++/93901
1519 * pt.c (maybe_instantiate_noexcept): Change clone handling.
1520
1521 2020-05-14 Patrick Palka <ppalka@redhat.com>
1522
1523 PR c++/78446
1524 * call.c (build_op_call): Pass complain to lookup_fnfields.
1525 (build_special_member_call): Likewise.
1526 * class.c (type_requires_array_cookie): Pass tf_warning_or_error
1527 to lookup_fnfields.
1528 * cp-tree.h (lookup_fnfields): Add tsubst_flags_t parameter.
1529 * except.c (build_throw): Pass tf_warning_or_error to
1530 lookup_fnfields.
1531 * init.c (build_new_1): Pass complain to lookup_fnfields.
1532 * method.c (locate_fn_flags): Likewise.
1533 * name-lookup.c (lookup_name_real_1): Pass tf_warning_or_error
1534 to lookup_fnfields.
1535 * pt.c (tsubst_baselink): Pass complain to lookup_fnfields.
1536 * search.c (lookup_fnfields): New 'complain' parameter. Pass it
1537 to lookup_member.
1538
1539 2020-05-14 Nathan Sidwell <nathan@acm.org>
1540
1541 * parser.c (cp_parser_diagnose_invalid_typename): Mention
1542 std=c++20 not 2a, reformat dependent binfo inform loops.
1543
1544 * pt.c (tsubst_template_decl): Reorder and commonize some control
1545 paths.
1546
1547 * pt.c (tsubst_friend_function): Simplify control flow.
1548
1549 * pt.c (lookup_template_class_1): Remove unnecessary else by
1550 simply grabbing TYPE_NAME earlier.
1551
1552 * pt.c (push_template_decl_real): Adjust friend pushing logic.
1553 Reinit template type.
1554
1555 * pt.c (build_template_decl): Init DECL_TEMPLATE_RESULT &
1556 TREE_TYPE here ...
1557 (process_partial_specialization): ... not here ...
1558 (push_template_decl_real, add_inherited_template_parms)
1559 (build_deduction_guide): ... or here.
1560
1561 2020-05-14 Jakub Jelinek <jakub@redhat.com>
1562
1563 * cp-gimplify.c (cp_genericize_r): Set cfun->has_omp_target.
1564
1565 2020-05-13 Patrick Palka <ppalka@redhat.com>
1566
1567 PR c++/79706
1568 * init.c (build_vec_delete_1): Just return error_mark_node if
1569 deallocate_expr is error_mark_node.
1570 (build_delete): Just return error_mark_node if do_delete is
1571 error_mark_node.
1572
1573 2020-05-13 Patrick Palka <ppalka@redhat.com>
1574
1575 PR c++/95020
1576 * constraint.cc (tsubst_requires_expr): Produce a new
1577 requires-expression when processing_template_decl, even if
1578 template arguments are not dependent.
1579
1580 2020-05-13 Marek Polacek <polacek@redhat.com>
1581
1582 PR c++/95066
1583 * decl.c (duplicate_decls): Set DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
1584
1585 2020-05-13 Nathan Sidwell <nathan@acm.org>
1586
1587 * pt.c (template_args_equal): Reorder category checking for
1588 clarity.
1589
1590 * pt.c (perform_typedefs_access_check): Cache expensively
1591 calculated object references.
1592 (check_auto_in_tmpl_args): Just assert we do not get unexpected
1593 nodes, rather than silently do nothing.
1594 (append_type_to_template_for_access): Likewise, cache expensie
1595 object reference.
1596
1597 * pt.c (canonical_type_parameter): Simplify.
1598
1599 Formatting fixups & some simplifications.
1600 * pt.c (spec_hash_table): New typedef.
1601 (decl_specializations, type_specializations): Use it.
1602 (retrieve_specialization): Likewise.
1603 (register_specialization): Remove unnecessary casts.
1604 (push_template_decl_real): Reformat.
1605 (instantiate_class_template_1): Use more RAII.
1606 (make_argument_pack): Simplify.
1607 (instantiate_template_1): Use gcc_checking_assert for expensive
1608 asserts.
1609 (instantiate_decl): Likewise.
1610 (resolve_typename_type): Reformat comment.
1611 * semantics.c (struct deferred_access): Remove unnecessary GTY on
1612 member.
1613 (begin_class_definition): Fix formatting.
1614
1615 2020-05-13 Jason Merrill <jason@redhat.com>
1616
1617 * call.c, class.c, constexpr.c, constraint.cc, decl.c, init.c,
1618 lambda.c, lex.c, method.c, name-lookup.c, parser.c, pt.c, tree.c,
1619 typeck2.c: Change cxx2a to cxx20.
1620
1621 2020-05-12 Marek Polacek <polacek@redhat.com>
1622
1623 PR c++/95074
1624 * parser.c (cp_parser_postfix_expression) <case CPP_OPEN_PAREN>: When
1625 looking for a block-scope function declaration, look through the whole
1626 set, not just the first function in the overload set.
1627
1628 2020-05-12 Jakub Jelinek <jakub@redhat.com>
1629
1630 PR c++/95063
1631 * pt.c (tsubst_decl): Deal with DECL_OMP_PRIVATIZED_MEMBER for
1632 a bit-field.
1633
1634 2020-05-11 Jason Merrill <jason@redhat.com>
1635
1636 Resolve C++20 NB comment CA104
1637 * pt.c (determine_specialization): Compare constraints for
1638 specialization of member template of class instantiation.
1639
1640 2020-05-11 Jason Merrill <jason@redhat.com>
1641
1642 PR c++/92583
1643 PR c++/92654
1644 * tree.c (cp_walk_subtrees): Stop at typedefs.
1645 Handle TYPENAME_TYPE here.
1646 * pt.c (find_parameter_packs_r): Not here.
1647 (for_each_template_parm_r): Clear *walk_subtrees.
1648 * decl2.c (min_vis_r): Look through typedefs.
1649
1650 2020-05-11 Jason Merrill <jason@redhat.com>
1651
1652 * call.c (implicit_conversion_error): Split out from...
1653 (perform_implicit_conversion_flags): ...here.
1654 (build_converted_constant_expr_internal): Use it.
1655
1656 2020-05-11 Jason Merrill <jason@redhat.com>
1657
1658 PR c++/90748
1659 * parser.c (inject_parm_decls): Set current_class_ptr here.
1660 (cp_parser_direct_declarator): And here.
1661 (cp_parser_late_return_type_opt): Not here.
1662 (cp_parser_noexcept_specification_opt): Nor here.
1663 (cp_parser_exception_specification_opt)
1664 (cp_parser_late_noexcept_specifier): Remove unneeded parameters.
1665
1666 2020-05-11 Jason Merrill <jason@redhat.com>
1667
1668 * decl.c (cxx_init_decl_processing): Call declare_weak for
1669 __cxa_pure_virtual.
1670
1671 2020-05-11 Jason Merrill <jason@redhat.com>
1672
1673 * pt.c (instantiate_class_template_1): Call tsubst_expr for
1674 STATIC_ASSERT member.
1675 * ptree.c (cxx_print_xnode): Handle STATIC_ASSERT.
1676
1677 2020-05-11 Jason Merrill <jason@redhat.com>
1678
1679 * pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Remove redundant
1680 walking of capture list.
1681
1682 2020-05-11 Jason Merrill <jason@redhat.com>
1683
1684 * cp-tree.h (LOOKUP_EXPLICIT_TMPL_ARGS): Remove.
1685 * call.c (build_new_function_call): Don't set it.
1686 (build_new_method_call_1): Likewise.
1687 (build_over_call): Check cand->explicit_targs instead.
1688
1689 2020-05-11 Jason Merrill <jason@redhat.com>
1690
1691 * decl.c (compute_array_index_type_loc): Stabilize before building
1692 the MINUS_EXPR.
1693
1694 2020-05-11 Jason Merrill <jason@redhat.com>
1695
1696 * decl.c (grokdeclarator): Adjust deprecated_state here.
1697 (start_decl): Not here.
1698
1699 2020-05-08 Iain Sandoe <iain@sandoe.co.uk>
1700
1701 PR c++/95003
1702 * coroutines.cc (build_actor_fn): Ensure that bind scopes
1703 are marked as having side-effects where necessary.
1704 (replace_statement_captures): Likewise.
1705 (morph_fn_to_coro): Likewise.
1706
1707 2020-05-08 Nathan Sidwell <nathan@acm.org>
1708
1709 * NEWS: Delete, it is so stale.
1710
1711 * parser.c (cp_lexer_set_source_position_from_token): EOF has a
1712 location too.
1713
1714 2020-05-07 Iain Sandoe <iain@sandoe.co.uk>
1715
1716 PR c++/94817
1717 PR c++/94829
1718 * coroutines.cc (morph_fn_to_coro): Set unformed outline
1719 functions to error_mark_node. For early error returns suppress
1720 warnings about missing ramp return values. Fix reinstatement
1721 of the function body on pre-existing initial error.
1722 * decl.c (finish_function): Use the normal error path for fails
1723 in the ramp function, do not try to compile the helpers if the
1724 transform fails.
1725
1726 2020-05-07 Marek Polacek <polacek@redhat.com>
1727
1728 PR c++/94590 - Detect long double -> double narrowing.
1729 * typeck2.c (check_narrowing): Detect long double -> double
1730 narrowing even when double and long double have the same
1731 precision. Make it handle conversions to float too.
1732
1733 2020-05-07 Marek Polacek <polacek@redhat.com>
1734
1735 PR c++/94255
1736 * parser.c (cp_parser_class_specifier_1): Check that the scope is
1737 nested inside current scope before pushing it.
1738
1739 2020-05-07 Marek Polacek <polacek@redhat.com>
1740
1741 P1957R2
1742 * typeck2.c (check_narrowing): Consider T* to bool narrowing
1743 in C++11 and up.
1744
1745 2020-05-07 Marek Polacek <polacek@redhat.com>
1746
1747 * decl.c (grok_op_properties): Fix spelling of non-static.
1748 * typeck.c (build_class_member_access_expr): Likewise.
1749
1750 2020-05-07 Richard Biener <rguenther@suse.de>
1751
1752 PR middle-end/94703
1753 * optimize.c (update_cloned_parm): Copy DECL_NOT_GIMPLE_REG_P.
1754
1755 2020-05-06 Marek Polacek <polacek@redhat.com>
1756
1757 PR c++/94938
1758 * pt.c (tsubst_copy_and_build): Call type_dependent_expression_p_push
1759 instead of uses_template_parms. Move the warning_sentinels after the
1760 RECURs.
1761
1762 2020-05-06 Jakub Jelinek <jakub@redhat.com>
1763
1764 PR c++/94951
1765 * typeck.c (cp_strict_aliasing_warning): New function.
1766 (cp_build_indirect_ref_1, build_reinterpret_cast_1): Use
1767 it instead of strict_aliasing_warning.
1768
1769 PR c++/94907
1770 * method.c (defaulted_late_check): Don't call synthesize_method
1771 on constexpr sfk_comparison if it has been called on it already.
1772
1773 2020-05-06 Nathan Sidwell <nathan@acm.org>
1774
1775 PR c++/94946
1776 * decl.c (grokdeclarator): Don't splice template attributes in
1777 parm context -- they can apply to the parm.
1778
1779 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
1780
1781 * coroutines.cc: Remove references to n4849 throughout.
1782
1783 2020-05-05 Jason Merrill <jason@redhat.com>
1784
1785 CWG 2235
1786 * pt.c (more_specialized_fn): Do consider parms with no deducible
1787 template parameters.
1788
1789 2020-05-05 Jason Merrill <jason@redhat.com>
1790
1791 PR c++/90212
1792 * constexpr.c (potential_constant_expression_1): In a lambda
1793 function, consider a captured variable directly.
1794
1795 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
1796
1797 * coroutines.cc (transform_await_wrapper): Check that we have
1798 no unlowered co_yields.
1799 (captures_temporary): Likewise.
1800 (register_awaits): Likewise.
1801
1802 2020-05-05 Nathan Sidwell <nathan@acm.org>
1803
1804 PR c++/94807
1805 * coroutines.cc (morph_fn_to_coro): Just check for
1806 closure_identifier.
1807 * pt.c (tsubst_function_decl): Update lambda fn's this_ptr name.
1808
1809 2020-05-05 Marek Polacek <polacek@redhat.com>
1810 Jason Merrill <jason@redhat.com>
1811
1812 PR c++/94799
1813 * parser.c (cp_parser_postfix_dot_deref_expression): If we have
1814 a type-dependent object of class type, stash it to
1815 parser->context->object_type. If the postfix expression doesn't have
1816 a type, use typeof.
1817 (cp_parser_class_name): Consider object scope too.
1818 (cp_parser_lookup_name): Remove code dealing with the case when
1819 object_type is unknown_type_node.
1820
1821 2020-05-04 Patrick Palka <ppalka@redhat.com>
1822
1823 PR c++/94038
1824 * cp-gimplify.c (cp_fold) <case CALL_EXPR>: Move some variable
1825 declarations closer to their uses. Copy the CALL_EXPR only
1826 when one of its arguments has changed.
1827 <case TREE_VEC>: Instead of first collecting the folded
1828 arguments into a releasing_vec, just make a copy of the TREE_VEC
1829 as soon as folding changes one of its arguments.
1830
1831 2020-05-04 Iain Sandoe <iain@sandoe.co.uk>
1832
1833 * coroutines.cc (morph_fn_to_coro): Mark the coro.gro variable
1834 as artificial and ignored.
1835
1836 2020-05-04 Nathan Sidwell <nathan@acm.org>
1837
1838 pt.c (process_template_parm): Don't walk the template list twice,
1839 remember the final node instead.
1840 (end_template_parm_list): Refactor. Comment on why we do a pop
1841 and a push.
1842
1843 PR c++/94827 -- don't save parms in nested requirement
1844 * constraint.cc (tsubst_nested_requirement): TYPE directly holds
1845 notmalized requirement.
1846 (finish_nested_requirement): Don't stash current tpl parms into
1847 the requirement.
1848 (diagnose_nested_requirement): TYPE directly holds notmalized
1849 requirement.
1850
1851 2020-05-01 Patrick Palka <ppalka@redhat.com>
1852
1853 PR c++/90880
1854 * cp-tree.h (check_accessibility_of_qualified_id): Add
1855 tsubst_flags_t parameter and change return type to bool.
1856 * parser.c (cp_parser_lookup_name): Pass tf_warning_to_error to
1857 check_accessibility_of_qualified_id.
1858 * pt.c (tsubst_qualified_id): Return error_mark_node if
1859 check_accessibility_of_qualified_id returns false.
1860 * semantics.c (check_accessibility_of_qualified_id): Add
1861 complain parameter. Pass complain instead of
1862 tf_warning_or_error to perform_or_defer_access_check. Return
1863 true unless perform_or_defer_access_check returns false.
1864
1865 2020-05-01 Marek Polacek <polacek@redhat.com>
1866
1867 PR c++/94885
1868 * typeck2.c (process_init_constructor_record): Return PICFLAG_ERRONEOUS
1869 if an initializer element was erroneous.
1870
1871 2020-05-01 Jason Merrill <jason@redhat.com>
1872
1873 PR c++/90479
1874 * init.c (get_nsdmi): Don't push_to_top_level for a local class.
1875
1876 2020-05-01 Jason Merrill <jason@redhat.com>
1877
1878 PR c++/91529
1879 * decl.c (cp_finish_decl): Also clear TREE_READONLY if
1880 -fmerge-all-constants.
1881
1882 2020-05-01 Jason Merrill <jason@redhat.com>
1883
1884 PR c++/93822
1885 * pt.c (tsubst_decl): Make sure DECL_VALUE_EXPR continues to have
1886 the same type as the variable.
1887
1888 2020-04-30 Jason Merrill <jason@redhat.com>
1889 Nathan Sidwell <nathan@acm.org>
1890
1891 PR c++/94827
1892 * constraint.cc (map_arguments): If ARGS is null, it's a
1893 self-mapping of parms.
1894 (finish_nested_requirement): Do not pass argified
1895 current_template_parms to normalization.
1896 (tsubst_nested_requirement): Don't assert no template parms.
1897
1898 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
1899
1900 PR c++/94886
1901 * coroutines.cc (transform_local_var_uses): Defer walking
1902 the DECL_INITIALs of BIND_EXPR vars until all the frame
1903 allocations have been made.
1904
1905 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
1906
1907 PR c++/94883
1908 * coroutines.cc (register_awaits): Update target
1909 expressions for awaitable and suspend handle
1910 initializers.
1911
1912 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
1913
1914 PR c++/94879
1915 * coroutines.cc (build_co_await): Account for variables
1916 with DECL_VALUE_EXPRs.
1917 (captures_temporary): Likewise.
1918 (register_awaits): Likewise.
1919
1920 2020-04-29 Patrick Palka <ppalka@redhat.com>
1921
1922 PR c++/94830
1923 * pt.c (find_template_parameter_info::parm_list): New field.
1924 (keep_template_parm): Use the new field to build up the
1925 parameter list here instead of ...
1926 (find_template_parameters): ... here. Return ftpi.parm_list.
1927
1928 2020-04-29 Jakub Jelinek <jakub@redhat.com>
1929
1930 PR target/94707
1931 * class.c (build_base_field): Set DECL_FIELD_ABI_IGNORED on C++17 empty
1932 base artificial FIELD_DECLs.
1933 (layout_class_type): Set DECL_FIELD_ABI_IGNORED on empty class
1934 field_poverlapping_p FIELD_DECLs.
1935
1936 2020-04-29 Patrick Palka <ppalka@redhat.com>
1937
1938 PR c++/94819
1939 * constraint.cc (satisfy_declaration_constraints): Use saved_t
1940 instead of t as the key to decl_satisfied_cache.
1941
1942 PR c++/94808
1943 * error.c (print_requires_expression_info): Print the dependent
1944 form of the parameter list with its template parameter mapping,
1945 rather than printing the substituted form.
1946
1947 2020-04-28 Jason Merrill <jason@redhat.com>
1948
1949 PR c++/94583
1950 * decl.c (use_eh_spec_block): Check nothrow type after
1951 DECL_DEFAULTED_FN.
1952 * pt.c (maybe_instantiate_noexcept): Call synthesize_method for
1953 DECL_MAYBE_DELETED fns here.
1954 * decl2.c (mark_used): Not here.
1955 * method.c (get_defaulted_eh_spec): Reject DECL_MAYBE_DELETED here.
1956
1957 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
1958
1959 PR c++/94760
1960 * coroutines.cc (instantiate_coro_traits): Pass a reference to
1961 object type rather than a pointer type for 'this', for method
1962 coroutines.
1963 (struct param_info): Add a field to hold that the parm is a lambda
1964 closure pointer.
1965 (morph_fn_to_coro): Check for lambda closure pointers in the
1966 args. Use a reference to *this when building the args list for the
1967 promise allocator lookup.
1968
1969 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
1970
1971 PR c++/94759
1972 * coroutines.cc (coro_promise_type_found_p): Do not
1973 exclude non-classes here (this needs to be handled in the
1974 coroutine header).
1975 (morph_fn_to_coro): Allow for the case where the coroutine
1976 returns void.
1977
1978 2020-04-27 Iain Sandoe <iain@sandoe.co.uk>
1979
1980 PR c++/94701
1981 * coroutines.cc (struct local_var_info): Add fields for static
1982 variables and those with DECL_VALUE_EXPR redirection.
1983 (transform_local_var_uses): Skip past typedefs and static vars
1984 and then account for redirected variables.
1985 (register_local_var_uses): Likewise.
1986
1987 2020-04-27 Jason Merrill <jason@redhat.com>
1988
1989 PR c++/90750
1990 PR c++/79585
1991 * decl.c (grokdeclarator): Move dependent attribute to decl.
1992 * decl2.c (splice_template_attributes): No longer static.
1993
1994 2020-04-27 Patrick Palka <ppalka@redhat.com>
1995
1996 PR c++/94772
1997 * constexpr.c (cxx_eval_call_expression): Don't set new_obj if we're
1998 evaluating the target constructor of a delegating constructor.
1999 (cxx_eval_store_expression): Don't set TREE_READONLY if the LHS of the
2000 INIT_EXPR is '*this'.
2001
2002 2020-04-26 Marek Polacek <polacek@redhat.com>
2003
2004 PR c++/90320
2005 * call.c (struct conversion): Add copy_init_p.
2006 (standard_conversion): Set copy_init_p in ck_base and ck_rvalue
2007 if FLAGS demands LOOKUP_ONLYCONVERTING.
2008 (convert_like_real) <case ck_base>: If copy_init_p is set, or
2009 LOOKUP_ONLYCONVERTING into FLAGS.
2010
2011 2020-04-26 Iain Sandoe <iain@sandoe.co.uk>
2012
2013 PR c++/94752
2014 * coroutines.cc (morph_fn_to_coro): Ensure that
2015 unnamed function params have a usable and distinct
2016 frame field name.
2017
2018 2020-04-24 Jason Merrill <jason@redhat.com>
2019
2020 PR c++/94583
2021 * decl.c (redeclaration_error_message): Reject defaulted comparison
2022 operator that has been previously declared.
2023
2024 2020-04-25 Patrick Palka <ppalka@redhat.com>
2025
2026 * parser.c (cp_parser_diagnose_invalid_type_name): Suggest enabling
2027 concepts if the invalid identifier is 'requires'.
2028
2029 2020-04-25 Jakub Jelinek <jakub@redhat.com>
2030
2031 PR c++/94742
2032 * semantics.c (finish_call_expr): When looking if all overloads
2033 are noreturn, use STRIP_TEMPLATE to look through TEMPLATE_DECLs.
2034
2035 2020-04-24 Martin Liska <mliska@suse.cz>
2036
2037 * coroutines.cc: Fix compilation error for release checking
2038 where we miss declaration of ‘coro_body_contains_bind_expr_p’.
2039
2040 2020-04-23 Patrick Palka <ppalka@redhat.com>
2041
2042 * tree.c (zero_init_expr_p): Use uses_template_parms instead of
2043 dependent_type_p.
2044
2045 PR c++/94645
2046 * pt.c (template_class_depth): Walk into the DECL_FRIEND_CONTEXT of a
2047 friend declaration rather than into its CP_DECL_CONTEXT.
2048
2049 2020-04-23 Iain Sandoe <iain@sandoe.co.uk>
2050
2051 PR c++/94288
2052 * coroutines.cc (await_statement_expander): Simplify cases.
2053 (struct susp_frame_data): Add fields for truth and/or if
2054 cases, rename one field.
2055 (analyze_expression_awaits): New.
2056 (expand_one_truth_if): New.
2057 (add_var_to_bind): New helper.
2058 (coro_build_add_if_not_cond_break): New helper.
2059 (await_statement_walker): Handle conditional expressions,
2060 handle expansion of truth-and/or-if cases.
2061 (bind_expr_find_in_subtree): New, checking-only.
2062 (coro_body_contains_bind_expr_p): New, checking-only.
2063 (morph_fn_to_coro): Ensure that we have a top level bind
2064 expression.
2065
2066 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
2067
2068 PR translation/94698
2069 * class.c (check_field_decls): Change "define" to "declare" in
2070 -Weffc++ diagnostics.
2071
2072 2020-04-22 Patrick Palka <ppalka@redhat.com>
2073
2074 PR c++/94719
2075 PR c++/94549
2076 * constraint.cc (satisfy_declaration_constraints): If the inherited
2077 constructor points to an instantiation of a constructor template,
2078 remember and use its attached template arguments.
2079
2080 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
2081
2082 PR translation/94698
2083 * class.c (check_field_decls): Change "override" to "define" in
2084 -Weffc++ diagnostics.
2085
2086 2020-04-22 Iain Sandoe <iain@sandoe.co.uk>
2087
2088 PR c++/94682
2089 * coroutines.cc (struct param_info): Add a field to note that
2090 the param is 'this'.
2091 (morph_fn_to_coro): Convert this to a reference before using it
2092 in the promise parameter preview.
2093
2094 2020-04-22 Jason Merrill <jason@redhat.com>
2095
2096 PR c++/94546
2097 * pt.c (register_parameter_specializations): If the instantiation is
2098 still a parameter pack, don't wrap it in a NONTYPE_ARGUMENT_PACK.
2099 (tsubst_pack_expansion, tsubst_expr): Adjust.
2100
2101 2020-04-22 Martin Sebor <msebor@redhat.com>
2102 Jason Merrill <jason@redhat.com>
2103
2104 PR c++/94510
2105 * decl.c (reshape_init_array_1): Avoid stripping redundant trailing
2106 zero initializers...
2107 * mangle.c (write_expression): ...and handle them here even for
2108 pointers to members by calling zero_init_expr_p.
2109 * cp-tree.h (zero_init_expr_p): Declare.
2110 * tree.c (zero_init_expr_p): Define.
2111 (type_initializer_zero_p): Remove.
2112 * pt.c (tparm_obj_values): New hash_map.
2113 (get_template_parm_object): Store to it.
2114 (tparm_object_argument): New.
2115
2116 2020-04-22 Patrick Palka <ppalka@redhat.com>
2117
2118 PR c++/67825
2119 * constraint.cc (diagnose_valid_expression): Check convert_to_void here
2120 as well as in tsubst_valid_expression_requirement.
2121
2122 2020-04-21 Patrick Palka <ppalka@redhat.com>
2123
2124 PR c++/94549
2125 * constraint.cc (satisfy_declaration_constraints): Don't strip the
2126 inherited constructor if it already has template information.
2127
2128 PR c++/94597
2129 * pt.c (any_template_parm_r) <case IDENTIFIER_NODE>: New case. If this
2130 is a conversion operator, visit its TREE_TYPE.
2131
2132 2020-04-21 Nathan Sidwell <nathan@acm.org>
2133
2134 * pt.c (tsubst_copy_and_build) [POINTER_PLUS_EXPR]: Check for
2135 error_mark_node.
2136
2137 2020-04-21 Iain Sandoe <iain@sandoe.co.uk>
2138
2139 PR c++/94661
2140 * coroutines.cc (morph_fn_to_coro): Simplify return
2141 value computation.
2142
2143 2020-04-17 Marek Polacek <polacek@redhat.com>
2144
2145 PR c++/94592
2146 * constexpr.c (cxx_eval_outermost_constant_expr): Return when T is
2147 a BRACE_ENCLOSED_INITIALIZER_P.
2148 (is_nondependent_constant_expression): Don't check
2149 BRACE_ENCLOSED_INITIALIZER_P.
2150 (is_nondependent_static_init_expression): Likewise.
2151
2152 2020-04-20 Patrick Palka <ppalka@redhat.com>
2153
2154 PR c++/94628
2155 * cp-tree.h (lss_policy::lss_nop): New enumerator.
2156 * pt.c (local_specialization_stack::local_specialization_stack): Handle
2157 an lss_nop policy.
2158 (local_specialization_stack::~local_specialization_stack): Likewise.
2159 (tsubst_pack_expansion): Use a local_specialization_stack instead of
2160 manually saving and restoring local_specializations. Conditionally
2161 replace local_specializations sooner, before the handling of the
2162 unsubstituted_packs case.
2163
2164 2020-04-20 Marek Polacek <polacek@redhat.com>
2165
2166 PR c++/94505 - bogus -Wparentheses warning with fold-expression.
2167 * pt.c (fold_expression): Add warning_sentinel for -Wparentheses
2168 before calling build_x_binary_op.
2169
2170 2020-04-20 Marek Polacek <polacek@redhat.com>
2171
2172 * coroutines.cc (captures_temporary): Don't assign the result of
2173 STRIP_NOPS to the same variable.
2174
2175 2020-04-20 Nathan Sidwell <nathan@acm.org>
2176
2177 PR c++/94454 - tpl-tpl-parms are not canonicalizable types
2178 * pt.c (canonical_type_parameter): Assert not a tpl-tpl-parm.
2179 (process_template_parm): tpl-tpl-parms are structural.
2180 (rewrite_template_parm): Propagate structuralness.
2181
2182 PR c++/94454 - Expr pack expansion equality
2183 * tree.c (cp_tree_equal) [TEMPLATE_ID_EXPR, default]: Refactor.
2184 [EXPR_PACK_EXPANSION]: Add.
2185
2186 PR c++/94454 Template Argument Hashing
2187 * pt.c (iterative_hash_template_arg): Strip nodes as
2188 template_args_equal does.
2189 [ARGUMENT_PACK_SELECT, TREE_VEC, CONSTRUCTOR]: Refactor.
2190 [node_class:TEMPLATE_TEMPLATE_PARM]: Hash by level & index.
2191 [node_class:default]: Refactor.
2192
2193 2020-04-18 Patrick Palka <ppalka@redhat.com>
2194
2195 PR c++/94632
2196 * tree.c (cp_tree_equal) <case PARM_DECL>: Ignore
2197 comparing_specializations if the parameters' contexts are identical.
2198
2199 PR c++/92187
2200 * pt.c (splice_late_return_type): Propagate cv-qualifiers and
2201 PLACEHOLDER_TYPE_CONSTRAINTS from the original auto node to the new one.
2202
2203 2020-04-17 Patrick Palka <ppalka@redhat.com>
2204
2205 PR c++/94483
2206 * lambda.c (lambda_capture_field_type): Avoid doing auto deduction if
2207 the explicit initializer has parameter packs.
2208
2209 PR c++/88754
2210 * parser.c (cp_parser_check_template_parameters): Before issuing a hard
2211 error, first try simulating an error instead.
2212
2213 2020-04-17 Jakub Jelinek <jakub@redhat.com>
2214
2215 PR other/94629
2216 * call.c (build_conditional_expr_1): Remove redundant assignment to
2217 arg2.
2218
2219 2020-04-16 Patrick Palka <ppalka@redhat.com>
2220
2221 PR c++/94475
2222 * cvt.c (ocp_convert): If the result of scalar_constant_value is
2223 erroneous, ignore it and use the original expression.
2224
2225 2020-04-16 Jakub Jelinek <jakub@redhat.com>
2226
2227 PR c++/94571
2228 * parser.c (cp_parser_simple_declaration): Fix up a pasto in
2229 diagnostics.
2230
2231 2020-04-15 Jakub Jelinek <jakub@redhat.com>
2232
2233 PR c/94593
2234 * parser.c (cp_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
2235 requires directive when not at file or namespace scope.
2236
2237 2020-04-14 Iain Sandoe <iain@sandoe.co.uk>
2238
2239 PR c++/94359
2240 * coroutines.cc (build_actor_fn): Check that the target can
2241 support the resume tailcall before mandating it.
2242
2243 2020-04-14 Patrick Palka <ppalka@redhat.com>
2244
2245 PR c++/85278
2246 * cxx-pretty-print.c (cxx_pretty_printer:simple_type_specifier)
2247 <case DECLTYPE_TYPE>: Handle DECLTYPE_TYPE here instead of ...
2248 (pp_cxx_type_specifier_seq) <case DECLTYPE_TYPE>: ... here.
2249 (cxx_pretty_printer::direct_abstract_declarator) <case DECLTYPE_TYPE>:
2250 New no-op case.
2251
2252 PR c++/94034
2253 * constexpr.c (replace_result_decl_data): New struct.
2254 (replace_result_decl_data_r): New function.
2255 (replace_result_decl): New function.
2256 (cxx_eval_call_expression): Use it.
2257 * tree.c (build_aggr_init_expr): Set the location of the AGGR_INIT_EXPR
2258 to that of its initializer.
2259
2260 2020-04-13 Marek Polacek <polacek@redhat.com>
2261
2262 PR c++/94588
2263 * name-lookup.c (check_local_shadow): Add an inform call.
2264
2265 2020-04-13 Patrick Palka <ppalka@redhat.com>
2266
2267 PR c++/94521
2268 * error.c (dump_scope): Pass TFF_NO_FUNCTION_ARGUMENTS to
2269 dump_function_decl when printing a function template instantiation as a
2270 scope.
2271
2272 PR c++/94470
2273 * constexpr.c (get_or_insert_ctor_field): Set default value of parameter
2274 'pos_hint' to -1.
2275 (cxx_eval_bare_aggregate): Use get_or_insert_ctor_field instead of
2276 assuming the the next index belongs at the end of the new CONSTRUCTOR.
2277 (cxx_eval_store_expression): Revert PR c++/78572 fix.
2278
2279 2020-04-13 Nathan Sidwell <nathan@acm.org>
2280
2281 PR c++/94426 lambdas with internal linkage are different to no-linkage
2282 * decl2.c (determine_visibility): A lambda's visibility is
2283 affected by its extra scope.
2284 * pt.c (instantiate_decl): Determine var's visibility before
2285 instantiating its initializer.
2286 * tree.c (no_linkage_check): Revert code looking at visibility of
2287 lambda's extra scope.
2288 `
2289 2020-04-10 Iain Sandoe <iain@sandoe.co.uk>
2290
2291 PR c++/94528
2292 * coroutines.cc (co_await_expander): Remove.
2293 (expand_one_await_expression): New.
2294 (process_one_statement): New.
2295 (await_statement_expander): New.
2296 (build_actor_fn): Revise to use per-statement expander.
2297 (struct susp_frame_data): Reorder and comment.
2298 (register_awaits): Factor code.
2299 (replace_statement_captures): New, factored from...
2300 (maybe_promote_captured_temps):.. here.
2301 (await_statement_walker): Revise to process per statement.
2302 (morph_fn_to_coro): Use revised susp_frame_data layout.
2303
2304 2020-04-10 Marek Polacek <polacek@redhat.com>
2305
2306 PR c++/94149
2307 * method.c (constructible_expr): In C++20, try using parenthesized
2308 initialization of aggregates to determine the result of
2309 __is_constructible.
2310
2311 2020-04-10 Bin Cheng <bin.cheng@linux.alibaba.com>
2312
2313 * coroutines.cc (co_await_expander): Simplify.
2314
2315 2020-04-09 Jason Merrill <jason@redhat.com>
2316
2317 PR c++/94523
2318 * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]: Look at
2319 ctx->object and ctx->global->values first.
2320
2321 2020-04-09 Marek Polacek <polacek@redhat.com>
2322
2323 PR c++/93790
2324 * call.c (initialize_reference): If the reference binding failed, maybe
2325 try initializing from { }.
2326 * decl.c (grok_reference_init): For T& t(e), set
2327 LOOKUP_AGGREGATE_PAREN_INIT but don't build up a constructor yet.
2328
2329 2020-04-08 Iain Sandoe <iain@sandoe.co.uk>
2330 Jun Ma <JunMa@linux.alibaba.com>
2331
2332 * coroutines.cc (maybe_promote_captured_temps): Add a cleanup
2333 expression, if needed, to any call from which we promoted
2334 temporaries captured by reference.
2335
2336 2020-04-08 Marek Polacek <polacek@redhat.com>
2337
2338 PR c++/94507 - ICE-on-invalid with lambda template.
2339 * pt.c (tsubst_lambda_expr): Cope when tsubst_template_decl or
2340 tsubst_function_decl returns error_mark_node.
2341
2342 2020-04-08 Martin Liska <mliska@suse.cz>
2343
2344 PR c++/94314
2345 * decl.c (duplicate_decls): Duplicate also DECL_IS_REPLACEABLE_OPERATOR.
2346 (cxx_init_decl_processing): Mark replaceable all implicitly defined
2347 operators.
2348
2349 2020-04-08 Patrick Palka <ppalka@redhat.com>
2350
2351 Core issues 1001 and 1322
2352 PR c++/92010
2353 * pt.c (rebuild_function_or_method_type): Split function out from ...
2354 (tsubst_function_type): ... here.
2355 (maybe_rebuild_function_decl_type): New function.
2356 (tsubst_function_decl): Use it.
2357
2358 2020-04-08 Jakub Jelinek <jakub@redhat.com>
2359
2360 PR c++/94325
2361 * decl.c (begin_destructor_body): For CLASSTYPE_VBASECLASSES class
2362 dtors, if CLASSTYPE_PRIMARY_BINFO is non-NULL, but not BINFO_VIRTUAL_P,
2363 look at CLASSTYPE_PRIMARY_BINFO of its BINFO_TYPE if it is not
2364 BINFO_VIRTUAL_P, and so on.
2365
2366 2020-04-08 Marek Polacek <polacek@redhat.com>
2367
2368 PR c++/94478 - ICE with defaulted comparison operator
2369 * method.c (early_check_defaulted_comparison): Give an error when the
2370 context is null.
2371
2372 2020-04-08 Tobias Burnus <tobias@codesourcery.com>
2373
2374 PR middle-end/94120
2375 * paser.c (cp_parser_oacc_declare): Add check that variables
2376 are declared in the same scope as the directive.
2377
2378 2020-04-07 Jason Merrill <jason@redhat.com>
2379
2380 PR c++/94480
2381 * parser.c (cp_parser_requires_expression): Use tentative_firewall.
2382
2383 PR c++/94481
2384 * parser.c (cp_parser_placeholder_type_specifier): Use
2385 matching_parens.
2386
2387 2020-04-07 Iain Sandoe <iain@sandoe.co.uk>
2388
2389 * coroutines.cc (maybe_promote_captured_temps): Ensure that
2390 reference capture placeholder vars are properly declared.
2391
2392 2020-04-07 Patrick Palka <ppalka@redhat.com>
2393
2394 PR c++/90996
2395 * tree.c (replace_placeholders): Look through all handled components,
2396 not just COMPONENT_REFs.
2397 * typeck2.c (process_init_constructor_array): Propagate
2398 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
2399 the array initializer.
2400
2401 2020-04-07 Jakub Jelinek <jakub@redhat.com>
2402
2403 PR c++/94512
2404 * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
2405 if cp_parser_omp_master succeeded.
2406
2407 2020-04-06 Jason Merrill <jason@redhat.com>
2408
2409 PR c++/94462
2410 * decl.c (duplicate_decls): Fix handling of DECL_HIDDEN_FRIEND_P.
2411
2412 2020-04-04 Marek Polacek <polacek@redhat.com>
2413 Jason Merrill <jason@redhat.com>
2414
2415 PR c++/94155 - crash in gimplifier with paren init of aggregates.
2416 * init.c (build_vec_init): Fill in indexes.
2417
2418 2020-04-04 Jason Merrill <jason@redhat.com>
2419
2420 PR c++/91377
2421 * mangle.c (write_expression): Skip IMPLICIT_CONV_EXPR.
2422
2423 2020-04-04 Patrick Palka <ppalka@redhat.com>
2424
2425 PR c++/94205
2426 PR c++/79937
2427 * constexpr.c (struct constexpr_ctx): New field 'parent'.
2428 (cxx_eval_bare_aggregate): Propagate CONSTRUCTOR_PLACEHOLDER_BOUNDARY
2429 flag from the original constructor to the reduced constructor.
2430 (lookup_placeholder): Prefer to return the outermost matching object
2431 by recursively calling lookup_placeholder on the 'parent' context,
2432 but don't cross CONSTRUCTOR_PLACEHOLDER_BOUNDARY constructors.
2433 (cxx_eval_constant_expression): Link the 'ctx' context to the 'new_ctx'
2434 context via 'new_ctx.parent' when being expanded without an explicit
2435 target. Don't call replace_placeholders.
2436 (cxx_eval_outermost_constant_expr): Initialize 'ctx.parent' to NULL.
2437
2438 PR c++/94219
2439 PR c++/94205
2440 * constexpr.c (get_or_insert_ctor_field): Split out (while adding
2441 support for VECTOR_TYPEs, and optimizations for the common case)
2442 from ...
2443 (cxx_eval_store_expression): ... here. Rename local variable
2444 'changed_active_union_member_p' to 'activated_union_member_p'. Record
2445 the sequence of indexes into 'indexes' that yields the subobject we're
2446 assigning to. Record the integer offsets of the constructor indexes
2447 we're assigning through into 'index_pos_hints'. After evaluating the
2448 initializer of the store expression, recompute 'valp' using 'indexes'
2449 and using 'index_pos_hints' as hints.
2450 (cxx_eval_bare_aggregate): Tweak comments. Use get_or_insert_ctor_field
2451 to recompute the constructor_elt pointer we're assigning through after
2452 evaluating each initializer.
2453
2454 2020-04-04 Jason Merrill <jason@redhat.com>
2455
2456 PR c++/67825
2457 * constraint.cc (tsubst_valid_expression_requirement): Call
2458 convert_to_void.
2459
2460 2020-04-04 Jason Merrill <jason@redhat.com>
2461
2462 PR c++/94453
2463 * constexpr.c (maybe_constant_value): Use break_out_target_exprs.
2464 * expr.c (mark_use) [VIEW_CONVERT_EXPR]: Don't wrap a TARGET_EXPR in
2465 NON_LVALUE_EXPR.
2466
2467 2020-04-04 Jakub Jelinek <jakub@redhat.com>
2468
2469 PR debug/94441
2470 * parser.c (cp_parser_omp_for_loop): Use
2471 protected_set_expr_location_if_unset.
2472 * cp-gimplify.c (genericize_if_stmt, genericize_cp_loop): Likewise.
2473
2474 PR c++/94477
2475 * pt.c (tsubst_expr) <case OMP_MASTER>: Clear
2476 omp_parallel_combined_clauses.
2477
2478 2020-04-03 Jason Merrill <jason@redhat.com>
2479
2480 PR c++/91966
2481 * pt.c (complex_pack_expansion_r): New.
2482 (complex_alias_template_p): Use it.
2483
2484 2020-03-31 Jason Merrill <jason@redhat.com>
2485
2486 PR c++/94205
2487 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Call
2488 replace_placeholders.
2489 * typeck2.c (store_init_value): Fix arguments to
2490 fold_non_dependent_expr.
2491
2492 2020-03-31 Jason Merrill <jason@redhat.com>
2493
2494 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Use
2495 local variables.
2496
2497 2020-03-30 Jason Merrill <jason@redhat.com>
2498
2499 PR c++/90711
2500 * tree.c (cp_tree_equal) [CALL_EXPR]: Compare KOENIG_LOOKUP_P.
2501 (called_fns_equal): Check DECL_CONTEXT.
2502
2503 2020-03-30 Jakub Jelinek <jakub@redhat.com>
2504
2505 PR c++/94385
2506 * semantics.c (add_stmt): Only set STMT_IS_FULL_EXPR_P on trees with
2507 STATEMENT_CODE_P code.
2508
2509 2020-03-28 Patrick Palka <ppalka@redhat.com>
2510
2511 PR c++/94306
2512 * parser.c (cp_parser_requires_clause_opt): Diagnose and recover from
2513 "requires {" when "requires requires {" was probably intended.
2514
2515 PR c++/94252
2516 * constraint.cc (tsubst_compound_requirement): Always suppress errors
2517 from type_deducible_p and expression_convertible_p, as they're not
2518 substitution errors.
2519 (diagnose_atomic_constraint) <case INTEGER_CST>: Remove this case so
2520 that we diagnose INTEGER_CST expressions of non-bool type via the
2521 default case.
2522 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: New case.
2523 * parser.c (cp_parser_requires_expression): Always parse the requirement
2524 body as if we're processing a template, by temporarily incrementing
2525 processing_template_decl. Afterwards, if we're not actually in a
2526 template context, perform semantic processing to diagnose any invalid
2527 types and expressions.
2528 * pt.c (tsubst_copy_and_build) <case REQUIRES_EXPR>: Remove dead code.
2529 * semantics.c (finish_static_assert): Explain an assertion failure
2530 when the condition is a REQUIRES_EXPR like we do when it is a concept
2531 check.
2532
2533 * constraint.cc (diagnose_compound_requirement): When diagnosing a
2534 compound requirement, maybe replay the satisfaction failure, subject to
2535 the current diagnosis depth.
2536
2537 * constraint.cc (finish_constraint_binary_op): Set the location of EXPR
2538 as well as its range, because build_x_binary_op doesn't always do so.
2539 (current_constraint_diagnosis_depth): New.
2540 (concepts_diagnostics_max_depth_exceeded_p): New.
2541 (collect_operands_of_disjunction): New.
2542 (satisfy_disjunction): When diagnosing a satisfaction failure, maybe
2543 replay each branch of the disjunction, subject to the current diagnosis
2544 depth.
2545 (diagnose_valid_expression): When diagnosing a satisfaction failure,
2546 maybe replay the substitution error, subject to the current diagnosis
2547 recursion.
2548 (diagnose_valid_type): Likewise.
2549 (diagnose_nested_requiremnet): Likewise.
2550 (diagnosing_failed_constraint::diagnosing_failed_constraint): Increment
2551 current_constraint_diagnosis_depth when diagnosing.
2552 (diagnosing_failed_constraint::~diagnosing_failed_constraint): Decrement
2553 current_constraint_diagnosis_depth when diagnosing.
2554 (diagnosing_failed_constraint::replay_errors_p): New static member
2555 function.
2556 (diagnose_constraints): Don't diagnose if concepts_diagnostics_max_depth
2557 is 0. Emit a one-off note to increase -fconcepts-diagnostics-depth if
2558 the limit was exceeded.
2559 * cp-tree.h (diagnosing_failed_constraint::replay_errors_p): Declare.
2560
2561 2020-03-27 Nathan Sidwell <nathan@acm.org>
2562
2563 PR c++/84733
2564 * name-lookup.c (do_pushdecl): Look through cleanp levels.
2565
2566 2020-03-27 Martin Sebor <msebor@redhat.com>
2567
2568 PR c++/94078
2569 PR c++/93824
2570 PR c++/93810
2571 * cp-tree.h (most_specialized_partial_spec): Declare.
2572 * parser.c (cp_parser_elaborated_type_specifier): Distinguish alias
2573 from declarations.
2574 (specialization_of): New function.
2575 (cp_parser_check_class_key): Move code...
2576 (class_decl_loc_t::add): ...to here. Add parameters. Avoid issuing
2577 -Wredundant-tags on first-time declarations in other declarators.
2578 Correct handling of template specializations.
2579 (class_decl_loc_t::diag_mismatched_tags): Also expect to be called
2580 when -Wredundant-tags is enabled. Use primary template or partial
2581 specialization as the guide for uses of implicit instantiations.
2582 * pt.c (most_specialized_partial_spec): Declare extern.
2583
2584 2020-03-27 Nathan Sidwell <nathan@acm.org>
2585
2586 PR c++/94257
2587 * name-lookup.c (push_namespace): Triage ambiguous lookups that
2588 contain namespaces.
2589
2590 2020-03-27 Jakub Jelinek <jakub@redhat.com>
2591
2592 PR c++/94326
2593 * call.c (set_flags_from_callee): Don't update
2594 cp_function_chain->can_throw or current_function_returns_abnormally
2595 if cp_unevaluated_operand.
2596
2597 PR c++/94339
2598 * cvt.c (ocp_convert): Handle COMPOUND_EXPR by recursion on the second
2599 operand and creating a new COMPOUND_EXPR if anything changed.
2600
2601 2020-03-26 Marek Polacek <polacek@redhat.com>
2602
2603 PR c++/94336 - template keyword accepted before destructor names.
2604 * parser.c (cp_parser_unqualified_id): Give an error when 'template'
2605 is followed by a destructor name.
2606
2607 2020-03-27 Patrick Palka <ppalka@redhat.com>
2608
2609 * decl.c (compute_array_index_type_loc): Remove redundant
2610 type_dependent_expression_p check that is subsumed by
2611 value_dependent_expression_p.
2612 * decl2.c (is_late_template_attribute): Likewise.
2613 * pt.c (uses_template_parms): Likewise.
2614 (dependent_template_arg_p): Likewise.
2615
2616 2020-03-26 Marek Polacek <polacek@redhat.com>
2617
2618 DR 1710
2619 PR c++/94057 - template keyword in a typename-specifier.
2620 * parser.c (check_template_keyword_in_nested_name_spec): New.
2621 (cp_parser_nested_name_specifier_opt): Implement DR1710, optional
2622 'template'. Call check_template_keyword_in_nested_name_spec.
2623 (cp_parser_simple_type_specifier): Assume that a <
2624 following a qualified-id in a typename-specifier begins
2625 a template argument list.
2626
2627 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
2628
2629 * coroutines.cc (coro_init_identifiers): Initialize an identifier
2630 for the cororoutine handle 'address' method name.
2631 (struct coro_aw_data): Add fields to cover the continuations.
2632 (co_await_expander): Determine the kind of await_suspend in use.
2633 If we have the case that returns a continuation handle, then save
2634 this and make the target for 'scope exit without cleanup' be the
2635 continuation resume label.
2636 (expand_co_awaits): Remove.
2637 (struct suspend_point_info): Remove fields that kept the returned
2638 await_suspend handle type.
2639 (transform_await_expr): Remove code tracking continuation handles.
2640 (build_actor_fn): Add the continuation handle as an actor-function
2641 scope var. Build the symmetric transfer continuation point. Call
2642 the tree walk for co_await expansion directly, rather than via a
2643 trivial shim function.
2644 (register_await_info): Remove fields tracking continuation handles.
2645 (get_await_suspend_return_type): Remove.
2646 (register_awaits): Remove code tracking continuation handles.
2647 (morph_fn_to_coro): Remove code tracking continuation handles.
2648
2649 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
2650
2651 * coroutines.cc (co_await_expander): If we are expanding the
2652 initial await expression, set a boolean flag to show that we
2653 have now reached the initial await_resume() method call.
2654 (expand_co_awaits): Handle the 'initial await resume called' flag.
2655 (build_actor_fn): Insert the initial await expression into the
2656 start of the user-authored function-body. Handle the 'initial await
2657 resume called' flag.
2658 (morph_fn_to_coro): Initialise the 'initial await resume called'
2659 flag. Modify the unhandled exception catch clause to recognise
2660 exceptions that occur before the initial await_resume() and re-
2661 throw them.
2662
2663 2020-03-26 Jakub Jelinek <jakub@redhat.com>
2664
2665 PR c++/81349
2666 * class.c (user_provided_p): Use STRIP_TEMPLATE instead of returning
2667 true for all TEMPLATE_DECLs.
2668
2669 PR c++/94272
2670 * cp-gimplify.c (cp_genericize_r): Handle STATEMENT_LIST.
2671
2672 2020-03-25 Patrick Palka <ppalka@redhat.com>
2673
2674 PR c++/94265
2675 * parser.c (cp_parser_selection_statement) <case RID_IF>: Invalidate the
2676 current condition chain when the if-statement has a non-empty
2677 init-statement.
2678
2679 2020-03-25 Iain Sandoe <iain@sandoe.co.uk>
2680
2681 PR c++/94319
2682 * coroutines.cc (captures_temporary): Fix a missing dereference.
2683
2684 2020-03-24 Marek Polacek <polacek@redhat.com>
2685
2686 PR c++/94190 - wrong no post-decrement operator error in template.
2687 * call.c (convert_like_real): Use convert_from_reference on the result.
2688
2689 2020-03-24 Jason Merrill <jason@redhat.com>
2690
2691 PR c++/94186
2692 * constraint.cc (constraint_satisfaction_value): Repeat noisily on
2693 error.
2694 (tsubst_nested_requirement): Likewise.
2695 (get_constraint_error_location): Allow missing context.
2696 (diagnose_atomic_constraint): Diagnose non-bool constraint here.
2697 (satisfy_atom): Not here. Only diagnose non-constant when noisy.
2698
2699 2020-03-24 Jason Merrill <jason@redhat.com>
2700
2701 * pt.c (any_template_parm_r): Look into the type of a non-type
2702 template parm.
2703
2704 2020-03-24 Jason Merrill <jason@redhat.com>
2705
2706 * cp-tree.h (cp_expr): When constructing from an expr and a
2707 location, call protected_set_expr_location.
2708
2709 2020-03-23 Patrick Palka <ppalka@redhat.com>
2710
2711 PR c++/93805
2712 * except.c (maybe_noexcept_warning): Add TODO.
2713 * method.c (walk_field_subobs): Pass tf_none to expr_noexcept_p.
2714
2715 2020-03-23 nathans <nathan@acm.org>
2716
2717 PR c++/94044
2718 * tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
2719 operand.
2720
2721 2020-03-21 Patrick Palka <ppalka@redhat.com>
2722
2723 PR c++/94066
2724 * constexpr.c (reduced_constant_expression_p) [CONSTRUCTOR]: Properly
2725 handle unions without an initializer.
2726 (cxx_eval_component_reference): Emit a different diagnostic when the
2727 constructor element corresponding to a union member is NULL.
2728 (cxx_eval_bare_aggregate): When constructing a union, always set the
2729 active union member before evaluating the initializer. Relax assertion
2730 that verifies the index of the constructor element we're initializing
2731 hasn't been changed.
2732 (cxx_eval_store_expression): Diagnose changing the active union member
2733 while the union is in the process of being initialized. After setting
2734 an active union member, clear CONSTRUCTOR_NO_CLEARING on the underlying
2735 CONSTRUCTOR.
2736 (cxx_eval_constant_expression) [PLACEHOLDER_EXPR]: Don't re-reduce a
2737 CONSTRUCTOR returned by lookup_placeholder.
2738
2739 2020-03-20 Patrick Palka <ppalka@redhat.com>
2740
2741 * cxx-pretty-print.c (pp_cxx_parameter_mapping): Make extern. Move
2742 the "[with ]" bits to here from ...
2743 (pp_cxx_atomic_constraint): ... here.
2744 * cxx-pretty-print.h (pp_cxx_parameter_mapping): Declare.
2745 * error.c (rebuild_concept_check): Delete.
2746 (print_concept_check_info): Print the dependent form of the constraint and the
2747 preferably substituted parameter mapping alongside it.
2748
2749 2020-03-19 Jason Merrill <jason@redhat.com>
2750
2751 PR c++/94175
2752 * cp-gimplify.c (simple_empty_class_p): Look through
2753 SIMPLE_TARGET_EXPR_P.
2754 (cp_gimplify_expr) [MODIFY_EXPR]: Likewise.
2755 [RETURN_EXPR]: Avoid producing 'return *retval;'.
2756 * call.c (build_call_a): Strip TARGET_EXPR from empty class arg.
2757 * cp-tree.h (SIMPLE_TARGET_EXPR_P): Check that TARGET_EXPR_INITIAL
2758 is non-null.
2759
2760 2020-03-19 Jakub Jelinek <jakub@redhat.com>
2761
2762 PR c++/93931
2763 * parser.c (cp_parser_omp_var_list_no_open): Call process_outer_var_ref
2764 on outer_automatic_var_p decls.
2765 * cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also for
2766 capture proxy decls.
2767
2768 2020-03-18 Nathan Sidwell <nathan@acm.org>
2769
2770 PR c++/94147 - mangling of lambdas assigned to globals
2771 * parser.c (cp_parser_init_declarator): Namespace-scope variables
2772 provide a lambda scope.
2773 * tree.c (no_linkage_check): Lambdas with a variable for extra
2774 scope have a linkage from the variable.
2775
2776 2020-03-18 Jakub Jelinek <jakub@redhat.com>
2777
2778 * constraint.cc (resolve_function_concept_check, subsumes_constraints,
2779 strictly_subsumes): Fix up duplicated word issue in a comment.
2780 * coroutines.cc (build_init_or_final_await, captures_temporary):
2781 Likewise.
2782 * logic.cc (dnf_size_r, cnf_size_r): Likewise.
2783 * pt.c (append_type_to_template_for_access_check): Likewise.
2784
2785 PR c++/91759
2786 * decl.c (grokfndecl): Restore old diagnostics about deduction
2787 guide declared in different scope if in_namespace is NULL_TREE.
2788
2789 2020-03-17 Jakub Jelinek <jakub@redhat.com>
2790
2791 PR c++/90995
2792 * parser.c (cp_parser_enum_specifier): Use temp_override for
2793 parser->colon_corrects_to_scope_p, replace goto out with return.
2794 If scoped enum or enum with underlying type is not followed by
2795 { or ;, call cp_parser_commit_to_tentative_parse before calling
2796 cp_parser_error and make sure to return error_mark_node instead of
2797 NULL_TREE. Formatting fixes.
2798
2799 2020-03-17 Ville Voutilainen <ville.voutilainen@gmail.com>
2800
2801 PR c++/94197
2802 * method.c (assignable_expr): Use cp_unevaluated.
2803 (is_xible_helper): Push a non-deferred access check for
2804 the stub objects created by assignable_expr and constructible_expr.
2805
2806 2020-03-17 Jakub Jelinek <jakub@redhat.com>
2807
2808 * pt.c (tsubst): Fix up duplicated word issue in a diagnostic message.
2809 (lookup_template_class_1, tsubst_expr): Fix up duplicated word issue
2810 in a comment.
2811 * parser.c (cp_parser_statement, cp_parser_linkage_specification,
2812 cp_parser_placeholder_type_specifier,
2813 cp_parser_constraint_requires_parens): Likewise.
2814 * name-lookup.c (suggest_alternative_in_explicit_scope): Likewise.
2815
2816 2020-03-15 Iain Sandoe <iain@sandoe.co.uk>
2817
2818 * coroutines.cc (co_await_expander): Fix indentation.
2819
2820 2020-03-14 Jason Merrill <jason@redhat.com>
2821
2822 PR c++/92068
2823 * pt.c (process_partial_specialization): Error rather than crash on
2824 extra pack expansion.
2825
2826 2020-03-14 Jason Merrill <jason@redhat.com>
2827
2828 PR c++/92909
2829 * pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
2830 DECL_ORIGINAL_TYPE of a typedef.
2831
2832 2020-03-14 Jason Merrill <jason@redhat.com>
2833
2834 PR c++/93248
2835 * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
2836 substituting DECL_ARGUMENTS.
2837
2838 2020-03-14 Jakub Jelinek <jakub@redhat.com>
2839
2840 * logic.cc (formula::formula): Change "a an" to "an" in a comment.
2841 * parser.c (cp_debug_parser): Change "a an" to "an" in a string
2842 literal.
2843
2844 2020-03-13 Patrick Palka <ppalka@redhat.com>
2845
2846 PR c++/67960
2847 * call.c (build_over_call): Use a warning_sentinel to disable
2848 warn_deprecated_decl before calling build_addr_func.
2849
2850 2020-03-12 Jakub Jelinek <jakub@redhat.com>
2851
2852 PR c++/94124
2853 * decl.c (reshape_init_array_1): Don't unshare constructor if there
2854 aren't any trailing zero elts, otherwise only unshare the first
2855 nelts.
2856
2857 2020-03-11 Jason Merrill <jason@redhat.com>
2858
2859 PR c++/93907
2860 * constraint.cc (tsubst_parameter_mapping): Canonicalize type
2861 argument.
2862
2863 2020-03-11 Marek Polacek <polacek@redhat.com>
2864 Jason Merrill <jason@redhat.com>
2865
2866 PR c++/94074 - wrong modifying const object error for COMPONENT_REF.
2867 * constexpr.c (cref_has_const_field): New function.
2868 (modifying_const_object_p): Consider a COMPONENT_REF
2869 const only if any of its fields are const.
2870 (cxx_eval_store_expression): Mark a CONSTRUCTOR of a const type
2871 as readonly after its initialization has been done.
2872
2873 2020-03-10 Marek Polacek <polacek@redhat.com>
2874
2875 PR c++/94124 - wrong conversion error with non-viable overload.
2876 * decl.c (reshape_init_array_1): Unshare a constructor if we
2877 stripped trailing zero-initializers.
2878
2879 2020-03-10 Jason Merrill <jason@redhat.com>
2880
2881 PR c++/93901
2882 * pt.c (maybe_instantiate_noexcept): Always update clones.
2883
2884 2020-03-10 Jason Merrill <jason@redhat.com>
2885
2886 PR c++/93596
2887 * pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
2888
2889 2020-03-10 Jason Merrill <jason@redhat.com>
2890
2891 PR c++/93922
2892 PR c++/94041
2893 PR c++/52320
2894 PR c++/66139
2895 * cp-gimplify.c (cp_gimplify_init_expr): Partially revert patch for
2896 66139: Don't split_nonconstant_init. Remove pre_p parameter.
2897
2898 2020-03-09 Marek Polacek <polacek@redhat.com>
2899
2900 PR c++/92031 - bogus taking address of rvalue error.
2901 PR c++/91465 - ICE with template codes in check_narrowing.
2902 PR c++/93870 - wrong error when converting template non-type arg.
2903 PR c++/94068 - ICE with template codes in check_narrowing.
2904 * call.c (convert_like_real): Return IMPLICIT_CONV_EXPR
2905 in a template when not ck_identity and we're dealing with a class.
2906 (convert_like_real) <case ck_ref_bind>: Return IMPLICIT_CONV_EXPR
2907 in a template if we need a temporary.
2908 * decl.c (compute_array_index_type_loc): Remove
2909 instantiate_non_dependent_expr_sfinae call. Call
2910 fold_non_dependent_expr instead of maybe_constant_value.
2911 (build_explicit_specifier): Don't instantiate or create a sentinel
2912 before converting the expression.
2913 * except.c (build_noexcept_spec): Likewise.
2914 * pt.c (convert_nontype_argument): Don't build IMPLICIT_CONV_EXPR.
2915 Set IMPLICIT_CONV_EXPR_NONTYPE_ARG if that's what
2916 build_converted_constant_expr returned.
2917 * typeck2.c (check_narrowing): Call fold_non_dependent_expr instead
2918 of maybe_constant_value.
2919
2920 2020-03-09 Jakub Jelinek <jakub@redhat.com>
2921
2922 PR c++/94067
2923 Revert
2924 2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
2925
2926 * constexpr.c (cxx_eval_constant_expression): Do not handle
2927 RROTATE_EXPR and LROTATE_EXPR.
2928
2929 2020-03-09 Marek Polacek <polacek@redhat.com>
2930
2931 PR c++/94050 - ABI issue with alignas on armv7hl.
2932 * class.c (layout_class_type): Don't replace a class's
2933 CLASSTYPE_AS_BASE if their TYPE_USER_ALIGN don't match.
2934
2935 2020-03-09 Bin Cheng <bin.cheng@linux.alibaba.com>
2936
2937 * coroutines.cc (build_actor_fn): Factor out code inserting the
2938 default return_void call to...
2939 (morph_fn_to_coro): ...here, also hoist local var declarations.
2940
2941 2020-03-08 Patrick Palka <ppalka@redhat.com>
2942
2943 PR c++/93729
2944 * call.c (convert_like_real): Check complain before emitting an error
2945 about binding a bit-field to a reference.
2946
2947 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
2948 [TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
2949 TYPE_NAME.
2950
2951 2020-03-06 Nathan Sidwell <nathan@acm.org>
2952
2953 PR c++/94027
2954 * mangle.c (find_substitution): Don't call same_type_p on template
2955 args that cannot match.
2956
2957 2020-03-04 Martin Sebor <msebor@redhat.com>
2958
2959 PR c++/90938
2960 * tree.c (type_initializer_zero_p): Fail for structs initialized
2961 with non-structs.
2962
2963 2020-03-04 Jason Merrill <jason@redhat.com>
2964
2965 PR c++/90432
2966 * init.c (perform_member_init): Don't do aggregate initialization of
2967 empty field.
2968 * constexpr.c (cx_check_missing_mem_inits): Don't enforce
2969 initialization of empty field.
2970
2971 2020-03-04 Martin Liska <mliska@suse.cz>
2972
2973 * method.c: Wrap array in ctor with braces in order
2974 to silent clang warnings.
2975
2976 2020-03-03 Jason Merrill <jason@redhat.com>
2977 Marek Polacek <polacek@redhat.com>
2978
2979 PR c++/90505 - mismatch in template argument deduction.
2980 * pt.c (tsubst): Don't reduce the template level of template
2981 parameters when tf_partial.
2982
2983 2020-03-03 Jakub Jelinek <jakub@redhat.com>
2984
2985 PR c++/93998
2986 * constexpr.c (cxx_eval_constant_expression)
2987 <case TARGET_EXPR, case SAVE_EXPR>: Don't record anything if
2988 *non_constant_p is true.
2989
2990 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
2991
2992 * coroutines.cc (captures_temporary): Strip component_ref
2993 to its base object.
2994
2995 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
2996
2997 * coroutines.cc (finish_co_await_expr): Build co_await_expr
2998 with unknown_type_node.
2999 (finish_co_yield_expr): Ditto.
3000 *pt.c (type_dependent_expression_p): Set co_await/yield_expr
3001 with unknown type as dependent.
3002
3003 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
3004
3005 * coroutines.cc (struct local_var_info): Adjust to remove the
3006 reference to the captured var, and just to note that this is a
3007 lambda capture proxy.
3008 (transform_local_var_uses): Handle lambda captures specially.
3009 (struct param_frame_data): Add a visited set.
3010 (register_param_uses): Also check for param uses in lambda
3011 capture proxies.
3012 (struct local_vars_frame_data): Remove captures list.
3013 (register_local_var_uses): Handle lambda capture proxies by
3014 noting and bypassing them.
3015 (morph_fn_to_coro): Update to remove lifetime extension of
3016 lambda capture-by-copy vars.
3017
3018 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
3019
3020 * coroutines.cc (build_co_await): Do not build frame
3021 awaitable proxy vars when the co_await expression is
3022 a function parameter or local var.
3023 (co_await_expander): Do not initialise a frame var with
3024 itself.
3025 (transform_await_expr): Only substitute the awaitable
3026 frame var if it's needed.
3027 (register_awaits): Do not make frame copies for param
3028 or local vars that are awaitables.
3029
3030 2020-02-28 Jason Merrill <jason@redhat.com>
3031
3032 Implement P2092R0, Disambiguating Nested-Requirements
3033 * parser.c (cp_parser_requirement_parameter_list): Pass
3034 CP_PARSER_FLAGS_TYPENAME_OPTIONAL.
3035
3036 * call.c (build_user_type_conversion_1): Don't look at the second
3037 conversion of a non-viable candidate.
3038
3039 2020-02-28 Jakub Jelinek <jakub@redhat.com>
3040
3041 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
3042 * typeck.c (cp_build_addr_expr_1): Allow taking address of immediate
3043 functions in unevaluated contexts.
3044
3045 2020-02-27 Nathan Sidwell <nathan@acm.org>
3046
3047 PR c++/93933
3048 * pt.c (template_args_equal): Pass ARGUMENT_PACKS through to
3049 cp_tree_equal.
3050 * tree.c (cp_tree_equal): Compare ARGUMENT_PACKS here,
3051 * typeck.c (comptypes): Assert we don't get any argument packs.
3052
3053 * class.c (adjust_clone_args): Correct arg-checking assert.
3054 * typeck.c (comptypes): Assert not nulls.
3055
3056 2020-02-26 Marek Polacek <polacek@redhat.com>
3057
3058 PR c++/93789 - ICE with invalid array bounds.
3059 * decl.c (compute_array_index_type_loc): Don't use the folded
3060 size when folding cleared TREE_CONSTANT.
3061
3062 2020-02-26 Iain Sandoe <iain@sandoe.co.uk>
3063
3064 * class.c (classtype_has_non_deleted_copy_ctor): New.
3065 * coroutines.cc (struct param_info): Keep track of params
3066 that are references, and cache the original type and whether
3067 the DTOR is trivial.
3068 (build_actor_fn): Handle param copies always, and adjust the
3069 handling for references.
3070 (register_param_uses): Only handle uses here.
3071 (classtype_has_non_deleted_copy_ctor): New.
3072 (morph_fn_to_coro): Adjust param copy handling to match n4849
3073 by reordering ahead of the promise CTOR and always making a
3074 frame copy, even if the param is unused in the coroutine body.
3075 * cp-tree.h (classtype_has_non_deleted_copy_ctor): New.
3076
3077 2020-02-26 Patrick Palka <ppalka@redhat.com>
3078
3079 * constraint.cc (finish_constraint_binary_op): Set expr's location range
3080 to the range of its operands.
3081 (satisfy_atom): Pass MAP instead of ARGS to diagnose_atomic_constraint.
3082 (diagnose_trait_expr): Take the instantiated parameter mapping MAP
3083 instead of the corresponding template arguments ARGS and adjust body
3084 accordingly.
3085 (diagnose_requires_expr): Likewise.
3086 (diagnose_atomic_constraint): Likewise. When printing an atomic
3087 constraint expression, print the instantiated parameter mapping
3088 alongside it.
3089 * cxx-pretty-print.cc (cxx_pretty_printer::expression)
3090 [NONTYPE_ARGUMENT_PACK]: Print braces around a NONTYPE_ARGUMENT_PACK.
3091 (cxx_pretty_printer::type_id): Handle TYPE_ARGUMENT_PACK.
3092
3093 2020-02-26 Marek Polacek <polacek@redhat.com>
3094
3095 PR c++/93676 - value-init crash in template.
3096 * init.c (build_new_1): Don't call build_vec_init in a template.
3097
3098 2020-02-26 Marek Polacek <polacek@redhat.com>
3099
3100 PR c++/93862 - ICE with static_cast when converting from int[].
3101 * call.c (reference_compatible_p): No longer static.
3102 * cp-tree.h (reference_compatible_p): Declare.
3103 * typeck.c (build_static_cast_1): Use reference_compatible_p instead
3104 of reference_related_p.
3105
3106 2020-02-26 Marek Polacek <polacek@redhat.com>
3107
3108 PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
3109 * constexpr.c (reduced_constant_expression_p): Don't crash on a null
3110 field.
3111
3112 2020-02-24 Martin Sebor <msebor@redhat.com>
3113
3114 PR c++/93804
3115 * parser.c (cp_parser_check_class_key): Avoid issuing -Wredundant-tags
3116 in shared C/C++ code in headers.
3117 Remove a duplicate hunk of code.
3118
3119 2020-02-24 Marek Polacek <polacek@redhat.com>
3120
3121 PR c++/93869 - ICE with -Wmismatched-tags.
3122 * parser.c (cp_parser_check_class_key): Check class_key earlier.
3123
3124 2020-02-24 Marek Polacek <polacek@redhat.com>
3125
3126 PR c++/93712 - ICE with ill-formed array list-initialization.
3127 * call.c (next_conversion): Return NULL for ck_aggr.
3128 (build_aggr_conv): Set u.expr instead of u.next.
3129 (build_array_conv): Likewise.
3130 (build_complex_conv): Likewise.
3131 (conv_get_original_expr): Handle ck_aggr.
3132
3133 2020-02-24 Jakub Jelinek <jakub@redhat.com>
3134
3135 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
3136 * call.c (build_over_call): Don't evaluate immediate functions in
3137 unevaluated operands.
3138
3139 2020-02-24 Jason Merrill <jason@redhat.com>
3140
3141 P0780R2: Resolve lambda init-capture pack grammar.
3142 * parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than
3143 ...&x=y.
3144
3145 2020-02-22 Marek Polacek <polacek@redhat.com>
3146
3147 PR c++/93882
3148 * decl.c (grokdeclarator): Use %qs in a diagnostic message.
3149
3150 2020-02-21 Martin Sebor <msebor@redhat.com>
3151
3152 PR gcov-profile/93753
3153 * class.c (check_flexarrays): Tighten up a test for potential members
3154 of anonymous structs or unions.
3155
3156 2020-02-20 Martin Sebor <msebor@redhat.com>
3157
3158 PR c++/93801
3159 * parser.c (cp_parser_check_class_key): Only handle true C++ class-keys.
3160
3161 2020-02-20 Martin Liska <mliska@suse.cz>
3162
3163 PR translation/93841
3164 * config/or1k/or1k.opt: Remove superfluous word.
3165 * doc/invoke.texi: Likewise.
3166
3167 2020-02-20 Martin Liska <mliska@suse.cz>
3168
3169 PR translation/93838
3170 * parser.c (cp_parser_decl_specifier_seq): Remove trailing space.
3171
3172 2020-02-19 Marek Polacek <polacek@redhat.com>
3173
3174 PR c++/93169 - wrong-code with a non-constexpr constructor.
3175 * constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY
3176 on constant CONSTRUCTORs.
3177
3178 2020-02-15 Marek Polacek <polacek@redhat.com>
3179
3180 PR c++/93710 - poor diagnostic for array initializer.
3181 * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
3182 for an error call.
3183
3184 2020-02-15 Jason Merrill <jason@redhat.com>
3185
3186 PR c++/92556
3187 * pt.c (any_template_parm_r): Look into lambda body.
3188
3189 PR c++/92583
3190 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
3191
3192 2020-02-14 Jakub Jelinek <jakub@redhat.com>
3193
3194 PR c++/61414
3195 * class.c (enum_min_precision): Change prec type from int to int &.
3196
3197 PR libstdc++/92906
3198 * cp-tree.h (enum cp_tree_index): Add CPTI_FALLBACK_DFLOAT32_TYPE,
3199 CPTI_FALLBACK_DFLOAT64_TYPE and CPTI_FALLBACK_DFLOAT128_TYPE.
3200 (fallback_dfloat32_type, fallback_dfloat64_type,
3201 fallback_dfloat128_type): Define.
3202 * mangle.c (write_builtin_type): Handle fallback_dfloat*_type like
3203 dfloat*_type_node.
3204 * rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
3205 is disabled for compatibility.
3206
3207 2020-02-13 Jason Merrill <jason@redhat.com>
3208
3209 PR c++/93713
3210 * name-lookup.c (matching_fn_p): A function does not match a
3211 template.
3212
3213 PR c++/93643
3214 PR c++/91476
3215 * tree.c (decl_linkage): Always lk_none for locals.
3216
3217 2020-02-12 Jason Merrill <jason@redhat.com>
3218
3219 PR c++/92583
3220 PR c++/92654
3221 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
3222 * pt.c (find_parameter_packs_r): Not here.
3223
3224 2020-02-12 Iain Sandoe <iain@sandoe.co.uk>
3225
3226 * coroutines.cc (build_actor_fn): Implement deallocation function
3227 selection per n4849, dcl.fct.def.coroutine bullet 12.
3228 (morph_fn_to_coro): Implement allocation function selection per
3229 n4849, dcl.fct.def.coroutine bullets 9 and 10.
3230
3231 2020-02-12 Marek Polacek <polacek@redhat.com>
3232
3233 PR c++/93684 - ICE-on-invalid with broken attribute.
3234 * parser.c (cp_parser_std_attribute): Peek a token first before
3235 consuming it.
3236
3237 2020-02-11 Jason Merrill <jason@redhat.com>
3238
3239 PR c++/93675
3240 * class.c (add_implicitly_declared_members): Use do_friend.
3241 * method.c (implicitly_declare_fn): Fix friend handling.
3242 (decl_remember_implicit_trigger_p): New.
3243 (synthesize_method): Use it.
3244 * decl2.c (mark_used): Use it.
3245
3246 2020-02-11 Jason Merrill <jason@redhat.com>
3247
3248 PR c++/93650
3249 PR c++/90691
3250 * constexpr.c (maybe_constant_value): Correct earlier change.
3251 (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
3252 * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.
3253
3254 2020-02-12 Patrick Palka <ppalka@redhat.com>
3255
3256 PR c++/69448
3257 PR c++/80471
3258 * type-utils.h (find_type_usage): Refactor to take a tree * and to
3259 return a tree *, and update documentation accordingly.
3260 * pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
3261 decltype(auto) node.
3262 (make_constrained_decltype_auto): No need to explicitly set
3263 AUTO_IS_DECLTYPE anymore.
3264 (splice_late_return_type): Use find_type_usage to find and
3265 replace a possibly nested auto node instead of using is_auto.
3266 Check test for is_auto into an assert when deciding whether
3267 to late_return_type.
3268 (type_uses_auto): Adjust the call to find_type_usage.
3269 * parser.c (cp_parser_decltype): No need to explicitly set
3270 AUTO_IS_DECLTYPE anymore.
3271
3272 * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
3273 (dump_simple_decl): Handle standard concept definitions as well as
3274 variable concept definitions.
3275
3276 2020-02-10 Jakub Jelinek <jakub@redhat.com>
3277
3278 PR other/93641
3279 * error.c (dump_decl_name): Fix up last argument to strncmp.
3280
3281 2020-02-10 Jason Merrill <jason@redhat.com>
3282
3283 PR c++/93618
3284 * tree.c (array_of_unknown_bound_p): New.
3285 * init.c (perform_member_init): Do nothing for flexible arrays.
3286
3287 2020-02-09 Jakub Jelinek <jakub@redhat.com>
3288
3289 PR c++/93633
3290 * constexpr.c (cxx_eval_constant_expression): If obj is heap var with
3291 ARRAY_TYPE, use the element type. Punt if objtype after that is not
3292 a class type.
3293
3294 2020-02-08 Jason Merrill <jason@redhat.com>
3295
3296 PR c++/90691
3297 * expr.c (fold_for_warn): Call maybe_constant_value.
3298 * constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
3299 (maybe_constant_value): Add uid_sensitive parm.
3300 (get_fundef_copy): Don't copy if it's true.
3301 (cxx_eval_call_expression): Don't instantiate if it's true.
3302 (cxx_eval_outermost_constant_expr): Likewise.
3303
3304 PR c++/92852
3305 * constexpr.c (maybe_constant_value): Don't unshare if the cached
3306 value is the same as the argument.
3307
3308 * typeck.c (maybe_warn_about_returning_address_of_local): Add
3309 location parameter.
3310
3311 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
3312 if appropriate.
3313
3314 2020-02-08 Jakub Jelinek <jakub@redhat.com>
3315
3316 PR c++/93549
3317 * constexpr.c (find_array_ctor_elt): If last element has no index,
3318 for flag_checking verify all elts have no index. If i is within the
3319 elts, return it directly, if it is right after the last elt, append
3320 if NULL index, otherwise force indexes on all elts.
3321 (cxx_eval_store_expression): Allow cep->index to be NULL.
3322
3323 2020-02-07 Marek Polacek <polacek@redhat.com>
3324
3325 PR c++/92947 - Paren init of aggregates in unevaluated context.
3326 * call.c (build_new_method_call_1): Don't check
3327 cp_unevaluated_operand. Check the return value of digest_init.
3328
3329 2020-02-06 Jason Merrill <jason@redhat.com>
3330
3331 PR c++/92654
3332 * tree.c (cp_walk_subtrees): Walk into type template arguments.
3333 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
3334 instead of TYPE_ALIAS_P.
3335 * pt.c (push_template_decl_real): Likewise.
3336 (find_parameter_packs_r): Likewise. Remove dead code.
3337 * error.c (find_typenames_r): Remove dead code.
3338
3339 2020-02-06 Jason Merrill <jason@redhat.com>
3340
3341 PR c++/92517
3342 * parser.c (cp_parser_constraint_primary_expression): Do the main
3343 parse non-tentatively.
3344
3345 2020-02-06 Marek Polacek <polacek@redhat.com>
3346
3347 PR c++/93597 - ICE with lambda in operator function.
3348 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
3349
3350 2020-02-05 Jason Merrill <jason@redhat.com>
3351
3352 PR c++/93140
3353 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
3354 handling of TREE_CHAIN for empty pack.
3355
3356 2020-02-05 Jakub Jelinek <jakub@redhat.com>
3357
3358 PR c++/93557
3359 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
3360 prior to passing it to c_build_vec_convert.
3361
3362 2020-02-05 Marek Polacek <polacek@redhat.com>
3363
3364 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
3365 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
3366 TREE_SIDE_EFFECTS.
3367
3368 2020-02-05 Jason Merrill <jason@redhat.com>
3369
3370 PR c++/92593
3371 * decl.c (grokdeclarator): Reject field of current class type even
3372 in a template.
3373
3374 2020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
3375
3376 * coroutines.cc (maybe_promote_captured_temps): Increase the index
3377 number for temporary variables' name.
3378
3379 2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
3380
3381 * coroutines.cc (build_co_await): Call convert_from_reference
3382 to wrap co_await_expr with indirect_ref which avoid
3383 reference/non-reference type confusion.
3384
3385 (co_await_expander): Sink to call_expr if await_resume
3386 is wrapped by indirect_ref.
3387
3388 2020-02-04 Jason Merrill <jason@redhat.com>
3389
3390 PR c++/93551
3391 * constraint.cc (satisfy_declaration_constraints): Check return
3392 value of push_tinst_level.
3393
3394 PR c++/90951
3395 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
3396 elements instead of value-initializing them.
3397
3398 PR c++/86917
3399 * init.c (perform_member_init): Simplify.
3400 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
3401 flexarray.
3402 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
3403
3404 2020-02-04 Iain Sandoe <iain@sandoe.co.uk>
3405
3406 * coroutines.cc (find_promise_type): Delete unused forward
3407 declaration.
3408 (struct coroutine_info): Add a bool for no promise type error.
3409 (coro_promise_type_found_p): Only emit the error for a missing
3410 promise once in each affected coroutine.
3411
3412 2020-02-03 Jason Merrill <jason@redhat.com>
3413
3414 PR c++/66477
3415 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
3416 defer loading the value of a reference.
3417
3418 2020-02-03 Jason Merrill <jason@redhat.com>
3419
3420 PR c++/91953
3421 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
3422 empty class type.
3423 [COMPONENT_REF]: A member function reference doesn't use the object
3424 as an rvalue.
3425
3426 2020-02-03 Iain Sandoe <iain@sandoe.co.uk>
3427
3428 PR c++/93458
3429 * coroutines.cc (struct coroutine_info): Add a bool flag to note
3430 that we emitted an error for a bad function return type.
3431 (get_coroutine_info): Tolerate an unset info table in case of
3432 missing traits.
3433 (find_coro_traits_template_decl): In case of error or if we didn't
3434 find a type template, note we emitted the error and suppress
3435 duplicates.
3436 (find_coro_handle_template_decl): Likewise.
3437 (instantiate_coro_traits): Only check for error_mark_node in the
3438 return from lookup_qualified_name.
3439 (coro_promise_type_found_p): Reorder initialization so that we check
3440 for the traits and their usability before allocation of the info
3441 table. Check for a suitable return type and emit a diagnostic for
3442 here instead of relying on the lookup machinery. This allows the
3443 error to have a better location, and means we can suppress multiple
3444 copies.
3445 (coro_function_valid_p): Re-check for a valid promise (and thus the
3446 traits) before proceeding. Tolerate missing info as a fatal error.
3447
3448 2020-02-03 Jason Merrill <jason@redhat.com>
3449
3450 PR c++/88256
3451 * cp-gimplify.c (predeclare_vla): New.
3452 (cp_genericize_r) [NOP_EXPR]: Call it.
3453
3454 2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
3455
3456 * coroutines.cc (transform_await_wrapper): Set actor funcion as
3457 new context of label_decl.
3458 (build_actor_fn): Fill new field of await_xform_data.
3459
3460 2020-02-02 Marek Polacek <polacek@redhat.com>
3461
3462 PR c++/93530 - ICE on invalid alignas in a template.
3463 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
3464 decl_attributes.
3465
3466 2020-01-31 Jason Merrill <jason@redhat.com>
3467
3468 PR c++/86216
3469 * semantics.c (process_outer_var_ref): Capture VLAs even in
3470 unevaluated context.
3471
3472 PR c++/14179
3473 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
3474 non-aggregate elements.
3475 (reshape_init_array): Add first_initializer_p parm.
3476 (reshape_init_r): Change first_initializer_p from bool to tree.
3477 (reshape_init): Pass init to it.
3478
3479 PR c++/14179
3480 * parser.c (cp_parser_initializer_list): Suppress location wrappers
3481 after 256 elements.
3482
3483 2020-01-29 Jason Merrill <jason@redhat.com>
3484
3485 PR c++/82521
3486 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
3487 the expression was dependent before substitution.
3488
3489 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
3490
3491 * coroutines.cc (act_des_fn): New.
3492 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
3493 Access promise via actor function's frame pointer argument.
3494 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
3495
3496 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
3497
3498 * coroutines.cc (co_await_expander): Handle type conversion case.
3499
3500 2020-01-29 Jason Merrill <jason@redhat.com>
3501
3502 PR c++/90333
3503 PR c++/89640
3504 PR c++/60503
3505 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
3506 a trailing return type.
3507 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
3508 parens.
3509
3510 2020-01-29 Marek Polacek <polacek@redhat.com>
3511
3512 PR c++/91754 - Fix template arguments comparison with class NTTP.
3513 * pt.c (class_nttp_const_wrapper_p): New.
3514 (template_args_equal): See through class_nttp_const_wrapper_p
3515 arguments.
3516
3517 2020-01-29 Marek Polacek <polacek@redhat.com>
3518
3519 PR c++/92948 - Fix class NTTP with template arguments.
3520 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
3521 converting a value-dependent expression to a class type.
3522 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
3523 as the result of the tsubst_copy call.
3524
3525 2020-01-29 Jakub Jelinek <jakub@redhat.com>
3526
3527 PR c++/91118
3528 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
3529 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
3530
3531 2020-01-28 Jason Merrill <jason@redhat.com>
3532
3533 PR c++/93442
3534 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
3535
3536 PR c++/93477
3537 PR c++/91476
3538 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
3539
3540 PR c++/90546
3541 * call.c (build_user_type_conversion_1): Allow a template conversion
3542 returning an rvalue reference to bind directly to an lvalue.
3543
3544 PR c++/90731
3545 * decl.c (grokdeclarator): Propagate eh spec from typedef.
3546
3547 2020-01-28 Martin Liska <mliska@suse.cz>
3548
3549 PR c++/92440
3550 * pt.c (redeclare_class_template): Group couple of
3551 errors and inform messages with auto_diagnostic_group.
3552
3553 2020-01-28 Martin Liska <mliska@suse.cz>
3554
3555 PR c++/92440
3556 * pt.c (redeclare_class_template): Use inform
3557 for the second location.
3558
3559 2020-01-27 Jason Merrill <jason@redhat.com>
3560
3561 PR c++/90966
3562 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
3563
3564 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
3565
3566 PR c++/93443
3567 * coroutines.cc (morph_fn_to_coro): Check the ramp return
3568 value when it is constructed from the 'get return object'.
3569
3570 2020-01-27 Nathan Sidwell <nathan@acm.org>
3571
3572 PR c++/91826
3573 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
3574
3575 2020-01-26 Jason Merrill <jason@redhat.com>
3576
3577 PR c++/90992
3578 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
3579 temporarily enable -Wsystem-headers. Change second warning to
3580 conditional inform.
3581
3582 PR c++/90997
3583 * semantics.c (finish_call_expr): Don't call
3584 instantiate_non_dependent_expr before warn_for_memset.
3585
3586 2020-01-25 Marek Polacek <polacek@redhat.com>
3587
3588 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
3589 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
3590 dynamic_cast diagnostic.
3591
3592 2020-01-24 Jason Merrill <jason@redhat.com>
3593
3594 PR c++/93400 - ICE with constrained friend.
3595 * constraint.cc (maybe_substitute_reqs_for): New.
3596 * decl.c (function_requirements_equivalent_p): Call it.
3597 * pt.c (tsubst_friend_function): Only substitute
3598 TEMPLATE_PARMS_CONSTRAINTS.
3599 (tsubst_template_parms): Copy constraints.
3600
3601 2020-01-24 Jason Merrill <jason@redhat.com>
3602
3603 PR c++/93279 - ICE with lambda in member operator.
3604 * name-lookup.c (maybe_save_operator_binding): Don't remember
3605 class-scope bindings.
3606
3607 2020-01-24 Jason Merrill <jason@redhat.com>
3608
3609 PR c++/93377 - ICE with member alias in constraint.
3610 * pt.c (any_template_parm_r): Look at template arguments for all
3611 aliases, not only alias templates.
3612
3613 2020-01-24 Marek Polacek <polacek@redhat.com>
3614
3615 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
3616 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
3617
3618 2020-01-24 Jason Merrill <jason@redhat.com>
3619
3620 PR c++/92852 - ICE with generic lambda and reference var.
3621 * constexpr.c (maybe_constant_value): Likewise.
3622
3623 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
3624
3625 PR c++/92804
3626 * parser.c (cp_parser_nested_name_specifier_opt): Properly
3627 diagnose concept-ids.
3628
3629 2020-01-23 Jason Merrill <jason@redhat.com>
3630
3631 PR c++/93331 - ICE with __builtin_strchr.
3632 * constexpr.c (cxx_eval_builtin_function_call): Use the original
3633 argument if we didn't manage to extract a STRING_CST.
3634
3635 PR c++/93345 - ICE with defaulted dtor and template.
3636 PR c++/33799
3637 * decl.c (cxx_maybe_build_cleanup): Don't try to set
3638 throwing_cleanup in a template.
3639
3640 2020-01-22 Marek Polacek <polacek@redhat.com>
3641
3642 PR c++/92907 - noexcept does not consider "const" in member functions.
3643 * g++.dg/cpp0x/noexcept56.C: New test.
3644
3645 2020-01-22 Marek Polacek <polacek@redhat.com>
3646
3647 PR c++/93324 - ICE with -Wall on constexpr if.
3648 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
3649
3650 2020-01-22 Patrick Palka <ppalka@redhat.com>
3651
3652 * constraint.cc (get_mapped_args): Avoid using auto_vec
3653 as a vector element. Release the vectors inside the lists
3654 vector.
3655 * parser.c (cp_literal_operator_id): Free the buffer.
3656
3657 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
3658
3659 * coroutines.cc (finish_co_await_expr): Add error check on return
3660 value of build_co_await.
3661 (finish_co_yield_expr,): Ditto.
3662
3663 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
3664
3665 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
3666 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
3667 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
3668
3669 2020-01-21 Jason Merrill <jason@redhat.com>
3670
3671 PR c++/60855 - ICE with sizeof VLA capture.
3672 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
3673
3674 PR c++/90732 - ICE with VLA capture and generic lambda.
3675 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
3676
3677 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
3678 Bin Cheng <bin.cheng@linux.alibaba.com>
3679
3680 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
3681 from complete_type_or_else.
3682 (register_param_uses): Likewise.
3683 (build_co_await): Do not try to use complete_type_or_else for void
3684 types, otherwise for incomplete types, check for NULL return from
3685 complete_type_or_else.
3686
3687 2020-01-21 Jason Merrill <jason@redhat.com>
3688
3689 PR c++/91476 - anon-namespace reference temp clash between TUs.
3690 * decl2.c (copy_linkage): Factor out of get_guard.
3691 * call.c (make_temporary_var_for_ref_to_temp): Use it.
3692 * decl.c (cp_finish_decomp): Use it.
3693 (cp_finish_decl): determine_visibility sooner.
3694
3695 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
3696
3697 * coroutines.cc (finish_co_await_expr): Set return value flag.
3698 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
3699
3700 2020-01-19 Jason Merrill <jason@redhat.com>
3701
3702 PR c++/33799 - destroy return value, take 2.
3703 * cp-tree.h (current_retval_sentinel): New macro.
3704 (struct language_function): Add throwing_cleanup bitfield.
3705 * decl.c (cxx_maybe_build_cleanup): Set it.
3706 * except.c (maybe_set_retval_sentinel)
3707 (maybe_splice_retval_cleanup): New functions.
3708 * parser.c (cp_parser_compound_statement): Call
3709 maybe_splice_retval_cleanup.
3710 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
3711
3712 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
3713
3714 2020-01-18 Jakub Jelinek <jakub@redhat.com>
3715
3716 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
3717 but non-NO_DOLLAR_IN_LABEL case build.
3718
3719 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
3720
3721 * Make-lang.in: Add coroutines.o.
3722 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
3723 (DECL_COROUTINE_P): New.
3724 * lex.c (init_reswords): Enable keywords when the coroutine flag
3725 is set,
3726 * operators.def (co_await): New operator.
3727 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
3728 (op_error): Likewise.
3729 (build_new_op_1): Likewise.
3730 (build_new_function_call): Validate coroutine builtin arguments.
3731 * constexpr.c (potential_constant_expression_1): Handle
3732 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
3733 * coroutines.cc: New file.
3734 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
3735 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
3736 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
3737 * cp-tree.h (coro_validate_builtin_call): New.
3738 * decl.c (emit_coro_helper): New.
3739 (finish_function): Handle the case when a function is found to
3740 be a coroutine, perform the outlining and emit the outlined
3741 functions. Set a bit to signal that this is a coroutine component.
3742 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
3743 (cp_parser_unary_expression): Handle co_await.
3744 (cp_parser_assignment_expression): Handle co_yield.
3745 (cp_parser_statement): Handle RID_CO_RETURN.
3746 (cp_parser_jump_statement): Handle co_return.
3747 (cp_parser_operator): Handle co_await operator.
3748 (cp_parser_yield_expression): New.
3749 (cp_parser_required_error): Handle RT_CO_YIELD.
3750 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
3751 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
3752 CO_RETURN_EXPRs.
3753 * tree.c (cp_walk_subtrees): Likewise.
3754
3755 2020-01-17 Jason Merrill <jason@redhat.com>
3756
3757 PR c++/92531 - ICE with noexcept(lambda).
3758 * pt.c (uses_template_parms): Don't try to enumerate all the
3759 expression cases.
3760
3761 2020-01-17 Jakub Jelinek <jakub@redhat.com>
3762
3763 PR c++/93228
3764 * parser.c (cp_parser_template_name): Look up deprecated attribute
3765 in DECL_TEMPLATE_RESULT or its type's attributes.
3766
3767 2020-01-16 Jason Merrill <jason@redhat.com>
3768
3769 PR c++/93286 - ICE with __is_constructible and variadic template.
3770 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
3771 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
3772
3773 PR c++/93280 - ICE with aggregate assignment and DMI.
3774 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
3775 * typeck2.c (digest_nsdmi_init): Not here.
3776
3777 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
3778
3779 PR c++/91073
3780 * cp-tree.h (is_constrained_auto): New.
3781 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
3782 handle concept-check expressions; take a cp_decl_specifier_seq*
3783 instead of a bool.
3784 (cp_parser_condition): Update call.
3785 (cp_parser_simple_declaration): Likewise.
3786 (cp_parser_placeholder_type_specifier): Correctly handle
3787 concept-check expressions.
3788
3789 2020-01-15 Jason Merrill <jason@redhat.com>
3790
3791 Revert
3792 PR c++/33799 - destroy return value if local cleanup throws.
3793 * cp-tree.h (current_retval_sentinel): New macro.
3794 * decl.c (start_preparsed_function): Set up cleanup for retval.
3795 * typeck.c (check_return_expr): Set current_retval_sentinel.
3796
3797 PR c++/93257 - consteval void function.
3798 * constexpr.c (verify_constant): Allow void_node.
3799
3800 PR c++/92871 - bad code with xvalue and GNU ?: extension.
3801 * call.c (prevent_lifetime_extension): New.
3802 (build_conditional_expr_1): Use it.
3803
3804 2020-01-14 Nathan Sidwell <nathan@acm.org>
3805
3806 PR c++/90916
3807 * pt.c (retrieve_specialization): Use get_template_info, not open
3808 coding access.
3809
3810 PR c++/90916
3811 * pt.c (retrieve_specialization): Get the TI from the decl or the
3812 classtype as appropriate.
3813
3814 2020-01-14 David Malcolm <dmalcolm@redhat.com>
3815
3816 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
3817 New static constant.
3818 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
3819 (struct named_label_hash::empty_zero_p): Likewise.
3820 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
3821
3822 2020-01-14 Jason Merrill <jason@redhat.com>
3823
3824 PR c++/92590 - wrong handling of inherited default ctor.
3825 * class.c (add_method): A constrained inherited ctor doesn't hide an
3826 implicit derived ctor.
3827 Revert:
3828 PR c++/92552 - ICE with inherited constrained default ctor.
3829 * pt.c (instantiate_class_template_1): Copy
3830 TYPE_HAS_USER_CONSTRUCTOR.
3831 PR c++/91930 - ICE with constrained inherited default ctor.
3832 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
3833 for inherited constructor.
3834 PR c++/92594 - ICE with inherited trivial default ctor.
3835 * method.c (trivial_fn_p): Treat an inherited default constructor
3836 like a normal default constructor.
3837
3838 PR c++/92594 - ICE with inherited trivial default ctor.
3839 * method.c (trivial_fn_p): Treat an inherited default constructor
3840 like a normal default constructor.
3841
3842 PR c++/92009 - ICE with punning of typeid.
3843 * rtti.c (get_tinfo_desc): Call xref_basetypes.
3844 * constexpr.c (cxx_fold_indirect_ref): Don't strip
3845 REINTERPRET_CAST_P.
3846
3847 2020-01-13 Jason Merrill <jason@redhat.com>
3848
3849 PR c++/92746 - ICE with noexcept of function concept check.
3850 * except.c (check_noexcept_r): Handle concept-check.
3851
3852 PR c++/92582 - ICE with member template as requirement.
3853 * pt.c (struct find_template_parameter_info): Add ctx_parms.
3854 (any_template_parm_r): Handle TEMPLATE_DECL.
3855 (find_template_parameters): Take parms instead of their depth.
3856 * constraint.cc (build_parameter_mapping): Pass them.
3857
3858 PR c++/33799 - destroy return value if local cleanup throws.
3859 * cp-tree.h (current_retval_sentinel): New macro.
3860 * decl.c (start_preparsed_function): Set up cleanup for retval.
3861 * typeck.c (check_return_expr): Set current_retval_sentinel.
3862
3863 PR c++/93238 - short right-shift with enum.
3864 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
3865
3866 2020-01-10 Jason Merrill <jason@redhat.com>
3867
3868 * typeck.c (cp_build_binary_op): Restore short_shift code.
3869
3870 PR c++/93143 - incorrect tree sharing with constexpr.
3871 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
3872 CONSTRUCTORs are already unshared.
3873
3874 PR c++/93173 - incorrect tree sharing.
3875 PR c++/93033
3876 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
3877 copy_if_shared after cp_genericize_tree.
3878 * typeck2.c (split_nonconstant_init): Don't unshare here.
3879
3880 2020-01-08 Jason Merrill <jason@redhat.com>
3881
3882 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
3883 TARGET_EXPR_DIRECT_INIT_P.
3884 * constexpr.c (cxx_eval_constant_expression): Likewise.
3885
3886 2020-01-08 Jason Merrill <jason@redhat.com>
3887
3888 PR c++/91369 - constexpr destructor and member initializer.
3889 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
3890 when not preevaluating.
3891
3892 2020-01-08 Jason Merrill <jason@redhat.com>
3893
3894 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
3895 support.
3896
3897 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
3898
3899 * init.c (build_new): Add location_t parameter and use it throughout.
3900 (build_raw_new_expr): Likewise.
3901 * parser.c (cp_parser_new_expression): Pass the combined_loc.
3902 * pt.c (tsubst_copy_and_build): Adjust call.
3903 * cp-tree.h: Update declarations.
3904
3905 2020-01-07 Jason Merrill <jason@redhat.com>
3906
3907 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
3908 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
3909 explicit class visibility for a template.
3910
3911 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
3912
3913 * mangle.c (mangle_type_attribute_p): New function, split out from...
3914 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
3915 that contain a space.
3916
3917 2020-01-07 Jakub Jelinek <jakub@redhat.com>
3918
3919 PR c++/91369
3920 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
3921 member, initialize it to zero in ctor.
3922 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
3923 a heap object. Don't cache calls to functions which allocate some
3924 heap objects and don't deallocate them or deallocate some heap
3925 objects they didn't allocate.
3926
3927 2020-01-06 Jason Merrill <jason@redhat.com>
3928
3929 PR c++/92552 - ICE with inherited constrained default ctor.
3930 * pt.c (instantiate_class_template_1): Copy
3931 TYPE_HAS_USER_CONSTRUCTOR.
3932 * class.c (one_inherited_ctor): Don't set it here.
3933
3934 2020-01-06 Andrew Sutton <asutton@lock3software.com>
3935
3936 PR c++/92739 - parsing requires clause with attributes.
3937 * parser.c (cp_parser_constraint_requires_parens): Exclude
3938 attributes as postfix expressions.
3939
3940 2020-01-05 Jakub Jelinek <jakub@redhat.com>
3941
3942 PR c++/93138
3943 * parser.c (cp_parser_check_class_key): Disable access checks for the
3944 simple name lookup.
3945 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
3946 !warn_redundant_tags.
3947
3948 2010-01-05 Jakub Jelinek <jakub@redhat.com>
3949
3950 PR c++/93046
3951 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
3952 TARGET_EXPR if it has been gimplified already.
3953
3954 2020-01-03 Jason Merrill <jason@redhat.com>
3955
3956 PR c++/93033 - incorrect tree node sharing with array init.
3957 * typeck2.c (split_nonconstant_init): Unshare non-decl.
3958 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
3959
3960 2020-01-02 Jason Merrill <jason@redhat.com>
3961
3962 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
3963 C++17.
3964
3965 2020-01-02 Jakub Jelinek <jakub@redhat.com>
3966
3967 PR c/90677
3968 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
3969 has not been found, rather than error_mark_node.
3970
3971 2020-01-01 Jakub Jelinek <jakub@redhat.com>
3972
3973 Update copyright years.
3974 \f
3975 Copyright (C) 2020 Free Software Foundation, Inc.
3976
3977 Copying and distribution of this file, with or without modification,
3978 are permitted in any medium without royalty provided the copyright
3979 notice and this notice are preserved.