* cp-tree.h (OVL_ARG_DEPENDENT): Delete.
[official-gcc.git] / gcc / cp / ChangeLog
blobe903bfd1d715566d4d6f9af8decaec7985b0caeb
1 2017-05-18  Nathan Sidwell  <nathan@acm.org>
3         * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
4         (OVL_USED_P): New.
5         (lookup_keep): Declare.
6         * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
7         * pt.c (tsubst_copy): Assert lookup is persistent.
8         * semantics.c (finish_call_expr): Use lkp_iterator, call
9         lookup_keep.
10         * tree.c (ovl_copy): New.
11         (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
12         (lookup_keep): New.
14         * cp-tree.h (OVL_USED): Replace with ...
15         (OVL_USING_P): ... this.
16         (ovl_iterator::using_p): Adjust.
17         * name-lookup.c (push_overloaded_decl_1,
18         do_nonmember_using_decl): Adjust.
19         * search.c (lookup_field_r): Adjust.
20         * tree.c (ovl_insert, ovl_scope): Adjust.
22         * cp-tree.h (lookup_add): Swap args.
23         (ovl_cons, build_overload): Delete.
24         * name-lookup.c (add_function, push_overloaded_decl_1,
25         do_nonmember_using_decl, merge_functions, remove_hidden_names):
26         Use lookup_add, ovl_insert.
27         * pt.c (check_explicit_specialization): Use lookup_add.
28         (do_class_deduction): Likewise. Refactor if.
29         * tree.c (lookup_add): Swap args.
30         (ovl_cons, build_overload): Delete.
32         * name-lookup.c (find_local_binding): New, broken out of ...
33         (lookup_name_innermost_nonclass_level_1): ... here.  Call it.
34         (set_namespace_binding): Swap scope & name args.
35         (namespace_binding_1): Likewise.
36         (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
37         (push_overloaded_decl_1): Likewise.
38         (set_global_binding): Likewise.
39         (get_namespace_binding): Adjust namespace_binding_1 call.
41 2017-05-17  Nathan Sidwell  <nathan@acm.org>
43         * cp-tree.h (default_hash_traits <lang_identifier *>): New
44         specialization.
45         * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
46         (extern_c_fns): New hash table.
47         (check_extern_c_conflict): New, broken out of ...
48         (pushdecl_maybe_friend_1): ... here.  Call it.
49         (c_linkage_bindings): Just look in hash table.
51 2017-05-17  Ville Voutilainen  <ville.voutilainen@gmail.com>
53         PR c++/80654
54         PR c++/80682
55         Implement new C++ intrinsics __is_assignable and __is_constructible.
56         * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
57         (is_xible): New.
58         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
59         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
60         * method.c (constructible_expr): Set cp_unevaluated.
61         (is_xible_helper): New.
62         (is_trivially_xible): Adjust.
63         (is_xible): New.
64         * parser.c (cp_parser_primary_expression): Handle
65         RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
66         (cp_parser_trait_expr): Likewise.
67         * semantics.c (trait_expr_value): Handle
68         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
70 2017-05-17  Nathan Sidwell  <nathan@acm.org>
72         * cp-tree.h (ovl_iterator::using_p): New predicate.
73         (ovl_iterator::remove_node): New worker.
74         (ovl_insert): Declare.
75         * tree.c (ovl_insert): New.
76         (ovl_iterator::remove_node): New.
77         * class.c (add_method): Use ovl_iterator, ovl_insert.
78         (clone_function_decl): Fix description.
79         (clone_constructors_and_destructors): Use ovl_iterator.
81         * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
82         (maybe_warn_about_overly_private_class): Use ovl_iterator.
83         (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
84         (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
85         (get_base_fndecls): Use ovl_iterator.
86         (warn_hidden): Use OVL_NAME, ovl_iterator.
87         (add_implicitly_declared_members): Use ovl_iterator.
88         * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
89         flatten nested if.
90         (finish_shorthand_constraint): Simplify, use ovl_make.
91         * pt.c (make_constrained_auto): Simplify.  Use ovl_make.
92         * search.c (shared_member_p): Use ovl_iterator.
93         (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
94         (lookup_conversion_operator): Use OVL_FIRST.
95         (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
96         (look_for_overrides_here): Use ovl_iterator.
97         (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
98         * typeck.c (build_x_unary_op): Use ovl_make.
100 2017-05-17  Martin Liska  <mliska@suse.cz>
102         * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
103         use it instead of int type.
104         (dump_vtable): Likewise.
105         (dump_vtt): Likewise.
106         * decl2.c (dump_tu): Likewise.
108 2017-05-16  David Malcolm  <dmalcolm@redhat.com>
110         * call.c (enforce_access): Add access_failure_info * param and use
111         it to record access failures.
112         * cp-tree.h (class access_failure_info): New class.
113         (enforce_access): Add access_failure_info * param, defaulting to
114         NULL.
115         (lookup_member): Likewise.
116         (locate_field_accessor): New function decl.
117         (perform_or_defer_access_check): Add access_failure_info * param,
118         defaulting to NULL.
119         * search.c (lookup_member): Add access_failure_info * param and
120         pass it on to call to perform_or_defer_access_check.
121         (matches_code_and_type_p): New function.
122         (field_access_p): New function.
123         (direct_accessor_p): New function.
124         (reference_accessor_p): New function.
125         (field_accessor_p): New function.
126         (struct locate_field_data): New struct.
127         (dfs_locate_field_accessor_pre): New function.
128         (locate_field_accessor): New function.
129         * semantics.c (perform_or_defer_access_check): Add
130         access_failure_info * param, and pass it on to call to
131         enforce_access.
132         * typeck.c (access_failure_info::record_access_failure): New method.
133         (access_failure_info::maybe_suggest_accessor): New method.
134         (finish_class_member_access_expr): Pass an access_failure_info
135         instance to the lookup_member call, and call its
136         maybe_suggest_accessor method afterwards.
138 2017-05-16  Marek Polacek  <polacek@redhat.com>
140         PR sanitizer/80536
141         PR sanitizer/80386
142         * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
144 2017-05-16  Nathan Sidwell  <nathan@acm.org>
146         * name-lookup.c (check_local_shadow): New, broke out of ...
147         (pushdecl_maybe_friend_1): ... here.  Call it.
149         * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
150         (ovl_first): Move inline definition to end of file.
151         (ovl_make, lookup_add): Declare.
152         (get_fns, get_first_fn): Make pure.
153         * tree.c (ovl_cache): New.
154         (ovl_make, lookup_add): New.
155         * pt.c (do_class_deduction): Don't add candidates that will be
156         elided.
158         * call.c (build_user_type_conversion_1): Use OVL_FIRST.
159         (print_error_for_call_failure): Use OVL_NAME.
160         (build_op_call_1): Use ovl_iterator.
161         (add_candidates): Use OVL_FIRST & lkp_iterator.
162         (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
163         lkp_iterator.
164         * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
165         (type_has_user_nondefault_constructor,
166         in_class_defaulted_default_constructor,
167         type_has_user_provided_constructor,
168         type_has_user_provided_or_explicit_constructor,
169         type_has_non_user_provided_default_constructor,
170         vbase_has_user_provided_move_assign,
171         type_has_move_constructor, type_has_move_assign,
172         type_has_user_declared_move_constructor,
173         type_has_user_declared_move_assign,
174         type_build_ctor_call, type_build_dtor_call,
175         type_requires_array_cookie, explain_non_literal_class): Likewise.
176         (finish_struct): Use lkp_iterator.
177         (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
178         (note_name_declared_in_class): Use OVL_NAME.
179         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
180         (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
181         cxx_pretty_printer::expression): Likewise.
182         * decl2.c (check_classfn): Use ovl_iterator.
183         * pt.c (retrieve_specialization): Use ovl_iterator.
184         * tree.c (cp_tree_equal): Use lkp_iterator.
185         (type_has_nontrivial_copy_init): Use ovl_iterator.
187         * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
188         check is_overloaded_fn.
190 2017-05-16  Martin Liska  <mliska@suse.cz>
192         * parser.c (cp_lexer_print_token): Add default value for flags
193         argument of print_gimple_stmt, print_gimple_expr,
194         print_generic_stmt and print_generic_expr.
196 2017-05-16  Nathan Sidwell  <nathan@acm.org>
198         * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
199         iterators.
200         (MAYBE_BASELINK_FUNCTIONS): New.
201         * constraint.cc (resolve_constraint_check): Use lkp_iterator.
202         * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
203         * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
204         * method.c (inherited_ctor_binfo): Use ovl_iterator.
205         (binfo_inherited_from): Likewise.
206         * parser.c (lookup_literal_operator): Use lkp_iterator.
207         * pt.c (iterative_hash_template_arg): Use lkp_iterator.
208         (print_candidates_1): Likewise.
209         (determine_specialization): Likewise.
210         (resolve_overloaded_unification): Likewise.
211         (resolve_nondeduced_context): Likewise.
212         (type_dependent_expression_p): Likewise.
213         (dependent_template_p): Likewise.
214         * ptree.c (cxx_print_xnode): Likewise.
215         * semantics.c (omp_reduction_lookup): Use lkp_iterator.
216         (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
217         * typeck.c (check_template_keyword): Use lkp_iterator.
219         * cp-tree.h (OVL_FIRST, OVL_NAME): New.
220         (ovl_first): New.
221         * constexpr.c (function_concept_check): Use OVL_FIRST.
222         * cvt.c (build_expr_type_conversion): Likewise.
223         * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
224         * decl2.c (mark_used): Use OVL_FIRST.
225         * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
226         (dump_expr, location_of): Use OVL_FIRST.
227         * friend.c (do_friend): Use OVL_NAME.
228         * init.c (build_offset_ref): Use OVL_FIRST.
229         * mangle.c (write_member_name): Likewise.
230         (write_expression): Use OVL_NAME.
231         * method.c (strip_inheriting_ctors): Use OVL_FIRST.
232         * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
233         * pt.c (check_explicit_specialization): Use OVL_FIRST.
234         (check_template_shadow): Likewise.
235         (tsubst_template_args): Use OVL_NAME.
236         (tsubst_baselink): Use OVL_FIRST.
237         * semantics.c (perform_koenig_lookup): Use OVL_NAME.
238         * tree.c (get_first_fn): Use OVL_FIRST.
239         * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
240         (cp_build_addr_expr_1): Use OVL_FIRST.
242         * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
243         peeking.
244         * semantics.c (finish_id_expression): Directly init local var.
245         (finish_omp_reduction_clause): Use really_overloaded_fn.
246         * tree.c (get_fns): Document.  Assert we got an overload.
247         (get_first_fn) Document.
248         * typeck.c (cp_build_addr_expr_1): Pass arg directly to
249         really_overloaded_fn.
250         * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
252         * cp-tree.h (SCOPE_DEPTH): New.
253         * name-lookup.h (is_nested_namespace): Declare.
254         * name-lookup.c (is_nested_namespace): New.
255         (is_ancestor): Use it.
256         (set_decl_namespace): Likewise.
257         (push_namespace): Set SCOPE_DEPTH.
258         * pt.c (check_specialization_namespace): Use is_nested_namespace.
259         (check_unqualigied_spec_or_inst): Likewise.
261 2017-05-15  Nathan Sidwell  <nathan@acm.org>
263         PR c++/79369
264         * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
265         * name-lookup.h (push_namespace): Return int, add make_inline arg.
266         * name-lookup.c (push_namespace): Deal with inline directly.
267         Return pushed count.
268         * parser.c (cp_parser_namespace_definition): Adjust for
269         push_namespace change.
271 2017-05-11  Nathan Sidwell  <nathan@acm.org>
273         * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
274         LANG_HOOKS_PUSHDECL): Move to ...
275         * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
276         LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
277         * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
279         * name-lookup.h (pushdecl): Add default friend parm.
280         (pushdecl_maybe_friend): Delete.
281         (pushdecl_top_level): Add default friend parm.
282         (pushdecl_top_level_maybe_friend): Delete.
283         * name-lookup.c (pushdecl_maybe_friend): Delete.
284         (pushdecl): Add is_friend parm.
285         (pushdecl_top_level): Add is friend_parm.
286         (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
287         (pushdecl_top_level_and_finish): Do pushing and finishing directly.
288         * friend.c (do_friend): Adjust.
289         * pt.c (tsubst_friend_class): Adjust.
291         Revert pushdecl_top_level_and_finish name change.
292         * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
293         * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
294         * decl.c (cp_make_fname_decl): Adjust.
295         * decl2.c (get_guard, handle_tls_init):  Adjust.
296         * rtti.c (get_tinfo_decl, tinfo_base_init):  Adjust.
298         * name-lookup.c (pushdecl_outermost_localscope): Always
299         conditionally stop timer.
301         * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
302         * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
304         * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
305         pushtag_top_level_maybe_friend,
306         pushdecl_top_level_and_finish): Move declarations to ...
307         * name-lookup.h: ... here.  Group pushdecl variants.
308         (pushdecl_top_level_and_finish): Rename to ...
309         (pushdecl_top_level_with_init): ... here.
310         * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
311         * decl2.c (get_guard, handle_tls_init): Likewise.
312         * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
313         * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
314         * method.c (implicitly_declare_fn): Likewise.
315         * searchc (node_debug_info_needed): Likewise.
316         * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
317         (pushdecl_top_level_with_init): ... here.
318         (pop_everything): Use namespace_bindings_p.
320         * name-lookup.h (pop_binding): Rename to pop_local_binding.
321         (getdecls): Rename to get_local_decls.
322         * name-lookup.c (pop_binding): Rename to ...
323         (pop_local_binding): ... here.
324         (pop_bindings_and_leave_scope): Adjust.
325         (getdecls): Rename to ...
326         (get_local_decls): ... here.  Assert local scope.
327         * decl.c (poplevel): Assert not namespace.  Adjust and simplify
328         logic.
329         (store_parm_decls): Adjust get_local_decls call.
330         (parser.c (synthesize_implicit_template_parm): Likewise.
332 2017-05-11  Ville Voutilainen  <ville.voutilainen@gmail.com>
334         PR c++/80682
335         * method.c (is_trivially_xible): Reject void types.
337 2017-05-10  Nathan Sidwell  <nathan@acm.org>
339         * class.c (handle_using_decl): Always use OVL_CURRENT.
340         (resolve_address_of_overloaded_function): Move iterator decl into
341         for scope.  Don't strip anticipated decls here.
343         * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
344         printing.
345         (print_candidates): Adjust.
347         * cp-tree.h (build_new_function_call): Lose koenig_p arg.  Fix
348         line breaking.
349         * call.c (build_new_function_call): Lose koenig_p arg.  Remove
350         koenig_p handling here.
351         * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
352         (tsubst_omp_clauses): Likewise.
353         (do_class_deduction): Adjust buld_new_function_call calls.
354         * semantics.c (finish_call_expr): Likewise.
356 2017-05-10  Jason Merrill  <jason@redhat.com>
358         * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
359         (unify_type_mismatch, unify_parameter_pack_mismatch)
360         (unify_ptrmem_cst_mismatch, unify_expression_unequal)
361         (unify_parameter_pack_inconsistent, unify_inconsistency)
362         (unify_vla_arg, unify_method_type_error, unify_arity)
363         (unify_arg_conversion, unify_no_common_base)
364         (unify_inconsistent_template_template_parameters)
365         (unify_template_deduction_failure)
366         (unify_template_argument_mismatch)
367         (unify_overload_resolution_failure): Call unify_invalid.
369         CWG 1847 - Clarifying compatibility during partial ordering
370         * pt.c (more_specialized_fn): No order between two non-deducible
371         parameters.
373         * pt.c (dependent_type_p): Make sure we aren't called with
374         global_type_node.
376         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
377         * pt.c (convert_template_argument): Just return an argument pack.
378         (coerce_template_parameter_pack, template_parm_to_arg)
379         (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
380         (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
381         Don't set the type of a NONTYPE_ARGUMENT_PACK.
382         * parser.c (make_char_string_pack, make_string_pack): Likewise.
384 2017-05-10  Nathan Sidwell  <nathan@acm.org>
386         * cp-tree.h (add_method, clone_function_decl): Change last arg to
387         bool.
388         * class.c (add_method): Change third arg to bool.  Adjust.
389         (one_inheriting_sig, one_inherited_ctor): Adjust.
390         (clone_function_decl): Change 2nd arg to bool.  Adjust.
391         (clone_constructors_and_destructors): Adjust.
392         * lambda.c (maybe_add_lambda_conv_op): Adjust.
393         * method.c (lazily_declare_fn): Adjust.
394         * pt.c (tsubst_decl, instantiate_template_1): Adjust.
395         * semantics.c (finish_member_declaration): Adjust.
397 2017-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
399         PR c++/80145
400         * decl.c (finish_function): To improve error recovery, change the
401         logic for calling apply_deduced_return_type.
403 2017-05-09  Jason Merrill  <jason@redhat.com>
405         * class.c (check_bases): Ignore empty bases.
407         PR c++/70979 - literal class and closure types
408         * class.c (finalize_literal_type_property): Handle closures
409         specifically.
410         (explain_non_literal_class): Likewise.
412         PR c++/66297, DR 1684 - literal class and constexpr member fns
413         * constexpr.c (is_valid_constexpr_fn): Only complain about
414         non-literal enclosing class in C++11.
415         * class.c (finalize_literal_type_property): Likewise.
417 2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
419         PR c++/80186
420         * pt.c (tsubst_decl): Early return error_mark_node if
421         grok_ctor_properties returns false.
423 2017-05-09  Jason Merrill  <jason@redhat.com>
425         PR c++/70167 - array prvalue treated as lvalue
426         * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
427         (enum fcl_t): New.
428         * semantics.c (finish_compound_literal): Add fcl_context parameter.
429         Only make a static variable for C99 syntax.
430         * parser.c (cp_parser_postfix_expression): Pass it.
431         * pt.c (tsubst_copy_and_build): Likewise.
432         * call.c (extend_ref_init_temps): Set
433         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
435 2017-05-09  Nathan Sidwell  <nathan@acm.org>
437         * cp-lang.c (get_global_decls, cxx_pushdecl): New.
438         (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
439         * name-lookup.h (pushdecl_top_level): Declare.
441 2017-05-08  Jason Merrill  <jason@redhat.com>
443         PR c++/80178 - parameter passing for uncopyable classes
444         * tree.c (type_has_nontrivial_copy_init): True for classes with only
445         deleted copy/move ctors.
446         (remember_deleted_copy, maybe_warn_parm_abi): New.
447         * decl.c (require_complete_types_for_parms, check_function_type):
448         Call maybe_warn_parm_abi.
449         * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
451 2017-05-08  Nathan Sidwell  <nathan@acm.org>
453         * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
454         (start_preparsed_function): Do decl pushing before setting
455         current_funciton_decl and announcing it.
457         * name-lookup.h (pushdecl_with_scope): Replace with ...
458         (pushdecl_outermost_localscope): ... this.
459         * name-lookup.c (pushdecl_with_scope): Replace with ...
460         (pushdecl_outermost_localscope): ... this.
461         (pushdecl_namespace_level): Adjust.
462         * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
463         * lambda.c (insert_capture_proxy): Likewise.
465         * class.c (build_vtbl_initializer): Don't shadow outer variable
466         with static var.
468         Revert _binding -> _value change.
469         * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
470         (get_namespace_binding, set_global_binding): ... these.
471         * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
472         (get_namespace_binding, set_global_binding): ... these.
473         (arg_assoc_namespace, pushdecl_maybe_friend_1,
474         check_for_out_of_scope_variable, push_overloaded_decl_1,
475         lookup_name_innermost_nonclass_level, push_namespace): Adjust.
476         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
477         SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
478         * decl.c (poplevel): Adjust.
479         * pt.c (make_constrained_auto): Likewise.
481 2017-05-07  Volker Reichelt  <v.reichelt@netcologne.de>
483         PR translation/80280
484         * call.c (print_z_candidate): Fix quoting.
486 2017-05-05  David Malcolm  <dmalcolm@redhat.com>
488         * error.c (pedwarn_cxx98): Replace report_diagnostic
489         with diagnostic_report_diagnostic.
491 2017-05-05  Nathan Sidwell  <nathan@acm.org>
493         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
494         (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
495         (IDENTIFIER_NAMESPACE_VALUE): Delete.
496         * name-lookup.h (namespace_binding, set_namespace_binding): Replace
497         with ...
498         (get_namespace_value, set_global_value): ... these.
499         (get_global_value_if_present, is_typename_at_global_scope): Delete.
500         * decl.c (poplevel): Use get_namespace_value.
501         (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
502         * class.c (build_vtbl_initializer): Stash library decl in
503         static var. Use IDENTIFIER_GLOBAL_VALUE.
504         * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
505         do_allocate_exception, do_free_exception, build_throw): Likewise.
506         * init.c (throw_bad_array_new_length): Likewise.
507         * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
508         * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
509         check_for_our_of_scope_variable, push_overloaded_decl_1): Use
510         get_namespace_value.
511         (set_namespace_binding_1): Rename to
512         (set_namespace_binding): ... here.
513         (set_global_value): New.
514         (lookup_name_innermost_nonclass_level_1, push_namespace): Use
515         get_namespace_value.
516         * pt.c (listify): Use get_namespace_value.
518         * call.c (make_temporary_var_for_ref_to_temp): Push decl into
519         current scope.
520         * lex.c (unqualified_name_lookup_error): Likewise.
522         * class.c (alter_class): Use retrofit_lang_decl directly.
523         * decl.c (push_local_name, dupliate_decls): Likewise.
524         * semantics.c (omp_privatize_field): Likewise.
526         Kill walk_namespaces.
527         * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
528         * decl.c (walk_namespaces_r, walk_namespaces): Delete.
530         Kill per-namespace static_decls.
531         * cp-tree.h (static_decls): Declare.
532         (wrapup_globals_for_namespace,
533         diagnose_inline_vars_for_namespace): Replace with ...
534         (wrapup_namespace_globals): ... this.
535         * decl.c (static_decls): Define.
536         (wrapup_globals_for_namespace,
537         diagnose_inline_vars_for_namespace): Replace with ...
538         (wrapup_namespace_globals): ... this.
539         (cxx_init_decl_processing): Initialize static_decls.
540         * decl2.c (c_parse_final_cleanups): Adjust.
541         * name-lookup.h (cp_binding_level): Remove static_decls member.
542         * name-lookup.c (add_decl_to_level): Adjust.
543         (begin_scope): Adjust.
545 2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
547         PR c++/71577
548         * decl.c (reshape_init): Unconditionally return error_mark_node
549         upon error about too many initializers.
551 2017-05-04  Nathan Sidwell  <nathan@acm.org>
553         * constraint.cc (diagnose_check_constraint): Fix %E thinko.
555 2017-05-04  Martin Sebor  <msebor@redhat.com>
557         PR translation/80280
558         * call.c (print_z_candidate): Add missing quoting to %D and other
559         like directives.
560         (build_op_call_1): Same.
561         * constraint.cc (diagnose_check_constraint): Same.
562         * mangle.c (mangle_decl): Same.
563         * name-lookup.c (cp_binding_level_debug): Same.
564         (set_decl_namespace): Same.
565         * parser.c (cp_parser_tx_qualifier_opt): Same.
566         * pt.c (print_candidates_1): Same.
567         (check_template_variable): Same.
568         (tsubst_default_argument): Same.
569         (most_specialized_partial_spec): Same.
570         * semantics.c (omp_reduction_lookup): Same.
571         * tree.c (check_abi_tag_redeclaration): Same.
572         * typeck.c (comptypes): Same.
573         * typeck2.c (abstract_virtuals_error_sfinae): Same.
575 2017-05-04  Nathan Sidwell  <nathan@acm.org>
577         More global trees.
578         * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
579         CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
580         CPTI_INIT_LIST_IDENTIFIER.
581         (global_namespace, global_type_node, global_identifier,
582         anon_identifier, init_list_identifier): New.
583         * decl.c (global_type_node, global_scope_name): Delete.
584         (initialize_predefined_identifiers): Add new identifiers.
585         (cxx_init_decl_processing): Adjust.
586         * name-lookup.h (global_namespace, global_type_node): Delete.
587         * name-lookup.c (global_namespace, anonymous_namespace_name,
588         get_anonymous_namespace_name): Delete.
589         (namespace_scope_ht_size, begin_scope, pushtag_1,
590         push_namespace): Adjust,
591         * call.c (type_has_extended_temps): Use init_list_identifier.
592         * pt.c (listify): Likewise.
594         * name-lookup.c: Reorder functions to make merging from modules
595         branch simpler.
597 2017-05-03  Jason Merrill  <jason@redhat.com>
599         * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
601 2017-05-03  Nathan Sidwell  <nathan@acm.org>
603         * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
604         along with #defines, to before name-lookup include.
606 2017-05-02  Paolo Carlini  <paolo.carlini@oracle.com>
608         * pt.c (is_auto_or_concept): Remove.
609         (type_uses_auto_or_concept): Remove, unused.
610         (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
611         * parser.c (tree_type_is_auto_or_concept): Remove, unused.
612         * cp-tree.h (is_auto_or_concept): Remove.
614 2017-05-01  Xi Ruoyao  <ryxi@stu.xidian.edu.cn>
616         PR c++/80038
617         * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
618         add pedigree operation and detach call here.
619         * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
620         cilk_cp_gimplify_call_params_in_spawned_fn.
621         (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
622         * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
624 2017-04-29  Volker Reichelt  <v.reichelt@netcologne.de>
626         * parser.c (cp_parser_member_declaration): Add fix-it hints for
627         stray comma and missing semicolon at end of member declaration.
629 2017-04-27  Volker Reichelt  <v.reichelt@netcologne.de>
631         * parser.c (cp_parser_cast_expression): Add target type of cast to
632         diagnostic.
633         * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
635 2017-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
637         * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
638         return type to bool.
639         * cp-tree.h (grok_ctor_properties): Update.
641 2017-04-26  Volker Reichelt  <v.reichelt@netcologne.de>
643         * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
644         information to diagnostic of invalid colon in nested-name-specifier.
646 2017-04-25  Volker Reichelt  <v.reichelt@netcologne.de>
648         * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
649         diagnostic of invalid class/struct keyword after enum.
651 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
653         * parser.c (cp_parser_member_declaration): Add fix-it hint
654         for removing stray semicolons.
656 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
658         * name-lookup.c (get_std_name_hint): New function.
659         (maybe_suggest_missing_header): New function.
660         (suggest_alternative_in_explicit_scope): Call
661         maybe_suggest_missing_header.
663 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
665         PR c++/80177
666         * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
667         candidate type of bm from tree to const char *.
668         (consider_binding_level): Likewise.
669         (lookup_name_fuzzy): Likewise, using this to merge the best
670         result from the preprocessor into bm, rather than immediately
671         returning, so that better matches from reserved words can "win".
672         Guard the rejection of keywords that don't start decl-specifiers
673         so it only happens for FUZZY_LOOKUP_TYPENAME.
675 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
677         * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
678         (start_enum): Likewise.
679         (build_enumerator): Likewise. Use %qE instead of plain %E.
680         * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
681         %<%D%> in diagnostics.
682         (cp_parser_elaborated_type_specifier): Likewise.
683         * pt.c (make_pack_expansion): Use %qT and %qE instead of
684         %<%T%> and %<%E%> in diagnostics.
685         (tsubst_pack_expansion): Likewise.
687 2017-04-24  David Malcolm  <dmalcolm@redhat.com>
689         PR c++/80016
690         * parser.c (cp_parser_unary_expression):  Generate a location
691         range for alignof and sizeof expressions.
693 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
695         * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
696         error message.
697         (cp_parser_virt_specifier_seq_opt): Likewise.
698         (set_and_check_decl_spec_loc): Likewise twice.
700 2017-04-21  Jason Merrill  <jason@redhat.com>
702         PR c++/80179 - ICE with initialized flexible array member.
703         * constexpr.c (verify_ctor_sanity): Handle flexible array members.
705 2017-04-21  Richard Biener  <rguenther@suse.de>
707         * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
708         (copy_type): Likewise.
709         * lex.c (copy_decl): Pass down mem-stat info.
710         (copy_type): Likewise.
712 2017-04-20  Jonathan Wakely  <jwakely@redhat.com>
714         PR c++/80473
715         * init.c (build_new_1): Suppress notes about over-aligned new when
716         the warning is suppressed.
718 2017-04-20  Volker Reichelt  <v.reichelt@netcologne.de>
720         * parser.c (cp_parser_member_declaration): Add warning with fixit
721         information for extra semicolon after in-class function definition.
723 2017-04-20  Jakub Jelinek  <jakub@redhat.com>
725         PR middle-end/80423
726         * tree.c (build_cplus_array_type): Call build_array_type
727         with the intended TYPE_TYPELESS_STORAGE flag value, instead
728         of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
729         on the shared type.
731 2017-04-18  Marek Polacek  <polacek@redhat.com>
733         PR c++/80244 - ICE with attribute in template alias.
734         * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
736         PR c++/80241 - ICE with alignas pack expansion.
737         * error.c (dump_expr): Handle TREE_LIST.
738         * parser.c (cp_parser_std_attribute_list): Return error_mark if
739         make_pack_expansion returns an error.
741 2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>
743         PR c++/80287
744         * class.c (fixup_may_alias): Fix all type variants.
746 2017-04-17  Jason Merrill  <jason@redhat.com>
748         PR c++/80415 - wrong error with default arg and array reference.
749         * tree.c (lvalue_kind): Return clk_class for an array prvalue.
751         * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
753 2017-04-15  Alexandre Oliva <aoliva@redhat.com>
755         * decl.c (name_unnamed_type): Split out of...
756         (grokdeclarator): ... this.
757         * decl.h (name_unnamed_type): Declare.
759 2017-04-12  Richard Biener  <rguenther@suse.de>
760         Bernd Edlinger  <bernd.edlinger@hotmail.de>
762         PR middle-end/79671
763         * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
764         for arrays of character or std::byte type.
766 2017-04-11  Jason Merrill  <jason@redhat.com>
768         PR c++/80294 - ICE with constexpr and inheritance.
769         * constexpr.c (reduced_constant_expression_p):
770         A null constructor element is non-constant.
771         (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
772         returning an empty base.
774 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
776         PR c++/80370
777         * decl.c (cp_finish_decomp): If processing_template_decl on
778         non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
779         change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
780         sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
781         processing.
782         * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
783         with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
784         dependent.
786 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
788         PR c++/80363
789         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
791 2017-04-10  Jakub Jelinek  <jakub@redhat.com>
793         PR c++/80176
794         * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
795         operand, if it is a static member function, recurse on the
796         BASELINK.
798 2017-04-10  Marek Polacek  <polacek@redhat.com>
800         PR sanitizer/80348
801         * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
802         ORIG_TYPE earlier and not only when shortening.
804 2017-04-07  Jason Merrill  <jason@redhat.com>
806         PR c++/80356 - ICE with reference to function template argument.
807         PR c++/79294
808         * pt.c (convert_nontype_argument_function): Adjust type even with a
809         value-dependent argument.
811         PR c++/80267 - ICE with nested capture of reference
812         PR c++/60992
813         * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
815 2017-04-07  Marek Polacek  <polacek@redhat.com>
817         PR sanitizer/80348
818         * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
820         PR c++/80095
821         * call.c (build_over_call): Don't check cxx_dialect.
822         * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
823         whether SUB is a CONSTRUCTOR.
824         * init.c (build_new_1): Don't check cxx_dialect.
825         * tree.c (replace_placeholders): Add a function comment.  Return if
826         not in C++14, or if the object isn't a (member of a) class.
827         * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
828         TYPE is CLASS_TYPE_P.
830 2017-04-05  Jakub Jelinek  <jakub@redhat.com>
832         PR c++/80309
833         * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
834         of a loop doing vec_safe_push of NULL.  Formatting fixes.
835         (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
836         to newidx before calling canonical_type_parameter on newtype.
838 2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
840         PR c++/80296
841         * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
842         UNARY_PLUS_EXPR case.
844 2017-04-03  Jason Merrill  <jason@redhat.com>
846         * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
848 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
850         * class.c (update_vtable_entry_for_fn): Fix typo in comment.
851         * decl2.c (one_static_initialization_or_destruction): Likewise.
852         * name-lookup.c (store_bindings): Likewise.
853         * parser.c (make_call_declarator): Likewise.
854         * pt.c (check_explicit_specialization): Likewise.
856 2017-04-03  Jason Merrill  <jason@redhat.com>
858         PR sanitizer/79993 - ICE with VLA initialization from string
859         PR c++/69487 - wrong VLA initialization from string
860         * init.c (finish_length_check): Split out from build_vec_init.
861         (build_vec_init): Handle STRING_CST.
862         * typeck2.c (split_nonconstant_init): Handle STRING_CST.
863         (digest_init_r): Don't give a STRING_CST VLA type.
865 2017-03-31  Jakub Jelinek  <jakub@redhat.com>
867         PR c++/79572
868         * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
869         REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
870         for NOP_EXPR to REFERENCE_TYPE.
872         PR libstdc++/80251
873         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
874         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
875         CPTK_IS_AGGREGATE.
876         * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
877         Remove extraneous parens.
878         (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
879         * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
880         (cp_parser_trait_expr): Likewise.
882 2017-03-27  Jakub Jelinek  <jakub@redhat.com>
884         PR middle-end/80162
885         * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
886         * typeck.c (cxx_mark_addressable): Likewise.  Look through
887         VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
888         to ARRAY_TYPE.
889         (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
891 2017-03-24  Jason Merrill  <jason@redhat.com>
893         PR c++/77339 - ICE with invalid use of alias template.
894         * pt.c (lookup_template_class_1): Don't try to enter the scope of an
895         alias template.
897 2017-03-24  Marek Polacek  <polacek@redhat.com>
899         PR c++/80119
900         * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
901         doesn't have side effects.
903 2017-03-23  Jason Merrill  <jason@redhat.com>
905         PR c++/80150 - ICE with overloaded variadic deduction.
906         * pt.c (try_one_overload): Remove asserts.
908         PR c++/77563 - missing ambiguous conversion error.
909         * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
911 2017-03-23  Marek Polacek  <polacek@redhat.com>
913         * cp-tree.h: Remove a C_RID_YYCODE reference.
915 2017-03-22  Jakub Jelinek  <jakub@redhat.com>
917         PR c++/80141
918         * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
919         case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
920         processing_template_decl.
922 2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
924         PR c++/77752
925         * name-lookup.c (pushtag_1): Add check for bogus, non template,
926         std::initializer_list.
928 2017-03-21  Jakub Jelinek  <jakub@redhat.com>
930         PR c++/35878
931         * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
933 2017-03-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
935         PR c++/35878
936         * init.c (std_placement_new_fn_p): New.
937         (build_new_1): Call it.
939 2017-03-20  Jason Merrill  <jason@redhat.com>
941         PR c++/80096 - ICE with C++17 non-type auto.
942         * pt.c (tsubst): Delay tsubst of type of template non-type
943         parameter.
945         PR c++/79519 - ICE with deleted template friend.
946         * decl.c (grokdeclarator): Complain about misplaced function
947         definition using =, as well.
949         PR c++/79640 - infinite recursion with generic lambda.
950         * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
951         before substituting its initializer.
953 2017-03-20  Marek Polacek  <polacek@redhat.com>
954             Paolo Carlini  <paolo.carlini@oracle.com>
956         PR c++/80059 - ICE with noexcept and __transaction_atomic
957         * except.c (build_must_not_throw_expr): Call
958         instantiate_non_dependent_expr.
960 2017-03-19  Jason Merrill  <jason@redhat.com>
962         PR c++/80084 - wrong C++17 decomposition by reference of parameter.
963         * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
964         reference decomposition.
966         PR c++/80077 - error with constexpr and -fno-elide-constructors.
967         * constexpr.c (cxx_eval_call_expression): Set ctx->call while
968         expanding trivial constructor.
970 2017-03-17  Jason Merrill  <jason@redhat.com>
972         PR c++/78345 - ICE initializing array from lambda.
973         * init.c (build_aggr_init): Check array initializer.
974         (build_vec_init): Check the type of a CONSTRUCTOR.
976         PR c++/80073 - C++17 ICE with virtual base.
977         * decl.c (xref_basetypes): Also check for indirect vbases.
979 2017-03-16  Jason Merrill  <jason@redhat.com>
981         * decl.c (start_enum): std::byte aliases anything.
983         PR c++/79797
984         * constexpr.c (lookup_placeholder): Tweak.
986 2017-03-15  Jason Merrill  <jason@redhat.com>
988         PR c++/80043 - ICE with -fpermissive
989         * typeck.c (convert_for_assignment): Handle instantiate_type
990         not giving an error.
992 2017-03-14  Nathan Sidwell  <nathan@acm.org>
994         PR c++/79393 DR 1658 workaround
995         * method.c (synthesized_method_base_walk): Inihibit abstract class
996         virtual base access check here.
997         (synthesized_method_walk): Not here.
999 2017-03-13  Nathan Sidwell  <nathan@acm.org>
1001         PR c++/79393 DR 1658 workaround
1002         * method.c (synthesized_method_walk): Check vbases of abstract
1003         classes for dtor walk.
1005 2017-03-10  David Malcolm  <dmalcolm@redhat.com>
1007         PR translation/79848
1008         * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
1010 2017-03-10  Jason Merrill  <jason@redhat.com>
1012         PR c++/79960 - alias templates and partial ordering
1013         * pt.c (comp_template_args): Add partial_order parm.
1014         (template_args_equal): Likewise.
1015         (comp_template_args_porder): New.
1016         (get_partial_spec_bindings): Use it.
1018 2017-03-10  Marek Polacek  <polacek@redhat.com>
1020         PR c++/79967
1021         * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
1023 2017-03-10  Jakub Jelinek  <jakub@redhat.com>
1025         PR c++/79899
1026         * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
1027         Use XALLOCAVEC macro.
1029         PR c++/79896
1030         * decl.c (finish_enum_value_list): If value is error_mark_node,
1031         don't copy it and change its type.
1032         * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
1033         of CONST_DECL is error_mark_node.
1035 2017-03-09  Marek Polacek  <polacek@redhat.com>
1037         PR c++/79900 - ICE in strip_typedefs
1038         * tree.c (strip_typedefs): Skip the attribute handling if T is
1039         a variant type which hasn't been updated yet.
1041         PR c++/79687 - wrong code with pointer-to-member
1042         * init.c (constant_value_1): Break if the variable has a dynamic
1043         initializer.
1045 2017-03-08  Jason Merrill  <jason@redhat.com>
1047         PR c++/79797 - ICE with self-reference in array DMI.
1048         * constexpr.c (lookup_placeholder): Split out...
1049         (cxx_eval_constant_expression): ...from here.
1051 2017-03-07  Jakub Jelinek  <jakub@redhat.com>
1053         PR c/79834
1054         * parser.c (cp_parser_omp_cancellation_point,
1055         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
1056         cp_parser_omp_target_update): Change "may only be used in compound
1057         statements" diagnostics, such that the same translatable string is
1058         used for all pragmas.
1059         (cp_parser_pragma): Likewise.  Use error_at instead of
1060         cp_parser_error for that diagnostics.
1062 2017-03-06  Marek Polacek  <polacek@redhat.com>
1064         PR c++/79796 - ICE with NSDMI and this pointer
1065         * call.c (build_over_call): Handle NSDMI with a 'this' by calling
1066         replace_placeholders.
1068 2017-03-06  Jakub Jelinek  <jakub@redhat.com>
1070         PR c++/79822
1071         * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
1072         ({ (void) 0; }).
1074 2017-03-06  Jason Merrill  <jason@redhat.com>
1076         Revert "Allow deduction guides to look into primary template."
1077         * cp-tree.h, parser.c, pt.c, search.c: Revert.
1079 2017-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
1081         PR c++/70266
1082         * except.c (build_must_not_throw_expr): Perform the implicit
1083         conversions on the condition.
1085 2017-03-03  Jason Merrill  <jason@redhat.com>
1087         * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
1088         -Wc++1z-compat.
1090         Core issues 2273 and 2277
1091         * call.c (joust): Adjust using-declaration tiebreaker to handle
1092         the intermediate base case.
1093         * method.c (strip_inheriting_ctors): Just return the argument if
1094         !flag_new_inheriting_ctors.
1096 2017-03-03  Richard Biener  <rguenther@suse.de>
1098         PR c++/79825
1099         * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
1101 2017-03-03  Marek Polacek  <polacek@redhat.com>
1103         PR c++/79791
1104         * typeck.c (string_conv_p): In C++11, always call pedwarn with
1105         OPT_Wwrite_strings.
1107 2017-03-02  Jason Merrill  <jason@redhat.com>
1109         Update overload resolution with deduction guides.
1110         * pt.c (do_class_deduction): Always build the copy guide.
1111         (copy_guide_p, template_guide_p): New.
1112         (build_deduction_guide): Remember the original constructor.
1113         * call.c (joust): Prefer the copy guide and non-template guides.
1115         Allow deduction guides to look into primary template.
1116         * cp-tree.h (struct saved_scope): Add deduction_guide_type.
1117         (struct cp_decl_specifier_seq): Add constructor_p.
1118         * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
1119         (cp_parser_init_declarator): Check it.  Set ctor_dtor_or_conv_p.
1120         Clear deduction_guide_type.  Don't handle deduction guide names.
1121         (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
1122         (cp_parser_direct_declarator): Likewise.  Handle deduction guides.
1123         (cp_parser_member_declaration, cp_parser_cache_defarg)
1124         (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
1125         * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
1126         (build_deduction_guide): Set deduction_guide_type.
1127         (dependent_scope_p): Check deduction_guide_type.
1128         * search.c (lookup_member): Likewise.
1130 2017-03-02  Jakub Jelinek  <jakub@redhat.com>
1132         PR c++/79782
1133         * init.c (mark_exp_read_r): New function.
1134         (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
1135         whole arguments instead of plain mark_exp_read on TREE_LIST values.
1137 2017-03-01  Jason Merrill  <jason@redhat.com>
1139         Class template argument deduction in new-expression
1140         * init.c (build_new): Handle deduction from no initializer.
1141         * parser.c (cp_parser_new_expression): Don't require a single
1142         expression for class template deduction.
1143         * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
1144         class template placeholder.
1145         * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
1146         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
1147         (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
1149 2017-03-01  Jakub Jelinek  <jakub@redhat.com>
1151         PR c++/79746
1152         * init.c (emit_mem_initializers): When not constructing vbases of
1153         abstract classes, mark arguments as read for
1154         -Wunused-but-set-parameter.
1156 2017-02-28  Jason Merrill  <jason@redhat.com>
1158         Class template argument deduction refinements
1159         * call.c (joust): Move deduction guide tiebreaker down.
1160         * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
1161         deduction with no initializer.
1162         * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
1163         (do_class_deduction): Use that rather than special case.
1164         (do_auto_deduction): Handle null initializer.
1166 2017-02-28  Jakub Jelinek  <jakub@redhat.com>
1168         * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
1169         instead of just cond ? "..." : "...".
1170         (grokdeclarator): Likewise.
1171         (build_enumerator): Likewise.
1172         * init.c (build_new_1): Likewise.
1173         * call.c (build_new_method_call_1): Likewise.
1174         * parser.c: Include intl.h.
1175         (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
1176         "enter"/"exit" keyword.
1177         (cp_finalize_oacc_routine): Don't use %s to supply portions of the
1178         message.
1180 2017-02-27  Jason Merrill  <jason@redhat.com>
1182         PR c++/71568 - SFINAE forming pointer to member function
1183         * init.c (build_offset_ref): Check the return value of
1184         perform_or_defer_access_check.
1186 2017-02-27  Marek Polacek  <polacek@redhat.com>
1188         * decl.c (expand_static_init): Add missing } in a comment.
1190 2017-02-27  Volker Reichelt  <v.reichelt@netcologne.de>
1192         * init.c: Include intl.h.
1193         (build_new_1): Move message strings into pedwarn to make them
1194         -Wformat-security friendly. Mark string for translation.
1195         * pt.c (tsubst_copy_and_build): Mark string for translation.
1196         Make the pointer const.
1197         * semantics.c (finish_id_expression): Mark strings for translation.
1199 2017-02-25  Jakub Jelinek  <jakub@redhat.com>
1201         * call.c (build_op_delete_call): Make msg1 and msg2 const.
1203 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
1205         PR c++/79588
1206         * call.c (build_over_call): Call check_function_arguments even for
1207         -Wrestrict, adjust check_function_arguments caller.
1208         * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
1209         here.
1210         * typeck.c (cp_build_function_call_vec): Adjust
1211         check_function_arguments caller.
1213 2017-02-24  Marek Polacek  <polacek@redhat.com>
1215         PR translation/79705
1216         * decl.c (check_redeclaration_exception_specification): Mark a string
1217         for translation.  Make the pointer const.
1219 2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>
1221         PR c++/79361
1222         * pt.c (register_specialization): Check duplicate_decls return value
1223         for error_mark_node and pass it back.
1225 2017-02-22  Jason Merrill  <jason@redhat.com>
1227         PR c++/79679 - missing destructor for argument
1228         * call.c (build_over_call): Don't pass tf_no_cleanup to argument
1229         conversions.
1231         * pt.c (do_class_deduction): Handle 0 argument case.
1233 2017-02-22  Jakub Jelinek  <jakub@redhat.com>
1235         PR c++/79664
1236         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
1237         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
1238         * constexpr.c (potential_constant_expression_1): Handle
1239         OMP_*, OACC_* and CILK_* trees.  Use error_at with
1240         EXPR_LOC_OR_LOC (t, input_location) computed early
1241         instead of error, or error_at with location_of (t).
1243 2017-02-22  Marek Polacek  <polacek@redhat.com>
1245         PR c++/79653
1246         * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
1247         if the alignas expression is erroneous.
1248         * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
1249         error_mark_node.
1251         PR c++/79657
1252         * semantics.c (finish_underlying_type): Bail out for incomplete enums.
1254 2017-02-21  Jason Merrill  <jason@redhat.com>
1256         PR c++/50308 - wrong deprecated warning with ADL
1257         PR c++/17729 - duplicate deprecated warning
1258         * semantics.c (finish_id_expression): Only call mark_used on a
1259         function if we aren't building a call.
1261         PR c++/41727 - ICE with partial spec of partial instantiation
1262         * pt.c (process_partial_specialization): For now, don't check more
1263         specialized if there is more than one level of args.
1265 2017-02-21  Marek Polacek  <polacek@redhat.com>
1267         PR c++/79535
1268         * cp-tree.h (maybe_reject_flexarray_init): Declare.
1269         * init.c (maybe_reject_flexarray_init): No longer static.
1270         Add check for current_function_decl.
1271         * parser.c (cp_parser_late_parse_one_default_arg): Reject
1272         a default mem-initializer for a flexible array.
1274 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
1275             Paolo Carlini  <paolo.carlini@oracle.com>
1277         PR c++/79654
1278         * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
1279         on error.
1280         * pt.c (tsubst_decomp_names): Return error_mark_node if the first
1281         decl after the decomposition artificial decl has error_mark_node.
1282         * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
1283         instead of just == error_mark_node comparison.
1285 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
1287         PR sanitizer/79589
1288         * decl.c: Include gimplify.h.
1289         (cp_finish_decomp): Make sure there is no sharing of trees
1290         in between DECL_VALUE_EXPR of decomposition decls.
1292         PR c++/79655
1293         * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
1295         PR c++/79639
1296         * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
1297         call cplus_expand_constant on it first.
1299 2017-02-19  Jason Merrill  <jason@redhat.com>
1301         PR c++/78139 - destructor needed by new-expression
1302         * call.c (build_special_member_call): Use tf_no_cleanup.
1304         PR c++/78282 - auto template and pack expansion
1305         * pt.c (find_parameter_packs_r): Don't walk into the type of
1306         templates other than template template-parameters.
1308         PR c++/79606 - ICE with this->base_member in NSDMI
1309         * class.c (build_base_path): Check processing_template_decl.
1311         PR c++/79607 - ICE with T{} initializer
1312         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
1314         PR c++/79566 - elaborated-type-specifier in range for
1315         * parser.c (cp_parser_simple_declaration): Fix check for type
1316         definition.
1318         PR c++/79400 - confusing suggestion of 'noexcept'
1319         * parser.c (cp_parser_exception_specification_opt): Remove
1320         suggestion for deprecated dynamic exception-specification.
1322         PR c++/79470 - partial ordering with reference parameters
1323         * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
1325         PR c++/79500 - ICE with non-template deduction guide
1326         * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
1327         DECL_TEMPLATE_RESULT.
1329         PR c++/79580 - ICE with compound literal
1330         * parser.c (cp_parser_class_head): If we're in the middle of an
1331         expression, use ts_within_enclosing_non_class.
1333         PR c++/79503 - inherited ctor taking base class
1334         * call.c (add_function_candidate): Also check that
1335         DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
1337 2017-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
1339         PR c++/79380
1340         * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
1341         argument.
1343 2017-02-19  Eric Fiselier  <eric@efcs.ca>
1344             Jonathan Wakely  <jwakely@redhat.com>
1346         PR c++/69523
1347         * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
1348         control warning about literal suffix identifiers without a leading
1349         underscore.
1351 2017-02-17  Jason Merrill  <jason@redhat.com>
1353         PR c++/79508 - lookup error with member template
1354         * parser.c (cp_parser_template_name): Clear
1355         parser->context->object_type if we aren't doing lookup.
1357         PR c++/78690 - ICE with using and global type with same name
1358         * pt.c (type_dependent_object_expression_p): True for
1359         IDENTIFIER_NODE.
1361         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1362         * pt.c (convert_template_argument): Just return an auto arg pack.
1363         (tsubst_template_args): Don't tsubst an auto pack type.
1365         PR c++/79556 - C++17 ICE with non-type auto
1366         * pt.c (do_auto_deduction): Don't try to deduce from null type.
1368         PR c++/79533 - C++17 ICE with temporary cast to reference
1369         * call.c (build_over_call): Conversion to a reference prevents copy
1370         elision.
1372 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
1373             Jason Merrill  <jason@redhat.com>
1375         PR c++/79502 - lost nodiscard attribute
1376         * pt.c (apply_late_template_attributes): Do apply non-dependent
1377         attributes to types.
1379 2017-02-16  Jason Merrill  <jason@redhat.com>
1381         PR c++/78572 - ICE with self-modifying array initializer
1382         * constexpr.c (cxx_eval_store_expression): The object we're
1383         initializing is outside the constant-expression.
1384         (cxx_eval_call_expression): Set ctx->call.
1386         PR c++/79050 - ICE with undeduced auto and LTO
1387         * decl.c (poplevel): Remove undeduced auto decls.
1389 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
1391         PR c++/79512
1392         * parser.c (cp_parser_omp_target): For -fopenmp-simd
1393         ignore #pragma omp target even when not followed by identifier.
1395 2017-02-15  Jason Merrill  <jason@redhat.com>
1396             Jakub Jelinek  <jakub@redhat.com>
1398         PR c++/79464 - ICE in IPA with omitted constructor parms
1399         * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
1400         (adjust_clone_args): Adjust.
1401         (add_method): Remember omitted parms.
1402         * call.c (add_function_candidate): Likewise.
1403         * mangle.c (write_method_parms): Likewise.
1404         * method.c (ctor_omit_inherited_parms): Return false if there are no
1405         parms to omit.
1407 2017-02-15  Martin Sebor  <msebor@redhat.com>
1409         PR c++/79363
1410         * init.c (maybe_reject_flexarray_init): New function.
1411         (perform_member_init): Call it.
1413 2017-02-15  Jakub Jelinek  <jakub@redhat.com>
1415         PR c++/79301
1416         * parser.c (cp_parser_std_attribute): Don't pedwarn about
1417         [[deprecated]] with -std=c++11 and [[fallthrough]] with
1418         -std=c++11 and -std=c++14.
1420         PR c++/79288
1421         * decl.c (grokdeclarator): For static data members, handle thread_p
1422         only after handling inline.
1424 2017-02-14  Marek Polacek  <polacek@redhat.com>
1426         PR c++/79420
1427         PR c++/79463
1428         * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
1429         clobbering if the postfix expression isn't an EXPR_P.
1431 2017-02-13  Jason Merrill  <jason@redhat.com>
1433         PR c++/79461 - ICE with lambda in constexpr constructor
1434         * constexpr.c (build_data_member_initialization): Ignore
1435         initialization of a local variable.
1437 2017-02-13  Jakub Jelinek  <jakub@redhat.com>
1439         * init.c (warn_placement_new_too_small): Add missing space in
1440         diagnostics.
1441         * parser.c (cp_parser_oacc_declare): Likewise.
1442         * mangle.c (maybe_check_abi_tags): Likewise.
1444         PR c++/79232
1445         * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
1446         on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
1447         in the rightmost operand.
1449 2017-02-13  Nathan Sidwell  <nathan@acm.org>
1451         PR c++/79296 - ICE mangling localized template instantiation
1452         * decl2.c (determine_visibility): Use template fn context for
1453         local class instantiations.
1455 2017-02-11  Jason Merrill  <jason@redhat.com>
1457         PR c++/77659 - ICE with new and C++14 aggregate NSDMI
1458         * init.c (build_new): Make backups of any CONSTRUCTORs in init.
1459         (build_new_1): Use replace_placeholders.
1460         * tree.c (replace_placeholders_t): Also track whether we've seen a
1461         placeholder.
1462         (replace_placeholders, replace_placeholders_r): Adjust.
1463         * cp-tree.h: Adjust.
1465         PR c++/77790 - ICE with auto function in C++11 mode
1466         * decl.c (undeduced_auto_decl): Remove C++14 limitation.
1467         (require_deduced_type): Add complain parm, return bool.
1468         * cp-tree.h: Adjust.
1469         * decl2.c (mark_used): Use require_deduced_type.
1471 2017-02-10  Jason Merrill  <jason@redhat.com>
1473         PR c++/78908 - template ops and bitfields
1474         * tree.c (build_min_non_dep): Use unlowered_expr_type.
1476         PR c++/78897 - constexpr union
1477         * constexpr.c (cxx_eval_store_expression): A store to a union member
1478         erases a previous store to another member.
1480         PR c++/71285 - member of fold-expression
1481         * semantics.c (finish_unary_fold_expr)
1482         (finish_binary_fold_expr): Use null type for fold-expressions.
1484         PR c++/79401 - protected inherited constructor
1485         * call.c (enforce_access): For inheriting constructor, find a base
1486         binfo in the path we already have.
1488 2017-02-10  Marek Polacek  <polacek@redhat.com>
1490         PR c++/79435
1491         * pt.c (type_dependent_expression_p): Check if the expression type
1492         is null.
1494         PR c++/79184
1495         * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
1496         if warnings shouldn't be given.
1498 2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
1500         PR c++/71737
1501         * pt.c (tsubst_decl): Don't try to preserve a typedef that names
1502         an error_mark_node as type.
1504 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
1505             Jason Merrill  <jason@redhat.com>
1507         PR c++/79143
1508         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
1509         from pattern to type.
1511 2017-02-09  Jason Merrill  <jason@redhat.com>
1513         PR c++/79316 - default argument in deduction guide
1514         PR c++/79350 - explicit deduction guide
1515         * parser.c (cp_parser_constructor_declarator_p)
1516         (cp_parser_direct_declarator): Parse deduction guides more like
1517         constructors.
1518         * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
1519         * tree.c (special_function_p): Return it.
1520         * decl.c (check_special_function_return_type): Handle it.
1521         (grokdeclarator, grokfndecl): Adjust.
1522         (cp_finish_decl): Pass flags to do_auto_deduction.
1523         * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
1524         * pt.c (dguide_name_p): Take a const_tree.
1525         (do_class_deduction): Handle explicit.
1526         (do_auto_deduction): Pass flags through.
1527         (build_deduction_guide): Copy explicit flag.
1529 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
1531         PR c++/79429
1532         * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
1533         non-pragma_compound context here.
1534         (cp_parser_omp_target): Likewise.
1535         (cp_parser_pragma): Don't call push_omp_privatization_clauses and
1536         parsing for ordered and target omp pragmas in non-pragma_stmt
1537         non-pragma_compound contexts.
1539         PR c/79431
1540         * parser.c (cp_parser_oacc_declare): Formatting fix.
1541         (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
1542         automatic variables.
1544 2016-02-09  Nathan Sidwell  <nathan@codesourcery.com>
1545             Chung-Lin Tang  <cltang@codesourcery.com>
1547         * parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
1548         parsing.  Parse constant expression. Remove semantic checking.
1549         (cp_parser_omp_clause_collapse): Disallow tile.
1550         (cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
1551         error about missing for after already emitting one.  Use more
1552         conventional for idiom for unbounded loop.
1553         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
1554         * semantics.c (finish_omp_clauses): Correct TILE semantic check.
1555         (finish_omp_for): Deal with tile clause.
1557 2017-02-07  Nathan Sidwell  <nathan@acm.org>
1559         * method.c (synthesized_method_base_walk): New.  Broken out of ...
1560         (synthesized_method_walk): ... here.  Call it.  Cleanup
1561         initializations.
1563 2017-02-07  Patrick Palka  <ppalka@gcc.gnu.org>
1565         PR c++/79360
1566         * typeck2.c (process_init_constructor_union): Consider only
1567         FIELD_DECLs when looking for an NSDMI.
1569 2017-02-06  Jason Merrill  <jason@redhat.com>
1571         PR c++/71193 - incomplete types in templates
1572         * parser.c (cp_parser_postfix_dot_deref_expression): In a template
1573         handle incomplete type by pedwarning and then treating as dependent.
1575 2017-02-06  Jakub Jelinek  <jakub@redhat.com>
1577         PR c++/79379
1578         * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
1579         (potential_constant_expression_1): Likewise.
1581         PR c++/79377
1582         * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
1583         allow one fewer than expected arguments if flag_permissive.
1585         PR c++/79372
1586         * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
1587         * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
1588         with error_mark_node type.
1590 2017-02-03  Jason Merrill  <jason@redhat.com>
1592         PR c++/78689 - ICE on constructor with label
1593         * optimize.c (maybe_clone_body): Replace omitted parameters with
1594         null lvalues.
1595         * class.c (build_clone): Fix logic for omitting inherited parms.
1597         PR c++/12245 - excessive memory use
1598         * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
1599         back in.  Don't cache constants.
1600         (maybe_constant_init): Don't cache constants.
1602         PR c++/79294 - ICE with invalid template argument
1603         * pt.c (convert_nontype_argument_function): Check value-dependence.
1604         (convert_nontype_argument): Don't check it here for function ptrs.
1606 2017-02-02  Richard Biener  <rguenther@suse.de>
1608         PR cp/14179
1609         * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
1610         it lazily on the first changed element only and copy it
1611         fully upfront, only storing changed elements.
1613 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
1615         PR c++/69637
1616         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
1617         to the width.
1619 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
1621         PR c++/79304
1622         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
1623         after ARROW_EXPR.
1625 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
1627         PR c++/79298
1628         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
1629         any namespace aliases.
1631 2017-01-31  Nathan Sidwell  <nathan@acm.org>
1633         PR c++/79290
1634         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
1636         PR c++/67273
1637         PR c++/79253
1638         * pt.c: (instantiate_decl): Push to top level when current
1639         function scope doesn't match.  Only push lmabda scope stack when
1640         pushing to top.
1642         * cp-tree.h (instantiate_decl): Make defer_ok bool.
1643         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
1644         (instantiate_decl): Simplify and reorder state saving and restoration.
1646         PR c++/79264
1647         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
1648         * semantics.c (finish_member_declaration): Assert class is being
1649         defined.
1651 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
1653         Introduce C++ support in libcc1.
1654         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
1655         (ansi_opname): Rename to...
1656         (cp_operator_id): ... this.  Adjust all callers.
1657         (ansi_assopname): Rename to...
1658         (cp_assignment_operator_id): ... this.  Adjust all callers.
1659         (cp_literal_operator_id): Declare.
1660         (set_global_friend): Declare.
1661         (is_global_friend): Declare.
1662         (enum cp_oracle_request): New type.
1663         (cp_binding_oracle_function): New type.
1664         (cp_binding_oracle): Declare.
1665         (cp_finish_injected_record_type): Declare.
1666         * friend.c (global_friend): New var.
1667         (set_global_friend): New fn.
1668         (is_global_friend): New fn.
1669         (is_friend): Call is_global_friend.
1670         * name-lookup.c (cp_binding_oracle): New var.
1671         (query_oracle): New fn.
1672         (qualified_lookup_using_namespace): Call query_oracle.
1673         (lookup_name_real_1): Likewise.
1674         * parser.c (cp_literal_operator_id): Drop static.
1675         * search.c (friend_accessible_p): Call is_global_friend.
1676         * semantics.c (is_this_parameter): Accept a variable if the
1677         binding oracle is enabled.
1679 2017-01-27  Jason Merrill  <jason@redhat.com>
1681         PR c++/78771 - ICE with inherited constructor.
1682         * call.c (build_over_call): Call deduce_inheriting_ctor here.
1683         * pt.c (tsubst_decl): Not here.
1684         * class.c (add_method): Or here.
1685         * method.c (deduce_inheriting_ctor): Handle clones.
1686         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
1688 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
1690         PR c++/64382
1691         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
1692         New function.
1693         * cp/cp-tree.h: Declare it.
1694         * cp/semantics.c (finish_id_expression): Resolve names within a default
1695         capturing generic lambda defined within a template prior to
1696         instantiation to allow for captures to be added to the closure type.
1698 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
1700         PR c++/68727
1701         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
1702         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
1703         * parser.c (cp_parser_builtin_offsetof): Pass result of
1704         build_static_cast of null_pointer_node to finish_offsetof.
1705         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
1706         it for -Winvalid-offsetof pedwarn instead of trying to guess
1707         original offsetof type from EXPR.  Save OBJECT_PTR as a new
1708         second operand to OFFSETOF_EXPR.
1709         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
1710         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
1711         as OBJECT_PTR.
1713 2017-01-26  Jason Merrill  <jason@redhat.com>
1715         * name-lookup.c (parse_using_directive): Deprecate strong using.
1717         PR c++/79176 - lambda ICE with -flto -Os
1718         * decl2.c (vague_linkage_p): Handle decloned 'tors.
1719         * tree.c (decl_linkage): Likewise.
1721 2017-01-25  Martin Sebor  <msebor@redhat.com>
1723         * decl.c (grokdeclarator): Fix a typo in a comment.
1725 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
1727         PR c++/78896
1728         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
1729         lambda expressions.
1731         PR c++/77914
1732         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
1733         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
1735 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
1737         PR lto/79061
1738         * decl.c (cxx_init_decl_processing): Pass main_input_filename
1739         to build_translation_unit_decl.
1741 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
1743         PR c++/79205
1744         * cp-gimplify.c (cp_genericize_r): Add result of
1745         convert_from_reference on invisiref parm to p_set.
1747 2017-01-24  Nathan Sidwell  <nathan@acm.org>
1749         PR c++/78469 - defaulted ctor and inaccessible dtor
1750         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
1751         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
1752         * tree.c (build_target_expr): Check tf_no_cleanup.
1754         PR c++/79118 - anon-members and constexpr
1755         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
1756         ctor decl.  Recursively check anonymous members.
1757         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
1758         call.
1759         (explain_invalid_constexpr_fn): Likewise.
1761 2017-01-23  Nathan Sidwell  <nathan@acm.org>
1763         PR c++/71710 - template using directive of field
1764         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
1765         check earlier.
1767         PR c++/71406 - ICE with scope-ref'd template id exprs
1768         PR c++/77508
1769         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
1770         before breaking up TEMPLATE_ID_EXPR.
1772 2017-01-20  Nathan Sidwell  <nathan@acm.org>
1774         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
1775         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
1777 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
1779         PR c++/77829
1780         PR c++/78656
1781         * cp-tree.h (suggest_alternatives_for): Add bool param.
1782         (suggest_alternative_in_explicit_scope): New decl.
1783         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
1784         that isn't the global one, call new function
1785         suggest_alternative_in_explicit_scope, only calling
1786         suggest_alternatives_for if it fails, and disabling near match
1787         searches fort that case.  When SCOPE is the global namespace,
1788         pass true for new param to suggest_alternatives_for to allow for
1789         fuzzy name lookups.
1790         * lex.c (unqualified_name_lookup_error): Pass true for new param
1791         to suggest_alternatives_for.
1792         * name-lookup.c (consider_binding_level): Add forward decl.
1793         (suggest_alternatives_for): Add "suggest_misspellings" param,
1794         using it to conditionalize the fuzzy name-lookup code.
1795         (suggest_alternative_in_explicit_scope): New function.
1796         * parser.c (cp_parser_primary_expression): When calling
1797         finish_id_expression, pass location of id_expression rather
1798         than that of id_expr_token.
1799         (cp_parser_id_expression): Convert local "unqualified_id" from
1800         tree to cp_expr to avoid implicitly dropping location information.
1802 2017-01-20  Marek Polacek  <polacek@redhat.com>
1804         PR c/64279
1805         * call.c (build_conditional_expr_1): Warn about duplicated branches.
1806         * semantics.c (finish_expr_stmt): Build statement using the proper
1807         location.
1809 2017-01-19  Jason Merrill  <jason@redhat.com>
1811         US 20 - forwarding references and class template argument deduction
1812         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
1813         * pt.c (push_template_decl_real): Set it.
1814         (maybe_adjust_types_for_deduction): Check it.
1815         (rewrite_template_parm): Copy it.
1817         US 19 - deduction guides and constructors
1818         * call.c (joust): Prefer deduction guides to constructors.
1819         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
1820         (deduction_guide_p): Check DECL_P.
1822         * decl.c (check_initializer): Always use build_aggr_init for array
1823         decomposition.
1825         PR c++/79130 - decomposition and direct-initialization
1826         * init.c (build_aggr_init): Communicate direct-initialization to
1827         build_vec_init.
1828         (build_vec_init): Check for array copy sooner.
1829         * parser.c (cp_parser_decomposition_declaration): Remove call to
1830         build_x_compound_expr_from_list.
1832 2017-01-18  Jason Merrill  <jason@redhat.com>
1834         PR c++/68666 - member variable template-id
1835         * typeck.c (finish_class_member_access_expr): Handle variable
1836         template-id.
1837         * pt.c (lookup_and_finish_template_variable): No longer static.
1838         * cp-tree.h: Declare it.
1840 2017-01-18  Nathan Sidwell  <nathan@acm.org>
1842         PR c++/78488
1843         * call.c (build_over_call): When checking ellipsis conversions for
1844         an inherited ctor, make sure there is at least one conversion.
1846 2017-01-18  Jason Merrill  <jason@redhat.com>
1848         PR c++/78894 - ICE with class deduction and default arg
1849         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
1851 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
1853         PR c++/77489
1854         * mangle.c (write_discriminator): Reorganize abi warning check.
1856 2017-01-18  Nathan Sidwell  <nathan@acm.org>
1858         * cp-tree.h: Clarify exception spec node comment.
1859         * except.c (nothrow_spec_p): Simplify by checking node-equality.
1861         PR c++/79091
1862         * mangle.c (write_exception_spec): Check nothrow explicitly.
1863         (write_encoding): Don't increment processing_template_decl around
1864         encoding.
1866 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
1868         PR c++/70182
1869         * mangle.c (write_template_args): Add "on" for operator names.
1871 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
1873         PR c++/77489
1874         * mangle.c (write_discriminator): Handle discriminator >= 10.
1876 2017-01-17  Nathan Sidwell  <nathan@acm.org>
1878         PR c++/61636
1879         * cp-tree.h (maybe_generic_this_capture): Declare.
1880         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
1881         (maybe_resolve_dummy): ... here.  Call it.
1882         (maybe_generic_this_capture): New.
1883         * parser.c (cp_parser_postfix_expression): Speculatively capture
1884         this in generic lambda in unresolved member function call.
1885         * pt.c (tsubst_copy_and_build): Force hard error from failed
1886         member function lookup in generic lambda.
1888 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
1890         PR c++/70565
1891         * cp-array-notation.c (expand_array_notation_exprs): Handle
1892         OMP_PARALLEL.
1894 2017-01-11  Jason Merrill  <jason@redhat.com>
1896         PR c++/78337 - ICE on invalid with generic lambda
1897         * semantics.c (process_outer_var_ref): Check if containing_function
1898         is null.  Move inform call under complain test.
1900 2017-01-11  Nathan Sidwell  <nathan@acm.org>
1902         PR c++/77812
1903         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
1904         is a new overload.
1906 2017-01-11  Nathan Sidwell  <nathan@acm.org>
1908         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
1910 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
1912         PR c++/78341
1913         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
1914         assertion.  Formatting fix.
1916         PR c++/72813
1917         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
1918         writing PCH file.
1920 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
1922         PR c++/77949
1923         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
1924         a missing semicolon if we have a valid insertion location for
1925         the fix-it hint.
1927 2017-01-10  Jason Merrill  <jason@redhat.com>
1929         FI 20, decomposition declaration with parenthesized initializer.
1930         * parser.c (cp_parser_decomposition_declaration): Use
1931         cp_parser_initializer.
1933 2017-01-09  Jason Merrill  <jason@redhat.com>
1935         Implement P0195R2, C++17 variadic using.
1936         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
1937         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
1938         * error.c (dump_decl): Likewise.
1940 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
1942         PR translation/79019
1943         PR translation/79020
1944         * semantics.c (finish_omp_clauses): Add missing whitespace to
1945         translatable strings.
1946         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
1948 2017-01-07  Jason Merrill  <jason@redhat.com>
1950         PR c++/78948 - instantiation from discarded statement
1951         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
1952         * cp-tree.h (in_discarded_stmt): Declare it.
1953         (struct saved_scope): Add discarded_stmt bitfield.
1954         (in_discarded_stmt): New macro.
1955         * decl2.c (mark_used): Check it.
1956         * parser.c (cp_parser_selection_statement): Adjust.
1957         (cp_parser_jump_statement): Adjust.
1959 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
1961         PR c++/78931
1962         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
1963         REFERENCE_REF_P, set tt to its operand.
1965         PR c++/78890
1966         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
1967         unions even for C++11 and later.
1969 2017-01-05  Nathan Sidwell  <nathan@acm.org>
1971         PR c++/78765
1972         * pt.c (convert_nontype_argument): Don't try and see if integral
1973         or enum expressions are constants prematurely.
1975 2017-01-04  Marek Polacek  <polacek@redhat.com>
1977         PR c++/64767
1978         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
1979         a zero character literal.
1981 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
1983         PR c++/78949
1984         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
1985         vector type.
1987         PR c++/78693
1988         * parser.c (cp_parser_simple_declaration): Only complain about
1989         inconsistent auto deduction if auto_result doesn't use auto.
1991         * parser.c (cp_parser_simple_declaration): Diagnose function
1992         declaration among more than one init-declarators with auto
1993         specifier.
1995         PR c++/71182
1996         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
1997         assertion, as lexer->buffer may be NULL.
1999 2017-01-04  Marek Polacek  <polacek@redhat.com>
2001         PR c++/77545
2002         PR c++/77284
2003         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
2005 2017-01-04  Nathan Sidwell  <nathan@acm.org>
2007         PR c++/66735
2008         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
2009         (lambda_capture_field_type): Update prototype.
2010         * lambda.c (lambda_capture_field_type): Add is_reference parm.
2011         Add referenceness here.
2012         (add_capture): Adjust lambda_capture_field_type call, refactor
2013         error checking.
2014         * pt.c (tsubst): Adjust lambda_capture_field_type call.
2016 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
2018         Update copyright years.
2020 Copyright (C) 2017 Free Software Foundation, Inc.
2022 Copying and distribution of this file, with or without modification,
2023 are permitted in any medium without royalty provided the copyright
2024 notice and this notice are preserved.