1 2019-02-01 Marek Polacek <polacek@redhat.com>
3 PR c++/88325 - ICE with invalid out-of-line template member definition.
4 * parser.c (cp_parser_class_name): Don't call make_typename_type
7 2019-02-01 Jakub Jelinek <jakub@redhat.com>
10 * parser.c (cp_parser_gnu_attributes_opt): Set ok to false
11 if require_open failed.
13 2019-01-31 Marek Polacek <polacek@redhat.com>
15 PR c++/89083, c++/80864 - ICE with list initialization in template.
16 * constexpr.c (adjust_temp_type): Use copy_node and change the type
17 instead of using build_constructor.
18 * decl.c (reshape_init_r): Don't reshape a digested initializer.
19 Return the initializer for COMPOUND_LITERAL_P.
21 PR c++/88983 - ICE with switch in constexpr function.
22 * constexpr.c (cxx_eval_switch_expr): Use SWITCH_COND and SWITCH_BODY.
23 (cxx_eval_constant_expression) <case COND_EXPR>: Don't look for the
24 label in the else branch if we found it in the then branch.
26 2019-01-30 Jason Merrill <jason@redhat.com>
28 PR c++/88752 - ICE with lambda and constexpr if.
29 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New.
30 * pt.c (tsubst_lambda_expr): Set it.
31 (instantiated_lambda_fn_p): Check it.
32 (enclosing_instantiation_of): Use it.
34 2019-01-31 Jakub Jelinek <jakub@redhat.com>
37 * cxx-pretty-print.c (pp_cxx_enumeration_constant): Print always as
38 a C cast in pp_c_flag_gnu_v3 mode.
40 2019-01-30 Jakub Jelinek <jakub@redhat.com>
43 * lambda.c (is_capture_proxy): Don't return true for
44 DECL_OMP_PRIVATIZED_MEMBER artificial vars.
46 2019-01-30 Marek Polacek <polacek@redhat.com>
48 PR c++/89119 - ICE with value-initialization in template.
49 * pt.c (tsubst_copy_and_build): Handle RANGE_EXPR.
51 2019-01-29 Jason Merrill <jason@redhat.com>
53 PR c++/86943 - wrong code converting lambda to function pointer.
54 * lambda.c (maybe_add_lambda_conv_op): Use a template-id in the
55 call. Only forward parms for decltype.
56 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Handle CALL_FROM_THUNK_P
58 * typeck.c (check_return_expr): Don't mess with a thunk call.
60 2019-01-28 Jason Merrill <jason@redhat.com>
62 PR c++/89089 - ICE with [[no_unique_address]].
63 PR c++/88865 - wrong layout with [[no_unique_address]].
64 * class.c (check_field_decls): A potentially-overlapping field makes
65 the class non-layout-POD, but not non-empty.
66 (end_of_class): Always consider empty data members.
67 (layout_class_type): Set DECL_SIZE for empty fields.
69 2019-01-28 Marek Polacek <polacek@redhat.com>
71 PR c++/88358 - name wrongly treated as type.
72 * parser.c (cp_parser_direct_declarator): Don't assume a qualified-id
73 in parameter-list is a type if the function's declarator-id is not
76 2019-01-27 Marek Polacek <polacek@redhat.com>
78 PR c++/88815 - narrowing conversion lost in decltype.
79 PR c++/78244 - narrowing conversion in template not detected.
80 * cp-tree.h (CONSTRUCTOR_IS_DEPENDENT): New.
81 * pt.c (instantiation_dependent_r): Consider a CONSTRUCTOR with
82 CONSTRUCTOR_IS_DEPENDENT instantiation-dependent.
83 * semantics.c (finish_compound_literal): When the compound literal
84 isn't instantiation-dependent and the type isn't type-dependent,
85 fall back to the normal processing. Set CONSTRUCTOR_IS_DEPENDENT.
87 PR c++/89024 - ICE with incomplete enum type.
88 * call.c (standard_conversion): When converting an
89 ARITHMETIC_TYPE_P to an incomplete type, return NULL.
91 2019-01-25 Paolo Carlini <paolo.carlini@oracle.com>
94 * call.c (build_op_delete_call): Implement 7.6.2.5/(10.1).
95 * decl2.c (coerce_delete_type): Use build_pointer_type instead
98 2019-01-24 Jason Merrill <jason@redhat.com>
100 PR c++/89001 - mangling of reference temporaries
101 * cp-tree.h (struct saved_scope): Add ref_temp_count.
102 (current_ref_temp_count): New macro.
103 * mangle.c (mangle_ref_init_variable): Use it.
104 * typeck2.c (store_init_value): Clear it.
105 * call.c (make_temporary_var_for_ref_to_temp): Copy public and
108 2019-01-24 Jakub Jelinek <jakub@redhat.com>
111 * semantics.c (finish_omp_cancel): Diagnose more than one if
112 on #pragma omp cancel with different modifiers. Use
113 maybe_convert_cond when not in template or build_x_binary_op
116 2019-01-23 Marek Polacek <polacek@redhat.com>
118 PR c++/88757 - qualified name treated wrongly as type.
119 * parser.c (cp_parser_direct_declarator): Don't treat qualified-ids
120 in parameter-list as types if name lookup for declarator-id didn't
121 find one or more function templates.
123 2019-01-23 Jakub Jelinek <jakub@redhat.com>
126 * cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only
127 after genericizing cond and incr expressions.
130 * cp-gimplify.c (genericize_switch_stmt): Move cond genericization
131 before the begin_bc_block call.
133 2019-01-21 Jason Merrill <jason@redhat.com>
135 PR c++/87893 - constexpr ctor ICE on ARM.
136 PR c++/88293 - ICE with comma expression.
137 * constexpr.c (initialized_type): Don't shortcut non-void type.
138 Handle COMPOUND_EXPR.
139 (cxx_eval_outermost_constant_expr): Return early for void type.
141 2019-01-21 Jakub Jelinek <jakub@redhat.com>
144 * optimize.c (cxx_copy_decl): New function.
145 (clone_body): Use it instead of copy_decl_no_change.
148 * typeck.c (cp_build_binary_op): Don't instrument
149 SANITIZE_POINTER_COMPARE if processing_template_decl.
150 (pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT.
152 2019-01-18 Jason Merrill <jason@redhat.com>
154 PR c++/88875 - error with explicit list constructor.
155 * call.c (reference_binding): Don't modify EXPR. Set
156 need_temporary_p on the ck_user conversion for a temporary.
157 (convert_like_real): Check it.
159 2019-01-18 H.J. Lu <hongjiu.lu@intel.com>
163 * call.c (convert_for_arg_passing): Upate the
164 warn_for_address_or_pointer_of_packed_member call.
165 * typeck.c (convert_for_assignment): Likewise.
167 2019-01-17 Jason Merrill <jason@redhat.com>
169 PR c++/86205 - ICE with ?: of throw and template-id.
170 * pt.c (resolve_nondeduced_context_or_error): Split out from...
171 * typeck.c (decay_conversion): ...here.
172 * call.c (build_conditional_expr_1): Use it.
174 PR c++/86740, ICE with constexpr if and nested generic lambdas.
175 * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR.
177 2019-01-17 Paolo Carlini <paolo.carlini@oracle.com>
179 * decl.c (grokdeclarator): Use typespec_loc in error messages
180 about 'auto' and trailing return type.
182 2019-01-17 David Malcolm <dmalcolm@redhat.com>
185 * class.c (add_method): Don't use DECL_DESTRUCTOR_P on
188 2019-01-17 Nathan Sidwell <nathan@acm.org>
191 * semantics.c (process_outer_var_ref): Only skip dependent types
194 2019-01-17 Alexandre Oliva <aoliva@redhat.com>
197 * cp-tree.h (saved_scope): Add suppress_location_wrappers.
198 * name-lookup.c (do_push_to_top_level): Save and reset it.
199 (do_pop_from_top_level): Restore it.
202 * pt.c (make_template_placeholder): Use auto_identifier.
203 (is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test.
204 * error.c (dump_type): Handle template placeholders.
205 * cxx-pretty-print.c (pp_cx_unqualified_id): Likewise.
208 * cvt.c (convert_to_void): Handle all cdtor calls as if
211 2019-01-16 Paolo Carlini <paolo.carlini@oracle.com>
213 * decl.c (grokdeclarator): Use locations[ds_storage_class] in
214 error messages about ill-formed uses of mutable.
216 2019-01-16 Marek Polacek <polacek@redhat.com>
218 PR c++/78244 - narrowing conversion in template not detected.
219 * call.c (perform_implicit_conversion_flags): Set
220 IMPLICIT_CONV_EXPR_BRACED_INIT.
221 * cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New.
222 * pt.c (tsubst_copy_and_build): Use it.
224 2019-01-15 David Malcolm <dmalcolm@redhat.com>
227 * pt.c (build_deduction_guide): Bail out if tsubst_arg_types
230 2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
232 * decl.c (start_decl): Improve error location.
233 * decl2.c (grokfield): Likewise.
235 2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
237 * decl.c (grokdeclarator): Move further up the location_t loc
238 declaration and use the location when building a TYPE_DECL for
240 * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error
241 about an ill-formed bit-field as typedef.
243 2019-01-14 Marek Polacek <polacek@redhat.com>
245 PR c++/88830 - ICE with abstract class.
246 * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR.
249 PR c++/88825 - ICE with bogus function return type deduction.
250 * typeck.c (can_do_nrvo_p): Check error_mark_node.
252 2019-01-14 Tom Honermann <tom@honermann.net>
254 Implement P0482R5, char8_t: A type for UTF-8 characters and strings
255 * cvt.c (type_promotes_to): Handle char8_t promotion.
256 * decl.c (grokdeclarator): Handle invalid type specifier
257 combinations involving char8_t.
258 * lex.c (init_reswords): Add char8_t as a reserved word.
259 * mangle.c (write_builtin_type): Add name mangling for char8_t (Du).
260 * parser.c (cp_keyword_starts_decl_specifier_p)
261 (cp_parser_simple_type_specifier): Recognize char8_t as a simple
263 (cp_parser_string_literal): Use char8_array_type_node for the type
265 (cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system
267 * rtti.c (emit_support_tinfos): type_info support for char8_t.
268 * tree.c (char_type_p): Recognize char8_t as a character type.
269 * typeck.c (string_conv_p): Handle conversions of u8 string
270 literals of char8_t type.
271 (check_literal_operator_args): Handle UDLs with u8 string literals
273 * typeck2.c (ordinary_char_type_p): New.
274 (digest_init_r): Disallow initializing a char array with a u8 string
277 2019-01-14 Martin Liska <mliska@suse.cz>
279 PR gcov-profile/88263
280 * decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION
281 as location of the TLS wrapper.
283 2019-01-12 Paolo Carlini <paolo.carlini@oracle.com>
285 * decl.c (cp_finish_decl): Improve error location.
286 * decl2.c (grokfield): Likewise, improve two locations.
288 2019-01-11 Marek Polacek <polacek@redhat.com>
290 PR c++/88692, c++/87882 - -Wredundant-move false positive with *this.
291 * typeck.c (maybe_warn_pessimizing_move): Return if ARG isn't
294 2019-01-11 Jason Merrill <jason@redhat.com>
296 PR c++/88312 - pack expansion of decltype.
297 * pt.c (instantiation_dependent_r): A template non-type parameter
298 pack is instantiation-dependent.
300 2019-01-11 Jason Merrill <jason@redhat.com>
302 PR c++/88613 - ICE with use of const var in lambda.
303 * expr.c (mark_use): Fix location wrapper handling.
304 * cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use.
306 2019-01-11 Tobias Burnus <burnus@net-b.de>
309 * decl2.c (maybe_emit_vtables): If needed, generate code for
310 the destructor of an abstract class.
311 (mark_used): Update comment for older function-name change.
313 2019-01-11 Paolo Carlini <paolo.carlini@oracle.com>
315 * decl.c (start_decl): Improve error location.
316 (grokdeclarator): Likewise, improve two locations.
318 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
322 * cp-tree.h: Mechanically replace "can not" with "cannot".
323 * parser.c: Likewise.
326 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
328 * decl.c (grok_reference_init): Improve error location.
329 (grokdeclarator): Likewise, improve two locations.
331 2019-01-08 Marek Polacek <polacek@redhat.com>
333 PR c++/88538 - braced-init-list in template-argument-list.
334 * parser.c (cp_parser_template_argument): Handle braced-init-list when
337 PR c++/88548 - this accepted in static member functions.
338 * parser.c (cp_debug_parser): Adjust printing of
339 local_variables_forbidden_p.
340 (cp_parser_new): Set local_variables_forbidden_p to 0 rather than false.
341 (cp_parser_primary_expression): When checking
342 local_variables_forbidden_p, use THIS_FORBIDDEN or
343 LOCAL_VARS_FORBIDDEN.
344 (cp_parser_lambda_body): Update the type of
345 local_variables_forbidden_p. Set it to 0 rather than false.
346 (cp_parser_condition): Adjust call to cp_parser_declarator.
347 (cp_parser_explicit_instantiation): Likewise.
348 (cp_parser_init_declarator): Likewise.
349 (cp_parser_declarator): New parameter. Use it.
350 (cp_parser_direct_declarator): New parameter. Use it to set
351 local_variables_forbidden_p. Adjust call to cp_parser_declarator.
352 (cp_parser_type_id_1): Adjust call to cp_parser_declarator.
353 (cp_parser_parameter_declaration): Likewise.
354 (cp_parser_default_argument): Update the type of
355 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
357 (cp_parser_member_declaration): Tell cp_parser_declarator if we saw
358 'static' or 'friend'.
359 (cp_parser_exception_declaration): Adjust call to cp_parser_declarator.
360 (cp_parser_late_parsing_default_args): Update the type of
361 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
363 (cp_parser_cache_defarg): Adjust call to cp_parser_declarator.
364 (cp_parser_objc_class_ivars): Likewise.
365 (cp_parser_objc_struct_declaration): Likewise.
366 (cp_parser_omp_for_loop_init): Likewise.
367 * parser.h (cp_parser): Change the type of local_variables_forbidden_p
369 (LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN):
372 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
374 * decl.c (start_decl): Improve permerror location.
376 2019-01-08 Jonathan Wakely <jwakely@redhat.com>
377 Jakub Jelinek <jakub@redhat.com>
380 * decl.c (finish_function): For -Wreturn-type don't add a return *this;
381 fixit hint if current_class_ref is NULL. Use a single if instead of
384 2019-01-07 Paolo Carlini <paolo.carlini@oracle.com>
386 * decl.c (start_decl): Improve two error_at locations.
387 (expand_static_init): Likewise.
389 2019-01-07 Marek Polacek <polacek@redhat.com>
391 PR c++/88741 - wrong error with initializer-string.
392 * decl.c (cp_complete_array_type): Strip any location wrappers.
394 2019-01-07 Bernd Edlinger <bernd.edlinger@hotmail.de>
400 * cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value.
401 * typeck2.c (digest_init_r): Raise an error for non-static
402 initialization of a flexible array member.
403 (process_init_constructor, massage_init_elt,
404 process_init_constructor_array, process_init_constructor_record,
405 process_init_constructor_union, process_init_constructor): Add the
406 flags parameter and pass it thru.
407 (store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to
408 digest_init_flags for static decls.
410 2019-01-07 Jakub Jelinek <jakub@redhat.com>
413 * cp-tree.h (cp_build_vec_convert): Declare.
414 * parser.c (cp_parser_postfix_expression): Parse
415 __builtin_convertvector.
416 * constexpr.c: Include fold-const-call.h.
417 (cxx_eval_internal_function): Handle IFN_VEC_CONVERT.
418 (potential_constant_expression_1): Likewise.
419 * semantics.c (cp_build_vec_convert): New function.
420 * pt.c (tsubst_copy_and_build): Handle CALL_EXPR to
423 2019-01-03 Jakub Jelinek <jakub@redhat.com>
426 * decl.c (builtin_function_1): Return result of pushdecl_top_level
427 or pushdecl rather than decl.
429 2019-01-03 Paolo Carlini <paolo.carlini@oracle.com>
431 * tree.c (handle_nodiscard_attribute): Improve warning location.
433 2019-01-02 Marek Polacek <polacek@redhat.com>
435 PR c++/88612 - ICE with -Waddress-of-packed-member.
436 * call.c (convert_for_arg_passing): Only give warnings with tf_warning.
437 * typeck.c (convert_for_assignment): Likewise.
439 PR c++/88631 - CTAD failing for value-initialization.
440 * typeck2.c (build_functional_cast): Try deducing the template
441 arguments even if there are no arguments to deduce from.
443 2019-01-01 Jakub Jelinek <jakub@redhat.com>
445 Update copyright years.
447 Copyright (C) 2019 Free Software Foundation, Inc.
449 Copying and distribution of this file, with or without modification,
450 are permitted in any medium without royalty provided the copyright
451 notice and this notice are preserved.