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