[PR c++/82878] pass-by-invisiref in lambda
[official-gcc.git] / gcc / cp / ChangeLog
blobe1e9d7238a68d35778df3b11f2b2e35bced3614e
1 2017-11-20  Nathan Sidwell  <nathan@acm.org>
3         PR c++/82878
4         PR c++/78495
5         * call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited
6         ctor.
7         * cp-gimplify.c (cp_genericize_r): Restore THUNK dereference
8         inhibibition check removed in previous c++/78495 change.
10 2017-11-20   Jakub Jelinek  <jakub@redhat.com>
12         PR c++/82781
13         * constexpr.c (cxx_eval_vector_conditional_expression): New function.
14         (cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
15         of cxx_eval_conditional_expression.
17 2017-11-19  Jakub Jelinek  <jakub@redhat.com>
19         PR c/66618
20         PR c/69960
21         * cp-gimplify.c (c_fully_fold): Add LVAL argument, call
22         cp_fold_maybe_rvalue instead of cp_fold_rvalue and pass it !LVAL.
24 2017-11-16  Jason Merrill  <jason@redhat.com>
26         PR c++/79092 - non-type args of different types are different
27         * tree.c (cp_tree_equal): Check the type of constants.
28         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Handle UNIFY_ALLOW_INTEGER
29         when comparing to previously deduced argument.
30         (maybe_convert_nontype_argument): New.
31         (convert_nontype_argument): Call it.
32         (tsubst_copy_and_build): Handle partial instantiation of
33         IMPLICIT_CONV_EXPR.
34         (unify): Ignore type when deducing from array bound.
35         (dependent_type_p_r): Handle DEFERRED_NOEXCEPT.
36         (value_dependent_expression_p): Any type-dependent expression is
37         value-dependent.  Handle IMPLICIT_CONV_EXPR.
38         * cp-tree.h (IMPLICIT_CONV_EXPR_NONTYPE_ARG): New.
39         * mangle.c (write_template_arg): Strip IMPLICIT_CONV_EXPR.
41 2017-11-16  Nathan Sidwell  <nathan@acm.org>
43         PR c++/82836
44         PR c++/82737
45         * cp-objcp-common.h (LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME):
46         Override.
47         * cp-tree.h (overwrite_mangling): Declare.
48         * decl2.c (struct mangled_decl_hash): Entries are deletable.
49         (overwrite_mangling): New.
51         PR c++/81060
52         * decl.c (xref_tag_1): Push lambda into current scope.
53         * name-lookup.c (do_pushtag): Don't deal with ts_lambda here.
55 2017-11-15  Nathan Sidwell  <nathan@acm.org>
57         PR c++/81574
58         * lambda.c (lambda_capture_field_type): Function references are
59         always catured by reference.
61 2017-11-15  Martin Liska  <mliska@suse.cz>
63         * decl.c (begin_destructor_body): Use cp_build_fold_indirect_ref
64         instead of cp_build_indirect_ref.
66 2017-11-15  Martin Liska  <mliska@suse.cz>
68         * decl.c (begin_destructor_body): In case of VPTR sanitization
69         (with disabled recovery), zero vptr in order to catch virtual calls
70         after lifetime of an object.
72 2017-11-14  Jason Merrill  <jason@redhat.com>
74         Use GTY((cache)) on some hash tables.
75         * decl.c (decomp_type_table): Use tree_cache_map.
76         * init.c (nsdmi_inst): Likewise.
77         * pt.c (defarg_ints): Likewise.
78         * cp-objcp-common.c (cp_get_debug_type): Likewise.
80 2017-11-13  Jason Merrill  <jason@redhat.com>
82         Capture adjustments for P0588R1.
83         * semantics.c (process_outer_var_ref): Capture variables when
84         they are named; complain about non-capture uses when odr-used.
85         * expr.c (mark_use): Rvalue use looks through capture proxy.
86         * constexpr.c (potential_constant_expression_1): Improve error about
87         use of captured variable.
88         * lambda.c (need_generic_capture, dependent_capture_r)
89         (do_dependent_capture, processing_nonlambda_template): Remove.
90         * call.c (build_this): Remove uses of the above.
91         * decl.c (cp_finish_decl): Likewise.
92         * semantics.c (maybe_cleanup_point_expr)
93         (maybe_cleanup_point_expr_void, finish_goto_stmt)
94         (maybe_convert_cond): Likewise.
95         * typeck.c (check_return_expr): Likewise.
97         Defer folding of *&.
98         * typeck.c (cp_build_fold_indirect_ref): New.
99         (cp_build_indirect_ref_1): Split out from cp_build_indirect_ref.
100         Add 'fold' parameter.
101         * cp-tree.h: Declare cp_build_fold_indirect_ref.
102         * call.c, class.c, cp-ubsan.c, decl.c, except.c, init.c, lambda.c,
103         parser.c, rtti.c, tree.c, typeck.c, typeck2.c: Use it.
104         * parser.c (do_range_for_auto_deduction): Use RO_UNARY_STAR.
105         (cp_convert_range_for): Likewise.
106         * typeck2.c (build_x_arrow): Use RO_ARROW.
108         * cp-ubsan.c (cp_ubsan_check_member_access_r): Fix handling of
109         INDIRECT_REF of ADDR_EXPR.
111         PR c++/82360 - ICE with static_cast in template.
112         * call.c (perform_direct_initialization_if_possible): Check
113         processing_template_decl.
114         * typeck.c (build_static_cast_1): Likewise.
116 2017-11-13  Ville Voutilainen  <ville.voutilainen@gmail.com>
118         Remove the null check from placement new in all modes
119         * init.c (build_new_1): Don't do a null check for
120         a namespace-scope non-replaceable placement new
121         in any mode unless -fcheck-new is provided.
123 2017-11-07 Boris Kolpackov  <boris@codesynthesis.com>
125         * Make-lang.in (CP_PLUGIN_HEADERS): Add operators.def since included
126         in cp-tree.h.
128 2017-11-07  Jakub Jelinek  <jakub@redhat.com>
130         PR c++/82835
131         * cp-gimplify.c (cxx_omp_clause_apply_fn): For methods pass i - 1 to
132         convert_default_arg instead of i.
134 2017-11-06  Jason Merrill  <jason@redhat.com>
136         P0704R1 - fixing const-qualified pointers to members
137         * typeck2.c (build_m_component_ref): Also accept in lower stds with
138         a pedwarn.
140 2017-11-06  Paolo Carlini  <paolo.carlini@oracle.com>
142         PR c++/65579
143         * decl2.c (finish_static_data_member_decl): If there's an initializer,
144         complete the type and re-apply the quals.
146 2017-11-06  Martin Liska  <mliska@suse.cz>
148         PR middle-end/82404
149         * constexpr.c (cxx_eval_builtin_function_call): Handle
150         __builtin_unreachable call.
151         (get_function_named_in_call): Declare function earlier.
152         (constexpr_fn_retval): Skip __builtin_unreachable.
153         * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Rename to
154         ...
155         (cp_maybe_instrument_return): ... this.
156         (cp_genericize): Call the function unconditionally.
158 2017-11-03  Nathan Sidwell  <nathan@acm.org>
160         PR c++/82710
161         * decl.c (grokdeclarator): Protect MAYBE_CLASS things from paren
162         warning too.
164 2017-11-02  Paolo Carlini  <paolo.carlini@oracle.com>
166         PR c++/81957
167         * pt.c (make_pack_expansion): Add tsubst_flags_t parameter.
168         (expand_integer_pack, convert_template_argument, coerce_template_parms,
169         gen_elem_of_pack_expansion_instantiation, tsubst_pack_expansion,
170         unify): Adjust calls.
171         * tree.c (cp_build_qualified_type_real): Likewise.
172         * cp-tree.h (make_pack_expansion): Adjust declaration.
174 2017-11-02  Nathan Sidwell  <nathan@acm.org>
176         * cp-tree.h (IDENTIFIER_NEWDEL_OP_P): Restore, adjust.
177         (IDENTIFIER_NEW_OP_P): New.
178         * decl.c (grokdeclarator): Restore IDENTIFIER_NEWDEL_OP_P use.
179         * pt.c (push_template_decl_real): Likewise.
180         * typeck.c (check_return_expr): Use IDENTIFIER_NEW_OP_P.
182         PR c++/82710
183         * decl.c (grokdeclarator): Don't warn when parens protect a return
184         type from a qualified name.
186 2017-11-01  Nathan Sidwell  <nathan@acm.org>
188         * cp-tree.h (enum cp_identifier_kind): Delete cik_newdel_op.
189         Renumber and reserve udlit value.
190         (IDENTIFIER_NEWDEL_OP_P): Delete.
191         (IDENTIFIER_OVL_OP_P): New.
192         (IDENTIFIER_ASSIGN_OP_P): Adjust.
193         (IDENTIFIER_CONV_OP_P): Adjust.
194         (IDENTIFIER_OVL_OP_INFO): Adjust.
195         (IDENTIFIER_OVL_OP_FLAGS): New.
196         * decl.c (grokdeclarator): Use IDENTIFIER_OVL_OP_FLAGS.
197         * lex.c (get_identifier_kind_name): Adjust.
198         (init_operators): Don't special case new/delete ops.
199         * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_P.
200         * pt.c (push_template_decl_real): Use IDENTIFIER_OVL_OP_FLAGS.
201         * typeck.c (check_return_expr): Likewise.
203         * cp-tree.h (assign_op_identifier, call_op_identifier): Use
204         compressed code.
205         (struct lang_decl_fn): Use compressed operator code.
206         (DECL_OVERLOADED_OPERATOR_CODE): Replace with ...
207         (DECL_OVERLOADED_OPERATOR_CODE_RAW): ... this.
208         (DECL_OVERLOADED_OPERATOR_CODE_IS): Use it.
209         * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE_RAW.
210         (build_library_fn): Likewise.
211         (grok_op_properties): Likewise.
212         * mangle.c (write_unqualified_name): Likewise.
213         * method.c (implicitly_declare_fn): Likewise.
214         * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_IS.
216         * cp-tree.h (IDENTIFIER_CP_INDEX): Define.
217         (enum ovl_op_flags): Add OVL_OP_FLAG_AMBIARY.
218         (enum ovl_op_code): New.
219         (struct ovl_op_info): Add ovl_op_code field.
220         (ovl_op_info): Size by OVL_OP_MAX.
221         (ovl_op_mapping, ovl_op_alternate): Declare.
222         (OVL_OP_INFO): Adjust for mapping array.
223         (IDENTIFIER_OVL_OP_INFO): New.
224         * decl.c (ambi_op_p, unary_op_p): Delete.
225         (grok_op_properties): Use IDENTIFIER_OVL_OP_INFO and
226         ovl_op_alternate.
227         * lex.c (ovl_op_info): Adjust and static initialize.
228         (ovl_op_mappings, ovl_op_alternate): Define.
229         (init_operators): Iterate over ovl_op_info array and init mappings
230         & alternate arrays.
231         * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_INFO.
232         * operators.def (DEF_OPERATOR): Remove KIND parm.
233         (DEF_SIMPLE_OPERATOR): Delete.
234         (OPERATOR_TRANSITION): Expand if defined.
236 2017-10-31  David Malcolm  <dmalcolm@redhat.com>
238         * pt.c (listify): Use %< and %> for description of #include.
240 2017-10-31  David Malcolm  <dmalcolm@redhat.com>
242         * class.c (explain_non_literal_class): Use UNKNOWN_LOCATION rather
243         than 0.
244         * name-lookup.c (suggest_alternatives_for): Update for renaming of
245         inform_at_rich_loc.
246         (maybe_suggest_missing_header): Likewise.
247         (suggest_alternative_in_explicit_scope): Likewise.
248         * parser.c (cp_parser_diagnose_invalid_type_name): Likewise for
249         renaming of error_at_rich_loc.
250         (cp_parser_string_literal): Likewise.
251         (cp_parser_nested_name_specifier_opt): Likewise.
252         (cp_parser_cast_expression): Likewise for renaming of
253         warning_at_rich_loc.
254         (cp_parser_decl_specifier_seq): Likewise for renaming of
255         error_at_rich_loc and warning_at_rich_loc.
256         (cp_parser_elaborated_type_specifier): Likewise for renaming of
257         pedwarn_at_rich_loc.
258         (cp_parser_cv_qualifier_seq_opt): Likewise for renaming of
259         error_at_rich_loc.
260         (cp_parser_virt_specifier_seq_opt): Likewise.
261         (cp_parser_class_specifier_1): Likewise.
262         (cp_parser_class_head): Likewise.
263         (cp_parser_member_declaration): Likewise for renaming of
264         pedwarn_at_rich_loc, warning_at_rich_loc, and error_at_rich_loc.
265         (cp_parser_enclosed_template_argument_list): Likewise for renaming
266         of error_at_rich_loc.
267         (set_and_check_decl_spec_loc): Likewise.
268         * pt.c (listify): Likewise.
269         * rtti.c (typeid_ok_p): Likewise.
270         * semantics.c (process_outer_var_ref): Use UNKNOWN_LOCATION rather
271         than 0.
272         * typeck.c (access_failure_info::maybe_suggest_accessor): Update
273         for renaming of inform_at_rich_loc.
274         (finish_class_member_access_expr): Likewise for renaming of
275         error_at_rich_loc.
277 2017-10-31  Nathan Sidwell  <nathan@acm.org>
279         * cp-tree.h (struct operator_name_info_t): Rename to ...
280         (struct ovl_op_info_t): ... here.  Add tree_code field.
281         (operator_name_info, assignment_operator_name_info): Delete.
282         (ovl_op_info): Declare.
283         (OVL_OP_INFO): Adjust.
284         * decl.c (grok_op_properties): Use ovl_op_flags.
285         * lex.c (operator_name_info, assignment_operator_name_info):
286         Delete.
287         (ovl_op_info): Define.
288         (set_operator_ident): Adjust.
289         (init_operators): Set tree_code.
290         * mangle.c (write_unqualified_id): Adjust operator array scan.
292         * lex.c (init_operators): Allow NULL operator name.  Don't add
293         special cases.
294         * operators.def: Use NULL for mangling only operators.  Move to
295         after regular operators but move assignment operators last.
297         * cp-tree.h (enum ovl_op_flags): New.
298         (struct operator_name_info_t): Rename arity to flags.
299         * lex.c (set_operator_ident): New.
300         (init_operators): Use it.  Adjust for flags.
301         * mangle.c (write_unqualified_id): Adjust for flags.
302         * operators.def: Replace arity with flags.
304         * cp-tree.h (ovl_op_identifier): New.
305         (assign_op_identifier, call_op_identifier): Adjust.
306         (cp_operator_id, cp_assignment_operator_ide): Delete.
307         (SET_OVERLOADED_OPERATOR_CODE): Delete.
308         (OVL_OP_INFO): New.
309         * call.c (op_error): Use OVL_OP_INFO.
310         (build_conditional_expr_1): Use ovl_op_identifier.
311         (build_new_op_1): Use OVL_OP_INFO & ovl_op_identifier.
312         (build_op_delete_call): Likewise.
313         * class.c (type_requires_array_cookie): Use ovl_op_identifier.
314         * decl.c (duplicate_decls): Directly copy operator code.
315         (builtin_function_1): Do not set operator code.
316         (build_library_fn): Directly set operator code.
317         (push_cp_library_fn): Use ovl_op_identifier.
318         (grok_op_properties): Directly set operator code.
319         * decl2.c (maybe_warn_sized_delete): Use ovl_op_identifier.
320         * error.c (dump_expr): Use OVL_OP_INFO.
321         (op_to_string): Add assop arg. Use OVL_OP_INFO.
322         (assop_to_string): Delete.
323         (args_to_string): Adjust.
324         * init.c (build_new_1): Use ovl_op_identifier.
325         * mangle.c (write_unqualified_name): Use OVL_OP_INFO.
326         (write_expression): Likewise.
327         * method.c (synthesized_method_walk): Use ovl_op_identifier.
328         (implicitly_declare_fn): Use assign_op_identifier. Directly set
329         operator code.
330         * name-lookup.c (get_class_binding): Use assign_op_identifier.
331         * parser.c (cp_parser_operator): Use ovl_op_identifier.
332         (cp_parser_omp_clause_reduction): Likewise.
333         * semantics.c (omp_reduction_id): Likewise.
334         * typeck.c (cxx_sizeof_or_alignof_type): Use OVL_OP_INFO.
336         * cp-tree.h (assign_op_identifier, call_op_identifier): Define.
337         (LAMBDA_FUNCTION_P): Use DECL_OVERLOADED_OPERATOR_IS.
338         (DECL_OVERLOADED_OPERATOR_P): Just retuurn true/false.
339         (DECL_OVERLOADED_OPERATOR_CODE, DECL_OVERLOADED_OPERATOR_IS): Define.
340         * call.c (add_function_candidate): Use
341         DECL_OVERLOADED_OPERATOR_IS.
342         (build_op_call_1): Use call_op_identifier &
343         DECL_OVERLOADED_OPERATOR_IS.
344         (build_over_call): Likewise.
345         (has_trivial_copy_assign_p): Use assign_op_identifier.
346         (build_special_member_call): Likewise.
347         * class.c (dfs_declare_virt_assop_and_dtor): Likewise.
348         (vbase_has_user_provided_move_assign,
349         classtype_has_move_assign_or_move_ctor_p): Likewise.
350         * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE.
351         (grok_special_member_properties): Use assign_op_identifier.
352         (start_preparsed_function): Use DECL_OVERLOADED_OPERATOR_IS.
353         * decl2.c (mark_used): Use DECL_CONV_FN_P.
354         * dump.c (dump_access): Delete prototype.
355         (dump_op): Delete.
356         (cp_dump_tree): Don't call it.
357         * lambda.c (lambda_function): Use call_op_identifier.
358         (maybe_add_lambda_conv_op): Not an overloaded operator.  Remove
359         unneeded braces.
360         * mangle.c (write_unqualified_name): Use DECL_OVERLOADED_OPERTOR_CODE.
361         * method.c (do_build_copy_assign): Use assign_op_identifier.
362         (synthesize_method): Use DECL_OVERLOADED_OPERATOR_IS.
363         (get_copy_assign): Use assign_op_identifier.
364         (synthesized_method_walk): Likewise.
365         (defaultable_fn_check): Use DECL_OVERLOADED_OPERATOR_IS.
366         * parser.c (cp_parser_lambda_declarator_opt): Use
367         call_op_identifier.
368         * semanitics.c (classtype_has_nothrow_assign_or_copy_p): Use
369         assign_op_identifier.
370         * tree.c (special_function_p):  Use DECL_OVERLOADED_OPERATOR_IS.
371         * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_CODE.
372         (check_return_expr): Use assign_op_identifier.
374 2017-10-30  Paolo Carlini  <paolo.carlini@oracle.com>
376         PR c++/82085
377         * pt.c (tsubst_copy_and_build, [INDIRECT_REF]): For a REFERENCE_REF_P,
378         unconditionally call convert_from_reference.
380 2017-10-30  Nathan Sidwell  <nathan@acm.org>
382         * call.c (build_op_call_1): Test for FUNCTION_DECL in same manner
383         as a few lines earlier.
384         * cp-tree.h (PACK_EXPANSION_PATTERN): Fix white space.
385         * decl.c (grokfndecl): Fix indentation.
386         (compute_array_index_type): Use processing_template_decl_sentinel.
387         (grok_op_properties): Move warnings to end.  Reorder other checks
388         to group similar entities.  Tweak diagnostics.
389         * lex.c (unqualified_name_lookup_error): No need to check name is
390         not ERROR_MARK operator.
391         * parser.c (cp_parser_operator): Select operator code before
392         looking it up.
393         * typeck.c (check_return_expr): Fix indentation and line wrapping.
395 2017-10-27  Paolo Carlini  <paolo.carlini@oracle.com>
397         * pt.c (invalid_nontype_parm_type_p): Return a bool instead of an int.
399 2017-10-26  Nathan Sidwell  <nathan@acm.org>
401         * decl.c (sort_labels): Restore function.
402         (pop_labels): Sort labels
403         (identify_goto): Add translation markup.
405 2017-10-25  Nathan Sidwell  <nathan@acm.org>
407         Kill IDENTIFIER_LABEL_VALUE.
408         * cp-tree.h (lang_identifier): Delete label_value slot.
409         (IDENTIFIER_LABEL_VALUE, SET_IDENTIFIER_LABEL_VALUE): Delete.
410         (struct named_label_hasher): Rename to ...
411         (struct named_label_hash): ... here.  Reimplement.
412         (struct language_function): Adjust x_named_labels.
413         * name-lookup.h (struct cp_label_binding): Delete.
414         (struct cp_binding_level): Delete shadowed_labels slot.
415         * decl.c (struct named_label_entry): Add name and outer slots.
416         (pop_label): Rename to ...
417         (check_label_used): ... here.  Don't pop.
418         (note_label, sort_labels): Delete.
419         (pop_labels, pop_local_label): Reimplement.
420         (poplevel): Pop local labels as any other decl. Remove
421         shadowed_labels handling.
422         (named_label_hash::hash, named_label_hash::equal): New.
423         (make_label_decl): Absorb into ...
424         (lookup_label_1): ... here.  Add making_local_p arg, reimplement.
425         (lookup_label, declare_local_label): Adjust.
426         (check_goto, define_label): Adjust.
427         * lex.c (make_conv_op_name): Don't clear IDENTIFIER_LABEL_VALUE.
428         * ptree.c (cxx_print_identifier): Don't print identifier binding.
430         * decl.c (identifier_goto): Reduce duplication.
431         (check_previous_goto_1): Likewise.
432         (check_goto): Move var decls to initialization.
433         (check_omp_return, define_label_1, define_label): Likewise.
435 2017-10-25  Jakub Jelinek  <jakub@redhat.com>
437         PR libstdc++/81706
438         * decl.c (duplicate_decls): Copy "omp declare simd" attributes from
439         newdecl to corresponding __builtin_ if any.
441 2017-10-24  Paolo Carlini  <paolo.carlini@oracle.com>
443         PR c++/82466
444         * decl.c (duplicate_decls): Warn for built-in functions declared as
445         non-function, use OPT_Wbuiltin_declaration_mismatch.
447         * decl.c (duplicate_decls): Avoid redundant '+' in warning_at.
449 2017-10-24  Paolo Carlini  <paolo.carlini@oracle.com>
451         PR c++/80991
452         * pt.c (value_dependent_expression_p, [TRAIT_EXPR]): Handle
453         a TREE_LIST as TRAIT_EXPR_TYPE2.
455 2017-10-24  Mukesh Kapoor  <mukesh.kapoor@oracle.com>
456             Paolo Carlini  <paolo.carlini@oracle.com>
458         PR c++/82307
459         * cvt.c (type_promotes_to): Implement C++17, 7.6/4, about unscoped
460         enumeration type whose underlying type is fixed.
462 2017-10-23  Paolo Carlini  <paolo.carlini@oracle.com>
464         PR c++/80449
465         * semantics.c (finish_compound_literal): Check do_auto_deduction
466         return value for error_mark_node.
468 2017-10-23  Jason Merrill  <jason@redhat.com>
470         PR c++/77369 - wrong noexcept handling in C++14 and below
471         * tree.c (strip_typedefs): Canonicalize TYPE_RAISES_EXCEPTIONS.
473 2017-10-20  Nathan Sidwell  <nathan@acm.org>
475         * class.c (layout_class_type): Cleanup as-base creation, determine
476         mode here.
477         (finish_struct_1): ... not here.
479 2017-10-19  Jakub Jelinek  <jakub@redhat.com>
481         PR c++/82600
482         * typeck.c (check_return_expr): Don't call
483         maybe_warn_about_returning_address_of_local in templates.
485 2017-10-17  Nathan Sidwell  <nathan@acm.org>
487         PR c++/82560
488         * call.c (build_over_call): Don't pass tf_no_cleanup to nested
489         calls.
491         PR middle-end/82546
492         * cp-objcp-common.c (cp_tree_size): Reformat.  Adjust returns size
493         of TYPE nodes.
495 2017-10-13  Jason Merrill  <jason@redhat.com>
497         PR c++/82357 - bit-field in template
498         * tree.c (cp_stabilize_reference): Just return a NON_DEPENDENT_EXPR.
500 2017-10-13  David Malcolm  <dmalcolm@redhat.com>
502         * cp-tree.h (maybe_show_extern_c_location): New decl.
503         * decl.c (grokfndecl): When complaining about literal operators
504         with C linkage, issue a note giving the location of the
505         extern "C".
506         * parser.c (cp_parser_new): Initialize new field
507         "innermost_linkage_specification_location".
508         (cp_parser_linkage_specification): Store the location
509         of the linkage specification within the cp_parser.
510         (cp_parser_explicit_specialization): When complaining about
511         template specializations with C linkage, issue a note giving the
512         location of the extern "C".
513         (cp_parser_explicit_template_declaration): Likewise for templates.
514         (maybe_show_extern_c_location): New function.
515         * parser.h (struct cp_parser): New field
516         "innermost_linkage_specification_location".
518 2017-10-12  Nathan Sidwell  <nathan@acm.org>
520         * cp-tree.h (cp_expr): Add const operator * and operator->
521         accessors.
522         (cp_tree_node_structure_enum): Delete TS_CP_BINDING,
523         TS_CP_WRAPPER, LAST_TS_CP_ENUM.
525 2017-10-12  David Malcolm  <dmalcolm@redhat.com>
527         * parser.c (get_required_cpp_ttype): New function.
528         (cp_parser_error_1): Call it, using the result to call
529         maybe_suggest_missing_token_insertion.
531 2017-10-12  David Malcolm  <dmalcolm@redhat.com>
533         * parser.c (get_matching_symbol): Move to before...
534         (cp_parser_error): Split out into...
535         (cp_parser_error_1): ...this new function, merging in content
536         from...
537         (cp_parser_required_error): ...here.  Eliminate partial duplicate
538         of body of cp_parser_error in favor of a call to the new
539         cp_parser_error_1 helper function.
541 2017-10-11  Nathan Sidwell  <nathan@acm.org>
543         * decl2.c (struct mangled_decl_hash): Use DECL_ASSEMBLER_NAME_RAW.
544         (record_mangling): Likewise.
546 2017-10-10  Nathan Sidwell  <nathan@acm.org>
548         * name-lookup.c (extern_c_fns): Rename to ...
549         (extern_c_decls): ... here.
550         (check_extern_c_conflict, extern_c_linkage_bindings): Update.
551         (do_pushdecl): Check extern-c fns and vars.
553         * cp-tree.h (default_hash_traits <lang_identifier *>): Delete
554         specialization.
556         * decl2.c (struct mangled_decl_hash): New hash traits.
557         (mangled_decls): Make hash_table<mangled_decl_hash>.
558         (generate_mangling_alias, record_mangling): Adjust.
560 2017-10-10  Jason Merrill  <jason@redhat.com>
562         More delayed lambda capture fixes.
563         * call.c (add_function_candidate): Use build_address.
564         (build_op_call_1): Call mark_lvalue_use early.
565         (build_over_call): Handle error from build_this.
566         * constexpr.c (cxx_bind_parameters_in_call): Use build_address.
567         (cxx_eval_increment_expression): Don't use rvalue().
568         * cvt.c (convert_to_void): Use mark_discarded_use.
569         * expr.c (mark_use): Handle PARM_DECL, NON_DEPENDENT_EXPR.  Fix
570         reference handling.  Don't copy the expression.
571         (mark_discarded_use): New.
572         * lambda.c (insert_capture_proxy): Add some sanity checking.
573         (maybe_add_lambda_conv_op): Set cp_unevaluated_operand.
574         * pt.c (register_local_specialization): Add sanity check.
575         * semantics.c (process_outer_var_ref): Fix check for existing proxy.
576         * typeck.c (cp_build_addr_expr_1): Handle error from
577         mark_lvalue_use.
578         (cp_build_modify_expr): Call mark_lvalue_use_nonread, handle error
579         from rvalue.
581         Handle generic lambda capture in dependent expressions.
582         * lambda.c (need_generic_capture, dependent_capture_r)
583         (do_dependent_capture): New.
584         * pt.c (processing_nonlambda_template): Use need_generic_capture.
585         * semantics.c (maybe_cleanup_point_expr)
586         (maybe_cleanup_point_expr_void, finish_goto_stmt)
587         (maybe_convert_cond): Call do_dependent_capture.
588         * typeck.c (build_static_cast): Remove dependent capture handling.
590         * typeck.c (condition_conversion): Assert !processing_template_decl.
591         * semantics.c (finish_omp_clauses): Don't
592         fold_build_cleanup_point_expr if processing_template_decl.
593         (outer_var_p): A temporary can't be from an outer scope.
594         * pt.c (type_dependent_expression_p): Fix dependency checking of
595         functions without DECL_TEMPLATE_INFO.
596         (instantiate_decl): Use lss_copy.
597         * constexpr.c (is_valid_constexpr_fn): Fix lambdas before C++17.
599         * typeck.c (check_return_expr): Check non-dependent conversion in
600         templates.
601         * constraint.cc (check_function_concept): Don't complain about an
602         empty concept if seen_error.
604 2017-10-10  Richard Sandiford  <richard.sandiford@linaro.org>
606         * cvt.c (ignore_overflows): Use wi::to_wide when
607         operating on trees as wide_ints.
608         * decl.c (check_array_designated_initializer): Likewise.
609         * mangle.c (write_integer_cst): Likewise.
610         * semantics.c (cp_finish_omp_clause_depend_sink): Likewise.
612 2017-10-10  Nathan Sidwell  <nathan@acm.org>
614         * name-lookup.c (set_global_binding): Don't deal with STAT_HACK.
616 2017-10-06  Paolo Carlini  <paolo.carlini@oracle.com>
618         PR c++/47791
619         * decl.c (finish_function): Take a bool intead of an int; adjust.
620         * cp-tree.h (finish_function): Adjust declaration.
621         * decl2.c (generate_tls_wrapper, finish_objects,
622         finish_static_storage_duration_function): Adjust calls.
623         * lambda.c (maybe_add_lambda_conv_op, finish_lambda_function):
624         Likewise.
625         * method.c (synthesize_method): Likewise.
626         * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
627         * pt.c (instantiate_decl): Likewise.
628         * parser.c (cp_parser_function_definition_after_declarator,
629         cp_parser_late_parsing_for_member, cp_parser_omp_declare_reduction):
630         Likewise.
631         (cp_parser_ctor_initializer_opt,
632         cp_parser_ctor_initializer_opt_and_function_body,
633         cp_parser_function_try_block,
634         cp_parser_function_definition_after_declarator,
635         cp_parser_function_transaction): Return void; adjust declarations.
637 2017-10-06  Nathan Sidwell  <nathan@acm.org>
639         PR c++/82424
640         * name-lookup.c (check_local_shadow): Don't try and convert
641         dependent types.
643 2017-10-06  Jakub Jelinek  <jakub@redhat.com>
645         PR c++/82299
646         * decl.c (reshape_init): Suppress warn_useless_cast for direct enum
647         init.
648         * typeck.c (convert_for_assignment): Likewise.
650         P0704R1 - fixing const-qualified pointers to members
651         * typeck2.c (build_m_component_ref): For -std=c++2a allow
652         pointer to const & qualified method on rvalue.
654 2017-10-06  Nathan Sidwell  <nathan@acm.org>
656         Use hash_table for extern "C" names
657         * name-lookup.c (extern_c_fns): Use hash_table.
658         (check_extern_c_conflict): Adjust.
659         (c_linkage_bindings): Adjust.
661         Use hash_table for namespace bindings
662         * cp-tree.h (struct named_decl_hash): New.
663         (lang_decl_ns): Change type of bindings field.
664         * lex.c (maybe_add_lang_decl_raw): Adjust.
665         * name-lookup.c (find_namespace_slot): Adjust.
666         (do_pushdecl): Push NULL-named namespace.
667         (do_push_nested_namespace): Adjust.
668         (push_namespace): Push anonymous namespace as NULL name.
670 2017-10-05  Jason Merrill  <jason@redhat.com>
672         Pass variadic class objects exactly like named by-value args.
673         * call.c (convert_arg_to_ellipsis): Use the result of force_rvalue.
675 2017-10-05  Nathan Sidwell  <nathan@acm.org>
677         Warn on MVP declarations
678         * cp-tree.h (struct cp_declarator): Add parenthesized field.
679         * decl.c (grokdeclarator): Warn about unnecessary parens.
680         * parser.c (make_declarator): Init parenthesized field.
681         (cp_parser_direct_declarator): Set parenthesized field.
683         Kill IDENTIFIER_GLOBAL_VALUE, SET_IDENTIFIER_GLOBAL_VALUE
684         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
685         SET_IDENTIFIER_GLOBAL_VALUE): Delete.
686         * name-lookup.h (set_global_binding): Remove NAME parm.
687         (get_global_binding): New inline fn.
688         * name-lookup.c (set_global_binding): Remove NAME parm. Adjust.
689         (identifier_global_value): Move to ...
690         * cp-objcp-common.c (identifier_global_value): ... here.
691         * class.c (build_ctor_vtbl_group, build_vtbl_initializer): Adjust.
692         * decl.c (record_builtin_type, expand_static_init,
693         grokdeclarator): Adjust.
694         * decl2.c (get_guard, get_local_tls_init_fn, get_tls_init_fn,
695         get_tls_wrapper_fn, maybe_warn_sized_delete): Adjust.
696         * except.c (declare_library_fn, build_throw): Adjust.
697         * init.c (throw_bad_array_length): Adjust.
698         * rtti.c (throw_bad_cast, throw_bad_typeid, get_tinfo_decl): Adjust.
700         * decl2.c (record_mangling): Fix spello and formatting from
701         previous patch.
703 2017-10-04  Nathan Sidwell  <nathan@acm.org>
705         Give builtin types the correct name.
706         * name-lookup.c (set_global_binding): Assert name is DECL_NAME.
707         * decl.c (record_builtin_type): Reimplement, use new TYPE_DECL for
708         rname.
710 2017-10-04  Paolo Carlini  <paolo.carlini@oracle.com>
711             Andrew Pinski  <apinski@cavium.com>
713         PR c++/71946
714         * parser.c (cp_parser_lambda_body): Set parser->in_function_body.
716 2017-10-04  Nathan Sidwell  <nathan@acm.org>
718         Move mangling aliases out of global namespace.
719         * cp-tree.h (record_mangling): New.
720         (maybe_remove_implicit_alias): Delete.
721         * decl2.c (mangled_decls): New hash map.
722         (generate_mangling_alias): Reimplement using mangled_decls.
723         (record_mangling): New.
724         * mangle.c (decl_implicit_alias_p,
725         maybe_remove_implicit_alias): Delete.
726         (mangle_decl): Use record_mangling.
727         * name-lookup.c (supplement_binding_1): Remove
728         maybe_remove_implicit_alias check.
730 2017-10-04  Jakub Jelinek  <jakub@redhat.com>
732         PR c++/82373
733         * error.c (dump_function_decl): If show_return, call dump_type_suffix
734         on the same return type dump_type_prefix has been called on.
736 2017-10-04  Jason Merrill  <jason@redhat.com>
738         PR c++/81525 - broken handling of auto in generic lambda.
739         * pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.
741 2017-10-04  Nathan Sidwell  <nathan@acm.org>
743         * call.c (convert_arg_to_ellipsis): Correct comment about passing
744         by reference.
746 2017-10-02  Richard Sandiford  <richard.sandiford@linaro.org>
748         * constexpr.c (cxx_eval_store_expression): Use wi::to_widest
749         when comparing the array bounds with an ARRAY_REF index.
751 2017-09-30  Paolo Carlini  <paolo.carlini@oracle.com>
753         PR c++/68754
754         * method.c (defaulted_late_check): Early return if the defaulted
755         declaration does not match the expected signature.
757 2017-09-29  Jakub Jelinek  <jakub@redhat.com>
759         P0683R1 - default member initializers for bit-fields
760         * cp-tree.h (grokbitfield): Add INIT parameter.
761         * parser.c (cp_parser_constant_expression): Add STRICT_P argument,
762         if true, parse a conditional-expression rather than
763         assignment-expression.
764         (cp_parser_member_declaration): For C++11 and later pass true
765         as STRICT_P to cp_parser_constant_expression.  Parse C++2A bitfield
766         NSDMIs.  Adjust grokbitfield caller.  Handle DECL_INITIAL also for
767         DECL_C_BIT_FIELDs.
768         (cp_parser_objc_class_ivars): Adjust grokbitfield caller.
769         * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs.
770         (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs.
771         * decl2.c (grokbitfield): Add INIT parameter, pass it to
772         cp_finish_decl.
773         * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not
774         just non-bitfields.
776         * class.c (check_bitfield_decl): Retrieve and clear width from
777         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
778         (check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than
779         DECL_INITIAL.
780         (remove_zero_width_bit_fields): Adjust comment.
781         * decl2.c (grokbitfield): Stash width into
782         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
783         * pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr
784         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width.
786         * parser.c (cp_parser_member_declaration): Parse attributes before
787         colon of a bitfield in addition to after colon.
789         * Make-lang.in (check-c++-all): Test also c++2a.
791 2017-09-28  Jason Merrill  <jason@redhat.com>
793         PR c++/56973, DR 696 - capture constant variables only as needed.
794         * expr.c (mark_use): Split out from mark_rvalue_use and
795         mark_lvalue_use.  Handle lambda capture of constant variables.
796         (mark_lvalue_use_nonread): New.
797         * semantics.c (process_outer_var_ref): Don't capture a constant
798         variable until forced.
799         * pt.c (processing_nonlambda_template): New.
800         * call.c (build_this): Check it.
801         * decl2.c (grok_array_decl): Call mark_rvalue_use and
802         mark_lvalue_use_nonread.
803         * init.c (constant_value_1): Don't call mark_rvalue_use.
804         * typeck.c (build_static_cast): Handle lambda capture.
806         Use local_specializations to find capture proxies.
807         * cp-tree.h (DECL_CAPTURED_VARIABLE): New.
808         * lambda.c (build_capture_proxy): Set it.
809         (add_capture): Pass initializer to build_capture_proxy.
810         (start_lambda_function): Likewise.
811         (insert_capture_proxy): Use register_local_specialization.
812         (is_lambda_ignored_entity): Always ignore proxies.
813         * name-lookup.c (qualify_lookup): Don't check
814         is_lambda_ignored_entity if LOOKUP_HIDDEN is set.
815         * semantics.c (process_outer_var_ref): Use
816         retrieve_local_specialization.
817         * parser.c (cp_parser_lambda_body): Push local_specializations.
818         * pt.c (tsubst_expr): Pass LOOKUP_HIDDEN when looking for a proxy.
819         (tsubst_lambda_expr): Push local_specializations sooner.
820         (tsubst_copy_and_build): Don't register_local_specialization.
822         * call.c (build_special_member_call): Use the return value of
823         mark_lvalue_use.
824         * decl.c (compute_array_index_type): Likewise.
825         * parser.c (cp_parser_oacc_wait_list): Likewise.
826         * lambda.c (is_normal_capture_proxy): Handle *this capture.
827         (add_capture): Clarify internal_error message.
829 2017-09-22  Eric Botcazou  <ebotcazou@adacore.com>
831         PR bootstrap/81926
832         * cp-objcp-common.c (cp_get_debug_type): Do only one lookup.
834 2017-09-22  Jakub Jelinek  <jakub@redhat.com>
836         PR sanitizer/81929
837         * tree.c (struct replace_placeholders_t): Add pset field.
838         (replace_placeholders_r): Call cp_walk_tree with d->pset as
839         last argument instead of NULL.  Formatting fix.
840         (replace_placeholders): Add pset variable, add its address
841         into data.  Pass &pset instead of NULL to cp_walk_tree.
843 2017-09-22  David Malcolm  <dmalcolm@redhat.com>
845         * call.c (get_fndecl_argument_location): New function.
846         (convert_like_real): Use it  when complaining about argument type
847         mismatches.
848         * cp-tree.h (struct cp_parameter_declarator): Add "loc" field.
849         * parser.c (make_parameter_declarator): Add "loc" param and use
850         it to initialize the new field.
851         (cp_parser_translation_unit): Add UNKNOWN_LOCATION for "loc" of
852         the "no_parameters" parameter.
853         (cp_parser_parameter_declaration_list): Set the location of the
854         result of grokdeclarator to be the parameter's loc, assuming no
855         errors.
856         (cp_parser_parameter_declaration): Generate a location for the
857         parameter and pass to make_parameter_declarator.
859 2017-09-20  Nathan Sidwell  <nathan@acm.org>
861         * name-lookup.c (member_name_cmp): Use DECL_UID for final
862         ordering.
864 2017-09-20  Jakub Jelinek  <jakub@redhat.com>
866         P0409R2 - allow lambda capture [=, this]
867         * parser.c (cp_parser_lambda_introducer): For cxx2a don't pedwarn on
868         redundant [=, this].
870 2017-09-18  Jason Merrill  <jason@redhat.com>
872         PR c++/82069 - ICE with lambda in template
873         * semantics.c (process_outer_var_ref): Check uses_template_parms
874         instead of any_dependent_template_arguments_p.
876 2017-09-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
877             Paolo Carlini  <paolo.carlini@oracle.com>
879         PR c++/64644
880         * decl2.c (finish_anon_union): Complain about "anonymous union with
881         no members" with a pedwarn.
883 2017-09-15  Bernd Edlinger  <bernd.edlinger@hotmail.de>
885         * typeck.c (build_reinterpret_cast_1,
886         build_const_cast_1): Implement -Wcast-align=strict.
888 2017-09-15  Jakub Jelinek  <jakub@redhat.com>
890         * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
891         adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
892         to C++17 or -std=gnu++17 or -std=c++17.  Adjust comments.
893         (cxx_init_decl_processing, next_initializable_field,
894         is_direct_enum_init, check_initializer, cp_finish_decl,
895         mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
896         finish_function): Likewise.
897         * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
898         * pt.c (mark_template_parm, convert_nontype_argument,
899         instantiate_class_template_1, type_unification_real, unify,
900         get_partial_spec_bindings, dependent_type_p_r): Likewise.
901         * typeck.c (cp_build_unary_op): Likewise.
902         * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
903         * call.c (build_user_type_conversion_1, build_over_call,
904         build_special_member_call): Likewise.
905         * lambda.c (begin_lambda_type): Likewise.
906         * typeck2.c (process_init_constructor_record): Likewise.
907         * class.c (build_base_field, finalize_literal_type_property,
908         explain_non_literal_class): Likewise.
909         * parser.c (cp_parser_diagnose_invalid_type_name,
910         cp_parser_primary_expression, cp_parser_lambda_introducer,
911         cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
912         cp_convert_range_for, cp_parser_perform_range_for_lookup,
913         cp_parser_decomposition_declaration, cp_parser_linkage_specification,
914         cp_parser_static_assert, cp_parser_simple_type_specifier,
915         cp_parser_namespace_definition, cp_parser_using_declaration,
916         cp_parser_init_declarator, cp_parser_type_parameter_key,
917         cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
918         cp_parser_constructor_declarator_p): Likewise.
919         * mangle.c (struct globals): Rename need_cxx1z_warning to
920         need_cxx17_warning.
921         (write_exception_spec, start_mangling, mangle_decl): Likewise.
922         * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
923         it.
924         (check-c++17): New goal.  Use 17 instead of 1z.
925         (check-c++-all): Use 17 instead of 1z.
927 2017-09-14  Jakub Jelinek  <jakub@redhat.com>
929         PR c++/81314
930         * cp-gimplify.c (omp_var_to_track): Look through references.
931         (omp_cxx_notice_variable): Likewise.
933 2017-09-13  Nathan Sidwell  <nathan@acm.org>
935         Conv-op identifers not in identifier hash table
936         * lex.c (conv_type_hasher): Make member fns inline.
937         (make_conv_op_name): Directly clone conv_op_identifier.
939         Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
940         * cp-tree.h (struct lang_type): Rename methods to members.
941         (CLASSTYPE_METHOD_VEC): Rename to ...
942         (CLASSTYPE_MEMBER_VEC): ... this.
943         * name-lookup.h (get_method_slot): Rename to ...
944         (get_member_slot): ... this.
945         (resort_type_method_vec): Rename to ...
946         (resort_type_member_vec): ... this.
947         * class.c (add_method, warn_hidden): Adjust.
948         * search.c (dfs_locate_field_accessor_pre): Adjust.
949         * name-lookup.c (method_vec_binary_search): Rename to ...
950         (member_vec_binary_search): ... this and adjust.
951         (method_vec_linear_search): Rename to ...
952         (member_vec_linear_search): ... this and adjust.
953         (fields_linear_search, get_class_binding_direct): Adjust.
954         (get_method_slot): Rename to ...
955         (get_member_slot): ... this and adjust.
956         (method_name_slot): Rename to ...
957         (member_name_slot): ... this and adjust.
958         (resort_type_method_vec): Rename to ...
959         (resort_type_member_vec): ... this and adjust.
960         (method_vec_append_class_fields): Rename to ...
961         (member_vec_append_class_fields): ... this and adjust.
962         (method_vec_append_enum_values): Rename to ...
963         (member_vec_append_enum_values): ... this and adjust.
964         (method_vec_dedup): Rename to ...
965         (member_vec_dedup): ... this and adjust.
966         (set_class_bindings, insert_late_enum_def_bindings): Adjust.
967         
968 2017-09-12  Paolo Carlini  <paolo.carlini@oracle.com>
970         PR c++/70621
971         * decl.c (start_decl): Early return error_mark_node if duplicate_decls
972         returns it; avoid misleading error message.
974 2017-09-12  Nathan Sidwell  <nathan@acm.org>
976         Kill CLASSTYPE_SORTED_FIELDS.
977         * cp-tree.h (struct lang_type): Lose sorted_fields member.
978         (CLASSTYPE_SORTED_FIELDS): Delete.
979         * name-lookup.h (set_class_bindings): Add EXTRA arg.
980         * name-lookup.c (fields_linear_search): New, broken out of ...
981         (lookup_field_1): ... here.  Delete remainder of function.
982         (get_class_binding_direct): Reimplement without sorted_fields.
983         (get_class_binding): Rename TYPE arg to KLASS, for consistency.
984         (get_method_slot): Call set_class_binding when creating method_vec
985         on complete type.
986         (method_name_cmp): Order identically named slots.
987         (sorted_fields_type_new): Delete.
988         (field_vc_append_class_fields): Rename to ...
989         (method_vec_append_class_fields): ... here.  Adjust.
990         (field_vec_append_enum_values): Renme to ...
991         (method_vec_append_enum_values): ... here. Adjust.
992         (method_vec_dedup): New.
993         (set_class_bindings): Reimplement.
994         (insert_late_enum_def_bindings): Reimplement.
996         * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
997         consistency.
998         (restort_data): Move later.
999         (method_name_cmp, resort_method_name_cmp): Simplify.
1000         (resort_type_method_vec): Reformat.
1002 2017-09-09  Jason Merrill  <jason@redhat.com>
1004         * constexpr.c (reduced_constant_expression_p): If
1005         CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
1007 2017-09-09  Eric Botcazou  <ebotcazou@adacore.com>
1009         PR bootstrap/81926
1010         * cp-objcp-common.c (struct debug_type_hasher): New class.
1011         (debug_type_hash): New variable.
1012         (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
1014 2017-09-08  Jason Merrill  <jason@redhat.com>
1016         PR c++/70029 - ICE with ref-qualifier and -flto
1017         * tree.c (cxx_copy_lang_qualifiers): New.
1018         * cp-tree.h: Declare it.
1019         * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
1021 2017-09-06  Jason Merrill  <jason@redhat.com>
1023         PR c++/82053 - ICE with default argument in lambda in template
1024         * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
1025         in templates.
1026         (retrieve_specialization): Use lambda_fn_in_template_p.
1027         * cp-tree.h: Declare it.
1029         PR c++/82070 - error with nested lambda capture
1030         * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
1031         register_local_specialization.
1033 2017-09-06  Nathan Sidwell  <nathan@acm.org>
1035         * name-lookup.h (lookup_field_1): Delete.
1036         (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
1037         * name-lookup.c (lookup_field_1): make static
1038         (method_vec_binary_search, method_vec_linear_search): New.  Broken
1039         out of ...
1040         (get_class_binding_direct): ... here.  Add TYPE_OR_FNS argument.
1041         Do complete search of this level.
1042         (get_class_binding): Adjust.
1043         * decl.c (reshape_init_class): Call get_class_binding.
1044         * search.c (lookup_field_r): Move field searching into
1045         get_class_binding_direct.
1047         * class.c (warn_hidden): Don't barf on non-functions.
1048         * decl2.c (check_classfn): Likewise.  Check template match earlier.
1050         * name-lookup.c (count_fields): Rename to ...
1051         (count_class_fields): ... here.  Take a class, don't count
1052         NULL-named fields.
1053         (add_fields_to_record_type): Rename to ...
1054         (field_vec_append_class_fields): ... here.  Take a class, don't
1055         add NULL-named fields.
1056         (add_enum_fields_to_record_type): Rename to ...
1057         (field_vec_append_enum_values): ... here.
1058         (set_class_bindings): Adjust, assert we added expected number.
1059         (insert_late_enum_def_bindings): Reimplement.  Create vector if
1060         there are now sufficient entries.
1062         * name-lookup.h (lookup_fnfields_slot_nolazy,
1063         lookup_fnfields_slot): Rename to ...
1064         (get_class_binding_direct, get_class_binding): ... here.
1065         * name-lookup.c (lookup_fnfields_slot_nolazy,
1066         lookup_fnfields_slot): Rename to ...
1067         (get_class_binding_direct, get_class_binding): ... here.
1068         * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
1069         * call.c (build_user_type_conversion_1): Adjust.
1070         (has_trivial_copy_assign_p): Adjust.
1071         (has_trivial_copy_p): Adjust.
1072         * class.c (get_basefndecls) Adjust.
1073         (vbase_has_user_provided_move_assign) Adjust.
1074         (classtype_has_move_assign_or_move_ctor_p): Adjust.
1075         (type_build_ctor_call, type_build_dtor_call): Adjust.
1076         * decl.c (register_dtor_fn): Adjust.
1077         * decl2.c (check_classfn): Adjust.
1078         * pt.c (retrieve_specialization): Adjust.
1079         (check_explicit_specialization): Adjust.
1080         (do_class_deduction): Adjust.
1081         * search.c (lookup_field_r): Adjust.
1082         (look_for_overrides_here, lookup_conversions_r): Adjust.
1083         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
1084         * tree.c (type_has_nontrivial_copy_init): Adjust.
1085         * method.c (lazily_declare_fn): Adjust comment.
1087 2017-09-05  Nathan Sidwell  <nathan@acm.org>
1089         * name-lookup.c (do_class_using_decl): Elide read-once temps.
1090         Move declarations to initializations.
1092         * class.c (add_method): Move slot search and insertion to ...
1093         * name-lookup.c (get_method_slot): ... this new function.
1094         (lookup_fnfields_slot_nolazy): Cope with NULL slot.
1095         * name-lookup.h (get_method_slot): Declare.
1096         * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
1097         realistic type.
1098         (grok_special_member_properties): Set
1099         TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
1100         Improve TYPE_HAS_CONSTEXPR_CTOR setting.        
1102         * cp-tree.h (lang_decl_base): Rename template_conv_p to
1103         unknown_bound_p.
1104         (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
1105         (DECL_CONV_FN_TYPE): FN must be conv op.
1106         (DECL_TEMPLATE_CONV_FN_P): Delete.
1107         (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
1108         * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
1109         setting.
1111         * class.c (unreverse_member_declarations): Remove extraneous if.
1112         * pt.c (push_template_decl_real): Use string concatenation, not
1113         \<newline>.  Add %<..%>.
1115 2017-09-05  Paolo Carlini  <paolo.carlini@oracle.com>
1117         PR c++/81942
1118         * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
1119         * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
1120         creating cdtor_label.
1121         * constexpr.c (returns): Add the case of a constructor/destructor
1122         returning via a LABEL_DECL_CDTOR label.
1123         (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
1125 2017-09-01  Nathan Sidwell  <nathan@acm.org>
1127         * cp-tree.h (resort_type_method_vec): Move declaration to ...
1128         * name-lookup.h (resort_type_method_vec): ... here.
1129         (set_class_bindings): Lose 2nd arg.
1130         * class.c (finish_struct_1, finish_struct): Adjust
1131         set_class_bindings call.  Don't call finish_struct_methods.
1132         (resort_data, method_name_cmp, resort_method_name_cmp,
1133         resort_type_method_vec, finish_struct_methods): Move to ...
1134         * name-lookup.c (resort_data, method_name_cmp,
1135         resort_method_name_cmp, resort_type_method_vec): ... here.
1136         (set_class_bindings): Lose fields arg.  Swallow finish_struct_methods.
1138         * class.c (finish_struct): Call set_class_bindings for the
1139         template case too.
1141         * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
1142         Don't call maybe_warn_about_overly_private_class here.
1143         (warn_hidden): Cleanup declarations and comments.
1144         (type_has_user_provided_constructor): No need to check
1145         CLASSTYPE_METHOD_VEC.
1146         (type_has_user_provided_or_explicit_constructor): Likewise.
1147         (classtype_has_move_assign_or_move_ctor_p): Likewise.
1148         (check_bases_and_members): Don't call finish_struct_methods here.
1149         (finish_struct_1): Call finish_struct_methods and
1150         set_class_bindings immediately after layout.  Clear DECL_IN_AGGR_P
1151         here.
1152         (finish_struct): For templates process USING_DECLS and clear
1153         DECL_IN_AGGR_P before calling finish_struct_methods. Call
1154         maybe_warn_about_overly_private_class here.
1156         Revert 2017-08-28  Nathan Sidwell  <nathan@acm.org>
1157         Restore sorted_fields vector.
1158         * cp-tree.h (lang_type): Restore sorted_fields vector.
1159         (CLASSTYPE_SORTED_FIELDS): Restore.
1160         (CLASSTYPE_BINDINGS): Delete.
1161         * name-lookup.c (lookup_field_1): Restore binary search.
1162         (sorted_fields_type_new, count_fields,
1163         add_fields_to_record_type, add_enum_fields_to_record_type): Restore
1164         (set_class_bindings): Revert.
1165         (insert_late_enum_def_binding): Restore field_vec insertion.
1167 2017-09-01  Jakub Jelinek  <jakub@redhat.com>
1169         PR c/81887
1170         * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
1172 2017-09-01  Marek Polacek  <polacek@redhat.com>
1174         PR c++/82040
1175         * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
1177 2017-08-30  Jason Merrill  <jason@redhat.com>
1179         PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
1180         * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
1181         (regenerated_lambda_fn_p): New.
1182         (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
1183         (tsubst_copy) [VAR_DECL]: Likewise.
1185         PR c++/82030 - ICE inheriting from multiple lambdas
1186         PR c++/80767
1187         * call.c (compare_ics): Handle null candidate.
1189 2017-08-30  Ville Voutilainen  <ville.voutilainen@gmail.com>
1191         Make taking the address of an overloaded function a non-deduced context
1193         * pt.c (unify_overload_resolution_failure): Remove.
1194         (unify_one_argument): Adjust.
1196 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1197             Alan Hayward  <alan.hayward@arm.com>
1198             David Sherwood  <david.sherwood@arm.com>
1200         * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
1202 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1203             Alan Hayward  <alan.hayward@arm.com>
1204             David Sherwood  <david.sherwood@arm.com>
1206         * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
1208 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1209             Alan Hayward  <alan.hayward@arm.com>
1210             David Sherwood  <david.sherwood@arm.com>
1212         * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
1213         instead of TYPE_MODE.
1215 2017-08-29  Jason Merrill  <jason@redhat.com>
1217         PR c++/81236 - ICE with template-id in generic lambda
1218         * semantics.c (finish_id_expression): Remove special dependent case.
1219         Avoid some later pieces when dependent.
1220         (finish_qualified_id_expr): Do normal BASELINK handling in a
1221         template.  Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
1222         (parsing_default_capturing_generic_lambda_in_template): Remove.
1223         * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
1224         error for types that will never be complete.
1225         * mangle.c (write_expression): Add sanity check.
1226         * tree.c (build_qualified_name): Add sanity check.
1227         (cp_walk_subtrees): Walk into the class context of a BASELINK.
1228         * lambda.c (add_capture): Improve diagnostic for generic lambda
1229         capture failure.
1230         * call.c (build_new_method_call_1): Print the right constructor
1231         name.
1233         Reimplement handling of lambdas in templates.
1234         * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
1235         * decl.c (start_preparsed_function): Call start_lambda_scope.
1236         (finish_function): Call finish_lambda_scope.
1237         * init.c (get_nsdmi): Call start/finish_lambda_scope.
1238         * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
1239         * parser.c (cp_parser_function_definition_after_declarator): Don't
1240         call start/finish_lambda_scope.
1241         * pt.c (retrieve_specialization): Ignore lambda functions in
1242         templates.
1243         (find_parameter_packs_r): Ignore capture proxies.  Look into
1244         lambdas.
1245         (check_for_bare_parameter_packs): Allow bare packs in lambdas.
1246         (tsubst_default_argument): Call start/finish_lambda_scope.
1247         (tsubst_function_decl): Handle lambda functions differently.
1248         (tsubst_template_decl): Likewise.
1249         (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
1250         proxies.
1251         (tsubst_lambda_expr): Create a new closure rather than instantiate
1252         the one from the template.
1253         (tsubst_copy_and_build): Don't register a specialization of a pack.
1254         (regenerate_decl_from_template): Call start/finish_lambda_scope.
1255         (instantiate_decl): Remove special lambda function handling.
1256         * semantics.c (process_outer_var_ref): Remove special generic lambda
1257         handling.  Don't implicitly capture in a lambda in a template.  Look
1258         for an existing proxy.
1259         * class.c (current_nonlambda_class_type): Use decl_type_context.
1261         * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
1262         (LAMBDA_EXPR_RETURN_TYPE): Remove.
1263         (struct tree_lambda_expr): Remove closure and return_type fields.
1264         * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
1265         * pt.c (tsubst_copy_and_build): Likewise.
1266         * parser.c (cp_parser_lambda_declarator_opt): Track return type.
1267         (cp_parser_lambda_body): Adjust unspecified return type check.
1268         * ptree.c (cxx_print_lambda_node): Don't print closure or
1269         return type.
1271         PR c++/80935 - wrong C++17 error with lambda
1272         * decl.c (check_for_uninitialized_const_var): Check
1273         is_instantiation_of_constexpr.
1274         * constexpr.c (ensure_literal_type_for_constexpr_object): Check
1275         is_instantiation_of_constexpr.
1276         (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
1278         * lambda.c (build_lambda_object): Check for error_mark_node.
1279         * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
1280         pack as well.
1281         (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
1282         (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
1284         PR c++/80767 - unnecessary instantiation of generic lambda
1285         * call.c (convert_like_real): Call build_user_type_conversion_1 if
1286         cand is null.
1287         (add_conv_candidate): Build a ck_user conversion with no candidate.
1289         Fix lambdas in template default argument of inherited ctor.
1290         * method.c (synthesized_method_base_walk): Replace an inherited
1291         template with its specialization.
1292         (synthesized_method_walk): Make inheriting_ctor a pointer.
1293         (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
1294         (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
1296         * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
1297         template, not the function.
1298         (template_guide_p): Adjust.
1300         Support copying local_specializations.
1301         * cp-tree.h (enum lss_policy): New.
1302         (local_specialization_stack): Add policy parameter to default ctor.
1303         * pt.c (local_specialization_stack): Copy local_specializations if
1304         lss_copy.
1306         * constexpr.c (potential_constant_expression_1): Add "now" parm.
1307         (is_constant_expression, require_constant_expression): New.
1308         (is_static_init_expression, is_nondependent_constant_expression)
1309         (is_nondependent_static_init_expression): Drop "potential".
1310         * except.c (build_must_not_throw_expr): Do type conversion on
1311         value-dependent argument.
1312         * pt.c, semantics.c, typeck2.c: Use variants without "potential".
1314         Instantiate default arguments/member initializers once.
1315         * init.c (get_nsdmi): Remember NSDMI instantiations.
1316         * parser.c (inject_this_parameter): Be more picky about
1317         current_class_ptr.
1318         * pt.c (tsubst_copy): Simplify 'this' handling.
1319         (tsubst_default_argument): Remember default argument
1320         instantiations.  Take parameter number.
1321         (tsubst_default_arguments): Pass it.
1322         * call.c (convert_default_arg): Likewise.
1324         Fix default argument conversion failure and SFINAE.
1325         * call.c (build_over_call): Check convert_default_arg result for
1326         error_mark_node.
1327         * parser.c (cp_parser_late_parsing_default_args): Remember
1328         error_mark_node.
1330 2017-08-28  Nathan Sidwell  <nathan@acm.org>
1332         * cp-tree.h (lang_type): Replace sorted_fields vector with
1333         bindings map.
1334         (CLASSTYPE_SORTED_FIELDS): Delete.
1335         (CLASSTYPE_BINDINGS): New.
1336         * decl.c (finish_enum_value_list): Swap args of
1337         insert_late_enum_def_bindings.
1338         * name-lookup.c (lookup_field_1): Replace binary search of sorted
1339         fields with map->get.
1340         (sorted_fields_type_new, count_fields,
1341         add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
1342         (add_class_member, add_class_members): New.
1343         (set_class_bindings): Create map and insert.
1344         (insert_late_enum_def_binding): Swap parms.  Use add_clasS_member.
1345         * ptree.c (cxx_print_type): Delete sorted fields printing.
1347         * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
1348         Delete.
1349         * name-lookup.h (set_class_bindings,
1350         insert_late_enum_def_bindings): Declare.
1351         * decl.c (finish_enum_value_list): Adjust for
1352         insert_late_enum_def_bindings name change.
1353         * class.c (finish_struct_1): Call set_class_bindings.
1354         (count_fields, add_fields_to_record_type,
1355         add_enum_fields_to_record_type, sorted_fields_type_new,
1356         insert_into_classtype_sorted_fields,
1357         insert_late_enum_def_into_classtype_sorted_fields): Move to ...
1358         * name-lookup.h (count_fields, add_fields_to_record_type,
1359         add_enum_fields_to_record_type, sorted_fields_type_new,
1360         set_class_bindings, insert_late_enum_def_bindings): ... here.
1362 2017-08-25  Nathan Sidwell  <nathan@acm.org>
1364         * class.c (method_name_cmp, resort_method_name_cmp): Methods
1365         can never be NULL.
1367         Conversion operators have a special name
1368         * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
1369         (conv_op_marker, conv_op_identifier): New.
1370         (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
1371         * decl.c (initialize_predefined_identifiers): Add
1372         conv_op_identifier.
1373         (cxx_init_decl_processing): Create conv_op_marker.
1374         * decl2.c (check_classfn): Lookup conv-ops by name.
1375         * class.c (add_method): Use conv_op_identifier & conv_op_marker.
1376         (resort_type_method_vec): Don't skip conv-ops.
1377         (finish_struct_methods, warn_hidden): Likewise.
1378         * name-lookup.h (lookup_all_conversions): Delete.
1379         * name-lookup.c (lookup_conversion_operator): Replace with ...
1380         (extract_conversion_operator): ... this.
1381         (lookup_fnfields_slot_nolazy): Find conv-ops by name.
1382         (lookup_all_conversions): Delete.
1383         * pt.c (check_explicit_specialization): Find conv-ops by name.
1384         * search.c (lookup_conversions_r): Likewise.
1386 2017-08-24  Nathan Sidwell  <nathan@acm.org>
1388         Conversion operators kept on single overload set
1389         * class.c (add_method): Keep all conv-ops on one slot.
1390         * name-lookup.c (lookup_conversion_operator): Pull the desired
1391         conv op out of overload set.
1392         * search.c (lookup_conversions_r): Lose template/non-template
1393         distinction.
1394         (lookup_conversions): Likewise.
1396 2017-08-23  Nathan Sidwell  <nathan@acm.org>
1398         * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
1399         lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
1400         declatations to ...
1401         * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
1402         lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
1403         * search.c (lookup_conversion_operator,
1404         lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1405         lookup_all_conversions): Move to ...
1406         * name-lookup.c (lookup_conversion_operator,
1407         lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1408         lookup_all_conversions): ... here.
1410         * semantics.c (finish_member_declaration): Move USING_DECL check
1411         earlier.  Always set C++ linkage.  Commonize TYPE_FIELD and
1412         template decl list insertion.
1414         * cp-tree.h (maybe_version_functions): Declare.
1415         * decl.c (decls_match): Break function versioning check to
1416         separate function.  Call it.
1417         (maybe_version_functions): Broken out of decls_match.
1418         * class.c (add_method): Use maybe_version_functions.
1420         * cp-tree.h (print_search_statistics,
1421         reinit_search_statistics): Don't declare.
1422         * search.c (n_fields_searched, n_calls_lookup_field,
1423         n_calls_lookup_field_1, n_calls_lookup_fnfields,
1424         n_calls_lookup_fnfields_1, n_calls_get_base_type,
1425         n_outer_fields_searched, n_contexts_saved): Delete.
1426         (lookup_field_1, lookup_member,
1427         lookup_fnfields_slot_nolazy): Remove stat gathering.
1428         (print_search_statistics, reinit_search_statistics): Delete.
1429         * tree.c (cxx_print_statistics): Don't print search stats.
1431 2017-08-21  Nathan Sidwell  <nathan@acm.org>
1433         * search.c (lookup_field_r): Remove obsolete code for type-named
1434         field in PoD.
1436         * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
1437         isn't special.
1438         (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
1439         (lookup_field_fuzzy_r): Adjust.
1441 2017-08-21  David Malcolm  <dmalcolm@redhat.com>
1443         * call.c (build_over_call): Pass NULL for new parameter to
1444         check_function_arguments.
1445         * typeck.c (cp_build_function_call_vec): Likewise.
1447 2017-08-21  Nathan Sidwell  <nathan@acm.org>
1449         PR c++/81899
1450         * pt.c (instantiate_class_template_1):
1451         BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
1453 2017-08-18  David Malcolm  <dmalcolm@redhat.com>
1455         PR c++/81514
1456         * name-lookup.c (maybe_suggest_missing_header): Convert return
1457         type from void to bool; return true iff a suggestion was offered.
1458         (suggest_alternative_in_explicit_scope): Move call to
1459         maybe_suggest_missing_header to before use of best_match, and
1460         return true if the former offers a suggestion.
1462 2017-08-18  H.J. Lu  <hongjiu.lu@intel.com>
1464         PR c/53037
1465         * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
1466         * decl2.c (grokbitfield): Don't allow bit-field with
1467         warn_if_not_aligned type.
1469 2017-08-17  Nathan Sidwell  <nathan@acm.org>
1471         * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
1472         * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
1473         (TYPE_TEMPLATE_INFO): Simplify.
1474         (SET_TYPE_TEMPLATE_INFO): Simplify.
1476         * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
1477         don't need lang_type.
1478         (cxx_make_type): Use maybe_add_lang_type_raw return value.
1479         * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
1480         TYPE_LANG_SPECIFIC.
1482         * cp-tree.h (struct lang_type): Remove template_info field.
1483         (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
1484         (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
1486 2017-08-14  Martin Sebor  <msebor@redhat.com>
1488         PR c/81117
1489         * error.c (cp_printer): Handle 'G'.
1491 2017-08-11  Martin Liska  <mliska@suse.cz>
1493         * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
1494         TARGET_SUPPORTS_ALIASES.
1495         (handle_tls_init): Likewise.
1496         (note_mangling_alias): Likewise.  Remove ATTRIBUTE_UNUSED for
1497         both arguments.
1498         * optimize.c (can_alias_cdtor): Likewise.
1500 2017-08-11  Jason Merrill  <jason@redhat.com>
1502         PR c++/81671 - nullptr_t template parameter
1503         * pt.c (convert_nontype_argument): Fix nullptr_t check.
1505 2017-08-10  Jason Merrill  <jason@redhat.com>
1507         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1508         * method.c (synthesized_method_walk): Don't diagnose lack of
1509         operator delete.
1511         PR c++/80452 - Core 1579, implicit move semantics on return/throw
1512         * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
1513         tentatively changed the lvalue to an rvalue.
1514         * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
1515         (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
1516         parameter is an rvalue reference.
1517         * except.c (build_throw): Do maybe-rvalue overload resolution twice.
1518         * typeck.c (check_return_expr): Likewise.
1520 2017-08-10  David Malcolm  <dmalcolm@redhat.com>
1522         * parser.c (cp_parser_error): Update for new param to
1523         c_parse_error.
1524         (class token_pair): New class.
1525         (struct matching_paren_traits): New struct.
1526         (matching_parens): New typedef.
1527         (struct matching_brace_traits): New struct.
1528         (matching_braces): New typedef.
1529         (cp_parser_statement_expr): Convert explicit parsing of
1530         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
1531         class matching_parens, so that the pertinent open parenthesis is
1532         highlighted when there are problems locating the close
1533         parenthesis.
1534         (cp_parser_primary_expression): Likewise.
1535         (cp_parser_compound_literal_p): Remove consumption of opening
1536         paren.
1537         (cp_parser_postfix_expression): Convert explicit parsing of
1538         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
1539         above.  Use it to consume the opening paren previously consumed by
1540         cp_parser_compound_literal_p.
1541         (cp_parser_parenthesized_expression_list): Likewise.
1542         (cp_parser_unary_expression): Likewise.
1543         (cp_parser_new_expression): Likewise.
1544         (cp_parser_cast_expression): Likewise.
1545         (cp_parser_builtin_offsetof): Likewise.
1546         (cp_parser_trait_expr): Likewise.
1547         (cp_parser_lambda_declarator_opt): Likewise.
1548         (cp_parser_lambda_body): Likewise, for matching_braces.
1549         (cp_parser_compound_statement): Likewise.
1550         (cp_parser_selection_statement): Likewise, for matching_parens.
1551         (cp_parser_iteration_statement): Likewise.
1552         (cp_parser_already_scoped_statement): Likewise, for
1553         matching_braces.
1554         (cp_parser_linkage_specification): Likewise.
1555         (cp_parser_static_assert): Likewise, for matching_parens.
1556         (cp_parser_decltype): Likewise.
1557         (cp_parser_operator): Likewise.
1558         (cp_parser_enum_specifier): Likewise.
1559         (cp_parser_namespace_definition): Likewise.
1560         (cp_parser_direct_declarator): Likewise.
1561         (cp_parser_braced_list): Likewise.
1562         (cp_parser_class_specifier_1): Likewise, for matching_braces.
1563         (cp_parser_constant_initializer): Likewise.
1564         (cp_parser_noexcept_specification_opt): Likewise, for
1565         matching_parens.
1566         (cp_parser_exception_specification_opt): Likewise.
1567         (cp_parser_handler): Likewise.
1568         (cp_parser_asm_specification_opt): Likewise.
1569         (cp_parser_asm_operand_list): Likewise.
1570         (cp_parser_gnu_attributes_opt): Likewise.
1571         (cp_parser_std_attribute_spec): Likewise.
1572         (cp_parser_requirement_parameter_list): Likewise.
1573         (cp_parser_requirement_body): Likewise, for matching_braces.
1574         (cp_parser_compound_requirement): Likewise.
1575         (cp_parser_template_introduction): Likewise.
1576         (cp_parser_sizeof_pack): Likewise, for matching_parens.
1577         (cp_parser_sizeof_operand): Likewise; use it to consume the
1578         opening paren previously consumed by cp_parser_compound_literal_p.
1579         (get_matching_symbol): New function.
1580         (cp_parser_required_error): Add param "matching_location".  Remove
1581         calls to cp_parser_error, instead setting a non-NULL gmsgid, and
1582         handling it if set by calling c_parse_error, potentially with a
1583         secondary location if matching_location was set.
1584         (cp_parser_require): Add param "matching_location", with a default
1585         value of UNKNOWN_LOCATION.
1586         (cp_parser_require_keyword): Update for new param of
1587         cp_parser_required_error.
1588         (cp_parser_objc_encode_expression): Update to class matching_parens
1589         as above.
1590         (cp_parser_objc_defs_expression): Likewise.
1591         (cp_parser_objc_protocol_expression): Likewise.
1592         (cp_parser_objc_selector_expression): Likewise.
1593         (cp_parser_objc_typename): Likewise.
1594         (cp_parser_objc_superclass_or_category): Likewise.
1595         (cp_parser_objc_try_catch_finally_statement): Likewise.
1596         (cp_parser_objc_synchronized_statement): Likewise.
1597         (cp_parser_objc_at_property_declaration): Likewise.
1598         (cp_parser_oacc_single_int_clause): Likewise.
1599         (cp_parser_oacc_shape_clause): Likewise.
1600         (cp_parser_omp_clause_collapse): Likewise.
1601         (cp_parser_omp_clause_default): Likewise.
1602         (cp_parser_omp_clause_final): Likewise.
1603         (cp_parser_omp_clause_if): Likewise.
1604         (cp_parser_omp_clause_num_threads): Likewise.
1605         (cp_parser_omp_clause_num_tasks): Likewise.
1606         (cp_parser_omp_clause_grainsize): Likewise.
1607         (cp_parser_omp_clause_priority): Likewise.
1608         (cp_parser_omp_clause_hint): Likewise.
1609         (cp_parser_omp_clause_defaultmap): Likewise.
1610         (cp_parser_omp_clause_ordered): Likewise.
1611         (cp_parser_omp_clause_schedule): Likewise.
1612         (cp_parser_omp_clause_num_teams): Likewise.
1613         (cp_parser_omp_clause_thread_limit): Likewise.
1614         (cp_parser_omp_clause_aligned): Likewise.
1615         (cp_parser_omp_clause_linear): Likewise.
1616         (cp_parser_omp_clause_safelen): Likewise.
1617         (cp_parser_omp_clause_simdlen): Likewise.
1618         (cp_parser_omp_clause_depend): Likewise.
1619         (cp_parser_omp_clause_device): Likewise.
1620         (cp_parser_omp_clause_dist_schedule): Likewise.
1621         (cp_parser_oacc_clause_async): Likewise.
1622         (cp_parser_omp_critical): Likewise.
1623         (cp_parser_omp_for_loop): Likewise.
1624         (cp_parser_omp_sections_scope): Likewise.
1625         (cp_parser_omp_declare_reduction_exprs): Likewise.
1626         Update for new param to cp_parser_required_error.
1627         (cp_parser_oacc_routine): Likewise.
1628         (cp_parser_transaction_expression): Likewise.
1629         (cp_parser_cilk_simd_vectorlength): Likewise.
1631 2017-08-09  Jason Merrill  <jason@redhat.com>
1633         PR c++/81525 - wrong constant value with generic lambda
1634         * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
1635         (tsubst_copy) [VAR_DECL]: Handle auto.
1637         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1638         * init.c (get_nsdmi): Add complain parm.
1639         * typeck2.c (digest_nsdmi_init): Add complain parm.
1640         (process_init_constructor_record): Pass complain to get_nsdmi.
1641         * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
1642         * method.c (get_defaulted_eh_spec): Add complain parm.  Pass it into
1643         synthesized_method_walk.
1644         (synthesized_method_walk): Adjust.
1645         (walk_field_subobs): Pass complain to get_nsdmi.
1646         (defaulted_late_check): Skip other checks if deleted.
1647         * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
1648         * call.c (build_aggr_conv): Pass complain to get_nsdmi.
1649         * parser.c (defarg_location): New.
1650         * error.c (location_of): Use it.
1652 2017-08-09  Marek Polacek  <polacek@redhat.com>
1654         * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
1655         * typeck.c (build_binary_op): Change the type of a parameter to bool.
1656         (cp_truthvalue_conversion): Use true instead of 1.
1658 2017-08-08  Marek Polacek  <polacek@redhat.com>
1660         PR c++/81607
1661         * cp-gimplify.c (cp_fold): If folding exposed a branch of
1662         a COND_EXPR, convert it to the original type of the COND_EXPR, if
1663         they differ.               
1665 2017-08-08  Martin Liska  <mliska@suse.cz>
1667         * call.c: Include header files.
1668         * cp-gimplify.c: Likewise.
1669         * cp-ubsan.c: Likewise.
1670         * cvt.c: Likewise.
1671         * init.c: Likewise.
1672         * search.c: Likewise.
1673         * semantics.c: Likewise.
1674         * typeck.c: Likewise.
1676 2017-08-07  Martin Liska  <mliska@suse.cz>
1678         * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
1679         attribute.
1680         (cp_parser_std_attribute): Likewise.
1681         * tree.c: Add new include.
1683 2017-08-04  Paolo Carlini  <paolo.carlini@oracle.com>
1685         PR c++/79790
1686         * pt.c (do_class_deduction): Handle the case of no viable implicit
1687         deduction guides; simplify the code generating implicit deduction
1688         guides.
1690 2017-08-03  Paolo Carlini  <paolo.carlini@oracle.com>
1692         PR c++/71440
1693         * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
1694         destructor as expressions.
1696 2017-08-02  Jakub Jelinek  <jakub@redhat.com>
1698         PR c++/81640
1699         * call.c (build_user_type_conversion_1): Only call
1700         lookup_fnfields_slot if totype is CLASS_TYPE_P.
1702 2017-07-31  Jason Merrill  <jason@redhat.com>
1704         * decl.c (declare_global_var): Set DECL_CONTEXT.
1706 2017-07-31  Jan Hubicka <hubicka@ucw.cz>
1707             Martin Liska  <mliska@suse.cz>
1709         * pt.c (tsubst_copy): Copy PREDICT_EXPR.
1710         * semantics.c (finish_goto_stmt): Build gimple predict
1711         stament.
1712         * constexpr.c (potential_constant_expression_1): Handle
1713         PREDICT_EXPR.
1715 2017-07-31  Martin Liska  <mliska@suse.cz>
1717         PR sanitize/81530
1718         * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
1719         also with current_function_decl non-null equality.
1720         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1721         * decl.c (compute_array_index_type): Likewise.
1722         * init.c (finish_length_check): Likewise.
1723         * typeck.c (cp_build_binary_op): Likewise.
1725 2017-07-29  Jakub Jelinek  <jakub@redhat.com>
1727         * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
1728         DW_AT_export_symbols.
1729         * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
1730         argument, pass it through to the debug hook.
1731         (finish_namespace_using_directive): Adjust
1732         emit_debug_info_using_namespace caller.
1733         (push_namespace): Likewise.  Call it after setting
1734         DECL_NAMESPACE_INLINE_P.
1735         (cp_emit_debug_info_for_using): Pass false as new argument to
1736         the imported_module_or_decl debug hook.
1738 2017-07-28  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
1740         * lex.c (copy_decl): Adjust.
1741         (copy_type): Likewise.
1743 2017-07-26  Paolo Carlini  <paolo.carlini@oracle.com>
1745         PR c++/71570
1746         * lambda.c (add_capture): Early return if we cannot capture by
1747         reference.
1749 2017-07-26  Jason Merrill  <jason@redhat.com>
1751         P0702R1 - List deduction of vector.
1752         * pt.c (do_class_deduction): Special-case deduction from a single
1753         element of related type.
1755 2017-07-26  Leonid Koppel  <lkoppel@uwaterloo.ca>
1757         PR c++/67054 - Inherited ctor with non-default-constructible members
1758         * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
1759         when deducing an inheriting constructor.
1761 2017-07-21  Nathan Sidwell  <nathan@acm.org>
1763         * search.c (lookup_conversion_operator): Return overloads.
1764         (lookup_fnfields_idx_nolazy): Absorb into ...
1765         (lookup_fnfields_slot_nolaxy): ... here.
1766         (lookup_fnfields_1): Absorb into ...
1767         (lookup_fnfields_slot): ... here.
1769         Remove special CDtor METHOD_VEC slots.
1770         * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
1771         CLASSTYPE_DESTRUCTOR_SLOT): Delete.
1772         (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
1773         (CLASSTYPE_DESTRUCTOR): Likewise.
1774         * class (add_method): Don't use special cdtor slots.
1775         * search.c (lookup_fnfields_idx_nolazy): Likewise.
1776         (look_for_overrides_here): Use lookup_fnfields_slot.
1777         * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
1779         * call.c (add_candidates): Move decls to initialization.  Don't
1780         use !!.
1782 2017-07-20  Nathan Sidwell  <nathan@acm.org>
1784         Remove TYPE_METHODS.
1785         * class.c (maybe_warn_about_overly_private_class,
1786         finish_struct_methods, one_inheriting_sig, count_fields,
1787         add_fields_to_record_type, check_field_decls, check_methods,
1788         clone_function_decl, set_method_tm_attributes,
1789         finalize_literal_type_property, check_bases_and_members,
1790         create_vtable_ptr, determine_key_method,
1791         unreverse_member_declarations, finish_struct,
1792         add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
1793         * decl.c (fixup_anonymous_aggr): Likewise.
1794         * decl2.c (reset_type_linkage_2): Likewise.
1795         * method.c (after_nsdmi_defaulted_late_checks,
1796         lazily_declare_fn): Likewise.
1797         * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
1798         * pt.c (instantiate_class_template_1, tsubst_expr,
1799         do_type_instantiation, instantiate_pending_templates): Likewise.
1800         * search.c (lookup_field_1): Likewise.
1801         * semantics.c (finish_member_declaration,
1802         finish_omp_declare_simd_methods): Likewise.
1804 2017-07-19  Nathan Sidwell  <nathan@acm.org>
1806         * class.c (add_implicitly_declared_members): Use
1807         classtype_has_move_assign_or_move_ctor_p.
1808         (classtype_has_move_assign_or_move_ctor,
1809         classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
1810         (classtype_has_move_assign_or_move_ctor_p): ... this new function.
1811         * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
1812         Replace with ...
1813         (classtype_has_move_assign_or_move_ctor_p): ... this.
1814         * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
1815         * tree.c (type_has_nontrivial_copy_init): Adjust.
1817         * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
1818         PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
1820 2017-07-18  Nathan Sidwell  <nathan@acm.org>
1822         * cp-array-notation.c (build_array_notation_ref): Use
1823         TYPE_{MIN,MAX}_VALUE.
1825         * class.c (classtype_has_move_assign_or_move_ctor): Declare.
1826         (add_implicitly_declared_members): Use it.
1827         (type_has_move_constructor, type_has_move_assign): Merge into ...
1828         (classtype_has_move_assign_or_move_ctor): ... this new function.
1829         * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
1831 2017-07-17  Volker Reichelt  <v.reichelt@netcologne.de>
1833         * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
1834         friend outside class and obsolete auto as storage-class-specifier.
1836 2017-07-17  Nathan Sidwell  <nathan@acm.org>
1838         * class.c (maybe_warn_about_overly_private_class): Ignore public
1839         copy ctors.
1841         * class.c (type_has_user_declared_move_constructor,
1842         type_has_user_declared_move_assign): Combine into ...
1843         (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
1844         * cp-tree.h (type_has_user_declared_move_constructor,
1845         type_has_user_declared_move_assign): Combine into ...
1846         (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
1847         * method.c (maybe_explain_implicit_delete): Use it.
1848         (lazily_declare_fn): Use it.
1849         * tree.c (type_has_nontrivial_copy_init): Use it.
1851         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
1852         semantics, simplify implementation.
1854 2017-07-16  Volker Reichelt  <v.reichelt@netcologne.de>
1856         * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
1857         in old-style cast diagnostic.
1858         * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
1859         in useless cast diagnostic.
1860         * error.c (type_to_string): Remove enum special handling.
1862 2017-07-14  David Malcolm  <dmalcolm@redhat.com>
1864         * name-lookup.c (get_std_name_hint): Add '<' and '>' around
1865         the header names.
1866         (maybe_suggest_missing_header): Update for addition of '<' and '>'
1867         to above.  Provide a fix-it hint.
1868         * pt.c: Include "gcc-rich-location.h"
1869         (listify): Attempt to add fix-it hint for missing
1870         #include <initializer_list>.
1871         * rtti.c: Include "gcc-rich-location.h".
1872         (typeid_ok_p): Attempt to add fix-it hint for missing
1873         #include <typeinfo>.
1875 2017-07-12  Jason Merrill  <jason@redhat.com>
1877         P0512R0 - Deduction from an initializer list.
1878         * pt.c (do_class_deduction): Do list deduction in two phases.
1880 2017-07-12  Nathan Sidwell  <nathan@acm.org>
1882         * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
1883         DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
1884         identifier flags.
1885         * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
1886         DECL_CXX_DESTRUCTOR explicitly.
1887         * decl2.c (grokclassfn): Likewise.
1888         * friend.c (do_friend): Likewise.
1889         * method.c (make_thunk, make_alias_for,
1890         implicitly_declare_fn): Likewise.
1892 2017-07-11  Jason Merrill  <jason@redhat.com>
1894         Core DR 393
1895         * decl.c (grokparms): Downgrade error about array of unknown bound
1896         to pedwarn and disable it for C++17.
1898 2017-07-11  Nathan Sidwell  <nathan@acm.org>
1900         * decl2.c (reset_type_linkage_2): Dont't change ctor name.
1902 2017-07-10  Martin Sebor  <msebor@redhat.com>
1904         * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
1906 2017-07-06  Jason Merrill  <jason@redhat.com>
1908         PR c++/81204 - parse error with dependent template-name
1909         * parser.c (cp_parser_lookup_name): Revert previous change.
1911 2017-07-06  David Malcolm  <dmalcolm@redhat.com>
1913         * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
1914         selftest::run_cp_tests.
1915         (selftest::run_cp_tests): New function.
1916         * cp-tree.h (selftest::run_cp_tests): New decl.
1918 2017-07-04  Jakub Jelinek  <jakub@redhat.com>
1920         * parser.c (cp_parser_decomposition_declaration): Replace
1921         decomposition declaration with structured binding in diagnostics.
1922         * decl.c (cp_finish_decomp): Likewise.
1923         (grokdeclarator): Likewise.
1925         PR c++/81258
1926         * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
1927         forms of structured binding initializers.
1929 2017-07-03  Paolo Carlini  <paolo.carlini@oracle.com>
1931         PR c++/65775
1932         * decl.c (grokdeclarator): Move checks on function return type after
1933         the splice_late_return_type call; if declspecs->locations[ds_type_spec]
1934         is UNKNOWN_LOCATION fall back to input_location.
1936 2017-07-03  David Malcolm  <dmalcolm@redhat.com>
1938         * parser.c (enum required_token): Fix spelling of
1939         RT_INTERATION to RT_ITERATION.
1940         (cp_parser_iteration_statement): Likewise.
1941         (cp_parser_required_error): Likewise.
1943 2017-06-30  Jason Merrill  <jason@redhat.com>
1945         PR c++/81257 - ICE with invalid ::template.
1946         PR c++/54769 - wrong lookup of dependent template-name.
1947         * parser.c (cp_parser_template_name): Revert part of last change.
1949 2017-06-30  Nathan Sidwell  <nathan@acm.org>
1951         * config-lang.in (gtfiles): Add cp/lex.c.
1952         * cp-tree.h (mangle_convop_name_for_type): Rename ...
1953         (make_conv_op_name): ... here.  Move to lex.
1954         * lambda.c (maybe_add_lambda_conv_op): Update.
1955         * parser.c (cp_parser_conversion_function_id): Update.
1956         * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
1957         tsubst_copy_and_build): Update.
1958         * semantics.c (apply_deduced_return_type): Update.
1959         * mangle.c (conv_type_hasher, conv_type_names,
1960         mangle_conv_op_name_for_type): Move to ...
1961         * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
1962         ... here.  Rename.
1964 2017-06-30  David Malcolm  <dmalcolm@redhat.com>
1966         PR c++/80014
1967         * parser.c (cp_parser_postfix_expression): Construct a location
1968         for typeid expressions.
1970 2017-06-30  Nathan Sidwell  <nathan@acm.org>
1972         * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
1973         declare.
1974         (lookup_all_conversions): Declare.
1975         * class.c (get_basefndecls): Use lookup_fnfields_slot.
1976         * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
1977         * decl2.c (check_class_fn): Use lookup_fnfields_slot.  Rework
1978         diagnostics.
1979         * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
1980         (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
1981         lookup_all_conversions.
1982         * search.c (lookup_fnfields_1): Make static.
1983         (lookup_all_conversions): New.
1984         (class_method_index_for_fn): Delete.
1985         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
1986         lookup_fnfields_slot.
1988         * call.c (build_new_method_call_1): Use constructo_name to get
1989         ctor name.  Move argument processing earlier to merge cdtor
1990         handling blocks.
1991         * decl.c (grokfndecl): Cdtors have special names.
1992         * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
1993         * pt.c (check_explicit_specialization): Cdtor name is already
1994         special.
1995         * search.c (class_method_index_for_fn): Likewise.
1997         PR c++/81229
1998         * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
1999         a matching TYPE_DECL.
2001 2017-06-29  Paolo Carlini  <paolo.carlini@oracle.com>
2003         * class.c (add_method): Change pair of errors to error + inform.
2004         (handle_using_decl): Likewise.
2006 2017-06-29  Jason Merrill  <jason@redhat.com>
2008         * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
2010         PR c++/81180 - ICE with C++17 deduction of member class template.
2011         * pt.c (build_deduction_guide): Correct member template handling.
2013         PR c++/81188 - matching decltype of member function call.
2014         * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
2016 2017-06-29  Nathan Sidwell  <nathan@acm.org>
2018         PR c++/81247
2019         * parser.c (cp_parser_namespace_definition): Immediately close the
2020         namespace if there's no open-brace.
2021         * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
2022         namespace.
2024 2017-06-29  Jason Merrill  <jason@redhat.com>
2026         PR c++/81164 - ICE with invalid inherited constructor.
2027         * search.c (binfo_direct_p): New.
2028         * name-lookup.c (do_class_using_decl): Use it.
2030 2017-06-29  Nathan Sidwell  <nathan@acm.org>
2032         * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
2033         VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
2034         * decl.c (initialize_predefined_identifiers): Name cdtor special
2035         names consistently.  Use literals for above deleted defines.
2036         (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
2038         * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
2039         flag.
2041         * call.c (check_dtor_name): Use constructor_name for enums too.
2042         (build_new_method_call_1): Use constructor_name for cdtors and
2043         show ~ for dtor.
2044         * class.c (build_self_reference): Use TYPE_NAME to get name of
2045         self reference.
2046         * name-lookup (constructor_name): Use DECL_NAME directly.
2047         (constructor_name_p): Reimplement.
2048         (push_class_level_binding_1): Use TYPE_NAME directly.
2050         * class.c (finish_struct): Use OVL_P.
2051         (get_vfield_name): Measure constructor_name length.
2052         * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
2053         (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
2054         * cxx-pretty-print.c (is_destructor_name): Delete.
2055         (pp_cxx_unqualified_id): Remove bogus destructor name checking.
2056         * decl.c (grokfndecl): Move cheap checks first when looking for
2057         implicit extern cness.
2059         * parser.c (cp_parser_direct_declarator): Reorder if to avoid
2060         indentation. Remove unnecessary assignment of constructor name.
2062         Whitespace cleanups.
2063         * call.c (name_as_c_string): Move CONST_CAST to return.
2064         (build_new_method_call_1): Remove unneeded bracing.
2065         * class.c (include_empty_classes): Unbreak line.
2066         * constraint.cc (tsubst_check_constraint): Add space.
2067         * cp-tree.h (lang_decl_ns): Add comment.
2068         (PTRMEM_CST_MEMBER): Break line.
2069         * decl.c (grokfndecl): Add blank lines. Unbreak some others.
2070         (grokdeclarator): Remove lines, move declaration to first use.
2071         * decl2.c (decl_needed_p): Fix indentation.
2072         (c_parse_final_cleanups): Remove blank line.
2073         * method.c (implicitly_declare_fn): Move declaration to first use.
2074         * search.c (current_scope): Add blank lines.
2076 2017-06-28  Jason Merrill  <jason@redhat.com>
2078         PR c++/72764 - ICE with invalid template typename.
2079         * decl.c (build_typename_type): No longer static.
2080         * tree.c (strip_typedefs): Use it instead of make_typename_type.
2082         PR c++/69300 - ICE with self-referential noexcept
2083         * pt.c (maybe_instantiate_noexcept): Check for recursion.
2085         PR c++/61022 - error with variadic template template parm
2086         * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
2088         PR c++/72801 - ICE with variadic partial specialization
2089         * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
2091         PR c++/55639 - partial specialization with ::template
2092         * parser.c (cp_parser_class_head): Handle ::template.
2094         PR c++/45976 - error with ::template in declarator.
2095         * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
2097         PR c++/54769 - wrong lookup of dependent template-name.
2098         * parser.c (cp_parser_template_name): Handle dependent object type.
2099         (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
2100         parameter.
2101         (cp_parser_id_expression): Pass it.
2102         (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
2104         * parser.c (cp_parser_template_id): Use the range location on the
2105         TEMPLATE_ID_EXPR.
2107         PR c++/81204 - parse error with dependent template-name
2108         * parser.c (cp_parser_lookup_name): Disqualify function templates
2109         after lookup.
2111 2017-06-27  Nathan Sidwell  <nathan@acm.org>
2113         * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
2114         initialization point.  Don't unnecessarily check for ctor name.
2116         * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
2117         (CLASSTYPE_DESTRUCTOR): ... this.
2118         * class.c (accessible_nvdtor_p,
2119         maybe_warn_about_overly_private_class,
2120         add_implicitly_declared_members,
2121         clone_constructors_and_destructors, type_has_virtual_destructor):
2122         Adjust for CLASSTYPE_DESTRUCTOR.
2123         (deduce_noexcept_on_destructors): Absorb into ...
2124         (check_bases_and_members): ... here.
2125         * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
2126         * init.c (build_delete): Likewise.
2127         * parser.c (cp_parser_lookup_name): Likewise.
2128         * pt.c (check_explicit_specialization): Likewise.
2129         * rtti.c (emit_support_tinfos): Likewise.
2130         * search.c (lookup_fnfields_idx_nolazy): Likewise.
2132         Kill IDENTIFIER_TEMPLATE.
2133         * cp-tree.h (lang_identifier): Remove class_template_info field.
2134         (IDENTIFIER_TEMPLATE): Delete.
2135         * name-lookup.c (constructor_name_full): Subsume into ...
2136         (constructor_name): ... here.  Don't check IDENTIFIER_TEMPLATE.
2137         (constructor_name_p): Likewise.
2138         * mangle.c (write_source_name): Likewise.
2139         * ptree.c (cxx_print_identifier): Likewise.
2141 2017-06-27  Marek Polacek  <polacek@redhat.com>
2143         PR bootstrap/81216
2144         * parser.c (cp_parser_already_scoped_statement): Initialize
2145         LOC_AFTER_LABELS.
2147 2017-06-26  Jason Merrill  <jason@redhat.com>
2149         PR c++/81215 - deduction failure with variadic TTP.
2150         * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
2152 2017-06-26  Martin Sebor  <msebor@redhat.com>
2154         PR c++/81169
2155         * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
2156         to detect casting away cv-qualifiers.
2158 2017-06-26  Nathan Sidwell  <nathan@acm.org>
2160         * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
2161         (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
2162         identifier.
2163         (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
2164         DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
2165         (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
2166         * decl.c (grok_op_properties): Adjust identifier checking.
2167         * init.c (expand_default_init): Adjust identifier descision.
2168         * method.c (implicitly_declare_fn): Don't use
2169         DECL_ASSIGNMENT_OPERATOR_P.
2170         * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
2171         IDENTIFIER_DTOR_P.
2172         * call.c (in_charge_arg_for_name): Reimplement.
2173         (build_special_member_call): Use IDENTIFIER_CDTOR_P,
2174         IDENTIFIER_DTOR_P.
2176 2017-06-26  Marek Polacek  <polacek@redhat.com>
2178         PR c/80116
2179         * parser.c (cp_parser_statement): Add a default argument.  Save the
2180         location of the expression-statement after labels have been parsed.
2181         (cp_parser_implicitly_scoped_statement): Set the location of the
2182         body of the conditional after parsing all the labels.  Call
2183         warn_for_multistatement_macros.
2184         (cp_parser_already_scoped_statement): Likewise.
2186 2017-06-24  Paolo Carlini  <paolo.carlini@oracle.com>
2188         PR c++/62315
2189         * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
2190         'typename' in error messages about missing 'typename'.
2192 2017-06-23  Jason Merrill  <jason@redhat.com>
2194         PR c++/79056 - C++17 ICE with invalid template syntax.
2195         * parser.c (cp_parser_simple_type_specifier): Don't assume that type
2196         is a TYPE_DECL.
2197         (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
2198         * pt.c (template_placeholder_p): New.
2199         * cp-tree.h: Declare it.
2201 2017-06-23  Marc Glisse  <marc.glisse@inria.fr>
2203         * decl.c (duplicate_decls): Use builtin_structptr_types.
2205 2017-06-22  Nathan Sidwell  <nathan@acm.org>
2207         Reorder IDENTIFIER flags
2208         gcc/cp/
2209         * cp-tree.h (enum cp_identifier_kind): New.
2210         (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
2211         IDENTIFIER_KIND_BIT_2): New.
2212         (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
2213         (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
2214         (C_IS_RESERVED_WORD): Replace with ...
2215         (IDENTIFIER_KEYWORD_P): ... this.
2216         (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
2217         (IDENTIFIER_CDTOR_P): ... this.
2218         (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
2219         (IDENTIFIER_OPNAME_P): Replace with ...
2220         (IDENTIFIER_ANY_OP_P): ... this.
2221         (IDENTIFIER_ASSIGN_OP_P): New.
2222         (IDENTIFIER_TYPENAME_P): Replace with ...
2223         (IDENTIFIER_CONV_OP_P): ... this.
2224         (NEW_DELETE_OPNAME_P): Replace with ...
2225         (IDENTIFIER_NEWDEL_OP_P): ... this.
2226         (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
2227         (get_identifier_kind_name, set_identifier_kind): Declare.
2228         * lex.c (get_identifier_kind_name, set_identifier_kind): New.
2229         (init_operators): Adjust to avoid keywords, use
2230         set_identifier_kind. Copy TYPE_EXPR slot.
2231         (init_reswords): Call set_identifier_kind.
2232         (unqualified_name_lookup_error): Adjust.
2233         * operators.def (TYPE_EXPR): Remove.
2234         * decl.c (struct predefined_identifier): Move into ...
2235         (initialize_predefined_identifiers): ... here.  Call
2236         set_identifier_kind.
2237         (grokfndecl, check_var_type, grokdeclarator): Adjust.
2238         (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
2239         space.  Adjust.
2240         * call.c (name_as_c_string): Adjust.
2241         (build_new_method_call_1): Likewise.
2242         * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
2243         * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
2244         * dump.c (cp_dump_tree): Adjust.
2245         * error.c (dump_decl_name): Adjust.
2246         * mangle.c (write_unqualified_id, write_member_name,
2247         write_expression): Adjust.
2248         (mangle_conv_op_name_for_type): Use set_identifier_kind.
2249         * name-lookup.c (do_class_using_decl): Adjust.
2250         (lookup_name_fuzzy, lookup_name_real_1): Likewise.
2251         * parser.c (cp_lexer_get_preprocessor_token,
2252         cp_parser_direct_declarator): Likewise.
2253         * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
2254         tsubst_copy, tsubst_copy_and_build): Adjust.
2255         * ptree.c (cxx_print_identifier): Print identifier kind.
2256         * search.c (lookup_field_r, lookup_member,
2257         lookup_fnfields_idx_nolazy): Adjust.
2258         * semantics.c (finish_id_expression): Adjust..
2259         * typeck.c (cp_build_addr_expr_1): Adjust.
2261 2017-06-21  Jakub Jelinek  <jakub@redhat.com>
2263         PR c++/81154
2264         * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
2265         Complain about t not being a variable if t is OVERLOAD even
2266         when processing_template_decl.
2268 2017-06-21  David Malcolm  <dmalcolm@redhat.com>
2270         * parser.c (get_cast_suggestion): New function.
2271         (maybe_add_cast_fixit): New function.
2272         (cp_parser_cast_expression): Capture the location of the closing
2273         parenthesis.  Call maybe_add_cast_fixit when emitting warnings
2274         about old-style casts.
2276 2017-06-20  Jason Merrill  <jason@redhat.com>
2278         PR c++/80972 - C++17 ICE with attribute packed.
2279         * call.c (build_over_call): Allow a TARGET_EXPR from reference
2280         binding.
2282 2017-06-20  Nathan Sidwell  <nathan@acm.org>
2284         * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
2285         (nelts_identifier): Delete.
2286         * decl.c (initialize_predefined_identifiers): Remove nelts.
2288         PR c++/67074 - namespace aliases
2289         * decl.c (duplicate_decls): Don't error here on mismatched
2290         namespace alias.
2291         * name-lookup.c (name_lookup::add_value): Matching namespaces are
2292         not ambiguous.
2293         (diagnose_name_conflict): Namespaces are never redeclarations.
2294         (update_binding): An alias can match a real namespace.
2296 2017-06-19  Jason Merrill  <jason@redhat.com>
2298         PR c++/80562 - ICE with constexpr if.
2299         * semantics.c (finish_if_stmt_cond): Call
2300         instantiate_non_dependent_expr.
2302         PR c++/80829 - ICE with constexpr copy of base subobject.
2303         * constexpr.c (clear_no_implicit_zero): New.
2304         (cxx_eval_call_expression): Call it.
2306 2017-06-19  Nathan Sidwell  <nathan@acm.org>
2308         PR c++/81124
2309         PR c++/79766
2310         * name-lookup.c (set_decl_namespace): Don't follow using
2311         directives and ignore using decls.  Only check overly-explicit
2312         scope after discovering decl.
2314 2017-06-19  Jason Merrill  <jason@redhat.com>
2316         PR c++/81073 - constexpr and static var in statement-expression.
2317         * typeck2.c (store_init_value): Always call
2318         require_potential_constant_expression.
2319         * pt.c (convert_nontype_argument): Likewise.
2320         * constexpr.c (potential_constant_expression_1): Adjust message.
2321         Use decl_maybe_constant_var_p instead of decl_constant_var_p.
2322         * decl2.c (decl_maybe_constant_var_p): Consider initializer.
2324 2017-06-19  Nathan Sidwell  <nathan@acm.org>
2326         * pt.c (coerce_template_parms): Fix indentation.
2327         (tsubst_decl): Remove repeated SET_DECL_RTL.  Move VAR_P handling
2328         in to single block.
2330         PR c++/81119
2331         * name-lookup.c (update_binding): Only warn about constructors
2332         hidden by functions.
2334 2017-06-17  Jason Merrill  <jason@redhat.com>
2336         PR c++/60063 - -Wunused-local-typedefs and templates.
2337         * decl2.c (is_late_template_attribute): Return false for "used".
2339         PR c++/70844 - -Wuseless-cast and inheriting constructor.
2340         * method.c (forward_parm): Suppress warn_useless_cast.
2342 2017-06-16  Jason Merrill  <jason@redhat.com>
2344         PR c++/81045 - Wrong type-dependence with auto return type.
2345         * pt.c (type_dependent_expression_p): An undeduced auto outside the
2346         template isn't dependent.
2347         * call.c (build_over_call): Instantiate undeduced auto even in a
2348         template.
2350         PR c++/80465 - ICE with generic lambda with noexcept-specifier.
2351         * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
2352         set longer for a generic lambda.
2354         PR c++/80614 - Wrong mangling for C++17 noexcept type
2355         * mangle.c (write_type): Put the eh spec back on the function type.
2357         PR c++/81102 - Wrong error with partial specialization.
2358         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
2359         types.  Do type deduction later.
2361         PR c++/81074 - ICE with partial specialization of member template.
2362         PR c++/71747
2363         * pt.c (get_partial_spec_bindings): Only coerce innermost args.
2365         PR c++/80831 - ICE with -fsyntax-only.
2366         * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
2368         PR c++/80639 - ICE with invalid PMF initialization.
2369         PR c++/80043 - ICE with -fpermissive
2370         * typeck.c (convert_for_assignment): Recurse when instantiate_type
2371         returns without an error.
2373 2017-06-16  Nathan Sidwell  <nathan@acm.org>
2375         * pt.c (tsubst_baselink): Fix & clarify formatting.
2377         * cp-tree.h (build_this_parm, cp_build_parm_decl,
2378         build_artificial_parm): Add FN parm.
2379         * decl.c (start_cleanup_fn): Adjust.
2380         (build_this_parm): Add FN parm, pass it through.
2381         (grokfndecl): Adjust parm building.
2382         * decl2.c (cp_build_parm_decl): Add FN parm, set context.
2383         (build_artificial_parm): Add FN parm, pass through.
2384         (maybe_retrofit_in_chrg): Adjust parm building.
2385         (start_static_storage_duration_function): Likwise.
2386         * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
2387         * method.c (implicitly_declare_fn): Likewise.
2388         * parser.c (inject_this_parameter): Likewise.
2390         Symbol tables are insert only.
2391         * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
2392         derive from pointer_hash.  Make undeletable.
2394         * class.c (resort_type_method_vec): Avoid potential unsigned
2395         overflow.
2397         Don't defer noexcept_deferred_spec.
2398         * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
2399         * decl.c (cxx_init_decl_processing): Initialize
2400         noexcept_deferred_spec.
2401         * except.c (unevaluated_noexcept_spec): Delete.
2402         * class.c (deduce_noexcept_on_destructor): Use
2403         noexcept_deferred_spec directly.
2404         * method.c (implicitly_declare_fn): Likewise.
2406         Make keyed_classes a vector.
2407         * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
2408         (keyed_classes): Declare as vector.
2409         * decl.c (keyed_classes): Define.
2410         (cxx_init_decl_processing): Allocate it.
2411         (record_key_method_defined): Use vec_safe_push.
2412         * class.c (finish_struct_1): Likewise.
2413         * pt.c (instantiate_class_template_1): Likewise.
2414         * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
2416         Make rtti lazier
2417         * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
2418         TK_VMI_CLASS_TYPES, TK_MAX.  Delete TK_FIXED.
2419         (tinfo_names): New.
2420         (typeid_ok_p): Add quotes to error messages.  Use get_tinfo_desc.
2421         (get_tinfo_decl): Use get_tinfo_desc.
2422         (get_pseudo_ti_init): Likewise. Adjust VMI construction.
2423         (create_pseudo_type_info): Delete.
2424         (get_pseudo_ti_index): Just determine the index.
2425         (get_tinfo_desc): New.  Create all types lazily.
2426         (create_tinfo_types): Just allocate the descriptor array.
2427         (emit_support_tinfos): Use non-inserting type lookup.  Set builtin
2428         location.
2430 2017-06-15  Martin Sebor  <msebor@redhat.com>
2432         PR c++/80560
2433         * call.c (first_non_public_field, maybe_warn_class_memaccess): New
2434         functions.
2435         (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
2436         (build_cxx_call): Call maybe_warn_class_memaccess.
2438 2017-06-14  Jakub Jelinek  <jakub@redhat.com>
2440         * cp-gimplify.c (cp_genericize_r): Turn most of the function
2441         into a switch (TREE_CODE (stmt)) statement from long else if
2442         sequence.
2444 2017-06-13  Jakub Jelinek  <jakub@redhat.com>
2446         PR c++/80973
2447         * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
2448         argument even if it has REFERENCE_TYPE.
2450         PR c++/80984
2451         * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
2452         BLOCK_VARS (outer) chain.
2453         (cxx_omp_const_qual_no_mutable): Likewise.
2455 2017-06-13  Martin Liska  <mliska@suse.cz>
2457         PR sanitize/78204
2458         * class.c (build_base_path): Use sanitize_flags_p.
2459         * cp-gimplify.c (cp_genericize_r): Likewise.
2460         (cp_genericize_tree): Likewise.
2461         (cp_genericize): Likewise.
2462         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2463         * decl.c (compute_array_index_type): Likewise.
2464         (start_preparsed_function): Likewise.
2465         * decl2.c (one_static_initialization_or_destruction): Likewise.
2466         * init.c (finish_length_check): Likewise.
2467         * lambda.c (maybe_add_lambda_conv_op): Likewise.
2468         * typeck.c (cp_build_binary_op): Likewise.
2469         (build_static_cast_1): Likewise.
2471 2017-06-11  Jason Merrill  <jason@redhat.com>
2473         * error.c (dump_expr): Use is_this_parameter.
2475         * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
2476         id_equal.
2478 2017-06-09  Jason Merrill  <jason@redhat.com>
2480         Missing bits from N4268, constant evaluation for all non-type args.
2481         * call.c (build_converted_constant_expr): Rename from
2482         build_integral_nontype_arg_conv, handle all types.
2483         * pt.c (convert_nontype_argument): In C++17 call it for all types.
2484         Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
2485         * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
2487         Overhaul pointer-to-member conversion and template argument handling.
2488         * call.c (standard_conversion): Avoid creating ck_pmem when the
2489         class type is the same.
2490         * cvt.c (can_convert_qual): Split from
2491         perform_qualification_conversions.
2492         * constexpr.c (cxx_eval_constant_expression): Check it.
2493         * typeck.c (convert_ptrmem): Only cplus_expand_constant if
2494         adjustment is necessary.
2495         * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
2496         (convert_nontype_argument): Avoid redundant error.
2498         * call.c (convert_like_real): Remove "inner" parameter.
2499         Don't replace a constant with its value.
2500         * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
2502         * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
2503         nullptr_node.
2505         * parser.c (cp_parser_constant_expression): Check
2506         potential_rvalue_constant_expression after decay_conversion.
2507         * pt.c (convert_nontype_argument): Don't require linkage in C++17.
2509         PR c++/80384 - ICE with dependent noexcept-specifier
2510         * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
2511         noexcept-specifier.
2513         * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
2515 2017-06-09  Jan Hubicka  <hubicka@ucw.cz>
2517         * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
2518         * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
2519         (excpet.c): Mark terminate as cold.
2521 2017-06-08  Jakub Jelinek  <jakub@redhat.com>
2523         PR c/81006
2524         * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
2525         to sizetype before size_binop.
2527         PR c++/81011
2528         * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
2529         to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
2530         and OMP_CLAUSE_SHARED_READONLY flags.
2532 2017-06-08  Jan Hubicka  <hubicka@ucw.cz>
2534         * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
2536 2017-06-07  Nathan Sidwell  <nathan@acm.org>
2538         * class.c (layout_class_type): Restructure overlong-bitfield tpe
2539         search.
2541 2017-06-07  Jonathan Wakely  <jwakely@redhat.com>
2543         PR c++/80990
2544         * pt.c (do_class_deduction): Build qualified type.
2546 2017-06-06  Nathan Sidwell  <nathan@acm.org>
2548         * name-lookup.c (suggest_alternatives_for): Use qualified lookup
2549         sans using directives.  Don't walk into inline namespaces.
2551         PR c++/80979
2552         * name-lookup.c (adl_class_only): Don't add visible friends.
2554 2017-06-05  Volker Reichelt  <v.reichelt@netcologne.de>
2556         * parser.c (cp_parser_base_specifier): Fix typos in error messages.
2558 2017-06-02  Nathan Sidwell  <nathan@acm.org>
2560         Remove lang_type_ptrmem.
2561         * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
2562         into ...
2563         (lang_type_class): ... this.  Reorder bitfields.  Rename to ...
2564         (lang_type): ... this.  Delete old definition.
2565         (lang_type_ptrmem): Delete.
2566         (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC.  Adjust uses.
2567         (LANG_TYPE_PTRMEM_CHECK): Delete.
2568         (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
2569         (TYPE_PTRMEMFUNC_TYPE): New.  Use TYPE_LANG_SLOT_1.
2570         * decl.c (build_ptrmemfunc_type): Adjust.
2571         * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
2572         (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
2573         
2574         * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
2575         setting.
2576         
2577         Remove cp_binding_level::namespaces
2578         * name-lookup.h (cp_binding_level): Lose namespaces field.
2579         * name-lookup.c (add_decl_to_level): Chain namespaces on the names
2580         list.
2581         (suggest_alternatives_for): Adjust for namespace list.  Do
2582         breadth-first search.
2583         * decl2.c (collect_source_refs): Namespaces are on the regulr
2584         list.
2585         (collect_ada_namespace): Likewise.
2587 2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
2589         * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
2590         warning.
2592 2017-06-01  Ville Voutilainen  <ville.voutilainen@gmail.com>
2594         PR c++/80812
2595         * method.c (constructible_expr): Strip array types before calling
2596         build_value_init.
2598 2017-06-01  Paolo Carlini  <paolo.carlini@oracle.com>
2600         PR c++/80896
2601         * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
2602         for case INDIRECT_REF too in the main switch.
2604 2017-05-31  Jason Merrill  <jason@redhat.com>
2606         PR c++/80840 - ICE with constexpr and reference
2607         * pt.c (convert_nontype_argument): Don't test whether a decl is
2608         value-dependent when binding to a reference.
2610 2017-05-31  Nathan Sidwell  <nathan@acm.org>
2612         * cp-tree.h (lang_decl_slector): New enum.
2613         (lang_decl_base): Make selector an enum.  Drop decomposition_p
2614         field.
2615         (lang_decl): Use enum for discrimination.
2616         (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
2617         LANG_DECL_DEOMP_CHECK): Use enum.
2618         (DECL_DECOMPOSITION_P): Use selector value.
2619         (SET_DECL_DECOMPOSITION_P): Delete.
2620         (retrofit_lang_decl): Lose SEL parm.
2621         (fit_decomposition_lang_decl): Declare.
2622         * decl.c (cp_finish_decomp, grokdeclarator): Use
2623         fit_decomposition_lang_decl.
2624         * lex.c (maybe_add_lang_decl_raw): New. Broken out of
2625         retrofit_lang_decl.
2626         (set_decl_linkage): New.  Broken out of retrofit_lang_decl.  Use enum.
2627         (fit_decomposition_lang_decl): Likewise.
2628         (retrofit_lang_decl): Use worker functions.
2629         (cxx_dup_lang_specific_decl): Use selector enum.
2630         (maybe_add_lang_type_raw): New.  Broken out of ...
2631         (cxx_make_type_name): ... here.  Call it.
2633 2017-05-30  Jason Merrill  <jason@redhat.com>
2635         PR c++/80856 - ICE with local extern in template
2636         * semantics.c (finish_call_expr): Replace a local extern overload
2637         set in a template with the IDENTIFIER_NODE.
2639 2017-05-30  David Malcolm  <dmalcolm@redhat.com>
2641         * call.c (perform_implicit_conversion_flags): Convert
2642         "from %qT to %qT" to "from %qH to %qI" in diagnostic.
2643         (print_conversion_rejection): Replace pairs of %qT with
2644         %qH and %qI in various places.
2645         (build_user_type_conversion_1): Likewise.
2646         (build_integral_nontype_arg_conv): Likewise.
2647         (build_conditional_expr_1): Likewise.
2648         (convert_like_real): Likewise.
2649         (convert_arg_to_ellipsis): Likewise.
2650         (joust): Likewise.
2651         (initialize_reference): Likewise.
2652         * cvt.c (cp_convert_to_pointer): Likewise.
2653         (cp_convert_to_pointer): Likewise.
2654         (convert_to_reference): Likewise.
2655         (ocp_convert): Likewise.
2656         * error.c (cp_printer): Gain bool and const char ** parameters.
2657         (struct deferred_printed_type): New struct.
2658         (class cxx_format_postprocessor): New class.
2659         (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
2660         to pp->m_format_postprocessor.
2661         (comparable_template_types_p): New function.
2662         (newline_and_indent): New function.
2663         (arg_to_string): New function.
2664         (print_nonequal_arg): New function.
2665         (print_template_differences): New function.
2666         (type_to_string_with_compare): New function.
2667         (print_template_tree_comparison): New function.
2668         (append_formatted_chunk): New function.
2669         (add_quotes): New function.
2670         (cxx_format_postprocessor::handle): New function.
2671         (defer_phase_2_of_type_diff): New function.
2672         (cp_printer): Add "quoted" and "buffer_ptr" params.  Implement
2673         %H and %I.
2674         * typeck.c (cp_build_binary_op): Replace pairs of %qT with
2675         %qH and %qI in various places.
2676         (convert_member_func_to_ptr): Likewise.
2677         (build_reinterpret_cast_1): Likewise.
2678         (convert_for_assignment): Likewise.
2679         * typeck2.c (check_narrowing): Likewise.
2681 2017-05-30  Nathan Sidwell  <nathan@acm.org>
2683         Kill IDENTIFIER_NAMESPACE_BINDINGS
2684         * cp-tree.h (lang_identifier): Delete namespace_bindings.
2685         (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
2686         (lang_decl_ns): Add bindings.
2687         (DECL_NAMESPACE_BINDINGS): New.
2688         * lex.c (retrofit_lang_decl): Create namespace hash table.
2689         * name-lookup.c (find_namespace_slot): Change to use hash-map.
2690         * ptree.c (cxx_print_binding): Delete.
2691         (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
2693         * cp-tree.def (OVERLOAD): Fix comment.
2694         * cp-tree.h: Fix comments and whitespace.
2695         * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
2696         * name-lookup.c (add_decl_to_level): Assert not class.
2697         (check_local_shadow): Use OVL_P.
2698         (pushdecl_with_scope_1): Rename to ...
2699         (do_pushdecl_with_Scope): ... here.
2700         (do_nonmember_using_decl): Use qualified_namespace_lookup return
2701         value.
2702         (push_class_level_binding_1): Use OVL_P.
2703         (pushdecl_namespace_level): Use do_pushdecl_with_scope.
2704         (pushtag_1): Rename to ...
2705         (do_pushtag): ... here.  Adjust do_pushdecl_with_scope call.
2706         (pushtag): Adjust.
2707         (store_class_bindings): Do not time here.
2708         * name-lookup.h (pushdecl_outermost_localscope): Reorder.
2709         * pt.c (listify): Declare argvec at point of initialization.
2711         PR c++/80913
2712         * name-lookup.c (add_decl_to_level): Assert not making a circular
2713         chain.
2714         (update_binding): Don't prematurely slide artificial decl.
2716 2017-05-29  Alexandre Oliva <aoliva@redhat.com>
2718         * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
2720 2017-05-29  Nathan Sidwell  <nathan@acm.org>
2722         PR c++/80891 (#1,#5)
2723         * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
2724         * name-lookup.c (name_lookup): Add deduping field.
2725         (name_lookup::preserve_state, name_lookup::restore_state): Deal
2726         with deduping.
2727         (name_lookup::add_overload): New.
2728         (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
2729         (name_lookup::search_adl): Set deduping.  Don't unmark here.
2730         * pt.c (most_specialized_instantiation): Revert previous change,
2731         Assert not given duplicates.
2732         * tree.c (lookup_mark): Just mark the underlying decls.
2733         (lookup_maybe_add): Dedup using marked decls.
2735         PR c++/80891 (#4)
2736         * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
2737         * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
2739         Stat hack representation
2740         * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
2741         MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
2742         (stat_hack): New.
2743         (find_namespace_binding): Replace with ...
2744         (find_namespace_slot): ... this.
2745         (find_namespace_value): New.
2746         (name_lookup::search_namespace_only,
2747         name_lookup::adl_namespace_only): Adjust.
2748         (update_binding): Add SLOT parameter, adjust.
2749         (check_local_shadow): Use find_namespace_value.
2750         (set_local_extern_decl_linkage): Likewise.
2751         (do_pushdecl): Adjust for namespace slot.
2752         (push_local_binding): Assert not a namespace binding.
2753         (check_for_out_of_scope_variable): Use find_namespace_value.
2754         (set_identifier_type_value_with_scope): Likewise.
2755         (get_namespace_binding): Likewise.
2756         (set_namespace_binding): Delete.
2757         (set_global_binding): Directly update the binding.
2758         (finish_namespace_using_decl): Likewise.
2759         (lookup_type_scope_1): Use find_namespace_slot and update.
2760         (do_push_nested_namespace): Use find_namespace_value.
2762         PR c++/80891 (#1)
2763         * pt.c (most_specialized_instantiation): Cope with duplicate
2764         instantiations.
2766         PR c++/80891 (#3)
2767         * cp-tree.h (build_min_nt_call_vec): Declare.
2768         * decl.c (build_offset_ref_call_from_tree): Call it.
2769         * parser.c (cp_parser_postfix_expression): Likewise.
2770         * pt.c (tsubst_copy_and_build): Likewise.
2771         * semantics.c (finish_call_expr): Likewise.
2772         * tree.c (build_min_nt_loc): Keep unresolved lookups.
2773         (build_min): Likewise.
2774         (build_min_non_dep): Likewise.
2775         (build_min_non_dep_call_vec): Likewise.
2776         (build_min_nt_call_vec): New.
2778         PR c++/80891 (#2)
2779         * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
2780         (ovl_used): New.
2781         (lookup_keep): Call it.
2783 2017-05-26  Nathan Sidwell  <nathan@acm.org>
2785         Implement DR2061
2786         * name-lookup.c (push_inline_namespaces): New.
2787         (push_namespace): Look inside inline namespaces.
2789         Inline and using namespace representation change.
2790         * cp-tree.h (struct lang_decl_ns): Delete ns_using.  Add usings,
2791         inlinees as vector.
2792         (DECL_NAMESPACE_USING): Adjust.
2793         (DECL_NAMESPACE_INLINEES): New.
2794         * name-lookup.h (struct cp_binding_level): Change usings
2795         representation.
2796         * name-lookup.c (name_lookup::do_queue_usings,
2797         name_lookup::queue_usings): Adjust.
2798         (name_lookup::search_namespace, name_lookup::search_usings,
2799         name_lookup::queue_namespace): Adjust.
2800         (name_lookup::adl_namespace_only): Adjust.
2801         (add_using_namespace, push_namespace): Push onto vector.
2802         (pop_namespace): Add timing logic.
2804         * call.c (build_operator_new_call): Do namelookup and ADL here.
2805         (build_new_op_1): Likewise.
2806         * name-lookup.h (lookup_function_nonclass): Delete declaration.
2807         (do_using_directive): Likewise.
2808         * name-lookup.c (set_namespace_binding, push_local_binding): Don't
2809         declare early.
2810         (struct scope_binding): Delete.
2811         (EMPTY_SCOPE_BINDING): Delete.
2812         (set_decl_namespace): Use OVL_P.
2813         (finish_local_using_decl): Lose unnecesary checks.
2814         (lookup_function_nonclass): Delete.
2815         (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
2817         * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
2818         (ovl_iterator): Add allow_inner field.  Adjust ctor.  Make
2819         unduplicatable.
2820         (ovl_iterator::maybe_push, ovl_iterator::pop): New.
2821         (lkp_iterator): Add outer field.  Adjust ctor.
2822         (lkp_iterator::operator++): New.
2823         (lookup_mark, lookup_maybe_add): Declare.
2824         * name-lookup.c (name_lookup): Delete fn_set member.
2825         (name_lookup::preserve_state, name_lookup::restore_state): Unmark
2826         and mark lookup.
2827         (name_lookup::add_value): Use lookup_add directly.
2828         (name_lookup::add_fns: Use lookup_maybe_add.
2829         (name_lookup::search_adl): Mark and unmark fns.
2830         (pushdecl): Adjust.
2831         * pt.c (check_explicit_specialization): Use lookup_add directly.
2832         * ptree.c (cxx_print_xnode): Show complete overload structure.
2833         * tree.c (lookup_mark, lookup_maybe_add): New.
2835         * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
2837 2017-05-26  Jakub Jelinek  <jakub@redhat.com>
2839         * cp-tree.h (struct lang_decl_decomp): New type.
2840         (struct lang_decl): Add u.decomp.
2841         (LANG_DECL_DECOMP_CHECK): Define.
2842         (DECL_DECOMPOSITION_P): Note it is set also on the vars
2843         for user identifiers.
2844         (DECL_DECOMP_BASE): Define.
2845         (retrofit_lang_decl): Add extra int = 0 argument.
2846         * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
2847         use it to influence the selector choices and for selector
2848         0 to non-zero transition copy old content.
2849         (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
2850         * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
2851         !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR.  Adjust warning
2852         wording if decl is a structured binding.
2853         (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
2854         Set DECL_DECOMP_BASE.  Ignore DECL_READ_P sets from initialization
2855         of individual variables for tuple structured bindings.
2856         (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
2857         Clear DECL_DECOMP_BASE.
2858         * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
2859         * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
2860         is expected.
2861         * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
2862         DECL_VALUE_EXPR.
2864 2017-05-25  Jason Merrill  <jason@redhat.com>
2866         PR c++/80605 - __is_standard_layout and zero-length array
2867         * class.c (check_bases): Use DECL_FIELD_IS_BASE.
2869 2017-05-25  Nathan Sidwell  <nathan@acm.org>
2871         Kill OVL_CURRENT, OVL_NEXT.
2872         * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
2873         * name-lookup.c (set_decl_namespace): Use ovl_iterator.
2874         (consider_binding_level): Use OVL_FIRST.
2875         (cp_emit_debug_info_for_using): Use lkp_iterator.
2876         * pt.c (check_explicit_specialization): Use ovl_iterator.       
2878         Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
2879         * cp-tree.h (lang_decl_ns): Remove ns_users field.
2880         (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
2881         (TREE_INDIRECT_USING): Delete.
2882         * name-lookup.h (is_associated_namespace): Delete.
2883         * name-lookup.c (name_lookup::search_usings,
2884         name_lookup::do_queue_usings): Usings are always direct.
2885         (is_associated_namespace): Delete.
2886         (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
2887         (namespace_ancestor_1, namespace_ancestor): Delete.
2888         (push_using_directive_1, push_using_directive): Delete.
2889         (add_using_namespace_1): Delete.
2890         (add_using_namespace): Reimplement.
2891         (emit_debug_info_using_namespace): New.
2892         (finish_namespace_using_directive, finish_local_using_directive,
2893         push_namespace): Adjust.
2894         * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
2896 2017-05-25  Volker Reichelt  <v.reichelt@netcologne.de>
2898         * semantics.c (finish_handler_parms): Warn about non-reference type
2899         catch handlers.
2901 2017-05-25  Nathan Sidwell  <nathan@acm.org>
2903         Reimplement unqualified namespace lookup.
2904         * name-lookup.c (name_lookup::using_pair,
2905         name_lookup::using_queue): New typedefs.
2906         (name_lookup::queue_namespace, name_lookup::do_queue_usings,
2907         name_lookup::queue_usings): New.
2908         (name_lookup::search_unqualified): New.
2909         (merge_functions, same_entity_p, ambiguous_decl,
2910         unqualified_namespace_lookup_1, unqualified_namespace_lookup,
2911         lookup_using_namespace): Delete.
2912         (lookup_name_real_1): Adjust.
2914         Reimplement qualified namespace lookup.
2915         * name-lookup.c (name_lookup::flags): New member.  Adjust ctor.
2916         (name_lookup::ambiguous, name_lookup::add_value,
2917         name_lookup::add_type, name_lookup::process_binding): New.
2918         (name_lookup::search_namespace_only,
2919         name_lookup::search_namespace, name_lookup::search_usings): New.
2920         (name_lookup::search_qualified): New.
2921         (do_nonmember_using_decl, suggest_alternatives_for,
2922         lookup_qualified_name): Adjust.
2923         (tree_vec_contains): Delete.
2924         (qualified_lookup_using_namespace): Rename to ...
2925         (qualified_namespace_lookup): ... here.  Reimplement.
2927         Reimplement ADL.
2928         * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
2929         * name-lookup.h (lookup_arg_dependent): Return plain tree.
2930         * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
2931         arg_assoc_args_vec, arg_assoc_type, add_function,
2932         arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
2933         arg_assoc_class, arg_assoc_template_arg, arg_assoc,
2934         lookup_arg_dependent_1): Delete.
2935         (name_lookup): New lookup object.
2936         (name_lookup::preserve_state, name_lookup::restore_state,
2937         name_lookup::mark_seen, name_lookup::find_and_mark,
2938         name_lookup::add_fns, name_lookup::adl_namespace_only,
2939         name_lookup::adl_namespace, name_lookup::adl_class_only,
2940         name_lookup::adl_bases, name_lookup::adl_class,
2941         name_lookup::adl_expr, name_lookup::adl_type,
2942         name_lookup::adl_template_arg, name_lookup::search_adl): New.
2943         (lookup_arg_dependent): Return a plain tree.  Adjust.
2944         (is_associated_namespace): Move later.
2945         
2946 2017-05-24  Nathan Sidwell  <nathan@acm.org>
2948         * friend.c (do_friend): Remove check for existing decl.
2949         * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
2950         * name-lookup.c (push_local_binding): Directly look for binding.
2951         (lookup_name_innermost_nonclass_level_1): Delete.
2952         (lookup_name_innermost_nonclass_level): Delete.
2954         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
2956         * cp-tree.h (cp_free_lang_data): Add extern.
2957         (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
2958         ATTRIBUTE_PURE.
2959         (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
2960         * typeck.c (type_unknown_p): Delete.
2961         * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
2962         overload management.
2963         (dependent_name): Likewise.
2964         (decl_anon_ns_mem_p): Simplify.
2966 2017-05-24  Jonathan Wakely  <jwakely@redhat.com>
2968         PR c++/80544
2969         * tree.c (reshape_init): Use unqualified type for direct enum init.
2970         * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
2971         (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
2972         non-class destination types.
2973         (build_const_cast_1): Strip cv-quals from destination types.
2974         (build_static_cast, build_reinterpret_cast, build_const_cast)
2975         (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
2977 2017-05-24  Martin Sebor  <msebor@redhat.com>
2979         PR c/80731
2980         * call.c (fully_fold_internal): Adjust.
2982 2017-05-24  Nathan Sidwell  <nathan@acm.org>
2984         * cp-tree.h (ovl_skip_hidden): Declare.
2985         * tree.c (ovl_skip_hidden): New.
2986         * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
2987         (lookup_arg_dependent_1): Likewise.
2988         (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
2989         (hidden_name_p, remove_hidden_names): Delete.
2990         (lookup_name_real_1): Do not strip hidden names.
2991         * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
2993         * cp-tree.h (OVL_HIDDEN_P): New.
2994         (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
2995         (ovl_iterator::reveal_node): Declare.
2996         * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
2997         (ovl_insert): Order on hiddenness.
2998         (ovl_iterator::reveal_node): New.
2999         * name-lookup.c (anticipated_builtin_p): New.
3000         (supplement_binding_1): Use it.
3001         (set_local_extern_decl_linkage): Use hidden_p.
3002         (do_pushdecl): Deal with unhiding a hidden decl, use
3003         anticipated_builtin_p.
3004         (do_nonmember_using_decl): Use anticipated_decl_p.
3005         (lookup_name_real_1): Use DECL_HIDDEN_P.
3007 2017-05-23  Jason Merrill  <jason@redhat.com>
3009         -Wunused and C++17 structured bindings
3010         * decl.c (poplevel): Don't warn about unused structured bindings,
3011         only real variables.
3012         * error.c (dump_simple_decl): Handle structured bindings.
3013         * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
3015 2017-05-23  Nathan Sidwell  <nathan@acm.org>
3017         * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
3018         * name-lookup.c (create_local_binding): New.
3019         (update_binding): New.
3020         (pushdecl_maybe_friend_1): Rename to ...
3021         (do_pushdecl): ... this.  Reimplement.
3022         (pushdecl): Adjust.
3023         (push_overloaded_decl_1, push_overloaded_decl): Delete.
3025 2017-05-23  Jason Merrill  <jason@redhat.com>
3027         PR c++/80396 - built-in for make_integer_sequence.
3028         * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
3029         (expand_integer_pack, expand_builtin_pack_call): New.
3030         (find_parameter_packs_r): Check builtin_pack_call_p.
3031         (check_for_bare_parameter_packs): Handle it.
3032         (tsubst_pack_expansion): Call expand_builtin_pack_call.
3033         (declare_integer_pack): New.
3034         (init_template_processing): Call it.
3035         * decl2.c (mark_used): Check builtin_pack_fn_p.
3037 2017-05-23  Nathan Sidwell  <nathan@acm.org>
3039         * name-lookup.c (find_namespace_binding): New.
3040         (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
3041         (set_identifier_type_value_with_scope): Use find_namespace_binding.
3042         (find_binding, cp_binding_level_find_binding_for_name,
3043         binding_for_name, namespace_binding_1): Delete.
3044         (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
3045         (get_namespace_binding, set_namespace_binding,
3046         finish_namespace_using_decl, unqualified_namespace_lookup_1,
3047         qualified_lookup_using_namespace, lookup_type_scope_1,
3048         lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
3050         PR c++/80866
3051         * parser.c (cp_parser_template_id): Keep the lookup when stashing
3052         the template_id.
3054         * cp-tree.h (DECL_HIDDEN_P): New.
3055         * name-lookup.c (set_decl_context,
3056         set_local_extern_decl_linkage): New, broken out of ...
3057         (pushdecl_maybe_friend_1): ... here.  Call them.
3059 2017-05-23  Thomas Schwinge  <thomas@codesourcery.com>
3061         * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
3062         "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
3063         "VECTOR_LENGTH".
3065 2017-05-23  Nathan Sidwell  <nathan@acm.org>
3067         * cp-tree.h (OVL_P): New.
3068         * name-lookup.h (push_local_binding): Delete.
3069         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3070         (finish_namespace_using_decl, finish_local_using_decl): ... here
3071         * name-lookup.c (add_decl_to_level): Swap args.
3072         (pop_bindings_and_leave_scope): Look inside TREE_LIST.
3073         (diagnose_name_conflict): Check contexts are same for redecl.
3074         (update_local_overload): New.
3075         (compparms_for_decl_and_using): Rename to ...
3076         (matching_fn_p): ... here.
3077         (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
3078         push_local_bindings call.
3079         (push_local_binding): Make static, replace FLAGS arg with
3080         IS_USING.
3081         (validate_nonmember_using_decl): Use OVL_FIRST.
3082         (do_nonmember_using_decl): Use in/out parameters.  Use
3083         lkp_iterator and simplify.
3084         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3085         (finish_namespace_using_decl, finish_local_using_decl): ... here.
3086         Adjust.
3087         (lookup_type_current_level): Delete.
3088         * parser.c (cp_parser_using_declaration): Adjust.
3089         * pt.c (tsubst_expr): Adjust.
3091 2017-05-22  Nathan Sidwell  <nathan@acm.org>
3093         * name-lookup.h (parse_using_directive): Replace with ...
3094         (finish_namespace_using_directive): ... this and ...
3095         (finish_local_using_directive): ... this.
3096         * name-lookup.c (add_using_namespace_1): Move later.
3097         (add_using_namespace): Move later, add namespace_p arg, remove
3098         indirect arg.
3099         (push_using_directive_1): Directly recurse.
3100         (do_using_directive, parse_using_directive): Delete, split into ...
3101         (finish_namespace_using_directive): ... this and ...
3102         (finish_local_using_directive): ... this.
3103         (push_namespace): Use add_using_namespace.
3104         * parser.c (cp_parser_using_directive): Call
3105         finish_namespace_using_directive or finish_local_using_directive.
3106         * pt.c (tsubst_expr): Call finish_local_using_directive.
3108         * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
3109         * cp-tree.h (raw_dump_id): Declare.
3110         * decl2.c (raw_dump_id): Define.
3111         (dump_tu): Use raw_dump_id.
3113         * config-lang.in (gtfiles): Sort list, break lines.
3115         * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
3116         (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
3117         ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
3118         CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
3119         CPTI_RETHROW_FN): New.
3120         (noexcept_deferred_spec): New.
3121         (terminate_node, call_unexpected_node): Rename to ...
3122         (terminate_fn, call_unexpected_fn): ... here.
3123         (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
3124         allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
3125         * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
3126         (init_exception_processing): Adjust.
3127         (declare_library_fn): Create and push the fns here.
3128         (do_get_exception_ptr, do_begin_catch, do_end_catch,
3129         do_allocate_exception_ptr, do_free_exception_ptr): Adjust
3130         declare_library_fn use.
3131         (unevaluated_noexcept_spec): Adjust.
3132         * cp-gimplify.c (genericize_eh_spec_block,
3133         gimplify_most_not_throw_expr): Adjust.
3135         * name-lookup.c (pushdecl_top_level,
3136         pushdecl_top_level_and_finish): Move after namespace pushing and
3137         popping functions.
3138         (push_to_top_level): Rename to ...
3139         (do_push_to_top_level): ... here.  Remove timing code.
3140         (pop_from_top_level_1): Rename to ...
3141         (do_pop_from_top_level): ... here.
3142         (do_push_nested_namespace, do_pop_nested_namespace)
3143         (push_to_top_level): New wrapper for do_push_to_top_level.
3144         (pop_from_top_level): Adjust.
3145         (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
3147 2017-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
3149         * config-lang.in (gtfiles): Add c-family/c-format.c,
3150         except.c, init.c, lambda.c and friend.c.
3151         * class.c (dvirt_fn): Move out of function scope,
3152         add GTY attribute.
3153         * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
3154         * init.c (fn): Likewise.
3155         * lambda.c (ptr_id, max_id): Likewise.
3156         * friend.c (global_friend): Add GTY attribute.
3158 2017-05-19  Nathan Sidwell  <nathan@acm.org>
3160         * call.c (add_list_candidates): Use OVL_FIRST.
3161         (build_new_method_call_1): Likewise.
3162         * cp-tree.h (OVL_SINGLE_P): New.
3163         (TYPE_HIDDEN_P): New.
3164         * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
3165         * dump.c (cp_tump_tree): Adjust overload dumping.
3166         * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
3167         printing.
3168         * method.c (lazily_declare_fn): Assert we added it.
3169         * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
3170         OVL_FIRST.
3171         (cp_parser_template_name): Use lkp_iterator.
3172         * pt.c (begin_template_parm_list): Fixup comment.
3173         (instantiate_class_template_1): Use TYPE_HIDDEN_P.
3174         * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
3175         (ovl_scope): Use lkp_iterator.
3177 2017-05-19  Thomas Schwinge  <thomas@codesourcery.com>
3179         * parser.c (cp_parser_omp_clause_default): Handle
3180         "OMP_CLAUSE_DEFAULT_PRESENT".
3182         * parser.c (cp_parser_omp_clause_default): Avoid printing more
3183         than one syntax error message.
3185 2017-05-19  Nathan Sidwell  <nathan@acm.org>
3187         * class.c (class_dump_id): Define.
3188         (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
3189         * cp-objcp-common.c (cp_register_dumps): New.
3190         * cp-objcp-common.h (cp_register_dumps): Declare.
3191         (LANG_HOOKS_REGISTER_DUMPS): Override.
3192         * cp-tree.h (class_dump_id): Declare.
3194 2017-05-18  Nathan Sidwell  <nathan@acm.org>
3196         * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
3197         (OVL_USED_P): New.
3198         (lookup_keep): Declare.
3199         * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
3200         * pt.c (tsubst_copy): Assert lookup is persistent.
3201         * semantics.c (finish_call_expr): Use lkp_iterator, call
3202         lookup_keep.
3203         * tree.c (ovl_copy): New.
3204         (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
3205         (lookup_keep): New.
3207         * cp-tree.h (OVL_USED): Replace with ...
3208         (OVL_USING_P): ... this.
3209         (ovl_iterator::using_p): Adjust.
3210         * name-lookup.c (push_overloaded_decl_1,
3211         do_nonmember_using_decl): Adjust.
3212         * search.c (lookup_field_r): Adjust.
3213         * tree.c (ovl_insert, ovl_scope): Adjust.
3215         * cp-tree.h (lookup_add): Swap args.
3216         (ovl_cons, build_overload): Delete.
3217         * name-lookup.c (add_function, push_overloaded_decl_1,
3218         do_nonmember_using_decl, merge_functions, remove_hidden_names):
3219         Use lookup_add, ovl_insert.
3220         * pt.c (check_explicit_specialization): Use lookup_add.
3221         (do_class_deduction): Likewise. Refactor if.
3222         * tree.c (lookup_add): Swap args.
3223         (ovl_cons, build_overload): Delete.
3225         * name-lookup.c (find_local_binding): New, broken out of ...
3226         (lookup_name_innermost_nonclass_level_1): ... here.  Call it.
3227         (set_namespace_binding): Swap scope & name args.
3228         (namespace_binding_1): Likewise.
3229         (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
3230         (push_overloaded_decl_1): Likewise.
3231         (set_global_binding): Likewise.
3232         (get_namespace_binding): Adjust namespace_binding_1 call.
3234 2017-05-17  Nathan Sidwell  <nathan@acm.org>
3236         * cp-tree.h (default_hash_traits <lang_identifier *>): New
3237         specialization.
3238         * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
3239         (extern_c_fns): New hash table.
3240         (check_extern_c_conflict): New, broken out of ...
3241         (pushdecl_maybe_friend_1): ... here.  Call it.
3242         (c_linkage_bindings): Just look in hash table.
3244 2017-05-17  Ville Voutilainen  <ville.voutilainen@gmail.com>
3246         PR c++/80654
3247         PR c++/80682
3248         Implement new C++ intrinsics __is_assignable and __is_constructible.
3249         * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
3250         (is_xible): New.
3251         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3252         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3253         * method.c (constructible_expr): Set cp_unevaluated.
3254         (is_xible_helper): New.
3255         (is_trivially_xible): Adjust.
3256         (is_xible): New.
3257         * parser.c (cp_parser_primary_expression): Handle
3258         RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
3259         (cp_parser_trait_expr): Likewise.
3260         * semantics.c (trait_expr_value): Handle
3261         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3263 2017-05-17  Nathan Sidwell  <nathan@acm.org>
3265         * cp-tree.h (ovl_iterator::using_p): New predicate.
3266         (ovl_iterator::remove_node): New worker.
3267         (ovl_insert): Declare.
3268         * tree.c (ovl_insert): New.
3269         (ovl_iterator::remove_node): New.
3270         * class.c (add_method): Use ovl_iterator, ovl_insert.
3271         (clone_function_decl): Fix description.
3272         (clone_constructors_and_destructors): Use ovl_iterator.
3274         * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
3275         (maybe_warn_about_overly_private_class): Use ovl_iterator.
3276         (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
3277         (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
3278         (get_base_fndecls): Use ovl_iterator.
3279         (warn_hidden): Use OVL_NAME, ovl_iterator.
3280         (add_implicitly_declared_members): Use ovl_iterator.
3281         * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
3282         flatten nested if.
3283         (finish_shorthand_constraint): Simplify, use ovl_make.
3284         * pt.c (make_constrained_auto): Simplify.  Use ovl_make.
3285         * search.c (shared_member_p): Use ovl_iterator.
3286         (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
3287         (lookup_conversion_operator): Use OVL_FIRST.
3288         (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
3289         (look_for_overrides_here): Use ovl_iterator.
3290         (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
3291         * typeck.c (build_x_unary_op): Use ovl_make.
3293 2017-05-17  Martin Liska  <mliska@suse.cz>
3295         * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
3296         use it instead of int type.
3297         (dump_vtable): Likewise.
3298         (dump_vtt): Likewise.
3299         * decl2.c (dump_tu): Likewise.
3301 2017-05-16  David Malcolm  <dmalcolm@redhat.com>
3303         * call.c (enforce_access): Add access_failure_info * param and use
3304         it to record access failures.
3305         * cp-tree.h (class access_failure_info): New class.
3306         (enforce_access): Add access_failure_info * param, defaulting to
3307         NULL.
3308         (lookup_member): Likewise.
3309         (locate_field_accessor): New function decl.
3310         (perform_or_defer_access_check): Add access_failure_info * param,
3311         defaulting to NULL.
3312         * search.c (lookup_member): Add access_failure_info * param and
3313         pass it on to call to perform_or_defer_access_check.
3314         (matches_code_and_type_p): New function.
3315         (field_access_p): New function.
3316         (direct_accessor_p): New function.
3317         (reference_accessor_p): New function.
3318         (field_accessor_p): New function.
3319         (struct locate_field_data): New struct.
3320         (dfs_locate_field_accessor_pre): New function.
3321         (locate_field_accessor): New function.
3322         * semantics.c (perform_or_defer_access_check): Add
3323         access_failure_info * param, and pass it on to call to
3324         enforce_access.
3325         * typeck.c (access_failure_info::record_access_failure): New method.
3326         (access_failure_info::maybe_suggest_accessor): New method.
3327         (finish_class_member_access_expr): Pass an access_failure_info
3328         instance to the lookup_member call, and call its
3329         maybe_suggest_accessor method afterwards.
3331 2017-05-16  Marek Polacek  <polacek@redhat.com>
3333         PR sanitizer/80536
3334         PR sanitizer/80386
3335         * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
3337 2017-05-16  Nathan Sidwell  <nathan@acm.org>
3339         * name-lookup.c (check_local_shadow): New, broke out of ...
3340         (pushdecl_maybe_friend_1): ... here.  Call it.
3342         * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
3343         (ovl_first): Move inline definition to end of file.
3344         (ovl_make, lookup_add): Declare.
3345         (get_fns, get_first_fn): Make pure.
3346         * tree.c (ovl_cache): New.
3347         (ovl_make, lookup_add): New.
3348         * pt.c (do_class_deduction): Don't add candidates that will be
3349         elided.
3351         * call.c (build_user_type_conversion_1): Use OVL_FIRST.
3352         (print_error_for_call_failure): Use OVL_NAME.
3353         (build_op_call_1): Use ovl_iterator.
3354         (add_candidates): Use OVL_FIRST & lkp_iterator.
3355         (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
3356         lkp_iterator.
3357         * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
3358         (type_has_user_nondefault_constructor,
3359         in_class_defaulted_default_constructor,
3360         type_has_user_provided_constructor,
3361         type_has_user_provided_or_explicit_constructor,
3362         type_has_non_user_provided_default_constructor,
3363         vbase_has_user_provided_move_assign,
3364         type_has_move_constructor, type_has_move_assign,
3365         type_has_user_declared_move_constructor,
3366         type_has_user_declared_move_assign,
3367         type_build_ctor_call, type_build_dtor_call,
3368         type_requires_array_cookie, explain_non_literal_class): Likewise.
3369         (finish_struct): Use lkp_iterator.
3370         (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
3371         (note_name_declared_in_class): Use OVL_NAME.
3372         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
3373         (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
3374         cxx_pretty_printer::expression): Likewise.
3375         * decl2.c (check_classfn): Use ovl_iterator.
3376         * pt.c (retrieve_specialization): Use ovl_iterator.
3377         * tree.c (cp_tree_equal): Use lkp_iterator.
3378         (type_has_nontrivial_copy_init): Use ovl_iterator.
3380         * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
3381         check is_overloaded_fn.
3383 2017-05-16  Martin Liska  <mliska@suse.cz>
3385         * parser.c (cp_lexer_print_token): Add default value for flags
3386         argument of print_gimple_stmt, print_gimple_expr,
3387         print_generic_stmt and print_generic_expr.
3389 2017-05-16  Nathan Sidwell  <nathan@acm.org>
3391         * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
3392         iterators.
3393         (MAYBE_BASELINK_FUNCTIONS): New.
3394         * constraint.cc (resolve_constraint_check): Use lkp_iterator.
3395         * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
3396         * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
3397         * method.c (inherited_ctor_binfo): Use ovl_iterator.
3398         (binfo_inherited_from): Likewise.
3399         * parser.c (lookup_literal_operator): Use lkp_iterator.
3400         * pt.c (iterative_hash_template_arg): Use lkp_iterator.
3401         (print_candidates_1): Likewise.
3402         (determine_specialization): Likewise.
3403         (resolve_overloaded_unification): Likewise.
3404         (resolve_nondeduced_context): Likewise.
3405         (type_dependent_expression_p): Likewise.
3406         (dependent_template_p): Likewise.
3407         * ptree.c (cxx_print_xnode): Likewise.
3408         * semantics.c (omp_reduction_lookup): Use lkp_iterator.
3409         (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
3410         * typeck.c (check_template_keyword): Use lkp_iterator.
3412         * cp-tree.h (OVL_FIRST, OVL_NAME): New.
3413         (ovl_first): New.
3414         * constexpr.c (function_concept_check): Use OVL_FIRST.
3415         * cvt.c (build_expr_type_conversion): Likewise.
3416         * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
3417         * decl2.c (mark_used): Use OVL_FIRST.
3418         * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
3419         (dump_expr, location_of): Use OVL_FIRST.
3420         * friend.c (do_friend): Use OVL_NAME.
3421         * init.c (build_offset_ref): Use OVL_FIRST.
3422         * mangle.c (write_member_name): Likewise.
3423         (write_expression): Use OVL_NAME.
3424         * method.c (strip_inheriting_ctors): Use OVL_FIRST.
3425         * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
3426         * pt.c (check_explicit_specialization): Use OVL_FIRST.
3427         (check_template_shadow): Likewise.
3428         (tsubst_template_args): Use OVL_NAME.
3429         (tsubst_baselink): Use OVL_FIRST.
3430         * semantics.c (perform_koenig_lookup): Use OVL_NAME.
3431         * tree.c (get_first_fn): Use OVL_FIRST.
3432         * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
3433         (cp_build_addr_expr_1): Use OVL_FIRST.
3435         * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
3436         peeking.
3437         * semantics.c (finish_id_expression): Directly init local var.
3438         (finish_omp_reduction_clause): Use really_overloaded_fn.
3439         * tree.c (get_fns): Document.  Assert we got an overload.
3440         (get_first_fn) Document.
3441         * typeck.c (cp_build_addr_expr_1): Pass arg directly to
3442         really_overloaded_fn.
3443         * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
3445         * cp-tree.h (SCOPE_DEPTH): New.
3446         * name-lookup.h (is_nested_namespace): Declare.
3447         * name-lookup.c (is_nested_namespace): New.
3448         (is_ancestor): Use it.
3449         (set_decl_namespace): Likewise.
3450         (push_namespace): Set SCOPE_DEPTH.
3451         * pt.c (check_specialization_namespace): Use is_nested_namespace.
3452         (check_unqualigied_spec_or_inst): Likewise.
3454 2017-05-15  Nathan Sidwell  <nathan@acm.org>
3456         PR c++/79369
3457         * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
3458         * name-lookup.h (push_namespace): Return int, add make_inline arg.
3459         * name-lookup.c (push_namespace): Deal with inline directly.
3460         Return pushed count.
3461         * parser.c (cp_parser_namespace_definition): Adjust for
3462         push_namespace change.
3464 2017-05-11  Nathan Sidwell  <nathan@acm.org>
3466         * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
3467         LANG_HOOKS_PUSHDECL): Move to ...
3468         * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
3469         LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
3470         * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
3472         * name-lookup.h (pushdecl): Add default friend parm.
3473         (pushdecl_maybe_friend): Delete.
3474         (pushdecl_top_level): Add default friend parm.
3475         (pushdecl_top_level_maybe_friend): Delete.
3476         * name-lookup.c (pushdecl_maybe_friend): Delete.
3477         (pushdecl): Add is_friend parm.
3478         (pushdecl_top_level): Add is friend_parm.
3479         (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
3480         (pushdecl_top_level_and_finish): Do pushing and finishing directly.
3481         * friend.c (do_friend): Adjust.
3482         * pt.c (tsubst_friend_class): Adjust.
3484         Revert pushdecl_top_level_and_finish name change.
3485         * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
3486         * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
3487         * decl.c (cp_make_fname_decl): Adjust.
3488         * decl2.c (get_guard, handle_tls_init):  Adjust.
3489         * rtti.c (get_tinfo_decl, tinfo_base_init):  Adjust.
3491         * name-lookup.c (pushdecl_outermost_localscope): Always
3492         conditionally stop timer.
3494         * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
3495         * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
3497         * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
3498         pushtag_top_level_maybe_friend,
3499         pushdecl_top_level_and_finish): Move declarations to ...
3500         * name-lookup.h: ... here.  Group pushdecl variants.
3501         (pushdecl_top_level_and_finish): Rename to ...
3502         (pushdecl_top_level_with_init): ... here.
3503         * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
3504         * decl2.c (get_guard, handle_tls_init): Likewise.
3505         * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
3506         * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
3507         * method.c (implicitly_declare_fn): Likewise.
3508         * searchc (node_debug_info_needed): Likewise.
3509         * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
3510         (pushdecl_top_level_with_init): ... here.
3511         (pop_everything): Use namespace_bindings_p.
3513         * name-lookup.h (pop_binding): Rename to pop_local_binding.
3514         (getdecls): Rename to get_local_decls.
3515         * name-lookup.c (pop_binding): Rename to ...
3516         (pop_local_binding): ... here.
3517         (pop_bindings_and_leave_scope): Adjust.
3518         (getdecls): Rename to ...
3519         (get_local_decls): ... here.  Assert local scope.
3520         * decl.c (poplevel): Assert not namespace.  Adjust and simplify
3521         logic.
3522         (store_parm_decls): Adjust get_local_decls call.
3523         (parser.c (synthesize_implicit_template_parm): Likewise.
3525 2017-05-11  Ville Voutilainen  <ville.voutilainen@gmail.com>
3527         PR c++/80682
3528         * method.c (is_trivially_xible): Reject void types.
3530 2017-05-10  Nathan Sidwell  <nathan@acm.org>
3532         * class.c (handle_using_decl): Always use OVL_CURRENT.
3533         (resolve_address_of_overloaded_function): Move iterator decl into
3534         for scope.  Don't strip anticipated decls here.
3536         * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
3537         printing.
3538         (print_candidates): Adjust.
3540         * cp-tree.h (build_new_function_call): Lose koenig_p arg.  Fix
3541         line breaking.
3542         * call.c (build_new_function_call): Lose koenig_p arg.  Remove
3543         koenig_p handling here.
3544         * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
3545         (tsubst_omp_clauses): Likewise.
3546         (do_class_deduction): Adjust buld_new_function_call calls.
3547         * semantics.c (finish_call_expr): Likewise.
3549 2017-05-10  Jason Merrill  <jason@redhat.com>
3551         * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
3552         (unify_type_mismatch, unify_parameter_pack_mismatch)
3553         (unify_ptrmem_cst_mismatch, unify_expression_unequal)
3554         (unify_parameter_pack_inconsistent, unify_inconsistency)
3555         (unify_vla_arg, unify_method_type_error, unify_arity)
3556         (unify_arg_conversion, unify_no_common_base)
3557         (unify_inconsistent_template_template_parameters)
3558         (unify_template_deduction_failure)
3559         (unify_template_argument_mismatch)
3560         (unify_overload_resolution_failure): Call unify_invalid.
3562         CWG 1847 - Clarifying compatibility during partial ordering
3563         * pt.c (more_specialized_fn): No order between two non-deducible
3564         parameters.
3566         * pt.c (dependent_type_p): Make sure we aren't called with
3567         global_type_node.
3569         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3570         * pt.c (convert_template_argument): Just return an argument pack.
3571         (coerce_template_parameter_pack, template_parm_to_arg)
3572         (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
3573         (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
3574         Don't set the type of a NONTYPE_ARGUMENT_PACK.
3575         * parser.c (make_char_string_pack, make_string_pack): Likewise.
3577 2017-05-10  Nathan Sidwell  <nathan@acm.org>
3579         * cp-tree.h (add_method, clone_function_decl): Change last arg to
3580         bool.
3581         * class.c (add_method): Change third arg to bool.  Adjust.
3582         (one_inheriting_sig, one_inherited_ctor): Adjust.
3583         (clone_function_decl): Change 2nd arg to bool.  Adjust.
3584         (clone_constructors_and_destructors): Adjust.
3585         * lambda.c (maybe_add_lambda_conv_op): Adjust.
3586         * method.c (lazily_declare_fn): Adjust.
3587         * pt.c (tsubst_decl, instantiate_template_1): Adjust.
3588         * semantics.c (finish_member_declaration): Adjust.
3590 2017-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
3592         PR c++/80145
3593         * decl.c (finish_function): To improve error recovery, change the
3594         logic for calling apply_deduced_return_type.
3596 2017-05-09  Jason Merrill  <jason@redhat.com>
3598         PR c++/80605 - __is_standard_layout and empty base
3599         * class.c (check_bases): Ignore empty bases.
3601         PR c++/70979 - literal class and closure types
3602         * class.c (finalize_literal_type_property): Handle closures
3603         specifically.
3604         (explain_non_literal_class): Likewise.
3606         PR c++/66297, DR 1684 - literal class and constexpr member fns
3607         * constexpr.c (is_valid_constexpr_fn): Only complain about
3608         non-literal enclosing class in C++11.
3609         * class.c (finalize_literal_type_property): Likewise.
3611 2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
3613         PR c++/80186
3614         * pt.c (tsubst_decl): Early return error_mark_node if
3615         grok_ctor_properties returns false.
3617 2017-05-09  Jason Merrill  <jason@redhat.com>
3619         PR c++/70167 - array prvalue treated as lvalue
3620         * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
3621         (enum fcl_t): New.
3622         * semantics.c (finish_compound_literal): Add fcl_context parameter.
3623         Only make a static variable for C99 syntax.
3624         * parser.c (cp_parser_postfix_expression): Pass it.
3625         * pt.c (tsubst_copy_and_build): Likewise.
3626         * call.c (extend_ref_init_temps): Set
3627         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
3629 2017-05-09  Nathan Sidwell  <nathan@acm.org>
3631         * cp-lang.c (get_global_decls, cxx_pushdecl): New.
3632         (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
3633         * name-lookup.h (pushdecl_top_level): Declare.
3635 2017-05-08  Jason Merrill  <jason@redhat.com>
3637         PR c++/80178 - parameter passing for uncopyable classes
3638         * tree.c (type_has_nontrivial_copy_init): True for classes with only
3639         deleted copy/move ctors.
3640         (remember_deleted_copy, maybe_warn_parm_abi): New.
3641         * decl.c (require_complete_types_for_parms, check_function_type):
3642         Call maybe_warn_parm_abi.
3643         * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
3645 2017-05-08  Nathan Sidwell  <nathan@acm.org>
3647         * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
3648         (start_preparsed_function): Do decl pushing before setting
3649         current_funciton_decl and announcing it.
3651         * name-lookup.h (pushdecl_with_scope): Replace with ...
3652         (pushdecl_outermost_localscope): ... this.
3653         * name-lookup.c (pushdecl_with_scope): Replace with ...
3654         (pushdecl_outermost_localscope): ... this.
3655         (pushdecl_namespace_level): Adjust.
3656         * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
3657         * lambda.c (insert_capture_proxy): Likewise.
3659         * class.c (build_vtbl_initializer): Don't shadow outer variable
3660         with static var.
3662         Revert _binding -> _value change.
3663         * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
3664         (get_namespace_binding, set_global_binding): ... these.
3665         * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
3666         (get_namespace_binding, set_global_binding): ... these.
3667         (arg_assoc_namespace, pushdecl_maybe_friend_1,
3668         check_for_out_of_scope_variable, push_overloaded_decl_1,
3669         lookup_name_innermost_nonclass_level, push_namespace): Adjust.
3670         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
3671         SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
3672         * decl.c (poplevel): Adjust.
3673         * pt.c (make_constrained_auto): Likewise.
3675 2017-05-07  Volker Reichelt  <v.reichelt@netcologne.de>
3677         PR translation/80280
3678         * call.c (print_z_candidate): Fix quoting.
3680 2017-05-05  David Malcolm  <dmalcolm@redhat.com>
3682         * error.c (pedwarn_cxx98): Replace report_diagnostic
3683         with diagnostic_report_diagnostic.
3685 2017-05-05  Nathan Sidwell  <nathan@acm.org>
3687         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
3688         (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
3689         (IDENTIFIER_NAMESPACE_VALUE): Delete.
3690         * name-lookup.h (namespace_binding, set_namespace_binding): Replace
3691         with ...
3692         (get_namespace_value, set_global_value): ... these.
3693         (get_global_value_if_present, is_typename_at_global_scope): Delete.
3694         * decl.c (poplevel): Use get_namespace_value.
3695         (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
3696         * class.c (build_vtbl_initializer): Stash library decl in
3697         static var. Use IDENTIFIER_GLOBAL_VALUE.
3698         * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
3699         do_allocate_exception, do_free_exception, build_throw): Likewise.
3700         * init.c (throw_bad_array_new_length): Likewise.
3701         * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
3702         * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
3703         check_for_our_of_scope_variable, push_overloaded_decl_1): Use
3704         get_namespace_value.
3705         (set_namespace_binding_1): Rename to
3706         (set_namespace_binding): ... here.
3707         (set_global_value): New.
3708         (lookup_name_innermost_nonclass_level_1, push_namespace): Use
3709         get_namespace_value.
3710         * pt.c (listify): Use get_namespace_value.
3712         * call.c (make_temporary_var_for_ref_to_temp): Push decl into
3713         current scope.
3714         * lex.c (unqualified_name_lookup_error): Likewise.
3716         * class.c (alter_class): Use retrofit_lang_decl directly.
3717         * decl.c (push_local_name, dupliate_decls): Likewise.
3718         * semantics.c (omp_privatize_field): Likewise.
3720         Kill walk_namespaces.
3721         * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
3722         * decl.c (walk_namespaces_r, walk_namespaces): Delete.
3724         Kill per-namespace static_decls.
3725         * cp-tree.h (static_decls): Declare.
3726         (wrapup_globals_for_namespace,
3727         diagnose_inline_vars_for_namespace): Replace with ...
3728         (wrapup_namespace_globals): ... this.
3729         * decl.c (static_decls): Define.
3730         (wrapup_globals_for_namespace,
3731         diagnose_inline_vars_for_namespace): Replace with ...
3732         (wrapup_namespace_globals): ... this.
3733         (cxx_init_decl_processing): Initialize static_decls.
3734         * decl2.c (c_parse_final_cleanups): Adjust.
3735         * name-lookup.h (cp_binding_level): Remove static_decls member.
3736         * name-lookup.c (add_decl_to_level): Adjust.
3737         (begin_scope): Adjust.
3739 2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
3741         PR c++/71577
3742         * decl.c (reshape_init): Unconditionally return error_mark_node
3743         upon error about too many initializers.
3745 2017-05-04  Nathan Sidwell  <nathan@acm.org>
3747         * constraint.cc (diagnose_check_constraint): Fix %E thinko.
3749 2017-05-04  Martin Sebor  <msebor@redhat.com>
3751         PR translation/80280
3752         * call.c (print_z_candidate): Add missing quoting to %D and other
3753         like directives.
3754         (build_op_call_1): Same.
3755         * constraint.cc (diagnose_check_constraint): Same.
3756         * mangle.c (mangle_decl): Same.
3757         * name-lookup.c (cp_binding_level_debug): Same.
3758         (set_decl_namespace): Same.
3759         * parser.c (cp_parser_tx_qualifier_opt): Same.
3760         * pt.c (print_candidates_1): Same.
3761         (check_template_variable): Same.
3762         (tsubst_default_argument): Same.
3763         (most_specialized_partial_spec): Same.
3764         * semantics.c (omp_reduction_lookup): Same.
3765         * tree.c (check_abi_tag_redeclaration): Same.
3766         * typeck.c (comptypes): Same.
3767         * typeck2.c (abstract_virtuals_error_sfinae): Same.
3769 2017-05-04  Nathan Sidwell  <nathan@acm.org>
3771         More global trees.
3772         * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
3773         CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
3774         CPTI_INIT_LIST_IDENTIFIER.
3775         (global_namespace, global_type_node, global_identifier,
3776         anon_identifier, init_list_identifier): New.
3777         * decl.c (global_type_node, global_scope_name): Delete.
3778         (initialize_predefined_identifiers): Add new identifiers.
3779         (cxx_init_decl_processing): Adjust.
3780         * name-lookup.h (global_namespace, global_type_node): Delete.
3781         * name-lookup.c (global_namespace, anonymous_namespace_name,
3782         get_anonymous_namespace_name): Delete.
3783         (namespace_scope_ht_size, begin_scope, pushtag_1,
3784         push_namespace): Adjust,
3785         * call.c (type_has_extended_temps): Use init_list_identifier.
3786         * pt.c (listify): Likewise.
3788         * name-lookup.c: Reorder functions to make merging from modules
3789         branch simpler.
3791 2017-05-03  Jason Merrill  <jason@redhat.com>
3793         * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
3795 2017-05-03  Nathan Sidwell  <nathan@acm.org>
3797         * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
3798         along with #defines, to before name-lookup include.
3800 2017-05-02  Paolo Carlini  <paolo.carlini@oracle.com>
3802         * pt.c (is_auto_or_concept): Remove.
3803         (type_uses_auto_or_concept): Remove, unused.
3804         (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
3805         * parser.c (tree_type_is_auto_or_concept): Remove, unused.
3806         * cp-tree.h (is_auto_or_concept): Remove.
3808 2017-05-01  Xi Ruoyao  <ryxi@stu.xidian.edu.cn>
3810         PR c++/80038
3811         * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
3812         add pedigree operation and detach call here.
3813         * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
3814         cilk_cp_gimplify_call_params_in_spawned_fn.
3815         (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
3816         * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
3818 2017-04-29  Volker Reichelt  <v.reichelt@netcologne.de>
3820         * parser.c (cp_parser_member_declaration): Add fix-it hints for
3821         stray comma and missing semicolon at end of member declaration.
3823 2017-04-27  Volker Reichelt  <v.reichelt@netcologne.de>
3825         * parser.c (cp_parser_cast_expression): Add target type of cast to
3826         diagnostic.
3827         * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
3829 2017-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
3831         * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
3832         return type to bool.
3833         * cp-tree.h (grok_ctor_properties): Update.
3835 2017-04-26  Volker Reichelt  <v.reichelt@netcologne.de>
3837         * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
3838         information to diagnostic of invalid colon in nested-name-specifier.
3840 2017-04-25  Volker Reichelt  <v.reichelt@netcologne.de>
3842         * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
3843         diagnostic of invalid class/struct keyword after enum.
3845 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
3847         * parser.c (cp_parser_member_declaration): Add fix-it hint
3848         for removing stray semicolons.
3850 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
3852         * name-lookup.c (get_std_name_hint): New function.
3853         (maybe_suggest_missing_header): New function.
3854         (suggest_alternative_in_explicit_scope): Call
3855         maybe_suggest_missing_header.
3857 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
3859         PR c++/80177
3860         * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
3861         candidate type of bm from tree to const char *.
3862         (consider_binding_level): Likewise.
3863         (lookup_name_fuzzy): Likewise, using this to merge the best
3864         result from the preprocessor into bm, rather than immediately
3865         returning, so that better matches from reserved words can "win".
3866         Guard the rejection of keywords that don't start decl-specifiers
3867         so it only happens for FUZZY_LOOKUP_TYPENAME.
3869 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
3871         * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
3872         (start_enum): Likewise.
3873         (build_enumerator): Likewise. Use %qE instead of plain %E.
3874         * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
3875         %<%D%> in diagnostics.
3876         (cp_parser_elaborated_type_specifier): Likewise.
3877         * pt.c (make_pack_expansion): Use %qT and %qE instead of
3878         %<%T%> and %<%E%> in diagnostics.
3879         (tsubst_pack_expansion): Likewise.
3881 2017-04-24  David Malcolm  <dmalcolm@redhat.com>
3883         PR c++/80016
3884         * parser.c (cp_parser_unary_expression):  Generate a location
3885         range for alignof and sizeof expressions.
3887 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
3889         * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
3890         error message.
3891         (cp_parser_virt_specifier_seq_opt): Likewise.
3892         (set_and_check_decl_spec_loc): Likewise twice.
3894 2017-04-21  Jason Merrill  <jason@redhat.com>
3896         PR c++/80179 - ICE with initialized flexible array member.
3897         * constexpr.c (verify_ctor_sanity): Handle flexible array members.
3899 2017-04-21  Richard Biener  <rguenther@suse.de>
3901         * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
3902         (copy_type): Likewise.
3903         * lex.c (copy_decl): Pass down mem-stat info.
3904         (copy_type): Likewise.
3906 2017-04-20  Jonathan Wakely  <jwakely@redhat.com>
3908         PR c++/80473
3909         * init.c (build_new_1): Suppress notes about over-aligned new when
3910         the warning is suppressed.
3912 2017-04-20  Volker Reichelt  <v.reichelt@netcologne.de>
3914         * parser.c (cp_parser_member_declaration): Add warning with fixit
3915         information for extra semicolon after in-class function definition.
3917 2017-04-20  Jakub Jelinek  <jakub@redhat.com>
3919         PR middle-end/80423
3920         * tree.c (build_cplus_array_type): Call build_array_type
3921         with the intended TYPE_TYPELESS_STORAGE flag value, instead
3922         of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
3923         on the shared type.
3925 2017-04-18  Marek Polacek  <polacek@redhat.com>
3927         PR c++/80244 - ICE with attribute in template alias.
3928         * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
3930         PR c++/80241 - ICE with alignas pack expansion.
3931         * error.c (dump_expr): Handle TREE_LIST.
3932         * parser.c (cp_parser_std_attribute_list): Return error_mark if
3933         make_pack_expansion returns an error.
3935 2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>
3937         PR c++/80287
3938         * class.c (fixup_may_alias): Fix all type variants.
3940 2017-04-17  Jason Merrill  <jason@redhat.com>
3942         PR c++/80415 - wrong error with default arg and array reference.
3943         * tree.c (lvalue_kind): Return clk_class for an array prvalue.
3945         * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
3947 2017-04-15  Alexandre Oliva <aoliva@redhat.com>
3949         * decl.c (name_unnamed_type): Split out of...
3950         (grokdeclarator): ... this.
3951         * decl.h (name_unnamed_type): Declare.
3953 2017-04-12  Richard Biener  <rguenther@suse.de>
3954         Bernd Edlinger  <bernd.edlinger@hotmail.de>
3956         PR middle-end/79671
3957         * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
3958         for arrays of character or std::byte type.
3960 2017-04-11  Jason Merrill  <jason@redhat.com>
3962         PR c++/80294 - ICE with constexpr and inheritance.
3963         * constexpr.c (reduced_constant_expression_p):
3964         A null constructor element is non-constant.
3965         (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
3966         returning an empty base.
3968 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
3970         PR c++/80370
3971         * decl.c (cp_finish_decomp): If processing_template_decl on
3972         non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
3973         change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
3974         sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
3975         processing.
3976         * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
3977         with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
3978         dependent.
3980 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
3982         PR c++/80363
3983         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
3985 2017-04-10  Jakub Jelinek  <jakub@redhat.com>
3987         PR c++/80176
3988         * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
3989         operand, if it is a static member function, recurse on the
3990         BASELINK.
3992 2017-04-10  Marek Polacek  <polacek@redhat.com>
3994         PR sanitizer/80348
3995         * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
3996         ORIG_TYPE earlier and not only when shortening.
3998 2017-04-07  Jason Merrill  <jason@redhat.com>
4000         PR c++/80356 - ICE with reference to function template argument.
4001         PR c++/79294
4002         * pt.c (convert_nontype_argument_function): Adjust type even with a
4003         value-dependent argument.
4005         PR c++/80267 - ICE with nested capture of reference
4006         PR c++/60992
4007         * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
4009 2017-04-07  Marek Polacek  <polacek@redhat.com>
4011         PR sanitizer/80348
4012         * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
4014         PR c++/80095
4015         * call.c (build_over_call): Don't check cxx_dialect.
4016         * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
4017         whether SUB is a CONSTRUCTOR.
4018         * init.c (build_new_1): Don't check cxx_dialect.
4019         * tree.c (replace_placeholders): Add a function comment.  Return if
4020         not in C++14, or if the object isn't a (member of a) class.
4021         * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
4022         TYPE is CLASS_TYPE_P.
4024 2017-04-05  Jakub Jelinek  <jakub@redhat.com>
4026         PR c++/80309
4027         * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
4028         of a loop doing vec_safe_push of NULL.  Formatting fixes.
4029         (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
4030         to newidx before calling canonical_type_parameter on newtype.
4032 2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
4034         PR c++/80296
4035         * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
4036         UNARY_PLUS_EXPR case.
4038 2017-04-03  Jason Merrill  <jason@redhat.com>
4040         * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
4042 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
4044         * class.c (update_vtable_entry_for_fn): Fix typo in comment.
4045         * decl2.c (one_static_initialization_or_destruction): Likewise.
4046         * name-lookup.c (store_bindings): Likewise.
4047         * parser.c (make_call_declarator): Likewise.
4048         * pt.c (check_explicit_specialization): Likewise.
4050 2017-04-03  Jason Merrill  <jason@redhat.com>
4052         PR sanitizer/79993 - ICE with VLA initialization from string
4053         PR c++/69487 - wrong VLA initialization from string
4054         * init.c (finish_length_check): Split out from build_vec_init.
4055         (build_vec_init): Handle STRING_CST.
4056         * typeck2.c (split_nonconstant_init): Handle STRING_CST.
4057         (digest_init_r): Don't give a STRING_CST VLA type.
4059 2017-03-31  Jakub Jelinek  <jakub@redhat.com>
4061         PR c++/79572
4062         * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
4063         REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
4064         for NOP_EXPR to REFERENCE_TYPE.
4066         PR libstdc++/80251
4067         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
4068         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
4069         CPTK_IS_AGGREGATE.
4070         * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
4071         Remove extraneous parens.
4072         (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
4073         * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
4074         (cp_parser_trait_expr): Likewise.
4076 2017-03-27  Jakub Jelinek  <jakub@redhat.com>
4078         PR middle-end/80162
4079         * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
4080         * typeck.c (cxx_mark_addressable): Likewise.  Look through
4081         VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
4082         to ARRAY_TYPE.
4083         (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
4085 2017-03-24  Jason Merrill  <jason@redhat.com>
4087         PR c++/77339 - ICE with invalid use of alias template.
4088         * pt.c (lookup_template_class_1): Don't try to enter the scope of an
4089         alias template.
4091 2017-03-24  Marek Polacek  <polacek@redhat.com>
4093         PR c++/80119
4094         * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
4095         doesn't have side effects.
4097 2017-03-23  Jason Merrill  <jason@redhat.com>
4099         PR c++/80150 - ICE with overloaded variadic deduction.
4100         * pt.c (try_one_overload): Remove asserts.
4102         PR c++/77563 - missing ambiguous conversion error.
4103         * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
4105 2017-03-23  Marek Polacek  <polacek@redhat.com>
4107         * cp-tree.h: Remove a C_RID_YYCODE reference.
4109 2017-03-22  Jakub Jelinek  <jakub@redhat.com>
4111         PR c++/80141
4112         * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
4113         case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
4114         processing_template_decl.
4116 2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
4118         PR c++/77752
4119         * name-lookup.c (pushtag_1): Add check for bogus, non template,
4120         std::initializer_list.
4122 2017-03-21  Jakub Jelinek  <jakub@redhat.com>
4124         PR c++/35878
4125         * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
4127 2017-03-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
4129         PR c++/35878
4130         * init.c (std_placement_new_fn_p): New.
4131         (build_new_1): Call it.
4133 2017-03-20  Jason Merrill  <jason@redhat.com>
4135         PR c++/80096 - ICE with C++17 non-type auto.
4136         * pt.c (tsubst): Delay tsubst of type of template non-type
4137         parameter.
4139         PR c++/79519 - ICE with deleted template friend.
4140         * decl.c (grokdeclarator): Complain about misplaced function
4141         definition using =, as well.
4143         PR c++/79640 - infinite recursion with generic lambda.
4144         * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
4145         before substituting its initializer.
4147 2017-03-20  Marek Polacek  <polacek@redhat.com>
4148             Paolo Carlini  <paolo.carlini@oracle.com>
4150         PR c++/80059 - ICE with noexcept and __transaction_atomic
4151         * except.c (build_must_not_throw_expr): Call
4152         instantiate_non_dependent_expr.
4154 2017-03-19  Jason Merrill  <jason@redhat.com>
4156         PR c++/80084 - wrong C++17 decomposition by reference of parameter.
4157         * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
4158         reference decomposition.
4160         PR c++/80077 - error with constexpr and -fno-elide-constructors.
4161         * constexpr.c (cxx_eval_call_expression): Set ctx->call while
4162         expanding trivial constructor.
4164 2017-03-17  Jason Merrill  <jason@redhat.com>
4166         PR c++/78345 - ICE initializing array from lambda.
4167         * init.c (build_aggr_init): Check array initializer.
4168         (build_vec_init): Check the type of a CONSTRUCTOR.
4170         PR c++/80073 - C++17 ICE with virtual base.
4171         * decl.c (xref_basetypes): Also check for indirect vbases.
4173 2017-03-16  Jason Merrill  <jason@redhat.com>
4175         * decl.c (start_enum): std::byte aliases anything.
4177         PR c++/79797
4178         * constexpr.c (lookup_placeholder): Tweak.
4180 2017-03-15  Jason Merrill  <jason@redhat.com>
4182         PR c++/80043 - ICE with -fpermissive
4183         * typeck.c (convert_for_assignment): Handle instantiate_type
4184         not giving an error.
4186 2017-03-14  Nathan Sidwell  <nathan@acm.org>
4188         PR c++/79393 DR 1658 workaround
4189         * method.c (synthesized_method_base_walk): Inihibit abstract class
4190         virtual base access check here.
4191         (synthesized_method_walk): Not here.
4193 2017-03-13  Nathan Sidwell  <nathan@acm.org>
4195         PR c++/79393 DR 1658 workaround
4196         * method.c (synthesized_method_walk): Check vbases of abstract
4197         classes for dtor walk.
4199 2017-03-10  David Malcolm  <dmalcolm@redhat.com>
4201         PR translation/79848
4202         * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
4204 2017-03-10  Jason Merrill  <jason@redhat.com>
4206         PR c++/79960 - alias templates and partial ordering
4207         * pt.c (comp_template_args): Add partial_order parm.
4208         (template_args_equal): Likewise.
4209         (comp_template_args_porder): New.
4210         (get_partial_spec_bindings): Use it.
4212 2017-03-10  Marek Polacek  <polacek@redhat.com>
4214         PR c++/79967
4215         * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
4217 2017-03-10  Jakub Jelinek  <jakub@redhat.com>
4219         PR c++/79899
4220         * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
4221         Use XALLOCAVEC macro.
4223         PR c++/79896
4224         * decl.c (finish_enum_value_list): If value is error_mark_node,
4225         don't copy it and change its type.
4226         * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
4227         of CONST_DECL is error_mark_node.
4229 2017-03-09  Marek Polacek  <polacek@redhat.com>
4231         PR c++/79900 - ICE in strip_typedefs
4232         * tree.c (strip_typedefs): Skip the attribute handling if T is
4233         a variant type which hasn't been updated yet.
4235         PR c++/79687 - wrong code with pointer-to-member
4236         * init.c (constant_value_1): Break if the variable has a dynamic
4237         initializer.
4239 2017-03-08  Jason Merrill  <jason@redhat.com>
4241         PR c++/79797 - ICE with self-reference in array DMI.
4242         * constexpr.c (lookup_placeholder): Split out...
4243         (cxx_eval_constant_expression): ...from here.
4245 2017-03-07  Jakub Jelinek  <jakub@redhat.com>
4247         PR c/79834
4248         * parser.c (cp_parser_omp_cancellation_point,
4249         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
4250         cp_parser_omp_target_update): Change "may only be used in compound
4251         statements" diagnostics, such that the same translatable string is
4252         used for all pragmas.
4253         (cp_parser_pragma): Likewise.  Use error_at instead of
4254         cp_parser_error for that diagnostics.
4256 2017-03-06  Marek Polacek  <polacek@redhat.com>
4258         PR c++/79796 - ICE with NSDMI and this pointer
4259         * call.c (build_over_call): Handle NSDMI with a 'this' by calling
4260         replace_placeholders.
4262 2017-03-06  Jakub Jelinek  <jakub@redhat.com>
4264         PR c++/79822
4265         * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
4266         ({ (void) 0; }).
4268 2017-03-06  Jason Merrill  <jason@redhat.com>
4270         Revert "Allow deduction guides to look into primary template."
4271         * cp-tree.h, parser.c, pt.c, search.c: Revert.
4273 2017-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
4275         PR c++/70266
4276         * except.c (build_must_not_throw_expr): Perform the implicit
4277         conversions on the condition.
4279 2017-03-03  Jason Merrill  <jason@redhat.com>
4281         * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
4282         -Wc++1z-compat.
4284         Core issues 2273 and 2277
4285         * call.c (joust): Adjust using-declaration tiebreaker to handle
4286         the intermediate base case.
4287         * method.c (strip_inheriting_ctors): Just return the argument if
4288         !flag_new_inheriting_ctors.
4290 2017-03-03  Richard Biener  <rguenther@suse.de>
4292         PR c++/79825
4293         * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
4295 2017-03-03  Marek Polacek  <polacek@redhat.com>
4297         PR c++/79791
4298         * typeck.c (string_conv_p): In C++11, always call pedwarn with
4299         OPT_Wwrite_strings.
4301 2017-03-02  Jason Merrill  <jason@redhat.com>
4303         Update overload resolution with deduction guides.
4304         * pt.c (do_class_deduction): Always build the copy guide.
4305         (copy_guide_p, template_guide_p): New.
4306         (build_deduction_guide): Remember the original constructor.
4307         * call.c (joust): Prefer the copy guide and non-template guides.
4309         Allow deduction guides to look into primary template.
4310         * cp-tree.h (struct saved_scope): Add deduction_guide_type.
4311         (struct cp_decl_specifier_seq): Add constructor_p.
4312         * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
4313         (cp_parser_init_declarator): Check it.  Set ctor_dtor_or_conv_p.
4314         Clear deduction_guide_type.  Don't handle deduction guide names.
4315         (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
4316         (cp_parser_direct_declarator): Likewise.  Handle deduction guides.
4317         (cp_parser_member_declaration, cp_parser_cache_defarg)
4318         (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
4319         * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
4320         (build_deduction_guide): Set deduction_guide_type.
4321         (dependent_scope_p): Check deduction_guide_type.
4322         * search.c (lookup_member): Likewise.
4324 2017-03-02  Jakub Jelinek  <jakub@redhat.com>
4326         PR c++/79782
4327         * init.c (mark_exp_read_r): New function.
4328         (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
4329         whole arguments instead of plain mark_exp_read on TREE_LIST values.
4331 2017-03-01  Jason Merrill  <jason@redhat.com>
4333         Class template argument deduction in new-expression
4334         * init.c (build_new): Handle deduction from no initializer.
4335         * parser.c (cp_parser_new_expression): Don't require a single
4336         expression for class template deduction.
4337         * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
4338         class template placeholder.
4339         * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
4340         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
4341         (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
4343 2017-03-01  Jakub Jelinek  <jakub@redhat.com>
4345         PR c++/79746
4346         * init.c (emit_mem_initializers): When not constructing vbases of
4347         abstract classes, mark arguments as read for
4348         -Wunused-but-set-parameter.
4350 2017-02-28  Jason Merrill  <jason@redhat.com>
4352         Class template argument deduction refinements
4353         * call.c (joust): Move deduction guide tiebreaker down.
4354         * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
4355         deduction with no initializer.
4356         * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
4357         (do_class_deduction): Use that rather than special case.
4358         (do_auto_deduction): Handle null initializer.
4360 2017-02-28  Jakub Jelinek  <jakub@redhat.com>
4362         * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
4363         instead of just cond ? "..." : "...".
4364         (grokdeclarator): Likewise.
4365         (build_enumerator): Likewise.
4366         * init.c (build_new_1): Likewise.
4367         * call.c (build_new_method_call_1): Likewise.
4368         * parser.c: Include intl.h.
4369         (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
4370         "enter"/"exit" keyword.
4371         (cp_finalize_oacc_routine): Don't use %s to supply portions of the
4372         message.
4374 2017-02-27  Jason Merrill  <jason@redhat.com>
4376         PR c++/71568 - SFINAE forming pointer to member function
4377         * init.c (build_offset_ref): Check the return value of
4378         perform_or_defer_access_check.
4380 2017-02-27  Marek Polacek  <polacek@redhat.com>
4382         * decl.c (expand_static_init): Add missing } in a comment.
4384 2017-02-27  Volker Reichelt  <v.reichelt@netcologne.de>
4386         * init.c: Include intl.h.
4387         (build_new_1): Move message strings into pedwarn to make them
4388         -Wformat-security friendly. Mark string for translation.
4389         * pt.c (tsubst_copy_and_build): Mark string for translation.
4390         Make the pointer const.
4391         * semantics.c (finish_id_expression): Mark strings for translation.
4393 2017-02-25  Jakub Jelinek  <jakub@redhat.com>
4395         * call.c (build_op_delete_call): Make msg1 and msg2 const.
4397 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
4399         PR c++/79588
4400         * call.c (build_over_call): Call check_function_arguments even for
4401         -Wrestrict, adjust check_function_arguments caller.
4402         * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
4403         here.
4404         * typeck.c (cp_build_function_call_vec): Adjust
4405         check_function_arguments caller.
4407 2017-02-24  Marek Polacek  <polacek@redhat.com>
4409         PR translation/79705
4410         * decl.c (check_redeclaration_exception_specification): Mark a string
4411         for translation.  Make the pointer const.
4413 2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>
4415         PR c++/79361
4416         * pt.c (register_specialization): Check duplicate_decls return value
4417         for error_mark_node and pass it back.
4419 2017-02-22  Jason Merrill  <jason@redhat.com>
4421         PR c++/79679 - missing destructor for argument
4422         * call.c (build_over_call): Don't pass tf_no_cleanup to argument
4423         conversions.
4425         * pt.c (do_class_deduction): Handle 0 argument case.
4427 2017-02-22  Jakub Jelinek  <jakub@redhat.com>
4429         PR c++/79664
4430         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
4431         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
4432         * constexpr.c (potential_constant_expression_1): Handle
4433         OMP_*, OACC_* and CILK_* trees.  Use error_at with
4434         EXPR_LOC_OR_LOC (t, input_location) computed early
4435         instead of error, or error_at with location_of (t).
4437 2017-02-22  Marek Polacek  <polacek@redhat.com>
4439         PR c++/79653
4440         * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
4441         if the alignas expression is erroneous.
4442         * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
4443         error_mark_node.
4445         PR c++/79657
4446         * semantics.c (finish_underlying_type): Bail out for incomplete enums.
4448 2017-02-21  Jason Merrill  <jason@redhat.com>
4450         PR c++/50308 - wrong deprecated warning with ADL
4451         PR c++/17729 - duplicate deprecated warning
4452         * semantics.c (finish_id_expression): Only call mark_used on a
4453         function if we aren't building a call.
4455         PR c++/41727 - ICE with partial spec of partial instantiation
4456         * pt.c (process_partial_specialization): For now, don't check more
4457         specialized if there is more than one level of args.
4459 2017-02-21  Marek Polacek  <polacek@redhat.com>
4461         PR c++/79535
4462         * cp-tree.h (maybe_reject_flexarray_init): Declare.
4463         * init.c (maybe_reject_flexarray_init): No longer static.
4464         Add check for current_function_decl.
4465         * parser.c (cp_parser_late_parse_one_default_arg): Reject
4466         a default mem-initializer for a flexible array.
4468 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
4469             Paolo Carlini  <paolo.carlini@oracle.com>
4471         PR c++/79654
4472         * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
4473         on error.
4474         * pt.c (tsubst_decomp_names): Return error_mark_node if the first
4475         decl after the decomposition artificial decl has error_mark_node.
4476         * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
4477         instead of just == error_mark_node comparison.
4479 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
4481         PR sanitizer/79589
4482         * decl.c: Include gimplify.h.
4483         (cp_finish_decomp): Make sure there is no sharing of trees
4484         in between DECL_VALUE_EXPR of decomposition decls.
4486         PR c++/79655
4487         * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
4489         PR c++/79639
4490         * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
4491         call cplus_expand_constant on it first.
4493 2017-02-19  Jason Merrill  <jason@redhat.com>
4495         PR c++/78139 - destructor needed by new-expression
4496         * call.c (build_special_member_call): Use tf_no_cleanup.
4498         PR c++/78282 - auto template and pack expansion
4499         * pt.c (find_parameter_packs_r): Don't walk into the type of
4500         templates other than template template-parameters.
4502         PR c++/79606 - ICE with this->base_member in NSDMI
4503         * class.c (build_base_path): Check processing_template_decl.
4505         PR c++/79607 - ICE with T{} initializer
4506         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
4508         PR c++/79566 - elaborated-type-specifier in range for
4509         * parser.c (cp_parser_simple_declaration): Fix check for type
4510         definition.
4512         PR c++/79400 - confusing suggestion of 'noexcept'
4513         * parser.c (cp_parser_exception_specification_opt): Remove
4514         suggestion for deprecated dynamic exception-specification.
4516         PR c++/79470 - partial ordering with reference parameters
4517         * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
4519         PR c++/79500 - ICE with non-template deduction guide
4520         * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
4521         DECL_TEMPLATE_RESULT.
4523         PR c++/79580 - ICE with compound literal
4524         * parser.c (cp_parser_class_head): If we're in the middle of an
4525         expression, use ts_within_enclosing_non_class.
4527         PR c++/79503 - inherited ctor taking base class
4528         * call.c (add_function_candidate): Also check that
4529         DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
4531 2017-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
4533         PR c++/79380
4534         * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
4535         argument.
4537 2017-02-19  Eric Fiselier  <eric@efcs.ca>
4538             Jonathan Wakely  <jwakely@redhat.com>
4540         PR c++/69523
4541         * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
4542         control warning about literal suffix identifiers without a leading
4543         underscore.
4545 2017-02-17  Jason Merrill  <jason@redhat.com>
4547         PR c++/79508 - lookup error with member template
4548         * parser.c (cp_parser_template_name): Clear
4549         parser->context->object_type if we aren't doing lookup.
4551         PR c++/78690 - ICE with using and global type with same name
4552         * pt.c (type_dependent_object_expression_p): True for
4553         IDENTIFIER_NODE.
4555         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
4556         * pt.c (convert_template_argument): Just return an auto arg pack.
4557         (tsubst_template_args): Don't tsubst an auto pack type.
4559         PR c++/79556 - C++17 ICE with non-type auto
4560         * pt.c (do_auto_deduction): Don't try to deduce from null type.
4562         PR c++/79533 - C++17 ICE with temporary cast to reference
4563         * call.c (build_over_call): Conversion to a reference prevents copy
4564         elision.
4566 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
4567             Jason Merrill  <jason@redhat.com>
4569         PR c++/79502 - lost nodiscard attribute
4570         * pt.c (apply_late_template_attributes): Do apply non-dependent
4571         attributes to types.
4573 2017-02-16  Jason Merrill  <jason@redhat.com>
4575         PR c++/78572 - ICE with self-modifying array initializer
4576         * constexpr.c (cxx_eval_store_expression): The object we're
4577         initializing is outside the constant-expression.
4578         (cxx_eval_call_expression): Set ctx->call.
4580         PR c++/79050 - ICE with undeduced auto and LTO
4581         * decl.c (poplevel): Remove undeduced auto decls.
4583 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
4585         PR c++/79512
4586         * parser.c (cp_parser_omp_target): For -fopenmp-simd
4587         ignore #pragma omp target even when not followed by identifier.
4589 2017-02-15  Jason Merrill  <jason@redhat.com>
4590             Jakub Jelinek  <jakub@redhat.com>
4592         PR c++/79464 - ICE in IPA with omitted constructor parms
4593         * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
4594         (adjust_clone_args): Adjust.
4595         (add_method): Remember omitted parms.
4596         * call.c (add_function_candidate): Likewise.
4597         * mangle.c (write_method_parms): Likewise.
4598         * method.c (ctor_omit_inherited_parms): Return false if there are no
4599         parms to omit.
4601 2017-02-15  Martin Sebor  <msebor@redhat.com>
4603         PR c++/79363
4604         * init.c (maybe_reject_flexarray_init): New function.
4605         (perform_member_init): Call it.
4607 2017-02-15  Jakub Jelinek  <jakub@redhat.com>
4609         PR c++/79301
4610         * parser.c (cp_parser_std_attribute): Don't pedwarn about
4611         [[deprecated]] with -std=c++11 and [[fallthrough]] with
4612         -std=c++11 and -std=c++14.
4614         PR c++/79288
4615         * decl.c (grokdeclarator): For static data members, handle thread_p
4616         only after handling inline.
4618 2017-02-14  Marek Polacek  <polacek@redhat.com>
4620         PR c++/79420
4621         PR c++/79463
4622         * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
4623         clobbering if the postfix expression isn't an EXPR_P.
4625 2017-02-13  Jason Merrill  <jason@redhat.com>
4627         PR c++/79461 - ICE with lambda in constexpr constructor
4628         * constexpr.c (build_data_member_initialization): Ignore
4629         initialization of a local variable.
4631 2017-02-13  Jakub Jelinek  <jakub@redhat.com>
4633         * init.c (warn_placement_new_too_small): Add missing space in
4634         diagnostics.
4635         * parser.c (cp_parser_oacc_declare): Likewise.
4636         * mangle.c (maybe_check_abi_tags): Likewise.
4638         PR c++/79232
4639         * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
4640         on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
4641         in the rightmost operand.
4643 2017-02-13  Nathan Sidwell  <nathan@acm.org>
4645         PR c++/79296 - ICE mangling localized template instantiation
4646         * decl2.c (determine_visibility): Use template fn context for
4647         local class instantiations.
4649 2017-02-11  Jason Merrill  <jason@redhat.com>
4651         PR c++/77659 - ICE with new and C++14 aggregate NSDMI
4652         * init.c (build_new): Make backups of any CONSTRUCTORs in init.
4653         (build_new_1): Use replace_placeholders.
4654         * tree.c (replace_placeholders_t): Also track whether we've seen a
4655         placeholder.
4656         (replace_placeholders, replace_placeholders_r): Adjust.
4657         * cp-tree.h: Adjust.
4659         PR c++/77790 - ICE with auto function in C++11 mode
4660         * decl.c (undeduced_auto_decl): Remove C++14 limitation.
4661         (require_deduced_type): Add complain parm, return bool.
4662         * cp-tree.h: Adjust.
4663         * decl2.c (mark_used): Use require_deduced_type.
4665 2017-02-10  Jason Merrill  <jason@redhat.com>
4667         PR c++/78908 - template ops and bitfields
4668         * tree.c (build_min_non_dep): Use unlowered_expr_type.
4670         PR c++/78897 - constexpr union
4671         * constexpr.c (cxx_eval_store_expression): A store to a union member
4672         erases a previous store to another member.
4674         PR c++/71285 - member of fold-expression
4675         * semantics.c (finish_unary_fold_expr)
4676         (finish_binary_fold_expr): Use null type for fold-expressions.
4678         PR c++/79401 - protected inherited constructor
4679         * call.c (enforce_access): For inheriting constructor, find a base
4680         binfo in the path we already have.
4682 2017-02-10  Marek Polacek  <polacek@redhat.com>
4684         PR c++/79435
4685         * pt.c (type_dependent_expression_p): Check if the expression type
4686         is null.
4688         PR c++/79184
4689         * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
4690         if warnings shouldn't be given.
4692 2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
4694         PR c++/71737
4695         * pt.c (tsubst_decl): Don't try to preserve a typedef that names
4696         an error_mark_node as type.
4698 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
4699             Jason Merrill  <jason@redhat.com>
4701         PR c++/79143
4702         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
4703         from pattern to type.
4705 2017-02-09  Jason Merrill  <jason@redhat.com>
4707         PR c++/79316 - default argument in deduction guide
4708         PR c++/79350 - explicit deduction guide
4709         * parser.c (cp_parser_constructor_declarator_p)
4710         (cp_parser_direct_declarator): Parse deduction guides more like
4711         constructors.
4712         * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
4713         * tree.c (special_function_p): Return it.
4714         * decl.c (check_special_function_return_type): Handle it.
4715         (grokdeclarator, grokfndecl): Adjust.
4716         (cp_finish_decl): Pass flags to do_auto_deduction.
4717         * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
4718         * pt.c (dguide_name_p): Take a const_tree.
4719         (do_class_deduction): Handle explicit.
4720         (do_auto_deduction): Pass flags through.
4721         (build_deduction_guide): Copy explicit flag.
4723 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
4725         PR c++/79429
4726         * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
4727         non-pragma_compound context here.
4728         (cp_parser_omp_target): Likewise.
4729         (cp_parser_pragma): Don't call push_omp_privatization_clauses and
4730         parsing for ordered and target omp pragmas in non-pragma_stmt
4731         non-pragma_compound contexts.
4733         PR c/79431
4734         * parser.c (cp_parser_oacc_declare): Formatting fix.
4735         (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
4736         automatic variables.
4738 2016-02-09  Nathan Sidwell  <nathan@codesourcery.com>
4739             Chung-Lin Tang  <cltang@codesourcery.com>
4741         * parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
4742         parsing.  Parse constant expression. Remove semantic checking.
4743         (cp_parser_omp_clause_collapse): Disallow tile.
4744         (cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
4745         error about missing for after already emitting one.  Use more
4746         conventional for idiom for unbounded loop.
4747         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
4748         * semantics.c (finish_omp_clauses): Correct TILE semantic check.
4749         (finish_omp_for): Deal with tile clause.
4751 2017-02-07  Nathan Sidwell  <nathan@acm.org>
4753         * method.c (synthesized_method_base_walk): New.  Broken out of ...
4754         (synthesized_method_walk): ... here.  Call it.  Cleanup
4755         initializations.
4757 2017-02-07  Patrick Palka  <ppalka@gcc.gnu.org>
4759         PR c++/79360
4760         * typeck2.c (process_init_constructor_union): Consider only
4761         FIELD_DECLs when looking for an NSDMI.
4763 2017-02-06  Jason Merrill  <jason@redhat.com>
4765         PR c++/71193 - incomplete types in templates
4766         * parser.c (cp_parser_postfix_dot_deref_expression): In a template
4767         handle incomplete type by pedwarning and then treating as dependent.
4769 2017-02-06  Jakub Jelinek  <jakub@redhat.com>
4771         PR c++/79379
4772         * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
4773         (potential_constant_expression_1): Likewise.
4775         PR c++/79377
4776         * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
4777         allow one fewer than expected arguments if flag_permissive.
4779         PR c++/79372
4780         * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
4781         * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
4782         with error_mark_node type.
4784 2017-02-03  Jason Merrill  <jason@redhat.com>
4786         PR c++/78689 - ICE on constructor with label
4787         * optimize.c (maybe_clone_body): Replace omitted parameters with
4788         null lvalues.
4789         * class.c (build_clone): Fix logic for omitting inherited parms.
4791         PR c++/12245 - excessive memory use
4792         * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
4793         back in.  Don't cache constants.
4794         (maybe_constant_init): Don't cache constants.
4796         PR c++/79294 - ICE with invalid template argument
4797         * pt.c (convert_nontype_argument_function): Check value-dependence.
4798         (convert_nontype_argument): Don't check it here for function ptrs.
4800 2017-02-02  Richard Biener  <rguenther@suse.de>
4802         PR cp/14179
4803         * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
4804         it lazily on the first changed element only and copy it
4805         fully upfront, only storing changed elements.
4807 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
4809         PR c++/69637
4810         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
4811         to the width.
4813 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
4815         PR c++/79304
4816         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
4817         after ARROW_EXPR.
4819 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
4821         PR c++/79298
4822         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
4823         any namespace aliases.
4825 2017-01-31  Nathan Sidwell  <nathan@acm.org>
4827         PR c++/79290
4828         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
4830         PR c++/67273
4831         PR c++/79253
4832         * pt.c: (instantiate_decl): Push to top level when current
4833         function scope doesn't match.  Only push lmabda scope stack when
4834         pushing to top.
4836         * cp-tree.h (instantiate_decl): Make defer_ok bool.
4837         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
4838         (instantiate_decl): Simplify and reorder state saving and restoration.
4840         PR c++/79264
4841         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
4842         * semantics.c (finish_member_declaration): Assert class is being
4843         defined.
4845 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
4847         Introduce C++ support in libcc1.
4848         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
4849         (ansi_opname): Rename to...
4850         (cp_operator_id): ... this.  Adjust all callers.
4851         (ansi_assopname): Rename to...
4852         (cp_assignment_operator_id): ... this.  Adjust all callers.
4853         (cp_literal_operator_id): Declare.
4854         (set_global_friend): Declare.
4855         (is_global_friend): Declare.
4856         (enum cp_oracle_request): New type.
4857         (cp_binding_oracle_function): New type.
4858         (cp_binding_oracle): Declare.
4859         (cp_finish_injected_record_type): Declare.
4860         * friend.c (global_friend): New var.
4861         (set_global_friend): New fn.
4862         (is_global_friend): New fn.
4863         (is_friend): Call is_global_friend.
4864         * name-lookup.c (cp_binding_oracle): New var.
4865         (query_oracle): New fn.
4866         (qualified_lookup_using_namespace): Call query_oracle.
4867         (lookup_name_real_1): Likewise.
4868         * parser.c (cp_literal_operator_id): Drop static.
4869         * search.c (friend_accessible_p): Call is_global_friend.
4870         * semantics.c (is_this_parameter): Accept a variable if the
4871         binding oracle is enabled.
4873 2017-01-27  Jason Merrill  <jason@redhat.com>
4875         PR c++/78771 - ICE with inherited constructor.
4876         * call.c (build_over_call): Call deduce_inheriting_ctor here.
4877         * pt.c (tsubst_decl): Not here.
4878         * class.c (add_method): Or here.
4879         * method.c (deduce_inheriting_ctor): Handle clones.
4880         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
4882 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
4884         PR c++/64382
4885         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
4886         New function.
4887         * cp/cp-tree.h: Declare it.
4888         * cp/semantics.c (finish_id_expression): Resolve names within a default
4889         capturing generic lambda defined within a template prior to
4890         instantiation to allow for captures to be added to the closure type.
4892 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
4894         PR c++/68727
4895         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
4896         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
4897         * parser.c (cp_parser_builtin_offsetof): Pass result of
4898         build_static_cast of null_pointer_node to finish_offsetof.
4899         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
4900         it for -Winvalid-offsetof pedwarn instead of trying to guess
4901         original offsetof type from EXPR.  Save OBJECT_PTR as a new
4902         second operand to OFFSETOF_EXPR.
4903         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
4904         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
4905         as OBJECT_PTR.
4907 2017-01-26  Jason Merrill  <jason@redhat.com>
4909         * name-lookup.c (parse_using_directive): Deprecate strong using.
4911         PR c++/79176 - lambda ICE with -flto -Os
4912         * decl2.c (vague_linkage_p): Handle decloned 'tors.
4913         * tree.c (decl_linkage): Likewise.
4915 2017-01-25  Martin Sebor  <msebor@redhat.com>
4917         * decl.c (grokdeclarator): Fix a typo in a comment.
4919 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
4921         PR c++/78896
4922         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
4923         lambda expressions.
4925         PR c++/77914
4926         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
4927         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
4929 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
4931         PR lto/79061
4932         * decl.c (cxx_init_decl_processing): Pass main_input_filename
4933         to build_translation_unit_decl.
4935 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
4937         PR c++/79205
4938         * cp-gimplify.c (cp_genericize_r): Add result of
4939         convert_from_reference on invisiref parm to p_set.
4941 2017-01-24  Nathan Sidwell  <nathan@acm.org>
4943         PR c++/78469 - defaulted ctor and inaccessible dtor
4944         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
4945         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
4946         * tree.c (build_target_expr): Check tf_no_cleanup.
4948         PR c++/79118 - anon-members and constexpr
4949         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
4950         ctor decl.  Recursively check anonymous members.
4951         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
4952         call.
4953         (explain_invalid_constexpr_fn): Likewise.
4955 2017-01-23  Nathan Sidwell  <nathan@acm.org>
4957         PR c++/71710 - template using directive of field
4958         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
4959         check earlier.
4961         PR c++/71406 - ICE with scope-ref'd template id exprs
4962         PR c++/77508
4963         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
4964         before breaking up TEMPLATE_ID_EXPR.
4966 2017-01-20  Nathan Sidwell  <nathan@acm.org>
4968         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
4969         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
4971 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
4973         PR c++/77829
4974         PR c++/78656
4975         * cp-tree.h (suggest_alternatives_for): Add bool param.
4976         (suggest_alternative_in_explicit_scope): New decl.
4977         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
4978         that isn't the global one, call new function
4979         suggest_alternative_in_explicit_scope, only calling
4980         suggest_alternatives_for if it fails, and disabling near match
4981         searches fort that case.  When SCOPE is the global namespace,
4982         pass true for new param to suggest_alternatives_for to allow for
4983         fuzzy name lookups.
4984         * lex.c (unqualified_name_lookup_error): Pass true for new param
4985         to suggest_alternatives_for.
4986         * name-lookup.c (consider_binding_level): Add forward decl.
4987         (suggest_alternatives_for): Add "suggest_misspellings" param,
4988         using it to conditionalize the fuzzy name-lookup code.
4989         (suggest_alternative_in_explicit_scope): New function.
4990         * parser.c (cp_parser_primary_expression): When calling
4991         finish_id_expression, pass location of id_expression rather
4992         than that of id_expr_token.
4993         (cp_parser_id_expression): Convert local "unqualified_id" from
4994         tree to cp_expr to avoid implicitly dropping location information.
4996 2017-01-20  Marek Polacek  <polacek@redhat.com>
4998         PR c/64279
4999         * call.c (build_conditional_expr_1): Warn about duplicated branches.
5000         * semantics.c (finish_expr_stmt): Build statement using the proper
5001         location.
5003 2017-01-19  Jason Merrill  <jason@redhat.com>
5005         US 20 - forwarding references and class template argument deduction
5006         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
5007         * pt.c (push_template_decl_real): Set it.
5008         (maybe_adjust_types_for_deduction): Check it.
5009         (rewrite_template_parm): Copy it.
5011         US 19 - deduction guides and constructors
5012         * call.c (joust): Prefer deduction guides to constructors.
5013         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
5014         (deduction_guide_p): Check DECL_P.
5016         * decl.c (check_initializer): Always use build_aggr_init for array
5017         decomposition.
5019         PR c++/79130 - decomposition and direct-initialization
5020         * init.c (build_aggr_init): Communicate direct-initialization to
5021         build_vec_init.
5022         (build_vec_init): Check for array copy sooner.
5023         * parser.c (cp_parser_decomposition_declaration): Remove call to
5024         build_x_compound_expr_from_list.
5026 2017-01-18  Jason Merrill  <jason@redhat.com>
5028         PR c++/68666 - member variable template-id
5029         * typeck.c (finish_class_member_access_expr): Handle variable
5030         template-id.
5031         * pt.c (lookup_and_finish_template_variable): No longer static.
5032         * cp-tree.h: Declare it.
5034 2017-01-18  Nathan Sidwell  <nathan@acm.org>
5036         PR c++/78488
5037         * call.c (build_over_call): When checking ellipsis conversions for
5038         an inherited ctor, make sure there is at least one conversion.
5040 2017-01-18  Jason Merrill  <jason@redhat.com>
5042         PR c++/78894 - ICE with class deduction and default arg
5043         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
5045 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
5047         PR c++/77489
5048         * mangle.c (write_discriminator): Reorganize abi warning check.
5050 2017-01-18  Nathan Sidwell  <nathan@acm.org>
5052         * cp-tree.h: Clarify exception spec node comment.
5053         * except.c (nothrow_spec_p): Simplify by checking node-equality.
5055         PR c++/79091
5056         * mangle.c (write_exception_spec): Check nothrow explicitly.
5057         (write_encoding): Don't increment processing_template_decl around
5058         encoding.
5060 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
5062         PR c++/70182
5063         * mangle.c (write_template_args): Add "on" for operator names.
5065 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
5067         PR c++/77489
5068         * mangle.c (write_discriminator): Handle discriminator >= 10.
5070 2017-01-17  Nathan Sidwell  <nathan@acm.org>
5072         PR c++/61636
5073         * cp-tree.h (maybe_generic_this_capture): Declare.
5074         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
5075         (maybe_resolve_dummy): ... here.  Call it.
5076         (maybe_generic_this_capture): New.
5077         * parser.c (cp_parser_postfix_expression): Speculatively capture
5078         this in generic lambda in unresolved member function call.
5079         * pt.c (tsubst_copy_and_build): Force hard error from failed
5080         member function lookup in generic lambda.
5082 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
5084         PR c++/70565
5085         * cp-array-notation.c (expand_array_notation_exprs): Handle
5086         OMP_PARALLEL.
5088 2017-01-11  Jason Merrill  <jason@redhat.com>
5090         PR c++/78337 - ICE on invalid with generic lambda
5091         * semantics.c (process_outer_var_ref): Check if containing_function
5092         is null.  Move inform call under complain test.
5094 2017-01-11  Nathan Sidwell  <nathan@acm.org>
5096         PR c++/77812
5097         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
5098         is a new overload.
5100 2017-01-11  Nathan Sidwell  <nathan@acm.org>
5102         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
5104 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
5106         PR c++/78341
5107         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
5108         assertion.  Formatting fix.
5110         PR c++/72813
5111         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
5112         writing PCH file.
5114 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
5116         PR c++/77949
5117         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
5118         a missing semicolon if we have a valid insertion location for
5119         the fix-it hint.
5121 2017-01-10  Jason Merrill  <jason@redhat.com>
5123         FI 20, decomposition declaration with parenthesized initializer.
5124         * parser.c (cp_parser_decomposition_declaration): Use
5125         cp_parser_initializer.
5127 2017-01-09  Jason Merrill  <jason@redhat.com>
5129         Implement P0195R2, C++17 variadic using.
5130         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
5131         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
5132         * error.c (dump_decl): Likewise.
5134 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
5136         PR translation/79019
5137         PR translation/79020
5138         * semantics.c (finish_omp_clauses): Add missing whitespace to
5139         translatable strings.
5140         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
5142 2017-01-07  Jason Merrill  <jason@redhat.com>
5144         PR c++/78948 - instantiation from discarded statement
5145         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
5146         * cp-tree.h (in_discarded_stmt): Declare it.
5147         (struct saved_scope): Add discarded_stmt bitfield.
5148         (in_discarded_stmt): New macro.
5149         * decl2.c (mark_used): Check it.
5150         * parser.c (cp_parser_selection_statement): Adjust.
5151         (cp_parser_jump_statement): Adjust.
5153 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
5155         PR c++/78931
5156         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
5157         REFERENCE_REF_P, set tt to its operand.
5159         PR c++/78890
5160         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
5161         unions even for C++11 and later.
5163 2017-01-05  Nathan Sidwell  <nathan@acm.org>
5165         PR c++/78765
5166         * pt.c (convert_nontype_argument): Don't try and see if integral
5167         or enum expressions are constants prematurely.
5169 2017-01-04  Marek Polacek  <polacek@redhat.com>
5171         PR c++/64767
5172         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
5173         a zero character literal.
5175 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
5177         PR c++/78949
5178         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
5179         vector type.
5181         PR c++/78693
5182         * parser.c (cp_parser_simple_declaration): Only complain about
5183         inconsistent auto deduction if auto_result doesn't use auto.
5185         * parser.c (cp_parser_simple_declaration): Diagnose function
5186         declaration among more than one init-declarators with auto
5187         specifier.
5189         PR c++/71182
5190         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
5191         assertion, as lexer->buffer may be NULL.
5193 2017-01-04  Marek Polacek  <polacek@redhat.com>
5195         PR c++/77545
5196         PR c++/77284
5197         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
5199 2017-01-04  Nathan Sidwell  <nathan@acm.org>
5201         PR c++/66735
5202         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
5203         (lambda_capture_field_type): Update prototype.
5204         * lambda.c (lambda_capture_field_type): Add is_reference parm.
5205         Add referenceness here.
5206         (add_capture): Adjust lambda_capture_field_type call, refactor
5207         error checking.
5208         * pt.c (tsubst): Adjust lambda_capture_field_type call.
5210 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
5212         Update copyright years.
5214 Copyright (C) 2017 Free Software Foundation, Inc.
5216 Copying and distribution of this file, with or without modification,
5217 are permitted in any medium without royalty provided the copyright
5218 notice and this notice are preserved.