]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/cp/ChangeLog
PR c/86125 - missing -Wbuiltin-declaration-mismatch on a mismatched return type
[thirdparty/gcc.git] / gcc / cp / ChangeLog
CommitLineData
b5e76680 12019-01-24 Jakub Jelinek <jakub@redhat.com>
2
3 PR c++/88976
4 * semantics.c (finish_omp_cancel): Diagnose more than one if
5 on #pragma omp cancel with different modifiers. Use
6 maybe_convert_cond when not in template or build_x_binary_op
7 otherwise.
8
dffbcba8 92019-01-23 Marek Polacek <polacek@redhat.com>
10
11 PR c++/88757 - qualified name treated wrongly as type.
12 * parser.c (cp_parser_direct_declarator): Don't treat qualified-ids
13 in parameter-list as types if name lookup for declarator-id didn't
14 find one or more function templates.
15
1f03c410 162019-01-23 Jakub Jelinek <jakub@redhat.com>
17
8090d51c 18 PR c/44715
19 * cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only
20 after genericizing cond and incr expressions.
21
1f03c410 22 PR c++/88984
23 * cp-gimplify.c (genericize_switch_stmt): Move cond genericization
24 before the begin_bc_block call.
25
48c03f15 262019-01-21 Jason Merrill <jason@redhat.com>
27
28 PR c++/87893 - constexpr ctor ICE on ARM.
29 PR c++/88293 - ICE with comma expression.
30 * constexpr.c (initialized_type): Don't shortcut non-void type.
31 Handle COMPOUND_EXPR.
32 (cxx_eval_outermost_constant_expr): Return early for void type.
33
99bf4b63 342019-01-21 Jakub Jelinek <jakub@redhat.com>
35
77fe9474 36 PR c++/88949
37 * optimize.c (cxx_copy_decl): New function.
38 (clone_body): Use it instead of copy_decl_no_change.
39
99bf4b63 40 PR sanitizer/88901
41 * typeck.c (cp_build_binary_op): Don't instrument
42 SANITIZE_POINTER_COMPARE if processing_template_decl.
43 (pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT.
44
ecd2d842 452019-01-18 Jason Merrill <jason@redhat.com>
46
47 PR c++/88875 - error with explicit list constructor.
48 * call.c (reference_binding): Don't modify EXPR. Set
49 need_temporary_p on the ck_user conversion for a temporary.
50 (convert_like_real): Check it.
51
6d4e8a95 522019-01-18 H.J. Lu <hongjiu.lu@intel.com>
53
54 PR c/51628
55 PR c/88664
56 * call.c (convert_for_arg_passing): Upate the
57 warn_for_address_or_pointer_of_packed_member call.
58 * typeck.c (convert_for_assignment): Likewise.
59
9d3c4130 602019-01-17 Jason Merrill <jason@redhat.com>
61
bc9c0483 62 PR c++/86205 - ICE with ?: of throw and template-id.
63 * pt.c (resolve_nondeduced_context_or_error): Split out from...
64 * typeck.c (decay_conversion): ...here.
65 * call.c (build_conditional_expr_1): Use it.
66
9d3c4130 67 PR c++/86740, ICE with constexpr if and nested generic lambdas.
68 * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR.
69
0f910e62 702019-01-17 Paolo Carlini <paolo.carlini@oracle.com>
71
72 * decl.c (grokdeclarator): Use typespec_loc in error messages
73 about 'auto' and trailing return type.
74
098cc8f0 752019-01-17 David Malcolm <dmalcolm@redhat.com>
76
77 PR c++/88699
78 * class.c (add_method): Don't use DECL_DESTRUCTOR_P on
79 USING_DECLs.
80
a395125a 812019-01-17 Nathan Sidwell <nathan@acm.org>
82
83 PR c++/86610
84 * semantics.c (process_outer_var_ref): Only skip dependent types
85 in templates.
86
5461905d 872019-01-17 Alexandre Oliva <aoliva@redhat.com>
88
c5f929a4 89 PR c++/87768
90 * cp-tree.h (saved_scope): Add suppress_location_wrappers.
91 * name-lookup.c (do_push_to_top_level): Save and reset it.
92 (do_pop_from_top_level): Restore it.
93
f97941b7 94 PR c++/86648
95 * pt.c (make_template_placeholder): Use auto_identifier.
96 (is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test.
97 * error.c (dump_type): Handle template placeholders.
98 * cxx-pretty-print.c (pp_cx_unqualified_id): Likewise.
99
5461905d 100 PR c++/88146
101 * cvt.c (convert_to_void): Handle all cdtor calls as if
102 returning void.
103
b92cc3ed 1042019-01-16 Paolo Carlini <paolo.carlini@oracle.com>
105
106 * decl.c (grokdeclarator): Use locations[ds_storage_class] in
107 error messages about ill-formed uses of mutable.
108
9fc2172c 1092019-01-16 Marek Polacek <polacek@redhat.com>
110
111 PR c++/78244 - narrowing conversion in template not detected.
112 * call.c (perform_implicit_conversion_flags): Set
113 IMPLICIT_CONV_EXPR_BRACED_INIT.
114 * cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New.
115 * pt.c (tsubst_copy_and_build): Use it.
116
727d210b 1172019-01-15 David Malcolm <dmalcolm@redhat.com>
118
119 PR c++/88795
120 * pt.c (build_deduction_guide): Bail out if tsubst_arg_types
121 fails.
122
39a51021 1232019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
124
125 * decl.c (start_decl): Improve error location.
126 * decl2.c (grokfield): Likewise.
127
1282019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
129
130 * decl.c (grokdeclarator): Move further up the location_t loc
131 declaration and use the location when building a TYPE_DECL for
132 a typedef name.
133 * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error
134 about an ill-formed bit-field as typedef.
135
affca1c8 1362019-01-14 Marek Polacek <polacek@redhat.com>
137
138 PR c++/88830 - ICE with abstract class.
139 * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR.
140 Fix formatting.
141
9f8a8956 142 PR c++/88825 - ICE with bogus function return type deduction.
143 * typeck.c (can_do_nrvo_p): Check error_mark_node.
144
82362779 1452019-01-14 Tom Honermann <tom@honermann.net>
146
147 Implement P0482R5, char8_t: A type for UTF-8 characters and strings
148 * cvt.c (type_promotes_to): Handle char8_t promotion.
149 * decl.c (grokdeclarator): Handle invalid type specifier
150 combinations involving char8_t.
151 * lex.c (init_reswords): Add char8_t as a reserved word.
152 * mangle.c (write_builtin_type): Add name mangling for char8_t (Du).
153 * parser.c (cp_keyword_starts_decl_specifier_p)
154 (cp_parser_simple_type_specifier): Recognize char8_t as a simple
155 type specifier.
156 (cp_parser_string_literal): Use char8_array_type_node for the type
157 of CPP_UTF8STRING.
158 (cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system
159 headers.
160 * rtti.c (emit_support_tinfos): type_info support for char8_t.
161 * tree.c (char_type_p): Recognize char8_t as a character type.
162 * typeck.c (string_conv_p): Handle conversions of u8 string
163 literals of char8_t type.
164 (check_literal_operator_args): Handle UDLs with u8 string literals
165 of char8_t type.
166 * typeck2.c (ordinary_char_type_p): New.
167 (digest_init_r): Disallow initializing a char array with a u8 string
168 literal.
169
bf4eb32b 1702019-01-14 Martin Liska <mliska@suse.cz>
171
172 PR gcov-profile/88263
173 * decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION
174 as location of the TLS wrapper.
175
2fa582a9 1762019-01-12 Paolo Carlini <paolo.carlini@oracle.com>
177
178 * decl.c (cp_finish_decl): Improve error location.
179 * decl2.c (grokfield): Likewise, improve two locations.
180
0b5957b9 1812019-01-11 Marek Polacek <polacek@redhat.com>
182
183 PR c++/88692, c++/87882 - -Wredundant-move false positive with *this.
184 * typeck.c (maybe_warn_pessimizing_move): Return if ARG isn't
185 ADDR_EXPR.
186
d07c152b 1872019-01-11 Jason Merrill <jason@redhat.com>
188
189 PR c++/88312 - pack expansion of decltype.
190 * pt.c (instantiation_dependent_r): A template non-type parameter
191 pack is instantiation-dependent.
192
0c2ebbc4 1932019-01-11 Jason Merrill <jason@redhat.com>
194
195 PR c++/88613 - ICE with use of const var in lambda.
196 * expr.c (mark_use): Fix location wrapper handling.
197 * cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use.
198
1b2f170e 1992019-01-11 Tobias Burnus <burnus@net-b.de>
200
201 PR C++/88114
202 * decl2.c (maybe_emit_vtables): If needed, generate code for
203 the destructor of an abstract class.
204 (mark_used): Update comment for older function-name change.
205
b385e516 2062019-01-11 Paolo Carlini <paolo.carlini@oracle.com>
207
208 * decl.c (start_decl): Improve error location.
209 (grokdeclarator): Likewise, improve two locations.
210
f4d3c071 2112019-01-09 Sandra Loosemore <sandra@codesourcery.com>
212
213 PR other/16615
214
215 * cp-tree.h: Mechanically replace "can not" with "cannot".
216 * parser.c: Likewise.
217 * pt.c: Likewise.
218
7cc45975 2192019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
220
221 * decl.c (grok_reference_init): Improve error location.
222 (grokdeclarator): Likewise, improve two locations.
223
90e20c9c 2242019-01-08 Marek Polacek <polacek@redhat.com>
225
91902bb4 226 PR c++/88538 - braced-init-list in template-argument-list.
227 * parser.c (cp_parser_template_argument): Handle braced-init-list when
228 in C++20.
229
90e20c9c 230 PR c++/88548 - this accepted in static member functions.
231 * parser.c (cp_debug_parser): Adjust printing of
232 local_variables_forbidden_p.
233 (cp_parser_new): Set local_variables_forbidden_p to 0 rather than false.
234 (cp_parser_primary_expression): When checking
235 local_variables_forbidden_p, use THIS_FORBIDDEN or
236 LOCAL_VARS_FORBIDDEN.
237 (cp_parser_lambda_body): Update the type of
238 local_variables_forbidden_p. Set it to 0 rather than false.
239 (cp_parser_condition): Adjust call to cp_parser_declarator.
240 (cp_parser_explicit_instantiation): Likewise.
241 (cp_parser_init_declarator): Likewise.
242 (cp_parser_declarator): New parameter. Use it.
243 (cp_parser_direct_declarator): New parameter. Use it to set
244 local_variables_forbidden_p. Adjust call to cp_parser_declarator.
245 (cp_parser_type_id_1): Adjust call to cp_parser_declarator.
246 (cp_parser_parameter_declaration): Likewise.
247 (cp_parser_default_argument): Update the type of
248 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
249 rather than true.
250 (cp_parser_member_declaration): Tell cp_parser_declarator if we saw
251 'static' or 'friend'.
252 (cp_parser_exception_declaration): Adjust call to cp_parser_declarator.
253 (cp_parser_late_parsing_default_args): Update the type of
254 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
255 rather than true.
256 (cp_parser_cache_defarg): Adjust call to cp_parser_declarator.
257 (cp_parser_objc_class_ivars): Likewise.
258 (cp_parser_objc_struct_declaration): Likewise.
259 (cp_parser_omp_for_loop_init): Likewise.
260 * parser.h (cp_parser): Change the type of local_variables_forbidden_p
261 to unsigned char.
262 (LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN):
263 Define.
264
8f7d5246 2652019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
266
267 * decl.c (start_decl): Improve permerror location.
268
6e5908c9 2692019-01-08 Jonathan Wakely <jwakely@redhat.com>
270 Jakub Jelinek <jakub@redhat.com>
271
272 PR c++/88554
273 * decl.c (finish_function): For -Wreturn-type don't add a return *this;
274 fixit hint if current_class_ref is NULL. Use a single if instead of
275 two nested ones.
276
2318c037 2772019-01-07 Paolo Carlini <paolo.carlini@oracle.com>
278
279 * decl.c (start_decl): Improve two error_at locations.
280 (expand_static_init): Likewise.
281
677576f7 2822019-01-07 Marek Polacek <polacek@redhat.com>
283
284 PR c++/88741 - wrong error with initializer-string.
285 * decl.c (cp_complete_array_type): Strip any location wrappers.
286
c38103e8 2872019-01-07 Bernd Edlinger <bernd.edlinger@hotmail.de>
288
289 PR c++/88261
290 PR c++/69338
291 PR c++/69696
292 PR c++/69697
293 * cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value.
294 * typeck2.c (digest_init_r): Raise an error for non-static
295 initialization of a flexible array member.
296 (process_init_constructor, massage_init_elt,
297 process_init_constructor_array, process_init_constructor_record,
298 process_init_constructor_union, process_init_constructor): Add the
299 flags parameter and pass it thru.
300 (store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to
301 digest_init_flags for static decls.
302
59409f09 3032019-01-07 Jakub Jelinek <jakub@redhat.com>
304
305 PR c++/85052
306 * cp-tree.h (cp_build_vec_convert): Declare.
307 * parser.c (cp_parser_postfix_expression): Parse
308 __builtin_convertvector.
309 * constexpr.c: Include fold-const-call.h.
310 (cxx_eval_internal_function): Handle IFN_VEC_CONVERT.
311 (potential_constant_expression_1): Likewise.
312 * semantics.c (cp_build_vec_convert): New function.
313 * pt.c (tsubst_copy_and_build): Handle CALL_EXPR to
314 IFN_VEC_CONVERT.
315
0627c5c9 3162019-01-03 Jakub Jelinek <jakub@redhat.com>
317
318 PR c++/88636
319 * decl.c (builtin_function_1): Return result of pushdecl_top_level
320 or pushdecl rather than decl.
321
f9f7d90c 3222019-01-03 Paolo Carlini <paolo.carlini@oracle.com>
323
324 * tree.c (handle_nodiscard_attribute): Improve warning location.
325
37fb9cf6 3262019-01-02 Marek Polacek <polacek@redhat.com>
327
328 PR c++/88612 - ICE with -Waddress-of-packed-member.
329 * call.c (convert_for_arg_passing): Only give warnings with tf_warning.
330 * typeck.c (convert_for_assignment): Likewise.
331
6080dd2f 332 PR c++/88631 - CTAD failing for value-initialization.
333 * typeck2.c (build_functional_cast): Try deducing the template
334 arguments even if there are no arguments to deduce from.
335
fbd26352 3362019-01-01 Jakub Jelinek <jakub@redhat.com>
ca29c574 337
8e8f6434 338 Update copyright years.
7dfbd804 339\f
fbd26352 340Copyright (C) 2019 Free Software Foundation, Inc.
7dfbd804 341
342Copying and distribution of this file, with or without modification,
343are permitted in any medium without royalty provided the copyright
344notice and this notice are preserved.