[C++ PATCH] Move mangling alias out of ::
[official-gcc.git] / gcc / cp / ChangeLog
blob01b8c4d6da60a4a1c84d6d01be2aacc6903a770b
1 2017-10-04  Nathan Sidwell  <nathan@acm.org>
3         Move mangling aliases out of global namespace.
4         * cp-tree.h (record_mangling): New.
5         (maybe_remove_implicit_alias): Delete.
6         * decl2.c (mangled_decls): New hash map.
7         (generate_mangling_alias): Reimplement using mangled_decls.
8         (record_mangling): New.
9         * mangle.c (decl_implicit_alias_p,
10         maybe_remove_implicit_alias): Delete.
11         (mangle_decl): Use record_mangling.
12         * name-lookup.c (supplement_binding_1): Remove
13         maybe_remove_implicit_alias check.
15 2017-10-04  Jakub Jelinek  <jakub@redhat.com>
17         PR c++/82373
18         * error.c (dump_function_decl): If show_return, call dump_type_suffix
19         on the same return type dump_type_prefix has been called on.
21 2017-10-04  Jason Merrill  <jason@redhat.com>
23         PR c++/81525 - broken handling of auto in generic lambda.
24         * pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.
26 2017-10-04  Nathan Sidwell  <nathan@acm.org>
28         * call.c (convert_arg_to_ellipsis): Correct comment about passing
29         by reference.
31 2017-10-02  Richard Sandiford  <richard.sandiford@linaro.org>
33         * constexpr.c (cxx_eval_store_expression): Use wi::to_widest
34         when comparing the array bounds with an ARRAY_REF index.
36 2017-09-30  Paolo Carlini  <paolo.carlini@oracle.com>
38         PR c++/68754
39         * method.c (defaulted_late_check): Early return if the defaulted
40         declaration does not match the expected signature.
42 2017-09-29  Jakub Jelinek  <jakub@redhat.com>
44         P0683R1 - default member initializers for bit-fields
45         * cp-tree.h (grokbitfield): Add INIT parameter.
46         * parser.c (cp_parser_constant_expression): Add STRICT_P argument,
47         if true, parse a conditional-expression rather than
48         assignment-expression.
49         (cp_parser_member_declaration): For C++11 and later pass true
50         as STRICT_P to cp_parser_constant_expression.  Parse C++2A bitfield
51         NSDMIs.  Adjust grokbitfield caller.  Handle DECL_INITIAL also for
52         DECL_C_BIT_FIELDs.
53         (cp_parser_objc_class_ivars): Adjust grokbitfield caller.
54         * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs.
55         (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs.
56         * decl2.c (grokbitfield): Add INIT parameter, pass it to
57         cp_finish_decl.
58         * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not
59         just non-bitfields.
61         * class.c (check_bitfield_decl): Retrieve and clear width from
62         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
63         (check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than
64         DECL_INITIAL.
65         (remove_zero_width_bit_fields): Adjust comment.
66         * decl2.c (grokbitfield): Stash width into
67         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
68         * pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr
69         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width.
71         * parser.c (cp_parser_member_declaration): Parse attributes before
72         colon of a bitfield in addition to after colon.
74         * Make-lang.in (check-c++-all): Test also c++2a.
76 2017-09-28  Jason Merrill  <jason@redhat.com>
78         PR c++/56973, DR 696 - capture constant variables only as needed.
79         * expr.c (mark_use): Split out from mark_rvalue_use and
80         mark_lvalue_use.  Handle lambda capture of constant variables.
81         (mark_lvalue_use_nonread): New.
82         * semantics.c (process_outer_var_ref): Don't capture a constant
83         variable until forced.
84         * pt.c (processing_nonlambda_template): New.
85         * call.c (build_this): Check it.
86         * decl2.c (grok_array_decl): Call mark_rvalue_use and
87         mark_lvalue_use_nonread.
88         * init.c (constant_value_1): Don't call mark_rvalue_use.
89         * typeck.c (build_static_cast): Handle lambda capture.
91         Use local_specializations to find capture proxies.
92         * cp-tree.h (DECL_CAPTURED_VARIABLE): New.
93         * lambda.c (build_capture_proxy): Set it.
94         (add_capture): Pass initializer to build_capture_proxy.
95         (start_lambda_function): Likewise.
96         (insert_capture_proxy): Use register_local_specialization.
97         (is_lambda_ignored_entity): Always ignore proxies.
98         * name-lookup.c (qualify_lookup): Don't check
99         is_lambda_ignored_entity if LOOKUP_HIDDEN is set.
100         * semantics.c (process_outer_var_ref): Use
101         retrieve_local_specialization.
102         * parser.c (cp_parser_lambda_body): Push local_specializations.
103         * pt.c (tsubst_expr): Pass LOOKUP_HIDDEN when looking for a proxy.
104         (tsubst_lambda_expr): Push local_specializations sooner.
105         (tsubst_copy_and_build): Don't register_local_specialization.
107         * call.c (build_special_member_call): Use the return value of
108         mark_lvalue_use.
109         * decl.c (compute_array_index_type): Likewise.
110         * parser.c (cp_parser_oacc_wait_list): Likewise.
111         * lambda.c (is_normal_capture_proxy): Handle *this capture.
112         (add_capture): Clarify internal_error message.
114 2017-09-22  Eric Botcazou  <ebotcazou@adacore.com>
116         PR bootstrap/81926
117         * cp-objcp-common.c (cp_get_debug_type): Do only one lookup.
119 2017-09-22  Jakub Jelinek  <jakub@redhat.com>
121         PR sanitizer/81929
122         * tree.c (struct replace_placeholders_t): Add pset field.
123         (replace_placeholders_r): Call cp_walk_tree with d->pset as
124         last argument instead of NULL.  Formatting fix.
125         (replace_placeholders): Add pset variable, add its address
126         into data.  Pass &pset instead of NULL to cp_walk_tree.
128 2017-09-22  David Malcolm  <dmalcolm@redhat.com>
130         * call.c (get_fndecl_argument_location): New function.
131         (convert_like_real): Use it  when complaining about argument type
132         mismatches.
133         * cp-tree.h (struct cp_parameter_declarator): Add "loc" field.
134         * parser.c (make_parameter_declarator): Add "loc" param and use
135         it to initialize the new field.
136         (cp_parser_translation_unit): Add UNKNOWN_LOCATION for "loc" of
137         the "no_parameters" parameter.
138         (cp_parser_parameter_declaration_list): Set the location of the
139         result of grokdeclarator to be the parameter's loc, assuming no
140         errors.
141         (cp_parser_parameter_declaration): Generate a location for the
142         parameter and pass to make_parameter_declarator.
144 2017-09-20  Nathan Sidwell  <nathan@acm.org>
146         * name-lookup.c (member_name_cmp): Use DECL_UID for final
147         ordering.
149 2017-09-20  Jakub Jelinek  <jakub@redhat.com>
151         P0409R2 - allow lambda capture [=, this]
152         * parser.c (cp_parser_lambda_introducer): For cxx2a don't pedwarn on
153         redundant [=, this].
155 2017-09-18  Jason Merrill  <jason@redhat.com>
157         PR c++/82069 - ICE with lambda in template
158         * semantics.c (process_outer_var_ref): Check uses_template_parms
159         instead of any_dependent_template_arguments_p.
161 2017-09-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
162             Paolo Carlini  <paolo.carlini@oracle.com>
164         PR c++/64644
165         * decl2.c (finish_anon_union): Complain about "anonymous union with
166         no members" with a pedwarn.
168 2017-09-15  Bernd Edlinger  <bernd.edlinger@hotmail.de>
170         * typeck.c (build_reinterpret_cast_1,
171         build_const_cast_1): Implement -Wcast-align=strict.
173 2017-09-15  Jakub Jelinek  <jakub@redhat.com>
175         * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
176         adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
177         to C++17 or -std=gnu++17 or -std=c++17.  Adjust comments.
178         (cxx_init_decl_processing, next_initializable_field,
179         is_direct_enum_init, check_initializer, cp_finish_decl,
180         mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
181         finish_function): Likewise.
182         * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
183         * pt.c (mark_template_parm, convert_nontype_argument,
184         instantiate_class_template_1, type_unification_real, unify,
185         get_partial_spec_bindings, dependent_type_p_r): Likewise.
186         * typeck.c (cp_build_unary_op): Likewise.
187         * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
188         * call.c (build_user_type_conversion_1, build_over_call,
189         build_special_member_call): Likewise.
190         * lambda.c (begin_lambda_type): Likewise.
191         * typeck2.c (process_init_constructor_record): Likewise.
192         * class.c (build_base_field, finalize_literal_type_property,
193         explain_non_literal_class): Likewise.
194         * parser.c (cp_parser_diagnose_invalid_type_name,
195         cp_parser_primary_expression, cp_parser_lambda_introducer,
196         cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
197         cp_convert_range_for, cp_parser_perform_range_for_lookup,
198         cp_parser_decomposition_declaration, cp_parser_linkage_specification,
199         cp_parser_static_assert, cp_parser_simple_type_specifier,
200         cp_parser_namespace_definition, cp_parser_using_declaration,
201         cp_parser_init_declarator, cp_parser_type_parameter_key,
202         cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
203         cp_parser_constructor_declarator_p): Likewise.
204         * mangle.c (struct globals): Rename need_cxx1z_warning to
205         need_cxx17_warning.
206         (write_exception_spec, start_mangling, mangle_decl): Likewise.
207         * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
208         it.
209         (check-c++17): New goal.  Use 17 instead of 1z.
210         (check-c++-all): Use 17 instead of 1z.
212 2017-09-14  Jakub Jelinek  <jakub@redhat.com>
214         PR c++/81314
215         * cp-gimplify.c (omp_var_to_track): Look through references.
216         (omp_cxx_notice_variable): Likewise.
218 2017-09-13  Nathan Sidwell  <nathan@acm.org>
220         Conv-op identifers not in identifier hash table
221         * lex.c (conv_type_hasher): Make member fns inline.
222         (make_conv_op_name): Directly clone conv_op_identifier.
224         Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
225         * cp-tree.h (struct lang_type): Rename methods to members.
226         (CLASSTYPE_METHOD_VEC): Rename to ...
227         (CLASSTYPE_MEMBER_VEC): ... this.
228         * name-lookup.h (get_method_slot): Rename to ...
229         (get_member_slot): ... this.
230         (resort_type_method_vec): Rename to ...
231         (resort_type_member_vec): ... this.
232         * class.c (add_method, warn_hidden): Adjust.
233         * search.c (dfs_locate_field_accessor_pre): Adjust.
234         * name-lookup.c (method_vec_binary_search): Rename to ...
235         (member_vec_binary_search): ... this and adjust.
236         (method_vec_linear_search): Rename to ...
237         (member_vec_linear_search): ... this and adjust.
238         (fields_linear_search, get_class_binding_direct): Adjust.
239         (get_method_slot): Rename to ...
240         (get_member_slot): ... this and adjust.
241         (method_name_slot): Rename to ...
242         (member_name_slot): ... this and adjust.
243         (resort_type_method_vec): Rename to ...
244         (resort_type_member_vec): ... this and adjust.
245         (method_vec_append_class_fields): Rename to ...
246         (member_vec_append_class_fields): ... this and adjust.
247         (method_vec_append_enum_values): Rename to ...
248         (member_vec_append_enum_values): ... this and adjust.
249         (method_vec_dedup): Rename to ...
250         (member_vec_dedup): ... this and adjust.
251         (set_class_bindings, insert_late_enum_def_bindings): Adjust.
252         
253 2017-09-12  Paolo Carlini  <paolo.carlini@oracle.com>
255         PR c++/70621
256         * decl.c (start_decl): Early return error_mark_node if duplicate_decls
257         returns it; avoid misleading error message.
259 2017-09-12  Nathan Sidwell  <nathan@acm.org>
261         Kill CLASSTYPE_SORTED_FIELDS.
262         * cp-tree.h (struct lang_type): Lose sorted_fields member.
263         (CLASSTYPE_SORTED_FIELDS): Delete.
264         * name-lookup.h (set_class_bindings): Add EXTRA arg.
265         * name-lookup.c (fields_linear_search): New, broken out of ...
266         (lookup_field_1): ... here.  Delete remainder of function.
267         (get_class_binding_direct): Reimplement without sorted_fields.
268         (get_class_binding): Rename TYPE arg to KLASS, for consistency.
269         (get_method_slot): Call set_class_binding when creating method_vec
270         on complete type.
271         (method_name_cmp): Order identically named slots.
272         (sorted_fields_type_new): Delete.
273         (field_vc_append_class_fields): Rename to ...
274         (method_vec_append_class_fields): ... here.  Adjust.
275         (field_vec_append_enum_values): Renme to ...
276         (method_vec_append_enum_values): ... here. Adjust.
277         (method_vec_dedup): New.
278         (set_class_bindings): Reimplement.
279         (insert_late_enum_def_bindings): Reimplement.
281         * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
282         consistency.
283         (restort_data): Move later.
284         (method_name_cmp, resort_method_name_cmp): Simplify.
285         (resort_type_method_vec): Reformat.
287 2017-09-09  Jason Merrill  <jason@redhat.com>
289         * constexpr.c (reduced_constant_expression_p): If
290         CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
292 2017-09-09  Eric Botcazou  <ebotcazou@adacore.com>
294         PR bootstrap/81926
295         * cp-objcp-common.c (struct debug_type_hasher): New class.
296         (debug_type_hash): New variable.
297         (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
299 2017-09-08  Jason Merrill  <jason@redhat.com>
301         PR c++/70029 - ICE with ref-qualifier and -flto
302         * tree.c (cxx_copy_lang_qualifiers): New.
303         * cp-tree.h: Declare it.
304         * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
306 2017-09-06  Jason Merrill  <jason@redhat.com>
308         PR c++/82053 - ICE with default argument in lambda in template
309         * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
310         in templates.
311         (retrieve_specialization): Use lambda_fn_in_template_p.
312         * cp-tree.h: Declare it.
314         PR c++/82070 - error with nested lambda capture
315         * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
316         register_local_specialization.
318 2017-09-06  Nathan Sidwell  <nathan@acm.org>
320         * name-lookup.h (lookup_field_1): Delete.
321         (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
322         * name-lookup.c (lookup_field_1): make static
323         (method_vec_binary_search, method_vec_linear_search): New.  Broken
324         out of ...
325         (get_class_binding_direct): ... here.  Add TYPE_OR_FNS argument.
326         Do complete search of this level.
327         (get_class_binding): Adjust.
328         * decl.c (reshape_init_class): Call get_class_binding.
329         * search.c (lookup_field_r): Move field searching into
330         get_class_binding_direct.
332         * class.c (warn_hidden): Don't barf on non-functions.
333         * decl2.c (check_classfn): Likewise.  Check template match earlier.
335         * name-lookup.c (count_fields): Rename to ...
336         (count_class_fields): ... here.  Take a class, don't count
337         NULL-named fields.
338         (add_fields_to_record_type): Rename to ...
339         (field_vec_append_class_fields): ... here.  Take a class, don't
340         add NULL-named fields.
341         (add_enum_fields_to_record_type): Rename to ...
342         (field_vec_append_enum_values): ... here.
343         (set_class_bindings): Adjust, assert we added expected number.
344         (insert_late_enum_def_bindings): Reimplement.  Create vector if
345         there are now sufficient entries.
347         * name-lookup.h (lookup_fnfields_slot_nolazy,
348         lookup_fnfields_slot): Rename to ...
349         (get_class_binding_direct, get_class_binding): ... here.
350         * name-lookup.c (lookup_fnfields_slot_nolazy,
351         lookup_fnfields_slot): Rename to ...
352         (get_class_binding_direct, get_class_binding): ... here.
353         * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
354         * call.c (build_user_type_conversion_1): Adjust.
355         (has_trivial_copy_assign_p): Adjust.
356         (has_trivial_copy_p): Adjust.
357         * class.c (get_basefndecls) Adjust.
358         (vbase_has_user_provided_move_assign) Adjust.
359         (classtype_has_move_assign_or_move_ctor_p): Adjust.
360         (type_build_ctor_call, type_build_dtor_call): Adjust.
361         * decl.c (register_dtor_fn): Adjust.
362         * decl2.c (check_classfn): Adjust.
363         * pt.c (retrieve_specialization): Adjust.
364         (check_explicit_specialization): Adjust.
365         (do_class_deduction): Adjust.
366         * search.c (lookup_field_r): Adjust.
367         (look_for_overrides_here, lookup_conversions_r): Adjust.
368         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
369         * tree.c (type_has_nontrivial_copy_init): Adjust.
370         * method.c (lazily_declare_fn): Adjust comment.
372 2017-09-05  Nathan Sidwell  <nathan@acm.org>
374         * name-lookup.c (do_class_using_decl): Elide read-once temps.
375         Move declarations to initializations.
377         * class.c (add_method): Move slot search and insertion to ...
378         * name-lookup.c (get_method_slot): ... this new function.
379         (lookup_fnfields_slot_nolazy): Cope with NULL slot.
380         * name-lookup.h (get_method_slot): Declare.
381         * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
382         realistic type.
383         (grok_special_member_properties): Set
384         TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
385         Improve TYPE_HAS_CONSTEXPR_CTOR setting.        
387         * cp-tree.h (lang_decl_base): Rename template_conv_p to
388         unknown_bound_p.
389         (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
390         (DECL_CONV_FN_TYPE): FN must be conv op.
391         (DECL_TEMPLATE_CONV_FN_P): Delete.
392         (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
393         * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
394         setting.
396         * class.c (unreverse_member_declarations): Remove extraneous if.
397         * pt.c (push_template_decl_real): Use string concatenation, not
398         \<newline>.  Add %<..%>.
400 2017-09-05  Paolo Carlini  <paolo.carlini@oracle.com>
402         PR c++/81942
403         * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
404         * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
405         creating cdtor_label.
406         * constexpr.c (returns): Add the case of a constructor/destructor
407         returning via a LABEL_DECL_CDTOR label.
408         (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
410 2017-09-01  Nathan Sidwell  <nathan@acm.org>
412         * cp-tree.h (resort_type_method_vec): Move declaration to ...
413         * name-lookup.h (resort_type_method_vec): ... here.
414         (set_class_bindings): Lose 2nd arg.
415         * class.c (finish_struct_1, finish_struct): Adjust
416         set_class_bindings call.  Don't call finish_struct_methods.
417         (resort_data, method_name_cmp, resort_method_name_cmp,
418         resort_type_method_vec, finish_struct_methods): Move to ...
419         * name-lookup.c (resort_data, method_name_cmp,
420         resort_method_name_cmp, resort_type_method_vec): ... here.
421         (set_class_bindings): Lose fields arg.  Swallow finish_struct_methods.
423         * class.c (finish_struct): Call set_class_bindings for the
424         template case too.
426         * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
427         Don't call maybe_warn_about_overly_private_class here.
428         (warn_hidden): Cleanup declarations and comments.
429         (type_has_user_provided_constructor): No need to check
430         CLASSTYPE_METHOD_VEC.
431         (type_has_user_provided_or_explicit_constructor): Likewise.
432         (classtype_has_move_assign_or_move_ctor_p): Likewise.
433         (check_bases_and_members): Don't call finish_struct_methods here.
434         (finish_struct_1): Call finish_struct_methods and
435         set_class_bindings immediately after layout.  Clear DECL_IN_AGGR_P
436         here.
437         (finish_struct): For templates process USING_DECLS and clear
438         DECL_IN_AGGR_P before calling finish_struct_methods. Call
439         maybe_warn_about_overly_private_class here.
441         Revert 2017-08-28  Nathan Sidwell  <nathan@acm.org>
442         Restore sorted_fields vector.
443         * cp-tree.h (lang_type): Restore sorted_fields vector.
444         (CLASSTYPE_SORTED_FIELDS): Restore.
445         (CLASSTYPE_BINDINGS): Delete.
446         * name-lookup.c (lookup_field_1): Restore binary search.
447         (sorted_fields_type_new, count_fields,
448         add_fields_to_record_type, add_enum_fields_to_record_type): Restore
449         (set_class_bindings): Revert.
450         (insert_late_enum_def_binding): Restore field_vec insertion.
452 2017-09-01  Jakub Jelinek  <jakub@redhat.com>
454         PR c/81887
455         * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
457 2017-09-01  Marek Polacek  <polacek@redhat.com>
459         PR c++/82040
460         * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
462 2017-08-30  Jason Merrill  <jason@redhat.com>
464         PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
465         * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
466         (regenerated_lambda_fn_p): New.
467         (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
468         (tsubst_copy) [VAR_DECL]: Likewise.
470         PR c++/82030 - ICE inheriting from multiple lambdas
471         PR c++/80767
472         * call.c (compare_ics): Handle null candidate.
474 2017-08-30  Ville Voutilainen  <ville.voutilainen@gmail.com>
476         Make taking the address of an overloaded function a non-deduced context
478         * pt.c (unify_overload_resolution_failure): Remove.
479         (unify_one_argument): Adjust.
481 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
482             Alan Hayward  <alan.hayward@arm.com>
483             David Sherwood  <david.sherwood@arm.com>
485         * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
487 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
488             Alan Hayward  <alan.hayward@arm.com>
489             David Sherwood  <david.sherwood@arm.com>
491         * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
493 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
494             Alan Hayward  <alan.hayward@arm.com>
495             David Sherwood  <david.sherwood@arm.com>
497         * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
498         instead of TYPE_MODE.
500 2017-08-29  Jason Merrill  <jason@redhat.com>
502         PR c++/81236 - ICE with template-id in generic lambda
503         * semantics.c (finish_id_expression): Remove special dependent case.
504         Avoid some later pieces when dependent.
505         (finish_qualified_id_expr): Do normal BASELINK handling in a
506         template.  Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
507         (parsing_default_capturing_generic_lambda_in_template): Remove.
508         * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
509         error for types that will never be complete.
510         * mangle.c (write_expression): Add sanity check.
511         * tree.c (build_qualified_name): Add sanity check.
512         (cp_walk_subtrees): Walk into the class context of a BASELINK.
513         * lambda.c (add_capture): Improve diagnostic for generic lambda
514         capture failure.
515         * call.c (build_new_method_call_1): Print the right constructor
516         name.
518         Reimplement handling of lambdas in templates.
519         * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
520         * decl.c (start_preparsed_function): Call start_lambda_scope.
521         (finish_function): Call finish_lambda_scope.
522         * init.c (get_nsdmi): Call start/finish_lambda_scope.
523         * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
524         * parser.c (cp_parser_function_definition_after_declarator): Don't
525         call start/finish_lambda_scope.
526         * pt.c (retrieve_specialization): Ignore lambda functions in
527         templates.
528         (find_parameter_packs_r): Ignore capture proxies.  Look into
529         lambdas.
530         (check_for_bare_parameter_packs): Allow bare packs in lambdas.
531         (tsubst_default_argument): Call start/finish_lambda_scope.
532         (tsubst_function_decl): Handle lambda functions differently.
533         (tsubst_template_decl): Likewise.
534         (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
535         proxies.
536         (tsubst_lambda_expr): Create a new closure rather than instantiate
537         the one from the template.
538         (tsubst_copy_and_build): Don't register a specialization of a pack.
539         (regenerate_decl_from_template): Call start/finish_lambda_scope.
540         (instantiate_decl): Remove special lambda function handling.
541         * semantics.c (process_outer_var_ref): Remove special generic lambda
542         handling.  Don't implicitly capture in a lambda in a template.  Look
543         for an existing proxy.
544         * class.c (current_nonlambda_class_type): Use decl_type_context.
546         * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
547         (LAMBDA_EXPR_RETURN_TYPE): Remove.
548         (struct tree_lambda_expr): Remove closure and return_type fields.
549         * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
550         * pt.c (tsubst_copy_and_build): Likewise.
551         * parser.c (cp_parser_lambda_declarator_opt): Track return type.
552         (cp_parser_lambda_body): Adjust unspecified return type check.
553         * ptree.c (cxx_print_lambda_node): Don't print closure or
554         return type.
556         PR c++/80935 - wrong C++17 error with lambda
557         * decl.c (check_for_uninitialized_const_var): Check
558         is_instantiation_of_constexpr.
559         * constexpr.c (ensure_literal_type_for_constexpr_object): Check
560         is_instantiation_of_constexpr.
561         (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
563         * lambda.c (build_lambda_object): Check for error_mark_node.
564         * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
565         pack as well.
566         (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
567         (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
569         PR c++/80767 - unnecessary instantiation of generic lambda
570         * call.c (convert_like_real): Call build_user_type_conversion_1 if
571         cand is null.
572         (add_conv_candidate): Build a ck_user conversion with no candidate.
574         Fix lambdas in template default argument of inherited ctor.
575         * method.c (synthesized_method_base_walk): Replace an inherited
576         template with its specialization.
577         (synthesized_method_walk): Make inheriting_ctor a pointer.
578         (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
579         (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
581         * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
582         template, not the function.
583         (template_guide_p): Adjust.
585         Support copying local_specializations.
586         * cp-tree.h (enum lss_policy): New.
587         (local_specialization_stack): Add policy parameter to default ctor.
588         * pt.c (local_specialization_stack): Copy local_specializations if
589         lss_copy.
591         * constexpr.c (potential_constant_expression_1): Add "now" parm.
592         (is_constant_expression, require_constant_expression): New.
593         (is_static_init_expression, is_nondependent_constant_expression)
594         (is_nondependent_static_init_expression): Drop "potential".
595         * except.c (build_must_not_throw_expr): Do type conversion on
596         value-dependent argument.
597         * pt.c, semantics.c, typeck2.c: Use variants without "potential".
599         Instantiate default arguments/member initializers once.
600         * init.c (get_nsdmi): Remember NSDMI instantiations.
601         * parser.c (inject_this_parameter): Be more picky about
602         current_class_ptr.
603         * pt.c (tsubst_copy): Simplify 'this' handling.
604         (tsubst_default_argument): Remember default argument
605         instantiations.  Take parameter number.
606         (tsubst_default_arguments): Pass it.
607         * call.c (convert_default_arg): Likewise.
609         Fix default argument conversion failure and SFINAE.
610         * call.c (build_over_call): Check convert_default_arg result for
611         error_mark_node.
612         * parser.c (cp_parser_late_parsing_default_args): Remember
613         error_mark_node.
615 2017-08-28  Nathan Sidwell  <nathan@acm.org>
617         * cp-tree.h (lang_type): Replace sorted_fields vector with
618         bindings map.
619         (CLASSTYPE_SORTED_FIELDS): Delete.
620         (CLASSTYPE_BINDINGS): New.
621         * decl.c (finish_enum_value_list): Swap args of
622         insert_late_enum_def_bindings.
623         * name-lookup.c (lookup_field_1): Replace binary search of sorted
624         fields with map->get.
625         (sorted_fields_type_new, count_fields,
626         add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
627         (add_class_member, add_class_members): New.
628         (set_class_bindings): Create map and insert.
629         (insert_late_enum_def_binding): Swap parms.  Use add_clasS_member.
630         * ptree.c (cxx_print_type): Delete sorted fields printing.
632         * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
633         Delete.
634         * name-lookup.h (set_class_bindings,
635         insert_late_enum_def_bindings): Declare.
636         * decl.c (finish_enum_value_list): Adjust for
637         insert_late_enum_def_bindings name change.
638         * class.c (finish_struct_1): Call set_class_bindings.
639         (count_fields, add_fields_to_record_type,
640         add_enum_fields_to_record_type, sorted_fields_type_new,
641         insert_into_classtype_sorted_fields,
642         insert_late_enum_def_into_classtype_sorted_fields): Move to ...
643         * name-lookup.h (count_fields, add_fields_to_record_type,
644         add_enum_fields_to_record_type, sorted_fields_type_new,
645         set_class_bindings, insert_late_enum_def_bindings): ... here.
647 2017-08-25  Nathan Sidwell  <nathan@acm.org>
649         * class.c (method_name_cmp, resort_method_name_cmp): Methods
650         can never be NULL.
652         Conversion operators have a special name
653         * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
654         (conv_op_marker, conv_op_identifier): New.
655         (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
656         * decl.c (initialize_predefined_identifiers): Add
657         conv_op_identifier.
658         (cxx_init_decl_processing): Create conv_op_marker.
659         * decl2.c (check_classfn): Lookup conv-ops by name.
660         * class.c (add_method): Use conv_op_identifier & conv_op_marker.
661         (resort_type_method_vec): Don't skip conv-ops.
662         (finish_struct_methods, warn_hidden): Likewise.
663         * name-lookup.h (lookup_all_conversions): Delete.
664         * name-lookup.c (lookup_conversion_operator): Replace with ...
665         (extract_conversion_operator): ... this.
666         (lookup_fnfields_slot_nolazy): Find conv-ops by name.
667         (lookup_all_conversions): Delete.
668         * pt.c (check_explicit_specialization): Find conv-ops by name.
669         * search.c (lookup_conversions_r): Likewise.
671 2017-08-24  Nathan Sidwell  <nathan@acm.org>
673         Conversion operators kept on single overload set
674         * class.c (add_method): Keep all conv-ops on one slot.
675         * name-lookup.c (lookup_conversion_operator): Pull the desired
676         conv op out of overload set.
677         * search.c (lookup_conversions_r): Lose template/non-template
678         distinction.
679         (lookup_conversions): Likewise.
681 2017-08-23  Nathan Sidwell  <nathan@acm.org>
683         * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
684         lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
685         declatations to ...
686         * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
687         lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
688         * search.c (lookup_conversion_operator,
689         lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
690         lookup_all_conversions): Move to ...
691         * name-lookup.c (lookup_conversion_operator,
692         lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
693         lookup_all_conversions): ... here.
695         * semantics.c (finish_member_declaration): Move USING_DECL check
696         earlier.  Always set C++ linkage.  Commonize TYPE_FIELD and
697         template decl list insertion.
699         * cp-tree.h (maybe_version_functions): Declare.
700         * decl.c (decls_match): Break function versioning check to
701         separate function.  Call it.
702         (maybe_version_functions): Broken out of decls_match.
703         * class.c (add_method): Use maybe_version_functions.
705         * cp-tree.h (print_search_statistics,
706         reinit_search_statistics): Don't declare.
707         * search.c (n_fields_searched, n_calls_lookup_field,
708         n_calls_lookup_field_1, n_calls_lookup_fnfields,
709         n_calls_lookup_fnfields_1, n_calls_get_base_type,
710         n_outer_fields_searched, n_contexts_saved): Delete.
711         (lookup_field_1, lookup_member,
712         lookup_fnfields_slot_nolazy): Remove stat gathering.
713         (print_search_statistics, reinit_search_statistics): Delete.
714         * tree.c (cxx_print_statistics): Don't print search stats.
716 2017-08-21  Nathan Sidwell  <nathan@acm.org>
718         * search.c (lookup_field_r): Remove obsolete code for type-named
719         field in PoD.
721         * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
722         isn't special.
723         (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
724         (lookup_field_fuzzy_r): Adjust.
726 2017-08-21  David Malcolm  <dmalcolm@redhat.com>
728         * call.c (build_over_call): Pass NULL for new parameter to
729         check_function_arguments.
730         * typeck.c (cp_build_function_call_vec): Likewise.
732 2017-08-21  Nathan Sidwell  <nathan@acm.org>
734         PR c++/81899
735         * pt.c (instantiate_class_template_1):
736         BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
738 2017-08-18  David Malcolm  <dmalcolm@redhat.com>
740         PR c++/81514
741         * name-lookup.c (maybe_suggest_missing_header): Convert return
742         type from void to bool; return true iff a suggestion was offered.
743         (suggest_alternative_in_explicit_scope): Move call to
744         maybe_suggest_missing_header to before use of best_match, and
745         return true if the former offers a suggestion.
747 2017-08-18  H.J. Lu  <hongjiu.lu@intel.com>
749         PR c/53037
750         * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
751         * decl2.c (grokbitfield): Don't allow bit-field with
752         warn_if_not_aligned type.
754 2017-08-17  Nathan Sidwell  <nathan@acm.org>
756         * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
757         * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
758         (TYPE_TEMPLATE_INFO): Simplify.
759         (SET_TYPE_TEMPLATE_INFO): Simplify.
761         * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
762         don't need lang_type.
763         (cxx_make_type): Use maybe_add_lang_type_raw return value.
764         * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
765         TYPE_LANG_SPECIFIC.
767         * cp-tree.h (struct lang_type): Remove template_info field.
768         (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
769         (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
771 2017-08-14  Martin Sebor  <msebor@redhat.com>
773         PR c/81117
774         * error.c (cp_printer): Handle 'G'.
776 2017-08-11  Martin Liska  <mliska@suse.cz>
778         * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
779         TARGET_SUPPORTS_ALIASES.
780         (handle_tls_init): Likewise.
781         (note_mangling_alias): Likewise.  Remove ATTRIBUTE_UNUSED for
782         both arguments.
783         * optimize.c (can_alias_cdtor): Likewise.
785 2017-08-11  Jason Merrill  <jason@redhat.com>
787         PR c++/81671 - nullptr_t template parameter
788         * pt.c (convert_nontype_argument): Fix nullptr_t check.
790 2017-08-10  Jason Merrill  <jason@redhat.com>
792         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
793         * method.c (synthesized_method_walk): Don't diagnose lack of
794         operator delete.
796         PR c++/80452 - Core 1579, implicit move semantics on return/throw
797         * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
798         tentatively changed the lvalue to an rvalue.
799         * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
800         (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
801         parameter is an rvalue reference.
802         * except.c (build_throw): Do maybe-rvalue overload resolution twice.
803         * typeck.c (check_return_expr): Likewise.
805 2017-08-10  David Malcolm  <dmalcolm@redhat.com>
807         * parser.c (cp_parser_error): Update for new param to
808         c_parse_error.
809         (class token_pair): New class.
810         (struct matching_paren_traits): New struct.
811         (matching_parens): New typedef.
812         (struct matching_brace_traits): New struct.
813         (matching_braces): New typedef.
814         (cp_parser_statement_expr): Convert explicit parsing of
815         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
816         class matching_parens, so that the pertinent open parenthesis is
817         highlighted when there are problems locating the close
818         parenthesis.
819         (cp_parser_primary_expression): Likewise.
820         (cp_parser_compound_literal_p): Remove consumption of opening
821         paren.
822         (cp_parser_postfix_expression): Convert explicit parsing of
823         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
824         above.  Use it to consume the opening paren previously consumed by
825         cp_parser_compound_literal_p.
826         (cp_parser_parenthesized_expression_list): Likewise.
827         (cp_parser_unary_expression): Likewise.
828         (cp_parser_new_expression): Likewise.
829         (cp_parser_cast_expression): Likewise.
830         (cp_parser_builtin_offsetof): Likewise.
831         (cp_parser_trait_expr): Likewise.
832         (cp_parser_lambda_declarator_opt): Likewise.
833         (cp_parser_lambda_body): Likewise, for matching_braces.
834         (cp_parser_compound_statement): Likewise.
835         (cp_parser_selection_statement): Likewise, for matching_parens.
836         (cp_parser_iteration_statement): Likewise.
837         (cp_parser_already_scoped_statement): Likewise, for
838         matching_braces.
839         (cp_parser_linkage_specification): Likewise.
840         (cp_parser_static_assert): Likewise, for matching_parens.
841         (cp_parser_decltype): Likewise.
842         (cp_parser_operator): Likewise.
843         (cp_parser_enum_specifier): Likewise.
844         (cp_parser_namespace_definition): Likewise.
845         (cp_parser_direct_declarator): Likewise.
846         (cp_parser_braced_list): Likewise.
847         (cp_parser_class_specifier_1): Likewise, for matching_braces.
848         (cp_parser_constant_initializer): Likewise.
849         (cp_parser_noexcept_specification_opt): Likewise, for
850         matching_parens.
851         (cp_parser_exception_specification_opt): Likewise.
852         (cp_parser_handler): Likewise.
853         (cp_parser_asm_specification_opt): Likewise.
854         (cp_parser_asm_operand_list): Likewise.
855         (cp_parser_gnu_attributes_opt): Likewise.
856         (cp_parser_std_attribute_spec): Likewise.
857         (cp_parser_requirement_parameter_list): Likewise.
858         (cp_parser_requirement_body): Likewise, for matching_braces.
859         (cp_parser_compound_requirement): Likewise.
860         (cp_parser_template_introduction): Likewise.
861         (cp_parser_sizeof_pack): Likewise, for matching_parens.
862         (cp_parser_sizeof_operand): Likewise; use it to consume the
863         opening paren previously consumed by cp_parser_compound_literal_p.
864         (get_matching_symbol): New function.
865         (cp_parser_required_error): Add param "matching_location".  Remove
866         calls to cp_parser_error, instead setting a non-NULL gmsgid, and
867         handling it if set by calling c_parse_error, potentially with a
868         secondary location if matching_location was set.
869         (cp_parser_require): Add param "matching_location", with a default
870         value of UNKNOWN_LOCATION.
871         (cp_parser_require_keyword): Update for new param of
872         cp_parser_required_error.
873         (cp_parser_objc_encode_expression): Update to class matching_parens
874         as above.
875         (cp_parser_objc_defs_expression): Likewise.
876         (cp_parser_objc_protocol_expression): Likewise.
877         (cp_parser_objc_selector_expression): Likewise.
878         (cp_parser_objc_typename): Likewise.
879         (cp_parser_objc_superclass_or_category): Likewise.
880         (cp_parser_objc_try_catch_finally_statement): Likewise.
881         (cp_parser_objc_synchronized_statement): Likewise.
882         (cp_parser_objc_at_property_declaration): Likewise.
883         (cp_parser_oacc_single_int_clause): Likewise.
884         (cp_parser_oacc_shape_clause): Likewise.
885         (cp_parser_omp_clause_collapse): Likewise.
886         (cp_parser_omp_clause_default): Likewise.
887         (cp_parser_omp_clause_final): Likewise.
888         (cp_parser_omp_clause_if): Likewise.
889         (cp_parser_omp_clause_num_threads): Likewise.
890         (cp_parser_omp_clause_num_tasks): Likewise.
891         (cp_parser_omp_clause_grainsize): Likewise.
892         (cp_parser_omp_clause_priority): Likewise.
893         (cp_parser_omp_clause_hint): Likewise.
894         (cp_parser_omp_clause_defaultmap): Likewise.
895         (cp_parser_omp_clause_ordered): Likewise.
896         (cp_parser_omp_clause_schedule): Likewise.
897         (cp_parser_omp_clause_num_teams): Likewise.
898         (cp_parser_omp_clause_thread_limit): Likewise.
899         (cp_parser_omp_clause_aligned): Likewise.
900         (cp_parser_omp_clause_linear): Likewise.
901         (cp_parser_omp_clause_safelen): Likewise.
902         (cp_parser_omp_clause_simdlen): Likewise.
903         (cp_parser_omp_clause_depend): Likewise.
904         (cp_parser_omp_clause_device): Likewise.
905         (cp_parser_omp_clause_dist_schedule): Likewise.
906         (cp_parser_oacc_clause_async): Likewise.
907         (cp_parser_omp_critical): Likewise.
908         (cp_parser_omp_for_loop): Likewise.
909         (cp_parser_omp_sections_scope): Likewise.
910         (cp_parser_omp_declare_reduction_exprs): Likewise.
911         Update for new param to cp_parser_required_error.
912         (cp_parser_oacc_routine): Likewise.
913         (cp_parser_transaction_expression): Likewise.
914         (cp_parser_cilk_simd_vectorlength): Likewise.
916 2017-08-09  Jason Merrill  <jason@redhat.com>
918         PR c++/81525 - wrong constant value with generic lambda
919         * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
920         (tsubst_copy) [VAR_DECL]: Handle auto.
922         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
923         * init.c (get_nsdmi): Add complain parm.
924         * typeck2.c (digest_nsdmi_init): Add complain parm.
925         (process_init_constructor_record): Pass complain to get_nsdmi.
926         * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
927         * method.c (get_defaulted_eh_spec): Add complain parm.  Pass it into
928         synthesized_method_walk.
929         (synthesized_method_walk): Adjust.
930         (walk_field_subobs): Pass complain to get_nsdmi.
931         (defaulted_late_check): Skip other checks if deleted.
932         * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
933         * call.c (build_aggr_conv): Pass complain to get_nsdmi.
934         * parser.c (defarg_location): New.
935         * error.c (location_of): Use it.
937 2017-08-09  Marek Polacek  <polacek@redhat.com>
939         * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
940         * typeck.c (build_binary_op): Change the type of a parameter to bool.
941         (cp_truthvalue_conversion): Use true instead of 1.
943 2017-08-08  Marek Polacek  <polacek@redhat.com>
945         PR c++/81607
946         * cp-gimplify.c (cp_fold): If folding exposed a branch of
947         a COND_EXPR, convert it to the original type of the COND_EXPR, if
948         they differ.               
950 2017-08-08  Martin Liska  <mliska@suse.cz>
952         * call.c: Include header files.
953         * cp-gimplify.c: Likewise.
954         * cp-ubsan.c: Likewise.
955         * cvt.c: Likewise.
956         * init.c: Likewise.
957         * search.c: Likewise.
958         * semantics.c: Likewise.
959         * typeck.c: Likewise.
961 2017-08-07  Martin Liska  <mliska@suse.cz>
963         * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
964         attribute.
965         (cp_parser_std_attribute): Likewise.
966         * tree.c: Add new include.
968 2017-08-04  Paolo Carlini  <paolo.carlini@oracle.com>
970         PR c++/79790
971         * pt.c (do_class_deduction): Handle the case of no viable implicit
972         deduction guides; simplify the code generating implicit deduction
973         guides.
975 2017-08-03  Paolo Carlini  <paolo.carlini@oracle.com>
977         PR c++/71440
978         * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
979         destructor as expressions.
981 2017-08-02  Jakub Jelinek  <jakub@redhat.com>
983         PR c++/81640
984         * call.c (build_user_type_conversion_1): Only call
985         lookup_fnfields_slot if totype is CLASS_TYPE_P.
987 2017-07-31  Jason Merrill  <jason@redhat.com>
989         * decl.c (declare_global_var): Set DECL_CONTEXT.
991 2017-07-31  Jan Hubicka <hubicka@ucw.cz>
992             Martin Liska  <mliska@suse.cz>
994         * pt.c (tsubst_copy): Copy PREDICT_EXPR.
995         * semantics.c (finish_goto_stmt): Build gimple predict
996         stament.
997         * constexpr.c (potential_constant_expression_1): Handle
998         PREDICT_EXPR.
1000 2017-07-31  Martin Liska  <mliska@suse.cz>
1002         PR sanitize/81530
1003         * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
1004         also with current_function_decl non-null equality.
1005         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1006         * decl.c (compute_array_index_type): Likewise.
1007         * init.c (finish_length_check): Likewise.
1008         * typeck.c (cp_build_binary_op): Likewise.
1010 2017-07-29  Jakub Jelinek  <jakub@redhat.com>
1012         * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
1013         DW_AT_export_symbols.
1014         * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
1015         argument, pass it through to the debug hook.
1016         (finish_namespace_using_directive): Adjust
1017         emit_debug_info_using_namespace caller.
1018         (push_namespace): Likewise.  Call it after setting
1019         DECL_NAMESPACE_INLINE_P.
1020         (cp_emit_debug_info_for_using): Pass false as new argument to
1021         the imported_module_or_decl debug hook.
1023 2017-07-28  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
1025         * lex.c (copy_decl): Adjust.
1026         (copy_type): Likewise.
1028 2017-07-26  Paolo Carlini  <paolo.carlini@oracle.com>
1030         PR c++/71570
1031         * lambda.c (add_capture): Early return if we cannot capture by
1032         reference.
1034 2017-07-26  Jason Merrill  <jason@redhat.com>
1036         P0702R1 - List deduction of vector.
1037         * pt.c (do_class_deduction): Special-case deduction from a single
1038         element of related type.
1040 2017-07-26  Leonid Koppel  <lkoppel@uwaterloo.ca>
1042         PR c++/67054 - Inherited ctor with non-default-constructible members
1043         * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
1044         when deducing an inheriting constructor.
1046 2017-07-21  Nathan Sidwell  <nathan@acm.org>
1048         * search.c (lookup_conversion_operator): Return overloads.
1049         (lookup_fnfields_idx_nolazy): Absorb into ...
1050         (lookup_fnfields_slot_nolaxy): ... here.
1051         (lookup_fnfields_1): Absorb into ...
1052         (lookup_fnfields_slot): ... here.
1054         Remove special CDtor METHOD_VEC slots.
1055         * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
1056         CLASSTYPE_DESTRUCTOR_SLOT): Delete.
1057         (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
1058         (CLASSTYPE_DESTRUCTOR): Likewise.
1059         * class (add_method): Don't use special cdtor slots.
1060         * search.c (lookup_fnfields_idx_nolazy): Likewise.
1061         (look_for_overrides_here): Use lookup_fnfields_slot.
1062         * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
1064         * call.c (add_candidates): Move decls to initialization.  Don't
1065         use !!.
1067 2017-07-20  Nathan Sidwell  <nathan@acm.org>
1069         Remove TYPE_METHODS.
1070         * class.c (maybe_warn_about_overly_private_class,
1071         finish_struct_methods, one_inheriting_sig, count_fields,
1072         add_fields_to_record_type, check_field_decls, check_methods,
1073         clone_function_decl, set_method_tm_attributes,
1074         finalize_literal_type_property, check_bases_and_members,
1075         create_vtable_ptr, determine_key_method,
1076         unreverse_member_declarations, finish_struct,
1077         add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
1078         * decl.c (fixup_anonymous_aggr): Likewise.
1079         * decl2.c (reset_type_linkage_2): Likewise.
1080         * method.c (after_nsdmi_defaulted_late_checks,
1081         lazily_declare_fn): Likewise.
1082         * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
1083         * pt.c (instantiate_class_template_1, tsubst_expr,
1084         do_type_instantiation, instantiate_pending_templates): Likewise.
1085         * search.c (lookup_field_1): Likewise.
1086         * semantics.c (finish_member_declaration,
1087         finish_omp_declare_simd_methods): Likewise.
1089 2017-07-19  Nathan Sidwell  <nathan@acm.org>
1091         * class.c (add_implicitly_declared_members): Use
1092         classtype_has_move_assign_or_move_ctor_p.
1093         (classtype_has_move_assign_or_move_ctor,
1094         classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
1095         (classtype_has_move_assign_or_move_ctor_p): ... this new function.
1096         * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
1097         Replace with ...
1098         (classtype_has_move_assign_or_move_ctor_p): ... this.
1099         * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
1100         * tree.c (type_has_nontrivial_copy_init): Adjust.
1102         * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
1103         PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
1105 2017-07-18  Nathan Sidwell  <nathan@acm.org>
1107         * cp-array-notation.c (build_array_notation_ref): Use
1108         TYPE_{MIN,MAX}_VALUE.
1110         * class.c (classtype_has_move_assign_or_move_ctor): Declare.
1111         (add_implicitly_declared_members): Use it.
1112         (type_has_move_constructor, type_has_move_assign): Merge into ...
1113         (classtype_has_move_assign_or_move_ctor): ... this new function.
1114         * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
1116 2017-07-17  Volker Reichelt  <v.reichelt@netcologne.de>
1118         * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
1119         friend outside class and obsolete auto as storage-class-specifier.
1121 2017-07-17  Nathan Sidwell  <nathan@acm.org>
1123         * class.c (maybe_warn_about_overly_private_class): Ignore public
1124         copy ctors.
1126         * class.c (type_has_user_declared_move_constructor,
1127         type_has_user_declared_move_assign): Combine into ...
1128         (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
1129         * cp-tree.h (type_has_user_declared_move_constructor,
1130         type_has_user_declared_move_assign): Combine into ...
1131         (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
1132         * method.c (maybe_explain_implicit_delete): Use it.
1133         (lazily_declare_fn): Use it.
1134         * tree.c (type_has_nontrivial_copy_init): Use it.
1136         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
1137         semantics, simplify implementation.
1139 2017-07-16  Volker Reichelt  <v.reichelt@netcologne.de>
1141         * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
1142         in old-style cast diagnostic.
1143         * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
1144         in useless cast diagnostic.
1145         * error.c (type_to_string): Remove enum special handling.
1147 2017-07-14  David Malcolm  <dmalcolm@redhat.com>
1149         * name-lookup.c (get_std_name_hint): Add '<' and '>' around
1150         the header names.
1151         (maybe_suggest_missing_header): Update for addition of '<' and '>'
1152         to above.  Provide a fix-it hint.
1153         * pt.c: Include "gcc-rich-location.h"
1154         (listify): Attempt to add fix-it hint for missing
1155         #include <initializer_list>.
1156         * rtti.c: Include "gcc-rich-location.h".
1157         (typeid_ok_p): Attempt to add fix-it hint for missing
1158         #include <typeinfo>.
1160 2017-07-12  Jason Merrill  <jason@redhat.com>
1162         P0512R0 - Deduction from an initializer list.
1163         * pt.c (do_class_deduction): Do list deduction in two phases.
1165 2017-07-12  Nathan Sidwell  <nathan@acm.org>
1167         * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
1168         DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
1169         identifier flags.
1170         * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
1171         DECL_CXX_DESTRUCTOR explicitly.
1172         * decl2.c (grokclassfn): Likewise.
1173         * friend.c (do_friend): Likewise.
1174         * method.c (make_thunk, make_alias_for,
1175         implicitly_declare_fn): Likewise.
1177 2017-07-11  Jason Merrill  <jason@redhat.com>
1179         Core DR 393
1180         * decl.c (grokparms): Downgrade error about array of unknown bound
1181         to pedwarn and disable it for C++17.
1183 2017-07-11  Nathan Sidwell  <nathan@acm.org>
1185         * decl2.c (reset_type_linkage_2): Dont't change ctor name.
1187 2017-07-10  Martin Sebor  <msebor@redhat.com>
1189         * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
1191 2017-07-06  Jason Merrill  <jason@redhat.com>
1193         PR c++/81204 - parse error with dependent template-name
1194         * parser.c (cp_parser_lookup_name): Revert previous change.
1196 2017-07-06  David Malcolm  <dmalcolm@redhat.com>
1198         * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
1199         selftest::run_cp_tests.
1200         (selftest::run_cp_tests): New function.
1201         * cp-tree.h (selftest::run_cp_tests): New decl.
1203 2017-07-04  Jakub Jelinek  <jakub@redhat.com>
1205         * parser.c (cp_parser_decomposition_declaration): Replace
1206         decomposition declaration with structured binding in diagnostics.
1207         * decl.c (cp_finish_decomp): Likewise.
1208         (grokdeclarator): Likewise.
1210         PR c++/81258
1211         * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
1212         forms of structured binding initializers.
1214 2017-07-03  Paolo Carlini  <paolo.carlini@oracle.com>
1216         PR c++/65775
1217         * decl.c (grokdeclarator): Move checks on function return type after
1218         the splice_late_return_type call; if declspecs->locations[ds_type_spec]
1219         is UNKNOWN_LOCATION fall back to input_location.
1221 2017-07-03  David Malcolm  <dmalcolm@redhat.com>
1223         * parser.c (enum required_token): Fix spelling of
1224         RT_INTERATION to RT_ITERATION.
1225         (cp_parser_iteration_statement): Likewise.
1226         (cp_parser_required_error): Likewise.
1228 2017-06-30  Jason Merrill  <jason@redhat.com>
1230         PR c++/81257 - ICE with invalid ::template.
1231         PR c++/54769 - wrong lookup of dependent template-name.
1232         * parser.c (cp_parser_template_name): Revert part of last change.
1234 2017-06-30  Nathan Sidwell  <nathan@acm.org>
1236         * config-lang.in (gtfiles): Add cp/lex.c.
1237         * cp-tree.h (mangle_convop_name_for_type): Rename ...
1238         (make_conv_op_name): ... here.  Move to lex.
1239         * lambda.c (maybe_add_lambda_conv_op): Update.
1240         * parser.c (cp_parser_conversion_function_id): Update.
1241         * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
1242         tsubst_copy_and_build): Update.
1243         * semantics.c (apply_deduced_return_type): Update.
1244         * mangle.c (conv_type_hasher, conv_type_names,
1245         mangle_conv_op_name_for_type): Move to ...
1246         * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
1247         ... here.  Rename.
1249 2017-06-30  David Malcolm  <dmalcolm@redhat.com>
1251         PR c++/80014
1252         * parser.c (cp_parser_postfix_expression): Construct a location
1253         for typeid expressions.
1255 2017-06-30  Nathan Sidwell  <nathan@acm.org>
1257         * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
1258         declare.
1259         (lookup_all_conversions): Declare.
1260         * class.c (get_basefndecls): Use lookup_fnfields_slot.
1261         * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
1262         * decl2.c (check_class_fn): Use lookup_fnfields_slot.  Rework
1263         diagnostics.
1264         * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
1265         (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
1266         lookup_all_conversions.
1267         * search.c (lookup_fnfields_1): Make static.
1268         (lookup_all_conversions): New.
1269         (class_method_index_for_fn): Delete.
1270         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
1271         lookup_fnfields_slot.
1273         * call.c (build_new_method_call_1): Use constructo_name to get
1274         ctor name.  Move argument processing earlier to merge cdtor
1275         handling blocks.
1276         * decl.c (grokfndecl): Cdtors have special names.
1277         * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
1278         * pt.c (check_explicit_specialization): Cdtor name is already
1279         special.
1280         * search.c (class_method_index_for_fn): Likewise.
1282         PR c++/81229
1283         * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
1284         a matching TYPE_DECL.
1286 2017-06-29  Paolo Carlini  <paolo.carlini@oracle.com>
1288         * class.c (add_method): Change pair of errors to error + inform.
1289         (handle_using_decl): Likewise.
1291 2017-06-29  Jason Merrill  <jason@redhat.com>
1293         * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
1295         PR c++/81180 - ICE with C++17 deduction of member class template.
1296         * pt.c (build_deduction_guide): Correct member template handling.
1298         PR c++/81188 - matching decltype of member function call.
1299         * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
1301 2017-06-29  Nathan Sidwell  <nathan@acm.org>
1303         PR c++/81247
1304         * parser.c (cp_parser_namespace_definition): Immediately close the
1305         namespace if there's no open-brace.
1306         * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
1307         namespace.
1309 2017-06-29  Jason Merrill  <jason@redhat.com>
1311         PR c++/81164 - ICE with invalid inherited constructor.
1312         * search.c (binfo_direct_p): New.
1313         * name-lookup.c (do_class_using_decl): Use it.
1315 2017-06-29  Nathan Sidwell  <nathan@acm.org>
1317         * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
1318         VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
1319         * decl.c (initialize_predefined_identifiers): Name cdtor special
1320         names consistently.  Use literals for above deleted defines.
1321         (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
1323         * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
1324         flag.
1326         * call.c (check_dtor_name): Use constructor_name for enums too.
1327         (build_new_method_call_1): Use constructor_name for cdtors and
1328         show ~ for dtor.
1329         * class.c (build_self_reference): Use TYPE_NAME to get name of
1330         self reference.
1331         * name-lookup (constructor_name): Use DECL_NAME directly.
1332         (constructor_name_p): Reimplement.
1333         (push_class_level_binding_1): Use TYPE_NAME directly.
1335         * class.c (finish_struct): Use OVL_P.
1336         (get_vfield_name): Measure constructor_name length.
1337         * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
1338         (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
1339         * cxx-pretty-print.c (is_destructor_name): Delete.
1340         (pp_cxx_unqualified_id): Remove bogus destructor name checking.
1341         * decl.c (grokfndecl): Move cheap checks first when looking for
1342         implicit extern cness.
1344         * parser.c (cp_parser_direct_declarator): Reorder if to avoid
1345         indentation. Remove unnecessary assignment of constructor name.
1347         Whitespace cleanups.
1348         * call.c (name_as_c_string): Move CONST_CAST to return.
1349         (build_new_method_call_1): Remove unneeded bracing.
1350         * class.c (include_empty_classes): Unbreak line.
1351         * constraint.cc (tsubst_check_constraint): Add space.
1352         * cp-tree.h (lang_decl_ns): Add comment.
1353         (PTRMEM_CST_MEMBER): Break line.
1354         * decl.c (grokfndecl): Add blank lines. Unbreak some others.
1355         (grokdeclarator): Remove lines, move declaration to first use.
1356         * decl2.c (decl_needed_p): Fix indentation.
1357         (c_parse_final_cleanups): Remove blank line.
1358         * method.c (implicitly_declare_fn): Move declaration to first use.
1359         * search.c (current_scope): Add blank lines.
1361 2017-06-28  Jason Merrill  <jason@redhat.com>
1363         PR c++/72764 - ICE with invalid template typename.
1364         * decl.c (build_typename_type): No longer static.
1365         * tree.c (strip_typedefs): Use it instead of make_typename_type.
1367         PR c++/69300 - ICE with self-referential noexcept
1368         * pt.c (maybe_instantiate_noexcept): Check for recursion.
1370         PR c++/61022 - error with variadic template template parm
1371         * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
1373         PR c++/72801 - ICE with variadic partial specialization
1374         * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
1376         PR c++/55639 - partial specialization with ::template
1377         * parser.c (cp_parser_class_head): Handle ::template.
1379         PR c++/45976 - error with ::template in declarator.
1380         * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
1382         PR c++/54769 - wrong lookup of dependent template-name.
1383         * parser.c (cp_parser_template_name): Handle dependent object type.
1384         (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
1385         parameter.
1386         (cp_parser_id_expression): Pass it.
1387         (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
1389         * parser.c (cp_parser_template_id): Use the range location on the
1390         TEMPLATE_ID_EXPR.
1392         PR c++/81204 - parse error with dependent template-name
1393         * parser.c (cp_parser_lookup_name): Disqualify function templates
1394         after lookup.
1396 2017-06-27  Nathan Sidwell  <nathan@acm.org>
1398         * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
1399         initialization point.  Don't unnecessarily check for ctor name.
1401         * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
1402         (CLASSTYPE_DESTRUCTOR): ... this.
1403         * class.c (accessible_nvdtor_p,
1404         maybe_warn_about_overly_private_class,
1405         add_implicitly_declared_members,
1406         clone_constructors_and_destructors, type_has_virtual_destructor):
1407         Adjust for CLASSTYPE_DESTRUCTOR.
1408         (deduce_noexcept_on_destructors): Absorb into ...
1409         (check_bases_and_members): ... here.
1410         * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
1411         * init.c (build_delete): Likewise.
1412         * parser.c (cp_parser_lookup_name): Likewise.
1413         * pt.c (check_explicit_specialization): Likewise.
1414         * rtti.c (emit_support_tinfos): Likewise.
1415         * search.c (lookup_fnfields_idx_nolazy): Likewise.
1417         Kill IDENTIFIER_TEMPLATE.
1418         * cp-tree.h (lang_identifier): Remove class_template_info field.
1419         (IDENTIFIER_TEMPLATE): Delete.
1420         * name-lookup.c (constructor_name_full): Subsume into ...
1421         (constructor_name): ... here.  Don't check IDENTIFIER_TEMPLATE.
1422         (constructor_name_p): Likewise.
1423         * mangle.c (write_source_name): Likewise.
1424         * ptree.c (cxx_print_identifier): Likewise.
1426 2017-06-27  Marek Polacek  <polacek@redhat.com>
1428         PR bootstrap/81216
1429         * parser.c (cp_parser_already_scoped_statement): Initialize
1430         LOC_AFTER_LABELS.
1432 2017-06-26  Jason Merrill  <jason@redhat.com>
1434         PR c++/81215 - deduction failure with variadic TTP.
1435         * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
1437 2017-06-26  Martin Sebor  <msebor@redhat.com>
1439         PR c++/81169
1440         * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
1441         to detect casting away cv-qualifiers.
1443 2017-06-26  Nathan Sidwell  <nathan@acm.org>
1445         * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
1446         (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
1447         identifier.
1448         (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
1449         DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
1450         (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
1451         * decl.c (grok_op_properties): Adjust identifier checking.
1452         * init.c (expand_default_init): Adjust identifier descision.
1453         * method.c (implicitly_declare_fn): Don't use
1454         DECL_ASSIGNMENT_OPERATOR_P.
1455         * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
1456         IDENTIFIER_DTOR_P.
1457         * call.c (in_charge_arg_for_name): Reimplement.
1458         (build_special_member_call): Use IDENTIFIER_CDTOR_P,
1459         IDENTIFIER_DTOR_P.
1461 2017-06-26  Marek Polacek  <polacek@redhat.com>
1463         PR c/80116
1464         * parser.c (cp_parser_statement): Add a default argument.  Save the
1465         location of the expression-statement after labels have been parsed.
1466         (cp_parser_implicitly_scoped_statement): Set the location of the
1467         body of the conditional after parsing all the labels.  Call
1468         warn_for_multistatement_macros.
1469         (cp_parser_already_scoped_statement): Likewise.
1471 2017-06-24  Paolo Carlini  <paolo.carlini@oracle.com>
1473         PR c++/62315
1474         * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
1475         'typename' in error messages about missing 'typename'.
1477 2017-06-23  Jason Merrill  <jason@redhat.com>
1479         PR c++/79056 - C++17 ICE with invalid template syntax.
1480         * parser.c (cp_parser_simple_type_specifier): Don't assume that type
1481         is a TYPE_DECL.
1482         (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
1483         * pt.c (template_placeholder_p): New.
1484         * cp-tree.h: Declare it.
1486 2017-06-23  Marc Glisse  <marc.glisse@inria.fr>
1488         * decl.c (duplicate_decls): Use builtin_structptr_types.
1490 2017-06-22  Nathan Sidwell  <nathan@acm.org>
1492         Reorder IDENTIFIER flags
1493         gcc/cp/
1494         * cp-tree.h (enum cp_identifier_kind): New.
1495         (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
1496         IDENTIFIER_KIND_BIT_2): New.
1497         (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
1498         (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
1499         (C_IS_RESERVED_WORD): Replace with ...
1500         (IDENTIFIER_KEYWORD_P): ... this.
1501         (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
1502         (IDENTIFIER_CDTOR_P): ... this.
1503         (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
1504         (IDENTIFIER_OPNAME_P): Replace with ...
1505         (IDENTIFIER_ANY_OP_P): ... this.
1506         (IDENTIFIER_ASSIGN_OP_P): New.
1507         (IDENTIFIER_TYPENAME_P): Replace with ...
1508         (IDENTIFIER_CONV_OP_P): ... this.
1509         (NEW_DELETE_OPNAME_P): Replace with ...
1510         (IDENTIFIER_NEWDEL_OP_P): ... this.
1511         (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
1512         (get_identifier_kind_name, set_identifier_kind): Declare.
1513         * lex.c (get_identifier_kind_name, set_identifier_kind): New.
1514         (init_operators): Adjust to avoid keywords, use
1515         set_identifier_kind. Copy TYPE_EXPR slot.
1516         (init_reswords): Call set_identifier_kind.
1517         (unqualified_name_lookup_error): Adjust.
1518         * operators.def (TYPE_EXPR): Remove.
1519         * decl.c (struct predefined_identifier): Move into ...
1520         (initialize_predefined_identifiers): ... here.  Call
1521         set_identifier_kind.
1522         (grokfndecl, check_var_type, grokdeclarator): Adjust.
1523         (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
1524         space.  Adjust.
1525         * call.c (name_as_c_string): Adjust.
1526         (build_new_method_call_1): Likewise.
1527         * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
1528         * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
1529         * dump.c (cp_dump_tree): Adjust.
1530         * error.c (dump_decl_name): Adjust.
1531         * mangle.c (write_unqualified_id, write_member_name,
1532         write_expression): Adjust.
1533         (mangle_conv_op_name_for_type): Use set_identifier_kind.
1534         * name-lookup.c (do_class_using_decl): Adjust.
1535         (lookup_name_fuzzy, lookup_name_real_1): Likewise.
1536         * parser.c (cp_lexer_get_preprocessor_token,
1537         cp_parser_direct_declarator): Likewise.
1538         * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
1539         tsubst_copy, tsubst_copy_and_build): Adjust.
1540         * ptree.c (cxx_print_identifier): Print identifier kind.
1541         * search.c (lookup_field_r, lookup_member,
1542         lookup_fnfields_idx_nolazy): Adjust.
1543         * semantics.c (finish_id_expression): Adjust..
1544         * typeck.c (cp_build_addr_expr_1): Adjust.
1546 2017-06-21  Jakub Jelinek  <jakub@redhat.com>
1548         PR c++/81154
1549         * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
1550         Complain about t not being a variable if t is OVERLOAD even
1551         when processing_template_decl.
1553 2017-06-21  David Malcolm  <dmalcolm@redhat.com>
1555         * parser.c (get_cast_suggestion): New function.
1556         (maybe_add_cast_fixit): New function.
1557         (cp_parser_cast_expression): Capture the location of the closing
1558         parenthesis.  Call maybe_add_cast_fixit when emitting warnings
1559         about old-style casts.
1561 2017-06-20  Jason Merrill  <jason@redhat.com>
1563         PR c++/80972 - C++17 ICE with attribute packed.
1564         * call.c (build_over_call): Allow a TARGET_EXPR from reference
1565         binding.
1567 2017-06-20  Nathan Sidwell  <nathan@acm.org>
1569         * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
1570         (nelts_identifier): Delete.
1571         * decl.c (initialize_predefined_identifiers): Remove nelts.
1573         PR c++/67074 - namespace aliases
1574         * decl.c (duplicate_decls): Don't error here on mismatched
1575         namespace alias.
1576         * name-lookup.c (name_lookup::add_value): Matching namespaces are
1577         not ambiguous.
1578         (diagnose_name_conflict): Namespaces are never redeclarations.
1579         (update_binding): An alias can match a real namespace.
1581 2017-06-19  Jason Merrill  <jason@redhat.com>
1583         PR c++/80562 - ICE with constexpr if.
1584         * semantics.c (finish_if_stmt_cond): Call
1585         instantiate_non_dependent_expr.
1587         PR c++/80829 - ICE with constexpr copy of base subobject.
1588         * constexpr.c (clear_no_implicit_zero): New.
1589         (cxx_eval_call_expression): Call it.
1591 2017-06-19  Nathan Sidwell  <nathan@acm.org>
1593         PR c++/81124
1594         PR c++/79766
1595         * name-lookup.c (set_decl_namespace): Don't follow using
1596         directives and ignore using decls.  Only check overly-explicit
1597         scope after discovering decl.
1599 2017-06-19  Jason Merrill  <jason@redhat.com>
1601         PR c++/81073 - constexpr and static var in statement-expression.
1602         * typeck2.c (store_init_value): Always call
1603         require_potential_constant_expression.
1604         * pt.c (convert_nontype_argument): Likewise.
1605         * constexpr.c (potential_constant_expression_1): Adjust message.
1606         Use decl_maybe_constant_var_p instead of decl_constant_var_p.
1607         * decl2.c (decl_maybe_constant_var_p): Consider initializer.
1609 2017-06-19  Nathan Sidwell  <nathan@acm.org>
1611         * pt.c (coerce_template_parms): Fix indentation.
1612         (tsubst_decl): Remove repeated SET_DECL_RTL.  Move VAR_P handling
1613         in to single block.
1615         PR c++/81119
1616         * name-lookup.c (update_binding): Only warn about constructors
1617         hidden by functions.
1619 2017-06-17  Jason Merrill  <jason@redhat.com>
1621         PR c++/60063 - -Wunused-local-typedefs and templates.
1622         * decl2.c (is_late_template_attribute): Return false for "used".
1624         PR c++/70844 - -Wuseless-cast and inheriting constructor.
1625         * method.c (forward_parm): Suppress warn_useless_cast.
1627 2017-06-16  Jason Merrill  <jason@redhat.com>
1629         PR c++/81045 - Wrong type-dependence with auto return type.
1630         * pt.c (type_dependent_expression_p): An undeduced auto outside the
1631         template isn't dependent.
1632         * call.c (build_over_call): Instantiate undeduced auto even in a
1633         template.
1635         PR c++/80465 - ICE with generic lambda with noexcept-specifier.
1636         * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
1637         set longer for a generic lambda.
1639         PR c++/80614 - Wrong mangling for C++17 noexcept type
1640         * mangle.c (write_type): Put the eh spec back on the function type.
1642         PR c++/81102 - Wrong error with partial specialization.
1643         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
1644         types.  Do type deduction later.
1646         PR c++/81074 - ICE with partial specialization of member template.
1647         PR c++/71747
1648         * pt.c (get_partial_spec_bindings): Only coerce innermost args.
1650         PR c++/80831 - ICE with -fsyntax-only.
1651         * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
1653         PR c++/80639 - ICE with invalid PMF initialization.
1654         PR c++/80043 - ICE with -fpermissive
1655         * typeck.c (convert_for_assignment): Recurse when instantiate_type
1656         returns without an error.
1658 2017-06-16  Nathan Sidwell  <nathan@acm.org>
1660         * pt.c (tsubst_baselink): Fix & clarify formatting.
1662         * cp-tree.h (build_this_parm, cp_build_parm_decl,
1663         build_artificial_parm): Add FN parm.
1664         * decl.c (start_cleanup_fn): Adjust.
1665         (build_this_parm): Add FN parm, pass it through.
1666         (grokfndecl): Adjust parm building.
1667         * decl2.c (cp_build_parm_decl): Add FN parm, set context.
1668         (build_artificial_parm): Add FN parm, pass through.
1669         (maybe_retrofit_in_chrg): Adjust parm building.
1670         (start_static_storage_duration_function): Likwise.
1671         * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
1672         * method.c (implicitly_declare_fn): Likewise.
1673         * parser.c (inject_this_parameter): Likewise.
1675         Symbol tables are insert only.
1676         * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
1677         derive from pointer_hash.  Make undeletable.
1679         * class.c (resort_type_method_vec): Avoid potential unsigned
1680         overflow.
1682         Don't defer noexcept_deferred_spec.
1683         * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
1684         * decl.c (cxx_init_decl_processing): Initialize
1685         noexcept_deferred_spec.
1686         * except.c (unevaluated_noexcept_spec): Delete.
1687         * class.c (deduce_noexcept_on_destructor): Use
1688         noexcept_deferred_spec directly.
1689         * method.c (implicitly_declare_fn): Likewise.
1691         Make keyed_classes a vector.
1692         * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
1693         (keyed_classes): Declare as vector.
1694         * decl.c (keyed_classes): Define.
1695         (cxx_init_decl_processing): Allocate it.
1696         (record_key_method_defined): Use vec_safe_push.
1697         * class.c (finish_struct_1): Likewise.
1698         * pt.c (instantiate_class_template_1): Likewise.
1699         * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
1701         Make rtti lazier
1702         * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
1703         TK_VMI_CLASS_TYPES, TK_MAX.  Delete TK_FIXED.
1704         (tinfo_names): New.
1705         (typeid_ok_p): Add quotes to error messages.  Use get_tinfo_desc.
1706         (get_tinfo_decl): Use get_tinfo_desc.
1707         (get_pseudo_ti_init): Likewise. Adjust VMI construction.
1708         (create_pseudo_type_info): Delete.
1709         (get_pseudo_ti_index): Just determine the index.
1710         (get_tinfo_desc): New.  Create all types lazily.
1711         (create_tinfo_types): Just allocate the descriptor array.
1712         (emit_support_tinfos): Use non-inserting type lookup.  Set builtin
1713         location.
1715 2017-06-15  Martin Sebor  <msebor@redhat.com>
1717         PR c++/80560
1718         * call.c (first_non_public_field, maybe_warn_class_memaccess): New
1719         functions.
1720         (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
1721         (build_cxx_call): Call maybe_warn_class_memaccess.
1723 2017-06-14  Jakub Jelinek  <jakub@redhat.com>
1725         * cp-gimplify.c (cp_genericize_r): Turn most of the function
1726         into a switch (TREE_CODE (stmt)) statement from long else if
1727         sequence.
1729 2017-06-13  Jakub Jelinek  <jakub@redhat.com>
1731         PR c++/80973
1732         * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
1733         argument even if it has REFERENCE_TYPE.
1735         PR c++/80984
1736         * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
1737         BLOCK_VARS (outer) chain.
1738         (cxx_omp_const_qual_no_mutable): Likewise.
1740 2017-06-13  Martin Liska  <mliska@suse.cz>
1742         PR sanitize/78204
1743         * class.c (build_base_path): Use sanitize_flags_p.
1744         * cp-gimplify.c (cp_genericize_r): Likewise.
1745         (cp_genericize_tree): Likewise.
1746         (cp_genericize): Likewise.
1747         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1748         * decl.c (compute_array_index_type): Likewise.
1749         (start_preparsed_function): Likewise.
1750         * decl2.c (one_static_initialization_or_destruction): Likewise.
1751         * init.c (finish_length_check): Likewise.
1752         * lambda.c (maybe_add_lambda_conv_op): Likewise.
1753         * typeck.c (cp_build_binary_op): Likewise.
1754         (build_static_cast_1): Likewise.
1756 2017-06-11  Jason Merrill  <jason@redhat.com>
1758         * error.c (dump_expr): Use is_this_parameter.
1760         * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
1761         id_equal.
1763 2017-06-09  Jason Merrill  <jason@redhat.com>
1765         Missing bits from N4268, constant evaluation for all non-type args.
1766         * call.c (build_converted_constant_expr): Rename from
1767         build_integral_nontype_arg_conv, handle all types.
1768         * pt.c (convert_nontype_argument): In C++17 call it for all types.
1769         Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
1770         * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
1772         Overhaul pointer-to-member conversion and template argument handling.
1773         * call.c (standard_conversion): Avoid creating ck_pmem when the
1774         class type is the same.
1775         * cvt.c (can_convert_qual): Split from
1776         perform_qualification_conversions.
1777         * constexpr.c (cxx_eval_constant_expression): Check it.
1778         * typeck.c (convert_ptrmem): Only cplus_expand_constant if
1779         adjustment is necessary.
1780         * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
1781         (convert_nontype_argument): Avoid redundant error.
1783         * call.c (convert_like_real): Remove "inner" parameter.
1784         Don't replace a constant with its value.
1785         * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
1787         * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
1788         nullptr_node.
1790         * parser.c (cp_parser_constant_expression): Check
1791         potential_rvalue_constant_expression after decay_conversion.
1792         * pt.c (convert_nontype_argument): Don't require linkage in C++17.
1794         PR c++/80384 - ICE with dependent noexcept-specifier
1795         * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
1796         noexcept-specifier.
1798         * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
1800 2017-06-09  Jan Hubicka  <hubicka@ucw.cz>
1802         * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
1803         * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
1804         (excpet.c): Mark terminate as cold.
1806 2017-06-08  Jakub Jelinek  <jakub@redhat.com>
1808         PR c/81006
1809         * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
1810         to sizetype before size_binop.
1812         PR c++/81011
1813         * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
1814         to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
1815         and OMP_CLAUSE_SHARED_READONLY flags.
1817 2017-06-08  Jan Hubicka  <hubicka@ucw.cz>
1819         * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
1821 2017-06-07  Nathan Sidwell  <nathan@acm.org>
1823         * class.c (layout_class_type): Restructure overlong-bitfield tpe
1824         search.
1826 2017-06-07  Jonathan Wakely  <jwakely@redhat.com>
1828         PR c++/80990
1829         * pt.c (do_class_deduction): Build qualified type.
1831 2017-06-06  Nathan Sidwell  <nathan@acm.org>
1833         * name-lookup.c (suggest_alternatives_for): Use qualified lookup
1834         sans using directives.  Don't walk into inline namespaces.
1836         PR c++/80979
1837         * name-lookup.c (adl_class_only): Don't add visible friends.
1839 2017-06-05  Volker Reichelt  <v.reichelt@netcologne.de>
1841         * parser.c (cp_parser_base_specifier): Fix typos in error messages.
1843 2017-06-02  Nathan Sidwell  <nathan@acm.org>
1845         Remove lang_type_ptrmem.
1846         * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
1847         into ...
1848         (lang_type_class): ... this.  Reorder bitfields.  Rename to ...
1849         (lang_type): ... this.  Delete old definition.
1850         (lang_type_ptrmem): Delete.
1851         (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC.  Adjust uses.
1852         (LANG_TYPE_PTRMEM_CHECK): Delete.
1853         (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
1854         (TYPE_PTRMEMFUNC_TYPE): New.  Use TYPE_LANG_SLOT_1.
1855         * decl.c (build_ptrmemfunc_type): Adjust.
1856         * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
1857         (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
1858         
1859         * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
1860         setting.
1861         
1862         Remove cp_binding_level::namespaces
1863         * name-lookup.h (cp_binding_level): Lose namespaces field.
1864         * name-lookup.c (add_decl_to_level): Chain namespaces on the names
1865         list.
1866         (suggest_alternatives_for): Adjust for namespace list.  Do
1867         breadth-first search.
1868         * decl2.c (collect_source_refs): Namespaces are on the regulr
1869         list.
1870         (collect_ada_namespace): Likewise.
1872 2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1874         * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
1875         warning.
1877 2017-06-01  Ville Voutilainen  <ville.voutilainen@gmail.com>
1879         PR c++/80812
1880         * method.c (constructible_expr): Strip array types before calling
1881         build_value_init.
1883 2017-06-01  Paolo Carlini  <paolo.carlini@oracle.com>
1885         PR c++/80896
1886         * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
1887         for case INDIRECT_REF too in the main switch.
1889 2017-05-31  Jason Merrill  <jason@redhat.com>
1891         PR c++/80840 - ICE with constexpr and reference
1892         * pt.c (convert_nontype_argument): Don't test whether a decl is
1893         value-dependent when binding to a reference.
1895 2017-05-31  Nathan Sidwell  <nathan@acm.org>
1897         * cp-tree.h (lang_decl_slector): New enum.
1898         (lang_decl_base): Make selector an enum.  Drop decomposition_p
1899         field.
1900         (lang_decl): Use enum for discrimination.
1901         (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
1902         LANG_DECL_DEOMP_CHECK): Use enum.
1903         (DECL_DECOMPOSITION_P): Use selector value.
1904         (SET_DECL_DECOMPOSITION_P): Delete.
1905         (retrofit_lang_decl): Lose SEL parm.
1906         (fit_decomposition_lang_decl): Declare.
1907         * decl.c (cp_finish_decomp, grokdeclarator): Use
1908         fit_decomposition_lang_decl.
1909         * lex.c (maybe_add_lang_decl_raw): New. Broken out of
1910         retrofit_lang_decl.
1911         (set_decl_linkage): New.  Broken out of retrofit_lang_decl.  Use enum.
1912         (fit_decomposition_lang_decl): Likewise.
1913         (retrofit_lang_decl): Use worker functions.
1914         (cxx_dup_lang_specific_decl): Use selector enum.
1915         (maybe_add_lang_type_raw): New.  Broken out of ...
1916         (cxx_make_type_name): ... here.  Call it.
1918 2017-05-30  Jason Merrill  <jason@redhat.com>
1920         PR c++/80856 - ICE with local extern in template
1921         * semantics.c (finish_call_expr): Replace a local extern overload
1922         set in a template with the IDENTIFIER_NODE.
1924 2017-05-30  David Malcolm  <dmalcolm@redhat.com>
1926         * call.c (perform_implicit_conversion_flags): Convert
1927         "from %qT to %qT" to "from %qH to %qI" in diagnostic.
1928         (print_conversion_rejection): Replace pairs of %qT with
1929         %qH and %qI in various places.
1930         (build_user_type_conversion_1): Likewise.
1931         (build_integral_nontype_arg_conv): Likewise.
1932         (build_conditional_expr_1): Likewise.
1933         (convert_like_real): Likewise.
1934         (convert_arg_to_ellipsis): Likewise.
1935         (joust): Likewise.
1936         (initialize_reference): Likewise.
1937         * cvt.c (cp_convert_to_pointer): Likewise.
1938         (cp_convert_to_pointer): Likewise.
1939         (convert_to_reference): Likewise.
1940         (ocp_convert): Likewise.
1941         * error.c (cp_printer): Gain bool and const char ** parameters.
1942         (struct deferred_printed_type): New struct.
1943         (class cxx_format_postprocessor): New class.
1944         (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
1945         to pp->m_format_postprocessor.
1946         (comparable_template_types_p): New function.
1947         (newline_and_indent): New function.
1948         (arg_to_string): New function.
1949         (print_nonequal_arg): New function.
1950         (print_template_differences): New function.
1951         (type_to_string_with_compare): New function.
1952         (print_template_tree_comparison): New function.
1953         (append_formatted_chunk): New function.
1954         (add_quotes): New function.
1955         (cxx_format_postprocessor::handle): New function.
1956         (defer_phase_2_of_type_diff): New function.
1957         (cp_printer): Add "quoted" and "buffer_ptr" params.  Implement
1958         %H and %I.
1959         * typeck.c (cp_build_binary_op): Replace pairs of %qT with
1960         %qH and %qI in various places.
1961         (convert_member_func_to_ptr): Likewise.
1962         (build_reinterpret_cast_1): Likewise.
1963         (convert_for_assignment): Likewise.
1964         * typeck2.c (check_narrowing): Likewise.
1966 2017-05-30  Nathan Sidwell  <nathan@acm.org>
1968         Kill IDENTIFIER_NAMESPACE_BINDINGS
1969         * cp-tree.h (lang_identifier): Delete namespace_bindings.
1970         (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
1971         (lang_decl_ns): Add bindings.
1972         (DECL_NAMESPACE_BINDINGS): New.
1973         * lex.c (retrofit_lang_decl): Create namespace hash table.
1974         * name-lookup.c (find_namespace_slot): Change to use hash-map.
1975         * ptree.c (cxx_print_binding): Delete.
1976         (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
1978         * cp-tree.def (OVERLOAD): Fix comment.
1979         * cp-tree.h: Fix comments and whitespace.
1980         * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
1981         * name-lookup.c (add_decl_to_level): Assert not class.
1982         (check_local_shadow): Use OVL_P.
1983         (pushdecl_with_scope_1): Rename to ...
1984         (do_pushdecl_with_Scope): ... here.
1985         (do_nonmember_using_decl): Use qualified_namespace_lookup return
1986         value.
1987         (push_class_level_binding_1): Use OVL_P.
1988         (pushdecl_namespace_level): Use do_pushdecl_with_scope.
1989         (pushtag_1): Rename to ...
1990         (do_pushtag): ... here.  Adjust do_pushdecl_with_scope call.
1991         (pushtag): Adjust.
1992         (store_class_bindings): Do not time here.
1993         * name-lookup.h (pushdecl_outermost_localscope): Reorder.
1994         * pt.c (listify): Declare argvec at point of initialization.
1996         PR c++/80913
1997         * name-lookup.c (add_decl_to_level): Assert not making a circular
1998         chain.
1999         (update_binding): Don't prematurely slide artificial decl.
2001 2017-05-29  Alexandre Oliva <aoliva@redhat.com>
2003         * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
2005 2017-05-29  Nathan Sidwell  <nathan@acm.org>
2007         PR c++/80891 (#1,#5)
2008         * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
2009         * name-lookup.c (name_lookup): Add deduping field.
2010         (name_lookup::preserve_state, name_lookup::restore_state): Deal
2011         with deduping.
2012         (name_lookup::add_overload): New.
2013         (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
2014         (name_lookup::search_adl): Set deduping.  Don't unmark here.
2015         * pt.c (most_specialized_instantiation): Revert previous change,
2016         Assert not given duplicates.
2017         * tree.c (lookup_mark): Just mark the underlying decls.
2018         (lookup_maybe_add): Dedup using marked decls.
2020         PR c++/80891 (#4)
2021         * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
2022         * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
2024         Stat hack representation
2025         * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
2026         MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
2027         (stat_hack): New.
2028         (find_namespace_binding): Replace with ...
2029         (find_namespace_slot): ... this.
2030         (find_namespace_value): New.
2031         (name_lookup::search_namespace_only,
2032         name_lookup::adl_namespace_only): Adjust.
2033         (update_binding): Add SLOT parameter, adjust.
2034         (check_local_shadow): Use find_namespace_value.
2035         (set_local_extern_decl_linkage): Likewise.
2036         (do_pushdecl): Adjust for namespace slot.
2037         (push_local_binding): Assert not a namespace binding.
2038         (check_for_out_of_scope_variable): Use find_namespace_value.
2039         (set_identifier_type_value_with_scope): Likewise.
2040         (get_namespace_binding): Likewise.
2041         (set_namespace_binding): Delete.
2042         (set_global_binding): Directly update the binding.
2043         (finish_namespace_using_decl): Likewise.
2044         (lookup_type_scope_1): Use find_namespace_slot and update.
2045         (do_push_nested_namespace): Use find_namespace_value.
2047         PR c++/80891 (#1)
2048         * pt.c (most_specialized_instantiation): Cope with duplicate
2049         instantiations.
2051         PR c++/80891 (#3)
2052         * cp-tree.h (build_min_nt_call_vec): Declare.
2053         * decl.c (build_offset_ref_call_from_tree): Call it.
2054         * parser.c (cp_parser_postfix_expression): Likewise.
2055         * pt.c (tsubst_copy_and_build): Likewise.
2056         * semantics.c (finish_call_expr): Likewise.
2057         * tree.c (build_min_nt_loc): Keep unresolved lookups.
2058         (build_min): Likewise.
2059         (build_min_non_dep): Likewise.
2060         (build_min_non_dep_call_vec): Likewise.
2061         (build_min_nt_call_vec): New.
2063         PR c++/80891 (#2)
2064         * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
2065         (ovl_used): New.
2066         (lookup_keep): Call it.
2068 2017-05-26  Nathan Sidwell  <nathan@acm.org>
2070         Implement DR2061
2071         * name-lookup.c (push_inline_namespaces): New.
2072         (push_namespace): Look inside inline namespaces.
2074         Inline and using namespace representation change.
2075         * cp-tree.h (struct lang_decl_ns): Delete ns_using.  Add usings,
2076         inlinees as vector.
2077         (DECL_NAMESPACE_USING): Adjust.
2078         (DECL_NAMESPACE_INLINEES): New.
2079         * name-lookup.h (struct cp_binding_level): Change usings
2080         representation.
2081         * name-lookup.c (name_lookup::do_queue_usings,
2082         name_lookup::queue_usings): Adjust.
2083         (name_lookup::search_namespace, name_lookup::search_usings,
2084         name_lookup::queue_namespace): Adjust.
2085         (name_lookup::adl_namespace_only): Adjust.
2086         (add_using_namespace, push_namespace): Push onto vector.
2087         (pop_namespace): Add timing logic.
2089         * call.c (build_operator_new_call): Do namelookup and ADL here.
2090         (build_new_op_1): Likewise.
2091         * name-lookup.h (lookup_function_nonclass): Delete declaration.
2092         (do_using_directive): Likewise.
2093         * name-lookup.c (set_namespace_binding, push_local_binding): Don't
2094         declare early.
2095         (struct scope_binding): Delete.
2096         (EMPTY_SCOPE_BINDING): Delete.
2097         (set_decl_namespace): Use OVL_P.
2098         (finish_local_using_decl): Lose unnecesary checks.
2099         (lookup_function_nonclass): Delete.
2100         (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
2102         * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
2103         (ovl_iterator): Add allow_inner field.  Adjust ctor.  Make
2104         unduplicatable.
2105         (ovl_iterator::maybe_push, ovl_iterator::pop): New.
2106         (lkp_iterator): Add outer field.  Adjust ctor.
2107         (lkp_iterator::operator++): New.
2108         (lookup_mark, lookup_maybe_add): Declare.
2109         * name-lookup.c (name_lookup): Delete fn_set member.
2110         (name_lookup::preserve_state, name_lookup::restore_state): Unmark
2111         and mark lookup.
2112         (name_lookup::add_value): Use lookup_add directly.
2113         (name_lookup::add_fns: Use lookup_maybe_add.
2114         (name_lookup::search_adl): Mark and unmark fns.
2115         (pushdecl): Adjust.
2116         * pt.c (check_explicit_specialization): Use lookup_add directly.
2117         * ptree.c (cxx_print_xnode): Show complete overload structure.
2118         * tree.c (lookup_mark, lookup_maybe_add): New.
2120         * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
2122 2017-05-26  Jakub Jelinek  <jakub@redhat.com>
2124         * cp-tree.h (struct lang_decl_decomp): New type.
2125         (struct lang_decl): Add u.decomp.
2126         (LANG_DECL_DECOMP_CHECK): Define.
2127         (DECL_DECOMPOSITION_P): Note it is set also on the vars
2128         for user identifiers.
2129         (DECL_DECOMP_BASE): Define.
2130         (retrofit_lang_decl): Add extra int = 0 argument.
2131         * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
2132         use it to influence the selector choices and for selector
2133         0 to non-zero transition copy old content.
2134         (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
2135         * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
2136         !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR.  Adjust warning
2137         wording if decl is a structured binding.
2138         (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
2139         Set DECL_DECOMP_BASE.  Ignore DECL_READ_P sets from initialization
2140         of individual variables for tuple structured bindings.
2141         (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
2142         Clear DECL_DECOMP_BASE.
2143         * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
2144         * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
2145         is expected.
2146         * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
2147         DECL_VALUE_EXPR.
2149 2017-05-25  Jason Merrill  <jason@redhat.com>
2151         PR c++/80605 - __is_standard_layout and zero-length array
2152         * class.c (check_bases): Use DECL_FIELD_IS_BASE.
2154 2017-05-25  Nathan Sidwell  <nathan@acm.org>
2156         Kill OVL_CURRENT, OVL_NEXT.
2157         * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
2158         * name-lookup.c (set_decl_namespace): Use ovl_iterator.
2159         (consider_binding_level): Use OVL_FIRST.
2160         (cp_emit_debug_info_for_using): Use lkp_iterator.
2161         * pt.c (check_explicit_specialization): Use ovl_iterator.       
2163         Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
2164         * cp-tree.h (lang_decl_ns): Remove ns_users field.
2165         (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
2166         (TREE_INDIRECT_USING): Delete.
2167         * name-lookup.h (is_associated_namespace): Delete.
2168         * name-lookup.c (name_lookup::search_usings,
2169         name_lookup::do_queue_usings): Usings are always direct.
2170         (is_associated_namespace): Delete.
2171         (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
2172         (namespace_ancestor_1, namespace_ancestor): Delete.
2173         (push_using_directive_1, push_using_directive): Delete.
2174         (add_using_namespace_1): Delete.
2175         (add_using_namespace): Reimplement.
2176         (emit_debug_info_using_namespace): New.
2177         (finish_namespace_using_directive, finish_local_using_directive,
2178         push_namespace): Adjust.
2179         * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
2181 2017-05-25  Volker Reichelt  <v.reichelt@netcologne.de>
2183         * semantics.c (finish_handler_parms): Warn about non-reference type
2184         catch handlers.
2186 2017-05-25  Nathan Sidwell  <nathan@acm.org>
2188         Reimplement unqualified namespace lookup.
2189         * name-lookup.c (name_lookup::using_pair,
2190         name_lookup::using_queue): New typedefs.
2191         (name_lookup::queue_namespace, name_lookup::do_queue_usings,
2192         name_lookup::queue_usings): New.
2193         (name_lookup::search_unqualified): New.
2194         (merge_functions, same_entity_p, ambiguous_decl,
2195         unqualified_namespace_lookup_1, unqualified_namespace_lookup,
2196         lookup_using_namespace): Delete.
2197         (lookup_name_real_1): Adjust.
2199         Reimplement qualified namespace lookup.
2200         * name-lookup.c (name_lookup::flags): New member.  Adjust ctor.
2201         (name_lookup::ambiguous, name_lookup::add_value,
2202         name_lookup::add_type, name_lookup::process_binding): New.
2203         (name_lookup::search_namespace_only,
2204         name_lookup::search_namespace, name_lookup::search_usings): New.
2205         (name_lookup::search_qualified): New.
2206         (do_nonmember_using_decl, suggest_alternatives_for,
2207         lookup_qualified_name): Adjust.
2208         (tree_vec_contains): Delete.
2209         (qualified_lookup_using_namespace): Rename to ...
2210         (qualified_namespace_lookup): ... here.  Reimplement.
2212         Reimplement ADL.
2213         * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
2214         * name-lookup.h (lookup_arg_dependent): Return plain tree.
2215         * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
2216         arg_assoc_args_vec, arg_assoc_type, add_function,
2217         arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
2218         arg_assoc_class, arg_assoc_template_arg, arg_assoc,
2219         lookup_arg_dependent_1): Delete.
2220         (name_lookup): New lookup object.
2221         (name_lookup::preserve_state, name_lookup::restore_state,
2222         name_lookup::mark_seen, name_lookup::find_and_mark,
2223         name_lookup::add_fns, name_lookup::adl_namespace_only,
2224         name_lookup::adl_namespace, name_lookup::adl_class_only,
2225         name_lookup::adl_bases, name_lookup::adl_class,
2226         name_lookup::adl_expr, name_lookup::adl_type,
2227         name_lookup::adl_template_arg, name_lookup::search_adl): New.
2228         (lookup_arg_dependent): Return a plain tree.  Adjust.
2229         (is_associated_namespace): Move later.
2230         
2231 2017-05-24  Nathan Sidwell  <nathan@acm.org>
2233         * friend.c (do_friend): Remove check for existing decl.
2234         * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
2235         * name-lookup.c (push_local_binding): Directly look for binding.
2236         (lookup_name_innermost_nonclass_level_1): Delete.
2237         (lookup_name_innermost_nonclass_level): Delete.
2239         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
2241         * cp-tree.h (cp_free_lang_data): Add extern.
2242         (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
2243         ATTRIBUTE_PURE.
2244         (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
2245         * typeck.c (type_unknown_p): Delete.
2246         * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
2247         overload management.
2248         (dependent_name): Likewise.
2249         (decl_anon_ns_mem_p): Simplify.
2251 2017-05-24  Jonathan Wakely  <jwakely@redhat.com>
2253         PR c++/80544
2254         * tree.c (reshape_init): Use unqualified type for direct enum init.
2255         * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
2256         (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
2257         non-class destination types.
2258         (build_const_cast_1): Strip cv-quals from destination types.
2259         (build_static_cast, build_reinterpret_cast, build_const_cast)
2260         (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
2262 2017-05-24  Martin Sebor  <msebor@redhat.com>
2264         PR c/80731
2265         * call.c (fully_fold_internal): Adjust.
2267 2017-05-24  Nathan Sidwell  <nathan@acm.org>
2269         * cp-tree.h (ovl_skip_hidden): Declare.
2270         * tree.c (ovl_skip_hidden): New.
2271         * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
2272         (lookup_arg_dependent_1): Likewise.
2273         (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
2274         (hidden_name_p, remove_hidden_names): Delete.
2275         (lookup_name_real_1): Do not strip hidden names.
2276         * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
2278         * cp-tree.h (OVL_HIDDEN_P): New.
2279         (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
2280         (ovl_iterator::reveal_node): Declare.
2281         * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
2282         (ovl_insert): Order on hiddenness.
2283         (ovl_iterator::reveal_node): New.
2284         * name-lookup.c (anticipated_builtin_p): New.
2285         (supplement_binding_1): Use it.
2286         (set_local_extern_decl_linkage): Use hidden_p.
2287         (do_pushdecl): Deal with unhiding a hidden decl, use
2288         anticipated_builtin_p.
2289         (do_nonmember_using_decl): Use anticipated_decl_p.
2290         (lookup_name_real_1): Use DECL_HIDDEN_P.
2292 2017-05-23  Jason Merrill  <jason@redhat.com>
2294         -Wunused and C++17 structured bindings
2295         * decl.c (poplevel): Don't warn about unused structured bindings,
2296         only real variables.
2297         * error.c (dump_simple_decl): Handle structured bindings.
2298         * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
2300 2017-05-23  Nathan Sidwell  <nathan@acm.org>
2302         * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
2303         * name-lookup.c (create_local_binding): New.
2304         (update_binding): New.
2305         (pushdecl_maybe_friend_1): Rename to ...
2306         (do_pushdecl): ... this.  Reimplement.
2307         (pushdecl): Adjust.
2308         (push_overloaded_decl_1, push_overloaded_decl): Delete.
2310 2017-05-23  Jason Merrill  <jason@redhat.com>
2312         PR c++/80396 - built-in for make_integer_sequence.
2313         * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
2314         (expand_integer_pack, expand_builtin_pack_call): New.
2315         (find_parameter_packs_r): Check builtin_pack_call_p.
2316         (check_for_bare_parameter_packs): Handle it.
2317         (tsubst_pack_expansion): Call expand_builtin_pack_call.
2318         (declare_integer_pack): New.
2319         (init_template_processing): Call it.
2320         * decl2.c (mark_used): Check builtin_pack_fn_p.
2322 2017-05-23  Nathan Sidwell  <nathan@acm.org>
2324         * name-lookup.c (find_namespace_binding): New.
2325         (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
2326         (set_identifier_type_value_with_scope): Use find_namespace_binding.
2327         (find_binding, cp_binding_level_find_binding_for_name,
2328         binding_for_name, namespace_binding_1): Delete.
2329         (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
2330         (get_namespace_binding, set_namespace_binding,
2331         finish_namespace_using_decl, unqualified_namespace_lookup_1,
2332         qualified_lookup_using_namespace, lookup_type_scope_1,
2333         lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
2335         PR c++/80866
2336         * parser.c (cp_parser_template_id): Keep the lookup when stashing
2337         the template_id.
2339         * cp-tree.h (DECL_HIDDEN_P): New.
2340         * name-lookup.c (set_decl_context,
2341         set_local_extern_decl_linkage): New, broken out of ...
2342         (pushdecl_maybe_friend_1): ... here.  Call them.
2344 2017-05-23  Thomas Schwinge  <thomas@codesourcery.com>
2346         * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
2347         "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
2348         "VECTOR_LENGTH".
2350 2017-05-23  Nathan Sidwell  <nathan@acm.org>
2352         * cp-tree.h (OVL_P): New.
2353         * name-lookup.h (push_local_binding): Delete.
2354         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
2355         (finish_namespace_using_decl, finish_local_using_decl): ... here
2356         * name-lookup.c (add_decl_to_level): Swap args.
2357         (pop_bindings_and_leave_scope): Look inside TREE_LIST.
2358         (diagnose_name_conflict): Check contexts are same for redecl.
2359         (update_local_overload): New.
2360         (compparms_for_decl_and_using): Rename to ...
2361         (matching_fn_p): ... here.
2362         (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
2363         push_local_bindings call.
2364         (push_local_binding): Make static, replace FLAGS arg with
2365         IS_USING.
2366         (validate_nonmember_using_decl): Use OVL_FIRST.
2367         (do_nonmember_using_decl): Use in/out parameters.  Use
2368         lkp_iterator and simplify.
2369         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
2370         (finish_namespace_using_decl, finish_local_using_decl): ... here.
2371         Adjust.
2372         (lookup_type_current_level): Delete.
2373         * parser.c (cp_parser_using_declaration): Adjust.
2374         * pt.c (tsubst_expr): Adjust.
2376 2017-05-22  Nathan Sidwell  <nathan@acm.org>
2378         * name-lookup.h (parse_using_directive): Replace with ...
2379         (finish_namespace_using_directive): ... this and ...
2380         (finish_local_using_directive): ... this.
2381         * name-lookup.c (add_using_namespace_1): Move later.
2382         (add_using_namespace): Move later, add namespace_p arg, remove
2383         indirect arg.
2384         (push_using_directive_1): Directly recurse.
2385         (do_using_directive, parse_using_directive): Delete, split into ...
2386         (finish_namespace_using_directive): ... this and ...
2387         (finish_local_using_directive): ... this.
2388         (push_namespace): Use add_using_namespace.
2389         * parser.c (cp_parser_using_directive): Call
2390         finish_namespace_using_directive or finish_local_using_directive.
2391         * pt.c (tsubst_expr): Call finish_local_using_directive.
2393         * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
2394         * cp-tree.h (raw_dump_id): Declare.
2395         * decl2.c (raw_dump_id): Define.
2396         (dump_tu): Use raw_dump_id.
2398         * config-lang.in (gtfiles): Sort list, break lines.
2400         * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
2401         (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
2402         ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
2403         CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
2404         CPTI_RETHROW_FN): New.
2405         (noexcept_deferred_spec): New.
2406         (terminate_node, call_unexpected_node): Rename to ...
2407         (terminate_fn, call_unexpected_fn): ... here.
2408         (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
2409         allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
2410         * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
2411         (init_exception_processing): Adjust.
2412         (declare_library_fn): Create and push the fns here.
2413         (do_get_exception_ptr, do_begin_catch, do_end_catch,
2414         do_allocate_exception_ptr, do_free_exception_ptr): Adjust
2415         declare_library_fn use.
2416         (unevaluated_noexcept_spec): Adjust.
2417         * cp-gimplify.c (genericize_eh_spec_block,
2418         gimplify_most_not_throw_expr): Adjust.
2420         * name-lookup.c (pushdecl_top_level,
2421         pushdecl_top_level_and_finish): Move after namespace pushing and
2422         popping functions.
2423         (push_to_top_level): Rename to ...
2424         (do_push_to_top_level): ... here.  Remove timing code.
2425         (pop_from_top_level_1): Rename to ...
2426         (do_pop_from_top_level): ... here.
2427         (do_push_nested_namespace, do_pop_nested_namespace)
2428         (push_to_top_level): New wrapper for do_push_to_top_level.
2429         (pop_from_top_level): Adjust.
2430         (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
2432 2017-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
2434         * config-lang.in (gtfiles): Add c-family/c-format.c,
2435         except.c, init.c, lambda.c and friend.c.
2436         * class.c (dvirt_fn): Move out of function scope,
2437         add GTY attribute.
2438         * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
2439         * init.c (fn): Likewise.
2440         * lambda.c (ptr_id, max_id): Likewise.
2441         * friend.c (global_friend): Add GTY attribute.
2443 2017-05-19  Nathan Sidwell  <nathan@acm.org>
2445         * call.c (add_list_candidates): Use OVL_FIRST.
2446         (build_new_method_call_1): Likewise.
2447         * cp-tree.h (OVL_SINGLE_P): New.
2448         (TYPE_HIDDEN_P): New.
2449         * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
2450         * dump.c (cp_tump_tree): Adjust overload dumping.
2451         * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
2452         printing.
2453         * method.c (lazily_declare_fn): Assert we added it.
2454         * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
2455         OVL_FIRST.
2456         (cp_parser_template_name): Use lkp_iterator.
2457         * pt.c (begin_template_parm_list): Fixup comment.
2458         (instantiate_class_template_1): Use TYPE_HIDDEN_P.
2459         * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
2460         (ovl_scope): Use lkp_iterator.
2462 2017-05-19  Thomas Schwinge  <thomas@codesourcery.com>
2464         * parser.c (cp_parser_omp_clause_default): Handle
2465         "OMP_CLAUSE_DEFAULT_PRESENT".
2467         * parser.c (cp_parser_omp_clause_default): Avoid printing more
2468         than one syntax error message.
2470 2017-05-19  Nathan Sidwell  <nathan@acm.org>
2472         * class.c (class_dump_id): Define.
2473         (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
2474         * cp-objcp-common.c (cp_register_dumps): New.
2475         * cp-objcp-common.h (cp_register_dumps): Declare.
2476         (LANG_HOOKS_REGISTER_DUMPS): Override.
2477         * cp-tree.h (class_dump_id): Declare.
2479 2017-05-18  Nathan Sidwell  <nathan@acm.org>
2481         * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
2482         (OVL_USED_P): New.
2483         (lookup_keep): Declare.
2484         * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
2485         * pt.c (tsubst_copy): Assert lookup is persistent.
2486         * semantics.c (finish_call_expr): Use lkp_iterator, call
2487         lookup_keep.
2488         * tree.c (ovl_copy): New.
2489         (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
2490         (lookup_keep): New.
2492         * cp-tree.h (OVL_USED): Replace with ...
2493         (OVL_USING_P): ... this.
2494         (ovl_iterator::using_p): Adjust.
2495         * name-lookup.c (push_overloaded_decl_1,
2496         do_nonmember_using_decl): Adjust.
2497         * search.c (lookup_field_r): Adjust.
2498         * tree.c (ovl_insert, ovl_scope): Adjust.
2500         * cp-tree.h (lookup_add): Swap args.
2501         (ovl_cons, build_overload): Delete.
2502         * name-lookup.c (add_function, push_overloaded_decl_1,
2503         do_nonmember_using_decl, merge_functions, remove_hidden_names):
2504         Use lookup_add, ovl_insert.
2505         * pt.c (check_explicit_specialization): Use lookup_add.
2506         (do_class_deduction): Likewise. Refactor if.
2507         * tree.c (lookup_add): Swap args.
2508         (ovl_cons, build_overload): Delete.
2510         * name-lookup.c (find_local_binding): New, broken out of ...
2511         (lookup_name_innermost_nonclass_level_1): ... here.  Call it.
2512         (set_namespace_binding): Swap scope & name args.
2513         (namespace_binding_1): Likewise.
2514         (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
2515         (push_overloaded_decl_1): Likewise.
2516         (set_global_binding): Likewise.
2517         (get_namespace_binding): Adjust namespace_binding_1 call.
2519 2017-05-17  Nathan Sidwell  <nathan@acm.org>
2521         * cp-tree.h (default_hash_traits <lang_identifier *>): New
2522         specialization.
2523         * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
2524         (extern_c_fns): New hash table.
2525         (check_extern_c_conflict): New, broken out of ...
2526         (pushdecl_maybe_friend_1): ... here.  Call it.
2527         (c_linkage_bindings): Just look in hash table.
2529 2017-05-17  Ville Voutilainen  <ville.voutilainen@gmail.com>
2531         PR c++/80654
2532         PR c++/80682
2533         Implement new C++ intrinsics __is_assignable and __is_constructible.
2534         * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
2535         (is_xible): New.
2536         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
2537         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2538         * method.c (constructible_expr): Set cp_unevaluated.
2539         (is_xible_helper): New.
2540         (is_trivially_xible): Adjust.
2541         (is_xible): New.
2542         * parser.c (cp_parser_primary_expression): Handle
2543         RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
2544         (cp_parser_trait_expr): Likewise.
2545         * semantics.c (trait_expr_value): Handle
2546         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2548 2017-05-17  Nathan Sidwell  <nathan@acm.org>
2550         * cp-tree.h (ovl_iterator::using_p): New predicate.
2551         (ovl_iterator::remove_node): New worker.
2552         (ovl_insert): Declare.
2553         * tree.c (ovl_insert): New.
2554         (ovl_iterator::remove_node): New.
2555         * class.c (add_method): Use ovl_iterator, ovl_insert.
2556         (clone_function_decl): Fix description.
2557         (clone_constructors_and_destructors): Use ovl_iterator.
2559         * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
2560         (maybe_warn_about_overly_private_class): Use ovl_iterator.
2561         (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
2562         (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
2563         (get_base_fndecls): Use ovl_iterator.
2564         (warn_hidden): Use OVL_NAME, ovl_iterator.
2565         (add_implicitly_declared_members): Use ovl_iterator.
2566         * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
2567         flatten nested if.
2568         (finish_shorthand_constraint): Simplify, use ovl_make.
2569         * pt.c (make_constrained_auto): Simplify.  Use ovl_make.
2570         * search.c (shared_member_p): Use ovl_iterator.
2571         (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
2572         (lookup_conversion_operator): Use OVL_FIRST.
2573         (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
2574         (look_for_overrides_here): Use ovl_iterator.
2575         (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
2576         * typeck.c (build_x_unary_op): Use ovl_make.
2578 2017-05-17  Martin Liska  <mliska@suse.cz>
2580         * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
2581         use it instead of int type.
2582         (dump_vtable): Likewise.
2583         (dump_vtt): Likewise.
2584         * decl2.c (dump_tu): Likewise.
2586 2017-05-16  David Malcolm  <dmalcolm@redhat.com>
2588         * call.c (enforce_access): Add access_failure_info * param and use
2589         it to record access failures.
2590         * cp-tree.h (class access_failure_info): New class.
2591         (enforce_access): Add access_failure_info * param, defaulting to
2592         NULL.
2593         (lookup_member): Likewise.
2594         (locate_field_accessor): New function decl.
2595         (perform_or_defer_access_check): Add access_failure_info * param,
2596         defaulting to NULL.
2597         * search.c (lookup_member): Add access_failure_info * param and
2598         pass it on to call to perform_or_defer_access_check.
2599         (matches_code_and_type_p): New function.
2600         (field_access_p): New function.
2601         (direct_accessor_p): New function.
2602         (reference_accessor_p): New function.
2603         (field_accessor_p): New function.
2604         (struct locate_field_data): New struct.
2605         (dfs_locate_field_accessor_pre): New function.
2606         (locate_field_accessor): New function.
2607         * semantics.c (perform_or_defer_access_check): Add
2608         access_failure_info * param, and pass it on to call to
2609         enforce_access.
2610         * typeck.c (access_failure_info::record_access_failure): New method.
2611         (access_failure_info::maybe_suggest_accessor): New method.
2612         (finish_class_member_access_expr): Pass an access_failure_info
2613         instance to the lookup_member call, and call its
2614         maybe_suggest_accessor method afterwards.
2616 2017-05-16  Marek Polacek  <polacek@redhat.com>
2618         PR sanitizer/80536
2619         PR sanitizer/80386
2620         * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
2622 2017-05-16  Nathan Sidwell  <nathan@acm.org>
2624         * name-lookup.c (check_local_shadow): New, broke out of ...
2625         (pushdecl_maybe_friend_1): ... here.  Call it.
2627         * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
2628         (ovl_first): Move inline definition to end of file.
2629         (ovl_make, lookup_add): Declare.
2630         (get_fns, get_first_fn): Make pure.
2631         * tree.c (ovl_cache): New.
2632         (ovl_make, lookup_add): New.
2633         * pt.c (do_class_deduction): Don't add candidates that will be
2634         elided.
2636         * call.c (build_user_type_conversion_1): Use OVL_FIRST.
2637         (print_error_for_call_failure): Use OVL_NAME.
2638         (build_op_call_1): Use ovl_iterator.
2639         (add_candidates): Use OVL_FIRST & lkp_iterator.
2640         (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
2641         lkp_iterator.
2642         * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
2643         (type_has_user_nondefault_constructor,
2644         in_class_defaulted_default_constructor,
2645         type_has_user_provided_constructor,
2646         type_has_user_provided_or_explicit_constructor,
2647         type_has_non_user_provided_default_constructor,
2648         vbase_has_user_provided_move_assign,
2649         type_has_move_constructor, type_has_move_assign,
2650         type_has_user_declared_move_constructor,
2651         type_has_user_declared_move_assign,
2652         type_build_ctor_call, type_build_dtor_call,
2653         type_requires_array_cookie, explain_non_literal_class): Likewise.
2654         (finish_struct): Use lkp_iterator.
2655         (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
2656         (note_name_declared_in_class): Use OVL_NAME.
2657         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
2658         (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
2659         cxx_pretty_printer::expression): Likewise.
2660         * decl2.c (check_classfn): Use ovl_iterator.
2661         * pt.c (retrieve_specialization): Use ovl_iterator.
2662         * tree.c (cp_tree_equal): Use lkp_iterator.
2663         (type_has_nontrivial_copy_init): Use ovl_iterator.
2665         * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
2666         check is_overloaded_fn.
2668 2017-05-16  Martin Liska  <mliska@suse.cz>
2670         * parser.c (cp_lexer_print_token): Add default value for flags
2671         argument of print_gimple_stmt, print_gimple_expr,
2672         print_generic_stmt and print_generic_expr.
2674 2017-05-16  Nathan Sidwell  <nathan@acm.org>
2676         * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
2677         iterators.
2678         (MAYBE_BASELINK_FUNCTIONS): New.
2679         * constraint.cc (resolve_constraint_check): Use lkp_iterator.
2680         * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
2681         * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
2682         * method.c (inherited_ctor_binfo): Use ovl_iterator.
2683         (binfo_inherited_from): Likewise.
2684         * parser.c (lookup_literal_operator): Use lkp_iterator.
2685         * pt.c (iterative_hash_template_arg): Use lkp_iterator.
2686         (print_candidates_1): Likewise.
2687         (determine_specialization): Likewise.
2688         (resolve_overloaded_unification): Likewise.
2689         (resolve_nondeduced_context): Likewise.
2690         (type_dependent_expression_p): Likewise.
2691         (dependent_template_p): Likewise.
2692         * ptree.c (cxx_print_xnode): Likewise.
2693         * semantics.c (omp_reduction_lookup): Use lkp_iterator.
2694         (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
2695         * typeck.c (check_template_keyword): Use lkp_iterator.
2697         * cp-tree.h (OVL_FIRST, OVL_NAME): New.
2698         (ovl_first): New.
2699         * constexpr.c (function_concept_check): Use OVL_FIRST.
2700         * cvt.c (build_expr_type_conversion): Likewise.
2701         * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
2702         * decl2.c (mark_used): Use OVL_FIRST.
2703         * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
2704         (dump_expr, location_of): Use OVL_FIRST.
2705         * friend.c (do_friend): Use OVL_NAME.
2706         * init.c (build_offset_ref): Use OVL_FIRST.
2707         * mangle.c (write_member_name): Likewise.
2708         (write_expression): Use OVL_NAME.
2709         * method.c (strip_inheriting_ctors): Use OVL_FIRST.
2710         * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
2711         * pt.c (check_explicit_specialization): Use OVL_FIRST.
2712         (check_template_shadow): Likewise.
2713         (tsubst_template_args): Use OVL_NAME.
2714         (tsubst_baselink): Use OVL_FIRST.
2715         * semantics.c (perform_koenig_lookup): Use OVL_NAME.
2716         * tree.c (get_first_fn): Use OVL_FIRST.
2717         * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
2718         (cp_build_addr_expr_1): Use OVL_FIRST.
2720         * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
2721         peeking.
2722         * semantics.c (finish_id_expression): Directly init local var.
2723         (finish_omp_reduction_clause): Use really_overloaded_fn.
2724         * tree.c (get_fns): Document.  Assert we got an overload.
2725         (get_first_fn) Document.
2726         * typeck.c (cp_build_addr_expr_1): Pass arg directly to
2727         really_overloaded_fn.
2728         * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
2730         * cp-tree.h (SCOPE_DEPTH): New.
2731         * name-lookup.h (is_nested_namespace): Declare.
2732         * name-lookup.c (is_nested_namespace): New.
2733         (is_ancestor): Use it.
2734         (set_decl_namespace): Likewise.
2735         (push_namespace): Set SCOPE_DEPTH.
2736         * pt.c (check_specialization_namespace): Use is_nested_namespace.
2737         (check_unqualigied_spec_or_inst): Likewise.
2739 2017-05-15  Nathan Sidwell  <nathan@acm.org>
2741         PR c++/79369
2742         * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
2743         * name-lookup.h (push_namespace): Return int, add make_inline arg.
2744         * name-lookup.c (push_namespace): Deal with inline directly.
2745         Return pushed count.
2746         * parser.c (cp_parser_namespace_definition): Adjust for
2747         push_namespace change.
2749 2017-05-11  Nathan Sidwell  <nathan@acm.org>
2751         * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
2752         LANG_HOOKS_PUSHDECL): Move to ...
2753         * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
2754         LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
2755         * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
2757         * name-lookup.h (pushdecl): Add default friend parm.
2758         (pushdecl_maybe_friend): Delete.
2759         (pushdecl_top_level): Add default friend parm.
2760         (pushdecl_top_level_maybe_friend): Delete.
2761         * name-lookup.c (pushdecl_maybe_friend): Delete.
2762         (pushdecl): Add is_friend parm.
2763         (pushdecl_top_level): Add is friend_parm.
2764         (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
2765         (pushdecl_top_level_and_finish): Do pushing and finishing directly.
2766         * friend.c (do_friend): Adjust.
2767         * pt.c (tsubst_friend_class): Adjust.
2769         Revert pushdecl_top_level_and_finish name change.
2770         * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
2771         * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
2772         * decl.c (cp_make_fname_decl): Adjust.
2773         * decl2.c (get_guard, handle_tls_init):  Adjust.
2774         * rtti.c (get_tinfo_decl, tinfo_base_init):  Adjust.
2776         * name-lookup.c (pushdecl_outermost_localscope): Always
2777         conditionally stop timer.
2779         * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
2780         * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
2782         * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
2783         pushtag_top_level_maybe_friend,
2784         pushdecl_top_level_and_finish): Move declarations to ...
2785         * name-lookup.h: ... here.  Group pushdecl variants.
2786         (pushdecl_top_level_and_finish): Rename to ...
2787         (pushdecl_top_level_with_init): ... here.
2788         * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
2789         * decl2.c (get_guard, handle_tls_init): Likewise.
2790         * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
2791         * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
2792         * method.c (implicitly_declare_fn): Likewise.
2793         * searchc (node_debug_info_needed): Likewise.
2794         * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
2795         (pushdecl_top_level_with_init): ... here.
2796         (pop_everything): Use namespace_bindings_p.
2798         * name-lookup.h (pop_binding): Rename to pop_local_binding.
2799         (getdecls): Rename to get_local_decls.
2800         * name-lookup.c (pop_binding): Rename to ...
2801         (pop_local_binding): ... here.
2802         (pop_bindings_and_leave_scope): Adjust.
2803         (getdecls): Rename to ...
2804         (get_local_decls): ... here.  Assert local scope.
2805         * decl.c (poplevel): Assert not namespace.  Adjust and simplify
2806         logic.
2807         (store_parm_decls): Adjust get_local_decls call.
2808         (parser.c (synthesize_implicit_template_parm): Likewise.
2810 2017-05-11  Ville Voutilainen  <ville.voutilainen@gmail.com>
2812         PR c++/80682
2813         * method.c (is_trivially_xible): Reject void types.
2815 2017-05-10  Nathan Sidwell  <nathan@acm.org>
2817         * class.c (handle_using_decl): Always use OVL_CURRENT.
2818         (resolve_address_of_overloaded_function): Move iterator decl into
2819         for scope.  Don't strip anticipated decls here.
2821         * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
2822         printing.
2823         (print_candidates): Adjust.
2825         * cp-tree.h (build_new_function_call): Lose koenig_p arg.  Fix
2826         line breaking.
2827         * call.c (build_new_function_call): Lose koenig_p arg.  Remove
2828         koenig_p handling here.
2829         * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
2830         (tsubst_omp_clauses): Likewise.
2831         (do_class_deduction): Adjust buld_new_function_call calls.
2832         * semantics.c (finish_call_expr): Likewise.
2834 2017-05-10  Jason Merrill  <jason@redhat.com>
2836         * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
2837         (unify_type_mismatch, unify_parameter_pack_mismatch)
2838         (unify_ptrmem_cst_mismatch, unify_expression_unequal)
2839         (unify_parameter_pack_inconsistent, unify_inconsistency)
2840         (unify_vla_arg, unify_method_type_error, unify_arity)
2841         (unify_arg_conversion, unify_no_common_base)
2842         (unify_inconsistent_template_template_parameters)
2843         (unify_template_deduction_failure)
2844         (unify_template_argument_mismatch)
2845         (unify_overload_resolution_failure): Call unify_invalid.
2847         CWG 1847 - Clarifying compatibility during partial ordering
2848         * pt.c (more_specialized_fn): No order between two non-deducible
2849         parameters.
2851         * pt.c (dependent_type_p): Make sure we aren't called with
2852         global_type_node.
2854         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2855         * pt.c (convert_template_argument): Just return an argument pack.
2856         (coerce_template_parameter_pack, template_parm_to_arg)
2857         (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
2858         (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
2859         Don't set the type of a NONTYPE_ARGUMENT_PACK.
2860         * parser.c (make_char_string_pack, make_string_pack): Likewise.
2862 2017-05-10  Nathan Sidwell  <nathan@acm.org>
2864         * cp-tree.h (add_method, clone_function_decl): Change last arg to
2865         bool.
2866         * class.c (add_method): Change third arg to bool.  Adjust.
2867         (one_inheriting_sig, one_inherited_ctor): Adjust.
2868         (clone_function_decl): Change 2nd arg to bool.  Adjust.
2869         (clone_constructors_and_destructors): Adjust.
2870         * lambda.c (maybe_add_lambda_conv_op): Adjust.
2871         * method.c (lazily_declare_fn): Adjust.
2872         * pt.c (tsubst_decl, instantiate_template_1): Adjust.
2873         * semantics.c (finish_member_declaration): Adjust.
2875 2017-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
2877         PR c++/80145
2878         * decl.c (finish_function): To improve error recovery, change the
2879         logic for calling apply_deduced_return_type.
2881 2017-05-09  Jason Merrill  <jason@redhat.com>
2883         PR c++/80605 - __is_standard_layout and empty base
2884         * class.c (check_bases): Ignore empty bases.
2886         PR c++/70979 - literal class and closure types
2887         * class.c (finalize_literal_type_property): Handle closures
2888         specifically.
2889         (explain_non_literal_class): Likewise.
2891         PR c++/66297, DR 1684 - literal class and constexpr member fns
2892         * constexpr.c (is_valid_constexpr_fn): Only complain about
2893         non-literal enclosing class in C++11.
2894         * class.c (finalize_literal_type_property): Likewise.
2896 2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
2898         PR c++/80186
2899         * pt.c (tsubst_decl): Early return error_mark_node if
2900         grok_ctor_properties returns false.
2902 2017-05-09  Jason Merrill  <jason@redhat.com>
2904         PR c++/70167 - array prvalue treated as lvalue
2905         * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
2906         (enum fcl_t): New.
2907         * semantics.c (finish_compound_literal): Add fcl_context parameter.
2908         Only make a static variable for C99 syntax.
2909         * parser.c (cp_parser_postfix_expression): Pass it.
2910         * pt.c (tsubst_copy_and_build): Likewise.
2911         * call.c (extend_ref_init_temps): Set
2912         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2914 2017-05-09  Nathan Sidwell  <nathan@acm.org>
2916         * cp-lang.c (get_global_decls, cxx_pushdecl): New.
2917         (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
2918         * name-lookup.h (pushdecl_top_level): Declare.
2920 2017-05-08  Jason Merrill  <jason@redhat.com>
2922         PR c++/80178 - parameter passing for uncopyable classes
2923         * tree.c (type_has_nontrivial_copy_init): True for classes with only
2924         deleted copy/move ctors.
2925         (remember_deleted_copy, maybe_warn_parm_abi): New.
2926         * decl.c (require_complete_types_for_parms, check_function_type):
2927         Call maybe_warn_parm_abi.
2928         * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
2930 2017-05-08  Nathan Sidwell  <nathan@acm.org>
2932         * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
2933         (start_preparsed_function): Do decl pushing before setting
2934         current_funciton_decl and announcing it.
2936         * name-lookup.h (pushdecl_with_scope): Replace with ...
2937         (pushdecl_outermost_localscope): ... this.
2938         * name-lookup.c (pushdecl_with_scope): Replace with ...
2939         (pushdecl_outermost_localscope): ... this.
2940         (pushdecl_namespace_level): Adjust.
2941         * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
2942         * lambda.c (insert_capture_proxy): Likewise.
2944         * class.c (build_vtbl_initializer): Don't shadow outer variable
2945         with static var.
2947         Revert _binding -> _value change.
2948         * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
2949         (get_namespace_binding, set_global_binding): ... these.
2950         * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
2951         (get_namespace_binding, set_global_binding): ... these.
2952         (arg_assoc_namespace, pushdecl_maybe_friend_1,
2953         check_for_out_of_scope_variable, push_overloaded_decl_1,
2954         lookup_name_innermost_nonclass_level, push_namespace): Adjust.
2955         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
2956         SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
2957         * decl.c (poplevel): Adjust.
2958         * pt.c (make_constrained_auto): Likewise.
2960 2017-05-07  Volker Reichelt  <v.reichelt@netcologne.de>
2962         PR translation/80280
2963         * call.c (print_z_candidate): Fix quoting.
2965 2017-05-05  David Malcolm  <dmalcolm@redhat.com>
2967         * error.c (pedwarn_cxx98): Replace report_diagnostic
2968         with diagnostic_report_diagnostic.
2970 2017-05-05  Nathan Sidwell  <nathan@acm.org>
2972         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
2973         (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
2974         (IDENTIFIER_NAMESPACE_VALUE): Delete.
2975         * name-lookup.h (namespace_binding, set_namespace_binding): Replace
2976         with ...
2977         (get_namespace_value, set_global_value): ... these.
2978         (get_global_value_if_present, is_typename_at_global_scope): Delete.
2979         * decl.c (poplevel): Use get_namespace_value.
2980         (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
2981         * class.c (build_vtbl_initializer): Stash library decl in
2982         static var. Use IDENTIFIER_GLOBAL_VALUE.
2983         * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
2984         do_allocate_exception, do_free_exception, build_throw): Likewise.
2985         * init.c (throw_bad_array_new_length): Likewise.
2986         * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
2987         * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
2988         check_for_our_of_scope_variable, push_overloaded_decl_1): Use
2989         get_namespace_value.
2990         (set_namespace_binding_1): Rename to
2991         (set_namespace_binding): ... here.
2992         (set_global_value): New.
2993         (lookup_name_innermost_nonclass_level_1, push_namespace): Use
2994         get_namespace_value.
2995         * pt.c (listify): Use get_namespace_value.
2997         * call.c (make_temporary_var_for_ref_to_temp): Push decl into
2998         current scope.
2999         * lex.c (unqualified_name_lookup_error): Likewise.
3001         * class.c (alter_class): Use retrofit_lang_decl directly.
3002         * decl.c (push_local_name, dupliate_decls): Likewise.
3003         * semantics.c (omp_privatize_field): Likewise.
3005         Kill walk_namespaces.
3006         * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
3007         * decl.c (walk_namespaces_r, walk_namespaces): Delete.
3009         Kill per-namespace static_decls.
3010         * cp-tree.h (static_decls): Declare.
3011         (wrapup_globals_for_namespace,
3012         diagnose_inline_vars_for_namespace): Replace with ...
3013         (wrapup_namespace_globals): ... this.
3014         * decl.c (static_decls): Define.
3015         (wrapup_globals_for_namespace,
3016         diagnose_inline_vars_for_namespace): Replace with ...
3017         (wrapup_namespace_globals): ... this.
3018         (cxx_init_decl_processing): Initialize static_decls.
3019         * decl2.c (c_parse_final_cleanups): Adjust.
3020         * name-lookup.h (cp_binding_level): Remove static_decls member.
3021         * name-lookup.c (add_decl_to_level): Adjust.
3022         (begin_scope): Adjust.
3024 2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
3026         PR c++/71577
3027         * decl.c (reshape_init): Unconditionally return error_mark_node
3028         upon error about too many initializers.
3030 2017-05-04  Nathan Sidwell  <nathan@acm.org>
3032         * constraint.cc (diagnose_check_constraint): Fix %E thinko.
3034 2017-05-04  Martin Sebor  <msebor@redhat.com>
3036         PR translation/80280
3037         * call.c (print_z_candidate): Add missing quoting to %D and other
3038         like directives.
3039         (build_op_call_1): Same.
3040         * constraint.cc (diagnose_check_constraint): Same.
3041         * mangle.c (mangle_decl): Same.
3042         * name-lookup.c (cp_binding_level_debug): Same.
3043         (set_decl_namespace): Same.
3044         * parser.c (cp_parser_tx_qualifier_opt): Same.
3045         * pt.c (print_candidates_1): Same.
3046         (check_template_variable): Same.
3047         (tsubst_default_argument): Same.
3048         (most_specialized_partial_spec): Same.
3049         * semantics.c (omp_reduction_lookup): Same.
3050         * tree.c (check_abi_tag_redeclaration): Same.
3051         * typeck.c (comptypes): Same.
3052         * typeck2.c (abstract_virtuals_error_sfinae): Same.
3054 2017-05-04  Nathan Sidwell  <nathan@acm.org>
3056         More global trees.
3057         * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
3058         CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
3059         CPTI_INIT_LIST_IDENTIFIER.
3060         (global_namespace, global_type_node, global_identifier,
3061         anon_identifier, init_list_identifier): New.
3062         * decl.c (global_type_node, global_scope_name): Delete.
3063         (initialize_predefined_identifiers): Add new identifiers.
3064         (cxx_init_decl_processing): Adjust.
3065         * name-lookup.h (global_namespace, global_type_node): Delete.
3066         * name-lookup.c (global_namespace, anonymous_namespace_name,
3067         get_anonymous_namespace_name): Delete.
3068         (namespace_scope_ht_size, begin_scope, pushtag_1,
3069         push_namespace): Adjust,
3070         * call.c (type_has_extended_temps): Use init_list_identifier.
3071         * pt.c (listify): Likewise.
3073         * name-lookup.c: Reorder functions to make merging from modules
3074         branch simpler.
3076 2017-05-03  Jason Merrill  <jason@redhat.com>
3078         * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
3080 2017-05-03  Nathan Sidwell  <nathan@acm.org>
3082         * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
3083         along with #defines, to before name-lookup include.
3085 2017-05-02  Paolo Carlini  <paolo.carlini@oracle.com>
3087         * pt.c (is_auto_or_concept): Remove.
3088         (type_uses_auto_or_concept): Remove, unused.
3089         (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
3090         * parser.c (tree_type_is_auto_or_concept): Remove, unused.
3091         * cp-tree.h (is_auto_or_concept): Remove.
3093 2017-05-01  Xi Ruoyao  <ryxi@stu.xidian.edu.cn>
3095         PR c++/80038
3096         * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
3097         add pedigree operation and detach call here.
3098         * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
3099         cilk_cp_gimplify_call_params_in_spawned_fn.
3100         (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
3101         * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
3103 2017-04-29  Volker Reichelt  <v.reichelt@netcologne.de>
3105         * parser.c (cp_parser_member_declaration): Add fix-it hints for
3106         stray comma and missing semicolon at end of member declaration.
3108 2017-04-27  Volker Reichelt  <v.reichelt@netcologne.de>
3110         * parser.c (cp_parser_cast_expression): Add target type of cast to
3111         diagnostic.
3112         * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
3114 2017-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
3116         * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
3117         return type to bool.
3118         * cp-tree.h (grok_ctor_properties): Update.
3120 2017-04-26  Volker Reichelt  <v.reichelt@netcologne.de>
3122         * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
3123         information to diagnostic of invalid colon in nested-name-specifier.
3125 2017-04-25  Volker Reichelt  <v.reichelt@netcologne.de>
3127         * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
3128         diagnostic of invalid class/struct keyword after enum.
3130 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
3132         * parser.c (cp_parser_member_declaration): Add fix-it hint
3133         for removing stray semicolons.
3135 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
3137         * name-lookup.c (get_std_name_hint): New function.
3138         (maybe_suggest_missing_header): New function.
3139         (suggest_alternative_in_explicit_scope): Call
3140         maybe_suggest_missing_header.
3142 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
3144         PR c++/80177
3145         * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
3146         candidate type of bm from tree to const char *.
3147         (consider_binding_level): Likewise.
3148         (lookup_name_fuzzy): Likewise, using this to merge the best
3149         result from the preprocessor into bm, rather than immediately
3150         returning, so that better matches from reserved words can "win".
3151         Guard the rejection of keywords that don't start decl-specifiers
3152         so it only happens for FUZZY_LOOKUP_TYPENAME.
3154 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
3156         * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
3157         (start_enum): Likewise.
3158         (build_enumerator): Likewise. Use %qE instead of plain %E.
3159         * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
3160         %<%D%> in diagnostics.
3161         (cp_parser_elaborated_type_specifier): Likewise.
3162         * pt.c (make_pack_expansion): Use %qT and %qE instead of
3163         %<%T%> and %<%E%> in diagnostics.
3164         (tsubst_pack_expansion): Likewise.
3166 2017-04-24  David Malcolm  <dmalcolm@redhat.com>
3168         PR c++/80016
3169         * parser.c (cp_parser_unary_expression):  Generate a location
3170         range for alignof and sizeof expressions.
3172 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
3174         * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
3175         error message.
3176         (cp_parser_virt_specifier_seq_opt): Likewise.
3177         (set_and_check_decl_spec_loc): Likewise twice.
3179 2017-04-21  Jason Merrill  <jason@redhat.com>
3181         PR c++/80179 - ICE with initialized flexible array member.
3182         * constexpr.c (verify_ctor_sanity): Handle flexible array members.
3184 2017-04-21  Richard Biener  <rguenther@suse.de>
3186         * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
3187         (copy_type): Likewise.
3188         * lex.c (copy_decl): Pass down mem-stat info.
3189         (copy_type): Likewise.
3191 2017-04-20  Jonathan Wakely  <jwakely@redhat.com>
3193         PR c++/80473
3194         * init.c (build_new_1): Suppress notes about over-aligned new when
3195         the warning is suppressed.
3197 2017-04-20  Volker Reichelt  <v.reichelt@netcologne.de>
3199         * parser.c (cp_parser_member_declaration): Add warning with fixit
3200         information for extra semicolon after in-class function definition.
3202 2017-04-20  Jakub Jelinek  <jakub@redhat.com>
3204         PR middle-end/80423
3205         * tree.c (build_cplus_array_type): Call build_array_type
3206         with the intended TYPE_TYPELESS_STORAGE flag value, instead
3207         of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
3208         on the shared type.
3210 2017-04-18  Marek Polacek  <polacek@redhat.com>
3212         PR c++/80244 - ICE with attribute in template alias.
3213         * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
3215         PR c++/80241 - ICE with alignas pack expansion.
3216         * error.c (dump_expr): Handle TREE_LIST.
3217         * parser.c (cp_parser_std_attribute_list): Return error_mark if
3218         make_pack_expansion returns an error.
3220 2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>
3222         PR c++/80287
3223         * class.c (fixup_may_alias): Fix all type variants.
3225 2017-04-17  Jason Merrill  <jason@redhat.com>
3227         PR c++/80415 - wrong error with default arg and array reference.
3228         * tree.c (lvalue_kind): Return clk_class for an array prvalue.
3230         * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
3232 2017-04-15  Alexandre Oliva <aoliva@redhat.com>
3234         * decl.c (name_unnamed_type): Split out of...
3235         (grokdeclarator): ... this.
3236         * decl.h (name_unnamed_type): Declare.
3238 2017-04-12  Richard Biener  <rguenther@suse.de>
3239         Bernd Edlinger  <bernd.edlinger@hotmail.de>
3241         PR middle-end/79671
3242         * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
3243         for arrays of character or std::byte type.
3245 2017-04-11  Jason Merrill  <jason@redhat.com>
3247         PR c++/80294 - ICE with constexpr and inheritance.
3248         * constexpr.c (reduced_constant_expression_p):
3249         A null constructor element is non-constant.
3250         (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
3251         returning an empty base.
3253 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
3255         PR c++/80370
3256         * decl.c (cp_finish_decomp): If processing_template_decl on
3257         non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
3258         change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
3259         sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
3260         processing.
3261         * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
3262         with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
3263         dependent.
3265 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
3267         PR c++/80363
3268         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
3270 2017-04-10  Jakub Jelinek  <jakub@redhat.com>
3272         PR c++/80176
3273         * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
3274         operand, if it is a static member function, recurse on the
3275         BASELINK.
3277 2017-04-10  Marek Polacek  <polacek@redhat.com>
3279         PR sanitizer/80348
3280         * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
3281         ORIG_TYPE earlier and not only when shortening.
3283 2017-04-07  Jason Merrill  <jason@redhat.com>
3285         PR c++/80356 - ICE with reference to function template argument.
3286         PR c++/79294
3287         * pt.c (convert_nontype_argument_function): Adjust type even with a
3288         value-dependent argument.
3290         PR c++/80267 - ICE with nested capture of reference
3291         PR c++/60992
3292         * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
3294 2017-04-07  Marek Polacek  <polacek@redhat.com>
3296         PR sanitizer/80348
3297         * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
3299         PR c++/80095
3300         * call.c (build_over_call): Don't check cxx_dialect.
3301         * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
3302         whether SUB is a CONSTRUCTOR.
3303         * init.c (build_new_1): Don't check cxx_dialect.
3304         * tree.c (replace_placeholders): Add a function comment.  Return if
3305         not in C++14, or if the object isn't a (member of a) class.
3306         * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
3307         TYPE is CLASS_TYPE_P.
3309 2017-04-05  Jakub Jelinek  <jakub@redhat.com>
3311         PR c++/80309
3312         * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
3313         of a loop doing vec_safe_push of NULL.  Formatting fixes.
3314         (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
3315         to newidx before calling canonical_type_parameter on newtype.
3317 2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
3319         PR c++/80296
3320         * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
3321         UNARY_PLUS_EXPR case.
3323 2017-04-03  Jason Merrill  <jason@redhat.com>
3325         * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
3327 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
3329         * class.c (update_vtable_entry_for_fn): Fix typo in comment.
3330         * decl2.c (one_static_initialization_or_destruction): Likewise.
3331         * name-lookup.c (store_bindings): Likewise.
3332         * parser.c (make_call_declarator): Likewise.
3333         * pt.c (check_explicit_specialization): Likewise.
3335 2017-04-03  Jason Merrill  <jason@redhat.com>
3337         PR sanitizer/79993 - ICE with VLA initialization from string
3338         PR c++/69487 - wrong VLA initialization from string
3339         * init.c (finish_length_check): Split out from build_vec_init.
3340         (build_vec_init): Handle STRING_CST.
3341         * typeck2.c (split_nonconstant_init): Handle STRING_CST.
3342         (digest_init_r): Don't give a STRING_CST VLA type.
3344 2017-03-31  Jakub Jelinek  <jakub@redhat.com>
3346         PR c++/79572
3347         * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
3348         REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
3349         for NOP_EXPR to REFERENCE_TYPE.
3351         PR libstdc++/80251
3352         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
3353         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3354         CPTK_IS_AGGREGATE.
3355         * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
3356         Remove extraneous parens.
3357         (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
3358         * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
3359         (cp_parser_trait_expr): Likewise.
3361 2017-03-27  Jakub Jelinek  <jakub@redhat.com>
3363         PR middle-end/80162
3364         * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
3365         * typeck.c (cxx_mark_addressable): Likewise.  Look through
3366         VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
3367         to ARRAY_TYPE.
3368         (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
3370 2017-03-24  Jason Merrill  <jason@redhat.com>
3372         PR c++/77339 - ICE with invalid use of alias template.
3373         * pt.c (lookup_template_class_1): Don't try to enter the scope of an
3374         alias template.
3376 2017-03-24  Marek Polacek  <polacek@redhat.com>
3378         PR c++/80119
3379         * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
3380         doesn't have side effects.
3382 2017-03-23  Jason Merrill  <jason@redhat.com>
3384         PR c++/80150 - ICE with overloaded variadic deduction.
3385         * pt.c (try_one_overload): Remove asserts.
3387         PR c++/77563 - missing ambiguous conversion error.
3388         * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
3390 2017-03-23  Marek Polacek  <polacek@redhat.com>
3392         * cp-tree.h: Remove a C_RID_YYCODE reference.
3394 2017-03-22  Jakub Jelinek  <jakub@redhat.com>
3396         PR c++/80141
3397         * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
3398         case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
3399         processing_template_decl.
3401 2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
3403         PR c++/77752
3404         * name-lookup.c (pushtag_1): Add check for bogus, non template,
3405         std::initializer_list.
3407 2017-03-21  Jakub Jelinek  <jakub@redhat.com>
3409         PR c++/35878
3410         * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
3412 2017-03-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
3414         PR c++/35878
3415         * init.c (std_placement_new_fn_p): New.
3416         (build_new_1): Call it.
3418 2017-03-20  Jason Merrill  <jason@redhat.com>
3420         PR c++/80096 - ICE with C++17 non-type auto.
3421         * pt.c (tsubst): Delay tsubst of type of template non-type
3422         parameter.
3424         PR c++/79519 - ICE with deleted template friend.
3425         * decl.c (grokdeclarator): Complain about misplaced function
3426         definition using =, as well.
3428         PR c++/79640 - infinite recursion with generic lambda.
3429         * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
3430         before substituting its initializer.
3432 2017-03-20  Marek Polacek  <polacek@redhat.com>
3433             Paolo Carlini  <paolo.carlini@oracle.com>
3435         PR c++/80059 - ICE with noexcept and __transaction_atomic
3436         * except.c (build_must_not_throw_expr): Call
3437         instantiate_non_dependent_expr.
3439 2017-03-19  Jason Merrill  <jason@redhat.com>
3441         PR c++/80084 - wrong C++17 decomposition by reference of parameter.
3442         * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
3443         reference decomposition.
3445         PR c++/80077 - error with constexpr and -fno-elide-constructors.
3446         * constexpr.c (cxx_eval_call_expression): Set ctx->call while
3447         expanding trivial constructor.
3449 2017-03-17  Jason Merrill  <jason@redhat.com>
3451         PR c++/78345 - ICE initializing array from lambda.
3452         * init.c (build_aggr_init): Check array initializer.
3453         (build_vec_init): Check the type of a CONSTRUCTOR.
3455         PR c++/80073 - C++17 ICE with virtual base.
3456         * decl.c (xref_basetypes): Also check for indirect vbases.
3458 2017-03-16  Jason Merrill  <jason@redhat.com>
3460         * decl.c (start_enum): std::byte aliases anything.
3462         PR c++/79797
3463         * constexpr.c (lookup_placeholder): Tweak.
3465 2017-03-15  Jason Merrill  <jason@redhat.com>
3467         PR c++/80043 - ICE with -fpermissive
3468         * typeck.c (convert_for_assignment): Handle instantiate_type
3469         not giving an error.
3471 2017-03-14  Nathan Sidwell  <nathan@acm.org>
3473         PR c++/79393 DR 1658 workaround
3474         * method.c (synthesized_method_base_walk): Inihibit abstract class
3475         virtual base access check here.
3476         (synthesized_method_walk): Not here.
3478 2017-03-13  Nathan Sidwell  <nathan@acm.org>
3480         PR c++/79393 DR 1658 workaround
3481         * method.c (synthesized_method_walk): Check vbases of abstract
3482         classes for dtor walk.
3484 2017-03-10  David Malcolm  <dmalcolm@redhat.com>
3486         PR translation/79848
3487         * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
3489 2017-03-10  Jason Merrill  <jason@redhat.com>
3491         PR c++/79960 - alias templates and partial ordering
3492         * pt.c (comp_template_args): Add partial_order parm.
3493         (template_args_equal): Likewise.
3494         (comp_template_args_porder): New.
3495         (get_partial_spec_bindings): Use it.
3497 2017-03-10  Marek Polacek  <polacek@redhat.com>
3499         PR c++/79967
3500         * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
3502 2017-03-10  Jakub Jelinek  <jakub@redhat.com>
3504         PR c++/79899
3505         * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
3506         Use XALLOCAVEC macro.
3508         PR c++/79896
3509         * decl.c (finish_enum_value_list): If value is error_mark_node,
3510         don't copy it and change its type.
3511         * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
3512         of CONST_DECL is error_mark_node.
3514 2017-03-09  Marek Polacek  <polacek@redhat.com>
3516         PR c++/79900 - ICE in strip_typedefs
3517         * tree.c (strip_typedefs): Skip the attribute handling if T is
3518         a variant type which hasn't been updated yet.
3520         PR c++/79687 - wrong code with pointer-to-member
3521         * init.c (constant_value_1): Break if the variable has a dynamic
3522         initializer.
3524 2017-03-08  Jason Merrill  <jason@redhat.com>
3526         PR c++/79797 - ICE with self-reference in array DMI.
3527         * constexpr.c (lookup_placeholder): Split out...
3528         (cxx_eval_constant_expression): ...from here.
3530 2017-03-07  Jakub Jelinek  <jakub@redhat.com>
3532         PR c/79834
3533         * parser.c (cp_parser_omp_cancellation_point,
3534         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
3535         cp_parser_omp_target_update): Change "may only be used in compound
3536         statements" diagnostics, such that the same translatable string is
3537         used for all pragmas.
3538         (cp_parser_pragma): Likewise.  Use error_at instead of
3539         cp_parser_error for that diagnostics.
3541 2017-03-06  Marek Polacek  <polacek@redhat.com>
3543         PR c++/79796 - ICE with NSDMI and this pointer
3544         * call.c (build_over_call): Handle NSDMI with a 'this' by calling
3545         replace_placeholders.
3547 2017-03-06  Jakub Jelinek  <jakub@redhat.com>
3549         PR c++/79822
3550         * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
3551         ({ (void) 0; }).
3553 2017-03-06  Jason Merrill  <jason@redhat.com>
3555         Revert "Allow deduction guides to look into primary template."
3556         * cp-tree.h, parser.c, pt.c, search.c: Revert.
3558 2017-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
3560         PR c++/70266
3561         * except.c (build_must_not_throw_expr): Perform the implicit
3562         conversions on the condition.
3564 2017-03-03  Jason Merrill  <jason@redhat.com>
3566         * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
3567         -Wc++1z-compat.
3569         Core issues 2273 and 2277
3570         * call.c (joust): Adjust using-declaration tiebreaker to handle
3571         the intermediate base case.
3572         * method.c (strip_inheriting_ctors): Just return the argument if
3573         !flag_new_inheriting_ctors.
3575 2017-03-03  Richard Biener  <rguenther@suse.de>
3577         PR c++/79825
3578         * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
3580 2017-03-03  Marek Polacek  <polacek@redhat.com>
3582         PR c++/79791
3583         * typeck.c (string_conv_p): In C++11, always call pedwarn with
3584         OPT_Wwrite_strings.
3586 2017-03-02  Jason Merrill  <jason@redhat.com>
3588         Update overload resolution with deduction guides.
3589         * pt.c (do_class_deduction): Always build the copy guide.
3590         (copy_guide_p, template_guide_p): New.
3591         (build_deduction_guide): Remember the original constructor.
3592         * call.c (joust): Prefer the copy guide and non-template guides.
3594         Allow deduction guides to look into primary template.
3595         * cp-tree.h (struct saved_scope): Add deduction_guide_type.
3596         (struct cp_decl_specifier_seq): Add constructor_p.
3597         * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
3598         (cp_parser_init_declarator): Check it.  Set ctor_dtor_or_conv_p.
3599         Clear deduction_guide_type.  Don't handle deduction guide names.
3600         (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
3601         (cp_parser_direct_declarator): Likewise.  Handle deduction guides.
3602         (cp_parser_member_declaration, cp_parser_cache_defarg)
3603         (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
3604         * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
3605         (build_deduction_guide): Set deduction_guide_type.
3606         (dependent_scope_p): Check deduction_guide_type.
3607         * search.c (lookup_member): Likewise.
3609 2017-03-02  Jakub Jelinek  <jakub@redhat.com>
3611         PR c++/79782
3612         * init.c (mark_exp_read_r): New function.
3613         (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
3614         whole arguments instead of plain mark_exp_read on TREE_LIST values.
3616 2017-03-01  Jason Merrill  <jason@redhat.com>
3618         Class template argument deduction in new-expression
3619         * init.c (build_new): Handle deduction from no initializer.
3620         * parser.c (cp_parser_new_expression): Don't require a single
3621         expression for class template deduction.
3622         * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
3623         class template placeholder.
3624         * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
3625         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
3626         (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
3628 2017-03-01  Jakub Jelinek  <jakub@redhat.com>
3630         PR c++/79746
3631         * init.c (emit_mem_initializers): When not constructing vbases of
3632         abstract classes, mark arguments as read for
3633         -Wunused-but-set-parameter.
3635 2017-02-28  Jason Merrill  <jason@redhat.com>
3637         Class template argument deduction refinements
3638         * call.c (joust): Move deduction guide tiebreaker down.
3639         * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
3640         deduction with no initializer.
3641         * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
3642         (do_class_deduction): Use that rather than special case.
3643         (do_auto_deduction): Handle null initializer.
3645 2017-02-28  Jakub Jelinek  <jakub@redhat.com>
3647         * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
3648         instead of just cond ? "..." : "...".
3649         (grokdeclarator): Likewise.
3650         (build_enumerator): Likewise.
3651         * init.c (build_new_1): Likewise.
3652         * call.c (build_new_method_call_1): Likewise.
3653         * parser.c: Include intl.h.
3654         (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
3655         "enter"/"exit" keyword.
3656         (cp_finalize_oacc_routine): Don't use %s to supply portions of the
3657         message.
3659 2017-02-27  Jason Merrill  <jason@redhat.com>
3661         PR c++/71568 - SFINAE forming pointer to member function
3662         * init.c (build_offset_ref): Check the return value of
3663         perform_or_defer_access_check.
3665 2017-02-27  Marek Polacek  <polacek@redhat.com>
3667         * decl.c (expand_static_init): Add missing } in a comment.
3669 2017-02-27  Volker Reichelt  <v.reichelt@netcologne.de>
3671         * init.c: Include intl.h.
3672         (build_new_1): Move message strings into pedwarn to make them
3673         -Wformat-security friendly. Mark string for translation.
3674         * pt.c (tsubst_copy_and_build): Mark string for translation.
3675         Make the pointer const.
3676         * semantics.c (finish_id_expression): Mark strings for translation.
3678 2017-02-25  Jakub Jelinek  <jakub@redhat.com>
3680         * call.c (build_op_delete_call): Make msg1 and msg2 const.
3682 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
3684         PR c++/79588
3685         * call.c (build_over_call): Call check_function_arguments even for
3686         -Wrestrict, adjust check_function_arguments caller.
3687         * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
3688         here.
3689         * typeck.c (cp_build_function_call_vec): Adjust
3690         check_function_arguments caller.
3692 2017-02-24  Marek Polacek  <polacek@redhat.com>
3694         PR translation/79705
3695         * decl.c (check_redeclaration_exception_specification): Mark a string
3696         for translation.  Make the pointer const.
3698 2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>
3700         PR c++/79361
3701         * pt.c (register_specialization): Check duplicate_decls return value
3702         for error_mark_node and pass it back.
3704 2017-02-22  Jason Merrill  <jason@redhat.com>
3706         PR c++/79679 - missing destructor for argument
3707         * call.c (build_over_call): Don't pass tf_no_cleanup to argument
3708         conversions.
3710         * pt.c (do_class_deduction): Handle 0 argument case.
3712 2017-02-22  Jakub Jelinek  <jakub@redhat.com>
3714         PR c++/79664
3715         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
3716         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
3717         * constexpr.c (potential_constant_expression_1): Handle
3718         OMP_*, OACC_* and CILK_* trees.  Use error_at with
3719         EXPR_LOC_OR_LOC (t, input_location) computed early
3720         instead of error, or error_at with location_of (t).
3722 2017-02-22  Marek Polacek  <polacek@redhat.com>
3724         PR c++/79653
3725         * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
3726         if the alignas expression is erroneous.
3727         * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
3728         error_mark_node.
3730         PR c++/79657
3731         * semantics.c (finish_underlying_type): Bail out for incomplete enums.
3733 2017-02-21  Jason Merrill  <jason@redhat.com>
3735         PR c++/50308 - wrong deprecated warning with ADL
3736         PR c++/17729 - duplicate deprecated warning
3737         * semantics.c (finish_id_expression): Only call mark_used on a
3738         function if we aren't building a call.
3740         PR c++/41727 - ICE with partial spec of partial instantiation
3741         * pt.c (process_partial_specialization): For now, don't check more
3742         specialized if there is more than one level of args.
3744 2017-02-21  Marek Polacek  <polacek@redhat.com>
3746         PR c++/79535
3747         * cp-tree.h (maybe_reject_flexarray_init): Declare.
3748         * init.c (maybe_reject_flexarray_init): No longer static.
3749         Add check for current_function_decl.
3750         * parser.c (cp_parser_late_parse_one_default_arg): Reject
3751         a default mem-initializer for a flexible array.
3753 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
3754             Paolo Carlini  <paolo.carlini@oracle.com>
3756         PR c++/79654
3757         * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
3758         on error.
3759         * pt.c (tsubst_decomp_names): Return error_mark_node if the first
3760         decl after the decomposition artificial decl has error_mark_node.
3761         * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
3762         instead of just == error_mark_node comparison.
3764 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
3766         PR sanitizer/79589
3767         * decl.c: Include gimplify.h.
3768         (cp_finish_decomp): Make sure there is no sharing of trees
3769         in between DECL_VALUE_EXPR of decomposition decls.
3771         PR c++/79655
3772         * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
3774         PR c++/79639
3775         * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
3776         call cplus_expand_constant on it first.
3778 2017-02-19  Jason Merrill  <jason@redhat.com>
3780         PR c++/78139 - destructor needed by new-expression
3781         * call.c (build_special_member_call): Use tf_no_cleanup.
3783         PR c++/78282 - auto template and pack expansion
3784         * pt.c (find_parameter_packs_r): Don't walk into the type of
3785         templates other than template template-parameters.
3787         PR c++/79606 - ICE with this->base_member in NSDMI
3788         * class.c (build_base_path): Check processing_template_decl.
3790         PR c++/79607 - ICE with T{} initializer
3791         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
3793         PR c++/79566 - elaborated-type-specifier in range for
3794         * parser.c (cp_parser_simple_declaration): Fix check for type
3795         definition.
3797         PR c++/79400 - confusing suggestion of 'noexcept'
3798         * parser.c (cp_parser_exception_specification_opt): Remove
3799         suggestion for deprecated dynamic exception-specification.
3801         PR c++/79470 - partial ordering with reference parameters
3802         * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
3804         PR c++/79500 - ICE with non-template deduction guide
3805         * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
3806         DECL_TEMPLATE_RESULT.
3808         PR c++/79580 - ICE with compound literal
3809         * parser.c (cp_parser_class_head): If we're in the middle of an
3810         expression, use ts_within_enclosing_non_class.
3812         PR c++/79503 - inherited ctor taking base class
3813         * call.c (add_function_candidate): Also check that
3814         DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
3816 2017-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
3818         PR c++/79380
3819         * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
3820         argument.
3822 2017-02-19  Eric Fiselier  <eric@efcs.ca>
3823             Jonathan Wakely  <jwakely@redhat.com>
3825         PR c++/69523
3826         * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
3827         control warning about literal suffix identifiers without a leading
3828         underscore.
3830 2017-02-17  Jason Merrill  <jason@redhat.com>
3832         PR c++/79508 - lookup error with member template
3833         * parser.c (cp_parser_template_name): Clear
3834         parser->context->object_type if we aren't doing lookup.
3836         PR c++/78690 - ICE with using and global type with same name
3837         * pt.c (type_dependent_object_expression_p): True for
3838         IDENTIFIER_NODE.
3840         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3841         * pt.c (convert_template_argument): Just return an auto arg pack.
3842         (tsubst_template_args): Don't tsubst an auto pack type.
3844         PR c++/79556 - C++17 ICE with non-type auto
3845         * pt.c (do_auto_deduction): Don't try to deduce from null type.
3847         PR c++/79533 - C++17 ICE with temporary cast to reference
3848         * call.c (build_over_call): Conversion to a reference prevents copy
3849         elision.
3851 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
3852             Jason Merrill  <jason@redhat.com>
3854         PR c++/79502 - lost nodiscard attribute
3855         * pt.c (apply_late_template_attributes): Do apply non-dependent
3856         attributes to types.
3858 2017-02-16  Jason Merrill  <jason@redhat.com>
3860         PR c++/78572 - ICE with self-modifying array initializer
3861         * constexpr.c (cxx_eval_store_expression): The object we're
3862         initializing is outside the constant-expression.
3863         (cxx_eval_call_expression): Set ctx->call.
3865         PR c++/79050 - ICE with undeduced auto and LTO
3866         * decl.c (poplevel): Remove undeduced auto decls.
3868 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
3870         PR c++/79512
3871         * parser.c (cp_parser_omp_target): For -fopenmp-simd
3872         ignore #pragma omp target even when not followed by identifier.
3874 2017-02-15  Jason Merrill  <jason@redhat.com>
3875             Jakub Jelinek  <jakub@redhat.com>
3877         PR c++/79464 - ICE in IPA with omitted constructor parms
3878         * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
3879         (adjust_clone_args): Adjust.
3880         (add_method): Remember omitted parms.
3881         * call.c (add_function_candidate): Likewise.
3882         * mangle.c (write_method_parms): Likewise.
3883         * method.c (ctor_omit_inherited_parms): Return false if there are no
3884         parms to omit.
3886 2017-02-15  Martin Sebor  <msebor@redhat.com>
3888         PR c++/79363
3889         * init.c (maybe_reject_flexarray_init): New function.
3890         (perform_member_init): Call it.
3892 2017-02-15  Jakub Jelinek  <jakub@redhat.com>
3894         PR c++/79301
3895         * parser.c (cp_parser_std_attribute): Don't pedwarn about
3896         [[deprecated]] with -std=c++11 and [[fallthrough]] with
3897         -std=c++11 and -std=c++14.
3899         PR c++/79288
3900         * decl.c (grokdeclarator): For static data members, handle thread_p
3901         only after handling inline.
3903 2017-02-14  Marek Polacek  <polacek@redhat.com>
3905         PR c++/79420
3906         PR c++/79463
3907         * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
3908         clobbering if the postfix expression isn't an EXPR_P.
3910 2017-02-13  Jason Merrill  <jason@redhat.com>
3912         PR c++/79461 - ICE with lambda in constexpr constructor
3913         * constexpr.c (build_data_member_initialization): Ignore
3914         initialization of a local variable.
3916 2017-02-13  Jakub Jelinek  <jakub@redhat.com>
3918         * init.c (warn_placement_new_too_small): Add missing space in
3919         diagnostics.
3920         * parser.c (cp_parser_oacc_declare): Likewise.
3921         * mangle.c (maybe_check_abi_tags): Likewise.
3923         PR c++/79232
3924         * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
3925         on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
3926         in the rightmost operand.
3928 2017-02-13  Nathan Sidwell  <nathan@acm.org>
3930         PR c++/79296 - ICE mangling localized template instantiation
3931         * decl2.c (determine_visibility): Use template fn context for
3932         local class instantiations.
3934 2017-02-11  Jason Merrill  <jason@redhat.com>
3936         PR c++/77659 - ICE with new and C++14 aggregate NSDMI
3937         * init.c (build_new): Make backups of any CONSTRUCTORs in init.
3938         (build_new_1): Use replace_placeholders.
3939         * tree.c (replace_placeholders_t): Also track whether we've seen a
3940         placeholder.
3941         (replace_placeholders, replace_placeholders_r): Adjust.
3942         * cp-tree.h: Adjust.
3944         PR c++/77790 - ICE with auto function in C++11 mode
3945         * decl.c (undeduced_auto_decl): Remove C++14 limitation.
3946         (require_deduced_type): Add complain parm, return bool.
3947         * cp-tree.h: Adjust.
3948         * decl2.c (mark_used): Use require_deduced_type.
3950 2017-02-10  Jason Merrill  <jason@redhat.com>
3952         PR c++/78908 - template ops and bitfields
3953         * tree.c (build_min_non_dep): Use unlowered_expr_type.
3955         PR c++/78897 - constexpr union
3956         * constexpr.c (cxx_eval_store_expression): A store to a union member
3957         erases a previous store to another member.
3959         PR c++/71285 - member of fold-expression
3960         * semantics.c (finish_unary_fold_expr)
3961         (finish_binary_fold_expr): Use null type for fold-expressions.
3963         PR c++/79401 - protected inherited constructor
3964         * call.c (enforce_access): For inheriting constructor, find a base
3965         binfo in the path we already have.
3967 2017-02-10  Marek Polacek  <polacek@redhat.com>
3969         PR c++/79435
3970         * pt.c (type_dependent_expression_p): Check if the expression type
3971         is null.
3973         PR c++/79184
3974         * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
3975         if warnings shouldn't be given.
3977 2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
3979         PR c++/71737
3980         * pt.c (tsubst_decl): Don't try to preserve a typedef that names
3981         an error_mark_node as type.
3983 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
3984             Jason Merrill  <jason@redhat.com>
3986         PR c++/79143
3987         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
3988         from pattern to type.
3990 2017-02-09  Jason Merrill  <jason@redhat.com>
3992         PR c++/79316 - default argument in deduction guide
3993         PR c++/79350 - explicit deduction guide
3994         * parser.c (cp_parser_constructor_declarator_p)
3995         (cp_parser_direct_declarator): Parse deduction guides more like
3996         constructors.
3997         * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
3998         * tree.c (special_function_p): Return it.
3999         * decl.c (check_special_function_return_type): Handle it.
4000         (grokdeclarator, grokfndecl): Adjust.
4001         (cp_finish_decl): Pass flags to do_auto_deduction.
4002         * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
4003         * pt.c (dguide_name_p): Take a const_tree.
4004         (do_class_deduction): Handle explicit.
4005         (do_auto_deduction): Pass flags through.
4006         (build_deduction_guide): Copy explicit flag.
4008 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
4010         PR c++/79429
4011         * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
4012         non-pragma_compound context here.
4013         (cp_parser_omp_target): Likewise.
4014         (cp_parser_pragma): Don't call push_omp_privatization_clauses and
4015         parsing for ordered and target omp pragmas in non-pragma_stmt
4016         non-pragma_compound contexts.
4018         PR c/79431
4019         * parser.c (cp_parser_oacc_declare): Formatting fix.
4020         (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
4021         automatic variables.
4023 2016-02-09  Nathan Sidwell  <nathan@codesourcery.com>
4024             Chung-Lin Tang  <cltang@codesourcery.com>
4026         * parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
4027         parsing.  Parse constant expression. Remove semantic checking.
4028         (cp_parser_omp_clause_collapse): Disallow tile.
4029         (cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
4030         error about missing for after already emitting one.  Use more
4031         conventional for idiom for unbounded loop.
4032         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
4033         * semantics.c (finish_omp_clauses): Correct TILE semantic check.
4034         (finish_omp_for): Deal with tile clause.
4036 2017-02-07  Nathan Sidwell  <nathan@acm.org>
4038         * method.c (synthesized_method_base_walk): New.  Broken out of ...
4039         (synthesized_method_walk): ... here.  Call it.  Cleanup
4040         initializations.
4042 2017-02-07  Patrick Palka  <ppalka@gcc.gnu.org>
4044         PR c++/79360
4045         * typeck2.c (process_init_constructor_union): Consider only
4046         FIELD_DECLs when looking for an NSDMI.
4048 2017-02-06  Jason Merrill  <jason@redhat.com>
4050         PR c++/71193 - incomplete types in templates
4051         * parser.c (cp_parser_postfix_dot_deref_expression): In a template
4052         handle incomplete type by pedwarning and then treating as dependent.
4054 2017-02-06  Jakub Jelinek  <jakub@redhat.com>
4056         PR c++/79379
4057         * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
4058         (potential_constant_expression_1): Likewise.
4060         PR c++/79377
4061         * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
4062         allow one fewer than expected arguments if flag_permissive.
4064         PR c++/79372
4065         * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
4066         * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
4067         with error_mark_node type.
4069 2017-02-03  Jason Merrill  <jason@redhat.com>
4071         PR c++/78689 - ICE on constructor with label
4072         * optimize.c (maybe_clone_body): Replace omitted parameters with
4073         null lvalues.
4074         * class.c (build_clone): Fix logic for omitting inherited parms.
4076         PR c++/12245 - excessive memory use
4077         * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
4078         back in.  Don't cache constants.
4079         (maybe_constant_init): Don't cache constants.
4081         PR c++/79294 - ICE with invalid template argument
4082         * pt.c (convert_nontype_argument_function): Check value-dependence.
4083         (convert_nontype_argument): Don't check it here for function ptrs.
4085 2017-02-02  Richard Biener  <rguenther@suse.de>
4087         PR cp/14179
4088         * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
4089         it lazily on the first changed element only and copy it
4090         fully upfront, only storing changed elements.
4092 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
4094         PR c++/69637
4095         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
4096         to the width.
4098 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
4100         PR c++/79304
4101         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
4102         after ARROW_EXPR.
4104 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
4106         PR c++/79298
4107         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
4108         any namespace aliases.
4110 2017-01-31  Nathan Sidwell  <nathan@acm.org>
4112         PR c++/79290
4113         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
4115         PR c++/67273
4116         PR c++/79253
4117         * pt.c: (instantiate_decl): Push to top level when current
4118         function scope doesn't match.  Only push lmabda scope stack when
4119         pushing to top.
4121         * cp-tree.h (instantiate_decl): Make defer_ok bool.
4122         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
4123         (instantiate_decl): Simplify and reorder state saving and restoration.
4125         PR c++/79264
4126         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
4127         * semantics.c (finish_member_declaration): Assert class is being
4128         defined.
4130 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
4132         Introduce C++ support in libcc1.
4133         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
4134         (ansi_opname): Rename to...
4135         (cp_operator_id): ... this.  Adjust all callers.
4136         (ansi_assopname): Rename to...
4137         (cp_assignment_operator_id): ... this.  Adjust all callers.
4138         (cp_literal_operator_id): Declare.
4139         (set_global_friend): Declare.
4140         (is_global_friend): Declare.
4141         (enum cp_oracle_request): New type.
4142         (cp_binding_oracle_function): New type.
4143         (cp_binding_oracle): Declare.
4144         (cp_finish_injected_record_type): Declare.
4145         * friend.c (global_friend): New var.
4146         (set_global_friend): New fn.
4147         (is_global_friend): New fn.
4148         (is_friend): Call is_global_friend.
4149         * name-lookup.c (cp_binding_oracle): New var.
4150         (query_oracle): New fn.
4151         (qualified_lookup_using_namespace): Call query_oracle.
4152         (lookup_name_real_1): Likewise.
4153         * parser.c (cp_literal_operator_id): Drop static.
4154         * search.c (friend_accessible_p): Call is_global_friend.
4155         * semantics.c (is_this_parameter): Accept a variable if the
4156         binding oracle is enabled.
4158 2017-01-27  Jason Merrill  <jason@redhat.com>
4160         PR c++/78771 - ICE with inherited constructor.
4161         * call.c (build_over_call): Call deduce_inheriting_ctor here.
4162         * pt.c (tsubst_decl): Not here.
4163         * class.c (add_method): Or here.
4164         * method.c (deduce_inheriting_ctor): Handle clones.
4165         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
4167 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
4169         PR c++/64382
4170         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
4171         New function.
4172         * cp/cp-tree.h: Declare it.
4173         * cp/semantics.c (finish_id_expression): Resolve names within a default
4174         capturing generic lambda defined within a template prior to
4175         instantiation to allow for captures to be added to the closure type.
4177 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
4179         PR c++/68727
4180         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
4181         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
4182         * parser.c (cp_parser_builtin_offsetof): Pass result of
4183         build_static_cast of null_pointer_node to finish_offsetof.
4184         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
4185         it for -Winvalid-offsetof pedwarn instead of trying to guess
4186         original offsetof type from EXPR.  Save OBJECT_PTR as a new
4187         second operand to OFFSETOF_EXPR.
4188         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
4189         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
4190         as OBJECT_PTR.
4192 2017-01-26  Jason Merrill  <jason@redhat.com>
4194         * name-lookup.c (parse_using_directive): Deprecate strong using.
4196         PR c++/79176 - lambda ICE with -flto -Os
4197         * decl2.c (vague_linkage_p): Handle decloned 'tors.
4198         * tree.c (decl_linkage): Likewise.
4200 2017-01-25  Martin Sebor  <msebor@redhat.com>
4202         * decl.c (grokdeclarator): Fix a typo in a comment.
4204 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
4206         PR c++/78896
4207         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
4208         lambda expressions.
4210         PR c++/77914
4211         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
4212         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
4214 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
4216         PR lto/79061
4217         * decl.c (cxx_init_decl_processing): Pass main_input_filename
4218         to build_translation_unit_decl.
4220 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
4222         PR c++/79205
4223         * cp-gimplify.c (cp_genericize_r): Add result of
4224         convert_from_reference on invisiref parm to p_set.
4226 2017-01-24  Nathan Sidwell  <nathan@acm.org>
4228         PR c++/78469 - defaulted ctor and inaccessible dtor
4229         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
4230         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
4231         * tree.c (build_target_expr): Check tf_no_cleanup.
4233         PR c++/79118 - anon-members and constexpr
4234         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
4235         ctor decl.  Recursively check anonymous members.
4236         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
4237         call.
4238         (explain_invalid_constexpr_fn): Likewise.
4240 2017-01-23  Nathan Sidwell  <nathan@acm.org>
4242         PR c++/71710 - template using directive of field
4243         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
4244         check earlier.
4246         PR c++/71406 - ICE with scope-ref'd template id exprs
4247         PR c++/77508
4248         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
4249         before breaking up TEMPLATE_ID_EXPR.
4251 2017-01-20  Nathan Sidwell  <nathan@acm.org>
4253         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
4254         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
4256 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
4258         PR c++/77829
4259         PR c++/78656
4260         * cp-tree.h (suggest_alternatives_for): Add bool param.
4261         (suggest_alternative_in_explicit_scope): New decl.
4262         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
4263         that isn't the global one, call new function
4264         suggest_alternative_in_explicit_scope, only calling
4265         suggest_alternatives_for if it fails, and disabling near match
4266         searches fort that case.  When SCOPE is the global namespace,
4267         pass true for new param to suggest_alternatives_for to allow for
4268         fuzzy name lookups.
4269         * lex.c (unqualified_name_lookup_error): Pass true for new param
4270         to suggest_alternatives_for.
4271         * name-lookup.c (consider_binding_level): Add forward decl.
4272         (suggest_alternatives_for): Add "suggest_misspellings" param,
4273         using it to conditionalize the fuzzy name-lookup code.
4274         (suggest_alternative_in_explicit_scope): New function.
4275         * parser.c (cp_parser_primary_expression): When calling
4276         finish_id_expression, pass location of id_expression rather
4277         than that of id_expr_token.
4278         (cp_parser_id_expression): Convert local "unqualified_id" from
4279         tree to cp_expr to avoid implicitly dropping location information.
4281 2017-01-20  Marek Polacek  <polacek@redhat.com>
4283         PR c/64279
4284         * call.c (build_conditional_expr_1): Warn about duplicated branches.
4285         * semantics.c (finish_expr_stmt): Build statement using the proper
4286         location.
4288 2017-01-19  Jason Merrill  <jason@redhat.com>
4290         US 20 - forwarding references and class template argument deduction
4291         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
4292         * pt.c (push_template_decl_real): Set it.
4293         (maybe_adjust_types_for_deduction): Check it.
4294         (rewrite_template_parm): Copy it.
4296         US 19 - deduction guides and constructors
4297         * call.c (joust): Prefer deduction guides to constructors.
4298         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
4299         (deduction_guide_p): Check DECL_P.
4301         * decl.c (check_initializer): Always use build_aggr_init for array
4302         decomposition.
4304         PR c++/79130 - decomposition and direct-initialization
4305         * init.c (build_aggr_init): Communicate direct-initialization to
4306         build_vec_init.
4307         (build_vec_init): Check for array copy sooner.
4308         * parser.c (cp_parser_decomposition_declaration): Remove call to
4309         build_x_compound_expr_from_list.
4311 2017-01-18  Jason Merrill  <jason@redhat.com>
4313         PR c++/68666 - member variable template-id
4314         * typeck.c (finish_class_member_access_expr): Handle variable
4315         template-id.
4316         * pt.c (lookup_and_finish_template_variable): No longer static.
4317         * cp-tree.h: Declare it.
4319 2017-01-18  Nathan Sidwell  <nathan@acm.org>
4321         PR c++/78488
4322         * call.c (build_over_call): When checking ellipsis conversions for
4323         an inherited ctor, make sure there is at least one conversion.
4325 2017-01-18  Jason Merrill  <jason@redhat.com>
4327         PR c++/78894 - ICE with class deduction and default arg
4328         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
4330 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
4332         PR c++/77489
4333         * mangle.c (write_discriminator): Reorganize abi warning check.
4335 2017-01-18  Nathan Sidwell  <nathan@acm.org>
4337         * cp-tree.h: Clarify exception spec node comment.
4338         * except.c (nothrow_spec_p): Simplify by checking node-equality.
4340         PR c++/79091
4341         * mangle.c (write_exception_spec): Check nothrow explicitly.
4342         (write_encoding): Don't increment processing_template_decl around
4343         encoding.
4345 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
4347         PR c++/70182
4348         * mangle.c (write_template_args): Add "on" for operator names.
4350 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
4352         PR c++/77489
4353         * mangle.c (write_discriminator): Handle discriminator >= 10.
4355 2017-01-17  Nathan Sidwell  <nathan@acm.org>
4357         PR c++/61636
4358         * cp-tree.h (maybe_generic_this_capture): Declare.
4359         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
4360         (maybe_resolve_dummy): ... here.  Call it.
4361         (maybe_generic_this_capture): New.
4362         * parser.c (cp_parser_postfix_expression): Speculatively capture
4363         this in generic lambda in unresolved member function call.
4364         * pt.c (tsubst_copy_and_build): Force hard error from failed
4365         member function lookup in generic lambda.
4367 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
4369         PR c++/70565
4370         * cp-array-notation.c (expand_array_notation_exprs): Handle
4371         OMP_PARALLEL.
4373 2017-01-11  Jason Merrill  <jason@redhat.com>
4375         PR c++/78337 - ICE on invalid with generic lambda
4376         * semantics.c (process_outer_var_ref): Check if containing_function
4377         is null.  Move inform call under complain test.
4379 2017-01-11  Nathan Sidwell  <nathan@acm.org>
4381         PR c++/77812
4382         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
4383         is a new overload.
4385 2017-01-11  Nathan Sidwell  <nathan@acm.org>
4387         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
4389 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
4391         PR c++/78341
4392         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
4393         assertion.  Formatting fix.
4395         PR c++/72813
4396         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
4397         writing PCH file.
4399 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
4401         PR c++/77949
4402         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
4403         a missing semicolon if we have a valid insertion location for
4404         the fix-it hint.
4406 2017-01-10  Jason Merrill  <jason@redhat.com>
4408         FI 20, decomposition declaration with parenthesized initializer.
4409         * parser.c (cp_parser_decomposition_declaration): Use
4410         cp_parser_initializer.
4412 2017-01-09  Jason Merrill  <jason@redhat.com>
4414         Implement P0195R2, C++17 variadic using.
4415         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
4416         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
4417         * error.c (dump_decl): Likewise.
4419 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
4421         PR translation/79019
4422         PR translation/79020
4423         * semantics.c (finish_omp_clauses): Add missing whitespace to
4424         translatable strings.
4425         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
4427 2017-01-07  Jason Merrill  <jason@redhat.com>
4429         PR c++/78948 - instantiation from discarded statement
4430         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
4431         * cp-tree.h (in_discarded_stmt): Declare it.
4432         (struct saved_scope): Add discarded_stmt bitfield.
4433         (in_discarded_stmt): New macro.
4434         * decl2.c (mark_used): Check it.
4435         * parser.c (cp_parser_selection_statement): Adjust.
4436         (cp_parser_jump_statement): Adjust.
4438 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
4440         PR c++/78931
4441         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
4442         REFERENCE_REF_P, set tt to its operand.
4444         PR c++/78890
4445         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
4446         unions even for C++11 and later.
4448 2017-01-05  Nathan Sidwell  <nathan@acm.org>
4450         PR c++/78765
4451         * pt.c (convert_nontype_argument): Don't try and see if integral
4452         or enum expressions are constants prematurely.
4454 2017-01-04  Marek Polacek  <polacek@redhat.com>
4456         PR c++/64767
4457         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
4458         a zero character literal.
4460 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
4462         PR c++/78949
4463         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
4464         vector type.
4466         PR c++/78693
4467         * parser.c (cp_parser_simple_declaration): Only complain about
4468         inconsistent auto deduction if auto_result doesn't use auto.
4470         * parser.c (cp_parser_simple_declaration): Diagnose function
4471         declaration among more than one init-declarators with auto
4472         specifier.
4474         PR c++/71182
4475         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
4476         assertion, as lexer->buffer may be NULL.
4478 2017-01-04  Marek Polacek  <polacek@redhat.com>
4480         PR c++/77545
4481         PR c++/77284
4482         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
4484 2017-01-04  Nathan Sidwell  <nathan@acm.org>
4486         PR c++/66735
4487         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
4488         (lambda_capture_field_type): Update prototype.
4489         * lambda.c (lambda_capture_field_type): Add is_reference parm.
4490         Add referenceness here.
4491         (add_capture): Adjust lambda_capture_field_type call, refactor
4492         error checking.
4493         * pt.c (tsubst): Adjust lambda_capture_field_type call.
4495 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
4497         Update copyright years.
4499 Copyright (C) 2017 Free Software Foundation, Inc.
4501 Copying and distribution of this file, with or without modification,
4502 are permitted in any medium without royalty provided the copyright
4503 notice and this notice are preserved.