PR c++/85746: Don't fold __builtin_constant_p prematurely
[official-gcc.git] / gcc / cp / ChangeLog
blobd2b1fe457cb9b80603556ca4ffda1fb6ac07476d
1 2019-10-22  Marc Glisse  <marc.glisse@inria.fr>
3         PR c++/85746
4         * constexpr.c (cxx_eval_builtin_function_call): Only set
5         force_folding_builtin_constant_p if manifestly_const_eval.
7 2019-10-22  Richard Sandiford  <richard.sandiford@arm.com>
9         * cp-tree.h (STF_USER_VISIBLE): New constant.
10         (strip_typedefs, strip_typedefs_expr): Take a flags argument.
11         * tree.c (strip_typedefs, strip_typedefs_expr): Likewise,
12         updating mutual calls accordingly.  When STF_USER_VISIBLE is true,
13         only look through typedefs if user_facing_original_type_p.
14         * error.c (dump_template_bindings, type_to_string): Pass
15         STF_USER_VISIBLE to strip_typedefs.
16         (dump_type): Likewise, unless pp_c_flag_gnu_v3 is set.
18 2019-10-21  Kamlesh Kumar  <kamleshbhalui@gmail.com>
19             Jason Merrill  <jason@redhat.com>
21         PR c++/83534 - typeinfo of noexcept function
22         * rtti.c (get_tinfo_decl_dynamic): Do not call
23         TYPE_MAIN_VARIANT for function.
24         (get_typeid): Likewise.
26 2019-10-21  Paolo Carlini  <paolo.carlini@oracle.com>
28         * parser.c (cp_parser_class_head): Improve error recovery upon
29         extra qualification error.
31 2019-10-21  Jakub Jelinek  <jakub@redhat.com>
33         PR c++/92015
34         * constexpr.c (cxx_eval_component_reference, cxx_eval_bit_field_ref):
35         Use STRIP_ANY_LOCATION_WRAPPER on CONSTRUCTOR elts.
37 2019-10-21  Marek Polacek  <polacek@redhat.com>
39         PR c++/92062 - ODR-use ignored for static member of class template.
40         * pt.c (has_value_dependent_address): Strip location wrappers.
42 2019-10-21  Marek Polacek  <polacek@redhat.com>
44         PR c++/92106 - ICE with structured bindings and -Wreturn-local-addr.
45         * typeck.c (maybe_warn_about_returning_address_of_local): Avoid
46         recursing on null initializer and return false instead.
48 2019-10-17  JeanHeyd Meneide  <phdofthehouse@gmail.com>
50         Implement p1301 [[nodiscard("should have a reason")]] + p1771 DR
51         * tree.c (handle_nodiscard_attribute): Handle C++2a nodiscard
52         string message.
53         (std_attribute_table) Increase nodiscard argument handling
54         max_length from 0 to 1.
55         * parser.c (cp_parser_check_std_attribute): Add requirement
56         that nodiscard only be seen once in attribute-list.
57         (cp_parser_std_attribute): Check that empty parenthesis lists are
58         not specified for attributes that have max_length > 0 (e.g.
59         [[attr()]]).
60         * cvt.c (maybe_warn_nodiscard): Add nodiscard message to
61         output, if applicable.
62         (convert_to_void): Allow constructors to be nodiscard-able (P1771).
64 2019-10-18  Nathan Sidwell  <nathan@acm.org>
66         * cp-tree.h (struct lang_type): Remove was_anonymous.
67         (TYPE_WAS_UNNAMED): Implement by checking TYPE_DECL &
68         TYPE_STUB_DECL.
69         * decl.c (name_unnamed_type): Don't set TYPE_WAS_UNNAMED.
71 2019-10-17  Paolo Carlini  <paolo.carlini@oracle.com>
73         * decl.c (grokfndecl): Remove redundant use of in_system_header_at.
74         (compute_array_index_type_loc): Likewise.
75         (grokdeclarator): Likewise.
76         * error.c (cp_printer): Likewise.
77         * lambda.c (add_default_capture): Likewise.
78         * parser.c (cp_parser_primary_expression): Likewise.
79         (cp_parser_selection_statement): Likewise.
80         (cp_parser_toplevel_declaration): Likewise.
81         (cp_parser_enumerator_list): Likewise.
82         (cp_parser_using_declaration): Likewise.
83         (cp_parser_member_declaration): Likewise.
84         (cp_parser_exception_specification_opt): Likewise.
85         (cp_parser_std_attribute_spec): Likewise.
86         * pt.c (do_decl_instantiation): Likewise.
87         (do_type_instantiation): Likewise.
88         * typeck.c (cp_build_unary_op): Likewise.
90         * decl.c (check_tag_decl): Pass to in_system_header_at the same
91         location used for the permerror.
92         (grokdeclarator): Likewise.
94         * decl.c (check_tag_decl): Use locations[ds_typedef] in error_at.
96 2019-10-17  Jason Merrill  <jason@redhat.com>
98         * cp-gimplify.c (cp_gimplify_expr): Use get_initialized_tmp_var.
99         (gimplify_to_rvalue): Remove default NULL argument.
101 2019-10-17  Nathan Sidwell  <nathan@acm.org>
103         * decl.c (builtin_function_1): Merge into ...
104         (cxx_builtin_function): ... here.  Nadger the decl before maybe
105         copying it.  Set the context.
106         (cxx_builtin_function_ext_scope): Push to top level, then call
107         cxx_builtin_function.
109 2019-10-16  Luis Machado  <luis.machado@linaro.org>
111         * cp-gimplify.c: Fix reference to non-existing tree-gimple.c file.
113 2019-10-16  Jakub Jelinek  <jakub@redhat.com>
115         * decl.c (cxx_maybe_build_cleanup): When clearing location of cleanup,
116         if cleanup is a nop, clear location of its operand too.
118 2019-10-15  Nathan Sidwell  <nathan@acm.org>
120         * class.c (build_clones): Break out of clone_function_decl.  Just
121         build the clones.
122         (clone_function_decl): Call build_clones, then maybe add them to
123         the method vector.
125         * class.c (build_clone): Refactor to clarify recursiveness.
127 2019-10-14  Jason Merrill  <jason@redhat.com>
129         PR c++/91930 - ICE with constrained inherited default ctor.
130         * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
131         for inherited constructor.
133 2019-10-14  Paolo Carlini  <paolo.carlini@oracle.com>
135         * decl.c (check_tag_decl): Use DECL_SOURCE_LOCATION.
137 2019-10-14  Jakub Jelinek  <jakub@redhat.com>
139         PR c++/92084
140         * semantics.c (handle_omp_array_sections_1): Temporarily disable
141         -fstrong-eval-order also for in_reduction and task_reduction clauses.
143         * parser.c (cp_parser_omp_all_clauses): Change bool NESTED_P argument
144         into int NESTED, if it is 2, diagnose missing commas in between
145         clauses.
146         (cp_parser_omp_context_selector): Pass 2 as last argument to
147         cp_parser_omp_all_clauses.
149 2019-10-12  Jakub Jelinek  <jakub@redhat.com>
151         * parser.c (cp_parser_omp_context_selector): Improve error recovery.
152         For simd properties, put them directly into TREE_VALUE.
153         (cp_finish_omp_declare_variant): Add "omp declare variant base"
154         attribute rather than "omp declare variant".
156 2019-10-11  Marek Polacek  <polacek@redhat.com>
158         PR c++/92049 - extra error with -fchecking=2.
159         * pt.c (build_non_dependent_expr): Call fold_non_dependent_expr
160         with tf_none.
162 2019-10-11  Paolo Carlini  <paolo.carlini@oracle.com>
164         * typeck.c (cp_build_binary_op): Do not handle RROTATE_EXPR and
165         LROTATE_EXPR.
166         * constexpr.c (cxx_eval_constant_expression): Likewise.
167         (potential_constant_expression_1): Likewise.
168         * pt.c (tsubst_copy): Likewise.
170 2019-10-11  Jason Merrill  <jason@redhat.com>
172         * decl2.c (mark_used): Don't clobber DECL_SOURCE_LOCATION on
173         explicitly defaulted functions.
174         * method.c (synthesize_method): Likewise.
176 2019-10-11  Jakub Jelinek  <jakub@redhat.com>
178         PR c++/91987
179         * decl2.c (grok_array_decl): For -fstrong-eval-order, when array ref
180         operands have been swapped and at least one operand has side-effects,
181         revert the swapping before calling build_array_ref.
182         * typeck.c (cp_build_array_ref): For non-ARRAY_TYPE array ref with
183         side-effects on the index operand, if -fstrong-eval-order use
184         save_expr around the array operand.
185         (cp_build_binary_op): For shifts with side-effects in the second
186         operand, wrap first operand into SAVE_EXPR and evaluate it before
187         the shift.
188         * semantics.c (handle_omp_array_sections_1): Temporarily disable
189         flag_strong_eval_order during OMP_CLAUSE_REDUCTION array section
190         processing.
191         * cp-gimplify.c (gimplify_to_rvalue): New function.
192         (cp_gimplify_expr): Use it.
194 2019-10-10  Marek Polacek  <polacek@redhat.com>
196         * typeck.c (comp_ptr_ttypes_real): Change the return type to bool.
197         Use false instead of 0.
199 2019-10-10  Jakub Jelinek  <jakub@redhat.com>
201         * parser.h (struct cp_omp_declare_simd_data): Add variant_p member.
202         * parser.c (cp_ensure_no_omp_declare_simd): Handle both declare simd
203         and declare variant.
204         (cp_parser_oacc_all_clauses): Formatting fix.
205         (cp_parser_omp_all_clauses): Add NESTED_P argument, if true, terminate
206         processing on closing paren and don't skip to end of pragma line.
207         (cp_parser_omp_declare_simd): Add VARIANT_P argument.  Handle also
208         declare variant.
209         (omp_construct_selectors, omp_device_selectors,
210         omp_implementation_selectors, omp_user_selectors): New variables.
211         (cp_parser_omp_context_selector,
212         cp_parser_omp_context_selector_specification,
213         cp_finish_omp_declare_variant): New functions.
214         (cp_parser_late_parsing_omp_declare_simd): Handle also declare variant.
215         (cp_parser_omp_declare): Handle declare variant.
217 2019-10-09  Jason Merrill  <jason@redhat.com>
219         * cp-tree.h (template_info_decl_check): Check ENABLE_TREE_CHECKING.
221 2019-10-09  Marek Polacek  <polacek@redhat.com>
223         PR c++/91364 - P0388R4: Permit conversions to arrays of unknown bound.
224         PR c++/69531 - DR 1307: Differently bounded array parameters.
225         PR c++/88128 - DR 330: Qual convs and pointers to arrays of pointers.
226         * call.c (build_array_conv): Build ck_identity at the beginning
227         of the conversion.
228         (standard_conversion): Pass bounds_none to comp_ptr_ttypes_const.
229         (maybe_warn_array_conv): New.
230         (convert_like_real): Call it.  Add an error message about converting
231         from arrays of unknown bounds.
232         (conv_get_original_expr): New.
233         (nelts_initialized_by_list_init): New.
234         (conv_binds_to_array_of_unknown_bound): New.
235         (compare_ics): Implement list-initialization ranking based on
236         array sizes, as specified in DR 1307 and P0388R.
237         * cp-tree.h (comp_ptr_ttypes_const): Adjust declaration.
238         (compare_bounds_t): New enum.
239         * typeck.c (comp_array_types): New bool and compare_bounds_t
240         parameters.  Use them.
241         (structural_comptypes): Adjust the call to comp_array_types.
242         (similar_type_p): Handle ARRAY_TYPE.
243         (build_const_cast_1): Pass bounds_none to comp_ptr_ttypes_const.
244         (comp_ptr_ttypes_real): Don't check cv-quals of ARRAY_TYPEs.  Use
245         comp_array_types to compare array types.  Look through arrays as per
246         DR 330.
247         (comp_ptr_ttypes_const): Use comp_array_types to compare array types.
248         Look through arrays as per DR 330.
250 2019-10-09  Marek Polacek  <polacek@redhat.com>
252         PR c++/92032 - DR 1601: Promotion of enum with fixed underlying type.
253         * call.c (standard_conversion): When converting an enumeration with
254         a fixed underlying type to the underlying type, give it the cr_promotion
255         rank.
256         (compare_ics): Implement a tiebreaker as per CWG 1601.
258 2019-10-08  Andrew Sutton  <asutton@lock3software.com>
259             Jason Merrill  <jason@redhat.com>
261         Update the concepts implementation to conform to the C++20
262         specification, improve compile times, and generally clean up
263         the implementation.
264         * call.c (build_new_function_call): Don't evaluate concepts here.
265         (constraint_failure): Don't record the template.
266         (print_z_candidate): Don't extract the template.
267         * class.c (add_method): When overloading, hide ineligible special
268         member fns.
269         (check_methods): Set TYPE_HAS_COMPLEX_* here.
270         * constexpr.c (cxx_eval_constant_expression): Evaluate concepts.
271         (maybe_initialize_fundef_copies_table): Remove.
272         (get_fundef_copy): Use hash_map_safe_get_or_insert.
273         (clear_cv_and_fold_caches): Clear the satisfaction cache.
274         * constraint.cc (known_non_bool_p): New.
275         (parsing_constraint_expression_sentinel): Renamed from
276         expanding_constraint_sentinel.
277         (check_constraint_operands): New.
278         (check_constraint_atom): New.
279         (finish_constraint_binary_op): New.
280         (finish_constraint_or_expr): Likewise.
281         (finish_constraint_and_expr): Likewise.
282         (finish_constraint_primary_expr): Likewise.
283         (combine_constraint_expressions): New.
284         (finish_requires_expr): Add location parm.
285         (get_concept_definition): Return the initializer of concept definitions.
286         (get_template_head_requirements): New.
287         (get_trailing_function_requirements): New.
288         (deduce_constrained_parameter): Check if the identifier or template-id
289         is a concept definition.
290         (resolve_concept_definition_check): Removed.
291         (resolve_variable_concept_check): Removed.
292         (resolve_concept_check): New.
293         (resolve_constraint_check): Handle concept definitions.
294         converting arguments.
295         (function_concept_check_p): Removed.
296         (variable_concept_check_p): Removed.
297         (unpack_concept_check): New.
298         (get_concept_check_template): New.
299         (build_call_check): Moved and renamed to build_function_check.
300         (build_concept_check_arguments): make static.
301         (build_function_check): Always do overload resolution
302         in order to force conversion of template arguments (i.e., actually
303         check that the use of a concept is valid).
304         (build_standard_check): Renamed from build_real_concept_check.
305         (build_real_concept_check): Build checks for C++2a concepts by
306         (build_wildcard_concept_check): New.
307         (build_concept_check): Use build_real_concept_check. New overload.
308         (build_constraints): Save expressions, not normalized constraints.
309         (build_concept_id): New. Pass tf_warning_or_error.
310         (build_type_constraint): New.
311         (finish_type_constraints): New.
312         (associate_classtype_constraints): Also add constraints to union
313         types. Note the original declaration in errors. Don't return
314         error_mark_node in order to avoid an assertion later.
315         (push_down_pack_expansion): Remove.
316         (finish_shorthand_constraint): Make fold expressions, not naked
317         parameter packs. Always apply the constraint to each template argument.
318         (check_introduction_list): New. Fail if not enough
319         names are introduced.
320         (finish_template_introduction): Don't normalize constraints. Pass
321         tsubst flags. Check for insufficient introductions.
322         (placeholder_extract_concept_and_args): Handle the template-id case.
323         Unpack function concept checks correctly.
324         (tsubst_simple_requirement): Return errors if they occur. Don't
325         process as a template.
326         (tsubst_type_requirement): Likewise.
327         (type_deducible_p): New. Wrap the input expression in parens for the
328         purpose of deduction.
329         (expression_convertible_t): New.
330         (tsubst_compound_requirement): Use new deduction, conversion predicates.
331         (tsubst_nested_requirement): Return errors if they occur. Don't
332         process as a template. Instantiate and evaluate the nested requirement.
333         (tsubst_valid_expression_requirement): New.
334         (tsubst_simple_requirement): Use tsubst_valid_expression_requirement.
335         (tsubst_compound_requirement): Use tsubst_valid_expression_requirement.
336         (check_constaint_variables): New.
337         (tsubst_constraint_variables): Check that type substitutions are valid.
338         (tsubst_requires_expr): Likewise. Produce new requires-exprs during
339         template substitution. Copy the previous local specialization stack,
340         so references to non-local parameters can be found. Use cp_unevaluated.
341         (tsubst_constraint): New. Don't evaluate concept checks.
342         (subst_info): New.
343         (norm_info): New. Used to build a normalization tree for concept check
344         diagnostics.
345         (debug_parameter_mapping): New.
346         (debug_argument_list): New.
347         (expand_concept): Removed.
348         (normalize_logical_operation): Pass subst_info through call.
349         (normalize_pack_expansion): Remove.
350         (normalize_simple_requirement): Removed
351         (normalize_type_requirement): Removed
352         (normalize_compound_requirement): Removed
353         (normalize_nested_requirement): Removed
354         (normalize_requirement): Removed
355         (normalize_requirements): Removed
356         (normalize_requires_expression): Removed
357         (normalize_variable_concept_check): Removed.
358         (normalize_function_concept_check): Removed.
359         (normalize_concept_check): Merged all normalize_*_check here.
360         Substitute through written template arguments before normalizing the
361         definition. Only substitute the innermost template arguments.
362         (check_for_logical_overloads): Delete.
363         (map_arguments): New. Associate template parameters with arguments.
364         (build_parameter_mapping): New. Extract used parameters.
365         (normalize_expression): Rewrite.
366         (normalize_conjunction): Removed
367         (normalize_disjunction): Removed
368         (normalize_predicate_constraint): Removed
369         (normalize_parameterized_constraint): Removed
370         (normalized_map): New variable.
371         (get_normalized_constraints): New entry point for normalization.
372         Establishes a timer.
373         (get_normalized_constraints_from_info): New.
374         (get_normalized_constraints_from_decl): New. Turn on template processing
375         prior to normalization. Handle inheriting ctors. Build the
376         normalization arguments from the full set of template parameters of the
377         most general template. This guarantees that we have no concrete arguments
378         in the parameter mapping (e.g., from template members of class
379         templates). Cache normalizations.
380         (normalize_concept_definition): New. Cache normalizations.
381         (normalize_template_requirements): New.
382         (normalize_nontemplate_requirements): New.
383         (normalize_constraint_expression): New.
384         (tsubst_parameter_mapping): New.
385         (get_mapped_args): New.
386         (parameter_mapping_equivalent_p): New. Use template_args_equal.
387         (atomic_constraints_identical_p): New.
388         (hash_atomic_constraint): New.
389         (satisfying_constraint_p): New. Guard against recursive evaluation of
390         constraints during satisfaction.
391         (satisfy_conjunction): New.
392         (satisfy_disjunction): New.
393         (sat_entry): New class for hashing satisfaction results.
394         (sat_hasher): New hash traits.
395         (sat_cache): New.
396         (get_satisfaction): New. Returns cached satisfaction result.
397         (save_satisfaction): New. Caches a satisfaction result.
398         (clear_satisfaction_cache): New.
399         (satisfaction_cache): New. Helps manage satisfaction cache requests.
400         (decl_satisfied_cache): New.
401         (satisfy_atom): New.
402         (satisfy_constraint_r): New.
403         (satisfy_constraint): Use new satisfaction algorithm.
404         (evaluate_concept_check): New.
405         (evaluate_concept): Removed.
406         (evaluate_function_concept): Removed.
407         (evaluate_variable_concept): Removed.
408         (satisfy_constraint_expression): New.
409         (constraint_expression_satisfied_p): New.
410         (constraints_satisfied_p): Use strip_inheriting_ctors. Use
411         push_/pop_access_scope.
412         (more_constrained): Normalize before calling out to subsumption. Allow
413         classes as arguments.
414         (strictly_subsumes): Allow non-templates as arguments. Accept a new
415         template argument.
416         (weakly_subsumes): New.
417         (at_least_as_constrained): Removed.
418         (diagnose_other_expression): Removed.
419         (diagnose_predicate_constraint): Removed.
420         (diagnose_pack_expansion): Removed.
421         (diagnose_check_constraint): Removed.
422         (diagnose_logical_constraint): Removed.
423         (diagnose_expression_constraint): Removed.
424         (diagnose_type_constraint): Removed.
425         (diagnose_implicit_conversion_constraint): Removed.
426         (diagnose_argument_deduction_constraint): Removed.
427         (diagnose_exception_constraint): Removed.
428         (diagnose_parameterized_constraint): Removed.
429         (diagnose_argument_deduction_constraint): Removed.
430         (diagnose_argument_deduction_constraint): Removed.
431         (diagnose_argument_deduction_constraint): Removed.
432         (diagnose_trait_expr): New.
433         (diagnose_requires_expr): New.
434         (diagnose_atomic_constraint): New.
435         (diagnose_valid_expression) Stop wrongly diagnosing valid expressions.
436         Don't substitute as if in template decls. This causes substitution
437         to generate expressions that aren't suitable for use with the noexcept
438         routines.
439         (diagnose_valid_type) Likewise.
440         (diagnose_compound_requirement) Actually emit diagnostics for
441         the causes of errors.Call force_paren_expr_uneval.
442         (diagnose_declaration_constraints): Turn on template processing to
443         suppress certain analyses.
444         * cp-objcp-common.c (cp_common_init_ts): Make concepts typed.
445         (cp_get_debug_type): Use hash_map_safe_*.
446         * cp-tree.h: New function declarations for semantic actions, other
447         facilities. Remove declaration no longer used or needed. Remove
448         unused _CONSTR macros.
449         (LANG_DECL_HAS_MIN): Add CONCEPT_DECL.
450         (template_info_decl_check): Factor macro check into an inline function.
451         (DECL_TEMPLATE_INFO): Use new check facility.
452         (finish_concept_definition): New. Don't invalid concept declarations
453         with invalid initializers.
454         (find_template_parameters): New.
455         (concept_definition_p): New.
456         (concept_check_p): New.
457         (variable_concept_check_p): New.
458         (force_paren_expr_uneval): New.
459         (ovl_iterator::using_p): A USING_DECL by itself was also
460         introduced by a using-declaration.
461         (struct tree_template_info): Use tree_base instead of
462         tree_common. Add tmpl and args fields.
463         (TI_TEMPLATE, TI_ARGS): Adjust.
464         (DECLTYPE_FOR_INIT_CAPTURE): Remove.
465         (CONSTR_CHECK, CONSTR_INFO, CONSTR_EXPR, CONSTR_CONTEXT): New.
466         (ATOMIC_CONSTR_MAP, TRAIT_EXPR_LOCATION): New.
467         (struct tree_trait_expr): Add locus field.
468         (enum tsubst_flags): Add tf_norm as a hint to generate normalization
469         context when diagnosing constraint failure.
470         * cp-tree.def: Remove unused _CONSTR nodes and rename PRED_CONSTR
471         to ATOMIC_CONSTR.
472         (CONCEPT_DECL): New.
473         * cxx-pretty-print.c: Remove constraint printing code.
474         (pp_cxx_concept_definition): New.
475         (pp_cxx_template_declaration): Print concept definitions.
476         (pp_cxx_check_constraint): Update printing for concept definitions.
477         (pp_cxx_nested_name_specifier): Fix a weird
478         case where we're printing '::::' for concepts.
479         (simple_type_specifier): Print requirements for placeholder types.
480         (pp_cxx_constrained_type_spec): Print the associated requirements of
481         a placeholder type.
482         (pp_cxx_compound_requirement): Add space before the '->'.
483         (pp_cxx_parameter_mapping): Print the parameter mapping.
484         (pp_cxx_atomic_constraint): Use the function above.
485         * decl.c (redeclaration_error_message): New error for concepts.
486         (grokdeclarator): Check for and disallow decltype(auto) in parameter
487         declarations.
488         (grokfndecl): Don't normalize constraints. Add check for constraints
489         on declaration.
490         (grokvardecl): Don't normalize constraints.
491         (grok_special_member_properties): Don't set TYPE_HAS_COMPLEX_*.
492         (function_requirements_equivalent_p): New. Compare trailing
493         requires clauses. Compare combined constraints in pre-C++20 mode.
494         (decls_match): Compare trailing requires clauses. Compare template
495         heads for function templates. Remove old constraint comparison.
496         Simplify comparison of functions, function templates.
497         (duplicate_function_template_decls): New. Refactor a nasty if
498         condition into a single predicate.
499         (require_deduced_type): Don't complain if we already complained about
500         deduction failure.
501         (finish_function): Perform auto deduction to ensure that constraints
502         are checked even when functions contain no return statements. Only do
503         auto deduction if we haven't previously seen any return statements.
504         This prevents multiple diagnostics of the same error.
505         (store_decomp_type): Remove.
506         (cp_finish_decomp): Use hash_map_safe_put.
507         * error.c: Remove constraint printing code.
508         (dump_decl): Dump concept definitions. Handle wildcard declarations.
509         (dump_template_decl): Likewise.
510         (dump_type): Print associated requirements for placeholder
511         types.
512         (rebuild_concept_check): New.
513         (maybe_print_single_constraint_context): New.
514         (maybe_print_constraint_context): Recursively print nested contexts.
515         * init.c (get_nsdmi): Use hash_map_safe_*.
516         * lambda.c (maybe_add_lambda_conv_op): Bail if deduction failed.
517         (add_capture): Copy parameter packs from init.
518         (lambda_capture_field_type): Always use auto for init-capture.
519         * logic.cc: Completely rewrite.
520         (constraint_hash): New.
521         (clause/ctor): Save atoms in the hash table.
522         (replace): Save atoms during replacement.
523         (insert): Save atoms during insertion.
524         (contains): Only search the hash table for containment.
525         (clause): Keep a hash of atomic constraints.
526         (clause::clause): Explicitly copy the hash table when copying.
527         (disjunction_p, conjunction_p, atomic_p, dnf_size, cnf_size): New.
528         (diagnose_constraint_size): New.
529         (subsumes_constraints_nonnull): Compare the sizes of normalized formula
530         to determine the cheapest decomposition.
531         * name-lookup.c (diagnose_name_conflict): Diagnose name issues with
532         concepts.
533         (matching_fn_p): Check constraints.
534         (push_class_level_binding_1): Move overloaded functions case down,
535         accept FUNCTION_DECL as target_decl.
536         * parser.c (enum required_token): New required token for auto.
537         (make_location): Add overload taking lexer as last parm.
538         (cp_parser_required_error): Diagnose missing auto.
539         (cp_parser_diagnose_ungrouped_constraint_plain): New.
540         (cp_parser_diagnose_ungrouped_constraint_plain): New.
541         (cp_parser_constraint_primary_expression): New. Tentatively parse the
542         primary expression. If that fails tentatively parse a lower
543         precedence expression in order to diagnose the error.
544         (cp_parser_check_non_logical_constraint): New. Performs a trial
545         parse of the right-hand-side of non-logical operators in order to
546         generate good diagnostics.
547         (cp_parser_constraint_logical_and_expression): New.
548         (cp_parser_constraint_logical_or_expression): New.
549         (cp_parser_requires_clause_expression): New.
550         (cp_parser_requires_clause): Renamed to cp_parser_constraint_expression.
551         (cp_parser_requires_clause_opt): Parse the requires-clause differently
552         in -fconcepts and -std=c++2a modes.
553         (cp_parser_requirement_list): Rename to cp_parser_requirement_seq.
554         Rewrite so that semicolons are parsed
555         along with requirements, not the sequence.
556         (cp_parser_simple_requirement): Expect a semicolon at end.
557         (cp_parser_compound_requirement): Expect a semicolon at end. Only
558         allow trailing-return-type with -fconcepts-ts.
559         (cp_parser_nested_requirement): Expect a semicolon at end. Parse
560         constraint-expressions.
561         (cp_parser_concept_definition): New. Don't fail parsing the concept
562         definition if the initializer is ill-formed. Don't declare the concept
563         before parsing the initializer.
564         (cp_parser_constraint_expression): Declare earlier.
565         (cp_parser_type_requirement): Current scope is not valid.
566         (cp_parser_requires_expression): Commit to the tentative parse.
567         (cp_parser_decl_specifier_seq): Warn when concept appears to be used
568         as a decl-specifier.
569         (cp_parser_template_declaration_after_parameters): Parse concept
570         definitions.
571         (cp_parser_template_id): Don't try to resolve a concept template-id yet.
572         (cp_parser_template_id_expr): Resolve it as a concept check.
573         (cp_parser_decl_specifier_seq): Warn on 'concept bool'.
574         (cp_parser_type_parameter): Combine expressions not
575         constraints.
576         (cp_parser_explicit_template_declaration): Combine expressions not
577         constraints.
578         (cp_parser_maybe_concept_name): Removed.
579         (cp_parser_simple_type_specifier): Handle an error condition of
580         a bad constrained type specifier. Expect auto or decltype after
581         a concept name. Also handle the case where we have a template-id
582         as a concept check.
583         (cp_parser_template_introduction): Diagnose errors on invalid
584         introductions. Give up if it doesn't start with a concept name.
585         Pedwarn if not -fconcepts-ts.
586         (synthesize_implicit_template_parm): Don't do consistent binding.
587         Use a new flag for constrained parameters. Combine expressions,
588         not constraints. Fail if we get a placeholder in block scope.
589         Placeholders that do not constrain types are not allowed in parameter
590         declarations, so don't handle them.
591         (cp_parser_placeholder_type_specifier): New. Implement parsing of
592         placeholder type specifiers following a concept name or partial
593         concept check. Disallow decltype(auto) parameters.
594         (cp_parser_nested_name_specifier_opt): If the token is already
595         CPP_NESTED_NAME_SPECIFIER, leave it alone.
596         (cp_parser_id_expression, cp_parser_unqualified_id): Call
597         cp_parser_template_id_expr.
598         (cp_parser_placeholder_type_specifier): Add tentative parm.  Don't
599         expect a WILDCARD_DECL.
600         (cp_parser_trait_expr): Pass trait_loc down.
601         (cp_parser_postfix_expression): Do set location of dependent member
602         call.
603         * pt.c (finish_concept_definition): New.
604         (push_template_decl_real): Handle concept definitions.
605         (start_concept_definition): Let push_template_decl_real handle the
606         creation of the template.
607         (get_constraints): Return null if the table hasn't been initialized.
608         (tsubst_copy_and_build): Build template-id expressions for concept
609         checks.
610         [TRAIT_EXPR]: Pass trait_loc down.
611         (lookup_template_class_1): Add the template name to the constraint
612         failure diagnostic.
613         (lookup_and_finish_template_variable): Build concept checks
614         with the correct arguments.
615         (tsubst_function_decl): Don't substitute through constraints.
616         Always associate constraints with functions.
617         (template_parm_level_and_index): Make non-static.
618         (for_each_template_parm_r): Handle requires expressions.
619         (keep_template_parm): New.
620         (find_template_parameters): New.
621         (more_specialized_fn): Change how winners and losers are chosen.
622         (make_constrained_auto): Don't normalize constraints.
623         (template_parameters_equivalent_p): New. Compare template
624         parameters. Add a comparison for implicitly vs. explicitly declared
625         parameters.
626         (template_parameter_lists_equivalent_p): New. Compare template
627         parameter lists.
628         (template_requirements_equivalent_p): New.
629         (template_heads_equivalent_p): New. Compare template heads.
630         (template_parameter_constraints_equivalent_p): New.
631         (is_compatible_template_arg): Use weakly_subsumes.
632         (maybe_new_partial_specialization): Use new constraint comparison
633         for finding specializations.
634         (process_partial_specialization): Pass main template as argument.
635         (more_specialized_partial_spec): Don't immediately return when
636         detecting a winner.
637         (make_constrained_auto): Handle concept definitions.
638         (do_auto_deduction): Update auto deduction for new concept model.
639         Extract the function concept correctly; rename constr to check to
640         reflect the kind of node.
641         (tsubst): Adjust wildcard argument during substitution.
642         [DECLTYPE_TYPE]: Remove init-capture handling.
643         (tsubst_copy_and_build): Build concept checks, not template ids.
644         Defer checks of function concepts. Handle concepts before variable
645         templates. Handle calls to function concepts explicitly.
646         (coerce_template_parms): Use concept_definition_p. Handle a deduction
647         error where a potentially empty pack can be supplied after the last
648         parameter of a concept.
649         (finish_template_variable): Don't process concepts here.
650         (instantiation_dependent_r): Use concept_check_p.
651         (tsubst_template_args): Make non-static.
652         (make_constrained_placeholder_type): New. Refactored from
653         make_constrained_auto.
654         (make_constrained_auto) Use make_constrained_placeholder_type.
655         (make_constrained_decltype_auto) New.
656         (tsubst_function_parms): New.
657         (value_dependent_expression_p) [TEMPLATE_ID_EXPR]: Use
658         concept_definition_p.
659         (push_access_scope, pop_access_scope): No longer static.
660         (tsubst_template_parm): Substitute TEMPLATE_PARM_CONSTRAINTS.
661         (tsubst_friend_function): Use tsubst_constraint. Use generic_targs_for.
662         (get_underlying_template) Use generic_targs_for.
663         (uses_parameter_packs): Return tree.
664         (gen_elem_of_pack_expansion_instantiation): Don't push
665         local_specialization_stack.
666         (prepend_one_capture): New.
667         (tsubst_lambda_expr): Use prepend_one_capture.  Don't touch
668         local_specializations.
669         (template_parms_level_to_args): No longer static.
670         (add_outermost_template_args): Likewise.
671         (find_template_parameter_info): New. Provide context for finding
672         template parameters.
673         (keep_template_parm): Don't keep parameters declared at depth levels
674         greater than those of the template parameters of the source declaration.
675         Don't propagate cv-qualified types. Return 0, so we find all template
676         parameters, not the just first.
677         (any_template_parm_r): New. Handle cases that are mishandled by
678         for_each_template_parm_r.
679         (generic_targs_for): Factor out of coerce_template_args_for_ttp.
680         (tsubst_argument_pack): Factor out of tsubst_template_args.
681         (constraint_sat_entry): Removed.
682         (constraint_sat_hasher): Removed.
683         (concept_spec_entry): Removed.
684         (concept_spec_hasher): Removed.
685         (constraint_memos): Removed.
686         (concept_memos): Removed.
687         (lookup_constraint_satisfaction): Removed.
688         (memoize_constraint_satisfaction): Removed.
689         (lookup_concept_satisfaction): Removed.
690         (memoize_concept_satisfaction): Removed.
691         (concept_expansions): Removed.
692         (get_concept_expansion): Removed.
693         (save_concept_expansion): Removed.
694         (init_constraint_processing): Remove initialization of non-existing
695         resources.
696         (find_template_requirement): New. Search for the sub-requirement
697         within the associated constraints.
698         (convert_generic_types_to_packs): Also transform the associated
699         constraint and update the current template requirements.
700         (store_defaulted_ttp, lookup_defaulted_ttp): Remove.
701         (add_defaults_to_ttp): Use hash_map_safe_*.
702         * semantics.c (finish_call_expr): Diagnose calls to concepts.
703         Handle concept checks explicitly.
704         (finish_id_expression): Evaluate variable concepts as part of
705         id-expression processing. Don't treat variable concepts as variables,
706         and don't process function concepts as plain id-expressions.
707         (force_paren_expr): Add even_uneval parm.
708         (finish_trait_expr): Add location parm.
709         * tree.c (special_memfn_p): New.
710         (cp_expr_location): Handle TRAIT_EXPR.
711         * typeck.c (check_return_expr): Actually use the diagnostic kind
712         when performing return-type deduction.
713         * typeck2.c (build_functional_cast): Don't rely on the location of
714         'auto'.
716 2019-10-09  Paolo Carlini  <paolo.carlini@oracle.com>
718         * decl.c (grok_ctor_properties): Use DECL_SOURCE_LOCATION.
719         * typeck.c (cp_build_binary_op): Use the op_location_t argument
720         in many error messages.
722 2019-10-08  Martin Sebor  <msebor@redhat.com>
724         PR c++/92001
725         * call.c (maybe_warn_class_memaccess): Handle arrays.
727 2019-10-07  Paolo Carlini  <paolo.carlini@oracle.com>
729         * call.c (resolve_args): Use cp_expr_loc_or_input_loc in one place.
730         * decl.c (grokdeclarator): Use id_loc in one place.
731         * decl2.c (build_anon_union_vars): Use DECL_SOURCE_LOCATION.
732         * parser.c (cp_parser_delete_expression): Fix the location of the
733         returned expression.
734         (cp_parser_throw_expression): Likewise.
735         * pt.c (determine_specialization): Use DECL_SOURCE_LOCATION.
737 2019-10-05  Jakub Jelinek  <jakub@redhat.com>
739         PR c++/91369 - Implement P0784R7: constexpr new
740         * cp-tree.h (enum cp_tree_index): Add CPTI_HEAP_UNINIT_IDENTIFIER,
741         CPTI_HEAP_IDENTIFIER and CPTI_HEAP_DELETED_IDENTIFIER.
742         (heap_uninit_identifier, heap_identifier, heap_deleted_identifier):
743         Define.
744         (type_has_constexpr_destructor, build_new_constexpr_heap_type,
745         cxx_constant_dtor): Declare.
746         * class.c (type_maybe_constexpr_default_constructor): Make static.
747         (type_maybe_constexpr_destructor, type_has_constexpr_destructor): New
748         functions.
749         (finalize_literal_type_property): For c++2a, don't clear
750         CLASSTYPE_LITERAL_P for types without trivial destructors unless they
751         have non-constexpr destructors.
752         (explain_non_literal_class): For c++2a, complain about non-constexpr
753         destructors rather than about non-trivial destructors.
754         * constexpr.c: Include stor-layout.h.
755         (struct constexpr_global_ctx): New type.
756         (struct constexpr_ctx): Add global field, remove values and
757         constexpr_ops_count.
758         (cxx_replaceable_global_alloc_fn): New inline function.
759         (cxx_eval_call_expression): For c++2a allow calls to replaceable
760         global allocation functions, for new return address of a heap uninit
761         var, for delete record its deletion.  Change ctx->values->{get,put} to
762         ctx->global->values.{get,put}.
763         (non_const_var_error): Add auto_diagnostic_group sentinel.  Emit
764         special diagnostics for heap variables.
765         (cxx_eval_store_expression): Change ctx->values->{get,put} to
766         ctx->global->values.{get,put}.
767         (cxx_eval_loop_expr): Initialize jump_target if NULL.  Change
768         new_ctx.values->remove to ctx->global->values.remove.
769         (cxx_eval_constant_expression): Change *ctx->constexpr_ops_count
770         to ctx->global->constexpr_ops_count.  Change ctx->values->{get,put} to
771         ctx->global->values.{get,put}.
772         <case NOP_EXPR>: Formatting fix.  On cast of replaceable global
773         allocation function to some pointer type, adjust the type of
774         the heap variable and change name from heap_uninit_identifier
775         to heap_identifier.
776         (find_heap_var_refs): New function.
777         (cxx_eval_outermost_constant_expr): Add constexpr_dtor argument,
778         handle evaluation of constexpr dtors and add tracking of heap
779         variables.  Use tf_no_cleanup for get_target_expr_with_sfinae.
780         (cxx_constant_value): Adjust cxx_eval_outermost_constant_expr caller.
781         (cxx_constant_dtor): New function.
782         (maybe_constant_value, fold_non_dependent_expr_template,
783         maybe_constant_init_1): Adjust cxx_eval_outermost_constant_expr
784         callers.
785         (potential_constant_expression_1): Ignore clobbers.  Allow
786         COND_EXPR_IS_VEC_DELETE for c++2a.
787         * decl.c (initialize_predefined_identifiers): Add heap identifiers.
788         (decl_maybe_constant_destruction): New function.
789         (cp_finish_decl): Don't clear TREE_READONLY for constexpr variables
790         with non-trivial, but constexpr destructors.
791         (register_dtor_fn): For constexpr variables with constexpr non-trivial
792         destructors call cxx_maybe_build_cleanup instead of adding destructor
793         calls at runtime.
794         (expand_static_init): For constexpr variables with constexpr
795         non-trivial destructors call cxx_maybe_build_cleanup.
796         (grokdeclarator): Allow constexpr destructors for c++2a.  Formatting
797         fix.
798         (cxx_maybe_build_cleanup): For constexpr variables with constexpr
799         non-trivial destructors call cxx_constant_dtor instead of adding
800         destructor calls at runtime.
801         * init.c: Include stor-layout.h.
802         (build_new_constexpr_heap_type, maybe_wrap_new_for_constexpr): New
803         functions.
804         (build_new_1): For c++2a and new[], add cast around the alloc call
805         to help constexpr evaluation figure out the type of the heap storage.
806         (build_vec_delete_1): Set DECL_INITIAL of tbase and emit a DECL_EXPR
807         for it instead of initializing an uninitialized variable.
808         * method.c: Include intl.h.
809         (SFK_CTOR_P, SFK_DTOR_P, SFK_ASSIGN_P, SFK_COPY_P, SFK_MOVE_P): Move
810         definitions earlier.
811         (process_subob_fn): Add sfk argument, adjust non-constexpr call
812         diagnostics based on it.
813         (walk_field_subobs): Formatting fixes.  Adjust process_subob_fn caller.
814         (synthesized_method_base_walk): Likewise.
815         (synthesized_method_walk): Set *constexpr_p to true for dtors in c++2a.
816         Fix up DR number in comment.
817         (implicitly_declare_fn): Formatting fix.
818         * typeck2.c (store_init_value): Don't call cp_fully_fold_init on
819         initializers of automatic non-constexpr variables in constexpr
820         functions.
822 2019-10-04  Jakub Jelinek  <jakub@redhat.com>
824         PR c++/71504
825         * constexpr.c (cxx_fold_indirect_ref_1): New function.
826         (cxx_fold_indirect_ref): Use it.
828         PR c++/91974
829         * cp-gimplify.c (cp_gimplify_expr) <case CALL_EXPR>: For
830         -fstrong-eval-order ensure CALL_EXPR_FN side-effects are evaluated
831         before any arguments.  Additionally, ensure CALL_EXPR_FN that isn't
832         invariant nor OBJ_TYPE_REF nor SSA_NAME is forced into a temporary.
834 2019-10-03  Paolo Carlini  <paolo.carlini@oracle.com>
836         * init.c (build_new): Use cp_expr_loc_or_input_loc in two places.
837         * name-lookup.c (do_pushdecl): Use DECL_SOURCE_LOCATION.
838         (push_class_level_binding_1): Likewise.
839         (set_decl_namespace): Likewise.
841 2019-10-03  Jakub Jelinek  <jakub@redhat.com>
843         * constexpr.c (cxx_eval_constant_expression) <case CLEANUP_STMT>: If
844         not skipping upon entry to body, run cleanup with the same *jump_target
845         as it started to run the cleanup even if the body returns, breaks or
846         continues.
847         (potential_constant_expression_1): Allow CLEANUP_STMT.
849         * constexpr.c (cxx_eval_store_expression): Formatting fix.  Handle
850         const_object_being_modified with array type.
852 2019-10-02  Jason Merrill  <jason@redhat.com>
854         * typeck2.c (store_init_value): Only clear_cv_and_fold_caches if the
855         value is constant.
857 2019-09-30  Jason Merrill  <jason@redhat.com>
859         Use hash_map_safe_* functions.
860         * constexpr.c (maybe_initialize_fundef_copies_table): Remove.
861         (get_fundef_copy): Use hash_map_safe_get_or_insert.
862         * cp-objcp-common.c (cp_get_debug_type): Use hash_map_safe_*.
863         * decl.c (store_decomp_type): Remove.
864         (cp_finish_decomp): Use hash_map_safe_put.
865         * init.c (get_nsdmi): Use hash_map_safe_*.
866         * pt.c (store_defaulted_ttp, lookup_defaulted_ttp): Remove.
867         (add_defaults_to_ttp): Use hash_map_safe_*.
869 2019-10-02  Richard Biener  <rguenther@suse.de>
871         PR c++/91606
872         * decl.c (build_ptrmemfunc_type): Mark pointer-to-member
873         fat pointer structure members as DECL_NONADDRESSABLE_P.
875 2019-09-28  Marek Polacek  <polacek@redhat.com>
877         PR c++/91889 - follow-up fix for DR 2352.
878         * call.c (involves_qualification_conversion_p): New function.
879         (direct_reference_binding): Build a ck_qual if the conversion
880         would involve a qualification conversion.
881         (convert_like_real): Strip the conversion created by the ck_qual
882         in direct_reference_binding.
884         PR c++/91921 - stray warning with -Woverloaded-virtual.
885         * class.c (warn_hidden): Only emit the second part of
886         -Woverloaded-virtual if the first part was issued.  Use inform instead
887         warning_at.
889         PR c++/91923 - failure-to-SFINAE with class type NTTP in C++17.
890         * pt.c (invalid_nontype_parm_type_p): Only emit errors when
891         tf_error.
893 2019-09-27  Jakub Jelinek  <jakub@redhat.com>
895         PR c++/88203
896         * parser.c (cp_parser_omp_var_list_no_open): Parse predefined
897         variables.
898         * semantics.c (finish_omp_clauses): Allow predefined variables in
899         shared and firstprivate clauses, even when they are predetermined
900         shared.
901         * cp-gimplify.c (cxx_omp_predetermined_sharing_1): Return
902         OMP_CLAUSE_DEFAULT_SHARED for predefined variables.
904 2019-09-27  Jason Merrill  <jason@redhat.com>
906         * constexpr.c (cxx_fold_indirect_ref): Use similar_type_p.
907         (cxx_eval_indirect_ref): Likewise.  Improve error location.
909         * cp-tree.h (class iloc_sentinel): New.
910         * decl.c (grokdeclarator, finish_enum_value_list): Use it.
911         * mangle.c (mangle_decl_string): Use it.
912         * pt.c (perform_typedefs_access_check): Use it.
914 2019-09-27  Richard Sandiford  <richard.sandiford@arm.com>
916         * cp-tree.h (build_cxx_call): Take the original function decl
917         as an optional final parameter.
918         (cp_build_function_call_vec): Likewise.
919         * call.c (build_cxx_call): Likewise.  Pass all built-in calls to
920         check_builtin_function_arguments.
921         * typeck.c (build_function_call_vec): Take the original function
922         decl as an optional final parameter and pass it to
923         cp_build_function_call_vec.
924         (cp_build_function_call_vec): Take the original function
925         decl as an optional final parameter and pass it to build_cxx_call.
927 2019-09-25  Marek Polacek  <polacek@redhat.com>
929         PR c++/91877 - ICE with converting member of packed struct.
930         * call.c (convert_like_real): Use similar_type_p in an assert.
932 2019-09-25  Paolo Carlini  <paolo.carlini@oracle.com>
934         * name-lookup.c (check_extern_c_conflict): Use DECL_SOURCE_LOCATION.
935         (check_local_shadow): Use it in three additional places.
937 2019-09-24  Jason Merrill  <jason@redhat.com>
939         * parser.c (cp_parser_postfix_expression): Do set location of
940         dependent member call.
942 2019-09-24  Marek Polacek  <polacek@redhat.com>
944         PR c++/91868 - improve -Wshadow location.
945         * name-lookup.c (check_local_shadow): Use DECL_SOURCE_LOCATION
946         instead of input_location.
948         PR c++/91845 - ICE with invalid pointer-to-member.
949         * expr.c (mark_use): Use error_operand_p.
950         * typeck2.c (build_m_component_ref): Check error_operand_p after
951         calling mark_[lr]value_use.
953 2019-09-23  Paolo Carlini  <paolo.carlini@oracle.com>
955         * pt.c (check_explicit_specialization): Use cp_expr_loc_or_input_loc.
956         (process_partial_specialization): Likewise.
957         (convert_nontype_argument_function): Likewise.
958         (invalid_tparm_referent_p): Likewise.
959         (convert_template_argument): Likewise.
960         (check_valid_ptrmem_cst_expr): Tidy.
962 2019-09-23  Jason Merrill  <jason@redhat.com>
964         PR c++/91809 - bit-field and ellipsis.
965         * call.c (convert_arg_to_ellipsis): Don't call decay_conversion for
966         arithmetic arguments.
968 2019-09-23  Marek Polacek  <polacek@redhat.com>
970         PR c++/91844 - Implement CWG 2352, Similar types and reference binding.
971         * call.c (reference_related_p): Use similar_type_p instead of
972         same_type_p.
973         (reference_compatible_p): Update implementation to match CWG 2352.
974         * cp-tree.h (similar_type_p): Declare.
975         * typeck.c (similar_type_p): New.
977 2019-09-22  Marek Polacek  <polacek@redhat.com>
979         PR c++/91819 - ICE with operator++ and enum.
980         * call.c (build_new_op_1): Set arg2_type.
982 2019-09-17  Jason Merrill  <jason@redhat.com>
984         * parser.c (cp_parser_statement): Handle [[likely]] on
985         compound-statement.
987 2019-09-19  Jason Merrill  <jason@redhat.com>
989         Revert:
990         * call.c (build_new_op_1): Don't apply any standard conversions to
991         the operands of a built-in operator.  Don't suppress conversions in
992         cp_build_unary_op.
993         * typeck.c (cp_build_unary_op): Do integral promotions for enums.
995 2019-09-16  Paolo Carlini  <paolo.carlini@oracle.com>
997         * decl.c (grokdeclarator): Use declspecs->locations and
998         declarator->id_loc in a few error messages.
999         * pt.c (finish_member_template_decl): Use DECL_SOURCE_LOCATION.
1000         (push_template_decl_real): Likewise.
1002 2019-09-15  Jason Merrill  <jason@redhat.com>
1004         PR c++/30277 - int-width bit-field promotion.
1005         PR c++/33819 - long bit-field promotion.
1006         * typeck.c (cp_perform_integral_promotions): Handle large bit-fields
1007         properly.  Handle 32-bit non-int bit-fields properly.
1008         (is_bitfield_expr_with_lowered_type): Don't look through NOP_EXPR.
1010         PR c++/82165 - enum bitfields and operator overloading.
1011         * call.c (build_new_op_1): Use unlowered_expr_type.
1013         * call.c (build_new_op_1): Don't apply any standard conversions to
1014         the operands of a built-in operator.  Don't suppress conversions in
1015         cp_build_unary_op.
1016         * typeck.c (cp_build_unary_op): Do integral promotions for enums.
1018 2019-09-15  Marek Polacek  <polacek@redhat.com>
1020         PR c++/91740 - ICE with constexpr call and ?: in ARRAY_REF.
1021         * pt.c (build_non_dependent_expr): Call build_non_dependent_expr for
1022         the first operand.
1024 2019-09-15  Nathan Sidwell  <nathan@acm.org>
1026         * cp-tree.h (DECL_CLONED_FUNCTION_P): Reimplement using
1027         IDENTIFIER_CDTOR_P, correct documentation.
1028         (DECL_CLONED_FUNCTION): Directly access field.
1029         (decl_cloned_function_p): Delete.
1030         * class.c (decl_cloned_function_p): Delete.
1031         * pt.c (instantiate_template_1): Check DECL_CHAIN is a decl.
1033 2019-09-11  Nathan Sidwell  <nathan@acm.org>
1035         * c-objcp-common.c (cp-objcp-common.c): Alphababetize and
1036         correctly mark all C++ nodes.
1037         * decl.c (cp_tree_node_structure): Alphabetize.
1039 2019-09-10  Marek Polacek  <polacek@redhat.com>
1041         PR c++/91673 - ICE with noexcept in alias-declaration.
1042         * parser.c (CP_PARSER_FLAGS_DELAY_NOEXCEPT): New parser flag.
1043         (cp_parser_lambda_declarator_opt): Pass CP_PARSER_FLAGS_NONE to
1044         cp_parser_exception_specification_opt.
1045         (cp_parser_direct_declarator): Adjust a call to
1046         cp_parser_exception_specification_opt.
1047         (cp_parser_member_declaration): Pass CP_PARSER_FLAGS_DELAY_NOEXCEPT
1048         to cp_parser_declarator if not processing a friend or typedef
1049         declaration.
1050         (cp_parser_late_noexcept_specifier): Adjust a call to
1051         cp_parser_noexcept_specification_opt.
1052         (cp_parser_noexcept_specification_opt): New parameter for parser flags,
1053         drop the FRIEND_P parameter.  Use the new parameter.
1054         (cp_parser_exception_specification_opt): Likewise.
1055         (cp_parser_transaction): Adjust a call to
1056         cp_parser_noexcept_specification_opt.
1057         (cp_parser_transaction_expression): Likewise.
1059 2019-09-10  Marek Polacek  <polacek@redhat.com>
1061         PR c++/91705 - constexpr evaluation rejects ++/-- on floats.
1062         * constexpr.c (cxx_eval_increment_expression): Call fold_simple on
1063         the offset.
1065 2019-09-10  Paolo Carlini  <paolo.carlini@oracle.com>
1067         * decl.c (has_designator_problem): Use cp_expr_loc_or_input_loc
1068         in error_at.
1069         (build_enumerator): Likewise.
1070         (cp_finish_decl): Use DECL_SOURCE_LOCATION.
1071         (grokdeclarator): Use id_loc in two error_at; change errror
1072         message about constinit together constexpr to use two ranges.
1074 2019-09-09  Marek Polacek  <polacek@redhat.com>
1076         PR c++/84374 - diagnose invalid uses of decltype(auto).
1077         * decl.c (grokdeclarator): Diagnose wrong usage of decltype(auto) in
1078         a function declaration.
1080 2019-09-06  Nathan Sidwell  <nathan@acm.org>
1082         PR c++/91125
1083         * cp-tree.h (IDENTIFIER_REPO_CHOSEN, DECL_REPO_AVAILABLE_P): Delete.
1084         (struct lang_decl_base): Remove repo_available_p.
1085         * decl.c (duplicate_decls): Don't copy DECL_REPO_AVAILABLE_P.
1087         (Reserve TREE_LANG_FLAG_3 for modules.
1088         * cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): Delete.
1089         (DECL_NON_TRIVIALLY_INITIALIZED_P): Move to TREE_LANG_FLAG_6.
1090         * class.c (build_ctor_vtbl_group): Don't set
1091         DECL_CONSTRUCTION_VTABLE_P.
1092         * decl2.c (determine_visibility_from_class): Don't check
1093         DECL_CONSTRUCTION_VTABLE_P anymore.
1095 2019-09-06  Martin Liska  <mliska@suse.cz>
1097         PR c++/91125
1098         * Make-lang.in: Remove repo.o.
1099         * config-lang.in: Likewise.
1100         * cp-tree.h (init_repo): Remove declarations
1101         of repo-related functions.
1102         (repo_emit_p): Likewise.
1103         (repo_export_class_p): Likewise.
1104         (finish_repo): Likewise.
1105         * decl2.c (import_export_class): Always
1106         set -1 value/
1107         (mark_needed): Remove -frepo from comment.
1108         (import_export_decl): Similarly here.
1109         (c_parse_final_cleanups): Remove call of finish_repo.
1110         * lex.c (cxx_init): Remove call to init_repo.
1111         * optimize.c (can_alias_cdtor): Remove dead condition.
1112         * pt.c (push_template_decl_real): Update comment.
1113         (instantiate_decl): Remove dead code used for -frepo.
1114         * repo.c: Remove.
1116 2019-09-05  Marek Polacek  <polacek@redhat.com>
1118         PR c++/91644 - ICE with constinit in function template.
1119         * decl.c (start_decl): Call retrofit_lang_decl for constinit variables.
1120         * pt.c (tsubst_expr): Pass LOOKUP_CONSTINIT down to cp_finish_decl for
1121         constinit variables.
1123 2019-09-05  Nathan Sidwell  <nathan@acm.org>
1125         * cp-tree.h (DECL_VTABLE_OR_VTT_P): Forward to DECL_VIRTUAL_P.
1127 2019-09-04  Marek Polacek  <polacek@redhat.com>
1129         * call.c (build_over_call): Remove -fdeduce-init-list implementation.
1130         * pt.c (unify): Likewise.
1132 2019-09-01  Marek Polacek  <polacek@redhat.com>
1134         PR c++/91129 - wrong error with binary op in template argument.
1135         * typeck.c (warn_for_null_address): Use fold_for_warn instead of
1136         fold_non_dependent_expr.
1137         (cp_build_binary_op): Likewise.
1139 2019-08-30  Jason Merrill  <jason@redhat.com>
1141         Add source location to TRAIT_EXPR.
1142         * cp-tree.h (TRAIT_EXPR_LOCATION): New.
1143         (struct tree_trait_expr): Add locus field.
1144         * parser.c (cp_parser_trait_expr): Pass trait_loc down.
1145         * pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Likewise.
1146         * semantics.c (finish_trait_expr): Add location parm.
1147         * tree.c (cp_expr_location): Handle TRAIT_EXPR.
1149 2019-08-29  Paolo Carlini  <paolo.carlini@oracle.com>
1151         * decl.c (check_var_type): Add location_t parameter and use it.
1152         (grokdeclarator): Adjust call.
1153         * pt.c (tsubst_decl): Likewise.
1154         * cp-tree.h: Adjust declaration.
1156 2019-08-28  Marek Polacek  <polacek@redhat.com>
1158         Implement P1152R4: Deprecating some uses of volatile.
1159         PR c++/91361
1160         * cp-gimplify.c (cp_fold): Set TREE_THIS_VOLATILE.
1161         * decl.c (grokdeclarator): Warn about a volatile-qualified structured
1162         binding and return type.
1163         (grokparms): Warn about a volatile-qualified function parameter.
1164         * expr.c (mark_use) <case MODIFY_EXPR>: Emit a -Wvolatile warning.
1165         * typeck.c (cp_build_unary_op): Emit a -Wvolatile warning for pre and
1166         post ++/-- on a volatile operand.
1167         (genericize_compound_lvalue): Use a better location.  Don't lose
1168         TREE_THIS_VOLATILE.
1169         (cp_build_modify_expr): Emit a -Wvolatile warning for a compound
1170         assignment whose LHS is volatile-qualified.  Build the assignment with
1171         a more precise location.
1173 2019-08-28  Marek Polacek  <polacek@redhat.com>
1175         PR c++/91360 - Implement C++20 P1143R2: constinit.
1176         * cp-tree.h (TINFO_VAR_DECLARED_CONSTINIT): Define.
1177         (LOOKUP_CONSTINIT): Define.
1178         (enum cp_decl_spec): Add ds_constinit.
1179         * decl.c (check_tag_decl): Give an error for constinit in type
1180         declarations.
1181         (check_initializer): Also check LOOKUP_CONSTINIT.
1182         (cp_finish_decl): Add checking for a constinit declaration.  Set
1183         TINFO_VAR_DECLARED_CONSTINIT.
1184         (grokdeclarator): Add checking for a declaration with the constinit
1185         specifier.
1186         * lex.c (init_reswords): Handle D_CXX20.
1187         * parser.c (cp_lexer_get_preprocessor_token): Pass a better location
1188         to warning_at.  Warn about C++20 keywords.
1189         (cp_keyword_starts_decl_specifier_p): Handle RID_CONSTINIT.
1190         (cp_parser_diagnose_invalid_type_name): Add an inform about constinit.
1191         (cp_parser_decomposition_declaration): Maybe pass LOOKUP_CONSTINIT to
1192         cp_finish_decl.
1193         (cp_parser_decl_specifier_seq): Handle RID_CONSTINIT.
1194         (cp_parser_init_declarator): Maybe pass LOOKUP_CONSTINIT to
1195         cp_finish_decl.
1196         (set_and_check_decl_spec_loc): Add "constinit".
1197         * pt.c (tsubst_decl): Set TINFO_VAR_DECLARED_CONSTINIT.
1198         (instantiate_decl): Maybe pass LOOKUP_CONSTINIT to cp_finish_decl.
1199         * typeck2.c (store_init_value): If a constinit variable wasn't
1200         initialized using a constant initializer, give an error.
1202 2019-08-28  Nathan Sidwell  <nathan@acm.org>
1204         PR c++/90613
1205         * name-lookup.c (cp_emit_debug_info): Check for builtins during
1206         overload iteration.
1208 2019-08-27  Marek Polacek  <polacek@redhat.com>
1210         PR c++/81676 - bogus -Wunused warnings in constexpr if.
1211         * semantics.c (maybe_mark_exp_read_r): New function.
1212         (finish_if_stmt): Call it on THEN_CLAUSE and ELSE_CLAUSE.
1214         PR c++/91428 - warn about std::is_constant_evaluated in if constexpr.
1215         * cp-tree.h (decl_in_std_namespace_p): Declare.
1216         * semantics.c (is_std_constant_evaluated_p): New.
1217         (finish_if_stmt_cond): Warn about "std::is_constant_evaluated ()" in
1218         an if-constexpr.
1219         * typeck.c (decl_in_std_namespace_p): No longer static.
1221 2019-08-26  Jason Merrill  <jason@redhat.com>
1223         * decl.c (duplicate_decls): Always merge DECL_DECLARED_CONSTEXPR_P.
1225 2019-08-26  Marek Polacek  <polacek@redhat.com>
1227         PR c++/91545 - ICE in constexpr store evaluation.
1228         * constexpr.c (cxx_eval_store_expression): Check FIELD_DECL instead
1229         of DECL_P.
1231 2019-08-24  Nathan Sidwell  <nathan@acm.org>
1233         * class.c (check_for_overrides): Conversion operators need
1234         checking too.
1236 2019-08-24  Paolo Carlini  <paolo.carlini@oracle.com>
1238         * semantics.c (finish_switch_cond): Improve error message location.
1240 2019-08-23  Jason Merrill  <jason@redhat.com>
1242         * decl2.c (decl_dependent_p): New.
1243         (mark_used): Check it instead of just processing_template_decl.
1245 2019-08-23  Jason Merrill  <jason@redhat.com>
1247         * parser.c (cp_parser_nested_name_specifier_opt): Avoid redundant
1248         error.
1250 2019-08-23  Marek Polacek  <polacek@redhat.com>
1252         PR c++/91521 - wrong error with operator->.
1253         * decl.c (grokdeclarator): Return error_mark_node for an invalid
1254         trailing return type.
1256         PR c++/79817 - attribute deprecated on namespace.
1257         * cp-tree.h (cp_warn_deprecated_use_scopes): Declare.
1258         * decl.c (grokdeclarator): Call cp_warn_deprecated_use_scopes.
1259         (type_is_deprecated): Likewise.
1260         * decl2.c (cp_warn_deprecated_use_scopes): New function.
1261         * name-lookup.c (handle_namespace_attrs): Handle attribute deprecated.
1262         * parser.c (cp_parser_namespace_alias_definition): Call
1263         cp_warn_deprecated_use_scopes.
1264         (cp_parser_using_declaration): Likewise.
1265         (cp_parser_using_directive): Likewise.
1266         * semantics.c (finish_id_expression_1): Likewise.
1268 2019-08-23  Nathan Sidwell  <nathan@acm.org>
1270         * class.c (check_for_override): Checking IDENTIFIER_VIRTUAL_P is
1271         sufficient, reorder DECL_OVERRIDE_P check.
1273 2019-08-23  Iain Sandoe  <iain@sandoe.co.uk>
1275         PR pch/61250
1276         * parser.c (cp_parser_initial_pragma): Call c_common_no_more_pch ()
1277         after determining that the first token is not
1278         PRAGMA_GCC_PCH_PREPROCESS.
1280 2019-08-22  Marek Polacek  <polacek@redhat.com>
1282         PR c++/91304 - prefix attributes ignored in condition.
1283         * parser.c (cp_parser_condition): Handle prefix attributes.
1285 2019-08-21  Richard Sandiford  <richard.sandiford@arm.com>
1287         PR c++/91505
1288         * decl.c (duplicate_decls): Call copy_attributes_to_builtin inside
1289         the BUILT_IN_NORMAL block rather than afterward.
1291 2019-08-19  Marek Polacek  <polacek@redhat.com>
1293         PR c++/91264 - detect modifying const objects in constexpr.
1294         * constexpr.c (modifying_const_object_error): New function.
1295         (cxx_eval_call_expression): Set TREE_READONLY on a CONSTRUCTOR of
1296         a const-qualified object after it's been fully constructed.
1297         (modifying_const_object_p): New function.
1298         (cxx_eval_store_expression): Detect modifying a const object
1299         during constant expression evaluation.
1300         (cxx_eval_increment_expression): Use a better location when building
1301         up the store.
1302         (cxx_eval_constant_expression) <case DECL_EXPR>: Mark a constant
1303         object's constructor TREE_READONLY.
1305 2019-08-15  Jason Merrill  <jason@redhat.com>
1307         PR c++/90393 - ICE with thow in ?:
1309         PR c++/64372, DR 1560 - Gratuitous lvalue-to-rvalue conversion in ?:
1310         * tree.c (lvalue_kind): Handle throw in one arm.
1311         * typeck.c (rationalize_conditional_expr): Likewise.
1312         (cp_build_modify_expr): Likewise.
1314 2019-08-14  Jason Merrill  <jason@redhat.com>
1316         Implement P0848R3, Conditionally Trivial Special Member Functions.
1317         * tree.c (special_memfn_p): New.
1318         * class.c (add_method): When overloading, hide ineligible special
1319         member fns.
1320         (check_methods): Set TYPE_HAS_COMPLEX_* here.
1321         * decl.c (grok_special_member_properties): Not here.
1322         * name-lookup.c (push_class_level_binding_1): Move overloaded
1323         functions case down, accept FUNCTION_DECL as target_decl.
1325 2019-08-14  Jonathan Wakely  <jwakely@redhat.com>
1327         PR c++/91436
1328         * name-lookup.c (get_std_name_hint): Fix min_dialect field for
1329         complex_literals and make_unique entries.
1331 2019-08-14  Jakub Jelinek  <jakub@redhat.com>
1332             Marek Polacek  <polacek@redhat.com>
1334         PR c++/91391 - bogus -Wcomma-subscript warning.
1335         * parser.c (cp_parser_postfix_open_square_expression): Don't warn about
1336         a deprecated comma here.  Pass warn_comma_subscript down to
1337         cp_parser_expression.
1338         (cp_parser_expression): New bool parameter.  Warn about uses of a comma
1339         operator within a subscripting expression.
1340         (cp_parser_skip_to_closing_square_bracket): Revert to pre-r274121 state.
1341         (cp_parser_skip_to_closing_square_bracket_1): Remove.
1343 2019-08-14  Jonathan Wakely  <jwakely@redhat.com>
1345         * name-lookup.c (get_std_name_hint): Add more entries.
1347 2019-08-14  Paolo Carlini  <paolo.carlini@oracle.com>
1349         * decl2.c (grok_array_decl): Use the location of the open square
1350         bracket in error message about invalid types.
1352 2019-08-14  Paolo Carlini  <paolo.carlini@oracle.com>
1354         * decl.c (grokdeclarator): Check here for typedef a function
1355         definition or a member function definition.
1356         (start_function): Adjust.
1357         (grokmethod): Likewise.
1359 2019-08-13  Richard Sandiford  <richard.sandiford@arm.com>
1361         PR middle-end/91421
1362         * decl.c (duplicate_decls):  Use copy_decl_built_in_function.
1363         * pt.c (declare_integer_pack): Use set_decl_built_in_function.
1365 2019-08-13  Marek Polacek  <polacek@redhat.com>
1367         PR c++/90473 - wrong code with nullptr in default argument.
1368         * call.c (null_ptr_cst_p): Update quote from the standard.
1369         * decl.c (check_default_argument): Don't return nullptr when the arg
1370         has side-effects.
1372 2019-08-13  Marek Polacek  <polacek@redhat.com>
1374         * cp-tree.h (DECL_MUTABLE_P): Use FIELD_DECL_CHECK.
1376 2019-08-10  Jakub Jelinek  <jakub@redhat.com>
1378         * parser.c (cp_parser_omp_clause_name): Parse device_type.
1379         (cp_parser_omp_clause_device_type): New function.
1380         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DEVICE_TYPE.
1381         (OMP_DECLARE_TARGET_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DEVICE_TYPE.
1382         (cp_parser_omp_declare_target): Handle device_type clauses.  Remove
1383         diagnostics for declare target with clauses nested in clause-less
1384         declare target declaration-definition-seq.
1385         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DEVICE_TYPE.
1387 2019-08-09  Jakub Jelinek  <jakub@redhat.com>
1389         * parser.c (check_no_duplicate_clause): Simplify using
1390         omp_find_clause.
1391         (cp_parser_omp_clause_if): Fix up printing of target {enter,exit} data
1392         directive name modifiers.
1394         PR c/91401
1395         * parser.c (cp_parser_omp_clause_dist_schedule): Comment out the
1396         check_no_duplicate_clause call, instead emit a warning for duplicate
1397         dist_schedule clauses.
1399 2019-08-08  Paolo Carlini  <paolo.carlini@oracle.com>
1401         * decl.c (grokdeclarator): Use id_loc and EXPR_LOCATION in
1402         a few error messages.
1404 2019-08-08  Marek Polacek  <polacek@redhat.com>
1406         PR c++/87519 - bogus warning with -Wsign-conversion.
1407         * typeck.c (cp_build_binary_op): Use same_type_p instead of comparing
1408         the types directly.
1410         * constexpr.c (inline_asm_in_constexpr_error): New.
1411         (cxx_eval_constant_expression) <case ASM_EXPR>: Call it.
1412         (potential_constant_expression_1) <case ASM_EXPR>: Likewise.
1414 2019-08-08  Jakub Jelinek  <jakub@redhat.com>
1416         * semantics.c (finish_omp_clauses): For C_ORT_OMP
1417         OMP_CLAUSE_USE_DEVICE_* clauses use oacc_reduction_head bitmap
1418         instead of generic_head to track duplicates.
1420 2019-08-07  Marek Polacek  <polacek@redhat.com>
1422         PR c++/81429 - wrong parsing of constructor with C++11 attribute.
1423         * parser.c (cp_parser_constructor_declarator_p): Handle the scenario
1424         when a parameter declaration begins with [[attribute]].
1426 2019-08-07  Marek Polacek  <polacek@redhat.com>
1428         PR c++/91346 - Implement P1668R1, allow unevaluated asm in constexpr.
1429         * constexpr.c (cxx_eval_constant_expression): Handle ASM_EXPR.
1430         (potential_constant_expression_1) <case ASM_EXPR>: Allow.
1431         * cp-tree.h (finish_asm_stmt): Adjust.
1432         * parser.c (cp_parser_asm_definition): Grab the locaion of "asm" and
1433         use it.  Change an error to a pedwarn.  Allow asm in C++2a, warn
1434         otherwise.
1435         * pt.c (tsubst_expr): Pass a location down to finish_asm_stmt.
1436         * semantics.c (finish_asm_stmt): New location_t parameter.  Use it.
1438 2019-08-07  Jakub Jelinek  <jakub@redhat.com>
1440         * parser.c (cp_parser_omp_clause_name): Parse use_device_addr clause.
1441         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR.
1442         (OMP_TARGET_DATA_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR.
1443         (cp_parser_omp_target_data): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR
1444         like PRAGMA_OMP_CLAUSE_USE_DEVICE_PTR, adjust diagnostics about no
1445         map or use_device_* clauses.
1446         * semantics.c (finish_omp_clauses): For OMP_CLAUSE_USE_DEVICE_PTR
1447         in OpenMP, require pointer or reference to pointer type rather than
1448         pointer or array or reference to pointer or array type. Handle
1449         OMP_CLAUSE_USE_DEVICE_ADDR.
1450         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_USE_DEVICE_ADDR.
1452 2019-08-06  Jason Merrill  <jason@redhat.com>
1454         PR c++/91378 - ICE with noexcept and auto return type.
1455         * pt.c (maybe_instantiate_noexcept): push_to_top_level.
1457 2019-08-06  Paolo Carlini  <paolo.carlini@oracle.com>
1459         * decl.c (check_array_designated_initializer): Use
1460         cp_expr_loc_or_input_loc in one place.
1462 2019-08-06  Jakub Jelinek  <jakub@redhat.com>
1464         * parser.c (cp_parser_omp_for_loop): For OMP_LOOP, ignore parallel
1465         clauses and predetermine iterator as lastprivate.
1466         * semantics.c (handle_omp_for_class_iterator): Use
1467         OMP_CLAUSE_LASTPRIVATE_LOOP_IV instead of
1468         OMP_CLAUSE_LASTPRIVATE_TASKLOOP_IV, set it for lastprivate also
1469         on OMP_LOOP construct.  If a clause is missing for class iterator
1470         on OMP_LOOP, add firstprivate clause, and if there is private
1471         clause, turn it into firstprivate too.
1472         (finish_omp_for): Formatting fix.  For OMP_LOOP, adjust
1473         OMP_CLAUSE_LASTPRIVATE_LOOP_IV clause CP_CLAUSE_INFO, so that it
1474         uses copy ctor instead of default ctor.
1475         * cp-gimplify.c (cp_gimplify_expr): Handle OMP_LOOP like
1476         OMP_DISTRIBUTE etc.
1477         (cp_fold_r): Likewise.
1478         (cp_genericize_r): Likewise.
1479         (cxx_omp_finish_clause): Also finish lastprivate clause with
1480         OMP_CLAUSE_LASTPRIVATE_LOOP_IV flag.
1481         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_BIND.
1482         (tsubst_omp_for_iterator): For OMP_LOOP, ignore parallel
1483         clauses and predetermine iterator as lastprivate.
1484         * constexpr.c (potential_constant_expression_1): Handle OMP_LOOP
1485         like OMP_DISTRIBUTE etc.
1487 2019-08-05  Marek Polacek  <polacek@redhat.com>
1489         DR 2413 - typename in conversion-function-ids.
1490         * parser.c (cp_parser_conversion_type_id): Call
1491         cp_parser_type_specifier_seq with CP_PARSER_FLAGS_TYPENAME_OPTIONAL
1492         instead of CP_PARSER_FLAGS_NONE.
1494 2019-08-05  Paolo Carlini  <paolo.carlini@oracle.com>
1496         * cp-tree.h (cp_expr_loc_or_input_loc): New.
1497         (cxx_incomplete_type_diagnostic): Use it.
1498         * call.c (build_converted_constant_expr_internal, convert_like_real,
1499         convert_arg_to_ellipsis, convert_for_arg_passing, build_over_call,
1500         build_cxx_call, perform_implicit_conversion_flags,
1501         initialize_reference): Likewise.
1502         * constexpr.c (cxx_eval_internal_function, cxx_eval_call_expression,
1503         eval_and_check_array_index, cxx_eval_store_expression,
1504         cxx_eval_statement_list, cxx_eval_loop_expr,
1505         cxx_eval_constant_expression, potential_constant_expression_1):
1506         Likewise.
1507         * constraint.cc (check_for_logical_overloads,
1508         satisfy_predicate_constraint): Likewise.
1509         * cp-gimplify.c (cp_gimplify_expr): Likewise.
1510         * cvt.c (cp_convert_to_pointer, convert_to_reference,
1511         cp_convert_and_check, ocp_convert, maybe_warn_nodiscard): Likewise.
1512         * decl.c (pop_switch): Likewise.
1513         * decl2.c (delete_sanity): Likewise.
1514         * error.c (location_of): Likewise.
1515         * init.c (maybe_warn_list_ctor, build_aggr_init,
1516         warn_placement_new_too_small, build_new_1, build_vec_init): Likewise.
1517         * lex.c (unqualified_name_lookup_error): Likewise.
1518         * parser.c (cp_parser_initializer_list, cp_parser_omp_for_cond):
1519         Likewise.
1520         * pt.c (check_for_bare_parameter_packs, check_valid_ptrmem_cst_expr,
1521         unify_arg_conversion, convert_nontype_argument,
1522         tsubst_copy_and_build, resolve_typename_type): Likewise.
1523         * semantics.c (maybe_convert_cond, finish_call_expr,
1524         cp_build_vec_convert): Likewise.
1525         * typeck.c (decay_conversion, rationalize_conditional_expr,
1526         cp_build_unary_op, build_x_compound_expr_from_list,
1527         maybe_warn_about_returning_address_of_local,
1528         maybe_warn_pessimizing_move): Likewise.
1529         * typeck2.c (check_narrowing, digest_init_r,
1530         process_init_constructor_array): Likewise.
1532 2019-08-05  Tom Honermann  <tom@honermann.net>
1534         * parser.c (cp_parser_template_declaration_after_parameters): Enable
1535         class template argument deduction for non-type template parameters
1536         in literal operator templates.
1538 2019-08-05  Marek Polacek  <polacek@redhat.com>
1540         PR c++/91338 - Implement P1161R3: Deprecate a[b,c].
1541         * parser.c (cp_parser_postfix_open_square_expression): Warn about uses
1542         of a comma operator within a subscripting expression.
1543         (cp_parser_skip_to_closing_square_bracket_1): New function, made out
1544         of...
1545         (cp_parser_skip_to_closing_square_bracket): ...this.
1547 2019-08-05  Jason Merrill  <jason@redhat.com>
1549         * semantics.c (force_paren_expr): Preserve location.
1551 2019-08-02  Marek Polacek  <polacek@redhat.com>
1553         PR c++/91230 - wrong error with __PRETTY_FUNCTION__ and generic lambda.
1554         * pt.c (value_dependent_expression_p): Consider __PRETTY_FUNCTION__
1555         inside a template function value-dependent.
1557 2019-08-02  Paolo Carlini  <paolo.carlini@oracle.com>
1559         * tree.c (handle_nodiscard_attribute): Do not warn about nodiscard
1560         applied to a constructor.
1562 2019-08-02  Martin Liska  <mliska@suse.cz>
1564         * decl.c (grok_op_properties):
1565         Mark DECL_SET_IS_OPERATOR_DELETE for user-provided delete operators.
1567 2019-08-01  Martin Sebor  <msebor@redhat.com>
1569         PR c++/90947
1570         * decl.c (reshape_init_array_1): Avoid truncating initializer
1571         lists containing string literals.
1573 2019-08-01  Marek Polacek  <polacek@redhat.com>
1575         PR c++/90805 - detect narrowing in case values.
1576         * decl.c (case_conversion): Detect narrowing in case values.
1578 2019-07-31  Paolo Carlini  <paolo.carlini@oracle.com>
1580         * decl2.c (delete_sanity): Improve diagnostic locations, use
1581         cp_expr_loc_or_loc in four places.
1583 2019-07-31  Jason Merrill  <jason@redhat.com>
1585         PR c++/90538 - multiple expansions of capture packs
1586         * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): Remove.
1587         * lambda.c (add_capture): Copy parameter packs from init.
1588         (lambda_capture_field_type): Always use auto for init-capture.
1589         * pt.c (uses_parameter_packs): Return tree.
1590         (tsubst) [DECLTYPE_TYPE]: Remove init-capture handling.
1591         (gen_elem_of_pack_expansion_instantiation): Don't push
1592         local_specialization_stack.
1593         (prepend_one_capture): New.
1594         (tsubst_lambda_expr): Use it.  Don't touch local_specializations.
1595         (do_auto_deduction): Avoid redundant error.
1597         Fix copy_node of TEMPLATE_INFO.
1598         * cp-tree.h (struct tree_template_info): Use tree_base instead of
1599         tree_common.  Add tmpl and args fields.
1600         (TI_TEMPLATE, TI_ARGS): Adjust.
1602 2019-07-30  Martin Liska  <mliska@suse.cz>
1604         PR tree-optimization/91270
1605         * tree-ssa-dce.c (propagate_necessity): Mark 2nd argument
1606         of delete operator as needed.
1608 2019-07-25  Martin Liska  <mliska@suse.cz>
1609             Dominik Infuhr  <dominik.infuehr@theobroma-systems.com>
1611         PR c++/23383
1612         * decl.c (cxx_init_decl_processing): Mark delete operators
1613         with DECL_SET_IS_OPERATOR_DELETE.
1615 2019-07-25  Martin Liska  <mliska@suse.cz>
1617         * decl.c (duplicate_decls): Use new macros
1618         (e.g. DECL_SET_LAMBDA_FUNCTION and DECL_LAMBDA_FUNCTION_P).
1619         (cxx_init_decl_processing): Likewise.
1620         (grok_op_properties): Likewise.
1621         * parser.c (cp_parser_lambda_declarator_opt): Likewise.
1623 2019-07-24  Martin Sebor  <msebor@redhat.com>
1625         PR driver/80545
1626         * decl.c (finish_function): Use lang_mask.
1628 2019-07-20  Jason Merrill  <jason@redhat.com>
1630         * cp-tree.h (ovl_iterator::using_p): A USING_DECL by itself was also
1631         introduced by a using-declaration.
1633 2019-07-20  Jason Merrill  <jason@redhat.com>
1635         Reduce memory consumption for push/pop_access_scope.
1636         * name-lookup.c (leave_scope): Do add class levels other than
1637         previous_class_level to free_binding_level.
1638         (invalidate_class_lookup_cache): Move from class.c, add to
1639         free_binding_level.
1640         * pt.c (saved_access_scope): Change from list to vec.
1642 2019-07-20  Jakub Jelinek  <jakub@redhat.com>
1644         * cp-tree.h (OMP_FOR_GIMPLIFYING_P): Use OMP_LOOPING_CHECK
1645         instead of OMP_LOOP_CHECK.
1646         * parser.c (cp_parser_omp_clause_name): Handle bind clause.
1647         (cp_parser_omp_clause_bind): New function.
1648         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_BIND.
1649         (OMP_LOOP_CLAUSE_MASK): Define.
1650         (cp_parser_omp_loop): New function.
1651         (cp_parser_omp_parallel, cp_parser_omp_teams): Handle parsing of
1652         loop combined with parallel or teams.
1653         (cp_parser_omp_construct): Handle PRAGMA_OMP_LOOP.
1654         (cp_parser_pragma): Likewise.
1655         * pt.c (tsubst_expr): Handle OMP_LOOP.
1656         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_BIND.
1658 2019-07-19  Jason Merrill  <jason@redhat.com>
1660         PR c++/90101 - dependent class non-type parameter.
1661         * pt.c (invalid_nontype_parm_type_p): Check for dependent class type.
1663 2019-07-18  Jason Merrill  <jason@redhat.com>
1665         PR c++/90098 - partial specialization and class non-type parms.
1666         PR c++/90099
1667         PR c++/90101
1668         * call.c (build_converted_constant_expr_internal): Don't copy.
1669         * pt.c (process_partial_specialization): Allow VIEW_CONVERT_EXPR
1670         around class non-type parameter.
1671         (unify) [TEMPLATE_PARM_INDEX]: Ignore cv-quals.
1673 2019-07-16  Jason Merrill  <jason@redhat.com>
1675         * parser.c (make_location): Add overload taking cp_lexer* as last
1676         parameter.
1678         * parser.c (cp_parser_simple_type_specifier): Separate tentative
1679         parses for optional type-spec and CTAD.
1681         * parser.c (cp_parser_nested_name_specifier_opt): If the token is
1682         already CPP_NESTED_NAME_SPECIFIER, leave it alone.
1684 2019-07-12  Jakub Jelinek  <jakub@redhat.com>
1686         * parser.c (cp_parser_omp_clause_name): Handle order clause.
1687         (cp_parser_omp_clause_order): New function.
1688         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ORDER.
1689         (OMP_SIMD_CLAUSE_MASK, OMP_FOR_CLAUSE_MASK): Add
1690         PRAGMA_OMP_CLAUSE_ORDER.
1691         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_ORDER.
1692         * pt.c (tsubst_omp_clauses): Likewise.
1694 2019-07-10  Paolo Carlini  <paolo.carlini@oracle.com>
1696         * decl.c (get_type_quals,
1697         smallest_type_location (const cp_decl_specifier_seq*)): New.
1698         (check_tag_decl): Use smallest_type_location in error_at about
1699         multiple types in one declaration.
1700         (grokdeclarator): Use locations[ds_complex] in error_at about
1701         complex invalid; use locations[ds_storage_class] in error_at
1702         about static cdtor; use id_loc in error_at about flexible
1703         array member in union; use get_type_quals.
1705 2019-07-09  Martin Sebor  <msebor@redhat.com>
1707         PR c++/61339
1708         * cp-tree.h: Change class-key of PODs to struct and others to class.
1709         * search.c: Same.
1710         * semantics.c (finalize_nrv_r): Same.
1712 2019-07-09  Martin Sebor  <msebor@redhat.com>
1714         PR c++/61339
1715         * constexpr.c (cxx_eval_call_expression): Change class-key from class
1716         to struct and vice versa to match convention and avoid -Wclass-is-pod
1717         and -Wstruct-no-pod.
1718         * constraint.cc (get_concept_definition): Same.
1719         * cp-tree.h: Same.
1720         * cxx-pretty-print.h: Same.
1721         * error.c: Same.
1722         * logic.cc (term_list::replace): Same.
1723         * name-lookup.c (find_local_binding): Same.
1724         * pt.c (tsubst_binary_right_fold): Same.
1725         * search.c (field_accessor_p): Same.
1726         * semantics.c (expand_or_defer_fn): Same.
1728 2019-07-08  Jakub Jelinek  <jakub@redhat.com>
1730         PR c++/91110
1731         * decl2.c (cp_omp_mappable_type_1): Don't emit any note for
1732         error_mark_node type.
1734 2019-07-05  Jakub Jelinek  <jakub@redhat.com>
1736         PR c++/67184
1737         PR c++/69445
1738         * call.c (build_new_method_call_1): Remove set but not used variable
1739         binfo.
1741 2019-07-05  Paolo Carlini  <paolo.carlini@oracle.com>
1743         PR c++/67184 (again)
1744         PR c++/69445
1745         * call.c (build_over_call): Devirtualize user-defined operators
1746         coming from a base too.
1747         (build_new_method_call_1): Do not devirtualize here.
1749 2019-07-04  Marek Polacek  <polacek@redhat.com>
1751         DR 1813
1752         PR c++/83374 - __is_standard_layout wrong for a class with repeated
1753         bases.
1754         * class.c (check_bases): Set CLASSTYPE_NON_STD_LAYOUT for a class if
1755         CLASSTYPE_REPEATED_BASE_P is true.
1757 2019-07-04  Andrew Stubbs  <ams@codesourcery.com>
1759         * cp-tree.h (cp_omp_emit_unmappable_type_notes): New prototype.
1760         * decl.c (cp_finish_decl): Call cp_omp_emit_unmappable_type_notes.
1761         * decl2.c (cp_omp_mappable_type): Move contents to ...
1762         (cp_omp_mappable_type_1): ... here and add note output.
1763         (cp_omp_emit_unmappable_type_notes): New function.
1764         * semantics.c (finish_omp_clauses): Call
1765         cp_omp_emit_unmappable_type_notes in four places.
1767 2019-07-03  Martin Liska  <mliska@suse.cz>
1769         * call.c (build_new_op_1): Remove dead assignemts.
1770         * typeck.c (cp_build_binary_op): Likewise.
1772 2019-06-27  Jason Merrill  <jason@redhat.com>
1774         PR c++/55442 - memory-hog with highly recursive constexpr.
1775         * constexpr.c (push_cx_call_context): Return depth.
1776         (cxx_eval_call_expression): Don't cache past constexpr_cache_depth.
1778 2019-06-27  Jan Hubicka  <jh@suse.cz>
1780         * class.c (layout_class_type): Set TYPE_CXX_ODR_P for as-base
1781         type copy.
1783 2019-06-27  Martin Liska  <mliska@suse.cz>
1785         * class.c (adjust_clone_args): Remove obviously
1786         dead assignments.
1787         (dump_class_hierarchy_r): Likewise.
1788         * decl.c (check_initializer): Likewise.
1789         * parser.c (cp_parser_lambda_expression): Likewise.
1790         * pt.c (unify_bound_ttp_args): Likewise.
1791         (convert_template_argument): Likewise.
1792         * rtti.c (build_headof): Likewise.
1793         * typeck.c (convert_for_initialization): Likewise.
1795 2019-06-25  Jason Merrill  <jason@redhat.com>
1797         PR c++/70462 - unnecessary base ctor variant with final.
1798         * optimize.c (populate_clone_array): Skip base variant if
1799         CLASSTYPE_FINAL.
1800         (maybe_clone_body): We don't need an alias if we are only defining
1801         one clone.
1803         * class.c (resolves_to_fixed_type_p): Check CLASSTYPE_FINAL.
1805 2019-06-25  Jakub Jelinek  <jakub@redhat.com>
1807         PR c++/90969
1808         * constexpr.c (cxx_eval_array_reference): Don't look through VCE from
1809         vector type if lval.
1811 2019-06-25  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
1813         * lex.c (init_reswords): Create keyword for "__intN__" type.
1814         * cp-tree.h (cp_decl_specifier_seq): New bitfield "int_n_alt".
1815         * decl.c (grokdeclarator): Don't pedwarn about "__intN" ISO
1816         C incompatibility if alternate "__intN__" form is used.
1817         * parser.c (cp_parser_simple_type_specifier): Set
1818         decl_specs->int_n_alt if "__intN__" form is used.
1820 2019-06-24  Jan Hubicka  <jh@suse.cz>
1822         * lex.c (cxx_make_type): Set TYPE_CXX_ODR_P.
1824 2019-06-24  Jason Merrill  <jason@redhat.com>
1826         * class.c (layout_class_type): Don't use a separate
1827         CLASSTYPE_AS_BASE if it's the same size.
1829 2019-06-23  Marek Polacek  <polacek@redhat.com>
1831         * call.c (convert_default_arg): Use DEFERRED_PARSE instead of
1832         DEFAULT_ARG.
1833         * cp-objcp-common.c (cp_tree_size): Likewise.  Use tree_deferred_parse
1834         instead of tree_default_arg.
1835         * cp-tree.def: Rename DEFAULT_ARG to DEFERRED_PARSE.
1836         * cp-tree.h: Rename DEFARG_TOKENS to DEFPARSE_TOKENS.  Rename
1837         DEFARG_INSTANTIATIONS to DEFPARSE_INSTANTIATIONS.  Rename
1838         tree_default_arg to tree_deferred_parse.
1839         (UNPARSED_NOEXCEPT_SPEC_P): Use DEFERRED_PARSE instead of DEFAULT_ARG.
1840         (cp_tree_node_structure_enum): Rename TS_CP_DEFAULT_ARG to
1841         TS_CP_DEFERRED_PARSE.
1842         (lang_tree_node): Rename tree_default_arg to tree_deferred_parse.
1843         Rename default_arg to deferred_parse.  Use TS_CP_DEFERRED_PARSE instead
1844         of TS_CP_DEFAULT_ARG.
1845         (defarg_location): Remove declaration.
1846         (defparse_location): Add declaration.
1847         * decl.c (grokfndecl): Use DEFERRED_PARSE instead of DEFAULT_ARG.
1848         Call defparse_location instead of defarg_location.
1849         (check_default_argument): Use DEFERRED_PARSE instead of DEFAULT_ARG.
1850         (cp_tree_node_structure): Likewise.  Use TS_CP_DEFERRED_PARSE instead
1851         of TS_CP_DEFAULT_ARG.
1852         * decl2.c (grokfield): Use DEFERRED_PARSE instead of DEFAULT_ARG.
1853         * error.c (dump_expr): Likewise.
1854         (location_of): Likewise.
1855         * init.c (get_nsdmi): Likewise.
1856         * parser.c (cp_parser_save_noexcept): Likewise.  Use DEFPARSE_TOKENS
1857         instead of DEFARG_TOKENS.
1858         (cp_parser_late_noexcept_specifier): Likewise.
1859         (cp_parser_late_parse_one_default_arg): Use DEFPARSE_TOKENS instead
1860         of DEFARG_TOKENS.
1861         (cp_parser_late_parsing_default_args): Use DEFERRED_PARSE instead of
1862         DEFAULT_ARG.  Use DEFPARSE_INSTANTIATIONS instead of
1863         DEFARG_INSTANTIATIONS.
1864         (cp_parser_cache_defarg): Use DEFERRED_PARSE instead of DEFAULT_ARG.
1865         Use DEFPARSE_TOKENS instead of DEFARG_TOKENS.  Use
1866         DEFPARSE_INSTANTIATIONS instead of DEFARG_INSTANTIATIONS.
1867         (defparse_location): Renamed from defarg_location.
1868         * pt.c (tsubst_default_argument): Use DEFERRED_PARSE instead of
1869         DEFAULT_ARG.
1870         (tsubst_arg_types): Likewise.
1871         (dependent_type_p_r): Likewise.
1872         * tree.c (cp_tree_equal): Likewise.
1873         (cp_walk_subtrees): Likewise.
1874         * typeck.c (convert_arguments): Likewise.
1876 2019-06-22  Marek Polacek  <polacek@redhat.com>
1878         PR c++/86476 - noexcept-specifier is a complete-class context.
1879         PR c++/52869
1880         * cp-tree.def (DEFAULT_ARG): Update commentary.
1881         * cp-tree.h (UNPARSED_NOEXCEPT_SPEC_P): New macro.
1882         (tree_default_arg): Use tree_base instead of tree_common.
1883         (do_push_parm_decls, maybe_check_overriding_exception_spec): Declare.
1884         * decl.c (do_push_parm_decls): New function, broken out of...
1885         (store_parm_decls): ...here.  Call it.
1886         * except.c (nothrow_spec_p): Accept DEFAULT_ARG in the assert.
1887         * parser.c (cp_parser_noexcept_specification_opt,
1888         cp_parser_late_noexcept_specifier, noexcept_override_late_checks):
1889         Forward-declare.
1890         (unparsed_noexcepts): New macro.
1891         (push_unparsed_function_queues): Update initializer.
1892         (cp_parser_direct_declarator): Pass FRIEND_P to
1893         cp_parser_exception_specification_opt.
1894         (inject_parm_decls): New.
1895         (pop_injected_parms): New.
1896         (cp_parser_class_specifier_1): Implement delayed parsing of
1897         noexcept-specifiers.
1898         (cp_parser_save_noexcept): New.
1899         (cp_parser_late_noexcept_specifier): New.
1900         (noexcept_override_late_checks): New.
1901         (cp_parser_noexcept_specification_opt): Add FRIEND_P parameter.  Call
1902         cp_parser_save_noexcept instead of the normal processing if needed.
1903         (cp_parser_exception_specification_opt): Add FRIEND_P parameter and
1904         pass it to cp_parser_noexcept_specification_opt.
1905         (cp_parser_save_member_function_body): Fix comment.
1906         (cp_parser_save_default_args): Maybe save the noexcept-specifier to
1907         post process.
1908         (cp_parser_transaction): Update call to
1909         cp_parser_noexcept_specification_opt.
1910         (cp_parser_transaction_expression): Likewise.
1911         * parser.h (cp_unparsed_functions_entry): Add new field to carry
1912         a noexcept-specifier.
1913         * pt.c (dependent_type_p_r): Handle unparsed noexcept expression.
1914         * search.c (maybe_check_overriding_exception_spec): New function, broken
1915         out of...
1916         (check_final_overrider): ...here.  Call
1917         maybe_check_overriding_exception_spec.
1918         * tree.c (canonical_eh_spec): Handle UNPARSED_NOEXCEPT_SPEC_P.
1919         (cp_tree_equal): Handle DEFAULT_ARG.
1921         PR c++/90881 - bogus -Wunused-value in unevaluated context.
1922         * cvt.c (convert_to_void): Don't emit unused warnings in
1923         an unevaluated context.
1925 2019-06-22  Paolo Carlini  <paolo.carlini@oracle.com>
1927         * decl.c (grokdeclarator): Use id_loc, typespec_loc, and
1928         locations[ds_storage_class] in a few additional places.
1930 2019-06-21  Paolo Carlini  <paolo.carlini@oracle.com>
1932         PR c++/90909
1933         Revert:
1934         2019-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
1936         PR c++/67184
1937         PR c++/69445
1938         * call.c (build_over_call): Devirtualize when the final overrider
1939         comes from the base.
1941 2019-06-21  Marek Polacek  <polacek@redhat.com>
1943         PR c++/61490 - qualified-id in friend function definition.
1944         * decl.c (grokdeclarator): Diagnose qualified-id in friend function
1945         definition.  Improve location for diagnostics of friend functions.
1947         PR c++/60223 - ICE with T{} in non-deduced context.
1948         * pt.c (unify): Allow COMPOUND_LITERAL_P in a non-deduced context.
1950         PR c++/64235 - missing syntax error with invalid alignas.
1951         * parser.c (cp_parser_std_attribute_spec): Commit to tentative parse
1952         if there's a missing close paren.
1954         PR c++/90490 - fix decltype issues in noexcept-specifier.
1955         * except.c (build_noexcept_spec): Call
1956         instantiate_non_dependent_expr_sfinae before
1957         build_converted_constant_expr instead of calling
1958         instantiate_non_dependent_expr after it.  Add
1959         processing_template_decl_sentinel.
1961 2019-06-21  Jakub Jelinek  <jakub@redhat.com>
1963         PR c++/90950
1964         * semantics.c (finish_omp_clauses): Don't reject references to
1965         incomplete types if processing_template_decl.
1967 2019-06-19  Marek Polacek  <polacek@redhat.com>
1969         PR c++/60364 - noreturn after first decl not diagnosed.
1970         * decl.c (duplicate_decls): Give an error when a function is
1971         declared [[noreturn]] after its first declaration.
1972         * parser.c (cp_parser_std_attribute): Don't treat C++11 noreturn
1973         attribute as equivalent to GNU's.
1974         * tree.c (std_attribute_table): Add noreturn.
1976 2019-06-19  Jakub Jelinek  <jakub@redhat.com>
1978         * cp-gimplify.c (cp_genericize_r): Handle OMP_CLAUSE_{IN,EX}CLUSIVE
1979         like OMP_CLAUSE_SHARED.
1981 2019-06-18  Jason Merrill  <jason@redhat.com>
1983         * constexpr.c (cxx_eval_store_expression): Delay target evaluation.
1985 2019-06-18  Jason Merrill  <jason@redhat.com>
1987         * constexpr.c (eval_and_check_array_index): Split out from...
1988         (cxx_eval_array_reference): ...here.
1989         (cxx_eval_store_expression): Use it here, too.
1990         (diag_array_subscript): Take location.  Strip location wrapper.
1992 2019-06-18  Jason Merrill  <jason@redhat.com>
1994         * constexpr.c (cxx_eval_constant_expression): Handle conversion from
1995         and then to the same type.
1997 2019-06-18  Jason Merrill  <jason@redhat.com>
1999         * constexpr.c (unshare_constructor): Add MEM_STAT_DECL.
2001 2019-06-17  Jakub Jelinek  <jakub@redhat.com>
2003         * semantics.c (finish_omp_clauses): For OMP_CLAUSE_REDUCTION_INSCAN
2004         set need_copy_assignment.
2006 2019-06-17  Marek Polacek  <polacek@redhat.com>
2008         PR c++/83820 - excessive attribute arguments not detected.
2009         * parser.c (cp_parser_std_attribute): Detect excessive arguments.
2011 2019-06-17  Nathan Sidwell  <nathan@acm.org>
2013         PR c++/90754
2014         * name-lookup.c (lookup_type_scope_1): Calll qualify_lookup before
2015         checking context.
2017 2019-06-14  Marek Polacek  <polacek@redhat.com>
2019         PR c++/90884 - stray note with -Wctor-dtor-privacy.
2020         * class.c (maybe_warn_about_overly_private_class): Guard the call to
2021         inform.
2023 2019-06-12  Jason Merrill  <jason@redhat.com>
2025         PR c++/85552 - wrong instantiation of dtor for DMI.
2026         * typeck2.c (digest_nsdmi_init): Set tf_no_cleanup for direct-init.
2028 2019-06-13  Paolo Carlini  <paolo.carlini@oracle.com>
2030         * decl.c (grokdeclarator): Use id_loc in five additional places
2031         in the last part of the function.
2033 2019-06-13  Paolo Carlini  <paolo.carlini@oracle.com>
2035         * decl.c (grokdeclarator): Move further up the declaration of
2036         id_loc, use it immediately, update its value after the loop
2037         over declarator, use it again in the final part of function;
2038         improve locations of error messages about multiple data types
2039         and conflicting specifiers.
2041 2019-06-13  Richard Biener  <rguenther@suse.de>
2043         PR c++/90801
2044         * typeck2.c (split_nonconstant_init_1): Properly count
2045         num_split_elts, optimize single constructor elt removal.
2047 2019-06-12  Marek Polacek  <polacek@redhat.com>
2049         PR c++/66999 - 'this' captured by reference.
2050         * parser.c (cp_parser_lambda_introducer): Reject `&this'.  Use
2051         cp_lexer_nth_token_is instead of cp_lexer_peek_nth_token.
2053         PR c++/90825 - endless recursion when evaluating sizeof.
2054         PR c++/90832 - endless recursion when evaluating sizeof.
2055         * constexpr.c (cxx_eval_constant_expression): Don't recurse on the
2056         result of fold_sizeof_expr if is returns a SIZEOF_EXPR.
2057         * typeck.c (cxx_sizeof_expr): Only return a SIZEOF_EXPR if the operand
2058         is instantiation-dependent.
2060         PR c++/90736 - bogus error with alignof.
2061         * constexpr.c (adjust_temp_type): Use cv_unqualified type.
2063 2019-06-11  Matthew Beliveau  <mbelivea@redhat.com>
2065         PR c++/90449 - add -Winaccessible-base option.
2066         * class.c (warn_about_ambiguous_bases): Changed name to:
2067         maybe_warn_about_inaccessible_bases.
2068         (maybe_warn_about_inaccessible_bases): Implemented new
2069         Winaccessible-base warning option for both direct and virtual
2070         base warnings.
2071         (layout_class_type): Call to warn_about_ambiguous_bases changed to fit
2072         new name.
2074 2019-06-11  Richard Biener  <rguenther@suse.de>
2076         PR c++/90801
2077         * typeck2.c (split_nonconstant_init_1): Avoid ordered remove
2078         from CONSTRUCTOR by marking to remove elements and doing all
2079         of them in a O(n) scan.
2081 2019-06-11  Jakub Jelinek  <jakub@redhat.com>
2083         PR c++/90810
2084         * init.c (constant_value_1): Handle VECTOR_CST DECL_INITIAL for
2085         !DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P decls like CONSTRUCTOR.
2087 2019-06-11  Martin Liska  <mliska@suse.cz>
2089         PR c++/87847
2090         * pt.c (init_template_processing): Disable hash table
2091         sanitization for decl_specializations and type_specializations.
2093 2019-06-10  Jason Merrill  <jason@redhat.com>
2095         * constexpr.c (free_constructor): New.
2096         (cxx_eval_call_expression): Free parameter value CONSTRUCTORs.
2098         * constexpr.c (unshare_constructor): Only unshare if T is itself a
2099         CONSTRUCTOR.
2100         (cxx_eval_call_expression): Don't call it on the result here.
2102         Reduce constexpr_call memory consumption.
2103         * constexpr.c (cxx_bind_parameters_in_call): Use TREE_VEC rather
2104         than TREE_LIST.
2105         (constexpr_call_hasher::equal, cxx_bind_parameters_in_call)
2106         (cxx_eval_call_expression): Adjust.
2108 2019-06-10  Jakub Jelinek  <jakub@redhat.com>
2110         * parser.c (cp_parser_omp_clause_reduction): Don't sorry_at on inscan
2111         reductions.
2112         (cp_parser_omp_scan_loop_body): New function.
2113         (cp_parser_omp_for_loop): Call cp_parser_omp_scan_loop_body if there
2114         are inscan reduction clauses.
2115         (cp_parser_pragma): Reject PRAGMA_OMP_SCAN.
2116         * semantics.c (finish_omp_clauses): Reject mixing inscan with
2117         non-inscan reductions on the same construct, or inscan reductions with
2118         ordered or schedule clauses, or inscan array reductions.
2119         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_{IN,EX}CLUSIVE.
2120         (tsubst_expr): Handle OMP_SCAN.
2122 2019-06-07  Jason Merrill  <jason@redhat.com>
2124         * constexpr.c (cxx_eval_constant_expression): Call
2125         STRIP_ANY_LOCATION_WRAPPER early.
2126         [CONVERT_EXPR]: Don't build anything for conversion to void.
2127         [ADDR_EXPR]: ggc_free unused ADDR_EXPR.
2129 2019-06-05  Martin Sebor  <msebor@redhat.com>
2131         PR c/90737
2132         * typeck.c (maybe_warn_about_returning_address_of_local): Only
2133         consider functions returning pointers as candidates for
2134         -Wreturn-local-addr.
2136 2019-06-05  Paolo Carlini  <paolo.carlini@oracle.com>
2138         * decl.c (smallest_type_location): New.
2139         (check_special_function_return_type): Use it.
2140         (grokdeclarator): Lkewise.
2142 2019-06-05  Paolo Carlini  <paolo.carlini@oracle.com>
2144         * decl.c (grokdeclarator): Use locations[ds_friend]
2145         in one place.
2147 2019-06-05  Martin Sebor  <msebor@redhat.com>
2149         * call.c (build_conditional_expr_1): Adjust quoting and hyphenation.
2150         (convert_like_real): Same.
2151         (convert_arg_to_ellipsis): Same.
2152         * constexpr.c (diag_array_subscript): Same.
2153         * constraint.cc (diagnose_trait_expression): Same.
2154         * cvt.c (ocp_convert): Same.
2155         * decl.c (start_decl): Same.
2156         (check_for_uninitialized_const_var): Same.
2157         (grokfndecl): Same.
2158         (check_special_function_return_type): Same.
2159         (finish_enum_value_list): Same.
2160         (start_preparsed_function): Same.
2161         * parser.c (cp_parser_decl_specifier_seq): Same.
2162         * typeck.c (cp_build_binary_op): Same.
2163         (build_static_cast_1): Same.
2165 2019-06-04  Nina Dinka Ranns  <dinka.ranns@gmail.com>
2167         PR c++/63149 - Wrong auto deduction from braced-init-list.
2168         * pt.c (listify_autos): use non cv qualified auto_node in
2169         std::initializer_list<auto>.
2171 2019-06-04  Paolo Carlini  <paolo.carlini@oracle.com>
2173         * decl.c (grokdeclarator): Use declarator->id_loc in two
2174         additional places.
2176 2019-06-04  Nathan Sidwell  <nathan@acm.org>
2178         * name-lookup.c (lookup_type_scope_1): Reimplement, handle local
2179         and namespace scopes separately.
2181 2019-06-04  Harald van Dijk  <harald@gigawatt.nl>
2183         PR c++/60531 - Wrong error about unresolved overloaded function
2184         * typeck.c (cp_build_binary_op): See if overload can be resolved.
2185         (cp_build_unary_op): Ditto.
2187 2019-06-04  Jason Merrill  <jason@redhat.com>
2189         Reduce accumulated garbage in constexpr evaluation.
2190         * constexpr.c (cxx_eval_call_expression): ggc_free any bindings we
2191         don't save.
2192         (cxx_eval_increment_expression): ggc_free the MODIFY_EXPR after
2193         evaluating it.
2195 2019-06-04  Jakub Jelinek  <jakub@redhat.com>
2197         * cp-tree.h (CP_OMP_CLAUSE_INFO): Allow for any clauses up to _condvar_
2198         instead of only up to linear.
2200 2019-06-03  Paolo Carlini  <paolo.carlini@oracle.com>
2202         * parser.c (cp_parser_unqualified_id): Use build_min_nt_loc in
2203         five places.
2205 2019-06-01  Ville Voutilainen  <ville.voutilainen@gmail.com>
2207         PR c++/85254
2208         * class.c (fixup_type_variants): Handle CLASSTYPE_FINAL.
2210 2019-05-31  Nathan Sidwell  <nathan@acm.org>
2212         * cp-tree.h (IDENTIFIER_LAMBDA_P): New.
2213         (TYPE_ANON_P): New.
2214         (LAMBDA_TYPE_P, TYPE_UNNAMED_P): Likewise.
2215         (LAMBDANAME_PREFIX, LAMBDANAME_FORMAT): Delete.
2216         (make_lambda_name): Don't declare.
2217         * error.c (dump_aggr_type): Check for lambdas before other
2218         anonymous names.
2219         * lambda.c (begin_lambda_type): Use make_anon_name.
2220         * cp-lang.c (cxx_dwarf_name): Lambda names smell anonymous.
2221         * mangle.c (write_local_name): Likewise.
2222         * name-lookup.c (lambda_cnt, make_lambda_name): Delete.
2224 2019-05-30  Marek Polacek  <polacek@redhat.com>
2226         * cp-tree.h (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Fix a typo.
2228 2019-05-31  Paolo Carlini  <paolo.carlini@oracle.com>
2230         * decl.c (grokdeclarator): Use declarator->id_loc in five
2231         error_at calls.
2233 2019-05-29  Jakub Jelinek  <jakub@redhat.com>
2235         PR c++/90598
2236         * tree.c (lvalue_kind): Return clk_none for expressions with
2237         with VOID_TYPE_P.
2239 2019-05-29  Paolo Carlini  <paolo.carlini@oracle.com>
2241         PR c++/89875
2242         * parser.c (cp_parser_sizeof_operand): When the type-id production
2243         did not work out commit to the tentative parse.
2245 2019-05-29  Jakub Jelinek  <jakub@redhat.com>
2247         P1091R3 - Extending structured bindings to be more like var decls
2248         P1381R1 - Reference capture of structured bindings
2249         * decl.c (cp_maybe_mangle_decomp): Handle TREE_STATIC decls even at
2250         function scope.
2251         (cp_finish_decomp): Copy over various decl properties from decl to
2252         v[i] in the tuple case.
2253         (grokdeclarator): Allow static, thread_local and __thread for C++2a
2254         and use pedwarn instead of error for older standard revisions.
2255         Make other structured binding diagnostic messages more i18n friendly.
2257 2019-05-28  Nathan Sidwell  <nathan@acm.org>
2259         * decl.c (duplicate_decls): Assert a template newdecl has no
2260         specializations.
2262 2019-05-28  Marek Polacek  <polacek@redhat.com>
2264         PR c++/90548 - ICE with generic lambda and empty pack.
2265         * pt.c (tsubst_copy_and_build): Handle pack expansion properly.
2267 2019-05-28  Nathan Sidwell  <nathan@acm.org>
2269         * cp-tree.h (make_anon_name): Drop declaration.
2270         (TYPE_UNNAMED_P): Use IDENTIFIER_ANON_P.
2271         * cp-lang.c (cxx_dwarf_name): Likewise.
2272         * class.c (find_flexarrays): Likewise.
2273         * decl.c (name_unnamed_type, xref_tag_1): Likewise.
2274         * error.c (dump_aggr_type): Likewise.
2275         * pt.c (push_template_decl_real): Likewise.
2276         * name-lookup.c (consider_binding_level): Likewise.
2277         (anon_cnt, make_anon_name): Delete.
2279 2019-05-25  Marek Polacek  <polacek@redhat.com>
2281         PR c++/90572 - wrong disambiguation in friend declaration.
2282         * parser.c (cp_parser_constructor_declarator_p): Don't allow missing
2283         typename for friend declarations.
2285 2019-05-23  Jonathan Wakely  <jwakely@redhat.com>
2287         * cp-tree.h (CP_AGGREGATE_TYPE_P): Fix whitespace.
2289         * init.c (std_placement_new_fn_p): Remove outdated TODO comment that
2290         was resolved by r254694.
2292 2019-05-22  Jason Merrill  <jason@redhat.com>
2294         PR c++/20408 - unnecessary code for empty struct.
2295         * call.c (build_call_a): Use simple_empty_class_p.
2297         PR c++/86485 - -Wmaybe-unused with empty class ?:
2298         * cp-gimplify.c (simple_empty_class_p): Also true for MODIFY_EXPR.
2300 2019-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
2302         * parser.c (cp_parser_template_declaration_after_parameters): Use
2303         DECL_SOURCE_LOCATION in literal operator template errors.
2305 2019-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
2307         PR c++/67184
2308         PR c++/69445
2309         * call.c (build_over_call): Devirtualize when the final overrider
2310         comes from the base.
2312 2019-05-21  Nathan Sidwell  <nathan@acm.org>
2314         * name-lookup.c (do_nonmember_using_decl): Drop INSERT_P
2315         parameter.  Document.
2316         (finish_nonmember_using_decl): Adjust do_nonmember_using_decl
2317         calls.  Remove stray FIXME comment.
2319         * name-lookup.h (struct cp_binding_level): Drop usings field.
2320         (finish_namespace_using_decl, finish_local_using_decl): Replace with ...
2321         (finish_nonmember_using_decl): ... this.
2322         * name-lookup.c (push_using_decl_1, push_using_decl):
2323         (do_nonmember_using_decl): ... here.  Add INSERT_P arg.  Reimplement.
2324         (validate_nonmember_using_decl, finish_namespace_using_decl)
2325         (finish_local_using_decl): Replace with ...
2326         (finish_nonmember_using_decl): ... this.  Drop DECL parm.
2327         * parser.c (cp_parser_using_declaration): Don't do lookup here.
2328         * pt.c (tsubst_expr): Do not do using decl lookup here.
2330 2019-05-21  Eric Botcazou  <ebotcazou@adacore.com>
2332         * decl2.c (cpp_check) <IS_ASSIGNMENT_OPERATOR>: New case.
2334 2019-05-20  Marek Polacek  <polacek@redhat.com>
2336         CWG 2094 - volatile scalars are trivially copyable.
2337         PR c++/85679
2338         * tree.c (trivially_copyable_p): Don't check CP_TYPE_VOLATILE_P for
2339         scalar types.
2341 2019-05-20  Marek Polacek  <polacek@redhat.com>
2343         * pt.c (convert_template_argument): Add a diagnostic for the
2344         [temp.arg]/2 ambiguity case.
2346         * name-lookup.c (finish_using_directive): Don't issue inform() if the
2347         warning didn't trigger.  Add quoting.  Tweak the inform message.
2349 2019-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
2351         * cp-tree.h: Remove remnants of CONV_NONCONVERTING.
2353 2019-05-20  Nathan Sidwell  <nathan@acm.org>
2355         * name-lookup.c (finish_namespace_using_directive)
2356         (finish_local_using_directive): Merge to ...
2357         (finish_using_directive): ... here.  Handle both contexts.
2358         * name-lookup.h (finish_namespace_using_directive)
2359         (finish_local_using_directive): Replace with ...
2360         (finish_using_directive): ... this.
2361         * parser.c (cp_parser_using_directive): Adjust.
2362         * pt.c (tsubst_expr): Likewise.
2364         * cp-tree.h (struct lang_decl_ns): Remove usings field.
2365         (DECL_NAMESPACE_USING): Delete.
2366         * name-lookup.c (name_lookup::search_usings): Use namespace's
2367         binding scope.
2368         (name_lookup::queue_namespae): Likewise.
2369         (finish_namespace_using_directive, push_namespace): Likewise.
2370         (has_using_namespace_std_directive): Just search the entire
2371         binding stack.
2373 2019-05-20  Jonathan Wakely  <jwakely@redhat.com>
2375         PR c++/90532 Ensure __is_constructible(T[]) is false
2376         * method.c (is_xible_helper): Return error_mark_node for construction
2377         of an array of unknown bound.
2379 2019-05-17  Thomas Schwinge  <thomas@codesourcery.com>
2381         PR c++/89433
2382         * parser.c (cp_finalize_oacc_routine): Rework checking if already
2383         marked with an OpenACC 'routine' directive.
2385         PR c++/89433
2386         * parser.c (cp_parser_oacc_routine)
2387         (cp_parser_late_parsing_oacc_routine): Normalize order of clauses.
2388         (cp_finalize_oacc_routine): Call oacc_verify_routine_clauses.
2390         PR c++/89433
2391         * parser.c (cp_finalize_oacc_routine): Refer to OpenACC 'routine'
2392         clauses from "omp declare target" attribute.
2394 2019-05-16  Martin Sebor  <msebor@redhat.com>
2396         * call.c (print_z_candidate): Wrap diagnostic text in a gettext
2397         macro.  Adjust.
2398         (print_z_candidates): Same.
2399         (build_conditional_expr_1): Quote keywords, operators, and types
2400         in diagnostics.
2401         (build_op_delete_call): Same.
2402         (maybe_print_user_conv_context): Wrap diagnostic text in a gettext
2403         macro.
2404         (convert_like_real): Same.
2405         (convert_arg_to_ellipsis): Quote keywords, operators, and types
2406         in diagnostics.
2407         (build_over_call): Same.
2408         (joust): Break up an overlong line.  Wrap diagnostic text in a gettext
2409         macro.
2410         * constexpr.c (cxx_eval_check_shift_p): Spell out >= in English.
2411         (cxx_eval_constant_expression): Quote keywords, operators, and types
2412         in diagnostics.
2413         (potential_constant_expression_1): Same.
2414         * cp-gimplify.c (cp_genericize_r): Same.
2415         * cvt.c (maybe_warn_nodiscard): Quote keywords, operators, and types
2416         in diagnostics.
2417         (type_promotes_to): Same.
2418         * decl.c (check_previous_goto_1): Same.
2419         (check_goto): Same.
2420         (start_decl): Same.
2421         (cp_finish_decl): Avoid parenthesizing a sentence for consistency.
2422         (grok_op_properties): Quote keywords, operators, and types
2423         in diagnostics.
2424         * decl2.c (grokfield): Same.
2425         (coerce_delete_type): Same.
2426         * except.c (is_admissible_throw_operand_or_catch_parameter): Same.
2427         * friend.c (do_friend): Quote C++ tokens.
2428         * init.c (build_new_1): Quote keywords, operators, and types
2429         in diagnostics.
2430         (build_vec_delete_1): Same.
2431         (build_delete): Same.
2432         * lex.c (parse_strconst_pragma): Same.
2433         (handle_pragma_implementation): Same.
2434         (unqualified_fn_lookup_error): Same.
2435         * mangle.c (write_type): Same.
2436         * method.c (defaulted_late_check): Avoid two consecutive punctuators.
2437         * name-lookup.c (cp_binding_level_debug): Remove a trailing newline.
2438         (pop_everything): Same.
2439         * parser.c (cp_lexer_start_debugging): Quote a macro name.
2440         in a diagnostic
2441         (cp_lexer_stop_debugging): Same.
2442         (cp_parser_userdef_numeric_literal): Quote a C++ header name
2443         in a diagnostic.
2444         (cp_parser_nested_name_specifier_opt): Quote keywords, operators,
2445         and types in diagnostics.
2446         (cp_parser_question_colon_clause): Same.
2447         (cp_parser_asm_definition): Same.
2448         (cp_parser_init_declarator): Same.
2449         (cp_parser_template_declaration_after_parameters): Avoid capitalizing
2450         a sentence in a diagnostic.
2451         (cp_parser_omp_declare_reduction): Quote keywords, operators, and types
2452         in diagnostics.
2453         (cp_parser_transaction): Same.
2454         * pt.c (maybe_process_partial_specialization): Replace second call
2455         to permerror with inform for consistency with other uses.
2456         (expand_integer_pack): Quote keywords, operators, and types
2457         in diagnostics.
2458         * rtti.c (get_typeid): Quote keywords, operators, and types
2459         in diagnostics.
2460         (build_dynamic_cast_1): Same.
2461         * semantics.c (finish_asm_stmt): Same.
2462         (finish_label_decl): Same.
2463         (finish_bases): Same.
2464         (finish_offsetof): Same.
2465         (cp_check_omp_declare_reduction): Same.
2466         (finish_decltype_type): Same.
2467         * tree.c (handle_init_priority_attribute): Same.  Add detail
2468         to diagnostics.
2469         (maybe_warn_zero_as_null_pointer_constant): Same.
2470         * typeck.c (cp_build_binary_op): Quote keywords, operators, and types
2471         in diagnostics.
2472         (cp_build_unary_op): Same.
2473         (check_for_casting_away_constness): Same.
2474         (build_static_cast): Same.
2475         (build_const_cast_1): Same.
2476         (maybe_warn_about_returning_address_of_local): Same.
2477         (check_return_expr): Same.
2478         * typeck2.c (abstract_virtuals_error_sfinae): Same.
2479         (digest_init_r): Replace a tab with spaces in a diagnostic.
2480         (build_functional_cast): Quote keywords, operators, and types
2481         in diagnostics.
2483 2019-05-15  Jakub Jelinek  <jakub@redhat.com>
2485         PR debug/90197
2486         * cp-gimplify.c (genericize_cp_loop): Emit a DEBUG_BEGIN_STMT
2487         before the condition (or if missing or constant non-zero at the end
2488         of the loop.  Emit a DEBUG_BEGIN_STMT before the increment expression
2489         if any.  Don't call protected_set_expr_location on incr if it already
2490         has a location.
2492 2019-05-15  Marek Polacek  <polacek@redhat.com>
2494         CWG 2096 - constraints on literal unions.
2495         * class.c (check_field_decls): Initialize booleans directly.  A union
2496         is literal if at least one of its non-static data members is of
2497         non-volatile literal type.
2499 2019-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
2501         * cp-tree.h (REFERENCE_VLA_OK): Remove.
2502         * lambda.c (build_capture_proxy): Remove use of the above.
2504 2019-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
2506         * call.c (perform_overload_resolution, build_new_method_call_1):
2507         Use OVL_P; remove redundant TEMPLATE_DECL checks.
2508         * decl.c (grokfndecl): Likewise.
2509         * mangle.c (write_expression): Likewise.
2510         * parser.c (cp_parser_template_id): Likewise.
2511         * pt.c (resolve_overloaded_unification, type_dependent_expression_p):
2512         Likewise.
2513         * search.c (build_baselink): Likewise.
2514         * tree.c (is_overloaded_fn, dependent_name, maybe_get_fns): Likewise.
2516 2019-05-14  Paolo Carlini  <paolo.carlini@oracle.com>
2518         PR preprocessor/90382
2519         * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
2520         min_location.
2522 2019-05-13  Jason Merrill  <jason@redhat.com>
2524         Use releasing_vec more broadly.
2525         * cp-tree.h (struct releasing_vec): Replace get_ref method with
2526         operator&.
2527         (vec_safe_push, vec_safe_reserve, vec_safe_length, vec_safe_splice):
2528         Forwarding functions for releasing_vec.
2529         (release_tree_vector): Declare but don't define.
2530         * call.c (build_op_delete_call, build_temp, call_copy_ctor)
2531         (perform_direct_initialization_if_possible): Use releasing_vec.
2532         * constexpr.c (cxx_eval_vec_init_1, cxx_eval_store_expression):
2533         Likewise.
2534         * cp-gimplify.c (cp_fold): Likewise.
2535         * cvt.c (force_rvalue, ocp_convert): Likewise.
2536         * decl.c (get_tuple_decomp_init): Likewise.
2537         * except.c (build_throw): Likewise.
2538         * init.c (perform_member_init, expand_default_init): Likewise.
2539         * method.c (do_build_copy_assign, locate_fn_flags): Likewise.
2540         * parser.c (cp_parser_userdef_char_literal)
2541         (cp_parser_userdef_numeric_literal)
2542         (cp_parser_userdef_string_literal)
2543         (cp_parser_perform_range_for_lookup)
2544         (cp_parser_range_for_member_function, cp_parser_omp_for_loop)
2545         (cp_parser_omp_for_loop_init): Likewise.
2546         * pt.c (tsubst_copy_and_build, do_class_deduction): Likewise.
2547         * semantics.c (calculate_direct_bases, calculate_bases)
2548         (finish_omp_barrier, finish_omp_flush, finish_omp_taskwait)
2549         (finish_omp_taskyield, finish_omp_cancel)
2550         (finish_omp_cancellation_point): Likewise.
2551         * tree.c (build_vec_init_elt, strip_typedefs, strip_typedefs_expr)
2552         (build_min_non_dep_op_overload): Likewise.
2553         * typeck.c (build_function_call_vec, cp_build_function_call_nary)
2554         (cp_build_modify_expr): Likewise.
2555         * typeck2.c (build_functional_cast): Likewise.
2557 2019-05-11  Paolo Carlini  <paolo.carlini@oracle.com>
2559         * typeck.c (cp_build_function_call_vec): When mark_used fails
2560         unconditionally return error_mark_node.
2562 2019-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
2564         * decl.c (grokvardecl): Use an accurate location in error message
2565         about main as a global variable.
2567 2019-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
2569         * call.c (build_call_a): Use FUNC_OR_METHOD_TYPE_P.
2570         * cp-gimplify.c (cp_fold): Likewise.
2571         * cp-objcp-common.c (cp_type_dwarf_attribute): Likewise.
2572         * cp-tree.h (TYPE_OBJ_P, TYPE_PTROBV_P): Likewise.
2573         * cvt.c (perform_qualification_conversions): Likewise.
2574         * decl.c (grokdeclarator): Likewise.
2575         * decl2.c (build_memfn_type): Likewise.
2576         * mangle.c (canonicalize_for_substitution, write_type): Likewise.
2577         * parser.c (cp_parser_omp_declare_reduction): Likewise.
2578         * pt.c (check_explicit_specialization, uses_deducible_template_parms,
2579         check_cv_quals_for_unify, dependent_type_p_r): Likewise.
2580         * rtti.c (ptr_initializer): Likewise.
2581         * semantics.c (finish_asm_stmt, finish_offsetof,
2582         cp_check_omp_declare_reduction): Likewise.
2583         * tree.c (cp_build_qualified_type_real,
2584         cp_build_type_attribute_variant, cxx_type_hash_eq,
2585         cxx_copy_lang_qualifiers, cp_free_lang_data): Likewise.
2586         * typeck.c (structural_comptypes, convert_arguments,
2587         cp_build_addr_expr_1, unary_complex_lvalue, cp_build_c_cast,
2588         cp_build_modify_expr, comp_ptr_ttypes_real, type_memfn_rqual):
2589         Likewise.
2591 2019-05-10  Marek Polacek  <polacek@redhat.com>
2593         PR c++/78010 - bogus -Wsuggest-override warning on final function.
2594         * class.c (check_for_override): Don't warn for final functions.
2596 2019-05-10  Jakub Jelinek  <jakub@redhat.com>
2598         PR pch/90326
2599         * config-lang.in (gtfiles): Remove c-family/c-lex.c, add
2600         c-family/c-cppbuiltin.c.
2602 2019-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
2604         PR c++/90382
2605         Revert:
2606         2018-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
2608         * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
2609         min_location.
2611 2019-05-08  Nathan Sidwell  <nathan@acm.org>
2613         Kill DECL_SAVED_FUNCTION_DATA .
2614         * cp-tree.h (language_function): Remove x_auto_return_pattern.
2615         (current_function_auto_return_pattern): Delete.
2616         (lang_decl_fn): Replace saved_language_function with
2617         saved_auto_return type.
2618         (DECL_SAVED_FUNCTION_DATA): Delete.
2619         (DECL_SAVED_AUTO_RETURN_TYPE): New.
2620         (FNDECL_USED_AUTO): Correct documentation.
2621         * decl.c (duplicate_decls): Adjust AUTO return handling.
2622         (start_preparsed_function): Replace
2623         current_function_auto_return_pattern with
2624         DECL_SAVED_AUTO_RETURN_TYPE.  Remove DECL_SAVED_FUNCTION_DATA
2625         zapping.
2626         (finish_function): Likewise.
2627         (save_function_data): Delete.
2628         (fndecl_declared_return_type): Reimplement.
2629         * mangle.c (write_unqualified_name): Use DECL_SAVED_AUTO_RETURN_TYPE.
2630         * method.c (make_thunk, make_alias_for): Likewise.
2631         * parser.c (cp_parser_jump_statement): Likewise.
2632         * pt.c (do_auto_deduction): Likewise.
2633         * typeck.c (check_return_expr): Likewise.
2635 2019-05-06  Jason Merrill  <jason@redhat.com>
2637         PR c++/90171 - reorganize usual_deallocation_fn_p
2638         * call.c (struct dealloc_info): New.
2639         (usual_deallocation_fn_p): Take a dealloc_info*.
2640         (aligned_deallocation_fn_p, sized_deallocation_fn_p): Remove.
2641         (build_op_delete_call): Adjust.
2643 2019-05-07  Jason Merrill  <jason@redhat.com>
2645         PR c++/86485 - -Wmaybe-unused with empty class ?:
2646         * typeck.c (build_static_cast_1): Use cp_build_addr_expr.
2648         * pt.c (type_dependent_expression_p): A non-type template parm with
2649         a placeholder type is type-dependent.
2651 2019-05-06  Marek Polacek  <polacek@redhat.com>
2653         PR c++/90265 - ICE with generic lambda.
2654         * pt.c (tsubst_copy_and_build): Use a dedicated variable for the last
2655         element in the vector.
2657 2019-05-03  Martin Liska  <mliska@suse.cz>
2659         * call.c (build_aggr_conv): Use is_empty instead of
2660         elements () == 0 (and similar usages).
2661         * parser.c (cp_parser_lambda_introducer): Likewise.
2663 2019-05-02  Nathan Sidwell  <nathan@acm.org>
2665         * semantics.c (finish_id_expression_1): Remove unreachable code.
2667 2019-05-01  Nathan Sidwell  <nathan@acm.org>
2669         * name-lookup.h (get_class_binding_direct): Change final arg to
2670         bool.
2671         (get_class_binding): Likewise.
2672         * name-lookup.c (get_class_binding_direct): Replace TYPE_OR_FNS
2673         arg with WANT_TYPE bool.  Simplify.
2674         (get_class_binding): Adjust final arg.
2675         * decl.c (reshape_init_class): Adjust get_class_binding calls.
2677 2019-04-30  Nathan Sidwell  <nathan@acm.org>
2679         * cp-objcp-common.c (cp_common_init_ts): Use MARK_TS_EXP for _EXPR
2680         nodes.  Call c_common_init_ts.
2682 2019-04-29  Nathan Sidwell  <nathan@acm.org>
2684         * decl.c (duplicate_decls): Add whitespace, move comments into
2685         conditional blocks.
2686         * method.c (explain_implicit_non_constexpr): Refactor.
2687         * pt.c (check_explicit_specialization): Fix indentation.
2688         * semantics.c (process_outer_var_ref): Reformat.
2689         (finish_id_expression_1): Use STRIP_TEMPLATE.
2691 2019-04-26  Jonathan Wakely  <jwakely@redhat.com>
2693         PR c++/90243 - orphaned note in uninstantiated constexpr function
2694         * decl.c (check_for_uninitialized_const_var): Suppress notes if no
2695         error was shown.
2697 2019-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
2699         PR c++/90173
2700         * decl.c (grokdeclarator): Set type to error_mark_node
2701         upon error about template placeholder type non followed
2702         by a simple declarator-id.
2704 2019-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
2706         * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
2707         min_location.
2709 2019-04-24  Jason Merrill  <jason@redhat.com>
2711         PR c++/90227 - error with template parameter packs.
2712         * pt.c (coerce_template_parms): Do add empty pack when
2713         require_all_args.
2715 2019-04-24  Richard Biener  <rguenther@suse.de>
2717         * call.c (null_ptr_cst_p): Order checks according to expensiveness.
2718         (conversion_null_warnings): Likewise.
2719         * typeck.c (same_type_ignoring_top_level_qualifiers_p): Return
2720         early if type1 == type2.
2722 2019-04-22  Jason Merrill  <jason@redhat.com>
2724         PR c++/87366 - wrong error with alias template.
2725         * typeck.c (structural_comptypes): When comparing_specializations,
2726         aliases are unequal.
2727         (comptypes): When comparing_specializations, do structural
2728         comparison.
2730 2019-04-19  Jason Merrill  <jason@redhat.com>
2732         PR c++/90190 - CTAD with list-constructor.
2733         * pt.c (do_class_deduction): Don't try the single element deduction
2734         if the single element is also a braced list.
2736         PR c++/90171 - ICE with destroying delete with size_t parm.
2737         * call.c (sized_deallocation_fn_p): New.  Use it instead of
2738         second_parm_is_size_t in most cases.
2739         (second_parm_is_size_t): Don't check for aligned.
2741 2019-04-19  Paolo Carlini  <paolo.carlini@oracle.com>
2743         PR c++/89900
2744         * pt.c (fn_type_unification): When handling null explicit
2745         arguments do not special case non-parameter packs.
2747 2019-04-19  Jakub Jelinek  <jakub@redhat.com>
2749         PR c++/90138
2750         * pt.c (process_template_parm): Set decl to pushdecl result.  If
2751         !is_non_type, also set parm to that.
2753         PR c/89888
2754         * decl.c (struct cp_switch): Remove outside_range_p member.
2755         (push_switch): Don't clear it.
2756         (pop_switch): Adjust c_do_switch_warnings caller.
2757         (finish_case_label): Adjust c_add_case_label caller.
2759         PR c++/90108
2760         * decl.c (duplicate_decls): If remove is main variant and
2761         DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
2762         variant that has newdecl as TYPE_NAME if any.
2764 2019-04-18  Jason Merrill  <jason@redhat.com>
2766         PR c++/87554 - ICE with extern template and reference member.
2767         * decl.c (cp_finish_decl): Don't set DECL_INITIAL of external vars.
2769 2019-04-17  Jason Merrill  <jason@redhat.com>
2771         PR c++/90047 - ICE with enable_if alias template.
2772         * pt.c (tsubst_decl) [TYPE_DECL]: Don't put an erroneous decl in the
2773         hash table when we're in SFINAE context.
2775 2019-04-17  Marek Polacek  <polacek@redhat.com>
2777         PR c++/90124 - bogus error with incomplete type in decltype.
2778         * typeck.c (build_class_member_access_expr): Check
2779         cp_unevaluated_operand.
2781 2019-04-12  Jakub Jelinek  <jakub@redhat.com>
2783         PR c/89933
2784         * decl.c (duplicate_decls): When newdecl's type is its main variant,
2785         don't try to remove it from the variant list, but instead assert
2786         it has no variants.
2788 2019-04-12  Martin Sebor  <msebor@redhat.com>
2790         PR c/88383
2791         PR c/89288
2792         * parser.c (cp_parser_has_attribute_expression): Handle assignment
2793         expressions.
2795 2019-04-12  Jason Merrill  <jason@redhat.com>
2797         * call.c (null_member_pointer_value_p): Handle an empty CONSTRUCTOR
2798         of PMF type.
2800 2019-04-12  Marek Polacek  <polacek@redhat.com>
2802         * except.c (build_noexcept_spec): Use build_converted_constant_bool_expr
2803         instead of perform_implicit_conversion_flags.
2805         PR c++/87603 - constexpr functions are no longer noexcept.
2806         * constexpr.c (is_sub_constant_expr): Remove unused function.
2807         * cp-tree.h (is_sub_constant_expr): Remove declaration.
2808         * except.c (check_noexcept_r): Don't consider a call to a constexpr
2809         function noexcept.
2811 2019-04-11  Jakub Jelinek  <jakub@redhat.com>
2813         PR translation/90035
2814         * parser.h (struct cp_parser): Add
2815         type_definition_forbidden_message_arg member.
2816         * parser.c (cp_debug_parser): Print it.
2817         (cp_parser_check_type_definition): Pass
2818         parser->type_definition_forbidden_message_arg as second argument to
2819         error.
2820         (cp_parser_has_attribute_expression, cp_parser_sizeof_operand): Set
2821         parser->type_definition_forbidden_message_arg and use G_() with
2822         %qs for parser->type_definition_forbidden_message instead of
2823         building untranslatable message using concat.
2825 2019-04-09  Jakub Jelinek  <jakub@redhat.com>
2827         PR translation/90011
2828         * typeck2.c (check_narrowing): Remove trailing space from diagnostics.
2830 2019-04-08  Marek Polacek  <polacek@redhat.com>
2832         * typeck2.c (digest_init_r): Don't condition the object slicing warning
2833         on flag_checking.
2835 2019-04-08  Paolo Carlini  <paolo.carlini@oracle.com>
2837         PR c++/89914
2838         * semantics.c (trait_expr_value): Don't use TYPE_NOTHROW_P
2839         when maybe_instantiate_noexcept fails.
2840         (classtype_has_nothrow_assign_or_copy_p): Likewise.
2841         * method.c (implicitly_declare_fn): Avoid passing error_mark_node
2842         to build_exception_variant.
2844 2019-04-05  Marek Polacek  <polacek@redhat.com>
2846         PR c++/87145 - bogus error converting class type in template arg list.
2847         * pt.c (convert_nontype_argument): Don't call
2848         build_converted_constant_expr if it could involve calling a conversion
2849         function with a instantiation-dependent constructor as its argument.
2851 2019-04-05  Martin Sebor  <msebor@redhat.com>
2853         PR bootstrap/89980
2854         * decl.c (reshape_init_array_1): Avoid treating empty strings
2855         as zeros in array initializers.
2856         Use trivial_type_p () instead of TYPE_HAS_TRIVIAL_DFLT().
2858 2019-04-04  Jason Merrill  <jason@redhat.com>
2860         PR c++/89948 - ICE with break in statement-expr.
2861         * constexpr.c (cxx_eval_statement_list): Jumping out of a
2862         statement-expr is non-constant.
2864 2019-04-04  Jason Merrill  <jason@redhat.com>
2866         PR c++/89966 - error with non-type auto tparm.
2867         * pt.c (do_auto_deduction): Clear tf_partial.
2869 2019-04-04  Jason Merrill  <jason@redhat.com>
2871         PR c++/86986 - ICE with TTP with parameter pack.
2872         * pt.c (coerce_template_parameter_pack): Only look at the type of a
2873         non-type parameter pack.
2874         (fixed_parameter_pack_p_1): Don't recurse into the type of a
2875         non-type parameter pack.
2876         (coerce_template_template_parms): Call add_outermost_template_args.
2878 2019-04-04  Martin Sebor  <msebor@redhat.com>
2880         PR c++/89974
2881         PR c++/89878
2882         PR c++/89833
2883         PR c++/47488
2884         * decl.c (reshape_init_array_1): Strip trailing zero-initializers
2885         from arrays of trivial type and known size.
2886         * mangle.c (write_expression): Convert braced initializer lists
2887         to STRING_CSTs.
2888         (write_expression): Trim trailing zero-initializers from arrays
2889         of trivial type.
2890         (write_template_arg_literal): Mangle strings the same as braced
2891         initializer lists.
2893 2019-04-03  Jason Merrill  <jason@redhat.com>
2895         PR c++/81866 - ICE with member template and default targ.
2896         * pt.c (tsubst_template_decl): Handle getting a type from
2897         retrieve_specialization.
2899         PR c++/86586 - -fcompare-debug=-Wsign-compare.
2900         * typeck.c (cp_build_binary_op): Don't fold for -Wsign-compare.
2902         PR c++/89331 - ICE with offsetof in incomplete class.
2903         * semantics.c (finish_offsetof): Handle error_mark_node.
2904         * typeck.c (build_class_member_access_expr): Call
2905         complete_type_or_maybe_complain before converting to base.
2907         PR c++/89917 - ICE with lambda in variadic mem-init.
2908         * pt.c (make_pack_expansion): Change type_pack_expansion_p to false.
2910 2019-04-01  Jason Merrill  <jason@redhat.com>
2912         PR c++/86946 - ICE with function call in template argument.
2913         DR 1321
2914         * pt.c (iterative_hash_template_arg) [CALL_EXPR]: Use
2915         dependent_name.
2917 2019-04-01  Paolo Carlini  <paolo.carlini@oracle.com>
2919         PR c++/62207
2920         * pt.c (tsubst_copy): Deal with lookup_name not returing a variable.
2922 2019-03-31  Marek Polacek  <polacek@redhat.com>
2924         PR c++/89852 - ICE with C++11 functional cast with { }.
2925         * constexpr.c (fold_non_dependent_expr_template): New static function
2926         broken out of...
2927         (fold_non_dependent_expr): ...here.
2928         (fold_non_dependent_init): New function.
2929         * cp-tree.h (fold_non_dependent_init): Declare.
2930         * typeck2.c (massage_init_elt): Call fold_non_dependent_init instead
2931         of fold_non_dependent_expr.  Don't call maybe_constant_init.
2933 2019-03-30  Jason Merrill  <jason@redhat.com>
2935         PR c++/89744 - ICE with specialization of member class template.
2936         * pt.c (lookup_template_class_1): If the partial instantiation is
2937         explicitly specialized, adjust.
2938         (maybe_process_partial_specialization): Also adjust
2939         CLASSTYPE_TI_ARGS.
2941 2019-03-29  Jakub Jelinek  <jakub@redhat.com>
2943         PR sanitizer/89869
2944         * typeck.c: Include gimplify.h.
2945         (cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it
2946         for second time.  Formatting fixes.
2948 2019-03-29  Marek Polacek  <polacek@redhat.com>
2950         PR c++/89876 - ICE with deprecated conversion.
2951         * call.c (convert_like_real): Only give warnings with tf_warning.
2953 2019-03-28  Marek Polacek  <polacek@redhat.com>
2955         PR c++/89612 - ICE with member friend template with noexcept.
2956         * pt.c (maybe_instantiate_noexcept): For function templates, use their
2957         template result (function decl).  Don't set up local specializations.
2958         Temporarily turn on processing_template_decl.  Update the template type
2959         too.
2961         PR c++/89836 - bool constant expression and explicit conversions.
2962         * call.c (build_converted_constant_expr_internal): New function,
2963         renamed from...
2964         (build_converted_constant_expr): ...this.  New.
2965         (build_converted_constant_bool_expr): New.
2966         * cp-tree.h (build_converted_constant_bool_expr): Declare.
2967         * decl.c (build_explicit_specifier): Call
2968         build_converted_constant_bool_expr.
2970 2019-03-28  Jakub Jelinek  <jakub@redhat.com>
2972         PR c++/89785
2973         * constexpr.c (struct check_for_return_continue_data): New type.
2974         (check_for_return_continue): New function.
2975         (potential_constant_expression_1) <case SWITCH_STMT>: Walk
2976         SWITCH_STMT_BODY to find RETURN_EXPRs or CONTINUE_STMTs not nested
2977         in loop bodies and set *jump_target to that if found.
2979 2019-03-27  Jason Merrill  <jason@redhat.com>
2981         PR c++/89831 - error with qualified-id in const member function.
2982         * semantics.c (finish_non_static_data_member): Use object cv-quals
2983         in scoped case, too.
2985         PR c++/89421 - ICE with lambda in template parameter list.
2986         * parser.c (cp_parser_lambda_expression): Also reject a lambda in a
2987         template parameter list before C++20.
2988         * pt.c (type_dependent_expression_p): True for LAMBDA_EXPR.
2989         * semantics.c (begin_class_definition): Restore error about defining
2990         non-lambda class in template parm list.
2992 2019-03-26  Jason Merrill  <jason@redhat.com>
2994         PR c++/86932 - missed SFINAE with empty pack.
2995         * pt.c (coerce_template_parms): Don't add an empty pack if
2996         tf_partial.
2997         (fn_type_unification): Pass tf_partial to coerce_template_parms.
2999         PR c++/86429 - constexpr variable in lambda.
3000         PR c++/82643
3001         PR c++/87327
3002         * constexpr.c (cxx_eval_constant_expression): In a lambda function,
3003         try evaluating the captured variable directly.
3005 2019-03-26  Jakub Jelinek  <jakub@redhat.com>
3007         PR c++/89796
3008         * semantics.c (finish_omp_atomic): Add warning_sentinel for
3009         -Wunused-value around finish_expr_stmt call.
3011 2019-03-25  Paolo Carlini  <paolo.carlini@oracle.com>
3013         PR c++/84661
3014         PR c++/85013
3015         * parser.c (cp_parser_binary_expression): Don't call cp_fully_fold
3016         to undo the disabling of warnings.
3018 2019-03-25  Jason Merrill  <jason@redhat.com>
3020         PR c++/87748 - substitution failure error with decltype.
3021         * pt.c (most_specialized_partial_spec): Clear
3022         processing_template_decl.
3024 2019-03-25  Marek Polacek  <polacek@redhat.com>
3026         PR c++/89214 - ICE when initializing aggregates with bases.
3027         * typeck2.c (digest_init_r): Warn about object slicing instead of
3028         crashing.
3030         PR c++/89705 - ICE with reference binding with conversion function.
3031         * call.c (reference_binding): If the result of the conversion function
3032         is a prvalue of non-class type, use the cv-unqualified type.
3034 2019-03-25  Nathan Sidwell  <nathan@acm.org>
3036         * lambda.c (maybe_add_lambda_conv_op): Don't add to comdat group.
3038 2019-03-22  Jakub Jelinek  <jakub@redhat.com>
3040         PR c++/60702
3041         * cp-tree.h (get_tls_wrapper_fn): Remove declaration.
3042         (maybe_get_tls_wrapper_call): Declare.
3043         * decl2.c (get_tls_wrapper_fn): Make static.
3044         (maybe_get_tls_wrapper_call): New function.
3045         * typeck.c (build_class_member_access_expr): Handle accesses to TLS
3046         variables.
3047         * semantics.c (finish_qualified_id_expr): Likewise.
3048         (finish_id_expression_1): Use maybe_get_tls_wrapper_call.
3049         * pt.c (tsubst_copy_and_build): Likewise.
3051         PR c++/87481
3052         * constexpr.c (struct constexpr_ctx): Add constexpr_ops_count member.
3053         (cxx_eval_constant_expression): When not skipping, not constant class
3054         or location wrapper, increment *ctx->constexpr_ops_count and if it is
3055         above constexpr_loop_nest_limit, diagnose failure.
3056         (cxx_eval_outermost_constant_expr): Add constexpr_ops_count and
3057         initialize ctx.constexpr_ops_count to its address.
3058         (is_sub_constant_expr): Likewise.
3060 2019-03-21  Jakub Jelinek  <jakub@redhat.com>
3062         PR c++/71446
3063         * call.c (filed_in_pset): Change pset from hash_set<tree> * to
3064         hash_set<tree, true> &, adjust uses accordingly.
3065         (build_aggr_conv): Change pset from hash_set<tree> *
3066         to hash_set<tree, true>.  Replace goto fail; with return NULL;,
3067         adjust pset uses.
3069         PR c++/89767
3070         * parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id
3071         variables, check for duplicates in this function.
3072         * lambda.c (add_capture): Don't check for duplicates nor use
3073         IDENTIFIER_MARKED.
3074         (register_capture_members): Don't clear IDENTIFIER_MARKED here.
3076 2019-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
3078         PR c++/89571
3079         * method.c (after_nsdmi_defaulted_late_checks): Avoid passing
3080         error_mark_node to comp_except_specs.
3082 2019-03-20  Jason Merrill  <jason@redhat.com>
3084         PR c++/87480 - decltype of member access in default template arg
3085         * pt.c (type_unification_real): Accept a dependent result in
3086         template context.
3088 2019-03-19  Martin Sebor  <msebor@redhat.com>
3090         PR tree-optimization/89688
3091         * typeck2.c (store_init_value): Call braced_lists_to_string for more
3092         kinds of initializers.
3094 2019-03-18  Jason Merrill  <jason@redhat.com>
3096         PR c++/89630 - ICE with dependent using-decl as template arg.
3097         * tree.c (cp_tree_equal): Always return false for USING_DECL.
3099         PR c++/89761 - ICE with sizeof... in pack expansion.
3100         * pt.c (argument_pack_element_is_expansion_p): Handle
3101         ARGUMENT_PACK_SELECT.
3103         PR c++/89640 - GNU attributes on lambda.
3104         * parser.c (cp_parser_lambda_declarator_opt): Allow GNU attributes.
3106         PR c++/89682 - wrong access error in default argument.
3107         * pt.c (tsubst_default_argument): Don't defer access checks.
3109 2019-03-18  Paolo Carlini  <paolo.carlini@oracle.com>
3111         PR c++/85014
3112         * semantics.c (finish_non_static_data_member): Check return value
3113         of context_for_name_lookup and immediately return error_mark_node
3114         if isn't a type.
3116 2019-03-17  Jason Merrill  <jason@redhat.com>
3118         PR c++/89571 - ICE with ill-formed noexcept on constructor.
3119         * pt.c (maybe_instantiate_noexcept): Only return false if defaulted.
3120         (regenerate_decl_from_template): Use it for noexcept-specs.
3122 2019-03-14  Jason Merrill  <jason@redhat.com>
3124         * parser.c (cp_parser_decl_specifier_seq): Support C++20
3125         concept-definition syntax without 'bool'.
3127 2019-03-14  Jakub Jelinek  <jakub@redhat.com>
3129         PR c++/89512
3130         * semantics.c (finish_qualified_id_expr): Reject variable templates.
3132         PR c++/89652
3133         * constexpr.c (struct constexpr_ctx): Change save_exprs type from
3134         hash_set<tree> to vec<tree>.
3135         (cxx_eval_call_expression): Adjust for save_exprs being a vec instead
3136         of hash_set.
3137         (cxx_eval_loop_expr): Likewise.  Truncate the vector after each
3138         removal of SAVE_EXPRs from values.
3139         (cxx_eval_constant_expression) <case SAVE_EXPR>: Call safe_push
3140         method on save_exprs instead of add.
3142 2019-03-13  Jason Merrill  <jason@redhat.com>
3144         PR c++/86521 - C++17 copy elision in initialization by constructor.
3145         * call.c (joust_maybe_elide_copy): New.
3146         (joust): Call it.
3148 2019-03-13  Marek Polacek  <polacek@redhat.com>
3150         PR c++/88979 - further P0634 fix for constructors.
3151         * parser.c (cp_parser_decl_specifier_seq): Pass flags to
3152         cp_parser_constructor_declarator_p.
3153         (cp_parser_direct_declarator): Allow missing typename for constructor
3154         parameters.
3155         (cp_parser_constructor_declarator_p): Add FLAGS parameter.  Pass it to
3156         cp_parser_type_specifier.
3158         PR c++/89686 - mixing init-capture and simple-capture in lambda.
3159         * parser.c (cp_parser_lambda_introducer): Give error when combining
3160         init-capture and simple-capture.
3162         PR c++/89660 - bogus error with -Wredundant-move.
3163         * typeck.c (maybe_warn_pessimizing_move): Only accept (T &) &arg
3164         as the std::move's argument.  Don't call convert_for_initialization
3165         when warn_redundant_move isn't on.
3167 2019-03-11  Jason Merrill  <jason@redhat.com>
3169         PR c++/86521 - wrong overload resolution with ref-qualifiers.
3170         * call.c (build_user_type_conversion_1): Don't use a conversion to a
3171         reference of the wrong rvalueness for direct binding.
3173 2019-03-11  Martin Liska  <mliska@suse.cz>
3175         * cvt.c (build_expr_type_conversion): Wrap apostrophes
3176         in gcc internal format with %'.
3177         * decl.c (check_no_redeclaration_friend_default_args): Likewise.
3178         (grokfndecl): Likewise.
3179         * name-lookup.c (do_pushtag): Likewise.
3180         * pt.c (unify_parameter_deduction_failure): Likewise.
3181         (unify_template_deduction_failure): Likewise.
3183 2019-03-11  Martin Liska  <mliska@suse.cz>
3185         * call.c (convert_arg_to_ellipsis): Wrap an option name
3186         in a string format message and fix GNU coding style.
3187         (build_over_call): Likewise.
3188         * class.c (check_field_decl): Likewise.
3189         (layout_nonempty_base_or_field): Likewise.
3190         * constexpr.c (cxx_eval_loop_expr): Likewise.
3191         * cvt.c (type_promotes_to): Likewise.
3192         * decl.c (cxx_init_decl_processing): Likewise.
3193         (mark_inline_variable): Likewise.
3194         (grokdeclarator): Likewise.
3195         * decl2.c (record_mangling): Likewise.
3196         * error.c (maybe_warn_cpp0x): Likewise.
3197         * except.c (doing_eh): Likewise.
3198         * mangle.c (maybe_check_abi_tags): Likewise.
3199         * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
3200         (cp_parser_userdef_numeric_literal): Likewise.
3201         (cp_parser_primary_expression): Likewise.
3202         (cp_parser_unqualified_id): Likewise.
3203         (cp_parser_pseudo_destructor_name): Likewise.
3204         (cp_parser_builtin_offsetof): Likewise.
3205         (cp_parser_lambda_expression): Likewise.
3206         (cp_parser_lambda_introducer): Likewise.
3207         (cp_parser_lambda_declarator_opt): Likewise.
3208         (cp_parser_selection_statement): Likewise.
3209         (cp_parser_init_statement): Likewise.
3210         (cp_parser_decomposition_declaration): Likewise.
3211         (cp_parser_function_specifier_opt): Likewise.
3212         (cp_parser_static_assert): Likewise.
3213         (cp_parser_simple_type_specifier): Likewise.
3214         (cp_parser_namespace_definition): Likewise.
3215         (cp_parser_using_declaration): Likewise.
3216         (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
3217         (cp_parser_initializer_list): Likewise.
3218         (cp_parser_type_parameter_key): Likewise.
3219         (cp_parser_member_declaration): Likewise.
3220         (cp_parser_try_block): Likewise.
3221         (cp_parser_std_attribute_spec): Likewise.
3222         (cp_parser_requires_clause_opt): Likewise.
3223         * pt.c (check_template_variable): Likewise.
3224         (check_default_tmpl_args): Likewise.
3225         (push_tinst_level_loc): Likewise.
3226         (instantiate_pending_templates): Likewise.
3227         (invalid_nontype_parm_type_p): Likewise.
3228         * repo.c (get_base_filename): Likewise.
3229         * rtti.c (typeid_ok_p): Likewise.
3230         (build_dynamic_cast_1): Likewise.
3231         * tree.c (maybe_warn_parm_abi): Likewise.
3233 2019-03-08  Jakub Jelinek  <jakub@redhat.com>
3235         PR other/80058
3236         * parser.c (cp_parser_template_declaration_after_parameters): Avoid
3237         one space before " at the end of line and another after " on another
3238         line in a string literal.
3240         PR tree-optimization/89550
3241         * semantics.c (maybe_convert_cond): Only set TREE_NO_WARNING if
3242         warning_at returned true.
3243         * decl2.c (c_parse_final_cleanups): Likewise.
3244         * typeck.c (convert_for_assignment): Likewise.
3245         * decl.c (finish_function): Likewise.
3247         PR c++/89585
3248         * parser.c (cp_parser_asm_definition): Just warn instead of error
3249         on volatile qualifier outside of function body.
3251         PR c++/89599
3252         * constexpr.c (potential_constant_expression_1): Reject
3253         REINTERPRET_CAST_P NOP_EXPRs.
3255         PR c++/89622
3256         * call.c (joust): Call print_z_candidate only if pedwarn returned
3257         true.
3259 2019-03-07  Jason Merrill  <jason@redhat.com>
3261         PR c++/88123 - lambda and using-directive.
3262         * name-lookup.c (op_unqualified_lookup)
3263         (maybe_save_operator_binding, discard_operator_bindings)
3264         (push_operator_bindings): New.
3265         * typeck.c (build_x_binary_op, build_x_unary_op): Call
3266         maybe_save_operator_binding.
3267         * decl.c (start_preparsed_function): Call push_operator_bindings.
3268         * tree.c (cp_free_lang_data): Call discard_operator_bindings.
3270         PR c++/88820 - ICE with CTAD and member template used in DMI.
3271         * pt.c (do_class_deduction): Handle parm used as its own arg.
3273 2019-03-07  Jakub Jelinek  <jakub@redhat.com>
3275         PR c++/89585
3276         * parser.c (cp_parser_asm_definition): Parse asm qualifiers even
3277         at toplevel, but diagnose them.
3279 2019-03-06  Jason Merrill  <jason@redhat.com>
3281         PR c++/89381 - implicit copy and using-declaration.
3282         * class.c (classtype_has_move_assign_or_move_ctor_p): Don't consider
3283         op= brought in by a using-declaration.
3285 2019-03-06  Jakub Jelinek  <jakub@redhat.com>
3287         PR c++/87148
3288         * init.c (build_value_init_noctor): Ignore flexible array members.
3290 2019-03-06  Jason Merrill  <jason@redhat.com>
3292         PR c++/89576 - if constexpr of lambda capture.
3293         * semantics.c (maybe_convert_cond): Do convert a non-dependent
3294         condition in a template.
3295         * typeck.c (condition_conversion): Handle being called in a
3296         template.
3298 2019-03-06  Marek Polacek  <polacek@redhat.com>
3300         PR c++/87378 - bogus -Wredundant-move warning.
3301         * typeck.c (maybe_warn_pessimizing_move): See if the maybe-rvalue
3302         overload resolution would actually succeed.
3304 2019-03-05  Jason Merrill  <jason@redhat.com>
3306         * class.c (is_really_empty_class): Add ignore_vptr parm.
3307         (trivial_default_constructor_is_constexpr): Pass it.
3308         * call.c (build_over_call): Pass it.
3309         * constexpr.c (cxx_eval_constant_expression): Pass it instead of
3310         checking TYPE_POLYMORPHIC_P.
3311         (cxx_eval_component_reference, potential_constant_expression_1):
3312         Pass it.
3313         * cp-gimplify.c (simple_empty_class_p): Pass it.
3314         * init.c (expand_aggr_init_1): Pass it.
3316 2019-03-04  Paolo Carlini  <paolo.carlini@oracle.com>
3318         PR c++/84605
3319         * parser.c (cp_parser_class_head): Reject TYPE_BEING_DEFINED too.
3321 2019-03-04  Jakub Jelinek  <jakub@redhat.com>
3323         PR c++/71446
3324         * call.c (field_in_pset): New function.
3325         (build_aggr_conv): Handle CONSTRUCTOR_IS_DESIGNATED_INIT correctly.
3327 2019-03-02  Jakub Jelinek  <jakub@redhat.com>
3329         PR c++/71446
3330         * cp-tree.h (CONSTRUCTOR_IS_DESIGNATED_INIT): Define.
3331         * parser.c (cp_parser_braced_list): Adjust cp_parser_initializer_list
3332         caller, set CONSTRUCTOR_IS_DESIGNATED_INIT.
3333         (cp_parser_initializer_list): Add designated parameter, set *designated
3334         to a bool whether any designators were parsed.
3335         * decl.c (reshape_init): Copy over CONSTRUCTOR_IS_DESIGNATED_INIT if
3336         needed.
3337         * pt.c (tsubst_copy_and_build): Likewise.
3338         * call.c (implicit_conversion): If CONSTRUCTOR_IS_DESIGNATED_INIT,
3339         don't call build_list_conv, nor build_complex_conv, nor attempt to
3340         convert a single element initializer to scalar.
3342 2019-03-01  Marek Polacek  <polacek@redhat.com>
3344         PR c++/89537 - missing location for error with non-static member fn.
3345         * call.c (resolve_args): Use EXPR_LOCATION.
3346         * typeck.c (build_class_member_access_expr): Use input_location.
3348         PR c++/89532 - ICE with incomplete type in decltype.
3349         * semantics.c (finish_compound_literal): Return error_mark_node
3350         if digest_init_flags returns error_mark_node.
3352 2019-03-01  Jakub Jelinek  <jakub@redhat.com>
3354         Implement P1002R1, Try-catch blocks in constexpr functions
3355         PR c++/89513
3356         * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
3357         Diagnose constexpr ctor or function with function-try-block with
3358         pedwarn for c++17 and earlier.  Formatting fix.
3359         (cp_parser_try_block): Use pedwarn instead of error and only for
3360         c++17 and earlier when try block appears in constexpr function.
3361         * constexpr.c (build_constexpr_constructor_member_initializers):
3362         Handle TRY_BLOCK here instead of erroring on it.
3364 2019-02-28  Jason Merrill  <jason@redhat.com>
3366         PR c++/88183 - ICE with .* fold-expression.
3367         * pt.c (fold_expression) [DOTSTAR_EXPR]: Remove special handling.
3369         PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
3370         * class.c, lambda.c, pt.c: Revert earlier change.
3371         * lambda.c (add_capture): Don't special-case capture of dependent
3372         VLA.
3374         * name-lookup.c (print_binding_level): Print this_entity.
3376 2019-02-27  Marek Polacek  <polacek@redhat.com>
3378         PR c++/88857 - ICE with value-initialization of argument in template.
3379         * call.c (convert_like_real): Don't call build_value_init in template.
3381 2019-02-27  Jason Merrill  <jason@redhat.com>
3383         PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
3384         * semantics.c (process_outer_var_ref): Do capture dependent vars.
3385         * class.c (finish_struct): Only add TAG_DEFN if T is in
3386         current_function_decl.
3387         * lambda.c (vla_capture_type): Force the capture type out into the
3388         lambda's enclosing function.
3389         (add_capture): Pass in the lambda.
3390         * pt.c (tsubst_lambda_expr): complete_type a VLA capture type.
3392 2019-02-27  Marek Polacek  <polacek@redhat.com>
3394         PR c++/89511 - ICE with using-declaration and unscoped enumerator.
3395         * parser.c (cp_parser_using_declaration): For an unscoped enum
3396         only use its context if it's not a function declaration.
3398 2019-02-27  Paolo Carlini  <paolo.carlini@oracle.com>
3400         PR c++/89488
3401         * method.c (process_subob_fn): When maybe_instantiate_noexcept
3402         returns false don't call merge_exception_specifiers.
3404 2019-02-27  Paolo Carlini  <paolo.carlini@oracle.com>
3406         PR c++/88987
3407         * parser.c (cp_parser_noexcept_specification_opt): Return NULL_TREE
3408         for a non-constant parsed expression.
3410 2019-02-26  Jakub Jelinek  <jakub@redhat.com>
3412         PR c++/89481
3413         * constexpr.c (cxx_eval_store_expression): When changing active union
3414         member, set no_zero_init.
3416 2019-02-23  Marek Polacek  <polacek@redhat.com>
3418         PR c++/88294 - ICE with non-constant noexcept-specifier.
3419         * pt.c (maybe_instantiate_noexcept): Set up the list of local
3420         specializations.  Set current_class_{ptr,ref}.
3422 2019-02-22  David Malcolm  <dmalcolm@redhat.com>
3424         PR c++/89390
3425         * parser.c (cp_parser_unqualified_id): Capture and use locations
3426         for destructors.
3428 2019-02-22  Marek Polacek  <polacek@redhat.com>
3430         PR c++/89420 - ICE with CAST_EXPR in explicit-specifier.
3431         * decl.c (build_explicit_specifier): Don't check
3432         processing_template_decl.  Call instantiation_dependent_expression_p
3433         instead of value_dependent_expression_p.  Call
3434         instantiate_non_dependent_expr_sfinae before
3435         build_converted_constant_expr instead of calling
3436         instantiate_non_dependent_expr after it.  Add
3437         processing_template_decl_sentinel.
3439 2019-02-22  Thomas Schwinge  <thomas@codesourcery.com>
3441         * parser.c (cp_parser_oacc_simple_clause): Remove parser formal
3442         parameter, move loc formal parameter to the front.  Adjust all
3443         users.
3444         (cp_parser_oacc_shape_clause): Add loc formal parameter.  Adjust
3445         all users.
3447 2019-02-21  Jason Merrill  <jason@redhat.com>
3449         PR c++/87685 - generic lambda 'this' capture error.
3450         * lambda.c (lambda_expr_this_capture): Change add_capture_p to int.
3451         (maybe_generic_this_capture): Pass -1.
3453         PR c++/88394 - ICE with VLA init-capture.
3454         * lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE.
3456         PR c++/88869 - C++17 ICE with CTAD and explicit specialization.
3457         * pt.c (do_class_deduction): Don't include explicit specialization
3458         args in outer_args.
3460         PR c++/89422 - ICE with -g and lambda in default arg in template.
3461         * pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner.
3463 2019-02-21  Jason Merrill  <jason@redhat.com>
3465         PR c++/88419 - C++17 ICE with class template arg deduction.
3466         * pt.c (make_template_placeholder): Set TYPE_CANONICAL after
3467         CLASS_PLACEHOLDER_TEMPLATE.
3469 2019-02-21  Jakub Jelinek  <jakub@redhat.com>
3471         PR c++/89285
3472         * constexpr.c (struct constexpr_fundef): Add parms and result members.
3473         (retrieve_constexpr_fundef): Adjust for the above change.
3474         (register_constexpr_fundef): Save constexpr body with copy_fn,
3475         temporarily set DECL_CONTEXT on DECL_RESULT before that.
3476         (get_fundef_copy): Change FUN argument to FUNDEF with
3477         constexpr_fundef * type, grab body and parms/result out of
3478         constexpr_fundef struct and temporarily change it for copy_fn calls
3479         too.
3480         (cxx_eval_builtin_function_call): For __builtin_FUNCTION temporarily
3481         adjust current_function_decl from ctx->call context.  Test
3482         !potential_constant_expression instead of !is_constant_expression.
3483         (cxx_bind_parameters_in_call): Grab parameters from new_call.  Undo
3484         convert_for_arg_passing changes for TREE_ADDRESSABLE type passing.
3485         (cxx_eval_call_expression): Adjust get_fundef_copy caller.
3486         (cxx_eval_conditional_expression): For IF_STMT, allow then or else
3487         operands to be NULL.
3488         (label_matches): Handle BREAK_STMT and CONTINUE_STMT.
3489         (cxx_eval_loop_expr): Add support for FOR_STMT, WHILE_STMT and DO_STMT.
3490         (cxx_eval_switch_expr): Add support for SWITCH_STMT.
3491         (cxx_eval_constant_expression): Handle IF_STMT, FOR_STMT, WHILE_STMT,
3492         DO_STMT, CONTINUE_STMT, SWITCH_STMT, BREAK_STMT and CONTINUE_STMT.
3493         For SIZEOF_EXPR, recurse on the result of fold_sizeof_expr.  Ignore
3494         DECL_EXPR with USING_DECL operand.
3495         * lambda.c (maybe_add_lambda_conv_op): Build thisarg using
3496         build_int_cst to make it a valid constant expression.
3498 2019-02-20  Jason Merrill  <jason@redhat.com>
3500         PR c++/88690 - C++17 ICE with empty base in aggregate.
3501         * typeck2.c (process_init_constructor_record): Skip trivial
3502         initialization of an empty base.
3504 2019-02-21  Richard Biener  <rguenther@suse.de>
3506         PR middle-end/89392
3507         * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not
3508         make symtab process new functions here.
3510 2019-02-20  Jason Merrill  <jason@redhat.com>
3512         PR c++/87921 - wrong error with inline static data member.
3513         * decl2.c (finish_static_data_member_decl): Don't set DECL_IN_AGGR_P
3514         for a non-template inline variable.  Do nothing for an
3515         already-instantiated variable.
3516         (c_parse_final_cleanups): Check DECL_IN_AGGR_P without
3517         DECL_INLINE_VAR_P.
3518         * decl.c (check_initializer): Likewise.
3519         (make_rtl_for_nonlocal_decl): Likewise.
3520         * pt.c (instantiate_decl): Likewise.
3521         * typeck2.c (store_init_value): Likewise.
3523 2019-02-20  Jakub Jelinek  <jakub@redhat.com>
3525         PR c++/89403
3526         * decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting
3527         for flag_syntax_only from here...
3528         * semantics.c (expand_or_defer_fn_1): ... here.
3530         PR c++/89405
3531         * decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and
3532         DECL_COMMON, set DECL_INTERFACE_KNOWN.
3534         PR c++/89336
3535         * constexpr.c (cxx_eval_store_expression): Diagnose changing of active
3536         union member for -std=c++17 and earlier.
3538 2019-02-19  Jason Merrill  <jason@redhat.com>
3540         PR c++/87513 - 'sorry' mangling PMF template-id.
3541         * mangle.c (write_expression): Handle SCOPE_REF to BASELINK.
3543 2019-02-19  Jason Merrill  <jason@redhat.com>
3545         PR c++/88380 - wrong-code with flexible array and NSDMI.
3546         * typeck2.c (process_init_constructor_record): Skip flexarrays.
3548 2019-02-20  will wray  <wjwray@gmail.com>
3550         PR c++/88572 - wrong handling of braces on scalar init.
3551         * decl.c (reshape_init_r): Allow braces around scalar initializer
3552         within aggregate init.  Reject double braced-init of scalar
3553         variable.
3555 2019-02-20  Paolo Carlini  <paolo.carlini@oracle.com>
3557         PR c++/84536
3558         * pt.c (tsubst_init): Diagnose an initializer expanding to an
3559         empty list of expressions; tweak wrt dependent types.
3560         (regenerate_decl_from_template): For VAR_DECLs call tsubst_init
3561         instead of tsubst_expr.
3563 2019-02-19  Jason Merrill  <jason@redhat.com>
3565         PR c++/88368 - wrong 'use of deleted function'
3566         * method.c (walk_field_subobs): Remember errors from get_nsdmi.
3567         (get_defaulted_eh_spec): Call push_tinst_level.
3568         * pt.c (maybe_instantiate_noexcept): Keep error_mark_node.
3569         * typeck2.c (merge_exception_specifiers): Handle error_mark_node.
3571 2019-02-19  Chung-Lin Tang  <cltang@codesourcery.com>
3573         PR c/87924
3574         * parser.c (cp_parser_oacc_clause_wait): Add representation of wait
3575         clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.
3577 2019-02-19  Jakub Jelinek  <jakub@redhat.com>
3579         PR c++/89387
3580         * lambda.c (maybe_generic_this_capture): Don't check
3581         DECL_NONSTATIC_MEMBER_FUNCTION_P on USING_DECLs.
3583         PR c++/89391
3584         * typeck.c (build_reinterpret_cast_1): Don't handle void to
3585         && conversion go through build_target_expr_with_type.
3587         PR c++/89390
3588         * error.c (qualified_name_lookup_error): Only call
3589         suggest_alternative_in_scoped_enum if name is IDENTIFIER_NODE.
3591 2019-02-19  Tom Honermann  <tom@honermann.net>
3593         * name-lookup.c (get_std_name_hint): Added u8string as a name hint.
3595 2019-02-18  Jason Merrill  <jason@redhat.com>
3597         PR c++/89336 - multiple stores in constexpr stmt.
3598         * constexpr.c (cxx_eval_store_expression): Preevaluate scalar or
3599         assigned value.
3601         * pt.c (check_explicit_specialization): If the declarator is a
3602         template-id, only check whether the arguments are dependent.
3604         Improve duplicate [[likely]] diagnostic.
3605         * parser.c (cp_parser_statement): Make attrs_loc a range.  Pass it
3606         to process_stmt_hotness_attribute.
3607         * cp-gimplify.c (process_stmt_hotness_attribute): Take attrs_loc.
3608         (genericize_if_stmt): Use likely/unlikely instead of predictor_name.
3610 2019-02-17  Marek Polacek  <polacek@redhat.com>
3612         PR c++/89217 - ICE with list-initialization in range-based for loop.
3613         * constexpr.c (unshare_constructor): No longer static.
3614         * cp-tree.h (unshare_constructor): Declare.
3615         * semantics.c (finish_compound_literal): When dealing with a
3616         non-dependent expression in a template, return the original
3617         expression.  Pass LOOKUP_NO_NARROWING to digest_init_flags.
3619 2019-02-13  Marek Polacek  <polacek@redhat.com>
3621         PR c++/89297 - ICE with OVERLOAD in template.
3622         * semantics.c (finish_compound_literal): Call
3623         instantiate_non_dependent_expr_sfinae.
3625 2019-02-13  Alexandre Oliva  <aoliva@redhat.com>
3627         PR c++/86379
3628         * cp-tree.h (USING_DECL_SCOPE): Use result rather than type.
3629         * name-lookup.c (strip_using_decl): Use USING_DECL_SCOPE.
3630         * search.c (protected_accessible_p): Follow USING_DECL_DECLS.
3631         (shared_member_p): Likewise.
3632         (lookup_member): Likewise.
3633         * decl.c (grok_special_member_properties): Skip USING_DECLs.
3634         * semantics.c (finish_omp_declare_simd_methods): Likewise.
3635         (finish_qualified_id_expr): Do not call shared_member_p with
3636         a dependent expr.
3638         PR c++/87322
3639         * pt.c (tsubst_lambda_expr): Avoid duplicate tsubsting.
3640         Move cp_evaluated resetting before signature tsubsting.
3641         (gen_elem_of_pack_expansion_instantiation): Separate local
3642         specializations per index.
3644 2019-02-13  David Malcolm  <dmalcolm@redhat.com>
3646         PR c++/89036
3647         * class.c (add_method): Drop destructor assertion.
3649 2019-02-13  Paolo Carlini  <paolo.carlini@oracle.com>
3651         PR c++/88986
3652         * decl.c (make_typename_type): Allow for TYPE_PACK_EXPANSION as
3653         context (the first argument).
3654         * pt.c (tsubst, case TYPENAME_TYPE): Handle TYPE_PACK_EXPANSION
3655         as context.
3657 2019-02-12  Jason Merrill  <jason@redhat.com>
3659         PR c++/89144 - link error with constexpr initializer_list.
3660         * call.c (convert_like_real) [ck_list]: Don't allocate a temporary
3661         array for an empty list.
3662         * typeck2.c (store_init_value): Don't use cxx_constant_init in a
3663         template.
3665 2019-02-11  Jason Merrill  <jason@redhat.com>
3667         PR c++/89241 - ICE with __func__ in lambda in template.
3668         * pt.c (enclosing_instantiation_of): Also check
3669         instantiated_lambda_fn_p for the template context.
3671 2019-02-11  Marek Polacek  <polacek@redhat.com>
3673         PR c++/89212 - ICE converting nullptr to pointer-to-member-function.
3674         * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Return early for
3675         null member pointer value.
3677 2019-02-11  Jakub Jelinek  <jakub@redhat.com>
3679         PR c++/88977
3680         * pt.c (convert_nontype_argument): Pass true as manifestly_const_eval
3681         to maybe_constant_value calls.
3683 2019-02-11  Marek Polacek  <polacek@redhat.com>
3685         * typeck2.c (digest_init_r): Remove commented code.
3687 2019-02-11  Martin Sebor  <msebor@redhat.com>
3689         PR c++/87996
3690         * decl.c (compute_array_index_type_loc): Preserve signed sizes
3691         for diagnostics.  Call valid_array_size_p instead of error.
3692         * init.c (build_new_1): Compute size for diagnostic.  Call
3693         invalid_array_size_error
3694         (build_new): Call valid_array_size_p instead of error.
3696 2019-02-07  Alexandre Oliva  <aoliva@redhat.com>
3698         PR c++/86218
3699         * call.c (compare_ics): Deal with ck_aggr in either cs.
3701 2019-02-06  David Malcolm  <dmalcolm@redhat.com>
3703         PR c++/71302
3704         * call.c (get_location_for_expr_unwinding_for_system_header): New
3705         function.
3706         (conversion_null_warnings): Use it when getting locations for
3707         EXPR, effectively adding a call to
3708         get_location_for_expr_unwinding_for_system_header for
3709         -Wconversion-null and making use of EXPR_LOCATION for
3710         -Wzero-as-null-pointer-constant.
3712 2019-02-05  Jakub Jelinek  <jakub@redhat.com>
3714         PR c++/89187
3715         * optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on
3716         PARM_DECLs of the thunk.
3717         * lambda.c (maybe_add_lambda_conv_op): Likewise.
3719 2019-02-05  Marek Polacek  <polacek@redhat.com>
3721         PR c++/89158 - by-value capture of constexpr variable broken.
3722         * call.c (convert_like_real) <case ck_user>: Call mark_exp_read
3723         instead of mark_rvalue_use.
3725 2019-02-05  Alexandre Oliva  <aoliva@redhat.com>
3727         PR c++/87770
3728         * pt.c (instantiates_primary_template_p): New.
3729         (type_dependent_expression_p): Use it.
3731 2019-02-01  Jason Merrill  <jason@redhat.com>
3733         PR c++/88761 - ICE with reference capture of constant.
3734         * lambda.c (mark_const_cap_r): Do walk subtrees of DECL_EXPR for
3735         non-proxy decls.
3737 2019-02-01  Marek Polacek  <polacek@redhat.com>
3739         PR c++/88325 - ICE with invalid out-of-line template member definition.
3740         * parser.c (cp_parser_class_name): Don't call make_typename_type
3741         for overloads.
3743 2019-02-01  Jakub Jelinek  <jakub@redhat.com>
3745         PR c++/87175
3746         * parser.c (cp_parser_gnu_attributes_opt): Set ok to false
3747         if require_open failed.
3749 2019-01-31  Marek Polacek  <polacek@redhat.com>
3751         PR c++/89083, c++/80864 - ICE with list initialization in template.
3752         * constexpr.c (adjust_temp_type): Use copy_node and change the type
3753         instead of using build_constructor.
3754         * decl.c (reshape_init_r): Don't reshape a digested initializer.
3755         Return the initializer for COMPOUND_LITERAL_P.
3757         PR c++/88983 - ICE with switch in constexpr function.
3758         * constexpr.c (cxx_eval_switch_expr): Use SWITCH_COND and SWITCH_BODY.
3759         (cxx_eval_constant_expression) <case COND_EXPR>: Don't look for the
3760         label in the else branch if we found it in the then branch.
3762 2019-01-30  Jason Merrill  <jason@redhat.com>
3764         PR c++/88752 - ICE with lambda and constexpr if.
3765         * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New.
3766         * pt.c (tsubst_lambda_expr): Set it.
3767         (instantiated_lambda_fn_p): Check it.
3768         (enclosing_instantiation_of): Use it.
3770 2019-01-31  Jakub Jelinek  <jakub@redhat.com>
3772         PR libstdc++/88170
3773         * cxx-pretty-print.c (pp_cxx_enumeration_constant): Print always as
3774         a C cast in pp_c_flag_gnu_v3 mode.
3776 2019-01-30  Jakub Jelinek  <jakub@redhat.com>
3778         PR c++/88988
3779         * lambda.c (is_capture_proxy): Don't return true for
3780         DECL_OMP_PRIVATIZED_MEMBER artificial vars.
3782 2019-01-30  Marek Polacek  <polacek@redhat.com>
3784         PR c++/89119 - ICE with value-initialization in template.
3785         * pt.c (tsubst_copy_and_build): Handle RANGE_EXPR.
3787 2019-01-29  Jason Merrill  <jason@redhat.com>
3789         PR c++/86943 - wrong code converting lambda to function pointer.
3790         * lambda.c (maybe_add_lambda_conv_op): Use a template-id in the
3791         call.  Only forward parms for decltype.
3792         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Handle CALL_FROM_THUNK_P
3793         specially.
3794         * typeck.c (check_return_expr): Don't mess with a thunk call.
3796 2019-01-28  Jason Merrill  <jason@redhat.com>
3798         PR c++/89089 - ICE with [[no_unique_address]].
3799         PR c++/88865 - wrong layout with [[no_unique_address]].
3800         * class.c (check_field_decls): A potentially-overlapping field makes
3801         the class non-layout-POD, but not non-empty.
3802         (end_of_class): Always consider empty data members.
3803         (layout_class_type): Set DECL_SIZE for empty fields.
3805 2019-01-28  Marek Polacek  <polacek@redhat.com>
3807         PR c++/88358 - name wrongly treated as type.
3808         * parser.c (cp_parser_direct_declarator): Don't assume a qualified-id
3809         in parameter-list is a type if the function's declarator-id is not
3810         qualified.
3812 2019-01-27  Marek Polacek  <polacek@redhat.com>
3814         PR c++/88815 - narrowing conversion lost in decltype.
3815         PR c++/78244 - narrowing conversion in template not detected.
3816         * cp-tree.h (CONSTRUCTOR_IS_DEPENDENT): New.
3817         * pt.c (instantiation_dependent_r): Consider a CONSTRUCTOR with
3818         CONSTRUCTOR_IS_DEPENDENT instantiation-dependent.
3819         * semantics.c (finish_compound_literal): When the compound literal
3820         isn't instantiation-dependent and the type isn't type-dependent,
3821         fall back to the normal processing.  Set CONSTRUCTOR_IS_DEPENDENT.
3823         PR c++/89024 - ICE with incomplete enum type.
3824         * call.c (standard_conversion): When converting an
3825         ARITHMETIC_TYPE_P to an incomplete type, return NULL.
3827 2019-01-25  Paolo Carlini  <paolo.carlini@oracle.com>
3829         PR c++/88969
3830         * call.c (build_op_delete_call): Implement 7.6.2.5/(10.1).
3831         * decl2.c (coerce_delete_type): Use build_pointer_type instead
3832         of TYPE_POINTER_TO.
3834 2019-01-24  Jason Merrill  <jason@redhat.com>
3836         PR c++/89001 - mangling of reference temporaries
3837         * cp-tree.h (struct saved_scope): Add ref_temp_count.
3838         (current_ref_temp_count): New macro.
3839         * mangle.c (mangle_ref_init_variable): Use it.
3840         * typeck2.c (store_init_value): Clear it.
3841         * call.c (make_temporary_var_for_ref_to_temp): Copy public and
3842         comdat.
3844 2019-01-24  Jakub Jelinek  <jakub@redhat.com>
3846         PR c++/88976
3847         * semantics.c (finish_omp_cancel): Diagnose more than one if
3848         on #pragma omp cancel with different modifiers.  Use
3849         maybe_convert_cond when not in template or build_x_binary_op
3850         otherwise.
3852 2019-01-23  Marek Polacek  <polacek@redhat.com>
3854         PR c++/88757 - qualified name treated wrongly as type.
3855         * parser.c (cp_parser_direct_declarator): Don't treat qualified-ids
3856         in parameter-list as types if name lookup for declarator-id didn't
3857         find one or more function templates.
3859 2019-01-23  Jakub Jelinek  <jakub@redhat.com>
3861         PR c/44715
3862         * cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only
3863         after genericizing cond and incr expressions.
3865         PR c++/88984
3866         * cp-gimplify.c (genericize_switch_stmt): Move cond genericization
3867         before the begin_bc_block call.
3869 2019-01-21  Jason Merrill  <jason@redhat.com>
3871         PR c++/87893 - constexpr ctor ICE on ARM.
3872         PR c++/88293 - ICE with comma expression.
3873         * constexpr.c (initialized_type): Don't shortcut non-void type.
3874         Handle COMPOUND_EXPR.
3875         (cxx_eval_outermost_constant_expr): Return early for void type.
3877 2019-01-21  Jakub Jelinek  <jakub@redhat.com>
3879         PR c++/88949
3880         * optimize.c (cxx_copy_decl): New function.
3881         (clone_body): Use it instead of copy_decl_no_change.
3883         PR sanitizer/88901
3884         * typeck.c (cp_build_binary_op): Don't instrument
3885         SANITIZE_POINTER_COMPARE if processing_template_decl.
3886         (pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT.
3888 2019-01-18  Jason Merrill  <jason@redhat.com>
3890         PR c++/88875 - error with explicit list constructor.
3891         * call.c (reference_binding): Don't modify EXPR.  Set
3892         need_temporary_p on the ck_user conversion for a temporary.
3893         (convert_like_real): Check it.
3895 2019-01-18  H.J. Lu  <hongjiu.lu@intel.com>
3897         PR c/51628
3898         PR c/88664
3899         * call.c (convert_for_arg_passing): Upate the
3900         warn_for_address_or_pointer_of_packed_member call.
3901         * typeck.c (convert_for_assignment): Likewise.
3903 2019-01-17  Jason Merrill  <jason@redhat.com>
3905         PR c++/86205 - ICE with ?: of throw and template-id.
3906         * pt.c (resolve_nondeduced_context_or_error): Split out from...
3907         * typeck.c (decay_conversion): ...here.
3908         * call.c (build_conditional_expr_1): Use it.
3910         PR c++/86740, ICE with constexpr if and nested generic lambdas.
3911         * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR.
3913 2019-01-17  Paolo Carlini  <paolo.carlini@oracle.com>
3915         * decl.c (grokdeclarator): Use typespec_loc in error messages
3916         about 'auto' and trailing return type.
3918 2019-01-17  David Malcolm  <dmalcolm@redhat.com>
3920         PR c++/88699
3921         * class.c (add_method): Don't use DECL_DESTRUCTOR_P on
3922         USING_DECLs.
3924 2019-01-17  Nathan Sidwell  <nathan@acm.org>
3926         PR c++/86610
3927         * semantics.c (process_outer_var_ref): Only skip dependent types
3928         in templates.
3930 2019-01-17  Alexandre Oliva  <aoliva@redhat.com>
3932         PR c++/87768
3933         * cp-tree.h (saved_scope): Add suppress_location_wrappers.
3934         * name-lookup.c (do_push_to_top_level): Save and reset it.
3935         (do_pop_from_top_level): Restore it.
3937         PR c++/86648
3938         * pt.c (make_template_placeholder): Use auto_identifier.
3939         (is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test.
3940         * error.c (dump_type): Handle template placeholders.
3941         * cxx-pretty-print.c (pp_cx_unqualified_id): Likewise.
3943         PR c++/88146
3944         * cvt.c (convert_to_void): Handle all cdtor calls as if
3945         returning void.
3947 2019-01-16  Paolo Carlini  <paolo.carlini@oracle.com>
3949         * decl.c (grokdeclarator): Use locations[ds_storage_class] in
3950         error messages about ill-formed uses of mutable.
3952 2019-01-16  Marek Polacek  <polacek@redhat.com>
3954         PR c++/78244 - narrowing conversion in template not detected.
3955         * call.c (perform_implicit_conversion_flags): Set
3956         IMPLICIT_CONV_EXPR_BRACED_INIT.
3957         * cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New.
3958         * pt.c (tsubst_copy_and_build): Use it.
3960 2019-01-15  David Malcolm  <dmalcolm@redhat.com>
3962         PR c++/88795
3963         * pt.c (build_deduction_guide): Bail out if tsubst_arg_types
3964         fails.
3966 2019-01-15  Paolo Carlini  <paolo.carlini@oracle.com>
3968         * decl.c (start_decl): Improve error location.
3969         * decl2.c (grokfield): Likewise.
3971 2019-01-15  Paolo Carlini  <paolo.carlini@oracle.com>
3973         * decl.c (grokdeclarator): Move further up the location_t loc
3974         declaration and use the location when building a TYPE_DECL for
3975         a typedef name.
3976         * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error
3977         about an ill-formed bit-field as typedef.
3979 2019-01-14  Marek Polacek  <polacek@redhat.com>
3981         PR c++/88830 - ICE with abstract class.
3982         * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR.
3983         Fix formatting.
3985         PR c++/88825 - ICE with bogus function return type deduction.
3986         * typeck.c (can_do_nrvo_p): Check error_mark_node.
3988 2019-01-14  Tom Honermann  <tom@honermann.net>
3990         Implement P0482R5, char8_t: A type for UTF-8 characters and strings
3991         * cvt.c (type_promotes_to): Handle char8_t promotion.
3992         * decl.c (grokdeclarator): Handle invalid type specifier
3993         combinations involving char8_t.
3994         * lex.c (init_reswords): Add char8_t as a reserved word.
3995         * mangle.c (write_builtin_type): Add name mangling for char8_t (Du).
3996         * parser.c (cp_keyword_starts_decl_specifier_p)
3997         (cp_parser_simple_type_specifier): Recognize char8_t as a simple
3998         type specifier.
3999         (cp_parser_string_literal): Use char8_array_type_node for the type
4000         of CPP_UTF8STRING.
4001         (cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system
4002         headers.
4003         * rtti.c (emit_support_tinfos): type_info support for char8_t.
4004         * tree.c (char_type_p): Recognize char8_t as a character type.
4005         * typeck.c (string_conv_p): Handle conversions of u8 string
4006         literals of char8_t type.
4007         (check_literal_operator_args): Handle UDLs with u8 string literals
4008         of char8_t type.
4009         * typeck2.c (ordinary_char_type_p): New.
4010         (digest_init_r): Disallow initializing a char array with a u8 string
4011         literal.
4013 2019-01-14  Martin Liska  <mliska@suse.cz>
4015         PR gcov-profile/88263
4016         * decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION
4017         as location of the TLS wrapper.
4019 2019-01-12  Paolo Carlini  <paolo.carlini@oracle.com>
4021         * decl.c (cp_finish_decl): Improve error location.
4022         * decl2.c (grokfield): Likewise, improve two locations.
4024 2019-01-11  Marek Polacek  <polacek@redhat.com>
4026         PR c++/88692, c++/87882 - -Wredundant-move false positive with *this.
4027         * typeck.c (maybe_warn_pessimizing_move): Return if ARG isn't
4028         ADDR_EXPR.
4030 2019-01-11  Jason Merrill  <jason@redhat.com>
4032         PR c++/88312 - pack expansion of decltype.
4033         * pt.c (instantiation_dependent_r): A template non-type parameter
4034         pack is instantiation-dependent.
4036 2019-01-11  Jason Merrill  <jason@redhat.com>
4038         PR c++/88613 - ICE with use of const var in lambda.
4039         * expr.c (mark_use): Fix location wrapper handling.
4040         * cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use.
4042 2019-01-11  Tobias Burnus  <burnus@net-b.de>
4044         PR C++/88114
4045         * decl2.c (maybe_emit_vtables): If needed, generate code for
4046         the destructor of an abstract class.
4047         (mark_used): Update comment for older function-name change.
4049 2019-01-11  Paolo Carlini  <paolo.carlini@oracle.com>
4051         * decl.c (start_decl): Improve error location.
4052         (grokdeclarator): Likewise, improve two locations.
4054 2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>
4056         PR other/16615
4058         * cp-tree.h: Mechanically replace "can not" with "cannot".
4059         * parser.c: Likewise.
4060         * pt.c: Likewise.
4062 2019-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
4064         * decl.c (grok_reference_init): Improve error location.
4065         (grokdeclarator): Likewise, improve two locations.
4067 2019-01-08  Marek Polacek  <polacek@redhat.com>
4069         PR c++/88538 - braced-init-list in template-argument-list.
4070         * parser.c (cp_parser_template_argument): Handle braced-init-list when
4071         in C++20.
4073         PR c++/88548 - this accepted in static member functions.
4074         * parser.c (cp_debug_parser): Adjust printing of
4075         local_variables_forbidden_p.
4076         (cp_parser_new): Set local_variables_forbidden_p to 0 rather than false.
4077         (cp_parser_primary_expression): When checking
4078         local_variables_forbidden_p, use THIS_FORBIDDEN or
4079         LOCAL_VARS_FORBIDDEN.
4080         (cp_parser_lambda_body): Update the type of
4081         local_variables_forbidden_p.  Set it to 0 rather than false.
4082         (cp_parser_condition): Adjust call to cp_parser_declarator.
4083         (cp_parser_explicit_instantiation): Likewise.
4084         (cp_parser_init_declarator): Likewise.
4085         (cp_parser_declarator): New parameter.  Use it.
4086         (cp_parser_direct_declarator): New parameter.  Use it to set
4087         local_variables_forbidden_p.  Adjust call to cp_parser_declarator.
4088         (cp_parser_type_id_1): Adjust call to cp_parser_declarator.
4089         (cp_parser_parameter_declaration): Likewise.
4090         (cp_parser_default_argument): Update the type of
4091         local_variables_forbidden_p.  Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
4092         rather than true.
4093         (cp_parser_member_declaration): Tell cp_parser_declarator if we saw
4094         'static' or 'friend'.
4095         (cp_parser_exception_declaration): Adjust call to cp_parser_declarator.
4096         (cp_parser_late_parsing_default_args): Update the type of
4097         local_variables_forbidden_p.  Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
4098         rather than true.
4099         (cp_parser_cache_defarg): Adjust call to cp_parser_declarator.
4100         (cp_parser_objc_class_ivars): Likewise.
4101         (cp_parser_objc_struct_declaration): Likewise.
4102         (cp_parser_omp_for_loop_init): Likewise.
4103         * parser.h (cp_parser): Change the type of local_variables_forbidden_p
4104         to unsigned char.
4105         (LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN):
4106         Define.
4108 2019-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
4110         * decl.c (start_decl): Improve permerror location.
4112 2019-01-08  Jonathan Wakely  <jwakely@redhat.com>
4113             Jakub Jelinek  <jakub@redhat.com>
4115         PR c++/88554
4116         * decl.c (finish_function): For -Wreturn-type don't add a return *this;
4117         fixit hint if current_class_ref is NULL.  Use a single if instead of
4118         two nested ones.
4120 2019-01-07  Paolo Carlini  <paolo.carlini@oracle.com>
4122         * decl.c (start_decl): Improve two error_at locations.
4123         (expand_static_init): Likewise.
4125 2019-01-07  Marek Polacek  <polacek@redhat.com>
4127         PR c++/88741 - wrong error with initializer-string.
4128         * decl.c (cp_complete_array_type): Strip any location wrappers.
4130 2019-01-07  Bernd Edlinger  <bernd.edlinger@hotmail.de>
4132         PR c++/88261
4133         PR c++/69338
4134         PR c++/69696
4135         PR c++/69697
4136         * cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value.
4137         * typeck2.c (digest_init_r): Raise an error for non-static
4138         initialization of a flexible array member.
4139         (process_init_constructor, massage_init_elt,
4140         process_init_constructor_array, process_init_constructor_record,
4141         process_init_constructor_union, process_init_constructor): Add the
4142         flags parameter and pass it thru.
4143         (store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to
4144         digest_init_flags for static decls.
4146 2019-01-07  Jakub Jelinek  <jakub@redhat.com>
4148         PR c++/85052
4149         * cp-tree.h (cp_build_vec_convert): Declare.
4150         * parser.c (cp_parser_postfix_expression): Parse
4151         __builtin_convertvector.
4152         * constexpr.c: Include fold-const-call.h.
4153         (cxx_eval_internal_function): Handle IFN_VEC_CONVERT.
4154         (potential_constant_expression_1): Likewise.
4155         * semantics.c (cp_build_vec_convert): New function.
4156         * pt.c (tsubst_copy_and_build): Handle CALL_EXPR to
4157         IFN_VEC_CONVERT.
4159 2019-01-03  Jakub Jelinek  <jakub@redhat.com>
4161         PR c++/88636
4162         * decl.c (builtin_function_1): Return result of pushdecl_top_level
4163         or pushdecl rather than decl.
4165 2019-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
4167         * tree.c (handle_nodiscard_attribute): Improve warning location.
4169 2019-01-02  Marek Polacek  <polacek@redhat.com>
4171         PR c++/88612 - ICE with -Waddress-of-packed-member.
4172         * call.c (convert_for_arg_passing): Only give warnings with tf_warning.
4173         * typeck.c (convert_for_assignment): Likewise.
4175         PR c++/88631 - CTAD failing for value-initialization.
4176         * typeck2.c (build_functional_cast): Try deducing the template
4177         arguments even if there are no arguments to deduce from.
4179 2019-01-01  Jakub Jelinek  <jakub@redhat.com>
4181         Update copyright years.
4183 Copyright (C) 2019 Free Software Foundation, Inc.
4185 Copying and distribution of this file, with or without modification,
4186 are permitted in any medium without royalty provided the copyright
4187 notice and this notice are preserved.