1 2020-01-31 Jason Merrill <jason@redhat.com>
4 * parser.c (cp_parser_initializer_list): Suppress location wrappers
7 2020-01-29 Jason Merrill <jason@redhat.com>
10 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
11 the expression was dependent before substitution.
13 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
15 * coroutines.cc (act_des_fn): New.
16 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
17 Access promise via actor function's frame pointer argument.
18 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
20 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
22 * coroutines.cc (co_await_expander): Handle type conversion case.
24 2020-01-29 Jason Merrill <jason@redhat.com>
29 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
30 a trailing return type.
31 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
34 2020-01-29 Marek Polacek <polacek@redhat.com>
36 PR c++/91754 - Fix template arguments comparison with class NTTP.
37 * pt.c (class_nttp_const_wrapper_p): New.
38 (template_args_equal): See through class_nttp_const_wrapper_p
41 2020-01-29 Marek Polacek <polacek@redhat.com>
43 PR c++/92948 - Fix class NTTP with template arguments.
44 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
45 converting a value-dependent expression to a class type.
46 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
47 as the result of the tsubst_copy call.
49 2020-01-29 Jakub Jelinek <jakub@redhat.com>
52 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
53 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
55 2020-01-28 Jason Merrill <jason@redhat.com>
58 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
62 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
65 * call.c (build_user_type_conversion_1): Allow a template conversion
66 returning an rvalue reference to bind directly to an lvalue.
69 * decl.c (grokdeclarator): Propagate eh spec from typedef.
71 2020-01-28 Martin Liska <mliska@suse.cz>
74 * pt.c (redeclare_class_template): Group couple of
75 errors and inform messages with auto_diagnostic_group.
77 2020-01-28 Martin Liska <mliska@suse.cz>
80 * pt.c (redeclare_class_template): Use inform
81 for the second location.
83 2020-01-27 Jason Merrill <jason@redhat.com>
86 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
88 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
91 * coroutines.cc (morph_fn_to_coro): Check the ramp return
92 value when it is constructed from the 'get return object'.
94 2020-01-27 Nathan Sidwell <nathan@acm.org>
97 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
99 2020-01-26 Jason Merrill <jason@redhat.com>
102 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
103 temporarily enable -Wsystem-headers. Change second warning to
107 * semantics.c (finish_call_expr): Don't call
108 instantiate_non_dependent_expr before warn_for_memset.
110 2020-01-25 Marek Polacek <polacek@redhat.com>
112 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
113 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
114 dynamic_cast diagnostic.
116 2020-01-24 Jason Merrill <jason@redhat.com>
118 PR c++/93400 - ICE with constrained friend.
119 * constraint.cc (maybe_substitute_reqs_for): New.
120 * decl.c (function_requirements_equivalent_p): Call it.
121 * pt.c (tsubst_friend_function): Only substitute
122 TEMPLATE_PARMS_CONSTRAINTS.
123 (tsubst_template_parms): Copy constraints.
125 2020-01-24 Jason Merrill <jason@redhat.com>
127 PR c++/93279 - ICE with lambda in member operator.
128 * name-lookup.c (maybe_save_operator_binding): Don't remember
129 class-scope bindings.
131 2020-01-24 Jason Merrill <jason@redhat.com>
133 PR c++/93377 - ICE with member alias in constraint.
134 * pt.c (any_template_parm_r): Look at template arguments for all
135 aliases, not only alias templates.
137 2020-01-24 Marek Polacek <polacek@redhat.com>
139 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
140 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
142 2020-01-24 Jason Merrill <jason@redhat.com>
144 PR c++/92852 - ICE with generic lambda and reference var.
145 * constexpr.c (maybe_constant_value): Likewise.
147 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
150 * parser.c (cp_parser_nested_name_specifier_opt): Properly
151 diagnose concept-ids.
153 2020-01-23 Jason Merrill <jason@redhat.com>
155 PR c++/93331 - ICE with __builtin_strchr.
156 * constexpr.c (cxx_eval_builtin_function_call): Use the original
157 argument if we didn't manage to extract a STRING_CST.
159 PR c++/93345 - ICE with defaulted dtor and template.
161 * decl.c (cxx_maybe_build_cleanup): Don't try to set
162 throwing_cleanup in a template.
164 2020-01-22 Marek Polacek <polacek@redhat.com>
166 PR c++/92907 - noexcept does not consider "const" in member functions.
167 * g++.dg/cpp0x/noexcept56.C: New test.
169 2020-01-22 Marek Polacek <polacek@redhat.com>
171 PR c++/93324 - ICE with -Wall on constexpr if.
172 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
174 2020-01-22 Patrick Palka <ppalka@redhat.com>
176 * constraint.cc (get_mapped_args): Avoid using auto_vec
177 as a vector element. Release the vectors inside the lists
179 * parser.c (cp_literal_operator_id): Free the buffer.
181 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
183 * coroutines.cc (finish_co_await_expr): Add error check on return
184 value of build_co_await.
185 (finish_co_yield_expr,): Ditto.
187 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
189 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
190 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
191 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
193 2020-01-21 Jason Merrill <jason@redhat.com>
195 PR c++/60855 - ICE with sizeof VLA capture.
196 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
198 PR c++/90732 - ICE with VLA capture and generic lambda.
199 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
201 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
202 Bin Cheng <bin.cheng@linux.alibaba.com>
204 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
205 from complete_type_or_else.
206 (register_param_uses): Likewise.
207 (build_co_await): Do not try to use complete_type_or_else for void
208 types, otherwise for incomplete types, check for NULL return from
209 complete_type_or_else.
211 2020-01-21 Jason Merrill <jason@redhat.com>
213 PR c++/91476 - anon-namespace reference temp clash between TUs.
214 * decl2.c (copy_linkage): Factor out of get_guard.
215 * call.c (make_temporary_var_for_ref_to_temp): Use it.
216 * decl.c (cp_finish_decomp): Use it.
217 (cp_finish_decl): determine_visibility sooner.
219 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
221 * coroutines.cc (finish_co_await_expr): Set return value flag.
222 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
224 2020-01-19 Jason Merrill <jason@redhat.com>
226 PR c++/33799 - destroy return value, take 2.
227 * cp-tree.h (current_retval_sentinel): New macro.
228 (struct language_function): Add throwing_cleanup bitfield.
229 * decl.c (cxx_maybe_build_cleanup): Set it.
230 * except.c (maybe_set_retval_sentinel)
231 (maybe_splice_retval_cleanup): New functions.
232 * parser.c (cp_parser_compound_statement): Call
233 maybe_splice_retval_cleanup.
234 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
236 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
238 2020-01-18 Jakub Jelinek <jakub@redhat.com>
240 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
241 but non-NO_DOLLAR_IN_LABEL case build.
243 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
245 * Make-lang.in: Add coroutines.o.
246 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
247 (DECL_COROUTINE_P): New.
248 * lex.c (init_reswords): Enable keywords when the coroutine flag
250 * operators.def (co_await): New operator.
251 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
252 (op_error): Likewise.
253 (build_new_op_1): Likewise.
254 (build_new_function_call): Validate coroutine builtin arguments.
255 * constexpr.c (potential_constant_expression_1): Handle
256 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
257 * coroutines.cc: New file.
258 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
259 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
260 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
261 * cp-tree.h (coro_validate_builtin_call): New.
262 * decl.c (emit_coro_helper): New.
263 (finish_function): Handle the case when a function is found to
264 be a coroutine, perform the outlining and emit the outlined
265 functions. Set a bit to signal that this is a coroutine component.
266 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
267 (cp_parser_unary_expression): Handle co_await.
268 (cp_parser_assignment_expression): Handle co_yield.
269 (cp_parser_statement): Handle RID_CO_RETURN.
270 (cp_parser_jump_statement): Handle co_return.
271 (cp_parser_operator): Handle co_await operator.
272 (cp_parser_yield_expression): New.
273 (cp_parser_required_error): Handle RT_CO_YIELD.
274 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
275 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
277 * tree.c (cp_walk_subtrees): Likewise.
279 2020-01-17 Jason Merrill <jason@redhat.com>
281 PR c++/92531 - ICE with noexcept(lambda).
282 * pt.c (uses_template_parms): Don't try to enumerate all the
285 2020-01-17 Jakub Jelinek <jakub@redhat.com>
288 * parser.c (cp_parser_template_name): Look up deprecated attribute
289 in DECL_TEMPLATE_RESULT or its type's attributes.
291 2020-01-16 Jason Merrill <jason@redhat.com>
293 PR c++/93286 - ICE with __is_constructible and variadic template.
294 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
295 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
297 PR c++/93280 - ICE with aggregate assignment and DMI.
298 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
299 * typeck2.c (digest_nsdmi_init): Not here.
301 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
304 * cp-tree.h (is_constrained_auto): New.
305 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
306 handle concept-check expressions; take a cp_decl_specifier_seq*
308 (cp_parser_condition): Update call.
309 (cp_parser_simple_declaration): Likewise.
310 (cp_parser_placeholder_type_specifier): Correctly handle
311 concept-check expressions.
313 2020-01-15 Jason Merrill <jason@redhat.com>
316 PR c++/33799 - destroy return value if local cleanup throws.
317 * cp-tree.h (current_retval_sentinel): New macro.
318 * decl.c (start_preparsed_function): Set up cleanup for retval.
319 * typeck.c (check_return_expr): Set current_retval_sentinel.
321 PR c++/93257 - consteval void function.
322 * constexpr.c (verify_constant): Allow void_node.
324 PR c++/92871 - bad code with xvalue and GNU ?: extension.
325 * call.c (prevent_lifetime_extension): New.
326 (build_conditional_expr_1): Use it.
328 2020-01-14 Nathan Sidwell <nathan@acm.org>
331 * pt.c (retrieve_specialization): Use get_template_info, not open
335 * pt.c (retrieve_specialization): Get the TI from the decl or the
336 classtype as appropriate.
338 2020-01-14 David Malcolm <dmalcolm@redhat.com>
340 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
342 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
343 (struct named_label_hash::empty_zero_p): Likewise.
344 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
346 2020-01-14 Jason Merrill <jason@redhat.com>
348 PR c++/92590 - wrong handling of inherited default ctor.
349 * class.c (add_method): A constrained inherited ctor doesn't hide an
350 implicit derived ctor.
352 PR c++/92552 - ICE with inherited constrained default ctor.
353 * pt.c (instantiate_class_template_1): Copy
354 TYPE_HAS_USER_CONSTRUCTOR.
355 PR c++/91930 - ICE with constrained inherited default ctor.
356 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
357 for inherited constructor.
358 PR c++/92594 - ICE with inherited trivial default ctor.
359 * method.c (trivial_fn_p): Treat an inherited default constructor
360 like a normal default constructor.
362 PR c++/92594 - ICE with inherited trivial default ctor.
363 * method.c (trivial_fn_p): Treat an inherited default constructor
364 like a normal default constructor.
366 PR c++/92009 - ICE with punning of typeid.
367 * rtti.c (get_tinfo_desc): Call xref_basetypes.
368 * constexpr.c (cxx_fold_indirect_ref): Don't strip
371 2020-01-13 Jason Merrill <jason@redhat.com>
373 PR c++/92746 - ICE with noexcept of function concept check.
374 * except.c (check_noexcept_r): Handle concept-check.
376 PR c++/92582 - ICE with member template as requirement.
377 * pt.c (struct find_template_parameter_info): Add ctx_parms.
378 (any_template_parm_r): Handle TEMPLATE_DECL.
379 (find_template_parameters): Take parms instead of their depth.
380 * constraint.cc (build_parameter_mapping): Pass them.
382 PR c++/33799 - destroy return value if local cleanup throws.
383 * cp-tree.h (current_retval_sentinel): New macro.
384 * decl.c (start_preparsed_function): Set up cleanup for retval.
385 * typeck.c (check_return_expr): Set current_retval_sentinel.
387 PR c++/93238 - short right-shift with enum.
388 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
390 2020-01-10 Jason Merrill <jason@redhat.com>
392 * typeck.c (cp_build_binary_op): Restore short_shift code.
394 PR c++/93143 - incorrect tree sharing with constexpr.
395 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
396 CONSTRUCTORs are already unshared.
398 PR c++/93173 - incorrect tree sharing.
400 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
401 copy_if_shared after cp_genericize_tree.
402 * typeck2.c (split_nonconstant_init): Don't unshare here.
404 2020-01-08 Jason Merrill <jason@redhat.com>
406 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
407 TARGET_EXPR_DIRECT_INIT_P.
408 * constexpr.c (cxx_eval_constant_expression): Likewise.
410 2020-01-08 Jason Merrill <jason@redhat.com>
412 PR c++/91369 - constexpr destructor and member initializer.
413 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
414 when not preevaluating.
416 2020-01-08 Jason Merrill <jason@redhat.com>
418 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
421 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
423 * init.c (build_new): Add location_t parameter and use it throughout.
424 (build_raw_new_expr): Likewise.
425 * parser.c (cp_parser_new_expression): Pass the combined_loc.
426 * pt.c (tsubst_copy_and_build): Adjust call.
427 * cp-tree.h: Update declarations.
429 2020-01-07 Jason Merrill <jason@redhat.com>
431 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
432 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
433 explicit class visibility for a template.
435 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
437 * mangle.c (mangle_type_attribute_p): New function, split out from...
438 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
439 that contain a space.
441 2020-01-07 Jakub Jelinek <jakub@redhat.com>
444 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
445 member, initialize it to zero in ctor.
446 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
447 a heap object. Don't cache calls to functions which allocate some
448 heap objects and don't deallocate them or deallocate some heap
449 objects they didn't allocate.
451 2020-01-06 Jason Merrill <jason@redhat.com>
453 PR c++/92552 - ICE with inherited constrained default ctor.
454 * pt.c (instantiate_class_template_1): Copy
455 TYPE_HAS_USER_CONSTRUCTOR.
456 * class.c (one_inherited_ctor): Don't set it here.
458 2020-01-06 Andrew Sutton <asutton@lock3software.com>
460 PR c++/92739 - parsing requires clause with attributes.
461 * parser.c (cp_parser_constraint_requires_parens): Exclude
462 attributes as postfix expressions.
464 2020-01-05 Jakub Jelinek <jakub@redhat.com>
467 * parser.c (cp_parser_check_class_key): Disable access checks for the
469 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
470 !warn_redundant_tags.
472 2010-01-05 Jakub Jelinek <jakub@redhat.com>
475 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
476 TARGET_EXPR if it has been gimplified already.
478 2020-01-03 Jason Merrill <jason@redhat.com>
480 PR c++/93033 - incorrect tree node sharing with array init.
481 * typeck2.c (split_nonconstant_init): Unshare non-decl.
482 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
484 2020-01-02 Jason Merrill <jason@redhat.com>
486 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
489 2020-01-02 Jakub Jelinek <jakub@redhat.com>
492 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
493 has not been found, rather than error_mark_node.
495 2020-01-01 Jakub Jelinek <jakub@redhat.com>
497 Update copyright years.
499 Copyright (C) 2020 Free Software Foundation, Inc.
501 Copying and distribution of this file, with or without modification,
502 are permitted in any medium without royalty provided the copyright
503 notice and this notice are preserved.