]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/cp/ChangeLog
2019-01-30 Jerry DeLisle <jvdelisle@gcc.gnu.org>
[thirdparty/gcc.git] / gcc / cp / ChangeLog
CommitLineData
9b0e9786 12019-01-30 Jakub Jelinek <jakub@redhat.com>
2
3 PR c++/88988
4 * lambda.c (is_capture_proxy): Don't return true for
5 DECL_OMP_PRIVATIZED_MEMBER artificial vars.
6
7066144a 72019-01-30 Marek Polacek <polacek@redhat.com>
8
9 PR c++/89119 - ICE with value-initialization in template.
10 * pt.c (tsubst_copy_and_build): Handle RANGE_EXPR.
11
64e3499e 122019-01-29 Jason Merrill <jason@redhat.com>
13
14 PR c++/86943 - wrong code converting lambda to function pointer.
15 * lambda.c (maybe_add_lambda_conv_op): Use a template-id in the
16 call. Only forward parms for decltype.
17 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Handle CALL_FROM_THUNK_P
18 specially.
19 * typeck.c (check_return_expr): Don't mess with a thunk call.
20
107cba11 212019-01-28 Jason Merrill <jason@redhat.com>
22
23 PR c++/89089 - ICE with [[no_unique_address]].
24 PR c++/88865 - wrong layout with [[no_unique_address]].
25 * class.c (check_field_decls): A potentially-overlapping field makes
26 the class non-layout-POD, but not non-empty.
27 (end_of_class): Always consider empty data members.
28 (layout_class_type): Set DECL_SIZE for empty fields.
29
44da2a17 302019-01-28 Marek Polacek <polacek@redhat.com>
31
32 PR c++/88358 - name wrongly treated as type.
33 * parser.c (cp_parser_direct_declarator): Don't assume a qualified-id
34 in parameter-list is a type if the function's declarator-id is not
35 qualified.
36
1d41b42f 372019-01-27 Marek Polacek <polacek@redhat.com>
38
b7feeace 39 PR c++/88815 - narrowing conversion lost in decltype.
40 PR c++/78244 - narrowing conversion in template not detected.
41 * cp-tree.h (CONSTRUCTOR_IS_DEPENDENT): New.
42 * pt.c (instantiation_dependent_r): Consider a CONSTRUCTOR with
43 CONSTRUCTOR_IS_DEPENDENT instantiation-dependent.
44 * semantics.c (finish_compound_literal): When the compound literal
45 isn't instantiation-dependent and the type isn't type-dependent,
46 fall back to the normal processing. Set CONSTRUCTOR_IS_DEPENDENT.
47
1d41b42f 48 PR c++/89024 - ICE with incomplete enum type.
49 * call.c (standard_conversion): When converting an
50 ARITHMETIC_TYPE_P to an incomplete type, return NULL.
51
837ddebd 522019-01-25 Paolo Carlini <paolo.carlini@oracle.com>
53
54 PR c++/88969
55 * call.c (build_op_delete_call): Implement 7.6.2.5/(10.1).
56 * decl2.c (coerce_delete_type): Use build_pointer_type instead
57 of TYPE_POINTER_TO.
58
8c89c5fc 592019-01-24 Jason Merrill <jason@redhat.com>
60
61 PR c++/89001 - mangling of reference temporaries
62 * cp-tree.h (struct saved_scope): Add ref_temp_count.
63 (current_ref_temp_count): New macro.
64 * mangle.c (mangle_ref_init_variable): Use it.
65 * typeck2.c (store_init_value): Clear it.
66 * call.c (make_temporary_var_for_ref_to_temp): Copy public and
67 comdat.
68
b5e76680 692019-01-24 Jakub Jelinek <jakub@redhat.com>
70
71 PR c++/88976
72 * semantics.c (finish_omp_cancel): Diagnose more than one if
73 on #pragma omp cancel with different modifiers. Use
74 maybe_convert_cond when not in template or build_x_binary_op
75 otherwise.
76
dffbcba8 772019-01-23 Marek Polacek <polacek@redhat.com>
78
79 PR c++/88757 - qualified name treated wrongly as type.
80 * parser.c (cp_parser_direct_declarator): Don't treat qualified-ids
81 in parameter-list as types if name lookup for declarator-id didn't
82 find one or more function templates.
83
1f03c410 842019-01-23 Jakub Jelinek <jakub@redhat.com>
85
8090d51c 86 PR c/44715
87 * cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only
88 after genericizing cond and incr expressions.
89
1f03c410 90 PR c++/88984
91 * cp-gimplify.c (genericize_switch_stmt): Move cond genericization
92 before the begin_bc_block call.
93
48c03f15 942019-01-21 Jason Merrill <jason@redhat.com>
95
96 PR c++/87893 - constexpr ctor ICE on ARM.
97 PR c++/88293 - ICE with comma expression.
98 * constexpr.c (initialized_type): Don't shortcut non-void type.
99 Handle COMPOUND_EXPR.
100 (cxx_eval_outermost_constant_expr): Return early for void type.
101
99bf4b63 1022019-01-21 Jakub Jelinek <jakub@redhat.com>
103
77fe9474 104 PR c++/88949
105 * optimize.c (cxx_copy_decl): New function.
106 (clone_body): Use it instead of copy_decl_no_change.
107
99bf4b63 108 PR sanitizer/88901
109 * typeck.c (cp_build_binary_op): Don't instrument
110 SANITIZE_POINTER_COMPARE if processing_template_decl.
111 (pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT.
112
ecd2d842 1132019-01-18 Jason Merrill <jason@redhat.com>
114
115 PR c++/88875 - error with explicit list constructor.
116 * call.c (reference_binding): Don't modify EXPR. Set
117 need_temporary_p on the ck_user conversion for a temporary.
118 (convert_like_real): Check it.
119
6d4e8a95 1202019-01-18 H.J. Lu <hongjiu.lu@intel.com>
121
122 PR c/51628
123 PR c/88664
124 * call.c (convert_for_arg_passing): Upate the
125 warn_for_address_or_pointer_of_packed_member call.
126 * typeck.c (convert_for_assignment): Likewise.
127
9d3c4130 1282019-01-17 Jason Merrill <jason@redhat.com>
129
bc9c0483 130 PR c++/86205 - ICE with ?: of throw and template-id.
131 * pt.c (resolve_nondeduced_context_or_error): Split out from...
132 * typeck.c (decay_conversion): ...here.
133 * call.c (build_conditional_expr_1): Use it.
134
9d3c4130 135 PR c++/86740, ICE with constexpr if and nested generic lambdas.
136 * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR.
137
0f910e62 1382019-01-17 Paolo Carlini <paolo.carlini@oracle.com>
139
140 * decl.c (grokdeclarator): Use typespec_loc in error messages
141 about 'auto' and trailing return type.
142
098cc8f0 1432019-01-17 David Malcolm <dmalcolm@redhat.com>
144
145 PR c++/88699
146 * class.c (add_method): Don't use DECL_DESTRUCTOR_P on
147 USING_DECLs.
148
a395125a 1492019-01-17 Nathan Sidwell <nathan@acm.org>
150
151 PR c++/86610
152 * semantics.c (process_outer_var_ref): Only skip dependent types
153 in templates.
154
5461905d 1552019-01-17 Alexandre Oliva <aoliva@redhat.com>
156
c5f929a4 157 PR c++/87768
158 * cp-tree.h (saved_scope): Add suppress_location_wrappers.
159 * name-lookup.c (do_push_to_top_level): Save and reset it.
160 (do_pop_from_top_level): Restore it.
161
f97941b7 162 PR c++/86648
163 * pt.c (make_template_placeholder): Use auto_identifier.
164 (is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test.
165 * error.c (dump_type): Handle template placeholders.
166 * cxx-pretty-print.c (pp_cx_unqualified_id): Likewise.
167
5461905d 168 PR c++/88146
169 * cvt.c (convert_to_void): Handle all cdtor calls as if
170 returning void.
171
b92cc3ed 1722019-01-16 Paolo Carlini <paolo.carlini@oracle.com>
173
174 * decl.c (grokdeclarator): Use locations[ds_storage_class] in
175 error messages about ill-formed uses of mutable.
176
9fc2172c 1772019-01-16 Marek Polacek <polacek@redhat.com>
178
179 PR c++/78244 - narrowing conversion in template not detected.
180 * call.c (perform_implicit_conversion_flags): Set
181 IMPLICIT_CONV_EXPR_BRACED_INIT.
182 * cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New.
183 * pt.c (tsubst_copy_and_build): Use it.
184
727d210b 1852019-01-15 David Malcolm <dmalcolm@redhat.com>
186
187 PR c++/88795
188 * pt.c (build_deduction_guide): Bail out if tsubst_arg_types
189 fails.
190
39a51021 1912019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
192
193 * decl.c (start_decl): Improve error location.
194 * decl2.c (grokfield): Likewise.
195
1962019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
197
198 * decl.c (grokdeclarator): Move further up the location_t loc
199 declaration and use the location when building a TYPE_DECL for
200 a typedef name.
201 * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error
202 about an ill-formed bit-field as typedef.
203
affca1c8 2042019-01-14 Marek Polacek <polacek@redhat.com>
205
206 PR c++/88830 - ICE with abstract class.
207 * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR.
208 Fix formatting.
209
9f8a8956 210 PR c++/88825 - ICE with bogus function return type deduction.
211 * typeck.c (can_do_nrvo_p): Check error_mark_node.
212
82362779 2132019-01-14 Tom Honermann <tom@honermann.net>
214
215 Implement P0482R5, char8_t: A type for UTF-8 characters and strings
216 * cvt.c (type_promotes_to): Handle char8_t promotion.
217 * decl.c (grokdeclarator): Handle invalid type specifier
218 combinations involving char8_t.
219 * lex.c (init_reswords): Add char8_t as a reserved word.
220 * mangle.c (write_builtin_type): Add name mangling for char8_t (Du).
221 * parser.c (cp_keyword_starts_decl_specifier_p)
222 (cp_parser_simple_type_specifier): Recognize char8_t as a simple
223 type specifier.
224 (cp_parser_string_literal): Use char8_array_type_node for the type
225 of CPP_UTF8STRING.
226 (cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system
227 headers.
228 * rtti.c (emit_support_tinfos): type_info support for char8_t.
229 * tree.c (char_type_p): Recognize char8_t as a character type.
230 * typeck.c (string_conv_p): Handle conversions of u8 string
231 literals of char8_t type.
232 (check_literal_operator_args): Handle UDLs with u8 string literals
233 of char8_t type.
234 * typeck2.c (ordinary_char_type_p): New.
235 (digest_init_r): Disallow initializing a char array with a u8 string
236 literal.
237
bf4eb32b 2382019-01-14 Martin Liska <mliska@suse.cz>
239
240 PR gcov-profile/88263
241 * decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION
242 as location of the TLS wrapper.
243
2fa582a9 2442019-01-12 Paolo Carlini <paolo.carlini@oracle.com>
245
246 * decl.c (cp_finish_decl): Improve error location.
247 * decl2.c (grokfield): Likewise, improve two locations.
248
0b5957b9 2492019-01-11 Marek Polacek <polacek@redhat.com>
250
251 PR c++/88692, c++/87882 - -Wredundant-move false positive with *this.
252 * typeck.c (maybe_warn_pessimizing_move): Return if ARG isn't
253 ADDR_EXPR.
254
d07c152b 2552019-01-11 Jason Merrill <jason@redhat.com>
256
257 PR c++/88312 - pack expansion of decltype.
258 * pt.c (instantiation_dependent_r): A template non-type parameter
259 pack is instantiation-dependent.
260
0c2ebbc4 2612019-01-11 Jason Merrill <jason@redhat.com>
262
263 PR c++/88613 - ICE with use of const var in lambda.
264 * expr.c (mark_use): Fix location wrapper handling.
265 * cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use.
266
1b2f170e 2672019-01-11 Tobias Burnus <burnus@net-b.de>
268
269 PR C++/88114
270 * decl2.c (maybe_emit_vtables): If needed, generate code for
271 the destructor of an abstract class.
272 (mark_used): Update comment for older function-name change.
273
b385e516 2742019-01-11 Paolo Carlini <paolo.carlini@oracle.com>
275
276 * decl.c (start_decl): Improve error location.
277 (grokdeclarator): Likewise, improve two locations.
278
f4d3c071 2792019-01-09 Sandra Loosemore <sandra@codesourcery.com>
280
281 PR other/16615
282
283 * cp-tree.h: Mechanically replace "can not" with "cannot".
284 * parser.c: Likewise.
285 * pt.c: Likewise.
286
7cc45975 2872019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
288
289 * decl.c (grok_reference_init): Improve error location.
290 (grokdeclarator): Likewise, improve two locations.
291
90e20c9c 2922019-01-08 Marek Polacek <polacek@redhat.com>
293
91902bb4 294 PR c++/88538 - braced-init-list in template-argument-list.
295 * parser.c (cp_parser_template_argument): Handle braced-init-list when
296 in C++20.
297
90e20c9c 298 PR c++/88548 - this accepted in static member functions.
299 * parser.c (cp_debug_parser): Adjust printing of
300 local_variables_forbidden_p.
301 (cp_parser_new): Set local_variables_forbidden_p to 0 rather than false.
302 (cp_parser_primary_expression): When checking
303 local_variables_forbidden_p, use THIS_FORBIDDEN or
304 LOCAL_VARS_FORBIDDEN.
305 (cp_parser_lambda_body): Update the type of
306 local_variables_forbidden_p. Set it to 0 rather than false.
307 (cp_parser_condition): Adjust call to cp_parser_declarator.
308 (cp_parser_explicit_instantiation): Likewise.
309 (cp_parser_init_declarator): Likewise.
310 (cp_parser_declarator): New parameter. Use it.
311 (cp_parser_direct_declarator): New parameter. Use it to set
312 local_variables_forbidden_p. Adjust call to cp_parser_declarator.
313 (cp_parser_type_id_1): Adjust call to cp_parser_declarator.
314 (cp_parser_parameter_declaration): Likewise.
315 (cp_parser_default_argument): Update the type of
316 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
317 rather than true.
318 (cp_parser_member_declaration): Tell cp_parser_declarator if we saw
319 'static' or 'friend'.
320 (cp_parser_exception_declaration): Adjust call to cp_parser_declarator.
321 (cp_parser_late_parsing_default_args): Update the type of
322 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
323 rather than true.
324 (cp_parser_cache_defarg): Adjust call to cp_parser_declarator.
325 (cp_parser_objc_class_ivars): Likewise.
326 (cp_parser_objc_struct_declaration): Likewise.
327 (cp_parser_omp_for_loop_init): Likewise.
328 * parser.h (cp_parser): Change the type of local_variables_forbidden_p
329 to unsigned char.
330 (LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN):
331 Define.
332
8f7d5246 3332019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
334
335 * decl.c (start_decl): Improve permerror location.
336
6e5908c9 3372019-01-08 Jonathan Wakely <jwakely@redhat.com>
338 Jakub Jelinek <jakub@redhat.com>
339
340 PR c++/88554
341 * decl.c (finish_function): For -Wreturn-type don't add a return *this;
342 fixit hint if current_class_ref is NULL. Use a single if instead of
343 two nested ones.
344
2318c037 3452019-01-07 Paolo Carlini <paolo.carlini@oracle.com>
346
347 * decl.c (start_decl): Improve two error_at locations.
348 (expand_static_init): Likewise.
349
677576f7 3502019-01-07 Marek Polacek <polacek@redhat.com>
351
352 PR c++/88741 - wrong error with initializer-string.
353 * decl.c (cp_complete_array_type): Strip any location wrappers.
354
c38103e8 3552019-01-07 Bernd Edlinger <bernd.edlinger@hotmail.de>
356
357 PR c++/88261
358 PR c++/69338
359 PR c++/69696
360 PR c++/69697
361 * cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value.
362 * typeck2.c (digest_init_r): Raise an error for non-static
363 initialization of a flexible array member.
364 (process_init_constructor, massage_init_elt,
365 process_init_constructor_array, process_init_constructor_record,
366 process_init_constructor_union, process_init_constructor): Add the
367 flags parameter and pass it thru.
368 (store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to
369 digest_init_flags for static decls.
370
59409f09 3712019-01-07 Jakub Jelinek <jakub@redhat.com>
372
373 PR c++/85052
374 * cp-tree.h (cp_build_vec_convert): Declare.
375 * parser.c (cp_parser_postfix_expression): Parse
376 __builtin_convertvector.
377 * constexpr.c: Include fold-const-call.h.
378 (cxx_eval_internal_function): Handle IFN_VEC_CONVERT.
379 (potential_constant_expression_1): Likewise.
380 * semantics.c (cp_build_vec_convert): New function.
381 * pt.c (tsubst_copy_and_build): Handle CALL_EXPR to
382 IFN_VEC_CONVERT.
383
0627c5c9 3842019-01-03 Jakub Jelinek <jakub@redhat.com>
385
386 PR c++/88636
387 * decl.c (builtin_function_1): Return result of pushdecl_top_level
388 or pushdecl rather than decl.
389
f9f7d90c 3902019-01-03 Paolo Carlini <paolo.carlini@oracle.com>
391
392 * tree.c (handle_nodiscard_attribute): Improve warning location.
393
37fb9cf6 3942019-01-02 Marek Polacek <polacek@redhat.com>
395
396 PR c++/88612 - ICE with -Waddress-of-packed-member.
397 * call.c (convert_for_arg_passing): Only give warnings with tf_warning.
398 * typeck.c (convert_for_assignment): Likewise.
399
6080dd2f 400 PR c++/88631 - CTAD failing for value-initialization.
401 * typeck2.c (build_functional_cast): Try deducing the template
402 arguments even if there are no arguments to deduce from.
403
fbd26352 4042019-01-01 Jakub Jelinek <jakub@redhat.com>
ca29c574 405
8e8f6434 406 Update copyright years.
7dfbd804 407\f
fbd26352 408Copyright (C) 2019 Free Software Foundation, Inc.
7dfbd804 409
410Copying and distribution of this file, with or without modification,
411are permitted in any medium without royalty provided the copyright
412notice and this notice are preserved.