PR c++/91819 - ICE with operator++ and enum.
[official-gcc.git] / gcc / cp / ChangeLog
blob4420d8ffab7d1ba045ec1a8a81921a3e28c1489b
1 2019-09-22  Marek Polacek  <polacek@redhat.com>
3         PR c++/91819 - ICE with operator++ and enum.
4         * call.c (build_new_op_1): Set arg2_type.
6 2019-09-17  Jason Merrill  <jason@redhat.com>
8         * parser.c (cp_parser_statement): Handle [[likely]] on
9         compound-statement.
11 2019-09-19  Jason Merrill  <jason@redhat.com>
13         Revert:
14         * call.c (build_new_op_1): Don't apply any standard conversions to
15         the operands of a built-in operator.  Don't suppress conversions in
16         cp_build_unary_op.
17         * typeck.c (cp_build_unary_op): Do integral promotions for enums.
19 2019-09-16  Paolo Carlini  <paolo.carlini@oracle.com>
21         * decl.c (grokdeclarator): Use declspecs->locations and
22         declarator->id_loc in a few error messages.
23         * pt.c (finish_member_template_decl): Use DECL_SOURCE_LOCATION.
24         (push_template_decl_real): Likewise.
26 2019-09-15  Jason Merrill  <jason@redhat.com>
28         PR c++/30277 - int-width bit-field promotion.
29         PR c++/33819 - long bit-field promotion.
30         * typeck.c (cp_perform_integral_promotions): Handle large bit-fields
31         properly.  Handle 32-bit non-int bit-fields properly.
32         (is_bitfield_expr_with_lowered_type): Don't look through NOP_EXPR.
34         PR c++/82165 - enum bitfields and operator overloading.
35         * call.c (build_new_op_1): Use unlowered_expr_type.
37         * call.c (build_new_op_1): Don't apply any standard conversions to
38         the operands of a built-in operator.  Don't suppress conversions in
39         cp_build_unary_op.
40         * typeck.c (cp_build_unary_op): Do integral promotions for enums.
42 2019-09-15  Marek Polacek  <polacek@redhat.com>
44         PR c++/91740 - ICE with constexpr call and ?: in ARRAY_REF.
45         * pt.c (build_non_dependent_expr): Call build_non_dependent_expr for
46         the first operand.
48 2019-09-15  Nathan Sidwell  <nathan@acm.org>
50         * cp-tree.h (DECL_CLONED_FUNCTION_P): Reimplement using
51         IDENTIFIER_CDTOR_P, correct documentation.
52         (DECL_CLONED_FUNCTION): Directly access field.
53         (decl_cloned_function_p): Delete.
54         * class.c (decl_cloned_function_p): Delete.
55         * pt.c (instantiate_template_1): Check DECL_CHAIN is a decl.
57 2019-09-11  Nathan Sidwell  <nathan@acm.org>
59         * c-objcp-common.c (cp-objcp-common.c): Alphababetize and
60         correctly mark all C++ nodes.
61         * decl.c (cp_tree_node_structure): Alphabetize.
63 2019-09-10  Marek Polacek  <polacek@redhat.com>
65         PR c++/91673 - ICE with noexcept in alias-declaration.
66         * parser.c (CP_PARSER_FLAGS_DELAY_NOEXCEPT): New parser flag.
67         (cp_parser_lambda_declarator_opt): Pass CP_PARSER_FLAGS_NONE to
68         cp_parser_exception_specification_opt.
69         (cp_parser_direct_declarator): Adjust a call to
70         cp_parser_exception_specification_opt.
71         (cp_parser_member_declaration): Pass CP_PARSER_FLAGS_DELAY_NOEXCEPT
72         to cp_parser_declarator if not processing a friend or typedef
73         declaration.
74         (cp_parser_late_noexcept_specifier): Adjust a call to
75         cp_parser_noexcept_specification_opt.
76         (cp_parser_noexcept_specification_opt): New parameter for parser flags,
77         drop the FRIEND_P parameter.  Use the new parameter.
78         (cp_parser_exception_specification_opt): Likewise.
79         (cp_parser_transaction): Adjust a call to
80         cp_parser_noexcept_specification_opt.
81         (cp_parser_transaction_expression): Likewise.
83 2019-09-10  Marek Polacek  <polacek@redhat.com>
85         PR c++/91705 - constexpr evaluation rejects ++/-- on floats.
86         * constexpr.c (cxx_eval_increment_expression): Call fold_simple on
87         the offset.
89 2019-09-10  Paolo Carlini  <paolo.carlini@oracle.com>
91         * decl.c (has_designator_problem): Use cp_expr_loc_or_input_loc
92         in error_at.
93         (build_enumerator): Likewise.
94         (cp_finish_decl): Use DECL_SOURCE_LOCATION.
95         (grokdeclarator): Use id_loc in two error_at; change errror
96         message about constinit together constexpr to use two ranges.
98 2019-09-09  Marek Polacek  <polacek@redhat.com>
100         PR c++/84374 - diagnose invalid uses of decltype(auto).
101         * decl.c (grokdeclarator): Diagnose wrong usage of decltype(auto) in
102         a function declaration.
104 2019-09-06  Nathan Sidwell  <nathan@acm.org>
106         PR c++/91125
107         * cp-tree.h (IDENTIFIER_REPO_CHOSEN, DECL_REPO_AVAILABLE_P): Delete.
108         (struct lang_decl_base): Remove repo_available_p.
109         * decl.c (duplicate_decls): Don't copy DECL_REPO_AVAILABLE_P.
111         (Reserve TREE_LANG_FLAG_3 for modules.
112         * cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): Delete.
113         (DECL_NON_TRIVIALLY_INITIALIZED_P): Move to TREE_LANG_FLAG_6.
114         * class.c (build_ctor_vtbl_group): Don't set
115         DECL_CONSTRUCTION_VTABLE_P.
116         * decl2.c (determine_visibility_from_class): Don't check
117         DECL_CONSTRUCTION_VTABLE_P anymore.
119 2019-09-06  Martin Liska  <mliska@suse.cz>
121         PR c++/91125
122         * Make-lang.in: Remove repo.o.
123         * config-lang.in: Likewise.
124         * cp-tree.h (init_repo): Remove declarations
125         of repo-related functions.
126         (repo_emit_p): Likewise.
127         (repo_export_class_p): Likewise.
128         (finish_repo): Likewise.
129         * decl2.c (import_export_class): Always
130         set -1 value/
131         (mark_needed): Remove -frepo from comment.
132         (import_export_decl): Similarly here.
133         (c_parse_final_cleanups): Remove call of finish_repo.
134         * lex.c (cxx_init): Remove call to init_repo.
135         * optimize.c (can_alias_cdtor): Remove dead condition.
136         * pt.c (push_template_decl_real): Update comment.
137         (instantiate_decl): Remove dead code used for -frepo.
138         * repo.c: Remove.
140 2019-09-05  Marek Polacek  <polacek@redhat.com>
142         PR c++/91644 - ICE with constinit in function template.
143         * decl.c (start_decl): Call retrofit_lang_decl for constinit variables.
144         * pt.c (tsubst_expr): Pass LOOKUP_CONSTINIT down to cp_finish_decl for
145         constinit variables.
147 2019-09-05  Nathan Sidwell  <nathan@acm.org>
149         * cp-tree.h (DECL_VTABLE_OR_VTT_P): Forward to DECL_VIRTUAL_P.
151 2019-09-04  Marek Polacek  <polacek@redhat.com>
153         * call.c (build_over_call): Remove -fdeduce-init-list implementation.
154         * pt.c (unify): Likewise.
156 2019-09-01  Marek Polacek  <polacek@redhat.com>
158         PR c++/91129 - wrong error with binary op in template argument.
159         * typeck.c (warn_for_null_address): Use fold_for_warn instead of
160         fold_non_dependent_expr.
161         (cp_build_binary_op): Likewise.
163 2019-08-30  Jason Merrill  <jason@redhat.com>
165         Add source location to TRAIT_EXPR.
166         * cp-tree.h (TRAIT_EXPR_LOCATION): New.
167         (struct tree_trait_expr): Add locus field.
168         * parser.c (cp_parser_trait_expr): Pass trait_loc down.
169         * pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Likewise.
170         * semantics.c (finish_trait_expr): Add location parm.
171         * tree.c (cp_expr_location): Handle TRAIT_EXPR.
173 2019-08-29  Paolo Carlini  <paolo.carlini@oracle.com>
175         * decl.c (check_var_type): Add location_t parameter and use it.
176         (grokdeclarator): Adjust call.
177         * pt.c (tsubst_decl): Likewise.
178         * cp-tree.h: Adjust declaration.
180 2019-08-28  Marek Polacek  <polacek@redhat.com>
182         Implement P1152R4: Deprecating some uses of volatile.
183         PR c++/91361
184         * cp-gimplify.c (cp_fold): Set TREE_THIS_VOLATILE.
185         * decl.c (grokdeclarator): Warn about a volatile-qualified structured
186         binding and return type.
187         (grokparms): Warn about a volatile-qualified function parameter.
188         * expr.c (mark_use) <case MODIFY_EXPR>: Emit a -Wvolatile warning.
189         * typeck.c (cp_build_unary_op): Emit a -Wvolatile warning for pre and
190         post ++/-- on a volatile operand.
191         (genericize_compound_lvalue): Use a better location.  Don't lose
192         TREE_THIS_VOLATILE.
193         (cp_build_modify_expr): Emit a -Wvolatile warning for a compound
194         assignment whose LHS is volatile-qualified.  Build the assignment with
195         a more precise location.
197 2019-08-28  Marek Polacek  <polacek@redhat.com>
199         PR c++/91360 - Implement C++20 P1143R2: constinit.
200         * cp-tree.h (TINFO_VAR_DECLARED_CONSTINIT): Define.
201         (LOOKUP_CONSTINIT): Define.
202         (enum cp_decl_spec): Add ds_constinit.
203         * decl.c (check_tag_decl): Give an error for constinit in type
204         declarations.
205         (check_initializer): Also check LOOKUP_CONSTINIT.
206         (cp_finish_decl): Add checking for a constinit declaration.  Set
207         TINFO_VAR_DECLARED_CONSTINIT.
208         (grokdeclarator): Add checking for a declaration with the constinit
209         specifier.
210         * lex.c (init_reswords): Handle D_CXX20.
211         * parser.c (cp_lexer_get_preprocessor_token): Pass a better location
212         to warning_at.  Warn about C++20 keywords.
213         (cp_keyword_starts_decl_specifier_p): Handle RID_CONSTINIT.
214         (cp_parser_diagnose_invalid_type_name): Add an inform about constinit.
215         (cp_parser_decomposition_declaration): Maybe pass LOOKUP_CONSTINIT to
216         cp_finish_decl.
217         (cp_parser_decl_specifier_seq): Handle RID_CONSTINIT.
218         (cp_parser_init_declarator): Maybe pass LOOKUP_CONSTINIT to
219         cp_finish_decl.
220         (set_and_check_decl_spec_loc): Add "constinit".
221         * pt.c (tsubst_decl): Set TINFO_VAR_DECLARED_CONSTINIT.
222         (instantiate_decl): Maybe pass LOOKUP_CONSTINIT to cp_finish_decl.
223         * typeck2.c (store_init_value): If a constinit variable wasn't
224         initialized using a constant initializer, give an error.
226 2019-08-28  Nathan Sidwell  <nathan@acm.org>
228         PR c++/90613
229         * name-lookup.c (cp_emit_debug_info): Check for builtins during
230         overload iteration.
232 2019-08-27  Marek Polacek  <polacek@redhat.com>
234         PR c++/81676 - bogus -Wunused warnings in constexpr if.
235         * semantics.c (maybe_mark_exp_read_r): New function.
236         (finish_if_stmt): Call it on THEN_CLAUSE and ELSE_CLAUSE.
238         PR c++/91428 - warn about std::is_constant_evaluated in if constexpr.
239         * cp-tree.h (decl_in_std_namespace_p): Declare.
240         * semantics.c (is_std_constant_evaluated_p): New.
241         (finish_if_stmt_cond): Warn about "std::is_constant_evaluated ()" in
242         an if-constexpr.
243         * typeck.c (decl_in_std_namespace_p): No longer static.
245 2019-08-26  Jason Merrill  <jason@redhat.com>
247         * decl.c (duplicate_decls): Always merge DECL_DECLARED_CONSTEXPR_P.
249 2019-08-26  Marek Polacek  <polacek@redhat.com>
251         PR c++/91545 - ICE in constexpr store evaluation.
252         * constexpr.c (cxx_eval_store_expression): Check FIELD_DECL instead
253         of DECL_P.
255 2019-08-24  Nathan Sidwell  <nathan@acm.org>
257         * class.c (check_for_overrides): Conversion operators need
258         checking too.
260 2019-08-24  Paolo Carlini  <paolo.carlini@oracle.com>
262         * semantics.c (finish_switch_cond): Improve error message location.
264 2019-08-23  Jason Merrill  <jason@redhat.com>
266         * decl2.c (decl_dependent_p): New.
267         (mark_used): Check it instead of just processing_template_decl.
269 2019-08-23  Jason Merrill  <jason@redhat.com>
271         * parser.c (cp_parser_nested_name_specifier_opt): Avoid redundant
272         error.
274 2019-08-23  Marek Polacek  <polacek@redhat.com>
276         PR c++/91521 - wrong error with operator->.
277         * decl.c (grokdeclarator): Return error_mark_node for an invalid
278         trailing return type.
280         PR c++/79817 - attribute deprecated on namespace.
281         * cp-tree.h (cp_warn_deprecated_use_scopes): Declare.
282         * decl.c (grokdeclarator): Call cp_warn_deprecated_use_scopes.
283         (type_is_deprecated): Likewise.
284         * decl2.c (cp_warn_deprecated_use_scopes): New function.
285         * name-lookup.c (handle_namespace_attrs): Handle attribute deprecated.
286         * parser.c (cp_parser_namespace_alias_definition): Call
287         cp_warn_deprecated_use_scopes.
288         (cp_parser_using_declaration): Likewise.
289         (cp_parser_using_directive): Likewise.
290         * semantics.c (finish_id_expression_1): Likewise.
292 2019-08-23  Nathan Sidwell  <nathan@acm.org>
294         * class.c (check_for_override): Checking IDENTIFIER_VIRTUAL_P is
295         sufficient, reorder DECL_OVERRIDE_P check.
297 2019-08-23  Iain Sandoe  <iain@sandoe.co.uk>
299         PR pch/61250
300         * parser.c (cp_parser_initial_pragma): Call c_common_no_more_pch ()
301         after determining that the first token is not
302         PRAGMA_GCC_PCH_PREPROCESS.
304 2019-08-22  Marek Polacek  <polacek@redhat.com>
306         PR c++/91304 - prefix attributes ignored in condition.
307         * parser.c (cp_parser_condition): Handle prefix attributes.
309 2019-08-21  Richard Sandiford  <richard.sandiford@arm.com>
311         PR c++/91505
312         * decl.c (duplicate_decls): Call copy_attributes_to_builtin inside
313         the BUILT_IN_NORMAL block rather than afterward.
315 2019-08-19  Marek Polacek  <polacek@redhat.com>
317         PR c++/91264 - detect modifying const objects in constexpr.
318         * constexpr.c (modifying_const_object_error): New function.
319         (cxx_eval_call_expression): Set TREE_READONLY on a CONSTRUCTOR of
320         a const-qualified object after it's been fully constructed.
321         (modifying_const_object_p): New function.
322         (cxx_eval_store_expression): Detect modifying a const object
323         during constant expression evaluation.
324         (cxx_eval_increment_expression): Use a better location when building
325         up the store.
326         (cxx_eval_constant_expression) <case DECL_EXPR>: Mark a constant
327         object's constructor TREE_READONLY.
329 2019-08-15  Jason Merrill  <jason@redhat.com>
331         PR c++/90393 - ICE with thow in ?:
333         PR c++/64372, DR 1560 - Gratuitous lvalue-to-rvalue conversion in ?:
334         * tree.c (lvalue_kind): Handle throw in one arm.
335         * typeck.c (rationalize_conditional_expr): Likewise.
336         (cp_build_modify_expr): Likewise.
338 2019-08-14  Jason Merrill  <jason@redhat.com>
340         Implement P0848R3, Conditionally Trivial Special Member Functions.
341         * tree.c (special_memfn_p): New.
342         * class.c (add_method): When overloading, hide ineligible special
343         member fns.
344         (check_methods): Set TYPE_HAS_COMPLEX_* here.
345         * decl.c (grok_special_member_properties): Not here.
346         * name-lookup.c (push_class_level_binding_1): Move overloaded
347         functions case down, accept FUNCTION_DECL as target_decl.
349 2019-08-14  Jonathan Wakely  <jwakely@redhat.com>
351         PR c++/91436
352         * name-lookup.c (get_std_name_hint): Fix min_dialect field for
353         complex_literals and make_unique entries.
355 2019-08-14  Jakub Jelinek  <jakub@redhat.com>
356             Marek Polacek  <polacek@redhat.com>
358         PR c++/91391 - bogus -Wcomma-subscript warning.
359         * parser.c (cp_parser_postfix_open_square_expression): Don't warn about
360         a deprecated comma here.  Pass warn_comma_subscript down to
361         cp_parser_expression.
362         (cp_parser_expression): New bool parameter.  Warn about uses of a comma
363         operator within a subscripting expression.
364         (cp_parser_skip_to_closing_square_bracket): Revert to pre-r274121 state.
365         (cp_parser_skip_to_closing_square_bracket_1): Remove.
367 2019-08-14  Jonathan Wakely  <jwakely@redhat.com>
369         * name-lookup.c (get_std_name_hint): Add more entries.
371 2019-08-14  Paolo Carlini  <paolo.carlini@oracle.com>
373         * decl2.c (grok_array_decl): Use the location of the open square
374         bracket in error message about invalid types.
376 2019-08-14  Paolo Carlini  <paolo.carlini@oracle.com>
378         * decl.c (grokdeclarator): Check here for typedef a function
379         definition or a member function definition.
380         (start_function): Adjust.
381         (grokmethod): Likewise.
383 2019-08-13  Richard Sandiford  <richard.sandiford@arm.com>
385         PR middle-end/91421
386         * decl.c (duplicate_decls):  Use copy_decl_built_in_function.
387         * pt.c (declare_integer_pack): Use set_decl_built_in_function.
389 2019-08-13  Marek Polacek  <polacek@redhat.com>
391         PR c++/90473 - wrong code with nullptr in default argument.
392         * call.c (null_ptr_cst_p): Update quote from the standard.
393         * decl.c (check_default_argument): Don't return nullptr when the arg
394         has side-effects.
396 2019-08-13  Marek Polacek  <polacek@redhat.com>
398         * cp-tree.h (DECL_MUTABLE_P): Use FIELD_DECL_CHECK.
400 2019-08-10  Jakub Jelinek  <jakub@redhat.com>
402         * parser.c (cp_parser_omp_clause_name): Parse device_type.
403         (cp_parser_omp_clause_device_type): New function.
404         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DEVICE_TYPE.
405         (OMP_DECLARE_TARGET_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DEVICE_TYPE.
406         (cp_parser_omp_declare_target): Handle device_type clauses.  Remove
407         diagnostics for declare target with clauses nested in clause-less
408         declare target declaration-definition-seq.
409         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DEVICE_TYPE.
411 2019-08-09  Jakub Jelinek  <jakub@redhat.com>
413         * parser.c (check_no_duplicate_clause): Simplify using
414         omp_find_clause.
415         (cp_parser_omp_clause_if): Fix up printing of target {enter,exit} data
416         directive name modifiers.
418         PR c/91401
419         * parser.c (cp_parser_omp_clause_dist_schedule): Comment out the
420         check_no_duplicate_clause call, instead emit a warning for duplicate
421         dist_schedule clauses.
423 2019-08-08  Paolo Carlini  <paolo.carlini@oracle.com>
425         * decl.c (grokdeclarator): Use id_loc and EXPR_LOCATION in
426         a few error messages.
428 2019-08-08  Marek Polacek  <polacek@redhat.com>
430         PR c++/87519 - bogus warning with -Wsign-conversion.
431         * typeck.c (cp_build_binary_op): Use same_type_p instead of comparing
432         the types directly.
434         * constexpr.c (inline_asm_in_constexpr_error): New.
435         (cxx_eval_constant_expression) <case ASM_EXPR>: Call it.
436         (potential_constant_expression_1) <case ASM_EXPR>: Likewise.
438 2019-08-08  Jakub Jelinek  <jakub@redhat.com>
440         * semantics.c (finish_omp_clauses): For C_ORT_OMP
441         OMP_CLAUSE_USE_DEVICE_* clauses use oacc_reduction_head bitmap
442         instead of generic_head to track duplicates.
444 2019-08-07  Marek Polacek  <polacek@redhat.com>
446         PR c++/81429 - wrong parsing of constructor with C++11 attribute.
447         * parser.c (cp_parser_constructor_declarator_p): Handle the scenario
448         when a parameter declaration begins with [[attribute]].
450 2019-08-07  Marek Polacek  <polacek@redhat.com>
452         PR c++/91346 - Implement P1668R1, allow unevaluated asm in constexpr.
453         * constexpr.c (cxx_eval_constant_expression): Handle ASM_EXPR.
454         (potential_constant_expression_1) <case ASM_EXPR>: Allow.
455         * cp-tree.h (finish_asm_stmt): Adjust.
456         * parser.c (cp_parser_asm_definition): Grab the locaion of "asm" and
457         use it.  Change an error to a pedwarn.  Allow asm in C++2a, warn
458         otherwise.
459         * pt.c (tsubst_expr): Pass a location down to finish_asm_stmt.
460         * semantics.c (finish_asm_stmt): New location_t parameter.  Use it.
462 2019-08-07  Jakub Jelinek  <jakub@redhat.com>
464         * parser.c (cp_parser_omp_clause_name): Parse use_device_addr clause.
465         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR.
466         (OMP_TARGET_DATA_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR.
467         (cp_parser_omp_target_data): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR
468         like PRAGMA_OMP_CLAUSE_USE_DEVICE_PTR, adjust diagnostics about no
469         map or use_device_* clauses.
470         * semantics.c (finish_omp_clauses): For OMP_CLAUSE_USE_DEVICE_PTR
471         in OpenMP, require pointer or reference to pointer type rather than
472         pointer or array or reference to pointer or array type. Handle
473         OMP_CLAUSE_USE_DEVICE_ADDR.
474         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_USE_DEVICE_ADDR.
476 2019-08-06  Jason Merrill  <jason@redhat.com>
478         PR c++/91378 - ICE with noexcept and auto return type.
479         * pt.c (maybe_instantiate_noexcept): push_to_top_level.
481 2019-08-06  Paolo Carlini  <paolo.carlini@oracle.com>
483         * decl.c (check_array_designated_initializer): Use
484         cp_expr_loc_or_input_loc in one place.
486 2019-08-06  Jakub Jelinek  <jakub@redhat.com>
488         * parser.c (cp_parser_omp_for_loop): For OMP_LOOP, ignore parallel
489         clauses and predetermine iterator as lastprivate.
490         * semantics.c (handle_omp_for_class_iterator): Use
491         OMP_CLAUSE_LASTPRIVATE_LOOP_IV instead of
492         OMP_CLAUSE_LASTPRIVATE_TASKLOOP_IV, set it for lastprivate also
493         on OMP_LOOP construct.  If a clause is missing for class iterator
494         on OMP_LOOP, add firstprivate clause, and if there is private
495         clause, turn it into firstprivate too.
496         (finish_omp_for): Formatting fix.  For OMP_LOOP, adjust
497         OMP_CLAUSE_LASTPRIVATE_LOOP_IV clause CP_CLAUSE_INFO, so that it
498         uses copy ctor instead of default ctor.
499         * cp-gimplify.c (cp_gimplify_expr): Handle OMP_LOOP like
500         OMP_DISTRIBUTE etc.
501         (cp_fold_r): Likewise.
502         (cp_genericize_r): Likewise.
503         (cxx_omp_finish_clause): Also finish lastprivate clause with
504         OMP_CLAUSE_LASTPRIVATE_LOOP_IV flag.
505         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_BIND.
506         (tsubst_omp_for_iterator): For OMP_LOOP, ignore parallel
507         clauses and predetermine iterator as lastprivate.
508         * constexpr.c (potential_constant_expression_1): Handle OMP_LOOP
509         like OMP_DISTRIBUTE etc.
511 2019-08-05  Marek Polacek  <polacek@redhat.com>
513         DR 2413 - typename in conversion-function-ids.
514         * parser.c (cp_parser_conversion_type_id): Call
515         cp_parser_type_specifier_seq with CP_PARSER_FLAGS_TYPENAME_OPTIONAL
516         instead of CP_PARSER_FLAGS_NONE.
518 2019-08-05  Paolo Carlini  <paolo.carlini@oracle.com>
520         * cp-tree.h (cp_expr_loc_or_input_loc): New.
521         (cxx_incomplete_type_diagnostic): Use it.
522         * call.c (build_converted_constant_expr_internal, convert_like_real,
523         convert_arg_to_ellipsis, convert_for_arg_passing, build_over_call,
524         build_cxx_call, perform_implicit_conversion_flags,
525         initialize_reference): Likewise.
526         * constexpr.c (cxx_eval_internal_function, cxx_eval_call_expression,
527         eval_and_check_array_index, cxx_eval_store_expression,
528         cxx_eval_statement_list, cxx_eval_loop_expr,
529         cxx_eval_constant_expression, potential_constant_expression_1):
530         Likewise.
531         * constraint.cc (check_for_logical_overloads,
532         satisfy_predicate_constraint): Likewise.
533         * cp-gimplify.c (cp_gimplify_expr): Likewise.
534         * cvt.c (cp_convert_to_pointer, convert_to_reference,
535         cp_convert_and_check, ocp_convert, maybe_warn_nodiscard): Likewise.
536         * decl.c (pop_switch): Likewise.
537         * decl2.c (delete_sanity): Likewise.
538         * error.c (location_of): Likewise.
539         * init.c (maybe_warn_list_ctor, build_aggr_init,
540         warn_placement_new_too_small, build_new_1, build_vec_init): Likewise.
541         * lex.c (unqualified_name_lookup_error): Likewise.
542         * parser.c (cp_parser_initializer_list, cp_parser_omp_for_cond):
543         Likewise.
544         * pt.c (check_for_bare_parameter_packs, check_valid_ptrmem_cst_expr,
545         unify_arg_conversion, convert_nontype_argument,
546         tsubst_copy_and_build, resolve_typename_type): Likewise.
547         * semantics.c (maybe_convert_cond, finish_call_expr,
548         cp_build_vec_convert): Likewise.
549         * typeck.c (decay_conversion, rationalize_conditional_expr,
550         cp_build_unary_op, build_x_compound_expr_from_list,
551         maybe_warn_about_returning_address_of_local,
552         maybe_warn_pessimizing_move): Likewise.
553         * typeck2.c (check_narrowing, digest_init_r,
554         process_init_constructor_array): Likewise.
556 2019-08-05  Tom Honermann  <tom@honermann.net>
558         * parser.c (cp_parser_template_declaration_after_parameters): Enable
559         class template argument deduction for non-type template parameters
560         in literal operator templates.
562 2019-08-05  Marek Polacek  <polacek@redhat.com>
564         PR c++/91338 - Implement P1161R3: Deprecate a[b,c].
565         * parser.c (cp_parser_postfix_open_square_expression): Warn about uses
566         of a comma operator within a subscripting expression.
567         (cp_parser_skip_to_closing_square_bracket_1): New function, made out
568         of...
569         (cp_parser_skip_to_closing_square_bracket): ...this.
571 2019-08-05  Jason Merrill  <jason@redhat.com>
573         * semantics.c (force_paren_expr): Preserve location.
575 2019-08-02  Marek Polacek  <polacek@redhat.com>
577         PR c++/91230 - wrong error with __PRETTY_FUNCTION__ and generic lambda.
578         * pt.c (value_dependent_expression_p): Consider __PRETTY_FUNCTION__
579         inside a template function value-dependent.
581 2019-08-02  Paolo Carlini  <paolo.carlini@oracle.com>
583         * tree.c (handle_nodiscard_attribute): Do not warn about nodiscard
584         applied to a constructor.
586 2019-08-02  Martin Liska  <mliska@suse.cz>
588         * decl.c (grok_op_properties):
589         Mark DECL_SET_IS_OPERATOR_DELETE for user-provided delete operators.
591 2019-08-01  Martin Sebor  <msebor@redhat.com>
593         PR c++/90947
594         * decl.c (reshape_init_array_1): Avoid truncating initializer
595         lists containing string literals.
597 2019-08-01  Marek Polacek  <polacek@redhat.com>
599         PR c++/90805 - detect narrowing in case values.
600         * decl.c (case_conversion): Detect narrowing in case values.
602 2019-07-31  Paolo Carlini  <paolo.carlini@oracle.com>
604         * decl2.c (delete_sanity): Improve diagnostic locations, use
605         cp_expr_loc_or_loc in four places.
607 2019-07-31  Jason Merrill  <jason@redhat.com>
609         PR c++/90538 - multiple expansions of capture packs
610         * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): Remove.
611         * lambda.c (add_capture): Copy parameter packs from init.
612         (lambda_capture_field_type): Always use auto for init-capture.
613         * pt.c (uses_parameter_packs): Return tree.
614         (tsubst) [DECLTYPE_TYPE]: Remove init-capture handling.
615         (gen_elem_of_pack_expansion_instantiation): Don't push
616         local_specialization_stack.
617         (prepend_one_capture): New.
618         (tsubst_lambda_expr): Use it.  Don't touch local_specializations.
619         (do_auto_deduction): Avoid redundant error.
621         Fix copy_node of TEMPLATE_INFO.
622         * cp-tree.h (struct tree_template_info): Use tree_base instead of
623         tree_common.  Add tmpl and args fields.
624         (TI_TEMPLATE, TI_ARGS): Adjust.
626 2019-07-30  Martin Liska  <mliska@suse.cz>
628         PR tree-optimization/91270
629         * tree-ssa-dce.c (propagate_necessity): Mark 2nd argument
630         of delete operator as needed.
632 2019-07-25  Martin Liska  <mliska@suse.cz>
633             Dominik Infuhr  <dominik.infuehr@theobroma-systems.com>
635         PR c++/23383
636         * decl.c (cxx_init_decl_processing): Mark delete operators
637         with DECL_SET_IS_OPERATOR_DELETE.
639 2019-07-25  Martin Liska  <mliska@suse.cz>
641         * decl.c (duplicate_decls): Use new macros
642         (e.g. DECL_SET_LAMBDA_FUNCTION and DECL_LAMBDA_FUNCTION_P).
643         (cxx_init_decl_processing): Likewise.
644         (grok_op_properties): Likewise.
645         * parser.c (cp_parser_lambda_declarator_opt): Likewise.
647 2019-07-24  Martin Sebor  <msebor@redhat.com>
649         PR driver/80545
650         * decl.c (finish_function): Use lang_mask.
652 2019-07-20  Jason Merrill  <jason@redhat.com>
654         * cp-tree.h (ovl_iterator::using_p): A USING_DECL by itself was also
655         introduced by a using-declaration.
657 2019-07-20  Jason Merrill  <jason@redhat.com>
659         Reduce memory consumption for push/pop_access_scope.
660         * name-lookup.c (leave_scope): Do add class levels other than
661         previous_class_level to free_binding_level.
662         (invalidate_class_lookup_cache): Move from class.c, add to
663         free_binding_level.
664         * pt.c (saved_access_scope): Change from list to vec.
666 2019-07-20  Jakub Jelinek  <jakub@redhat.com>
668         * cp-tree.h (OMP_FOR_GIMPLIFYING_P): Use OMP_LOOPING_CHECK
669         instead of OMP_LOOP_CHECK.
670         * parser.c (cp_parser_omp_clause_name): Handle bind clause.
671         (cp_parser_omp_clause_bind): New function.
672         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_BIND.
673         (OMP_LOOP_CLAUSE_MASK): Define.
674         (cp_parser_omp_loop): New function.
675         (cp_parser_omp_parallel, cp_parser_omp_teams): Handle parsing of
676         loop combined with parallel or teams.
677         (cp_parser_omp_construct): Handle PRAGMA_OMP_LOOP.
678         (cp_parser_pragma): Likewise.
679         * pt.c (tsubst_expr): Handle OMP_LOOP.
680         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_BIND.
682 2019-07-19  Jason Merrill  <jason@redhat.com>
684         PR c++/90101 - dependent class non-type parameter.
685         * pt.c (invalid_nontype_parm_type_p): Check for dependent class type.
687 2019-07-18  Jason Merrill  <jason@redhat.com>
689         PR c++/90098 - partial specialization and class non-type parms.
690         PR c++/90099
691         PR c++/90101
692         * call.c (build_converted_constant_expr_internal): Don't copy.
693         * pt.c (process_partial_specialization): Allow VIEW_CONVERT_EXPR
694         around class non-type parameter.
695         (unify) [TEMPLATE_PARM_INDEX]: Ignore cv-quals.
697 2019-07-16  Jason Merrill  <jason@redhat.com>
699         * parser.c (make_location): Add overload taking cp_lexer* as last
700         parameter.
702         * parser.c (cp_parser_simple_type_specifier): Separate tentative
703         parses for optional type-spec and CTAD.
705         * parser.c (cp_parser_nested_name_specifier_opt): If the token is
706         already CPP_NESTED_NAME_SPECIFIER, leave it alone.
708 2019-07-12  Jakub Jelinek  <jakub@redhat.com>
710         * parser.c (cp_parser_omp_clause_name): Handle order clause.
711         (cp_parser_omp_clause_order): New function.
712         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ORDER.
713         (OMP_SIMD_CLAUSE_MASK, OMP_FOR_CLAUSE_MASK): Add
714         PRAGMA_OMP_CLAUSE_ORDER.
715         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_ORDER.
716         * pt.c (tsubst_omp_clauses): Likewise.
718 2019-07-10  Paolo Carlini  <paolo.carlini@oracle.com>
720         * decl.c (get_type_quals,
721         smallest_type_location (const cp_decl_specifier_seq*)): New.
722         (check_tag_decl): Use smallest_type_location in error_at about
723         multiple types in one declaration.
724         (grokdeclarator): Use locations[ds_complex] in error_at about
725         complex invalid; use locations[ds_storage_class] in error_at
726         about static cdtor; use id_loc in error_at about flexible
727         array member in union; use get_type_quals.
729 2019-07-09  Martin Sebor  <msebor@redhat.com>
731         PR c++/61339
732         * cp-tree.h: Change class-key of PODs to struct and others to class.
733         * search.c: Same.
734         * semantics.c (finalize_nrv_r): Same.
736 2019-07-09  Martin Sebor  <msebor@redhat.com>
738         PR c++/61339
739         * constexpr.c (cxx_eval_call_expression): Change class-key from class
740         to struct and vice versa to match convention and avoid -Wclass-is-pod
741         and -Wstruct-no-pod.
742         * constraint.cc (get_concept_definition): Same.
743         * cp-tree.h: Same.
744         * cxx-pretty-print.h: Same.
745         * error.c: Same.
746         * logic.cc (term_list::replace): Same.
747         * name-lookup.c (find_local_binding): Same.
748         * pt.c (tsubst_binary_right_fold): Same.
749         * search.c (field_accessor_p): Same.
750         * semantics.c (expand_or_defer_fn): Same.
752 2019-07-08  Jakub Jelinek  <jakub@redhat.com>
754         PR c++/91110
755         * decl2.c (cp_omp_mappable_type_1): Don't emit any note for
756         error_mark_node type.
758 2019-07-05  Jakub Jelinek  <jakub@redhat.com>
760         PR c++/67184
761         PR c++/69445
762         * call.c (build_new_method_call_1): Remove set but not used variable
763         binfo.
765 2019-07-05  Paolo Carlini  <paolo.carlini@oracle.com>
767         PR c++/67184 (again)
768         PR c++/69445
769         * call.c (build_over_call): Devirtualize user-defined operators
770         coming from a base too.
771         (build_new_method_call_1): Do not devirtualize here.
773 2019-07-04  Marek Polacek  <polacek@redhat.com>
775         DR 1813
776         PR c++/83374 - __is_standard_layout wrong for a class with repeated
777         bases.
778         * class.c (check_bases): Set CLASSTYPE_NON_STD_LAYOUT for a class if
779         CLASSTYPE_REPEATED_BASE_P is true.
781 2019-07-04  Andrew Stubbs  <ams@codesourcery.com>
783         * cp-tree.h (cp_omp_emit_unmappable_type_notes): New prototype.
784         * decl.c (cp_finish_decl): Call cp_omp_emit_unmappable_type_notes.
785         * decl2.c (cp_omp_mappable_type): Move contents to ...
786         (cp_omp_mappable_type_1): ... here and add note output.
787         (cp_omp_emit_unmappable_type_notes): New function.
788         * semantics.c (finish_omp_clauses): Call
789         cp_omp_emit_unmappable_type_notes in four places.
791 2019-07-03  Martin Liska  <mliska@suse.cz>
793         * call.c (build_new_op_1): Remove dead assignemts.
794         * typeck.c (cp_build_binary_op): Likewise.
796 2019-06-27  Jason Merrill  <jason@redhat.com>
798         PR c++/55442 - memory-hog with highly recursive constexpr.
799         * constexpr.c (push_cx_call_context): Return depth.
800         (cxx_eval_call_expression): Don't cache past constexpr_cache_depth.
802 2019-06-27  Jan Hubicka  <jh@suse.cz>
804         * class.c (layout_class_type): Set TYPE_CXX_ODR_P for as-base
805         type copy.
807 2019-06-27  Martin Liska  <mliska@suse.cz>
809         * class.c (adjust_clone_args): Remove obviously
810         dead assignments.
811         (dump_class_hierarchy_r): Likewise.
812         * decl.c (check_initializer): Likewise.
813         * parser.c (cp_parser_lambda_expression): Likewise.
814         * pt.c (unify_bound_ttp_args): Likewise.
815         (convert_template_argument): Likewise.
816         * rtti.c (build_headof): Likewise.
817         * typeck.c (convert_for_initialization): Likewise.
819 2019-06-25  Jason Merrill  <jason@redhat.com>
821         PR c++/70462 - unnecessary base ctor variant with final.
822         * optimize.c (populate_clone_array): Skip base variant if
823         CLASSTYPE_FINAL.
824         (maybe_clone_body): We don't need an alias if we are only defining
825         one clone.
827         * class.c (resolves_to_fixed_type_p): Check CLASSTYPE_FINAL.
829 2019-06-25  Jakub Jelinek  <jakub@redhat.com>
831         PR c++/90969
832         * constexpr.c (cxx_eval_array_reference): Don't look through VCE from
833         vector type if lval.
835 2019-06-25  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
837         * lex.c (init_reswords): Create keyword for "__intN__" type.
838         * cp-tree.h (cp_decl_specifier_seq): New bitfield "int_n_alt".
839         * decl.c (grokdeclarator): Don't pedwarn about "__intN" ISO
840         C incompatibility if alternate "__intN__" form is used.
841         * parser.c (cp_parser_simple_type_specifier): Set
842         decl_specs->int_n_alt if "__intN__" form is used.
844 2019-06-24  Jan Hubicka  <jh@suse.cz>
846         * lex.c (cxx_make_type): Set TYPE_CXX_ODR_P.
848 2019-06-24  Jason Merrill  <jason@redhat.com>
850         * class.c (layout_class_type): Don't use a separate
851         CLASSTYPE_AS_BASE if it's the same size.
853 2019-06-23  Marek Polacek  <polacek@redhat.com>
855         * call.c (convert_default_arg): Use DEFERRED_PARSE instead of
856         DEFAULT_ARG.
857         * cp-objcp-common.c (cp_tree_size): Likewise.  Use tree_deferred_parse
858         instead of tree_default_arg.
859         * cp-tree.def: Rename DEFAULT_ARG to DEFERRED_PARSE.
860         * cp-tree.h: Rename DEFARG_TOKENS to DEFPARSE_TOKENS.  Rename
861         DEFARG_INSTANTIATIONS to DEFPARSE_INSTANTIATIONS.  Rename
862         tree_default_arg to tree_deferred_parse.
863         (UNPARSED_NOEXCEPT_SPEC_P): Use DEFERRED_PARSE instead of DEFAULT_ARG.
864         (cp_tree_node_structure_enum): Rename TS_CP_DEFAULT_ARG to
865         TS_CP_DEFERRED_PARSE.
866         (lang_tree_node): Rename tree_default_arg to tree_deferred_parse.
867         Rename default_arg to deferred_parse.  Use TS_CP_DEFERRED_PARSE instead
868         of TS_CP_DEFAULT_ARG.
869         (defarg_location): Remove declaration.
870         (defparse_location): Add declaration.
871         * decl.c (grokfndecl): Use DEFERRED_PARSE instead of DEFAULT_ARG.
872         Call defparse_location instead of defarg_location.
873         (check_default_argument): Use DEFERRED_PARSE instead of DEFAULT_ARG.
874         (cp_tree_node_structure): Likewise.  Use TS_CP_DEFERRED_PARSE instead
875         of TS_CP_DEFAULT_ARG.
876         * decl2.c (grokfield): Use DEFERRED_PARSE instead of DEFAULT_ARG.
877         * error.c (dump_expr): Likewise.
878         (location_of): Likewise.
879         * init.c (get_nsdmi): Likewise.
880         * parser.c (cp_parser_save_noexcept): Likewise.  Use DEFPARSE_TOKENS
881         instead of DEFARG_TOKENS.
882         (cp_parser_late_noexcept_specifier): Likewise.
883         (cp_parser_late_parse_one_default_arg): Use DEFPARSE_TOKENS instead
884         of DEFARG_TOKENS.
885         (cp_parser_late_parsing_default_args): Use DEFERRED_PARSE instead of
886         DEFAULT_ARG.  Use DEFPARSE_INSTANTIATIONS instead of
887         DEFARG_INSTANTIATIONS.
888         (cp_parser_cache_defarg): Use DEFERRED_PARSE instead of DEFAULT_ARG.
889         Use DEFPARSE_TOKENS instead of DEFARG_TOKENS.  Use
890         DEFPARSE_INSTANTIATIONS instead of DEFARG_INSTANTIATIONS.
891         (defparse_location): Renamed from defarg_location.
892         * pt.c (tsubst_default_argument): Use DEFERRED_PARSE instead of
893         DEFAULT_ARG.
894         (tsubst_arg_types): Likewise.
895         (dependent_type_p_r): Likewise.
896         * tree.c (cp_tree_equal): Likewise.
897         (cp_walk_subtrees): Likewise.
898         * typeck.c (convert_arguments): Likewise.
900 2019-06-22  Marek Polacek  <polacek@redhat.com>
902         PR c++/86476 - noexcept-specifier is a complete-class context.
903         PR c++/52869
904         * cp-tree.def (DEFAULT_ARG): Update commentary.
905         * cp-tree.h (UNPARSED_NOEXCEPT_SPEC_P): New macro.
906         (tree_default_arg): Use tree_base instead of tree_common.
907         (do_push_parm_decls, maybe_check_overriding_exception_spec): Declare.
908         * decl.c (do_push_parm_decls): New function, broken out of...
909         (store_parm_decls): ...here.  Call it.
910         * except.c (nothrow_spec_p): Accept DEFAULT_ARG in the assert.
911         * parser.c (cp_parser_noexcept_specification_opt,
912         cp_parser_late_noexcept_specifier, noexcept_override_late_checks):
913         Forward-declare.
914         (unparsed_noexcepts): New macro.
915         (push_unparsed_function_queues): Update initializer.
916         (cp_parser_direct_declarator): Pass FRIEND_P to
917         cp_parser_exception_specification_opt.
918         (inject_parm_decls): New.
919         (pop_injected_parms): New.
920         (cp_parser_class_specifier_1): Implement delayed parsing of
921         noexcept-specifiers.
922         (cp_parser_save_noexcept): New.
923         (cp_parser_late_noexcept_specifier): New.
924         (noexcept_override_late_checks): New.
925         (cp_parser_noexcept_specification_opt): Add FRIEND_P parameter.  Call
926         cp_parser_save_noexcept instead of the normal processing if needed.
927         (cp_parser_exception_specification_opt): Add FRIEND_P parameter and
928         pass it to cp_parser_noexcept_specification_opt.
929         (cp_parser_save_member_function_body): Fix comment.
930         (cp_parser_save_default_args): Maybe save the noexcept-specifier to
931         post process.
932         (cp_parser_transaction): Update call to
933         cp_parser_noexcept_specification_opt.
934         (cp_parser_transaction_expression): Likewise.
935         * parser.h (cp_unparsed_functions_entry): Add new field to carry
936         a noexcept-specifier.
937         * pt.c (dependent_type_p_r): Handle unparsed noexcept expression.
938         * search.c (maybe_check_overriding_exception_spec): New function, broken
939         out of...
940         (check_final_overrider): ...here.  Call
941         maybe_check_overriding_exception_spec.
942         * tree.c (canonical_eh_spec): Handle UNPARSED_NOEXCEPT_SPEC_P.
943         (cp_tree_equal): Handle DEFAULT_ARG.
945         PR c++/90881 - bogus -Wunused-value in unevaluated context.
946         * cvt.c (convert_to_void): Don't emit unused warnings in
947         an unevaluated context.
949 2019-06-22  Paolo Carlini  <paolo.carlini@oracle.com>
951         * decl.c (grokdeclarator): Use id_loc, typespec_loc, and
952         locations[ds_storage_class] in a few additional places.
954 2019-06-21  Paolo Carlini  <paolo.carlini@oracle.com>
956         PR c++/90909
957         Revert:
958         2019-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
960         PR c++/67184
961         PR c++/69445
962         * call.c (build_over_call): Devirtualize when the final overrider
963         comes from the base.
965 2019-06-21  Marek Polacek  <polacek@redhat.com>
967         PR c++/61490 - qualified-id in friend function definition.
968         * decl.c (grokdeclarator): Diagnose qualified-id in friend function
969         definition.  Improve location for diagnostics of friend functions.
971         PR c++/60223 - ICE with T{} in non-deduced context.
972         * pt.c (unify): Allow COMPOUND_LITERAL_P in a non-deduced context.
974         PR c++/64235 - missing syntax error with invalid alignas.
975         * parser.c (cp_parser_std_attribute_spec): Commit to tentative parse
976         if there's a missing close paren.
978         PR c++/90490 - fix decltype issues in noexcept-specifier.
979         * except.c (build_noexcept_spec): Call
980         instantiate_non_dependent_expr_sfinae before
981         build_converted_constant_expr instead of calling
982         instantiate_non_dependent_expr after it.  Add
983         processing_template_decl_sentinel.
985 2019-06-21  Jakub Jelinek  <jakub@redhat.com>
987         PR c++/90950
988         * semantics.c (finish_omp_clauses): Don't reject references to
989         incomplete types if processing_template_decl.
991 2019-06-19  Marek Polacek  <polacek@redhat.com>
993         PR c++/60364 - noreturn after first decl not diagnosed.
994         * decl.c (duplicate_decls): Give an error when a function is
995         declared [[noreturn]] after its first declaration.
996         * parser.c (cp_parser_std_attribute): Don't treat C++11 noreturn
997         attribute as equivalent to GNU's.
998         * tree.c (std_attribute_table): Add noreturn.
1000 2019-06-19  Jakub Jelinek  <jakub@redhat.com>
1002         * cp-gimplify.c (cp_genericize_r): Handle OMP_CLAUSE_{IN,EX}CLUSIVE
1003         like OMP_CLAUSE_SHARED.
1005 2019-06-18  Jason Merrill  <jason@redhat.com>
1007         * constexpr.c (cxx_eval_store_expression): Delay target evaluation.
1009 2019-06-18  Jason Merrill  <jason@redhat.com>
1011         * constexpr.c (eval_and_check_array_index): Split out from...
1012         (cxx_eval_array_reference): ...here.
1013         (cxx_eval_store_expression): Use it here, too.
1014         (diag_array_subscript): Take location.  Strip location wrapper.
1016 2019-06-18  Jason Merrill  <jason@redhat.com>
1018         * constexpr.c (cxx_eval_constant_expression): Handle conversion from
1019         and then to the same type.
1021 2019-06-18  Jason Merrill  <jason@redhat.com>
1023         * constexpr.c (unshare_constructor): Add MEM_STAT_DECL.
1025 2019-06-17  Jakub Jelinek  <jakub@redhat.com>
1027         * semantics.c (finish_omp_clauses): For OMP_CLAUSE_REDUCTION_INSCAN
1028         set need_copy_assignment.
1030 2019-06-17  Marek Polacek  <polacek@redhat.com>
1032         PR c++/83820 - excessive attribute arguments not detected.
1033         * parser.c (cp_parser_std_attribute): Detect excessive arguments.
1035 2019-06-17  Nathan Sidwell  <nathan@acm.org>
1037         PR c++/90754
1038         * name-lookup.c (lookup_type_scope_1): Calll qualify_lookup before
1039         checking context.
1041 2019-06-14  Marek Polacek  <polacek@redhat.com>
1043         PR c++/90884 - stray note with -Wctor-dtor-privacy.
1044         * class.c (maybe_warn_about_overly_private_class): Guard the call to
1045         inform.
1047 2019-06-12  Jason Merrill  <jason@redhat.com>
1049         PR c++/85552 - wrong instantiation of dtor for DMI.
1050         * typeck2.c (digest_nsdmi_init): Set tf_no_cleanup for direct-init.
1052 2019-06-13  Paolo Carlini  <paolo.carlini@oracle.com>
1054         * decl.c (grokdeclarator): Use id_loc in five additional places
1055         in the last part of the function.
1057 2019-06-13  Paolo Carlini  <paolo.carlini@oracle.com>
1059         * decl.c (grokdeclarator): Move further up the declaration of
1060         id_loc, use it immediately, update its value after the loop
1061         over declarator, use it again in the final part of function;
1062         improve locations of error messages about multiple data types
1063         and conflicting specifiers.
1065 2019-06-13  Richard Biener  <rguenther@suse.de>
1067         PR c++/90801
1068         * typeck2.c (split_nonconstant_init_1): Properly count
1069         num_split_elts, optimize single constructor elt removal.
1071 2019-06-12  Marek Polacek  <polacek@redhat.com>
1073         PR c++/66999 - 'this' captured by reference.
1074         * parser.c (cp_parser_lambda_introducer): Reject `&this'.  Use
1075         cp_lexer_nth_token_is instead of cp_lexer_peek_nth_token.
1077         PR c++/90825 - endless recursion when evaluating sizeof.
1078         PR c++/90832 - endless recursion when evaluating sizeof.
1079         * constexpr.c (cxx_eval_constant_expression): Don't recurse on the
1080         result of fold_sizeof_expr if is returns a SIZEOF_EXPR.
1081         * typeck.c (cxx_sizeof_expr): Only return a SIZEOF_EXPR if the operand
1082         is instantiation-dependent.
1084         PR c++/90736 - bogus error with alignof.
1085         * constexpr.c (adjust_temp_type): Use cv_unqualified type.
1087 2019-06-11  Matthew Beliveau  <mbelivea@redhat.com>
1089         PR c++/90449 - add -Winaccessible-base option.
1090         * class.c (warn_about_ambiguous_bases): Changed name to:
1091         maybe_warn_about_inaccessible_bases.
1092         (maybe_warn_about_inaccessible_bases): Implemented new
1093         Winaccessible-base warning option for both direct and virtual
1094         base warnings.
1095         (layout_class_type): Call to warn_about_ambiguous_bases changed to fit
1096         new name.
1098 2019-06-11  Richard Biener  <rguenther@suse.de>
1100         PR c++/90801
1101         * typeck2.c (split_nonconstant_init_1): Avoid ordered remove
1102         from CONSTRUCTOR by marking to remove elements and doing all
1103         of them in a O(n) scan.
1105 2019-06-11  Jakub Jelinek  <jakub@redhat.com>
1107         PR c++/90810
1108         * init.c (constant_value_1): Handle VECTOR_CST DECL_INITIAL for
1109         !DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P decls like CONSTRUCTOR.
1111 2019-06-11  Martin Liska  <mliska@suse.cz>
1113         PR c++/87847
1114         * pt.c (init_template_processing): Disable hash table
1115         sanitization for decl_specializations and type_specializations.
1117 2019-06-10  Jason Merrill  <jason@redhat.com>
1119         * constexpr.c (free_constructor): New.
1120         (cxx_eval_call_expression): Free parameter value CONSTRUCTORs.
1122         * constexpr.c (unshare_constructor): Only unshare if T is itself a
1123         CONSTRUCTOR.
1124         (cxx_eval_call_expression): Don't call it on the result here.
1126         Reduce constexpr_call memory consumption.
1127         * constexpr.c (cxx_bind_parameters_in_call): Use TREE_VEC rather
1128         than TREE_LIST.
1129         (constexpr_call_hasher::equal, cxx_bind_parameters_in_call)
1130         (cxx_eval_call_expression): Adjust.
1132 2019-06-10  Jakub Jelinek  <jakub@redhat.com>
1134         * parser.c (cp_parser_omp_clause_reduction): Don't sorry_at on inscan
1135         reductions.
1136         (cp_parser_omp_scan_loop_body): New function.
1137         (cp_parser_omp_for_loop): Call cp_parser_omp_scan_loop_body if there
1138         are inscan reduction clauses.
1139         (cp_parser_pragma): Reject PRAGMA_OMP_SCAN.
1140         * semantics.c (finish_omp_clauses): Reject mixing inscan with
1141         non-inscan reductions on the same construct, or inscan reductions with
1142         ordered or schedule clauses, or inscan array reductions.
1143         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_{IN,EX}CLUSIVE.
1144         (tsubst_expr): Handle OMP_SCAN.
1146 2019-06-07  Jason Merrill  <jason@redhat.com>
1148         * constexpr.c (cxx_eval_constant_expression): Call
1149         STRIP_ANY_LOCATION_WRAPPER early.
1150         [CONVERT_EXPR]: Don't build anything for conversion to void.
1151         [ADDR_EXPR]: ggc_free unused ADDR_EXPR.
1153 2019-06-05  Martin Sebor  <msebor@redhat.com>
1155         PR c/90737
1156         * typeck.c (maybe_warn_about_returning_address_of_local): Only
1157         consider functions returning pointers as candidates for
1158         -Wreturn-local-addr.
1160 2019-06-05  Paolo Carlini  <paolo.carlini@oracle.com>
1162         * decl.c (smallest_type_location): New.
1163         (check_special_function_return_type): Use it.
1164         (grokdeclarator): Lkewise.
1166 2019-06-05  Paolo Carlini  <paolo.carlini@oracle.com>
1168         * decl.c (grokdeclarator): Use locations[ds_friend]
1169         in one place.
1171 2019-06-05  Martin Sebor  <msebor@redhat.com>
1173         * call.c (build_conditional_expr_1): Adjust quoting and hyphenation.
1174         (convert_like_real): Same.
1175         (convert_arg_to_ellipsis): Same.
1176         * constexpr.c (diag_array_subscript): Same.
1177         * constraint.cc (diagnose_trait_expression): Same.
1178         * cvt.c (ocp_convert): Same.
1179         * decl.c (start_decl): Same.
1180         (check_for_uninitialized_const_var): Same.
1181         (grokfndecl): Same.
1182         (check_special_function_return_type): Same.
1183         (finish_enum_value_list): Same.
1184         (start_preparsed_function): Same.
1185         * parser.c (cp_parser_decl_specifier_seq): Same.
1186         * typeck.c (cp_build_binary_op): Same.
1187         (build_static_cast_1): Same.
1189 2019-06-04  Nina Dinka Ranns  <dinka.ranns@gmail.com>
1191         PR c++/63149 - Wrong auto deduction from braced-init-list.
1192         * pt.c (listify_autos): use non cv qualified auto_node in
1193         std::initializer_list<auto>.
1195 2019-06-04  Paolo Carlini  <paolo.carlini@oracle.com>
1197         * decl.c (grokdeclarator): Use declarator->id_loc in two
1198         additional places.
1200 2019-06-04  Nathan Sidwell  <nathan@acm.org>
1202         * name-lookup.c (lookup_type_scope_1): Reimplement, handle local
1203         and namespace scopes separately.
1205 2019-06-04  Harald van Dijk  <harald@gigawatt.nl>
1207         PR c++/60531 - Wrong error about unresolved overloaded function
1208         * typeck.c (cp_build_binary_op): See if overload can be resolved.
1209         (cp_build_unary_op): Ditto.
1211 2019-06-04  Jason Merrill  <jason@redhat.com>
1213         Reduce accumulated garbage in constexpr evaluation.
1214         * constexpr.c (cxx_eval_call_expression): ggc_free any bindings we
1215         don't save.
1216         (cxx_eval_increment_expression): ggc_free the MODIFY_EXPR after
1217         evaluating it.
1219 2019-06-04  Jakub Jelinek  <jakub@redhat.com>
1221         * cp-tree.h (CP_OMP_CLAUSE_INFO): Allow for any clauses up to _condvar_
1222         instead of only up to linear.
1224 2019-06-03  Paolo Carlini  <paolo.carlini@oracle.com>
1226         * parser.c (cp_parser_unqualified_id): Use build_min_nt_loc in
1227         five places.
1229 2019-06-01  Ville Voutilainen  <ville.voutilainen@gmail.com>
1231         PR c++/85254
1232         * class.c (fixup_type_variants): Handle CLASSTYPE_FINAL.
1234 2019-05-31  Nathan Sidwell  <nathan@acm.org>
1236         * cp-tree.h (IDENTIFIER_LAMBDA_P): New.
1237         (TYPE_ANON_P): New.
1238         (LAMBDA_TYPE_P, TYPE_UNNAMED_P): Likewise.
1239         (LAMBDANAME_PREFIX, LAMBDANAME_FORMAT): Delete.
1240         (make_lambda_name): Don't declare.
1241         * error.c (dump_aggr_type): Check for lambdas before other
1242         anonymous names.
1243         * lambda.c (begin_lambda_type): Use make_anon_name.
1244         * cp-lang.c (cxx_dwarf_name): Lambda names smell anonymous.
1245         * mangle.c (write_local_name): Likewise.
1246         * name-lookup.c (lambda_cnt, make_lambda_name): Delete.
1248 2019-05-30  Marek Polacek  <polacek@redhat.com>
1250         * cp-tree.h (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Fix a typo.
1252 2019-05-31  Paolo Carlini  <paolo.carlini@oracle.com>
1254         * decl.c (grokdeclarator): Use declarator->id_loc in five
1255         error_at calls.
1257 2019-05-29  Jakub Jelinek  <jakub@redhat.com>
1259         PR c++/90598
1260         * tree.c (lvalue_kind): Return clk_none for expressions with
1261         with VOID_TYPE_P.
1263 2019-05-29  Paolo Carlini  <paolo.carlini@oracle.com>
1265         PR c++/89875
1266         * parser.c (cp_parser_sizeof_operand): When the type-id production
1267         did not work out commit to the tentative parse.
1269 2019-05-29  Jakub Jelinek  <jakub@redhat.com>
1271         P1091R3 - Extending structured bindings to be more like var decls
1272         P1381R1 - Reference capture of structured bindings
1273         * decl.c (cp_maybe_mangle_decomp): Handle TREE_STATIC decls even at
1274         function scope.
1275         (cp_finish_decomp): Copy over various decl properties from decl to
1276         v[i] in the tuple case.
1277         (grokdeclarator): Allow static, thread_local and __thread for C++2a
1278         and use pedwarn instead of error for older standard revisions.
1279         Make other structured binding diagnostic messages more i18n friendly.
1281 2019-05-28  Nathan Sidwell  <nathan@acm.org>
1283         * decl.c (duplicate_decls): Assert a template newdecl has no
1284         specializations.
1286 2019-05-28  Marek Polacek  <polacek@redhat.com>
1288         PR c++/90548 - ICE with generic lambda and empty pack.
1289         * pt.c (tsubst_copy_and_build): Handle pack expansion properly.
1291 2019-05-28  Nathan Sidwell  <nathan@acm.org>
1293         * cp-tree.h (make_anon_name): Drop declaration.
1294         (TYPE_UNNAMED_P): Use IDENTIFIER_ANON_P.
1295         * cp-lang.c (cxx_dwarf_name): Likewise.
1296         * class.c (find_flexarrays): Likewise.
1297         * decl.c (name_unnamed_type, xref_tag_1): Likewise.
1298         * error.c (dump_aggr_type): Likewise.
1299         * pt.c (push_template_decl_real): Likewise.
1300         * name-lookup.c (consider_binding_level): Likewise.
1301         (anon_cnt, make_anon_name): Delete.
1303 2019-05-25  Marek Polacek  <polacek@redhat.com>
1305         PR c++/90572 - wrong disambiguation in friend declaration.
1306         * parser.c (cp_parser_constructor_declarator_p): Don't allow missing
1307         typename for friend declarations.
1309 2019-05-23  Jonathan Wakely  <jwakely@redhat.com>
1311         * cp-tree.h (CP_AGGREGATE_TYPE_P): Fix whitespace.
1313         * init.c (std_placement_new_fn_p): Remove outdated TODO comment that
1314         was resolved by r254694.
1316 2019-05-22  Jason Merrill  <jason@redhat.com>
1318         PR c++/20408 - unnecessary code for empty struct.
1319         * call.c (build_call_a): Use simple_empty_class_p.
1321         PR c++/86485 - -Wmaybe-unused with empty class ?:
1322         * cp-gimplify.c (simple_empty_class_p): Also true for MODIFY_EXPR.
1324 2019-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
1326         * parser.c (cp_parser_template_declaration_after_parameters): Use
1327         DECL_SOURCE_LOCATION in literal operator template errors.
1329 2019-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
1331         PR c++/67184
1332         PR c++/69445
1333         * call.c (build_over_call): Devirtualize when the final overrider
1334         comes from the base.
1336 2019-05-21  Nathan Sidwell  <nathan@acm.org>
1338         * name-lookup.c (do_nonmember_using_decl): Drop INSERT_P
1339         parameter.  Document.
1340         (finish_nonmember_using_decl): Adjust do_nonmember_using_decl
1341         calls.  Remove stray FIXME comment.
1343         * name-lookup.h (struct cp_binding_level): Drop usings field.
1344         (finish_namespace_using_decl, finish_local_using_decl): Replace with ...
1345         (finish_nonmember_using_decl): ... this.
1346         * name-lookup.c (push_using_decl_1, push_using_decl):
1347         (do_nonmember_using_decl): ... here.  Add INSERT_P arg.  Reimplement.
1348         (validate_nonmember_using_decl, finish_namespace_using_decl)
1349         (finish_local_using_decl): Replace with ...
1350         (finish_nonmember_using_decl): ... this.  Drop DECL parm.
1351         * parser.c (cp_parser_using_declaration): Don't do lookup here.
1352         * pt.c (tsubst_expr): Do not do using decl lookup here.
1354 2019-05-21  Eric Botcazou  <ebotcazou@adacore.com>
1356         * decl2.c (cpp_check) <IS_ASSIGNMENT_OPERATOR>: New case.
1358 2019-05-20  Marek Polacek  <polacek@redhat.com>
1360         CWG 2094 - volatile scalars are trivially copyable.
1361         PR c++/85679
1362         * tree.c (trivially_copyable_p): Don't check CP_TYPE_VOLATILE_P for
1363         scalar types.
1365 2019-05-20  Marek Polacek  <polacek@redhat.com>
1367         * pt.c (convert_template_argument): Add a diagnostic for the
1368         [temp.arg]/2 ambiguity case.
1370         * name-lookup.c (finish_using_directive): Don't issue inform() if the
1371         warning didn't trigger.  Add quoting.  Tweak the inform message.
1373 2019-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
1375         * cp-tree.h: Remove remnants of CONV_NONCONVERTING.
1377 2019-05-20  Nathan Sidwell  <nathan@acm.org>
1379         * name-lookup.c (finish_namespace_using_directive)
1380         (finish_local_using_directive): Merge to ...
1381         (finish_using_directive): ... here.  Handle both contexts.
1382         * name-lookup.h (finish_namespace_using_directive)
1383         (finish_local_using_directive): Replace with ...
1384         (finish_using_directive): ... this.
1385         * parser.c (cp_parser_using_directive): Adjust.
1386         * pt.c (tsubst_expr): Likewise.
1388         * cp-tree.h (struct lang_decl_ns): Remove usings field.
1389         (DECL_NAMESPACE_USING): Delete.
1390         * name-lookup.c (name_lookup::search_usings): Use namespace's
1391         binding scope.
1392         (name_lookup::queue_namespae): Likewise.
1393         (finish_namespace_using_directive, push_namespace): Likewise.
1394         (has_using_namespace_std_directive): Just search the entire
1395         binding stack.
1397 2019-05-20  Jonathan Wakely  <jwakely@redhat.com>
1399         PR c++/90532 Ensure __is_constructible(T[]) is false
1400         * method.c (is_xible_helper): Return error_mark_node for construction
1401         of an array of unknown bound.
1403 2019-05-17  Thomas Schwinge  <thomas@codesourcery.com>
1405         PR c++/89433
1406         * parser.c (cp_finalize_oacc_routine): Rework checking if already
1407         marked with an OpenACC 'routine' directive.
1409         PR c++/89433
1410         * parser.c (cp_parser_oacc_routine)
1411         (cp_parser_late_parsing_oacc_routine): Normalize order of clauses.
1412         (cp_finalize_oacc_routine): Call oacc_verify_routine_clauses.
1414         PR c++/89433
1415         * parser.c (cp_finalize_oacc_routine): Refer to OpenACC 'routine'
1416         clauses from "omp declare target" attribute.
1418 2019-05-16  Martin Sebor  <msebor@redhat.com>
1420         * call.c (print_z_candidate): Wrap diagnostic text in a gettext
1421         macro.  Adjust.
1422         (print_z_candidates): Same.
1423         (build_conditional_expr_1): Quote keywords, operators, and types
1424         in diagnostics.
1425         (build_op_delete_call): Same.
1426         (maybe_print_user_conv_context): Wrap diagnostic text in a gettext
1427         macro.
1428         (convert_like_real): Same.
1429         (convert_arg_to_ellipsis): Quote keywords, operators, and types
1430         in diagnostics.
1431         (build_over_call): Same.
1432         (joust): Break up an overlong line.  Wrap diagnostic text in a gettext
1433         macro.
1434         * constexpr.c (cxx_eval_check_shift_p): Spell out >= in English.
1435         (cxx_eval_constant_expression): Quote keywords, operators, and types
1436         in diagnostics.
1437         (potential_constant_expression_1): Same.
1438         * cp-gimplify.c (cp_genericize_r): Same.
1439         * cvt.c (maybe_warn_nodiscard): Quote keywords, operators, and types
1440         in diagnostics.
1441         (type_promotes_to): Same.
1442         * decl.c (check_previous_goto_1): Same.
1443         (check_goto): Same.
1444         (start_decl): Same.
1445         (cp_finish_decl): Avoid parenthesizing a sentence for consistency.
1446         (grok_op_properties): Quote keywords, operators, and types
1447         in diagnostics.
1448         * decl2.c (grokfield): Same.
1449         (coerce_delete_type): Same.
1450         * except.c (is_admissible_throw_operand_or_catch_parameter): Same.
1451         * friend.c (do_friend): Quote C++ tokens.
1452         * init.c (build_new_1): Quote keywords, operators, and types
1453         in diagnostics.
1454         (build_vec_delete_1): Same.
1455         (build_delete): Same.
1456         * lex.c (parse_strconst_pragma): Same.
1457         (handle_pragma_implementation): Same.
1458         (unqualified_fn_lookup_error): Same.
1459         * mangle.c (write_type): Same.
1460         * method.c (defaulted_late_check): Avoid two consecutive punctuators.
1461         * name-lookup.c (cp_binding_level_debug): Remove a trailing newline.
1462         (pop_everything): Same.
1463         * parser.c (cp_lexer_start_debugging): Quote a macro name.
1464         in a diagnostic
1465         (cp_lexer_stop_debugging): Same.
1466         (cp_parser_userdef_numeric_literal): Quote a C++ header name
1467         in a diagnostic.
1468         (cp_parser_nested_name_specifier_opt): Quote keywords, operators,
1469         and types in diagnostics.
1470         (cp_parser_question_colon_clause): Same.
1471         (cp_parser_asm_definition): Same.
1472         (cp_parser_init_declarator): Same.
1473         (cp_parser_template_declaration_after_parameters): Avoid capitalizing
1474         a sentence in a diagnostic.
1475         (cp_parser_omp_declare_reduction): Quote keywords, operators, and types
1476         in diagnostics.
1477         (cp_parser_transaction): Same.
1478         * pt.c (maybe_process_partial_specialization): Replace second call
1479         to permerror with inform for consistency with other uses.
1480         (expand_integer_pack): Quote keywords, operators, and types
1481         in diagnostics.
1482         * rtti.c (get_typeid): Quote keywords, operators, and types
1483         in diagnostics.
1484         (build_dynamic_cast_1): Same.
1485         * semantics.c (finish_asm_stmt): Same.
1486         (finish_label_decl): Same.
1487         (finish_bases): Same.
1488         (finish_offsetof): Same.
1489         (cp_check_omp_declare_reduction): Same.
1490         (finish_decltype_type): Same.
1491         * tree.c (handle_init_priority_attribute): Same.  Add detail
1492         to diagnostics.
1493         (maybe_warn_zero_as_null_pointer_constant): Same.
1494         * typeck.c (cp_build_binary_op): Quote keywords, operators, and types
1495         in diagnostics.
1496         (cp_build_unary_op): Same.
1497         (check_for_casting_away_constness): Same.
1498         (build_static_cast): Same.
1499         (build_const_cast_1): Same.
1500         (maybe_warn_about_returning_address_of_local): Same.
1501         (check_return_expr): Same.
1502         * typeck2.c (abstract_virtuals_error_sfinae): Same.
1503         (digest_init_r): Replace a tab with spaces in a diagnostic.
1504         (build_functional_cast): Quote keywords, operators, and types
1505         in diagnostics.
1507 2019-05-15  Jakub Jelinek  <jakub@redhat.com>
1509         PR debug/90197
1510         * cp-gimplify.c (genericize_cp_loop): Emit a DEBUG_BEGIN_STMT
1511         before the condition (or if missing or constant non-zero at the end
1512         of the loop.  Emit a DEBUG_BEGIN_STMT before the increment expression
1513         if any.  Don't call protected_set_expr_location on incr if it already
1514         has a location.
1516 2019-05-15  Marek Polacek  <polacek@redhat.com>
1518         CWG 2096 - constraints on literal unions.
1519         * class.c (check_field_decls): Initialize booleans directly.  A union
1520         is literal if at least one of its non-static data members is of
1521         non-volatile literal type.
1523 2019-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
1525         * cp-tree.h (REFERENCE_VLA_OK): Remove.
1526         * lambda.c (build_capture_proxy): Remove use of the above.
1528 2019-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
1530         * call.c (perform_overload_resolution, build_new_method_call_1):
1531         Use OVL_P; remove redundant TEMPLATE_DECL checks.
1532         * decl.c (grokfndecl): Likewise.
1533         * mangle.c (write_expression): Likewise.
1534         * parser.c (cp_parser_template_id): Likewise.
1535         * pt.c (resolve_overloaded_unification, type_dependent_expression_p):
1536         Likewise.
1537         * search.c (build_baselink): Likewise.
1538         * tree.c (is_overloaded_fn, dependent_name, maybe_get_fns): Likewise.
1540 2019-05-14  Paolo Carlini  <paolo.carlini@oracle.com>
1542         PR preprocessor/90382
1543         * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
1544         min_location.
1546 2019-05-13  Jason Merrill  <jason@redhat.com>
1548         Use releasing_vec more broadly.
1549         * cp-tree.h (struct releasing_vec): Replace get_ref method with
1550         operator&.
1551         (vec_safe_push, vec_safe_reserve, vec_safe_length, vec_safe_splice):
1552         Forwarding functions for releasing_vec.
1553         (release_tree_vector): Declare but don't define.
1554         * call.c (build_op_delete_call, build_temp, call_copy_ctor)
1555         (perform_direct_initialization_if_possible): Use releasing_vec.
1556         * constexpr.c (cxx_eval_vec_init_1, cxx_eval_store_expression):
1557         Likewise.
1558         * cp-gimplify.c (cp_fold): Likewise.
1559         * cvt.c (force_rvalue, ocp_convert): Likewise.
1560         * decl.c (get_tuple_decomp_init): Likewise.
1561         * except.c (build_throw): Likewise.
1562         * init.c (perform_member_init, expand_default_init): Likewise.
1563         * method.c (do_build_copy_assign, locate_fn_flags): Likewise.
1564         * parser.c (cp_parser_userdef_char_literal)
1565         (cp_parser_userdef_numeric_literal)
1566         (cp_parser_userdef_string_literal)
1567         (cp_parser_perform_range_for_lookup)
1568         (cp_parser_range_for_member_function, cp_parser_omp_for_loop)
1569         (cp_parser_omp_for_loop_init): Likewise.
1570         * pt.c (tsubst_copy_and_build, do_class_deduction): Likewise.
1571         * semantics.c (calculate_direct_bases, calculate_bases)
1572         (finish_omp_barrier, finish_omp_flush, finish_omp_taskwait)
1573         (finish_omp_taskyield, finish_omp_cancel)
1574         (finish_omp_cancellation_point): Likewise.
1575         * tree.c (build_vec_init_elt, strip_typedefs, strip_typedefs_expr)
1576         (build_min_non_dep_op_overload): Likewise.
1577         * typeck.c (build_function_call_vec, cp_build_function_call_nary)
1578         (cp_build_modify_expr): Likewise.
1579         * typeck2.c (build_functional_cast): Likewise.
1581 2019-05-11  Paolo Carlini  <paolo.carlini@oracle.com>
1583         * typeck.c (cp_build_function_call_vec): When mark_used fails
1584         unconditionally return error_mark_node.
1586 2019-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
1588         * decl.c (grokvardecl): Use an accurate location in error message
1589         about main as a global variable.
1591 2019-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
1593         * call.c (build_call_a): Use FUNC_OR_METHOD_TYPE_P.
1594         * cp-gimplify.c (cp_fold): Likewise.
1595         * cp-objcp-common.c (cp_type_dwarf_attribute): Likewise.
1596         * cp-tree.h (TYPE_OBJ_P, TYPE_PTROBV_P): Likewise.
1597         * cvt.c (perform_qualification_conversions): Likewise.
1598         * decl.c (grokdeclarator): Likewise.
1599         * decl2.c (build_memfn_type): Likewise.
1600         * mangle.c (canonicalize_for_substitution, write_type): Likewise.
1601         * parser.c (cp_parser_omp_declare_reduction): Likewise.
1602         * pt.c (check_explicit_specialization, uses_deducible_template_parms,
1603         check_cv_quals_for_unify, dependent_type_p_r): Likewise.
1604         * rtti.c (ptr_initializer): Likewise.
1605         * semantics.c (finish_asm_stmt, finish_offsetof,
1606         cp_check_omp_declare_reduction): Likewise.
1607         * tree.c (cp_build_qualified_type_real,
1608         cp_build_type_attribute_variant, cxx_type_hash_eq,
1609         cxx_copy_lang_qualifiers, cp_free_lang_data): Likewise.
1610         * typeck.c (structural_comptypes, convert_arguments,
1611         cp_build_addr_expr_1, unary_complex_lvalue, cp_build_c_cast,
1612         cp_build_modify_expr, comp_ptr_ttypes_real, type_memfn_rqual):
1613         Likewise.
1615 2019-05-10  Marek Polacek  <polacek@redhat.com>
1617         PR c++/78010 - bogus -Wsuggest-override warning on final function.
1618         * class.c (check_for_override): Don't warn for final functions.
1620 2019-05-10  Jakub Jelinek  <jakub@redhat.com>
1622         PR pch/90326
1623         * config-lang.in (gtfiles): Remove c-family/c-lex.c, add
1624         c-family/c-cppbuiltin.c.
1626 2019-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
1628         PR c++/90382
1629         Revert:
1630         2018-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
1632         * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
1633         min_location.
1635 2019-05-08  Nathan Sidwell  <nathan@acm.org>
1637         Kill DECL_SAVED_FUNCTION_DATA .
1638         * cp-tree.h (language_function): Remove x_auto_return_pattern.
1639         (current_function_auto_return_pattern): Delete.
1640         (lang_decl_fn): Replace saved_language_function with
1641         saved_auto_return type.
1642         (DECL_SAVED_FUNCTION_DATA): Delete.
1643         (DECL_SAVED_AUTO_RETURN_TYPE): New.
1644         (FNDECL_USED_AUTO): Correct documentation.
1645         * decl.c (duplicate_decls): Adjust AUTO return handling.
1646         (start_preparsed_function): Replace
1647         current_function_auto_return_pattern with
1648         DECL_SAVED_AUTO_RETURN_TYPE.  Remove DECL_SAVED_FUNCTION_DATA
1649         zapping.
1650         (finish_function): Likewise.
1651         (save_function_data): Delete.
1652         (fndecl_declared_return_type): Reimplement.
1653         * mangle.c (write_unqualified_name): Use DECL_SAVED_AUTO_RETURN_TYPE.
1654         * method.c (make_thunk, make_alias_for): Likewise.
1655         * parser.c (cp_parser_jump_statement): Likewise.
1656         * pt.c (do_auto_deduction): Likewise.
1657         * typeck.c (check_return_expr): Likewise.
1659 2019-05-06  Jason Merrill  <jason@redhat.com>
1661         PR c++/90171 - reorganize usual_deallocation_fn_p
1662         * call.c (struct dealloc_info): New.
1663         (usual_deallocation_fn_p): Take a dealloc_info*.
1664         (aligned_deallocation_fn_p, sized_deallocation_fn_p): Remove.
1665         (build_op_delete_call): Adjust.
1667 2019-05-07  Jason Merrill  <jason@redhat.com>
1669         PR c++/86485 - -Wmaybe-unused with empty class ?:
1670         * typeck.c (build_static_cast_1): Use cp_build_addr_expr.
1672         * pt.c (type_dependent_expression_p): A non-type template parm with
1673         a placeholder type is type-dependent.
1675 2019-05-06  Marek Polacek  <polacek@redhat.com>
1677         PR c++/90265 - ICE with generic lambda.
1678         * pt.c (tsubst_copy_and_build): Use a dedicated variable for the last
1679         element in the vector.
1681 2019-05-03  Martin Liska  <mliska@suse.cz>
1683         * call.c (build_aggr_conv): Use is_empty instead of
1684         elements () == 0 (and similar usages).
1685         * parser.c (cp_parser_lambda_introducer): Likewise.
1687 2019-05-02  Nathan Sidwell  <nathan@acm.org>
1689         * semantics.c (finish_id_expression_1): Remove unreachable code.
1691 2019-05-01  Nathan Sidwell  <nathan@acm.org>
1693         * name-lookup.h (get_class_binding_direct): Change final arg to
1694         bool.
1695         (get_class_binding): Likewise.
1696         * name-lookup.c (get_class_binding_direct): Replace TYPE_OR_FNS
1697         arg with WANT_TYPE bool.  Simplify.
1698         (get_class_binding): Adjust final arg.
1699         * decl.c (reshape_init_class): Adjust get_class_binding calls.
1701 2019-04-30  Nathan Sidwell  <nathan@acm.org>
1703         * cp-objcp-common.c (cp_common_init_ts): Use MARK_TS_EXP for _EXPR
1704         nodes.  Call c_common_init_ts.
1706 2019-04-29  Nathan Sidwell  <nathan@acm.org>
1708         * decl.c (duplicate_decls): Add whitespace, move comments into
1709         conditional blocks.
1710         * method.c (explain_implicit_non_constexpr): Refactor.
1711         * pt.c (check_explicit_specialization): Fix indentation.
1712         * semantics.c (process_outer_var_ref): Reformat.
1713         (finish_id_expression_1): Use STRIP_TEMPLATE.
1715 2019-04-26  Jonathan Wakely  <jwakely@redhat.com>
1717         PR c++/90243 - orphaned note in uninstantiated constexpr function
1718         * decl.c (check_for_uninitialized_const_var): Suppress notes if no
1719         error was shown.
1721 2019-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
1723         PR c++/90173
1724         * decl.c (grokdeclarator): Set type to error_mark_node
1725         upon error about template placeholder type non followed
1726         by a simple declarator-id.
1728 2019-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
1730         * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
1731         min_location.
1733 2019-04-24  Jason Merrill  <jason@redhat.com>
1735         PR c++/90227 - error with template parameter packs.
1736         * pt.c (coerce_template_parms): Do add empty pack when
1737         require_all_args.
1739 2019-04-24  Richard Biener  <rguenther@suse.de>
1741         * call.c (null_ptr_cst_p): Order checks according to expensiveness.
1742         (conversion_null_warnings): Likewise.
1743         * typeck.c (same_type_ignoring_top_level_qualifiers_p): Return
1744         early if type1 == type2.
1746 2019-04-22  Jason Merrill  <jason@redhat.com>
1748         PR c++/87366 - wrong error with alias template.
1749         * typeck.c (structural_comptypes): When comparing_specializations,
1750         aliases are unequal.
1751         (comptypes): When comparing_specializations, do structural
1752         comparison.
1754 2019-04-19  Jason Merrill  <jason@redhat.com>
1756         PR c++/90190 - CTAD with list-constructor.
1757         * pt.c (do_class_deduction): Don't try the single element deduction
1758         if the single element is also a braced list.
1760         PR c++/90171 - ICE with destroying delete with size_t parm.
1761         * call.c (sized_deallocation_fn_p): New.  Use it instead of
1762         second_parm_is_size_t in most cases.
1763         (second_parm_is_size_t): Don't check for aligned.
1765 2019-04-19  Paolo Carlini  <paolo.carlini@oracle.com>
1767         PR c++/89900
1768         * pt.c (fn_type_unification): When handling null explicit
1769         arguments do not special case non-parameter packs.
1771 2019-04-19  Jakub Jelinek  <jakub@redhat.com>
1773         PR c++/90138
1774         * pt.c (process_template_parm): Set decl to pushdecl result.  If
1775         !is_non_type, also set parm to that.
1777         PR c/89888
1778         * decl.c (struct cp_switch): Remove outside_range_p member.
1779         (push_switch): Don't clear it.
1780         (pop_switch): Adjust c_do_switch_warnings caller.
1781         (finish_case_label): Adjust c_add_case_label caller.
1783         PR c++/90108
1784         * decl.c (duplicate_decls): If remove is main variant and
1785         DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
1786         variant that has newdecl as TYPE_NAME if any.
1788 2019-04-18  Jason Merrill  <jason@redhat.com>
1790         PR c++/87554 - ICE with extern template and reference member.
1791         * decl.c (cp_finish_decl): Don't set DECL_INITIAL of external vars.
1793 2019-04-17  Jason Merrill  <jason@redhat.com>
1795         PR c++/90047 - ICE with enable_if alias template.
1796         * pt.c (tsubst_decl) [TYPE_DECL]: Don't put an erroneous decl in the
1797         hash table when we're in SFINAE context.
1799 2019-04-17  Marek Polacek  <polacek@redhat.com>
1801         PR c++/90124 - bogus error with incomplete type in decltype.
1802         * typeck.c (build_class_member_access_expr): Check
1803         cp_unevaluated_operand.
1805 2019-04-12  Jakub Jelinek  <jakub@redhat.com>
1807         PR c/89933
1808         * decl.c (duplicate_decls): When newdecl's type is its main variant,
1809         don't try to remove it from the variant list, but instead assert
1810         it has no variants.
1812 2019-04-12  Martin Sebor  <msebor@redhat.com>
1814         PR c/88383
1815         PR c/89288
1816         * parser.c (cp_parser_has_attribute_expression): Handle assignment
1817         expressions.
1819 2019-04-12  Jason Merrill  <jason@redhat.com>
1821         * call.c (null_member_pointer_value_p): Handle an empty CONSTRUCTOR
1822         of PMF type.
1824 2019-04-12  Marek Polacek  <polacek@redhat.com>
1826         * except.c (build_noexcept_spec): Use build_converted_constant_bool_expr
1827         instead of perform_implicit_conversion_flags.
1829         PR c++/87603 - constexpr functions are no longer noexcept.
1830         * constexpr.c (is_sub_constant_expr): Remove unused function.
1831         * cp-tree.h (is_sub_constant_expr): Remove declaration.
1832         * except.c (check_noexcept_r): Don't consider a call to a constexpr
1833         function noexcept.
1835 2019-04-11  Jakub Jelinek  <jakub@redhat.com>
1837         PR translation/90035
1838         * parser.h (struct cp_parser): Add
1839         type_definition_forbidden_message_arg member.
1840         * parser.c (cp_debug_parser): Print it.
1841         (cp_parser_check_type_definition): Pass
1842         parser->type_definition_forbidden_message_arg as second argument to
1843         error.
1844         (cp_parser_has_attribute_expression, cp_parser_sizeof_operand): Set
1845         parser->type_definition_forbidden_message_arg and use G_() with
1846         %qs for parser->type_definition_forbidden_message instead of
1847         building untranslatable message using concat.
1849 2019-04-09  Jakub Jelinek  <jakub@redhat.com>
1851         PR translation/90011
1852         * typeck2.c (check_narrowing): Remove trailing space from diagnostics.
1854 2019-04-08  Marek Polacek  <polacek@redhat.com>
1856         * typeck2.c (digest_init_r): Don't condition the object slicing warning
1857         on flag_checking.
1859 2019-04-08  Paolo Carlini  <paolo.carlini@oracle.com>
1861         PR c++/89914
1862         * semantics.c (trait_expr_value): Don't use TYPE_NOTHROW_P
1863         when maybe_instantiate_noexcept fails.
1864         (classtype_has_nothrow_assign_or_copy_p): Likewise.
1865         * method.c (implicitly_declare_fn): Avoid passing error_mark_node
1866         to build_exception_variant.
1868 2019-04-05  Marek Polacek  <polacek@redhat.com>
1870         PR c++/87145 - bogus error converting class type in template arg list.
1871         * pt.c (convert_nontype_argument): Don't call
1872         build_converted_constant_expr if it could involve calling a conversion
1873         function with a instantiation-dependent constructor as its argument.
1875 2019-04-05  Martin Sebor  <msebor@redhat.com>
1877         PR bootstrap/89980
1878         * decl.c (reshape_init_array_1): Avoid treating empty strings
1879         as zeros in array initializers.
1880         Use trivial_type_p () instead of TYPE_HAS_TRIVIAL_DFLT().
1882 2019-04-04  Jason Merrill  <jason@redhat.com>
1884         PR c++/89948 - ICE with break in statement-expr.
1885         * constexpr.c (cxx_eval_statement_list): Jumping out of a
1886         statement-expr is non-constant.
1888 2019-04-04  Jason Merrill  <jason@redhat.com>
1890         PR c++/89966 - error with non-type auto tparm.
1891         * pt.c (do_auto_deduction): Clear tf_partial.
1893 2019-04-04  Jason Merrill  <jason@redhat.com>
1895         PR c++/86986 - ICE with TTP with parameter pack.
1896         * pt.c (coerce_template_parameter_pack): Only look at the type of a
1897         non-type parameter pack.
1898         (fixed_parameter_pack_p_1): Don't recurse into the type of a
1899         non-type parameter pack.
1900         (coerce_template_template_parms): Call add_outermost_template_args.
1902 2019-04-04  Martin Sebor  <msebor@redhat.com>
1904         PR c++/89974
1905         PR c++/89878
1906         PR c++/89833
1907         PR c++/47488
1908         * decl.c (reshape_init_array_1): Strip trailing zero-initializers
1909         from arrays of trivial type and known size.
1910         * mangle.c (write_expression): Convert braced initializer lists
1911         to STRING_CSTs.
1912         (write_expression): Trim trailing zero-initializers from arrays
1913         of trivial type.
1914         (write_template_arg_literal): Mangle strings the same as braced
1915         initializer lists.
1917 2019-04-03  Jason Merrill  <jason@redhat.com>
1919         PR c++/81866 - ICE with member template and default targ.
1920         * pt.c (tsubst_template_decl): Handle getting a type from
1921         retrieve_specialization.
1923         PR c++/86586 - -fcompare-debug=-Wsign-compare.
1924         * typeck.c (cp_build_binary_op): Don't fold for -Wsign-compare.
1926         PR c++/89331 - ICE with offsetof in incomplete class.
1927         * semantics.c (finish_offsetof): Handle error_mark_node.
1928         * typeck.c (build_class_member_access_expr): Call
1929         complete_type_or_maybe_complain before converting to base.
1931         PR c++/89917 - ICE with lambda in variadic mem-init.
1932         * pt.c (make_pack_expansion): Change type_pack_expansion_p to false.
1934 2019-04-01  Jason Merrill  <jason@redhat.com>
1936         PR c++/86946 - ICE with function call in template argument.
1937         DR 1321
1938         * pt.c (iterative_hash_template_arg) [CALL_EXPR]: Use
1939         dependent_name.
1941 2019-04-01  Paolo Carlini  <paolo.carlini@oracle.com>
1943         PR c++/62207
1944         * pt.c (tsubst_copy): Deal with lookup_name not returing a variable.
1946 2019-03-31  Marek Polacek  <polacek@redhat.com>
1948         PR c++/89852 - ICE with C++11 functional cast with { }.
1949         * constexpr.c (fold_non_dependent_expr_template): New static function
1950         broken out of...
1951         (fold_non_dependent_expr): ...here.
1952         (fold_non_dependent_init): New function.
1953         * cp-tree.h (fold_non_dependent_init): Declare.
1954         * typeck2.c (massage_init_elt): Call fold_non_dependent_init instead
1955         of fold_non_dependent_expr.  Don't call maybe_constant_init.
1957 2019-03-30  Jason Merrill  <jason@redhat.com>
1959         PR c++/89744 - ICE with specialization of member class template.
1960         * pt.c (lookup_template_class_1): If the partial instantiation is
1961         explicitly specialized, adjust.
1962         (maybe_process_partial_specialization): Also adjust
1963         CLASSTYPE_TI_ARGS.
1965 2019-03-29  Jakub Jelinek  <jakub@redhat.com>
1967         PR sanitizer/89869
1968         * typeck.c: Include gimplify.h.
1969         (cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it
1970         for second time.  Formatting fixes.
1972 2019-03-29  Marek Polacek  <polacek@redhat.com>
1974         PR c++/89876 - ICE with deprecated conversion.
1975         * call.c (convert_like_real): Only give warnings with tf_warning.
1977 2019-03-28  Marek Polacek  <polacek@redhat.com>
1979         PR c++/89612 - ICE with member friend template with noexcept.
1980         * pt.c (maybe_instantiate_noexcept): For function templates, use their
1981         template result (function decl).  Don't set up local specializations.
1982         Temporarily turn on processing_template_decl.  Update the template type
1983         too.
1985         PR c++/89836 - bool constant expression and explicit conversions.
1986         * call.c (build_converted_constant_expr_internal): New function,
1987         renamed from...
1988         (build_converted_constant_expr): ...this.  New.
1989         (build_converted_constant_bool_expr): New.
1990         * cp-tree.h (build_converted_constant_bool_expr): Declare.
1991         * decl.c (build_explicit_specifier): Call
1992         build_converted_constant_bool_expr.
1994 2019-03-28  Jakub Jelinek  <jakub@redhat.com>
1996         PR c++/89785
1997         * constexpr.c (struct check_for_return_continue_data): New type.
1998         (check_for_return_continue): New function.
1999         (potential_constant_expression_1) <case SWITCH_STMT>: Walk
2000         SWITCH_STMT_BODY to find RETURN_EXPRs or CONTINUE_STMTs not nested
2001         in loop bodies and set *jump_target to that if found.
2003 2019-03-27  Jason Merrill  <jason@redhat.com>
2005         PR c++/89831 - error with qualified-id in const member function.
2006         * semantics.c (finish_non_static_data_member): Use object cv-quals
2007         in scoped case, too.
2009         PR c++/89421 - ICE with lambda in template parameter list.
2010         * parser.c (cp_parser_lambda_expression): Also reject a lambda in a
2011         template parameter list before C++20.
2012         * pt.c (type_dependent_expression_p): True for LAMBDA_EXPR.
2013         * semantics.c (begin_class_definition): Restore error about defining
2014         non-lambda class in template parm list.
2016 2019-03-26  Jason Merrill  <jason@redhat.com>
2018         PR c++/86932 - missed SFINAE with empty pack.
2019         * pt.c (coerce_template_parms): Don't add an empty pack if
2020         tf_partial.
2021         (fn_type_unification): Pass tf_partial to coerce_template_parms.
2023         PR c++/86429 - constexpr variable in lambda.
2024         PR c++/82643
2025         PR c++/87327
2026         * constexpr.c (cxx_eval_constant_expression): In a lambda function,
2027         try evaluating the captured variable directly.
2029 2019-03-26  Jakub Jelinek  <jakub@redhat.com>
2031         PR c++/89796
2032         * semantics.c (finish_omp_atomic): Add warning_sentinel for
2033         -Wunused-value around finish_expr_stmt call.
2035 2019-03-25  Paolo Carlini  <paolo.carlini@oracle.com>
2037         PR c++/84661
2038         PR c++/85013
2039         * parser.c (cp_parser_binary_expression): Don't call cp_fully_fold
2040         to undo the disabling of warnings.
2042 2019-03-25  Jason Merrill  <jason@redhat.com>
2044         PR c++/87748 - substitution failure error with decltype.
2045         * pt.c (most_specialized_partial_spec): Clear
2046         processing_template_decl.
2048 2019-03-25  Marek Polacek  <polacek@redhat.com>
2050         PR c++/89214 - ICE when initializing aggregates with bases.
2051         * typeck2.c (digest_init_r): Warn about object slicing instead of
2052         crashing.
2054         PR c++/89705 - ICE with reference binding with conversion function.
2055         * call.c (reference_binding): If the result of the conversion function
2056         is a prvalue of non-class type, use the cv-unqualified type.
2058 2019-03-25  Nathan Sidwell  <nathan@acm.org>
2060         * lambda.c (maybe_add_lambda_conv_op): Don't add to comdat group.
2062 2019-03-22  Jakub Jelinek  <jakub@redhat.com>
2064         PR c++/60702
2065         * cp-tree.h (get_tls_wrapper_fn): Remove declaration.
2066         (maybe_get_tls_wrapper_call): Declare.
2067         * decl2.c (get_tls_wrapper_fn): Make static.
2068         (maybe_get_tls_wrapper_call): New function.
2069         * typeck.c (build_class_member_access_expr): Handle accesses to TLS
2070         variables.
2071         * semantics.c (finish_qualified_id_expr): Likewise.
2072         (finish_id_expression_1): Use maybe_get_tls_wrapper_call.
2073         * pt.c (tsubst_copy_and_build): Likewise.
2075         PR c++/87481
2076         * constexpr.c (struct constexpr_ctx): Add constexpr_ops_count member.
2077         (cxx_eval_constant_expression): When not skipping, not constant class
2078         or location wrapper, increment *ctx->constexpr_ops_count and if it is
2079         above constexpr_loop_nest_limit, diagnose failure.
2080         (cxx_eval_outermost_constant_expr): Add constexpr_ops_count and
2081         initialize ctx.constexpr_ops_count to its address.
2082         (is_sub_constant_expr): Likewise.
2084 2019-03-21  Jakub Jelinek  <jakub@redhat.com>
2086         PR c++/71446
2087         * call.c (filed_in_pset): Change pset from hash_set<tree> * to
2088         hash_set<tree, true> &, adjust uses accordingly.
2089         (build_aggr_conv): Change pset from hash_set<tree> *
2090         to hash_set<tree, true>.  Replace goto fail; with return NULL;,
2091         adjust pset uses.
2093         PR c++/89767
2094         * parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id
2095         variables, check for duplicates in this function.
2096         * lambda.c (add_capture): Don't check for duplicates nor use
2097         IDENTIFIER_MARKED.
2098         (register_capture_members): Don't clear IDENTIFIER_MARKED here.
2100 2019-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
2102         PR c++/89571
2103         * method.c (after_nsdmi_defaulted_late_checks): Avoid passing
2104         error_mark_node to comp_except_specs.
2106 2019-03-20  Jason Merrill  <jason@redhat.com>
2108         PR c++/87480 - decltype of member access in default template arg
2109         * pt.c (type_unification_real): Accept a dependent result in
2110         template context.
2112 2019-03-19  Martin Sebor  <msebor@redhat.com>
2114         PR tree-optimization/89688
2115         * typeck2.c (store_init_value): Call braced_lists_to_string for more
2116         kinds of initializers.
2118 2019-03-18  Jason Merrill  <jason@redhat.com>
2120         PR c++/89630 - ICE with dependent using-decl as template arg.
2121         * tree.c (cp_tree_equal): Always return false for USING_DECL.
2123         PR c++/89761 - ICE with sizeof... in pack expansion.
2124         * pt.c (argument_pack_element_is_expansion_p): Handle
2125         ARGUMENT_PACK_SELECT.
2127         PR c++/89640 - GNU attributes on lambda.
2128         * parser.c (cp_parser_lambda_declarator_opt): Allow GNU attributes.
2130         PR c++/89682 - wrong access error in default argument.
2131         * pt.c (tsubst_default_argument): Don't defer access checks.
2133 2019-03-18  Paolo Carlini  <paolo.carlini@oracle.com>
2135         PR c++/85014
2136         * semantics.c (finish_non_static_data_member): Check return value
2137         of context_for_name_lookup and immediately return error_mark_node
2138         if isn't a type.
2140 2019-03-17  Jason Merrill  <jason@redhat.com>
2142         PR c++/89571 - ICE with ill-formed noexcept on constructor.
2143         * pt.c (maybe_instantiate_noexcept): Only return false if defaulted.
2144         (regenerate_decl_from_template): Use it for noexcept-specs.
2146 2019-03-14  Jason Merrill  <jason@redhat.com>
2148         * parser.c (cp_parser_decl_specifier_seq): Support C++20
2149         concept-definition syntax without 'bool'.
2151 2019-03-14  Jakub Jelinek  <jakub@redhat.com>
2153         PR c++/89512
2154         * semantics.c (finish_qualified_id_expr): Reject variable templates.
2156         PR c++/89652
2157         * constexpr.c (struct constexpr_ctx): Change save_exprs type from
2158         hash_set<tree> to vec<tree>.
2159         (cxx_eval_call_expression): Adjust for save_exprs being a vec instead
2160         of hash_set.
2161         (cxx_eval_loop_expr): Likewise.  Truncate the vector after each
2162         removal of SAVE_EXPRs from values.
2163         (cxx_eval_constant_expression) <case SAVE_EXPR>: Call safe_push
2164         method on save_exprs instead of add.
2166 2019-03-13  Jason Merrill  <jason@redhat.com>
2168         PR c++/86521 - C++17 copy elision in initialization by constructor.
2169         * call.c (joust_maybe_elide_copy): New.
2170         (joust): Call it.
2172 2019-03-13  Marek Polacek  <polacek@redhat.com>
2174         PR c++/88979 - further P0634 fix for constructors.
2175         * parser.c (cp_parser_decl_specifier_seq): Pass flags to
2176         cp_parser_constructor_declarator_p.
2177         (cp_parser_direct_declarator): Allow missing typename for constructor
2178         parameters.
2179         (cp_parser_constructor_declarator_p): Add FLAGS parameter.  Pass it to
2180         cp_parser_type_specifier.
2182         PR c++/89686 - mixing init-capture and simple-capture in lambda.
2183         * parser.c (cp_parser_lambda_introducer): Give error when combining
2184         init-capture and simple-capture.
2186         PR c++/89660 - bogus error with -Wredundant-move.
2187         * typeck.c (maybe_warn_pessimizing_move): Only accept (T &) &arg
2188         as the std::move's argument.  Don't call convert_for_initialization
2189         when warn_redundant_move isn't on.
2191 2019-03-11  Jason Merrill  <jason@redhat.com>
2193         PR c++/86521 - wrong overload resolution with ref-qualifiers.
2194         * call.c (build_user_type_conversion_1): Don't use a conversion to a
2195         reference of the wrong rvalueness for direct binding.
2197 2019-03-11  Martin Liska  <mliska@suse.cz>
2199         * cvt.c (build_expr_type_conversion): Wrap apostrophes
2200         in gcc internal format with %'.
2201         * decl.c (check_no_redeclaration_friend_default_args): Likewise.
2202         (grokfndecl): Likewise.
2203         * name-lookup.c (do_pushtag): Likewise.
2204         * pt.c (unify_parameter_deduction_failure): Likewise.
2205         (unify_template_deduction_failure): Likewise.
2207 2019-03-11  Martin Liska  <mliska@suse.cz>
2209         * call.c (convert_arg_to_ellipsis): Wrap an option name
2210         in a string format message and fix GNU coding style.
2211         (build_over_call): Likewise.
2212         * class.c (check_field_decl): Likewise.
2213         (layout_nonempty_base_or_field): Likewise.
2214         * constexpr.c (cxx_eval_loop_expr): Likewise.
2215         * cvt.c (type_promotes_to): Likewise.
2216         * decl.c (cxx_init_decl_processing): Likewise.
2217         (mark_inline_variable): Likewise.
2218         (grokdeclarator): Likewise.
2219         * decl2.c (record_mangling): Likewise.
2220         * error.c (maybe_warn_cpp0x): Likewise.
2221         * except.c (doing_eh): Likewise.
2222         * mangle.c (maybe_check_abi_tags): Likewise.
2223         * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
2224         (cp_parser_userdef_numeric_literal): Likewise.
2225         (cp_parser_primary_expression): Likewise.
2226         (cp_parser_unqualified_id): Likewise.
2227         (cp_parser_pseudo_destructor_name): Likewise.
2228         (cp_parser_builtin_offsetof): Likewise.
2229         (cp_parser_lambda_expression): Likewise.
2230         (cp_parser_lambda_introducer): Likewise.
2231         (cp_parser_lambda_declarator_opt): Likewise.
2232         (cp_parser_selection_statement): Likewise.
2233         (cp_parser_init_statement): Likewise.
2234         (cp_parser_decomposition_declaration): Likewise.
2235         (cp_parser_function_specifier_opt): Likewise.
2236         (cp_parser_static_assert): Likewise.
2237         (cp_parser_simple_type_specifier): Likewise.
2238         (cp_parser_namespace_definition): Likewise.
2239         (cp_parser_using_declaration): Likewise.
2240         (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
2241         (cp_parser_initializer_list): Likewise.
2242         (cp_parser_type_parameter_key): Likewise.
2243         (cp_parser_member_declaration): Likewise.
2244         (cp_parser_try_block): Likewise.
2245         (cp_parser_std_attribute_spec): Likewise.
2246         (cp_parser_requires_clause_opt): Likewise.
2247         * pt.c (check_template_variable): Likewise.
2248         (check_default_tmpl_args): Likewise.
2249         (push_tinst_level_loc): Likewise.
2250         (instantiate_pending_templates): Likewise.
2251         (invalid_nontype_parm_type_p): Likewise.
2252         * repo.c (get_base_filename): Likewise.
2253         * rtti.c (typeid_ok_p): Likewise.
2254         (build_dynamic_cast_1): Likewise.
2255         * tree.c (maybe_warn_parm_abi): Likewise.
2257 2019-03-08  Jakub Jelinek  <jakub@redhat.com>
2259         PR other/80058
2260         * parser.c (cp_parser_template_declaration_after_parameters): Avoid
2261         one space before " at the end of line and another after " on another
2262         line in a string literal.
2264         PR tree-optimization/89550
2265         * semantics.c (maybe_convert_cond): Only set TREE_NO_WARNING if
2266         warning_at returned true.
2267         * decl2.c (c_parse_final_cleanups): Likewise.
2268         * typeck.c (convert_for_assignment): Likewise.
2269         * decl.c (finish_function): Likewise.
2271         PR c++/89585
2272         * parser.c (cp_parser_asm_definition): Just warn instead of error
2273         on volatile qualifier outside of function body.
2275         PR c++/89599
2276         * constexpr.c (potential_constant_expression_1): Reject
2277         REINTERPRET_CAST_P NOP_EXPRs.
2279         PR c++/89622
2280         * call.c (joust): Call print_z_candidate only if pedwarn returned
2281         true.
2283 2019-03-07  Jason Merrill  <jason@redhat.com>
2285         PR c++/88123 - lambda and using-directive.
2286         * name-lookup.c (op_unqualified_lookup)
2287         (maybe_save_operator_binding, discard_operator_bindings)
2288         (push_operator_bindings): New.
2289         * typeck.c (build_x_binary_op, build_x_unary_op): Call
2290         maybe_save_operator_binding.
2291         * decl.c (start_preparsed_function): Call push_operator_bindings.
2292         * tree.c (cp_free_lang_data): Call discard_operator_bindings.
2294         PR c++/88820 - ICE with CTAD and member template used in DMI.
2295         * pt.c (do_class_deduction): Handle parm used as its own arg.
2297 2019-03-07  Jakub Jelinek  <jakub@redhat.com>
2299         PR c++/89585
2300         * parser.c (cp_parser_asm_definition): Parse asm qualifiers even
2301         at toplevel, but diagnose them.
2303 2019-03-06  Jason Merrill  <jason@redhat.com>
2305         PR c++/89381 - implicit copy and using-declaration.
2306         * class.c (classtype_has_move_assign_or_move_ctor_p): Don't consider
2307         op= brought in by a using-declaration.
2309 2019-03-06  Jakub Jelinek  <jakub@redhat.com>
2311         PR c++/87148
2312         * init.c (build_value_init_noctor): Ignore flexible array members.
2314 2019-03-06  Jason Merrill  <jason@redhat.com>
2316         PR c++/89576 - if constexpr of lambda capture.
2317         * semantics.c (maybe_convert_cond): Do convert a non-dependent
2318         condition in a template.
2319         * typeck.c (condition_conversion): Handle being called in a
2320         template.
2322 2019-03-06  Marek Polacek  <polacek@redhat.com>
2324         PR c++/87378 - bogus -Wredundant-move warning.
2325         * typeck.c (maybe_warn_pessimizing_move): See if the maybe-rvalue
2326         overload resolution would actually succeed.
2328 2019-03-05  Jason Merrill  <jason@redhat.com>
2330         * class.c (is_really_empty_class): Add ignore_vptr parm.
2331         (trivial_default_constructor_is_constexpr): Pass it.
2332         * call.c (build_over_call): Pass it.
2333         * constexpr.c (cxx_eval_constant_expression): Pass it instead of
2334         checking TYPE_POLYMORPHIC_P.
2335         (cxx_eval_component_reference, potential_constant_expression_1):
2336         Pass it.
2337         * cp-gimplify.c (simple_empty_class_p): Pass it.
2338         * init.c (expand_aggr_init_1): Pass it.
2340 2019-03-04  Paolo Carlini  <paolo.carlini@oracle.com>
2342         PR c++/84605
2343         * parser.c (cp_parser_class_head): Reject TYPE_BEING_DEFINED too.
2345 2019-03-04  Jakub Jelinek  <jakub@redhat.com>
2347         PR c++/71446
2348         * call.c (field_in_pset): New function.
2349         (build_aggr_conv): Handle CONSTRUCTOR_IS_DESIGNATED_INIT correctly.
2351 2019-03-02  Jakub Jelinek  <jakub@redhat.com>
2353         PR c++/71446
2354         * cp-tree.h (CONSTRUCTOR_IS_DESIGNATED_INIT): Define.
2355         * parser.c (cp_parser_braced_list): Adjust cp_parser_initializer_list
2356         caller, set CONSTRUCTOR_IS_DESIGNATED_INIT.
2357         (cp_parser_initializer_list): Add designated parameter, set *designated
2358         to a bool whether any designators were parsed.
2359         * decl.c (reshape_init): Copy over CONSTRUCTOR_IS_DESIGNATED_INIT if
2360         needed.
2361         * pt.c (tsubst_copy_and_build): Likewise.
2362         * call.c (implicit_conversion): If CONSTRUCTOR_IS_DESIGNATED_INIT,
2363         don't call build_list_conv, nor build_complex_conv, nor attempt to
2364         convert a single element initializer to scalar.
2366 2019-03-01  Marek Polacek  <polacek@redhat.com>
2368         PR c++/89537 - missing location for error with non-static member fn.
2369         * call.c (resolve_args): Use EXPR_LOCATION.
2370         * typeck.c (build_class_member_access_expr): Use input_location.
2372         PR c++/89532 - ICE with incomplete type in decltype.
2373         * semantics.c (finish_compound_literal): Return error_mark_node
2374         if digest_init_flags returns error_mark_node.
2376 2019-03-01  Jakub Jelinek  <jakub@redhat.com>
2378         Implement P1002R1, Try-catch blocks in constexpr functions
2379         PR c++/89513
2380         * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
2381         Diagnose constexpr ctor or function with function-try-block with
2382         pedwarn for c++17 and earlier.  Formatting fix.
2383         (cp_parser_try_block): Use pedwarn instead of error and only for
2384         c++17 and earlier when try block appears in constexpr function.
2385         * constexpr.c (build_constexpr_constructor_member_initializers):
2386         Handle TRY_BLOCK here instead of erroring on it.
2388 2019-02-28  Jason Merrill  <jason@redhat.com>
2390         PR c++/88183 - ICE with .* fold-expression.
2391         * pt.c (fold_expression) [DOTSTAR_EXPR]: Remove special handling.
2393         PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
2394         * class.c, lambda.c, pt.c: Revert earlier change.
2395         * lambda.c (add_capture): Don't special-case capture of dependent
2396         VLA.
2398         * name-lookup.c (print_binding_level): Print this_entity.
2400 2019-02-27  Marek Polacek  <polacek@redhat.com>
2402         PR c++/88857 - ICE with value-initialization of argument in template.
2403         * call.c (convert_like_real): Don't call build_value_init in template.
2405 2019-02-27  Jason Merrill  <jason@redhat.com>
2407         PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
2408         * semantics.c (process_outer_var_ref): Do capture dependent vars.
2409         * class.c (finish_struct): Only add TAG_DEFN if T is in
2410         current_function_decl.
2411         * lambda.c (vla_capture_type): Force the capture type out into the
2412         lambda's enclosing function.
2413         (add_capture): Pass in the lambda.
2414         * pt.c (tsubst_lambda_expr): complete_type a VLA capture type.
2416 2019-02-27  Marek Polacek  <polacek@redhat.com>
2418         PR c++/89511 - ICE with using-declaration and unscoped enumerator.
2419         * parser.c (cp_parser_using_declaration): For an unscoped enum
2420         only use its context if it's not a function declaration.
2422 2019-02-27  Paolo Carlini  <paolo.carlini@oracle.com>
2424         PR c++/89488
2425         * method.c (process_subob_fn): When maybe_instantiate_noexcept
2426         returns false don't call merge_exception_specifiers.
2428 2019-02-27  Paolo Carlini  <paolo.carlini@oracle.com>
2430         PR c++/88987
2431         * parser.c (cp_parser_noexcept_specification_opt): Return NULL_TREE
2432         for a non-constant parsed expression.
2434 2019-02-26  Jakub Jelinek  <jakub@redhat.com>
2436         PR c++/89481
2437         * constexpr.c (cxx_eval_store_expression): When changing active union
2438         member, set no_zero_init.
2440 2019-02-23  Marek Polacek  <polacek@redhat.com>
2442         PR c++/88294 - ICE with non-constant noexcept-specifier.
2443         * pt.c (maybe_instantiate_noexcept): Set up the list of local
2444         specializations.  Set current_class_{ptr,ref}.
2446 2019-02-22  David Malcolm  <dmalcolm@redhat.com>
2448         PR c++/89390
2449         * parser.c (cp_parser_unqualified_id): Capture and use locations
2450         for destructors.
2452 2019-02-22  Marek Polacek  <polacek@redhat.com>
2454         PR c++/89420 - ICE with CAST_EXPR in explicit-specifier.
2455         * decl.c (build_explicit_specifier): Don't check
2456         processing_template_decl.  Call instantiation_dependent_expression_p
2457         instead of value_dependent_expression_p.  Call
2458         instantiate_non_dependent_expr_sfinae before
2459         build_converted_constant_expr instead of calling
2460         instantiate_non_dependent_expr after it.  Add
2461         processing_template_decl_sentinel.
2463 2019-02-22  Thomas Schwinge  <thomas@codesourcery.com>
2465         * parser.c (cp_parser_oacc_simple_clause): Remove parser formal
2466         parameter, move loc formal parameter to the front.  Adjust all
2467         users.
2468         (cp_parser_oacc_shape_clause): Add loc formal parameter.  Adjust
2469         all users.
2471 2019-02-21  Jason Merrill  <jason@redhat.com>
2473         PR c++/87685 - generic lambda 'this' capture error.
2474         * lambda.c (lambda_expr_this_capture): Change add_capture_p to int.
2475         (maybe_generic_this_capture): Pass -1.
2477         PR c++/88394 - ICE with VLA init-capture.
2478         * lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE.
2480         PR c++/88869 - C++17 ICE with CTAD and explicit specialization.
2481         * pt.c (do_class_deduction): Don't include explicit specialization
2482         args in outer_args.
2484         PR c++/89422 - ICE with -g and lambda in default arg in template.
2485         * pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner.
2487 2019-02-21  Jason Merrill  <jason@redhat.com>
2489         PR c++/88419 - C++17 ICE with class template arg deduction.
2490         * pt.c (make_template_placeholder): Set TYPE_CANONICAL after
2491         CLASS_PLACEHOLDER_TEMPLATE.
2493 2019-02-21  Jakub Jelinek  <jakub@redhat.com>
2495         PR c++/89285
2496         * constexpr.c (struct constexpr_fundef): Add parms and result members.
2497         (retrieve_constexpr_fundef): Adjust for the above change.
2498         (register_constexpr_fundef): Save constexpr body with copy_fn,
2499         temporarily set DECL_CONTEXT on DECL_RESULT before that.
2500         (get_fundef_copy): Change FUN argument to FUNDEF with
2501         constexpr_fundef * type, grab body and parms/result out of
2502         constexpr_fundef struct and temporarily change it for copy_fn calls
2503         too.
2504         (cxx_eval_builtin_function_call): For __builtin_FUNCTION temporarily
2505         adjust current_function_decl from ctx->call context.  Test
2506         !potential_constant_expression instead of !is_constant_expression.
2507         (cxx_bind_parameters_in_call): Grab parameters from new_call.  Undo
2508         convert_for_arg_passing changes for TREE_ADDRESSABLE type passing.
2509         (cxx_eval_call_expression): Adjust get_fundef_copy caller.
2510         (cxx_eval_conditional_expression): For IF_STMT, allow then or else
2511         operands to be NULL.
2512         (label_matches): Handle BREAK_STMT and CONTINUE_STMT.
2513         (cxx_eval_loop_expr): Add support for FOR_STMT, WHILE_STMT and DO_STMT.
2514         (cxx_eval_switch_expr): Add support for SWITCH_STMT.
2515         (cxx_eval_constant_expression): Handle IF_STMT, FOR_STMT, WHILE_STMT,
2516         DO_STMT, CONTINUE_STMT, SWITCH_STMT, BREAK_STMT and CONTINUE_STMT.
2517         For SIZEOF_EXPR, recurse on the result of fold_sizeof_expr.  Ignore
2518         DECL_EXPR with USING_DECL operand.
2519         * lambda.c (maybe_add_lambda_conv_op): Build thisarg using
2520         build_int_cst to make it a valid constant expression.
2522 2019-02-20  Jason Merrill  <jason@redhat.com>
2524         PR c++/88690 - C++17 ICE with empty base in aggregate.
2525         * typeck2.c (process_init_constructor_record): Skip trivial
2526         initialization of an empty base.
2528 2019-02-21  Richard Biener  <rguenther@suse.de>
2530         PR middle-end/89392
2531         * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not
2532         make symtab process new functions here.
2534 2019-02-20  Jason Merrill  <jason@redhat.com>
2536         PR c++/87921 - wrong error with inline static data member.
2537         * decl2.c (finish_static_data_member_decl): Don't set DECL_IN_AGGR_P
2538         for a non-template inline variable.  Do nothing for an
2539         already-instantiated variable.
2540         (c_parse_final_cleanups): Check DECL_IN_AGGR_P without
2541         DECL_INLINE_VAR_P.
2542         * decl.c (check_initializer): Likewise.
2543         (make_rtl_for_nonlocal_decl): Likewise.
2544         * pt.c (instantiate_decl): Likewise.
2545         * typeck2.c (store_init_value): Likewise.
2547 2019-02-20  Jakub Jelinek  <jakub@redhat.com>
2549         PR c++/89403
2550         * decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting
2551         for flag_syntax_only from here...
2552         * semantics.c (expand_or_defer_fn_1): ... here.
2554         PR c++/89405
2555         * decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and
2556         DECL_COMMON, set DECL_INTERFACE_KNOWN.
2558         PR c++/89336
2559         * constexpr.c (cxx_eval_store_expression): Diagnose changing of active
2560         union member for -std=c++17 and earlier.
2562 2019-02-19  Jason Merrill  <jason@redhat.com>
2564         PR c++/87513 - 'sorry' mangling PMF template-id.
2565         * mangle.c (write_expression): Handle SCOPE_REF to BASELINK.
2567 2019-02-19  Jason Merrill  <jason@redhat.com>
2569         PR c++/88380 - wrong-code with flexible array and NSDMI.
2570         * typeck2.c (process_init_constructor_record): Skip flexarrays.
2572 2019-02-20  will wray  <wjwray@gmail.com>
2574         PR c++/88572 - wrong handling of braces on scalar init.
2575         * decl.c (reshape_init_r): Allow braces around scalar initializer
2576         within aggregate init.  Reject double braced-init of scalar
2577         variable.
2579 2019-02-20  Paolo Carlini  <paolo.carlini@oracle.com>
2581         PR c++/84536
2582         * pt.c (tsubst_init): Diagnose an initializer expanding to an
2583         empty list of expressions; tweak wrt dependent types.
2584         (regenerate_decl_from_template): For VAR_DECLs call tsubst_init
2585         instead of tsubst_expr.
2587 2019-02-19  Jason Merrill  <jason@redhat.com>
2589         PR c++/88368 - wrong 'use of deleted function'
2590         * method.c (walk_field_subobs): Remember errors from get_nsdmi.
2591         (get_defaulted_eh_spec): Call push_tinst_level.
2592         * pt.c (maybe_instantiate_noexcept): Keep error_mark_node.
2593         * typeck2.c (merge_exception_specifiers): Handle error_mark_node.
2595 2019-02-19  Chung-Lin Tang  <cltang@codesourcery.com>
2597         PR c/87924
2598         * parser.c (cp_parser_oacc_clause_wait): Add representation of wait
2599         clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.
2601 2019-02-19  Jakub Jelinek  <jakub@redhat.com>
2603         PR c++/89387
2604         * lambda.c (maybe_generic_this_capture): Don't check
2605         DECL_NONSTATIC_MEMBER_FUNCTION_P on USING_DECLs.
2607         PR c++/89391
2608         * typeck.c (build_reinterpret_cast_1): Don't handle void to
2609         && conversion go through build_target_expr_with_type.
2611         PR c++/89390
2612         * error.c (qualified_name_lookup_error): Only call
2613         suggest_alternative_in_scoped_enum if name is IDENTIFIER_NODE.
2615 2019-02-19  Tom Honermann  <tom@honermann.net>
2617         * name-lookup.c (get_std_name_hint): Added u8string as a name hint.
2619 2019-02-18  Jason Merrill  <jason@redhat.com>
2621         PR c++/89336 - multiple stores in constexpr stmt.
2622         * constexpr.c (cxx_eval_store_expression): Preevaluate scalar or
2623         assigned value.
2625         * pt.c (check_explicit_specialization): If the declarator is a
2626         template-id, only check whether the arguments are dependent.
2628         Improve duplicate [[likely]] diagnostic.
2629         * parser.c (cp_parser_statement): Make attrs_loc a range.  Pass it
2630         to process_stmt_hotness_attribute.
2631         * cp-gimplify.c (process_stmt_hotness_attribute): Take attrs_loc.
2632         (genericize_if_stmt): Use likely/unlikely instead of predictor_name.
2634 2019-02-17  Marek Polacek  <polacek@redhat.com>
2636         PR c++/89217 - ICE with list-initialization in range-based for loop.
2637         * constexpr.c (unshare_constructor): No longer static.
2638         * cp-tree.h (unshare_constructor): Declare.
2639         * semantics.c (finish_compound_literal): When dealing with a
2640         non-dependent expression in a template, return the original
2641         expression.  Pass LOOKUP_NO_NARROWING to digest_init_flags.
2643 2019-02-13  Marek Polacek  <polacek@redhat.com>
2645         PR c++/89297 - ICE with OVERLOAD in template.
2646         * semantics.c (finish_compound_literal): Call
2647         instantiate_non_dependent_expr_sfinae.
2649 2019-02-13  Alexandre Oliva  <aoliva@redhat.com>
2651         PR c++/86379
2652         * cp-tree.h (USING_DECL_SCOPE): Use result rather than type.
2653         * name-lookup.c (strip_using_decl): Use USING_DECL_SCOPE.
2654         * search.c (protected_accessible_p): Follow USING_DECL_DECLS.
2655         (shared_member_p): Likewise.
2656         (lookup_member): Likewise.
2657         * decl.c (grok_special_member_properties): Skip USING_DECLs.
2658         * semantics.c (finish_omp_declare_simd_methods): Likewise.
2659         (finish_qualified_id_expr): Do not call shared_member_p with
2660         a dependent expr.
2662         PR c++/87322
2663         * pt.c (tsubst_lambda_expr): Avoid duplicate tsubsting.
2664         Move cp_evaluated resetting before signature tsubsting.
2665         (gen_elem_of_pack_expansion_instantiation): Separate local
2666         specializations per index.
2668 2019-02-13  David Malcolm  <dmalcolm@redhat.com>
2670         PR c++/89036
2671         * class.c (add_method): Drop destructor assertion.
2673 2019-02-13  Paolo Carlini  <paolo.carlini@oracle.com>
2675         PR c++/88986
2676         * decl.c (make_typename_type): Allow for TYPE_PACK_EXPANSION as
2677         context (the first argument).
2678         * pt.c (tsubst, case TYPENAME_TYPE): Handle TYPE_PACK_EXPANSION
2679         as context.
2681 2019-02-12  Jason Merrill  <jason@redhat.com>
2683         PR c++/89144 - link error with constexpr initializer_list.
2684         * call.c (convert_like_real) [ck_list]: Don't allocate a temporary
2685         array for an empty list.
2686         * typeck2.c (store_init_value): Don't use cxx_constant_init in a
2687         template.
2689 2019-02-11  Jason Merrill  <jason@redhat.com>
2691         PR c++/89241 - ICE with __func__ in lambda in template.
2692         * pt.c (enclosing_instantiation_of): Also check
2693         instantiated_lambda_fn_p for the template context.
2695 2019-02-11  Marek Polacek  <polacek@redhat.com>
2697         PR c++/89212 - ICE converting nullptr to pointer-to-member-function.
2698         * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Return early for
2699         null member pointer value.
2701 2019-02-11  Jakub Jelinek  <jakub@redhat.com>
2703         PR c++/88977
2704         * pt.c (convert_nontype_argument): Pass true as manifestly_const_eval
2705         to maybe_constant_value calls.
2707 2019-02-11  Marek Polacek  <polacek@redhat.com>
2709         * typeck2.c (digest_init_r): Remove commented code.
2711 2019-02-11  Martin Sebor  <msebor@redhat.com>
2713         PR c++/87996
2714         * decl.c (compute_array_index_type_loc): Preserve signed sizes
2715         for diagnostics.  Call valid_array_size_p instead of error.
2716         * init.c (build_new_1): Compute size for diagnostic.  Call
2717         invalid_array_size_error
2718         (build_new): Call valid_array_size_p instead of error.
2720 2019-02-07  Alexandre Oliva  <aoliva@redhat.com>
2722         PR c++/86218
2723         * call.c (compare_ics): Deal with ck_aggr in either cs.
2725 2019-02-06  David Malcolm  <dmalcolm@redhat.com>
2727         PR c++/71302
2728         * call.c (get_location_for_expr_unwinding_for_system_header): New
2729         function.
2730         (conversion_null_warnings): Use it when getting locations for
2731         EXPR, effectively adding a call to
2732         get_location_for_expr_unwinding_for_system_header for
2733         -Wconversion-null and making use of EXPR_LOCATION for
2734         -Wzero-as-null-pointer-constant.
2736 2019-02-05  Jakub Jelinek  <jakub@redhat.com>
2738         PR c++/89187
2739         * optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on
2740         PARM_DECLs of the thunk.
2741         * lambda.c (maybe_add_lambda_conv_op): Likewise.
2743 2019-02-05  Marek Polacek  <polacek@redhat.com>
2745         PR c++/89158 - by-value capture of constexpr variable broken.
2746         * call.c (convert_like_real) <case ck_user>: Call mark_exp_read
2747         instead of mark_rvalue_use.
2749 2019-02-05  Alexandre Oliva  <aoliva@redhat.com>
2751         PR c++/87770
2752         * pt.c (instantiates_primary_template_p): New.
2753         (type_dependent_expression_p): Use it.
2755 2019-02-01  Jason Merrill  <jason@redhat.com>
2757         PR c++/88761 - ICE with reference capture of constant.
2758         * lambda.c (mark_const_cap_r): Do walk subtrees of DECL_EXPR for
2759         non-proxy decls.
2761 2019-02-01  Marek Polacek  <polacek@redhat.com>
2763         PR c++/88325 - ICE with invalid out-of-line template member definition.
2764         * parser.c (cp_parser_class_name): Don't call make_typename_type
2765         for overloads.
2767 2019-02-01  Jakub Jelinek  <jakub@redhat.com>
2769         PR c++/87175
2770         * parser.c (cp_parser_gnu_attributes_opt): Set ok to false
2771         if require_open failed.
2773 2019-01-31  Marek Polacek  <polacek@redhat.com>
2775         PR c++/89083, c++/80864 - ICE with list initialization in template.
2776         * constexpr.c (adjust_temp_type): Use copy_node and change the type
2777         instead of using build_constructor.
2778         * decl.c (reshape_init_r): Don't reshape a digested initializer.
2779         Return the initializer for COMPOUND_LITERAL_P.
2781         PR c++/88983 - ICE with switch in constexpr function.
2782         * constexpr.c (cxx_eval_switch_expr): Use SWITCH_COND and SWITCH_BODY.
2783         (cxx_eval_constant_expression) <case COND_EXPR>: Don't look for the
2784         label in the else branch if we found it in the then branch.
2786 2019-01-30  Jason Merrill  <jason@redhat.com>
2788         PR c++/88752 - ICE with lambda and constexpr if.
2789         * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New.
2790         * pt.c (tsubst_lambda_expr): Set it.
2791         (instantiated_lambda_fn_p): Check it.
2792         (enclosing_instantiation_of): Use it.
2794 2019-01-31  Jakub Jelinek  <jakub@redhat.com>
2796         PR libstdc++/88170
2797         * cxx-pretty-print.c (pp_cxx_enumeration_constant): Print always as
2798         a C cast in pp_c_flag_gnu_v3 mode.
2800 2019-01-30  Jakub Jelinek  <jakub@redhat.com>
2802         PR c++/88988
2803         * lambda.c (is_capture_proxy): Don't return true for
2804         DECL_OMP_PRIVATIZED_MEMBER artificial vars.
2806 2019-01-30  Marek Polacek  <polacek@redhat.com>
2808         PR c++/89119 - ICE with value-initialization in template.
2809         * pt.c (tsubst_copy_and_build): Handle RANGE_EXPR.
2811 2019-01-29  Jason Merrill  <jason@redhat.com>
2813         PR c++/86943 - wrong code converting lambda to function pointer.
2814         * lambda.c (maybe_add_lambda_conv_op): Use a template-id in the
2815         call.  Only forward parms for decltype.
2816         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Handle CALL_FROM_THUNK_P
2817         specially.
2818         * typeck.c (check_return_expr): Don't mess with a thunk call.
2820 2019-01-28  Jason Merrill  <jason@redhat.com>
2822         PR c++/89089 - ICE with [[no_unique_address]].
2823         PR c++/88865 - wrong layout with [[no_unique_address]].
2824         * class.c (check_field_decls): A potentially-overlapping field makes
2825         the class non-layout-POD, but not non-empty.
2826         (end_of_class): Always consider empty data members.
2827         (layout_class_type): Set DECL_SIZE for empty fields.
2829 2019-01-28  Marek Polacek  <polacek@redhat.com>
2831         PR c++/88358 - name wrongly treated as type.
2832         * parser.c (cp_parser_direct_declarator): Don't assume a qualified-id
2833         in parameter-list is a type if the function's declarator-id is not
2834         qualified.
2836 2019-01-27  Marek Polacek  <polacek@redhat.com>
2838         PR c++/88815 - narrowing conversion lost in decltype.
2839         PR c++/78244 - narrowing conversion in template not detected.
2840         * cp-tree.h (CONSTRUCTOR_IS_DEPENDENT): New.
2841         * pt.c (instantiation_dependent_r): Consider a CONSTRUCTOR with
2842         CONSTRUCTOR_IS_DEPENDENT instantiation-dependent.
2843         * semantics.c (finish_compound_literal): When the compound literal
2844         isn't instantiation-dependent and the type isn't type-dependent,
2845         fall back to the normal processing.  Set CONSTRUCTOR_IS_DEPENDENT.
2847         PR c++/89024 - ICE with incomplete enum type.
2848         * call.c (standard_conversion): When converting an
2849         ARITHMETIC_TYPE_P to an incomplete type, return NULL.
2851 2019-01-25  Paolo Carlini  <paolo.carlini@oracle.com>
2853         PR c++/88969
2854         * call.c (build_op_delete_call): Implement 7.6.2.5/(10.1).
2855         * decl2.c (coerce_delete_type): Use build_pointer_type instead
2856         of TYPE_POINTER_TO.
2858 2019-01-24  Jason Merrill  <jason@redhat.com>
2860         PR c++/89001 - mangling of reference temporaries
2861         * cp-tree.h (struct saved_scope): Add ref_temp_count.
2862         (current_ref_temp_count): New macro.
2863         * mangle.c (mangle_ref_init_variable): Use it.
2864         * typeck2.c (store_init_value): Clear it.
2865         * call.c (make_temporary_var_for_ref_to_temp): Copy public and
2866         comdat.
2868 2019-01-24  Jakub Jelinek  <jakub@redhat.com>
2870         PR c++/88976
2871         * semantics.c (finish_omp_cancel): Diagnose more than one if
2872         on #pragma omp cancel with different modifiers.  Use
2873         maybe_convert_cond when not in template or build_x_binary_op
2874         otherwise.
2876 2019-01-23  Marek Polacek  <polacek@redhat.com>
2878         PR c++/88757 - qualified name treated wrongly as type.
2879         * parser.c (cp_parser_direct_declarator): Don't treat qualified-ids
2880         in parameter-list as types if name lookup for declarator-id didn't
2881         find one or more function templates.
2883 2019-01-23  Jakub Jelinek  <jakub@redhat.com>
2885         PR c/44715
2886         * cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only
2887         after genericizing cond and incr expressions.
2889         PR c++/88984
2890         * cp-gimplify.c (genericize_switch_stmt): Move cond genericization
2891         before the begin_bc_block call.
2893 2019-01-21  Jason Merrill  <jason@redhat.com>
2895         PR c++/87893 - constexpr ctor ICE on ARM.
2896         PR c++/88293 - ICE with comma expression.
2897         * constexpr.c (initialized_type): Don't shortcut non-void type.
2898         Handle COMPOUND_EXPR.
2899         (cxx_eval_outermost_constant_expr): Return early for void type.
2901 2019-01-21  Jakub Jelinek  <jakub@redhat.com>
2903         PR c++/88949
2904         * optimize.c (cxx_copy_decl): New function.
2905         (clone_body): Use it instead of copy_decl_no_change.
2907         PR sanitizer/88901
2908         * typeck.c (cp_build_binary_op): Don't instrument
2909         SANITIZE_POINTER_COMPARE if processing_template_decl.
2910         (pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT.
2912 2019-01-18  Jason Merrill  <jason@redhat.com>
2914         PR c++/88875 - error with explicit list constructor.
2915         * call.c (reference_binding): Don't modify EXPR.  Set
2916         need_temporary_p on the ck_user conversion for a temporary.
2917         (convert_like_real): Check it.
2919 2019-01-18  H.J. Lu  <hongjiu.lu@intel.com>
2921         PR c/51628
2922         PR c/88664
2923         * call.c (convert_for_arg_passing): Upate the
2924         warn_for_address_or_pointer_of_packed_member call.
2925         * typeck.c (convert_for_assignment): Likewise.
2927 2019-01-17  Jason Merrill  <jason@redhat.com>
2929         PR c++/86205 - ICE with ?: of throw and template-id.
2930         * pt.c (resolve_nondeduced_context_or_error): Split out from...
2931         * typeck.c (decay_conversion): ...here.
2932         * call.c (build_conditional_expr_1): Use it.
2934         PR c++/86740, ICE with constexpr if and nested generic lambdas.
2935         * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR.
2937 2019-01-17  Paolo Carlini  <paolo.carlini@oracle.com>
2939         * decl.c (grokdeclarator): Use typespec_loc in error messages
2940         about 'auto' and trailing return type.
2942 2019-01-17  David Malcolm  <dmalcolm@redhat.com>
2944         PR c++/88699
2945         * class.c (add_method): Don't use DECL_DESTRUCTOR_P on
2946         USING_DECLs.
2948 2019-01-17  Nathan Sidwell  <nathan@acm.org>
2950         PR c++/86610
2951         * semantics.c (process_outer_var_ref): Only skip dependent types
2952         in templates.
2954 2019-01-17  Alexandre Oliva  <aoliva@redhat.com>
2956         PR c++/87768
2957         * cp-tree.h (saved_scope): Add suppress_location_wrappers.
2958         * name-lookup.c (do_push_to_top_level): Save and reset it.
2959         (do_pop_from_top_level): Restore it.
2961         PR c++/86648
2962         * pt.c (make_template_placeholder): Use auto_identifier.
2963         (is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test.
2964         * error.c (dump_type): Handle template placeholders.
2965         * cxx-pretty-print.c (pp_cx_unqualified_id): Likewise.
2967         PR c++/88146
2968         * cvt.c (convert_to_void): Handle all cdtor calls as if
2969         returning void.
2971 2019-01-16  Paolo Carlini  <paolo.carlini@oracle.com>
2973         * decl.c (grokdeclarator): Use locations[ds_storage_class] in
2974         error messages about ill-formed uses of mutable.
2976 2019-01-16  Marek Polacek  <polacek@redhat.com>
2978         PR c++/78244 - narrowing conversion in template not detected.
2979         * call.c (perform_implicit_conversion_flags): Set
2980         IMPLICIT_CONV_EXPR_BRACED_INIT.
2981         * cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New.
2982         * pt.c (tsubst_copy_and_build): Use it.
2984 2019-01-15  David Malcolm  <dmalcolm@redhat.com>
2986         PR c++/88795
2987         * pt.c (build_deduction_guide): Bail out if tsubst_arg_types
2988         fails.
2990 2019-01-15  Paolo Carlini  <paolo.carlini@oracle.com>
2992         * decl.c (start_decl): Improve error location.
2993         * decl2.c (grokfield): Likewise.
2995 2019-01-15  Paolo Carlini  <paolo.carlini@oracle.com>
2997         * decl.c (grokdeclarator): Move further up the location_t loc
2998         declaration and use the location when building a TYPE_DECL for
2999         a typedef name.
3000         * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error
3001         about an ill-formed bit-field as typedef.
3003 2019-01-14  Marek Polacek  <polacek@redhat.com>
3005         PR c++/88830 - ICE with abstract class.
3006         * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR.
3007         Fix formatting.
3009         PR c++/88825 - ICE with bogus function return type deduction.
3010         * typeck.c (can_do_nrvo_p): Check error_mark_node.
3012 2019-01-14  Tom Honermann  <tom@honermann.net>
3014         Implement P0482R5, char8_t: A type for UTF-8 characters and strings
3015         * cvt.c (type_promotes_to): Handle char8_t promotion.
3016         * decl.c (grokdeclarator): Handle invalid type specifier
3017         combinations involving char8_t.
3018         * lex.c (init_reswords): Add char8_t as a reserved word.
3019         * mangle.c (write_builtin_type): Add name mangling for char8_t (Du).
3020         * parser.c (cp_keyword_starts_decl_specifier_p)
3021         (cp_parser_simple_type_specifier): Recognize char8_t as a simple
3022         type specifier.
3023         (cp_parser_string_literal): Use char8_array_type_node for the type
3024         of CPP_UTF8STRING.
3025         (cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system
3026         headers.
3027         * rtti.c (emit_support_tinfos): type_info support for char8_t.
3028         * tree.c (char_type_p): Recognize char8_t as a character type.
3029         * typeck.c (string_conv_p): Handle conversions of u8 string
3030         literals of char8_t type.
3031         (check_literal_operator_args): Handle UDLs with u8 string literals
3032         of char8_t type.
3033         * typeck2.c (ordinary_char_type_p): New.
3034         (digest_init_r): Disallow initializing a char array with a u8 string
3035         literal.
3037 2019-01-14  Martin Liska  <mliska@suse.cz>
3039         PR gcov-profile/88263
3040         * decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION
3041         as location of the TLS wrapper.
3043 2019-01-12  Paolo Carlini  <paolo.carlini@oracle.com>
3045         * decl.c (cp_finish_decl): Improve error location.
3046         * decl2.c (grokfield): Likewise, improve two locations.
3048 2019-01-11  Marek Polacek  <polacek@redhat.com>
3050         PR c++/88692, c++/87882 - -Wredundant-move false positive with *this.
3051         * typeck.c (maybe_warn_pessimizing_move): Return if ARG isn't
3052         ADDR_EXPR.
3054 2019-01-11  Jason Merrill  <jason@redhat.com>
3056         PR c++/88312 - pack expansion of decltype.
3057         * pt.c (instantiation_dependent_r): A template non-type parameter
3058         pack is instantiation-dependent.
3060 2019-01-11  Jason Merrill  <jason@redhat.com>
3062         PR c++/88613 - ICE with use of const var in lambda.
3063         * expr.c (mark_use): Fix location wrapper handling.
3064         * cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use.
3066 2019-01-11  Tobias Burnus  <burnus@net-b.de>
3068         PR C++/88114
3069         * decl2.c (maybe_emit_vtables): If needed, generate code for
3070         the destructor of an abstract class.
3071         (mark_used): Update comment for older function-name change.
3073 2019-01-11  Paolo Carlini  <paolo.carlini@oracle.com>
3075         * decl.c (start_decl): Improve error location.
3076         (grokdeclarator): Likewise, improve two locations.
3078 2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>
3080         PR other/16615
3082         * cp-tree.h: Mechanically replace "can not" with "cannot".
3083         * parser.c: Likewise.
3084         * pt.c: Likewise.
3086 2019-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
3088         * decl.c (grok_reference_init): Improve error location.
3089         (grokdeclarator): Likewise, improve two locations.
3091 2019-01-08  Marek Polacek  <polacek@redhat.com>
3093         PR c++/88538 - braced-init-list in template-argument-list.
3094         * parser.c (cp_parser_template_argument): Handle braced-init-list when
3095         in C++20.
3097         PR c++/88548 - this accepted in static member functions.
3098         * parser.c (cp_debug_parser): Adjust printing of
3099         local_variables_forbidden_p.
3100         (cp_parser_new): Set local_variables_forbidden_p to 0 rather than false.
3101         (cp_parser_primary_expression): When checking
3102         local_variables_forbidden_p, use THIS_FORBIDDEN or
3103         LOCAL_VARS_FORBIDDEN.
3104         (cp_parser_lambda_body): Update the type of
3105         local_variables_forbidden_p.  Set it to 0 rather than false.
3106         (cp_parser_condition): Adjust call to cp_parser_declarator.
3107         (cp_parser_explicit_instantiation): Likewise.
3108         (cp_parser_init_declarator): Likewise.
3109         (cp_parser_declarator): New parameter.  Use it.
3110         (cp_parser_direct_declarator): New parameter.  Use it to set
3111         local_variables_forbidden_p.  Adjust call to cp_parser_declarator.
3112         (cp_parser_type_id_1): Adjust call to cp_parser_declarator.
3113         (cp_parser_parameter_declaration): Likewise.
3114         (cp_parser_default_argument): Update the type of
3115         local_variables_forbidden_p.  Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
3116         rather than true.
3117         (cp_parser_member_declaration): Tell cp_parser_declarator if we saw
3118         'static' or 'friend'.
3119         (cp_parser_exception_declaration): Adjust call to cp_parser_declarator.
3120         (cp_parser_late_parsing_default_args): Update the type of
3121         local_variables_forbidden_p.  Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
3122         rather than true.
3123         (cp_parser_cache_defarg): Adjust call to cp_parser_declarator.
3124         (cp_parser_objc_class_ivars): Likewise.
3125         (cp_parser_objc_struct_declaration): Likewise.
3126         (cp_parser_omp_for_loop_init): Likewise.
3127         * parser.h (cp_parser): Change the type of local_variables_forbidden_p
3128         to unsigned char.
3129         (LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN):
3130         Define.
3132 2019-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
3134         * decl.c (start_decl): Improve permerror location.
3136 2019-01-08  Jonathan Wakely  <jwakely@redhat.com>
3137             Jakub Jelinek  <jakub@redhat.com>
3139         PR c++/88554
3140         * decl.c (finish_function): For -Wreturn-type don't add a return *this;
3141         fixit hint if current_class_ref is NULL.  Use a single if instead of
3142         two nested ones.
3144 2019-01-07  Paolo Carlini  <paolo.carlini@oracle.com>
3146         * decl.c (start_decl): Improve two error_at locations.
3147         (expand_static_init): Likewise.
3149 2019-01-07  Marek Polacek  <polacek@redhat.com>
3151         PR c++/88741 - wrong error with initializer-string.
3152         * decl.c (cp_complete_array_type): Strip any location wrappers.
3154 2019-01-07  Bernd Edlinger  <bernd.edlinger@hotmail.de>
3156         PR c++/88261
3157         PR c++/69338
3158         PR c++/69696
3159         PR c++/69697
3160         * cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value.
3161         * typeck2.c (digest_init_r): Raise an error for non-static
3162         initialization of a flexible array member.
3163         (process_init_constructor, massage_init_elt,
3164         process_init_constructor_array, process_init_constructor_record,
3165         process_init_constructor_union, process_init_constructor): Add the
3166         flags parameter and pass it thru.
3167         (store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to
3168         digest_init_flags for static decls.
3170 2019-01-07  Jakub Jelinek  <jakub@redhat.com>
3172         PR c++/85052
3173         * cp-tree.h (cp_build_vec_convert): Declare.
3174         * parser.c (cp_parser_postfix_expression): Parse
3175         __builtin_convertvector.
3176         * constexpr.c: Include fold-const-call.h.
3177         (cxx_eval_internal_function): Handle IFN_VEC_CONVERT.
3178         (potential_constant_expression_1): Likewise.
3179         * semantics.c (cp_build_vec_convert): New function.
3180         * pt.c (tsubst_copy_and_build): Handle CALL_EXPR to
3181         IFN_VEC_CONVERT.
3183 2019-01-03  Jakub Jelinek  <jakub@redhat.com>
3185         PR c++/88636
3186         * decl.c (builtin_function_1): Return result of pushdecl_top_level
3187         or pushdecl rather than decl.
3189 2019-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
3191         * tree.c (handle_nodiscard_attribute): Improve warning location.
3193 2019-01-02  Marek Polacek  <polacek@redhat.com>
3195         PR c++/88612 - ICE with -Waddress-of-packed-member.
3196         * call.c (convert_for_arg_passing): Only give warnings with tf_warning.
3197         * typeck.c (convert_for_assignment): Likewise.
3199         PR c++/88631 - CTAD failing for value-initialization.
3200         * typeck2.c (build_functional_cast): Try deducing the template
3201         arguments even if there are no arguments to deduce from.
3203 2019-01-01  Jakub Jelinek  <jakub@redhat.com>
3205         Update copyright years.
3207 Copyright (C) 2019 Free Software Foundation, Inc.
3209 Copying and distribution of this file, with or without modification,
3210 are permitted in any medium without royalty provided the copyright
3211 notice and this notice are preserved.