aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/ChangeLog
blob: 3f379d0d996e78c1d8101df872ecf9032ffe2a99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
2020-01-22  Jun Ma <JunMa@linux.alibaba.com>

	* coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
	(lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
	(build_co_await): Use lookup_awaitable_member instead of lookup_member.

2020-01-21  Jason Merrill  <jason@redhat.com>

	PR c++/60855 - ICE with sizeof VLA capture.
	* lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.

	PR c++/90732 - ICE with VLA capture and generic lambda.
	* pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.

2020-01-21  Iain Sandoe  <iain@sandoe.co.uk>
	    Bin Cheng  <bin.cheng@linux.alibaba.com>

	* coroutines.cc (coro_promise_type_found_p): Check for NULL return
	from complete_type_or_else.
	(register_param_uses): Likewise.
	(build_co_await): Do not try to use complete_type_or_else for void
	types, otherwise for incomplete types, check for NULL return from
	complete_type_or_else.

2020-01-21  Jason Merrill  <jason@redhat.com>

	PR c++/91476 - anon-namespace reference temp clash between TUs.
	* decl2.c (copy_linkage): Factor out of get_guard.
	* call.c (make_temporary_var_for_ref_to_temp): Use it.
	* decl.c (cp_finish_decomp): Use it.
	(cp_finish_decl): determine_visibility sooner.

2020-01-21  Bin Cheng  <bin.cheng@linux.alibaba.com>

	* coroutines.cc (finish_co_await_expr): Set return value flag.
	(finish_co_yield_expr, morph_fn_to_coro): Ditto.

2020-01-19  Jason Merrill  <jason@redhat.com>

	PR c++/33799 - destroy return value, take 2.
	* cp-tree.h (current_retval_sentinel): New macro.
	(struct language_function): Add throwing_cleanup bitfield.
	* decl.c (cxx_maybe_build_cleanup): Set it.
	* except.c (maybe_set_retval_sentinel)
	(maybe_splice_retval_cleanup): New functions.
	* parser.c (cp_parser_compound_statement): Call
	maybe_splice_retval_cleanup.
	* typeck.c (check_return_expr): Call maybe_set_retval_sentinel.

	* parser.c (cp_parser_lambda_body): Use cp_parser_function_body.

2020-01-18  Jakub Jelinek  <jakub@redhat.com>

	* coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
	but non-NO_DOLLAR_IN_LABEL case build.

2020-01-18  Iain Sandoe  <iain@sandoe.co.uk>

	* Make-lang.in: Add coroutines.o.
	* cp-tree.h (lang_decl-fn): coroutine_p, new bit.
	(DECL_COROUTINE_P): New.
	* lex.c (init_reswords): Enable keywords when the coroutine flag
	is set,
	* operators.def (co_await): New operator.
	* call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
	(op_error): Likewise.
	(build_new_op_1): Likewise.
	(build_new_function_call): Validate coroutine builtin arguments.
	* constexpr.c (potential_constant_expression_1): Handle
	CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
	* coroutines.cc: New file.
	* cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
	CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
	* cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
	* cp-tree.h (coro_validate_builtin_call): New.
	* decl.c (emit_coro_helper): New.
	(finish_function): Handle the case when a function is found to
	be a coroutine, perform the outlining and emit the outlined
	functions. Set a bit to signal that this is a coroutine component.
	* parser.c (enum required_token): New enumeration RT_CO_YIELD.
	(cp_parser_unary_expression): Handle co_await.
	(cp_parser_assignment_expression): Handle co_yield.
	(cp_parser_statement): Handle RID_CO_RETURN.
	(cp_parser_jump_statement): Handle co_return.
	(cp_parser_operator): Handle co_await operator.
	(cp_parser_yield_expression): New.
	(cp_parser_required_error): Handle RT_CO_YIELD.
	* pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
	(tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
	CO_RETURN_EXPRs.
	* tree.c (cp_walk_subtrees): Likewise.

2020-01-17  Jason Merrill  <jason@redhat.com>

	PR c++/92531 - ICE with noexcept(lambda).
	* pt.c (uses_template_parms): Don't try to enumerate all the
	expression cases.

2020-01-17  Jakub Jelinek  <jakub@redhat.com>

	PR c++/93228
	* parser.c (cp_parser_template_name): Look up deprecated attribute
	in DECL_TEMPLATE_RESULT or its type's attributes.

2020-01-16  Jason Merrill  <jason@redhat.com>

	PR c++/93286 - ICE with __is_constructible and variadic template.
	* pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
	(tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.

	PR c++/93280 - ICE with aggregate assignment and DMI.
	* init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
	* typeck2.c (digest_nsdmi_init): Not here.

2020-01-15  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/91073
	* cp-tree.h (is_constrained_auto): New.
	* parser.c (cp_parser_maybe_commit_to_declaration): Correctly
	handle concept-check expressions; take a cp_decl_specifier_seq*
	instead of a bool.
	(cp_parser_condition): Update call.
	(cp_parser_simple_declaration): Likewise.
	(cp_parser_placeholder_type_specifier): Correctly handle
	concept-check expressions.

2020-01-15  Jason Merrill  <jason@redhat.com>

	Revert
	PR c++/33799 - destroy return value if local cleanup throws.
	* cp-tree.h (current_retval_sentinel): New macro.
	* decl.c (start_preparsed_function): Set up cleanup for retval.
	* typeck.c (check_return_expr): Set current_retval_sentinel.

	PR c++/93257 - consteval void function.
	* constexpr.c (verify_constant): Allow void_node.

	PR c++/92871 - bad code with xvalue and GNU ?: extension.
	* call.c (prevent_lifetime_extension): New.
	(build_conditional_expr_1): Use it.

2020-01-14  Nathan Sidwell  <nathan@acm.org>

	PR c++/90916
	* pt.c (retrieve_specialization): Use get_template_info, not open
	coding access.

	PR c++/90916
	* pt.c (retrieve_specialization): Get the TI from the decl or the
	classtype as appropriate.

2020-01-14  David Malcolm  <dmalcolm@redhat.com>

	* cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
	New static constant.
	* cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
	(struct named_label_hash::empty_zero_p): Likewise.
	* decl2.c (mangled_decl_hash::empty_zero_p): Likewise.

2020-01-14  Jason Merrill  <jason@redhat.com>

	PR c++/92590 - wrong handling of inherited default ctor.
	* class.c (add_method): A constrained inherited ctor doesn't hide an
	implicit derived ctor.
	Revert:
	PR c++/92552 - ICE with inherited constrained default ctor.
	* pt.c (instantiate_class_template_1): Copy
	TYPE_HAS_USER_CONSTRUCTOR.
	PR c++/91930 - ICE with constrained inherited default ctor.
	* name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
	for inherited constructor.
	PR c++/92594 - ICE with inherited trivial default ctor.
	* method.c (trivial_fn_p): Treat an inherited default constructor
	like a normal default constructor.

	PR c++/92594 - ICE with inherited trivial default ctor.
	* method.c (trivial_fn_p): Treat an inherited default constructor
	like a normal default constructor.

	PR c++/92009 - ICE with punning of typeid.
	* rtti.c (get_tinfo_desc): Call xref_basetypes.
	* constexpr.c (cxx_fold_indirect_ref): Don't strip
	REINTERPRET_CAST_P.

2020-01-13  Jason Merrill  <jason@redhat.com>

	PR c++/92746 - ICE with noexcept of function concept check.
	* except.c (check_noexcept_r): Handle concept-check.

	PR c++/92582 - ICE with member template as requirement.
	* pt.c (struct find_template_parameter_info): Add ctx_parms.
	(any_template_parm_r): Handle TEMPLATE_DECL.
	(find_template_parameters): Take parms instead of their depth.
	* constraint.cc (build_parameter_mapping): Pass them.

	PR c++/33799 - destroy return value if local cleanup throws.
	* cp-tree.h (current_retval_sentinel): New macro.
	* decl.c (start_preparsed_function): Set up cleanup for retval.
	* typeck.c (check_return_expr): Set current_retval_sentinel.

	PR c++/93238 - short right-shift with enum.
	* typeck.c (cp_build_binary_op): Use folded op1 for short_shift.

2020-01-10  Jason Merrill  <jason@redhat.com>

	* typeck.c (cp_build_binary_op): Restore short_shift code.

	PR c++/93143 - incorrect tree sharing with constexpr.
	* constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
	CONSTRUCTORs are already unshared.

	PR c++/93173 - incorrect tree sharing.
	PR c++/93033
	* cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
	copy_if_shared after cp_genericize_tree.
	* typeck2.c (split_nonconstant_init): Don't unshare here.

2020-01-08  Jason Merrill  <jason@redhat.com>

	* cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
	TARGET_EXPR_DIRECT_INIT_P.
	* constexpr.c (cxx_eval_constant_expression): Likewise.

2020-01-08  Jason Merrill  <jason@redhat.com>

	PR c++/91369 - constexpr destructor and member initializer.
	* constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
	when not preevaluating.

2020-01-08  Jason Merrill  <jason@redhat.com>

	* constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
	support.

2020-01-07  Paolo Carlini  <paolo.carlini@oracle.com>

	* init.c (build_new): Add location_t parameter and use it throughout.
	(build_raw_new_expr): Likewise.
	* parser.c (cp_parser_new_expression): Pass the combined_loc.
	* pt.c (tsubst_copy_and_build): Adjust call.
	* cp-tree.h: Update declarations.

2020-01-07  Jason Merrill  <jason@redhat.com>

	PR c++/47877 - -fvisibility-inlines-hidden and member templates.
	* decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
	explicit class visibility for a template.

2020-01-07  Richard Sandiford  <richard.sandiford@arm.com>

	* mangle.c (mangle_type_attribute_p): New function, split out from...
	(write_CV_qualifiers_for_type): ...here.  Don't mangle attributes
	that contain a space.

2020-01-07  Jakub Jelinek  <jakub@redhat.com>

	PR c++/91369
	* constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
	member, initialize it to zero in ctor.
	(cxx_eval_call_expression): Bump heap_dealloc_count when deleting
	a heap object.  Don't cache calls to functions which allocate some
	heap objects and don't deallocate them or deallocate some heap
	objects they didn't allocate.

2020-01-06  Jason Merrill  <jason@redhat.com>

	PR c++/92552 - ICE with inherited constrained default ctor.
	* pt.c (instantiate_class_template_1): Copy
	TYPE_HAS_USER_CONSTRUCTOR.
	* class.c (one_inherited_ctor): Don't set it here.

2020-01-06  Andrew Sutton  <asutton@lock3software.com>

	PR c++/92739 - parsing requires clause with attributes.
	* parser.c (cp_parser_constraint_requires_parens): Exclude
	attributes as postfix expressions.

2020-01-05  Jakub Jelinek  <jakub@redhat.com>

	PR c++/93138
	* parser.c (cp_parser_check_class_key): Disable access checks for the
	simple name lookup.
	(cp_parser_maybe_warn_enum_key): Likewise.  Return early if
	!warn_redundant_tags.

2010-01-05  Jakub Jelinek  <jakub@redhat.com>

	PR c++/93046
	* cp-gimplify.c (cp_gimplify_init_expr): Don't look through
	TARGET_EXPR if it has been gimplified already.

2020-01-03  Jason Merrill  <jason@redhat.com>

	PR c++/93033 - incorrect tree node sharing with array init.
	* typeck2.c (split_nonconstant_init): Unshare non-decl.
	* cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.

2020-01-02  Jason Merrill  <jason@redhat.com>

	* pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
	C++17.

2020-01-02  Jakub Jelinek  <jakub@redhat.com>

	PR c/90677
	* cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
	has not been found, rather than error_mark_node.

2020-01-01  Jakub Jelinek  <jakub@redhat.com>

	Update copyright years.

Copyright (C) 2020 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.