PR c++/82040
[official-gcc.git] / gcc / cp / ChangeLog
blobe27f04c2b655ebb7b981f3fed950f0ed497304f6
1 2017-09-01  Marek Polacek  <polacek@redhat.com>
3         PR c++/82040
4         * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
6 2017-08-30  Jason Merrill  <jason@redhat.com>
8         PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
9         * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
10         (regenerated_lambda_fn_p): New.
11         (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
12         (tsubst_copy) [VAR_DECL]: Likewise.
14         PR c++/82030 - ICE inheriting from multiple lambdas
15         PR c++/80767
16         * call.c (compare_ics): Handle null candidate.
18 2017-08-30  Ville Voutilainen  <ville.voutilainen@gmail.com>
20         Make taking the address of an overloaded function a non-deduced context
22         * pt.c (unify_overload_resolution_failure): Remove.
23         (unify_one_argument): Adjust.
25 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
26             Alan Hayward  <alan.hayward@arm.com>
27             David Sherwood  <david.sherwood@arm.com>
29         * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
31 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
32             Alan Hayward  <alan.hayward@arm.com>
33             David Sherwood  <david.sherwood@arm.com>
35         * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
37 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
38             Alan Hayward  <alan.hayward@arm.com>
39             David Sherwood  <david.sherwood@arm.com>
41         * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
42         instead of TYPE_MODE.
44 2017-08-29  Jason Merrill  <jason@redhat.com>
46         PR c++/81236 - ICE with template-id in generic lambda
47         * semantics.c (finish_id_expression): Remove special dependent case.
48         Avoid some later pieces when dependent.
49         (finish_qualified_id_expr): Do normal BASELINK handling in a
50         template.  Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
51         (parsing_default_capturing_generic_lambda_in_template): Remove.
52         * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
53         error for types that will never be complete.
54         * mangle.c (write_expression): Add sanity check.
55         * tree.c (build_qualified_name): Add sanity check.
56         (cp_walk_subtrees): Walk into the class context of a BASELINK.
57         * lambda.c (add_capture): Improve diagnostic for generic lambda
58         capture failure.
59         * call.c (build_new_method_call_1): Print the right constructor
60         name.
62         Reimplement handling of lambdas in templates.
63         * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
64         * decl.c (start_preparsed_function): Call start_lambda_scope.
65         (finish_function): Call finish_lambda_scope.
66         * init.c (get_nsdmi): Call start/finish_lambda_scope.
67         * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
68         * parser.c (cp_parser_function_definition_after_declarator): Don't
69         call start/finish_lambda_scope.
70         * pt.c (retrieve_specialization): Ignore lambda functions in
71         templates.
72         (find_parameter_packs_r): Ignore capture proxies.  Look into
73         lambdas.
74         (check_for_bare_parameter_packs): Allow bare packs in lambdas.
75         (tsubst_default_argument): Call start/finish_lambda_scope.
76         (tsubst_function_decl): Handle lambda functions differently.
77         (tsubst_template_decl): Likewise.
78         (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
79         proxies.
80         (tsubst_lambda_expr): Create a new closure rather than instantiate
81         the one from the template.
82         (tsubst_copy_and_build): Don't register a specialization of a pack.
83         (regenerate_decl_from_template): Call start/finish_lambda_scope.
84         (instantiate_decl): Remove special lambda function handling.
85         * semantics.c (process_outer_var_ref): Remove special generic lambda
86         handling.  Don't implicitly capture in a lambda in a template.  Look
87         for an existing proxy.
88         * class.c (current_nonlambda_class_type): Use decl_type_context.
90         * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
91         (LAMBDA_EXPR_RETURN_TYPE): Remove.
92         (struct tree_lambda_expr): Remove closure and return_type fields.
93         * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
94         * pt.c (tsubst_copy_and_build): Likewise.
95         * parser.c (cp_parser_lambda_declarator_opt): Track return type.
96         (cp_parser_lambda_body): Adjust unspecified return type check.
97         * ptree.c (cxx_print_lambda_node): Don't print closure or
98         return type.
100         PR c++/80935 - wrong C++17 error with lambda
101         * decl.c (check_for_uninitialized_const_var): Check
102         is_instantiation_of_constexpr.
103         * constexpr.c (ensure_literal_type_for_constexpr_object): Check
104         is_instantiation_of_constexpr.
105         (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
107         * lambda.c (build_lambda_object): Check for error_mark_node.
108         * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
109         pack as well.
110         (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
111         (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
113         PR c++/80767 - unnecessary instantiation of generic lambda
114         * call.c (convert_like_real): Call build_user_type_conversion_1 if
115         cand is null.
116         (add_conv_candidate): Build a ck_user conversion with no candidate.
118         Fix lambdas in template default argument of inherited ctor.
119         * method.c (synthesized_method_base_walk): Replace an inherited
120         template with its specialization.
121         (synthesized_method_walk): Make inheriting_ctor a pointer.
122         (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
123         (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
125         * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
126         template, not the function.
127         (template_guide_p): Adjust.
129         Support copying local_specializations.
130         * cp-tree.h (enum lss_policy): New.
131         (local_specialization_stack): Add policy parameter to default ctor.
132         * pt.c (local_specialization_stack): Copy local_specializations if
133         lss_copy.
135         * constexpr.c (potential_constant_expression_1): Add "now" parm.
136         (is_constant_expression, require_constant_expression): New.
137         (is_static_init_expression, is_nondependent_constant_expression)
138         (is_nondependent_static_init_expression): Drop "potential".
139         * except.c (build_must_not_throw_expr): Do type conversion on
140         value-dependent argument.
141         * pt.c, semantics.c, typeck2.c: Use variants without "potential".
143         Instantiate default arguments/member initializers once.
144         * init.c (get_nsdmi): Remember NSDMI instantiations.
145         * parser.c (inject_this_parameter): Be more picky about
146         current_class_ptr.
147         * pt.c (tsubst_copy): Simplify 'this' handling.
148         (tsubst_default_argument): Remember default argument
149         instantiations.  Take parameter number.
150         (tsubst_default_arguments): Pass it.
151         * call.c (convert_default_arg): Likewise.
153         Fix default argument conversion failure and SFINAE.
154         * call.c (build_over_call): Check convert_default_arg result for
155         error_mark_node.
156         * parser.c (cp_parser_late_parsing_default_args): Remember
157         error_mark_node.
159 2017-08-28  Nathan Sidwell  <nathan@acm.org>
161         * cp-tree.h (lang_type): Replace sorted_fields vector with
162         bindings map.
163         (CLASSTYPE_SORTED_FIELDS): Delete.
164         (CLASSTYPE_BINDINGS): New.
165         * decl.c (finish_enum_value_list): Swap args of
166         insert_late_enum_def_bindings.
167         * name-lookup.c (lookup_field_1): Replace binary search of sorted
168         fields with map->get.
169         (sorted_fields_type_new, count_fields,
170         add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
171         (add_class_member, add_class_members): New.
172         (set_class_bindings): Create map and insert.
173         (insert_late_enum_def_binding): Swap parms.  Use add_clasS_member.
174         * ptree.c (cxx_print_type): Delete sorted fields printing.
176         * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
177         Delete.
178         * name-lookup.h (set_class_bindings,
179         insert_late_enum_def_bindings): Declare.
180         * decl.c (finish_enum_value_list): Adjust for
181         insert_late_enum_def_bindings name change.
182         * class.c (finish_struct_1): Call set_class_bindings.
183         (count_fields, add_fields_to_record_type,
184         add_enum_fields_to_record_type, sorted_fields_type_new,
185         insert_into_classtype_sorted_fields,
186         insert_late_enum_def_into_classtype_sorted_fields): Move to ...
187         * name-lookup.h (count_fields, add_fields_to_record_type,
188         add_enum_fields_to_record_type, sorted_fields_type_new,
189         set_class_bindings, insert_late_enum_def_bindings): ... here.
191 2017-08-25  Nathan Sidwell  <nathan@acm.org>
193         * class.c (method_name_cmp, resort_method_name_cmp): Methods
194         can never be NULL.
196         Conversion operators have a special name
197         * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
198         (conv_op_marker, conv_op_identifier): New.
199         (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
200         * decl.c (initialize_predefined_identifiers): Add
201         conv_op_identifier.
202         (cxx_init_decl_processing): Create conv_op_marker.
203         * decl2.c (check_classfn): Lookup conv-ops by name.
204         * class.c (add_method): Use conv_op_identifier & conv_op_marker.
205         (resort_type_method_vec): Don't skip conv-ops.
206         (finish_struct_methods, warn_hidden): Likewise.
207         * name-lookup.h (lookup_all_conversions): Delete.
208         * name-lookup.c (lookup_conversion_operator): Replace with ...
209         (extract_conversion_operator): ... this.
210         (lookup_fnfields_slot_nolazy): Find conv-ops by name.
211         (lookup_all_conversions): Delete.
212         * pt.c (check_explicit_specialization): Find conv-ops by name.
213         * search.c (lookup_conversions_r): Likewise.
215 2017-08-24  Nathan Sidwell  <nathan@acm.org>
217         Conversion operators kept on single overload set
218         * class.c (add_method): Keep all conv-ops on one slot.
219         * name-lookup.c (lookup_conversion_operator): Pull the desired
220         conv op out of overload set.
221         * search.c (lookup_conversions_r): Lose template/non-template
222         distinction.
223         (lookup_conversions): Likewise.
225 2017-08-23  Nathan Sidwell  <nathan@acm.org>
227         * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
228         lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
229         declatations to ...
230         * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
231         lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
232         * search.c (lookup_conversion_operator,
233         lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
234         lookup_all_conversions): Move to ...
235         * name-lookup.c (lookup_conversion_operator,
236         lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
237         lookup_all_conversions): ... here.
239         * semantics.c (finish_member_declaration): Move USING_DECL check
240         earlier.  Always set C++ linkage.  Commonize TYPE_FIELD and
241         template decl list insertion.
243         * cp-tree.h (maybe_version_functions): Declare.
244         * decl.c (decls_match): Break function versioning check to
245         separate function.  Call it.
246         (maybe_version_functions): Broken out of decls_match.
247         * class.c (add_method): Use maybe_version_functions.
249         * cp-tree.h (print_search_statistics,
250         reinit_search_statistics): Don't declare.
251         * search.c (n_fields_searched, n_calls_lookup_field,
252         n_calls_lookup_field_1, n_calls_lookup_fnfields,
253         n_calls_lookup_fnfields_1, n_calls_get_base_type,
254         n_outer_fields_searched, n_contexts_saved): Delete.
255         (lookup_field_1, lookup_member,
256         lookup_fnfields_slot_nolazy): Remove stat gathering.
257         (print_search_statistics, reinit_search_statistics): Delete.
258         * tree.c (cxx_print_statistics): Don't print search stats.
260 2017-08-21  Nathan Sidwell  <nathan@acm.org>
262         * search.c (lookup_field_r): Remove obsolete code for type-named
263         field in PoD.
265         * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
266         isn't special.
267         (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
268         (lookup_field_fuzzy_r): Adjust.
270 2017-08-21  David Malcolm  <dmalcolm@redhat.com>
272         * call.c (build_over_call): Pass NULL for new parameter to
273         check_function_arguments.
274         * typeck.c (cp_build_function_call_vec): Likewise.
276 2017-08-21  Nathan Sidwell  <nathan@acm.org>
278         PR c++/81899
279         * pt.c (instantiate_class_template_1):
280         BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
282 2017-08-18  David Malcolm  <dmalcolm@redhat.com>
284         PR c++/81514
285         * name-lookup.c (maybe_suggest_missing_header): Convert return
286         type from void to bool; return true iff a suggestion was offered.
287         (suggest_alternative_in_explicit_scope): Move call to
288         maybe_suggest_missing_header to before use of best_match, and
289         return true if the former offers a suggestion.
291 2017-08-18  H.J. Lu  <hongjiu.lu@intel.com>
293         PR c/53037
294         * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
295         * decl2.c (grokbitfield): Don't allow bit-field with
296         warn_if_not_aligned type.
298 2017-08-17  Nathan Sidwell  <nathan@acm.org>
300         * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
301         * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
302         (TYPE_TEMPLATE_INFO): Simplify.
303         (SET_TYPE_TEMPLATE_INFO): Simplify.
305         * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
306         don't need lang_type.
307         (cxx_make_type): Use maybe_add_lang_type_raw return value.
308         * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
309         TYPE_LANG_SPECIFIC.
311         * cp-tree.h (struct lang_type): Remove template_info field.
312         (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
313         (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
315 2017-08-14  Martin Sebor  <msebor@redhat.com>
317         PR c/81117
318         * error.c (cp_printer): Handle 'G'.
320 2017-08-11  Martin Liska  <mliska@suse.cz>
322         * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
323         TARGET_SUPPORTS_ALIASES.
324         (handle_tls_init): Likewise.
325         (note_mangling_alias): Likewise.  Remove ATTRIBUTE_UNUSED for
326         both arguments.
327         * optimize.c (can_alias_cdtor): Likewise.
329 2017-08-11  Jason Merrill  <jason@redhat.com>
331         PR c++/81671 - nullptr_t template parameter
332         * pt.c (convert_nontype_argument): Fix nullptr_t check.
334 2017-08-10  Jason Merrill  <jason@redhat.com>
336         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
337         * method.c (synthesized_method_walk): Don't diagnose lack of
338         operator delete.
340         PR c++/80452 - Core 1579, implicit move semantics on return/throw
341         * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
342         tentatively changed the lvalue to an rvalue.
343         * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
344         (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
345         parameter is an rvalue reference.
346         * except.c (build_throw): Do maybe-rvalue overload resolution twice.
347         * typeck.c (check_return_expr): Likewise.
349 2017-08-10  David Malcolm  <dmalcolm@redhat.com>
351         * parser.c (cp_parser_error): Update for new param to
352         c_parse_error.
353         (class token_pair): New class.
354         (struct matching_paren_traits): New struct.
355         (matching_parens): New typedef.
356         (struct matching_brace_traits): New struct.
357         (matching_braces): New typedef.
358         (cp_parser_statement_expr): Convert explicit parsing of
359         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
360         class matching_parens, so that the pertinent open parenthesis is
361         highlighted when there are problems locating the close
362         parenthesis.
363         (cp_parser_primary_expression): Likewise.
364         (cp_parser_compound_literal_p): Remove consumption of opening
365         paren.
366         (cp_parser_postfix_expression): Convert explicit parsing of
367         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
368         above.  Use it to consume the opening paren previously consumed by
369         cp_parser_compound_literal_p.
370         (cp_parser_parenthesized_expression_list): Likewise.
371         (cp_parser_unary_expression): Likewise.
372         (cp_parser_new_expression): Likewise.
373         (cp_parser_cast_expression): Likewise.
374         (cp_parser_builtin_offsetof): Likewise.
375         (cp_parser_trait_expr): Likewise.
376         (cp_parser_lambda_declarator_opt): Likewise.
377         (cp_parser_lambda_body): Likewise, for matching_braces.
378         (cp_parser_compound_statement): Likewise.
379         (cp_parser_selection_statement): Likewise, for matching_parens.
380         (cp_parser_iteration_statement): Likewise.
381         (cp_parser_already_scoped_statement): Likewise, for
382         matching_braces.
383         (cp_parser_linkage_specification): Likewise.
384         (cp_parser_static_assert): Likewise, for matching_parens.
385         (cp_parser_decltype): Likewise.
386         (cp_parser_operator): Likewise.
387         (cp_parser_enum_specifier): Likewise.
388         (cp_parser_namespace_definition): Likewise.
389         (cp_parser_direct_declarator): Likewise.
390         (cp_parser_braced_list): Likewise.
391         (cp_parser_class_specifier_1): Likewise, for matching_braces.
392         (cp_parser_constant_initializer): Likewise.
393         (cp_parser_noexcept_specification_opt): Likewise, for
394         matching_parens.
395         (cp_parser_exception_specification_opt): Likewise.
396         (cp_parser_handler): Likewise.
397         (cp_parser_asm_specification_opt): Likewise.
398         (cp_parser_asm_operand_list): Likewise.
399         (cp_parser_gnu_attributes_opt): Likewise.
400         (cp_parser_std_attribute_spec): Likewise.
401         (cp_parser_requirement_parameter_list): Likewise.
402         (cp_parser_requirement_body): Likewise, for matching_braces.
403         (cp_parser_compound_requirement): Likewise.
404         (cp_parser_template_introduction): Likewise.
405         (cp_parser_sizeof_pack): Likewise, for matching_parens.
406         (cp_parser_sizeof_operand): Likewise; use it to consume the
407         opening paren previously consumed by cp_parser_compound_literal_p.
408         (get_matching_symbol): New function.
409         (cp_parser_required_error): Add param "matching_location".  Remove
410         calls to cp_parser_error, instead setting a non-NULL gmsgid, and
411         handling it if set by calling c_parse_error, potentially with a
412         secondary location if matching_location was set.
413         (cp_parser_require): Add param "matching_location", with a default
414         value of UNKNOWN_LOCATION.
415         (cp_parser_require_keyword): Update for new param of
416         cp_parser_required_error.
417         (cp_parser_objc_encode_expression): Update to class matching_parens
418         as above.
419         (cp_parser_objc_defs_expression): Likewise.
420         (cp_parser_objc_protocol_expression): Likewise.
421         (cp_parser_objc_selector_expression): Likewise.
422         (cp_parser_objc_typename): Likewise.
423         (cp_parser_objc_superclass_or_category): Likewise.
424         (cp_parser_objc_try_catch_finally_statement): Likewise.
425         (cp_parser_objc_synchronized_statement): Likewise.
426         (cp_parser_objc_at_property_declaration): Likewise.
427         (cp_parser_oacc_single_int_clause): Likewise.
428         (cp_parser_oacc_shape_clause): Likewise.
429         (cp_parser_omp_clause_collapse): Likewise.
430         (cp_parser_omp_clause_default): Likewise.
431         (cp_parser_omp_clause_final): Likewise.
432         (cp_parser_omp_clause_if): Likewise.
433         (cp_parser_omp_clause_num_threads): Likewise.
434         (cp_parser_omp_clause_num_tasks): Likewise.
435         (cp_parser_omp_clause_grainsize): Likewise.
436         (cp_parser_omp_clause_priority): Likewise.
437         (cp_parser_omp_clause_hint): Likewise.
438         (cp_parser_omp_clause_defaultmap): Likewise.
439         (cp_parser_omp_clause_ordered): Likewise.
440         (cp_parser_omp_clause_schedule): Likewise.
441         (cp_parser_omp_clause_num_teams): Likewise.
442         (cp_parser_omp_clause_thread_limit): Likewise.
443         (cp_parser_omp_clause_aligned): Likewise.
444         (cp_parser_omp_clause_linear): Likewise.
445         (cp_parser_omp_clause_safelen): Likewise.
446         (cp_parser_omp_clause_simdlen): Likewise.
447         (cp_parser_omp_clause_depend): Likewise.
448         (cp_parser_omp_clause_device): Likewise.
449         (cp_parser_omp_clause_dist_schedule): Likewise.
450         (cp_parser_oacc_clause_async): Likewise.
451         (cp_parser_omp_critical): Likewise.
452         (cp_parser_omp_for_loop): Likewise.
453         (cp_parser_omp_sections_scope): Likewise.
454         (cp_parser_omp_declare_reduction_exprs): Likewise.
455         Update for new param to cp_parser_required_error.
456         (cp_parser_oacc_routine): Likewise.
457         (cp_parser_transaction_expression): Likewise.
458         (cp_parser_cilk_simd_vectorlength): Likewise.
460 2017-08-09  Jason Merrill  <jason@redhat.com>
462         PR c++/81525 - wrong constant value with generic lambda
463         * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
464         (tsubst_copy) [VAR_DECL]: Handle auto.
466         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
467         * init.c (get_nsdmi): Add complain parm.
468         * typeck2.c (digest_nsdmi_init): Add complain parm.
469         (process_init_constructor_record): Pass complain to get_nsdmi.
470         * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
471         * method.c (get_defaulted_eh_spec): Add complain parm.  Pass it into
472         synthesized_method_walk.
473         (synthesized_method_walk): Adjust.
474         (walk_field_subobs): Pass complain to get_nsdmi.
475         (defaulted_late_check): Skip other checks if deleted.
476         * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
477         * call.c (build_aggr_conv): Pass complain to get_nsdmi.
478         * parser.c (defarg_location): New.
479         * error.c (location_of): Use it.
481 2017-08-09  Marek Polacek  <polacek@redhat.com>
483         * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
484         * typeck.c (build_binary_op): Change the type of a parameter to bool.
485         (cp_truthvalue_conversion): Use true instead of 1.
487 2017-08-08  Marek Polacek  <polacek@redhat.com>
489         PR c++/81607
490         * cp-gimplify.c (cp_fold): If folding exposed a branch of
491         a COND_EXPR, convert it to the original type of the COND_EXPR, if
492         they differ.               
494 2017-08-08  Martin Liska  <mliska@suse.cz>
496         * call.c: Include header files.
497         * cp-gimplify.c: Likewise.
498         * cp-ubsan.c: Likewise.
499         * cvt.c: Likewise.
500         * init.c: Likewise.
501         * search.c: Likewise.
502         * semantics.c: Likewise.
503         * typeck.c: Likewise.
505 2017-08-07  Martin Liska  <mliska@suse.cz>
507         * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
508         attribute.
509         (cp_parser_std_attribute): Likewise.
510         * tree.c: Add new include.
512 2017-08-04  Paolo Carlini  <paolo.carlini@oracle.com>
514         PR c++/79790
515         * pt.c (do_class_deduction): Handle the case of no viable implicit
516         deduction guides; simplify the code generating implicit deduction
517         guides.
519 2017-08-03  Paolo Carlini  <paolo.carlini@oracle.com>
521         PR c++/71440
522         * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
523         destructor as expressions.
525 2017-08-02  Jakub Jelinek  <jakub@redhat.com>
527         PR c++/81640
528         * call.c (build_user_type_conversion_1): Only call
529         lookup_fnfields_slot if totype is CLASS_TYPE_P.
531 2017-07-31  Jason Merrill  <jason@redhat.com>
533         * decl.c (declare_global_var): Set DECL_CONTEXT.
535 2017-07-31  Jan Hubicka <hubicka@ucw.cz>
536             Martin Liska  <mliska@suse.cz>
538         * pt.c (tsubst_copy): Copy PREDICT_EXPR.
539         * semantics.c (finish_goto_stmt): Build gimple predict
540         stament.
541         * constexpr.c (potential_constant_expression_1): Handle
542         PREDICT_EXPR.
544 2017-07-31  Martin Liska  <mliska@suse.cz>
546         PR sanitize/81530
547         * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
548         also with current_function_decl non-null equality.
549         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
550         * decl.c (compute_array_index_type): Likewise.
551         * init.c (finish_length_check): Likewise.
552         * typeck.c (cp_build_binary_op): Likewise.
554 2017-07-29  Jakub Jelinek  <jakub@redhat.com>
556         * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
557         DW_AT_export_symbols.
558         * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
559         argument, pass it through to the debug hook.
560         (finish_namespace_using_directive): Adjust
561         emit_debug_info_using_namespace caller.
562         (push_namespace): Likewise.  Call it after setting
563         DECL_NAMESPACE_INLINE_P.
564         (cp_emit_debug_info_for_using): Pass false as new argument to
565         the imported_module_or_decl debug hook.
567 2017-07-28  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
569         * lex.c (copy_decl): Adjust.
570         (copy_type): Likewise.
572 2017-07-26  Paolo Carlini  <paolo.carlini@oracle.com>
574         PR c++/71570
575         * lambda.c (add_capture): Early return if we cannot capture by
576         reference.
578 2017-07-26  Jason Merrill  <jason@redhat.com>
580         P0702R1 - List deduction of vector.
581         * pt.c (do_class_deduction): Special-case deduction from a single
582         element of related type.
584 2017-07-26  Leonid Koppel  <lkoppel@uwaterloo.ca>
586         PR c++/67054 - Inherited ctor with non-default-constructible members
587         * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
588         when deducing an inheriting constructor.
590 2017-07-21  Nathan Sidwell  <nathan@acm.org>
592         * search.c (lookup_conversion_operator): Return overloads.
593         (lookup_fnfields_idx_nolazy): Absorb into ...
594         (lookup_fnfields_slot_nolaxy): ... here.
595         (lookup_fnfields_1): Absorb into ...
596         (lookup_fnfields_slot): ... here.
598         Remove special CDtor METHOD_VEC slots.
599         * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
600         CLASSTYPE_DESTRUCTOR_SLOT): Delete.
601         (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
602         (CLASSTYPE_DESTRUCTOR): Likewise.
603         * class (add_method): Don't use special cdtor slots.
604         * search.c (lookup_fnfields_idx_nolazy): Likewise.
605         (look_for_overrides_here): Use lookup_fnfields_slot.
606         * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
608         * call.c (add_candidates): Move decls to initialization.  Don't
609         use !!.
611 2017-07-20  Nathan Sidwell  <nathan@acm.org>
613         Remove TYPE_METHODS.
614         * class.c (maybe_warn_about_overly_private_class,
615         finish_struct_methods, one_inheriting_sig, count_fields,
616         add_fields_to_record_type, check_field_decls, check_methods,
617         clone_function_decl, set_method_tm_attributes,
618         finalize_literal_type_property, check_bases_and_members,
619         create_vtable_ptr, determine_key_method,
620         unreverse_member_declarations, finish_struct,
621         add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
622         * decl.c (fixup_anonymous_aggr): Likewise.
623         * decl2.c (reset_type_linkage_2): Likewise.
624         * method.c (after_nsdmi_defaulted_late_checks,
625         lazily_declare_fn): Likewise.
626         * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
627         * pt.c (instantiate_class_template_1, tsubst_expr,
628         do_type_instantiation, instantiate_pending_templates): Likewise.
629         * search.c (lookup_field_1): Likewise.
630         * semantics.c (finish_member_declaration,
631         finish_omp_declare_simd_methods): Likewise.
633 2017-07-19  Nathan Sidwell  <nathan@acm.org>
635         * class.c (add_implicitly_declared_members): Use
636         classtype_has_move_assign_or_move_ctor_p.
637         (classtype_has_move_assign_or_move_ctor,
638         classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
639         (classtype_has_move_assign_or_move_ctor_p): ... this new function.
640         * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
641         Replace with ...
642         (classtype_has_move_assign_or_move_ctor_p): ... this.
643         * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
644         * tree.c (type_has_nontrivial_copy_init): Adjust.
646         * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
647         PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
649 2017-07-18  Nathan Sidwell  <nathan@acm.org>
651         * cp-array-notation.c (build_array_notation_ref): Use
652         TYPE_{MIN,MAX}_VALUE.
654         * class.c (classtype_has_move_assign_or_move_ctor): Declare.
655         (add_implicitly_declared_members): Use it.
656         (type_has_move_constructor, type_has_move_assign): Merge into ...
657         (classtype_has_move_assign_or_move_ctor): ... this new function.
658         * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
660 2017-07-17  Volker Reichelt  <v.reichelt@netcologne.de>
662         * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
663         friend outside class and obsolete auto as storage-class-specifier.
665 2017-07-17  Nathan Sidwell  <nathan@acm.org>
667         * class.c (maybe_warn_about_overly_private_class): Ignore public
668         copy ctors.
670         * class.c (type_has_user_declared_move_constructor,
671         type_has_user_declared_move_assign): Combine into ...
672         (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
673         * cp-tree.h (type_has_user_declared_move_constructor,
674         type_has_user_declared_move_assign): Combine into ...
675         (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
676         * method.c (maybe_explain_implicit_delete): Use it.
677         (lazily_declare_fn): Use it.
678         * tree.c (type_has_nontrivial_copy_init): Use it.
680         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
681         semantics, simplify implementation.
683 2017-07-16  Volker Reichelt  <v.reichelt@netcologne.de>
685         * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
686         in old-style cast diagnostic.
687         * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
688         in useless cast diagnostic.
689         * error.c (type_to_string): Remove enum special handling.
691 2017-07-14  David Malcolm  <dmalcolm@redhat.com>
693         * name-lookup.c (get_std_name_hint): Add '<' and '>' around
694         the header names.
695         (maybe_suggest_missing_header): Update for addition of '<' and '>'
696         to above.  Provide a fix-it hint.
697         * pt.c: Include "gcc-rich-location.h"
698         (listify): Attempt to add fix-it hint for missing
699         #include <initializer_list>.
700         * rtti.c: Include "gcc-rich-location.h".
701         (typeid_ok_p): Attempt to add fix-it hint for missing
702         #include <typeinfo>.
704 2017-07-12  Jason Merrill  <jason@redhat.com>
706         P0512R0 - Deduction from an initializer list.
707         * pt.c (do_class_deduction): Do list deduction in two phases.
709 2017-07-12  Nathan Sidwell  <nathan@acm.org>
711         * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
712         DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
713         identifier flags.
714         * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
715         DECL_CXX_DESTRUCTOR explicitly.
716         * decl2.c (grokclassfn): Likewise.
717         * friend.c (do_friend): Likewise.
718         * method.c (make_thunk, make_alias_for,
719         implicitly_declare_fn): Likewise.
721 2017-07-11  Jason Merrill  <jason@redhat.com>
723         Core DR 393
724         * decl.c (grokparms): Downgrade error about array of unknown bound
725         to pedwarn and disable it for C++17.
727 2017-07-11  Nathan Sidwell  <nathan@acm.org>
729         * decl2.c (reset_type_linkage_2): Dont't change ctor name.
731 2017-07-10  Martin Sebor  <msebor@redhat.com>
733         * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
735 2017-07-06  Jason Merrill  <jason@redhat.com>
737         PR c++/81204 - parse error with dependent template-name
738         * parser.c (cp_parser_lookup_name): Revert previous change.
740 2017-07-06  David Malcolm  <dmalcolm@redhat.com>
742         * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
743         selftest::run_cp_tests.
744         (selftest::run_cp_tests): New function.
745         * cp-tree.h (selftest::run_cp_tests): New decl.
747 2017-07-04  Jakub Jelinek  <jakub@redhat.com>
749         * parser.c (cp_parser_decomposition_declaration): Replace
750         decomposition declaration with structured binding in diagnostics.
751         * decl.c (cp_finish_decomp): Likewise.
752         (grokdeclarator): Likewise.
754         PR c++/81258
755         * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
756         forms of structured binding initializers.
758 2017-07-03  Paolo Carlini  <paolo.carlini@oracle.com>
760         PR c++/65775
761         * decl.c (grokdeclarator): Move checks on function return type after
762         the splice_late_return_type call; if declspecs->locations[ds_type_spec]
763         is UNKNOWN_LOCATION fall back to input_location.
765 2017-07-03  David Malcolm  <dmalcolm@redhat.com>
767         * parser.c (enum required_token): Fix spelling of
768         RT_INTERATION to RT_ITERATION.
769         (cp_parser_iteration_statement): Likewise.
770         (cp_parser_required_error): Likewise.
772 2017-06-30  Jason Merrill  <jason@redhat.com>
774         PR c++/81257 - ICE with invalid ::template.
775         PR c++/54769 - wrong lookup of dependent template-name.
776         * parser.c (cp_parser_template_name): Revert part of last change.
778 2017-06-30  Nathan Sidwell  <nathan@acm.org>
780         * config-lang.in (gtfiles): Add cp/lex.c.
781         * cp-tree.h (mangle_convop_name_for_type): Rename ...
782         (make_conv_op_name): ... here.  Move to lex.
783         * lambda.c (maybe_add_lambda_conv_op): Update.
784         * parser.c (cp_parser_conversion_function_id): Update.
785         * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
786         tsubst_copy_and_build): Update.
787         * semantics.c (apply_deduced_return_type): Update.
788         * mangle.c (conv_type_hasher, conv_type_names,
789         mangle_conv_op_name_for_type): Move to ...
790         * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
791         ... here.  Rename.
793 2017-06-30  David Malcolm  <dmalcolm@redhat.com>
795         PR c++/80014
796         * parser.c (cp_parser_postfix_expression): Construct a location
797         for typeid expressions.
799 2017-06-30  Nathan Sidwell  <nathan@acm.org>
801         * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
802         declare.
803         (lookup_all_conversions): Declare.
804         * class.c (get_basefndecls): Use lookup_fnfields_slot.
805         * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
806         * decl2.c (check_class_fn): Use lookup_fnfields_slot.  Rework
807         diagnostics.
808         * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
809         (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
810         lookup_all_conversions.
811         * search.c (lookup_fnfields_1): Make static.
812         (lookup_all_conversions): New.
813         (class_method_index_for_fn): Delete.
814         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
815         lookup_fnfields_slot.
817         * call.c (build_new_method_call_1): Use constructo_name to get
818         ctor name.  Move argument processing earlier to merge cdtor
819         handling blocks.
820         * decl.c (grokfndecl): Cdtors have special names.
821         * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
822         * pt.c (check_explicit_specialization): Cdtor name is already
823         special.
824         * search.c (class_method_index_for_fn): Likewise.
826         PR c++/81229
827         * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
828         a matching TYPE_DECL.
830 2017-06-29  Paolo Carlini  <paolo.carlini@oracle.com>
832         * class.c (add_method): Change pair of errors to error + inform.
833         (handle_using_decl): Likewise.
835 2017-06-29  Jason Merrill  <jason@redhat.com>
837         * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
839         PR c++/81180 - ICE with C++17 deduction of member class template.
840         * pt.c (build_deduction_guide): Correct member template handling.
842         PR c++/81188 - matching decltype of member function call.
843         * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
845 2017-06-29  Nathan Sidwell  <nathan@acm.org>
847         PR c++/81247
848         * parser.c (cp_parser_namespace_definition): Immediately close the
849         namespace if there's no open-brace.
850         * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
851         namespace.
853 2017-06-29  Jason Merrill  <jason@redhat.com>
855         PR c++/81164 - ICE with invalid inherited constructor.
856         * search.c (binfo_direct_p): New.
857         * name-lookup.c (do_class_using_decl): Use it.
859 2017-06-29  Nathan Sidwell  <nathan@acm.org>
861         * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
862         VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
863         * decl.c (initialize_predefined_identifiers): Name cdtor special
864         names consistently.  Use literals for above deleted defines.
865         (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
867         * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
868         flag.
870         * call.c (check_dtor_name): Use constructor_name for enums too.
871         (build_new_method_call_1): Use constructor_name for cdtors and
872         show ~ for dtor.
873         * class.c (build_self_reference): Use TYPE_NAME to get name of
874         self reference.
875         * name-lookup (constructor_name): Use DECL_NAME directly.
876         (constructor_name_p): Reimplement.
877         (push_class_level_binding_1): Use TYPE_NAME directly.
879         * class.c (finish_struct): Use OVL_P.
880         (get_vfield_name): Measure constructor_name length.
881         * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
882         (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
883         * cxx-pretty-print.c (is_destructor_name): Delete.
884         (pp_cxx_unqualified_id): Remove bogus destructor name checking.
885         * decl.c (grokfndecl): Move cheap checks first when looking for
886         implicit extern cness.
888         * parser.c (cp_parser_direct_declarator): Reorder if to avoid
889         indentation. Remove unnecessary assignment of constructor name.
891         Whitespace cleanups.
892         * call.c (name_as_c_string): Move CONST_CAST to return.
893         (build_new_method_call_1): Remove unneeded bracing.
894         * class.c (include_empty_classes): Unbreak line.
895         * constraint.cc (tsubst_check_constraint): Add space.
896         * cp-tree.h (lang_decl_ns): Add comment.
897         (PTRMEM_CST_MEMBER): Break line.
898         * decl.c (grokfndecl): Add blank lines. Unbreak some others.
899         (grokdeclarator): Remove lines, move declaration to first use.
900         * decl2.c (decl_needed_p): Fix indentation.
901         (c_parse_final_cleanups): Remove blank line.
902         * method.c (implicitly_declare_fn): Move declaration to first use.
903         * search.c (current_scope): Add blank lines.
905 2017-06-28  Jason Merrill  <jason@redhat.com>
907         PR c++/72764 - ICE with invalid template typename.
908         * decl.c (build_typename_type): No longer static.
909         * tree.c (strip_typedefs): Use it instead of make_typename_type.
911         PR c++/69300 - ICE with self-referential noexcept
912         * pt.c (maybe_instantiate_noexcept): Check for recursion.
914         PR c++/61022 - error with variadic template template parm
915         * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
917         PR c++/72801 - ICE with variadic partial specialization
918         * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
920         PR c++/55639 - partial specialization with ::template
921         * parser.c (cp_parser_class_head): Handle ::template.
923         PR c++/45976 - error with ::template in declarator.
924         * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
926         PR c++/54769 - wrong lookup of dependent template-name.
927         * parser.c (cp_parser_template_name): Handle dependent object type.
928         (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
929         parameter.
930         (cp_parser_id_expression): Pass it.
931         (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
933         * parser.c (cp_parser_template_id): Use the range location on the
934         TEMPLATE_ID_EXPR.
936         PR c++/81204 - parse error with dependent template-name
937         * parser.c (cp_parser_lookup_name): Disqualify function templates
938         after lookup.
940 2017-06-27  Nathan Sidwell  <nathan@acm.org>
942         * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
943         initialization point.  Don't unnecessarily check for ctor name.
945         * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
946         (CLASSTYPE_DESTRUCTOR): ... this.
947         * class.c (accessible_nvdtor_p,
948         maybe_warn_about_overly_private_class,
949         add_implicitly_declared_members,
950         clone_constructors_and_destructors, type_has_virtual_destructor):
951         Adjust for CLASSTYPE_DESTRUCTOR.
952         (deduce_noexcept_on_destructors): Absorb into ...
953         (check_bases_and_members): ... here.
954         * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
955         * init.c (build_delete): Likewise.
956         * parser.c (cp_parser_lookup_name): Likewise.
957         * pt.c (check_explicit_specialization): Likewise.
958         * rtti.c (emit_support_tinfos): Likewise.
959         * search.c (lookup_fnfields_idx_nolazy): Likewise.
961         Kill IDENTIFIER_TEMPLATE.
962         * cp-tree.h (lang_identifier): Remove class_template_info field.
963         (IDENTIFIER_TEMPLATE): Delete.
964         * name-lookup.c (constructor_name_full): Subsume into ...
965         (constructor_name): ... here.  Don't check IDENTIFIER_TEMPLATE.
966         (constructor_name_p): Likewise.
967         * mangle.c (write_source_name): Likewise.
968         * ptree.c (cxx_print_identifier): Likewise.
970 2017-06-27  Marek Polacek  <polacek@redhat.com>
972         PR bootstrap/81216
973         * parser.c (cp_parser_already_scoped_statement): Initialize
974         LOC_AFTER_LABELS.
976 2017-06-26  Jason Merrill  <jason@redhat.com>
978         PR c++/81215 - deduction failure with variadic TTP.
979         * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
981 2017-06-26  Martin Sebor  <msebor@redhat.com>
983         PR c++/81169
984         * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
985         to detect casting away cv-qualifiers.
987 2017-06-26  Nathan Sidwell  <nathan@acm.org>
989         * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
990         (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
991         identifier.
992         (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
993         DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
994         (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
995         * decl.c (grok_op_properties): Adjust identifier checking.
996         * init.c (expand_default_init): Adjust identifier descision.
997         * method.c (implicitly_declare_fn): Don't use
998         DECL_ASSIGNMENT_OPERATOR_P.
999         * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
1000         IDENTIFIER_DTOR_P.
1001         * call.c (in_charge_arg_for_name): Reimplement.
1002         (build_special_member_call): Use IDENTIFIER_CDTOR_P,
1003         IDENTIFIER_DTOR_P.
1005 2017-06-26  Marek Polacek  <polacek@redhat.com>
1007         PR c/80116
1008         * parser.c (cp_parser_statement): Add a default argument.  Save the
1009         location of the expression-statement after labels have been parsed.
1010         (cp_parser_implicitly_scoped_statement): Set the location of the
1011         body of the conditional after parsing all the labels.  Call
1012         warn_for_multistatement_macros.
1013         (cp_parser_already_scoped_statement): Likewise.
1015 2017-06-24  Paolo Carlini  <paolo.carlini@oracle.com>
1017         PR c++/62315
1018         * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
1019         'typename' in error messages about missing 'typename'.
1021 2017-06-23  Jason Merrill  <jason@redhat.com>
1023         PR c++/79056 - C++17 ICE with invalid template syntax.
1024         * parser.c (cp_parser_simple_type_specifier): Don't assume that type
1025         is a TYPE_DECL.
1026         (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
1027         * pt.c (template_placeholder_p): New.
1028         * cp-tree.h: Declare it.
1030 2017-06-23  Marc Glisse  <marc.glisse@inria.fr>
1032         * decl.c (duplicate_decls): Use builtin_structptr_types.
1034 2017-06-22  Nathan Sidwell  <nathan@acm.org>
1036         Reorder IDENTIFIER flags
1037         gcc/cp/
1038         * cp-tree.h (enum cp_identifier_kind): New.
1039         (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
1040         IDENTIFIER_KIND_BIT_2): New.
1041         (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
1042         (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
1043         (C_IS_RESERVED_WORD): Replace with ...
1044         (IDENTIFIER_KEYWORD_P): ... this.
1045         (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
1046         (IDENTIFIER_CDTOR_P): ... this.
1047         (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
1048         (IDENTIFIER_OPNAME_P): Replace with ...
1049         (IDENTIFIER_ANY_OP_P): ... this.
1050         (IDENTIFIER_ASSIGN_OP_P): New.
1051         (IDENTIFIER_TYPENAME_P): Replace with ...
1052         (IDENTIFIER_CONV_OP_P): ... this.
1053         (NEW_DELETE_OPNAME_P): Replace with ...
1054         (IDENTIFIER_NEWDEL_OP_P): ... this.
1055         (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
1056         (get_identifier_kind_name, set_identifier_kind): Declare.
1057         * lex.c (get_identifier_kind_name, set_identifier_kind): New.
1058         (init_operators): Adjust to avoid keywords, use
1059         set_identifier_kind. Copy TYPE_EXPR slot.
1060         (init_reswords): Call set_identifier_kind.
1061         (unqualified_name_lookup_error): Adjust.
1062         * operators.def (TYPE_EXPR): Remove.
1063         * decl.c (struct predefined_identifier): Move into ...
1064         (initialize_predefined_identifiers): ... here.  Call
1065         set_identifier_kind.
1066         (grokfndecl, check_var_type, grokdeclarator): Adjust.
1067         (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
1068         space.  Adjust.
1069         * call.c (name_as_c_string): Adjust.
1070         (build_new_method_call_1): Likewise.
1071         * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
1072         * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
1073         * dump.c (cp_dump_tree): Adjust.
1074         * error.c (dump_decl_name): Adjust.
1075         * mangle.c (write_unqualified_id, write_member_name,
1076         write_expression): Adjust.
1077         (mangle_conv_op_name_for_type): Use set_identifier_kind.
1078         * name-lookup.c (do_class_using_decl): Adjust.
1079         (lookup_name_fuzzy, lookup_name_real_1): Likewise.
1080         * parser.c (cp_lexer_get_preprocessor_token,
1081         cp_parser_direct_declarator): Likewise.
1082         * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
1083         tsubst_copy, tsubst_copy_and_build): Adjust.
1084         * ptree.c (cxx_print_identifier): Print identifier kind.
1085         * search.c (lookup_field_r, lookup_member,
1086         lookup_fnfields_idx_nolazy): Adjust.
1087         * semantics.c (finish_id_expression): Adjust..
1088         * typeck.c (cp_build_addr_expr_1): Adjust.
1090 2017-06-21  Jakub Jelinek  <jakub@redhat.com>
1092         PR c++/81154
1093         * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
1094         Complain about t not being a variable if t is OVERLOAD even
1095         when processing_template_decl.
1097 2017-06-21  David Malcolm  <dmalcolm@redhat.com>
1099         * parser.c (get_cast_suggestion): New function.
1100         (maybe_add_cast_fixit): New function.
1101         (cp_parser_cast_expression): Capture the location of the closing
1102         parenthesis.  Call maybe_add_cast_fixit when emitting warnings
1103         about old-style casts.
1105 2017-06-20  Jason Merrill  <jason@redhat.com>
1107         PR c++/80972 - C++17 ICE with attribute packed.
1108         * call.c (build_over_call): Allow a TARGET_EXPR from reference
1109         binding.
1111 2017-06-20  Nathan Sidwell  <nathan@acm.org>
1113         * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
1114         (nelts_identifier): Delete.
1115         * decl.c (initialize_predefined_identifiers): Remove nelts.
1117         PR c++/67074 - namespace aliases
1118         * decl.c (duplicate_decls): Don't error here on mismatched
1119         namespace alias.
1120         * name-lookup.c (name_lookup::add_value): Matching namespaces are
1121         not ambiguous.
1122         (diagnose_name_conflict): Namespaces are never redeclarations.
1123         (update_binding): An alias can match a real namespace.
1125 2017-06-19  Jason Merrill  <jason@redhat.com>
1127         PR c++/80562 - ICE with constexpr if.
1128         * semantics.c (finish_if_stmt_cond): Call
1129         instantiate_non_dependent_expr.
1131         PR c++/80829 - ICE with constexpr copy of base subobject.
1132         * constexpr.c (clear_no_implicit_zero): New.
1133         (cxx_eval_call_expression): Call it.
1135 2017-06-19  Nathan Sidwell  <nathan@acm.org>
1137         PR c++/81124
1138         PR c++/79766
1139         * name-lookup.c (set_decl_namespace): Don't follow using
1140         directives and ignore using decls.  Only check overly-explicit
1141         scope after discovering decl.
1143 2017-06-19  Jason Merrill  <jason@redhat.com>
1145         PR c++/81073 - constexpr and static var in statement-expression.
1146         * typeck2.c (store_init_value): Always call
1147         require_potential_constant_expression.
1148         * pt.c (convert_nontype_argument): Likewise.
1149         * constexpr.c (potential_constant_expression_1): Adjust message.
1150         Use decl_maybe_constant_var_p instead of decl_constant_var_p.
1151         * decl2.c (decl_maybe_constant_var_p): Consider initializer.
1153 2017-06-19  Nathan Sidwell  <nathan@acm.org>
1155         * pt.c (coerce_template_parms): Fix indentation.
1156         (tsubst_decl): Remove repeated SET_DECL_RTL.  Move VAR_P handling
1157         in to single block.
1159         PR c++/81119
1160         * name-lookup.c (update_binding): Only warn about constructors
1161         hidden by functions.
1163 2017-06-17  Jason Merrill  <jason@redhat.com>
1165         PR c++/60063 - -Wunused-local-typedefs and templates.
1166         * decl2.c (is_late_template_attribute): Return false for "used".
1168         PR c++/70844 - -Wuseless-cast and inheriting constructor.
1169         * method.c (forward_parm): Suppress warn_useless_cast.
1171 2017-06-16  Jason Merrill  <jason@redhat.com>
1173         PR c++/81045 - Wrong type-dependence with auto return type.
1174         * pt.c (type_dependent_expression_p): An undeduced auto outside the
1175         template isn't dependent.
1176         * call.c (build_over_call): Instantiate undeduced auto even in a
1177         template.
1179         PR c++/80465 - ICE with generic lambda with noexcept-specifier.
1180         * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
1181         set longer for a generic lambda.
1183         PR c++/80614 - Wrong mangling for C++17 noexcept type
1184         * mangle.c (write_type): Put the eh spec back on the function type.
1186         PR c++/81102 - Wrong error with partial specialization.
1187         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
1188         types.  Do type deduction later.
1190         PR c++/81074 - ICE with partial specialization of member template.
1191         PR c++/71747
1192         * pt.c (get_partial_spec_bindings): Only coerce innermost args.
1194         PR c++/80831 - ICE with -fsyntax-only.
1195         * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
1197         PR c++/80639 - ICE with invalid PMF initialization.
1198         PR c++/80043 - ICE with -fpermissive
1199         * typeck.c (convert_for_assignment): Recurse when instantiate_type
1200         returns without an error.
1202 2017-06-16  Nathan Sidwell  <nathan@acm.org>
1204         * pt.c (tsubst_baselink): Fix & clarify formatting.
1206         * cp-tree.h (build_this_parm, cp_build_parm_decl,
1207         build_artificial_parm): Add FN parm.
1208         * decl.c (start_cleanup_fn): Adjust.
1209         (build_this_parm): Add FN parm, pass it through.
1210         (grokfndecl): Adjust parm building.
1211         * decl2.c (cp_build_parm_decl): Add FN parm, set context.
1212         (build_artificial_parm): Add FN parm, pass through.
1213         (maybe_retrofit_in_chrg): Adjust parm building.
1214         (start_static_storage_duration_function): Likwise.
1215         * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
1216         * method.c (implicitly_declare_fn): Likewise.
1217         * parser.c (inject_this_parameter): Likewise.
1219         Symbol tables are insert only.
1220         * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
1221         derive from pointer_hash.  Make undeletable.
1223         * class.c (resort_type_method_vec): Avoid potential unsigned
1224         overflow.
1226         Don't defer noexcept_deferred_spec.
1227         * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
1228         * decl.c (cxx_init_decl_processing): Initialize
1229         noexcept_deferred_spec.
1230         * except.c (unevaluated_noexcept_spec): Delete.
1231         * class.c (deduce_noexcept_on_destructor): Use
1232         noexcept_deferred_spec directly.
1233         * method.c (implicitly_declare_fn): Likewise.
1235         Make keyed_classes a vector.
1236         * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
1237         (keyed_classes): Declare as vector.
1238         * decl.c (keyed_classes): Define.
1239         (cxx_init_decl_processing): Allocate it.
1240         (record_key_method_defined): Use vec_safe_push.
1241         * class.c (finish_struct_1): Likewise.
1242         * pt.c (instantiate_class_template_1): Likewise.
1243         * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
1245         Make rtti lazier
1246         * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
1247         TK_VMI_CLASS_TYPES, TK_MAX.  Delete TK_FIXED.
1248         (tinfo_names): New.
1249         (typeid_ok_p): Add quotes to error messages.  Use get_tinfo_desc.
1250         (get_tinfo_decl): Use get_tinfo_desc.
1251         (get_pseudo_ti_init): Likewise. Adjust VMI construction.
1252         (create_pseudo_type_info): Delete.
1253         (get_pseudo_ti_index): Just determine the index.
1254         (get_tinfo_desc): New.  Create all types lazily.
1255         (create_tinfo_types): Just allocate the descriptor array.
1256         (emit_support_tinfos): Use non-inserting type lookup.  Set builtin
1257         location.
1259 2017-06-15  Martin Sebor  <msebor@redhat.com>
1261         PR c++/80560
1262         * call.c (first_non_public_field, maybe_warn_class_memaccess): New
1263         functions.
1264         (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
1265         (build_cxx_call): Call maybe_warn_class_memaccess.
1267 2017-06-14  Jakub Jelinek  <jakub@redhat.com>
1269         * cp-gimplify.c (cp_genericize_r): Turn most of the function
1270         into a switch (TREE_CODE (stmt)) statement from long else if
1271         sequence.
1273 2017-06-13  Jakub Jelinek  <jakub@redhat.com>
1275         PR c++/80973
1276         * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
1277         argument even if it has REFERENCE_TYPE.
1279         PR c++/80984
1280         * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
1281         BLOCK_VARS (outer) chain.
1282         (cxx_omp_const_qual_no_mutable): Likewise.
1284 2017-06-13  Martin Liska  <mliska@suse.cz>
1286         PR sanitize/78204
1287         * class.c (build_base_path): Use sanitize_flags_p.
1288         * cp-gimplify.c (cp_genericize_r): Likewise.
1289         (cp_genericize_tree): Likewise.
1290         (cp_genericize): Likewise.
1291         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1292         * decl.c (compute_array_index_type): Likewise.
1293         (start_preparsed_function): Likewise.
1294         * decl2.c (one_static_initialization_or_destruction): Likewise.
1295         * init.c (finish_length_check): Likewise.
1296         * lambda.c (maybe_add_lambda_conv_op): Likewise.
1297         * typeck.c (cp_build_binary_op): Likewise.
1298         (build_static_cast_1): Likewise.
1300 2017-06-11  Jason Merrill  <jason@redhat.com>
1302         * error.c (dump_expr): Use is_this_parameter.
1304         * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
1305         id_equal.
1307 2017-06-09  Jason Merrill  <jason@redhat.com>
1309         Missing bits from N4268, constant evaluation for all non-type args.
1310         * call.c (build_converted_constant_expr): Rename from
1311         build_integral_nontype_arg_conv, handle all types.
1312         * pt.c (convert_nontype_argument): In C++17 call it for all types.
1313         Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
1314         * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
1316         Overhaul pointer-to-member conversion and template argument handling.
1317         * call.c (standard_conversion): Avoid creating ck_pmem when the
1318         class type is the same.
1319         * cvt.c (can_convert_qual): Split from
1320         perform_qualification_conversions.
1321         * constexpr.c (cxx_eval_constant_expression): Check it.
1322         * typeck.c (convert_ptrmem): Only cplus_expand_constant if
1323         adjustment is necessary.
1324         * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
1325         (convert_nontype_argument): Avoid redundant error.
1327         * call.c (convert_like_real): Remove "inner" parameter.
1328         Don't replace a constant with its value.
1329         * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
1331         * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
1332         nullptr_node.
1334         * parser.c (cp_parser_constant_expression): Check
1335         potential_rvalue_constant_expression after decay_conversion.
1336         * pt.c (convert_nontype_argument): Don't require linkage in C++17.
1338         PR c++/80384 - ICE with dependent noexcept-specifier
1339         * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
1340         noexcept-specifier.
1342         * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
1344 2017-06-09  Jan Hubicka  <hubicka@ucw.cz>
1346         * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
1347         * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
1348         (excpet.c): Mark terminate as cold.
1350 2017-06-08  Jakub Jelinek  <jakub@redhat.com>
1352         PR c/81006
1353         * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
1354         to sizetype before size_binop.
1356         PR c++/81011
1357         * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
1358         to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
1359         and OMP_CLAUSE_SHARED_READONLY flags.
1361 2017-06-08  Jan Hubicka  <hubicka@ucw.cz>
1363         * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
1365 2017-06-07  Nathan Sidwell  <nathan@acm.org>
1367         * class.c (layout_class_type): Restructure overlong-bitfield tpe
1368         search.
1370 2017-06-07  Jonathan Wakely  <jwakely@redhat.com>
1372         PR c++/80990
1373         * pt.c (do_class_deduction): Build qualified type.
1375 2017-06-06  Nathan Sidwell  <nathan@acm.org>
1377         * name-lookup.c (suggest_alternatives_for): Use qualified lookup
1378         sans using directives.  Don't walk into inline namespaces.
1380         PR c++/80979
1381         * name-lookup.c (adl_class_only): Don't add visible friends.
1383 2017-06-05  Volker Reichelt  <v.reichelt@netcologne.de>
1385         * parser.c (cp_parser_base_specifier): Fix typos in error messages.
1387 2017-06-02  Nathan Sidwell  <nathan@acm.org>
1389         Remove lang_type_ptrmem.
1390         * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
1391         into ...
1392         (lang_type_class): ... this.  Reorder bitfields.  Rename to ...
1393         (lang_type): ... this.  Delete old definition.
1394         (lang_type_ptrmem): Delete.
1395         (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC.  Adjust uses.
1396         (LANG_TYPE_PTRMEM_CHECK): Delete.
1397         (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
1398         (TYPE_PTRMEMFUNC_TYPE): New.  Use TYPE_LANG_SLOT_1.
1399         * decl.c (build_ptrmemfunc_type): Adjust.
1400         * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
1401         (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
1402         
1403         * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
1404         setting.
1405         
1406         Remove cp_binding_level::namespaces
1407         * name-lookup.h (cp_binding_level): Lose namespaces field.
1408         * name-lookup.c (add_decl_to_level): Chain namespaces on the names
1409         list.
1410         (suggest_alternatives_for): Adjust for namespace list.  Do
1411         breadth-first search.
1412         * decl2.c (collect_source_refs): Namespaces are on the regulr
1413         list.
1414         (collect_ada_namespace): Likewise.
1416 2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1418         * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
1419         warning.
1421 2017-06-01  Ville Voutilainen  <ville.voutilainen@gmail.com>
1423         PR c++/80812
1424         * method.c (constructible_expr): Strip array types before calling
1425         build_value_init.
1427 2017-06-01  Paolo Carlini  <paolo.carlini@oracle.com>
1429         PR c++/80896
1430         * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
1431         for case INDIRECT_REF too in the main switch.
1433 2017-05-31  Jason Merrill  <jason@redhat.com>
1435         PR c++/80840 - ICE with constexpr and reference
1436         * pt.c (convert_nontype_argument): Don't test whether a decl is
1437         value-dependent when binding to a reference.
1439 2017-05-31  Nathan Sidwell  <nathan@acm.org>
1441         * cp-tree.h (lang_decl_slector): New enum.
1442         (lang_decl_base): Make selector an enum.  Drop decomposition_p
1443         field.
1444         (lang_decl): Use enum for discrimination.
1445         (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
1446         LANG_DECL_DEOMP_CHECK): Use enum.
1447         (DECL_DECOMPOSITION_P): Use selector value.
1448         (SET_DECL_DECOMPOSITION_P): Delete.
1449         (retrofit_lang_decl): Lose SEL parm.
1450         (fit_decomposition_lang_decl): Declare.
1451         * decl.c (cp_finish_decomp, grokdeclarator): Use
1452         fit_decomposition_lang_decl.
1453         * lex.c (maybe_add_lang_decl_raw): New. Broken out of
1454         retrofit_lang_decl.
1455         (set_decl_linkage): New.  Broken out of retrofit_lang_decl.  Use enum.
1456         (fit_decomposition_lang_decl): Likewise.
1457         (retrofit_lang_decl): Use worker functions.
1458         (cxx_dup_lang_specific_decl): Use selector enum.
1459         (maybe_add_lang_type_raw): New.  Broken out of ...
1460         (cxx_make_type_name): ... here.  Call it.
1462 2017-05-30  Jason Merrill  <jason@redhat.com>
1464         PR c++/80856 - ICE with local extern in template
1465         * semantics.c (finish_call_expr): Replace a local extern overload
1466         set in a template with the IDENTIFIER_NODE.
1468 2017-05-30  David Malcolm  <dmalcolm@redhat.com>
1470         * call.c (perform_implicit_conversion_flags): Convert
1471         "from %qT to %qT" to "from %qH to %qI" in diagnostic.
1472         (print_conversion_rejection): Replace pairs of %qT with
1473         %qH and %qI in various places.
1474         (build_user_type_conversion_1): Likewise.
1475         (build_integral_nontype_arg_conv): Likewise.
1476         (build_conditional_expr_1): Likewise.
1477         (convert_like_real): Likewise.
1478         (convert_arg_to_ellipsis): Likewise.
1479         (joust): Likewise.
1480         (initialize_reference): Likewise.
1481         * cvt.c (cp_convert_to_pointer): Likewise.
1482         (cp_convert_to_pointer): Likewise.
1483         (convert_to_reference): Likewise.
1484         (ocp_convert): Likewise.
1485         * error.c (cp_printer): Gain bool and const char ** parameters.
1486         (struct deferred_printed_type): New struct.
1487         (class cxx_format_postprocessor): New class.
1488         (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
1489         to pp->m_format_postprocessor.
1490         (comparable_template_types_p): New function.
1491         (newline_and_indent): New function.
1492         (arg_to_string): New function.
1493         (print_nonequal_arg): New function.
1494         (print_template_differences): New function.
1495         (type_to_string_with_compare): New function.
1496         (print_template_tree_comparison): New function.
1497         (append_formatted_chunk): New function.
1498         (add_quotes): New function.
1499         (cxx_format_postprocessor::handle): New function.
1500         (defer_phase_2_of_type_diff): New function.
1501         (cp_printer): Add "quoted" and "buffer_ptr" params.  Implement
1502         %H and %I.
1503         * typeck.c (cp_build_binary_op): Replace pairs of %qT with
1504         %qH and %qI in various places.
1505         (convert_member_func_to_ptr): Likewise.
1506         (build_reinterpret_cast_1): Likewise.
1507         (convert_for_assignment): Likewise.
1508         * typeck2.c (check_narrowing): Likewise.
1510 2017-05-30  Nathan Sidwell  <nathan@acm.org>
1512         Kill IDENTIFIER_NAMESPACE_BINDINGS
1513         * cp-tree.h (lang_identifier): Delete namespace_bindings.
1514         (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
1515         (lang_decl_ns): Add bindings.
1516         (DECL_NAMESPACE_BINDINGS): New.
1517         * lex.c (retrofit_lang_decl): Create namespace hash table.
1518         * name-lookup.c (find_namespace_slot): Change to use hash-map.
1519         * ptree.c (cxx_print_binding): Delete.
1520         (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
1522         * cp-tree.def (OVERLOAD): Fix comment.
1523         * cp-tree.h: Fix comments and whitespace.
1524         * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
1525         * name-lookup.c (add_decl_to_level): Assert not class.
1526         (check_local_shadow): Use OVL_P.
1527         (pushdecl_with_scope_1): Rename to ...
1528         (do_pushdecl_with_Scope): ... here.
1529         (do_nonmember_using_decl): Use qualified_namespace_lookup return
1530         value.
1531         (push_class_level_binding_1): Use OVL_P.
1532         (pushdecl_namespace_level): Use do_pushdecl_with_scope.
1533         (pushtag_1): Rename to ...
1534         (do_pushtag): ... here.  Adjust do_pushdecl_with_scope call.
1535         (pushtag): Adjust.
1536         (store_class_bindings): Do not time here.
1537         * name-lookup.h (pushdecl_outermost_localscope): Reorder.
1538         * pt.c (listify): Declare argvec at point of initialization.
1540         PR c++/80913
1541         * name-lookup.c (add_decl_to_level): Assert not making a circular
1542         chain.
1543         (update_binding): Don't prematurely slide artificial decl.
1545 2017-05-29  Alexandre Oliva <aoliva@redhat.com>
1547         * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
1549 2017-05-29  Nathan Sidwell  <nathan@acm.org>
1551         PR c++/80891 (#1,#5)
1552         * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
1553         * name-lookup.c (name_lookup): Add deduping field.
1554         (name_lookup::preserve_state, name_lookup::restore_state): Deal
1555         with deduping.
1556         (name_lookup::add_overload): New.
1557         (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
1558         (name_lookup::search_adl): Set deduping.  Don't unmark here.
1559         * pt.c (most_specialized_instantiation): Revert previous change,
1560         Assert not given duplicates.
1561         * tree.c (lookup_mark): Just mark the underlying decls.
1562         (lookup_maybe_add): Dedup using marked decls.
1564         PR c++/80891 (#4)
1565         * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
1566         * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
1568         Stat hack representation
1569         * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
1570         MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
1571         (stat_hack): New.
1572         (find_namespace_binding): Replace with ...
1573         (find_namespace_slot): ... this.
1574         (find_namespace_value): New.
1575         (name_lookup::search_namespace_only,
1576         name_lookup::adl_namespace_only): Adjust.
1577         (update_binding): Add SLOT parameter, adjust.
1578         (check_local_shadow): Use find_namespace_value.
1579         (set_local_extern_decl_linkage): Likewise.
1580         (do_pushdecl): Adjust for namespace slot.
1581         (push_local_binding): Assert not a namespace binding.
1582         (check_for_out_of_scope_variable): Use find_namespace_value.
1583         (set_identifier_type_value_with_scope): Likewise.
1584         (get_namespace_binding): Likewise.
1585         (set_namespace_binding): Delete.
1586         (set_global_binding): Directly update the binding.
1587         (finish_namespace_using_decl): Likewise.
1588         (lookup_type_scope_1): Use find_namespace_slot and update.
1589         (do_push_nested_namespace): Use find_namespace_value.
1591         PR c++/80891 (#1)
1592         * pt.c (most_specialized_instantiation): Cope with duplicate
1593         instantiations.
1595         PR c++/80891 (#3)
1596         * cp-tree.h (build_min_nt_call_vec): Declare.
1597         * decl.c (build_offset_ref_call_from_tree): Call it.
1598         * parser.c (cp_parser_postfix_expression): Likewise.
1599         * pt.c (tsubst_copy_and_build): Likewise.
1600         * semantics.c (finish_call_expr): Likewise.
1601         * tree.c (build_min_nt_loc): Keep unresolved lookups.
1602         (build_min): Likewise.
1603         (build_min_non_dep): Likewise.
1604         (build_min_non_dep_call_vec): Likewise.
1605         (build_min_nt_call_vec): New.
1607         PR c++/80891 (#2)
1608         * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
1609         (ovl_used): New.
1610         (lookup_keep): Call it.
1612 2017-05-26  Nathan Sidwell  <nathan@acm.org>
1614         Implement DR2061
1615         * name-lookup.c (push_inline_namespaces): New.
1616         (push_namespace): Look inside inline namespaces.
1618         Inline and using namespace representation change.
1619         * cp-tree.h (struct lang_decl_ns): Delete ns_using.  Add usings,
1620         inlinees as vector.
1621         (DECL_NAMESPACE_USING): Adjust.
1622         (DECL_NAMESPACE_INLINEES): New.
1623         * name-lookup.h (struct cp_binding_level): Change usings
1624         representation.
1625         * name-lookup.c (name_lookup::do_queue_usings,
1626         name_lookup::queue_usings): Adjust.
1627         (name_lookup::search_namespace, name_lookup::search_usings,
1628         name_lookup::queue_namespace): Adjust.
1629         (name_lookup::adl_namespace_only): Adjust.
1630         (add_using_namespace, push_namespace): Push onto vector.
1631         (pop_namespace): Add timing logic.
1633         * call.c (build_operator_new_call): Do namelookup and ADL here.
1634         (build_new_op_1): Likewise.
1635         * name-lookup.h (lookup_function_nonclass): Delete declaration.
1636         (do_using_directive): Likewise.
1637         * name-lookup.c (set_namespace_binding, push_local_binding): Don't
1638         declare early.
1639         (struct scope_binding): Delete.
1640         (EMPTY_SCOPE_BINDING): Delete.
1641         (set_decl_namespace): Use OVL_P.
1642         (finish_local_using_decl): Lose unnecesary checks.
1643         (lookup_function_nonclass): Delete.
1644         (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
1646         * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
1647         (ovl_iterator): Add allow_inner field.  Adjust ctor.  Make
1648         unduplicatable.
1649         (ovl_iterator::maybe_push, ovl_iterator::pop): New.
1650         (lkp_iterator): Add outer field.  Adjust ctor.
1651         (lkp_iterator::operator++): New.
1652         (lookup_mark, lookup_maybe_add): Declare.
1653         * name-lookup.c (name_lookup): Delete fn_set member.
1654         (name_lookup::preserve_state, name_lookup::restore_state): Unmark
1655         and mark lookup.
1656         (name_lookup::add_value): Use lookup_add directly.
1657         (name_lookup::add_fns: Use lookup_maybe_add.
1658         (name_lookup::search_adl): Mark and unmark fns.
1659         (pushdecl): Adjust.
1660         * pt.c (check_explicit_specialization): Use lookup_add directly.
1661         * ptree.c (cxx_print_xnode): Show complete overload structure.
1662         * tree.c (lookup_mark, lookup_maybe_add): New.
1664         * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
1666 2017-05-26  Jakub Jelinek  <jakub@redhat.com>
1668         * cp-tree.h (struct lang_decl_decomp): New type.
1669         (struct lang_decl): Add u.decomp.
1670         (LANG_DECL_DECOMP_CHECK): Define.
1671         (DECL_DECOMPOSITION_P): Note it is set also on the vars
1672         for user identifiers.
1673         (DECL_DECOMP_BASE): Define.
1674         (retrofit_lang_decl): Add extra int = 0 argument.
1675         * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
1676         use it to influence the selector choices and for selector
1677         0 to non-zero transition copy old content.
1678         (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
1679         * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
1680         !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR.  Adjust warning
1681         wording if decl is a structured binding.
1682         (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
1683         Set DECL_DECOMP_BASE.  Ignore DECL_READ_P sets from initialization
1684         of individual variables for tuple structured bindings.
1685         (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
1686         Clear DECL_DECOMP_BASE.
1687         * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
1688         * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
1689         is expected.
1690         * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
1691         DECL_VALUE_EXPR.
1693 2017-05-25  Jason Merrill  <jason@redhat.com>
1695         PR c++/80605 - __is_standard_layout and zero-length array
1696         * class.c (check_bases): Use DECL_FIELD_IS_BASE.
1698 2017-05-25  Nathan Sidwell  <nathan@acm.org>
1700         Kill OVL_CURRENT, OVL_NEXT.
1701         * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
1702         * name-lookup.c (set_decl_namespace): Use ovl_iterator.
1703         (consider_binding_level): Use OVL_FIRST.
1704         (cp_emit_debug_info_for_using): Use lkp_iterator.
1705         * pt.c (check_explicit_specialization): Use ovl_iterator.       
1707         Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
1708         * cp-tree.h (lang_decl_ns): Remove ns_users field.
1709         (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
1710         (TREE_INDIRECT_USING): Delete.
1711         * name-lookup.h (is_associated_namespace): Delete.
1712         * name-lookup.c (name_lookup::search_usings,
1713         name_lookup::do_queue_usings): Usings are always direct.
1714         (is_associated_namespace): Delete.
1715         (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
1716         (namespace_ancestor_1, namespace_ancestor): Delete.
1717         (push_using_directive_1, push_using_directive): Delete.
1718         (add_using_namespace_1): Delete.
1719         (add_using_namespace): Reimplement.
1720         (emit_debug_info_using_namespace): New.
1721         (finish_namespace_using_directive, finish_local_using_directive,
1722         push_namespace): Adjust.
1723         * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
1725 2017-05-25  Volker Reichelt  <v.reichelt@netcologne.de>
1727         * semantics.c (finish_handler_parms): Warn about non-reference type
1728         catch handlers.
1730 2017-05-25  Nathan Sidwell  <nathan@acm.org>
1732         Reimplement unqualified namespace lookup.
1733         * name-lookup.c (name_lookup::using_pair,
1734         name_lookup::using_queue): New typedefs.
1735         (name_lookup::queue_namespace, name_lookup::do_queue_usings,
1736         name_lookup::queue_usings): New.
1737         (name_lookup::search_unqualified): New.
1738         (merge_functions, same_entity_p, ambiguous_decl,
1739         unqualified_namespace_lookup_1, unqualified_namespace_lookup,
1740         lookup_using_namespace): Delete.
1741         (lookup_name_real_1): Adjust.
1743         Reimplement qualified namespace lookup.
1744         * name-lookup.c (name_lookup::flags): New member.  Adjust ctor.
1745         (name_lookup::ambiguous, name_lookup::add_value,
1746         name_lookup::add_type, name_lookup::process_binding): New.
1747         (name_lookup::search_namespace_only,
1748         name_lookup::search_namespace, name_lookup::search_usings): New.
1749         (name_lookup::search_qualified): New.
1750         (do_nonmember_using_decl, suggest_alternatives_for,
1751         lookup_qualified_name): Adjust.
1752         (tree_vec_contains): Delete.
1753         (qualified_lookup_using_namespace): Rename to ...
1754         (qualified_namespace_lookup): ... here.  Reimplement.
1756         Reimplement ADL.
1757         * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
1758         * name-lookup.h (lookup_arg_dependent): Return plain tree.
1759         * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
1760         arg_assoc_args_vec, arg_assoc_type, add_function,
1761         arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
1762         arg_assoc_class, arg_assoc_template_arg, arg_assoc,
1763         lookup_arg_dependent_1): Delete.
1764         (name_lookup): New lookup object.
1765         (name_lookup::preserve_state, name_lookup::restore_state,
1766         name_lookup::mark_seen, name_lookup::find_and_mark,
1767         name_lookup::add_fns, name_lookup::adl_namespace_only,
1768         name_lookup::adl_namespace, name_lookup::adl_class_only,
1769         name_lookup::adl_bases, name_lookup::adl_class,
1770         name_lookup::adl_expr, name_lookup::adl_type,
1771         name_lookup::adl_template_arg, name_lookup::search_adl): New.
1772         (lookup_arg_dependent): Return a plain tree.  Adjust.
1773         (is_associated_namespace): Move later.
1774         
1775 2017-05-24  Nathan Sidwell  <nathan@acm.org>
1777         * friend.c (do_friend): Remove check for existing decl.
1778         * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
1779         * name-lookup.c (push_local_binding): Directly look for binding.
1780         (lookup_name_innermost_nonclass_level_1): Delete.
1781         (lookup_name_innermost_nonclass_level): Delete.
1783         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
1785         * cp-tree.h (cp_free_lang_data): Add extern.
1786         (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
1787         ATTRIBUTE_PURE.
1788         (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
1789         * typeck.c (type_unknown_p): Delete.
1790         * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
1791         overload management.
1792         (dependent_name): Likewise.
1793         (decl_anon_ns_mem_p): Simplify.
1795 2017-05-24  Jonathan Wakely  <jwakely@redhat.com>
1797         PR c++/80544
1798         * tree.c (reshape_init): Use unqualified type for direct enum init.
1799         * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
1800         (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
1801         non-class destination types.
1802         (build_const_cast_1): Strip cv-quals from destination types.
1803         (build_static_cast, build_reinterpret_cast, build_const_cast)
1804         (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
1806 2017-05-24  Martin Sebor  <msebor@redhat.com>
1808         PR c/80731
1809         * call.c (fully_fold_internal): Adjust.
1811 2017-05-24  Nathan Sidwell  <nathan@acm.org>
1813         * cp-tree.h (ovl_skip_hidden): Declare.
1814         * tree.c (ovl_skip_hidden): New.
1815         * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
1816         (lookup_arg_dependent_1): Likewise.
1817         (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
1818         (hidden_name_p, remove_hidden_names): Delete.
1819         (lookup_name_real_1): Do not strip hidden names.
1820         * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
1822         * cp-tree.h (OVL_HIDDEN_P): New.
1823         (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
1824         (ovl_iterator::reveal_node): Declare.
1825         * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
1826         (ovl_insert): Order on hiddenness.
1827         (ovl_iterator::reveal_node): New.
1828         * name-lookup.c (anticipated_builtin_p): New.
1829         (supplement_binding_1): Use it.
1830         (set_local_extern_decl_linkage): Use hidden_p.
1831         (do_pushdecl): Deal with unhiding a hidden decl, use
1832         anticipated_builtin_p.
1833         (do_nonmember_using_decl): Use anticipated_decl_p.
1834         (lookup_name_real_1): Use DECL_HIDDEN_P.
1836 2017-05-23  Jason Merrill  <jason@redhat.com>
1838         -Wunused and C++17 structured bindings
1839         * decl.c (poplevel): Don't warn about unused structured bindings,
1840         only real variables.
1841         * error.c (dump_simple_decl): Handle structured bindings.
1842         * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
1844 2017-05-23  Nathan Sidwell  <nathan@acm.org>
1846         * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
1847         * name-lookup.c (create_local_binding): New.
1848         (update_binding): New.
1849         (pushdecl_maybe_friend_1): Rename to ...
1850         (do_pushdecl): ... this.  Reimplement.
1851         (pushdecl): Adjust.
1852         (push_overloaded_decl_1, push_overloaded_decl): Delete.
1854 2017-05-23  Jason Merrill  <jason@redhat.com>
1856         PR c++/80396 - built-in for make_integer_sequence.
1857         * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
1858         (expand_integer_pack, expand_builtin_pack_call): New.
1859         (find_parameter_packs_r): Check builtin_pack_call_p.
1860         (check_for_bare_parameter_packs): Handle it.
1861         (tsubst_pack_expansion): Call expand_builtin_pack_call.
1862         (declare_integer_pack): New.
1863         (init_template_processing): Call it.
1864         * decl2.c (mark_used): Check builtin_pack_fn_p.
1866 2017-05-23  Nathan Sidwell  <nathan@acm.org>
1868         * name-lookup.c (find_namespace_binding): New.
1869         (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
1870         (set_identifier_type_value_with_scope): Use find_namespace_binding.
1871         (find_binding, cp_binding_level_find_binding_for_name,
1872         binding_for_name, namespace_binding_1): Delete.
1873         (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
1874         (get_namespace_binding, set_namespace_binding,
1875         finish_namespace_using_decl, unqualified_namespace_lookup_1,
1876         qualified_lookup_using_namespace, lookup_type_scope_1,
1877         lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
1879         PR c++/80866
1880         * parser.c (cp_parser_template_id): Keep the lookup when stashing
1881         the template_id.
1883         * cp-tree.h (DECL_HIDDEN_P): New.
1884         * name-lookup.c (set_decl_context,
1885         set_local_extern_decl_linkage): New, broken out of ...
1886         (pushdecl_maybe_friend_1): ... here.  Call them.
1888 2017-05-23  Thomas Schwinge  <thomas@codesourcery.com>
1890         * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
1891         "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
1892         "VECTOR_LENGTH".
1894 2017-05-23  Nathan Sidwell  <nathan@acm.org>
1896         * cp-tree.h (OVL_P): New.
1897         * name-lookup.h (push_local_binding): Delete.
1898         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
1899         (finish_namespace_using_decl, finish_local_using_decl): ... here
1900         * name-lookup.c (add_decl_to_level): Swap args.
1901         (pop_bindings_and_leave_scope): Look inside TREE_LIST.
1902         (diagnose_name_conflict): Check contexts are same for redecl.
1903         (update_local_overload): New.
1904         (compparms_for_decl_and_using): Rename to ...
1905         (matching_fn_p): ... here.
1906         (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
1907         push_local_bindings call.
1908         (push_local_binding): Make static, replace FLAGS arg with
1909         IS_USING.
1910         (validate_nonmember_using_decl): Use OVL_FIRST.
1911         (do_nonmember_using_decl): Use in/out parameters.  Use
1912         lkp_iterator and simplify.
1913         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
1914         (finish_namespace_using_decl, finish_local_using_decl): ... here.
1915         Adjust.
1916         (lookup_type_current_level): Delete.
1917         * parser.c (cp_parser_using_declaration): Adjust.
1918         * pt.c (tsubst_expr): Adjust.
1920 2017-05-22  Nathan Sidwell  <nathan@acm.org>
1922         * name-lookup.h (parse_using_directive): Replace with ...
1923         (finish_namespace_using_directive): ... this and ...
1924         (finish_local_using_directive): ... this.
1925         * name-lookup.c (add_using_namespace_1): Move later.
1926         (add_using_namespace): Move later, add namespace_p arg, remove
1927         indirect arg.
1928         (push_using_directive_1): Directly recurse.
1929         (do_using_directive, parse_using_directive): Delete, split into ...
1930         (finish_namespace_using_directive): ... this and ...
1931         (finish_local_using_directive): ... this.
1932         (push_namespace): Use add_using_namespace.
1933         * parser.c (cp_parser_using_directive): Call
1934         finish_namespace_using_directive or finish_local_using_directive.
1935         * pt.c (tsubst_expr): Call finish_local_using_directive.
1937         * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
1938         * cp-tree.h (raw_dump_id): Declare.
1939         * decl2.c (raw_dump_id): Define.
1940         (dump_tu): Use raw_dump_id.
1942         * config-lang.in (gtfiles): Sort list, break lines.
1944         * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
1945         (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
1946         ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
1947         CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
1948         CPTI_RETHROW_FN): New.
1949         (noexcept_deferred_spec): New.
1950         (terminate_node, call_unexpected_node): Rename to ...
1951         (terminate_fn, call_unexpected_fn): ... here.
1952         (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
1953         allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
1954         * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
1955         (init_exception_processing): Adjust.
1956         (declare_library_fn): Create and push the fns here.
1957         (do_get_exception_ptr, do_begin_catch, do_end_catch,
1958         do_allocate_exception_ptr, do_free_exception_ptr): Adjust
1959         declare_library_fn use.
1960         (unevaluated_noexcept_spec): Adjust.
1961         * cp-gimplify.c (genericize_eh_spec_block,
1962         gimplify_most_not_throw_expr): Adjust.
1964         * name-lookup.c (pushdecl_top_level,
1965         pushdecl_top_level_and_finish): Move after namespace pushing and
1966         popping functions.
1967         (push_to_top_level): Rename to ...
1968         (do_push_to_top_level): ... here.  Remove timing code.
1969         (pop_from_top_level_1): Rename to ...
1970         (do_pop_from_top_level): ... here.
1971         (do_push_nested_namespace, do_pop_nested_namespace)
1972         (push_to_top_level): New wrapper for do_push_to_top_level.
1973         (pop_from_top_level): Adjust.
1974         (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
1976 2017-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1978         * config-lang.in (gtfiles): Add c-family/c-format.c,
1979         except.c, init.c, lambda.c and friend.c.
1980         * class.c (dvirt_fn): Move out of function scope,
1981         add GTY attribute.
1982         * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
1983         * init.c (fn): Likewise.
1984         * lambda.c (ptr_id, max_id): Likewise.
1985         * friend.c (global_friend): Add GTY attribute.
1987 2017-05-19  Nathan Sidwell  <nathan@acm.org>
1989         * call.c (add_list_candidates): Use OVL_FIRST.
1990         (build_new_method_call_1): Likewise.
1991         * cp-tree.h (OVL_SINGLE_P): New.
1992         (TYPE_HIDDEN_P): New.
1993         * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
1994         * dump.c (cp_tump_tree): Adjust overload dumping.
1995         * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
1996         printing.
1997         * method.c (lazily_declare_fn): Assert we added it.
1998         * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
1999         OVL_FIRST.
2000         (cp_parser_template_name): Use lkp_iterator.
2001         * pt.c (begin_template_parm_list): Fixup comment.
2002         (instantiate_class_template_1): Use TYPE_HIDDEN_P.
2003         * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
2004         (ovl_scope): Use lkp_iterator.
2006 2017-05-19  Thomas Schwinge  <thomas@codesourcery.com>
2008         * parser.c (cp_parser_omp_clause_default): Handle
2009         "OMP_CLAUSE_DEFAULT_PRESENT".
2011         * parser.c (cp_parser_omp_clause_default): Avoid printing more
2012         than one syntax error message.
2014 2017-05-19  Nathan Sidwell  <nathan@acm.org>
2016         * class.c (class_dump_id): Define.
2017         (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
2018         * cp-objcp-common.c (cp_register_dumps): New.
2019         * cp-objcp-common.h (cp_register_dumps): Declare.
2020         (LANG_HOOKS_REGISTER_DUMPS): Override.
2021         * cp-tree.h (class_dump_id): Declare.
2023 2017-05-18  Nathan Sidwell  <nathan@acm.org>
2025         * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
2026         (OVL_USED_P): New.
2027         (lookup_keep): Declare.
2028         * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
2029         * pt.c (tsubst_copy): Assert lookup is persistent.
2030         * semantics.c (finish_call_expr): Use lkp_iterator, call
2031         lookup_keep.
2032         * tree.c (ovl_copy): New.
2033         (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
2034         (lookup_keep): New.
2036         * cp-tree.h (OVL_USED): Replace with ...
2037         (OVL_USING_P): ... this.
2038         (ovl_iterator::using_p): Adjust.
2039         * name-lookup.c (push_overloaded_decl_1,
2040         do_nonmember_using_decl): Adjust.
2041         * search.c (lookup_field_r): Adjust.
2042         * tree.c (ovl_insert, ovl_scope): Adjust.
2044         * cp-tree.h (lookup_add): Swap args.
2045         (ovl_cons, build_overload): Delete.
2046         * name-lookup.c (add_function, push_overloaded_decl_1,
2047         do_nonmember_using_decl, merge_functions, remove_hidden_names):
2048         Use lookup_add, ovl_insert.
2049         * pt.c (check_explicit_specialization): Use lookup_add.
2050         (do_class_deduction): Likewise. Refactor if.
2051         * tree.c (lookup_add): Swap args.
2052         (ovl_cons, build_overload): Delete.
2054         * name-lookup.c (find_local_binding): New, broken out of ...
2055         (lookup_name_innermost_nonclass_level_1): ... here.  Call it.
2056         (set_namespace_binding): Swap scope & name args.
2057         (namespace_binding_1): Likewise.
2058         (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
2059         (push_overloaded_decl_1): Likewise.
2060         (set_global_binding): Likewise.
2061         (get_namespace_binding): Adjust namespace_binding_1 call.
2063 2017-05-17  Nathan Sidwell  <nathan@acm.org>
2065         * cp-tree.h (default_hash_traits <lang_identifier *>): New
2066         specialization.
2067         * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
2068         (extern_c_fns): New hash table.
2069         (check_extern_c_conflict): New, broken out of ...
2070         (pushdecl_maybe_friend_1): ... here.  Call it.
2071         (c_linkage_bindings): Just look in hash table.
2073 2017-05-17  Ville Voutilainen  <ville.voutilainen@gmail.com>
2075         PR c++/80654
2076         PR c++/80682
2077         Implement new C++ intrinsics __is_assignable and __is_constructible.
2078         * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
2079         (is_xible): New.
2080         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
2081         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2082         * method.c (constructible_expr): Set cp_unevaluated.
2083         (is_xible_helper): New.
2084         (is_trivially_xible): Adjust.
2085         (is_xible): New.
2086         * parser.c (cp_parser_primary_expression): Handle
2087         RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
2088         (cp_parser_trait_expr): Likewise.
2089         * semantics.c (trait_expr_value): Handle
2090         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2092 2017-05-17  Nathan Sidwell  <nathan@acm.org>
2094         * cp-tree.h (ovl_iterator::using_p): New predicate.
2095         (ovl_iterator::remove_node): New worker.
2096         (ovl_insert): Declare.
2097         * tree.c (ovl_insert): New.
2098         (ovl_iterator::remove_node): New.
2099         * class.c (add_method): Use ovl_iterator, ovl_insert.
2100         (clone_function_decl): Fix description.
2101         (clone_constructors_and_destructors): Use ovl_iterator.
2103         * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
2104         (maybe_warn_about_overly_private_class): Use ovl_iterator.
2105         (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
2106         (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
2107         (get_base_fndecls): Use ovl_iterator.
2108         (warn_hidden): Use OVL_NAME, ovl_iterator.
2109         (add_implicitly_declared_members): Use ovl_iterator.
2110         * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
2111         flatten nested if.
2112         (finish_shorthand_constraint): Simplify, use ovl_make.
2113         * pt.c (make_constrained_auto): Simplify.  Use ovl_make.
2114         * search.c (shared_member_p): Use ovl_iterator.
2115         (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
2116         (lookup_conversion_operator): Use OVL_FIRST.
2117         (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
2118         (look_for_overrides_here): Use ovl_iterator.
2119         (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
2120         * typeck.c (build_x_unary_op): Use ovl_make.
2122 2017-05-17  Martin Liska  <mliska@suse.cz>
2124         * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
2125         use it instead of int type.
2126         (dump_vtable): Likewise.
2127         (dump_vtt): Likewise.
2128         * decl2.c (dump_tu): Likewise.
2130 2017-05-16  David Malcolm  <dmalcolm@redhat.com>
2132         * call.c (enforce_access): Add access_failure_info * param and use
2133         it to record access failures.
2134         * cp-tree.h (class access_failure_info): New class.
2135         (enforce_access): Add access_failure_info * param, defaulting to
2136         NULL.
2137         (lookup_member): Likewise.
2138         (locate_field_accessor): New function decl.
2139         (perform_or_defer_access_check): Add access_failure_info * param,
2140         defaulting to NULL.
2141         * search.c (lookup_member): Add access_failure_info * param and
2142         pass it on to call to perform_or_defer_access_check.
2143         (matches_code_and_type_p): New function.
2144         (field_access_p): New function.
2145         (direct_accessor_p): New function.
2146         (reference_accessor_p): New function.
2147         (field_accessor_p): New function.
2148         (struct locate_field_data): New struct.
2149         (dfs_locate_field_accessor_pre): New function.
2150         (locate_field_accessor): New function.
2151         * semantics.c (perform_or_defer_access_check): Add
2152         access_failure_info * param, and pass it on to call to
2153         enforce_access.
2154         * typeck.c (access_failure_info::record_access_failure): New method.
2155         (access_failure_info::maybe_suggest_accessor): New method.
2156         (finish_class_member_access_expr): Pass an access_failure_info
2157         instance to the lookup_member call, and call its
2158         maybe_suggest_accessor method afterwards.
2160 2017-05-16  Marek Polacek  <polacek@redhat.com>
2162         PR sanitizer/80536
2163         PR sanitizer/80386
2164         * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
2166 2017-05-16  Nathan Sidwell  <nathan@acm.org>
2168         * name-lookup.c (check_local_shadow): New, broke out of ...
2169         (pushdecl_maybe_friend_1): ... here.  Call it.
2171         * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
2172         (ovl_first): Move inline definition to end of file.
2173         (ovl_make, lookup_add): Declare.
2174         (get_fns, get_first_fn): Make pure.
2175         * tree.c (ovl_cache): New.
2176         (ovl_make, lookup_add): New.
2177         * pt.c (do_class_deduction): Don't add candidates that will be
2178         elided.
2180         * call.c (build_user_type_conversion_1): Use OVL_FIRST.
2181         (print_error_for_call_failure): Use OVL_NAME.
2182         (build_op_call_1): Use ovl_iterator.
2183         (add_candidates): Use OVL_FIRST & lkp_iterator.
2184         (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
2185         lkp_iterator.
2186         * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
2187         (type_has_user_nondefault_constructor,
2188         in_class_defaulted_default_constructor,
2189         type_has_user_provided_constructor,
2190         type_has_user_provided_or_explicit_constructor,
2191         type_has_non_user_provided_default_constructor,
2192         vbase_has_user_provided_move_assign,
2193         type_has_move_constructor, type_has_move_assign,
2194         type_has_user_declared_move_constructor,
2195         type_has_user_declared_move_assign,
2196         type_build_ctor_call, type_build_dtor_call,
2197         type_requires_array_cookie, explain_non_literal_class): Likewise.
2198         (finish_struct): Use lkp_iterator.
2199         (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
2200         (note_name_declared_in_class): Use OVL_NAME.
2201         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
2202         (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
2203         cxx_pretty_printer::expression): Likewise.
2204         * decl2.c (check_classfn): Use ovl_iterator.
2205         * pt.c (retrieve_specialization): Use ovl_iterator.
2206         * tree.c (cp_tree_equal): Use lkp_iterator.
2207         (type_has_nontrivial_copy_init): Use ovl_iterator.
2209         * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
2210         check is_overloaded_fn.
2212 2017-05-16  Martin Liska  <mliska@suse.cz>
2214         * parser.c (cp_lexer_print_token): Add default value for flags
2215         argument of print_gimple_stmt, print_gimple_expr,
2216         print_generic_stmt and print_generic_expr.
2218 2017-05-16  Nathan Sidwell  <nathan@acm.org>
2220         * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
2221         iterators.
2222         (MAYBE_BASELINK_FUNCTIONS): New.
2223         * constraint.cc (resolve_constraint_check): Use lkp_iterator.
2224         * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
2225         * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
2226         * method.c (inherited_ctor_binfo): Use ovl_iterator.
2227         (binfo_inherited_from): Likewise.
2228         * parser.c (lookup_literal_operator): Use lkp_iterator.
2229         * pt.c (iterative_hash_template_arg): Use lkp_iterator.
2230         (print_candidates_1): Likewise.
2231         (determine_specialization): Likewise.
2232         (resolve_overloaded_unification): Likewise.
2233         (resolve_nondeduced_context): Likewise.
2234         (type_dependent_expression_p): Likewise.
2235         (dependent_template_p): Likewise.
2236         * ptree.c (cxx_print_xnode): Likewise.
2237         * semantics.c (omp_reduction_lookup): Use lkp_iterator.
2238         (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
2239         * typeck.c (check_template_keyword): Use lkp_iterator.
2241         * cp-tree.h (OVL_FIRST, OVL_NAME): New.
2242         (ovl_first): New.
2243         * constexpr.c (function_concept_check): Use OVL_FIRST.
2244         * cvt.c (build_expr_type_conversion): Likewise.
2245         * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
2246         * decl2.c (mark_used): Use OVL_FIRST.
2247         * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
2248         (dump_expr, location_of): Use OVL_FIRST.
2249         * friend.c (do_friend): Use OVL_NAME.
2250         * init.c (build_offset_ref): Use OVL_FIRST.
2251         * mangle.c (write_member_name): Likewise.
2252         (write_expression): Use OVL_NAME.
2253         * method.c (strip_inheriting_ctors): Use OVL_FIRST.
2254         * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
2255         * pt.c (check_explicit_specialization): Use OVL_FIRST.
2256         (check_template_shadow): Likewise.
2257         (tsubst_template_args): Use OVL_NAME.
2258         (tsubst_baselink): Use OVL_FIRST.
2259         * semantics.c (perform_koenig_lookup): Use OVL_NAME.
2260         * tree.c (get_first_fn): Use OVL_FIRST.
2261         * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
2262         (cp_build_addr_expr_1): Use OVL_FIRST.
2264         * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
2265         peeking.
2266         * semantics.c (finish_id_expression): Directly init local var.
2267         (finish_omp_reduction_clause): Use really_overloaded_fn.
2268         * tree.c (get_fns): Document.  Assert we got an overload.
2269         (get_first_fn) Document.
2270         * typeck.c (cp_build_addr_expr_1): Pass arg directly to
2271         really_overloaded_fn.
2272         * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
2274         * cp-tree.h (SCOPE_DEPTH): New.
2275         * name-lookup.h (is_nested_namespace): Declare.
2276         * name-lookup.c (is_nested_namespace): New.
2277         (is_ancestor): Use it.
2278         (set_decl_namespace): Likewise.
2279         (push_namespace): Set SCOPE_DEPTH.
2280         * pt.c (check_specialization_namespace): Use is_nested_namespace.
2281         (check_unqualigied_spec_or_inst): Likewise.
2283 2017-05-15  Nathan Sidwell  <nathan@acm.org>
2285         PR c++/79369
2286         * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
2287         * name-lookup.h (push_namespace): Return int, add make_inline arg.
2288         * name-lookup.c (push_namespace): Deal with inline directly.
2289         Return pushed count.
2290         * parser.c (cp_parser_namespace_definition): Adjust for
2291         push_namespace change.
2293 2017-05-11  Nathan Sidwell  <nathan@acm.org>
2295         * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
2296         LANG_HOOKS_PUSHDECL): Move to ...
2297         * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
2298         LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
2299         * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
2301         * name-lookup.h (pushdecl): Add default friend parm.
2302         (pushdecl_maybe_friend): Delete.
2303         (pushdecl_top_level): Add default friend parm.
2304         (pushdecl_top_level_maybe_friend): Delete.
2305         * name-lookup.c (pushdecl_maybe_friend): Delete.
2306         (pushdecl): Add is_friend parm.
2307         (pushdecl_top_level): Add is friend_parm.
2308         (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
2309         (pushdecl_top_level_and_finish): Do pushing and finishing directly.
2310         * friend.c (do_friend): Adjust.
2311         * pt.c (tsubst_friend_class): Adjust.
2313         Revert pushdecl_top_level_and_finish name change.
2314         * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
2315         * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
2316         * decl.c (cp_make_fname_decl): Adjust.
2317         * decl2.c (get_guard, handle_tls_init):  Adjust.
2318         * rtti.c (get_tinfo_decl, tinfo_base_init):  Adjust.
2320         * name-lookup.c (pushdecl_outermost_localscope): Always
2321         conditionally stop timer.
2323         * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
2324         * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
2326         * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
2327         pushtag_top_level_maybe_friend,
2328         pushdecl_top_level_and_finish): Move declarations to ...
2329         * name-lookup.h: ... here.  Group pushdecl variants.
2330         (pushdecl_top_level_and_finish): Rename to ...
2331         (pushdecl_top_level_with_init): ... here.
2332         * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
2333         * decl2.c (get_guard, handle_tls_init): Likewise.
2334         * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
2335         * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
2336         * method.c (implicitly_declare_fn): Likewise.
2337         * searchc (node_debug_info_needed): Likewise.
2338         * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
2339         (pushdecl_top_level_with_init): ... here.
2340         (pop_everything): Use namespace_bindings_p.
2342         * name-lookup.h (pop_binding): Rename to pop_local_binding.
2343         (getdecls): Rename to get_local_decls.
2344         * name-lookup.c (pop_binding): Rename to ...
2345         (pop_local_binding): ... here.
2346         (pop_bindings_and_leave_scope): Adjust.
2347         (getdecls): Rename to ...
2348         (get_local_decls): ... here.  Assert local scope.
2349         * decl.c (poplevel): Assert not namespace.  Adjust and simplify
2350         logic.
2351         (store_parm_decls): Adjust get_local_decls call.
2352         (parser.c (synthesize_implicit_template_parm): Likewise.
2354 2017-05-11  Ville Voutilainen  <ville.voutilainen@gmail.com>
2356         PR c++/80682
2357         * method.c (is_trivially_xible): Reject void types.
2359 2017-05-10  Nathan Sidwell  <nathan@acm.org>
2361         * class.c (handle_using_decl): Always use OVL_CURRENT.
2362         (resolve_address_of_overloaded_function): Move iterator decl into
2363         for scope.  Don't strip anticipated decls here.
2365         * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
2366         printing.
2367         (print_candidates): Adjust.
2369         * cp-tree.h (build_new_function_call): Lose koenig_p arg.  Fix
2370         line breaking.
2371         * call.c (build_new_function_call): Lose koenig_p arg.  Remove
2372         koenig_p handling here.
2373         * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
2374         (tsubst_omp_clauses): Likewise.
2375         (do_class_deduction): Adjust buld_new_function_call calls.
2376         * semantics.c (finish_call_expr): Likewise.
2378 2017-05-10  Jason Merrill  <jason@redhat.com>
2380         * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
2381         (unify_type_mismatch, unify_parameter_pack_mismatch)
2382         (unify_ptrmem_cst_mismatch, unify_expression_unequal)
2383         (unify_parameter_pack_inconsistent, unify_inconsistency)
2384         (unify_vla_arg, unify_method_type_error, unify_arity)
2385         (unify_arg_conversion, unify_no_common_base)
2386         (unify_inconsistent_template_template_parameters)
2387         (unify_template_deduction_failure)
2388         (unify_template_argument_mismatch)
2389         (unify_overload_resolution_failure): Call unify_invalid.
2391         CWG 1847 - Clarifying compatibility during partial ordering
2392         * pt.c (more_specialized_fn): No order between two non-deducible
2393         parameters.
2395         * pt.c (dependent_type_p): Make sure we aren't called with
2396         global_type_node.
2398         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2399         * pt.c (convert_template_argument): Just return an argument pack.
2400         (coerce_template_parameter_pack, template_parm_to_arg)
2401         (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
2402         (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
2403         Don't set the type of a NONTYPE_ARGUMENT_PACK.
2404         * parser.c (make_char_string_pack, make_string_pack): Likewise.
2406 2017-05-10  Nathan Sidwell  <nathan@acm.org>
2408         * cp-tree.h (add_method, clone_function_decl): Change last arg to
2409         bool.
2410         * class.c (add_method): Change third arg to bool.  Adjust.
2411         (one_inheriting_sig, one_inherited_ctor): Adjust.
2412         (clone_function_decl): Change 2nd arg to bool.  Adjust.
2413         (clone_constructors_and_destructors): Adjust.
2414         * lambda.c (maybe_add_lambda_conv_op): Adjust.
2415         * method.c (lazily_declare_fn): Adjust.
2416         * pt.c (tsubst_decl, instantiate_template_1): Adjust.
2417         * semantics.c (finish_member_declaration): Adjust.
2419 2017-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
2421         PR c++/80145
2422         * decl.c (finish_function): To improve error recovery, change the
2423         logic for calling apply_deduced_return_type.
2425 2017-05-09  Jason Merrill  <jason@redhat.com>
2427         PR c++/80605 - __is_standard_layout and empty base
2428         * class.c (check_bases): Ignore empty bases.
2430         PR c++/70979 - literal class and closure types
2431         * class.c (finalize_literal_type_property): Handle closures
2432         specifically.
2433         (explain_non_literal_class): Likewise.
2435         PR c++/66297, DR 1684 - literal class and constexpr member fns
2436         * constexpr.c (is_valid_constexpr_fn): Only complain about
2437         non-literal enclosing class in C++11.
2438         * class.c (finalize_literal_type_property): Likewise.
2440 2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
2442         PR c++/80186
2443         * pt.c (tsubst_decl): Early return error_mark_node if
2444         grok_ctor_properties returns false.
2446 2017-05-09  Jason Merrill  <jason@redhat.com>
2448         PR c++/70167 - array prvalue treated as lvalue
2449         * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
2450         (enum fcl_t): New.
2451         * semantics.c (finish_compound_literal): Add fcl_context parameter.
2452         Only make a static variable for C99 syntax.
2453         * parser.c (cp_parser_postfix_expression): Pass it.
2454         * pt.c (tsubst_copy_and_build): Likewise.
2455         * call.c (extend_ref_init_temps): Set
2456         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2458 2017-05-09  Nathan Sidwell  <nathan@acm.org>
2460         * cp-lang.c (get_global_decls, cxx_pushdecl): New.
2461         (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
2462         * name-lookup.h (pushdecl_top_level): Declare.
2464 2017-05-08  Jason Merrill  <jason@redhat.com>
2466         PR c++/80178 - parameter passing for uncopyable classes
2467         * tree.c (type_has_nontrivial_copy_init): True for classes with only
2468         deleted copy/move ctors.
2469         (remember_deleted_copy, maybe_warn_parm_abi): New.
2470         * decl.c (require_complete_types_for_parms, check_function_type):
2471         Call maybe_warn_parm_abi.
2472         * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
2474 2017-05-08  Nathan Sidwell  <nathan@acm.org>
2476         * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
2477         (start_preparsed_function): Do decl pushing before setting
2478         current_funciton_decl and announcing it.
2480         * name-lookup.h (pushdecl_with_scope): Replace with ...
2481         (pushdecl_outermost_localscope): ... this.
2482         * name-lookup.c (pushdecl_with_scope): Replace with ...
2483         (pushdecl_outermost_localscope): ... this.
2484         (pushdecl_namespace_level): Adjust.
2485         * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
2486         * lambda.c (insert_capture_proxy): Likewise.
2488         * class.c (build_vtbl_initializer): Don't shadow outer variable
2489         with static var.
2491         Revert _binding -> _value change.
2492         * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
2493         (get_namespace_binding, set_global_binding): ... these.
2494         * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
2495         (get_namespace_binding, set_global_binding): ... these.
2496         (arg_assoc_namespace, pushdecl_maybe_friend_1,
2497         check_for_out_of_scope_variable, push_overloaded_decl_1,
2498         lookup_name_innermost_nonclass_level, push_namespace): Adjust.
2499         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
2500         SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
2501         * decl.c (poplevel): Adjust.
2502         * pt.c (make_constrained_auto): Likewise.
2504 2017-05-07  Volker Reichelt  <v.reichelt@netcologne.de>
2506         PR translation/80280
2507         * call.c (print_z_candidate): Fix quoting.
2509 2017-05-05  David Malcolm  <dmalcolm@redhat.com>
2511         * error.c (pedwarn_cxx98): Replace report_diagnostic
2512         with diagnostic_report_diagnostic.
2514 2017-05-05  Nathan Sidwell  <nathan@acm.org>
2516         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
2517         (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
2518         (IDENTIFIER_NAMESPACE_VALUE): Delete.
2519         * name-lookup.h (namespace_binding, set_namespace_binding): Replace
2520         with ...
2521         (get_namespace_value, set_global_value): ... these.
2522         (get_global_value_if_present, is_typename_at_global_scope): Delete.
2523         * decl.c (poplevel): Use get_namespace_value.
2524         (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
2525         * class.c (build_vtbl_initializer): Stash library decl in
2526         static var. Use IDENTIFIER_GLOBAL_VALUE.
2527         * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
2528         do_allocate_exception, do_free_exception, build_throw): Likewise.
2529         * init.c (throw_bad_array_new_length): Likewise.
2530         * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
2531         * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
2532         check_for_our_of_scope_variable, push_overloaded_decl_1): Use
2533         get_namespace_value.
2534         (set_namespace_binding_1): Rename to
2535         (set_namespace_binding): ... here.
2536         (set_global_value): New.
2537         (lookup_name_innermost_nonclass_level_1, push_namespace): Use
2538         get_namespace_value.
2539         * pt.c (listify): Use get_namespace_value.
2541         * call.c (make_temporary_var_for_ref_to_temp): Push decl into
2542         current scope.
2543         * lex.c (unqualified_name_lookup_error): Likewise.
2545         * class.c (alter_class): Use retrofit_lang_decl directly.
2546         * decl.c (push_local_name, dupliate_decls): Likewise.
2547         * semantics.c (omp_privatize_field): Likewise.
2549         Kill walk_namespaces.
2550         * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
2551         * decl.c (walk_namespaces_r, walk_namespaces): Delete.
2553         Kill per-namespace static_decls.
2554         * cp-tree.h (static_decls): Declare.
2555         (wrapup_globals_for_namespace,
2556         diagnose_inline_vars_for_namespace): Replace with ...
2557         (wrapup_namespace_globals): ... this.
2558         * decl.c (static_decls): Define.
2559         (wrapup_globals_for_namespace,
2560         diagnose_inline_vars_for_namespace): Replace with ...
2561         (wrapup_namespace_globals): ... this.
2562         (cxx_init_decl_processing): Initialize static_decls.
2563         * decl2.c (c_parse_final_cleanups): Adjust.
2564         * name-lookup.h (cp_binding_level): Remove static_decls member.
2565         * name-lookup.c (add_decl_to_level): Adjust.
2566         (begin_scope): Adjust.
2568 2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
2570         PR c++/71577
2571         * decl.c (reshape_init): Unconditionally return error_mark_node
2572         upon error about too many initializers.
2574 2017-05-04  Nathan Sidwell  <nathan@acm.org>
2576         * constraint.cc (diagnose_check_constraint): Fix %E thinko.
2578 2017-05-04  Martin Sebor  <msebor@redhat.com>
2580         PR translation/80280
2581         * call.c (print_z_candidate): Add missing quoting to %D and other
2582         like directives.
2583         (build_op_call_1): Same.
2584         * constraint.cc (diagnose_check_constraint): Same.
2585         * mangle.c (mangle_decl): Same.
2586         * name-lookup.c (cp_binding_level_debug): Same.
2587         (set_decl_namespace): Same.
2588         * parser.c (cp_parser_tx_qualifier_opt): Same.
2589         * pt.c (print_candidates_1): Same.
2590         (check_template_variable): Same.
2591         (tsubst_default_argument): Same.
2592         (most_specialized_partial_spec): Same.
2593         * semantics.c (omp_reduction_lookup): Same.
2594         * tree.c (check_abi_tag_redeclaration): Same.
2595         * typeck.c (comptypes): Same.
2596         * typeck2.c (abstract_virtuals_error_sfinae): Same.
2598 2017-05-04  Nathan Sidwell  <nathan@acm.org>
2600         More global trees.
2601         * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
2602         CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
2603         CPTI_INIT_LIST_IDENTIFIER.
2604         (global_namespace, global_type_node, global_identifier,
2605         anon_identifier, init_list_identifier): New.
2606         * decl.c (global_type_node, global_scope_name): Delete.
2607         (initialize_predefined_identifiers): Add new identifiers.
2608         (cxx_init_decl_processing): Adjust.
2609         * name-lookup.h (global_namespace, global_type_node): Delete.
2610         * name-lookup.c (global_namespace, anonymous_namespace_name,
2611         get_anonymous_namespace_name): Delete.
2612         (namespace_scope_ht_size, begin_scope, pushtag_1,
2613         push_namespace): Adjust,
2614         * call.c (type_has_extended_temps): Use init_list_identifier.
2615         * pt.c (listify): Likewise.
2617         * name-lookup.c: Reorder functions to make merging from modules
2618         branch simpler.
2620 2017-05-03  Jason Merrill  <jason@redhat.com>
2622         * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
2624 2017-05-03  Nathan Sidwell  <nathan@acm.org>
2626         * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
2627         along with #defines, to before name-lookup include.
2629 2017-05-02  Paolo Carlini  <paolo.carlini@oracle.com>
2631         * pt.c (is_auto_or_concept): Remove.
2632         (type_uses_auto_or_concept): Remove, unused.
2633         (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
2634         * parser.c (tree_type_is_auto_or_concept): Remove, unused.
2635         * cp-tree.h (is_auto_or_concept): Remove.
2637 2017-05-01  Xi Ruoyao  <ryxi@stu.xidian.edu.cn>
2639         PR c++/80038
2640         * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
2641         add pedigree operation and detach call here.
2642         * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
2643         cilk_cp_gimplify_call_params_in_spawned_fn.
2644         (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
2645         * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
2647 2017-04-29  Volker Reichelt  <v.reichelt@netcologne.de>
2649         * parser.c (cp_parser_member_declaration): Add fix-it hints for
2650         stray comma and missing semicolon at end of member declaration.
2652 2017-04-27  Volker Reichelt  <v.reichelt@netcologne.de>
2654         * parser.c (cp_parser_cast_expression): Add target type of cast to
2655         diagnostic.
2656         * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
2658 2017-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
2660         * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
2661         return type to bool.
2662         * cp-tree.h (grok_ctor_properties): Update.
2664 2017-04-26  Volker Reichelt  <v.reichelt@netcologne.de>
2666         * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
2667         information to diagnostic of invalid colon in nested-name-specifier.
2669 2017-04-25  Volker Reichelt  <v.reichelt@netcologne.de>
2671         * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
2672         diagnostic of invalid class/struct keyword after enum.
2674 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
2676         * parser.c (cp_parser_member_declaration): Add fix-it hint
2677         for removing stray semicolons.
2679 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
2681         * name-lookup.c (get_std_name_hint): New function.
2682         (maybe_suggest_missing_header): New function.
2683         (suggest_alternative_in_explicit_scope): Call
2684         maybe_suggest_missing_header.
2686 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
2688         PR c++/80177
2689         * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
2690         candidate type of bm from tree to const char *.
2691         (consider_binding_level): Likewise.
2692         (lookup_name_fuzzy): Likewise, using this to merge the best
2693         result from the preprocessor into bm, rather than immediately
2694         returning, so that better matches from reserved words can "win".
2695         Guard the rejection of keywords that don't start decl-specifiers
2696         so it only happens for FUZZY_LOOKUP_TYPENAME.
2698 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
2700         * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
2701         (start_enum): Likewise.
2702         (build_enumerator): Likewise. Use %qE instead of plain %E.
2703         * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
2704         %<%D%> in diagnostics.
2705         (cp_parser_elaborated_type_specifier): Likewise.
2706         * pt.c (make_pack_expansion): Use %qT and %qE instead of
2707         %<%T%> and %<%E%> in diagnostics.
2708         (tsubst_pack_expansion): Likewise.
2710 2017-04-24  David Malcolm  <dmalcolm@redhat.com>
2712         PR c++/80016
2713         * parser.c (cp_parser_unary_expression):  Generate a location
2714         range for alignof and sizeof expressions.
2716 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
2718         * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
2719         error message.
2720         (cp_parser_virt_specifier_seq_opt): Likewise.
2721         (set_and_check_decl_spec_loc): Likewise twice.
2723 2017-04-21  Jason Merrill  <jason@redhat.com>
2725         PR c++/80179 - ICE with initialized flexible array member.
2726         * constexpr.c (verify_ctor_sanity): Handle flexible array members.
2728 2017-04-21  Richard Biener  <rguenther@suse.de>
2730         * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
2731         (copy_type): Likewise.
2732         * lex.c (copy_decl): Pass down mem-stat info.
2733         (copy_type): Likewise.
2735 2017-04-20  Jonathan Wakely  <jwakely@redhat.com>
2737         PR c++/80473
2738         * init.c (build_new_1): Suppress notes about over-aligned new when
2739         the warning is suppressed.
2741 2017-04-20  Volker Reichelt  <v.reichelt@netcologne.de>
2743         * parser.c (cp_parser_member_declaration): Add warning with fixit
2744         information for extra semicolon after in-class function definition.
2746 2017-04-20  Jakub Jelinek  <jakub@redhat.com>
2748         PR middle-end/80423
2749         * tree.c (build_cplus_array_type): Call build_array_type
2750         with the intended TYPE_TYPELESS_STORAGE flag value, instead
2751         of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
2752         on the shared type.
2754 2017-04-18  Marek Polacek  <polacek@redhat.com>
2756         PR c++/80244 - ICE with attribute in template alias.
2757         * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
2759         PR c++/80241 - ICE with alignas pack expansion.
2760         * error.c (dump_expr): Handle TREE_LIST.
2761         * parser.c (cp_parser_std_attribute_list): Return error_mark if
2762         make_pack_expansion returns an error.
2764 2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>
2766         PR c++/80287
2767         * class.c (fixup_may_alias): Fix all type variants.
2769 2017-04-17  Jason Merrill  <jason@redhat.com>
2771         PR c++/80415 - wrong error with default arg and array reference.
2772         * tree.c (lvalue_kind): Return clk_class for an array prvalue.
2774         * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
2776 2017-04-15  Alexandre Oliva <aoliva@redhat.com>
2778         * decl.c (name_unnamed_type): Split out of...
2779         (grokdeclarator): ... this.
2780         * decl.h (name_unnamed_type): Declare.
2782 2017-04-12  Richard Biener  <rguenther@suse.de>
2783         Bernd Edlinger  <bernd.edlinger@hotmail.de>
2785         PR middle-end/79671
2786         * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
2787         for arrays of character or std::byte type.
2789 2017-04-11  Jason Merrill  <jason@redhat.com>
2791         PR c++/80294 - ICE with constexpr and inheritance.
2792         * constexpr.c (reduced_constant_expression_p):
2793         A null constructor element is non-constant.
2794         (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
2795         returning an empty base.
2797 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
2799         PR c++/80370
2800         * decl.c (cp_finish_decomp): If processing_template_decl on
2801         non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
2802         change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
2803         sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
2804         processing.
2805         * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
2806         with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
2807         dependent.
2809 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
2811         PR c++/80363
2812         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
2814 2017-04-10  Jakub Jelinek  <jakub@redhat.com>
2816         PR c++/80176
2817         * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
2818         operand, if it is a static member function, recurse on the
2819         BASELINK.
2821 2017-04-10  Marek Polacek  <polacek@redhat.com>
2823         PR sanitizer/80348
2824         * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
2825         ORIG_TYPE earlier and not only when shortening.
2827 2017-04-07  Jason Merrill  <jason@redhat.com>
2829         PR c++/80356 - ICE with reference to function template argument.
2830         PR c++/79294
2831         * pt.c (convert_nontype_argument_function): Adjust type even with a
2832         value-dependent argument.
2834         PR c++/80267 - ICE with nested capture of reference
2835         PR c++/60992
2836         * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
2838 2017-04-07  Marek Polacek  <polacek@redhat.com>
2840         PR sanitizer/80348
2841         * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
2843         PR c++/80095
2844         * call.c (build_over_call): Don't check cxx_dialect.
2845         * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
2846         whether SUB is a CONSTRUCTOR.
2847         * init.c (build_new_1): Don't check cxx_dialect.
2848         * tree.c (replace_placeholders): Add a function comment.  Return if
2849         not in C++14, or if the object isn't a (member of a) class.
2850         * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
2851         TYPE is CLASS_TYPE_P.
2853 2017-04-05  Jakub Jelinek  <jakub@redhat.com>
2855         PR c++/80309
2856         * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
2857         of a loop doing vec_safe_push of NULL.  Formatting fixes.
2858         (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
2859         to newidx before calling canonical_type_parameter on newtype.
2861 2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
2863         PR c++/80296
2864         * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
2865         UNARY_PLUS_EXPR case.
2867 2017-04-03  Jason Merrill  <jason@redhat.com>
2869         * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
2871 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
2873         * class.c (update_vtable_entry_for_fn): Fix typo in comment.
2874         * decl2.c (one_static_initialization_or_destruction): Likewise.
2875         * name-lookup.c (store_bindings): Likewise.
2876         * parser.c (make_call_declarator): Likewise.
2877         * pt.c (check_explicit_specialization): Likewise.
2879 2017-04-03  Jason Merrill  <jason@redhat.com>
2881         PR sanitizer/79993 - ICE with VLA initialization from string
2882         PR c++/69487 - wrong VLA initialization from string
2883         * init.c (finish_length_check): Split out from build_vec_init.
2884         (build_vec_init): Handle STRING_CST.
2885         * typeck2.c (split_nonconstant_init): Handle STRING_CST.
2886         (digest_init_r): Don't give a STRING_CST VLA type.
2888 2017-03-31  Jakub Jelinek  <jakub@redhat.com>
2890         PR c++/79572
2891         * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
2892         REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
2893         for NOP_EXPR to REFERENCE_TYPE.
2895         PR libstdc++/80251
2896         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
2897         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
2898         CPTK_IS_AGGREGATE.
2899         * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
2900         Remove extraneous parens.
2901         (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
2902         * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
2903         (cp_parser_trait_expr): Likewise.
2905 2017-03-27  Jakub Jelinek  <jakub@redhat.com>
2907         PR middle-end/80162
2908         * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
2909         * typeck.c (cxx_mark_addressable): Likewise.  Look through
2910         VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
2911         to ARRAY_TYPE.
2912         (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
2914 2017-03-24  Jason Merrill  <jason@redhat.com>
2916         PR c++/77339 - ICE with invalid use of alias template.
2917         * pt.c (lookup_template_class_1): Don't try to enter the scope of an
2918         alias template.
2920 2017-03-24  Marek Polacek  <polacek@redhat.com>
2922         PR c++/80119
2923         * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
2924         doesn't have side effects.
2926 2017-03-23  Jason Merrill  <jason@redhat.com>
2928         PR c++/80150 - ICE with overloaded variadic deduction.
2929         * pt.c (try_one_overload): Remove asserts.
2931         PR c++/77563 - missing ambiguous conversion error.
2932         * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
2934 2017-03-23  Marek Polacek  <polacek@redhat.com>
2936         * cp-tree.h: Remove a C_RID_YYCODE reference.
2938 2017-03-22  Jakub Jelinek  <jakub@redhat.com>
2940         PR c++/80141
2941         * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
2942         case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
2943         processing_template_decl.
2945 2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
2947         PR c++/77752
2948         * name-lookup.c (pushtag_1): Add check for bogus, non template,
2949         std::initializer_list.
2951 2017-03-21  Jakub Jelinek  <jakub@redhat.com>
2953         PR c++/35878
2954         * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
2956 2017-03-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
2958         PR c++/35878
2959         * init.c (std_placement_new_fn_p): New.
2960         (build_new_1): Call it.
2962 2017-03-20  Jason Merrill  <jason@redhat.com>
2964         PR c++/80096 - ICE with C++17 non-type auto.
2965         * pt.c (tsubst): Delay tsubst of type of template non-type
2966         parameter.
2968         PR c++/79519 - ICE with deleted template friend.
2969         * decl.c (grokdeclarator): Complain about misplaced function
2970         definition using =, as well.
2972         PR c++/79640 - infinite recursion with generic lambda.
2973         * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
2974         before substituting its initializer.
2976 2017-03-20  Marek Polacek  <polacek@redhat.com>
2977             Paolo Carlini  <paolo.carlini@oracle.com>
2979         PR c++/80059 - ICE with noexcept and __transaction_atomic
2980         * except.c (build_must_not_throw_expr): Call
2981         instantiate_non_dependent_expr.
2983 2017-03-19  Jason Merrill  <jason@redhat.com>
2985         PR c++/80084 - wrong C++17 decomposition by reference of parameter.
2986         * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
2987         reference decomposition.
2989         PR c++/80077 - error with constexpr and -fno-elide-constructors.
2990         * constexpr.c (cxx_eval_call_expression): Set ctx->call while
2991         expanding trivial constructor.
2993 2017-03-17  Jason Merrill  <jason@redhat.com>
2995         PR c++/78345 - ICE initializing array from lambda.
2996         * init.c (build_aggr_init): Check array initializer.
2997         (build_vec_init): Check the type of a CONSTRUCTOR.
2999         PR c++/80073 - C++17 ICE with virtual base.
3000         * decl.c (xref_basetypes): Also check for indirect vbases.
3002 2017-03-16  Jason Merrill  <jason@redhat.com>
3004         * decl.c (start_enum): std::byte aliases anything.
3006         PR c++/79797
3007         * constexpr.c (lookup_placeholder): Tweak.
3009 2017-03-15  Jason Merrill  <jason@redhat.com>
3011         PR c++/80043 - ICE with -fpermissive
3012         * typeck.c (convert_for_assignment): Handle instantiate_type
3013         not giving an error.
3015 2017-03-14  Nathan Sidwell  <nathan@acm.org>
3017         PR c++/79393 DR 1658 workaround
3018         * method.c (synthesized_method_base_walk): Inihibit abstract class
3019         virtual base access check here.
3020         (synthesized_method_walk): Not here.
3022 2017-03-13  Nathan Sidwell  <nathan@acm.org>
3024         PR c++/79393 DR 1658 workaround
3025         * method.c (synthesized_method_walk): Check vbases of abstract
3026         classes for dtor walk.
3028 2017-03-10  David Malcolm  <dmalcolm@redhat.com>
3030         PR translation/79848
3031         * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
3033 2017-03-10  Jason Merrill  <jason@redhat.com>
3035         PR c++/79960 - alias templates and partial ordering
3036         * pt.c (comp_template_args): Add partial_order parm.
3037         (template_args_equal): Likewise.
3038         (comp_template_args_porder): New.
3039         (get_partial_spec_bindings): Use it.
3041 2017-03-10  Marek Polacek  <polacek@redhat.com>
3043         PR c++/79967
3044         * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
3046 2017-03-10  Jakub Jelinek  <jakub@redhat.com>
3048         PR c++/79899
3049         * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
3050         Use XALLOCAVEC macro.
3052         PR c++/79896
3053         * decl.c (finish_enum_value_list): If value is error_mark_node,
3054         don't copy it and change its type.
3055         * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
3056         of CONST_DECL is error_mark_node.
3058 2017-03-09  Marek Polacek  <polacek@redhat.com>
3060         PR c++/79900 - ICE in strip_typedefs
3061         * tree.c (strip_typedefs): Skip the attribute handling if T is
3062         a variant type which hasn't been updated yet.
3064         PR c++/79687 - wrong code with pointer-to-member
3065         * init.c (constant_value_1): Break if the variable has a dynamic
3066         initializer.
3068 2017-03-08  Jason Merrill  <jason@redhat.com>
3070         PR c++/79797 - ICE with self-reference in array DMI.
3071         * constexpr.c (lookup_placeholder): Split out...
3072         (cxx_eval_constant_expression): ...from here.
3074 2017-03-07  Jakub Jelinek  <jakub@redhat.com>
3076         PR c/79834
3077         * parser.c (cp_parser_omp_cancellation_point,
3078         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
3079         cp_parser_omp_target_update): Change "may only be used in compound
3080         statements" diagnostics, such that the same translatable string is
3081         used for all pragmas.
3082         (cp_parser_pragma): Likewise.  Use error_at instead of
3083         cp_parser_error for that diagnostics.
3085 2017-03-06  Marek Polacek  <polacek@redhat.com>
3087         PR c++/79796 - ICE with NSDMI and this pointer
3088         * call.c (build_over_call): Handle NSDMI with a 'this' by calling
3089         replace_placeholders.
3091 2017-03-06  Jakub Jelinek  <jakub@redhat.com>
3093         PR c++/79822
3094         * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
3095         ({ (void) 0; }).
3097 2017-03-06  Jason Merrill  <jason@redhat.com>
3099         Revert "Allow deduction guides to look into primary template."
3100         * cp-tree.h, parser.c, pt.c, search.c: Revert.
3102 2017-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
3104         PR c++/70266
3105         * except.c (build_must_not_throw_expr): Perform the implicit
3106         conversions on the condition.
3108 2017-03-03  Jason Merrill  <jason@redhat.com>
3110         * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
3111         -Wc++1z-compat.
3113         Core issues 2273 and 2277
3114         * call.c (joust): Adjust using-declaration tiebreaker to handle
3115         the intermediate base case.
3116         * method.c (strip_inheriting_ctors): Just return the argument if
3117         !flag_new_inheriting_ctors.
3119 2017-03-03  Richard Biener  <rguenther@suse.de>
3121         PR c++/79825
3122         * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
3124 2017-03-03  Marek Polacek  <polacek@redhat.com>
3126         PR c++/79791
3127         * typeck.c (string_conv_p): In C++11, always call pedwarn with
3128         OPT_Wwrite_strings.
3130 2017-03-02  Jason Merrill  <jason@redhat.com>
3132         Update overload resolution with deduction guides.
3133         * pt.c (do_class_deduction): Always build the copy guide.
3134         (copy_guide_p, template_guide_p): New.
3135         (build_deduction_guide): Remember the original constructor.
3136         * call.c (joust): Prefer the copy guide and non-template guides.
3138         Allow deduction guides to look into primary template.
3139         * cp-tree.h (struct saved_scope): Add deduction_guide_type.
3140         (struct cp_decl_specifier_seq): Add constructor_p.
3141         * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
3142         (cp_parser_init_declarator): Check it.  Set ctor_dtor_or_conv_p.
3143         Clear deduction_guide_type.  Don't handle deduction guide names.
3144         (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
3145         (cp_parser_direct_declarator): Likewise.  Handle deduction guides.
3146         (cp_parser_member_declaration, cp_parser_cache_defarg)
3147         (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
3148         * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
3149         (build_deduction_guide): Set deduction_guide_type.
3150         (dependent_scope_p): Check deduction_guide_type.
3151         * search.c (lookup_member): Likewise.
3153 2017-03-02  Jakub Jelinek  <jakub@redhat.com>
3155         PR c++/79782
3156         * init.c (mark_exp_read_r): New function.
3157         (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
3158         whole arguments instead of plain mark_exp_read on TREE_LIST values.
3160 2017-03-01  Jason Merrill  <jason@redhat.com>
3162         Class template argument deduction in new-expression
3163         * init.c (build_new): Handle deduction from no initializer.
3164         * parser.c (cp_parser_new_expression): Don't require a single
3165         expression for class template deduction.
3166         * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
3167         class template placeholder.
3168         * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
3169         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
3170         (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
3172 2017-03-01  Jakub Jelinek  <jakub@redhat.com>
3174         PR c++/79746
3175         * init.c (emit_mem_initializers): When not constructing vbases of
3176         abstract classes, mark arguments as read for
3177         -Wunused-but-set-parameter.
3179 2017-02-28  Jason Merrill  <jason@redhat.com>
3181         Class template argument deduction refinements
3182         * call.c (joust): Move deduction guide tiebreaker down.
3183         * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
3184         deduction with no initializer.
3185         * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
3186         (do_class_deduction): Use that rather than special case.
3187         (do_auto_deduction): Handle null initializer.
3189 2017-02-28  Jakub Jelinek  <jakub@redhat.com>
3191         * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
3192         instead of just cond ? "..." : "...".
3193         (grokdeclarator): Likewise.
3194         (build_enumerator): Likewise.
3195         * init.c (build_new_1): Likewise.
3196         * call.c (build_new_method_call_1): Likewise.
3197         * parser.c: Include intl.h.
3198         (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
3199         "enter"/"exit" keyword.
3200         (cp_finalize_oacc_routine): Don't use %s to supply portions of the
3201         message.
3203 2017-02-27  Jason Merrill  <jason@redhat.com>
3205         PR c++/71568 - SFINAE forming pointer to member function
3206         * init.c (build_offset_ref): Check the return value of
3207         perform_or_defer_access_check.
3209 2017-02-27  Marek Polacek  <polacek@redhat.com>
3211         * decl.c (expand_static_init): Add missing } in a comment.
3213 2017-02-27  Volker Reichelt  <v.reichelt@netcologne.de>
3215         * init.c: Include intl.h.
3216         (build_new_1): Move message strings into pedwarn to make them
3217         -Wformat-security friendly. Mark string for translation.
3218         * pt.c (tsubst_copy_and_build): Mark string for translation.
3219         Make the pointer const.
3220         * semantics.c (finish_id_expression): Mark strings for translation.
3222 2017-02-25  Jakub Jelinek  <jakub@redhat.com>
3224         * call.c (build_op_delete_call): Make msg1 and msg2 const.
3226 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
3228         PR c++/79588
3229         * call.c (build_over_call): Call check_function_arguments even for
3230         -Wrestrict, adjust check_function_arguments caller.
3231         * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
3232         here.
3233         * typeck.c (cp_build_function_call_vec): Adjust
3234         check_function_arguments caller.
3236 2017-02-24  Marek Polacek  <polacek@redhat.com>
3238         PR translation/79705
3239         * decl.c (check_redeclaration_exception_specification): Mark a string
3240         for translation.  Make the pointer const.
3242 2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>
3244         PR c++/79361
3245         * pt.c (register_specialization): Check duplicate_decls return value
3246         for error_mark_node and pass it back.
3248 2017-02-22  Jason Merrill  <jason@redhat.com>
3250         PR c++/79679 - missing destructor for argument
3251         * call.c (build_over_call): Don't pass tf_no_cleanup to argument
3252         conversions.
3254         * pt.c (do_class_deduction): Handle 0 argument case.
3256 2017-02-22  Jakub Jelinek  <jakub@redhat.com>
3258         PR c++/79664
3259         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
3260         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
3261         * constexpr.c (potential_constant_expression_1): Handle
3262         OMP_*, OACC_* and CILK_* trees.  Use error_at with
3263         EXPR_LOC_OR_LOC (t, input_location) computed early
3264         instead of error, or error_at with location_of (t).
3266 2017-02-22  Marek Polacek  <polacek@redhat.com>
3268         PR c++/79653
3269         * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
3270         if the alignas expression is erroneous.
3271         * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
3272         error_mark_node.
3274         PR c++/79657
3275         * semantics.c (finish_underlying_type): Bail out for incomplete enums.
3277 2017-02-21  Jason Merrill  <jason@redhat.com>
3279         PR c++/50308 - wrong deprecated warning with ADL
3280         PR c++/17729 - duplicate deprecated warning
3281         * semantics.c (finish_id_expression): Only call mark_used on a
3282         function if we aren't building a call.
3284         PR c++/41727 - ICE with partial spec of partial instantiation
3285         * pt.c (process_partial_specialization): For now, don't check more
3286         specialized if there is more than one level of args.
3288 2017-02-21  Marek Polacek  <polacek@redhat.com>
3290         PR c++/79535
3291         * cp-tree.h (maybe_reject_flexarray_init): Declare.
3292         * init.c (maybe_reject_flexarray_init): No longer static.
3293         Add check for current_function_decl.
3294         * parser.c (cp_parser_late_parse_one_default_arg): Reject
3295         a default mem-initializer for a flexible array.
3297 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
3298             Paolo Carlini  <paolo.carlini@oracle.com>
3300         PR c++/79654
3301         * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
3302         on error.
3303         * pt.c (tsubst_decomp_names): Return error_mark_node if the first
3304         decl after the decomposition artificial decl has error_mark_node.
3305         * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
3306         instead of just == error_mark_node comparison.
3308 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
3310         PR sanitizer/79589
3311         * decl.c: Include gimplify.h.
3312         (cp_finish_decomp): Make sure there is no sharing of trees
3313         in between DECL_VALUE_EXPR of decomposition decls.
3315         PR c++/79655
3316         * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
3318         PR c++/79639
3319         * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
3320         call cplus_expand_constant on it first.
3322 2017-02-19  Jason Merrill  <jason@redhat.com>
3324         PR c++/78139 - destructor needed by new-expression
3325         * call.c (build_special_member_call): Use tf_no_cleanup.
3327         PR c++/78282 - auto template and pack expansion
3328         * pt.c (find_parameter_packs_r): Don't walk into the type of
3329         templates other than template template-parameters.
3331         PR c++/79606 - ICE with this->base_member in NSDMI
3332         * class.c (build_base_path): Check processing_template_decl.
3334         PR c++/79607 - ICE with T{} initializer
3335         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
3337         PR c++/79566 - elaborated-type-specifier in range for
3338         * parser.c (cp_parser_simple_declaration): Fix check for type
3339         definition.
3341         PR c++/79400 - confusing suggestion of 'noexcept'
3342         * parser.c (cp_parser_exception_specification_opt): Remove
3343         suggestion for deprecated dynamic exception-specification.
3345         PR c++/79470 - partial ordering with reference parameters
3346         * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
3348         PR c++/79500 - ICE with non-template deduction guide
3349         * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
3350         DECL_TEMPLATE_RESULT.
3352         PR c++/79580 - ICE with compound literal
3353         * parser.c (cp_parser_class_head): If we're in the middle of an
3354         expression, use ts_within_enclosing_non_class.
3356         PR c++/79503 - inherited ctor taking base class
3357         * call.c (add_function_candidate): Also check that
3358         DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
3360 2017-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
3362         PR c++/79380
3363         * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
3364         argument.
3366 2017-02-19  Eric Fiselier  <eric@efcs.ca>
3367             Jonathan Wakely  <jwakely@redhat.com>
3369         PR c++/69523
3370         * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
3371         control warning about literal suffix identifiers without a leading
3372         underscore.
3374 2017-02-17  Jason Merrill  <jason@redhat.com>
3376         PR c++/79508 - lookup error with member template
3377         * parser.c (cp_parser_template_name): Clear
3378         parser->context->object_type if we aren't doing lookup.
3380         PR c++/78690 - ICE with using and global type with same name
3381         * pt.c (type_dependent_object_expression_p): True for
3382         IDENTIFIER_NODE.
3384         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3385         * pt.c (convert_template_argument): Just return an auto arg pack.
3386         (tsubst_template_args): Don't tsubst an auto pack type.
3388         PR c++/79556 - C++17 ICE with non-type auto
3389         * pt.c (do_auto_deduction): Don't try to deduce from null type.
3391         PR c++/79533 - C++17 ICE with temporary cast to reference
3392         * call.c (build_over_call): Conversion to a reference prevents copy
3393         elision.
3395 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
3396             Jason Merrill  <jason@redhat.com>
3398         PR c++/79502 - lost nodiscard attribute
3399         * pt.c (apply_late_template_attributes): Do apply non-dependent
3400         attributes to types.
3402 2017-02-16  Jason Merrill  <jason@redhat.com>
3404         PR c++/78572 - ICE with self-modifying array initializer
3405         * constexpr.c (cxx_eval_store_expression): The object we're
3406         initializing is outside the constant-expression.
3407         (cxx_eval_call_expression): Set ctx->call.
3409         PR c++/79050 - ICE with undeduced auto and LTO
3410         * decl.c (poplevel): Remove undeduced auto decls.
3412 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
3414         PR c++/79512
3415         * parser.c (cp_parser_omp_target): For -fopenmp-simd
3416         ignore #pragma omp target even when not followed by identifier.
3418 2017-02-15  Jason Merrill  <jason@redhat.com>
3419             Jakub Jelinek  <jakub@redhat.com>
3421         PR c++/79464 - ICE in IPA with omitted constructor parms
3422         * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
3423         (adjust_clone_args): Adjust.
3424         (add_method): Remember omitted parms.
3425         * call.c (add_function_candidate): Likewise.
3426         * mangle.c (write_method_parms): Likewise.
3427         * method.c (ctor_omit_inherited_parms): Return false if there are no
3428         parms to omit.
3430 2017-02-15  Martin Sebor  <msebor@redhat.com>
3432         PR c++/79363
3433         * init.c (maybe_reject_flexarray_init): New function.
3434         (perform_member_init): Call it.
3436 2017-02-15  Jakub Jelinek  <jakub@redhat.com>
3438         PR c++/79301
3439         * parser.c (cp_parser_std_attribute): Don't pedwarn about
3440         [[deprecated]] with -std=c++11 and [[fallthrough]] with
3441         -std=c++11 and -std=c++14.
3443         PR c++/79288
3444         * decl.c (grokdeclarator): For static data members, handle thread_p
3445         only after handling inline.
3447 2017-02-14  Marek Polacek  <polacek@redhat.com>
3449         PR c++/79420
3450         PR c++/79463
3451         * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
3452         clobbering if the postfix expression isn't an EXPR_P.
3454 2017-02-13  Jason Merrill  <jason@redhat.com>
3456         PR c++/79461 - ICE with lambda in constexpr constructor
3457         * constexpr.c (build_data_member_initialization): Ignore
3458         initialization of a local variable.
3460 2017-02-13  Jakub Jelinek  <jakub@redhat.com>
3462         * init.c (warn_placement_new_too_small): Add missing space in
3463         diagnostics.
3464         * parser.c (cp_parser_oacc_declare): Likewise.
3465         * mangle.c (maybe_check_abi_tags): Likewise.
3467         PR c++/79232
3468         * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
3469         on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
3470         in the rightmost operand.
3472 2017-02-13  Nathan Sidwell  <nathan@acm.org>
3474         PR c++/79296 - ICE mangling localized template instantiation
3475         * decl2.c (determine_visibility): Use template fn context for
3476         local class instantiations.
3478 2017-02-11  Jason Merrill  <jason@redhat.com>
3480         PR c++/77659 - ICE with new and C++14 aggregate NSDMI
3481         * init.c (build_new): Make backups of any CONSTRUCTORs in init.
3482         (build_new_1): Use replace_placeholders.
3483         * tree.c (replace_placeholders_t): Also track whether we've seen a
3484         placeholder.
3485         (replace_placeholders, replace_placeholders_r): Adjust.
3486         * cp-tree.h: Adjust.
3488         PR c++/77790 - ICE with auto function in C++11 mode
3489         * decl.c (undeduced_auto_decl): Remove C++14 limitation.
3490         (require_deduced_type): Add complain parm, return bool.
3491         * cp-tree.h: Adjust.
3492         * decl2.c (mark_used): Use require_deduced_type.
3494 2017-02-10  Jason Merrill  <jason@redhat.com>
3496         PR c++/78908 - template ops and bitfields
3497         * tree.c (build_min_non_dep): Use unlowered_expr_type.
3499         PR c++/78897 - constexpr union
3500         * constexpr.c (cxx_eval_store_expression): A store to a union member
3501         erases a previous store to another member.
3503         PR c++/71285 - member of fold-expression
3504         * semantics.c (finish_unary_fold_expr)
3505         (finish_binary_fold_expr): Use null type for fold-expressions.
3507         PR c++/79401 - protected inherited constructor
3508         * call.c (enforce_access): For inheriting constructor, find a base
3509         binfo in the path we already have.
3511 2017-02-10  Marek Polacek  <polacek@redhat.com>
3513         PR c++/79435
3514         * pt.c (type_dependent_expression_p): Check if the expression type
3515         is null.
3517         PR c++/79184
3518         * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
3519         if warnings shouldn't be given.
3521 2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
3523         PR c++/71737
3524         * pt.c (tsubst_decl): Don't try to preserve a typedef that names
3525         an error_mark_node as type.
3527 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
3528             Jason Merrill  <jason@redhat.com>
3530         PR c++/79143
3531         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
3532         from pattern to type.
3534 2017-02-09  Jason Merrill  <jason@redhat.com>
3536         PR c++/79316 - default argument in deduction guide
3537         PR c++/79350 - explicit deduction guide
3538         * parser.c (cp_parser_constructor_declarator_p)
3539         (cp_parser_direct_declarator): Parse deduction guides more like
3540         constructors.
3541         * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
3542         * tree.c (special_function_p): Return it.
3543         * decl.c (check_special_function_return_type): Handle it.
3544         (grokdeclarator, grokfndecl): Adjust.
3545         (cp_finish_decl): Pass flags to do_auto_deduction.
3546         * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
3547         * pt.c (dguide_name_p): Take a const_tree.
3548         (do_class_deduction): Handle explicit.
3549         (do_auto_deduction): Pass flags through.
3550         (build_deduction_guide): Copy explicit flag.
3552 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
3554         PR c++/79429
3555         * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
3556         non-pragma_compound context here.
3557         (cp_parser_omp_target): Likewise.
3558         (cp_parser_pragma): Don't call push_omp_privatization_clauses and
3559         parsing for ordered and target omp pragmas in non-pragma_stmt
3560         non-pragma_compound contexts.
3562         PR c/79431
3563         * parser.c (cp_parser_oacc_declare): Formatting fix.
3564         (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
3565         automatic variables.
3567 2016-02-09  Nathan Sidwell  <nathan@codesourcery.com>
3568             Chung-Lin Tang  <cltang@codesourcery.com>
3570         * parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
3571         parsing.  Parse constant expression. Remove semantic checking.
3572         (cp_parser_omp_clause_collapse): Disallow tile.
3573         (cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
3574         error about missing for after already emitting one.  Use more
3575         conventional for idiom for unbounded loop.
3576         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
3577         * semantics.c (finish_omp_clauses): Correct TILE semantic check.
3578         (finish_omp_for): Deal with tile clause.
3580 2017-02-07  Nathan Sidwell  <nathan@acm.org>
3582         * method.c (synthesized_method_base_walk): New.  Broken out of ...
3583         (synthesized_method_walk): ... here.  Call it.  Cleanup
3584         initializations.
3586 2017-02-07  Patrick Palka  <ppalka@gcc.gnu.org>
3588         PR c++/79360
3589         * typeck2.c (process_init_constructor_union): Consider only
3590         FIELD_DECLs when looking for an NSDMI.
3592 2017-02-06  Jason Merrill  <jason@redhat.com>
3594         PR c++/71193 - incomplete types in templates
3595         * parser.c (cp_parser_postfix_dot_deref_expression): In a template
3596         handle incomplete type by pedwarning and then treating as dependent.
3598 2017-02-06  Jakub Jelinek  <jakub@redhat.com>
3600         PR c++/79379
3601         * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
3602         (potential_constant_expression_1): Likewise.
3604         PR c++/79377
3605         * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
3606         allow one fewer than expected arguments if flag_permissive.
3608         PR c++/79372
3609         * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
3610         * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
3611         with error_mark_node type.
3613 2017-02-03  Jason Merrill  <jason@redhat.com>
3615         PR c++/78689 - ICE on constructor with label
3616         * optimize.c (maybe_clone_body): Replace omitted parameters with
3617         null lvalues.
3618         * class.c (build_clone): Fix logic for omitting inherited parms.
3620         PR c++/12245 - excessive memory use
3621         * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
3622         back in.  Don't cache constants.
3623         (maybe_constant_init): Don't cache constants.
3625         PR c++/79294 - ICE with invalid template argument
3626         * pt.c (convert_nontype_argument_function): Check value-dependence.
3627         (convert_nontype_argument): Don't check it here for function ptrs.
3629 2017-02-02  Richard Biener  <rguenther@suse.de>
3631         PR cp/14179
3632         * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
3633         it lazily on the first changed element only and copy it
3634         fully upfront, only storing changed elements.
3636 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
3638         PR c++/69637
3639         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
3640         to the width.
3642 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
3644         PR c++/79304
3645         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
3646         after ARROW_EXPR.
3648 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
3650         PR c++/79298
3651         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
3652         any namespace aliases.
3654 2017-01-31  Nathan Sidwell  <nathan@acm.org>
3656         PR c++/79290
3657         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
3659         PR c++/67273
3660         PR c++/79253
3661         * pt.c: (instantiate_decl): Push to top level when current
3662         function scope doesn't match.  Only push lmabda scope stack when
3663         pushing to top.
3665         * cp-tree.h (instantiate_decl): Make defer_ok bool.
3666         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
3667         (instantiate_decl): Simplify and reorder state saving and restoration.
3669         PR c++/79264
3670         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
3671         * semantics.c (finish_member_declaration): Assert class is being
3672         defined.
3674 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
3676         Introduce C++ support in libcc1.
3677         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
3678         (ansi_opname): Rename to...
3679         (cp_operator_id): ... this.  Adjust all callers.
3680         (ansi_assopname): Rename to...
3681         (cp_assignment_operator_id): ... this.  Adjust all callers.
3682         (cp_literal_operator_id): Declare.
3683         (set_global_friend): Declare.
3684         (is_global_friend): Declare.
3685         (enum cp_oracle_request): New type.
3686         (cp_binding_oracle_function): New type.
3687         (cp_binding_oracle): Declare.
3688         (cp_finish_injected_record_type): Declare.
3689         * friend.c (global_friend): New var.
3690         (set_global_friend): New fn.
3691         (is_global_friend): New fn.
3692         (is_friend): Call is_global_friend.
3693         * name-lookup.c (cp_binding_oracle): New var.
3694         (query_oracle): New fn.
3695         (qualified_lookup_using_namespace): Call query_oracle.
3696         (lookup_name_real_1): Likewise.
3697         * parser.c (cp_literal_operator_id): Drop static.
3698         * search.c (friend_accessible_p): Call is_global_friend.
3699         * semantics.c (is_this_parameter): Accept a variable if the
3700         binding oracle is enabled.
3702 2017-01-27  Jason Merrill  <jason@redhat.com>
3704         PR c++/78771 - ICE with inherited constructor.
3705         * call.c (build_over_call): Call deduce_inheriting_ctor here.
3706         * pt.c (tsubst_decl): Not here.
3707         * class.c (add_method): Or here.
3708         * method.c (deduce_inheriting_ctor): Handle clones.
3709         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
3711 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
3713         PR c++/64382
3714         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
3715         New function.
3716         * cp/cp-tree.h: Declare it.
3717         * cp/semantics.c (finish_id_expression): Resolve names within a default
3718         capturing generic lambda defined within a template prior to
3719         instantiation to allow for captures to be added to the closure type.
3721 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
3723         PR c++/68727
3724         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
3725         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
3726         * parser.c (cp_parser_builtin_offsetof): Pass result of
3727         build_static_cast of null_pointer_node to finish_offsetof.
3728         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
3729         it for -Winvalid-offsetof pedwarn instead of trying to guess
3730         original offsetof type from EXPR.  Save OBJECT_PTR as a new
3731         second operand to OFFSETOF_EXPR.
3732         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
3733         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
3734         as OBJECT_PTR.
3736 2017-01-26  Jason Merrill  <jason@redhat.com>
3738         * name-lookup.c (parse_using_directive): Deprecate strong using.
3740         PR c++/79176 - lambda ICE with -flto -Os
3741         * decl2.c (vague_linkage_p): Handle decloned 'tors.
3742         * tree.c (decl_linkage): Likewise.
3744 2017-01-25  Martin Sebor  <msebor@redhat.com>
3746         * decl.c (grokdeclarator): Fix a typo in a comment.
3748 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
3750         PR c++/78896
3751         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
3752         lambda expressions.
3754         PR c++/77914
3755         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
3756         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
3758 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
3760         PR lto/79061
3761         * decl.c (cxx_init_decl_processing): Pass main_input_filename
3762         to build_translation_unit_decl.
3764 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
3766         PR c++/79205
3767         * cp-gimplify.c (cp_genericize_r): Add result of
3768         convert_from_reference on invisiref parm to p_set.
3770 2017-01-24  Nathan Sidwell  <nathan@acm.org>
3772         PR c++/78469 - defaulted ctor and inaccessible dtor
3773         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
3774         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
3775         * tree.c (build_target_expr): Check tf_no_cleanup.
3777         PR c++/79118 - anon-members and constexpr
3778         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
3779         ctor decl.  Recursively check anonymous members.
3780         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
3781         call.
3782         (explain_invalid_constexpr_fn): Likewise.
3784 2017-01-23  Nathan Sidwell  <nathan@acm.org>
3786         PR c++/71710 - template using directive of field
3787         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
3788         check earlier.
3790         PR c++/71406 - ICE with scope-ref'd template id exprs
3791         PR c++/77508
3792         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
3793         before breaking up TEMPLATE_ID_EXPR.
3795 2017-01-20  Nathan Sidwell  <nathan@acm.org>
3797         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
3798         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
3800 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
3802         PR c++/77829
3803         PR c++/78656
3804         * cp-tree.h (suggest_alternatives_for): Add bool param.
3805         (suggest_alternative_in_explicit_scope): New decl.
3806         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
3807         that isn't the global one, call new function
3808         suggest_alternative_in_explicit_scope, only calling
3809         suggest_alternatives_for if it fails, and disabling near match
3810         searches fort that case.  When SCOPE is the global namespace,
3811         pass true for new param to suggest_alternatives_for to allow for
3812         fuzzy name lookups.
3813         * lex.c (unqualified_name_lookup_error): Pass true for new param
3814         to suggest_alternatives_for.
3815         * name-lookup.c (consider_binding_level): Add forward decl.
3816         (suggest_alternatives_for): Add "suggest_misspellings" param,
3817         using it to conditionalize the fuzzy name-lookup code.
3818         (suggest_alternative_in_explicit_scope): New function.
3819         * parser.c (cp_parser_primary_expression): When calling
3820         finish_id_expression, pass location of id_expression rather
3821         than that of id_expr_token.
3822         (cp_parser_id_expression): Convert local "unqualified_id" from
3823         tree to cp_expr to avoid implicitly dropping location information.
3825 2017-01-20  Marek Polacek  <polacek@redhat.com>
3827         PR c/64279
3828         * call.c (build_conditional_expr_1): Warn about duplicated branches.
3829         * semantics.c (finish_expr_stmt): Build statement using the proper
3830         location.
3832 2017-01-19  Jason Merrill  <jason@redhat.com>
3834         US 20 - forwarding references and class template argument deduction
3835         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
3836         * pt.c (push_template_decl_real): Set it.
3837         (maybe_adjust_types_for_deduction): Check it.
3838         (rewrite_template_parm): Copy it.
3840         US 19 - deduction guides and constructors
3841         * call.c (joust): Prefer deduction guides to constructors.
3842         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
3843         (deduction_guide_p): Check DECL_P.
3845         * decl.c (check_initializer): Always use build_aggr_init for array
3846         decomposition.
3848         PR c++/79130 - decomposition and direct-initialization
3849         * init.c (build_aggr_init): Communicate direct-initialization to
3850         build_vec_init.
3851         (build_vec_init): Check for array copy sooner.
3852         * parser.c (cp_parser_decomposition_declaration): Remove call to
3853         build_x_compound_expr_from_list.
3855 2017-01-18  Jason Merrill  <jason@redhat.com>
3857         PR c++/68666 - member variable template-id
3858         * typeck.c (finish_class_member_access_expr): Handle variable
3859         template-id.
3860         * pt.c (lookup_and_finish_template_variable): No longer static.
3861         * cp-tree.h: Declare it.
3863 2017-01-18  Nathan Sidwell  <nathan@acm.org>
3865         PR c++/78488
3866         * call.c (build_over_call): When checking ellipsis conversions for
3867         an inherited ctor, make sure there is at least one conversion.
3869 2017-01-18  Jason Merrill  <jason@redhat.com>
3871         PR c++/78894 - ICE with class deduction and default arg
3872         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
3874 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
3876         PR c++/77489
3877         * mangle.c (write_discriminator): Reorganize abi warning check.
3879 2017-01-18  Nathan Sidwell  <nathan@acm.org>
3881         * cp-tree.h: Clarify exception spec node comment.
3882         * except.c (nothrow_spec_p): Simplify by checking node-equality.
3884         PR c++/79091
3885         * mangle.c (write_exception_spec): Check nothrow explicitly.
3886         (write_encoding): Don't increment processing_template_decl around
3887         encoding.
3889 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
3891         PR c++/70182
3892         * mangle.c (write_template_args): Add "on" for operator names.
3894 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
3896         PR c++/77489
3897         * mangle.c (write_discriminator): Handle discriminator >= 10.
3899 2017-01-17  Nathan Sidwell  <nathan@acm.org>
3901         PR c++/61636
3902         * cp-tree.h (maybe_generic_this_capture): Declare.
3903         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
3904         (maybe_resolve_dummy): ... here.  Call it.
3905         (maybe_generic_this_capture): New.
3906         * parser.c (cp_parser_postfix_expression): Speculatively capture
3907         this in generic lambda in unresolved member function call.
3908         * pt.c (tsubst_copy_and_build): Force hard error from failed
3909         member function lookup in generic lambda.
3911 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
3913         PR c++/70565
3914         * cp-array-notation.c (expand_array_notation_exprs): Handle
3915         OMP_PARALLEL.
3917 2017-01-11  Jason Merrill  <jason@redhat.com>
3919         PR c++/78337 - ICE on invalid with generic lambda
3920         * semantics.c (process_outer_var_ref): Check if containing_function
3921         is null.  Move inform call under complain test.
3923 2017-01-11  Nathan Sidwell  <nathan@acm.org>
3925         PR c++/77812
3926         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
3927         is a new overload.
3929 2017-01-11  Nathan Sidwell  <nathan@acm.org>
3931         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
3933 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
3935         PR c++/78341
3936         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
3937         assertion.  Formatting fix.
3939         PR c++/72813
3940         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
3941         writing PCH file.
3943 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
3945         PR c++/77949
3946         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
3947         a missing semicolon if we have a valid insertion location for
3948         the fix-it hint.
3950 2017-01-10  Jason Merrill  <jason@redhat.com>
3952         FI 20, decomposition declaration with parenthesized initializer.
3953         * parser.c (cp_parser_decomposition_declaration): Use
3954         cp_parser_initializer.
3956 2017-01-09  Jason Merrill  <jason@redhat.com>
3958         Implement P0195R2, C++17 variadic using.
3959         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
3960         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
3961         * error.c (dump_decl): Likewise.
3963 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
3965         PR translation/79019
3966         PR translation/79020
3967         * semantics.c (finish_omp_clauses): Add missing whitespace to
3968         translatable strings.
3969         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
3971 2017-01-07  Jason Merrill  <jason@redhat.com>
3973         PR c++/78948 - instantiation from discarded statement
3974         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
3975         * cp-tree.h (in_discarded_stmt): Declare it.
3976         (struct saved_scope): Add discarded_stmt bitfield.
3977         (in_discarded_stmt): New macro.
3978         * decl2.c (mark_used): Check it.
3979         * parser.c (cp_parser_selection_statement): Adjust.
3980         (cp_parser_jump_statement): Adjust.
3982 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
3984         PR c++/78931
3985         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
3986         REFERENCE_REF_P, set tt to its operand.
3988         PR c++/78890
3989         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
3990         unions even for C++11 and later.
3992 2017-01-05  Nathan Sidwell  <nathan@acm.org>
3994         PR c++/78765
3995         * pt.c (convert_nontype_argument): Don't try and see if integral
3996         or enum expressions are constants prematurely.
3998 2017-01-04  Marek Polacek  <polacek@redhat.com>
4000         PR c++/64767
4001         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
4002         a zero character literal.
4004 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
4006         PR c++/78949
4007         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
4008         vector type.
4010         PR c++/78693
4011         * parser.c (cp_parser_simple_declaration): Only complain about
4012         inconsistent auto deduction if auto_result doesn't use auto.
4014         * parser.c (cp_parser_simple_declaration): Diagnose function
4015         declaration among more than one init-declarators with auto
4016         specifier.
4018         PR c++/71182
4019         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
4020         assertion, as lexer->buffer may be NULL.
4022 2017-01-04  Marek Polacek  <polacek@redhat.com>
4024         PR c++/77545
4025         PR c++/77284
4026         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
4028 2017-01-04  Nathan Sidwell  <nathan@acm.org>
4030         PR c++/66735
4031         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
4032         (lambda_capture_field_type): Update prototype.
4033         * lambda.c (lambda_capture_field_type): Add is_reference parm.
4034         Add referenceness here.
4035         (add_capture): Adjust lambda_capture_field_type call, refactor
4036         error checking.
4037         * pt.c (tsubst): Adjust lambda_capture_field_type call.
4039 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
4041         Update copyright years.
4043 Copyright (C) 2017 Free Software Foundation, Inc.
4045 Copying and distribution of this file, with or without modification,
4046 are permitted in any medium without royalty provided the copyright
4047 notice and this notice are preserved.