PR c++/81899
[official-gcc.git] / gcc / cp / ChangeLog
blobba9583aa3b31b8b4e53c694869ac4207067c2d56
1 2017-08-21  Nathan Sidwell  <nathan@acm.org>
3         PR c++/81899
4         * pt.c (instantiate_class_template_1):
5         BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
7 2017-08-18  David Malcolm  <dmalcolm@redhat.com>
9         PR c++/81514
10         * name-lookup.c (maybe_suggest_missing_header): Convert return
11         type from void to bool; return true iff a suggestion was offered.
12         (suggest_alternative_in_explicit_scope): Move call to
13         maybe_suggest_missing_header to before use of best_match, and
14         return true if the former offers a suggestion.
16 2017-08-18  H.J. Lu  <hongjiu.lu@intel.com>
18         PR c/53037
19         * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
20         * decl2.c (grokbitfield): Don't allow bit-field with
21         warn_if_not_aligned type.
23 2017-08-17  Nathan Sidwell  <nathan@acm.org>
25         * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
26         * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
27         (TYPE_TEMPLATE_INFO): Simplify.
28         (SET_TYPE_TEMPLATE_INFO): Simplify.
30         * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
31         don't need lang_type.
32         (cxx_make_type): Use maybe_add_lang_type_raw return value.
33         * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
34         TYPE_LANG_SPECIFIC.
36         * cp-tree.h (struct lang_type): Remove template_info field.
37         (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
38         (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
40 2017-08-14  Martin Sebor  <msebor@redhat.com>
42         PR c/81117
43         * error.c (cp_printer): Handle 'G'.
45 2017-08-11  Martin Liska  <mliska@suse.cz>
47         * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
48         TARGET_SUPPORTS_ALIASES.
49         (handle_tls_init): Likewise.
50         (note_mangling_alias): Likewise.  Remove ATTRIBUTE_UNUSED for
51         both arguments.
52         * optimize.c (can_alias_cdtor): Likewise.
54 2017-08-11  Jason Merrill  <jason@redhat.com>
56         PR c++/81671 - nullptr_t template parameter
57         * pt.c (convert_nontype_argument): Fix nullptr_t check.
59 2017-08-10  Jason Merrill  <jason@redhat.com>
61         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
62         * method.c (synthesized_method_walk): Don't diagnose lack of
63         operator delete.
65         PR c++/80452 - Core 1579, implicit move semantics on return/throw
66         * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
67         tentatively changed the lvalue to an rvalue.
68         * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
69         (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
70         parameter is an rvalue reference.
71         * except.c (build_throw): Do maybe-rvalue overload resolution twice.
72         * typeck.c (check_return_expr): Likewise.
74 2017-08-10  David Malcolm  <dmalcolm@redhat.com>
76         * parser.c (cp_parser_error): Update for new param to
77         c_parse_error.
78         (class token_pair): New class.
79         (struct matching_paren_traits): New struct.
80         (matching_parens): New typedef.
81         (struct matching_brace_traits): New struct.
82         (matching_braces): New typedef.
83         (cp_parser_statement_expr): Convert explicit parsing of
84         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
85         class matching_parens, so that the pertinent open parenthesis is
86         highlighted when there are problems locating the close
87         parenthesis.
88         (cp_parser_primary_expression): Likewise.
89         (cp_parser_compound_literal_p): Remove consumption of opening
90         paren.
91         (cp_parser_postfix_expression): Convert explicit parsing of
92         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
93         above.  Use it to consume the opening paren previously consumed by
94         cp_parser_compound_literal_p.
95         (cp_parser_parenthesized_expression_list): Likewise.
96         (cp_parser_unary_expression): Likewise.
97         (cp_parser_new_expression): Likewise.
98         (cp_parser_cast_expression): Likewise.
99         (cp_parser_builtin_offsetof): Likewise.
100         (cp_parser_trait_expr): Likewise.
101         (cp_parser_lambda_declarator_opt): Likewise.
102         (cp_parser_lambda_body): Likewise, for matching_braces.
103         (cp_parser_compound_statement): Likewise.
104         (cp_parser_selection_statement): Likewise, for matching_parens.
105         (cp_parser_iteration_statement): Likewise.
106         (cp_parser_already_scoped_statement): Likewise, for
107         matching_braces.
108         (cp_parser_linkage_specification): Likewise.
109         (cp_parser_static_assert): Likewise, for matching_parens.
110         (cp_parser_decltype): Likewise.
111         (cp_parser_operator): Likewise.
112         (cp_parser_enum_specifier): Likewise.
113         (cp_parser_namespace_definition): Likewise.
114         (cp_parser_direct_declarator): Likewise.
115         (cp_parser_braced_list): Likewise.
116         (cp_parser_class_specifier_1): Likewise, for matching_braces.
117         (cp_parser_constant_initializer): Likewise.
118         (cp_parser_noexcept_specification_opt): Likewise, for
119         matching_parens.
120         (cp_parser_exception_specification_opt): Likewise.
121         (cp_parser_handler): Likewise.
122         (cp_parser_asm_specification_opt): Likewise.
123         (cp_parser_asm_operand_list): Likewise.
124         (cp_parser_gnu_attributes_opt): Likewise.
125         (cp_parser_std_attribute_spec): Likewise.
126         (cp_parser_requirement_parameter_list): Likewise.
127         (cp_parser_requirement_body): Likewise, for matching_braces.
128         (cp_parser_compound_requirement): Likewise.
129         (cp_parser_template_introduction): Likewise.
130         (cp_parser_sizeof_pack): Likewise, for matching_parens.
131         (cp_parser_sizeof_operand): Likewise; use it to consume the
132         opening paren previously consumed by cp_parser_compound_literal_p.
133         (get_matching_symbol): New function.
134         (cp_parser_required_error): Add param "matching_location".  Remove
135         calls to cp_parser_error, instead setting a non-NULL gmsgid, and
136         handling it if set by calling c_parse_error, potentially with a
137         secondary location if matching_location was set.
138         (cp_parser_require): Add param "matching_location", with a default
139         value of UNKNOWN_LOCATION.
140         (cp_parser_require_keyword): Update for new param of
141         cp_parser_required_error.
142         (cp_parser_objc_encode_expression): Update to class matching_parens
143         as above.
144         (cp_parser_objc_defs_expression): Likewise.
145         (cp_parser_objc_protocol_expression): Likewise.
146         (cp_parser_objc_selector_expression): Likewise.
147         (cp_parser_objc_typename): Likewise.
148         (cp_parser_objc_superclass_or_category): Likewise.
149         (cp_parser_objc_try_catch_finally_statement): Likewise.
150         (cp_parser_objc_synchronized_statement): Likewise.
151         (cp_parser_objc_at_property_declaration): Likewise.
152         (cp_parser_oacc_single_int_clause): Likewise.
153         (cp_parser_oacc_shape_clause): Likewise.
154         (cp_parser_omp_clause_collapse): Likewise.
155         (cp_parser_omp_clause_default): Likewise.
156         (cp_parser_omp_clause_final): Likewise.
157         (cp_parser_omp_clause_if): Likewise.
158         (cp_parser_omp_clause_num_threads): Likewise.
159         (cp_parser_omp_clause_num_tasks): Likewise.
160         (cp_parser_omp_clause_grainsize): Likewise.
161         (cp_parser_omp_clause_priority): Likewise.
162         (cp_parser_omp_clause_hint): Likewise.
163         (cp_parser_omp_clause_defaultmap): Likewise.
164         (cp_parser_omp_clause_ordered): Likewise.
165         (cp_parser_omp_clause_schedule): Likewise.
166         (cp_parser_omp_clause_num_teams): Likewise.
167         (cp_parser_omp_clause_thread_limit): Likewise.
168         (cp_parser_omp_clause_aligned): Likewise.
169         (cp_parser_omp_clause_linear): Likewise.
170         (cp_parser_omp_clause_safelen): Likewise.
171         (cp_parser_omp_clause_simdlen): Likewise.
172         (cp_parser_omp_clause_depend): Likewise.
173         (cp_parser_omp_clause_device): Likewise.
174         (cp_parser_omp_clause_dist_schedule): Likewise.
175         (cp_parser_oacc_clause_async): Likewise.
176         (cp_parser_omp_critical): Likewise.
177         (cp_parser_omp_for_loop): Likewise.
178         (cp_parser_omp_sections_scope): Likewise.
179         (cp_parser_omp_declare_reduction_exprs): Likewise.
180         Update for new param to cp_parser_required_error.
181         (cp_parser_oacc_routine): Likewise.
182         (cp_parser_transaction_expression): Likewise.
183         (cp_parser_cilk_simd_vectorlength): Likewise.
185 2017-08-09  Jason Merrill  <jason@redhat.com>
187         PR c++/81525 - wrong constant value with generic lambda
188         * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
189         (tsubst_copy) [VAR_DECL]: Handle auto.
191         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
192         * init.c (get_nsdmi): Add complain parm.
193         * typeck2.c (digest_nsdmi_init): Add complain parm.
194         (process_init_constructor_record): Pass complain to get_nsdmi.
195         * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
196         * method.c (get_defaulted_eh_spec): Add complain parm.  Pass it into
197         synthesized_method_walk.
198         (synthesized_method_walk): Adjust.
199         (walk_field_subobs): Pass complain to get_nsdmi.
200         (defaulted_late_check): Skip other checks if deleted.
201         * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
202         * call.c (build_aggr_conv): Pass complain to get_nsdmi.
203         * parser.c (defarg_location): New.
204         * error.c (location_of): Use it.
206 2017-08-09  Marek Polacek  <polacek@redhat.com>
208         * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
209         * typeck.c (build_binary_op): Change the type of a parameter to bool.
210         (cp_truthvalue_conversion): Use true instead of 1.
212 2017-08-08  Marek Polacek  <polacek@redhat.com>
214         PR c++/81607
215         * cp-gimplify.c (cp_fold): If folding exposed a branch of
216         a COND_EXPR, convert it to the original type of the COND_EXPR, if
217         they differ.               
219 2017-08-08  Martin Liska  <mliska@suse.cz>
221         * call.c: Include header files.
222         * cp-gimplify.c: Likewise.
223         * cp-ubsan.c: Likewise.
224         * cvt.c: Likewise.
225         * init.c: Likewise.
226         * search.c: Likewise.
227         * semantics.c: Likewise.
228         * typeck.c: Likewise.
230 2017-08-07  Martin Liska  <mliska@suse.cz>
232         * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
233         attribute.
234         (cp_parser_std_attribute): Likewise.
235         * tree.c: Add new include.
237 2017-08-04  Paolo Carlini  <paolo.carlini@oracle.com>
239         PR c++/79790
240         * pt.c (do_class_deduction): Handle the case of no viable implicit
241         deduction guides; simplify the code generating implicit deduction
242         guides.
244 2017-08-03  Paolo Carlini  <paolo.carlini@oracle.com>
246         PR c++/71440
247         * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
248         destructor as expressions.
250 2017-08-02  Jakub Jelinek  <jakub@redhat.com>
252         PR c++/81640
253         * call.c (build_user_type_conversion_1): Only call
254         lookup_fnfields_slot if totype is CLASS_TYPE_P.
256 2017-07-31  Jason Merrill  <jason@redhat.com>
258         * decl.c (declare_global_var): Set DECL_CONTEXT.
260 2017-07-31  Jan Hubicka <hubicka@ucw.cz>
261             Martin Liska  <mliska@suse.cz>
263         * pt.c (tsubst_copy): Copy PREDICT_EXPR.
264         * semantics.c (finish_goto_stmt): Build gimple predict
265         stament.
266         * constexpr.c (potential_constant_expression_1): Handle
267         PREDICT_EXPR.
269 2017-07-31  Martin Liska  <mliska@suse.cz>
271         PR sanitize/81530
272         * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
273         also with current_function_decl non-null equality.
274         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
275         * decl.c (compute_array_index_type): Likewise.
276         * init.c (finish_length_check): Likewise.
277         * typeck.c (cp_build_binary_op): Likewise.
279 2017-07-29  Jakub Jelinek  <jakub@redhat.com>
281         * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
282         DW_AT_export_symbols.
283         * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
284         argument, pass it through to the debug hook.
285         (finish_namespace_using_directive): Adjust
286         emit_debug_info_using_namespace caller.
287         (push_namespace): Likewise.  Call it after setting
288         DECL_NAMESPACE_INLINE_P.
289         (cp_emit_debug_info_for_using): Pass false as new argument to
290         the imported_module_or_decl debug hook.
292 2017-07-28  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
294         * lex.c (copy_decl): Adjust.
295         (copy_type): Likewise.
297 2017-07-26  Paolo Carlini  <paolo.carlini@oracle.com>
299         PR c++/71570
300         * lambda.c (add_capture): Early return if we cannot capture by
301         reference.
303 2017-07-26  Jason Merrill  <jason@redhat.com>
305         P0702R1 - List deduction of vector.
306         * pt.c (do_class_deduction): Special-case deduction from a single
307         element of related type.
309 2017-07-26  Leonid Koppel  <lkoppel@uwaterloo.ca>
311         PR c++/67054 - Inherited ctor with non-default-constructible members
312         * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
313         when deducing an inheriting constructor.
315 2017-07-21  Nathan Sidwell  <nathan@acm.org>
317         * search.c (lookup_conversion_operator): Return overloads.
318         (lookup_fnfields_idx_nolazy): Absorb into ...
319         (lookup_fnfields_slot_nolaxy): ... here.
320         (lookup_fnfields_1): Absorb into ...
321         (lookup_fnfields_slot): ... here.
323         Remove special CDtor METHOD_VEC slots.
324         * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
325         CLASSTYPE_DESTRUCTOR_SLOT): Delete.
326         (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
327         (CLASSTYPE_DESTRUCTOR): Likewise.
328         * class (add_method): Don't use special cdtor slots.
329         * search.c (lookup_fnfields_idx_nolazy): Likewise.
330         (look_for_overrides_here): Use lookup_fnfields_slot.
331         * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
333         * call.c (add_candidates): Move decls to initialization.  Don't
334         use !!.
336 2017-07-20  Nathan Sidwell  <nathan@acm.org>
338         Remove TYPE_METHODS.
339         * class.c (maybe_warn_about_overly_private_class,
340         finish_struct_methods, one_inheriting_sig, count_fields,
341         add_fields_to_record_type, check_field_decls, check_methods,
342         clone_function_decl, set_method_tm_attributes,
343         finalize_literal_type_property, check_bases_and_members,
344         create_vtable_ptr, determine_key_method,
345         unreverse_member_declarations, finish_struct,
346         add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
347         * decl.c (fixup_anonymous_aggr): Likewise.
348         * decl2.c (reset_type_linkage_2): Likewise.
349         * method.c (after_nsdmi_defaulted_late_checks,
350         lazily_declare_fn): Likewise.
351         * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
352         * pt.c (instantiate_class_template_1, tsubst_expr,
353         do_type_instantiation, instantiate_pending_templates): Likewise.
354         * search.c (lookup_field_1): Likewise.
355         * semantics.c (finish_member_declaration,
356         finish_omp_declare_simd_methods): Likewise.
358 2017-07-19  Nathan Sidwell  <nathan@acm.org>
360         * class.c (add_implicitly_declared_members): Use
361         classtype_has_move_assign_or_move_ctor_p.
362         (classtype_has_move_assign_or_move_ctor,
363         classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
364         (classtype_has_move_assign_or_move_ctor_p): ... this new function.
365         * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
366         Replace with ...
367         (classtype_has_move_assign_or_move_ctor_p): ... this.
368         * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
369         * tree.c (type_has_nontrivial_copy_init): Adjust.
371         * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
372         PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
374 2017-07-18  Nathan Sidwell  <nathan@acm.org>
376         * cp-array-notation.c (build_array_notation_ref): Use
377         TYPE_{MIN,MAX}_VALUE.
379         * class.c (classtype_has_move_assign_or_move_ctor): Declare.
380         (add_implicitly_declared_members): Use it.
381         (type_has_move_constructor, type_has_move_assign): Merge into ...
382         (classtype_has_move_assign_or_move_ctor): ... this new function.
383         * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
385 2017-07-17  Volker Reichelt  <v.reichelt@netcologne.de>
387         * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
388         friend outside class and obsolete auto as storage-class-specifier.
390 2017-07-17  Nathan Sidwell  <nathan@acm.org>
392         * class.c (maybe_warn_about_overly_private_class): Ignore public
393         copy ctors.
395         * class.c (type_has_user_declared_move_constructor,
396         type_has_user_declared_move_assign): Combine into ...
397         (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
398         * cp-tree.h (type_has_user_declared_move_constructor,
399         type_has_user_declared_move_assign): Combine into ...
400         (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
401         * method.c (maybe_explain_implicit_delete): Use it.
402         (lazily_declare_fn): Use it.
403         * tree.c (type_has_nontrivial_copy_init): Use it.
405         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
406         semantics, simplify implementation.
408 2017-07-16  Volker Reichelt  <v.reichelt@netcologne.de>
410         * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
411         in old-style cast diagnostic.
412         * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
413         in useless cast diagnostic.
414         * error.c (type_to_string): Remove enum special handling.
416 2017-07-14  David Malcolm  <dmalcolm@redhat.com>
418         * name-lookup.c (get_std_name_hint): Add '<' and '>' around
419         the header names.
420         (maybe_suggest_missing_header): Update for addition of '<' and '>'
421         to above.  Provide a fix-it hint.
422         * pt.c: Include "gcc-rich-location.h"
423         (listify): Attempt to add fix-it hint for missing
424         #include <initializer_list>.
425         * rtti.c: Include "gcc-rich-location.h".
426         (typeid_ok_p): Attempt to add fix-it hint for missing
427         #include <typeinfo>.
429 2017-07-12  Jason Merrill  <jason@redhat.com>
431         P0512R0 - Deduction from an initializer list.
432         * pt.c (do_class_deduction): Do list deduction in two phases.
434 2017-07-12  Nathan Sidwell  <nathan@acm.org>
436         * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
437         DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
438         identifier flags.
439         * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
440         DECL_CXX_DESTRUCTOR explicitly.
441         * decl2.c (grokclassfn): Likewise.
442         * friend.c (do_friend): Likewise.
443         * method.c (make_thunk, make_alias_for,
444         implicitly_declare_fn): Likewise.
446 2017-07-11  Jason Merrill  <jason@redhat.com>
448         Core DR 393
449         * decl.c (grokparms): Downgrade error about array of unknown bound
450         to pedwarn and disable it for C++17.
452 2017-07-11  Nathan Sidwell  <nathan@acm.org>
454         * decl2.c (reset_type_linkage_2): Dont't change ctor name.
456 2017-07-10  Martin Sebor  <msebor@redhat.com>
458         * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
460 2017-07-06  Jason Merrill  <jason@redhat.com>
462         PR c++/81204 - parse error with dependent template-name
463         * parser.c (cp_parser_lookup_name): Revert previous change.
465 2017-07-06  David Malcolm  <dmalcolm@redhat.com>
467         * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
468         selftest::run_cp_tests.
469         (selftest::run_cp_tests): New function.
470         * cp-tree.h (selftest::run_cp_tests): New decl.
472 2017-07-04  Jakub Jelinek  <jakub@redhat.com>
474         * parser.c (cp_parser_decomposition_declaration): Replace
475         decomposition declaration with structured binding in diagnostics.
476         * decl.c (cp_finish_decomp): Likewise.
477         (grokdeclarator): Likewise.
479         PR c++/81258
480         * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
481         forms of structured binding initializers.
483 2017-07-03  Paolo Carlini  <paolo.carlini@oracle.com>
485         PR c++/65775
486         * decl.c (grokdeclarator): Move checks on function return type after
487         the splice_late_return_type call; if declspecs->locations[ds_type_spec]
488         is UNKNOWN_LOCATION fall back to input_location.
490 2017-07-03  David Malcolm  <dmalcolm@redhat.com>
492         * parser.c (enum required_token): Fix spelling of
493         RT_INTERATION to RT_ITERATION.
494         (cp_parser_iteration_statement): Likewise.
495         (cp_parser_required_error): Likewise.
497 2017-06-30  Jason Merrill  <jason@redhat.com>
499         PR c++/81257 - ICE with invalid ::template.
500         PR c++/54769 - wrong lookup of dependent template-name.
501         * parser.c (cp_parser_template_name): Revert part of last change.
503 2017-06-30  Nathan Sidwell  <nathan@acm.org>
505         * config-lang.in (gtfiles): Add cp/lex.c.
506         * cp-tree.h (mangle_convop_name_for_type): Rename ...
507         (make_conv_op_name): ... here.  Move to lex.
508         * lambda.c (maybe_add_lambda_conv_op): Update.
509         * parser.c (cp_parser_conversion_function_id): Update.
510         * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
511         tsubst_copy_and_build): Update.
512         * semantics.c (apply_deduced_return_type): Update.
513         * mangle.c (conv_type_hasher, conv_type_names,
514         mangle_conv_op_name_for_type): Move to ...
515         * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
516         ... here.  Rename.
518 2017-06-30  David Malcolm  <dmalcolm@redhat.com>
520         PR c++/80014
521         * parser.c (cp_parser_postfix_expression): Construct a location
522         for typeid expressions.
524 2017-06-30  Nathan Sidwell  <nathan@acm.org>
526         * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
527         declare.
528         (lookup_all_conversions): Declare.
529         * class.c (get_basefndecls): Use lookup_fnfields_slot.
530         * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
531         * decl2.c (check_class_fn): Use lookup_fnfields_slot.  Rework
532         diagnostics.
533         * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
534         (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
535         lookup_all_conversions.
536         * search.c (lookup_fnfields_1): Make static.
537         (lookup_all_conversions): New.
538         (class_method_index_for_fn): Delete.
539         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
540         lookup_fnfields_slot.
542         * call.c (build_new_method_call_1): Use constructo_name to get
543         ctor name.  Move argument processing earlier to merge cdtor
544         handling blocks.
545         * decl.c (grokfndecl): Cdtors have special names.
546         * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
547         * pt.c (check_explicit_specialization): Cdtor name is already
548         special.
549         * search.c (class_method_index_for_fn): Likewise.
551         PR c++/81229
552         * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
553         a matching TYPE_DECL.
555 2017-06-29  Paolo Carlini  <paolo.carlini@oracle.com>
557         * class.c (add_method): Change pair of errors to error + inform.
558         (handle_using_decl): Likewise.
560 2017-06-29  Jason Merrill  <jason@redhat.com>
562         * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
564         PR c++/81180 - ICE with C++17 deduction of member class template.
565         * pt.c (build_deduction_guide): Correct member template handling.
567         PR c++/81188 - matching decltype of member function call.
568         * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
570 2017-06-29  Nathan Sidwell  <nathan@acm.org>
572         PR c++/81247
573         * parser.c (cp_parser_namespace_definition): Immediately close the
574         namespace if there's no open-brace.
575         * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
576         namespace.
578 2017-06-29  Jason Merrill  <jason@redhat.com>
580         PR c++/81164 - ICE with invalid inherited constructor.
581         * search.c (binfo_direct_p): New.
582         * name-lookup.c (do_class_using_decl): Use it.
584 2017-06-29  Nathan Sidwell  <nathan@acm.org>
586         * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
587         VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
588         * decl.c (initialize_predefined_identifiers): Name cdtor special
589         names consistently.  Use literals for above deleted defines.
590         (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
592         * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
593         flag.
595         * call.c (check_dtor_name): Use constructor_name for enums too.
596         (build_new_method_call_1): Use constructor_name for cdtors and
597         show ~ for dtor.
598         * class.c (build_self_reference): Use TYPE_NAME to get name of
599         self reference.
600         * name-lookup (constructor_name): Use DECL_NAME directly.
601         (constructor_name_p): Reimplement.
602         (push_class_level_binding_1): Use TYPE_NAME directly.
604         * class.c (finish_struct): Use OVL_P.
605         (get_vfield_name): Measure constructor_name length.
606         * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
607         (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
608         * cxx-pretty-print.c (is_destructor_name): Delete.
609         (pp_cxx_unqualified_id): Remove bogus destructor name checking.
610         * decl.c (grokfndecl): Move cheap checks first when looking for
611         implicit extern cness.
613         * parser.c (cp_parser_direct_declarator): Reorder if to avoid
614         indentation. Remove unnecessary assignment of constructor name.
616         Whitespace cleanups.
617         * call.c (name_as_c_string): Move CONST_CAST to return.
618         (build_new_method_call_1): Remove unneeded bracing.
619         * class.c (include_empty_classes): Unbreak line.
620         * constraint.cc (tsubst_check_constraint): Add space.
621         * cp-tree.h (lang_decl_ns): Add comment.
622         (PTRMEM_CST_MEMBER): Break line.
623         * decl.c (grokfndecl): Add blank lines. Unbreak some others.
624         (grokdeclarator): Remove lines, move declaration to first use.
625         * decl2.c (decl_needed_p): Fix indentation.
626         (c_parse_final_cleanups): Remove blank line.
627         * method.c (implicitly_declare_fn): Move declaration to first use.
628         * search.c (current_scope): Add blank lines.
630 2017-06-28  Jason Merrill  <jason@redhat.com>
632         PR c++/72764 - ICE with invalid template typename.
633         * decl.c (build_typename_type): No longer static.
634         * tree.c (strip_typedefs): Use it instead of make_typename_type.
636         PR c++/69300 - ICE with self-referential noexcept
637         * pt.c (maybe_instantiate_noexcept): Check for recursion.
639         PR c++/61022 - error with variadic template template parm
640         * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
642         PR c++/72801 - ICE with variadic partial specialization
643         * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
645         PR c++/55639 - partial specialization with ::template
646         * parser.c (cp_parser_class_head): Handle ::template.
648         PR c++/45976 - error with ::template in declarator.
649         * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
651         PR c++/54769 - wrong lookup of dependent template-name.
652         * parser.c (cp_parser_template_name): Handle dependent object type.
653         (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
654         parameter.
655         (cp_parser_id_expression): Pass it.
656         (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
658         * parser.c (cp_parser_template_id): Use the range location on the
659         TEMPLATE_ID_EXPR.
661         PR c++/81204 - parse error with dependent template-name
662         * parser.c (cp_parser_lookup_name): Disqualify function templates
663         after lookup.
665 2017-06-27  Nathan Sidwell  <nathan@acm.org>
667         * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
668         initialization point.  Don't unnecessarily check for ctor name.
670         * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
671         (CLASSTYPE_DESTRUCTOR): ... this.
672         * class.c (accessible_nvdtor_p,
673         maybe_warn_about_overly_private_class,
674         add_implicitly_declared_members,
675         clone_constructors_and_destructors, type_has_virtual_destructor):
676         Adjust for CLASSTYPE_DESTRUCTOR.
677         (deduce_noexcept_on_destructors): Absorb into ...
678         (check_bases_and_members): ... here.
679         * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
680         * init.c (build_delete): Likewise.
681         * parser.c (cp_parser_lookup_name): Likewise.
682         * pt.c (check_explicit_specialization): Likewise.
683         * rtti.c (emit_support_tinfos): Likewise.
684         * search.c (lookup_fnfields_idx_nolazy): Likewise.
686         Kill IDENTIFIER_TEMPLATE.
687         * cp-tree.h (lang_identifier): Remove class_template_info field.
688         (IDENTIFIER_TEMPLATE): Delete.
689         * name-lookup.c (constructor_name_full): Subsume into ...
690         (constructor_name): ... here.  Don't check IDENTIFIER_TEMPLATE.
691         (constructor_name_p): Likewise.
692         * mangle.c (write_source_name): Likewise.
693         * ptree.c (cxx_print_identifier): Likewise.
695 2017-06-27  Marek Polacek  <polacek@redhat.com>
697         PR bootstrap/81216
698         * parser.c (cp_parser_already_scoped_statement): Initialize
699         LOC_AFTER_LABELS.
701 2017-06-26  Jason Merrill  <jason@redhat.com>
703         PR c++/81215 - deduction failure with variadic TTP.
704         * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
706 2017-06-26  Martin Sebor  <msebor@redhat.com>
708         PR c++/81169
709         * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
710         to detect casting away cv-qualifiers.
712 2017-06-26  Nathan Sidwell  <nathan@acm.org>
714         * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
715         (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
716         identifier.
717         (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
718         DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
719         (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
720         * decl.c (grok_op_properties): Adjust identifier checking.
721         * init.c (expand_default_init): Adjust identifier descision.
722         * method.c (implicitly_declare_fn): Don't use
723         DECL_ASSIGNMENT_OPERATOR_P.
724         * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
725         IDENTIFIER_DTOR_P.
726         * call.c (in_charge_arg_for_name): Reimplement.
727         (build_special_member_call): Use IDENTIFIER_CDTOR_P,
728         IDENTIFIER_DTOR_P.
730 2017-06-26  Marek Polacek  <polacek@redhat.com>
732         PR c/80116
733         * parser.c (cp_parser_statement): Add a default argument.  Save the
734         location of the expression-statement after labels have been parsed.
735         (cp_parser_implicitly_scoped_statement): Set the location of the
736         body of the conditional after parsing all the labels.  Call
737         warn_for_multistatement_macros.
738         (cp_parser_already_scoped_statement): Likewise.
740 2017-06-24  Paolo Carlini  <paolo.carlini@oracle.com>
742         PR c++/62315
743         * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
744         'typename' in error messages about missing 'typename'.
746 2017-06-23  Jason Merrill  <jason@redhat.com>
748         PR c++/79056 - C++17 ICE with invalid template syntax.
749         * parser.c (cp_parser_simple_type_specifier): Don't assume that type
750         is a TYPE_DECL.
751         (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
752         * pt.c (template_placeholder_p): New.
753         * cp-tree.h: Declare it.
755 2017-06-23  Marc Glisse  <marc.glisse@inria.fr>
757         * decl.c (duplicate_decls): Use builtin_structptr_types.
759 2017-06-22  Nathan Sidwell  <nathan@acm.org>
761         Reorder IDENTIFIER flags
762         gcc/cp/
763         * cp-tree.h (enum cp_identifier_kind): New.
764         (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
765         IDENTIFIER_KIND_BIT_2): New.
766         (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
767         (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
768         (C_IS_RESERVED_WORD): Replace with ...
769         (IDENTIFIER_KEYWORD_P): ... this.
770         (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
771         (IDENTIFIER_CDTOR_P): ... this.
772         (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
773         (IDENTIFIER_OPNAME_P): Replace with ...
774         (IDENTIFIER_ANY_OP_P): ... this.
775         (IDENTIFIER_ASSIGN_OP_P): New.
776         (IDENTIFIER_TYPENAME_P): Replace with ...
777         (IDENTIFIER_CONV_OP_P): ... this.
778         (NEW_DELETE_OPNAME_P): Replace with ...
779         (IDENTIFIER_NEWDEL_OP_P): ... this.
780         (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
781         (get_identifier_kind_name, set_identifier_kind): Declare.
782         * lex.c (get_identifier_kind_name, set_identifier_kind): New.
783         (init_operators): Adjust to avoid keywords, use
784         set_identifier_kind. Copy TYPE_EXPR slot.
785         (init_reswords): Call set_identifier_kind.
786         (unqualified_name_lookup_error): Adjust.
787         * operators.def (TYPE_EXPR): Remove.
788         * decl.c (struct predefined_identifier): Move into ...
789         (initialize_predefined_identifiers): ... here.  Call
790         set_identifier_kind.
791         (grokfndecl, check_var_type, grokdeclarator): Adjust.
792         (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
793         space.  Adjust.
794         * call.c (name_as_c_string): Adjust.
795         (build_new_method_call_1): Likewise.
796         * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
797         * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
798         * dump.c (cp_dump_tree): Adjust.
799         * error.c (dump_decl_name): Adjust.
800         * mangle.c (write_unqualified_id, write_member_name,
801         write_expression): Adjust.
802         (mangle_conv_op_name_for_type): Use set_identifier_kind.
803         * name-lookup.c (do_class_using_decl): Adjust.
804         (lookup_name_fuzzy, lookup_name_real_1): Likewise.
805         * parser.c (cp_lexer_get_preprocessor_token,
806         cp_parser_direct_declarator): Likewise.
807         * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
808         tsubst_copy, tsubst_copy_and_build): Adjust.
809         * ptree.c (cxx_print_identifier): Print identifier kind.
810         * search.c (lookup_field_r, lookup_member,
811         lookup_fnfields_idx_nolazy): Adjust.
812         * semantics.c (finish_id_expression): Adjust..
813         * typeck.c (cp_build_addr_expr_1): Adjust.
815 2017-06-21  Jakub Jelinek  <jakub@redhat.com>
817         PR c++/81154
818         * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
819         Complain about t not being a variable if t is OVERLOAD even
820         when processing_template_decl.
822 2017-06-21  David Malcolm  <dmalcolm@redhat.com>
824         * parser.c (get_cast_suggestion): New function.
825         (maybe_add_cast_fixit): New function.
826         (cp_parser_cast_expression): Capture the location of the closing
827         parenthesis.  Call maybe_add_cast_fixit when emitting warnings
828         about old-style casts.
830 2017-06-20  Jason Merrill  <jason@redhat.com>
832         PR c++/80972 - C++17 ICE with attribute packed.
833         * call.c (build_over_call): Allow a TARGET_EXPR from reference
834         binding.
836 2017-06-20  Nathan Sidwell  <nathan@acm.org>
838         * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
839         (nelts_identifier): Delete.
840         * decl.c (initialize_predefined_identifiers): Remove nelts.
842         PR c++/67074 - namespace aliases
843         * decl.c (duplicate_decls): Don't error here on mismatched
844         namespace alias.
845         * name-lookup.c (name_lookup::add_value): Matching namespaces are
846         not ambiguous.
847         (diagnose_name_conflict): Namespaces are never redeclarations.
848         (update_binding): An alias can match a real namespace.
850 2017-06-19  Jason Merrill  <jason@redhat.com>
852         PR c++/80562 - ICE with constexpr if.
853         * semantics.c (finish_if_stmt_cond): Call
854         instantiate_non_dependent_expr.
856         PR c++/80829 - ICE with constexpr copy of base subobject.
857         * constexpr.c (clear_no_implicit_zero): New.
858         (cxx_eval_call_expression): Call it.
860 2017-06-19  Nathan Sidwell  <nathan@acm.org>
862         PR c++/81124
863         PR c++/79766
864         * name-lookup.c (set_decl_namespace): Don't follow using
865         directives and ignore using decls.  Only check overly-explicit
866         scope after discovering decl.
868 2017-06-19  Jason Merrill  <jason@redhat.com>
870         PR c++/81073 - constexpr and static var in statement-expression.
871         * typeck2.c (store_init_value): Always call
872         require_potential_constant_expression.
873         * pt.c (convert_nontype_argument): Likewise.
874         * constexpr.c (potential_constant_expression_1): Adjust message.
875         Use decl_maybe_constant_var_p instead of decl_constant_var_p.
876         * decl2.c (decl_maybe_constant_var_p): Consider initializer.
878 2017-06-19  Nathan Sidwell  <nathan@acm.org>
880         * pt.c (coerce_template_parms): Fix indentation.
881         (tsubst_decl): Remove repeated SET_DECL_RTL.  Move VAR_P handling
882         in to single block.
884         PR c++/81119
885         * name-lookup.c (update_binding): Only warn about constructors
886         hidden by functions.
888 2017-06-17  Jason Merrill  <jason@redhat.com>
890         PR c++/60063 - -Wunused-local-typedefs and templates.
891         * decl2.c (is_late_template_attribute): Return false for "used".
893         PR c++/70844 - -Wuseless-cast and inheriting constructor.
894         * method.c (forward_parm): Suppress warn_useless_cast.
896 2017-06-16  Jason Merrill  <jason@redhat.com>
898         PR c++/81045 - Wrong type-dependence with auto return type.
899         * pt.c (type_dependent_expression_p): An undeduced auto outside the
900         template isn't dependent.
901         * call.c (build_over_call): Instantiate undeduced auto even in a
902         template.
904         PR c++/80465 - ICE with generic lambda with noexcept-specifier.
905         * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
906         set longer for a generic lambda.
908         PR c++/80614 - Wrong mangling for C++17 noexcept type
909         * mangle.c (write_type): Put the eh spec back on the function type.
911         PR c++/81102 - Wrong error with partial specialization.
912         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
913         types.  Do type deduction later.
915         PR c++/81074 - ICE with partial specialization of member template.
916         PR c++/71747
917         * pt.c (get_partial_spec_bindings): Only coerce innermost args.
919         PR c++/80831 - ICE with -fsyntax-only.
920         * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
922         PR c++/80639 - ICE with invalid PMF initialization.
923         PR c++/80043 - ICE with -fpermissive
924         * typeck.c (convert_for_assignment): Recurse when instantiate_type
925         returns without an error.
927 2017-06-16  Nathan Sidwell  <nathan@acm.org>
929         * pt.c (tsubst_baselink): Fix & clarify formatting.
931         * cp-tree.h (build_this_parm, cp_build_parm_decl,
932         build_artificial_parm): Add FN parm.
933         * decl.c (start_cleanup_fn): Adjust.
934         (build_this_parm): Add FN parm, pass it through.
935         (grokfndecl): Adjust parm building.
936         * decl2.c (cp_build_parm_decl): Add FN parm, set context.
937         (build_artificial_parm): Add FN parm, pass through.
938         (maybe_retrofit_in_chrg): Adjust parm building.
939         (start_static_storage_duration_function): Likwise.
940         * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
941         * method.c (implicitly_declare_fn): Likewise.
942         * parser.c (inject_this_parameter): Likewise.
944         Symbol tables are insert only.
945         * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
946         derive from pointer_hash.  Make undeletable.
948         * class.c (resort_type_method_vec): Avoid potential unsigned
949         overflow.
951         Don't defer noexcept_deferred_spec.
952         * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
953         * decl.c (cxx_init_decl_processing): Initialize
954         noexcept_deferred_spec.
955         * except.c (unevaluated_noexcept_spec): Delete.
956         * class.c (deduce_noexcept_on_destructor): Use
957         noexcept_deferred_spec directly.
958         * method.c (implicitly_declare_fn): Likewise.
960         Make keyed_classes a vector.
961         * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
962         (keyed_classes): Declare as vector.
963         * decl.c (keyed_classes): Define.
964         (cxx_init_decl_processing): Allocate it.
965         (record_key_method_defined): Use vec_safe_push.
966         * class.c (finish_struct_1): Likewise.
967         * pt.c (instantiate_class_template_1): Likewise.
968         * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
970         Make rtti lazier
971         * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
972         TK_VMI_CLASS_TYPES, TK_MAX.  Delete TK_FIXED.
973         (tinfo_names): New.
974         (typeid_ok_p): Add quotes to error messages.  Use get_tinfo_desc.
975         (get_tinfo_decl): Use get_tinfo_desc.
976         (get_pseudo_ti_init): Likewise. Adjust VMI construction.
977         (create_pseudo_type_info): Delete.
978         (get_pseudo_ti_index): Just determine the index.
979         (get_tinfo_desc): New.  Create all types lazily.
980         (create_tinfo_types): Just allocate the descriptor array.
981         (emit_support_tinfos): Use non-inserting type lookup.  Set builtin
982         location.
984 2017-06-15  Martin Sebor  <msebor@redhat.com>
986         PR c++/80560
987         * call.c (first_non_public_field, maybe_warn_class_memaccess): New
988         functions.
989         (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
990         (build_cxx_call): Call maybe_warn_class_memaccess.
992 2017-06-14  Jakub Jelinek  <jakub@redhat.com>
994         * cp-gimplify.c (cp_genericize_r): Turn most of the function
995         into a switch (TREE_CODE (stmt)) statement from long else if
996         sequence.
998 2017-06-13  Jakub Jelinek  <jakub@redhat.com>
1000         PR c++/80973
1001         * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
1002         argument even if it has REFERENCE_TYPE.
1004         PR c++/80984
1005         * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
1006         BLOCK_VARS (outer) chain.
1007         (cxx_omp_const_qual_no_mutable): Likewise.
1009 2017-06-13  Martin Liska  <mliska@suse.cz>
1011         PR sanitize/78204
1012         * class.c (build_base_path): Use sanitize_flags_p.
1013         * cp-gimplify.c (cp_genericize_r): Likewise.
1014         (cp_genericize_tree): Likewise.
1015         (cp_genericize): Likewise.
1016         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1017         * decl.c (compute_array_index_type): Likewise.
1018         (start_preparsed_function): Likewise.
1019         * decl2.c (one_static_initialization_or_destruction): Likewise.
1020         * init.c (finish_length_check): Likewise.
1021         * lambda.c (maybe_add_lambda_conv_op): Likewise.
1022         * typeck.c (cp_build_binary_op): Likewise.
1023         (build_static_cast_1): Likewise.
1025 2017-06-11  Jason Merrill  <jason@redhat.com>
1027         * error.c (dump_expr): Use is_this_parameter.
1029         * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
1030         id_equal.
1032 2017-06-09  Jason Merrill  <jason@redhat.com>
1034         Missing bits from N4268, constant evaluation for all non-type args.
1035         * call.c (build_converted_constant_expr): Rename from
1036         build_integral_nontype_arg_conv, handle all types.
1037         * pt.c (convert_nontype_argument): In C++17 call it for all types.
1038         Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
1039         * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
1041         Overhaul pointer-to-member conversion and template argument handling.
1042         * call.c (standard_conversion): Avoid creating ck_pmem when the
1043         class type is the same.
1044         * cvt.c (can_convert_qual): Split from
1045         perform_qualification_conversions.
1046         * constexpr.c (cxx_eval_constant_expression): Check it.
1047         * typeck.c (convert_ptrmem): Only cplus_expand_constant if
1048         adjustment is necessary.
1049         * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
1050         (convert_nontype_argument): Avoid redundant error.
1052         * call.c (convert_like_real): Remove "inner" parameter.
1053         Don't replace a constant with its value.
1054         * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
1056         * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
1057         nullptr_node.
1059         * parser.c (cp_parser_constant_expression): Check
1060         potential_rvalue_constant_expression after decay_conversion.
1061         * pt.c (convert_nontype_argument): Don't require linkage in C++17.
1063         PR c++/80384 - ICE with dependent noexcept-specifier
1064         * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
1065         noexcept-specifier.
1067         * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
1069 2017-06-09  Jan Hubicka  <hubicka@ucw.cz>
1071         * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
1072         * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
1073         (excpet.c): Mark terminate as cold.
1075 2017-06-08  Jakub Jelinek  <jakub@redhat.com>
1077         PR c/81006
1078         * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
1079         to sizetype before size_binop.
1081         PR c++/81011
1082         * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
1083         to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
1084         and OMP_CLAUSE_SHARED_READONLY flags.
1086 2017-06-08  Jan Hubicka  <hubicka@ucw.cz>
1088         * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
1090 2017-06-07  Nathan Sidwell  <nathan@acm.org>
1092         * class.c (layout_class_type): Restructure overlong-bitfield tpe
1093         search.
1095 2017-06-07  Jonathan Wakely  <jwakely@redhat.com>
1097         PR c++/80990
1098         * pt.c (do_class_deduction): Build qualified type.
1100 2017-06-06  Nathan Sidwell  <nathan@acm.org>
1102         * name-lookup.c (suggest_alternatives_for): Use qualified lookup
1103         sans using directives.  Don't walk into inline namespaces.
1105         PR c++/80979
1106         * name-lookup.c (adl_class_only): Don't add visible friends.
1108 2017-06-05  Volker Reichelt  <v.reichelt@netcologne.de>
1110         * parser.c (cp_parser_base_specifier): Fix typos in error messages.
1112 2017-06-02  Nathan Sidwell  <nathan@acm.org>
1114         Remove lang_type_ptrmem.
1115         * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
1116         into ...
1117         (lang_type_class): ... this.  Reorder bitfields.  Rename to ...
1118         (lang_type): ... this.  Delete old definition.
1119         (lang_type_ptrmem): Delete.
1120         (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC.  Adjust uses.
1121         (LANG_TYPE_PTRMEM_CHECK): Delete.
1122         (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
1123         (TYPE_PTRMEMFUNC_TYPE): New.  Use TYPE_LANG_SLOT_1.
1124         * decl.c (build_ptrmemfunc_type): Adjust.
1125         * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
1126         (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
1127         
1128         * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
1129         setting.
1130         
1131         Remove cp_binding_level::namespaces
1132         * name-lookup.h (cp_binding_level): Lose namespaces field.
1133         * name-lookup.c (add_decl_to_level): Chain namespaces on the names
1134         list.
1135         (suggest_alternatives_for): Adjust for namespace list.  Do
1136         breadth-first search.
1137         * decl2.c (collect_source_refs): Namespaces are on the regulr
1138         list.
1139         (collect_ada_namespace): Likewise.
1141 2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1143         * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
1144         warning.
1146 2017-06-01  Ville Voutilainen  <ville.voutilainen@gmail.com>
1148         PR c++/80812
1149         * method.c (constructible_expr): Strip array types before calling
1150         build_value_init.
1152 2017-06-01  Paolo Carlini  <paolo.carlini@oracle.com>
1154         PR c++/80896
1155         * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
1156         for case INDIRECT_REF too in the main switch.
1158 2017-05-31  Jason Merrill  <jason@redhat.com>
1160         PR c++/80840 - ICE with constexpr and reference
1161         * pt.c (convert_nontype_argument): Don't test whether a decl is
1162         value-dependent when binding to a reference.
1164 2017-05-31  Nathan Sidwell  <nathan@acm.org>
1166         * cp-tree.h (lang_decl_slector): New enum.
1167         (lang_decl_base): Make selector an enum.  Drop decomposition_p
1168         field.
1169         (lang_decl): Use enum for discrimination.
1170         (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
1171         LANG_DECL_DEOMP_CHECK): Use enum.
1172         (DECL_DECOMPOSITION_P): Use selector value.
1173         (SET_DECL_DECOMPOSITION_P): Delete.
1174         (retrofit_lang_decl): Lose SEL parm.
1175         (fit_decomposition_lang_decl): Declare.
1176         * decl.c (cp_finish_decomp, grokdeclarator): Use
1177         fit_decomposition_lang_decl.
1178         * lex.c (maybe_add_lang_decl_raw): New. Broken out of
1179         retrofit_lang_decl.
1180         (set_decl_linkage): New.  Broken out of retrofit_lang_decl.  Use enum.
1181         (fit_decomposition_lang_decl): Likewise.
1182         (retrofit_lang_decl): Use worker functions.
1183         (cxx_dup_lang_specific_decl): Use selector enum.
1184         (maybe_add_lang_type_raw): New.  Broken out of ...
1185         (cxx_make_type_name): ... here.  Call it.
1187 2017-05-30  Jason Merrill  <jason@redhat.com>
1189         PR c++/80856 - ICE with local extern in template
1190         * semantics.c (finish_call_expr): Replace a local extern overload
1191         set in a template with the IDENTIFIER_NODE.
1193 2017-05-30  David Malcolm  <dmalcolm@redhat.com>
1195         * call.c (perform_implicit_conversion_flags): Convert
1196         "from %qT to %qT" to "from %qH to %qI" in diagnostic.
1197         (print_conversion_rejection): Replace pairs of %qT with
1198         %qH and %qI in various places.
1199         (build_user_type_conversion_1): Likewise.
1200         (build_integral_nontype_arg_conv): Likewise.
1201         (build_conditional_expr_1): Likewise.
1202         (convert_like_real): Likewise.
1203         (convert_arg_to_ellipsis): Likewise.
1204         (joust): Likewise.
1205         (initialize_reference): Likewise.
1206         * cvt.c (cp_convert_to_pointer): Likewise.
1207         (cp_convert_to_pointer): Likewise.
1208         (convert_to_reference): Likewise.
1209         (ocp_convert): Likewise.
1210         * error.c (cp_printer): Gain bool and const char ** parameters.
1211         (struct deferred_printed_type): New struct.
1212         (class cxx_format_postprocessor): New class.
1213         (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
1214         to pp->m_format_postprocessor.
1215         (comparable_template_types_p): New function.
1216         (newline_and_indent): New function.
1217         (arg_to_string): New function.
1218         (print_nonequal_arg): New function.
1219         (print_template_differences): New function.
1220         (type_to_string_with_compare): New function.
1221         (print_template_tree_comparison): New function.
1222         (append_formatted_chunk): New function.
1223         (add_quotes): New function.
1224         (cxx_format_postprocessor::handle): New function.
1225         (defer_phase_2_of_type_diff): New function.
1226         (cp_printer): Add "quoted" and "buffer_ptr" params.  Implement
1227         %H and %I.
1228         * typeck.c (cp_build_binary_op): Replace pairs of %qT with
1229         %qH and %qI in various places.
1230         (convert_member_func_to_ptr): Likewise.
1231         (build_reinterpret_cast_1): Likewise.
1232         (convert_for_assignment): Likewise.
1233         * typeck2.c (check_narrowing): Likewise.
1235 2017-05-30  Nathan Sidwell  <nathan@acm.org>
1237         Kill IDENTIFIER_NAMESPACE_BINDINGS
1238         * cp-tree.h (lang_identifier): Delete namespace_bindings.
1239         (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
1240         (lang_decl_ns): Add bindings.
1241         (DECL_NAMESPACE_BINDINGS): New.
1242         * lex.c (retrofit_lang_decl): Create namespace hash table.
1243         * name-lookup.c (find_namespace_slot): Change to use hash-map.
1244         * ptree.c (cxx_print_binding): Delete.
1245         (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
1247         * cp-tree.def (OVERLOAD): Fix comment.
1248         * cp-tree.h: Fix comments and whitespace.
1249         * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
1250         * name-lookup.c (add_decl_to_level): Assert not class.
1251         (check_local_shadow): Use OVL_P.
1252         (pushdecl_with_scope_1): Rename to ...
1253         (do_pushdecl_with_Scope): ... here.
1254         (do_nonmember_using_decl): Use qualified_namespace_lookup return
1255         value.
1256         (push_class_level_binding_1): Use OVL_P.
1257         (pushdecl_namespace_level): Use do_pushdecl_with_scope.
1258         (pushtag_1): Rename to ...
1259         (do_pushtag): ... here.  Adjust do_pushdecl_with_scope call.
1260         (pushtag): Adjust.
1261         (store_class_bindings): Do not time here.
1262         * name-lookup.h (pushdecl_outermost_localscope): Reorder.
1263         * pt.c (listify): Declare argvec at point of initialization.
1265         PR c++/80913
1266         * name-lookup.c (add_decl_to_level): Assert not making a circular
1267         chain.
1268         (update_binding): Don't prematurely slide artificial decl.
1270 2017-05-29  Alexandre Oliva <aoliva@redhat.com>
1272         * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
1274 2017-05-29  Nathan Sidwell  <nathan@acm.org>
1276         PR c++/80891 (#1,#5)
1277         * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
1278         * name-lookup.c (name_lookup): Add deduping field.
1279         (name_lookup::preserve_state, name_lookup::restore_state): Deal
1280         with deduping.
1281         (name_lookup::add_overload): New.
1282         (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
1283         (name_lookup::search_adl): Set deduping.  Don't unmark here.
1284         * pt.c (most_specialized_instantiation): Revert previous change,
1285         Assert not given duplicates.
1286         * tree.c (lookup_mark): Just mark the underlying decls.
1287         (lookup_maybe_add): Dedup using marked decls.
1289         PR c++/80891 (#4)
1290         * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
1291         * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
1293         Stat hack representation
1294         * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
1295         MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
1296         (stat_hack): New.
1297         (find_namespace_binding): Replace with ...
1298         (find_namespace_slot): ... this.
1299         (find_namespace_value): New.
1300         (name_lookup::search_namespace_only,
1301         name_lookup::adl_namespace_only): Adjust.
1302         (update_binding): Add SLOT parameter, adjust.
1303         (check_local_shadow): Use find_namespace_value.
1304         (set_local_extern_decl_linkage): Likewise.
1305         (do_pushdecl): Adjust for namespace slot.
1306         (push_local_binding): Assert not a namespace binding.
1307         (check_for_out_of_scope_variable): Use find_namespace_value.
1308         (set_identifier_type_value_with_scope): Likewise.
1309         (get_namespace_binding): Likewise.
1310         (set_namespace_binding): Delete.
1311         (set_global_binding): Directly update the binding.
1312         (finish_namespace_using_decl): Likewise.
1313         (lookup_type_scope_1): Use find_namespace_slot and update.
1314         (do_push_nested_namespace): Use find_namespace_value.
1316         PR c++/80891 (#1)
1317         * pt.c (most_specialized_instantiation): Cope with duplicate
1318         instantiations.
1320         PR c++/80891 (#3)
1321         * cp-tree.h (build_min_nt_call_vec): Declare.
1322         * decl.c (build_offset_ref_call_from_tree): Call it.
1323         * parser.c (cp_parser_postfix_expression): Likewise.
1324         * pt.c (tsubst_copy_and_build): Likewise.
1325         * semantics.c (finish_call_expr): Likewise.
1326         * tree.c (build_min_nt_loc): Keep unresolved lookups.
1327         (build_min): Likewise.
1328         (build_min_non_dep): Likewise.
1329         (build_min_non_dep_call_vec): Likewise.
1330         (build_min_nt_call_vec): New.
1332         PR c++/80891 (#2)
1333         * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
1334         (ovl_used): New.
1335         (lookup_keep): Call it.
1337 2017-05-26  Nathan Sidwell  <nathan@acm.org>
1339         Implement DR2061
1340         * name-lookup.c (push_inline_namespaces): New.
1341         (push_namespace): Look inside inline namespaces.
1343         Inline and using namespace representation change.
1344         * cp-tree.h (struct lang_decl_ns): Delete ns_using.  Add usings,
1345         inlinees as vector.
1346         (DECL_NAMESPACE_USING): Adjust.
1347         (DECL_NAMESPACE_INLINEES): New.
1348         * name-lookup.h (struct cp_binding_level): Change usings
1349         representation.
1350         * name-lookup.c (name_lookup::do_queue_usings,
1351         name_lookup::queue_usings): Adjust.
1352         (name_lookup::search_namespace, name_lookup::search_usings,
1353         name_lookup::queue_namespace): Adjust.
1354         (name_lookup::adl_namespace_only): Adjust.
1355         (add_using_namespace, push_namespace): Push onto vector.
1356         (pop_namespace): Add timing logic.
1358         * call.c (build_operator_new_call): Do namelookup and ADL here.
1359         (build_new_op_1): Likewise.
1360         * name-lookup.h (lookup_function_nonclass): Delete declaration.
1361         (do_using_directive): Likewise.
1362         * name-lookup.c (set_namespace_binding, push_local_binding): Don't
1363         declare early.
1364         (struct scope_binding): Delete.
1365         (EMPTY_SCOPE_BINDING): Delete.
1366         (set_decl_namespace): Use OVL_P.
1367         (finish_local_using_decl): Lose unnecesary checks.
1368         (lookup_function_nonclass): Delete.
1369         (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
1371         * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
1372         (ovl_iterator): Add allow_inner field.  Adjust ctor.  Make
1373         unduplicatable.
1374         (ovl_iterator::maybe_push, ovl_iterator::pop): New.
1375         (lkp_iterator): Add outer field.  Adjust ctor.
1376         (lkp_iterator::operator++): New.
1377         (lookup_mark, lookup_maybe_add): Declare.
1378         * name-lookup.c (name_lookup): Delete fn_set member.
1379         (name_lookup::preserve_state, name_lookup::restore_state): Unmark
1380         and mark lookup.
1381         (name_lookup::add_value): Use lookup_add directly.
1382         (name_lookup::add_fns: Use lookup_maybe_add.
1383         (name_lookup::search_adl): Mark and unmark fns.
1384         (pushdecl): Adjust.
1385         * pt.c (check_explicit_specialization): Use lookup_add directly.
1386         * ptree.c (cxx_print_xnode): Show complete overload structure.
1387         * tree.c (lookup_mark, lookup_maybe_add): New.
1389         * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
1391 2017-05-26  Jakub Jelinek  <jakub@redhat.com>
1393         * cp-tree.h (struct lang_decl_decomp): New type.
1394         (struct lang_decl): Add u.decomp.
1395         (LANG_DECL_DECOMP_CHECK): Define.
1396         (DECL_DECOMPOSITION_P): Note it is set also on the vars
1397         for user identifiers.
1398         (DECL_DECOMP_BASE): Define.
1399         (retrofit_lang_decl): Add extra int = 0 argument.
1400         * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
1401         use it to influence the selector choices and for selector
1402         0 to non-zero transition copy old content.
1403         (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
1404         * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
1405         !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR.  Adjust warning
1406         wording if decl is a structured binding.
1407         (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
1408         Set DECL_DECOMP_BASE.  Ignore DECL_READ_P sets from initialization
1409         of individual variables for tuple structured bindings.
1410         (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
1411         Clear DECL_DECOMP_BASE.
1412         * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
1413         * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
1414         is expected.
1415         * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
1416         DECL_VALUE_EXPR.
1418 2017-05-25  Jason Merrill  <jason@redhat.com>
1420         PR c++/80605 - __is_standard_layout and zero-length array
1421         * class.c (check_bases): Use DECL_FIELD_IS_BASE.
1423 2017-05-25  Nathan Sidwell  <nathan@acm.org>
1425         Kill OVL_CURRENT, OVL_NEXT.
1426         * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
1427         * name-lookup.c (set_decl_namespace): Use ovl_iterator.
1428         (consider_binding_level): Use OVL_FIRST.
1429         (cp_emit_debug_info_for_using): Use lkp_iterator.
1430         * pt.c (check_explicit_specialization): Use ovl_iterator.       
1432         Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
1433         * cp-tree.h (lang_decl_ns): Remove ns_users field.
1434         (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
1435         (TREE_INDIRECT_USING): Delete.
1436         * name-lookup.h (is_associated_namespace): Delete.
1437         * name-lookup.c (name_lookup::search_usings,
1438         name_lookup::do_queue_usings): Usings are always direct.
1439         (is_associated_namespace): Delete.
1440         (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
1441         (namespace_ancestor_1, namespace_ancestor): Delete.
1442         (push_using_directive_1, push_using_directive): Delete.
1443         (add_using_namespace_1): Delete.
1444         (add_using_namespace): Reimplement.
1445         (emit_debug_info_using_namespace): New.
1446         (finish_namespace_using_directive, finish_local_using_directive,
1447         push_namespace): Adjust.
1448         * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
1450 2017-05-25  Volker Reichelt  <v.reichelt@netcologne.de>
1452         * semantics.c (finish_handler_parms): Warn about non-reference type
1453         catch handlers.
1455 2017-05-25  Nathan Sidwell  <nathan@acm.org>
1457         Reimplement unqualified namespace lookup.
1458         * name-lookup.c (name_lookup::using_pair,
1459         name_lookup::using_queue): New typedefs.
1460         (name_lookup::queue_namespace, name_lookup::do_queue_usings,
1461         name_lookup::queue_usings): New.
1462         (name_lookup::search_unqualified): New.
1463         (merge_functions, same_entity_p, ambiguous_decl,
1464         unqualified_namespace_lookup_1, unqualified_namespace_lookup,
1465         lookup_using_namespace): Delete.
1466         (lookup_name_real_1): Adjust.
1468         Reimplement qualified namespace lookup.
1469         * name-lookup.c (name_lookup::flags): New member.  Adjust ctor.
1470         (name_lookup::ambiguous, name_lookup::add_value,
1471         name_lookup::add_type, name_lookup::process_binding): New.
1472         (name_lookup::search_namespace_only,
1473         name_lookup::search_namespace, name_lookup::search_usings): New.
1474         (name_lookup::search_qualified): New.
1475         (do_nonmember_using_decl, suggest_alternatives_for,
1476         lookup_qualified_name): Adjust.
1477         (tree_vec_contains): Delete.
1478         (qualified_lookup_using_namespace): Rename to ...
1479         (qualified_namespace_lookup): ... here.  Reimplement.
1481         Reimplement ADL.
1482         * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
1483         * name-lookup.h (lookup_arg_dependent): Return plain tree.
1484         * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
1485         arg_assoc_args_vec, arg_assoc_type, add_function,
1486         arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
1487         arg_assoc_class, arg_assoc_template_arg, arg_assoc,
1488         lookup_arg_dependent_1): Delete.
1489         (name_lookup): New lookup object.
1490         (name_lookup::preserve_state, name_lookup::restore_state,
1491         name_lookup::mark_seen, name_lookup::find_and_mark,
1492         name_lookup::add_fns, name_lookup::adl_namespace_only,
1493         name_lookup::adl_namespace, name_lookup::adl_class_only,
1494         name_lookup::adl_bases, name_lookup::adl_class,
1495         name_lookup::adl_expr, name_lookup::adl_type,
1496         name_lookup::adl_template_arg, name_lookup::search_adl): New.
1497         (lookup_arg_dependent): Return a plain tree.  Adjust.
1498         (is_associated_namespace): Move later.
1499         
1500 2017-05-24  Nathan Sidwell  <nathan@acm.org>
1502         * friend.c (do_friend): Remove check for existing decl.
1503         * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
1504         * name-lookup.c (push_local_binding): Directly look for binding.
1505         (lookup_name_innermost_nonclass_level_1): Delete.
1506         (lookup_name_innermost_nonclass_level): Delete.
1508         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
1510         * cp-tree.h (cp_free_lang_data): Add extern.
1511         (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
1512         ATTRIBUTE_PURE.
1513         (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
1514         * typeck.c (type_unknown_p): Delete.
1515         * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
1516         overload management.
1517         (dependent_name): Likewise.
1518         (decl_anon_ns_mem_p): Simplify.
1520 2017-05-24  Jonathan Wakely  <jwakely@redhat.com>
1522         PR c++/80544
1523         * tree.c (reshape_init): Use unqualified type for direct enum init.
1524         * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
1525         (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
1526         non-class destination types.
1527         (build_const_cast_1): Strip cv-quals from destination types.
1528         (build_static_cast, build_reinterpret_cast, build_const_cast)
1529         (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
1531 2017-05-24  Martin Sebor  <msebor@redhat.com>
1533         PR c/80731
1534         * call.c (fully_fold_internal): Adjust.
1536 2017-05-24  Nathan Sidwell  <nathan@acm.org>
1538         * cp-tree.h (ovl_skip_hidden): Declare.
1539         * tree.c (ovl_skip_hidden): New.
1540         * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
1541         (lookup_arg_dependent_1): Likewise.
1542         (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
1543         (hidden_name_p, remove_hidden_names): Delete.
1544         (lookup_name_real_1): Do not strip hidden names.
1545         * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
1547         * cp-tree.h (OVL_HIDDEN_P): New.
1548         (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
1549         (ovl_iterator::reveal_node): Declare.
1550         * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
1551         (ovl_insert): Order on hiddenness.
1552         (ovl_iterator::reveal_node): New.
1553         * name-lookup.c (anticipated_builtin_p): New.
1554         (supplement_binding_1): Use it.
1555         (set_local_extern_decl_linkage): Use hidden_p.
1556         (do_pushdecl): Deal with unhiding a hidden decl, use
1557         anticipated_builtin_p.
1558         (do_nonmember_using_decl): Use anticipated_decl_p.
1559         (lookup_name_real_1): Use DECL_HIDDEN_P.
1561 2017-05-23  Jason Merrill  <jason@redhat.com>
1563         -Wunused and C++17 structured bindings
1564         * decl.c (poplevel): Don't warn about unused structured bindings,
1565         only real variables.
1566         * error.c (dump_simple_decl): Handle structured bindings.
1567         * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
1569 2017-05-23  Nathan Sidwell  <nathan@acm.org>
1571         * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
1572         * name-lookup.c (create_local_binding): New.
1573         (update_binding): New.
1574         (pushdecl_maybe_friend_1): Rename to ...
1575         (do_pushdecl): ... this.  Reimplement.
1576         (pushdecl): Adjust.
1577         (push_overloaded_decl_1, push_overloaded_decl): Delete.
1579 2017-05-23  Jason Merrill  <jason@redhat.com>
1581         PR c++/80396 - built-in for make_integer_sequence.
1582         * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
1583         (expand_integer_pack, expand_builtin_pack_call): New.
1584         (find_parameter_packs_r): Check builtin_pack_call_p.
1585         (check_for_bare_parameter_packs): Handle it.
1586         (tsubst_pack_expansion): Call expand_builtin_pack_call.
1587         (declare_integer_pack): New.
1588         (init_template_processing): Call it.
1589         * decl2.c (mark_used): Check builtin_pack_fn_p.
1591 2017-05-23  Nathan Sidwell  <nathan@acm.org>
1593         * name-lookup.c (find_namespace_binding): New.
1594         (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
1595         (set_identifier_type_value_with_scope): Use find_namespace_binding.
1596         (find_binding, cp_binding_level_find_binding_for_name,
1597         binding_for_name, namespace_binding_1): Delete.
1598         (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
1599         (get_namespace_binding, set_namespace_binding,
1600         finish_namespace_using_decl, unqualified_namespace_lookup_1,
1601         qualified_lookup_using_namespace, lookup_type_scope_1,
1602         lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
1604         PR c++/80866
1605         * parser.c (cp_parser_template_id): Keep the lookup when stashing
1606         the template_id.
1608         * cp-tree.h (DECL_HIDDEN_P): New.
1609         * name-lookup.c (set_decl_context,
1610         set_local_extern_decl_linkage): New, broken out of ...
1611         (pushdecl_maybe_friend_1): ... here.  Call them.
1613 2017-05-23  Thomas Schwinge  <thomas@codesourcery.com>
1615         * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
1616         "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
1617         "VECTOR_LENGTH".
1619 2017-05-23  Nathan Sidwell  <nathan@acm.org>
1621         * cp-tree.h (OVL_P): New.
1622         * name-lookup.h (push_local_binding): Delete.
1623         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
1624         (finish_namespace_using_decl, finish_local_using_decl): ... here
1625         * name-lookup.c (add_decl_to_level): Swap args.
1626         (pop_bindings_and_leave_scope): Look inside TREE_LIST.
1627         (diagnose_name_conflict): Check contexts are same for redecl.
1628         (update_local_overload): New.
1629         (compparms_for_decl_and_using): Rename to ...
1630         (matching_fn_p): ... here.
1631         (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
1632         push_local_bindings call.
1633         (push_local_binding): Make static, replace FLAGS arg with
1634         IS_USING.
1635         (validate_nonmember_using_decl): Use OVL_FIRST.
1636         (do_nonmember_using_decl): Use in/out parameters.  Use
1637         lkp_iterator and simplify.
1638         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
1639         (finish_namespace_using_decl, finish_local_using_decl): ... here.
1640         Adjust.
1641         (lookup_type_current_level): Delete.
1642         * parser.c (cp_parser_using_declaration): Adjust.
1643         * pt.c (tsubst_expr): Adjust.
1645 2017-05-22  Nathan Sidwell  <nathan@acm.org>
1647         * name-lookup.h (parse_using_directive): Replace with ...
1648         (finish_namespace_using_directive): ... this and ...
1649         (finish_local_using_directive): ... this.
1650         * name-lookup.c (add_using_namespace_1): Move later.
1651         (add_using_namespace): Move later, add namespace_p arg, remove
1652         indirect arg.
1653         (push_using_directive_1): Directly recurse.
1654         (do_using_directive, parse_using_directive): Delete, split into ...
1655         (finish_namespace_using_directive): ... this and ...
1656         (finish_local_using_directive): ... this.
1657         (push_namespace): Use add_using_namespace.
1658         * parser.c (cp_parser_using_directive): Call
1659         finish_namespace_using_directive or finish_local_using_directive.
1660         * pt.c (tsubst_expr): Call finish_local_using_directive.
1662         * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
1663         * cp-tree.h (raw_dump_id): Declare.
1664         * decl2.c (raw_dump_id): Define.
1665         (dump_tu): Use raw_dump_id.
1667         * config-lang.in (gtfiles): Sort list, break lines.
1669         * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
1670         (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
1671         ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
1672         CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
1673         CPTI_RETHROW_FN): New.
1674         (noexcept_deferred_spec): New.
1675         (terminate_node, call_unexpected_node): Rename to ...
1676         (terminate_fn, call_unexpected_fn): ... here.
1677         (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
1678         allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
1679         * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
1680         (init_exception_processing): Adjust.
1681         (declare_library_fn): Create and push the fns here.
1682         (do_get_exception_ptr, do_begin_catch, do_end_catch,
1683         do_allocate_exception_ptr, do_free_exception_ptr): Adjust
1684         declare_library_fn use.
1685         (unevaluated_noexcept_spec): Adjust.
1686         * cp-gimplify.c (genericize_eh_spec_block,
1687         gimplify_most_not_throw_expr): Adjust.
1689         * name-lookup.c (pushdecl_top_level,
1690         pushdecl_top_level_and_finish): Move after namespace pushing and
1691         popping functions.
1692         (push_to_top_level): Rename to ...
1693         (do_push_to_top_level): ... here.  Remove timing code.
1694         (pop_from_top_level_1): Rename to ...
1695         (do_pop_from_top_level): ... here.
1696         (do_push_nested_namespace, do_pop_nested_namespace)
1697         (push_to_top_level): New wrapper for do_push_to_top_level.
1698         (pop_from_top_level): Adjust.
1699         (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
1701 2017-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1703         * config-lang.in (gtfiles): Add c-family/c-format.c,
1704         except.c, init.c, lambda.c and friend.c.
1705         * class.c (dvirt_fn): Move out of function scope,
1706         add GTY attribute.
1707         * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
1708         * init.c (fn): Likewise.
1709         * lambda.c (ptr_id, max_id): Likewise.
1710         * friend.c (global_friend): Add GTY attribute.
1712 2017-05-19  Nathan Sidwell  <nathan@acm.org>
1714         * call.c (add_list_candidates): Use OVL_FIRST.
1715         (build_new_method_call_1): Likewise.
1716         * cp-tree.h (OVL_SINGLE_P): New.
1717         (TYPE_HIDDEN_P): New.
1718         * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
1719         * dump.c (cp_tump_tree): Adjust overload dumping.
1720         * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
1721         printing.
1722         * method.c (lazily_declare_fn): Assert we added it.
1723         * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
1724         OVL_FIRST.
1725         (cp_parser_template_name): Use lkp_iterator.
1726         * pt.c (begin_template_parm_list): Fixup comment.
1727         (instantiate_class_template_1): Use TYPE_HIDDEN_P.
1728         * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
1729         (ovl_scope): Use lkp_iterator.
1731 2017-05-19  Thomas Schwinge  <thomas@codesourcery.com>
1733         * parser.c (cp_parser_omp_clause_default): Handle
1734         "OMP_CLAUSE_DEFAULT_PRESENT".
1736         * parser.c (cp_parser_omp_clause_default): Avoid printing more
1737         than one syntax error message.
1739 2017-05-19  Nathan Sidwell  <nathan@acm.org>
1741         * class.c (class_dump_id): Define.
1742         (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
1743         * cp-objcp-common.c (cp_register_dumps): New.
1744         * cp-objcp-common.h (cp_register_dumps): Declare.
1745         (LANG_HOOKS_REGISTER_DUMPS): Override.
1746         * cp-tree.h (class_dump_id): Declare.
1748 2017-05-18  Nathan Sidwell  <nathan@acm.org>
1750         * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
1751         (OVL_USED_P): New.
1752         (lookup_keep): Declare.
1753         * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
1754         * pt.c (tsubst_copy): Assert lookup is persistent.
1755         * semantics.c (finish_call_expr): Use lkp_iterator, call
1756         lookup_keep.
1757         * tree.c (ovl_copy): New.
1758         (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
1759         (lookup_keep): New.
1761         * cp-tree.h (OVL_USED): Replace with ...
1762         (OVL_USING_P): ... this.
1763         (ovl_iterator::using_p): Adjust.
1764         * name-lookup.c (push_overloaded_decl_1,
1765         do_nonmember_using_decl): Adjust.
1766         * search.c (lookup_field_r): Adjust.
1767         * tree.c (ovl_insert, ovl_scope): Adjust.
1769         * cp-tree.h (lookup_add): Swap args.
1770         (ovl_cons, build_overload): Delete.
1771         * name-lookup.c (add_function, push_overloaded_decl_1,
1772         do_nonmember_using_decl, merge_functions, remove_hidden_names):
1773         Use lookup_add, ovl_insert.
1774         * pt.c (check_explicit_specialization): Use lookup_add.
1775         (do_class_deduction): Likewise. Refactor if.
1776         * tree.c (lookup_add): Swap args.
1777         (ovl_cons, build_overload): Delete.
1779         * name-lookup.c (find_local_binding): New, broken out of ...
1780         (lookup_name_innermost_nonclass_level_1): ... here.  Call it.
1781         (set_namespace_binding): Swap scope & name args.
1782         (namespace_binding_1): Likewise.
1783         (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
1784         (push_overloaded_decl_1): Likewise.
1785         (set_global_binding): Likewise.
1786         (get_namespace_binding): Adjust namespace_binding_1 call.
1788 2017-05-17  Nathan Sidwell  <nathan@acm.org>
1790         * cp-tree.h (default_hash_traits <lang_identifier *>): New
1791         specialization.
1792         * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
1793         (extern_c_fns): New hash table.
1794         (check_extern_c_conflict): New, broken out of ...
1795         (pushdecl_maybe_friend_1): ... here.  Call it.
1796         (c_linkage_bindings): Just look in hash table.
1798 2017-05-17  Ville Voutilainen  <ville.voutilainen@gmail.com>
1800         PR c++/80654
1801         PR c++/80682
1802         Implement new C++ intrinsics __is_assignable and __is_constructible.
1803         * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
1804         (is_xible): New.
1805         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1806         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
1807         * method.c (constructible_expr): Set cp_unevaluated.
1808         (is_xible_helper): New.
1809         (is_trivially_xible): Adjust.
1810         (is_xible): New.
1811         * parser.c (cp_parser_primary_expression): Handle
1812         RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
1813         (cp_parser_trait_expr): Likewise.
1814         * semantics.c (trait_expr_value): Handle
1815         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
1817 2017-05-17  Nathan Sidwell  <nathan@acm.org>
1819         * cp-tree.h (ovl_iterator::using_p): New predicate.
1820         (ovl_iterator::remove_node): New worker.
1821         (ovl_insert): Declare.
1822         * tree.c (ovl_insert): New.
1823         (ovl_iterator::remove_node): New.
1824         * class.c (add_method): Use ovl_iterator, ovl_insert.
1825         (clone_function_decl): Fix description.
1826         (clone_constructors_and_destructors): Use ovl_iterator.
1828         * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
1829         (maybe_warn_about_overly_private_class): Use ovl_iterator.
1830         (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
1831         (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
1832         (get_base_fndecls): Use ovl_iterator.
1833         (warn_hidden): Use OVL_NAME, ovl_iterator.
1834         (add_implicitly_declared_members): Use ovl_iterator.
1835         * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
1836         flatten nested if.
1837         (finish_shorthand_constraint): Simplify, use ovl_make.
1838         * pt.c (make_constrained_auto): Simplify.  Use ovl_make.
1839         * search.c (shared_member_p): Use ovl_iterator.
1840         (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
1841         (lookup_conversion_operator): Use OVL_FIRST.
1842         (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
1843         (look_for_overrides_here): Use ovl_iterator.
1844         (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
1845         * typeck.c (build_x_unary_op): Use ovl_make.
1847 2017-05-17  Martin Liska  <mliska@suse.cz>
1849         * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
1850         use it instead of int type.
1851         (dump_vtable): Likewise.
1852         (dump_vtt): Likewise.
1853         * decl2.c (dump_tu): Likewise.
1855 2017-05-16  David Malcolm  <dmalcolm@redhat.com>
1857         * call.c (enforce_access): Add access_failure_info * param and use
1858         it to record access failures.
1859         * cp-tree.h (class access_failure_info): New class.
1860         (enforce_access): Add access_failure_info * param, defaulting to
1861         NULL.
1862         (lookup_member): Likewise.
1863         (locate_field_accessor): New function decl.
1864         (perform_or_defer_access_check): Add access_failure_info * param,
1865         defaulting to NULL.
1866         * search.c (lookup_member): Add access_failure_info * param and
1867         pass it on to call to perform_or_defer_access_check.
1868         (matches_code_and_type_p): New function.
1869         (field_access_p): New function.
1870         (direct_accessor_p): New function.
1871         (reference_accessor_p): New function.
1872         (field_accessor_p): New function.
1873         (struct locate_field_data): New struct.
1874         (dfs_locate_field_accessor_pre): New function.
1875         (locate_field_accessor): New function.
1876         * semantics.c (perform_or_defer_access_check): Add
1877         access_failure_info * param, and pass it on to call to
1878         enforce_access.
1879         * typeck.c (access_failure_info::record_access_failure): New method.
1880         (access_failure_info::maybe_suggest_accessor): New method.
1881         (finish_class_member_access_expr): Pass an access_failure_info
1882         instance to the lookup_member call, and call its
1883         maybe_suggest_accessor method afterwards.
1885 2017-05-16  Marek Polacek  <polacek@redhat.com>
1887         PR sanitizer/80536
1888         PR sanitizer/80386
1889         * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
1891 2017-05-16  Nathan Sidwell  <nathan@acm.org>
1893         * name-lookup.c (check_local_shadow): New, broke out of ...
1894         (pushdecl_maybe_friend_1): ... here.  Call it.
1896         * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
1897         (ovl_first): Move inline definition to end of file.
1898         (ovl_make, lookup_add): Declare.
1899         (get_fns, get_first_fn): Make pure.
1900         * tree.c (ovl_cache): New.
1901         (ovl_make, lookup_add): New.
1902         * pt.c (do_class_deduction): Don't add candidates that will be
1903         elided.
1905         * call.c (build_user_type_conversion_1): Use OVL_FIRST.
1906         (print_error_for_call_failure): Use OVL_NAME.
1907         (build_op_call_1): Use ovl_iterator.
1908         (add_candidates): Use OVL_FIRST & lkp_iterator.
1909         (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
1910         lkp_iterator.
1911         * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
1912         (type_has_user_nondefault_constructor,
1913         in_class_defaulted_default_constructor,
1914         type_has_user_provided_constructor,
1915         type_has_user_provided_or_explicit_constructor,
1916         type_has_non_user_provided_default_constructor,
1917         vbase_has_user_provided_move_assign,
1918         type_has_move_constructor, type_has_move_assign,
1919         type_has_user_declared_move_constructor,
1920         type_has_user_declared_move_assign,
1921         type_build_ctor_call, type_build_dtor_call,
1922         type_requires_array_cookie, explain_non_literal_class): Likewise.
1923         (finish_struct): Use lkp_iterator.
1924         (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
1925         (note_name_declared_in_class): Use OVL_NAME.
1926         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
1927         (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
1928         cxx_pretty_printer::expression): Likewise.
1929         * decl2.c (check_classfn): Use ovl_iterator.
1930         * pt.c (retrieve_specialization): Use ovl_iterator.
1931         * tree.c (cp_tree_equal): Use lkp_iterator.
1932         (type_has_nontrivial_copy_init): Use ovl_iterator.
1934         * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
1935         check is_overloaded_fn.
1937 2017-05-16  Martin Liska  <mliska@suse.cz>
1939         * parser.c (cp_lexer_print_token): Add default value for flags
1940         argument of print_gimple_stmt, print_gimple_expr,
1941         print_generic_stmt and print_generic_expr.
1943 2017-05-16  Nathan Sidwell  <nathan@acm.org>
1945         * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
1946         iterators.
1947         (MAYBE_BASELINK_FUNCTIONS): New.
1948         * constraint.cc (resolve_constraint_check): Use lkp_iterator.
1949         * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
1950         * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
1951         * method.c (inherited_ctor_binfo): Use ovl_iterator.
1952         (binfo_inherited_from): Likewise.
1953         * parser.c (lookup_literal_operator): Use lkp_iterator.
1954         * pt.c (iterative_hash_template_arg): Use lkp_iterator.
1955         (print_candidates_1): Likewise.
1956         (determine_specialization): Likewise.
1957         (resolve_overloaded_unification): Likewise.
1958         (resolve_nondeduced_context): Likewise.
1959         (type_dependent_expression_p): Likewise.
1960         (dependent_template_p): Likewise.
1961         * ptree.c (cxx_print_xnode): Likewise.
1962         * semantics.c (omp_reduction_lookup): Use lkp_iterator.
1963         (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
1964         * typeck.c (check_template_keyword): Use lkp_iterator.
1966         * cp-tree.h (OVL_FIRST, OVL_NAME): New.
1967         (ovl_first): New.
1968         * constexpr.c (function_concept_check): Use OVL_FIRST.
1969         * cvt.c (build_expr_type_conversion): Likewise.
1970         * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
1971         * decl2.c (mark_used): Use OVL_FIRST.
1972         * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
1973         (dump_expr, location_of): Use OVL_FIRST.
1974         * friend.c (do_friend): Use OVL_NAME.
1975         * init.c (build_offset_ref): Use OVL_FIRST.
1976         * mangle.c (write_member_name): Likewise.
1977         (write_expression): Use OVL_NAME.
1978         * method.c (strip_inheriting_ctors): Use OVL_FIRST.
1979         * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
1980         * pt.c (check_explicit_specialization): Use OVL_FIRST.
1981         (check_template_shadow): Likewise.
1982         (tsubst_template_args): Use OVL_NAME.
1983         (tsubst_baselink): Use OVL_FIRST.
1984         * semantics.c (perform_koenig_lookup): Use OVL_NAME.
1985         * tree.c (get_first_fn): Use OVL_FIRST.
1986         * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
1987         (cp_build_addr_expr_1): Use OVL_FIRST.
1989         * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
1990         peeking.
1991         * semantics.c (finish_id_expression): Directly init local var.
1992         (finish_omp_reduction_clause): Use really_overloaded_fn.
1993         * tree.c (get_fns): Document.  Assert we got an overload.
1994         (get_first_fn) Document.
1995         * typeck.c (cp_build_addr_expr_1): Pass arg directly to
1996         really_overloaded_fn.
1997         * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
1999         * cp-tree.h (SCOPE_DEPTH): New.
2000         * name-lookup.h (is_nested_namespace): Declare.
2001         * name-lookup.c (is_nested_namespace): New.
2002         (is_ancestor): Use it.
2003         (set_decl_namespace): Likewise.
2004         (push_namespace): Set SCOPE_DEPTH.
2005         * pt.c (check_specialization_namespace): Use is_nested_namespace.
2006         (check_unqualigied_spec_or_inst): Likewise.
2008 2017-05-15  Nathan Sidwell  <nathan@acm.org>
2010         PR c++/79369
2011         * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
2012         * name-lookup.h (push_namespace): Return int, add make_inline arg.
2013         * name-lookup.c (push_namespace): Deal with inline directly.
2014         Return pushed count.
2015         * parser.c (cp_parser_namespace_definition): Adjust for
2016         push_namespace change.
2018 2017-05-11  Nathan Sidwell  <nathan@acm.org>
2020         * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
2021         LANG_HOOKS_PUSHDECL): Move to ...
2022         * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
2023         LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
2024         * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
2026         * name-lookup.h (pushdecl): Add default friend parm.
2027         (pushdecl_maybe_friend): Delete.
2028         (pushdecl_top_level): Add default friend parm.
2029         (pushdecl_top_level_maybe_friend): Delete.
2030         * name-lookup.c (pushdecl_maybe_friend): Delete.
2031         (pushdecl): Add is_friend parm.
2032         (pushdecl_top_level): Add is friend_parm.
2033         (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
2034         (pushdecl_top_level_and_finish): Do pushing and finishing directly.
2035         * friend.c (do_friend): Adjust.
2036         * pt.c (tsubst_friend_class): Adjust.
2038         Revert pushdecl_top_level_and_finish name change.
2039         * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
2040         * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
2041         * decl.c (cp_make_fname_decl): Adjust.
2042         * decl2.c (get_guard, handle_tls_init):  Adjust.
2043         * rtti.c (get_tinfo_decl, tinfo_base_init):  Adjust.
2045         * name-lookup.c (pushdecl_outermost_localscope): Always
2046         conditionally stop timer.
2048         * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
2049         * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
2051         * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
2052         pushtag_top_level_maybe_friend,
2053         pushdecl_top_level_and_finish): Move declarations to ...
2054         * name-lookup.h: ... here.  Group pushdecl variants.
2055         (pushdecl_top_level_and_finish): Rename to ...
2056         (pushdecl_top_level_with_init): ... here.
2057         * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
2058         * decl2.c (get_guard, handle_tls_init): Likewise.
2059         * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
2060         * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
2061         * method.c (implicitly_declare_fn): Likewise.
2062         * searchc (node_debug_info_needed): Likewise.
2063         * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
2064         (pushdecl_top_level_with_init): ... here.
2065         (pop_everything): Use namespace_bindings_p.
2067         * name-lookup.h (pop_binding): Rename to pop_local_binding.
2068         (getdecls): Rename to get_local_decls.
2069         * name-lookup.c (pop_binding): Rename to ...
2070         (pop_local_binding): ... here.
2071         (pop_bindings_and_leave_scope): Adjust.
2072         (getdecls): Rename to ...
2073         (get_local_decls): ... here.  Assert local scope.
2074         * decl.c (poplevel): Assert not namespace.  Adjust and simplify
2075         logic.
2076         (store_parm_decls): Adjust get_local_decls call.
2077         (parser.c (synthesize_implicit_template_parm): Likewise.
2079 2017-05-11  Ville Voutilainen  <ville.voutilainen@gmail.com>
2081         PR c++/80682
2082         * method.c (is_trivially_xible): Reject void types.
2084 2017-05-10  Nathan Sidwell  <nathan@acm.org>
2086         * class.c (handle_using_decl): Always use OVL_CURRENT.
2087         (resolve_address_of_overloaded_function): Move iterator decl into
2088         for scope.  Don't strip anticipated decls here.
2090         * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
2091         printing.
2092         (print_candidates): Adjust.
2094         * cp-tree.h (build_new_function_call): Lose koenig_p arg.  Fix
2095         line breaking.
2096         * call.c (build_new_function_call): Lose koenig_p arg.  Remove
2097         koenig_p handling here.
2098         * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
2099         (tsubst_omp_clauses): Likewise.
2100         (do_class_deduction): Adjust buld_new_function_call calls.
2101         * semantics.c (finish_call_expr): Likewise.
2103 2017-05-10  Jason Merrill  <jason@redhat.com>
2105         * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
2106         (unify_type_mismatch, unify_parameter_pack_mismatch)
2107         (unify_ptrmem_cst_mismatch, unify_expression_unequal)
2108         (unify_parameter_pack_inconsistent, unify_inconsistency)
2109         (unify_vla_arg, unify_method_type_error, unify_arity)
2110         (unify_arg_conversion, unify_no_common_base)
2111         (unify_inconsistent_template_template_parameters)
2112         (unify_template_deduction_failure)
2113         (unify_template_argument_mismatch)
2114         (unify_overload_resolution_failure): Call unify_invalid.
2116         CWG 1847 - Clarifying compatibility during partial ordering
2117         * pt.c (more_specialized_fn): No order between two non-deducible
2118         parameters.
2120         * pt.c (dependent_type_p): Make sure we aren't called with
2121         global_type_node.
2123         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2124         * pt.c (convert_template_argument): Just return an argument pack.
2125         (coerce_template_parameter_pack, template_parm_to_arg)
2126         (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
2127         (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
2128         Don't set the type of a NONTYPE_ARGUMENT_PACK.
2129         * parser.c (make_char_string_pack, make_string_pack): Likewise.
2131 2017-05-10  Nathan Sidwell  <nathan@acm.org>
2133         * cp-tree.h (add_method, clone_function_decl): Change last arg to
2134         bool.
2135         * class.c (add_method): Change third arg to bool.  Adjust.
2136         (one_inheriting_sig, one_inherited_ctor): Adjust.
2137         (clone_function_decl): Change 2nd arg to bool.  Adjust.
2138         (clone_constructors_and_destructors): Adjust.
2139         * lambda.c (maybe_add_lambda_conv_op): Adjust.
2140         * method.c (lazily_declare_fn): Adjust.
2141         * pt.c (tsubst_decl, instantiate_template_1): Adjust.
2142         * semantics.c (finish_member_declaration): Adjust.
2144 2017-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
2146         PR c++/80145
2147         * decl.c (finish_function): To improve error recovery, change the
2148         logic for calling apply_deduced_return_type.
2150 2017-05-09  Jason Merrill  <jason@redhat.com>
2152         PR c++/80605 - __is_standard_layout and empty base
2153         * class.c (check_bases): Ignore empty bases.
2155         PR c++/70979 - literal class and closure types
2156         * class.c (finalize_literal_type_property): Handle closures
2157         specifically.
2158         (explain_non_literal_class): Likewise.
2160         PR c++/66297, DR 1684 - literal class and constexpr member fns
2161         * constexpr.c (is_valid_constexpr_fn): Only complain about
2162         non-literal enclosing class in C++11.
2163         * class.c (finalize_literal_type_property): Likewise.
2165 2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
2167         PR c++/80186
2168         * pt.c (tsubst_decl): Early return error_mark_node if
2169         grok_ctor_properties returns false.
2171 2017-05-09  Jason Merrill  <jason@redhat.com>
2173         PR c++/70167 - array prvalue treated as lvalue
2174         * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
2175         (enum fcl_t): New.
2176         * semantics.c (finish_compound_literal): Add fcl_context parameter.
2177         Only make a static variable for C99 syntax.
2178         * parser.c (cp_parser_postfix_expression): Pass it.
2179         * pt.c (tsubst_copy_and_build): Likewise.
2180         * call.c (extend_ref_init_temps): Set
2181         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2183 2017-05-09  Nathan Sidwell  <nathan@acm.org>
2185         * cp-lang.c (get_global_decls, cxx_pushdecl): New.
2186         (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
2187         * name-lookup.h (pushdecl_top_level): Declare.
2189 2017-05-08  Jason Merrill  <jason@redhat.com>
2191         PR c++/80178 - parameter passing for uncopyable classes
2192         * tree.c (type_has_nontrivial_copy_init): True for classes with only
2193         deleted copy/move ctors.
2194         (remember_deleted_copy, maybe_warn_parm_abi): New.
2195         * decl.c (require_complete_types_for_parms, check_function_type):
2196         Call maybe_warn_parm_abi.
2197         * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
2199 2017-05-08  Nathan Sidwell  <nathan@acm.org>
2201         * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
2202         (start_preparsed_function): Do decl pushing before setting
2203         current_funciton_decl and announcing it.
2205         * name-lookup.h (pushdecl_with_scope): Replace with ...
2206         (pushdecl_outermost_localscope): ... this.
2207         * name-lookup.c (pushdecl_with_scope): Replace with ...
2208         (pushdecl_outermost_localscope): ... this.
2209         (pushdecl_namespace_level): Adjust.
2210         * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
2211         * lambda.c (insert_capture_proxy): Likewise.
2213         * class.c (build_vtbl_initializer): Don't shadow outer variable
2214         with static var.
2216         Revert _binding -> _value change.
2217         * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
2218         (get_namespace_binding, set_global_binding): ... these.
2219         * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
2220         (get_namespace_binding, set_global_binding): ... these.
2221         (arg_assoc_namespace, pushdecl_maybe_friend_1,
2222         check_for_out_of_scope_variable, push_overloaded_decl_1,
2223         lookup_name_innermost_nonclass_level, push_namespace): Adjust.
2224         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
2225         SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
2226         * decl.c (poplevel): Adjust.
2227         * pt.c (make_constrained_auto): Likewise.
2229 2017-05-07  Volker Reichelt  <v.reichelt@netcologne.de>
2231         PR translation/80280
2232         * call.c (print_z_candidate): Fix quoting.
2234 2017-05-05  David Malcolm  <dmalcolm@redhat.com>
2236         * error.c (pedwarn_cxx98): Replace report_diagnostic
2237         with diagnostic_report_diagnostic.
2239 2017-05-05  Nathan Sidwell  <nathan@acm.org>
2241         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
2242         (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
2243         (IDENTIFIER_NAMESPACE_VALUE): Delete.
2244         * name-lookup.h (namespace_binding, set_namespace_binding): Replace
2245         with ...
2246         (get_namespace_value, set_global_value): ... these.
2247         (get_global_value_if_present, is_typename_at_global_scope): Delete.
2248         * decl.c (poplevel): Use get_namespace_value.
2249         (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
2250         * class.c (build_vtbl_initializer): Stash library decl in
2251         static var. Use IDENTIFIER_GLOBAL_VALUE.
2252         * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
2253         do_allocate_exception, do_free_exception, build_throw): Likewise.
2254         * init.c (throw_bad_array_new_length): Likewise.
2255         * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
2256         * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
2257         check_for_our_of_scope_variable, push_overloaded_decl_1): Use
2258         get_namespace_value.
2259         (set_namespace_binding_1): Rename to
2260         (set_namespace_binding): ... here.
2261         (set_global_value): New.
2262         (lookup_name_innermost_nonclass_level_1, push_namespace): Use
2263         get_namespace_value.
2264         * pt.c (listify): Use get_namespace_value.
2266         * call.c (make_temporary_var_for_ref_to_temp): Push decl into
2267         current scope.
2268         * lex.c (unqualified_name_lookup_error): Likewise.
2270         * class.c (alter_class): Use retrofit_lang_decl directly.
2271         * decl.c (push_local_name, dupliate_decls): Likewise.
2272         * semantics.c (omp_privatize_field): Likewise.
2274         Kill walk_namespaces.
2275         * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
2276         * decl.c (walk_namespaces_r, walk_namespaces): Delete.
2278         Kill per-namespace static_decls.
2279         * cp-tree.h (static_decls): Declare.
2280         (wrapup_globals_for_namespace,
2281         diagnose_inline_vars_for_namespace): Replace with ...
2282         (wrapup_namespace_globals): ... this.
2283         * decl.c (static_decls): Define.
2284         (wrapup_globals_for_namespace,
2285         diagnose_inline_vars_for_namespace): Replace with ...
2286         (wrapup_namespace_globals): ... this.
2287         (cxx_init_decl_processing): Initialize static_decls.
2288         * decl2.c (c_parse_final_cleanups): Adjust.
2289         * name-lookup.h (cp_binding_level): Remove static_decls member.
2290         * name-lookup.c (add_decl_to_level): Adjust.
2291         (begin_scope): Adjust.
2293 2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
2295         PR c++/71577
2296         * decl.c (reshape_init): Unconditionally return error_mark_node
2297         upon error about too many initializers.
2299 2017-05-04  Nathan Sidwell  <nathan@acm.org>
2301         * constraint.cc (diagnose_check_constraint): Fix %E thinko.
2303 2017-05-04  Martin Sebor  <msebor@redhat.com>
2305         PR translation/80280
2306         * call.c (print_z_candidate): Add missing quoting to %D and other
2307         like directives.
2308         (build_op_call_1): Same.
2309         * constraint.cc (diagnose_check_constraint): Same.
2310         * mangle.c (mangle_decl): Same.
2311         * name-lookup.c (cp_binding_level_debug): Same.
2312         (set_decl_namespace): Same.
2313         * parser.c (cp_parser_tx_qualifier_opt): Same.
2314         * pt.c (print_candidates_1): Same.
2315         (check_template_variable): Same.
2316         (tsubst_default_argument): Same.
2317         (most_specialized_partial_spec): Same.
2318         * semantics.c (omp_reduction_lookup): Same.
2319         * tree.c (check_abi_tag_redeclaration): Same.
2320         * typeck.c (comptypes): Same.
2321         * typeck2.c (abstract_virtuals_error_sfinae): Same.
2323 2017-05-04  Nathan Sidwell  <nathan@acm.org>
2325         More global trees.
2326         * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
2327         CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
2328         CPTI_INIT_LIST_IDENTIFIER.
2329         (global_namespace, global_type_node, global_identifier,
2330         anon_identifier, init_list_identifier): New.
2331         * decl.c (global_type_node, global_scope_name): Delete.
2332         (initialize_predefined_identifiers): Add new identifiers.
2333         (cxx_init_decl_processing): Adjust.
2334         * name-lookup.h (global_namespace, global_type_node): Delete.
2335         * name-lookup.c (global_namespace, anonymous_namespace_name,
2336         get_anonymous_namespace_name): Delete.
2337         (namespace_scope_ht_size, begin_scope, pushtag_1,
2338         push_namespace): Adjust,
2339         * call.c (type_has_extended_temps): Use init_list_identifier.
2340         * pt.c (listify): Likewise.
2342         * name-lookup.c: Reorder functions to make merging from modules
2343         branch simpler.
2345 2017-05-03  Jason Merrill  <jason@redhat.com>
2347         * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
2349 2017-05-03  Nathan Sidwell  <nathan@acm.org>
2351         * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
2352         along with #defines, to before name-lookup include.
2354 2017-05-02  Paolo Carlini  <paolo.carlini@oracle.com>
2356         * pt.c (is_auto_or_concept): Remove.
2357         (type_uses_auto_or_concept): Remove, unused.
2358         (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
2359         * parser.c (tree_type_is_auto_or_concept): Remove, unused.
2360         * cp-tree.h (is_auto_or_concept): Remove.
2362 2017-05-01  Xi Ruoyao  <ryxi@stu.xidian.edu.cn>
2364         PR c++/80038
2365         * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
2366         add pedigree operation and detach call here.
2367         * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
2368         cilk_cp_gimplify_call_params_in_spawned_fn.
2369         (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
2370         * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
2372 2017-04-29  Volker Reichelt  <v.reichelt@netcologne.de>
2374         * parser.c (cp_parser_member_declaration): Add fix-it hints for
2375         stray comma and missing semicolon at end of member declaration.
2377 2017-04-27  Volker Reichelt  <v.reichelt@netcologne.de>
2379         * parser.c (cp_parser_cast_expression): Add target type of cast to
2380         diagnostic.
2381         * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
2383 2017-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
2385         * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
2386         return type to bool.
2387         * cp-tree.h (grok_ctor_properties): Update.
2389 2017-04-26  Volker Reichelt  <v.reichelt@netcologne.de>
2391         * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
2392         information to diagnostic of invalid colon in nested-name-specifier.
2394 2017-04-25  Volker Reichelt  <v.reichelt@netcologne.de>
2396         * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
2397         diagnostic of invalid class/struct keyword after enum.
2399 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
2401         * parser.c (cp_parser_member_declaration): Add fix-it hint
2402         for removing stray semicolons.
2404 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
2406         * name-lookup.c (get_std_name_hint): New function.
2407         (maybe_suggest_missing_header): New function.
2408         (suggest_alternative_in_explicit_scope): Call
2409         maybe_suggest_missing_header.
2411 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
2413         PR c++/80177
2414         * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
2415         candidate type of bm from tree to const char *.
2416         (consider_binding_level): Likewise.
2417         (lookup_name_fuzzy): Likewise, using this to merge the best
2418         result from the preprocessor into bm, rather than immediately
2419         returning, so that better matches from reserved words can "win".
2420         Guard the rejection of keywords that don't start decl-specifiers
2421         so it only happens for FUZZY_LOOKUP_TYPENAME.
2423 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
2425         * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
2426         (start_enum): Likewise.
2427         (build_enumerator): Likewise. Use %qE instead of plain %E.
2428         * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
2429         %<%D%> in diagnostics.
2430         (cp_parser_elaborated_type_specifier): Likewise.
2431         * pt.c (make_pack_expansion): Use %qT and %qE instead of
2432         %<%T%> and %<%E%> in diagnostics.
2433         (tsubst_pack_expansion): Likewise.
2435 2017-04-24  David Malcolm  <dmalcolm@redhat.com>
2437         PR c++/80016
2438         * parser.c (cp_parser_unary_expression):  Generate a location
2439         range for alignof and sizeof expressions.
2441 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
2443         * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
2444         error message.
2445         (cp_parser_virt_specifier_seq_opt): Likewise.
2446         (set_and_check_decl_spec_loc): Likewise twice.
2448 2017-04-21  Jason Merrill  <jason@redhat.com>
2450         PR c++/80179 - ICE with initialized flexible array member.
2451         * constexpr.c (verify_ctor_sanity): Handle flexible array members.
2453 2017-04-21  Richard Biener  <rguenther@suse.de>
2455         * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
2456         (copy_type): Likewise.
2457         * lex.c (copy_decl): Pass down mem-stat info.
2458         (copy_type): Likewise.
2460 2017-04-20  Jonathan Wakely  <jwakely@redhat.com>
2462         PR c++/80473
2463         * init.c (build_new_1): Suppress notes about over-aligned new when
2464         the warning is suppressed.
2466 2017-04-20  Volker Reichelt  <v.reichelt@netcologne.de>
2468         * parser.c (cp_parser_member_declaration): Add warning with fixit
2469         information for extra semicolon after in-class function definition.
2471 2017-04-20  Jakub Jelinek  <jakub@redhat.com>
2473         PR middle-end/80423
2474         * tree.c (build_cplus_array_type): Call build_array_type
2475         with the intended TYPE_TYPELESS_STORAGE flag value, instead
2476         of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
2477         on the shared type.
2479 2017-04-18  Marek Polacek  <polacek@redhat.com>
2481         PR c++/80244 - ICE with attribute in template alias.
2482         * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
2484         PR c++/80241 - ICE with alignas pack expansion.
2485         * error.c (dump_expr): Handle TREE_LIST.
2486         * parser.c (cp_parser_std_attribute_list): Return error_mark if
2487         make_pack_expansion returns an error.
2489 2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>
2491         PR c++/80287
2492         * class.c (fixup_may_alias): Fix all type variants.
2494 2017-04-17  Jason Merrill  <jason@redhat.com>
2496         PR c++/80415 - wrong error with default arg and array reference.
2497         * tree.c (lvalue_kind): Return clk_class for an array prvalue.
2499         * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
2501 2017-04-15  Alexandre Oliva <aoliva@redhat.com>
2503         * decl.c (name_unnamed_type): Split out of...
2504         (grokdeclarator): ... this.
2505         * decl.h (name_unnamed_type): Declare.
2507 2017-04-12  Richard Biener  <rguenther@suse.de>
2508         Bernd Edlinger  <bernd.edlinger@hotmail.de>
2510         PR middle-end/79671
2511         * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
2512         for arrays of character or std::byte type.
2514 2017-04-11  Jason Merrill  <jason@redhat.com>
2516         PR c++/80294 - ICE with constexpr and inheritance.
2517         * constexpr.c (reduced_constant_expression_p):
2518         A null constructor element is non-constant.
2519         (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
2520         returning an empty base.
2522 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
2524         PR c++/80370
2525         * decl.c (cp_finish_decomp): If processing_template_decl on
2526         non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
2527         change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
2528         sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
2529         processing.
2530         * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
2531         with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
2532         dependent.
2534 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
2536         PR c++/80363
2537         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
2539 2017-04-10  Jakub Jelinek  <jakub@redhat.com>
2541         PR c++/80176
2542         * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
2543         operand, if it is a static member function, recurse on the
2544         BASELINK.
2546 2017-04-10  Marek Polacek  <polacek@redhat.com>
2548         PR sanitizer/80348
2549         * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
2550         ORIG_TYPE earlier and not only when shortening.
2552 2017-04-07  Jason Merrill  <jason@redhat.com>
2554         PR c++/80356 - ICE with reference to function template argument.
2555         PR c++/79294
2556         * pt.c (convert_nontype_argument_function): Adjust type even with a
2557         value-dependent argument.
2559         PR c++/80267 - ICE with nested capture of reference
2560         PR c++/60992
2561         * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
2563 2017-04-07  Marek Polacek  <polacek@redhat.com>
2565         PR sanitizer/80348
2566         * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
2568         PR c++/80095
2569         * call.c (build_over_call): Don't check cxx_dialect.
2570         * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
2571         whether SUB is a CONSTRUCTOR.
2572         * init.c (build_new_1): Don't check cxx_dialect.
2573         * tree.c (replace_placeholders): Add a function comment.  Return if
2574         not in C++14, or if the object isn't a (member of a) class.
2575         * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
2576         TYPE is CLASS_TYPE_P.
2578 2017-04-05  Jakub Jelinek  <jakub@redhat.com>
2580         PR c++/80309
2581         * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
2582         of a loop doing vec_safe_push of NULL.  Formatting fixes.
2583         (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
2584         to newidx before calling canonical_type_parameter on newtype.
2586 2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
2588         PR c++/80296
2589         * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
2590         UNARY_PLUS_EXPR case.
2592 2017-04-03  Jason Merrill  <jason@redhat.com>
2594         * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
2596 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
2598         * class.c (update_vtable_entry_for_fn): Fix typo in comment.
2599         * decl2.c (one_static_initialization_or_destruction): Likewise.
2600         * name-lookup.c (store_bindings): Likewise.
2601         * parser.c (make_call_declarator): Likewise.
2602         * pt.c (check_explicit_specialization): Likewise.
2604 2017-04-03  Jason Merrill  <jason@redhat.com>
2606         PR sanitizer/79993 - ICE with VLA initialization from string
2607         PR c++/69487 - wrong VLA initialization from string
2608         * init.c (finish_length_check): Split out from build_vec_init.
2609         (build_vec_init): Handle STRING_CST.
2610         * typeck2.c (split_nonconstant_init): Handle STRING_CST.
2611         (digest_init_r): Don't give a STRING_CST VLA type.
2613 2017-03-31  Jakub Jelinek  <jakub@redhat.com>
2615         PR c++/79572
2616         * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
2617         REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
2618         for NOP_EXPR to REFERENCE_TYPE.
2620         PR libstdc++/80251
2621         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
2622         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
2623         CPTK_IS_AGGREGATE.
2624         * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
2625         Remove extraneous parens.
2626         (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
2627         * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
2628         (cp_parser_trait_expr): Likewise.
2630 2017-03-27  Jakub Jelinek  <jakub@redhat.com>
2632         PR middle-end/80162
2633         * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
2634         * typeck.c (cxx_mark_addressable): Likewise.  Look through
2635         VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
2636         to ARRAY_TYPE.
2637         (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
2639 2017-03-24  Jason Merrill  <jason@redhat.com>
2641         PR c++/77339 - ICE with invalid use of alias template.
2642         * pt.c (lookup_template_class_1): Don't try to enter the scope of an
2643         alias template.
2645 2017-03-24  Marek Polacek  <polacek@redhat.com>
2647         PR c++/80119
2648         * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
2649         doesn't have side effects.
2651 2017-03-23  Jason Merrill  <jason@redhat.com>
2653         PR c++/80150 - ICE with overloaded variadic deduction.
2654         * pt.c (try_one_overload): Remove asserts.
2656         PR c++/77563 - missing ambiguous conversion error.
2657         * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
2659 2017-03-23  Marek Polacek  <polacek@redhat.com>
2661         * cp-tree.h: Remove a C_RID_YYCODE reference.
2663 2017-03-22  Jakub Jelinek  <jakub@redhat.com>
2665         PR c++/80141
2666         * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
2667         case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
2668         processing_template_decl.
2670 2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
2672         PR c++/77752
2673         * name-lookup.c (pushtag_1): Add check for bogus, non template,
2674         std::initializer_list.
2676 2017-03-21  Jakub Jelinek  <jakub@redhat.com>
2678         PR c++/35878
2679         * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
2681 2017-03-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
2683         PR c++/35878
2684         * init.c (std_placement_new_fn_p): New.
2685         (build_new_1): Call it.
2687 2017-03-20  Jason Merrill  <jason@redhat.com>
2689         PR c++/80096 - ICE with C++17 non-type auto.
2690         * pt.c (tsubst): Delay tsubst of type of template non-type
2691         parameter.
2693         PR c++/79519 - ICE with deleted template friend.
2694         * decl.c (grokdeclarator): Complain about misplaced function
2695         definition using =, as well.
2697         PR c++/79640 - infinite recursion with generic lambda.
2698         * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
2699         before substituting its initializer.
2701 2017-03-20  Marek Polacek  <polacek@redhat.com>
2702             Paolo Carlini  <paolo.carlini@oracle.com>
2704         PR c++/80059 - ICE with noexcept and __transaction_atomic
2705         * except.c (build_must_not_throw_expr): Call
2706         instantiate_non_dependent_expr.
2708 2017-03-19  Jason Merrill  <jason@redhat.com>
2710         PR c++/80084 - wrong C++17 decomposition by reference of parameter.
2711         * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
2712         reference decomposition.
2714         PR c++/80077 - error with constexpr and -fno-elide-constructors.
2715         * constexpr.c (cxx_eval_call_expression): Set ctx->call while
2716         expanding trivial constructor.
2718 2017-03-17  Jason Merrill  <jason@redhat.com>
2720         PR c++/78345 - ICE initializing array from lambda.
2721         * init.c (build_aggr_init): Check array initializer.
2722         (build_vec_init): Check the type of a CONSTRUCTOR.
2724         PR c++/80073 - C++17 ICE with virtual base.
2725         * decl.c (xref_basetypes): Also check for indirect vbases.
2727 2017-03-16  Jason Merrill  <jason@redhat.com>
2729         * decl.c (start_enum): std::byte aliases anything.
2731         PR c++/79797
2732         * constexpr.c (lookup_placeholder): Tweak.
2734 2017-03-15  Jason Merrill  <jason@redhat.com>
2736         PR c++/80043 - ICE with -fpermissive
2737         * typeck.c (convert_for_assignment): Handle instantiate_type
2738         not giving an error.
2740 2017-03-14  Nathan Sidwell  <nathan@acm.org>
2742         PR c++/79393 DR 1658 workaround
2743         * method.c (synthesized_method_base_walk): Inihibit abstract class
2744         virtual base access check here.
2745         (synthesized_method_walk): Not here.
2747 2017-03-13  Nathan Sidwell  <nathan@acm.org>
2749         PR c++/79393 DR 1658 workaround
2750         * method.c (synthesized_method_walk): Check vbases of abstract
2751         classes for dtor walk.
2753 2017-03-10  David Malcolm  <dmalcolm@redhat.com>
2755         PR translation/79848
2756         * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
2758 2017-03-10  Jason Merrill  <jason@redhat.com>
2760         PR c++/79960 - alias templates and partial ordering
2761         * pt.c (comp_template_args): Add partial_order parm.
2762         (template_args_equal): Likewise.
2763         (comp_template_args_porder): New.
2764         (get_partial_spec_bindings): Use it.
2766 2017-03-10  Marek Polacek  <polacek@redhat.com>
2768         PR c++/79967
2769         * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
2771 2017-03-10  Jakub Jelinek  <jakub@redhat.com>
2773         PR c++/79899
2774         * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
2775         Use XALLOCAVEC macro.
2777         PR c++/79896
2778         * decl.c (finish_enum_value_list): If value is error_mark_node,
2779         don't copy it and change its type.
2780         * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
2781         of CONST_DECL is error_mark_node.
2783 2017-03-09  Marek Polacek  <polacek@redhat.com>
2785         PR c++/79900 - ICE in strip_typedefs
2786         * tree.c (strip_typedefs): Skip the attribute handling if T is
2787         a variant type which hasn't been updated yet.
2789         PR c++/79687 - wrong code with pointer-to-member
2790         * init.c (constant_value_1): Break if the variable has a dynamic
2791         initializer.
2793 2017-03-08  Jason Merrill  <jason@redhat.com>
2795         PR c++/79797 - ICE with self-reference in array DMI.
2796         * constexpr.c (lookup_placeholder): Split out...
2797         (cxx_eval_constant_expression): ...from here.
2799 2017-03-07  Jakub Jelinek  <jakub@redhat.com>
2801         PR c/79834
2802         * parser.c (cp_parser_omp_cancellation_point,
2803         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
2804         cp_parser_omp_target_update): Change "may only be used in compound
2805         statements" diagnostics, such that the same translatable string is
2806         used for all pragmas.
2807         (cp_parser_pragma): Likewise.  Use error_at instead of
2808         cp_parser_error for that diagnostics.
2810 2017-03-06  Marek Polacek  <polacek@redhat.com>
2812         PR c++/79796 - ICE with NSDMI and this pointer
2813         * call.c (build_over_call): Handle NSDMI with a 'this' by calling
2814         replace_placeholders.
2816 2017-03-06  Jakub Jelinek  <jakub@redhat.com>
2818         PR c++/79822
2819         * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
2820         ({ (void) 0; }).
2822 2017-03-06  Jason Merrill  <jason@redhat.com>
2824         Revert "Allow deduction guides to look into primary template."
2825         * cp-tree.h, parser.c, pt.c, search.c: Revert.
2827 2017-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
2829         PR c++/70266
2830         * except.c (build_must_not_throw_expr): Perform the implicit
2831         conversions on the condition.
2833 2017-03-03  Jason Merrill  <jason@redhat.com>
2835         * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
2836         -Wc++1z-compat.
2838         Core issues 2273 and 2277
2839         * call.c (joust): Adjust using-declaration tiebreaker to handle
2840         the intermediate base case.
2841         * method.c (strip_inheriting_ctors): Just return the argument if
2842         !flag_new_inheriting_ctors.
2844 2017-03-03  Richard Biener  <rguenther@suse.de>
2846         PR c++/79825
2847         * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
2849 2017-03-03  Marek Polacek  <polacek@redhat.com>
2851         PR c++/79791
2852         * typeck.c (string_conv_p): In C++11, always call pedwarn with
2853         OPT_Wwrite_strings.
2855 2017-03-02  Jason Merrill  <jason@redhat.com>
2857         Update overload resolution with deduction guides.
2858         * pt.c (do_class_deduction): Always build the copy guide.
2859         (copy_guide_p, template_guide_p): New.
2860         (build_deduction_guide): Remember the original constructor.
2861         * call.c (joust): Prefer the copy guide and non-template guides.
2863         Allow deduction guides to look into primary template.
2864         * cp-tree.h (struct saved_scope): Add deduction_guide_type.
2865         (struct cp_decl_specifier_seq): Add constructor_p.
2866         * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
2867         (cp_parser_init_declarator): Check it.  Set ctor_dtor_or_conv_p.
2868         Clear deduction_guide_type.  Don't handle deduction guide names.
2869         (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
2870         (cp_parser_direct_declarator): Likewise.  Handle deduction guides.
2871         (cp_parser_member_declaration, cp_parser_cache_defarg)
2872         (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
2873         * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
2874         (build_deduction_guide): Set deduction_guide_type.
2875         (dependent_scope_p): Check deduction_guide_type.
2876         * search.c (lookup_member): Likewise.
2878 2017-03-02  Jakub Jelinek  <jakub@redhat.com>
2880         PR c++/79782
2881         * init.c (mark_exp_read_r): New function.
2882         (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
2883         whole arguments instead of plain mark_exp_read on TREE_LIST values.
2885 2017-03-01  Jason Merrill  <jason@redhat.com>
2887         Class template argument deduction in new-expression
2888         * init.c (build_new): Handle deduction from no initializer.
2889         * parser.c (cp_parser_new_expression): Don't require a single
2890         expression for class template deduction.
2891         * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
2892         class template placeholder.
2893         * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
2894         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
2895         (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
2897 2017-03-01  Jakub Jelinek  <jakub@redhat.com>
2899         PR c++/79746
2900         * init.c (emit_mem_initializers): When not constructing vbases of
2901         abstract classes, mark arguments as read for
2902         -Wunused-but-set-parameter.
2904 2017-02-28  Jason Merrill  <jason@redhat.com>
2906         Class template argument deduction refinements
2907         * call.c (joust): Move deduction guide tiebreaker down.
2908         * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
2909         deduction with no initializer.
2910         * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
2911         (do_class_deduction): Use that rather than special case.
2912         (do_auto_deduction): Handle null initializer.
2914 2017-02-28  Jakub Jelinek  <jakub@redhat.com>
2916         * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
2917         instead of just cond ? "..." : "...".
2918         (grokdeclarator): Likewise.
2919         (build_enumerator): Likewise.
2920         * init.c (build_new_1): Likewise.
2921         * call.c (build_new_method_call_1): Likewise.
2922         * parser.c: Include intl.h.
2923         (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
2924         "enter"/"exit" keyword.
2925         (cp_finalize_oacc_routine): Don't use %s to supply portions of the
2926         message.
2928 2017-02-27  Jason Merrill  <jason@redhat.com>
2930         PR c++/71568 - SFINAE forming pointer to member function
2931         * init.c (build_offset_ref): Check the return value of
2932         perform_or_defer_access_check.
2934 2017-02-27  Marek Polacek  <polacek@redhat.com>
2936         * decl.c (expand_static_init): Add missing } in a comment.
2938 2017-02-27  Volker Reichelt  <v.reichelt@netcologne.de>
2940         * init.c: Include intl.h.
2941         (build_new_1): Move message strings into pedwarn to make them
2942         -Wformat-security friendly. Mark string for translation.
2943         * pt.c (tsubst_copy_and_build): Mark string for translation.
2944         Make the pointer const.
2945         * semantics.c (finish_id_expression): Mark strings for translation.
2947 2017-02-25  Jakub Jelinek  <jakub@redhat.com>
2949         * call.c (build_op_delete_call): Make msg1 and msg2 const.
2951 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
2953         PR c++/79588
2954         * call.c (build_over_call): Call check_function_arguments even for
2955         -Wrestrict, adjust check_function_arguments caller.
2956         * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
2957         here.
2958         * typeck.c (cp_build_function_call_vec): Adjust
2959         check_function_arguments caller.
2961 2017-02-24  Marek Polacek  <polacek@redhat.com>
2963         PR translation/79705
2964         * decl.c (check_redeclaration_exception_specification): Mark a string
2965         for translation.  Make the pointer const.
2967 2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>
2969         PR c++/79361
2970         * pt.c (register_specialization): Check duplicate_decls return value
2971         for error_mark_node and pass it back.
2973 2017-02-22  Jason Merrill  <jason@redhat.com>
2975         PR c++/79679 - missing destructor for argument
2976         * call.c (build_over_call): Don't pass tf_no_cleanup to argument
2977         conversions.
2979         * pt.c (do_class_deduction): Handle 0 argument case.
2981 2017-02-22  Jakub Jelinek  <jakub@redhat.com>
2983         PR c++/79664
2984         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
2985         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
2986         * constexpr.c (potential_constant_expression_1): Handle
2987         OMP_*, OACC_* and CILK_* trees.  Use error_at with
2988         EXPR_LOC_OR_LOC (t, input_location) computed early
2989         instead of error, or error_at with location_of (t).
2991 2017-02-22  Marek Polacek  <polacek@redhat.com>
2993         PR c++/79653
2994         * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
2995         if the alignas expression is erroneous.
2996         * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
2997         error_mark_node.
2999         PR c++/79657
3000         * semantics.c (finish_underlying_type): Bail out for incomplete enums.
3002 2017-02-21  Jason Merrill  <jason@redhat.com>
3004         PR c++/50308 - wrong deprecated warning with ADL
3005         PR c++/17729 - duplicate deprecated warning
3006         * semantics.c (finish_id_expression): Only call mark_used on a
3007         function if we aren't building a call.
3009         PR c++/41727 - ICE with partial spec of partial instantiation
3010         * pt.c (process_partial_specialization): For now, don't check more
3011         specialized if there is more than one level of args.
3013 2017-02-21  Marek Polacek  <polacek@redhat.com>
3015         PR c++/79535
3016         * cp-tree.h (maybe_reject_flexarray_init): Declare.
3017         * init.c (maybe_reject_flexarray_init): No longer static.
3018         Add check for current_function_decl.
3019         * parser.c (cp_parser_late_parse_one_default_arg): Reject
3020         a default mem-initializer for a flexible array.
3022 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
3023             Paolo Carlini  <paolo.carlini@oracle.com>
3025         PR c++/79654
3026         * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
3027         on error.
3028         * pt.c (tsubst_decomp_names): Return error_mark_node if the first
3029         decl after the decomposition artificial decl has error_mark_node.
3030         * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
3031         instead of just == error_mark_node comparison.
3033 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
3035         PR sanitizer/79589
3036         * decl.c: Include gimplify.h.
3037         (cp_finish_decomp): Make sure there is no sharing of trees
3038         in between DECL_VALUE_EXPR of decomposition decls.
3040         PR c++/79655
3041         * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
3043         PR c++/79639
3044         * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
3045         call cplus_expand_constant on it first.
3047 2017-02-19  Jason Merrill  <jason@redhat.com>
3049         PR c++/78139 - destructor needed by new-expression
3050         * call.c (build_special_member_call): Use tf_no_cleanup.
3052         PR c++/78282 - auto template and pack expansion
3053         * pt.c (find_parameter_packs_r): Don't walk into the type of
3054         templates other than template template-parameters.
3056         PR c++/79606 - ICE with this->base_member in NSDMI
3057         * class.c (build_base_path): Check processing_template_decl.
3059         PR c++/79607 - ICE with T{} initializer
3060         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
3062         PR c++/79566 - elaborated-type-specifier in range for
3063         * parser.c (cp_parser_simple_declaration): Fix check for type
3064         definition.
3066         PR c++/79400 - confusing suggestion of 'noexcept'
3067         * parser.c (cp_parser_exception_specification_opt): Remove
3068         suggestion for deprecated dynamic exception-specification.
3070         PR c++/79470 - partial ordering with reference parameters
3071         * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
3073         PR c++/79500 - ICE with non-template deduction guide
3074         * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
3075         DECL_TEMPLATE_RESULT.
3077         PR c++/79580 - ICE with compound literal
3078         * parser.c (cp_parser_class_head): If we're in the middle of an
3079         expression, use ts_within_enclosing_non_class.
3081         PR c++/79503 - inherited ctor taking base class
3082         * call.c (add_function_candidate): Also check that
3083         DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
3085 2017-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
3087         PR c++/79380
3088         * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
3089         argument.
3091 2017-02-19  Eric Fiselier  <eric@efcs.ca>
3092             Jonathan Wakely  <jwakely@redhat.com>
3094         PR c++/69523
3095         * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
3096         control warning about literal suffix identifiers without a leading
3097         underscore.
3099 2017-02-17  Jason Merrill  <jason@redhat.com>
3101         PR c++/79508 - lookup error with member template
3102         * parser.c (cp_parser_template_name): Clear
3103         parser->context->object_type if we aren't doing lookup.
3105         PR c++/78690 - ICE with using and global type with same name
3106         * pt.c (type_dependent_object_expression_p): True for
3107         IDENTIFIER_NODE.
3109         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3110         * pt.c (convert_template_argument): Just return an auto arg pack.
3111         (tsubst_template_args): Don't tsubst an auto pack type.
3113         PR c++/79556 - C++17 ICE with non-type auto
3114         * pt.c (do_auto_deduction): Don't try to deduce from null type.
3116         PR c++/79533 - C++17 ICE with temporary cast to reference
3117         * call.c (build_over_call): Conversion to a reference prevents copy
3118         elision.
3120 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
3121             Jason Merrill  <jason@redhat.com>
3123         PR c++/79502 - lost nodiscard attribute
3124         * pt.c (apply_late_template_attributes): Do apply non-dependent
3125         attributes to types.
3127 2017-02-16  Jason Merrill  <jason@redhat.com>
3129         PR c++/78572 - ICE with self-modifying array initializer
3130         * constexpr.c (cxx_eval_store_expression): The object we're
3131         initializing is outside the constant-expression.
3132         (cxx_eval_call_expression): Set ctx->call.
3134         PR c++/79050 - ICE with undeduced auto and LTO
3135         * decl.c (poplevel): Remove undeduced auto decls.
3137 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
3139         PR c++/79512
3140         * parser.c (cp_parser_omp_target): For -fopenmp-simd
3141         ignore #pragma omp target even when not followed by identifier.
3143 2017-02-15  Jason Merrill  <jason@redhat.com>
3144             Jakub Jelinek  <jakub@redhat.com>
3146         PR c++/79464 - ICE in IPA with omitted constructor parms
3147         * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
3148         (adjust_clone_args): Adjust.
3149         (add_method): Remember omitted parms.
3150         * call.c (add_function_candidate): Likewise.
3151         * mangle.c (write_method_parms): Likewise.
3152         * method.c (ctor_omit_inherited_parms): Return false if there are no
3153         parms to omit.
3155 2017-02-15  Martin Sebor  <msebor@redhat.com>
3157         PR c++/79363
3158         * init.c (maybe_reject_flexarray_init): New function.
3159         (perform_member_init): Call it.
3161 2017-02-15  Jakub Jelinek  <jakub@redhat.com>
3163         PR c++/79301
3164         * parser.c (cp_parser_std_attribute): Don't pedwarn about
3165         [[deprecated]] with -std=c++11 and [[fallthrough]] with
3166         -std=c++11 and -std=c++14.
3168         PR c++/79288
3169         * decl.c (grokdeclarator): For static data members, handle thread_p
3170         only after handling inline.
3172 2017-02-14  Marek Polacek  <polacek@redhat.com>
3174         PR c++/79420
3175         PR c++/79463
3176         * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
3177         clobbering if the postfix expression isn't an EXPR_P.
3179 2017-02-13  Jason Merrill  <jason@redhat.com>
3181         PR c++/79461 - ICE with lambda in constexpr constructor
3182         * constexpr.c (build_data_member_initialization): Ignore
3183         initialization of a local variable.
3185 2017-02-13  Jakub Jelinek  <jakub@redhat.com>
3187         * init.c (warn_placement_new_too_small): Add missing space in
3188         diagnostics.
3189         * parser.c (cp_parser_oacc_declare): Likewise.
3190         * mangle.c (maybe_check_abi_tags): Likewise.
3192         PR c++/79232
3193         * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
3194         on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
3195         in the rightmost operand.
3197 2017-02-13  Nathan Sidwell  <nathan@acm.org>
3199         PR c++/79296 - ICE mangling localized template instantiation
3200         * decl2.c (determine_visibility): Use template fn context for
3201         local class instantiations.
3203 2017-02-11  Jason Merrill  <jason@redhat.com>
3205         PR c++/77659 - ICE with new and C++14 aggregate NSDMI
3206         * init.c (build_new): Make backups of any CONSTRUCTORs in init.
3207         (build_new_1): Use replace_placeholders.
3208         * tree.c (replace_placeholders_t): Also track whether we've seen a
3209         placeholder.
3210         (replace_placeholders, replace_placeholders_r): Adjust.
3211         * cp-tree.h: Adjust.
3213         PR c++/77790 - ICE with auto function in C++11 mode
3214         * decl.c (undeduced_auto_decl): Remove C++14 limitation.
3215         (require_deduced_type): Add complain parm, return bool.
3216         * cp-tree.h: Adjust.
3217         * decl2.c (mark_used): Use require_deduced_type.
3219 2017-02-10  Jason Merrill  <jason@redhat.com>
3221         PR c++/78908 - template ops and bitfields
3222         * tree.c (build_min_non_dep): Use unlowered_expr_type.
3224         PR c++/78897 - constexpr union
3225         * constexpr.c (cxx_eval_store_expression): A store to a union member
3226         erases a previous store to another member.
3228         PR c++/71285 - member of fold-expression
3229         * semantics.c (finish_unary_fold_expr)
3230         (finish_binary_fold_expr): Use null type for fold-expressions.
3232         PR c++/79401 - protected inherited constructor
3233         * call.c (enforce_access): For inheriting constructor, find a base
3234         binfo in the path we already have.
3236 2017-02-10  Marek Polacek  <polacek@redhat.com>
3238         PR c++/79435
3239         * pt.c (type_dependent_expression_p): Check if the expression type
3240         is null.
3242         PR c++/79184
3243         * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
3244         if warnings shouldn't be given.
3246 2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
3248         PR c++/71737
3249         * pt.c (tsubst_decl): Don't try to preserve a typedef that names
3250         an error_mark_node as type.
3252 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
3253             Jason Merrill  <jason@redhat.com>
3255         PR c++/79143
3256         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
3257         from pattern to type.
3259 2017-02-09  Jason Merrill  <jason@redhat.com>
3261         PR c++/79316 - default argument in deduction guide
3262         PR c++/79350 - explicit deduction guide
3263         * parser.c (cp_parser_constructor_declarator_p)
3264         (cp_parser_direct_declarator): Parse deduction guides more like
3265         constructors.
3266         * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
3267         * tree.c (special_function_p): Return it.
3268         * decl.c (check_special_function_return_type): Handle it.
3269         (grokdeclarator, grokfndecl): Adjust.
3270         (cp_finish_decl): Pass flags to do_auto_deduction.
3271         * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
3272         * pt.c (dguide_name_p): Take a const_tree.
3273         (do_class_deduction): Handle explicit.
3274         (do_auto_deduction): Pass flags through.
3275         (build_deduction_guide): Copy explicit flag.
3277 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
3279         PR c++/79429
3280         * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
3281         non-pragma_compound context here.
3282         (cp_parser_omp_target): Likewise.
3283         (cp_parser_pragma): Don't call push_omp_privatization_clauses and
3284         parsing for ordered and target omp pragmas in non-pragma_stmt
3285         non-pragma_compound contexts.
3287         PR c/79431
3288         * parser.c (cp_parser_oacc_declare): Formatting fix.
3289         (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
3290         automatic variables.
3292 2016-02-09  Nathan Sidwell  <nathan@codesourcery.com>
3293             Chung-Lin Tang  <cltang@codesourcery.com>
3295         * parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
3296         parsing.  Parse constant expression. Remove semantic checking.
3297         (cp_parser_omp_clause_collapse): Disallow tile.
3298         (cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
3299         error about missing for after already emitting one.  Use more
3300         conventional for idiom for unbounded loop.
3301         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
3302         * semantics.c (finish_omp_clauses): Correct TILE semantic check.
3303         (finish_omp_for): Deal with tile clause.
3305 2017-02-07  Nathan Sidwell  <nathan@acm.org>
3307         * method.c (synthesized_method_base_walk): New.  Broken out of ...
3308         (synthesized_method_walk): ... here.  Call it.  Cleanup
3309         initializations.
3311 2017-02-07  Patrick Palka  <ppalka@gcc.gnu.org>
3313         PR c++/79360
3314         * typeck2.c (process_init_constructor_union): Consider only
3315         FIELD_DECLs when looking for an NSDMI.
3317 2017-02-06  Jason Merrill  <jason@redhat.com>
3319         PR c++/71193 - incomplete types in templates
3320         * parser.c (cp_parser_postfix_dot_deref_expression): In a template
3321         handle incomplete type by pedwarning and then treating as dependent.
3323 2017-02-06  Jakub Jelinek  <jakub@redhat.com>
3325         PR c++/79379
3326         * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
3327         (potential_constant_expression_1): Likewise.
3329         PR c++/79377
3330         * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
3331         allow one fewer than expected arguments if flag_permissive.
3333         PR c++/79372
3334         * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
3335         * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
3336         with error_mark_node type.
3338 2017-02-03  Jason Merrill  <jason@redhat.com>
3340         PR c++/78689 - ICE on constructor with label
3341         * optimize.c (maybe_clone_body): Replace omitted parameters with
3342         null lvalues.
3343         * class.c (build_clone): Fix logic for omitting inherited parms.
3345         PR c++/12245 - excessive memory use
3346         * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
3347         back in.  Don't cache constants.
3348         (maybe_constant_init): Don't cache constants.
3350         PR c++/79294 - ICE with invalid template argument
3351         * pt.c (convert_nontype_argument_function): Check value-dependence.
3352         (convert_nontype_argument): Don't check it here for function ptrs.
3354 2017-02-02  Richard Biener  <rguenther@suse.de>
3356         PR cp/14179
3357         * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
3358         it lazily on the first changed element only and copy it
3359         fully upfront, only storing changed elements.
3361 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
3363         PR c++/69637
3364         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
3365         to the width.
3367 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
3369         PR c++/79304
3370         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
3371         after ARROW_EXPR.
3373 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
3375         PR c++/79298
3376         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
3377         any namespace aliases.
3379 2017-01-31  Nathan Sidwell  <nathan@acm.org>
3381         PR c++/79290
3382         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
3384         PR c++/67273
3385         PR c++/79253
3386         * pt.c: (instantiate_decl): Push to top level when current
3387         function scope doesn't match.  Only push lmabda scope stack when
3388         pushing to top.
3390         * cp-tree.h (instantiate_decl): Make defer_ok bool.
3391         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
3392         (instantiate_decl): Simplify and reorder state saving and restoration.
3394         PR c++/79264
3395         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
3396         * semantics.c (finish_member_declaration): Assert class is being
3397         defined.
3399 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
3401         Introduce C++ support in libcc1.
3402         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
3403         (ansi_opname): Rename to...
3404         (cp_operator_id): ... this.  Adjust all callers.
3405         (ansi_assopname): Rename to...
3406         (cp_assignment_operator_id): ... this.  Adjust all callers.
3407         (cp_literal_operator_id): Declare.
3408         (set_global_friend): Declare.
3409         (is_global_friend): Declare.
3410         (enum cp_oracle_request): New type.
3411         (cp_binding_oracle_function): New type.
3412         (cp_binding_oracle): Declare.
3413         (cp_finish_injected_record_type): Declare.
3414         * friend.c (global_friend): New var.
3415         (set_global_friend): New fn.
3416         (is_global_friend): New fn.
3417         (is_friend): Call is_global_friend.
3418         * name-lookup.c (cp_binding_oracle): New var.
3419         (query_oracle): New fn.
3420         (qualified_lookup_using_namespace): Call query_oracle.
3421         (lookup_name_real_1): Likewise.
3422         * parser.c (cp_literal_operator_id): Drop static.
3423         * search.c (friend_accessible_p): Call is_global_friend.
3424         * semantics.c (is_this_parameter): Accept a variable if the
3425         binding oracle is enabled.
3427 2017-01-27  Jason Merrill  <jason@redhat.com>
3429         PR c++/78771 - ICE with inherited constructor.
3430         * call.c (build_over_call): Call deduce_inheriting_ctor here.
3431         * pt.c (tsubst_decl): Not here.
3432         * class.c (add_method): Or here.
3433         * method.c (deduce_inheriting_ctor): Handle clones.
3434         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
3436 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
3438         PR c++/64382
3439         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
3440         New function.
3441         * cp/cp-tree.h: Declare it.
3442         * cp/semantics.c (finish_id_expression): Resolve names within a default
3443         capturing generic lambda defined within a template prior to
3444         instantiation to allow for captures to be added to the closure type.
3446 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
3448         PR c++/68727
3449         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
3450         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
3451         * parser.c (cp_parser_builtin_offsetof): Pass result of
3452         build_static_cast of null_pointer_node to finish_offsetof.
3453         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
3454         it for -Winvalid-offsetof pedwarn instead of trying to guess
3455         original offsetof type from EXPR.  Save OBJECT_PTR as a new
3456         second operand to OFFSETOF_EXPR.
3457         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
3458         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
3459         as OBJECT_PTR.
3461 2017-01-26  Jason Merrill  <jason@redhat.com>
3463         * name-lookup.c (parse_using_directive): Deprecate strong using.
3465         PR c++/79176 - lambda ICE with -flto -Os
3466         * decl2.c (vague_linkage_p): Handle decloned 'tors.
3467         * tree.c (decl_linkage): Likewise.
3469 2017-01-25  Martin Sebor  <msebor@redhat.com>
3471         * decl.c (grokdeclarator): Fix a typo in a comment.
3473 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
3475         PR c++/78896
3476         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
3477         lambda expressions.
3479         PR c++/77914
3480         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
3481         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
3483 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
3485         PR lto/79061
3486         * decl.c (cxx_init_decl_processing): Pass main_input_filename
3487         to build_translation_unit_decl.
3489 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
3491         PR c++/79205
3492         * cp-gimplify.c (cp_genericize_r): Add result of
3493         convert_from_reference on invisiref parm to p_set.
3495 2017-01-24  Nathan Sidwell  <nathan@acm.org>
3497         PR c++/78469 - defaulted ctor and inaccessible dtor
3498         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
3499         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
3500         * tree.c (build_target_expr): Check tf_no_cleanup.
3502         PR c++/79118 - anon-members and constexpr
3503         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
3504         ctor decl.  Recursively check anonymous members.
3505         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
3506         call.
3507         (explain_invalid_constexpr_fn): Likewise.
3509 2017-01-23  Nathan Sidwell  <nathan@acm.org>
3511         PR c++/71710 - template using directive of field
3512         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
3513         check earlier.
3515         PR c++/71406 - ICE with scope-ref'd template id exprs
3516         PR c++/77508
3517         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
3518         before breaking up TEMPLATE_ID_EXPR.
3520 2017-01-20  Nathan Sidwell  <nathan@acm.org>
3522         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
3523         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
3525 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
3527         PR c++/77829
3528         PR c++/78656
3529         * cp-tree.h (suggest_alternatives_for): Add bool param.
3530         (suggest_alternative_in_explicit_scope): New decl.
3531         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
3532         that isn't the global one, call new function
3533         suggest_alternative_in_explicit_scope, only calling
3534         suggest_alternatives_for if it fails, and disabling near match
3535         searches fort that case.  When SCOPE is the global namespace,
3536         pass true for new param to suggest_alternatives_for to allow for
3537         fuzzy name lookups.
3538         * lex.c (unqualified_name_lookup_error): Pass true for new param
3539         to suggest_alternatives_for.
3540         * name-lookup.c (consider_binding_level): Add forward decl.
3541         (suggest_alternatives_for): Add "suggest_misspellings" param,
3542         using it to conditionalize the fuzzy name-lookup code.
3543         (suggest_alternative_in_explicit_scope): New function.
3544         * parser.c (cp_parser_primary_expression): When calling
3545         finish_id_expression, pass location of id_expression rather
3546         than that of id_expr_token.
3547         (cp_parser_id_expression): Convert local "unqualified_id" from
3548         tree to cp_expr to avoid implicitly dropping location information.
3550 2017-01-20  Marek Polacek  <polacek@redhat.com>
3552         PR c/64279
3553         * call.c (build_conditional_expr_1): Warn about duplicated branches.
3554         * semantics.c (finish_expr_stmt): Build statement using the proper
3555         location.
3557 2017-01-19  Jason Merrill  <jason@redhat.com>
3559         US 20 - forwarding references and class template argument deduction
3560         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
3561         * pt.c (push_template_decl_real): Set it.
3562         (maybe_adjust_types_for_deduction): Check it.
3563         (rewrite_template_parm): Copy it.
3565         US 19 - deduction guides and constructors
3566         * call.c (joust): Prefer deduction guides to constructors.
3567         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
3568         (deduction_guide_p): Check DECL_P.
3570         * decl.c (check_initializer): Always use build_aggr_init for array
3571         decomposition.
3573         PR c++/79130 - decomposition and direct-initialization
3574         * init.c (build_aggr_init): Communicate direct-initialization to
3575         build_vec_init.
3576         (build_vec_init): Check for array copy sooner.
3577         * parser.c (cp_parser_decomposition_declaration): Remove call to
3578         build_x_compound_expr_from_list.
3580 2017-01-18  Jason Merrill  <jason@redhat.com>
3582         PR c++/68666 - member variable template-id
3583         * typeck.c (finish_class_member_access_expr): Handle variable
3584         template-id.
3585         * pt.c (lookup_and_finish_template_variable): No longer static.
3586         * cp-tree.h: Declare it.
3588 2017-01-18  Nathan Sidwell  <nathan@acm.org>
3590         PR c++/78488
3591         * call.c (build_over_call): When checking ellipsis conversions for
3592         an inherited ctor, make sure there is at least one conversion.
3594 2017-01-18  Jason Merrill  <jason@redhat.com>
3596         PR c++/78894 - ICE with class deduction and default arg
3597         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
3599 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
3601         PR c++/77489
3602         * mangle.c (write_discriminator): Reorganize abi warning check.
3604 2017-01-18  Nathan Sidwell  <nathan@acm.org>
3606         * cp-tree.h: Clarify exception spec node comment.
3607         * except.c (nothrow_spec_p): Simplify by checking node-equality.
3609         PR c++/79091
3610         * mangle.c (write_exception_spec): Check nothrow explicitly.
3611         (write_encoding): Don't increment processing_template_decl around
3612         encoding.
3614 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
3616         PR c++/70182
3617         * mangle.c (write_template_args): Add "on" for operator names.
3619 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
3621         PR c++/77489
3622         * mangle.c (write_discriminator): Handle discriminator >= 10.
3624 2017-01-17  Nathan Sidwell  <nathan@acm.org>
3626         PR c++/61636
3627         * cp-tree.h (maybe_generic_this_capture): Declare.
3628         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
3629         (maybe_resolve_dummy): ... here.  Call it.
3630         (maybe_generic_this_capture): New.
3631         * parser.c (cp_parser_postfix_expression): Speculatively capture
3632         this in generic lambda in unresolved member function call.
3633         * pt.c (tsubst_copy_and_build): Force hard error from failed
3634         member function lookup in generic lambda.
3636 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
3638         PR c++/70565
3639         * cp-array-notation.c (expand_array_notation_exprs): Handle
3640         OMP_PARALLEL.
3642 2017-01-11  Jason Merrill  <jason@redhat.com>
3644         PR c++/78337 - ICE on invalid with generic lambda
3645         * semantics.c (process_outer_var_ref): Check if containing_function
3646         is null.  Move inform call under complain test.
3648 2017-01-11  Nathan Sidwell  <nathan@acm.org>
3650         PR c++/77812
3651         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
3652         is a new overload.
3654 2017-01-11  Nathan Sidwell  <nathan@acm.org>
3656         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
3658 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
3660         PR c++/78341
3661         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
3662         assertion.  Formatting fix.
3664         PR c++/72813
3665         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
3666         writing PCH file.
3668 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
3670         PR c++/77949
3671         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
3672         a missing semicolon if we have a valid insertion location for
3673         the fix-it hint.
3675 2017-01-10  Jason Merrill  <jason@redhat.com>
3677         FI 20, decomposition declaration with parenthesized initializer.
3678         * parser.c (cp_parser_decomposition_declaration): Use
3679         cp_parser_initializer.
3681 2017-01-09  Jason Merrill  <jason@redhat.com>
3683         Implement P0195R2, C++17 variadic using.
3684         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
3685         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
3686         * error.c (dump_decl): Likewise.
3688 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
3690         PR translation/79019
3691         PR translation/79020
3692         * semantics.c (finish_omp_clauses): Add missing whitespace to
3693         translatable strings.
3694         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
3696 2017-01-07  Jason Merrill  <jason@redhat.com>
3698         PR c++/78948 - instantiation from discarded statement
3699         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
3700         * cp-tree.h (in_discarded_stmt): Declare it.
3701         (struct saved_scope): Add discarded_stmt bitfield.
3702         (in_discarded_stmt): New macro.
3703         * decl2.c (mark_used): Check it.
3704         * parser.c (cp_parser_selection_statement): Adjust.
3705         (cp_parser_jump_statement): Adjust.
3707 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
3709         PR c++/78931
3710         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
3711         REFERENCE_REF_P, set tt to its operand.
3713         PR c++/78890
3714         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
3715         unions even for C++11 and later.
3717 2017-01-05  Nathan Sidwell  <nathan@acm.org>
3719         PR c++/78765
3720         * pt.c (convert_nontype_argument): Don't try and see if integral
3721         or enum expressions are constants prematurely.
3723 2017-01-04  Marek Polacek  <polacek@redhat.com>
3725         PR c++/64767
3726         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
3727         a zero character literal.
3729 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
3731         PR c++/78949
3732         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
3733         vector type.
3735         PR c++/78693
3736         * parser.c (cp_parser_simple_declaration): Only complain about
3737         inconsistent auto deduction if auto_result doesn't use auto.
3739         * parser.c (cp_parser_simple_declaration): Diagnose function
3740         declaration among more than one init-declarators with auto
3741         specifier.
3743         PR c++/71182
3744         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
3745         assertion, as lexer->buffer may be NULL.
3747 2017-01-04  Marek Polacek  <polacek@redhat.com>
3749         PR c++/77545
3750         PR c++/77284
3751         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
3753 2017-01-04  Nathan Sidwell  <nathan@acm.org>
3755         PR c++/66735
3756         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
3757         (lambda_capture_field_type): Update prototype.
3758         * lambda.c (lambda_capture_field_type): Add is_reference parm.
3759         Add referenceness here.
3760         (add_capture): Adjust lambda_capture_field_type call, refactor
3761         error checking.
3762         * pt.c (tsubst): Adjust lambda_capture_field_type call.
3764 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
3766         Update copyright years.
3768 Copyright (C) 2017 Free Software Foundation, Inc.
3770 Copying and distribution of this file, with or without modification,
3771 are permitted in any medium without royalty provided the copyright
3772 notice and this notice are preserved.