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