1 2019-09-23 Paolo Carlini <paolo.carlini@oracle.com>
3 * pt.c (check_explicit_specialization): Use cp_expr_loc_or_input_loc.
4 (process_partial_specialization): Likewise.
5 (convert_nontype_argument_function): Likewise.
6 (invalid_tparm_referent_p): Likewise.
7 (convert_template_argument): Likewise.
8 (check_valid_ptrmem_cst_expr): Tidy.
10 2019-09-23 Jason Merrill <jason@redhat.com>
12 PR c++/91809 - bit-field and ellipsis.
13 * call.c (convert_arg_to_ellipsis): Don't call decay_conversion for
16 2019-09-23 Marek Polacek <polacek@redhat.com>
18 PR c++/91844 - Implement CWG 2352, Similar types and reference binding.
19 * call.c (reference_related_p): Use similar_type_p instead of
21 (reference_compatible_p): Update implementation to match CWG 2352.
22 * cp-tree.h (similar_type_p): Declare.
23 * typeck.c (similar_type_p): New.
25 2019-09-22 Marek Polacek <polacek@redhat.com>
27 PR c++/91819 - ICE with operator++ and enum.
28 * call.c (build_new_op_1): Set arg2_type.
30 2019-09-17 Jason Merrill <jason@redhat.com>
32 * parser.c (cp_parser_statement): Handle [[likely]] on
35 2019-09-19 Jason Merrill <jason@redhat.com>
38 * call.c (build_new_op_1): Don't apply any standard conversions to
39 the operands of a built-in operator. Don't suppress conversions in
41 * typeck.c (cp_build_unary_op): Do integral promotions for enums.
43 2019-09-16 Paolo Carlini <paolo.carlini@oracle.com>
45 * decl.c (grokdeclarator): Use declspecs->locations and
46 declarator->id_loc in a few error messages.
47 * pt.c (finish_member_template_decl): Use DECL_SOURCE_LOCATION.
48 (push_template_decl_real): Likewise.
50 2019-09-15 Jason Merrill <jason@redhat.com>
52 PR c++/30277 - int-width bit-field promotion.
53 PR c++/33819 - long bit-field promotion.
54 * typeck.c (cp_perform_integral_promotions): Handle large bit-fields
55 properly. Handle 32-bit non-int bit-fields properly.
56 (is_bitfield_expr_with_lowered_type): Don't look through NOP_EXPR.
58 PR c++/82165 - enum bitfields and operator overloading.
59 * call.c (build_new_op_1): Use unlowered_expr_type.
61 * call.c (build_new_op_1): Don't apply any standard conversions to
62 the operands of a built-in operator. Don't suppress conversions in
64 * typeck.c (cp_build_unary_op): Do integral promotions for enums.
66 2019-09-15 Marek Polacek <polacek@redhat.com>
68 PR c++/91740 - ICE with constexpr call and ?: in ARRAY_REF.
69 * pt.c (build_non_dependent_expr): Call build_non_dependent_expr for
72 2019-09-15 Nathan Sidwell <nathan@acm.org>
74 * cp-tree.h (DECL_CLONED_FUNCTION_P): Reimplement using
75 IDENTIFIER_CDTOR_P, correct documentation.
76 (DECL_CLONED_FUNCTION): Directly access field.
77 (decl_cloned_function_p): Delete.
78 * class.c (decl_cloned_function_p): Delete.
79 * pt.c (instantiate_template_1): Check DECL_CHAIN is a decl.
81 2019-09-11 Nathan Sidwell <nathan@acm.org>
83 * c-objcp-common.c (cp-objcp-common.c): Alphababetize and
84 correctly mark all C++ nodes.
85 * decl.c (cp_tree_node_structure): Alphabetize.
87 2019-09-10 Marek Polacek <polacek@redhat.com>
89 PR c++/91673 - ICE with noexcept in alias-declaration.
90 * parser.c (CP_PARSER_FLAGS_DELAY_NOEXCEPT): New parser flag.
91 (cp_parser_lambda_declarator_opt): Pass CP_PARSER_FLAGS_NONE to
92 cp_parser_exception_specification_opt.
93 (cp_parser_direct_declarator): Adjust a call to
94 cp_parser_exception_specification_opt.
95 (cp_parser_member_declaration): Pass CP_PARSER_FLAGS_DELAY_NOEXCEPT
96 to cp_parser_declarator if not processing a friend or typedef
98 (cp_parser_late_noexcept_specifier): Adjust a call to
99 cp_parser_noexcept_specification_opt.
100 (cp_parser_noexcept_specification_opt): New parameter for parser flags,
101 drop the FRIEND_P parameter. Use the new parameter.
102 (cp_parser_exception_specification_opt): Likewise.
103 (cp_parser_transaction): Adjust a call to
104 cp_parser_noexcept_specification_opt.
105 (cp_parser_transaction_expression): Likewise.
107 2019-09-10 Marek Polacek <polacek@redhat.com>
109 PR c++/91705 - constexpr evaluation rejects ++/-- on floats.
110 * constexpr.c (cxx_eval_increment_expression): Call fold_simple on
113 2019-09-10 Paolo Carlini <paolo.carlini@oracle.com>
115 * decl.c (has_designator_problem): Use cp_expr_loc_or_input_loc
117 (build_enumerator): Likewise.
118 (cp_finish_decl): Use DECL_SOURCE_LOCATION.
119 (grokdeclarator): Use id_loc in two error_at; change errror
120 message about constinit together constexpr to use two ranges.
122 2019-09-09 Marek Polacek <polacek@redhat.com>
124 PR c++/84374 - diagnose invalid uses of decltype(auto).
125 * decl.c (grokdeclarator): Diagnose wrong usage of decltype(auto) in
126 a function declaration.
128 2019-09-06 Nathan Sidwell <nathan@acm.org>
131 * cp-tree.h (IDENTIFIER_REPO_CHOSEN, DECL_REPO_AVAILABLE_P): Delete.
132 (struct lang_decl_base): Remove repo_available_p.
133 * decl.c (duplicate_decls): Don't copy DECL_REPO_AVAILABLE_P.
135 (Reserve TREE_LANG_FLAG_3 for modules.
136 * cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): Delete.
137 (DECL_NON_TRIVIALLY_INITIALIZED_P): Move to TREE_LANG_FLAG_6.
138 * class.c (build_ctor_vtbl_group): Don't set
139 DECL_CONSTRUCTION_VTABLE_P.
140 * decl2.c (determine_visibility_from_class): Don't check
141 DECL_CONSTRUCTION_VTABLE_P anymore.
143 2019-09-06 Martin Liska <mliska@suse.cz>
146 * Make-lang.in: Remove repo.o.
147 * config-lang.in: Likewise.
148 * cp-tree.h (init_repo): Remove declarations
149 of repo-related functions.
150 (repo_emit_p): Likewise.
151 (repo_export_class_p): Likewise.
152 (finish_repo): Likewise.
153 * decl2.c (import_export_class): Always
155 (mark_needed): Remove -frepo from comment.
156 (import_export_decl): Similarly here.
157 (c_parse_final_cleanups): Remove call of finish_repo.
158 * lex.c (cxx_init): Remove call to init_repo.
159 * optimize.c (can_alias_cdtor): Remove dead condition.
160 * pt.c (push_template_decl_real): Update comment.
161 (instantiate_decl): Remove dead code used for -frepo.
164 2019-09-05 Marek Polacek <polacek@redhat.com>
166 PR c++/91644 - ICE with constinit in function template.
167 * decl.c (start_decl): Call retrofit_lang_decl for constinit variables.
168 * pt.c (tsubst_expr): Pass LOOKUP_CONSTINIT down to cp_finish_decl for
171 2019-09-05 Nathan Sidwell <nathan@acm.org>
173 * cp-tree.h (DECL_VTABLE_OR_VTT_P): Forward to DECL_VIRTUAL_P.
175 2019-09-04 Marek Polacek <polacek@redhat.com>
177 * call.c (build_over_call): Remove -fdeduce-init-list implementation.
178 * pt.c (unify): Likewise.
180 2019-09-01 Marek Polacek <polacek@redhat.com>
182 PR c++/91129 - wrong error with binary op in template argument.
183 * typeck.c (warn_for_null_address): Use fold_for_warn instead of
184 fold_non_dependent_expr.
185 (cp_build_binary_op): Likewise.
187 2019-08-30 Jason Merrill <jason@redhat.com>
189 Add source location to TRAIT_EXPR.
190 * cp-tree.h (TRAIT_EXPR_LOCATION): New.
191 (struct tree_trait_expr): Add locus field.
192 * parser.c (cp_parser_trait_expr): Pass trait_loc down.
193 * pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Likewise.
194 * semantics.c (finish_trait_expr): Add location parm.
195 * tree.c (cp_expr_location): Handle TRAIT_EXPR.
197 2019-08-29 Paolo Carlini <paolo.carlini@oracle.com>
199 * decl.c (check_var_type): Add location_t parameter and use it.
200 (grokdeclarator): Adjust call.
201 * pt.c (tsubst_decl): Likewise.
202 * cp-tree.h: Adjust declaration.
204 2019-08-28 Marek Polacek <polacek@redhat.com>
206 Implement P1152R4: Deprecating some uses of volatile.
208 * cp-gimplify.c (cp_fold): Set TREE_THIS_VOLATILE.
209 * decl.c (grokdeclarator): Warn about a volatile-qualified structured
210 binding and return type.
211 (grokparms): Warn about a volatile-qualified function parameter.
212 * expr.c (mark_use) <case MODIFY_EXPR>: Emit a -Wvolatile warning.
213 * typeck.c (cp_build_unary_op): Emit a -Wvolatile warning for pre and
214 post ++/-- on a volatile operand.
215 (genericize_compound_lvalue): Use a better location. Don't lose
217 (cp_build_modify_expr): Emit a -Wvolatile warning for a compound
218 assignment whose LHS is volatile-qualified. Build the assignment with
219 a more precise location.
221 2019-08-28 Marek Polacek <polacek@redhat.com>
223 PR c++/91360 - Implement C++20 P1143R2: constinit.
224 * cp-tree.h (TINFO_VAR_DECLARED_CONSTINIT): Define.
225 (LOOKUP_CONSTINIT): Define.
226 (enum cp_decl_spec): Add ds_constinit.
227 * decl.c (check_tag_decl): Give an error for constinit in type
229 (check_initializer): Also check LOOKUP_CONSTINIT.
230 (cp_finish_decl): Add checking for a constinit declaration. Set
231 TINFO_VAR_DECLARED_CONSTINIT.
232 (grokdeclarator): Add checking for a declaration with the constinit
234 * lex.c (init_reswords): Handle D_CXX20.
235 * parser.c (cp_lexer_get_preprocessor_token): Pass a better location
236 to warning_at. Warn about C++20 keywords.
237 (cp_keyword_starts_decl_specifier_p): Handle RID_CONSTINIT.
238 (cp_parser_diagnose_invalid_type_name): Add an inform about constinit.
239 (cp_parser_decomposition_declaration): Maybe pass LOOKUP_CONSTINIT to
241 (cp_parser_decl_specifier_seq): Handle RID_CONSTINIT.
242 (cp_parser_init_declarator): Maybe pass LOOKUP_CONSTINIT to
244 (set_and_check_decl_spec_loc): Add "constinit".
245 * pt.c (tsubst_decl): Set TINFO_VAR_DECLARED_CONSTINIT.
246 (instantiate_decl): Maybe pass LOOKUP_CONSTINIT to cp_finish_decl.
247 * typeck2.c (store_init_value): If a constinit variable wasn't
248 initialized using a constant initializer, give an error.
250 2019-08-28 Nathan Sidwell <nathan@acm.org>
253 * name-lookup.c (cp_emit_debug_info): Check for builtins during
256 2019-08-27 Marek Polacek <polacek@redhat.com>
258 PR c++/81676 - bogus -Wunused warnings in constexpr if.
259 * semantics.c (maybe_mark_exp_read_r): New function.
260 (finish_if_stmt): Call it on THEN_CLAUSE and ELSE_CLAUSE.
262 PR c++/91428 - warn about std::is_constant_evaluated in if constexpr.
263 * cp-tree.h (decl_in_std_namespace_p): Declare.
264 * semantics.c (is_std_constant_evaluated_p): New.
265 (finish_if_stmt_cond): Warn about "std::is_constant_evaluated ()" in
267 * typeck.c (decl_in_std_namespace_p): No longer static.
269 2019-08-26 Jason Merrill <jason@redhat.com>
271 * decl.c (duplicate_decls): Always merge DECL_DECLARED_CONSTEXPR_P.
273 2019-08-26 Marek Polacek <polacek@redhat.com>
275 PR c++/91545 - ICE in constexpr store evaluation.
276 * constexpr.c (cxx_eval_store_expression): Check FIELD_DECL instead
279 2019-08-24 Nathan Sidwell <nathan@acm.org>
281 * class.c (check_for_overrides): Conversion operators need
284 2019-08-24 Paolo Carlini <paolo.carlini@oracle.com>
286 * semantics.c (finish_switch_cond): Improve error message location.
288 2019-08-23 Jason Merrill <jason@redhat.com>
290 * decl2.c (decl_dependent_p): New.
291 (mark_used): Check it instead of just processing_template_decl.
293 2019-08-23 Jason Merrill <jason@redhat.com>
295 * parser.c (cp_parser_nested_name_specifier_opt): Avoid redundant
298 2019-08-23 Marek Polacek <polacek@redhat.com>
300 PR c++/91521 - wrong error with operator->.
301 * decl.c (grokdeclarator): Return error_mark_node for an invalid
302 trailing return type.
304 PR c++/79817 - attribute deprecated on namespace.
305 * cp-tree.h (cp_warn_deprecated_use_scopes): Declare.
306 * decl.c (grokdeclarator): Call cp_warn_deprecated_use_scopes.
307 (type_is_deprecated): Likewise.
308 * decl2.c (cp_warn_deprecated_use_scopes): New function.
309 * name-lookup.c (handle_namespace_attrs): Handle attribute deprecated.
310 * parser.c (cp_parser_namespace_alias_definition): Call
311 cp_warn_deprecated_use_scopes.
312 (cp_parser_using_declaration): Likewise.
313 (cp_parser_using_directive): Likewise.
314 * semantics.c (finish_id_expression_1): Likewise.
316 2019-08-23 Nathan Sidwell <nathan@acm.org>
318 * class.c (check_for_override): Checking IDENTIFIER_VIRTUAL_P is
319 sufficient, reorder DECL_OVERRIDE_P check.
321 2019-08-23 Iain Sandoe <iain@sandoe.co.uk>
324 * parser.c (cp_parser_initial_pragma): Call c_common_no_more_pch ()
325 after determining that the first token is not
326 PRAGMA_GCC_PCH_PREPROCESS.
328 2019-08-22 Marek Polacek <polacek@redhat.com>
330 PR c++/91304 - prefix attributes ignored in condition.
331 * parser.c (cp_parser_condition): Handle prefix attributes.
333 2019-08-21 Richard Sandiford <richard.sandiford@arm.com>
336 * decl.c (duplicate_decls): Call copy_attributes_to_builtin inside
337 the BUILT_IN_NORMAL block rather than afterward.
339 2019-08-19 Marek Polacek <polacek@redhat.com>
341 PR c++/91264 - detect modifying const objects in constexpr.
342 * constexpr.c (modifying_const_object_error): New function.
343 (cxx_eval_call_expression): Set TREE_READONLY on a CONSTRUCTOR of
344 a const-qualified object after it's been fully constructed.
345 (modifying_const_object_p): New function.
346 (cxx_eval_store_expression): Detect modifying a const object
347 during constant expression evaluation.
348 (cxx_eval_increment_expression): Use a better location when building
350 (cxx_eval_constant_expression) <case DECL_EXPR>: Mark a constant
351 object's constructor TREE_READONLY.
353 2019-08-15 Jason Merrill <jason@redhat.com>
355 PR c++/90393 - ICE with thow in ?:
357 PR c++/64372, DR 1560 - Gratuitous lvalue-to-rvalue conversion in ?:
358 * tree.c (lvalue_kind): Handle throw in one arm.
359 * typeck.c (rationalize_conditional_expr): Likewise.
360 (cp_build_modify_expr): Likewise.
362 2019-08-14 Jason Merrill <jason@redhat.com>
364 Implement P0848R3, Conditionally Trivial Special Member Functions.
365 * tree.c (special_memfn_p): New.
366 * class.c (add_method): When overloading, hide ineligible special
368 (check_methods): Set TYPE_HAS_COMPLEX_* here.
369 * decl.c (grok_special_member_properties): Not here.
370 * name-lookup.c (push_class_level_binding_1): Move overloaded
371 functions case down, accept FUNCTION_DECL as target_decl.
373 2019-08-14 Jonathan Wakely <jwakely@redhat.com>
376 * name-lookup.c (get_std_name_hint): Fix min_dialect field for
377 complex_literals and make_unique entries.
379 2019-08-14 Jakub Jelinek <jakub@redhat.com>
380 Marek Polacek <polacek@redhat.com>
382 PR c++/91391 - bogus -Wcomma-subscript warning.
383 * parser.c (cp_parser_postfix_open_square_expression): Don't warn about
384 a deprecated comma here. Pass warn_comma_subscript down to
385 cp_parser_expression.
386 (cp_parser_expression): New bool parameter. Warn about uses of a comma
387 operator within a subscripting expression.
388 (cp_parser_skip_to_closing_square_bracket): Revert to pre-r274121 state.
389 (cp_parser_skip_to_closing_square_bracket_1): Remove.
391 2019-08-14 Jonathan Wakely <jwakely@redhat.com>
393 * name-lookup.c (get_std_name_hint): Add more entries.
395 2019-08-14 Paolo Carlini <paolo.carlini@oracle.com>
397 * decl2.c (grok_array_decl): Use the location of the open square
398 bracket in error message about invalid types.
400 2019-08-14 Paolo Carlini <paolo.carlini@oracle.com>
402 * decl.c (grokdeclarator): Check here for typedef a function
403 definition or a member function definition.
404 (start_function): Adjust.
405 (grokmethod): Likewise.
407 2019-08-13 Richard Sandiford <richard.sandiford@arm.com>
410 * decl.c (duplicate_decls): Use copy_decl_built_in_function.
411 * pt.c (declare_integer_pack): Use set_decl_built_in_function.
413 2019-08-13 Marek Polacek <polacek@redhat.com>
415 PR c++/90473 - wrong code with nullptr in default argument.
416 * call.c (null_ptr_cst_p): Update quote from the standard.
417 * decl.c (check_default_argument): Don't return nullptr when the arg
420 2019-08-13 Marek Polacek <polacek@redhat.com>
422 * cp-tree.h (DECL_MUTABLE_P): Use FIELD_DECL_CHECK.
424 2019-08-10 Jakub Jelinek <jakub@redhat.com>
426 * parser.c (cp_parser_omp_clause_name): Parse device_type.
427 (cp_parser_omp_clause_device_type): New function.
428 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DEVICE_TYPE.
429 (OMP_DECLARE_TARGET_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DEVICE_TYPE.
430 (cp_parser_omp_declare_target): Handle device_type clauses. Remove
431 diagnostics for declare target with clauses nested in clause-less
432 declare target declaration-definition-seq.
433 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DEVICE_TYPE.
435 2019-08-09 Jakub Jelinek <jakub@redhat.com>
437 * parser.c (check_no_duplicate_clause): Simplify using
439 (cp_parser_omp_clause_if): Fix up printing of target {enter,exit} data
440 directive name modifiers.
443 * parser.c (cp_parser_omp_clause_dist_schedule): Comment out the
444 check_no_duplicate_clause call, instead emit a warning for duplicate
445 dist_schedule clauses.
447 2019-08-08 Paolo Carlini <paolo.carlini@oracle.com>
449 * decl.c (grokdeclarator): Use id_loc and EXPR_LOCATION in
450 a few error messages.
452 2019-08-08 Marek Polacek <polacek@redhat.com>
454 PR c++/87519 - bogus warning with -Wsign-conversion.
455 * typeck.c (cp_build_binary_op): Use same_type_p instead of comparing
458 * constexpr.c (inline_asm_in_constexpr_error): New.
459 (cxx_eval_constant_expression) <case ASM_EXPR>: Call it.
460 (potential_constant_expression_1) <case ASM_EXPR>: Likewise.
462 2019-08-08 Jakub Jelinek <jakub@redhat.com>
464 * semantics.c (finish_omp_clauses): For C_ORT_OMP
465 OMP_CLAUSE_USE_DEVICE_* clauses use oacc_reduction_head bitmap
466 instead of generic_head to track duplicates.
468 2019-08-07 Marek Polacek <polacek@redhat.com>
470 PR c++/81429 - wrong parsing of constructor with C++11 attribute.
471 * parser.c (cp_parser_constructor_declarator_p): Handle the scenario
472 when a parameter declaration begins with [[attribute]].
474 2019-08-07 Marek Polacek <polacek@redhat.com>
476 PR c++/91346 - Implement P1668R1, allow unevaluated asm in constexpr.
477 * constexpr.c (cxx_eval_constant_expression): Handle ASM_EXPR.
478 (potential_constant_expression_1) <case ASM_EXPR>: Allow.
479 * cp-tree.h (finish_asm_stmt): Adjust.
480 * parser.c (cp_parser_asm_definition): Grab the locaion of "asm" and
481 use it. Change an error to a pedwarn. Allow asm in C++2a, warn
483 * pt.c (tsubst_expr): Pass a location down to finish_asm_stmt.
484 * semantics.c (finish_asm_stmt): New location_t parameter. Use it.
486 2019-08-07 Jakub Jelinek <jakub@redhat.com>
488 * parser.c (cp_parser_omp_clause_name): Parse use_device_addr clause.
489 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR.
490 (OMP_TARGET_DATA_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR.
491 (cp_parser_omp_target_data): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR
492 like PRAGMA_OMP_CLAUSE_USE_DEVICE_PTR, adjust diagnostics about no
493 map or use_device_* clauses.
494 * semantics.c (finish_omp_clauses): For OMP_CLAUSE_USE_DEVICE_PTR
495 in OpenMP, require pointer or reference to pointer type rather than
496 pointer or array or reference to pointer or array type. Handle
497 OMP_CLAUSE_USE_DEVICE_ADDR.
498 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_USE_DEVICE_ADDR.
500 2019-08-06 Jason Merrill <jason@redhat.com>
502 PR c++/91378 - ICE with noexcept and auto return type.
503 * pt.c (maybe_instantiate_noexcept): push_to_top_level.
505 2019-08-06 Paolo Carlini <paolo.carlini@oracle.com>
507 * decl.c (check_array_designated_initializer): Use
508 cp_expr_loc_or_input_loc in one place.
510 2019-08-06 Jakub Jelinek <jakub@redhat.com>
512 * parser.c (cp_parser_omp_for_loop): For OMP_LOOP, ignore parallel
513 clauses and predetermine iterator as lastprivate.
514 * semantics.c (handle_omp_for_class_iterator): Use
515 OMP_CLAUSE_LASTPRIVATE_LOOP_IV instead of
516 OMP_CLAUSE_LASTPRIVATE_TASKLOOP_IV, set it for lastprivate also
517 on OMP_LOOP construct. If a clause is missing for class iterator
518 on OMP_LOOP, add firstprivate clause, and if there is private
519 clause, turn it into firstprivate too.
520 (finish_omp_for): Formatting fix. For OMP_LOOP, adjust
521 OMP_CLAUSE_LASTPRIVATE_LOOP_IV clause CP_CLAUSE_INFO, so that it
522 uses copy ctor instead of default ctor.
523 * cp-gimplify.c (cp_gimplify_expr): Handle OMP_LOOP like
525 (cp_fold_r): Likewise.
526 (cp_genericize_r): Likewise.
527 (cxx_omp_finish_clause): Also finish lastprivate clause with
528 OMP_CLAUSE_LASTPRIVATE_LOOP_IV flag.
529 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_BIND.
530 (tsubst_omp_for_iterator): For OMP_LOOP, ignore parallel
531 clauses and predetermine iterator as lastprivate.
532 * constexpr.c (potential_constant_expression_1): Handle OMP_LOOP
533 like OMP_DISTRIBUTE etc.
535 2019-08-05 Marek Polacek <polacek@redhat.com>
537 DR 2413 - typename in conversion-function-ids.
538 * parser.c (cp_parser_conversion_type_id): Call
539 cp_parser_type_specifier_seq with CP_PARSER_FLAGS_TYPENAME_OPTIONAL
540 instead of CP_PARSER_FLAGS_NONE.
542 2019-08-05 Paolo Carlini <paolo.carlini@oracle.com>
544 * cp-tree.h (cp_expr_loc_or_input_loc): New.
545 (cxx_incomplete_type_diagnostic): Use it.
546 * call.c (build_converted_constant_expr_internal, convert_like_real,
547 convert_arg_to_ellipsis, convert_for_arg_passing, build_over_call,
548 build_cxx_call, perform_implicit_conversion_flags,
549 initialize_reference): Likewise.
550 * constexpr.c (cxx_eval_internal_function, cxx_eval_call_expression,
551 eval_and_check_array_index, cxx_eval_store_expression,
552 cxx_eval_statement_list, cxx_eval_loop_expr,
553 cxx_eval_constant_expression, potential_constant_expression_1):
555 * constraint.cc (check_for_logical_overloads,
556 satisfy_predicate_constraint): Likewise.
557 * cp-gimplify.c (cp_gimplify_expr): Likewise.
558 * cvt.c (cp_convert_to_pointer, convert_to_reference,
559 cp_convert_and_check, ocp_convert, maybe_warn_nodiscard): Likewise.
560 * decl.c (pop_switch): Likewise.
561 * decl2.c (delete_sanity): Likewise.
562 * error.c (location_of): Likewise.
563 * init.c (maybe_warn_list_ctor, build_aggr_init,
564 warn_placement_new_too_small, build_new_1, build_vec_init): Likewise.
565 * lex.c (unqualified_name_lookup_error): Likewise.
566 * parser.c (cp_parser_initializer_list, cp_parser_omp_for_cond):
568 * pt.c (check_for_bare_parameter_packs, check_valid_ptrmem_cst_expr,
569 unify_arg_conversion, convert_nontype_argument,
570 tsubst_copy_and_build, resolve_typename_type): Likewise.
571 * semantics.c (maybe_convert_cond, finish_call_expr,
572 cp_build_vec_convert): Likewise.
573 * typeck.c (decay_conversion, rationalize_conditional_expr,
574 cp_build_unary_op, build_x_compound_expr_from_list,
575 maybe_warn_about_returning_address_of_local,
576 maybe_warn_pessimizing_move): Likewise.
577 * typeck2.c (check_narrowing, digest_init_r,
578 process_init_constructor_array): Likewise.
580 2019-08-05 Tom Honermann <tom@honermann.net>
582 * parser.c (cp_parser_template_declaration_after_parameters): Enable
583 class template argument deduction for non-type template parameters
584 in literal operator templates.
586 2019-08-05 Marek Polacek <polacek@redhat.com>
588 PR c++/91338 - Implement P1161R3: Deprecate a[b,c].
589 * parser.c (cp_parser_postfix_open_square_expression): Warn about uses
590 of a comma operator within a subscripting expression.
591 (cp_parser_skip_to_closing_square_bracket_1): New function, made out
593 (cp_parser_skip_to_closing_square_bracket): ...this.
595 2019-08-05 Jason Merrill <jason@redhat.com>
597 * semantics.c (force_paren_expr): Preserve location.
599 2019-08-02 Marek Polacek <polacek@redhat.com>
601 PR c++/91230 - wrong error with __PRETTY_FUNCTION__ and generic lambda.
602 * pt.c (value_dependent_expression_p): Consider __PRETTY_FUNCTION__
603 inside a template function value-dependent.
605 2019-08-02 Paolo Carlini <paolo.carlini@oracle.com>
607 * tree.c (handle_nodiscard_attribute): Do not warn about nodiscard
608 applied to a constructor.
610 2019-08-02 Martin Liska <mliska@suse.cz>
612 * decl.c (grok_op_properties):
613 Mark DECL_SET_IS_OPERATOR_DELETE for user-provided delete operators.
615 2019-08-01 Martin Sebor <msebor@redhat.com>
618 * decl.c (reshape_init_array_1): Avoid truncating initializer
619 lists containing string literals.
621 2019-08-01 Marek Polacek <polacek@redhat.com>
623 PR c++/90805 - detect narrowing in case values.
624 * decl.c (case_conversion): Detect narrowing in case values.
626 2019-07-31 Paolo Carlini <paolo.carlini@oracle.com>
628 * decl2.c (delete_sanity): Improve diagnostic locations, use
629 cp_expr_loc_or_loc in four places.
631 2019-07-31 Jason Merrill <jason@redhat.com>
633 PR c++/90538 - multiple expansions of capture packs
634 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): Remove.
635 * lambda.c (add_capture): Copy parameter packs from init.
636 (lambda_capture_field_type): Always use auto for init-capture.
637 * pt.c (uses_parameter_packs): Return tree.
638 (tsubst) [DECLTYPE_TYPE]: Remove init-capture handling.
639 (gen_elem_of_pack_expansion_instantiation): Don't push
640 local_specialization_stack.
641 (prepend_one_capture): New.
642 (tsubst_lambda_expr): Use it. Don't touch local_specializations.
643 (do_auto_deduction): Avoid redundant error.
645 Fix copy_node of TEMPLATE_INFO.
646 * cp-tree.h (struct tree_template_info): Use tree_base instead of
647 tree_common. Add tmpl and args fields.
648 (TI_TEMPLATE, TI_ARGS): Adjust.
650 2019-07-30 Martin Liska <mliska@suse.cz>
652 PR tree-optimization/91270
653 * tree-ssa-dce.c (propagate_necessity): Mark 2nd argument
654 of delete operator as needed.
656 2019-07-25 Martin Liska <mliska@suse.cz>
657 Dominik Infuhr <dominik.infuehr@theobroma-systems.com>
660 * decl.c (cxx_init_decl_processing): Mark delete operators
661 with DECL_SET_IS_OPERATOR_DELETE.
663 2019-07-25 Martin Liska <mliska@suse.cz>
665 * decl.c (duplicate_decls): Use new macros
666 (e.g. DECL_SET_LAMBDA_FUNCTION and DECL_LAMBDA_FUNCTION_P).
667 (cxx_init_decl_processing): Likewise.
668 (grok_op_properties): Likewise.
669 * parser.c (cp_parser_lambda_declarator_opt): Likewise.
671 2019-07-24 Martin Sebor <msebor@redhat.com>
674 * decl.c (finish_function): Use lang_mask.
676 2019-07-20 Jason Merrill <jason@redhat.com>
678 * cp-tree.h (ovl_iterator::using_p): A USING_DECL by itself was also
679 introduced by a using-declaration.
681 2019-07-20 Jason Merrill <jason@redhat.com>
683 Reduce memory consumption for push/pop_access_scope.
684 * name-lookup.c (leave_scope): Do add class levels other than
685 previous_class_level to free_binding_level.
686 (invalidate_class_lookup_cache): Move from class.c, add to
688 * pt.c (saved_access_scope): Change from list to vec.
690 2019-07-20 Jakub Jelinek <jakub@redhat.com>
692 * cp-tree.h (OMP_FOR_GIMPLIFYING_P): Use OMP_LOOPING_CHECK
693 instead of OMP_LOOP_CHECK.
694 * parser.c (cp_parser_omp_clause_name): Handle bind clause.
695 (cp_parser_omp_clause_bind): New function.
696 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_BIND.
697 (OMP_LOOP_CLAUSE_MASK): Define.
698 (cp_parser_omp_loop): New function.
699 (cp_parser_omp_parallel, cp_parser_omp_teams): Handle parsing of
700 loop combined with parallel or teams.
701 (cp_parser_omp_construct): Handle PRAGMA_OMP_LOOP.
702 (cp_parser_pragma): Likewise.
703 * pt.c (tsubst_expr): Handle OMP_LOOP.
704 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_BIND.
706 2019-07-19 Jason Merrill <jason@redhat.com>
708 PR c++/90101 - dependent class non-type parameter.
709 * pt.c (invalid_nontype_parm_type_p): Check for dependent class type.
711 2019-07-18 Jason Merrill <jason@redhat.com>
713 PR c++/90098 - partial specialization and class non-type parms.
716 * call.c (build_converted_constant_expr_internal): Don't copy.
717 * pt.c (process_partial_specialization): Allow VIEW_CONVERT_EXPR
718 around class non-type parameter.
719 (unify) [TEMPLATE_PARM_INDEX]: Ignore cv-quals.
721 2019-07-16 Jason Merrill <jason@redhat.com>
723 * parser.c (make_location): Add overload taking cp_lexer* as last
726 * parser.c (cp_parser_simple_type_specifier): Separate tentative
727 parses for optional type-spec and CTAD.
729 * parser.c (cp_parser_nested_name_specifier_opt): If the token is
730 already CPP_NESTED_NAME_SPECIFIER, leave it alone.
732 2019-07-12 Jakub Jelinek <jakub@redhat.com>
734 * parser.c (cp_parser_omp_clause_name): Handle order clause.
735 (cp_parser_omp_clause_order): New function.
736 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ORDER.
737 (OMP_SIMD_CLAUSE_MASK, OMP_FOR_CLAUSE_MASK): Add
738 PRAGMA_OMP_CLAUSE_ORDER.
739 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_ORDER.
740 * pt.c (tsubst_omp_clauses): Likewise.
742 2019-07-10 Paolo Carlini <paolo.carlini@oracle.com>
744 * decl.c (get_type_quals,
745 smallest_type_location (const cp_decl_specifier_seq*)): New.
746 (check_tag_decl): Use smallest_type_location in error_at about
747 multiple types in one declaration.
748 (grokdeclarator): Use locations[ds_complex] in error_at about
749 complex invalid; use locations[ds_storage_class] in error_at
750 about static cdtor; use id_loc in error_at about flexible
751 array member in union; use get_type_quals.
753 2019-07-09 Martin Sebor <msebor@redhat.com>
756 * cp-tree.h: Change class-key of PODs to struct and others to class.
758 * semantics.c (finalize_nrv_r): Same.
760 2019-07-09 Martin Sebor <msebor@redhat.com>
763 * constexpr.c (cxx_eval_call_expression): Change class-key from class
764 to struct and vice versa to match convention and avoid -Wclass-is-pod
766 * constraint.cc (get_concept_definition): Same.
768 * cxx-pretty-print.h: Same.
770 * logic.cc (term_list::replace): Same.
771 * name-lookup.c (find_local_binding): Same.
772 * pt.c (tsubst_binary_right_fold): Same.
773 * search.c (field_accessor_p): Same.
774 * semantics.c (expand_or_defer_fn): Same.
776 2019-07-08 Jakub Jelinek <jakub@redhat.com>
779 * decl2.c (cp_omp_mappable_type_1): Don't emit any note for
780 error_mark_node type.
782 2019-07-05 Jakub Jelinek <jakub@redhat.com>
786 * call.c (build_new_method_call_1): Remove set but not used variable
789 2019-07-05 Paolo Carlini <paolo.carlini@oracle.com>
793 * call.c (build_over_call): Devirtualize user-defined operators
794 coming from a base too.
795 (build_new_method_call_1): Do not devirtualize here.
797 2019-07-04 Marek Polacek <polacek@redhat.com>
800 PR c++/83374 - __is_standard_layout wrong for a class with repeated
802 * class.c (check_bases): Set CLASSTYPE_NON_STD_LAYOUT for a class if
803 CLASSTYPE_REPEATED_BASE_P is true.
805 2019-07-04 Andrew Stubbs <ams@codesourcery.com>
807 * cp-tree.h (cp_omp_emit_unmappable_type_notes): New prototype.
808 * decl.c (cp_finish_decl): Call cp_omp_emit_unmappable_type_notes.
809 * decl2.c (cp_omp_mappable_type): Move contents to ...
810 (cp_omp_mappable_type_1): ... here and add note output.
811 (cp_omp_emit_unmappable_type_notes): New function.
812 * semantics.c (finish_omp_clauses): Call
813 cp_omp_emit_unmappable_type_notes in four places.
815 2019-07-03 Martin Liska <mliska@suse.cz>
817 * call.c (build_new_op_1): Remove dead assignemts.
818 * typeck.c (cp_build_binary_op): Likewise.
820 2019-06-27 Jason Merrill <jason@redhat.com>
822 PR c++/55442 - memory-hog with highly recursive constexpr.
823 * constexpr.c (push_cx_call_context): Return depth.
824 (cxx_eval_call_expression): Don't cache past constexpr_cache_depth.
826 2019-06-27 Jan Hubicka <jh@suse.cz>
828 * class.c (layout_class_type): Set TYPE_CXX_ODR_P for as-base
831 2019-06-27 Martin Liska <mliska@suse.cz>
833 * class.c (adjust_clone_args): Remove obviously
835 (dump_class_hierarchy_r): Likewise.
836 * decl.c (check_initializer): Likewise.
837 * parser.c (cp_parser_lambda_expression): Likewise.
838 * pt.c (unify_bound_ttp_args): Likewise.
839 (convert_template_argument): Likewise.
840 * rtti.c (build_headof): Likewise.
841 * typeck.c (convert_for_initialization): Likewise.
843 2019-06-25 Jason Merrill <jason@redhat.com>
845 PR c++/70462 - unnecessary base ctor variant with final.
846 * optimize.c (populate_clone_array): Skip base variant if
848 (maybe_clone_body): We don't need an alias if we are only defining
851 * class.c (resolves_to_fixed_type_p): Check CLASSTYPE_FINAL.
853 2019-06-25 Jakub Jelinek <jakub@redhat.com>
856 * constexpr.c (cxx_eval_array_reference): Don't look through VCE from
859 2019-06-25 Jozef Lawrynowicz <jozef.l@mittosystems.com>
861 * lex.c (init_reswords): Create keyword for "__intN__" type.
862 * cp-tree.h (cp_decl_specifier_seq): New bitfield "int_n_alt".
863 * decl.c (grokdeclarator): Don't pedwarn about "__intN" ISO
864 C incompatibility if alternate "__intN__" form is used.
865 * parser.c (cp_parser_simple_type_specifier): Set
866 decl_specs->int_n_alt if "__intN__" form is used.
868 2019-06-24 Jan Hubicka <jh@suse.cz>
870 * lex.c (cxx_make_type): Set TYPE_CXX_ODR_P.
872 2019-06-24 Jason Merrill <jason@redhat.com>
874 * class.c (layout_class_type): Don't use a separate
875 CLASSTYPE_AS_BASE if it's the same size.
877 2019-06-23 Marek Polacek <polacek@redhat.com>
879 * call.c (convert_default_arg): Use DEFERRED_PARSE instead of
881 * cp-objcp-common.c (cp_tree_size): Likewise. Use tree_deferred_parse
882 instead of tree_default_arg.
883 * cp-tree.def: Rename DEFAULT_ARG to DEFERRED_PARSE.
884 * cp-tree.h: Rename DEFARG_TOKENS to DEFPARSE_TOKENS. Rename
885 DEFARG_INSTANTIATIONS to DEFPARSE_INSTANTIATIONS. Rename
886 tree_default_arg to tree_deferred_parse.
887 (UNPARSED_NOEXCEPT_SPEC_P): Use DEFERRED_PARSE instead of DEFAULT_ARG.
888 (cp_tree_node_structure_enum): Rename TS_CP_DEFAULT_ARG to
889 TS_CP_DEFERRED_PARSE.
890 (lang_tree_node): Rename tree_default_arg to tree_deferred_parse.
891 Rename default_arg to deferred_parse. Use TS_CP_DEFERRED_PARSE instead
892 of TS_CP_DEFAULT_ARG.
893 (defarg_location): Remove declaration.
894 (defparse_location): Add declaration.
895 * decl.c (grokfndecl): Use DEFERRED_PARSE instead of DEFAULT_ARG.
896 Call defparse_location instead of defarg_location.
897 (check_default_argument): Use DEFERRED_PARSE instead of DEFAULT_ARG.
898 (cp_tree_node_structure): Likewise. Use TS_CP_DEFERRED_PARSE instead
899 of TS_CP_DEFAULT_ARG.
900 * decl2.c (grokfield): Use DEFERRED_PARSE instead of DEFAULT_ARG.
901 * error.c (dump_expr): Likewise.
902 (location_of): Likewise.
903 * init.c (get_nsdmi): Likewise.
904 * parser.c (cp_parser_save_noexcept): Likewise. Use DEFPARSE_TOKENS
905 instead of DEFARG_TOKENS.
906 (cp_parser_late_noexcept_specifier): Likewise.
907 (cp_parser_late_parse_one_default_arg): Use DEFPARSE_TOKENS instead
909 (cp_parser_late_parsing_default_args): Use DEFERRED_PARSE instead of
910 DEFAULT_ARG. Use DEFPARSE_INSTANTIATIONS instead of
911 DEFARG_INSTANTIATIONS.
912 (cp_parser_cache_defarg): Use DEFERRED_PARSE instead of DEFAULT_ARG.
913 Use DEFPARSE_TOKENS instead of DEFARG_TOKENS. Use
914 DEFPARSE_INSTANTIATIONS instead of DEFARG_INSTANTIATIONS.
915 (defparse_location): Renamed from defarg_location.
916 * pt.c (tsubst_default_argument): Use DEFERRED_PARSE instead of
918 (tsubst_arg_types): Likewise.
919 (dependent_type_p_r): Likewise.
920 * tree.c (cp_tree_equal): Likewise.
921 (cp_walk_subtrees): Likewise.
922 * typeck.c (convert_arguments): Likewise.
924 2019-06-22 Marek Polacek <polacek@redhat.com>
926 PR c++/86476 - noexcept-specifier is a complete-class context.
928 * cp-tree.def (DEFAULT_ARG): Update commentary.
929 * cp-tree.h (UNPARSED_NOEXCEPT_SPEC_P): New macro.
930 (tree_default_arg): Use tree_base instead of tree_common.
931 (do_push_parm_decls, maybe_check_overriding_exception_spec): Declare.
932 * decl.c (do_push_parm_decls): New function, broken out of...
933 (store_parm_decls): ...here. Call it.
934 * except.c (nothrow_spec_p): Accept DEFAULT_ARG in the assert.
935 * parser.c (cp_parser_noexcept_specification_opt,
936 cp_parser_late_noexcept_specifier, noexcept_override_late_checks):
938 (unparsed_noexcepts): New macro.
939 (push_unparsed_function_queues): Update initializer.
940 (cp_parser_direct_declarator): Pass FRIEND_P to
941 cp_parser_exception_specification_opt.
942 (inject_parm_decls): New.
943 (pop_injected_parms): New.
944 (cp_parser_class_specifier_1): Implement delayed parsing of
946 (cp_parser_save_noexcept): New.
947 (cp_parser_late_noexcept_specifier): New.
948 (noexcept_override_late_checks): New.
949 (cp_parser_noexcept_specification_opt): Add FRIEND_P parameter. Call
950 cp_parser_save_noexcept instead of the normal processing if needed.
951 (cp_parser_exception_specification_opt): Add FRIEND_P parameter and
952 pass it to cp_parser_noexcept_specification_opt.
953 (cp_parser_save_member_function_body): Fix comment.
954 (cp_parser_save_default_args): Maybe save the noexcept-specifier to
956 (cp_parser_transaction): Update call to
957 cp_parser_noexcept_specification_opt.
958 (cp_parser_transaction_expression): Likewise.
959 * parser.h (cp_unparsed_functions_entry): Add new field to carry
960 a noexcept-specifier.
961 * pt.c (dependent_type_p_r): Handle unparsed noexcept expression.
962 * search.c (maybe_check_overriding_exception_spec): New function, broken
964 (check_final_overrider): ...here. Call
965 maybe_check_overriding_exception_spec.
966 * tree.c (canonical_eh_spec): Handle UNPARSED_NOEXCEPT_SPEC_P.
967 (cp_tree_equal): Handle DEFAULT_ARG.
969 PR c++/90881 - bogus -Wunused-value in unevaluated context.
970 * cvt.c (convert_to_void): Don't emit unused warnings in
971 an unevaluated context.
973 2019-06-22 Paolo Carlini <paolo.carlini@oracle.com>
975 * decl.c (grokdeclarator): Use id_loc, typespec_loc, and
976 locations[ds_storage_class] in a few additional places.
978 2019-06-21 Paolo Carlini <paolo.carlini@oracle.com>
982 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
986 * call.c (build_over_call): Devirtualize when the final overrider
989 2019-06-21 Marek Polacek <polacek@redhat.com>
991 PR c++/61490 - qualified-id in friend function definition.
992 * decl.c (grokdeclarator): Diagnose qualified-id in friend function
993 definition. Improve location for diagnostics of friend functions.
995 PR c++/60223 - ICE with T{} in non-deduced context.
996 * pt.c (unify): Allow COMPOUND_LITERAL_P in a non-deduced context.
998 PR c++/64235 - missing syntax error with invalid alignas.
999 * parser.c (cp_parser_std_attribute_spec): Commit to tentative parse
1000 if there's a missing close paren.
1002 PR c++/90490 - fix decltype issues in noexcept-specifier.
1003 * except.c (build_noexcept_spec): Call
1004 instantiate_non_dependent_expr_sfinae before
1005 build_converted_constant_expr instead of calling
1006 instantiate_non_dependent_expr after it. Add
1007 processing_template_decl_sentinel.
1009 2019-06-21 Jakub Jelinek <jakub@redhat.com>
1012 * semantics.c (finish_omp_clauses): Don't reject references to
1013 incomplete types if processing_template_decl.
1015 2019-06-19 Marek Polacek <polacek@redhat.com>
1017 PR c++/60364 - noreturn after first decl not diagnosed.
1018 * decl.c (duplicate_decls): Give an error when a function is
1019 declared [[noreturn]] after its first declaration.
1020 * parser.c (cp_parser_std_attribute): Don't treat C++11 noreturn
1021 attribute as equivalent to GNU's.
1022 * tree.c (std_attribute_table): Add noreturn.
1024 2019-06-19 Jakub Jelinek <jakub@redhat.com>
1026 * cp-gimplify.c (cp_genericize_r): Handle OMP_CLAUSE_{IN,EX}CLUSIVE
1027 like OMP_CLAUSE_SHARED.
1029 2019-06-18 Jason Merrill <jason@redhat.com>
1031 * constexpr.c (cxx_eval_store_expression): Delay target evaluation.
1033 2019-06-18 Jason Merrill <jason@redhat.com>
1035 * constexpr.c (eval_and_check_array_index): Split out from...
1036 (cxx_eval_array_reference): ...here.
1037 (cxx_eval_store_expression): Use it here, too.
1038 (diag_array_subscript): Take location. Strip location wrapper.
1040 2019-06-18 Jason Merrill <jason@redhat.com>
1042 * constexpr.c (cxx_eval_constant_expression): Handle conversion from
1043 and then to the same type.
1045 2019-06-18 Jason Merrill <jason@redhat.com>
1047 * constexpr.c (unshare_constructor): Add MEM_STAT_DECL.
1049 2019-06-17 Jakub Jelinek <jakub@redhat.com>
1051 * semantics.c (finish_omp_clauses): For OMP_CLAUSE_REDUCTION_INSCAN
1052 set need_copy_assignment.
1054 2019-06-17 Marek Polacek <polacek@redhat.com>
1056 PR c++/83820 - excessive attribute arguments not detected.
1057 * parser.c (cp_parser_std_attribute): Detect excessive arguments.
1059 2019-06-17 Nathan Sidwell <nathan@acm.org>
1062 * name-lookup.c (lookup_type_scope_1): Calll qualify_lookup before
1065 2019-06-14 Marek Polacek <polacek@redhat.com>
1067 PR c++/90884 - stray note with -Wctor-dtor-privacy.
1068 * class.c (maybe_warn_about_overly_private_class): Guard the call to
1071 2019-06-12 Jason Merrill <jason@redhat.com>
1073 PR c++/85552 - wrong instantiation of dtor for DMI.
1074 * typeck2.c (digest_nsdmi_init): Set tf_no_cleanup for direct-init.
1076 2019-06-13 Paolo Carlini <paolo.carlini@oracle.com>
1078 * decl.c (grokdeclarator): Use id_loc in five additional places
1079 in the last part of the function.
1081 2019-06-13 Paolo Carlini <paolo.carlini@oracle.com>
1083 * decl.c (grokdeclarator): Move further up the declaration of
1084 id_loc, use it immediately, update its value after the loop
1085 over declarator, use it again in the final part of function;
1086 improve locations of error messages about multiple data types
1087 and conflicting specifiers.
1089 2019-06-13 Richard Biener <rguenther@suse.de>
1092 * typeck2.c (split_nonconstant_init_1): Properly count
1093 num_split_elts, optimize single constructor elt removal.
1095 2019-06-12 Marek Polacek <polacek@redhat.com>
1097 PR c++/66999 - 'this' captured by reference.
1098 * parser.c (cp_parser_lambda_introducer): Reject `&this'. Use
1099 cp_lexer_nth_token_is instead of cp_lexer_peek_nth_token.
1101 PR c++/90825 - endless recursion when evaluating sizeof.
1102 PR c++/90832 - endless recursion when evaluating sizeof.
1103 * constexpr.c (cxx_eval_constant_expression): Don't recurse on the
1104 result of fold_sizeof_expr if is returns a SIZEOF_EXPR.
1105 * typeck.c (cxx_sizeof_expr): Only return a SIZEOF_EXPR if the operand
1106 is instantiation-dependent.
1108 PR c++/90736 - bogus error with alignof.
1109 * constexpr.c (adjust_temp_type): Use cv_unqualified type.
1111 2019-06-11 Matthew Beliveau <mbelivea@redhat.com>
1113 PR c++/90449 - add -Winaccessible-base option.
1114 * class.c (warn_about_ambiguous_bases): Changed name to:
1115 maybe_warn_about_inaccessible_bases.
1116 (maybe_warn_about_inaccessible_bases): Implemented new
1117 Winaccessible-base warning option for both direct and virtual
1119 (layout_class_type): Call to warn_about_ambiguous_bases changed to fit
1122 2019-06-11 Richard Biener <rguenther@suse.de>
1125 * typeck2.c (split_nonconstant_init_1): Avoid ordered remove
1126 from CONSTRUCTOR by marking to remove elements and doing all
1127 of them in a O(n) scan.
1129 2019-06-11 Jakub Jelinek <jakub@redhat.com>
1132 * init.c (constant_value_1): Handle VECTOR_CST DECL_INITIAL for
1133 !DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P decls like CONSTRUCTOR.
1135 2019-06-11 Martin Liska <mliska@suse.cz>
1138 * pt.c (init_template_processing): Disable hash table
1139 sanitization for decl_specializations and type_specializations.
1141 2019-06-10 Jason Merrill <jason@redhat.com>
1143 * constexpr.c (free_constructor): New.
1144 (cxx_eval_call_expression): Free parameter value CONSTRUCTORs.
1146 * constexpr.c (unshare_constructor): Only unshare if T is itself a
1148 (cxx_eval_call_expression): Don't call it on the result here.
1150 Reduce constexpr_call memory consumption.
1151 * constexpr.c (cxx_bind_parameters_in_call): Use TREE_VEC rather
1153 (constexpr_call_hasher::equal, cxx_bind_parameters_in_call)
1154 (cxx_eval_call_expression): Adjust.
1156 2019-06-10 Jakub Jelinek <jakub@redhat.com>
1158 * parser.c (cp_parser_omp_clause_reduction): Don't sorry_at on inscan
1160 (cp_parser_omp_scan_loop_body): New function.
1161 (cp_parser_omp_for_loop): Call cp_parser_omp_scan_loop_body if there
1162 are inscan reduction clauses.
1163 (cp_parser_pragma): Reject PRAGMA_OMP_SCAN.
1164 * semantics.c (finish_omp_clauses): Reject mixing inscan with
1165 non-inscan reductions on the same construct, or inscan reductions with
1166 ordered or schedule clauses, or inscan array reductions.
1167 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_{IN,EX}CLUSIVE.
1168 (tsubst_expr): Handle OMP_SCAN.
1170 2019-06-07 Jason Merrill <jason@redhat.com>
1172 * constexpr.c (cxx_eval_constant_expression): Call
1173 STRIP_ANY_LOCATION_WRAPPER early.
1174 [CONVERT_EXPR]: Don't build anything for conversion to void.
1175 [ADDR_EXPR]: ggc_free unused ADDR_EXPR.
1177 2019-06-05 Martin Sebor <msebor@redhat.com>
1180 * typeck.c (maybe_warn_about_returning_address_of_local): Only
1181 consider functions returning pointers as candidates for
1182 -Wreturn-local-addr.
1184 2019-06-05 Paolo Carlini <paolo.carlini@oracle.com>
1186 * decl.c (smallest_type_location): New.
1187 (check_special_function_return_type): Use it.
1188 (grokdeclarator): Lkewise.
1190 2019-06-05 Paolo Carlini <paolo.carlini@oracle.com>
1192 * decl.c (grokdeclarator): Use locations[ds_friend]
1195 2019-06-05 Martin Sebor <msebor@redhat.com>
1197 * call.c (build_conditional_expr_1): Adjust quoting and hyphenation.
1198 (convert_like_real): Same.
1199 (convert_arg_to_ellipsis): Same.
1200 * constexpr.c (diag_array_subscript): Same.
1201 * constraint.cc (diagnose_trait_expression): Same.
1202 * cvt.c (ocp_convert): Same.
1203 * decl.c (start_decl): Same.
1204 (check_for_uninitialized_const_var): Same.
1206 (check_special_function_return_type): Same.
1207 (finish_enum_value_list): Same.
1208 (start_preparsed_function): Same.
1209 * parser.c (cp_parser_decl_specifier_seq): Same.
1210 * typeck.c (cp_build_binary_op): Same.
1211 (build_static_cast_1): Same.
1213 2019-06-04 Nina Dinka Ranns <dinka.ranns@gmail.com>
1215 PR c++/63149 - Wrong auto deduction from braced-init-list.
1216 * pt.c (listify_autos): use non cv qualified auto_node in
1217 std::initializer_list<auto>.
1219 2019-06-04 Paolo Carlini <paolo.carlini@oracle.com>
1221 * decl.c (grokdeclarator): Use declarator->id_loc in two
1224 2019-06-04 Nathan Sidwell <nathan@acm.org>
1226 * name-lookup.c (lookup_type_scope_1): Reimplement, handle local
1227 and namespace scopes separately.
1229 2019-06-04 Harald van Dijk <harald@gigawatt.nl>
1231 PR c++/60531 - Wrong error about unresolved overloaded function
1232 * typeck.c (cp_build_binary_op): See if overload can be resolved.
1233 (cp_build_unary_op): Ditto.
1235 2019-06-04 Jason Merrill <jason@redhat.com>
1237 Reduce accumulated garbage in constexpr evaluation.
1238 * constexpr.c (cxx_eval_call_expression): ggc_free any bindings we
1240 (cxx_eval_increment_expression): ggc_free the MODIFY_EXPR after
1243 2019-06-04 Jakub Jelinek <jakub@redhat.com>
1245 * cp-tree.h (CP_OMP_CLAUSE_INFO): Allow for any clauses up to _condvar_
1246 instead of only up to linear.
1248 2019-06-03 Paolo Carlini <paolo.carlini@oracle.com>
1250 * parser.c (cp_parser_unqualified_id): Use build_min_nt_loc in
1253 2019-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
1256 * class.c (fixup_type_variants): Handle CLASSTYPE_FINAL.
1258 2019-05-31 Nathan Sidwell <nathan@acm.org>
1260 * cp-tree.h (IDENTIFIER_LAMBDA_P): New.
1262 (LAMBDA_TYPE_P, TYPE_UNNAMED_P): Likewise.
1263 (LAMBDANAME_PREFIX, LAMBDANAME_FORMAT): Delete.
1264 (make_lambda_name): Don't declare.
1265 * error.c (dump_aggr_type): Check for lambdas before other
1267 * lambda.c (begin_lambda_type): Use make_anon_name.
1268 * cp-lang.c (cxx_dwarf_name): Lambda names smell anonymous.
1269 * mangle.c (write_local_name): Likewise.
1270 * name-lookup.c (lambda_cnt, make_lambda_name): Delete.
1272 2019-05-30 Marek Polacek <polacek@redhat.com>
1274 * cp-tree.h (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Fix a typo.
1276 2019-05-31 Paolo Carlini <paolo.carlini@oracle.com>
1278 * decl.c (grokdeclarator): Use declarator->id_loc in five
1281 2019-05-29 Jakub Jelinek <jakub@redhat.com>
1284 * tree.c (lvalue_kind): Return clk_none for expressions with
1287 2019-05-29 Paolo Carlini <paolo.carlini@oracle.com>
1290 * parser.c (cp_parser_sizeof_operand): When the type-id production
1291 did not work out commit to the tentative parse.
1293 2019-05-29 Jakub Jelinek <jakub@redhat.com>
1295 P1091R3 - Extending structured bindings to be more like var decls
1296 P1381R1 - Reference capture of structured bindings
1297 * decl.c (cp_maybe_mangle_decomp): Handle TREE_STATIC decls even at
1299 (cp_finish_decomp): Copy over various decl properties from decl to
1300 v[i] in the tuple case.
1301 (grokdeclarator): Allow static, thread_local and __thread for C++2a
1302 and use pedwarn instead of error for older standard revisions.
1303 Make other structured binding diagnostic messages more i18n friendly.
1305 2019-05-28 Nathan Sidwell <nathan@acm.org>
1307 * decl.c (duplicate_decls): Assert a template newdecl has no
1310 2019-05-28 Marek Polacek <polacek@redhat.com>
1312 PR c++/90548 - ICE with generic lambda and empty pack.
1313 * pt.c (tsubst_copy_and_build): Handle pack expansion properly.
1315 2019-05-28 Nathan Sidwell <nathan@acm.org>
1317 * cp-tree.h (make_anon_name): Drop declaration.
1318 (TYPE_UNNAMED_P): Use IDENTIFIER_ANON_P.
1319 * cp-lang.c (cxx_dwarf_name): Likewise.
1320 * class.c (find_flexarrays): Likewise.
1321 * decl.c (name_unnamed_type, xref_tag_1): Likewise.
1322 * error.c (dump_aggr_type): Likewise.
1323 * pt.c (push_template_decl_real): Likewise.
1324 * name-lookup.c (consider_binding_level): Likewise.
1325 (anon_cnt, make_anon_name): Delete.
1327 2019-05-25 Marek Polacek <polacek@redhat.com>
1329 PR c++/90572 - wrong disambiguation in friend declaration.
1330 * parser.c (cp_parser_constructor_declarator_p): Don't allow missing
1331 typename for friend declarations.
1333 2019-05-23 Jonathan Wakely <jwakely@redhat.com>
1335 * cp-tree.h (CP_AGGREGATE_TYPE_P): Fix whitespace.
1337 * init.c (std_placement_new_fn_p): Remove outdated TODO comment that
1338 was resolved by r254694.
1340 2019-05-22 Jason Merrill <jason@redhat.com>
1342 PR c++/20408 - unnecessary code for empty struct.
1343 * call.c (build_call_a): Use simple_empty_class_p.
1345 PR c++/86485 - -Wmaybe-unused with empty class ?:
1346 * cp-gimplify.c (simple_empty_class_p): Also true for MODIFY_EXPR.
1348 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
1350 * parser.c (cp_parser_template_declaration_after_parameters): Use
1351 DECL_SOURCE_LOCATION in literal operator template errors.
1353 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
1357 * call.c (build_over_call): Devirtualize when the final overrider
1358 comes from the base.
1360 2019-05-21 Nathan Sidwell <nathan@acm.org>
1362 * name-lookup.c (do_nonmember_using_decl): Drop INSERT_P
1363 parameter. Document.
1364 (finish_nonmember_using_decl): Adjust do_nonmember_using_decl
1365 calls. Remove stray FIXME comment.
1367 * name-lookup.h (struct cp_binding_level): Drop usings field.
1368 (finish_namespace_using_decl, finish_local_using_decl): Replace with ...
1369 (finish_nonmember_using_decl): ... this.
1370 * name-lookup.c (push_using_decl_1, push_using_decl):
1371 (do_nonmember_using_decl): ... here. Add INSERT_P arg. Reimplement.
1372 (validate_nonmember_using_decl, finish_namespace_using_decl)
1373 (finish_local_using_decl): Replace with ...
1374 (finish_nonmember_using_decl): ... this. Drop DECL parm.
1375 * parser.c (cp_parser_using_declaration): Don't do lookup here.
1376 * pt.c (tsubst_expr): Do not do using decl lookup here.
1378 2019-05-21 Eric Botcazou <ebotcazou@adacore.com>
1380 * decl2.c (cpp_check) <IS_ASSIGNMENT_OPERATOR>: New case.
1382 2019-05-20 Marek Polacek <polacek@redhat.com>
1384 CWG 2094 - volatile scalars are trivially copyable.
1386 * tree.c (trivially_copyable_p): Don't check CP_TYPE_VOLATILE_P for
1389 2019-05-20 Marek Polacek <polacek@redhat.com>
1391 * pt.c (convert_template_argument): Add a diagnostic for the
1392 [temp.arg]/2 ambiguity case.
1394 * name-lookup.c (finish_using_directive): Don't issue inform() if the
1395 warning didn't trigger. Add quoting. Tweak the inform message.
1397 2019-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1399 * cp-tree.h: Remove remnants of CONV_NONCONVERTING.
1401 2019-05-20 Nathan Sidwell <nathan@acm.org>
1403 * name-lookup.c (finish_namespace_using_directive)
1404 (finish_local_using_directive): Merge to ...
1405 (finish_using_directive): ... here. Handle both contexts.
1406 * name-lookup.h (finish_namespace_using_directive)
1407 (finish_local_using_directive): Replace with ...
1408 (finish_using_directive): ... this.
1409 * parser.c (cp_parser_using_directive): Adjust.
1410 * pt.c (tsubst_expr): Likewise.
1412 * cp-tree.h (struct lang_decl_ns): Remove usings field.
1413 (DECL_NAMESPACE_USING): Delete.
1414 * name-lookup.c (name_lookup::search_usings): Use namespace's
1416 (name_lookup::queue_namespae): Likewise.
1417 (finish_namespace_using_directive, push_namespace): Likewise.
1418 (has_using_namespace_std_directive): Just search the entire
1421 2019-05-20 Jonathan Wakely <jwakely@redhat.com>
1423 PR c++/90532 Ensure __is_constructible(T[]) is false
1424 * method.c (is_xible_helper): Return error_mark_node for construction
1425 of an array of unknown bound.
1427 2019-05-17 Thomas Schwinge <thomas@codesourcery.com>
1430 * parser.c (cp_finalize_oacc_routine): Rework checking if already
1431 marked with an OpenACC 'routine' directive.
1434 * parser.c (cp_parser_oacc_routine)
1435 (cp_parser_late_parsing_oacc_routine): Normalize order of clauses.
1436 (cp_finalize_oacc_routine): Call oacc_verify_routine_clauses.
1439 * parser.c (cp_finalize_oacc_routine): Refer to OpenACC 'routine'
1440 clauses from "omp declare target" attribute.
1442 2019-05-16 Martin Sebor <msebor@redhat.com>
1444 * call.c (print_z_candidate): Wrap diagnostic text in a gettext
1446 (print_z_candidates): Same.
1447 (build_conditional_expr_1): Quote keywords, operators, and types
1449 (build_op_delete_call): Same.
1450 (maybe_print_user_conv_context): Wrap diagnostic text in a gettext
1452 (convert_like_real): Same.
1453 (convert_arg_to_ellipsis): Quote keywords, operators, and types
1455 (build_over_call): Same.
1456 (joust): Break up an overlong line. Wrap diagnostic text in a gettext
1458 * constexpr.c (cxx_eval_check_shift_p): Spell out >= in English.
1459 (cxx_eval_constant_expression): Quote keywords, operators, and types
1461 (potential_constant_expression_1): Same.
1462 * cp-gimplify.c (cp_genericize_r): Same.
1463 * cvt.c (maybe_warn_nodiscard): Quote keywords, operators, and types
1465 (type_promotes_to): Same.
1466 * decl.c (check_previous_goto_1): Same.
1469 (cp_finish_decl): Avoid parenthesizing a sentence for consistency.
1470 (grok_op_properties): Quote keywords, operators, and types
1472 * decl2.c (grokfield): Same.
1473 (coerce_delete_type): Same.
1474 * except.c (is_admissible_throw_operand_or_catch_parameter): Same.
1475 * friend.c (do_friend): Quote C++ tokens.
1476 * init.c (build_new_1): Quote keywords, operators, and types
1478 (build_vec_delete_1): Same.
1479 (build_delete): Same.
1480 * lex.c (parse_strconst_pragma): Same.
1481 (handle_pragma_implementation): Same.
1482 (unqualified_fn_lookup_error): Same.
1483 * mangle.c (write_type): Same.
1484 * method.c (defaulted_late_check): Avoid two consecutive punctuators.
1485 * name-lookup.c (cp_binding_level_debug): Remove a trailing newline.
1486 (pop_everything): Same.
1487 * parser.c (cp_lexer_start_debugging): Quote a macro name.
1489 (cp_lexer_stop_debugging): Same.
1490 (cp_parser_userdef_numeric_literal): Quote a C++ header name
1492 (cp_parser_nested_name_specifier_opt): Quote keywords, operators,
1493 and types in diagnostics.
1494 (cp_parser_question_colon_clause): Same.
1495 (cp_parser_asm_definition): Same.
1496 (cp_parser_init_declarator): Same.
1497 (cp_parser_template_declaration_after_parameters): Avoid capitalizing
1498 a sentence in a diagnostic.
1499 (cp_parser_omp_declare_reduction): Quote keywords, operators, and types
1501 (cp_parser_transaction): Same.
1502 * pt.c (maybe_process_partial_specialization): Replace second call
1503 to permerror with inform for consistency with other uses.
1504 (expand_integer_pack): Quote keywords, operators, and types
1506 * rtti.c (get_typeid): Quote keywords, operators, and types
1508 (build_dynamic_cast_1): Same.
1509 * semantics.c (finish_asm_stmt): Same.
1510 (finish_label_decl): Same.
1511 (finish_bases): Same.
1512 (finish_offsetof): Same.
1513 (cp_check_omp_declare_reduction): Same.
1514 (finish_decltype_type): Same.
1515 * tree.c (handle_init_priority_attribute): Same. Add detail
1517 (maybe_warn_zero_as_null_pointer_constant): Same.
1518 * typeck.c (cp_build_binary_op): Quote keywords, operators, and types
1520 (cp_build_unary_op): Same.
1521 (check_for_casting_away_constness): Same.
1522 (build_static_cast): Same.
1523 (build_const_cast_1): Same.
1524 (maybe_warn_about_returning_address_of_local): Same.
1525 (check_return_expr): Same.
1526 * typeck2.c (abstract_virtuals_error_sfinae): Same.
1527 (digest_init_r): Replace a tab with spaces in a diagnostic.
1528 (build_functional_cast): Quote keywords, operators, and types
1531 2019-05-15 Jakub Jelinek <jakub@redhat.com>
1534 * cp-gimplify.c (genericize_cp_loop): Emit a DEBUG_BEGIN_STMT
1535 before the condition (or if missing or constant non-zero at the end
1536 of the loop. Emit a DEBUG_BEGIN_STMT before the increment expression
1537 if any. Don't call protected_set_expr_location on incr if it already
1540 2019-05-15 Marek Polacek <polacek@redhat.com>
1542 CWG 2096 - constraints on literal unions.
1543 * class.c (check_field_decls): Initialize booleans directly. A union
1544 is literal if at least one of its non-static data members is of
1545 non-volatile literal type.
1547 2019-05-15 Paolo Carlini <paolo.carlini@oracle.com>
1549 * cp-tree.h (REFERENCE_VLA_OK): Remove.
1550 * lambda.c (build_capture_proxy): Remove use of the above.
1552 2019-05-15 Paolo Carlini <paolo.carlini@oracle.com>
1554 * call.c (perform_overload_resolution, build_new_method_call_1):
1555 Use OVL_P; remove redundant TEMPLATE_DECL checks.
1556 * decl.c (grokfndecl): Likewise.
1557 * mangle.c (write_expression): Likewise.
1558 * parser.c (cp_parser_template_id): Likewise.
1559 * pt.c (resolve_overloaded_unification, type_dependent_expression_p):
1561 * search.c (build_baselink): Likewise.
1562 * tree.c (is_overloaded_fn, dependent_name, maybe_get_fns): Likewise.
1564 2019-05-14 Paolo Carlini <paolo.carlini@oracle.com>
1566 PR preprocessor/90382
1567 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
1570 2019-05-13 Jason Merrill <jason@redhat.com>
1572 Use releasing_vec more broadly.
1573 * cp-tree.h (struct releasing_vec): Replace get_ref method with
1575 (vec_safe_push, vec_safe_reserve, vec_safe_length, vec_safe_splice):
1576 Forwarding functions for releasing_vec.
1577 (release_tree_vector): Declare but don't define.
1578 * call.c (build_op_delete_call, build_temp, call_copy_ctor)
1579 (perform_direct_initialization_if_possible): Use releasing_vec.
1580 * constexpr.c (cxx_eval_vec_init_1, cxx_eval_store_expression):
1582 * cp-gimplify.c (cp_fold): Likewise.
1583 * cvt.c (force_rvalue, ocp_convert): Likewise.
1584 * decl.c (get_tuple_decomp_init): Likewise.
1585 * except.c (build_throw): Likewise.
1586 * init.c (perform_member_init, expand_default_init): Likewise.
1587 * method.c (do_build_copy_assign, locate_fn_flags): Likewise.
1588 * parser.c (cp_parser_userdef_char_literal)
1589 (cp_parser_userdef_numeric_literal)
1590 (cp_parser_userdef_string_literal)
1591 (cp_parser_perform_range_for_lookup)
1592 (cp_parser_range_for_member_function, cp_parser_omp_for_loop)
1593 (cp_parser_omp_for_loop_init): Likewise.
1594 * pt.c (tsubst_copy_and_build, do_class_deduction): Likewise.
1595 * semantics.c (calculate_direct_bases, calculate_bases)
1596 (finish_omp_barrier, finish_omp_flush, finish_omp_taskwait)
1597 (finish_omp_taskyield, finish_omp_cancel)
1598 (finish_omp_cancellation_point): Likewise.
1599 * tree.c (build_vec_init_elt, strip_typedefs, strip_typedefs_expr)
1600 (build_min_non_dep_op_overload): Likewise.
1601 * typeck.c (build_function_call_vec, cp_build_function_call_nary)
1602 (cp_build_modify_expr): Likewise.
1603 * typeck2.c (build_functional_cast): Likewise.
1605 2019-05-11 Paolo Carlini <paolo.carlini@oracle.com>
1607 * typeck.c (cp_build_function_call_vec): When mark_used fails
1608 unconditionally return error_mark_node.
1610 2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1612 * decl.c (grokvardecl): Use an accurate location in error message
1613 about main as a global variable.
1615 2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1617 * call.c (build_call_a): Use FUNC_OR_METHOD_TYPE_P.
1618 * cp-gimplify.c (cp_fold): Likewise.
1619 * cp-objcp-common.c (cp_type_dwarf_attribute): Likewise.
1620 * cp-tree.h (TYPE_OBJ_P, TYPE_PTROBV_P): Likewise.
1621 * cvt.c (perform_qualification_conversions): Likewise.
1622 * decl.c (grokdeclarator): Likewise.
1623 * decl2.c (build_memfn_type): Likewise.
1624 * mangle.c (canonicalize_for_substitution, write_type): Likewise.
1625 * parser.c (cp_parser_omp_declare_reduction): Likewise.
1626 * pt.c (check_explicit_specialization, uses_deducible_template_parms,
1627 check_cv_quals_for_unify, dependent_type_p_r): Likewise.
1628 * rtti.c (ptr_initializer): Likewise.
1629 * semantics.c (finish_asm_stmt, finish_offsetof,
1630 cp_check_omp_declare_reduction): Likewise.
1631 * tree.c (cp_build_qualified_type_real,
1632 cp_build_type_attribute_variant, cxx_type_hash_eq,
1633 cxx_copy_lang_qualifiers, cp_free_lang_data): Likewise.
1634 * typeck.c (structural_comptypes, convert_arguments,
1635 cp_build_addr_expr_1, unary_complex_lvalue, cp_build_c_cast,
1636 cp_build_modify_expr, comp_ptr_ttypes_real, type_memfn_rqual):
1639 2019-05-10 Marek Polacek <polacek@redhat.com>
1641 PR c++/78010 - bogus -Wsuggest-override warning on final function.
1642 * class.c (check_for_override): Don't warn for final functions.
1644 2019-05-10 Jakub Jelinek <jakub@redhat.com>
1647 * config-lang.in (gtfiles): Remove c-family/c-lex.c, add
1648 c-family/c-cppbuiltin.c.
1650 2019-05-09 Paolo Carlini <paolo.carlini@oracle.com>
1654 2018-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1656 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
1659 2019-05-08 Nathan Sidwell <nathan@acm.org>
1661 Kill DECL_SAVED_FUNCTION_DATA .
1662 * cp-tree.h (language_function): Remove x_auto_return_pattern.
1663 (current_function_auto_return_pattern): Delete.
1664 (lang_decl_fn): Replace saved_language_function with
1665 saved_auto_return type.
1666 (DECL_SAVED_FUNCTION_DATA): Delete.
1667 (DECL_SAVED_AUTO_RETURN_TYPE): New.
1668 (FNDECL_USED_AUTO): Correct documentation.
1669 * decl.c (duplicate_decls): Adjust AUTO return handling.
1670 (start_preparsed_function): Replace
1671 current_function_auto_return_pattern with
1672 DECL_SAVED_AUTO_RETURN_TYPE. Remove DECL_SAVED_FUNCTION_DATA
1674 (finish_function): Likewise.
1675 (save_function_data): Delete.
1676 (fndecl_declared_return_type): Reimplement.
1677 * mangle.c (write_unqualified_name): Use DECL_SAVED_AUTO_RETURN_TYPE.
1678 * method.c (make_thunk, make_alias_for): Likewise.
1679 * parser.c (cp_parser_jump_statement): Likewise.
1680 * pt.c (do_auto_deduction): Likewise.
1681 * typeck.c (check_return_expr): Likewise.
1683 2019-05-06 Jason Merrill <jason@redhat.com>
1685 PR c++/90171 - reorganize usual_deallocation_fn_p
1686 * call.c (struct dealloc_info): New.
1687 (usual_deallocation_fn_p): Take a dealloc_info*.
1688 (aligned_deallocation_fn_p, sized_deallocation_fn_p): Remove.
1689 (build_op_delete_call): Adjust.
1691 2019-05-07 Jason Merrill <jason@redhat.com>
1693 PR c++/86485 - -Wmaybe-unused with empty class ?:
1694 * typeck.c (build_static_cast_1): Use cp_build_addr_expr.
1696 * pt.c (type_dependent_expression_p): A non-type template parm with
1697 a placeholder type is type-dependent.
1699 2019-05-06 Marek Polacek <polacek@redhat.com>
1701 PR c++/90265 - ICE with generic lambda.
1702 * pt.c (tsubst_copy_and_build): Use a dedicated variable for the last
1703 element in the vector.
1705 2019-05-03 Martin Liska <mliska@suse.cz>
1707 * call.c (build_aggr_conv): Use is_empty instead of
1708 elements () == 0 (and similar usages).
1709 * parser.c (cp_parser_lambda_introducer): Likewise.
1711 2019-05-02 Nathan Sidwell <nathan@acm.org>
1713 * semantics.c (finish_id_expression_1): Remove unreachable code.
1715 2019-05-01 Nathan Sidwell <nathan@acm.org>
1717 * name-lookup.h (get_class_binding_direct): Change final arg to
1719 (get_class_binding): Likewise.
1720 * name-lookup.c (get_class_binding_direct): Replace TYPE_OR_FNS
1721 arg with WANT_TYPE bool. Simplify.
1722 (get_class_binding): Adjust final arg.
1723 * decl.c (reshape_init_class): Adjust get_class_binding calls.
1725 2019-04-30 Nathan Sidwell <nathan@acm.org>
1727 * cp-objcp-common.c (cp_common_init_ts): Use MARK_TS_EXP for _EXPR
1728 nodes. Call c_common_init_ts.
1730 2019-04-29 Nathan Sidwell <nathan@acm.org>
1732 * decl.c (duplicate_decls): Add whitespace, move comments into
1734 * method.c (explain_implicit_non_constexpr): Refactor.
1735 * pt.c (check_explicit_specialization): Fix indentation.
1736 * semantics.c (process_outer_var_ref): Reformat.
1737 (finish_id_expression_1): Use STRIP_TEMPLATE.
1739 2019-04-26 Jonathan Wakely <jwakely@redhat.com>
1741 PR c++/90243 - orphaned note in uninstantiated constexpr function
1742 * decl.c (check_for_uninitialized_const_var): Suppress notes if no
1745 2019-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1748 * decl.c (grokdeclarator): Set type to error_mark_node
1749 upon error about template placeholder type non followed
1750 by a simple declarator-id.
1752 2019-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1754 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
1757 2019-04-24 Jason Merrill <jason@redhat.com>
1759 PR c++/90227 - error with template parameter packs.
1760 * pt.c (coerce_template_parms): Do add empty pack when
1763 2019-04-24 Richard Biener <rguenther@suse.de>
1765 * call.c (null_ptr_cst_p): Order checks according to expensiveness.
1766 (conversion_null_warnings): Likewise.
1767 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Return
1768 early if type1 == type2.
1770 2019-04-22 Jason Merrill <jason@redhat.com>
1772 PR c++/87366 - wrong error with alias template.
1773 * typeck.c (structural_comptypes): When comparing_specializations,
1774 aliases are unequal.
1775 (comptypes): When comparing_specializations, do structural
1778 2019-04-19 Jason Merrill <jason@redhat.com>
1780 PR c++/90190 - CTAD with list-constructor.
1781 * pt.c (do_class_deduction): Don't try the single element deduction
1782 if the single element is also a braced list.
1784 PR c++/90171 - ICE with destroying delete with size_t parm.
1785 * call.c (sized_deallocation_fn_p): New. Use it instead of
1786 second_parm_is_size_t in most cases.
1787 (second_parm_is_size_t): Don't check for aligned.
1789 2019-04-19 Paolo Carlini <paolo.carlini@oracle.com>
1792 * pt.c (fn_type_unification): When handling null explicit
1793 arguments do not special case non-parameter packs.
1795 2019-04-19 Jakub Jelinek <jakub@redhat.com>
1798 * pt.c (process_template_parm): Set decl to pushdecl result. If
1799 !is_non_type, also set parm to that.
1802 * decl.c (struct cp_switch): Remove outside_range_p member.
1803 (push_switch): Don't clear it.
1804 (pop_switch): Adjust c_do_switch_warnings caller.
1805 (finish_case_label): Adjust c_add_case_label caller.
1808 * decl.c (duplicate_decls): If remove is main variant and
1809 DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
1810 variant that has newdecl as TYPE_NAME if any.
1812 2019-04-18 Jason Merrill <jason@redhat.com>
1814 PR c++/87554 - ICE with extern template and reference member.
1815 * decl.c (cp_finish_decl): Don't set DECL_INITIAL of external vars.
1817 2019-04-17 Jason Merrill <jason@redhat.com>
1819 PR c++/90047 - ICE with enable_if alias template.
1820 * pt.c (tsubst_decl) [TYPE_DECL]: Don't put an erroneous decl in the
1821 hash table when we're in SFINAE context.
1823 2019-04-17 Marek Polacek <polacek@redhat.com>
1825 PR c++/90124 - bogus error with incomplete type in decltype.
1826 * typeck.c (build_class_member_access_expr): Check
1827 cp_unevaluated_operand.
1829 2019-04-12 Jakub Jelinek <jakub@redhat.com>
1832 * decl.c (duplicate_decls): When newdecl's type is its main variant,
1833 don't try to remove it from the variant list, but instead assert
1836 2019-04-12 Martin Sebor <msebor@redhat.com>
1840 * parser.c (cp_parser_has_attribute_expression): Handle assignment
1843 2019-04-12 Jason Merrill <jason@redhat.com>
1845 * call.c (null_member_pointer_value_p): Handle an empty CONSTRUCTOR
1848 2019-04-12 Marek Polacek <polacek@redhat.com>
1850 * except.c (build_noexcept_spec): Use build_converted_constant_bool_expr
1851 instead of perform_implicit_conversion_flags.
1853 PR c++/87603 - constexpr functions are no longer noexcept.
1854 * constexpr.c (is_sub_constant_expr): Remove unused function.
1855 * cp-tree.h (is_sub_constant_expr): Remove declaration.
1856 * except.c (check_noexcept_r): Don't consider a call to a constexpr
1859 2019-04-11 Jakub Jelinek <jakub@redhat.com>
1861 PR translation/90035
1862 * parser.h (struct cp_parser): Add
1863 type_definition_forbidden_message_arg member.
1864 * parser.c (cp_debug_parser): Print it.
1865 (cp_parser_check_type_definition): Pass
1866 parser->type_definition_forbidden_message_arg as second argument to
1868 (cp_parser_has_attribute_expression, cp_parser_sizeof_operand): Set
1869 parser->type_definition_forbidden_message_arg and use G_() with
1870 %qs for parser->type_definition_forbidden_message instead of
1871 building untranslatable message using concat.
1873 2019-04-09 Jakub Jelinek <jakub@redhat.com>
1875 PR translation/90011
1876 * typeck2.c (check_narrowing): Remove trailing space from diagnostics.
1878 2019-04-08 Marek Polacek <polacek@redhat.com>
1880 * typeck2.c (digest_init_r): Don't condition the object slicing warning
1883 2019-04-08 Paolo Carlini <paolo.carlini@oracle.com>
1886 * semantics.c (trait_expr_value): Don't use TYPE_NOTHROW_P
1887 when maybe_instantiate_noexcept fails.
1888 (classtype_has_nothrow_assign_or_copy_p): Likewise.
1889 * method.c (implicitly_declare_fn): Avoid passing error_mark_node
1890 to build_exception_variant.
1892 2019-04-05 Marek Polacek <polacek@redhat.com>
1894 PR c++/87145 - bogus error converting class type in template arg list.
1895 * pt.c (convert_nontype_argument): Don't call
1896 build_converted_constant_expr if it could involve calling a conversion
1897 function with a instantiation-dependent constructor as its argument.
1899 2019-04-05 Martin Sebor <msebor@redhat.com>
1902 * decl.c (reshape_init_array_1): Avoid treating empty strings
1903 as zeros in array initializers.
1904 Use trivial_type_p () instead of TYPE_HAS_TRIVIAL_DFLT().
1906 2019-04-04 Jason Merrill <jason@redhat.com>
1908 PR c++/89948 - ICE with break in statement-expr.
1909 * constexpr.c (cxx_eval_statement_list): Jumping out of a
1910 statement-expr is non-constant.
1912 2019-04-04 Jason Merrill <jason@redhat.com>
1914 PR c++/89966 - error with non-type auto tparm.
1915 * pt.c (do_auto_deduction): Clear tf_partial.
1917 2019-04-04 Jason Merrill <jason@redhat.com>
1919 PR c++/86986 - ICE with TTP with parameter pack.
1920 * pt.c (coerce_template_parameter_pack): Only look at the type of a
1921 non-type parameter pack.
1922 (fixed_parameter_pack_p_1): Don't recurse into the type of a
1923 non-type parameter pack.
1924 (coerce_template_template_parms): Call add_outermost_template_args.
1926 2019-04-04 Martin Sebor <msebor@redhat.com>
1932 * decl.c (reshape_init_array_1): Strip trailing zero-initializers
1933 from arrays of trivial type and known size.
1934 * mangle.c (write_expression): Convert braced initializer lists
1936 (write_expression): Trim trailing zero-initializers from arrays
1938 (write_template_arg_literal): Mangle strings the same as braced
1941 2019-04-03 Jason Merrill <jason@redhat.com>
1943 PR c++/81866 - ICE with member template and default targ.
1944 * pt.c (tsubst_template_decl): Handle getting a type from
1945 retrieve_specialization.
1947 PR c++/86586 - -fcompare-debug=-Wsign-compare.
1948 * typeck.c (cp_build_binary_op): Don't fold for -Wsign-compare.
1950 PR c++/89331 - ICE with offsetof in incomplete class.
1951 * semantics.c (finish_offsetof): Handle error_mark_node.
1952 * typeck.c (build_class_member_access_expr): Call
1953 complete_type_or_maybe_complain before converting to base.
1955 PR c++/89917 - ICE with lambda in variadic mem-init.
1956 * pt.c (make_pack_expansion): Change type_pack_expansion_p to false.
1958 2019-04-01 Jason Merrill <jason@redhat.com>
1960 PR c++/86946 - ICE with function call in template argument.
1962 * pt.c (iterative_hash_template_arg) [CALL_EXPR]: Use
1965 2019-04-01 Paolo Carlini <paolo.carlini@oracle.com>
1968 * pt.c (tsubst_copy): Deal with lookup_name not returing a variable.
1970 2019-03-31 Marek Polacek <polacek@redhat.com>
1972 PR c++/89852 - ICE with C++11 functional cast with { }.
1973 * constexpr.c (fold_non_dependent_expr_template): New static function
1975 (fold_non_dependent_expr): ...here.
1976 (fold_non_dependent_init): New function.
1977 * cp-tree.h (fold_non_dependent_init): Declare.
1978 * typeck2.c (massage_init_elt): Call fold_non_dependent_init instead
1979 of fold_non_dependent_expr. Don't call maybe_constant_init.
1981 2019-03-30 Jason Merrill <jason@redhat.com>
1983 PR c++/89744 - ICE with specialization of member class template.
1984 * pt.c (lookup_template_class_1): If the partial instantiation is
1985 explicitly specialized, adjust.
1986 (maybe_process_partial_specialization): Also adjust
1989 2019-03-29 Jakub Jelinek <jakub@redhat.com>
1992 * typeck.c: Include gimplify.h.
1993 (cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it
1994 for second time. Formatting fixes.
1996 2019-03-29 Marek Polacek <polacek@redhat.com>
1998 PR c++/89876 - ICE with deprecated conversion.
1999 * call.c (convert_like_real): Only give warnings with tf_warning.
2001 2019-03-28 Marek Polacek <polacek@redhat.com>
2003 PR c++/89612 - ICE with member friend template with noexcept.
2004 * pt.c (maybe_instantiate_noexcept): For function templates, use their
2005 template result (function decl). Don't set up local specializations.
2006 Temporarily turn on processing_template_decl. Update the template type
2009 PR c++/89836 - bool constant expression and explicit conversions.
2010 * call.c (build_converted_constant_expr_internal): New function,
2012 (build_converted_constant_expr): ...this. New.
2013 (build_converted_constant_bool_expr): New.
2014 * cp-tree.h (build_converted_constant_bool_expr): Declare.
2015 * decl.c (build_explicit_specifier): Call
2016 build_converted_constant_bool_expr.
2018 2019-03-28 Jakub Jelinek <jakub@redhat.com>
2021 * constexpr.c (struct check_for_return_continue_data): New type.
2022 (check_for_return_continue): New function.
2023 (potential_constant_expression_1) <case SWITCH_STMT>: Walk
2024 SWITCH_STMT_BODY to find RETURN_EXPRs or CONTINUE_STMTs not nested
2025 in loop bodies and set *jump_target to that if found.
2027 2019-03-27 Jason Merrill <jason@redhat.com>
2029 PR c++/89831 - error with qualified-id in const member function.
2030 * semantics.c (finish_non_static_data_member): Use object cv-quals
2031 in scoped case, too.
2033 PR c++/89421 - ICE with lambda in template parameter list.
2034 * parser.c (cp_parser_lambda_expression): Also reject a lambda in a
2035 template parameter list before C++20.
2036 * pt.c (type_dependent_expression_p): True for LAMBDA_EXPR.
2037 * semantics.c (begin_class_definition): Restore error about defining
2038 non-lambda class in template parm list.
2040 2019-03-26 Jason Merrill <jason@redhat.com>
2042 PR c++/86932 - missed SFINAE with empty pack.
2043 * pt.c (coerce_template_parms): Don't add an empty pack if
2045 (fn_type_unification): Pass tf_partial to coerce_template_parms.
2047 PR c++/86429 - constexpr variable in lambda.
2050 * constexpr.c (cxx_eval_constant_expression): In a lambda function,
2051 try evaluating the captured variable directly.
2053 2019-03-26 Jakub Jelinek <jakub@redhat.com>
2056 * semantics.c (finish_omp_atomic): Add warning_sentinel for
2057 -Wunused-value around finish_expr_stmt call.
2059 2019-03-25 Paolo Carlini <paolo.carlini@oracle.com>
2063 * parser.c (cp_parser_binary_expression): Don't call cp_fully_fold
2064 to undo the disabling of warnings.
2066 2019-03-25 Jason Merrill <jason@redhat.com>
2068 PR c++/87748 - substitution failure error with decltype.
2069 * pt.c (most_specialized_partial_spec): Clear
2070 processing_template_decl.
2072 2019-03-25 Marek Polacek <polacek@redhat.com>
2074 PR c++/89214 - ICE when initializing aggregates with bases.
2075 * typeck2.c (digest_init_r): Warn about object slicing instead of
2078 PR c++/89705 - ICE with reference binding with conversion function.
2079 * call.c (reference_binding): If the result of the conversion function
2080 is a prvalue of non-class type, use the cv-unqualified type.
2082 2019-03-25 Nathan Sidwell <nathan@acm.org>
2084 * lambda.c (maybe_add_lambda_conv_op): Don't add to comdat group.
2086 2019-03-22 Jakub Jelinek <jakub@redhat.com>
2089 * cp-tree.h (get_tls_wrapper_fn): Remove declaration.
2090 (maybe_get_tls_wrapper_call): Declare.
2091 * decl2.c (get_tls_wrapper_fn): Make static.
2092 (maybe_get_tls_wrapper_call): New function.
2093 * typeck.c (build_class_member_access_expr): Handle accesses to TLS
2095 * semantics.c (finish_qualified_id_expr): Likewise.
2096 (finish_id_expression_1): Use maybe_get_tls_wrapper_call.
2097 * pt.c (tsubst_copy_and_build): Likewise.
2100 * constexpr.c (struct constexpr_ctx): Add constexpr_ops_count member.
2101 (cxx_eval_constant_expression): When not skipping, not constant class
2102 or location wrapper, increment *ctx->constexpr_ops_count and if it is
2103 above constexpr_loop_nest_limit, diagnose failure.
2104 (cxx_eval_outermost_constant_expr): Add constexpr_ops_count and
2105 initialize ctx.constexpr_ops_count to its address.
2106 (is_sub_constant_expr): Likewise.
2108 2019-03-21 Jakub Jelinek <jakub@redhat.com>
2111 * call.c (filed_in_pset): Change pset from hash_set<tree> * to
2112 hash_set<tree, true> &, adjust uses accordingly.
2113 (build_aggr_conv): Change pset from hash_set<tree> *
2114 to hash_set<tree, true>. Replace goto fail; with return NULL;,
2118 * parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id
2119 variables, check for duplicates in this function.
2120 * lambda.c (add_capture): Don't check for duplicates nor use
2122 (register_capture_members): Don't clear IDENTIFIER_MARKED here.
2124 2019-03-21 Paolo Carlini <paolo.carlini@oracle.com>
2127 * method.c (after_nsdmi_defaulted_late_checks): Avoid passing
2128 error_mark_node to comp_except_specs.
2130 2019-03-20 Jason Merrill <jason@redhat.com>
2132 PR c++/87480 - decltype of member access in default template arg
2133 * pt.c (type_unification_real): Accept a dependent result in
2136 2019-03-19 Martin Sebor <msebor@redhat.com>
2138 PR tree-optimization/89688
2139 * typeck2.c (store_init_value): Call braced_lists_to_string for more
2140 kinds of initializers.
2142 2019-03-18 Jason Merrill <jason@redhat.com>
2144 PR c++/89630 - ICE with dependent using-decl as template arg.
2145 * tree.c (cp_tree_equal): Always return false for USING_DECL.
2147 PR c++/89761 - ICE with sizeof... in pack expansion.
2148 * pt.c (argument_pack_element_is_expansion_p): Handle
2149 ARGUMENT_PACK_SELECT.
2151 PR c++/89640 - GNU attributes on lambda.
2152 * parser.c (cp_parser_lambda_declarator_opt): Allow GNU attributes.
2154 PR c++/89682 - wrong access error in default argument.
2155 * pt.c (tsubst_default_argument): Don't defer access checks.
2157 2019-03-18 Paolo Carlini <paolo.carlini@oracle.com>
2160 * semantics.c (finish_non_static_data_member): Check return value
2161 of context_for_name_lookup and immediately return error_mark_node
2164 2019-03-17 Jason Merrill <jason@redhat.com>
2166 PR c++/89571 - ICE with ill-formed noexcept on constructor.
2167 * pt.c (maybe_instantiate_noexcept): Only return false if defaulted.
2168 (regenerate_decl_from_template): Use it for noexcept-specs.
2170 2019-03-14 Jason Merrill <jason@redhat.com>
2172 * parser.c (cp_parser_decl_specifier_seq): Support C++20
2173 concept-definition syntax without 'bool'.
2175 2019-03-14 Jakub Jelinek <jakub@redhat.com>
2178 * semantics.c (finish_qualified_id_expr): Reject variable templates.
2181 * constexpr.c (struct constexpr_ctx): Change save_exprs type from
2182 hash_set<tree> to vec<tree>.
2183 (cxx_eval_call_expression): Adjust for save_exprs being a vec instead
2185 (cxx_eval_loop_expr): Likewise. Truncate the vector after each
2186 removal of SAVE_EXPRs from values.
2187 (cxx_eval_constant_expression) <case SAVE_EXPR>: Call safe_push
2188 method on save_exprs instead of add.
2190 2019-03-13 Jason Merrill <jason@redhat.com>
2192 PR c++/86521 - C++17 copy elision in initialization by constructor.
2193 * call.c (joust_maybe_elide_copy): New.
2196 2019-03-13 Marek Polacek <polacek@redhat.com>
2198 PR c++/88979 - further P0634 fix for constructors.
2199 * parser.c (cp_parser_decl_specifier_seq): Pass flags to
2200 cp_parser_constructor_declarator_p.
2201 (cp_parser_direct_declarator): Allow missing typename for constructor
2203 (cp_parser_constructor_declarator_p): Add FLAGS parameter. Pass it to
2204 cp_parser_type_specifier.
2206 PR c++/89686 - mixing init-capture and simple-capture in lambda.
2207 * parser.c (cp_parser_lambda_introducer): Give error when combining
2208 init-capture and simple-capture.
2210 PR c++/89660 - bogus error with -Wredundant-move.
2211 * typeck.c (maybe_warn_pessimizing_move): Only accept (T &) &arg
2212 as the std::move's argument. Don't call convert_for_initialization
2213 when warn_redundant_move isn't on.
2215 2019-03-11 Jason Merrill <jason@redhat.com>
2217 PR c++/86521 - wrong overload resolution with ref-qualifiers.
2218 * call.c (build_user_type_conversion_1): Don't use a conversion to a
2219 reference of the wrong rvalueness for direct binding.
2221 2019-03-11 Martin Liska <mliska@suse.cz>
2223 * cvt.c (build_expr_type_conversion): Wrap apostrophes
2224 in gcc internal format with %'.
2225 * decl.c (check_no_redeclaration_friend_default_args): Likewise.
2226 (grokfndecl): Likewise.
2227 * name-lookup.c (do_pushtag): Likewise.
2228 * pt.c (unify_parameter_deduction_failure): Likewise.
2229 (unify_template_deduction_failure): Likewise.
2231 2019-03-11 Martin Liska <mliska@suse.cz>
2233 * call.c (convert_arg_to_ellipsis): Wrap an option name
2234 in a string format message and fix GNU coding style.
2235 (build_over_call): Likewise.
2236 * class.c (check_field_decl): Likewise.
2237 (layout_nonempty_base_or_field): Likewise.
2238 * constexpr.c (cxx_eval_loop_expr): Likewise.
2239 * cvt.c (type_promotes_to): Likewise.
2240 * decl.c (cxx_init_decl_processing): Likewise.
2241 (mark_inline_variable): Likewise.
2242 (grokdeclarator): Likewise.
2243 * decl2.c (record_mangling): Likewise.
2244 * error.c (maybe_warn_cpp0x): Likewise.
2245 * except.c (doing_eh): Likewise.
2246 * mangle.c (maybe_check_abi_tags): Likewise.
2247 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
2248 (cp_parser_userdef_numeric_literal): Likewise.
2249 (cp_parser_primary_expression): Likewise.
2250 (cp_parser_unqualified_id): Likewise.
2251 (cp_parser_pseudo_destructor_name): Likewise.
2252 (cp_parser_builtin_offsetof): Likewise.
2253 (cp_parser_lambda_expression): Likewise.
2254 (cp_parser_lambda_introducer): Likewise.
2255 (cp_parser_lambda_declarator_opt): Likewise.
2256 (cp_parser_selection_statement): Likewise.
2257 (cp_parser_init_statement): Likewise.
2258 (cp_parser_decomposition_declaration): Likewise.
2259 (cp_parser_function_specifier_opt): Likewise.
2260 (cp_parser_static_assert): Likewise.
2261 (cp_parser_simple_type_specifier): Likewise.
2262 (cp_parser_namespace_definition): Likewise.
2263 (cp_parser_using_declaration): Likewise.
2264 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
2265 (cp_parser_initializer_list): Likewise.
2266 (cp_parser_type_parameter_key): Likewise.
2267 (cp_parser_member_declaration): Likewise.
2268 (cp_parser_try_block): Likewise.
2269 (cp_parser_std_attribute_spec): Likewise.
2270 (cp_parser_requires_clause_opt): Likewise.
2271 * pt.c (check_template_variable): Likewise.
2272 (check_default_tmpl_args): Likewise.
2273 (push_tinst_level_loc): Likewise.
2274 (instantiate_pending_templates): Likewise.
2275 (invalid_nontype_parm_type_p): Likewise.
2276 * repo.c (get_base_filename): Likewise.
2277 * rtti.c (typeid_ok_p): Likewise.
2278 (build_dynamic_cast_1): Likewise.
2279 * tree.c (maybe_warn_parm_abi): Likewise.
2281 2019-03-08 Jakub Jelinek <jakub@redhat.com>
2284 * parser.c (cp_parser_template_declaration_after_parameters): Avoid
2285 one space before " at the end of line and another after " on another
2286 line in a string literal.
2288 PR tree-optimization/89550
2289 * semantics.c (maybe_convert_cond): Only set TREE_NO_WARNING if
2290 warning_at returned true.
2291 * decl2.c (c_parse_final_cleanups): Likewise.
2292 * typeck.c (convert_for_assignment): Likewise.
2293 * decl.c (finish_function): Likewise.
2296 * parser.c (cp_parser_asm_definition): Just warn instead of error
2297 on volatile qualifier outside of function body.
2300 * constexpr.c (potential_constant_expression_1): Reject
2301 REINTERPRET_CAST_P NOP_EXPRs.
2304 * call.c (joust): Call print_z_candidate only if pedwarn returned
2307 2019-03-07 Jason Merrill <jason@redhat.com>
2309 PR c++/88123 - lambda and using-directive.
2310 * name-lookup.c (op_unqualified_lookup)
2311 (maybe_save_operator_binding, discard_operator_bindings)
2312 (push_operator_bindings): New.
2313 * typeck.c (build_x_binary_op, build_x_unary_op): Call
2314 maybe_save_operator_binding.
2315 * decl.c (start_preparsed_function): Call push_operator_bindings.
2316 * tree.c (cp_free_lang_data): Call discard_operator_bindings.
2318 PR c++/88820 - ICE with CTAD and member template used in DMI.
2319 * pt.c (do_class_deduction): Handle parm used as its own arg.
2321 2019-03-07 Jakub Jelinek <jakub@redhat.com>
2324 * parser.c (cp_parser_asm_definition): Parse asm qualifiers even
2325 at toplevel, but diagnose them.
2327 2019-03-06 Jason Merrill <jason@redhat.com>
2329 PR c++/89381 - implicit copy and using-declaration.
2330 * class.c (classtype_has_move_assign_or_move_ctor_p): Don't consider
2331 op= brought in by a using-declaration.
2333 2019-03-06 Jakub Jelinek <jakub@redhat.com>
2336 * init.c (build_value_init_noctor): Ignore flexible array members.
2338 2019-03-06 Jason Merrill <jason@redhat.com>
2340 PR c++/89576 - if constexpr of lambda capture.
2341 * semantics.c (maybe_convert_cond): Do convert a non-dependent
2342 condition in a template.
2343 * typeck.c (condition_conversion): Handle being called in a
2346 2019-03-06 Marek Polacek <polacek@redhat.com>
2348 PR c++/87378 - bogus -Wredundant-move warning.
2349 * typeck.c (maybe_warn_pessimizing_move): See if the maybe-rvalue
2350 overload resolution would actually succeed.
2352 2019-03-05 Jason Merrill <jason@redhat.com>
2354 * class.c (is_really_empty_class): Add ignore_vptr parm.
2355 (trivial_default_constructor_is_constexpr): Pass it.
2356 * call.c (build_over_call): Pass it.
2357 * constexpr.c (cxx_eval_constant_expression): Pass it instead of
2358 checking TYPE_POLYMORPHIC_P.
2359 (cxx_eval_component_reference, potential_constant_expression_1):
2361 * cp-gimplify.c (simple_empty_class_p): Pass it.
2362 * init.c (expand_aggr_init_1): Pass it.
2364 2019-03-04 Paolo Carlini <paolo.carlini@oracle.com>
2367 * parser.c (cp_parser_class_head): Reject TYPE_BEING_DEFINED too.
2369 2019-03-04 Jakub Jelinek <jakub@redhat.com>
2372 * call.c (field_in_pset): New function.
2373 (build_aggr_conv): Handle CONSTRUCTOR_IS_DESIGNATED_INIT correctly.
2375 2019-03-02 Jakub Jelinek <jakub@redhat.com>
2378 * cp-tree.h (CONSTRUCTOR_IS_DESIGNATED_INIT): Define.
2379 * parser.c (cp_parser_braced_list): Adjust cp_parser_initializer_list
2380 caller, set CONSTRUCTOR_IS_DESIGNATED_INIT.
2381 (cp_parser_initializer_list): Add designated parameter, set *designated
2382 to a bool whether any designators were parsed.
2383 * decl.c (reshape_init): Copy over CONSTRUCTOR_IS_DESIGNATED_INIT if
2385 * pt.c (tsubst_copy_and_build): Likewise.
2386 * call.c (implicit_conversion): If CONSTRUCTOR_IS_DESIGNATED_INIT,
2387 don't call build_list_conv, nor build_complex_conv, nor attempt to
2388 convert a single element initializer to scalar.
2390 2019-03-01 Marek Polacek <polacek@redhat.com>
2392 PR c++/89537 - missing location for error with non-static member fn.
2393 * call.c (resolve_args): Use EXPR_LOCATION.
2394 * typeck.c (build_class_member_access_expr): Use input_location.
2396 PR c++/89532 - ICE with incomplete type in decltype.
2397 * semantics.c (finish_compound_literal): Return error_mark_node
2398 if digest_init_flags returns error_mark_node.
2400 2019-03-01 Jakub Jelinek <jakub@redhat.com>
2402 Implement P1002R1, Try-catch blocks in constexpr functions
2404 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
2405 Diagnose constexpr ctor or function with function-try-block with
2406 pedwarn for c++17 and earlier. Formatting fix.
2407 (cp_parser_try_block): Use pedwarn instead of error and only for
2408 c++17 and earlier when try block appears in constexpr function.
2409 * constexpr.c (build_constexpr_constructor_member_initializers):
2410 Handle TRY_BLOCK here instead of erroring on it.
2412 2019-02-28 Jason Merrill <jason@redhat.com>
2414 PR c++/88183 - ICE with .* fold-expression.
2415 * pt.c (fold_expression) [DOTSTAR_EXPR]: Remove special handling.
2417 PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
2418 * class.c, lambda.c, pt.c: Revert earlier change.
2419 * lambda.c (add_capture): Don't special-case capture of dependent
2422 * name-lookup.c (print_binding_level): Print this_entity.
2424 2019-02-27 Marek Polacek <polacek@redhat.com>
2426 PR c++/88857 - ICE with value-initialization of argument in template.
2427 * call.c (convert_like_real): Don't call build_value_init in template.
2429 2019-02-27 Jason Merrill <jason@redhat.com>
2431 PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
2432 * semantics.c (process_outer_var_ref): Do capture dependent vars.
2433 * class.c (finish_struct): Only add TAG_DEFN if T is in
2434 current_function_decl.
2435 * lambda.c (vla_capture_type): Force the capture type out into the
2436 lambda's enclosing function.
2437 (add_capture): Pass in the lambda.
2438 * pt.c (tsubst_lambda_expr): complete_type a VLA capture type.
2440 2019-02-27 Marek Polacek <polacek@redhat.com>
2442 PR c++/89511 - ICE with using-declaration and unscoped enumerator.
2443 * parser.c (cp_parser_using_declaration): For an unscoped enum
2444 only use its context if it's not a function declaration.
2446 2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
2449 * method.c (process_subob_fn): When maybe_instantiate_noexcept
2450 returns false don't call merge_exception_specifiers.
2452 2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
2455 * parser.c (cp_parser_noexcept_specification_opt): Return NULL_TREE
2456 for a non-constant parsed expression.
2458 2019-02-26 Jakub Jelinek <jakub@redhat.com>
2461 * constexpr.c (cxx_eval_store_expression): When changing active union
2462 member, set no_zero_init.
2464 2019-02-23 Marek Polacek <polacek@redhat.com>
2466 PR c++/88294 - ICE with non-constant noexcept-specifier.
2467 * pt.c (maybe_instantiate_noexcept): Set up the list of local
2468 specializations. Set current_class_{ptr,ref}.
2470 2019-02-22 David Malcolm <dmalcolm@redhat.com>
2473 * parser.c (cp_parser_unqualified_id): Capture and use locations
2476 2019-02-22 Marek Polacek <polacek@redhat.com>
2478 PR c++/89420 - ICE with CAST_EXPR in explicit-specifier.
2479 * decl.c (build_explicit_specifier): Don't check
2480 processing_template_decl. Call instantiation_dependent_expression_p
2481 instead of value_dependent_expression_p. Call
2482 instantiate_non_dependent_expr_sfinae before
2483 build_converted_constant_expr instead of calling
2484 instantiate_non_dependent_expr after it. Add
2485 processing_template_decl_sentinel.
2487 2019-02-22 Thomas Schwinge <thomas@codesourcery.com>
2489 * parser.c (cp_parser_oacc_simple_clause): Remove parser formal
2490 parameter, move loc formal parameter to the front. Adjust all
2492 (cp_parser_oacc_shape_clause): Add loc formal parameter. Adjust
2495 2019-02-21 Jason Merrill <jason@redhat.com>
2497 PR c++/87685 - generic lambda 'this' capture error.
2498 * lambda.c (lambda_expr_this_capture): Change add_capture_p to int.
2499 (maybe_generic_this_capture): Pass -1.
2501 PR c++/88394 - ICE with VLA init-capture.
2502 * lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE.
2504 PR c++/88869 - C++17 ICE with CTAD and explicit specialization.
2505 * pt.c (do_class_deduction): Don't include explicit specialization
2508 PR c++/89422 - ICE with -g and lambda in default arg in template.
2509 * pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner.
2511 2019-02-21 Jason Merrill <jason@redhat.com>
2513 PR c++/88419 - C++17 ICE with class template arg deduction.
2514 * pt.c (make_template_placeholder): Set TYPE_CANONICAL after
2515 CLASS_PLACEHOLDER_TEMPLATE.
2517 2019-02-21 Jakub Jelinek <jakub@redhat.com>
2520 * constexpr.c (struct constexpr_fundef): Add parms and result members.
2521 (retrieve_constexpr_fundef): Adjust for the above change.
2522 (register_constexpr_fundef): Save constexpr body with copy_fn,
2523 temporarily set DECL_CONTEXT on DECL_RESULT before that.
2524 (get_fundef_copy): Change FUN argument to FUNDEF with
2525 constexpr_fundef * type, grab body and parms/result out of
2526 constexpr_fundef struct and temporarily change it for copy_fn calls
2528 (cxx_eval_builtin_function_call): For __builtin_FUNCTION temporarily
2529 adjust current_function_decl from ctx->call context. Test
2530 !potential_constant_expression instead of !is_constant_expression.
2531 (cxx_bind_parameters_in_call): Grab parameters from new_call. Undo
2532 convert_for_arg_passing changes for TREE_ADDRESSABLE type passing.
2533 (cxx_eval_call_expression): Adjust get_fundef_copy caller.
2534 (cxx_eval_conditional_expression): For IF_STMT, allow then or else
2535 operands to be NULL.
2536 (label_matches): Handle BREAK_STMT and CONTINUE_STMT.
2537 (cxx_eval_loop_expr): Add support for FOR_STMT, WHILE_STMT and DO_STMT.
2538 (cxx_eval_switch_expr): Add support for SWITCH_STMT.
2539 (cxx_eval_constant_expression): Handle IF_STMT, FOR_STMT, WHILE_STMT,
2540 DO_STMT, CONTINUE_STMT, SWITCH_STMT, BREAK_STMT and CONTINUE_STMT.
2541 For SIZEOF_EXPR, recurse on the result of fold_sizeof_expr. Ignore
2542 DECL_EXPR with USING_DECL operand.
2543 * lambda.c (maybe_add_lambda_conv_op): Build thisarg using
2544 build_int_cst to make it a valid constant expression.
2546 2019-02-20 Jason Merrill <jason@redhat.com>
2548 PR c++/88690 - C++17 ICE with empty base in aggregate.
2549 * typeck2.c (process_init_constructor_record): Skip trivial
2550 initialization of an empty base.
2552 2019-02-21 Richard Biener <rguenther@suse.de>
2555 * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not
2556 make symtab process new functions here.
2558 2019-02-20 Jason Merrill <jason@redhat.com>
2560 PR c++/87921 - wrong error with inline static data member.
2561 * decl2.c (finish_static_data_member_decl): Don't set DECL_IN_AGGR_P
2562 for a non-template inline variable. Do nothing for an
2563 already-instantiated variable.
2564 (c_parse_final_cleanups): Check DECL_IN_AGGR_P without
2566 * decl.c (check_initializer): Likewise.
2567 (make_rtl_for_nonlocal_decl): Likewise.
2568 * pt.c (instantiate_decl): Likewise.
2569 * typeck2.c (store_init_value): Likewise.
2571 2019-02-20 Jakub Jelinek <jakub@redhat.com>
2574 * decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting
2575 for flag_syntax_only from here...
2576 * semantics.c (expand_or_defer_fn_1): ... here.
2579 * decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and
2580 DECL_COMMON, set DECL_INTERFACE_KNOWN.
2583 * constexpr.c (cxx_eval_store_expression): Diagnose changing of active
2584 union member for -std=c++17 and earlier.
2586 2019-02-19 Jason Merrill <jason@redhat.com>
2588 PR c++/87513 - 'sorry' mangling PMF template-id.
2589 * mangle.c (write_expression): Handle SCOPE_REF to BASELINK.
2591 2019-02-19 Jason Merrill <jason@redhat.com>
2593 PR c++/88380 - wrong-code with flexible array and NSDMI.
2594 * typeck2.c (process_init_constructor_record): Skip flexarrays.
2596 2019-02-20 will wray <wjwray@gmail.com>
2598 PR c++/88572 - wrong handling of braces on scalar init.
2599 * decl.c (reshape_init_r): Allow braces around scalar initializer
2600 within aggregate init. Reject double braced-init of scalar
2603 2019-02-20 Paolo Carlini <paolo.carlini@oracle.com>
2606 * pt.c (tsubst_init): Diagnose an initializer expanding to an
2607 empty list of expressions; tweak wrt dependent types.
2608 (regenerate_decl_from_template): For VAR_DECLs call tsubst_init
2609 instead of tsubst_expr.
2611 2019-02-19 Jason Merrill <jason@redhat.com>
2613 PR c++/88368 - wrong 'use of deleted function'
2614 * method.c (walk_field_subobs): Remember errors from get_nsdmi.
2615 (get_defaulted_eh_spec): Call push_tinst_level.
2616 * pt.c (maybe_instantiate_noexcept): Keep error_mark_node.
2617 * typeck2.c (merge_exception_specifiers): Handle error_mark_node.
2619 2019-02-19 Chung-Lin Tang <cltang@codesourcery.com>
2622 * parser.c (cp_parser_oacc_clause_wait): Add representation of wait
2623 clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.
2625 2019-02-19 Jakub Jelinek <jakub@redhat.com>
2628 * lambda.c (maybe_generic_this_capture): Don't check
2629 DECL_NONSTATIC_MEMBER_FUNCTION_P on USING_DECLs.
2632 * typeck.c (build_reinterpret_cast_1): Don't handle void to
2633 && conversion go through build_target_expr_with_type.
2636 * error.c (qualified_name_lookup_error): Only call
2637 suggest_alternative_in_scoped_enum if name is IDENTIFIER_NODE.
2639 2019-02-19 Tom Honermann <tom@honermann.net>
2641 * name-lookup.c (get_std_name_hint): Added u8string as a name hint.
2643 2019-02-18 Jason Merrill <jason@redhat.com>
2645 PR c++/89336 - multiple stores in constexpr stmt.
2646 * constexpr.c (cxx_eval_store_expression): Preevaluate scalar or
2649 * pt.c (check_explicit_specialization): If the declarator is a
2650 template-id, only check whether the arguments are dependent.
2652 Improve duplicate [[likely]] diagnostic.
2653 * parser.c (cp_parser_statement): Make attrs_loc a range. Pass it
2654 to process_stmt_hotness_attribute.
2655 * cp-gimplify.c (process_stmt_hotness_attribute): Take attrs_loc.
2656 (genericize_if_stmt): Use likely/unlikely instead of predictor_name.
2658 2019-02-17 Marek Polacek <polacek@redhat.com>
2660 PR c++/89217 - ICE with list-initialization in range-based for loop.
2661 * constexpr.c (unshare_constructor): No longer static.
2662 * cp-tree.h (unshare_constructor): Declare.
2663 * semantics.c (finish_compound_literal): When dealing with a
2664 non-dependent expression in a template, return the original
2665 expression. Pass LOOKUP_NO_NARROWING to digest_init_flags.
2667 2019-02-13 Marek Polacek <polacek@redhat.com>
2669 PR c++/89297 - ICE with OVERLOAD in template.
2670 * semantics.c (finish_compound_literal): Call
2671 instantiate_non_dependent_expr_sfinae.
2673 2019-02-13 Alexandre Oliva <aoliva@redhat.com>
2676 * cp-tree.h (USING_DECL_SCOPE): Use result rather than type.
2677 * name-lookup.c (strip_using_decl): Use USING_DECL_SCOPE.
2678 * search.c (protected_accessible_p): Follow USING_DECL_DECLS.
2679 (shared_member_p): Likewise.
2680 (lookup_member): Likewise.
2681 * decl.c (grok_special_member_properties): Skip USING_DECLs.
2682 * semantics.c (finish_omp_declare_simd_methods): Likewise.
2683 (finish_qualified_id_expr): Do not call shared_member_p with
2687 * pt.c (tsubst_lambda_expr): Avoid duplicate tsubsting.
2688 Move cp_evaluated resetting before signature tsubsting.
2689 (gen_elem_of_pack_expansion_instantiation): Separate local
2690 specializations per index.
2692 2019-02-13 David Malcolm <dmalcolm@redhat.com>
2695 * class.c (add_method): Drop destructor assertion.
2697 2019-02-13 Paolo Carlini <paolo.carlini@oracle.com>
2700 * decl.c (make_typename_type): Allow for TYPE_PACK_EXPANSION as
2701 context (the first argument).
2702 * pt.c (tsubst, case TYPENAME_TYPE): Handle TYPE_PACK_EXPANSION
2705 2019-02-12 Jason Merrill <jason@redhat.com>
2707 PR c++/89144 - link error with constexpr initializer_list.
2708 * call.c (convert_like_real) [ck_list]: Don't allocate a temporary
2709 array for an empty list.
2710 * typeck2.c (store_init_value): Don't use cxx_constant_init in a
2713 2019-02-11 Jason Merrill <jason@redhat.com>
2715 PR c++/89241 - ICE with __func__ in lambda in template.
2716 * pt.c (enclosing_instantiation_of): Also check
2717 instantiated_lambda_fn_p for the template context.
2719 2019-02-11 Marek Polacek <polacek@redhat.com>
2721 PR c++/89212 - ICE converting nullptr to pointer-to-member-function.
2722 * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Return early for
2723 null member pointer value.
2725 2019-02-11 Jakub Jelinek <jakub@redhat.com>
2728 * pt.c (convert_nontype_argument): Pass true as manifestly_const_eval
2729 to maybe_constant_value calls.
2731 2019-02-11 Marek Polacek <polacek@redhat.com>
2733 * typeck2.c (digest_init_r): Remove commented code.
2735 2019-02-11 Martin Sebor <msebor@redhat.com>
2738 * decl.c (compute_array_index_type_loc): Preserve signed sizes
2739 for diagnostics. Call valid_array_size_p instead of error.
2740 * init.c (build_new_1): Compute size for diagnostic. Call
2741 invalid_array_size_error
2742 (build_new): Call valid_array_size_p instead of error.
2744 2019-02-07 Alexandre Oliva <aoliva@redhat.com>
2747 * call.c (compare_ics): Deal with ck_aggr in either cs.
2749 2019-02-06 David Malcolm <dmalcolm@redhat.com>
2752 * call.c (get_location_for_expr_unwinding_for_system_header): New
2754 (conversion_null_warnings): Use it when getting locations for
2755 EXPR, effectively adding a call to
2756 get_location_for_expr_unwinding_for_system_header for
2757 -Wconversion-null and making use of EXPR_LOCATION for
2758 -Wzero-as-null-pointer-constant.
2760 2019-02-05 Jakub Jelinek <jakub@redhat.com>
2763 * optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on
2764 PARM_DECLs of the thunk.
2765 * lambda.c (maybe_add_lambda_conv_op): Likewise.
2767 2019-02-05 Marek Polacek <polacek@redhat.com>
2769 PR c++/89158 - by-value capture of constexpr variable broken.
2770 * call.c (convert_like_real) <case ck_user>: Call mark_exp_read
2771 instead of mark_rvalue_use.
2773 2019-02-05 Alexandre Oliva <aoliva@redhat.com>
2776 * pt.c (instantiates_primary_template_p): New.
2777 (type_dependent_expression_p): Use it.
2779 2019-02-01 Jason Merrill <jason@redhat.com>
2781 PR c++/88761 - ICE with reference capture of constant.
2782 * lambda.c (mark_const_cap_r): Do walk subtrees of DECL_EXPR for
2785 2019-02-01 Marek Polacek <polacek@redhat.com>
2787 PR c++/88325 - ICE with invalid out-of-line template member definition.
2788 * parser.c (cp_parser_class_name): Don't call make_typename_type
2791 2019-02-01 Jakub Jelinek <jakub@redhat.com>
2794 * parser.c (cp_parser_gnu_attributes_opt): Set ok to false
2795 if require_open failed.
2797 2019-01-31 Marek Polacek <polacek@redhat.com>
2799 PR c++/89083, c++/80864 - ICE with list initialization in template.
2800 * constexpr.c (adjust_temp_type): Use copy_node and change the type
2801 instead of using build_constructor.
2802 * decl.c (reshape_init_r): Don't reshape a digested initializer.
2803 Return the initializer for COMPOUND_LITERAL_P.
2805 PR c++/88983 - ICE with switch in constexpr function.
2806 * constexpr.c (cxx_eval_switch_expr): Use SWITCH_COND and SWITCH_BODY.
2807 (cxx_eval_constant_expression) <case COND_EXPR>: Don't look for the
2808 label in the else branch if we found it in the then branch.
2810 2019-01-30 Jason Merrill <jason@redhat.com>
2812 PR c++/88752 - ICE with lambda and constexpr if.
2813 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New.
2814 * pt.c (tsubst_lambda_expr): Set it.
2815 (instantiated_lambda_fn_p): Check it.
2816 (enclosing_instantiation_of): Use it.
2818 2019-01-31 Jakub Jelinek <jakub@redhat.com>
2821 * cxx-pretty-print.c (pp_cxx_enumeration_constant): Print always as
2822 a C cast in pp_c_flag_gnu_v3 mode.
2824 2019-01-30 Jakub Jelinek <jakub@redhat.com>
2827 * lambda.c (is_capture_proxy): Don't return true for
2828 DECL_OMP_PRIVATIZED_MEMBER artificial vars.
2830 2019-01-30 Marek Polacek <polacek@redhat.com>
2832 PR c++/89119 - ICE with value-initialization in template.
2833 * pt.c (tsubst_copy_and_build): Handle RANGE_EXPR.
2835 2019-01-29 Jason Merrill <jason@redhat.com>
2837 PR c++/86943 - wrong code converting lambda to function pointer.
2838 * lambda.c (maybe_add_lambda_conv_op): Use a template-id in the
2839 call. Only forward parms for decltype.
2840 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Handle CALL_FROM_THUNK_P
2842 * typeck.c (check_return_expr): Don't mess with a thunk call.
2844 2019-01-28 Jason Merrill <jason@redhat.com>
2846 PR c++/89089 - ICE with [[no_unique_address]].
2847 PR c++/88865 - wrong layout with [[no_unique_address]].
2848 * class.c (check_field_decls): A potentially-overlapping field makes
2849 the class non-layout-POD, but not non-empty.
2850 (end_of_class): Always consider empty data members.
2851 (layout_class_type): Set DECL_SIZE for empty fields.
2853 2019-01-28 Marek Polacek <polacek@redhat.com>
2855 PR c++/88358 - name wrongly treated as type.
2856 * parser.c (cp_parser_direct_declarator): Don't assume a qualified-id
2857 in parameter-list is a type if the function's declarator-id is not
2860 2019-01-27 Marek Polacek <polacek@redhat.com>
2862 PR c++/88815 - narrowing conversion lost in decltype.
2863 PR c++/78244 - narrowing conversion in template not detected.
2864 * cp-tree.h (CONSTRUCTOR_IS_DEPENDENT): New.
2865 * pt.c (instantiation_dependent_r): Consider a CONSTRUCTOR with
2866 CONSTRUCTOR_IS_DEPENDENT instantiation-dependent.
2867 * semantics.c (finish_compound_literal): When the compound literal
2868 isn't instantiation-dependent and the type isn't type-dependent,
2869 fall back to the normal processing. Set CONSTRUCTOR_IS_DEPENDENT.
2871 PR c++/89024 - ICE with incomplete enum type.
2872 * call.c (standard_conversion): When converting an
2873 ARITHMETIC_TYPE_P to an incomplete type, return NULL.
2875 2019-01-25 Paolo Carlini <paolo.carlini@oracle.com>
2878 * call.c (build_op_delete_call): Implement 7.6.2.5/(10.1).
2879 * decl2.c (coerce_delete_type): Use build_pointer_type instead
2882 2019-01-24 Jason Merrill <jason@redhat.com>
2884 PR c++/89001 - mangling of reference temporaries
2885 * cp-tree.h (struct saved_scope): Add ref_temp_count.
2886 (current_ref_temp_count): New macro.
2887 * mangle.c (mangle_ref_init_variable): Use it.
2888 * typeck2.c (store_init_value): Clear it.
2889 * call.c (make_temporary_var_for_ref_to_temp): Copy public and
2892 2019-01-24 Jakub Jelinek <jakub@redhat.com>
2895 * semantics.c (finish_omp_cancel): Diagnose more than one if
2896 on #pragma omp cancel with different modifiers. Use
2897 maybe_convert_cond when not in template or build_x_binary_op
2900 2019-01-23 Marek Polacek <polacek@redhat.com>
2902 PR c++/88757 - qualified name treated wrongly as type.
2903 * parser.c (cp_parser_direct_declarator): Don't treat qualified-ids
2904 in parameter-list as types if name lookup for declarator-id didn't
2905 find one or more function templates.
2907 2019-01-23 Jakub Jelinek <jakub@redhat.com>
2910 * cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only
2911 after genericizing cond and incr expressions.
2914 * cp-gimplify.c (genericize_switch_stmt): Move cond genericization
2915 before the begin_bc_block call.
2917 2019-01-21 Jason Merrill <jason@redhat.com>
2919 PR c++/87893 - constexpr ctor ICE on ARM.
2920 PR c++/88293 - ICE with comma expression.
2921 * constexpr.c (initialized_type): Don't shortcut non-void type.
2922 Handle COMPOUND_EXPR.
2923 (cxx_eval_outermost_constant_expr): Return early for void type.
2925 2019-01-21 Jakub Jelinek <jakub@redhat.com>
2928 * optimize.c (cxx_copy_decl): New function.
2929 (clone_body): Use it instead of copy_decl_no_change.
2932 * typeck.c (cp_build_binary_op): Don't instrument
2933 SANITIZE_POINTER_COMPARE if processing_template_decl.
2934 (pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT.
2936 2019-01-18 Jason Merrill <jason@redhat.com>
2938 PR c++/88875 - error with explicit list constructor.
2939 * call.c (reference_binding): Don't modify EXPR. Set
2940 need_temporary_p on the ck_user conversion for a temporary.
2941 (convert_like_real): Check it.
2943 2019-01-18 H.J. Lu <hongjiu.lu@intel.com>
2947 * call.c (convert_for_arg_passing): Upate the
2948 warn_for_address_or_pointer_of_packed_member call.
2949 * typeck.c (convert_for_assignment): Likewise.
2951 2019-01-17 Jason Merrill <jason@redhat.com>
2953 PR c++/86205 - ICE with ?: of throw and template-id.
2954 * pt.c (resolve_nondeduced_context_or_error): Split out from...
2955 * typeck.c (decay_conversion): ...here.
2956 * call.c (build_conditional_expr_1): Use it.
2958 PR c++/86740, ICE with constexpr if and nested generic lambdas.
2959 * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR.
2961 2019-01-17 Paolo Carlini <paolo.carlini@oracle.com>
2963 * decl.c (grokdeclarator): Use typespec_loc in error messages
2964 about 'auto' and trailing return type.
2966 2019-01-17 David Malcolm <dmalcolm@redhat.com>
2969 * class.c (add_method): Don't use DECL_DESTRUCTOR_P on
2972 2019-01-17 Nathan Sidwell <nathan@acm.org>
2975 * semantics.c (process_outer_var_ref): Only skip dependent types
2978 2019-01-17 Alexandre Oliva <aoliva@redhat.com>
2981 * cp-tree.h (saved_scope): Add suppress_location_wrappers.
2982 * name-lookup.c (do_push_to_top_level): Save and reset it.
2983 (do_pop_from_top_level): Restore it.
2986 * pt.c (make_template_placeholder): Use auto_identifier.
2987 (is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test.
2988 * error.c (dump_type): Handle template placeholders.
2989 * cxx-pretty-print.c (pp_cx_unqualified_id): Likewise.
2992 * cvt.c (convert_to_void): Handle all cdtor calls as if
2995 2019-01-16 Paolo Carlini <paolo.carlini@oracle.com>
2997 * decl.c (grokdeclarator): Use locations[ds_storage_class] in
2998 error messages about ill-formed uses of mutable.
3000 2019-01-16 Marek Polacek <polacek@redhat.com>
3002 PR c++/78244 - narrowing conversion in template not detected.
3003 * call.c (perform_implicit_conversion_flags): Set
3004 IMPLICIT_CONV_EXPR_BRACED_INIT.
3005 * cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New.
3006 * pt.c (tsubst_copy_and_build): Use it.
3008 2019-01-15 David Malcolm <dmalcolm@redhat.com>
3011 * pt.c (build_deduction_guide): Bail out if tsubst_arg_types
3014 2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
3016 * decl.c (start_decl): Improve error location.
3017 * decl2.c (grokfield): Likewise.
3019 2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
3021 * decl.c (grokdeclarator): Move further up the location_t loc
3022 declaration and use the location when building a TYPE_DECL for
3024 * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error
3025 about an ill-formed bit-field as typedef.
3027 2019-01-14 Marek Polacek <polacek@redhat.com>
3029 PR c++/88830 - ICE with abstract class.
3030 * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR.
3033 PR c++/88825 - ICE with bogus function return type deduction.
3034 * typeck.c (can_do_nrvo_p): Check error_mark_node.
3036 2019-01-14 Tom Honermann <tom@honermann.net>
3038 Implement P0482R5, char8_t: A type for UTF-8 characters and strings
3039 * cvt.c (type_promotes_to): Handle char8_t promotion.
3040 * decl.c (grokdeclarator): Handle invalid type specifier
3041 combinations involving char8_t.
3042 * lex.c (init_reswords): Add char8_t as a reserved word.
3043 * mangle.c (write_builtin_type): Add name mangling for char8_t (Du).
3044 * parser.c (cp_keyword_starts_decl_specifier_p)
3045 (cp_parser_simple_type_specifier): Recognize char8_t as a simple
3047 (cp_parser_string_literal): Use char8_array_type_node for the type
3049 (cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system
3051 * rtti.c (emit_support_tinfos): type_info support for char8_t.
3052 * tree.c (char_type_p): Recognize char8_t as a character type.
3053 * typeck.c (string_conv_p): Handle conversions of u8 string
3054 literals of char8_t type.
3055 (check_literal_operator_args): Handle UDLs with u8 string literals
3057 * typeck2.c (ordinary_char_type_p): New.
3058 (digest_init_r): Disallow initializing a char array with a u8 string
3061 2019-01-14 Martin Liska <mliska@suse.cz>
3063 PR gcov-profile/88263
3064 * decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION
3065 as location of the TLS wrapper.
3067 2019-01-12 Paolo Carlini <paolo.carlini@oracle.com>
3069 * decl.c (cp_finish_decl): Improve error location.
3070 * decl2.c (grokfield): Likewise, improve two locations.
3072 2019-01-11 Marek Polacek <polacek@redhat.com>
3074 PR c++/88692, c++/87882 - -Wredundant-move false positive with *this.
3075 * typeck.c (maybe_warn_pessimizing_move): Return if ARG isn't
3078 2019-01-11 Jason Merrill <jason@redhat.com>
3080 PR c++/88312 - pack expansion of decltype.
3081 * pt.c (instantiation_dependent_r): A template non-type parameter
3082 pack is instantiation-dependent.
3084 2019-01-11 Jason Merrill <jason@redhat.com>
3086 PR c++/88613 - ICE with use of const var in lambda.
3087 * expr.c (mark_use): Fix location wrapper handling.
3088 * cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use.
3090 2019-01-11 Tobias Burnus <burnus@net-b.de>
3093 * decl2.c (maybe_emit_vtables): If needed, generate code for
3094 the destructor of an abstract class.
3095 (mark_used): Update comment for older function-name change.
3097 2019-01-11 Paolo Carlini <paolo.carlini@oracle.com>
3099 * decl.c (start_decl): Improve error location.
3100 (grokdeclarator): Likewise, improve two locations.
3102 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
3106 * cp-tree.h: Mechanically replace "can not" with "cannot".
3107 * parser.c: Likewise.
3110 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
3112 * decl.c (grok_reference_init): Improve error location.
3113 (grokdeclarator): Likewise, improve two locations.
3115 2019-01-08 Marek Polacek <polacek@redhat.com>
3117 PR c++/88538 - braced-init-list in template-argument-list.
3118 * parser.c (cp_parser_template_argument): Handle braced-init-list when
3121 PR c++/88548 - this accepted in static member functions.
3122 * parser.c (cp_debug_parser): Adjust printing of
3123 local_variables_forbidden_p.
3124 (cp_parser_new): Set local_variables_forbidden_p to 0 rather than false.
3125 (cp_parser_primary_expression): When checking
3126 local_variables_forbidden_p, use THIS_FORBIDDEN or
3127 LOCAL_VARS_FORBIDDEN.
3128 (cp_parser_lambda_body): Update the type of
3129 local_variables_forbidden_p. Set it to 0 rather than false.
3130 (cp_parser_condition): Adjust call to cp_parser_declarator.
3131 (cp_parser_explicit_instantiation): Likewise.
3132 (cp_parser_init_declarator): Likewise.
3133 (cp_parser_declarator): New parameter. Use it.
3134 (cp_parser_direct_declarator): New parameter. Use it to set
3135 local_variables_forbidden_p. Adjust call to cp_parser_declarator.
3136 (cp_parser_type_id_1): Adjust call to cp_parser_declarator.
3137 (cp_parser_parameter_declaration): Likewise.
3138 (cp_parser_default_argument): Update the type of
3139 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
3141 (cp_parser_member_declaration): Tell cp_parser_declarator if we saw
3142 'static' or 'friend'.
3143 (cp_parser_exception_declaration): Adjust call to cp_parser_declarator.
3144 (cp_parser_late_parsing_default_args): Update the type of
3145 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
3147 (cp_parser_cache_defarg): Adjust call to cp_parser_declarator.
3148 (cp_parser_objc_class_ivars): Likewise.
3149 (cp_parser_objc_struct_declaration): Likewise.
3150 (cp_parser_omp_for_loop_init): Likewise.
3151 * parser.h (cp_parser): Change the type of local_variables_forbidden_p
3153 (LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN):
3156 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
3158 * decl.c (start_decl): Improve permerror location.
3160 2019-01-08 Jonathan Wakely <jwakely@redhat.com>
3161 Jakub Jelinek <jakub@redhat.com>
3164 * decl.c (finish_function): For -Wreturn-type don't add a return *this;
3165 fixit hint if current_class_ref is NULL. Use a single if instead of
3168 2019-01-07 Paolo Carlini <paolo.carlini@oracle.com>
3170 * decl.c (start_decl): Improve two error_at locations.
3171 (expand_static_init): Likewise.
3173 2019-01-07 Marek Polacek <polacek@redhat.com>
3175 PR c++/88741 - wrong error with initializer-string.
3176 * decl.c (cp_complete_array_type): Strip any location wrappers.
3178 2019-01-07 Bernd Edlinger <bernd.edlinger@hotmail.de>
3184 * cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value.
3185 * typeck2.c (digest_init_r): Raise an error for non-static
3186 initialization of a flexible array member.
3187 (process_init_constructor, massage_init_elt,
3188 process_init_constructor_array, process_init_constructor_record,
3189 process_init_constructor_union, process_init_constructor): Add the
3190 flags parameter and pass it thru.
3191 (store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to
3192 digest_init_flags for static decls.
3194 2019-01-07 Jakub Jelinek <jakub@redhat.com>
3197 * cp-tree.h (cp_build_vec_convert): Declare.
3198 * parser.c (cp_parser_postfix_expression): Parse
3199 __builtin_convertvector.
3200 * constexpr.c: Include fold-const-call.h.
3201 (cxx_eval_internal_function): Handle IFN_VEC_CONVERT.
3202 (potential_constant_expression_1): Likewise.
3203 * semantics.c (cp_build_vec_convert): New function.
3204 * pt.c (tsubst_copy_and_build): Handle CALL_EXPR to
3207 2019-01-03 Jakub Jelinek <jakub@redhat.com>
3210 * decl.c (builtin_function_1): Return result of pushdecl_top_level
3211 or pushdecl rather than decl.
3213 2019-01-03 Paolo Carlini <paolo.carlini@oracle.com>
3215 * tree.c (handle_nodiscard_attribute): Improve warning location.
3217 2019-01-02 Marek Polacek <polacek@redhat.com>
3219 PR c++/88612 - ICE with -Waddress-of-packed-member.
3220 * call.c (convert_for_arg_passing): Only give warnings with tf_warning.
3221 * typeck.c (convert_for_assignment): Likewise.
3223 PR c++/88631 - CTAD failing for value-initialization.
3224 * typeck2.c (build_functional_cast): Try deducing the template
3225 arguments even if there are no arguments to deduce from.
3227 2019-01-01 Jakub Jelinek <jakub@redhat.com>
3229 Update copyright years.
3231 Copyright (C) 2019 Free Software Foundation, Inc.
3233 Copying and distribution of this file, with or without modification,
3234 are permitted in any medium without royalty provided the copyright
3235 notice and this notice are preserved.