Store VECTOR_CST_NELTS directly in tree_node
[official-gcc.git] / gcc / cp / ChangeLog
blobc0b7ba2ff69a0ffc25ca34ced3452386dcf2e143
1 2017-09-13  Nathan Sidwell  <nathan@acm.org>
3         Conv-op identifers not in identifier hash table
4         * lex.c (conv_type_hasher): Make member fns inline.
5         (make_conv_op_name): Directly clone conv_op_identifier.
7         Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
8         * cp-tree.h (struct lang_type): Rename methods to members.
9         (CLASSTYPE_METHOD_VEC): Rename to ...
10         (CLASSTYPE_MEMBER_VEC): ... this.
11         * name-lookup.h (get_method_slot): Rename to ...
12         (get_member_slot): ... this.
13         (resort_type_method_vec): Rename to ...
14         (resort_type_member_vec): ... this.
15         * class.c (add_method, warn_hidden): Adjust.
16         * search.c (dfs_locate_field_accessor_pre): Adjust.
17         * name-lookup.c (method_vec_binary_search): Rename to ...
18         (member_vec_binary_search): ... this and adjust.
19         (method_vec_linear_search): Rename to ...
20         (member_vec_linear_search): ... this and adjust.
21         (fields_linear_search, get_class_binding_direct): Adjust.
22         (get_method_slot): Rename to ...
23         (get_member_slot): ... this and adjust.
24         (method_name_slot): Rename to ...
25         (member_name_slot): ... this and adjust.
26         (resort_type_method_vec): Rename to ...
27         (resort_type_member_vec): ... this and adjust.
28         (method_vec_append_class_fields): Rename to ...
29         (member_vec_append_class_fields): ... this and adjust.
30         (method_vec_append_enum_values): Rename to ...
31         (member_vec_append_enum_values): ... this and adjust.
32         (method_vec_dedup): Rename to ...
33         (member_vec_dedup): ... this and adjust.
34         (set_class_bindings, insert_late_enum_def_bindings): Adjust.
35         
36 2017-09-12  Paolo Carlini  <paolo.carlini@oracle.com>
38         PR c++/70621
39         * decl.c (start_decl): Early return error_mark_node if duplicate_decls
40         returns it; avoid misleading error message.
42 2017-09-12  Nathan Sidwell  <nathan@acm.org>
44         Kill CLASSTYPE_SORTED_FIELDS.
45         * cp-tree.h (struct lang_type): Lose sorted_fields member.
46         (CLASSTYPE_SORTED_FIELDS): Delete.
47         * name-lookup.h (set_class_bindings): Add EXTRA arg.
48         * name-lookup.c (fields_linear_search): New, broken out of ...
49         (lookup_field_1): ... here.  Delete remainder of function.
50         (get_class_binding_direct): Reimplement without sorted_fields.
51         (get_class_binding): Rename TYPE arg to KLASS, for consistency.
52         (get_method_slot): Call set_class_binding when creating method_vec
53         on complete type.
54         (method_name_cmp): Order identically named slots.
55         (sorted_fields_type_new): Delete.
56         (field_vc_append_class_fields): Rename to ...
57         (method_vec_append_class_fields): ... here.  Adjust.
58         (field_vec_append_enum_values): Renme to ...
59         (method_vec_append_enum_values): ... here. Adjust.
60         (method_vec_dedup): New.
61         (set_class_bindings): Reimplement.
62         (insert_late_enum_def_bindings): Reimplement.
64         * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
65         consistency.
66         (restort_data): Move later.
67         (method_name_cmp, resort_method_name_cmp): Simplify.
68         (resort_type_method_vec): Reformat.
70 2017-09-09  Jason Merrill  <jason@redhat.com>
72         * constexpr.c (reduced_constant_expression_p): If
73         CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
75 2017-09-09  Eric Botcazou  <ebotcazou@adacore.com>
77         PR bootstrap/81926
78         * cp-objcp-common.c (struct debug_type_hasher): New class.
79         (debug_type_hash): New variable.
80         (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
82 2017-09-08  Jason Merrill  <jason@redhat.com>
84         PR c++/70029 - ICE with ref-qualifier and -flto
85         * tree.c (cxx_copy_lang_qualifiers): New.
86         * cp-tree.h: Declare it.
87         * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
89 2017-09-06  Jason Merrill  <jason@redhat.com>
91         PR c++/82053 - ICE with default argument in lambda in template
92         * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
93         in templates.
94         (retrieve_specialization): Use lambda_fn_in_template_p.
95         * cp-tree.h: Declare it.
97         PR c++/82070 - error with nested lambda capture
98         * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
99         register_local_specialization.
101 2017-09-06  Nathan Sidwell  <nathan@acm.org>
103         * name-lookup.h (lookup_field_1): Delete.
104         (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
105         * name-lookup.c (lookup_field_1): make static
106         (method_vec_binary_search, method_vec_linear_search): New.  Broken
107         out of ...
108         (get_class_binding_direct): ... here.  Add TYPE_OR_FNS argument.
109         Do complete search of this level.
110         (get_class_binding): Adjust.
111         * decl.c (reshape_init_class): Call get_class_binding.
112         * search.c (lookup_field_r): Move field searching into
113         get_class_binding_direct.
115         * class.c (warn_hidden): Don't barf on non-functions.
116         * decl2.c (check_classfn): Likewise.  Check template match earlier.
118         * name-lookup.c (count_fields): Rename to ...
119         (count_class_fields): ... here.  Take a class, don't count
120         NULL-named fields.
121         (add_fields_to_record_type): Rename to ...
122         (field_vec_append_class_fields): ... here.  Take a class, don't
123         add NULL-named fields.
124         (add_enum_fields_to_record_type): Rename to ...
125         (field_vec_append_enum_values): ... here.
126         (set_class_bindings): Adjust, assert we added expected number.
127         (insert_late_enum_def_bindings): Reimplement.  Create vector if
128         there are now sufficient entries.
130         * name-lookup.h (lookup_fnfields_slot_nolazy,
131         lookup_fnfields_slot): Rename to ...
132         (get_class_binding_direct, get_class_binding): ... here.
133         * name-lookup.c (lookup_fnfields_slot_nolazy,
134         lookup_fnfields_slot): Rename to ...
135         (get_class_binding_direct, get_class_binding): ... here.
136         * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
137         * call.c (build_user_type_conversion_1): Adjust.
138         (has_trivial_copy_assign_p): Adjust.
139         (has_trivial_copy_p): Adjust.
140         * class.c (get_basefndecls) Adjust.
141         (vbase_has_user_provided_move_assign) Adjust.
142         (classtype_has_move_assign_or_move_ctor_p): Adjust.
143         (type_build_ctor_call, type_build_dtor_call): Adjust.
144         * decl.c (register_dtor_fn): Adjust.
145         * decl2.c (check_classfn): Adjust.
146         * pt.c (retrieve_specialization): Adjust.
147         (check_explicit_specialization): Adjust.
148         (do_class_deduction): Adjust.
149         * search.c (lookup_field_r): Adjust.
150         (look_for_overrides_here, lookup_conversions_r): Adjust.
151         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
152         * tree.c (type_has_nontrivial_copy_init): Adjust.
153         * method.c (lazily_declare_fn): Adjust comment.
155 2017-09-05  Nathan Sidwell  <nathan@acm.org>
157         * name-lookup.c (do_class_using_decl): Elide read-once temps.
158         Move declarations to initializations.
160         * class.c (add_method): Move slot search and insertion to ...
161         * name-lookup.c (get_method_slot): ... this new function.
162         (lookup_fnfields_slot_nolazy): Cope with NULL slot.
163         * name-lookup.h (get_method_slot): Declare.
164         * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
165         realistic type.
166         (grok_special_member_properties): Set
167         TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
168         Improve TYPE_HAS_CONSTEXPR_CTOR setting.        
170         * cp-tree.h (lang_decl_base): Rename template_conv_p to
171         unknown_bound_p.
172         (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
173         (DECL_CONV_FN_TYPE): FN must be conv op.
174         (DECL_TEMPLATE_CONV_FN_P): Delete.
175         (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
176         * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
177         setting.
179         * class.c (unreverse_member_declarations): Remove extraneous if.
180         * pt.c (push_template_decl_real): Use string concatenation, not
181         \<newline>.  Add %<..%>.
183 2017-09-05  Paolo Carlini  <paolo.carlini@oracle.com>
185         PR c++/81942
186         * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
187         * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
188         creating cdtor_label.
189         * constexpr.c (returns): Add the case of a constructor/destructor
190         returning via a LABEL_DECL_CDTOR label.
191         (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
193 2017-09-01  Nathan Sidwell  <nathan@acm.org>
195         * cp-tree.h (resort_type_method_vec): Move declaration to ...
196         * name-lookup.h (resort_type_method_vec): ... here.
197         (set_class_bindings): Lose 2nd arg.
198         * class.c (finish_struct_1, finish_struct): Adjust
199         set_class_bindings call.  Don't call finish_struct_methods.
200         (resort_data, method_name_cmp, resort_method_name_cmp,
201         resort_type_method_vec, finish_struct_methods): Move to ...
202         * name-lookup.c (resort_data, method_name_cmp,
203         resort_method_name_cmp, resort_type_method_vec): ... here.
204         (set_class_bindings): Lose fields arg.  Swallow finish_struct_methods.
206         * class.c (finish_struct): Call set_class_bindings for the
207         template case too.
209         * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
210         Don't call maybe_warn_about_overly_private_class here.
211         (warn_hidden): Cleanup declarations and comments.
212         (type_has_user_provided_constructor): No need to check
213         CLASSTYPE_METHOD_VEC.
214         (type_has_user_provided_or_explicit_constructor): Likewise.
215         (classtype_has_move_assign_or_move_ctor_p): Likewise.
216         (check_bases_and_members): Don't call finish_struct_methods here.
217         (finish_struct_1): Call finish_struct_methods and
218         set_class_bindings immediately after layout.  Clear DECL_IN_AGGR_P
219         here.
220         (finish_struct): For templates process USING_DECLS and clear
221         DECL_IN_AGGR_P before calling finish_struct_methods. Call
222         maybe_warn_about_overly_private_class here.
224         Revert 2017-08-28  Nathan Sidwell  <nathan@acm.org>
225         Restore sorted_fields vector.
226         * cp-tree.h (lang_type): Restore sorted_fields vector.
227         (CLASSTYPE_SORTED_FIELDS): Restore.
228         (CLASSTYPE_BINDINGS): Delete.
229         * name-lookup.c (lookup_field_1): Restore binary search.
230         (sorted_fields_type_new, count_fields,
231         add_fields_to_record_type, add_enum_fields_to_record_type): Restore
232         (set_class_bindings): Revert.
233         (insert_late_enum_def_binding): Restore field_vec insertion.
235 2017-09-01  Jakub Jelinek  <jakub@redhat.com>
237         PR c/81887
238         * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
240 2017-09-01  Marek Polacek  <polacek@redhat.com>
242         PR c++/82040
243         * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
245 2017-08-30  Jason Merrill  <jason@redhat.com>
247         PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
248         * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
249         (regenerated_lambda_fn_p): New.
250         (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
251         (tsubst_copy) [VAR_DECL]: Likewise.
253         PR c++/82030 - ICE inheriting from multiple lambdas
254         PR c++/80767
255         * call.c (compare_ics): Handle null candidate.
257 2017-08-30  Ville Voutilainen  <ville.voutilainen@gmail.com>
259         Make taking the address of an overloaded function a non-deduced context
261         * pt.c (unify_overload_resolution_failure): Remove.
262         (unify_one_argument): Adjust.
264 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
265             Alan Hayward  <alan.hayward@arm.com>
266             David Sherwood  <david.sherwood@arm.com>
268         * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
270 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
271             Alan Hayward  <alan.hayward@arm.com>
272             David Sherwood  <david.sherwood@arm.com>
274         * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
276 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
277             Alan Hayward  <alan.hayward@arm.com>
278             David Sherwood  <david.sherwood@arm.com>
280         * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
281         instead of TYPE_MODE.
283 2017-08-29  Jason Merrill  <jason@redhat.com>
285         PR c++/81236 - ICE with template-id in generic lambda
286         * semantics.c (finish_id_expression): Remove special dependent case.
287         Avoid some later pieces when dependent.
288         (finish_qualified_id_expr): Do normal BASELINK handling in a
289         template.  Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
290         (parsing_default_capturing_generic_lambda_in_template): Remove.
291         * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
292         error for types that will never be complete.
293         * mangle.c (write_expression): Add sanity check.
294         * tree.c (build_qualified_name): Add sanity check.
295         (cp_walk_subtrees): Walk into the class context of a BASELINK.
296         * lambda.c (add_capture): Improve diagnostic for generic lambda
297         capture failure.
298         * call.c (build_new_method_call_1): Print the right constructor
299         name.
301         Reimplement handling of lambdas in templates.
302         * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
303         * decl.c (start_preparsed_function): Call start_lambda_scope.
304         (finish_function): Call finish_lambda_scope.
305         * init.c (get_nsdmi): Call start/finish_lambda_scope.
306         * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
307         * parser.c (cp_parser_function_definition_after_declarator): Don't
308         call start/finish_lambda_scope.
309         * pt.c (retrieve_specialization): Ignore lambda functions in
310         templates.
311         (find_parameter_packs_r): Ignore capture proxies.  Look into
312         lambdas.
313         (check_for_bare_parameter_packs): Allow bare packs in lambdas.
314         (tsubst_default_argument): Call start/finish_lambda_scope.
315         (tsubst_function_decl): Handle lambda functions differently.
316         (tsubst_template_decl): Likewise.
317         (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
318         proxies.
319         (tsubst_lambda_expr): Create a new closure rather than instantiate
320         the one from the template.
321         (tsubst_copy_and_build): Don't register a specialization of a pack.
322         (regenerate_decl_from_template): Call start/finish_lambda_scope.
323         (instantiate_decl): Remove special lambda function handling.
324         * semantics.c (process_outer_var_ref): Remove special generic lambda
325         handling.  Don't implicitly capture in a lambda in a template.  Look
326         for an existing proxy.
327         * class.c (current_nonlambda_class_type): Use decl_type_context.
329         * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
330         (LAMBDA_EXPR_RETURN_TYPE): Remove.
331         (struct tree_lambda_expr): Remove closure and return_type fields.
332         * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
333         * pt.c (tsubst_copy_and_build): Likewise.
334         * parser.c (cp_parser_lambda_declarator_opt): Track return type.
335         (cp_parser_lambda_body): Adjust unspecified return type check.
336         * ptree.c (cxx_print_lambda_node): Don't print closure or
337         return type.
339         PR c++/80935 - wrong C++17 error with lambda
340         * decl.c (check_for_uninitialized_const_var): Check
341         is_instantiation_of_constexpr.
342         * constexpr.c (ensure_literal_type_for_constexpr_object): Check
343         is_instantiation_of_constexpr.
344         (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
346         * lambda.c (build_lambda_object): Check for error_mark_node.
347         * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
348         pack as well.
349         (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
350         (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
352         PR c++/80767 - unnecessary instantiation of generic lambda
353         * call.c (convert_like_real): Call build_user_type_conversion_1 if
354         cand is null.
355         (add_conv_candidate): Build a ck_user conversion with no candidate.
357         Fix lambdas in template default argument of inherited ctor.
358         * method.c (synthesized_method_base_walk): Replace an inherited
359         template with its specialization.
360         (synthesized_method_walk): Make inheriting_ctor a pointer.
361         (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
362         (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
364         * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
365         template, not the function.
366         (template_guide_p): Adjust.
368         Support copying local_specializations.
369         * cp-tree.h (enum lss_policy): New.
370         (local_specialization_stack): Add policy parameter to default ctor.
371         * pt.c (local_specialization_stack): Copy local_specializations if
372         lss_copy.
374         * constexpr.c (potential_constant_expression_1): Add "now" parm.
375         (is_constant_expression, require_constant_expression): New.
376         (is_static_init_expression, is_nondependent_constant_expression)
377         (is_nondependent_static_init_expression): Drop "potential".
378         * except.c (build_must_not_throw_expr): Do type conversion on
379         value-dependent argument.
380         * pt.c, semantics.c, typeck2.c: Use variants without "potential".
382         Instantiate default arguments/member initializers once.
383         * init.c (get_nsdmi): Remember NSDMI instantiations.
384         * parser.c (inject_this_parameter): Be more picky about
385         current_class_ptr.
386         * pt.c (tsubst_copy): Simplify 'this' handling.
387         (tsubst_default_argument): Remember default argument
388         instantiations.  Take parameter number.
389         (tsubst_default_arguments): Pass it.
390         * call.c (convert_default_arg): Likewise.
392         Fix default argument conversion failure and SFINAE.
393         * call.c (build_over_call): Check convert_default_arg result for
394         error_mark_node.
395         * parser.c (cp_parser_late_parsing_default_args): Remember
396         error_mark_node.
398 2017-08-28  Nathan Sidwell  <nathan@acm.org>
400         * cp-tree.h (lang_type): Replace sorted_fields vector with
401         bindings map.
402         (CLASSTYPE_SORTED_FIELDS): Delete.
403         (CLASSTYPE_BINDINGS): New.
404         * decl.c (finish_enum_value_list): Swap args of
405         insert_late_enum_def_bindings.
406         * name-lookup.c (lookup_field_1): Replace binary search of sorted
407         fields with map->get.
408         (sorted_fields_type_new, count_fields,
409         add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
410         (add_class_member, add_class_members): New.
411         (set_class_bindings): Create map and insert.
412         (insert_late_enum_def_binding): Swap parms.  Use add_clasS_member.
413         * ptree.c (cxx_print_type): Delete sorted fields printing.
415         * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
416         Delete.
417         * name-lookup.h (set_class_bindings,
418         insert_late_enum_def_bindings): Declare.
419         * decl.c (finish_enum_value_list): Adjust for
420         insert_late_enum_def_bindings name change.
421         * class.c (finish_struct_1): Call set_class_bindings.
422         (count_fields, add_fields_to_record_type,
423         add_enum_fields_to_record_type, sorted_fields_type_new,
424         insert_into_classtype_sorted_fields,
425         insert_late_enum_def_into_classtype_sorted_fields): Move to ...
426         * name-lookup.h (count_fields, add_fields_to_record_type,
427         add_enum_fields_to_record_type, sorted_fields_type_new,
428         set_class_bindings, insert_late_enum_def_bindings): ... here.
430 2017-08-25  Nathan Sidwell  <nathan@acm.org>
432         * class.c (method_name_cmp, resort_method_name_cmp): Methods
433         can never be NULL.
435         Conversion operators have a special name
436         * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
437         (conv_op_marker, conv_op_identifier): New.
438         (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
439         * decl.c (initialize_predefined_identifiers): Add
440         conv_op_identifier.
441         (cxx_init_decl_processing): Create conv_op_marker.
442         * decl2.c (check_classfn): Lookup conv-ops by name.
443         * class.c (add_method): Use conv_op_identifier & conv_op_marker.
444         (resort_type_method_vec): Don't skip conv-ops.
445         (finish_struct_methods, warn_hidden): Likewise.
446         * name-lookup.h (lookup_all_conversions): Delete.
447         * name-lookup.c (lookup_conversion_operator): Replace with ...
448         (extract_conversion_operator): ... this.
449         (lookup_fnfields_slot_nolazy): Find conv-ops by name.
450         (lookup_all_conversions): Delete.
451         * pt.c (check_explicit_specialization): Find conv-ops by name.
452         * search.c (lookup_conversions_r): Likewise.
454 2017-08-24  Nathan Sidwell  <nathan@acm.org>
456         Conversion operators kept on single overload set
457         * class.c (add_method): Keep all conv-ops on one slot.
458         * name-lookup.c (lookup_conversion_operator): Pull the desired
459         conv op out of overload set.
460         * search.c (lookup_conversions_r): Lose template/non-template
461         distinction.
462         (lookup_conversions): Likewise.
464 2017-08-23  Nathan Sidwell  <nathan@acm.org>
466         * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
467         lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
468         declatations to ...
469         * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
470         lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
471         * search.c (lookup_conversion_operator,
472         lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
473         lookup_all_conversions): Move to ...
474         * name-lookup.c (lookup_conversion_operator,
475         lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
476         lookup_all_conversions): ... here.
478         * semantics.c (finish_member_declaration): Move USING_DECL check
479         earlier.  Always set C++ linkage.  Commonize TYPE_FIELD and
480         template decl list insertion.
482         * cp-tree.h (maybe_version_functions): Declare.
483         * decl.c (decls_match): Break function versioning check to
484         separate function.  Call it.
485         (maybe_version_functions): Broken out of decls_match.
486         * class.c (add_method): Use maybe_version_functions.
488         * cp-tree.h (print_search_statistics,
489         reinit_search_statistics): Don't declare.
490         * search.c (n_fields_searched, n_calls_lookup_field,
491         n_calls_lookup_field_1, n_calls_lookup_fnfields,
492         n_calls_lookup_fnfields_1, n_calls_get_base_type,
493         n_outer_fields_searched, n_contexts_saved): Delete.
494         (lookup_field_1, lookup_member,
495         lookup_fnfields_slot_nolazy): Remove stat gathering.
496         (print_search_statistics, reinit_search_statistics): Delete.
497         * tree.c (cxx_print_statistics): Don't print search stats.
499 2017-08-21  Nathan Sidwell  <nathan@acm.org>
501         * search.c (lookup_field_r): Remove obsolete code for type-named
502         field in PoD.
504         * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
505         isn't special.
506         (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
507         (lookup_field_fuzzy_r): Adjust.
509 2017-08-21  David Malcolm  <dmalcolm@redhat.com>
511         * call.c (build_over_call): Pass NULL for new parameter to
512         check_function_arguments.
513         * typeck.c (cp_build_function_call_vec): Likewise.
515 2017-08-21  Nathan Sidwell  <nathan@acm.org>
517         PR c++/81899
518         * pt.c (instantiate_class_template_1):
519         BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
521 2017-08-18  David Malcolm  <dmalcolm@redhat.com>
523         PR c++/81514
524         * name-lookup.c (maybe_suggest_missing_header): Convert return
525         type from void to bool; return true iff a suggestion was offered.
526         (suggest_alternative_in_explicit_scope): Move call to
527         maybe_suggest_missing_header to before use of best_match, and
528         return true if the former offers a suggestion.
530 2017-08-18  H.J. Lu  <hongjiu.lu@intel.com>
532         PR c/53037
533         * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
534         * decl2.c (grokbitfield): Don't allow bit-field with
535         warn_if_not_aligned type.
537 2017-08-17  Nathan Sidwell  <nathan@acm.org>
539         * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
540         * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
541         (TYPE_TEMPLATE_INFO): Simplify.
542         (SET_TYPE_TEMPLATE_INFO): Simplify.
544         * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
545         don't need lang_type.
546         (cxx_make_type): Use maybe_add_lang_type_raw return value.
547         * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
548         TYPE_LANG_SPECIFIC.
550         * cp-tree.h (struct lang_type): Remove template_info field.
551         (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
552         (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
554 2017-08-14  Martin Sebor  <msebor@redhat.com>
556         PR c/81117
557         * error.c (cp_printer): Handle 'G'.
559 2017-08-11  Martin Liska  <mliska@suse.cz>
561         * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
562         TARGET_SUPPORTS_ALIASES.
563         (handle_tls_init): Likewise.
564         (note_mangling_alias): Likewise.  Remove ATTRIBUTE_UNUSED for
565         both arguments.
566         * optimize.c (can_alias_cdtor): Likewise.
568 2017-08-11  Jason Merrill  <jason@redhat.com>
570         PR c++/81671 - nullptr_t template parameter
571         * pt.c (convert_nontype_argument): Fix nullptr_t check.
573 2017-08-10  Jason Merrill  <jason@redhat.com>
575         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
576         * method.c (synthesized_method_walk): Don't diagnose lack of
577         operator delete.
579         PR c++/80452 - Core 1579, implicit move semantics on return/throw
580         * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
581         tentatively changed the lvalue to an rvalue.
582         * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
583         (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
584         parameter is an rvalue reference.
585         * except.c (build_throw): Do maybe-rvalue overload resolution twice.
586         * typeck.c (check_return_expr): Likewise.
588 2017-08-10  David Malcolm  <dmalcolm@redhat.com>
590         * parser.c (cp_parser_error): Update for new param to
591         c_parse_error.
592         (class token_pair): New class.
593         (struct matching_paren_traits): New struct.
594         (matching_parens): New typedef.
595         (struct matching_brace_traits): New struct.
596         (matching_braces): New typedef.
597         (cp_parser_statement_expr): Convert explicit parsing of
598         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
599         class matching_parens, so that the pertinent open parenthesis is
600         highlighted when there are problems locating the close
601         parenthesis.
602         (cp_parser_primary_expression): Likewise.
603         (cp_parser_compound_literal_p): Remove consumption of opening
604         paren.
605         (cp_parser_postfix_expression): Convert explicit parsing of
606         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
607         above.  Use it to consume the opening paren previously consumed by
608         cp_parser_compound_literal_p.
609         (cp_parser_parenthesized_expression_list): Likewise.
610         (cp_parser_unary_expression): Likewise.
611         (cp_parser_new_expression): Likewise.
612         (cp_parser_cast_expression): Likewise.
613         (cp_parser_builtin_offsetof): Likewise.
614         (cp_parser_trait_expr): Likewise.
615         (cp_parser_lambda_declarator_opt): Likewise.
616         (cp_parser_lambda_body): Likewise, for matching_braces.
617         (cp_parser_compound_statement): Likewise.
618         (cp_parser_selection_statement): Likewise, for matching_parens.
619         (cp_parser_iteration_statement): Likewise.
620         (cp_parser_already_scoped_statement): Likewise, for
621         matching_braces.
622         (cp_parser_linkage_specification): Likewise.
623         (cp_parser_static_assert): Likewise, for matching_parens.
624         (cp_parser_decltype): Likewise.
625         (cp_parser_operator): Likewise.
626         (cp_parser_enum_specifier): Likewise.
627         (cp_parser_namespace_definition): Likewise.
628         (cp_parser_direct_declarator): Likewise.
629         (cp_parser_braced_list): Likewise.
630         (cp_parser_class_specifier_1): Likewise, for matching_braces.
631         (cp_parser_constant_initializer): Likewise.
632         (cp_parser_noexcept_specification_opt): Likewise, for
633         matching_parens.
634         (cp_parser_exception_specification_opt): Likewise.
635         (cp_parser_handler): Likewise.
636         (cp_parser_asm_specification_opt): Likewise.
637         (cp_parser_asm_operand_list): Likewise.
638         (cp_parser_gnu_attributes_opt): Likewise.
639         (cp_parser_std_attribute_spec): Likewise.
640         (cp_parser_requirement_parameter_list): Likewise.
641         (cp_parser_requirement_body): Likewise, for matching_braces.
642         (cp_parser_compound_requirement): Likewise.
643         (cp_parser_template_introduction): Likewise.
644         (cp_parser_sizeof_pack): Likewise, for matching_parens.
645         (cp_parser_sizeof_operand): Likewise; use it to consume the
646         opening paren previously consumed by cp_parser_compound_literal_p.
647         (get_matching_symbol): New function.
648         (cp_parser_required_error): Add param "matching_location".  Remove
649         calls to cp_parser_error, instead setting a non-NULL gmsgid, and
650         handling it if set by calling c_parse_error, potentially with a
651         secondary location if matching_location was set.
652         (cp_parser_require): Add param "matching_location", with a default
653         value of UNKNOWN_LOCATION.
654         (cp_parser_require_keyword): Update for new param of
655         cp_parser_required_error.
656         (cp_parser_objc_encode_expression): Update to class matching_parens
657         as above.
658         (cp_parser_objc_defs_expression): Likewise.
659         (cp_parser_objc_protocol_expression): Likewise.
660         (cp_parser_objc_selector_expression): Likewise.
661         (cp_parser_objc_typename): Likewise.
662         (cp_parser_objc_superclass_or_category): Likewise.
663         (cp_parser_objc_try_catch_finally_statement): Likewise.
664         (cp_parser_objc_synchronized_statement): Likewise.
665         (cp_parser_objc_at_property_declaration): Likewise.
666         (cp_parser_oacc_single_int_clause): Likewise.
667         (cp_parser_oacc_shape_clause): Likewise.
668         (cp_parser_omp_clause_collapse): Likewise.
669         (cp_parser_omp_clause_default): Likewise.
670         (cp_parser_omp_clause_final): Likewise.
671         (cp_parser_omp_clause_if): Likewise.
672         (cp_parser_omp_clause_num_threads): Likewise.
673         (cp_parser_omp_clause_num_tasks): Likewise.
674         (cp_parser_omp_clause_grainsize): Likewise.
675         (cp_parser_omp_clause_priority): Likewise.
676         (cp_parser_omp_clause_hint): Likewise.
677         (cp_parser_omp_clause_defaultmap): Likewise.
678         (cp_parser_omp_clause_ordered): Likewise.
679         (cp_parser_omp_clause_schedule): Likewise.
680         (cp_parser_omp_clause_num_teams): Likewise.
681         (cp_parser_omp_clause_thread_limit): Likewise.
682         (cp_parser_omp_clause_aligned): Likewise.
683         (cp_parser_omp_clause_linear): Likewise.
684         (cp_parser_omp_clause_safelen): Likewise.
685         (cp_parser_omp_clause_simdlen): Likewise.
686         (cp_parser_omp_clause_depend): Likewise.
687         (cp_parser_omp_clause_device): Likewise.
688         (cp_parser_omp_clause_dist_schedule): Likewise.
689         (cp_parser_oacc_clause_async): Likewise.
690         (cp_parser_omp_critical): Likewise.
691         (cp_parser_omp_for_loop): Likewise.
692         (cp_parser_omp_sections_scope): Likewise.
693         (cp_parser_omp_declare_reduction_exprs): Likewise.
694         Update for new param to cp_parser_required_error.
695         (cp_parser_oacc_routine): Likewise.
696         (cp_parser_transaction_expression): Likewise.
697         (cp_parser_cilk_simd_vectorlength): Likewise.
699 2017-08-09  Jason Merrill  <jason@redhat.com>
701         PR c++/81525 - wrong constant value with generic lambda
702         * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
703         (tsubst_copy) [VAR_DECL]: Handle auto.
705         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
706         * init.c (get_nsdmi): Add complain parm.
707         * typeck2.c (digest_nsdmi_init): Add complain parm.
708         (process_init_constructor_record): Pass complain to get_nsdmi.
709         * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
710         * method.c (get_defaulted_eh_spec): Add complain parm.  Pass it into
711         synthesized_method_walk.
712         (synthesized_method_walk): Adjust.
713         (walk_field_subobs): Pass complain to get_nsdmi.
714         (defaulted_late_check): Skip other checks if deleted.
715         * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
716         * call.c (build_aggr_conv): Pass complain to get_nsdmi.
717         * parser.c (defarg_location): New.
718         * error.c (location_of): Use it.
720 2017-08-09  Marek Polacek  <polacek@redhat.com>
722         * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
723         * typeck.c (build_binary_op): Change the type of a parameter to bool.
724         (cp_truthvalue_conversion): Use true instead of 1.
726 2017-08-08  Marek Polacek  <polacek@redhat.com>
728         PR c++/81607
729         * cp-gimplify.c (cp_fold): If folding exposed a branch of
730         a COND_EXPR, convert it to the original type of the COND_EXPR, if
731         they differ.               
733 2017-08-08  Martin Liska  <mliska@suse.cz>
735         * call.c: Include header files.
736         * cp-gimplify.c: Likewise.
737         * cp-ubsan.c: Likewise.
738         * cvt.c: Likewise.
739         * init.c: Likewise.
740         * search.c: Likewise.
741         * semantics.c: Likewise.
742         * typeck.c: Likewise.
744 2017-08-07  Martin Liska  <mliska@suse.cz>
746         * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
747         attribute.
748         (cp_parser_std_attribute): Likewise.
749         * tree.c: Add new include.
751 2017-08-04  Paolo Carlini  <paolo.carlini@oracle.com>
753         PR c++/79790
754         * pt.c (do_class_deduction): Handle the case of no viable implicit
755         deduction guides; simplify the code generating implicit deduction
756         guides.
758 2017-08-03  Paolo Carlini  <paolo.carlini@oracle.com>
760         PR c++/71440
761         * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
762         destructor as expressions.
764 2017-08-02  Jakub Jelinek  <jakub@redhat.com>
766         PR c++/81640
767         * call.c (build_user_type_conversion_1): Only call
768         lookup_fnfields_slot if totype is CLASS_TYPE_P.
770 2017-07-31  Jason Merrill  <jason@redhat.com>
772         * decl.c (declare_global_var): Set DECL_CONTEXT.
774 2017-07-31  Jan Hubicka <hubicka@ucw.cz>
775             Martin Liska  <mliska@suse.cz>
777         * pt.c (tsubst_copy): Copy PREDICT_EXPR.
778         * semantics.c (finish_goto_stmt): Build gimple predict
779         stament.
780         * constexpr.c (potential_constant_expression_1): Handle
781         PREDICT_EXPR.
783 2017-07-31  Martin Liska  <mliska@suse.cz>
785         PR sanitize/81530
786         * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
787         also with current_function_decl non-null equality.
788         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
789         * decl.c (compute_array_index_type): Likewise.
790         * init.c (finish_length_check): Likewise.
791         * typeck.c (cp_build_binary_op): Likewise.
793 2017-07-29  Jakub Jelinek  <jakub@redhat.com>
795         * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
796         DW_AT_export_symbols.
797         * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
798         argument, pass it through to the debug hook.
799         (finish_namespace_using_directive): Adjust
800         emit_debug_info_using_namespace caller.
801         (push_namespace): Likewise.  Call it after setting
802         DECL_NAMESPACE_INLINE_P.
803         (cp_emit_debug_info_for_using): Pass false as new argument to
804         the imported_module_or_decl debug hook.
806 2017-07-28  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
808         * lex.c (copy_decl): Adjust.
809         (copy_type): Likewise.
811 2017-07-26  Paolo Carlini  <paolo.carlini@oracle.com>
813         PR c++/71570
814         * lambda.c (add_capture): Early return if we cannot capture by
815         reference.
817 2017-07-26  Jason Merrill  <jason@redhat.com>
819         P0702R1 - List deduction of vector.
820         * pt.c (do_class_deduction): Special-case deduction from a single
821         element of related type.
823 2017-07-26  Leonid Koppel  <lkoppel@uwaterloo.ca>
825         PR c++/67054 - Inherited ctor with non-default-constructible members
826         * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
827         when deducing an inheriting constructor.
829 2017-07-21  Nathan Sidwell  <nathan@acm.org>
831         * search.c (lookup_conversion_operator): Return overloads.
832         (lookup_fnfields_idx_nolazy): Absorb into ...
833         (lookup_fnfields_slot_nolaxy): ... here.
834         (lookup_fnfields_1): Absorb into ...
835         (lookup_fnfields_slot): ... here.
837         Remove special CDtor METHOD_VEC slots.
838         * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
839         CLASSTYPE_DESTRUCTOR_SLOT): Delete.
840         (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
841         (CLASSTYPE_DESTRUCTOR): Likewise.
842         * class (add_method): Don't use special cdtor slots.
843         * search.c (lookup_fnfields_idx_nolazy): Likewise.
844         (look_for_overrides_here): Use lookup_fnfields_slot.
845         * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
847         * call.c (add_candidates): Move decls to initialization.  Don't
848         use !!.
850 2017-07-20  Nathan Sidwell  <nathan@acm.org>
852         Remove TYPE_METHODS.
853         * class.c (maybe_warn_about_overly_private_class,
854         finish_struct_methods, one_inheriting_sig, count_fields,
855         add_fields_to_record_type, check_field_decls, check_methods,
856         clone_function_decl, set_method_tm_attributes,
857         finalize_literal_type_property, check_bases_and_members,
858         create_vtable_ptr, determine_key_method,
859         unreverse_member_declarations, finish_struct,
860         add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
861         * decl.c (fixup_anonymous_aggr): Likewise.
862         * decl2.c (reset_type_linkage_2): Likewise.
863         * method.c (after_nsdmi_defaulted_late_checks,
864         lazily_declare_fn): Likewise.
865         * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
866         * pt.c (instantiate_class_template_1, tsubst_expr,
867         do_type_instantiation, instantiate_pending_templates): Likewise.
868         * search.c (lookup_field_1): Likewise.
869         * semantics.c (finish_member_declaration,
870         finish_omp_declare_simd_methods): Likewise.
872 2017-07-19  Nathan Sidwell  <nathan@acm.org>
874         * class.c (add_implicitly_declared_members): Use
875         classtype_has_move_assign_or_move_ctor_p.
876         (classtype_has_move_assign_or_move_ctor,
877         classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
878         (classtype_has_move_assign_or_move_ctor_p): ... this new function.
879         * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
880         Replace with ...
881         (classtype_has_move_assign_or_move_ctor_p): ... this.
882         * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
883         * tree.c (type_has_nontrivial_copy_init): Adjust.
885         * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
886         PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
888 2017-07-18  Nathan Sidwell  <nathan@acm.org>
890         * cp-array-notation.c (build_array_notation_ref): Use
891         TYPE_{MIN,MAX}_VALUE.
893         * class.c (classtype_has_move_assign_or_move_ctor): Declare.
894         (add_implicitly_declared_members): Use it.
895         (type_has_move_constructor, type_has_move_assign): Merge into ...
896         (classtype_has_move_assign_or_move_ctor): ... this new function.
897         * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
899 2017-07-17  Volker Reichelt  <v.reichelt@netcologne.de>
901         * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
902         friend outside class and obsolete auto as storage-class-specifier.
904 2017-07-17  Nathan Sidwell  <nathan@acm.org>
906         * class.c (maybe_warn_about_overly_private_class): Ignore public
907         copy ctors.
909         * class.c (type_has_user_declared_move_constructor,
910         type_has_user_declared_move_assign): Combine into ...
911         (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
912         * cp-tree.h (type_has_user_declared_move_constructor,
913         type_has_user_declared_move_assign): Combine into ...
914         (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
915         * method.c (maybe_explain_implicit_delete): Use it.
916         (lazily_declare_fn): Use it.
917         * tree.c (type_has_nontrivial_copy_init): Use it.
919         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
920         semantics, simplify implementation.
922 2017-07-16  Volker Reichelt  <v.reichelt@netcologne.de>
924         * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
925         in old-style cast diagnostic.
926         * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
927         in useless cast diagnostic.
928         * error.c (type_to_string): Remove enum special handling.
930 2017-07-14  David Malcolm  <dmalcolm@redhat.com>
932         * name-lookup.c (get_std_name_hint): Add '<' and '>' around
933         the header names.
934         (maybe_suggest_missing_header): Update for addition of '<' and '>'
935         to above.  Provide a fix-it hint.
936         * pt.c: Include "gcc-rich-location.h"
937         (listify): Attempt to add fix-it hint for missing
938         #include <initializer_list>.
939         * rtti.c: Include "gcc-rich-location.h".
940         (typeid_ok_p): Attempt to add fix-it hint for missing
941         #include <typeinfo>.
943 2017-07-12  Jason Merrill  <jason@redhat.com>
945         P0512R0 - Deduction from an initializer list.
946         * pt.c (do_class_deduction): Do list deduction in two phases.
948 2017-07-12  Nathan Sidwell  <nathan@acm.org>
950         * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
951         DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
952         identifier flags.
953         * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
954         DECL_CXX_DESTRUCTOR explicitly.
955         * decl2.c (grokclassfn): Likewise.
956         * friend.c (do_friend): Likewise.
957         * method.c (make_thunk, make_alias_for,
958         implicitly_declare_fn): Likewise.
960 2017-07-11  Jason Merrill  <jason@redhat.com>
962         Core DR 393
963         * decl.c (grokparms): Downgrade error about array of unknown bound
964         to pedwarn and disable it for C++17.
966 2017-07-11  Nathan Sidwell  <nathan@acm.org>
968         * decl2.c (reset_type_linkage_2): Dont't change ctor name.
970 2017-07-10  Martin Sebor  <msebor@redhat.com>
972         * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
974 2017-07-06  Jason Merrill  <jason@redhat.com>
976         PR c++/81204 - parse error with dependent template-name
977         * parser.c (cp_parser_lookup_name): Revert previous change.
979 2017-07-06  David Malcolm  <dmalcolm@redhat.com>
981         * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
982         selftest::run_cp_tests.
983         (selftest::run_cp_tests): New function.
984         * cp-tree.h (selftest::run_cp_tests): New decl.
986 2017-07-04  Jakub Jelinek  <jakub@redhat.com>
988         * parser.c (cp_parser_decomposition_declaration): Replace
989         decomposition declaration with structured binding in diagnostics.
990         * decl.c (cp_finish_decomp): Likewise.
991         (grokdeclarator): Likewise.
993         PR c++/81258
994         * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
995         forms of structured binding initializers.
997 2017-07-03  Paolo Carlini  <paolo.carlini@oracle.com>
999         PR c++/65775
1000         * decl.c (grokdeclarator): Move checks on function return type after
1001         the splice_late_return_type call; if declspecs->locations[ds_type_spec]
1002         is UNKNOWN_LOCATION fall back to input_location.
1004 2017-07-03  David Malcolm  <dmalcolm@redhat.com>
1006         * parser.c (enum required_token): Fix spelling of
1007         RT_INTERATION to RT_ITERATION.
1008         (cp_parser_iteration_statement): Likewise.
1009         (cp_parser_required_error): Likewise.
1011 2017-06-30  Jason Merrill  <jason@redhat.com>
1013         PR c++/81257 - ICE with invalid ::template.
1014         PR c++/54769 - wrong lookup of dependent template-name.
1015         * parser.c (cp_parser_template_name): Revert part of last change.
1017 2017-06-30  Nathan Sidwell  <nathan@acm.org>
1019         * config-lang.in (gtfiles): Add cp/lex.c.
1020         * cp-tree.h (mangle_convop_name_for_type): Rename ...
1021         (make_conv_op_name): ... here.  Move to lex.
1022         * lambda.c (maybe_add_lambda_conv_op): Update.
1023         * parser.c (cp_parser_conversion_function_id): Update.
1024         * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
1025         tsubst_copy_and_build): Update.
1026         * semantics.c (apply_deduced_return_type): Update.
1027         * mangle.c (conv_type_hasher, conv_type_names,
1028         mangle_conv_op_name_for_type): Move to ...
1029         * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
1030         ... here.  Rename.
1032 2017-06-30  David Malcolm  <dmalcolm@redhat.com>
1034         PR c++/80014
1035         * parser.c (cp_parser_postfix_expression): Construct a location
1036         for typeid expressions.
1038 2017-06-30  Nathan Sidwell  <nathan@acm.org>
1040         * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
1041         declare.
1042         (lookup_all_conversions): Declare.
1043         * class.c (get_basefndecls): Use lookup_fnfields_slot.
1044         * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
1045         * decl2.c (check_class_fn): Use lookup_fnfields_slot.  Rework
1046         diagnostics.
1047         * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
1048         (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
1049         lookup_all_conversions.
1050         * search.c (lookup_fnfields_1): Make static.
1051         (lookup_all_conversions): New.
1052         (class_method_index_for_fn): Delete.
1053         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
1054         lookup_fnfields_slot.
1056         * call.c (build_new_method_call_1): Use constructo_name to get
1057         ctor name.  Move argument processing earlier to merge cdtor
1058         handling blocks.
1059         * decl.c (grokfndecl): Cdtors have special names.
1060         * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
1061         * pt.c (check_explicit_specialization): Cdtor name is already
1062         special.
1063         * search.c (class_method_index_for_fn): Likewise.
1065         PR c++/81229
1066         * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
1067         a matching TYPE_DECL.
1069 2017-06-29  Paolo Carlini  <paolo.carlini@oracle.com>
1071         * class.c (add_method): Change pair of errors to error + inform.
1072         (handle_using_decl): Likewise.
1074 2017-06-29  Jason Merrill  <jason@redhat.com>
1076         * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
1078         PR c++/81180 - ICE with C++17 deduction of member class template.
1079         * pt.c (build_deduction_guide): Correct member template handling.
1081         PR c++/81188 - matching decltype of member function call.
1082         * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
1084 2017-06-29  Nathan Sidwell  <nathan@acm.org>
1086         PR c++/81247
1087         * parser.c (cp_parser_namespace_definition): Immediately close the
1088         namespace if there's no open-brace.
1089         * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
1090         namespace.
1092 2017-06-29  Jason Merrill  <jason@redhat.com>
1094         PR c++/81164 - ICE with invalid inherited constructor.
1095         * search.c (binfo_direct_p): New.
1096         * name-lookup.c (do_class_using_decl): Use it.
1098 2017-06-29  Nathan Sidwell  <nathan@acm.org>
1100         * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
1101         VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
1102         * decl.c (initialize_predefined_identifiers): Name cdtor special
1103         names consistently.  Use literals for above deleted defines.
1104         (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
1106         * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
1107         flag.
1109         * call.c (check_dtor_name): Use constructor_name for enums too.
1110         (build_new_method_call_1): Use constructor_name for cdtors and
1111         show ~ for dtor.
1112         * class.c (build_self_reference): Use TYPE_NAME to get name of
1113         self reference.
1114         * name-lookup (constructor_name): Use DECL_NAME directly.
1115         (constructor_name_p): Reimplement.
1116         (push_class_level_binding_1): Use TYPE_NAME directly.
1118         * class.c (finish_struct): Use OVL_P.
1119         (get_vfield_name): Measure constructor_name length.
1120         * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
1121         (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
1122         * cxx-pretty-print.c (is_destructor_name): Delete.
1123         (pp_cxx_unqualified_id): Remove bogus destructor name checking.
1124         * decl.c (grokfndecl): Move cheap checks first when looking for
1125         implicit extern cness.
1127         * parser.c (cp_parser_direct_declarator): Reorder if to avoid
1128         indentation. Remove unnecessary assignment of constructor name.
1130         Whitespace cleanups.
1131         * call.c (name_as_c_string): Move CONST_CAST to return.
1132         (build_new_method_call_1): Remove unneeded bracing.
1133         * class.c (include_empty_classes): Unbreak line.
1134         * constraint.cc (tsubst_check_constraint): Add space.
1135         * cp-tree.h (lang_decl_ns): Add comment.
1136         (PTRMEM_CST_MEMBER): Break line.
1137         * decl.c (grokfndecl): Add blank lines. Unbreak some others.
1138         (grokdeclarator): Remove lines, move declaration to first use.
1139         * decl2.c (decl_needed_p): Fix indentation.
1140         (c_parse_final_cleanups): Remove blank line.
1141         * method.c (implicitly_declare_fn): Move declaration to first use.
1142         * search.c (current_scope): Add blank lines.
1144 2017-06-28  Jason Merrill  <jason@redhat.com>
1146         PR c++/72764 - ICE with invalid template typename.
1147         * decl.c (build_typename_type): No longer static.
1148         * tree.c (strip_typedefs): Use it instead of make_typename_type.
1150         PR c++/69300 - ICE with self-referential noexcept
1151         * pt.c (maybe_instantiate_noexcept): Check for recursion.
1153         PR c++/61022 - error with variadic template template parm
1154         * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
1156         PR c++/72801 - ICE with variadic partial specialization
1157         * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
1159         PR c++/55639 - partial specialization with ::template
1160         * parser.c (cp_parser_class_head): Handle ::template.
1162         PR c++/45976 - error with ::template in declarator.
1163         * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
1165         PR c++/54769 - wrong lookup of dependent template-name.
1166         * parser.c (cp_parser_template_name): Handle dependent object type.
1167         (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
1168         parameter.
1169         (cp_parser_id_expression): Pass it.
1170         (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
1172         * parser.c (cp_parser_template_id): Use the range location on the
1173         TEMPLATE_ID_EXPR.
1175         PR c++/81204 - parse error with dependent template-name
1176         * parser.c (cp_parser_lookup_name): Disqualify function templates
1177         after lookup.
1179 2017-06-27  Nathan Sidwell  <nathan@acm.org>
1181         * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
1182         initialization point.  Don't unnecessarily check for ctor name.
1184         * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
1185         (CLASSTYPE_DESTRUCTOR): ... this.
1186         * class.c (accessible_nvdtor_p,
1187         maybe_warn_about_overly_private_class,
1188         add_implicitly_declared_members,
1189         clone_constructors_and_destructors, type_has_virtual_destructor):
1190         Adjust for CLASSTYPE_DESTRUCTOR.
1191         (deduce_noexcept_on_destructors): Absorb into ...
1192         (check_bases_and_members): ... here.
1193         * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
1194         * init.c (build_delete): Likewise.
1195         * parser.c (cp_parser_lookup_name): Likewise.
1196         * pt.c (check_explicit_specialization): Likewise.
1197         * rtti.c (emit_support_tinfos): Likewise.
1198         * search.c (lookup_fnfields_idx_nolazy): Likewise.
1200         Kill IDENTIFIER_TEMPLATE.
1201         * cp-tree.h (lang_identifier): Remove class_template_info field.
1202         (IDENTIFIER_TEMPLATE): Delete.
1203         * name-lookup.c (constructor_name_full): Subsume into ...
1204         (constructor_name): ... here.  Don't check IDENTIFIER_TEMPLATE.
1205         (constructor_name_p): Likewise.
1206         * mangle.c (write_source_name): Likewise.
1207         * ptree.c (cxx_print_identifier): Likewise.
1209 2017-06-27  Marek Polacek  <polacek@redhat.com>
1211         PR bootstrap/81216
1212         * parser.c (cp_parser_already_scoped_statement): Initialize
1213         LOC_AFTER_LABELS.
1215 2017-06-26  Jason Merrill  <jason@redhat.com>
1217         PR c++/81215 - deduction failure with variadic TTP.
1218         * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
1220 2017-06-26  Martin Sebor  <msebor@redhat.com>
1222         PR c++/81169
1223         * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
1224         to detect casting away cv-qualifiers.
1226 2017-06-26  Nathan Sidwell  <nathan@acm.org>
1228         * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
1229         (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
1230         identifier.
1231         (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
1232         DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
1233         (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
1234         * decl.c (grok_op_properties): Adjust identifier checking.
1235         * init.c (expand_default_init): Adjust identifier descision.
1236         * method.c (implicitly_declare_fn): Don't use
1237         DECL_ASSIGNMENT_OPERATOR_P.
1238         * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
1239         IDENTIFIER_DTOR_P.
1240         * call.c (in_charge_arg_for_name): Reimplement.
1241         (build_special_member_call): Use IDENTIFIER_CDTOR_P,
1242         IDENTIFIER_DTOR_P.
1244 2017-06-26  Marek Polacek  <polacek@redhat.com>
1246         PR c/80116
1247         * parser.c (cp_parser_statement): Add a default argument.  Save the
1248         location of the expression-statement after labels have been parsed.
1249         (cp_parser_implicitly_scoped_statement): Set the location of the
1250         body of the conditional after parsing all the labels.  Call
1251         warn_for_multistatement_macros.
1252         (cp_parser_already_scoped_statement): Likewise.
1254 2017-06-24  Paolo Carlini  <paolo.carlini@oracle.com>
1256         PR c++/62315
1257         * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
1258         'typename' in error messages about missing 'typename'.
1260 2017-06-23  Jason Merrill  <jason@redhat.com>
1262         PR c++/79056 - C++17 ICE with invalid template syntax.
1263         * parser.c (cp_parser_simple_type_specifier): Don't assume that type
1264         is a TYPE_DECL.
1265         (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
1266         * pt.c (template_placeholder_p): New.
1267         * cp-tree.h: Declare it.
1269 2017-06-23  Marc Glisse  <marc.glisse@inria.fr>
1271         * decl.c (duplicate_decls): Use builtin_structptr_types.
1273 2017-06-22  Nathan Sidwell  <nathan@acm.org>
1275         Reorder IDENTIFIER flags
1276         gcc/cp/
1277         * cp-tree.h (enum cp_identifier_kind): New.
1278         (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
1279         IDENTIFIER_KIND_BIT_2): New.
1280         (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
1281         (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
1282         (C_IS_RESERVED_WORD): Replace with ...
1283         (IDENTIFIER_KEYWORD_P): ... this.
1284         (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
1285         (IDENTIFIER_CDTOR_P): ... this.
1286         (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
1287         (IDENTIFIER_OPNAME_P): Replace with ...
1288         (IDENTIFIER_ANY_OP_P): ... this.
1289         (IDENTIFIER_ASSIGN_OP_P): New.
1290         (IDENTIFIER_TYPENAME_P): Replace with ...
1291         (IDENTIFIER_CONV_OP_P): ... this.
1292         (NEW_DELETE_OPNAME_P): Replace with ...
1293         (IDENTIFIER_NEWDEL_OP_P): ... this.
1294         (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
1295         (get_identifier_kind_name, set_identifier_kind): Declare.
1296         * lex.c (get_identifier_kind_name, set_identifier_kind): New.
1297         (init_operators): Adjust to avoid keywords, use
1298         set_identifier_kind. Copy TYPE_EXPR slot.
1299         (init_reswords): Call set_identifier_kind.
1300         (unqualified_name_lookup_error): Adjust.
1301         * operators.def (TYPE_EXPR): Remove.
1302         * decl.c (struct predefined_identifier): Move into ...
1303         (initialize_predefined_identifiers): ... here.  Call
1304         set_identifier_kind.
1305         (grokfndecl, check_var_type, grokdeclarator): Adjust.
1306         (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
1307         space.  Adjust.
1308         * call.c (name_as_c_string): Adjust.
1309         (build_new_method_call_1): Likewise.
1310         * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
1311         * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
1312         * dump.c (cp_dump_tree): Adjust.
1313         * error.c (dump_decl_name): Adjust.
1314         * mangle.c (write_unqualified_id, write_member_name,
1315         write_expression): Adjust.
1316         (mangle_conv_op_name_for_type): Use set_identifier_kind.
1317         * name-lookup.c (do_class_using_decl): Adjust.
1318         (lookup_name_fuzzy, lookup_name_real_1): Likewise.
1319         * parser.c (cp_lexer_get_preprocessor_token,
1320         cp_parser_direct_declarator): Likewise.
1321         * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
1322         tsubst_copy, tsubst_copy_and_build): Adjust.
1323         * ptree.c (cxx_print_identifier): Print identifier kind.
1324         * search.c (lookup_field_r, lookup_member,
1325         lookup_fnfields_idx_nolazy): Adjust.
1326         * semantics.c (finish_id_expression): Adjust..
1327         * typeck.c (cp_build_addr_expr_1): Adjust.
1329 2017-06-21  Jakub Jelinek  <jakub@redhat.com>
1331         PR c++/81154
1332         * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
1333         Complain about t not being a variable if t is OVERLOAD even
1334         when processing_template_decl.
1336 2017-06-21  David Malcolm  <dmalcolm@redhat.com>
1338         * parser.c (get_cast_suggestion): New function.
1339         (maybe_add_cast_fixit): New function.
1340         (cp_parser_cast_expression): Capture the location of the closing
1341         parenthesis.  Call maybe_add_cast_fixit when emitting warnings
1342         about old-style casts.
1344 2017-06-20  Jason Merrill  <jason@redhat.com>
1346         PR c++/80972 - C++17 ICE with attribute packed.
1347         * call.c (build_over_call): Allow a TARGET_EXPR from reference
1348         binding.
1350 2017-06-20  Nathan Sidwell  <nathan@acm.org>
1352         * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
1353         (nelts_identifier): Delete.
1354         * decl.c (initialize_predefined_identifiers): Remove nelts.
1356         PR c++/67074 - namespace aliases
1357         * decl.c (duplicate_decls): Don't error here on mismatched
1358         namespace alias.
1359         * name-lookup.c (name_lookup::add_value): Matching namespaces are
1360         not ambiguous.
1361         (diagnose_name_conflict): Namespaces are never redeclarations.
1362         (update_binding): An alias can match a real namespace.
1364 2017-06-19  Jason Merrill  <jason@redhat.com>
1366         PR c++/80562 - ICE with constexpr if.
1367         * semantics.c (finish_if_stmt_cond): Call
1368         instantiate_non_dependent_expr.
1370         PR c++/80829 - ICE with constexpr copy of base subobject.
1371         * constexpr.c (clear_no_implicit_zero): New.
1372         (cxx_eval_call_expression): Call it.
1374 2017-06-19  Nathan Sidwell  <nathan@acm.org>
1376         PR c++/81124
1377         PR c++/79766
1378         * name-lookup.c (set_decl_namespace): Don't follow using
1379         directives and ignore using decls.  Only check overly-explicit
1380         scope after discovering decl.
1382 2017-06-19  Jason Merrill  <jason@redhat.com>
1384         PR c++/81073 - constexpr and static var in statement-expression.
1385         * typeck2.c (store_init_value): Always call
1386         require_potential_constant_expression.
1387         * pt.c (convert_nontype_argument): Likewise.
1388         * constexpr.c (potential_constant_expression_1): Adjust message.
1389         Use decl_maybe_constant_var_p instead of decl_constant_var_p.
1390         * decl2.c (decl_maybe_constant_var_p): Consider initializer.
1392 2017-06-19  Nathan Sidwell  <nathan@acm.org>
1394         * pt.c (coerce_template_parms): Fix indentation.
1395         (tsubst_decl): Remove repeated SET_DECL_RTL.  Move VAR_P handling
1396         in to single block.
1398         PR c++/81119
1399         * name-lookup.c (update_binding): Only warn about constructors
1400         hidden by functions.
1402 2017-06-17  Jason Merrill  <jason@redhat.com>
1404         PR c++/60063 - -Wunused-local-typedefs and templates.
1405         * decl2.c (is_late_template_attribute): Return false for "used".
1407         PR c++/70844 - -Wuseless-cast and inheriting constructor.
1408         * method.c (forward_parm): Suppress warn_useless_cast.
1410 2017-06-16  Jason Merrill  <jason@redhat.com>
1412         PR c++/81045 - Wrong type-dependence with auto return type.
1413         * pt.c (type_dependent_expression_p): An undeduced auto outside the
1414         template isn't dependent.
1415         * call.c (build_over_call): Instantiate undeduced auto even in a
1416         template.
1418         PR c++/80465 - ICE with generic lambda with noexcept-specifier.
1419         * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
1420         set longer for a generic lambda.
1422         PR c++/80614 - Wrong mangling for C++17 noexcept type
1423         * mangle.c (write_type): Put the eh spec back on the function type.
1425         PR c++/81102 - Wrong error with partial specialization.
1426         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
1427         types.  Do type deduction later.
1429         PR c++/81074 - ICE with partial specialization of member template.
1430         PR c++/71747
1431         * pt.c (get_partial_spec_bindings): Only coerce innermost args.
1433         PR c++/80831 - ICE with -fsyntax-only.
1434         * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
1436         PR c++/80639 - ICE with invalid PMF initialization.
1437         PR c++/80043 - ICE with -fpermissive
1438         * typeck.c (convert_for_assignment): Recurse when instantiate_type
1439         returns without an error.
1441 2017-06-16  Nathan Sidwell  <nathan@acm.org>
1443         * pt.c (tsubst_baselink): Fix & clarify formatting.
1445         * cp-tree.h (build_this_parm, cp_build_parm_decl,
1446         build_artificial_parm): Add FN parm.
1447         * decl.c (start_cleanup_fn): Adjust.
1448         (build_this_parm): Add FN parm, pass it through.
1449         (grokfndecl): Adjust parm building.
1450         * decl2.c (cp_build_parm_decl): Add FN parm, set context.
1451         (build_artificial_parm): Add FN parm, pass through.
1452         (maybe_retrofit_in_chrg): Adjust parm building.
1453         (start_static_storage_duration_function): Likwise.
1454         * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
1455         * method.c (implicitly_declare_fn): Likewise.
1456         * parser.c (inject_this_parameter): Likewise.
1458         Symbol tables are insert only.
1459         * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
1460         derive from pointer_hash.  Make undeletable.
1462         * class.c (resort_type_method_vec): Avoid potential unsigned
1463         overflow.
1465         Don't defer noexcept_deferred_spec.
1466         * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
1467         * decl.c (cxx_init_decl_processing): Initialize
1468         noexcept_deferred_spec.
1469         * except.c (unevaluated_noexcept_spec): Delete.
1470         * class.c (deduce_noexcept_on_destructor): Use
1471         noexcept_deferred_spec directly.
1472         * method.c (implicitly_declare_fn): Likewise.
1474         Make keyed_classes a vector.
1475         * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
1476         (keyed_classes): Declare as vector.
1477         * decl.c (keyed_classes): Define.
1478         (cxx_init_decl_processing): Allocate it.
1479         (record_key_method_defined): Use vec_safe_push.
1480         * class.c (finish_struct_1): Likewise.
1481         * pt.c (instantiate_class_template_1): Likewise.
1482         * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
1484         Make rtti lazier
1485         * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
1486         TK_VMI_CLASS_TYPES, TK_MAX.  Delete TK_FIXED.
1487         (tinfo_names): New.
1488         (typeid_ok_p): Add quotes to error messages.  Use get_tinfo_desc.
1489         (get_tinfo_decl): Use get_tinfo_desc.
1490         (get_pseudo_ti_init): Likewise. Adjust VMI construction.
1491         (create_pseudo_type_info): Delete.
1492         (get_pseudo_ti_index): Just determine the index.
1493         (get_tinfo_desc): New.  Create all types lazily.
1494         (create_tinfo_types): Just allocate the descriptor array.
1495         (emit_support_tinfos): Use non-inserting type lookup.  Set builtin
1496         location.
1498 2017-06-15  Martin Sebor  <msebor@redhat.com>
1500         PR c++/80560
1501         * call.c (first_non_public_field, maybe_warn_class_memaccess): New
1502         functions.
1503         (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
1504         (build_cxx_call): Call maybe_warn_class_memaccess.
1506 2017-06-14  Jakub Jelinek  <jakub@redhat.com>
1508         * cp-gimplify.c (cp_genericize_r): Turn most of the function
1509         into a switch (TREE_CODE (stmt)) statement from long else if
1510         sequence.
1512 2017-06-13  Jakub Jelinek  <jakub@redhat.com>
1514         PR c++/80973
1515         * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
1516         argument even if it has REFERENCE_TYPE.
1518         PR c++/80984
1519         * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
1520         BLOCK_VARS (outer) chain.
1521         (cxx_omp_const_qual_no_mutable): Likewise.
1523 2017-06-13  Martin Liska  <mliska@suse.cz>
1525         PR sanitize/78204
1526         * class.c (build_base_path): Use sanitize_flags_p.
1527         * cp-gimplify.c (cp_genericize_r): Likewise.
1528         (cp_genericize_tree): Likewise.
1529         (cp_genericize): Likewise.
1530         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1531         * decl.c (compute_array_index_type): Likewise.
1532         (start_preparsed_function): Likewise.
1533         * decl2.c (one_static_initialization_or_destruction): Likewise.
1534         * init.c (finish_length_check): Likewise.
1535         * lambda.c (maybe_add_lambda_conv_op): Likewise.
1536         * typeck.c (cp_build_binary_op): Likewise.
1537         (build_static_cast_1): Likewise.
1539 2017-06-11  Jason Merrill  <jason@redhat.com>
1541         * error.c (dump_expr): Use is_this_parameter.
1543         * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
1544         id_equal.
1546 2017-06-09  Jason Merrill  <jason@redhat.com>
1548         Missing bits from N4268, constant evaluation for all non-type args.
1549         * call.c (build_converted_constant_expr): Rename from
1550         build_integral_nontype_arg_conv, handle all types.
1551         * pt.c (convert_nontype_argument): In C++17 call it for all types.
1552         Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
1553         * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
1555         Overhaul pointer-to-member conversion and template argument handling.
1556         * call.c (standard_conversion): Avoid creating ck_pmem when the
1557         class type is the same.
1558         * cvt.c (can_convert_qual): Split from
1559         perform_qualification_conversions.
1560         * constexpr.c (cxx_eval_constant_expression): Check it.
1561         * typeck.c (convert_ptrmem): Only cplus_expand_constant if
1562         adjustment is necessary.
1563         * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
1564         (convert_nontype_argument): Avoid redundant error.
1566         * call.c (convert_like_real): Remove "inner" parameter.
1567         Don't replace a constant with its value.
1568         * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
1570         * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
1571         nullptr_node.
1573         * parser.c (cp_parser_constant_expression): Check
1574         potential_rvalue_constant_expression after decay_conversion.
1575         * pt.c (convert_nontype_argument): Don't require linkage in C++17.
1577         PR c++/80384 - ICE with dependent noexcept-specifier
1578         * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
1579         noexcept-specifier.
1581         * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
1583 2017-06-09  Jan Hubicka  <hubicka@ucw.cz>
1585         * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
1586         * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
1587         (excpet.c): Mark terminate as cold.
1589 2017-06-08  Jakub Jelinek  <jakub@redhat.com>
1591         PR c/81006
1592         * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
1593         to sizetype before size_binop.
1595         PR c++/81011
1596         * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
1597         to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
1598         and OMP_CLAUSE_SHARED_READONLY flags.
1600 2017-06-08  Jan Hubicka  <hubicka@ucw.cz>
1602         * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
1604 2017-06-07  Nathan Sidwell  <nathan@acm.org>
1606         * class.c (layout_class_type): Restructure overlong-bitfield tpe
1607         search.
1609 2017-06-07  Jonathan Wakely  <jwakely@redhat.com>
1611         PR c++/80990
1612         * pt.c (do_class_deduction): Build qualified type.
1614 2017-06-06  Nathan Sidwell  <nathan@acm.org>
1616         * name-lookup.c (suggest_alternatives_for): Use qualified lookup
1617         sans using directives.  Don't walk into inline namespaces.
1619         PR c++/80979
1620         * name-lookup.c (adl_class_only): Don't add visible friends.
1622 2017-06-05  Volker Reichelt  <v.reichelt@netcologne.de>
1624         * parser.c (cp_parser_base_specifier): Fix typos in error messages.
1626 2017-06-02  Nathan Sidwell  <nathan@acm.org>
1628         Remove lang_type_ptrmem.
1629         * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
1630         into ...
1631         (lang_type_class): ... this.  Reorder bitfields.  Rename to ...
1632         (lang_type): ... this.  Delete old definition.
1633         (lang_type_ptrmem): Delete.
1634         (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC.  Adjust uses.
1635         (LANG_TYPE_PTRMEM_CHECK): Delete.
1636         (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
1637         (TYPE_PTRMEMFUNC_TYPE): New.  Use TYPE_LANG_SLOT_1.
1638         * decl.c (build_ptrmemfunc_type): Adjust.
1639         * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
1640         (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
1641         
1642         * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
1643         setting.
1644         
1645         Remove cp_binding_level::namespaces
1646         * name-lookup.h (cp_binding_level): Lose namespaces field.
1647         * name-lookup.c (add_decl_to_level): Chain namespaces on the names
1648         list.
1649         (suggest_alternatives_for): Adjust for namespace list.  Do
1650         breadth-first search.
1651         * decl2.c (collect_source_refs): Namespaces are on the regulr
1652         list.
1653         (collect_ada_namespace): Likewise.
1655 2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1657         * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
1658         warning.
1660 2017-06-01  Ville Voutilainen  <ville.voutilainen@gmail.com>
1662         PR c++/80812
1663         * method.c (constructible_expr): Strip array types before calling
1664         build_value_init.
1666 2017-06-01  Paolo Carlini  <paolo.carlini@oracle.com>
1668         PR c++/80896
1669         * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
1670         for case INDIRECT_REF too in the main switch.
1672 2017-05-31  Jason Merrill  <jason@redhat.com>
1674         PR c++/80840 - ICE with constexpr and reference
1675         * pt.c (convert_nontype_argument): Don't test whether a decl is
1676         value-dependent when binding to a reference.
1678 2017-05-31  Nathan Sidwell  <nathan@acm.org>
1680         * cp-tree.h (lang_decl_slector): New enum.
1681         (lang_decl_base): Make selector an enum.  Drop decomposition_p
1682         field.
1683         (lang_decl): Use enum for discrimination.
1684         (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
1685         LANG_DECL_DEOMP_CHECK): Use enum.
1686         (DECL_DECOMPOSITION_P): Use selector value.
1687         (SET_DECL_DECOMPOSITION_P): Delete.
1688         (retrofit_lang_decl): Lose SEL parm.
1689         (fit_decomposition_lang_decl): Declare.
1690         * decl.c (cp_finish_decomp, grokdeclarator): Use
1691         fit_decomposition_lang_decl.
1692         * lex.c (maybe_add_lang_decl_raw): New. Broken out of
1693         retrofit_lang_decl.
1694         (set_decl_linkage): New.  Broken out of retrofit_lang_decl.  Use enum.
1695         (fit_decomposition_lang_decl): Likewise.
1696         (retrofit_lang_decl): Use worker functions.
1697         (cxx_dup_lang_specific_decl): Use selector enum.
1698         (maybe_add_lang_type_raw): New.  Broken out of ...
1699         (cxx_make_type_name): ... here.  Call it.
1701 2017-05-30  Jason Merrill  <jason@redhat.com>
1703         PR c++/80856 - ICE with local extern in template
1704         * semantics.c (finish_call_expr): Replace a local extern overload
1705         set in a template with the IDENTIFIER_NODE.
1707 2017-05-30  David Malcolm  <dmalcolm@redhat.com>
1709         * call.c (perform_implicit_conversion_flags): Convert
1710         "from %qT to %qT" to "from %qH to %qI" in diagnostic.
1711         (print_conversion_rejection): Replace pairs of %qT with
1712         %qH and %qI in various places.
1713         (build_user_type_conversion_1): Likewise.
1714         (build_integral_nontype_arg_conv): Likewise.
1715         (build_conditional_expr_1): Likewise.
1716         (convert_like_real): Likewise.
1717         (convert_arg_to_ellipsis): Likewise.
1718         (joust): Likewise.
1719         (initialize_reference): Likewise.
1720         * cvt.c (cp_convert_to_pointer): Likewise.
1721         (cp_convert_to_pointer): Likewise.
1722         (convert_to_reference): Likewise.
1723         (ocp_convert): Likewise.
1724         * error.c (cp_printer): Gain bool and const char ** parameters.
1725         (struct deferred_printed_type): New struct.
1726         (class cxx_format_postprocessor): New class.
1727         (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
1728         to pp->m_format_postprocessor.
1729         (comparable_template_types_p): New function.
1730         (newline_and_indent): New function.
1731         (arg_to_string): New function.
1732         (print_nonequal_arg): New function.
1733         (print_template_differences): New function.
1734         (type_to_string_with_compare): New function.
1735         (print_template_tree_comparison): New function.
1736         (append_formatted_chunk): New function.
1737         (add_quotes): New function.
1738         (cxx_format_postprocessor::handle): New function.
1739         (defer_phase_2_of_type_diff): New function.
1740         (cp_printer): Add "quoted" and "buffer_ptr" params.  Implement
1741         %H and %I.
1742         * typeck.c (cp_build_binary_op): Replace pairs of %qT with
1743         %qH and %qI in various places.
1744         (convert_member_func_to_ptr): Likewise.
1745         (build_reinterpret_cast_1): Likewise.
1746         (convert_for_assignment): Likewise.
1747         * typeck2.c (check_narrowing): Likewise.
1749 2017-05-30  Nathan Sidwell  <nathan@acm.org>
1751         Kill IDENTIFIER_NAMESPACE_BINDINGS
1752         * cp-tree.h (lang_identifier): Delete namespace_bindings.
1753         (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
1754         (lang_decl_ns): Add bindings.
1755         (DECL_NAMESPACE_BINDINGS): New.
1756         * lex.c (retrofit_lang_decl): Create namespace hash table.
1757         * name-lookup.c (find_namespace_slot): Change to use hash-map.
1758         * ptree.c (cxx_print_binding): Delete.
1759         (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
1761         * cp-tree.def (OVERLOAD): Fix comment.
1762         * cp-tree.h: Fix comments and whitespace.
1763         * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
1764         * name-lookup.c (add_decl_to_level): Assert not class.
1765         (check_local_shadow): Use OVL_P.
1766         (pushdecl_with_scope_1): Rename to ...
1767         (do_pushdecl_with_Scope): ... here.
1768         (do_nonmember_using_decl): Use qualified_namespace_lookup return
1769         value.
1770         (push_class_level_binding_1): Use OVL_P.
1771         (pushdecl_namespace_level): Use do_pushdecl_with_scope.
1772         (pushtag_1): Rename to ...
1773         (do_pushtag): ... here.  Adjust do_pushdecl_with_scope call.
1774         (pushtag): Adjust.
1775         (store_class_bindings): Do not time here.
1776         * name-lookup.h (pushdecl_outermost_localscope): Reorder.
1777         * pt.c (listify): Declare argvec at point of initialization.
1779         PR c++/80913
1780         * name-lookup.c (add_decl_to_level): Assert not making a circular
1781         chain.
1782         (update_binding): Don't prematurely slide artificial decl.
1784 2017-05-29  Alexandre Oliva <aoliva@redhat.com>
1786         * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
1788 2017-05-29  Nathan Sidwell  <nathan@acm.org>
1790         PR c++/80891 (#1,#5)
1791         * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
1792         * name-lookup.c (name_lookup): Add deduping field.
1793         (name_lookup::preserve_state, name_lookup::restore_state): Deal
1794         with deduping.
1795         (name_lookup::add_overload): New.
1796         (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
1797         (name_lookup::search_adl): Set deduping.  Don't unmark here.
1798         * pt.c (most_specialized_instantiation): Revert previous change,
1799         Assert not given duplicates.
1800         * tree.c (lookup_mark): Just mark the underlying decls.
1801         (lookup_maybe_add): Dedup using marked decls.
1803         PR c++/80891 (#4)
1804         * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
1805         * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
1807         Stat hack representation
1808         * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
1809         MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
1810         (stat_hack): New.
1811         (find_namespace_binding): Replace with ...
1812         (find_namespace_slot): ... this.
1813         (find_namespace_value): New.
1814         (name_lookup::search_namespace_only,
1815         name_lookup::adl_namespace_only): Adjust.
1816         (update_binding): Add SLOT parameter, adjust.
1817         (check_local_shadow): Use find_namespace_value.
1818         (set_local_extern_decl_linkage): Likewise.
1819         (do_pushdecl): Adjust for namespace slot.
1820         (push_local_binding): Assert not a namespace binding.
1821         (check_for_out_of_scope_variable): Use find_namespace_value.
1822         (set_identifier_type_value_with_scope): Likewise.
1823         (get_namespace_binding): Likewise.
1824         (set_namespace_binding): Delete.
1825         (set_global_binding): Directly update the binding.
1826         (finish_namespace_using_decl): Likewise.
1827         (lookup_type_scope_1): Use find_namespace_slot and update.
1828         (do_push_nested_namespace): Use find_namespace_value.
1830         PR c++/80891 (#1)
1831         * pt.c (most_specialized_instantiation): Cope with duplicate
1832         instantiations.
1834         PR c++/80891 (#3)
1835         * cp-tree.h (build_min_nt_call_vec): Declare.
1836         * decl.c (build_offset_ref_call_from_tree): Call it.
1837         * parser.c (cp_parser_postfix_expression): Likewise.
1838         * pt.c (tsubst_copy_and_build): Likewise.
1839         * semantics.c (finish_call_expr): Likewise.
1840         * tree.c (build_min_nt_loc): Keep unresolved lookups.
1841         (build_min): Likewise.
1842         (build_min_non_dep): Likewise.
1843         (build_min_non_dep_call_vec): Likewise.
1844         (build_min_nt_call_vec): New.
1846         PR c++/80891 (#2)
1847         * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
1848         (ovl_used): New.
1849         (lookup_keep): Call it.
1851 2017-05-26  Nathan Sidwell  <nathan@acm.org>
1853         Implement DR2061
1854         * name-lookup.c (push_inline_namespaces): New.
1855         (push_namespace): Look inside inline namespaces.
1857         Inline and using namespace representation change.
1858         * cp-tree.h (struct lang_decl_ns): Delete ns_using.  Add usings,
1859         inlinees as vector.
1860         (DECL_NAMESPACE_USING): Adjust.
1861         (DECL_NAMESPACE_INLINEES): New.
1862         * name-lookup.h (struct cp_binding_level): Change usings
1863         representation.
1864         * name-lookup.c (name_lookup::do_queue_usings,
1865         name_lookup::queue_usings): Adjust.
1866         (name_lookup::search_namespace, name_lookup::search_usings,
1867         name_lookup::queue_namespace): Adjust.
1868         (name_lookup::adl_namespace_only): Adjust.
1869         (add_using_namespace, push_namespace): Push onto vector.
1870         (pop_namespace): Add timing logic.
1872         * call.c (build_operator_new_call): Do namelookup and ADL here.
1873         (build_new_op_1): Likewise.
1874         * name-lookup.h (lookup_function_nonclass): Delete declaration.
1875         (do_using_directive): Likewise.
1876         * name-lookup.c (set_namespace_binding, push_local_binding): Don't
1877         declare early.
1878         (struct scope_binding): Delete.
1879         (EMPTY_SCOPE_BINDING): Delete.
1880         (set_decl_namespace): Use OVL_P.
1881         (finish_local_using_decl): Lose unnecesary checks.
1882         (lookup_function_nonclass): Delete.
1883         (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
1885         * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
1886         (ovl_iterator): Add allow_inner field.  Adjust ctor.  Make
1887         unduplicatable.
1888         (ovl_iterator::maybe_push, ovl_iterator::pop): New.
1889         (lkp_iterator): Add outer field.  Adjust ctor.
1890         (lkp_iterator::operator++): New.
1891         (lookup_mark, lookup_maybe_add): Declare.
1892         * name-lookup.c (name_lookup): Delete fn_set member.
1893         (name_lookup::preserve_state, name_lookup::restore_state): Unmark
1894         and mark lookup.
1895         (name_lookup::add_value): Use lookup_add directly.
1896         (name_lookup::add_fns: Use lookup_maybe_add.
1897         (name_lookup::search_adl): Mark and unmark fns.
1898         (pushdecl): Adjust.
1899         * pt.c (check_explicit_specialization): Use lookup_add directly.
1900         * ptree.c (cxx_print_xnode): Show complete overload structure.
1901         * tree.c (lookup_mark, lookup_maybe_add): New.
1903         * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
1905 2017-05-26  Jakub Jelinek  <jakub@redhat.com>
1907         * cp-tree.h (struct lang_decl_decomp): New type.
1908         (struct lang_decl): Add u.decomp.
1909         (LANG_DECL_DECOMP_CHECK): Define.
1910         (DECL_DECOMPOSITION_P): Note it is set also on the vars
1911         for user identifiers.
1912         (DECL_DECOMP_BASE): Define.
1913         (retrofit_lang_decl): Add extra int = 0 argument.
1914         * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
1915         use it to influence the selector choices and for selector
1916         0 to non-zero transition copy old content.
1917         (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
1918         * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
1919         !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR.  Adjust warning
1920         wording if decl is a structured binding.
1921         (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
1922         Set DECL_DECOMP_BASE.  Ignore DECL_READ_P sets from initialization
1923         of individual variables for tuple structured bindings.
1924         (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
1925         Clear DECL_DECOMP_BASE.
1926         * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
1927         * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
1928         is expected.
1929         * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
1930         DECL_VALUE_EXPR.
1932 2017-05-25  Jason Merrill  <jason@redhat.com>
1934         PR c++/80605 - __is_standard_layout and zero-length array
1935         * class.c (check_bases): Use DECL_FIELD_IS_BASE.
1937 2017-05-25  Nathan Sidwell  <nathan@acm.org>
1939         Kill OVL_CURRENT, OVL_NEXT.
1940         * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
1941         * name-lookup.c (set_decl_namespace): Use ovl_iterator.
1942         (consider_binding_level): Use OVL_FIRST.
1943         (cp_emit_debug_info_for_using): Use lkp_iterator.
1944         * pt.c (check_explicit_specialization): Use ovl_iterator.       
1946         Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
1947         * cp-tree.h (lang_decl_ns): Remove ns_users field.
1948         (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
1949         (TREE_INDIRECT_USING): Delete.
1950         * name-lookup.h (is_associated_namespace): Delete.
1951         * name-lookup.c (name_lookup::search_usings,
1952         name_lookup::do_queue_usings): Usings are always direct.
1953         (is_associated_namespace): Delete.
1954         (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
1955         (namespace_ancestor_1, namespace_ancestor): Delete.
1956         (push_using_directive_1, push_using_directive): Delete.
1957         (add_using_namespace_1): Delete.
1958         (add_using_namespace): Reimplement.
1959         (emit_debug_info_using_namespace): New.
1960         (finish_namespace_using_directive, finish_local_using_directive,
1961         push_namespace): Adjust.
1962         * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
1964 2017-05-25  Volker Reichelt  <v.reichelt@netcologne.de>
1966         * semantics.c (finish_handler_parms): Warn about non-reference type
1967         catch handlers.
1969 2017-05-25  Nathan Sidwell  <nathan@acm.org>
1971         Reimplement unqualified namespace lookup.
1972         * name-lookup.c (name_lookup::using_pair,
1973         name_lookup::using_queue): New typedefs.
1974         (name_lookup::queue_namespace, name_lookup::do_queue_usings,
1975         name_lookup::queue_usings): New.
1976         (name_lookup::search_unqualified): New.
1977         (merge_functions, same_entity_p, ambiguous_decl,
1978         unqualified_namespace_lookup_1, unqualified_namespace_lookup,
1979         lookup_using_namespace): Delete.
1980         (lookup_name_real_1): Adjust.
1982         Reimplement qualified namespace lookup.
1983         * name-lookup.c (name_lookup::flags): New member.  Adjust ctor.
1984         (name_lookup::ambiguous, name_lookup::add_value,
1985         name_lookup::add_type, name_lookup::process_binding): New.
1986         (name_lookup::search_namespace_only,
1987         name_lookup::search_namespace, name_lookup::search_usings): New.
1988         (name_lookup::search_qualified): New.
1989         (do_nonmember_using_decl, suggest_alternatives_for,
1990         lookup_qualified_name): Adjust.
1991         (tree_vec_contains): Delete.
1992         (qualified_lookup_using_namespace): Rename to ...
1993         (qualified_namespace_lookup): ... here.  Reimplement.
1995         Reimplement ADL.
1996         * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
1997         * name-lookup.h (lookup_arg_dependent): Return plain tree.
1998         * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
1999         arg_assoc_args_vec, arg_assoc_type, add_function,
2000         arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
2001         arg_assoc_class, arg_assoc_template_arg, arg_assoc,
2002         lookup_arg_dependent_1): Delete.
2003         (name_lookup): New lookup object.
2004         (name_lookup::preserve_state, name_lookup::restore_state,
2005         name_lookup::mark_seen, name_lookup::find_and_mark,
2006         name_lookup::add_fns, name_lookup::adl_namespace_only,
2007         name_lookup::adl_namespace, name_lookup::adl_class_only,
2008         name_lookup::adl_bases, name_lookup::adl_class,
2009         name_lookup::adl_expr, name_lookup::adl_type,
2010         name_lookup::adl_template_arg, name_lookup::search_adl): New.
2011         (lookup_arg_dependent): Return a plain tree.  Adjust.
2012         (is_associated_namespace): Move later.
2013         
2014 2017-05-24  Nathan Sidwell  <nathan@acm.org>
2016         * friend.c (do_friend): Remove check for existing decl.
2017         * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
2018         * name-lookup.c (push_local_binding): Directly look for binding.
2019         (lookup_name_innermost_nonclass_level_1): Delete.
2020         (lookup_name_innermost_nonclass_level): Delete.
2022         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
2024         * cp-tree.h (cp_free_lang_data): Add extern.
2025         (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
2026         ATTRIBUTE_PURE.
2027         (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
2028         * typeck.c (type_unknown_p): Delete.
2029         * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
2030         overload management.
2031         (dependent_name): Likewise.
2032         (decl_anon_ns_mem_p): Simplify.
2034 2017-05-24  Jonathan Wakely  <jwakely@redhat.com>
2036         PR c++/80544
2037         * tree.c (reshape_init): Use unqualified type for direct enum init.
2038         * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
2039         (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
2040         non-class destination types.
2041         (build_const_cast_1): Strip cv-quals from destination types.
2042         (build_static_cast, build_reinterpret_cast, build_const_cast)
2043         (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
2045 2017-05-24  Martin Sebor  <msebor@redhat.com>
2047         PR c/80731
2048         * call.c (fully_fold_internal): Adjust.
2050 2017-05-24  Nathan Sidwell  <nathan@acm.org>
2052         * cp-tree.h (ovl_skip_hidden): Declare.
2053         * tree.c (ovl_skip_hidden): New.
2054         * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
2055         (lookup_arg_dependent_1): Likewise.
2056         (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
2057         (hidden_name_p, remove_hidden_names): Delete.
2058         (lookup_name_real_1): Do not strip hidden names.
2059         * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
2061         * cp-tree.h (OVL_HIDDEN_P): New.
2062         (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
2063         (ovl_iterator::reveal_node): Declare.
2064         * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
2065         (ovl_insert): Order on hiddenness.
2066         (ovl_iterator::reveal_node): New.
2067         * name-lookup.c (anticipated_builtin_p): New.
2068         (supplement_binding_1): Use it.
2069         (set_local_extern_decl_linkage): Use hidden_p.
2070         (do_pushdecl): Deal with unhiding a hidden decl, use
2071         anticipated_builtin_p.
2072         (do_nonmember_using_decl): Use anticipated_decl_p.
2073         (lookup_name_real_1): Use DECL_HIDDEN_P.
2075 2017-05-23  Jason Merrill  <jason@redhat.com>
2077         -Wunused and C++17 structured bindings
2078         * decl.c (poplevel): Don't warn about unused structured bindings,
2079         only real variables.
2080         * error.c (dump_simple_decl): Handle structured bindings.
2081         * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
2083 2017-05-23  Nathan Sidwell  <nathan@acm.org>
2085         * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
2086         * name-lookup.c (create_local_binding): New.
2087         (update_binding): New.
2088         (pushdecl_maybe_friend_1): Rename to ...
2089         (do_pushdecl): ... this.  Reimplement.
2090         (pushdecl): Adjust.
2091         (push_overloaded_decl_1, push_overloaded_decl): Delete.
2093 2017-05-23  Jason Merrill  <jason@redhat.com>
2095         PR c++/80396 - built-in for make_integer_sequence.
2096         * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
2097         (expand_integer_pack, expand_builtin_pack_call): New.
2098         (find_parameter_packs_r): Check builtin_pack_call_p.
2099         (check_for_bare_parameter_packs): Handle it.
2100         (tsubst_pack_expansion): Call expand_builtin_pack_call.
2101         (declare_integer_pack): New.
2102         (init_template_processing): Call it.
2103         * decl2.c (mark_used): Check builtin_pack_fn_p.
2105 2017-05-23  Nathan Sidwell  <nathan@acm.org>
2107         * name-lookup.c (find_namespace_binding): New.
2108         (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
2109         (set_identifier_type_value_with_scope): Use find_namespace_binding.
2110         (find_binding, cp_binding_level_find_binding_for_name,
2111         binding_for_name, namespace_binding_1): Delete.
2112         (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
2113         (get_namespace_binding, set_namespace_binding,
2114         finish_namespace_using_decl, unqualified_namespace_lookup_1,
2115         qualified_lookup_using_namespace, lookup_type_scope_1,
2116         lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
2118         PR c++/80866
2119         * parser.c (cp_parser_template_id): Keep the lookup when stashing
2120         the template_id.
2122         * cp-tree.h (DECL_HIDDEN_P): New.
2123         * name-lookup.c (set_decl_context,
2124         set_local_extern_decl_linkage): New, broken out of ...
2125         (pushdecl_maybe_friend_1): ... here.  Call them.
2127 2017-05-23  Thomas Schwinge  <thomas@codesourcery.com>
2129         * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
2130         "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
2131         "VECTOR_LENGTH".
2133 2017-05-23  Nathan Sidwell  <nathan@acm.org>
2135         * cp-tree.h (OVL_P): New.
2136         * name-lookup.h (push_local_binding): Delete.
2137         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
2138         (finish_namespace_using_decl, finish_local_using_decl): ... here
2139         * name-lookup.c (add_decl_to_level): Swap args.
2140         (pop_bindings_and_leave_scope): Look inside TREE_LIST.
2141         (diagnose_name_conflict): Check contexts are same for redecl.
2142         (update_local_overload): New.
2143         (compparms_for_decl_and_using): Rename to ...
2144         (matching_fn_p): ... here.
2145         (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
2146         push_local_bindings call.
2147         (push_local_binding): Make static, replace FLAGS arg with
2148         IS_USING.
2149         (validate_nonmember_using_decl): Use OVL_FIRST.
2150         (do_nonmember_using_decl): Use in/out parameters.  Use
2151         lkp_iterator and simplify.
2152         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
2153         (finish_namespace_using_decl, finish_local_using_decl): ... here.
2154         Adjust.
2155         (lookup_type_current_level): Delete.
2156         * parser.c (cp_parser_using_declaration): Adjust.
2157         * pt.c (tsubst_expr): Adjust.
2159 2017-05-22  Nathan Sidwell  <nathan@acm.org>
2161         * name-lookup.h (parse_using_directive): Replace with ...
2162         (finish_namespace_using_directive): ... this and ...
2163         (finish_local_using_directive): ... this.
2164         * name-lookup.c (add_using_namespace_1): Move later.
2165         (add_using_namespace): Move later, add namespace_p arg, remove
2166         indirect arg.
2167         (push_using_directive_1): Directly recurse.
2168         (do_using_directive, parse_using_directive): Delete, split into ...
2169         (finish_namespace_using_directive): ... this and ...
2170         (finish_local_using_directive): ... this.
2171         (push_namespace): Use add_using_namespace.
2172         * parser.c (cp_parser_using_directive): Call
2173         finish_namespace_using_directive or finish_local_using_directive.
2174         * pt.c (tsubst_expr): Call finish_local_using_directive.
2176         * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
2177         * cp-tree.h (raw_dump_id): Declare.
2178         * decl2.c (raw_dump_id): Define.
2179         (dump_tu): Use raw_dump_id.
2181         * config-lang.in (gtfiles): Sort list, break lines.
2183         * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
2184         (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
2185         ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
2186         CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
2187         CPTI_RETHROW_FN): New.
2188         (noexcept_deferred_spec): New.
2189         (terminate_node, call_unexpected_node): Rename to ...
2190         (terminate_fn, call_unexpected_fn): ... here.
2191         (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
2192         allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
2193         * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
2194         (init_exception_processing): Adjust.
2195         (declare_library_fn): Create and push the fns here.
2196         (do_get_exception_ptr, do_begin_catch, do_end_catch,
2197         do_allocate_exception_ptr, do_free_exception_ptr): Adjust
2198         declare_library_fn use.
2199         (unevaluated_noexcept_spec): Adjust.
2200         * cp-gimplify.c (genericize_eh_spec_block,
2201         gimplify_most_not_throw_expr): Adjust.
2203         * name-lookup.c (pushdecl_top_level,
2204         pushdecl_top_level_and_finish): Move after namespace pushing and
2205         popping functions.
2206         (push_to_top_level): Rename to ...
2207         (do_push_to_top_level): ... here.  Remove timing code.
2208         (pop_from_top_level_1): Rename to ...
2209         (do_pop_from_top_level): ... here.
2210         (do_push_nested_namespace, do_pop_nested_namespace)
2211         (push_to_top_level): New wrapper for do_push_to_top_level.
2212         (pop_from_top_level): Adjust.
2213         (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
2215 2017-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
2217         * config-lang.in (gtfiles): Add c-family/c-format.c,
2218         except.c, init.c, lambda.c and friend.c.
2219         * class.c (dvirt_fn): Move out of function scope,
2220         add GTY attribute.
2221         * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
2222         * init.c (fn): Likewise.
2223         * lambda.c (ptr_id, max_id): Likewise.
2224         * friend.c (global_friend): Add GTY attribute.
2226 2017-05-19  Nathan Sidwell  <nathan@acm.org>
2228         * call.c (add_list_candidates): Use OVL_FIRST.
2229         (build_new_method_call_1): Likewise.
2230         * cp-tree.h (OVL_SINGLE_P): New.
2231         (TYPE_HIDDEN_P): New.
2232         * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
2233         * dump.c (cp_tump_tree): Adjust overload dumping.
2234         * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
2235         printing.
2236         * method.c (lazily_declare_fn): Assert we added it.
2237         * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
2238         OVL_FIRST.
2239         (cp_parser_template_name): Use lkp_iterator.
2240         * pt.c (begin_template_parm_list): Fixup comment.
2241         (instantiate_class_template_1): Use TYPE_HIDDEN_P.
2242         * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
2243         (ovl_scope): Use lkp_iterator.
2245 2017-05-19  Thomas Schwinge  <thomas@codesourcery.com>
2247         * parser.c (cp_parser_omp_clause_default): Handle
2248         "OMP_CLAUSE_DEFAULT_PRESENT".
2250         * parser.c (cp_parser_omp_clause_default): Avoid printing more
2251         than one syntax error message.
2253 2017-05-19  Nathan Sidwell  <nathan@acm.org>
2255         * class.c (class_dump_id): Define.
2256         (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
2257         * cp-objcp-common.c (cp_register_dumps): New.
2258         * cp-objcp-common.h (cp_register_dumps): Declare.
2259         (LANG_HOOKS_REGISTER_DUMPS): Override.
2260         * cp-tree.h (class_dump_id): Declare.
2262 2017-05-18  Nathan Sidwell  <nathan@acm.org>
2264         * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
2265         (OVL_USED_P): New.
2266         (lookup_keep): Declare.
2267         * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
2268         * pt.c (tsubst_copy): Assert lookup is persistent.
2269         * semantics.c (finish_call_expr): Use lkp_iterator, call
2270         lookup_keep.
2271         * tree.c (ovl_copy): New.
2272         (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
2273         (lookup_keep): New.
2275         * cp-tree.h (OVL_USED): Replace with ...
2276         (OVL_USING_P): ... this.
2277         (ovl_iterator::using_p): Adjust.
2278         * name-lookup.c (push_overloaded_decl_1,
2279         do_nonmember_using_decl): Adjust.
2280         * search.c (lookup_field_r): Adjust.
2281         * tree.c (ovl_insert, ovl_scope): Adjust.
2283         * cp-tree.h (lookup_add): Swap args.
2284         (ovl_cons, build_overload): Delete.
2285         * name-lookup.c (add_function, push_overloaded_decl_1,
2286         do_nonmember_using_decl, merge_functions, remove_hidden_names):
2287         Use lookup_add, ovl_insert.
2288         * pt.c (check_explicit_specialization): Use lookup_add.
2289         (do_class_deduction): Likewise. Refactor if.
2290         * tree.c (lookup_add): Swap args.
2291         (ovl_cons, build_overload): Delete.
2293         * name-lookup.c (find_local_binding): New, broken out of ...
2294         (lookup_name_innermost_nonclass_level_1): ... here.  Call it.
2295         (set_namespace_binding): Swap scope & name args.
2296         (namespace_binding_1): Likewise.
2297         (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
2298         (push_overloaded_decl_1): Likewise.
2299         (set_global_binding): Likewise.
2300         (get_namespace_binding): Adjust namespace_binding_1 call.
2302 2017-05-17  Nathan Sidwell  <nathan@acm.org>
2304         * cp-tree.h (default_hash_traits <lang_identifier *>): New
2305         specialization.
2306         * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
2307         (extern_c_fns): New hash table.
2308         (check_extern_c_conflict): New, broken out of ...
2309         (pushdecl_maybe_friend_1): ... here.  Call it.
2310         (c_linkage_bindings): Just look in hash table.
2312 2017-05-17  Ville Voutilainen  <ville.voutilainen@gmail.com>
2314         PR c++/80654
2315         PR c++/80682
2316         Implement new C++ intrinsics __is_assignable and __is_constructible.
2317         * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
2318         (is_xible): New.
2319         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
2320         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2321         * method.c (constructible_expr): Set cp_unevaluated.
2322         (is_xible_helper): New.
2323         (is_trivially_xible): Adjust.
2324         (is_xible): New.
2325         * parser.c (cp_parser_primary_expression): Handle
2326         RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
2327         (cp_parser_trait_expr): Likewise.
2328         * semantics.c (trait_expr_value): Handle
2329         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2331 2017-05-17  Nathan Sidwell  <nathan@acm.org>
2333         * cp-tree.h (ovl_iterator::using_p): New predicate.
2334         (ovl_iterator::remove_node): New worker.
2335         (ovl_insert): Declare.
2336         * tree.c (ovl_insert): New.
2337         (ovl_iterator::remove_node): New.
2338         * class.c (add_method): Use ovl_iterator, ovl_insert.
2339         (clone_function_decl): Fix description.
2340         (clone_constructors_and_destructors): Use ovl_iterator.
2342         * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
2343         (maybe_warn_about_overly_private_class): Use ovl_iterator.
2344         (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
2345         (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
2346         (get_base_fndecls): Use ovl_iterator.
2347         (warn_hidden): Use OVL_NAME, ovl_iterator.
2348         (add_implicitly_declared_members): Use ovl_iterator.
2349         * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
2350         flatten nested if.
2351         (finish_shorthand_constraint): Simplify, use ovl_make.
2352         * pt.c (make_constrained_auto): Simplify.  Use ovl_make.
2353         * search.c (shared_member_p): Use ovl_iterator.
2354         (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
2355         (lookup_conversion_operator): Use OVL_FIRST.
2356         (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
2357         (look_for_overrides_here): Use ovl_iterator.
2358         (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
2359         * typeck.c (build_x_unary_op): Use ovl_make.
2361 2017-05-17  Martin Liska  <mliska@suse.cz>
2363         * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
2364         use it instead of int type.
2365         (dump_vtable): Likewise.
2366         (dump_vtt): Likewise.
2367         * decl2.c (dump_tu): Likewise.
2369 2017-05-16  David Malcolm  <dmalcolm@redhat.com>
2371         * call.c (enforce_access): Add access_failure_info * param and use
2372         it to record access failures.
2373         * cp-tree.h (class access_failure_info): New class.
2374         (enforce_access): Add access_failure_info * param, defaulting to
2375         NULL.
2376         (lookup_member): Likewise.
2377         (locate_field_accessor): New function decl.
2378         (perform_or_defer_access_check): Add access_failure_info * param,
2379         defaulting to NULL.
2380         * search.c (lookup_member): Add access_failure_info * param and
2381         pass it on to call to perform_or_defer_access_check.
2382         (matches_code_and_type_p): New function.
2383         (field_access_p): New function.
2384         (direct_accessor_p): New function.
2385         (reference_accessor_p): New function.
2386         (field_accessor_p): New function.
2387         (struct locate_field_data): New struct.
2388         (dfs_locate_field_accessor_pre): New function.
2389         (locate_field_accessor): New function.
2390         * semantics.c (perform_or_defer_access_check): Add
2391         access_failure_info * param, and pass it on to call to
2392         enforce_access.
2393         * typeck.c (access_failure_info::record_access_failure): New method.
2394         (access_failure_info::maybe_suggest_accessor): New method.
2395         (finish_class_member_access_expr): Pass an access_failure_info
2396         instance to the lookup_member call, and call its
2397         maybe_suggest_accessor method afterwards.
2399 2017-05-16  Marek Polacek  <polacek@redhat.com>
2401         PR sanitizer/80536
2402         PR sanitizer/80386
2403         * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
2405 2017-05-16  Nathan Sidwell  <nathan@acm.org>
2407         * name-lookup.c (check_local_shadow): New, broke out of ...
2408         (pushdecl_maybe_friend_1): ... here.  Call it.
2410         * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
2411         (ovl_first): Move inline definition to end of file.
2412         (ovl_make, lookup_add): Declare.
2413         (get_fns, get_first_fn): Make pure.
2414         * tree.c (ovl_cache): New.
2415         (ovl_make, lookup_add): New.
2416         * pt.c (do_class_deduction): Don't add candidates that will be
2417         elided.
2419         * call.c (build_user_type_conversion_1): Use OVL_FIRST.
2420         (print_error_for_call_failure): Use OVL_NAME.
2421         (build_op_call_1): Use ovl_iterator.
2422         (add_candidates): Use OVL_FIRST & lkp_iterator.
2423         (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
2424         lkp_iterator.
2425         * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
2426         (type_has_user_nondefault_constructor,
2427         in_class_defaulted_default_constructor,
2428         type_has_user_provided_constructor,
2429         type_has_user_provided_or_explicit_constructor,
2430         type_has_non_user_provided_default_constructor,
2431         vbase_has_user_provided_move_assign,
2432         type_has_move_constructor, type_has_move_assign,
2433         type_has_user_declared_move_constructor,
2434         type_has_user_declared_move_assign,
2435         type_build_ctor_call, type_build_dtor_call,
2436         type_requires_array_cookie, explain_non_literal_class): Likewise.
2437         (finish_struct): Use lkp_iterator.
2438         (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
2439         (note_name_declared_in_class): Use OVL_NAME.
2440         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
2441         (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
2442         cxx_pretty_printer::expression): Likewise.
2443         * decl2.c (check_classfn): Use ovl_iterator.
2444         * pt.c (retrieve_specialization): Use ovl_iterator.
2445         * tree.c (cp_tree_equal): Use lkp_iterator.
2446         (type_has_nontrivial_copy_init): Use ovl_iterator.
2448         * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
2449         check is_overloaded_fn.
2451 2017-05-16  Martin Liska  <mliska@suse.cz>
2453         * parser.c (cp_lexer_print_token): Add default value for flags
2454         argument of print_gimple_stmt, print_gimple_expr,
2455         print_generic_stmt and print_generic_expr.
2457 2017-05-16  Nathan Sidwell  <nathan@acm.org>
2459         * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
2460         iterators.
2461         (MAYBE_BASELINK_FUNCTIONS): New.
2462         * constraint.cc (resolve_constraint_check): Use lkp_iterator.
2463         * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
2464         * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
2465         * method.c (inherited_ctor_binfo): Use ovl_iterator.
2466         (binfo_inherited_from): Likewise.
2467         * parser.c (lookup_literal_operator): Use lkp_iterator.
2468         * pt.c (iterative_hash_template_arg): Use lkp_iterator.
2469         (print_candidates_1): Likewise.
2470         (determine_specialization): Likewise.
2471         (resolve_overloaded_unification): Likewise.
2472         (resolve_nondeduced_context): Likewise.
2473         (type_dependent_expression_p): Likewise.
2474         (dependent_template_p): Likewise.
2475         * ptree.c (cxx_print_xnode): Likewise.
2476         * semantics.c (omp_reduction_lookup): Use lkp_iterator.
2477         (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
2478         * typeck.c (check_template_keyword): Use lkp_iterator.
2480         * cp-tree.h (OVL_FIRST, OVL_NAME): New.
2481         (ovl_first): New.
2482         * constexpr.c (function_concept_check): Use OVL_FIRST.
2483         * cvt.c (build_expr_type_conversion): Likewise.
2484         * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
2485         * decl2.c (mark_used): Use OVL_FIRST.
2486         * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
2487         (dump_expr, location_of): Use OVL_FIRST.
2488         * friend.c (do_friend): Use OVL_NAME.
2489         * init.c (build_offset_ref): Use OVL_FIRST.
2490         * mangle.c (write_member_name): Likewise.
2491         (write_expression): Use OVL_NAME.
2492         * method.c (strip_inheriting_ctors): Use OVL_FIRST.
2493         * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
2494         * pt.c (check_explicit_specialization): Use OVL_FIRST.
2495         (check_template_shadow): Likewise.
2496         (tsubst_template_args): Use OVL_NAME.
2497         (tsubst_baselink): Use OVL_FIRST.
2498         * semantics.c (perform_koenig_lookup): Use OVL_NAME.
2499         * tree.c (get_first_fn): Use OVL_FIRST.
2500         * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
2501         (cp_build_addr_expr_1): Use OVL_FIRST.
2503         * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
2504         peeking.
2505         * semantics.c (finish_id_expression): Directly init local var.
2506         (finish_omp_reduction_clause): Use really_overloaded_fn.
2507         * tree.c (get_fns): Document.  Assert we got an overload.
2508         (get_first_fn) Document.
2509         * typeck.c (cp_build_addr_expr_1): Pass arg directly to
2510         really_overloaded_fn.
2511         * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
2513         * cp-tree.h (SCOPE_DEPTH): New.
2514         * name-lookup.h (is_nested_namespace): Declare.
2515         * name-lookup.c (is_nested_namespace): New.
2516         (is_ancestor): Use it.
2517         (set_decl_namespace): Likewise.
2518         (push_namespace): Set SCOPE_DEPTH.
2519         * pt.c (check_specialization_namespace): Use is_nested_namespace.
2520         (check_unqualigied_spec_or_inst): Likewise.
2522 2017-05-15  Nathan Sidwell  <nathan@acm.org>
2524         PR c++/79369
2525         * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
2526         * name-lookup.h (push_namespace): Return int, add make_inline arg.
2527         * name-lookup.c (push_namespace): Deal with inline directly.
2528         Return pushed count.
2529         * parser.c (cp_parser_namespace_definition): Adjust for
2530         push_namespace change.
2532 2017-05-11  Nathan Sidwell  <nathan@acm.org>
2534         * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
2535         LANG_HOOKS_PUSHDECL): Move to ...
2536         * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
2537         LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
2538         * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
2540         * name-lookup.h (pushdecl): Add default friend parm.
2541         (pushdecl_maybe_friend): Delete.
2542         (pushdecl_top_level): Add default friend parm.
2543         (pushdecl_top_level_maybe_friend): Delete.
2544         * name-lookup.c (pushdecl_maybe_friend): Delete.
2545         (pushdecl): Add is_friend parm.
2546         (pushdecl_top_level): Add is friend_parm.
2547         (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
2548         (pushdecl_top_level_and_finish): Do pushing and finishing directly.
2549         * friend.c (do_friend): Adjust.
2550         * pt.c (tsubst_friend_class): Adjust.
2552         Revert pushdecl_top_level_and_finish name change.
2553         * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
2554         * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
2555         * decl.c (cp_make_fname_decl): Adjust.
2556         * decl2.c (get_guard, handle_tls_init):  Adjust.
2557         * rtti.c (get_tinfo_decl, tinfo_base_init):  Adjust.
2559         * name-lookup.c (pushdecl_outermost_localscope): Always
2560         conditionally stop timer.
2562         * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
2563         * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
2565         * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
2566         pushtag_top_level_maybe_friend,
2567         pushdecl_top_level_and_finish): Move declarations to ...
2568         * name-lookup.h: ... here.  Group pushdecl variants.
2569         (pushdecl_top_level_and_finish): Rename to ...
2570         (pushdecl_top_level_with_init): ... here.
2571         * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
2572         * decl2.c (get_guard, handle_tls_init): Likewise.
2573         * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
2574         * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
2575         * method.c (implicitly_declare_fn): Likewise.
2576         * searchc (node_debug_info_needed): Likewise.
2577         * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
2578         (pushdecl_top_level_with_init): ... here.
2579         (pop_everything): Use namespace_bindings_p.
2581         * name-lookup.h (pop_binding): Rename to pop_local_binding.
2582         (getdecls): Rename to get_local_decls.
2583         * name-lookup.c (pop_binding): Rename to ...
2584         (pop_local_binding): ... here.
2585         (pop_bindings_and_leave_scope): Adjust.
2586         (getdecls): Rename to ...
2587         (get_local_decls): ... here.  Assert local scope.
2588         * decl.c (poplevel): Assert not namespace.  Adjust and simplify
2589         logic.
2590         (store_parm_decls): Adjust get_local_decls call.
2591         (parser.c (synthesize_implicit_template_parm): Likewise.
2593 2017-05-11  Ville Voutilainen  <ville.voutilainen@gmail.com>
2595         PR c++/80682
2596         * method.c (is_trivially_xible): Reject void types.
2598 2017-05-10  Nathan Sidwell  <nathan@acm.org>
2600         * class.c (handle_using_decl): Always use OVL_CURRENT.
2601         (resolve_address_of_overloaded_function): Move iterator decl into
2602         for scope.  Don't strip anticipated decls here.
2604         * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
2605         printing.
2606         (print_candidates): Adjust.
2608         * cp-tree.h (build_new_function_call): Lose koenig_p arg.  Fix
2609         line breaking.
2610         * call.c (build_new_function_call): Lose koenig_p arg.  Remove
2611         koenig_p handling here.
2612         * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
2613         (tsubst_omp_clauses): Likewise.
2614         (do_class_deduction): Adjust buld_new_function_call calls.
2615         * semantics.c (finish_call_expr): Likewise.
2617 2017-05-10  Jason Merrill  <jason@redhat.com>
2619         * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
2620         (unify_type_mismatch, unify_parameter_pack_mismatch)
2621         (unify_ptrmem_cst_mismatch, unify_expression_unequal)
2622         (unify_parameter_pack_inconsistent, unify_inconsistency)
2623         (unify_vla_arg, unify_method_type_error, unify_arity)
2624         (unify_arg_conversion, unify_no_common_base)
2625         (unify_inconsistent_template_template_parameters)
2626         (unify_template_deduction_failure)
2627         (unify_template_argument_mismatch)
2628         (unify_overload_resolution_failure): Call unify_invalid.
2630         CWG 1847 - Clarifying compatibility during partial ordering
2631         * pt.c (more_specialized_fn): No order between two non-deducible
2632         parameters.
2634         * pt.c (dependent_type_p): Make sure we aren't called with
2635         global_type_node.
2637         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2638         * pt.c (convert_template_argument): Just return an argument pack.
2639         (coerce_template_parameter_pack, template_parm_to_arg)
2640         (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
2641         (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
2642         Don't set the type of a NONTYPE_ARGUMENT_PACK.
2643         * parser.c (make_char_string_pack, make_string_pack): Likewise.
2645 2017-05-10  Nathan Sidwell  <nathan@acm.org>
2647         * cp-tree.h (add_method, clone_function_decl): Change last arg to
2648         bool.
2649         * class.c (add_method): Change third arg to bool.  Adjust.
2650         (one_inheriting_sig, one_inherited_ctor): Adjust.
2651         (clone_function_decl): Change 2nd arg to bool.  Adjust.
2652         (clone_constructors_and_destructors): Adjust.
2653         * lambda.c (maybe_add_lambda_conv_op): Adjust.
2654         * method.c (lazily_declare_fn): Adjust.
2655         * pt.c (tsubst_decl, instantiate_template_1): Adjust.
2656         * semantics.c (finish_member_declaration): Adjust.
2658 2017-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
2660         PR c++/80145
2661         * decl.c (finish_function): To improve error recovery, change the
2662         logic for calling apply_deduced_return_type.
2664 2017-05-09  Jason Merrill  <jason@redhat.com>
2666         PR c++/80605 - __is_standard_layout and empty base
2667         * class.c (check_bases): Ignore empty bases.
2669         PR c++/70979 - literal class and closure types
2670         * class.c (finalize_literal_type_property): Handle closures
2671         specifically.
2672         (explain_non_literal_class): Likewise.
2674         PR c++/66297, DR 1684 - literal class and constexpr member fns
2675         * constexpr.c (is_valid_constexpr_fn): Only complain about
2676         non-literal enclosing class in C++11.
2677         * class.c (finalize_literal_type_property): Likewise.
2679 2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
2681         PR c++/80186
2682         * pt.c (tsubst_decl): Early return error_mark_node if
2683         grok_ctor_properties returns false.
2685 2017-05-09  Jason Merrill  <jason@redhat.com>
2687         PR c++/70167 - array prvalue treated as lvalue
2688         * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
2689         (enum fcl_t): New.
2690         * semantics.c (finish_compound_literal): Add fcl_context parameter.
2691         Only make a static variable for C99 syntax.
2692         * parser.c (cp_parser_postfix_expression): Pass it.
2693         * pt.c (tsubst_copy_and_build): Likewise.
2694         * call.c (extend_ref_init_temps): Set
2695         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2697 2017-05-09  Nathan Sidwell  <nathan@acm.org>
2699         * cp-lang.c (get_global_decls, cxx_pushdecl): New.
2700         (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
2701         * name-lookup.h (pushdecl_top_level): Declare.
2703 2017-05-08  Jason Merrill  <jason@redhat.com>
2705         PR c++/80178 - parameter passing for uncopyable classes
2706         * tree.c (type_has_nontrivial_copy_init): True for classes with only
2707         deleted copy/move ctors.
2708         (remember_deleted_copy, maybe_warn_parm_abi): New.
2709         * decl.c (require_complete_types_for_parms, check_function_type):
2710         Call maybe_warn_parm_abi.
2711         * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
2713 2017-05-08  Nathan Sidwell  <nathan@acm.org>
2715         * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
2716         (start_preparsed_function): Do decl pushing before setting
2717         current_funciton_decl and announcing it.
2719         * name-lookup.h (pushdecl_with_scope): Replace with ...
2720         (pushdecl_outermost_localscope): ... this.
2721         * name-lookup.c (pushdecl_with_scope): Replace with ...
2722         (pushdecl_outermost_localscope): ... this.
2723         (pushdecl_namespace_level): Adjust.
2724         * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
2725         * lambda.c (insert_capture_proxy): Likewise.
2727         * class.c (build_vtbl_initializer): Don't shadow outer variable
2728         with static var.
2730         Revert _binding -> _value change.
2731         * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
2732         (get_namespace_binding, set_global_binding): ... these.
2733         * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
2734         (get_namespace_binding, set_global_binding): ... these.
2735         (arg_assoc_namespace, pushdecl_maybe_friend_1,
2736         check_for_out_of_scope_variable, push_overloaded_decl_1,
2737         lookup_name_innermost_nonclass_level, push_namespace): Adjust.
2738         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
2739         SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
2740         * decl.c (poplevel): Adjust.
2741         * pt.c (make_constrained_auto): Likewise.
2743 2017-05-07  Volker Reichelt  <v.reichelt@netcologne.de>
2745         PR translation/80280
2746         * call.c (print_z_candidate): Fix quoting.
2748 2017-05-05  David Malcolm  <dmalcolm@redhat.com>
2750         * error.c (pedwarn_cxx98): Replace report_diagnostic
2751         with diagnostic_report_diagnostic.
2753 2017-05-05  Nathan Sidwell  <nathan@acm.org>
2755         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
2756         (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
2757         (IDENTIFIER_NAMESPACE_VALUE): Delete.
2758         * name-lookup.h (namespace_binding, set_namespace_binding): Replace
2759         with ...
2760         (get_namespace_value, set_global_value): ... these.
2761         (get_global_value_if_present, is_typename_at_global_scope): Delete.
2762         * decl.c (poplevel): Use get_namespace_value.
2763         (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
2764         * class.c (build_vtbl_initializer): Stash library decl in
2765         static var. Use IDENTIFIER_GLOBAL_VALUE.
2766         * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
2767         do_allocate_exception, do_free_exception, build_throw): Likewise.
2768         * init.c (throw_bad_array_new_length): Likewise.
2769         * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
2770         * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
2771         check_for_our_of_scope_variable, push_overloaded_decl_1): Use
2772         get_namespace_value.
2773         (set_namespace_binding_1): Rename to
2774         (set_namespace_binding): ... here.
2775         (set_global_value): New.
2776         (lookup_name_innermost_nonclass_level_1, push_namespace): Use
2777         get_namespace_value.
2778         * pt.c (listify): Use get_namespace_value.
2780         * call.c (make_temporary_var_for_ref_to_temp): Push decl into
2781         current scope.
2782         * lex.c (unqualified_name_lookup_error): Likewise.
2784         * class.c (alter_class): Use retrofit_lang_decl directly.
2785         * decl.c (push_local_name, dupliate_decls): Likewise.
2786         * semantics.c (omp_privatize_field): Likewise.
2788         Kill walk_namespaces.
2789         * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
2790         * decl.c (walk_namespaces_r, walk_namespaces): Delete.
2792         Kill per-namespace static_decls.
2793         * cp-tree.h (static_decls): Declare.
2794         (wrapup_globals_for_namespace,
2795         diagnose_inline_vars_for_namespace): Replace with ...
2796         (wrapup_namespace_globals): ... this.
2797         * decl.c (static_decls): Define.
2798         (wrapup_globals_for_namespace,
2799         diagnose_inline_vars_for_namespace): Replace with ...
2800         (wrapup_namespace_globals): ... this.
2801         (cxx_init_decl_processing): Initialize static_decls.
2802         * decl2.c (c_parse_final_cleanups): Adjust.
2803         * name-lookup.h (cp_binding_level): Remove static_decls member.
2804         * name-lookup.c (add_decl_to_level): Adjust.
2805         (begin_scope): Adjust.
2807 2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
2809         PR c++/71577
2810         * decl.c (reshape_init): Unconditionally return error_mark_node
2811         upon error about too many initializers.
2813 2017-05-04  Nathan Sidwell  <nathan@acm.org>
2815         * constraint.cc (diagnose_check_constraint): Fix %E thinko.
2817 2017-05-04  Martin Sebor  <msebor@redhat.com>
2819         PR translation/80280
2820         * call.c (print_z_candidate): Add missing quoting to %D and other
2821         like directives.
2822         (build_op_call_1): Same.
2823         * constraint.cc (diagnose_check_constraint): Same.
2824         * mangle.c (mangle_decl): Same.
2825         * name-lookup.c (cp_binding_level_debug): Same.
2826         (set_decl_namespace): Same.
2827         * parser.c (cp_parser_tx_qualifier_opt): Same.
2828         * pt.c (print_candidates_1): Same.
2829         (check_template_variable): Same.
2830         (tsubst_default_argument): Same.
2831         (most_specialized_partial_spec): Same.
2832         * semantics.c (omp_reduction_lookup): Same.
2833         * tree.c (check_abi_tag_redeclaration): Same.
2834         * typeck.c (comptypes): Same.
2835         * typeck2.c (abstract_virtuals_error_sfinae): Same.
2837 2017-05-04  Nathan Sidwell  <nathan@acm.org>
2839         More global trees.
2840         * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
2841         CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
2842         CPTI_INIT_LIST_IDENTIFIER.
2843         (global_namespace, global_type_node, global_identifier,
2844         anon_identifier, init_list_identifier): New.
2845         * decl.c (global_type_node, global_scope_name): Delete.
2846         (initialize_predefined_identifiers): Add new identifiers.
2847         (cxx_init_decl_processing): Adjust.
2848         * name-lookup.h (global_namespace, global_type_node): Delete.
2849         * name-lookup.c (global_namespace, anonymous_namespace_name,
2850         get_anonymous_namespace_name): Delete.
2851         (namespace_scope_ht_size, begin_scope, pushtag_1,
2852         push_namespace): Adjust,
2853         * call.c (type_has_extended_temps): Use init_list_identifier.
2854         * pt.c (listify): Likewise.
2856         * name-lookup.c: Reorder functions to make merging from modules
2857         branch simpler.
2859 2017-05-03  Jason Merrill  <jason@redhat.com>
2861         * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
2863 2017-05-03  Nathan Sidwell  <nathan@acm.org>
2865         * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
2866         along with #defines, to before name-lookup include.
2868 2017-05-02  Paolo Carlini  <paolo.carlini@oracle.com>
2870         * pt.c (is_auto_or_concept): Remove.
2871         (type_uses_auto_or_concept): Remove, unused.
2872         (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
2873         * parser.c (tree_type_is_auto_or_concept): Remove, unused.
2874         * cp-tree.h (is_auto_or_concept): Remove.
2876 2017-05-01  Xi Ruoyao  <ryxi@stu.xidian.edu.cn>
2878         PR c++/80038
2879         * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
2880         add pedigree operation and detach call here.
2881         * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
2882         cilk_cp_gimplify_call_params_in_spawned_fn.
2883         (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
2884         * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
2886 2017-04-29  Volker Reichelt  <v.reichelt@netcologne.de>
2888         * parser.c (cp_parser_member_declaration): Add fix-it hints for
2889         stray comma and missing semicolon at end of member declaration.
2891 2017-04-27  Volker Reichelt  <v.reichelt@netcologne.de>
2893         * parser.c (cp_parser_cast_expression): Add target type of cast to
2894         diagnostic.
2895         * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
2897 2017-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
2899         * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
2900         return type to bool.
2901         * cp-tree.h (grok_ctor_properties): Update.
2903 2017-04-26  Volker Reichelt  <v.reichelt@netcologne.de>
2905         * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
2906         information to diagnostic of invalid colon in nested-name-specifier.
2908 2017-04-25  Volker Reichelt  <v.reichelt@netcologne.de>
2910         * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
2911         diagnostic of invalid class/struct keyword after enum.
2913 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
2915         * parser.c (cp_parser_member_declaration): Add fix-it hint
2916         for removing stray semicolons.
2918 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
2920         * name-lookup.c (get_std_name_hint): New function.
2921         (maybe_suggest_missing_header): New function.
2922         (suggest_alternative_in_explicit_scope): Call
2923         maybe_suggest_missing_header.
2925 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
2927         PR c++/80177
2928         * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
2929         candidate type of bm from tree to const char *.
2930         (consider_binding_level): Likewise.
2931         (lookup_name_fuzzy): Likewise, using this to merge the best
2932         result from the preprocessor into bm, rather than immediately
2933         returning, so that better matches from reserved words can "win".
2934         Guard the rejection of keywords that don't start decl-specifiers
2935         so it only happens for FUZZY_LOOKUP_TYPENAME.
2937 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
2939         * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
2940         (start_enum): Likewise.
2941         (build_enumerator): Likewise. Use %qE instead of plain %E.
2942         * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
2943         %<%D%> in diagnostics.
2944         (cp_parser_elaborated_type_specifier): Likewise.
2945         * pt.c (make_pack_expansion): Use %qT and %qE instead of
2946         %<%T%> and %<%E%> in diagnostics.
2947         (tsubst_pack_expansion): Likewise.
2949 2017-04-24  David Malcolm  <dmalcolm@redhat.com>
2951         PR c++/80016
2952         * parser.c (cp_parser_unary_expression):  Generate a location
2953         range for alignof and sizeof expressions.
2955 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
2957         * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
2958         error message.
2959         (cp_parser_virt_specifier_seq_opt): Likewise.
2960         (set_and_check_decl_spec_loc): Likewise twice.
2962 2017-04-21  Jason Merrill  <jason@redhat.com>
2964         PR c++/80179 - ICE with initialized flexible array member.
2965         * constexpr.c (verify_ctor_sanity): Handle flexible array members.
2967 2017-04-21  Richard Biener  <rguenther@suse.de>
2969         * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
2970         (copy_type): Likewise.
2971         * lex.c (copy_decl): Pass down mem-stat info.
2972         (copy_type): Likewise.
2974 2017-04-20  Jonathan Wakely  <jwakely@redhat.com>
2976         PR c++/80473
2977         * init.c (build_new_1): Suppress notes about over-aligned new when
2978         the warning is suppressed.
2980 2017-04-20  Volker Reichelt  <v.reichelt@netcologne.de>
2982         * parser.c (cp_parser_member_declaration): Add warning with fixit
2983         information for extra semicolon after in-class function definition.
2985 2017-04-20  Jakub Jelinek  <jakub@redhat.com>
2987         PR middle-end/80423
2988         * tree.c (build_cplus_array_type): Call build_array_type
2989         with the intended TYPE_TYPELESS_STORAGE flag value, instead
2990         of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
2991         on the shared type.
2993 2017-04-18  Marek Polacek  <polacek@redhat.com>
2995         PR c++/80244 - ICE with attribute in template alias.
2996         * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
2998         PR c++/80241 - ICE with alignas pack expansion.
2999         * error.c (dump_expr): Handle TREE_LIST.
3000         * parser.c (cp_parser_std_attribute_list): Return error_mark if
3001         make_pack_expansion returns an error.
3003 2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>
3005         PR c++/80287
3006         * class.c (fixup_may_alias): Fix all type variants.
3008 2017-04-17  Jason Merrill  <jason@redhat.com>
3010         PR c++/80415 - wrong error with default arg and array reference.
3011         * tree.c (lvalue_kind): Return clk_class for an array prvalue.
3013         * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
3015 2017-04-15  Alexandre Oliva <aoliva@redhat.com>
3017         * decl.c (name_unnamed_type): Split out of...
3018         (grokdeclarator): ... this.
3019         * decl.h (name_unnamed_type): Declare.
3021 2017-04-12  Richard Biener  <rguenther@suse.de>
3022         Bernd Edlinger  <bernd.edlinger@hotmail.de>
3024         PR middle-end/79671
3025         * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
3026         for arrays of character or std::byte type.
3028 2017-04-11  Jason Merrill  <jason@redhat.com>
3030         PR c++/80294 - ICE with constexpr and inheritance.
3031         * constexpr.c (reduced_constant_expression_p):
3032         A null constructor element is non-constant.
3033         (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
3034         returning an empty base.
3036 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
3038         PR c++/80370
3039         * decl.c (cp_finish_decomp): If processing_template_decl on
3040         non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
3041         change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
3042         sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
3043         processing.
3044         * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
3045         with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
3046         dependent.
3048 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
3050         PR c++/80363
3051         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
3053 2017-04-10  Jakub Jelinek  <jakub@redhat.com>
3055         PR c++/80176
3056         * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
3057         operand, if it is a static member function, recurse on the
3058         BASELINK.
3060 2017-04-10  Marek Polacek  <polacek@redhat.com>
3062         PR sanitizer/80348
3063         * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
3064         ORIG_TYPE earlier and not only when shortening.
3066 2017-04-07  Jason Merrill  <jason@redhat.com>
3068         PR c++/80356 - ICE with reference to function template argument.
3069         PR c++/79294
3070         * pt.c (convert_nontype_argument_function): Adjust type even with a
3071         value-dependent argument.
3073         PR c++/80267 - ICE with nested capture of reference
3074         PR c++/60992
3075         * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
3077 2017-04-07  Marek Polacek  <polacek@redhat.com>
3079         PR sanitizer/80348
3080         * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
3082         PR c++/80095
3083         * call.c (build_over_call): Don't check cxx_dialect.
3084         * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
3085         whether SUB is a CONSTRUCTOR.
3086         * init.c (build_new_1): Don't check cxx_dialect.
3087         * tree.c (replace_placeholders): Add a function comment.  Return if
3088         not in C++14, or if the object isn't a (member of a) class.
3089         * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
3090         TYPE is CLASS_TYPE_P.
3092 2017-04-05  Jakub Jelinek  <jakub@redhat.com>
3094         PR c++/80309
3095         * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
3096         of a loop doing vec_safe_push of NULL.  Formatting fixes.
3097         (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
3098         to newidx before calling canonical_type_parameter on newtype.
3100 2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
3102         PR c++/80296
3103         * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
3104         UNARY_PLUS_EXPR case.
3106 2017-04-03  Jason Merrill  <jason@redhat.com>
3108         * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
3110 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
3112         * class.c (update_vtable_entry_for_fn): Fix typo in comment.
3113         * decl2.c (one_static_initialization_or_destruction): Likewise.
3114         * name-lookup.c (store_bindings): Likewise.
3115         * parser.c (make_call_declarator): Likewise.
3116         * pt.c (check_explicit_specialization): Likewise.
3118 2017-04-03  Jason Merrill  <jason@redhat.com>
3120         PR sanitizer/79993 - ICE with VLA initialization from string
3121         PR c++/69487 - wrong VLA initialization from string
3122         * init.c (finish_length_check): Split out from build_vec_init.
3123         (build_vec_init): Handle STRING_CST.
3124         * typeck2.c (split_nonconstant_init): Handle STRING_CST.
3125         (digest_init_r): Don't give a STRING_CST VLA type.
3127 2017-03-31  Jakub Jelinek  <jakub@redhat.com>
3129         PR c++/79572
3130         * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
3131         REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
3132         for NOP_EXPR to REFERENCE_TYPE.
3134         PR libstdc++/80251
3135         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
3136         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3137         CPTK_IS_AGGREGATE.
3138         * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
3139         Remove extraneous parens.
3140         (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
3141         * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
3142         (cp_parser_trait_expr): Likewise.
3144 2017-03-27  Jakub Jelinek  <jakub@redhat.com>
3146         PR middle-end/80162
3147         * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
3148         * typeck.c (cxx_mark_addressable): Likewise.  Look through
3149         VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
3150         to ARRAY_TYPE.
3151         (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
3153 2017-03-24  Jason Merrill  <jason@redhat.com>
3155         PR c++/77339 - ICE with invalid use of alias template.
3156         * pt.c (lookup_template_class_1): Don't try to enter the scope of an
3157         alias template.
3159 2017-03-24  Marek Polacek  <polacek@redhat.com>
3161         PR c++/80119
3162         * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
3163         doesn't have side effects.
3165 2017-03-23  Jason Merrill  <jason@redhat.com>
3167         PR c++/80150 - ICE with overloaded variadic deduction.
3168         * pt.c (try_one_overload): Remove asserts.
3170         PR c++/77563 - missing ambiguous conversion error.
3171         * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
3173 2017-03-23  Marek Polacek  <polacek@redhat.com>
3175         * cp-tree.h: Remove a C_RID_YYCODE reference.
3177 2017-03-22  Jakub Jelinek  <jakub@redhat.com>
3179         PR c++/80141
3180         * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
3181         case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
3182         processing_template_decl.
3184 2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
3186         PR c++/77752
3187         * name-lookup.c (pushtag_1): Add check for bogus, non template,
3188         std::initializer_list.
3190 2017-03-21  Jakub Jelinek  <jakub@redhat.com>
3192         PR c++/35878
3193         * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
3195 2017-03-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
3197         PR c++/35878
3198         * init.c (std_placement_new_fn_p): New.
3199         (build_new_1): Call it.
3201 2017-03-20  Jason Merrill  <jason@redhat.com>
3203         PR c++/80096 - ICE with C++17 non-type auto.
3204         * pt.c (tsubst): Delay tsubst of type of template non-type
3205         parameter.
3207         PR c++/79519 - ICE with deleted template friend.
3208         * decl.c (grokdeclarator): Complain about misplaced function
3209         definition using =, as well.
3211         PR c++/79640 - infinite recursion with generic lambda.
3212         * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
3213         before substituting its initializer.
3215 2017-03-20  Marek Polacek  <polacek@redhat.com>
3216             Paolo Carlini  <paolo.carlini@oracle.com>
3218         PR c++/80059 - ICE with noexcept and __transaction_atomic
3219         * except.c (build_must_not_throw_expr): Call
3220         instantiate_non_dependent_expr.
3222 2017-03-19  Jason Merrill  <jason@redhat.com>
3224         PR c++/80084 - wrong C++17 decomposition by reference of parameter.
3225         * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
3226         reference decomposition.
3228         PR c++/80077 - error with constexpr and -fno-elide-constructors.
3229         * constexpr.c (cxx_eval_call_expression): Set ctx->call while
3230         expanding trivial constructor.
3232 2017-03-17  Jason Merrill  <jason@redhat.com>
3234         PR c++/78345 - ICE initializing array from lambda.
3235         * init.c (build_aggr_init): Check array initializer.
3236         (build_vec_init): Check the type of a CONSTRUCTOR.
3238         PR c++/80073 - C++17 ICE with virtual base.
3239         * decl.c (xref_basetypes): Also check for indirect vbases.
3241 2017-03-16  Jason Merrill  <jason@redhat.com>
3243         * decl.c (start_enum): std::byte aliases anything.
3245         PR c++/79797
3246         * constexpr.c (lookup_placeholder): Tweak.
3248 2017-03-15  Jason Merrill  <jason@redhat.com>
3250         PR c++/80043 - ICE with -fpermissive
3251         * typeck.c (convert_for_assignment): Handle instantiate_type
3252         not giving an error.
3254 2017-03-14  Nathan Sidwell  <nathan@acm.org>
3256         PR c++/79393 DR 1658 workaround
3257         * method.c (synthesized_method_base_walk): Inihibit abstract class
3258         virtual base access check here.
3259         (synthesized_method_walk): Not here.
3261 2017-03-13  Nathan Sidwell  <nathan@acm.org>
3263         PR c++/79393 DR 1658 workaround
3264         * method.c (synthesized_method_walk): Check vbases of abstract
3265         classes for dtor walk.
3267 2017-03-10  David Malcolm  <dmalcolm@redhat.com>
3269         PR translation/79848
3270         * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
3272 2017-03-10  Jason Merrill  <jason@redhat.com>
3274         PR c++/79960 - alias templates and partial ordering
3275         * pt.c (comp_template_args): Add partial_order parm.
3276         (template_args_equal): Likewise.
3277         (comp_template_args_porder): New.
3278         (get_partial_spec_bindings): Use it.
3280 2017-03-10  Marek Polacek  <polacek@redhat.com>
3282         PR c++/79967
3283         * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
3285 2017-03-10  Jakub Jelinek  <jakub@redhat.com>
3287         PR c++/79899
3288         * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
3289         Use XALLOCAVEC macro.
3291         PR c++/79896
3292         * decl.c (finish_enum_value_list): If value is error_mark_node,
3293         don't copy it and change its type.
3294         * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
3295         of CONST_DECL is error_mark_node.
3297 2017-03-09  Marek Polacek  <polacek@redhat.com>
3299         PR c++/79900 - ICE in strip_typedefs
3300         * tree.c (strip_typedefs): Skip the attribute handling if T is
3301         a variant type which hasn't been updated yet.
3303         PR c++/79687 - wrong code with pointer-to-member
3304         * init.c (constant_value_1): Break if the variable has a dynamic
3305         initializer.
3307 2017-03-08  Jason Merrill  <jason@redhat.com>
3309         PR c++/79797 - ICE with self-reference in array DMI.
3310         * constexpr.c (lookup_placeholder): Split out...
3311         (cxx_eval_constant_expression): ...from here.
3313 2017-03-07  Jakub Jelinek  <jakub@redhat.com>
3315         PR c/79834
3316         * parser.c (cp_parser_omp_cancellation_point,
3317         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
3318         cp_parser_omp_target_update): Change "may only be used in compound
3319         statements" diagnostics, such that the same translatable string is
3320         used for all pragmas.
3321         (cp_parser_pragma): Likewise.  Use error_at instead of
3322         cp_parser_error for that diagnostics.
3324 2017-03-06  Marek Polacek  <polacek@redhat.com>
3326         PR c++/79796 - ICE with NSDMI and this pointer
3327         * call.c (build_over_call): Handle NSDMI with a 'this' by calling
3328         replace_placeholders.
3330 2017-03-06  Jakub Jelinek  <jakub@redhat.com>
3332         PR c++/79822
3333         * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
3334         ({ (void) 0; }).
3336 2017-03-06  Jason Merrill  <jason@redhat.com>
3338         Revert "Allow deduction guides to look into primary template."
3339         * cp-tree.h, parser.c, pt.c, search.c: Revert.
3341 2017-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
3343         PR c++/70266
3344         * except.c (build_must_not_throw_expr): Perform the implicit
3345         conversions on the condition.
3347 2017-03-03  Jason Merrill  <jason@redhat.com>
3349         * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
3350         -Wc++1z-compat.
3352         Core issues 2273 and 2277
3353         * call.c (joust): Adjust using-declaration tiebreaker to handle
3354         the intermediate base case.
3355         * method.c (strip_inheriting_ctors): Just return the argument if
3356         !flag_new_inheriting_ctors.
3358 2017-03-03  Richard Biener  <rguenther@suse.de>
3360         PR c++/79825
3361         * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
3363 2017-03-03  Marek Polacek  <polacek@redhat.com>
3365         PR c++/79791
3366         * typeck.c (string_conv_p): In C++11, always call pedwarn with
3367         OPT_Wwrite_strings.
3369 2017-03-02  Jason Merrill  <jason@redhat.com>
3371         Update overload resolution with deduction guides.
3372         * pt.c (do_class_deduction): Always build the copy guide.
3373         (copy_guide_p, template_guide_p): New.
3374         (build_deduction_guide): Remember the original constructor.
3375         * call.c (joust): Prefer the copy guide and non-template guides.
3377         Allow deduction guides to look into primary template.
3378         * cp-tree.h (struct saved_scope): Add deduction_guide_type.
3379         (struct cp_decl_specifier_seq): Add constructor_p.
3380         * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
3381         (cp_parser_init_declarator): Check it.  Set ctor_dtor_or_conv_p.
3382         Clear deduction_guide_type.  Don't handle deduction guide names.
3383         (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
3384         (cp_parser_direct_declarator): Likewise.  Handle deduction guides.
3385         (cp_parser_member_declaration, cp_parser_cache_defarg)
3386         (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
3387         * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
3388         (build_deduction_guide): Set deduction_guide_type.
3389         (dependent_scope_p): Check deduction_guide_type.
3390         * search.c (lookup_member): Likewise.
3392 2017-03-02  Jakub Jelinek  <jakub@redhat.com>
3394         PR c++/79782
3395         * init.c (mark_exp_read_r): New function.
3396         (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
3397         whole arguments instead of plain mark_exp_read on TREE_LIST values.
3399 2017-03-01  Jason Merrill  <jason@redhat.com>
3401         Class template argument deduction in new-expression
3402         * init.c (build_new): Handle deduction from no initializer.
3403         * parser.c (cp_parser_new_expression): Don't require a single
3404         expression for class template deduction.
3405         * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
3406         class template placeholder.
3407         * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
3408         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
3409         (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
3411 2017-03-01  Jakub Jelinek  <jakub@redhat.com>
3413         PR c++/79746
3414         * init.c (emit_mem_initializers): When not constructing vbases of
3415         abstract classes, mark arguments as read for
3416         -Wunused-but-set-parameter.
3418 2017-02-28  Jason Merrill  <jason@redhat.com>
3420         Class template argument deduction refinements
3421         * call.c (joust): Move deduction guide tiebreaker down.
3422         * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
3423         deduction with no initializer.
3424         * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
3425         (do_class_deduction): Use that rather than special case.
3426         (do_auto_deduction): Handle null initializer.
3428 2017-02-28  Jakub Jelinek  <jakub@redhat.com>
3430         * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
3431         instead of just cond ? "..." : "...".
3432         (grokdeclarator): Likewise.
3433         (build_enumerator): Likewise.
3434         * init.c (build_new_1): Likewise.
3435         * call.c (build_new_method_call_1): Likewise.
3436         * parser.c: Include intl.h.
3437         (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
3438         "enter"/"exit" keyword.
3439         (cp_finalize_oacc_routine): Don't use %s to supply portions of the
3440         message.
3442 2017-02-27  Jason Merrill  <jason@redhat.com>
3444         PR c++/71568 - SFINAE forming pointer to member function
3445         * init.c (build_offset_ref): Check the return value of
3446         perform_or_defer_access_check.
3448 2017-02-27  Marek Polacek  <polacek@redhat.com>
3450         * decl.c (expand_static_init): Add missing } in a comment.
3452 2017-02-27  Volker Reichelt  <v.reichelt@netcologne.de>
3454         * init.c: Include intl.h.
3455         (build_new_1): Move message strings into pedwarn to make them
3456         -Wformat-security friendly. Mark string for translation.
3457         * pt.c (tsubst_copy_and_build): Mark string for translation.
3458         Make the pointer const.
3459         * semantics.c (finish_id_expression): Mark strings for translation.
3461 2017-02-25  Jakub Jelinek  <jakub@redhat.com>
3463         * call.c (build_op_delete_call): Make msg1 and msg2 const.
3465 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
3467         PR c++/79588
3468         * call.c (build_over_call): Call check_function_arguments even for
3469         -Wrestrict, adjust check_function_arguments caller.
3470         * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
3471         here.
3472         * typeck.c (cp_build_function_call_vec): Adjust
3473         check_function_arguments caller.
3475 2017-02-24  Marek Polacek  <polacek@redhat.com>
3477         PR translation/79705
3478         * decl.c (check_redeclaration_exception_specification): Mark a string
3479         for translation.  Make the pointer const.
3481 2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>
3483         PR c++/79361
3484         * pt.c (register_specialization): Check duplicate_decls return value
3485         for error_mark_node and pass it back.
3487 2017-02-22  Jason Merrill  <jason@redhat.com>
3489         PR c++/79679 - missing destructor for argument
3490         * call.c (build_over_call): Don't pass tf_no_cleanup to argument
3491         conversions.
3493         * pt.c (do_class_deduction): Handle 0 argument case.
3495 2017-02-22  Jakub Jelinek  <jakub@redhat.com>
3497         PR c++/79664
3498         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
3499         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
3500         * constexpr.c (potential_constant_expression_1): Handle
3501         OMP_*, OACC_* and CILK_* trees.  Use error_at with
3502         EXPR_LOC_OR_LOC (t, input_location) computed early
3503         instead of error, or error_at with location_of (t).
3505 2017-02-22  Marek Polacek  <polacek@redhat.com>
3507         PR c++/79653
3508         * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
3509         if the alignas expression is erroneous.
3510         * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
3511         error_mark_node.
3513         PR c++/79657
3514         * semantics.c (finish_underlying_type): Bail out for incomplete enums.
3516 2017-02-21  Jason Merrill  <jason@redhat.com>
3518         PR c++/50308 - wrong deprecated warning with ADL
3519         PR c++/17729 - duplicate deprecated warning
3520         * semantics.c (finish_id_expression): Only call mark_used on a
3521         function if we aren't building a call.
3523         PR c++/41727 - ICE with partial spec of partial instantiation
3524         * pt.c (process_partial_specialization): For now, don't check more
3525         specialized if there is more than one level of args.
3527 2017-02-21  Marek Polacek  <polacek@redhat.com>
3529         PR c++/79535
3530         * cp-tree.h (maybe_reject_flexarray_init): Declare.
3531         * init.c (maybe_reject_flexarray_init): No longer static.
3532         Add check for current_function_decl.
3533         * parser.c (cp_parser_late_parse_one_default_arg): Reject
3534         a default mem-initializer for a flexible array.
3536 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
3537             Paolo Carlini  <paolo.carlini@oracle.com>
3539         PR c++/79654
3540         * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
3541         on error.
3542         * pt.c (tsubst_decomp_names): Return error_mark_node if the first
3543         decl after the decomposition artificial decl has error_mark_node.
3544         * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
3545         instead of just == error_mark_node comparison.
3547 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
3549         PR sanitizer/79589
3550         * decl.c: Include gimplify.h.
3551         (cp_finish_decomp): Make sure there is no sharing of trees
3552         in between DECL_VALUE_EXPR of decomposition decls.
3554         PR c++/79655
3555         * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
3557         PR c++/79639
3558         * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
3559         call cplus_expand_constant on it first.
3561 2017-02-19  Jason Merrill  <jason@redhat.com>
3563         PR c++/78139 - destructor needed by new-expression
3564         * call.c (build_special_member_call): Use tf_no_cleanup.
3566         PR c++/78282 - auto template and pack expansion
3567         * pt.c (find_parameter_packs_r): Don't walk into the type of
3568         templates other than template template-parameters.
3570         PR c++/79606 - ICE with this->base_member in NSDMI
3571         * class.c (build_base_path): Check processing_template_decl.
3573         PR c++/79607 - ICE with T{} initializer
3574         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
3576         PR c++/79566 - elaborated-type-specifier in range for
3577         * parser.c (cp_parser_simple_declaration): Fix check for type
3578         definition.
3580         PR c++/79400 - confusing suggestion of 'noexcept'
3581         * parser.c (cp_parser_exception_specification_opt): Remove
3582         suggestion for deprecated dynamic exception-specification.
3584         PR c++/79470 - partial ordering with reference parameters
3585         * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
3587         PR c++/79500 - ICE with non-template deduction guide
3588         * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
3589         DECL_TEMPLATE_RESULT.
3591         PR c++/79580 - ICE with compound literal
3592         * parser.c (cp_parser_class_head): If we're in the middle of an
3593         expression, use ts_within_enclosing_non_class.
3595         PR c++/79503 - inherited ctor taking base class
3596         * call.c (add_function_candidate): Also check that
3597         DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
3599 2017-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
3601         PR c++/79380
3602         * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
3603         argument.
3605 2017-02-19  Eric Fiselier  <eric@efcs.ca>
3606             Jonathan Wakely  <jwakely@redhat.com>
3608         PR c++/69523
3609         * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
3610         control warning about literal suffix identifiers without a leading
3611         underscore.
3613 2017-02-17  Jason Merrill  <jason@redhat.com>
3615         PR c++/79508 - lookup error with member template
3616         * parser.c (cp_parser_template_name): Clear
3617         parser->context->object_type if we aren't doing lookup.
3619         PR c++/78690 - ICE with using and global type with same name
3620         * pt.c (type_dependent_object_expression_p): True for
3621         IDENTIFIER_NODE.
3623         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3624         * pt.c (convert_template_argument): Just return an auto arg pack.
3625         (tsubst_template_args): Don't tsubst an auto pack type.
3627         PR c++/79556 - C++17 ICE with non-type auto
3628         * pt.c (do_auto_deduction): Don't try to deduce from null type.
3630         PR c++/79533 - C++17 ICE with temporary cast to reference
3631         * call.c (build_over_call): Conversion to a reference prevents copy
3632         elision.
3634 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
3635             Jason Merrill  <jason@redhat.com>
3637         PR c++/79502 - lost nodiscard attribute
3638         * pt.c (apply_late_template_attributes): Do apply non-dependent
3639         attributes to types.
3641 2017-02-16  Jason Merrill  <jason@redhat.com>
3643         PR c++/78572 - ICE with self-modifying array initializer
3644         * constexpr.c (cxx_eval_store_expression): The object we're
3645         initializing is outside the constant-expression.
3646         (cxx_eval_call_expression): Set ctx->call.
3648         PR c++/79050 - ICE with undeduced auto and LTO
3649         * decl.c (poplevel): Remove undeduced auto decls.
3651 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
3653         PR c++/79512
3654         * parser.c (cp_parser_omp_target): For -fopenmp-simd
3655         ignore #pragma omp target even when not followed by identifier.
3657 2017-02-15  Jason Merrill  <jason@redhat.com>
3658             Jakub Jelinek  <jakub@redhat.com>
3660         PR c++/79464 - ICE in IPA with omitted constructor parms
3661         * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
3662         (adjust_clone_args): Adjust.
3663         (add_method): Remember omitted parms.
3664         * call.c (add_function_candidate): Likewise.
3665         * mangle.c (write_method_parms): Likewise.
3666         * method.c (ctor_omit_inherited_parms): Return false if there are no
3667         parms to omit.
3669 2017-02-15  Martin Sebor  <msebor@redhat.com>
3671         PR c++/79363
3672         * init.c (maybe_reject_flexarray_init): New function.
3673         (perform_member_init): Call it.
3675 2017-02-15  Jakub Jelinek  <jakub@redhat.com>
3677         PR c++/79301
3678         * parser.c (cp_parser_std_attribute): Don't pedwarn about
3679         [[deprecated]] with -std=c++11 and [[fallthrough]] with
3680         -std=c++11 and -std=c++14.
3682         PR c++/79288
3683         * decl.c (grokdeclarator): For static data members, handle thread_p
3684         only after handling inline.
3686 2017-02-14  Marek Polacek  <polacek@redhat.com>
3688         PR c++/79420
3689         PR c++/79463
3690         * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
3691         clobbering if the postfix expression isn't an EXPR_P.
3693 2017-02-13  Jason Merrill  <jason@redhat.com>
3695         PR c++/79461 - ICE with lambda in constexpr constructor
3696         * constexpr.c (build_data_member_initialization): Ignore
3697         initialization of a local variable.
3699 2017-02-13  Jakub Jelinek  <jakub@redhat.com>
3701         * init.c (warn_placement_new_too_small): Add missing space in
3702         diagnostics.
3703         * parser.c (cp_parser_oacc_declare): Likewise.
3704         * mangle.c (maybe_check_abi_tags): Likewise.
3706         PR c++/79232
3707         * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
3708         on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
3709         in the rightmost operand.
3711 2017-02-13  Nathan Sidwell  <nathan@acm.org>
3713         PR c++/79296 - ICE mangling localized template instantiation
3714         * decl2.c (determine_visibility): Use template fn context for
3715         local class instantiations.
3717 2017-02-11  Jason Merrill  <jason@redhat.com>
3719         PR c++/77659 - ICE with new and C++14 aggregate NSDMI
3720         * init.c (build_new): Make backups of any CONSTRUCTORs in init.
3721         (build_new_1): Use replace_placeholders.
3722         * tree.c (replace_placeholders_t): Also track whether we've seen a
3723         placeholder.
3724         (replace_placeholders, replace_placeholders_r): Adjust.
3725         * cp-tree.h: Adjust.
3727         PR c++/77790 - ICE with auto function in C++11 mode
3728         * decl.c (undeduced_auto_decl): Remove C++14 limitation.
3729         (require_deduced_type): Add complain parm, return bool.
3730         * cp-tree.h: Adjust.
3731         * decl2.c (mark_used): Use require_deduced_type.
3733 2017-02-10  Jason Merrill  <jason@redhat.com>
3735         PR c++/78908 - template ops and bitfields
3736         * tree.c (build_min_non_dep): Use unlowered_expr_type.
3738         PR c++/78897 - constexpr union
3739         * constexpr.c (cxx_eval_store_expression): A store to a union member
3740         erases a previous store to another member.
3742         PR c++/71285 - member of fold-expression
3743         * semantics.c (finish_unary_fold_expr)
3744         (finish_binary_fold_expr): Use null type for fold-expressions.
3746         PR c++/79401 - protected inherited constructor
3747         * call.c (enforce_access): For inheriting constructor, find a base
3748         binfo in the path we already have.
3750 2017-02-10  Marek Polacek  <polacek@redhat.com>
3752         PR c++/79435
3753         * pt.c (type_dependent_expression_p): Check if the expression type
3754         is null.
3756         PR c++/79184
3757         * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
3758         if warnings shouldn't be given.
3760 2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
3762         PR c++/71737
3763         * pt.c (tsubst_decl): Don't try to preserve a typedef that names
3764         an error_mark_node as type.
3766 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
3767             Jason Merrill  <jason@redhat.com>
3769         PR c++/79143
3770         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
3771         from pattern to type.
3773 2017-02-09  Jason Merrill  <jason@redhat.com>
3775         PR c++/79316 - default argument in deduction guide
3776         PR c++/79350 - explicit deduction guide
3777         * parser.c (cp_parser_constructor_declarator_p)
3778         (cp_parser_direct_declarator): Parse deduction guides more like
3779         constructors.
3780         * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
3781         * tree.c (special_function_p): Return it.
3782         * decl.c (check_special_function_return_type): Handle it.
3783         (grokdeclarator, grokfndecl): Adjust.
3784         (cp_finish_decl): Pass flags to do_auto_deduction.
3785         * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
3786         * pt.c (dguide_name_p): Take a const_tree.
3787         (do_class_deduction): Handle explicit.
3788         (do_auto_deduction): Pass flags through.
3789         (build_deduction_guide): Copy explicit flag.
3791 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
3793         PR c++/79429
3794         * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
3795         non-pragma_compound context here.
3796         (cp_parser_omp_target): Likewise.
3797         (cp_parser_pragma): Don't call push_omp_privatization_clauses and
3798         parsing for ordered and target omp pragmas in non-pragma_stmt
3799         non-pragma_compound contexts.
3801         PR c/79431
3802         * parser.c (cp_parser_oacc_declare): Formatting fix.
3803         (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
3804         automatic variables.
3806 2016-02-09  Nathan Sidwell  <nathan@codesourcery.com>
3807             Chung-Lin Tang  <cltang@codesourcery.com>
3809         * parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
3810         parsing.  Parse constant expression. Remove semantic checking.
3811         (cp_parser_omp_clause_collapse): Disallow tile.
3812         (cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
3813         error about missing for after already emitting one.  Use more
3814         conventional for idiom for unbounded loop.
3815         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
3816         * semantics.c (finish_omp_clauses): Correct TILE semantic check.
3817         (finish_omp_for): Deal with tile clause.
3819 2017-02-07  Nathan Sidwell  <nathan@acm.org>
3821         * method.c (synthesized_method_base_walk): New.  Broken out of ...
3822         (synthesized_method_walk): ... here.  Call it.  Cleanup
3823         initializations.
3825 2017-02-07  Patrick Palka  <ppalka@gcc.gnu.org>
3827         PR c++/79360
3828         * typeck2.c (process_init_constructor_union): Consider only
3829         FIELD_DECLs when looking for an NSDMI.
3831 2017-02-06  Jason Merrill  <jason@redhat.com>
3833         PR c++/71193 - incomplete types in templates
3834         * parser.c (cp_parser_postfix_dot_deref_expression): In a template
3835         handle incomplete type by pedwarning and then treating as dependent.
3837 2017-02-06  Jakub Jelinek  <jakub@redhat.com>
3839         PR c++/79379
3840         * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
3841         (potential_constant_expression_1): Likewise.
3843         PR c++/79377
3844         * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
3845         allow one fewer than expected arguments if flag_permissive.
3847         PR c++/79372
3848         * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
3849         * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
3850         with error_mark_node type.
3852 2017-02-03  Jason Merrill  <jason@redhat.com>
3854         PR c++/78689 - ICE on constructor with label
3855         * optimize.c (maybe_clone_body): Replace omitted parameters with
3856         null lvalues.
3857         * class.c (build_clone): Fix logic for omitting inherited parms.
3859         PR c++/12245 - excessive memory use
3860         * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
3861         back in.  Don't cache constants.
3862         (maybe_constant_init): Don't cache constants.
3864         PR c++/79294 - ICE with invalid template argument
3865         * pt.c (convert_nontype_argument_function): Check value-dependence.
3866         (convert_nontype_argument): Don't check it here for function ptrs.
3868 2017-02-02  Richard Biener  <rguenther@suse.de>
3870         PR cp/14179
3871         * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
3872         it lazily on the first changed element only and copy it
3873         fully upfront, only storing changed elements.
3875 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
3877         PR c++/69637
3878         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
3879         to the width.
3881 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
3883         PR c++/79304
3884         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
3885         after ARROW_EXPR.
3887 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
3889         PR c++/79298
3890         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
3891         any namespace aliases.
3893 2017-01-31  Nathan Sidwell  <nathan@acm.org>
3895         PR c++/79290
3896         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
3898         PR c++/67273
3899         PR c++/79253
3900         * pt.c: (instantiate_decl): Push to top level when current
3901         function scope doesn't match.  Only push lmabda scope stack when
3902         pushing to top.
3904         * cp-tree.h (instantiate_decl): Make defer_ok bool.
3905         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
3906         (instantiate_decl): Simplify and reorder state saving and restoration.
3908         PR c++/79264
3909         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
3910         * semantics.c (finish_member_declaration): Assert class is being
3911         defined.
3913 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
3915         Introduce C++ support in libcc1.
3916         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
3917         (ansi_opname): Rename to...
3918         (cp_operator_id): ... this.  Adjust all callers.
3919         (ansi_assopname): Rename to...
3920         (cp_assignment_operator_id): ... this.  Adjust all callers.
3921         (cp_literal_operator_id): Declare.
3922         (set_global_friend): Declare.
3923         (is_global_friend): Declare.
3924         (enum cp_oracle_request): New type.
3925         (cp_binding_oracle_function): New type.
3926         (cp_binding_oracle): Declare.
3927         (cp_finish_injected_record_type): Declare.
3928         * friend.c (global_friend): New var.
3929         (set_global_friend): New fn.
3930         (is_global_friend): New fn.
3931         (is_friend): Call is_global_friend.
3932         * name-lookup.c (cp_binding_oracle): New var.
3933         (query_oracle): New fn.
3934         (qualified_lookup_using_namespace): Call query_oracle.
3935         (lookup_name_real_1): Likewise.
3936         * parser.c (cp_literal_operator_id): Drop static.
3937         * search.c (friend_accessible_p): Call is_global_friend.
3938         * semantics.c (is_this_parameter): Accept a variable if the
3939         binding oracle is enabled.
3941 2017-01-27  Jason Merrill  <jason@redhat.com>
3943         PR c++/78771 - ICE with inherited constructor.
3944         * call.c (build_over_call): Call deduce_inheriting_ctor here.
3945         * pt.c (tsubst_decl): Not here.
3946         * class.c (add_method): Or here.
3947         * method.c (deduce_inheriting_ctor): Handle clones.
3948         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
3950 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
3952         PR c++/64382
3953         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
3954         New function.
3955         * cp/cp-tree.h: Declare it.
3956         * cp/semantics.c (finish_id_expression): Resolve names within a default
3957         capturing generic lambda defined within a template prior to
3958         instantiation to allow for captures to be added to the closure type.
3960 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
3962         PR c++/68727
3963         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
3964         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
3965         * parser.c (cp_parser_builtin_offsetof): Pass result of
3966         build_static_cast of null_pointer_node to finish_offsetof.
3967         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
3968         it for -Winvalid-offsetof pedwarn instead of trying to guess
3969         original offsetof type from EXPR.  Save OBJECT_PTR as a new
3970         second operand to OFFSETOF_EXPR.
3971         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
3972         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
3973         as OBJECT_PTR.
3975 2017-01-26  Jason Merrill  <jason@redhat.com>
3977         * name-lookup.c (parse_using_directive): Deprecate strong using.
3979         PR c++/79176 - lambda ICE with -flto -Os
3980         * decl2.c (vague_linkage_p): Handle decloned 'tors.
3981         * tree.c (decl_linkage): Likewise.
3983 2017-01-25  Martin Sebor  <msebor@redhat.com>
3985         * decl.c (grokdeclarator): Fix a typo in a comment.
3987 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
3989         PR c++/78896
3990         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
3991         lambda expressions.
3993         PR c++/77914
3994         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
3995         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
3997 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
3999         PR lto/79061
4000         * decl.c (cxx_init_decl_processing): Pass main_input_filename
4001         to build_translation_unit_decl.
4003 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
4005         PR c++/79205
4006         * cp-gimplify.c (cp_genericize_r): Add result of
4007         convert_from_reference on invisiref parm to p_set.
4009 2017-01-24  Nathan Sidwell  <nathan@acm.org>
4011         PR c++/78469 - defaulted ctor and inaccessible dtor
4012         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
4013         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
4014         * tree.c (build_target_expr): Check tf_no_cleanup.
4016         PR c++/79118 - anon-members and constexpr
4017         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
4018         ctor decl.  Recursively check anonymous members.
4019         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
4020         call.
4021         (explain_invalid_constexpr_fn): Likewise.
4023 2017-01-23  Nathan Sidwell  <nathan@acm.org>
4025         PR c++/71710 - template using directive of field
4026         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
4027         check earlier.
4029         PR c++/71406 - ICE with scope-ref'd template id exprs
4030         PR c++/77508
4031         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
4032         before breaking up TEMPLATE_ID_EXPR.
4034 2017-01-20  Nathan Sidwell  <nathan@acm.org>
4036         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
4037         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
4039 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
4041         PR c++/77829
4042         PR c++/78656
4043         * cp-tree.h (suggest_alternatives_for): Add bool param.
4044         (suggest_alternative_in_explicit_scope): New decl.
4045         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
4046         that isn't the global one, call new function
4047         suggest_alternative_in_explicit_scope, only calling
4048         suggest_alternatives_for if it fails, and disabling near match
4049         searches fort that case.  When SCOPE is the global namespace,
4050         pass true for new param to suggest_alternatives_for to allow for
4051         fuzzy name lookups.
4052         * lex.c (unqualified_name_lookup_error): Pass true for new param
4053         to suggest_alternatives_for.
4054         * name-lookup.c (consider_binding_level): Add forward decl.
4055         (suggest_alternatives_for): Add "suggest_misspellings" param,
4056         using it to conditionalize the fuzzy name-lookup code.
4057         (suggest_alternative_in_explicit_scope): New function.
4058         * parser.c (cp_parser_primary_expression): When calling
4059         finish_id_expression, pass location of id_expression rather
4060         than that of id_expr_token.
4061         (cp_parser_id_expression): Convert local "unqualified_id" from
4062         tree to cp_expr to avoid implicitly dropping location information.
4064 2017-01-20  Marek Polacek  <polacek@redhat.com>
4066         PR c/64279
4067         * call.c (build_conditional_expr_1): Warn about duplicated branches.
4068         * semantics.c (finish_expr_stmt): Build statement using the proper
4069         location.
4071 2017-01-19  Jason Merrill  <jason@redhat.com>
4073         US 20 - forwarding references and class template argument deduction
4074         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
4075         * pt.c (push_template_decl_real): Set it.
4076         (maybe_adjust_types_for_deduction): Check it.
4077         (rewrite_template_parm): Copy it.
4079         US 19 - deduction guides and constructors
4080         * call.c (joust): Prefer deduction guides to constructors.
4081         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
4082         (deduction_guide_p): Check DECL_P.
4084         * decl.c (check_initializer): Always use build_aggr_init for array
4085         decomposition.
4087         PR c++/79130 - decomposition and direct-initialization
4088         * init.c (build_aggr_init): Communicate direct-initialization to
4089         build_vec_init.
4090         (build_vec_init): Check for array copy sooner.
4091         * parser.c (cp_parser_decomposition_declaration): Remove call to
4092         build_x_compound_expr_from_list.
4094 2017-01-18  Jason Merrill  <jason@redhat.com>
4096         PR c++/68666 - member variable template-id
4097         * typeck.c (finish_class_member_access_expr): Handle variable
4098         template-id.
4099         * pt.c (lookup_and_finish_template_variable): No longer static.
4100         * cp-tree.h: Declare it.
4102 2017-01-18  Nathan Sidwell  <nathan@acm.org>
4104         PR c++/78488
4105         * call.c (build_over_call): When checking ellipsis conversions for
4106         an inherited ctor, make sure there is at least one conversion.
4108 2017-01-18  Jason Merrill  <jason@redhat.com>
4110         PR c++/78894 - ICE with class deduction and default arg
4111         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
4113 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
4115         PR c++/77489
4116         * mangle.c (write_discriminator): Reorganize abi warning check.
4118 2017-01-18  Nathan Sidwell  <nathan@acm.org>
4120         * cp-tree.h: Clarify exception spec node comment.
4121         * except.c (nothrow_spec_p): Simplify by checking node-equality.
4123         PR c++/79091
4124         * mangle.c (write_exception_spec): Check nothrow explicitly.
4125         (write_encoding): Don't increment processing_template_decl around
4126         encoding.
4128 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
4130         PR c++/70182
4131         * mangle.c (write_template_args): Add "on" for operator names.
4133 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
4135         PR c++/77489
4136         * mangle.c (write_discriminator): Handle discriminator >= 10.
4138 2017-01-17  Nathan Sidwell  <nathan@acm.org>
4140         PR c++/61636
4141         * cp-tree.h (maybe_generic_this_capture): Declare.
4142         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
4143         (maybe_resolve_dummy): ... here.  Call it.
4144         (maybe_generic_this_capture): New.
4145         * parser.c (cp_parser_postfix_expression): Speculatively capture
4146         this in generic lambda in unresolved member function call.
4147         * pt.c (tsubst_copy_and_build): Force hard error from failed
4148         member function lookup in generic lambda.
4150 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
4152         PR c++/70565
4153         * cp-array-notation.c (expand_array_notation_exprs): Handle
4154         OMP_PARALLEL.
4156 2017-01-11  Jason Merrill  <jason@redhat.com>
4158         PR c++/78337 - ICE on invalid with generic lambda
4159         * semantics.c (process_outer_var_ref): Check if containing_function
4160         is null.  Move inform call under complain test.
4162 2017-01-11  Nathan Sidwell  <nathan@acm.org>
4164         PR c++/77812
4165         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
4166         is a new overload.
4168 2017-01-11  Nathan Sidwell  <nathan@acm.org>
4170         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
4172 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
4174         PR c++/78341
4175         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
4176         assertion.  Formatting fix.
4178         PR c++/72813
4179         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
4180         writing PCH file.
4182 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
4184         PR c++/77949
4185         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
4186         a missing semicolon if we have a valid insertion location for
4187         the fix-it hint.
4189 2017-01-10  Jason Merrill  <jason@redhat.com>
4191         FI 20, decomposition declaration with parenthesized initializer.
4192         * parser.c (cp_parser_decomposition_declaration): Use
4193         cp_parser_initializer.
4195 2017-01-09  Jason Merrill  <jason@redhat.com>
4197         Implement P0195R2, C++17 variadic using.
4198         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
4199         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
4200         * error.c (dump_decl): Likewise.
4202 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
4204         PR translation/79019
4205         PR translation/79020
4206         * semantics.c (finish_omp_clauses): Add missing whitespace to
4207         translatable strings.
4208         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
4210 2017-01-07  Jason Merrill  <jason@redhat.com>
4212         PR c++/78948 - instantiation from discarded statement
4213         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
4214         * cp-tree.h (in_discarded_stmt): Declare it.
4215         (struct saved_scope): Add discarded_stmt bitfield.
4216         (in_discarded_stmt): New macro.
4217         * decl2.c (mark_used): Check it.
4218         * parser.c (cp_parser_selection_statement): Adjust.
4219         (cp_parser_jump_statement): Adjust.
4221 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
4223         PR c++/78931
4224         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
4225         REFERENCE_REF_P, set tt to its operand.
4227         PR c++/78890
4228         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
4229         unions even for C++11 and later.
4231 2017-01-05  Nathan Sidwell  <nathan@acm.org>
4233         PR c++/78765
4234         * pt.c (convert_nontype_argument): Don't try and see if integral
4235         or enum expressions are constants prematurely.
4237 2017-01-04  Marek Polacek  <polacek@redhat.com>
4239         PR c++/64767
4240         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
4241         a zero character literal.
4243 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
4245         PR c++/78949
4246         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
4247         vector type.
4249         PR c++/78693
4250         * parser.c (cp_parser_simple_declaration): Only complain about
4251         inconsistent auto deduction if auto_result doesn't use auto.
4253         * parser.c (cp_parser_simple_declaration): Diagnose function
4254         declaration among more than one init-declarators with auto
4255         specifier.
4257         PR c++/71182
4258         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
4259         assertion, as lexer->buffer may be NULL.
4261 2017-01-04  Marek Polacek  <polacek@redhat.com>
4263         PR c++/77545
4264         PR c++/77284
4265         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
4267 2017-01-04  Nathan Sidwell  <nathan@acm.org>
4269         PR c++/66735
4270         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
4271         (lambda_capture_field_type): Update prototype.
4272         * lambda.c (lambda_capture_field_type): Add is_reference parm.
4273         Add referenceness here.
4274         (add_capture): Adjust lambda_capture_field_type call, refactor
4275         error checking.
4276         * pt.c (tsubst): Adjust lambda_capture_field_type call.
4278 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
4280         Update copyright years.
4282 Copyright (C) 2017 Free Software Foundation, Inc.
4284 Copying and distribution of this file, with or without modification,
4285 are permitted in any medium without royalty provided the copyright
4286 notice and this notice are preserved.