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