1 2017-09-15 Jakub Jelinek <jakub@redhat.com>
3 * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
4 adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
5 to C++17 or -std=gnu++17 or -std=c++17. Adjust comments.
6 (cxx_init_decl_processing, next_initializable_field,
7 is_direct_enum_init, check_initializer, cp_finish_decl,
8 mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
9 finish_function): Likewise.
10 * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
11 * pt.c (mark_template_parm, convert_nontype_argument,
12 instantiate_class_template_1, type_unification_real, unify,
13 get_partial_spec_bindings, dependent_type_p_r): Likewise.
14 * typeck.c (cp_build_unary_op): Likewise.
15 * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
16 * call.c (build_user_type_conversion_1, build_over_call,
17 build_special_member_call): Likewise.
18 * lambda.c (begin_lambda_type): Likewise.
19 * typeck2.c (process_init_constructor_record): Likewise.
20 * class.c (build_base_field, finalize_literal_type_property,
21 explain_non_literal_class): Likewise.
22 * parser.c (cp_parser_diagnose_invalid_type_name,
23 cp_parser_primary_expression, cp_parser_lambda_introducer,
24 cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
25 cp_convert_range_for, cp_parser_perform_range_for_lookup,
26 cp_parser_decomposition_declaration, cp_parser_linkage_specification,
27 cp_parser_static_assert, cp_parser_simple_type_specifier,
28 cp_parser_namespace_definition, cp_parser_using_declaration,
29 cp_parser_init_declarator, cp_parser_type_parameter_key,
30 cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
31 cp_parser_constructor_declarator_p): Likewise.
32 * mangle.c (struct globals): Rename need_cxx1z_warning to
34 (write_exception_spec, start_mangling, mangle_decl): Likewise.
35 * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
37 (check-c++17): New goal. Use 17 instead of 1z.
38 (check-c++-all): Use 17 instead of 1z.
40 2017-09-14 Jakub Jelinek <jakub@redhat.com>
43 * cp-gimplify.c (omp_var_to_track): Look through references.
44 (omp_cxx_notice_variable): Likewise.
46 2017-09-13 Nathan Sidwell <nathan@acm.org>
48 Conv-op identifers not in identifier hash table
49 * lex.c (conv_type_hasher): Make member fns inline.
50 (make_conv_op_name): Directly clone conv_op_identifier.
52 Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
53 * cp-tree.h (struct lang_type): Rename methods to members.
54 (CLASSTYPE_METHOD_VEC): Rename to ...
55 (CLASSTYPE_MEMBER_VEC): ... this.
56 * name-lookup.h (get_method_slot): Rename to ...
57 (get_member_slot): ... this.
58 (resort_type_method_vec): Rename to ...
59 (resort_type_member_vec): ... this.
60 * class.c (add_method, warn_hidden): Adjust.
61 * search.c (dfs_locate_field_accessor_pre): Adjust.
62 * name-lookup.c (method_vec_binary_search): Rename to ...
63 (member_vec_binary_search): ... this and adjust.
64 (method_vec_linear_search): Rename to ...
65 (member_vec_linear_search): ... this and adjust.
66 (fields_linear_search, get_class_binding_direct): Adjust.
67 (get_method_slot): Rename to ...
68 (get_member_slot): ... this and adjust.
69 (method_name_slot): Rename to ...
70 (member_name_slot): ... this and adjust.
71 (resort_type_method_vec): Rename to ...
72 (resort_type_member_vec): ... this and adjust.
73 (method_vec_append_class_fields): Rename to ...
74 (member_vec_append_class_fields): ... this and adjust.
75 (method_vec_append_enum_values): Rename to ...
76 (member_vec_append_enum_values): ... this and adjust.
77 (method_vec_dedup): Rename to ...
78 (member_vec_dedup): ... this and adjust.
79 (set_class_bindings, insert_late_enum_def_bindings): Adjust.
81 2017-09-12 Paolo Carlini <paolo.carlini@oracle.com>
84 * decl.c (start_decl): Early return error_mark_node if duplicate_decls
85 returns it; avoid misleading error message.
87 2017-09-12 Nathan Sidwell <nathan@acm.org>
89 Kill CLASSTYPE_SORTED_FIELDS.
90 * cp-tree.h (struct lang_type): Lose sorted_fields member.
91 (CLASSTYPE_SORTED_FIELDS): Delete.
92 * name-lookup.h (set_class_bindings): Add EXTRA arg.
93 * name-lookup.c (fields_linear_search): New, broken out of ...
94 (lookup_field_1): ... here. Delete remainder of function.
95 (get_class_binding_direct): Reimplement without sorted_fields.
96 (get_class_binding): Rename TYPE arg to KLASS, for consistency.
97 (get_method_slot): Call set_class_binding when creating method_vec
99 (method_name_cmp): Order identically named slots.
100 (sorted_fields_type_new): Delete.
101 (field_vc_append_class_fields): Rename to ...
102 (method_vec_append_class_fields): ... here. Adjust.
103 (field_vec_append_enum_values): Renme to ...
104 (method_vec_append_enum_values): ... here. Adjust.
105 (method_vec_dedup): New.
106 (set_class_bindings): Reimplement.
107 (insert_late_enum_def_bindings): Reimplement.
109 * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
111 (restort_data): Move later.
112 (method_name_cmp, resort_method_name_cmp): Simplify.
113 (resort_type_method_vec): Reformat.
115 2017-09-09 Jason Merrill <jason@redhat.com>
117 * constexpr.c (reduced_constant_expression_p): If
118 CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
120 2017-09-09 Eric Botcazou <ebotcazou@adacore.com>
123 * cp-objcp-common.c (struct debug_type_hasher): New class.
124 (debug_type_hash): New variable.
125 (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
127 2017-09-08 Jason Merrill <jason@redhat.com>
129 PR c++/70029 - ICE with ref-qualifier and -flto
130 * tree.c (cxx_copy_lang_qualifiers): New.
131 * cp-tree.h: Declare it.
132 * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
134 2017-09-06 Jason Merrill <jason@redhat.com>
136 PR c++/82053 - ICE with default argument in lambda in template
137 * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
139 (retrieve_specialization): Use lambda_fn_in_template_p.
140 * cp-tree.h: Declare it.
142 PR c++/82070 - error with nested lambda capture
143 * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
144 register_local_specialization.
146 2017-09-06 Nathan Sidwell <nathan@acm.org>
148 * name-lookup.h (lookup_field_1): Delete.
149 (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
150 * name-lookup.c (lookup_field_1): make static
151 (method_vec_binary_search, method_vec_linear_search): New. Broken
153 (get_class_binding_direct): ... here. Add TYPE_OR_FNS argument.
154 Do complete search of this level.
155 (get_class_binding): Adjust.
156 * decl.c (reshape_init_class): Call get_class_binding.
157 * search.c (lookup_field_r): Move field searching into
158 get_class_binding_direct.
160 * class.c (warn_hidden): Don't barf on non-functions.
161 * decl2.c (check_classfn): Likewise. Check template match earlier.
163 * name-lookup.c (count_fields): Rename to ...
164 (count_class_fields): ... here. Take a class, don't count
166 (add_fields_to_record_type): Rename to ...
167 (field_vec_append_class_fields): ... here. Take a class, don't
168 add NULL-named fields.
169 (add_enum_fields_to_record_type): Rename to ...
170 (field_vec_append_enum_values): ... here.
171 (set_class_bindings): Adjust, assert we added expected number.
172 (insert_late_enum_def_bindings): Reimplement. Create vector if
173 there are now sufficient entries.
175 * name-lookup.h (lookup_fnfields_slot_nolazy,
176 lookup_fnfields_slot): Rename to ...
177 (get_class_binding_direct, get_class_binding): ... here.
178 * name-lookup.c (lookup_fnfields_slot_nolazy,
179 lookup_fnfields_slot): Rename to ...
180 (get_class_binding_direct, get_class_binding): ... here.
181 * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
182 * call.c (build_user_type_conversion_1): Adjust.
183 (has_trivial_copy_assign_p): Adjust.
184 (has_trivial_copy_p): Adjust.
185 * class.c (get_basefndecls) Adjust.
186 (vbase_has_user_provided_move_assign) Adjust.
187 (classtype_has_move_assign_or_move_ctor_p): Adjust.
188 (type_build_ctor_call, type_build_dtor_call): Adjust.
189 * decl.c (register_dtor_fn): Adjust.
190 * decl2.c (check_classfn): Adjust.
191 * pt.c (retrieve_specialization): Adjust.
192 (check_explicit_specialization): Adjust.
193 (do_class_deduction): Adjust.
194 * search.c (lookup_field_r): Adjust.
195 (look_for_overrides_here, lookup_conversions_r): Adjust.
196 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
197 * tree.c (type_has_nontrivial_copy_init): Adjust.
198 * method.c (lazily_declare_fn): Adjust comment.
200 2017-09-05 Nathan Sidwell <nathan@acm.org>
202 * name-lookup.c (do_class_using_decl): Elide read-once temps.
203 Move declarations to initializations.
205 * class.c (add_method): Move slot search and insertion to ...
206 * name-lookup.c (get_method_slot): ... this new function.
207 (lookup_fnfields_slot_nolazy): Cope with NULL slot.
208 * name-lookup.h (get_method_slot): Declare.
209 * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
211 (grok_special_member_properties): Set
212 TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
213 Improve TYPE_HAS_CONSTEXPR_CTOR setting.
215 * cp-tree.h (lang_decl_base): Rename template_conv_p to
217 (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
218 (DECL_CONV_FN_TYPE): FN must be conv op.
219 (DECL_TEMPLATE_CONV_FN_P): Delete.
220 (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
221 * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
224 * class.c (unreverse_member_declarations): Remove extraneous if.
225 * pt.c (push_template_decl_real): Use string concatenation, not
226 \<newline>. Add %<..%>.
228 2017-09-05 Paolo Carlini <paolo.carlini@oracle.com>
231 * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
232 * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
233 creating cdtor_label.
234 * constexpr.c (returns): Add the case of a constructor/destructor
235 returning via a LABEL_DECL_CDTOR label.
236 (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
238 2017-09-01 Nathan Sidwell <nathan@acm.org>
240 * cp-tree.h (resort_type_method_vec): Move declaration to ...
241 * name-lookup.h (resort_type_method_vec): ... here.
242 (set_class_bindings): Lose 2nd arg.
243 * class.c (finish_struct_1, finish_struct): Adjust
244 set_class_bindings call. Don't call finish_struct_methods.
245 (resort_data, method_name_cmp, resort_method_name_cmp,
246 resort_type_method_vec, finish_struct_methods): Move to ...
247 * name-lookup.c (resort_data, method_name_cmp,
248 resort_method_name_cmp, resort_type_method_vec): ... here.
249 (set_class_bindings): Lose fields arg. Swallow finish_struct_methods.
251 * class.c (finish_struct): Call set_class_bindings for the
254 * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
255 Don't call maybe_warn_about_overly_private_class here.
256 (warn_hidden): Cleanup declarations and comments.
257 (type_has_user_provided_constructor): No need to check
258 CLASSTYPE_METHOD_VEC.
259 (type_has_user_provided_or_explicit_constructor): Likewise.
260 (classtype_has_move_assign_or_move_ctor_p): Likewise.
261 (check_bases_and_members): Don't call finish_struct_methods here.
262 (finish_struct_1): Call finish_struct_methods and
263 set_class_bindings immediately after layout. Clear DECL_IN_AGGR_P
265 (finish_struct): For templates process USING_DECLS and clear
266 DECL_IN_AGGR_P before calling finish_struct_methods. Call
267 maybe_warn_about_overly_private_class here.
269 Revert 2017-08-28 Nathan Sidwell <nathan@acm.org>
270 Restore sorted_fields vector.
271 * cp-tree.h (lang_type): Restore sorted_fields vector.
272 (CLASSTYPE_SORTED_FIELDS): Restore.
273 (CLASSTYPE_BINDINGS): Delete.
274 * name-lookup.c (lookup_field_1): Restore binary search.
275 (sorted_fields_type_new, count_fields,
276 add_fields_to_record_type, add_enum_fields_to_record_type): Restore
277 (set_class_bindings): Revert.
278 (insert_late_enum_def_binding): Restore field_vec insertion.
280 2017-09-01 Jakub Jelinek <jakub@redhat.com>
283 * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
285 2017-09-01 Marek Polacek <polacek@redhat.com>
288 * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
290 2017-08-30 Jason Merrill <jason@redhat.com>
292 PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
293 * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
294 (regenerated_lambda_fn_p): New.
295 (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
296 (tsubst_copy) [VAR_DECL]: Likewise.
298 PR c++/82030 - ICE inheriting from multiple lambdas
300 * call.c (compare_ics): Handle null candidate.
302 2017-08-30 Ville Voutilainen <ville.voutilainen@gmail.com>
304 Make taking the address of an overloaded function a non-deduced context
306 * pt.c (unify_overload_resolution_failure): Remove.
307 (unify_one_argument): Adjust.
309 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
310 Alan Hayward <alan.hayward@arm.com>
311 David Sherwood <david.sherwood@arm.com>
313 * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
315 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
316 Alan Hayward <alan.hayward@arm.com>
317 David Sherwood <david.sherwood@arm.com>
319 * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
321 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
322 Alan Hayward <alan.hayward@arm.com>
323 David Sherwood <david.sherwood@arm.com>
325 * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
326 instead of TYPE_MODE.
328 2017-08-29 Jason Merrill <jason@redhat.com>
330 PR c++/81236 - ICE with template-id in generic lambda
331 * semantics.c (finish_id_expression): Remove special dependent case.
332 Avoid some later pieces when dependent.
333 (finish_qualified_id_expr): Do normal BASELINK handling in a
334 template. Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
335 (parsing_default_capturing_generic_lambda_in_template): Remove.
336 * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
337 error for types that will never be complete.
338 * mangle.c (write_expression): Add sanity check.
339 * tree.c (build_qualified_name): Add sanity check.
340 (cp_walk_subtrees): Walk into the class context of a BASELINK.
341 * lambda.c (add_capture): Improve diagnostic for generic lambda
343 * call.c (build_new_method_call_1): Print the right constructor
346 Reimplement handling of lambdas in templates.
347 * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
348 * decl.c (start_preparsed_function): Call start_lambda_scope.
349 (finish_function): Call finish_lambda_scope.
350 * init.c (get_nsdmi): Call start/finish_lambda_scope.
351 * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
352 * parser.c (cp_parser_function_definition_after_declarator): Don't
353 call start/finish_lambda_scope.
354 * pt.c (retrieve_specialization): Ignore lambda functions in
356 (find_parameter_packs_r): Ignore capture proxies. Look into
358 (check_for_bare_parameter_packs): Allow bare packs in lambdas.
359 (tsubst_default_argument): Call start/finish_lambda_scope.
360 (tsubst_function_decl): Handle lambda functions differently.
361 (tsubst_template_decl): Likewise.
362 (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
364 (tsubst_lambda_expr): Create a new closure rather than instantiate
365 the one from the template.
366 (tsubst_copy_and_build): Don't register a specialization of a pack.
367 (regenerate_decl_from_template): Call start/finish_lambda_scope.
368 (instantiate_decl): Remove special lambda function handling.
369 * semantics.c (process_outer_var_ref): Remove special generic lambda
370 handling. Don't implicitly capture in a lambda in a template. Look
371 for an existing proxy.
372 * class.c (current_nonlambda_class_type): Use decl_type_context.
374 * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
375 (LAMBDA_EXPR_RETURN_TYPE): Remove.
376 (struct tree_lambda_expr): Remove closure and return_type fields.
377 * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
378 * pt.c (tsubst_copy_and_build): Likewise.
379 * parser.c (cp_parser_lambda_declarator_opt): Track return type.
380 (cp_parser_lambda_body): Adjust unspecified return type check.
381 * ptree.c (cxx_print_lambda_node): Don't print closure or
384 PR c++/80935 - wrong C++17 error with lambda
385 * decl.c (check_for_uninitialized_const_var): Check
386 is_instantiation_of_constexpr.
387 * constexpr.c (ensure_literal_type_for_constexpr_object): Check
388 is_instantiation_of_constexpr.
389 (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
391 * lambda.c (build_lambda_object): Check for error_mark_node.
392 * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
394 (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
395 (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
397 PR c++/80767 - unnecessary instantiation of generic lambda
398 * call.c (convert_like_real): Call build_user_type_conversion_1 if
400 (add_conv_candidate): Build a ck_user conversion with no candidate.
402 Fix lambdas in template default argument of inherited ctor.
403 * method.c (synthesized_method_base_walk): Replace an inherited
404 template with its specialization.
405 (synthesized_method_walk): Make inheriting_ctor a pointer.
406 (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
407 (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
409 * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
410 template, not the function.
411 (template_guide_p): Adjust.
413 Support copying local_specializations.
414 * cp-tree.h (enum lss_policy): New.
415 (local_specialization_stack): Add policy parameter to default ctor.
416 * pt.c (local_specialization_stack): Copy local_specializations if
419 * constexpr.c (potential_constant_expression_1): Add "now" parm.
420 (is_constant_expression, require_constant_expression): New.
421 (is_static_init_expression, is_nondependent_constant_expression)
422 (is_nondependent_static_init_expression): Drop "potential".
423 * except.c (build_must_not_throw_expr): Do type conversion on
424 value-dependent argument.
425 * pt.c, semantics.c, typeck2.c: Use variants without "potential".
427 Instantiate default arguments/member initializers once.
428 * init.c (get_nsdmi): Remember NSDMI instantiations.
429 * parser.c (inject_this_parameter): Be more picky about
431 * pt.c (tsubst_copy): Simplify 'this' handling.
432 (tsubst_default_argument): Remember default argument
433 instantiations. Take parameter number.
434 (tsubst_default_arguments): Pass it.
435 * call.c (convert_default_arg): Likewise.
437 Fix default argument conversion failure and SFINAE.
438 * call.c (build_over_call): Check convert_default_arg result for
440 * parser.c (cp_parser_late_parsing_default_args): Remember
443 2017-08-28 Nathan Sidwell <nathan@acm.org>
445 * cp-tree.h (lang_type): Replace sorted_fields vector with
447 (CLASSTYPE_SORTED_FIELDS): Delete.
448 (CLASSTYPE_BINDINGS): New.
449 * decl.c (finish_enum_value_list): Swap args of
450 insert_late_enum_def_bindings.
451 * name-lookup.c (lookup_field_1): Replace binary search of sorted
452 fields with map->get.
453 (sorted_fields_type_new, count_fields,
454 add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
455 (add_class_member, add_class_members): New.
456 (set_class_bindings): Create map and insert.
457 (insert_late_enum_def_binding): Swap parms. Use add_clasS_member.
458 * ptree.c (cxx_print_type): Delete sorted fields printing.
460 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
462 * name-lookup.h (set_class_bindings,
463 insert_late_enum_def_bindings): Declare.
464 * decl.c (finish_enum_value_list): Adjust for
465 insert_late_enum_def_bindings name change.
466 * class.c (finish_struct_1): Call set_class_bindings.
467 (count_fields, add_fields_to_record_type,
468 add_enum_fields_to_record_type, sorted_fields_type_new,
469 insert_into_classtype_sorted_fields,
470 insert_late_enum_def_into_classtype_sorted_fields): Move to ...
471 * name-lookup.h (count_fields, add_fields_to_record_type,
472 add_enum_fields_to_record_type, sorted_fields_type_new,
473 set_class_bindings, insert_late_enum_def_bindings): ... here.
475 2017-08-25 Nathan Sidwell <nathan@acm.org>
477 * class.c (method_name_cmp, resort_method_name_cmp): Methods
480 Conversion operators have a special name
481 * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
482 (conv_op_marker, conv_op_identifier): New.
483 (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
484 * decl.c (initialize_predefined_identifiers): Add
486 (cxx_init_decl_processing): Create conv_op_marker.
487 * decl2.c (check_classfn): Lookup conv-ops by name.
488 * class.c (add_method): Use conv_op_identifier & conv_op_marker.
489 (resort_type_method_vec): Don't skip conv-ops.
490 (finish_struct_methods, warn_hidden): Likewise.
491 * name-lookup.h (lookup_all_conversions): Delete.
492 * name-lookup.c (lookup_conversion_operator): Replace with ...
493 (extract_conversion_operator): ... this.
494 (lookup_fnfields_slot_nolazy): Find conv-ops by name.
495 (lookup_all_conversions): Delete.
496 * pt.c (check_explicit_specialization): Find conv-ops by name.
497 * search.c (lookup_conversions_r): Likewise.
499 2017-08-24 Nathan Sidwell <nathan@acm.org>
501 Conversion operators kept on single overload set
502 * class.c (add_method): Keep all conv-ops on one slot.
503 * name-lookup.c (lookup_conversion_operator): Pull the desired
504 conv op out of overload set.
505 * search.c (lookup_conversions_r): Lose template/non-template
507 (lookup_conversions): Likewise.
509 2017-08-23 Nathan Sidwell <nathan@acm.org>
511 * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
512 lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
514 * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
515 lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
516 * search.c (lookup_conversion_operator,
517 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
518 lookup_all_conversions): Move to ...
519 * name-lookup.c (lookup_conversion_operator,
520 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
521 lookup_all_conversions): ... here.
523 * semantics.c (finish_member_declaration): Move USING_DECL check
524 earlier. Always set C++ linkage. Commonize TYPE_FIELD and
525 template decl list insertion.
527 * cp-tree.h (maybe_version_functions): Declare.
528 * decl.c (decls_match): Break function versioning check to
529 separate function. Call it.
530 (maybe_version_functions): Broken out of decls_match.
531 * class.c (add_method): Use maybe_version_functions.
533 * cp-tree.h (print_search_statistics,
534 reinit_search_statistics): Don't declare.
535 * search.c (n_fields_searched, n_calls_lookup_field,
536 n_calls_lookup_field_1, n_calls_lookup_fnfields,
537 n_calls_lookup_fnfields_1, n_calls_get_base_type,
538 n_outer_fields_searched, n_contexts_saved): Delete.
539 (lookup_field_1, lookup_member,
540 lookup_fnfields_slot_nolazy): Remove stat gathering.
541 (print_search_statistics, reinit_search_statistics): Delete.
542 * tree.c (cxx_print_statistics): Don't print search stats.
544 2017-08-21 Nathan Sidwell <nathan@acm.org>
546 * search.c (lookup_field_r): Remove obsolete code for type-named
549 * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
551 (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
552 (lookup_field_fuzzy_r): Adjust.
554 2017-08-21 David Malcolm <dmalcolm@redhat.com>
556 * call.c (build_over_call): Pass NULL for new parameter to
557 check_function_arguments.
558 * typeck.c (cp_build_function_call_vec): Likewise.
560 2017-08-21 Nathan Sidwell <nathan@acm.org>
563 * pt.c (instantiate_class_template_1):
564 BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
566 2017-08-18 David Malcolm <dmalcolm@redhat.com>
569 * name-lookup.c (maybe_suggest_missing_header): Convert return
570 type from void to bool; return true iff a suggestion was offered.
571 (suggest_alternative_in_explicit_scope): Move call to
572 maybe_suggest_missing_header to before use of best_match, and
573 return true if the former offers a suggestion.
575 2017-08-18 H.J. Lu <hongjiu.lu@intel.com>
578 * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
579 * decl2.c (grokbitfield): Don't allow bit-field with
580 warn_if_not_aligned type.
582 2017-08-17 Nathan Sidwell <nathan@acm.org>
584 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
585 * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
586 (TYPE_TEMPLATE_INFO): Simplify.
587 (SET_TYPE_TEMPLATE_INFO): Simplify.
589 * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
590 don't need lang_type.
591 (cxx_make_type): Use maybe_add_lang_type_raw return value.
592 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
595 * cp-tree.h (struct lang_type): Remove template_info field.
596 (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
597 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
599 2017-08-14 Martin Sebor <msebor@redhat.com>
602 * error.c (cp_printer): Handle 'G'.
604 2017-08-11 Martin Liska <mliska@suse.cz>
606 * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
607 TARGET_SUPPORTS_ALIASES.
608 (handle_tls_init): Likewise.
609 (note_mangling_alias): Likewise. Remove ATTRIBUTE_UNUSED for
611 * optimize.c (can_alias_cdtor): Likewise.
613 2017-08-11 Jason Merrill <jason@redhat.com>
615 PR c++/81671 - nullptr_t template parameter
616 * pt.c (convert_nontype_argument): Fix nullptr_t check.
618 2017-08-10 Jason Merrill <jason@redhat.com>
620 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
621 * method.c (synthesized_method_walk): Don't diagnose lack of
624 PR c++/80452 - Core 1579, implicit move semantics on return/throw
625 * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
626 tentatively changed the lvalue to an rvalue.
627 * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
628 (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
629 parameter is an rvalue reference.
630 * except.c (build_throw): Do maybe-rvalue overload resolution twice.
631 * typeck.c (check_return_expr): Likewise.
633 2017-08-10 David Malcolm <dmalcolm@redhat.com>
635 * parser.c (cp_parser_error): Update for new param to
637 (class token_pair): New class.
638 (struct matching_paren_traits): New struct.
639 (matching_parens): New typedef.
640 (struct matching_brace_traits): New struct.
641 (matching_braces): New typedef.
642 (cp_parser_statement_expr): Convert explicit parsing of
643 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
644 class matching_parens, so that the pertinent open parenthesis is
645 highlighted when there are problems locating the close
647 (cp_parser_primary_expression): Likewise.
648 (cp_parser_compound_literal_p): Remove consumption of opening
650 (cp_parser_postfix_expression): Convert explicit parsing of
651 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
652 above. Use it to consume the opening paren previously consumed by
653 cp_parser_compound_literal_p.
654 (cp_parser_parenthesized_expression_list): Likewise.
655 (cp_parser_unary_expression): Likewise.
656 (cp_parser_new_expression): Likewise.
657 (cp_parser_cast_expression): Likewise.
658 (cp_parser_builtin_offsetof): Likewise.
659 (cp_parser_trait_expr): Likewise.
660 (cp_parser_lambda_declarator_opt): Likewise.
661 (cp_parser_lambda_body): Likewise, for matching_braces.
662 (cp_parser_compound_statement): Likewise.
663 (cp_parser_selection_statement): Likewise, for matching_parens.
664 (cp_parser_iteration_statement): Likewise.
665 (cp_parser_already_scoped_statement): Likewise, for
667 (cp_parser_linkage_specification): Likewise.
668 (cp_parser_static_assert): Likewise, for matching_parens.
669 (cp_parser_decltype): Likewise.
670 (cp_parser_operator): Likewise.
671 (cp_parser_enum_specifier): Likewise.
672 (cp_parser_namespace_definition): Likewise.
673 (cp_parser_direct_declarator): Likewise.
674 (cp_parser_braced_list): Likewise.
675 (cp_parser_class_specifier_1): Likewise, for matching_braces.
676 (cp_parser_constant_initializer): Likewise.
677 (cp_parser_noexcept_specification_opt): Likewise, for
679 (cp_parser_exception_specification_opt): Likewise.
680 (cp_parser_handler): Likewise.
681 (cp_parser_asm_specification_opt): Likewise.
682 (cp_parser_asm_operand_list): Likewise.
683 (cp_parser_gnu_attributes_opt): Likewise.
684 (cp_parser_std_attribute_spec): Likewise.
685 (cp_parser_requirement_parameter_list): Likewise.
686 (cp_parser_requirement_body): Likewise, for matching_braces.
687 (cp_parser_compound_requirement): Likewise.
688 (cp_parser_template_introduction): Likewise.
689 (cp_parser_sizeof_pack): Likewise, for matching_parens.
690 (cp_parser_sizeof_operand): Likewise; use it to consume the
691 opening paren previously consumed by cp_parser_compound_literal_p.
692 (get_matching_symbol): New function.
693 (cp_parser_required_error): Add param "matching_location". Remove
694 calls to cp_parser_error, instead setting a non-NULL gmsgid, and
695 handling it if set by calling c_parse_error, potentially with a
696 secondary location if matching_location was set.
697 (cp_parser_require): Add param "matching_location", with a default
698 value of UNKNOWN_LOCATION.
699 (cp_parser_require_keyword): Update for new param of
700 cp_parser_required_error.
701 (cp_parser_objc_encode_expression): Update to class matching_parens
703 (cp_parser_objc_defs_expression): Likewise.
704 (cp_parser_objc_protocol_expression): Likewise.
705 (cp_parser_objc_selector_expression): Likewise.
706 (cp_parser_objc_typename): Likewise.
707 (cp_parser_objc_superclass_or_category): Likewise.
708 (cp_parser_objc_try_catch_finally_statement): Likewise.
709 (cp_parser_objc_synchronized_statement): Likewise.
710 (cp_parser_objc_at_property_declaration): Likewise.
711 (cp_parser_oacc_single_int_clause): Likewise.
712 (cp_parser_oacc_shape_clause): Likewise.
713 (cp_parser_omp_clause_collapse): Likewise.
714 (cp_parser_omp_clause_default): Likewise.
715 (cp_parser_omp_clause_final): Likewise.
716 (cp_parser_omp_clause_if): Likewise.
717 (cp_parser_omp_clause_num_threads): Likewise.
718 (cp_parser_omp_clause_num_tasks): Likewise.
719 (cp_parser_omp_clause_grainsize): Likewise.
720 (cp_parser_omp_clause_priority): Likewise.
721 (cp_parser_omp_clause_hint): Likewise.
722 (cp_parser_omp_clause_defaultmap): Likewise.
723 (cp_parser_omp_clause_ordered): Likewise.
724 (cp_parser_omp_clause_schedule): Likewise.
725 (cp_parser_omp_clause_num_teams): Likewise.
726 (cp_parser_omp_clause_thread_limit): Likewise.
727 (cp_parser_omp_clause_aligned): Likewise.
728 (cp_parser_omp_clause_linear): Likewise.
729 (cp_parser_omp_clause_safelen): Likewise.
730 (cp_parser_omp_clause_simdlen): Likewise.
731 (cp_parser_omp_clause_depend): Likewise.
732 (cp_parser_omp_clause_device): Likewise.
733 (cp_parser_omp_clause_dist_schedule): Likewise.
734 (cp_parser_oacc_clause_async): Likewise.
735 (cp_parser_omp_critical): Likewise.
736 (cp_parser_omp_for_loop): Likewise.
737 (cp_parser_omp_sections_scope): Likewise.
738 (cp_parser_omp_declare_reduction_exprs): Likewise.
739 Update for new param to cp_parser_required_error.
740 (cp_parser_oacc_routine): Likewise.
741 (cp_parser_transaction_expression): Likewise.
742 (cp_parser_cilk_simd_vectorlength): Likewise.
744 2017-08-09 Jason Merrill <jason@redhat.com>
746 PR c++/81525 - wrong constant value with generic lambda
747 * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
748 (tsubst_copy) [VAR_DECL]: Handle auto.
750 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
751 * init.c (get_nsdmi): Add complain parm.
752 * typeck2.c (digest_nsdmi_init): Add complain parm.
753 (process_init_constructor_record): Pass complain to get_nsdmi.
754 * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
755 * method.c (get_defaulted_eh_spec): Add complain parm. Pass it into
756 synthesized_method_walk.
757 (synthesized_method_walk): Adjust.
758 (walk_field_subobs): Pass complain to get_nsdmi.
759 (defaulted_late_check): Skip other checks if deleted.
760 * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
761 * call.c (build_aggr_conv): Pass complain to get_nsdmi.
762 * parser.c (defarg_location): New.
763 * error.c (location_of): Use it.
765 2017-08-09 Marek Polacek <polacek@redhat.com>
767 * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
768 * typeck.c (build_binary_op): Change the type of a parameter to bool.
769 (cp_truthvalue_conversion): Use true instead of 1.
771 2017-08-08 Marek Polacek <polacek@redhat.com>
774 * cp-gimplify.c (cp_fold): If folding exposed a branch of
775 a COND_EXPR, convert it to the original type of the COND_EXPR, if
778 2017-08-08 Martin Liska <mliska@suse.cz>
780 * call.c: Include header files.
781 * cp-gimplify.c: Likewise.
782 * cp-ubsan.c: Likewise.
785 * search.c: Likewise.
786 * semantics.c: Likewise.
787 * typeck.c: Likewise.
789 2017-08-07 Martin Liska <mliska@suse.cz>
791 * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
793 (cp_parser_std_attribute): Likewise.
794 * tree.c: Add new include.
796 2017-08-04 Paolo Carlini <paolo.carlini@oracle.com>
799 * pt.c (do_class_deduction): Handle the case of no viable implicit
800 deduction guides; simplify the code generating implicit deduction
803 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
806 * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
807 destructor as expressions.
809 2017-08-02 Jakub Jelinek <jakub@redhat.com>
812 * call.c (build_user_type_conversion_1): Only call
813 lookup_fnfields_slot if totype is CLASS_TYPE_P.
815 2017-07-31 Jason Merrill <jason@redhat.com>
817 * decl.c (declare_global_var): Set DECL_CONTEXT.
819 2017-07-31 Jan Hubicka <hubicka@ucw.cz>
820 Martin Liska <mliska@suse.cz>
822 * pt.c (tsubst_copy): Copy PREDICT_EXPR.
823 * semantics.c (finish_goto_stmt): Build gimple predict
825 * constexpr.c (potential_constant_expression_1): Handle
828 2017-07-31 Martin Liska <mliska@suse.cz>
831 * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
832 also with current_function_decl non-null equality.
833 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
834 * decl.c (compute_array_index_type): Likewise.
835 * init.c (finish_length_check): Likewise.
836 * typeck.c (cp_build_binary_op): Likewise.
838 2017-07-29 Jakub Jelinek <jakub@redhat.com>
840 * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
841 DW_AT_export_symbols.
842 * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
843 argument, pass it through to the debug hook.
844 (finish_namespace_using_directive): Adjust
845 emit_debug_info_using_namespace caller.
846 (push_namespace): Likewise. Call it after setting
847 DECL_NAMESPACE_INLINE_P.
848 (cp_emit_debug_info_for_using): Pass false as new argument to
849 the imported_module_or_decl debug hook.
851 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
853 * lex.c (copy_decl): Adjust.
854 (copy_type): Likewise.
856 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
859 * lambda.c (add_capture): Early return if we cannot capture by
862 2017-07-26 Jason Merrill <jason@redhat.com>
864 P0702R1 - List deduction of vector.
865 * pt.c (do_class_deduction): Special-case deduction from a single
866 element of related type.
868 2017-07-26 Leonid Koppel <lkoppel@uwaterloo.ca>
870 PR c++/67054 - Inherited ctor with non-default-constructible members
871 * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
872 when deducing an inheriting constructor.
874 2017-07-21 Nathan Sidwell <nathan@acm.org>
876 * search.c (lookup_conversion_operator): Return overloads.
877 (lookup_fnfields_idx_nolazy): Absorb into ...
878 (lookup_fnfields_slot_nolaxy): ... here.
879 (lookup_fnfields_1): Absorb into ...
880 (lookup_fnfields_slot): ... here.
882 Remove special CDtor METHOD_VEC slots.
883 * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
884 CLASSTYPE_DESTRUCTOR_SLOT): Delete.
885 (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
886 (CLASSTYPE_DESTRUCTOR): Likewise.
887 * class (add_method): Don't use special cdtor slots.
888 * search.c (lookup_fnfields_idx_nolazy): Likewise.
889 (look_for_overrides_here): Use lookup_fnfields_slot.
890 * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
892 * call.c (add_candidates): Move decls to initialization. Don't
895 2017-07-20 Nathan Sidwell <nathan@acm.org>
898 * class.c (maybe_warn_about_overly_private_class,
899 finish_struct_methods, one_inheriting_sig, count_fields,
900 add_fields_to_record_type, check_field_decls, check_methods,
901 clone_function_decl, set_method_tm_attributes,
902 finalize_literal_type_property, check_bases_and_members,
903 create_vtable_ptr, determine_key_method,
904 unreverse_member_declarations, finish_struct,
905 add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
906 * decl.c (fixup_anonymous_aggr): Likewise.
907 * decl2.c (reset_type_linkage_2): Likewise.
908 * method.c (after_nsdmi_defaulted_late_checks,
909 lazily_declare_fn): Likewise.
910 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
911 * pt.c (instantiate_class_template_1, tsubst_expr,
912 do_type_instantiation, instantiate_pending_templates): Likewise.
913 * search.c (lookup_field_1): Likewise.
914 * semantics.c (finish_member_declaration,
915 finish_omp_declare_simd_methods): Likewise.
917 2017-07-19 Nathan Sidwell <nathan@acm.org>
919 * class.c (add_implicitly_declared_members): Use
920 classtype_has_move_assign_or_move_ctor_p.
921 (classtype_has_move_assign_or_move_ctor,
922 classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
923 (classtype_has_move_assign_or_move_ctor_p): ... this new function.
924 * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
926 (classtype_has_move_assign_or_move_ctor_p): ... this.
927 * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
928 * tree.c (type_has_nontrivial_copy_init): Adjust.
930 * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
931 PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
933 2017-07-18 Nathan Sidwell <nathan@acm.org>
935 * cp-array-notation.c (build_array_notation_ref): Use
936 TYPE_{MIN,MAX}_VALUE.
938 * class.c (classtype_has_move_assign_or_move_ctor): Declare.
939 (add_implicitly_declared_members): Use it.
940 (type_has_move_constructor, type_has_move_assign): Merge into ...
941 (classtype_has_move_assign_or_move_ctor): ... this new function.
942 * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
944 2017-07-17 Volker Reichelt <v.reichelt@netcologne.de>
946 * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
947 friend outside class and obsolete auto as storage-class-specifier.
949 2017-07-17 Nathan Sidwell <nathan@acm.org>
951 * class.c (maybe_warn_about_overly_private_class): Ignore public
954 * class.c (type_has_user_declared_move_constructor,
955 type_has_user_declared_move_assign): Combine into ...
956 (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
957 * cp-tree.h (type_has_user_declared_move_constructor,
958 type_has_user_declared_move_assign): Combine into ...
959 (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
960 * method.c (maybe_explain_implicit_delete): Use it.
961 (lazily_declare_fn): Use it.
962 * tree.c (type_has_nontrivial_copy_init): Use it.
964 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
965 semantics, simplify implementation.
967 2017-07-16 Volker Reichelt <v.reichelt@netcologne.de>
969 * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
970 in old-style cast diagnostic.
971 * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
972 in useless cast diagnostic.
973 * error.c (type_to_string): Remove enum special handling.
975 2017-07-14 David Malcolm <dmalcolm@redhat.com>
977 * name-lookup.c (get_std_name_hint): Add '<' and '>' around
979 (maybe_suggest_missing_header): Update for addition of '<' and '>'
980 to above. Provide a fix-it hint.
981 * pt.c: Include "gcc-rich-location.h"
982 (listify): Attempt to add fix-it hint for missing
983 #include <initializer_list>.
984 * rtti.c: Include "gcc-rich-location.h".
985 (typeid_ok_p): Attempt to add fix-it hint for missing
988 2017-07-12 Jason Merrill <jason@redhat.com>
990 P0512R0 - Deduction from an initializer list.
991 * pt.c (do_class_deduction): Do list deduction in two phases.
993 2017-07-12 Nathan Sidwell <nathan@acm.org>
995 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
996 DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
998 * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
999 DECL_CXX_DESTRUCTOR explicitly.
1000 * decl2.c (grokclassfn): Likewise.
1001 * friend.c (do_friend): Likewise.
1002 * method.c (make_thunk, make_alias_for,
1003 implicitly_declare_fn): Likewise.
1005 2017-07-11 Jason Merrill <jason@redhat.com>
1008 * decl.c (grokparms): Downgrade error about array of unknown bound
1009 to pedwarn and disable it for C++17.
1011 2017-07-11 Nathan Sidwell <nathan@acm.org>
1013 * decl2.c (reset_type_linkage_2): Dont't change ctor name.
1015 2017-07-10 Martin Sebor <msebor@redhat.com>
1017 * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
1019 2017-07-06 Jason Merrill <jason@redhat.com>
1021 PR c++/81204 - parse error with dependent template-name
1022 * parser.c (cp_parser_lookup_name): Revert previous change.
1024 2017-07-06 David Malcolm <dmalcolm@redhat.com>
1026 * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
1027 selftest::run_cp_tests.
1028 (selftest::run_cp_tests): New function.
1029 * cp-tree.h (selftest::run_cp_tests): New decl.
1031 2017-07-04 Jakub Jelinek <jakub@redhat.com>
1033 * parser.c (cp_parser_decomposition_declaration): Replace
1034 decomposition declaration with structured binding in diagnostics.
1035 * decl.c (cp_finish_decomp): Likewise.
1036 (grokdeclarator): Likewise.
1039 * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
1040 forms of structured binding initializers.
1042 2017-07-03 Paolo Carlini <paolo.carlini@oracle.com>
1045 * decl.c (grokdeclarator): Move checks on function return type after
1046 the splice_late_return_type call; if declspecs->locations[ds_type_spec]
1047 is UNKNOWN_LOCATION fall back to input_location.
1049 2017-07-03 David Malcolm <dmalcolm@redhat.com>
1051 * parser.c (enum required_token): Fix spelling of
1052 RT_INTERATION to RT_ITERATION.
1053 (cp_parser_iteration_statement): Likewise.
1054 (cp_parser_required_error): Likewise.
1056 2017-06-30 Jason Merrill <jason@redhat.com>
1058 PR c++/81257 - ICE with invalid ::template.
1059 PR c++/54769 - wrong lookup of dependent template-name.
1060 * parser.c (cp_parser_template_name): Revert part of last change.
1062 2017-06-30 Nathan Sidwell <nathan@acm.org>
1064 * config-lang.in (gtfiles): Add cp/lex.c.
1065 * cp-tree.h (mangle_convop_name_for_type): Rename ...
1066 (make_conv_op_name): ... here. Move to lex.
1067 * lambda.c (maybe_add_lambda_conv_op): Update.
1068 * parser.c (cp_parser_conversion_function_id): Update.
1069 * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
1070 tsubst_copy_and_build): Update.
1071 * semantics.c (apply_deduced_return_type): Update.
1072 * mangle.c (conv_type_hasher, conv_type_names,
1073 mangle_conv_op_name_for_type): Move to ...
1074 * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
1077 2017-06-30 David Malcolm <dmalcolm@redhat.com>
1080 * parser.c (cp_parser_postfix_expression): Construct a location
1081 for typeid expressions.
1083 2017-06-30 Nathan Sidwell <nathan@acm.org>
1085 * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
1087 (lookup_all_conversions): Declare.
1088 * class.c (get_basefndecls): Use lookup_fnfields_slot.
1089 * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
1090 * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
1092 * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
1093 (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
1094 lookup_all_conversions.
1095 * search.c (lookup_fnfields_1): Make static.
1096 (lookup_all_conversions): New.
1097 (class_method_index_for_fn): Delete.
1098 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
1099 lookup_fnfields_slot.
1101 * call.c (build_new_method_call_1): Use constructo_name to get
1102 ctor name. Move argument processing earlier to merge cdtor
1104 * decl.c (grokfndecl): Cdtors have special names.
1105 * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
1106 * pt.c (check_explicit_specialization): Cdtor name is already
1108 * search.c (class_method_index_for_fn): Likewise.
1111 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
1112 a matching TYPE_DECL.
1114 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
1116 * class.c (add_method): Change pair of errors to error + inform.
1117 (handle_using_decl): Likewise.
1119 2017-06-29 Jason Merrill <jason@redhat.com>
1121 * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
1123 PR c++/81180 - ICE with C++17 deduction of member class template.
1124 * pt.c (build_deduction_guide): Correct member template handling.
1126 PR c++/81188 - matching decltype of member function call.
1127 * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
1129 2017-06-29 Nathan Sidwell <nathan@acm.org>
1132 * parser.c (cp_parser_namespace_definition): Immediately close the
1133 namespace if there's no open-brace.
1134 * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
1137 2017-06-29 Jason Merrill <jason@redhat.com>
1139 PR c++/81164 - ICE with invalid inherited constructor.
1140 * search.c (binfo_direct_p): New.
1141 * name-lookup.c (do_class_using_decl): Use it.
1143 2017-06-29 Nathan Sidwell <nathan@acm.org>
1145 * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
1146 VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
1147 * decl.c (initialize_predefined_identifiers): Name cdtor special
1148 names consistently. Use literals for above deleted defines.
1149 (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
1151 * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
1154 * call.c (check_dtor_name): Use constructor_name for enums too.
1155 (build_new_method_call_1): Use constructor_name for cdtors and
1157 * class.c (build_self_reference): Use TYPE_NAME to get name of
1159 * name-lookup (constructor_name): Use DECL_NAME directly.
1160 (constructor_name_p): Reimplement.
1161 (push_class_level_binding_1): Use TYPE_NAME directly.
1163 * class.c (finish_struct): Use OVL_P.
1164 (get_vfield_name): Measure constructor_name length.
1165 * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
1166 (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
1167 * cxx-pretty-print.c (is_destructor_name): Delete.
1168 (pp_cxx_unqualified_id): Remove bogus destructor name checking.
1169 * decl.c (grokfndecl): Move cheap checks first when looking for
1170 implicit extern cness.
1172 * parser.c (cp_parser_direct_declarator): Reorder if to avoid
1173 indentation. Remove unnecessary assignment of constructor name.
1175 Whitespace cleanups.
1176 * call.c (name_as_c_string): Move CONST_CAST to return.
1177 (build_new_method_call_1): Remove unneeded bracing.
1178 * class.c (include_empty_classes): Unbreak line.
1179 * constraint.cc (tsubst_check_constraint): Add space.
1180 * cp-tree.h (lang_decl_ns): Add comment.
1181 (PTRMEM_CST_MEMBER): Break line.
1182 * decl.c (grokfndecl): Add blank lines. Unbreak some others.
1183 (grokdeclarator): Remove lines, move declaration to first use.
1184 * decl2.c (decl_needed_p): Fix indentation.
1185 (c_parse_final_cleanups): Remove blank line.
1186 * method.c (implicitly_declare_fn): Move declaration to first use.
1187 * search.c (current_scope): Add blank lines.
1189 2017-06-28 Jason Merrill <jason@redhat.com>
1191 PR c++/72764 - ICE with invalid template typename.
1192 * decl.c (build_typename_type): No longer static.
1193 * tree.c (strip_typedefs): Use it instead of make_typename_type.
1195 PR c++/69300 - ICE with self-referential noexcept
1196 * pt.c (maybe_instantiate_noexcept): Check for recursion.
1198 PR c++/61022 - error with variadic template template parm
1199 * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
1201 PR c++/72801 - ICE with variadic partial specialization
1202 * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
1204 PR c++/55639 - partial specialization with ::template
1205 * parser.c (cp_parser_class_head): Handle ::template.
1207 PR c++/45976 - error with ::template in declarator.
1208 * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
1210 PR c++/54769 - wrong lookup of dependent template-name.
1211 * parser.c (cp_parser_template_name): Handle dependent object type.
1212 (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
1214 (cp_parser_id_expression): Pass it.
1215 (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
1217 * parser.c (cp_parser_template_id): Use the range location on the
1220 PR c++/81204 - parse error with dependent template-name
1221 * parser.c (cp_parser_lookup_name): Disqualify function templates
1224 2017-06-27 Nathan Sidwell <nathan@acm.org>
1226 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
1227 initialization point. Don't unnecessarily check for ctor name.
1229 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
1230 (CLASSTYPE_DESTRUCTOR): ... this.
1231 * class.c (accessible_nvdtor_p,
1232 maybe_warn_about_overly_private_class,
1233 add_implicitly_declared_members,
1234 clone_constructors_and_destructors, type_has_virtual_destructor):
1235 Adjust for CLASSTYPE_DESTRUCTOR.
1236 (deduce_noexcept_on_destructors): Absorb into ...
1237 (check_bases_and_members): ... here.
1238 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
1239 * init.c (build_delete): Likewise.
1240 * parser.c (cp_parser_lookup_name): Likewise.
1241 * pt.c (check_explicit_specialization): Likewise.
1242 * rtti.c (emit_support_tinfos): Likewise.
1243 * search.c (lookup_fnfields_idx_nolazy): Likewise.
1245 Kill IDENTIFIER_TEMPLATE.
1246 * cp-tree.h (lang_identifier): Remove class_template_info field.
1247 (IDENTIFIER_TEMPLATE): Delete.
1248 * name-lookup.c (constructor_name_full): Subsume into ...
1249 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
1250 (constructor_name_p): Likewise.
1251 * mangle.c (write_source_name): Likewise.
1252 * ptree.c (cxx_print_identifier): Likewise.
1254 2017-06-27 Marek Polacek <polacek@redhat.com>
1257 * parser.c (cp_parser_already_scoped_statement): Initialize
1260 2017-06-26 Jason Merrill <jason@redhat.com>
1262 PR c++/81215 - deduction failure with variadic TTP.
1263 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
1265 2017-06-26 Martin Sebor <msebor@redhat.com>
1268 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
1269 to detect casting away cv-qualifiers.
1271 2017-06-26 Nathan Sidwell <nathan@acm.org>
1273 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
1274 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
1276 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
1277 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
1278 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
1279 * decl.c (grok_op_properties): Adjust identifier checking.
1280 * init.c (expand_default_init): Adjust identifier descision.
1281 * method.c (implicitly_declare_fn): Don't use
1282 DECL_ASSIGNMENT_OPERATOR_P.
1283 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
1285 * call.c (in_charge_arg_for_name): Reimplement.
1286 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
1289 2017-06-26 Marek Polacek <polacek@redhat.com>
1292 * parser.c (cp_parser_statement): Add a default argument. Save the
1293 location of the expression-statement after labels have been parsed.
1294 (cp_parser_implicitly_scoped_statement): Set the location of the
1295 body of the conditional after parsing all the labels. Call
1296 warn_for_multistatement_macros.
1297 (cp_parser_already_scoped_statement): Likewise.
1299 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
1302 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
1303 'typename' in error messages about missing 'typename'.
1305 2017-06-23 Jason Merrill <jason@redhat.com>
1307 PR c++/79056 - C++17 ICE with invalid template syntax.
1308 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
1310 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
1311 * pt.c (template_placeholder_p): New.
1312 * cp-tree.h: Declare it.
1314 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
1316 * decl.c (duplicate_decls): Use builtin_structptr_types.
1318 2017-06-22 Nathan Sidwell <nathan@acm.org>
1320 Reorder IDENTIFIER flags
1322 * cp-tree.h (enum cp_identifier_kind): New.
1323 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
1324 IDENTIFIER_KIND_BIT_2): New.
1325 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
1326 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
1327 (C_IS_RESERVED_WORD): Replace with ...
1328 (IDENTIFIER_KEYWORD_P): ... this.
1329 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
1330 (IDENTIFIER_CDTOR_P): ... this.
1331 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
1332 (IDENTIFIER_OPNAME_P): Replace with ...
1333 (IDENTIFIER_ANY_OP_P): ... this.
1334 (IDENTIFIER_ASSIGN_OP_P): New.
1335 (IDENTIFIER_TYPENAME_P): Replace with ...
1336 (IDENTIFIER_CONV_OP_P): ... this.
1337 (NEW_DELETE_OPNAME_P): Replace with ...
1338 (IDENTIFIER_NEWDEL_OP_P): ... this.
1339 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
1340 (get_identifier_kind_name, set_identifier_kind): Declare.
1341 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
1342 (init_operators): Adjust to avoid keywords, use
1343 set_identifier_kind. Copy TYPE_EXPR slot.
1344 (init_reswords): Call set_identifier_kind.
1345 (unqualified_name_lookup_error): Adjust.
1346 * operators.def (TYPE_EXPR): Remove.
1347 * decl.c (struct predefined_identifier): Move into ...
1348 (initialize_predefined_identifiers): ... here. Call
1349 set_identifier_kind.
1350 (grokfndecl, check_var_type, grokdeclarator): Adjust.
1351 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
1353 * call.c (name_as_c_string): Adjust.
1354 (build_new_method_call_1): Likewise.
1355 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
1356 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
1357 * dump.c (cp_dump_tree): Adjust.
1358 * error.c (dump_decl_name): Adjust.
1359 * mangle.c (write_unqualified_id, write_member_name,
1360 write_expression): Adjust.
1361 (mangle_conv_op_name_for_type): Use set_identifier_kind.
1362 * name-lookup.c (do_class_using_decl): Adjust.
1363 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
1364 * parser.c (cp_lexer_get_preprocessor_token,
1365 cp_parser_direct_declarator): Likewise.
1366 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
1367 tsubst_copy, tsubst_copy_and_build): Adjust.
1368 * ptree.c (cxx_print_identifier): Print identifier kind.
1369 * search.c (lookup_field_r, lookup_member,
1370 lookup_fnfields_idx_nolazy): Adjust.
1371 * semantics.c (finish_id_expression): Adjust..
1372 * typeck.c (cp_build_addr_expr_1): Adjust.
1374 2017-06-21 Jakub Jelinek <jakub@redhat.com>
1377 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
1378 Complain about t not being a variable if t is OVERLOAD even
1379 when processing_template_decl.
1381 2017-06-21 David Malcolm <dmalcolm@redhat.com>
1383 * parser.c (get_cast_suggestion): New function.
1384 (maybe_add_cast_fixit): New function.
1385 (cp_parser_cast_expression): Capture the location of the closing
1386 parenthesis. Call maybe_add_cast_fixit when emitting warnings
1387 about old-style casts.
1389 2017-06-20 Jason Merrill <jason@redhat.com>
1391 PR c++/80972 - C++17 ICE with attribute packed.
1392 * call.c (build_over_call): Allow a TARGET_EXPR from reference
1395 2017-06-20 Nathan Sidwell <nathan@acm.org>
1397 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
1398 (nelts_identifier): Delete.
1399 * decl.c (initialize_predefined_identifiers): Remove nelts.
1401 PR c++/67074 - namespace aliases
1402 * decl.c (duplicate_decls): Don't error here on mismatched
1404 * name-lookup.c (name_lookup::add_value): Matching namespaces are
1406 (diagnose_name_conflict): Namespaces are never redeclarations.
1407 (update_binding): An alias can match a real namespace.
1409 2017-06-19 Jason Merrill <jason@redhat.com>
1411 PR c++/80562 - ICE with constexpr if.
1412 * semantics.c (finish_if_stmt_cond): Call
1413 instantiate_non_dependent_expr.
1415 PR c++/80829 - ICE with constexpr copy of base subobject.
1416 * constexpr.c (clear_no_implicit_zero): New.
1417 (cxx_eval_call_expression): Call it.
1419 2017-06-19 Nathan Sidwell <nathan@acm.org>
1423 * name-lookup.c (set_decl_namespace): Don't follow using
1424 directives and ignore using decls. Only check overly-explicit
1425 scope after discovering decl.
1427 2017-06-19 Jason Merrill <jason@redhat.com>
1429 PR c++/81073 - constexpr and static var in statement-expression.
1430 * typeck2.c (store_init_value): Always call
1431 require_potential_constant_expression.
1432 * pt.c (convert_nontype_argument): Likewise.
1433 * constexpr.c (potential_constant_expression_1): Adjust message.
1434 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
1435 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
1437 2017-06-19 Nathan Sidwell <nathan@acm.org>
1439 * pt.c (coerce_template_parms): Fix indentation.
1440 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
1444 * name-lookup.c (update_binding): Only warn about constructors
1445 hidden by functions.
1447 2017-06-17 Jason Merrill <jason@redhat.com>
1449 PR c++/60063 - -Wunused-local-typedefs and templates.
1450 * decl2.c (is_late_template_attribute): Return false for "used".
1452 PR c++/70844 - -Wuseless-cast and inheriting constructor.
1453 * method.c (forward_parm): Suppress warn_useless_cast.
1455 2017-06-16 Jason Merrill <jason@redhat.com>
1457 PR c++/81045 - Wrong type-dependence with auto return type.
1458 * pt.c (type_dependent_expression_p): An undeduced auto outside the
1459 template isn't dependent.
1460 * call.c (build_over_call): Instantiate undeduced auto even in a
1463 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
1464 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
1465 set longer for a generic lambda.
1467 PR c++/80614 - Wrong mangling for C++17 noexcept type
1468 * mangle.c (write_type): Put the eh spec back on the function type.
1470 PR c++/81102 - Wrong error with partial specialization.
1471 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
1472 types. Do type deduction later.
1474 PR c++/81074 - ICE with partial specialization of member template.
1476 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
1478 PR c++/80831 - ICE with -fsyntax-only.
1479 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
1481 PR c++/80639 - ICE with invalid PMF initialization.
1482 PR c++/80043 - ICE with -fpermissive
1483 * typeck.c (convert_for_assignment): Recurse when instantiate_type
1484 returns without an error.
1486 2017-06-16 Nathan Sidwell <nathan@acm.org>
1488 * pt.c (tsubst_baselink): Fix & clarify formatting.
1490 * cp-tree.h (build_this_parm, cp_build_parm_decl,
1491 build_artificial_parm): Add FN parm.
1492 * decl.c (start_cleanup_fn): Adjust.
1493 (build_this_parm): Add FN parm, pass it through.
1494 (grokfndecl): Adjust parm building.
1495 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
1496 (build_artificial_parm): Add FN parm, pass through.
1497 (maybe_retrofit_in_chrg): Adjust parm building.
1498 (start_static_storage_duration_function): Likwise.
1499 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
1500 * method.c (implicitly_declare_fn): Likewise.
1501 * parser.c (inject_this_parameter): Likewise.
1503 Symbol tables are insert only.
1504 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
1505 derive from pointer_hash. Make undeletable.
1507 * class.c (resort_type_method_vec): Avoid potential unsigned
1510 Don't defer noexcept_deferred_spec.
1511 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
1512 * decl.c (cxx_init_decl_processing): Initialize
1513 noexcept_deferred_spec.
1514 * except.c (unevaluated_noexcept_spec): Delete.
1515 * class.c (deduce_noexcept_on_destructor): Use
1516 noexcept_deferred_spec directly.
1517 * method.c (implicitly_declare_fn): Likewise.
1519 Make keyed_classes a vector.
1520 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
1521 (keyed_classes): Declare as vector.
1522 * decl.c (keyed_classes): Define.
1523 (cxx_init_decl_processing): Allocate it.
1524 (record_key_method_defined): Use vec_safe_push.
1525 * class.c (finish_struct_1): Likewise.
1526 * pt.c (instantiate_class_template_1): Likewise.
1527 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
1530 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
1531 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
1533 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
1534 (get_tinfo_decl): Use get_tinfo_desc.
1535 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
1536 (create_pseudo_type_info): Delete.
1537 (get_pseudo_ti_index): Just determine the index.
1538 (get_tinfo_desc): New. Create all types lazily.
1539 (create_tinfo_types): Just allocate the descriptor array.
1540 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
1543 2017-06-15 Martin Sebor <msebor@redhat.com>
1546 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
1548 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
1549 (build_cxx_call): Call maybe_warn_class_memaccess.
1551 2017-06-14 Jakub Jelinek <jakub@redhat.com>
1553 * cp-gimplify.c (cp_genericize_r): Turn most of the function
1554 into a switch (TREE_CODE (stmt)) statement from long else if
1557 2017-06-13 Jakub Jelinek <jakub@redhat.com>
1560 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
1561 argument even if it has REFERENCE_TYPE.
1564 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
1565 BLOCK_VARS (outer) chain.
1566 (cxx_omp_const_qual_no_mutable): Likewise.
1568 2017-06-13 Martin Liska <mliska@suse.cz>
1571 * class.c (build_base_path): Use sanitize_flags_p.
1572 * cp-gimplify.c (cp_genericize_r): Likewise.
1573 (cp_genericize_tree): Likewise.
1574 (cp_genericize): Likewise.
1575 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1576 * decl.c (compute_array_index_type): Likewise.
1577 (start_preparsed_function): Likewise.
1578 * decl2.c (one_static_initialization_or_destruction): Likewise.
1579 * init.c (finish_length_check): Likewise.
1580 * lambda.c (maybe_add_lambda_conv_op): Likewise.
1581 * typeck.c (cp_build_binary_op): Likewise.
1582 (build_static_cast_1): Likewise.
1584 2017-06-11 Jason Merrill <jason@redhat.com>
1586 * error.c (dump_expr): Use is_this_parameter.
1588 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
1591 2017-06-09 Jason Merrill <jason@redhat.com>
1593 Missing bits from N4268, constant evaluation for all non-type args.
1594 * call.c (build_converted_constant_expr): Rename from
1595 build_integral_nontype_arg_conv, handle all types.
1596 * pt.c (convert_nontype_argument): In C++17 call it for all types.
1597 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
1598 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
1600 Overhaul pointer-to-member conversion and template argument handling.
1601 * call.c (standard_conversion): Avoid creating ck_pmem when the
1602 class type is the same.
1603 * cvt.c (can_convert_qual): Split from
1604 perform_qualification_conversions.
1605 * constexpr.c (cxx_eval_constant_expression): Check it.
1606 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
1607 adjustment is necessary.
1608 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
1609 (convert_nontype_argument): Avoid redundant error.
1611 * call.c (convert_like_real): Remove "inner" parameter.
1612 Don't replace a constant with its value.
1613 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
1615 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
1618 * parser.c (cp_parser_constant_expression): Check
1619 potential_rvalue_constant_expression after decay_conversion.
1620 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
1622 PR c++/80384 - ICE with dependent noexcept-specifier
1623 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
1626 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
1628 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
1630 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
1631 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
1632 (excpet.c): Mark terminate as cold.
1634 2017-06-08 Jakub Jelinek <jakub@redhat.com>
1637 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
1638 to sizetype before size_binop.
1641 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
1642 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
1643 and OMP_CLAUSE_SHARED_READONLY flags.
1645 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
1647 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
1649 2017-06-07 Nathan Sidwell <nathan@acm.org>
1651 * class.c (layout_class_type): Restructure overlong-bitfield tpe
1654 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
1657 * pt.c (do_class_deduction): Build qualified type.
1659 2017-06-06 Nathan Sidwell <nathan@acm.org>
1661 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
1662 sans using directives. Don't walk into inline namespaces.
1665 * name-lookup.c (adl_class_only): Don't add visible friends.
1667 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
1669 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
1671 2017-06-02 Nathan Sidwell <nathan@acm.org>
1673 Remove lang_type_ptrmem.
1674 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
1676 (lang_type_class): ... this. Reorder bitfields. Rename to ...
1677 (lang_type): ... this. Delete old definition.
1678 (lang_type_ptrmem): Delete.
1679 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
1680 (LANG_TYPE_PTRMEM_CHECK): Delete.
1681 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
1682 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
1683 * decl.c (build_ptrmemfunc_type): Adjust.
1684 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
1685 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
1687 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
1690 Remove cp_binding_level::namespaces
1691 * name-lookup.h (cp_binding_level): Lose namespaces field.
1692 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
1694 (suggest_alternatives_for): Adjust for namespace list. Do
1695 breadth-first search.
1696 * decl2.c (collect_source_refs): Namespaces are on the regulr
1698 (collect_ada_namespace): Likewise.
1700 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
1702 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
1705 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
1708 * method.c (constructible_expr): Strip array types before calling
1711 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
1714 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
1715 for case INDIRECT_REF too in the main switch.
1717 2017-05-31 Jason Merrill <jason@redhat.com>
1719 PR c++/80840 - ICE with constexpr and reference
1720 * pt.c (convert_nontype_argument): Don't test whether a decl is
1721 value-dependent when binding to a reference.
1723 2017-05-31 Nathan Sidwell <nathan@acm.org>
1725 * cp-tree.h (lang_decl_slector): New enum.
1726 (lang_decl_base): Make selector an enum. Drop decomposition_p
1728 (lang_decl): Use enum for discrimination.
1729 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
1730 LANG_DECL_DEOMP_CHECK): Use enum.
1731 (DECL_DECOMPOSITION_P): Use selector value.
1732 (SET_DECL_DECOMPOSITION_P): Delete.
1733 (retrofit_lang_decl): Lose SEL parm.
1734 (fit_decomposition_lang_decl): Declare.
1735 * decl.c (cp_finish_decomp, grokdeclarator): Use
1736 fit_decomposition_lang_decl.
1737 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
1739 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
1740 (fit_decomposition_lang_decl): Likewise.
1741 (retrofit_lang_decl): Use worker functions.
1742 (cxx_dup_lang_specific_decl): Use selector enum.
1743 (maybe_add_lang_type_raw): New. Broken out of ...
1744 (cxx_make_type_name): ... here. Call it.
1746 2017-05-30 Jason Merrill <jason@redhat.com>
1748 PR c++/80856 - ICE with local extern in template
1749 * semantics.c (finish_call_expr): Replace a local extern overload
1750 set in a template with the IDENTIFIER_NODE.
1752 2017-05-30 David Malcolm <dmalcolm@redhat.com>
1754 * call.c (perform_implicit_conversion_flags): Convert
1755 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
1756 (print_conversion_rejection): Replace pairs of %qT with
1757 %qH and %qI in various places.
1758 (build_user_type_conversion_1): Likewise.
1759 (build_integral_nontype_arg_conv): Likewise.
1760 (build_conditional_expr_1): Likewise.
1761 (convert_like_real): Likewise.
1762 (convert_arg_to_ellipsis): Likewise.
1764 (initialize_reference): Likewise.
1765 * cvt.c (cp_convert_to_pointer): Likewise.
1766 (cp_convert_to_pointer): Likewise.
1767 (convert_to_reference): Likewise.
1768 (ocp_convert): Likewise.
1769 * error.c (cp_printer): Gain bool and const char ** parameters.
1770 (struct deferred_printed_type): New struct.
1771 (class cxx_format_postprocessor): New class.
1772 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
1773 to pp->m_format_postprocessor.
1774 (comparable_template_types_p): New function.
1775 (newline_and_indent): New function.
1776 (arg_to_string): New function.
1777 (print_nonequal_arg): New function.
1778 (print_template_differences): New function.
1779 (type_to_string_with_compare): New function.
1780 (print_template_tree_comparison): New function.
1781 (append_formatted_chunk): New function.
1782 (add_quotes): New function.
1783 (cxx_format_postprocessor::handle): New function.
1784 (defer_phase_2_of_type_diff): New function.
1785 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
1787 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
1788 %qH and %qI in various places.
1789 (convert_member_func_to_ptr): Likewise.
1790 (build_reinterpret_cast_1): Likewise.
1791 (convert_for_assignment): Likewise.
1792 * typeck2.c (check_narrowing): Likewise.
1794 2017-05-30 Nathan Sidwell <nathan@acm.org>
1796 Kill IDENTIFIER_NAMESPACE_BINDINGS
1797 * cp-tree.h (lang_identifier): Delete namespace_bindings.
1798 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
1799 (lang_decl_ns): Add bindings.
1800 (DECL_NAMESPACE_BINDINGS): New.
1801 * lex.c (retrofit_lang_decl): Create namespace hash table.
1802 * name-lookup.c (find_namespace_slot): Change to use hash-map.
1803 * ptree.c (cxx_print_binding): Delete.
1804 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
1806 * cp-tree.def (OVERLOAD): Fix comment.
1807 * cp-tree.h: Fix comments and whitespace.
1808 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
1809 * name-lookup.c (add_decl_to_level): Assert not class.
1810 (check_local_shadow): Use OVL_P.
1811 (pushdecl_with_scope_1): Rename to ...
1812 (do_pushdecl_with_Scope): ... here.
1813 (do_nonmember_using_decl): Use qualified_namespace_lookup return
1815 (push_class_level_binding_1): Use OVL_P.
1816 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
1817 (pushtag_1): Rename to ...
1818 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
1820 (store_class_bindings): Do not time here.
1821 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
1822 * pt.c (listify): Declare argvec at point of initialization.
1825 * name-lookup.c (add_decl_to_level): Assert not making a circular
1827 (update_binding): Don't prematurely slide artificial decl.
1829 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
1831 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
1833 2017-05-29 Nathan Sidwell <nathan@acm.org>
1835 PR c++/80891 (#1,#5)
1836 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
1837 * name-lookup.c (name_lookup): Add deduping field.
1838 (name_lookup::preserve_state, name_lookup::restore_state): Deal
1840 (name_lookup::add_overload): New.
1841 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
1842 (name_lookup::search_adl): Set deduping. Don't unmark here.
1843 * pt.c (most_specialized_instantiation): Revert previous change,
1844 Assert not given duplicates.
1845 * tree.c (lookup_mark): Just mark the underlying decls.
1846 (lookup_maybe_add): Dedup using marked decls.
1849 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
1850 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
1852 Stat hack representation
1853 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
1854 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
1856 (find_namespace_binding): Replace with ...
1857 (find_namespace_slot): ... this.
1858 (find_namespace_value): New.
1859 (name_lookup::search_namespace_only,
1860 name_lookup::adl_namespace_only): Adjust.
1861 (update_binding): Add SLOT parameter, adjust.
1862 (check_local_shadow): Use find_namespace_value.
1863 (set_local_extern_decl_linkage): Likewise.
1864 (do_pushdecl): Adjust for namespace slot.
1865 (push_local_binding): Assert not a namespace binding.
1866 (check_for_out_of_scope_variable): Use find_namespace_value.
1867 (set_identifier_type_value_with_scope): Likewise.
1868 (get_namespace_binding): Likewise.
1869 (set_namespace_binding): Delete.
1870 (set_global_binding): Directly update the binding.
1871 (finish_namespace_using_decl): Likewise.
1872 (lookup_type_scope_1): Use find_namespace_slot and update.
1873 (do_push_nested_namespace): Use find_namespace_value.
1876 * pt.c (most_specialized_instantiation): Cope with duplicate
1880 * cp-tree.h (build_min_nt_call_vec): Declare.
1881 * decl.c (build_offset_ref_call_from_tree): Call it.
1882 * parser.c (cp_parser_postfix_expression): Likewise.
1883 * pt.c (tsubst_copy_and_build): Likewise.
1884 * semantics.c (finish_call_expr): Likewise.
1885 * tree.c (build_min_nt_loc): Keep unresolved lookups.
1886 (build_min): Likewise.
1887 (build_min_non_dep): Likewise.
1888 (build_min_non_dep_call_vec): Likewise.
1889 (build_min_nt_call_vec): New.
1892 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
1894 (lookup_keep): Call it.
1896 2017-05-26 Nathan Sidwell <nathan@acm.org>
1899 * name-lookup.c (push_inline_namespaces): New.
1900 (push_namespace): Look inside inline namespaces.
1902 Inline and using namespace representation change.
1903 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
1905 (DECL_NAMESPACE_USING): Adjust.
1906 (DECL_NAMESPACE_INLINEES): New.
1907 * name-lookup.h (struct cp_binding_level): Change usings
1909 * name-lookup.c (name_lookup::do_queue_usings,
1910 name_lookup::queue_usings): Adjust.
1911 (name_lookup::search_namespace, name_lookup::search_usings,
1912 name_lookup::queue_namespace): Adjust.
1913 (name_lookup::adl_namespace_only): Adjust.
1914 (add_using_namespace, push_namespace): Push onto vector.
1915 (pop_namespace): Add timing logic.
1917 * call.c (build_operator_new_call): Do namelookup and ADL here.
1918 (build_new_op_1): Likewise.
1919 * name-lookup.h (lookup_function_nonclass): Delete declaration.
1920 (do_using_directive): Likewise.
1921 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
1923 (struct scope_binding): Delete.
1924 (EMPTY_SCOPE_BINDING): Delete.
1925 (set_decl_namespace): Use OVL_P.
1926 (finish_local_using_decl): Lose unnecesary checks.
1927 (lookup_function_nonclass): Delete.
1928 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
1930 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
1931 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
1933 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
1934 (lkp_iterator): Add outer field. Adjust ctor.
1935 (lkp_iterator::operator++): New.
1936 (lookup_mark, lookup_maybe_add): Declare.
1937 * name-lookup.c (name_lookup): Delete fn_set member.
1938 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
1940 (name_lookup::add_value): Use lookup_add directly.
1941 (name_lookup::add_fns: Use lookup_maybe_add.
1942 (name_lookup::search_adl): Mark and unmark fns.
1944 * pt.c (check_explicit_specialization): Use lookup_add directly.
1945 * ptree.c (cxx_print_xnode): Show complete overload structure.
1946 * tree.c (lookup_mark, lookup_maybe_add): New.
1948 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
1950 2017-05-26 Jakub Jelinek <jakub@redhat.com>
1952 * cp-tree.h (struct lang_decl_decomp): New type.
1953 (struct lang_decl): Add u.decomp.
1954 (LANG_DECL_DECOMP_CHECK): Define.
1955 (DECL_DECOMPOSITION_P): Note it is set also on the vars
1956 for user identifiers.
1957 (DECL_DECOMP_BASE): Define.
1958 (retrofit_lang_decl): Add extra int = 0 argument.
1959 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
1960 use it to influence the selector choices and for selector
1961 0 to non-zero transition copy old content.
1962 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
1963 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
1964 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
1965 wording if decl is a structured binding.
1966 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
1967 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
1968 of individual variables for tuple structured bindings.
1969 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
1970 Clear DECL_DECOMP_BASE.
1971 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
1972 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
1974 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
1977 2017-05-25 Jason Merrill <jason@redhat.com>
1979 PR c++/80605 - __is_standard_layout and zero-length array
1980 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
1982 2017-05-25 Nathan Sidwell <nathan@acm.org>
1984 Kill OVL_CURRENT, OVL_NEXT.
1985 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
1986 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
1987 (consider_binding_level): Use OVL_FIRST.
1988 (cp_emit_debug_info_for_using): Use lkp_iterator.
1989 * pt.c (check_explicit_specialization): Use ovl_iterator.
1991 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
1992 * cp-tree.h (lang_decl_ns): Remove ns_users field.
1993 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
1994 (TREE_INDIRECT_USING): Delete.
1995 * name-lookup.h (is_associated_namespace): Delete.
1996 * name-lookup.c (name_lookup::search_usings,
1997 name_lookup::do_queue_usings): Usings are always direct.
1998 (is_associated_namespace): Delete.
1999 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
2000 (namespace_ancestor_1, namespace_ancestor): Delete.
2001 (push_using_directive_1, push_using_directive): Delete.
2002 (add_using_namespace_1): Delete.
2003 (add_using_namespace): Reimplement.
2004 (emit_debug_info_using_namespace): New.
2005 (finish_namespace_using_directive, finish_local_using_directive,
2006 push_namespace): Adjust.
2007 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
2009 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
2011 * semantics.c (finish_handler_parms): Warn about non-reference type
2014 2017-05-25 Nathan Sidwell <nathan@acm.org>
2016 Reimplement unqualified namespace lookup.
2017 * name-lookup.c (name_lookup::using_pair,
2018 name_lookup::using_queue): New typedefs.
2019 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
2020 name_lookup::queue_usings): New.
2021 (name_lookup::search_unqualified): New.
2022 (merge_functions, same_entity_p, ambiguous_decl,
2023 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
2024 lookup_using_namespace): Delete.
2025 (lookup_name_real_1): Adjust.
2027 Reimplement qualified namespace lookup.
2028 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
2029 (name_lookup::ambiguous, name_lookup::add_value,
2030 name_lookup::add_type, name_lookup::process_binding): New.
2031 (name_lookup::search_namespace_only,
2032 name_lookup::search_namespace, name_lookup::search_usings): New.
2033 (name_lookup::search_qualified): New.
2034 (do_nonmember_using_decl, suggest_alternatives_for,
2035 lookup_qualified_name): Adjust.
2036 (tree_vec_contains): Delete.
2037 (qualified_lookup_using_namespace): Rename to ...
2038 (qualified_namespace_lookup): ... here. Reimplement.
2041 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
2042 * name-lookup.h (lookup_arg_dependent): Return plain tree.
2043 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
2044 arg_assoc_args_vec, arg_assoc_type, add_function,
2045 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
2046 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
2047 lookup_arg_dependent_1): Delete.
2048 (name_lookup): New lookup object.
2049 (name_lookup::preserve_state, name_lookup::restore_state,
2050 name_lookup::mark_seen, name_lookup::find_and_mark,
2051 name_lookup::add_fns, name_lookup::adl_namespace_only,
2052 name_lookup::adl_namespace, name_lookup::adl_class_only,
2053 name_lookup::adl_bases, name_lookup::adl_class,
2054 name_lookup::adl_expr, name_lookup::adl_type,
2055 name_lookup::adl_template_arg, name_lookup::search_adl): New.
2056 (lookup_arg_dependent): Return a plain tree. Adjust.
2057 (is_associated_namespace): Move later.
2059 2017-05-24 Nathan Sidwell <nathan@acm.org>
2061 * friend.c (do_friend): Remove check for existing decl.
2062 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
2063 * name-lookup.c (push_local_binding): Directly look for binding.
2064 (lookup_name_innermost_nonclass_level_1): Delete.
2065 (lookup_name_innermost_nonclass_level): Delete.
2067 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
2069 * cp-tree.h (cp_free_lang_data): Add extern.
2070 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
2072 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
2073 * typeck.c (type_unknown_p): Delete.
2074 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
2075 overload management.
2076 (dependent_name): Likewise.
2077 (decl_anon_ns_mem_p): Simplify.
2079 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
2082 * tree.c (reshape_init): Use unqualified type for direct enum init.
2083 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
2084 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
2085 non-class destination types.
2086 (build_const_cast_1): Strip cv-quals from destination types.
2087 (build_static_cast, build_reinterpret_cast, build_const_cast)
2088 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
2090 2017-05-24 Martin Sebor <msebor@redhat.com>
2093 * call.c (fully_fold_internal): Adjust.
2095 2017-05-24 Nathan Sidwell <nathan@acm.org>
2097 * cp-tree.h (ovl_skip_hidden): Declare.
2098 * tree.c (ovl_skip_hidden): New.
2099 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
2100 (lookup_arg_dependent_1): Likewise.
2101 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
2102 (hidden_name_p, remove_hidden_names): Delete.
2103 (lookup_name_real_1): Do not strip hidden names.
2104 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
2106 * cp-tree.h (OVL_HIDDEN_P): New.
2107 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
2108 (ovl_iterator::reveal_node): Declare.
2109 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
2110 (ovl_insert): Order on hiddenness.
2111 (ovl_iterator::reveal_node): New.
2112 * name-lookup.c (anticipated_builtin_p): New.
2113 (supplement_binding_1): Use it.
2114 (set_local_extern_decl_linkage): Use hidden_p.
2115 (do_pushdecl): Deal with unhiding a hidden decl, use
2116 anticipated_builtin_p.
2117 (do_nonmember_using_decl): Use anticipated_decl_p.
2118 (lookup_name_real_1): Use DECL_HIDDEN_P.
2120 2017-05-23 Jason Merrill <jason@redhat.com>
2122 -Wunused and C++17 structured bindings
2123 * decl.c (poplevel): Don't warn about unused structured bindings,
2124 only real variables.
2125 * error.c (dump_simple_decl): Handle structured bindings.
2126 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
2128 2017-05-23 Nathan Sidwell <nathan@acm.org>
2130 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
2131 * name-lookup.c (create_local_binding): New.
2132 (update_binding): New.
2133 (pushdecl_maybe_friend_1): Rename to ...
2134 (do_pushdecl): ... this. Reimplement.
2136 (push_overloaded_decl_1, push_overloaded_decl): Delete.
2138 2017-05-23 Jason Merrill <jason@redhat.com>
2140 PR c++/80396 - built-in for make_integer_sequence.
2141 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
2142 (expand_integer_pack, expand_builtin_pack_call): New.
2143 (find_parameter_packs_r): Check builtin_pack_call_p.
2144 (check_for_bare_parameter_packs): Handle it.
2145 (tsubst_pack_expansion): Call expand_builtin_pack_call.
2146 (declare_integer_pack): New.
2147 (init_template_processing): Call it.
2148 * decl2.c (mark_used): Check builtin_pack_fn_p.
2150 2017-05-23 Nathan Sidwell <nathan@acm.org>
2152 * name-lookup.c (find_namespace_binding): New.
2153 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
2154 (set_identifier_type_value_with_scope): Use find_namespace_binding.
2155 (find_binding, cp_binding_level_find_binding_for_name,
2156 binding_for_name, namespace_binding_1): Delete.
2157 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
2158 (get_namespace_binding, set_namespace_binding,
2159 finish_namespace_using_decl, unqualified_namespace_lookup_1,
2160 qualified_lookup_using_namespace, lookup_type_scope_1,
2161 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
2164 * parser.c (cp_parser_template_id): Keep the lookup when stashing
2167 * cp-tree.h (DECL_HIDDEN_P): New.
2168 * name-lookup.c (set_decl_context,
2169 set_local_extern_decl_linkage): New, broken out of ...
2170 (pushdecl_maybe_friend_1): ... here. Call them.
2172 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
2174 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
2175 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
2178 2017-05-23 Nathan Sidwell <nathan@acm.org>
2180 * cp-tree.h (OVL_P): New.
2181 * name-lookup.h (push_local_binding): Delete.
2182 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
2183 (finish_namespace_using_decl, finish_local_using_decl): ... here
2184 * name-lookup.c (add_decl_to_level): Swap args.
2185 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
2186 (diagnose_name_conflict): Check contexts are same for redecl.
2187 (update_local_overload): New.
2188 (compparms_for_decl_and_using): Rename to ...
2189 (matching_fn_p): ... here.
2190 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
2191 push_local_bindings call.
2192 (push_local_binding): Make static, replace FLAGS arg with
2194 (validate_nonmember_using_decl): Use OVL_FIRST.
2195 (do_nonmember_using_decl): Use in/out parameters. Use
2196 lkp_iterator and simplify.
2197 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
2198 (finish_namespace_using_decl, finish_local_using_decl): ... here.
2200 (lookup_type_current_level): Delete.
2201 * parser.c (cp_parser_using_declaration): Adjust.
2202 * pt.c (tsubst_expr): Adjust.
2204 2017-05-22 Nathan Sidwell <nathan@acm.org>
2206 * name-lookup.h (parse_using_directive): Replace with ...
2207 (finish_namespace_using_directive): ... this and ...
2208 (finish_local_using_directive): ... this.
2209 * name-lookup.c (add_using_namespace_1): Move later.
2210 (add_using_namespace): Move later, add namespace_p arg, remove
2212 (push_using_directive_1): Directly recurse.
2213 (do_using_directive, parse_using_directive): Delete, split into ...
2214 (finish_namespace_using_directive): ... this and ...
2215 (finish_local_using_directive): ... this.
2216 (push_namespace): Use add_using_namespace.
2217 * parser.c (cp_parser_using_directive): Call
2218 finish_namespace_using_directive or finish_local_using_directive.
2219 * pt.c (tsubst_expr): Call finish_local_using_directive.
2221 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
2222 * cp-tree.h (raw_dump_id): Declare.
2223 * decl2.c (raw_dump_id): Define.
2224 (dump_tu): Use raw_dump_id.
2226 * config-lang.in (gtfiles): Sort list, break lines.
2228 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
2229 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
2230 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
2231 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
2232 CPTI_RETHROW_FN): New.
2233 (noexcept_deferred_spec): New.
2234 (terminate_node, call_unexpected_node): Rename to ...
2235 (terminate_fn, call_unexpected_fn): ... here.
2236 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
2237 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
2238 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
2239 (init_exception_processing): Adjust.
2240 (declare_library_fn): Create and push the fns here.
2241 (do_get_exception_ptr, do_begin_catch, do_end_catch,
2242 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
2243 declare_library_fn use.
2244 (unevaluated_noexcept_spec): Adjust.
2245 * cp-gimplify.c (genericize_eh_spec_block,
2246 gimplify_most_not_throw_expr): Adjust.
2248 * name-lookup.c (pushdecl_top_level,
2249 pushdecl_top_level_and_finish): Move after namespace pushing and
2251 (push_to_top_level): Rename to ...
2252 (do_push_to_top_level): ... here. Remove timing code.
2253 (pop_from_top_level_1): Rename to ...
2254 (do_pop_from_top_level): ... here.
2255 (do_push_nested_namespace, do_pop_nested_namespace)
2256 (push_to_top_level): New wrapper for do_push_to_top_level.
2257 (pop_from_top_level): Adjust.
2258 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
2260 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
2262 * config-lang.in (gtfiles): Add c-family/c-format.c,
2263 except.c, init.c, lambda.c and friend.c.
2264 * class.c (dvirt_fn): Move out of function scope,
2266 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
2267 * init.c (fn): Likewise.
2268 * lambda.c (ptr_id, max_id): Likewise.
2269 * friend.c (global_friend): Add GTY attribute.
2271 2017-05-19 Nathan Sidwell <nathan@acm.org>
2273 * call.c (add_list_candidates): Use OVL_FIRST.
2274 (build_new_method_call_1): Likewise.
2275 * cp-tree.h (OVL_SINGLE_P): New.
2276 (TYPE_HIDDEN_P): New.
2277 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
2278 * dump.c (cp_tump_tree): Adjust overload dumping.
2279 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
2281 * method.c (lazily_declare_fn): Assert we added it.
2282 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
2284 (cp_parser_template_name): Use lkp_iterator.
2285 * pt.c (begin_template_parm_list): Fixup comment.
2286 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
2287 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
2288 (ovl_scope): Use lkp_iterator.
2290 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
2292 * parser.c (cp_parser_omp_clause_default): Handle
2293 "OMP_CLAUSE_DEFAULT_PRESENT".
2295 * parser.c (cp_parser_omp_clause_default): Avoid printing more
2296 than one syntax error message.
2298 2017-05-19 Nathan Sidwell <nathan@acm.org>
2300 * class.c (class_dump_id): Define.
2301 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
2302 * cp-objcp-common.c (cp_register_dumps): New.
2303 * cp-objcp-common.h (cp_register_dumps): Declare.
2304 (LANG_HOOKS_REGISTER_DUMPS): Override.
2305 * cp-tree.h (class_dump_id): Declare.
2307 2017-05-18 Nathan Sidwell <nathan@acm.org>
2309 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
2311 (lookup_keep): Declare.
2312 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
2313 * pt.c (tsubst_copy): Assert lookup is persistent.
2314 * semantics.c (finish_call_expr): Use lkp_iterator, call
2316 * tree.c (ovl_copy): New.
2317 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
2320 * cp-tree.h (OVL_USED): Replace with ...
2321 (OVL_USING_P): ... this.
2322 (ovl_iterator::using_p): Adjust.
2323 * name-lookup.c (push_overloaded_decl_1,
2324 do_nonmember_using_decl): Adjust.
2325 * search.c (lookup_field_r): Adjust.
2326 * tree.c (ovl_insert, ovl_scope): Adjust.
2328 * cp-tree.h (lookup_add): Swap args.
2329 (ovl_cons, build_overload): Delete.
2330 * name-lookup.c (add_function, push_overloaded_decl_1,
2331 do_nonmember_using_decl, merge_functions, remove_hidden_names):
2332 Use lookup_add, ovl_insert.
2333 * pt.c (check_explicit_specialization): Use lookup_add.
2334 (do_class_deduction): Likewise. Refactor if.
2335 * tree.c (lookup_add): Swap args.
2336 (ovl_cons, build_overload): Delete.
2338 * name-lookup.c (find_local_binding): New, broken out of ...
2339 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
2340 (set_namespace_binding): Swap scope & name args.
2341 (namespace_binding_1): Likewise.
2342 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
2343 (push_overloaded_decl_1): Likewise.
2344 (set_global_binding): Likewise.
2345 (get_namespace_binding): Adjust namespace_binding_1 call.
2347 2017-05-17 Nathan Sidwell <nathan@acm.org>
2349 * cp-tree.h (default_hash_traits <lang_identifier *>): New
2351 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
2352 (extern_c_fns): New hash table.
2353 (check_extern_c_conflict): New, broken out of ...
2354 (pushdecl_maybe_friend_1): ... here. Call it.
2355 (c_linkage_bindings): Just look in hash table.
2357 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
2361 Implement new C++ intrinsics __is_assignable and __is_constructible.
2362 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
2364 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
2365 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2366 * method.c (constructible_expr): Set cp_unevaluated.
2367 (is_xible_helper): New.
2368 (is_trivially_xible): Adjust.
2370 * parser.c (cp_parser_primary_expression): Handle
2371 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
2372 (cp_parser_trait_expr): Likewise.
2373 * semantics.c (trait_expr_value): Handle
2374 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2376 2017-05-17 Nathan Sidwell <nathan@acm.org>
2378 * cp-tree.h (ovl_iterator::using_p): New predicate.
2379 (ovl_iterator::remove_node): New worker.
2380 (ovl_insert): Declare.
2381 * tree.c (ovl_insert): New.
2382 (ovl_iterator::remove_node): New.
2383 * class.c (add_method): Use ovl_iterator, ovl_insert.
2384 (clone_function_decl): Fix description.
2385 (clone_constructors_and_destructors): Use ovl_iterator.
2387 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
2388 (maybe_warn_about_overly_private_class): Use ovl_iterator.
2389 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
2390 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
2391 (get_base_fndecls): Use ovl_iterator.
2392 (warn_hidden): Use OVL_NAME, ovl_iterator.
2393 (add_implicitly_declared_members): Use ovl_iterator.
2394 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
2396 (finish_shorthand_constraint): Simplify, use ovl_make.
2397 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
2398 * search.c (shared_member_p): Use ovl_iterator.
2399 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
2400 (lookup_conversion_operator): Use OVL_FIRST.
2401 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
2402 (look_for_overrides_here): Use ovl_iterator.
2403 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
2404 * typeck.c (build_x_unary_op): Use ovl_make.
2406 2017-05-17 Martin Liska <mliska@suse.cz>
2408 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
2409 use it instead of int type.
2410 (dump_vtable): Likewise.
2411 (dump_vtt): Likewise.
2412 * decl2.c (dump_tu): Likewise.
2414 2017-05-16 David Malcolm <dmalcolm@redhat.com>
2416 * call.c (enforce_access): Add access_failure_info * param and use
2417 it to record access failures.
2418 * cp-tree.h (class access_failure_info): New class.
2419 (enforce_access): Add access_failure_info * param, defaulting to
2421 (lookup_member): Likewise.
2422 (locate_field_accessor): New function decl.
2423 (perform_or_defer_access_check): Add access_failure_info * param,
2425 * search.c (lookup_member): Add access_failure_info * param and
2426 pass it on to call to perform_or_defer_access_check.
2427 (matches_code_and_type_p): New function.
2428 (field_access_p): New function.
2429 (direct_accessor_p): New function.
2430 (reference_accessor_p): New function.
2431 (field_accessor_p): New function.
2432 (struct locate_field_data): New struct.
2433 (dfs_locate_field_accessor_pre): New function.
2434 (locate_field_accessor): New function.
2435 * semantics.c (perform_or_defer_access_check): Add
2436 access_failure_info * param, and pass it on to call to
2438 * typeck.c (access_failure_info::record_access_failure): New method.
2439 (access_failure_info::maybe_suggest_accessor): New method.
2440 (finish_class_member_access_expr): Pass an access_failure_info
2441 instance to the lookup_member call, and call its
2442 maybe_suggest_accessor method afterwards.
2444 2017-05-16 Marek Polacek <polacek@redhat.com>
2448 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
2450 2017-05-16 Nathan Sidwell <nathan@acm.org>
2452 * name-lookup.c (check_local_shadow): New, broke out of ...
2453 (pushdecl_maybe_friend_1): ... here. Call it.
2455 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
2456 (ovl_first): Move inline definition to end of file.
2457 (ovl_make, lookup_add): Declare.
2458 (get_fns, get_first_fn): Make pure.
2459 * tree.c (ovl_cache): New.
2460 (ovl_make, lookup_add): New.
2461 * pt.c (do_class_deduction): Don't add candidates that will be
2464 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
2465 (print_error_for_call_failure): Use OVL_NAME.
2466 (build_op_call_1): Use ovl_iterator.
2467 (add_candidates): Use OVL_FIRST & lkp_iterator.
2468 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
2470 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
2471 (type_has_user_nondefault_constructor,
2472 in_class_defaulted_default_constructor,
2473 type_has_user_provided_constructor,
2474 type_has_user_provided_or_explicit_constructor,
2475 type_has_non_user_provided_default_constructor,
2476 vbase_has_user_provided_move_assign,
2477 type_has_move_constructor, type_has_move_assign,
2478 type_has_user_declared_move_constructor,
2479 type_has_user_declared_move_assign,
2480 type_build_ctor_call, type_build_dtor_call,
2481 type_requires_array_cookie, explain_non_literal_class): Likewise.
2482 (finish_struct): Use lkp_iterator.
2483 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
2484 (note_name_declared_in_class): Use OVL_NAME.
2485 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
2486 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
2487 cxx_pretty_printer::expression): Likewise.
2488 * decl2.c (check_classfn): Use ovl_iterator.
2489 * pt.c (retrieve_specialization): Use ovl_iterator.
2490 * tree.c (cp_tree_equal): Use lkp_iterator.
2491 (type_has_nontrivial_copy_init): Use ovl_iterator.
2493 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
2494 check is_overloaded_fn.
2496 2017-05-16 Martin Liska <mliska@suse.cz>
2498 * parser.c (cp_lexer_print_token): Add default value for flags
2499 argument of print_gimple_stmt, print_gimple_expr,
2500 print_generic_stmt and print_generic_expr.
2502 2017-05-16 Nathan Sidwell <nathan@acm.org>
2504 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
2506 (MAYBE_BASELINK_FUNCTIONS): New.
2507 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
2508 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
2509 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
2510 * method.c (inherited_ctor_binfo): Use ovl_iterator.
2511 (binfo_inherited_from): Likewise.
2512 * parser.c (lookup_literal_operator): Use lkp_iterator.
2513 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
2514 (print_candidates_1): Likewise.
2515 (determine_specialization): Likewise.
2516 (resolve_overloaded_unification): Likewise.
2517 (resolve_nondeduced_context): Likewise.
2518 (type_dependent_expression_p): Likewise.
2519 (dependent_template_p): Likewise.
2520 * ptree.c (cxx_print_xnode): Likewise.
2521 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
2522 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
2523 * typeck.c (check_template_keyword): Use lkp_iterator.
2525 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
2527 * constexpr.c (function_concept_check): Use OVL_FIRST.
2528 * cvt.c (build_expr_type_conversion): Likewise.
2529 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
2530 * decl2.c (mark_used): Use OVL_FIRST.
2531 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
2532 (dump_expr, location_of): Use OVL_FIRST.
2533 * friend.c (do_friend): Use OVL_NAME.
2534 * init.c (build_offset_ref): Use OVL_FIRST.
2535 * mangle.c (write_member_name): Likewise.
2536 (write_expression): Use OVL_NAME.
2537 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
2538 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
2539 * pt.c (check_explicit_specialization): Use OVL_FIRST.
2540 (check_template_shadow): Likewise.
2541 (tsubst_template_args): Use OVL_NAME.
2542 (tsubst_baselink): Use OVL_FIRST.
2543 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
2544 * tree.c (get_first_fn): Use OVL_FIRST.
2545 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
2546 (cp_build_addr_expr_1): Use OVL_FIRST.
2548 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
2550 * semantics.c (finish_id_expression): Directly init local var.
2551 (finish_omp_reduction_clause): Use really_overloaded_fn.
2552 * tree.c (get_fns): Document. Assert we got an overload.
2553 (get_first_fn) Document.
2554 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
2555 really_overloaded_fn.
2556 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
2558 * cp-tree.h (SCOPE_DEPTH): New.
2559 * name-lookup.h (is_nested_namespace): Declare.
2560 * name-lookup.c (is_nested_namespace): New.
2561 (is_ancestor): Use it.
2562 (set_decl_namespace): Likewise.
2563 (push_namespace): Set SCOPE_DEPTH.
2564 * pt.c (check_specialization_namespace): Use is_nested_namespace.
2565 (check_unqualigied_spec_or_inst): Likewise.
2567 2017-05-15 Nathan Sidwell <nathan@acm.org>
2570 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
2571 * name-lookup.h (push_namespace): Return int, add make_inline arg.
2572 * name-lookup.c (push_namespace): Deal with inline directly.
2573 Return pushed count.
2574 * parser.c (cp_parser_namespace_definition): Adjust for
2575 push_namespace change.
2577 2017-05-11 Nathan Sidwell <nathan@acm.org>
2579 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
2580 LANG_HOOKS_PUSHDECL): Move to ...
2581 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
2582 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
2583 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
2585 * name-lookup.h (pushdecl): Add default friend parm.
2586 (pushdecl_maybe_friend): Delete.
2587 (pushdecl_top_level): Add default friend parm.
2588 (pushdecl_top_level_maybe_friend): Delete.
2589 * name-lookup.c (pushdecl_maybe_friend): Delete.
2590 (pushdecl): Add is_friend parm.
2591 (pushdecl_top_level): Add is friend_parm.
2592 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
2593 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
2594 * friend.c (do_friend): Adjust.
2595 * pt.c (tsubst_friend_class): Adjust.
2597 Revert pushdecl_top_level_and_finish name change.
2598 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
2599 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
2600 * decl.c (cp_make_fname_decl): Adjust.
2601 * decl2.c (get_guard, handle_tls_init): Adjust.
2602 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
2604 * name-lookup.c (pushdecl_outermost_localscope): Always
2605 conditionally stop timer.
2607 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
2608 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
2610 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
2611 pushtag_top_level_maybe_friend,
2612 pushdecl_top_level_and_finish): Move declarations to ...
2613 * name-lookup.h: ... here. Group pushdecl variants.
2614 (pushdecl_top_level_and_finish): Rename to ...
2615 (pushdecl_top_level_with_init): ... here.
2616 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
2617 * decl2.c (get_guard, handle_tls_init): Likewise.
2618 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
2619 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
2620 * method.c (implicitly_declare_fn): Likewise.
2621 * searchc (node_debug_info_needed): Likewise.
2622 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
2623 (pushdecl_top_level_with_init): ... here.
2624 (pop_everything): Use namespace_bindings_p.
2626 * name-lookup.h (pop_binding): Rename to pop_local_binding.
2627 (getdecls): Rename to get_local_decls.
2628 * name-lookup.c (pop_binding): Rename to ...
2629 (pop_local_binding): ... here.
2630 (pop_bindings_and_leave_scope): Adjust.
2631 (getdecls): Rename to ...
2632 (get_local_decls): ... here. Assert local scope.
2633 * decl.c (poplevel): Assert not namespace. Adjust and simplify
2635 (store_parm_decls): Adjust get_local_decls call.
2636 (parser.c (synthesize_implicit_template_parm): Likewise.
2638 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
2641 * method.c (is_trivially_xible): Reject void types.
2643 2017-05-10 Nathan Sidwell <nathan@acm.org>
2645 * class.c (handle_using_decl): Always use OVL_CURRENT.
2646 (resolve_address_of_overloaded_function): Move iterator decl into
2647 for scope. Don't strip anticipated decls here.
2649 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
2651 (print_candidates): Adjust.
2653 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
2655 * call.c (build_new_function_call): Lose koenig_p arg. Remove
2656 koenig_p handling here.
2657 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
2658 (tsubst_omp_clauses): Likewise.
2659 (do_class_deduction): Adjust buld_new_function_call calls.
2660 * semantics.c (finish_call_expr): Likewise.
2662 2017-05-10 Jason Merrill <jason@redhat.com>
2664 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
2665 (unify_type_mismatch, unify_parameter_pack_mismatch)
2666 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
2667 (unify_parameter_pack_inconsistent, unify_inconsistency)
2668 (unify_vla_arg, unify_method_type_error, unify_arity)
2669 (unify_arg_conversion, unify_no_common_base)
2670 (unify_inconsistent_template_template_parameters)
2671 (unify_template_deduction_failure)
2672 (unify_template_argument_mismatch)
2673 (unify_overload_resolution_failure): Call unify_invalid.
2675 CWG 1847 - Clarifying compatibility during partial ordering
2676 * pt.c (more_specialized_fn): No order between two non-deducible
2679 * pt.c (dependent_type_p): Make sure we aren't called with
2682 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2683 * pt.c (convert_template_argument): Just return an argument pack.
2684 (coerce_template_parameter_pack, template_parm_to_arg)
2685 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
2686 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
2687 Don't set the type of a NONTYPE_ARGUMENT_PACK.
2688 * parser.c (make_char_string_pack, make_string_pack): Likewise.
2690 2017-05-10 Nathan Sidwell <nathan@acm.org>
2692 * cp-tree.h (add_method, clone_function_decl): Change last arg to
2694 * class.c (add_method): Change third arg to bool. Adjust.
2695 (one_inheriting_sig, one_inherited_ctor): Adjust.
2696 (clone_function_decl): Change 2nd arg to bool. Adjust.
2697 (clone_constructors_and_destructors): Adjust.
2698 * lambda.c (maybe_add_lambda_conv_op): Adjust.
2699 * method.c (lazily_declare_fn): Adjust.
2700 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
2701 * semantics.c (finish_member_declaration): Adjust.
2703 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
2706 * decl.c (finish_function): To improve error recovery, change the
2707 logic for calling apply_deduced_return_type.
2709 2017-05-09 Jason Merrill <jason@redhat.com>
2711 PR c++/80605 - __is_standard_layout and empty base
2712 * class.c (check_bases): Ignore empty bases.
2714 PR c++/70979 - literal class and closure types
2715 * class.c (finalize_literal_type_property): Handle closures
2717 (explain_non_literal_class): Likewise.
2719 PR c++/66297, DR 1684 - literal class and constexpr member fns
2720 * constexpr.c (is_valid_constexpr_fn): Only complain about
2721 non-literal enclosing class in C++11.
2722 * class.c (finalize_literal_type_property): Likewise.
2724 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
2727 * pt.c (tsubst_decl): Early return error_mark_node if
2728 grok_ctor_properties returns false.
2730 2017-05-09 Jason Merrill <jason@redhat.com>
2732 PR c++/70167 - array prvalue treated as lvalue
2733 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
2735 * semantics.c (finish_compound_literal): Add fcl_context parameter.
2736 Only make a static variable for C99 syntax.
2737 * parser.c (cp_parser_postfix_expression): Pass it.
2738 * pt.c (tsubst_copy_and_build): Likewise.
2739 * call.c (extend_ref_init_temps): Set
2740 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2742 2017-05-09 Nathan Sidwell <nathan@acm.org>
2744 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
2745 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
2746 * name-lookup.h (pushdecl_top_level): Declare.
2748 2017-05-08 Jason Merrill <jason@redhat.com>
2750 PR c++/80178 - parameter passing for uncopyable classes
2751 * tree.c (type_has_nontrivial_copy_init): True for classes with only
2752 deleted copy/move ctors.
2753 (remember_deleted_copy, maybe_warn_parm_abi): New.
2754 * decl.c (require_complete_types_for_parms, check_function_type):
2755 Call maybe_warn_parm_abi.
2756 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
2758 2017-05-08 Nathan Sidwell <nathan@acm.org>
2760 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
2761 (start_preparsed_function): Do decl pushing before setting
2762 current_funciton_decl and announcing it.
2764 * name-lookup.h (pushdecl_with_scope): Replace with ...
2765 (pushdecl_outermost_localscope): ... this.
2766 * name-lookup.c (pushdecl_with_scope): Replace with ...
2767 (pushdecl_outermost_localscope): ... this.
2768 (pushdecl_namespace_level): Adjust.
2769 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
2770 * lambda.c (insert_capture_proxy): Likewise.
2772 * class.c (build_vtbl_initializer): Don't shadow outer variable
2775 Revert _binding -> _value change.
2776 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
2777 (get_namespace_binding, set_global_binding): ... these.
2778 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
2779 (get_namespace_binding, set_global_binding): ... these.
2780 (arg_assoc_namespace, pushdecl_maybe_friend_1,
2781 check_for_out_of_scope_variable, push_overloaded_decl_1,
2782 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
2783 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
2784 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
2785 * decl.c (poplevel): Adjust.
2786 * pt.c (make_constrained_auto): Likewise.
2788 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
2790 PR translation/80280
2791 * call.c (print_z_candidate): Fix quoting.
2793 2017-05-05 David Malcolm <dmalcolm@redhat.com>
2795 * error.c (pedwarn_cxx98): Replace report_diagnostic
2796 with diagnostic_report_diagnostic.
2798 2017-05-05 Nathan Sidwell <nathan@acm.org>
2800 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
2801 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
2802 (IDENTIFIER_NAMESPACE_VALUE): Delete.
2803 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
2805 (get_namespace_value, set_global_value): ... these.
2806 (get_global_value_if_present, is_typename_at_global_scope): Delete.
2807 * decl.c (poplevel): Use get_namespace_value.
2808 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
2809 * class.c (build_vtbl_initializer): Stash library decl in
2810 static var. Use IDENTIFIER_GLOBAL_VALUE.
2811 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
2812 do_allocate_exception, do_free_exception, build_throw): Likewise.
2813 * init.c (throw_bad_array_new_length): Likewise.
2814 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
2815 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
2816 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
2817 get_namespace_value.
2818 (set_namespace_binding_1): Rename to
2819 (set_namespace_binding): ... here.
2820 (set_global_value): New.
2821 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
2822 get_namespace_value.
2823 * pt.c (listify): Use get_namespace_value.
2825 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
2827 * lex.c (unqualified_name_lookup_error): Likewise.
2829 * class.c (alter_class): Use retrofit_lang_decl directly.
2830 * decl.c (push_local_name, dupliate_decls): Likewise.
2831 * semantics.c (omp_privatize_field): Likewise.
2833 Kill walk_namespaces.
2834 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
2835 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
2837 Kill per-namespace static_decls.
2838 * cp-tree.h (static_decls): Declare.
2839 (wrapup_globals_for_namespace,
2840 diagnose_inline_vars_for_namespace): Replace with ...
2841 (wrapup_namespace_globals): ... this.
2842 * decl.c (static_decls): Define.
2843 (wrapup_globals_for_namespace,
2844 diagnose_inline_vars_for_namespace): Replace with ...
2845 (wrapup_namespace_globals): ... this.
2846 (cxx_init_decl_processing): Initialize static_decls.
2847 * decl2.c (c_parse_final_cleanups): Adjust.
2848 * name-lookup.h (cp_binding_level): Remove static_decls member.
2849 * name-lookup.c (add_decl_to_level): Adjust.
2850 (begin_scope): Adjust.
2852 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
2855 * decl.c (reshape_init): Unconditionally return error_mark_node
2856 upon error about too many initializers.
2858 2017-05-04 Nathan Sidwell <nathan@acm.org>
2860 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
2862 2017-05-04 Martin Sebor <msebor@redhat.com>
2864 PR translation/80280
2865 * call.c (print_z_candidate): Add missing quoting to %D and other
2867 (build_op_call_1): Same.
2868 * constraint.cc (diagnose_check_constraint): Same.
2869 * mangle.c (mangle_decl): Same.
2870 * name-lookup.c (cp_binding_level_debug): Same.
2871 (set_decl_namespace): Same.
2872 * parser.c (cp_parser_tx_qualifier_opt): Same.
2873 * pt.c (print_candidates_1): Same.
2874 (check_template_variable): Same.
2875 (tsubst_default_argument): Same.
2876 (most_specialized_partial_spec): Same.
2877 * semantics.c (omp_reduction_lookup): Same.
2878 * tree.c (check_abi_tag_redeclaration): Same.
2879 * typeck.c (comptypes): Same.
2880 * typeck2.c (abstract_virtuals_error_sfinae): Same.
2882 2017-05-04 Nathan Sidwell <nathan@acm.org>
2885 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
2886 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
2887 CPTI_INIT_LIST_IDENTIFIER.
2888 (global_namespace, global_type_node, global_identifier,
2889 anon_identifier, init_list_identifier): New.
2890 * decl.c (global_type_node, global_scope_name): Delete.
2891 (initialize_predefined_identifiers): Add new identifiers.
2892 (cxx_init_decl_processing): Adjust.
2893 * name-lookup.h (global_namespace, global_type_node): Delete.
2894 * name-lookup.c (global_namespace, anonymous_namespace_name,
2895 get_anonymous_namespace_name): Delete.
2896 (namespace_scope_ht_size, begin_scope, pushtag_1,
2897 push_namespace): Adjust,
2898 * call.c (type_has_extended_temps): Use init_list_identifier.
2899 * pt.c (listify): Likewise.
2901 * name-lookup.c: Reorder functions to make merging from modules
2904 2017-05-03 Jason Merrill <jason@redhat.com>
2906 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
2908 2017-05-03 Nathan Sidwell <nathan@acm.org>
2910 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
2911 along with #defines, to before name-lookup include.
2913 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
2915 * pt.c (is_auto_or_concept): Remove.
2916 (type_uses_auto_or_concept): Remove, unused.
2917 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
2918 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
2919 * cp-tree.h (is_auto_or_concept): Remove.
2921 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
2924 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
2925 add pedigree operation and detach call here.
2926 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
2927 cilk_cp_gimplify_call_params_in_spawned_fn.
2928 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
2929 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
2931 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
2933 * parser.c (cp_parser_member_declaration): Add fix-it hints for
2934 stray comma and missing semicolon at end of member declaration.
2936 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
2938 * parser.c (cp_parser_cast_expression): Add target type of cast to
2940 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
2942 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
2944 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
2945 return type to bool.
2946 * cp-tree.h (grok_ctor_properties): Update.
2948 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
2950 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
2951 information to diagnostic of invalid colon in nested-name-specifier.
2953 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
2955 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
2956 diagnostic of invalid class/struct keyword after enum.
2958 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2960 * parser.c (cp_parser_member_declaration): Add fix-it hint
2961 for removing stray semicolons.
2963 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2965 * name-lookup.c (get_std_name_hint): New function.
2966 (maybe_suggest_missing_header): New function.
2967 (suggest_alternative_in_explicit_scope): Call
2968 maybe_suggest_missing_header.
2970 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2973 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
2974 candidate type of bm from tree to const char *.
2975 (consider_binding_level): Likewise.
2976 (lookup_name_fuzzy): Likewise, using this to merge the best
2977 result from the preprocessor into bm, rather than immediately
2978 returning, so that better matches from reserved words can "win".
2979 Guard the rejection of keywords that don't start decl-specifiers
2980 so it only happens for FUZZY_LOOKUP_TYPENAME.
2982 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
2984 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
2985 (start_enum): Likewise.
2986 (build_enumerator): Likewise. Use %qE instead of plain %E.
2987 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
2988 %<%D%> in diagnostics.
2989 (cp_parser_elaborated_type_specifier): Likewise.
2990 * pt.c (make_pack_expansion): Use %qT and %qE instead of
2991 %<%T%> and %<%E%> in diagnostics.
2992 (tsubst_pack_expansion): Likewise.
2994 2017-04-24 David Malcolm <dmalcolm@redhat.com>
2997 * parser.c (cp_parser_unary_expression): Generate a location
2998 range for alignof and sizeof expressions.
3000 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
3002 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
3004 (cp_parser_virt_specifier_seq_opt): Likewise.
3005 (set_and_check_decl_spec_loc): Likewise twice.
3007 2017-04-21 Jason Merrill <jason@redhat.com>
3009 PR c++/80179 - ICE with initialized flexible array member.
3010 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
3012 2017-04-21 Richard Biener <rguenther@suse.de>
3014 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
3015 (copy_type): Likewise.
3016 * lex.c (copy_decl): Pass down mem-stat info.
3017 (copy_type): Likewise.
3019 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
3022 * init.c (build_new_1): Suppress notes about over-aligned new when
3023 the warning is suppressed.
3025 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
3027 * parser.c (cp_parser_member_declaration): Add warning with fixit
3028 information for extra semicolon after in-class function definition.
3030 2017-04-20 Jakub Jelinek <jakub@redhat.com>
3033 * tree.c (build_cplus_array_type): Call build_array_type
3034 with the intended TYPE_TYPELESS_STORAGE flag value, instead
3035 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
3038 2017-04-18 Marek Polacek <polacek@redhat.com>
3040 PR c++/80244 - ICE with attribute in template alias.
3041 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
3043 PR c++/80241 - ICE with alignas pack expansion.
3044 * error.c (dump_expr): Handle TREE_LIST.
3045 * parser.c (cp_parser_std_attribute_list): Return error_mark if
3046 make_pack_expansion returns an error.
3048 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
3051 * class.c (fixup_may_alias): Fix all type variants.
3053 2017-04-17 Jason Merrill <jason@redhat.com>
3055 PR c++/80415 - wrong error with default arg and array reference.
3056 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
3058 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
3060 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
3062 * decl.c (name_unnamed_type): Split out of...
3063 (grokdeclarator): ... this.
3064 * decl.h (name_unnamed_type): Declare.
3066 2017-04-12 Richard Biener <rguenther@suse.de>
3067 Bernd Edlinger <bernd.edlinger@hotmail.de>
3070 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
3071 for arrays of character or std::byte type.
3073 2017-04-11 Jason Merrill <jason@redhat.com>
3075 PR c++/80294 - ICE with constexpr and inheritance.
3076 * constexpr.c (reduced_constant_expression_p):
3077 A null constructor element is non-constant.
3078 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
3079 returning an empty base.
3081 2017-04-11 Jakub Jelinek <jakub@redhat.com>
3084 * decl.c (cp_finish_decomp): If processing_template_decl on
3085 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
3086 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
3087 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
3089 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
3090 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
3093 2017-04-11 Jakub Jelinek <jakub@redhat.com>
3096 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
3098 2017-04-10 Jakub Jelinek <jakub@redhat.com>
3101 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
3102 operand, if it is a static member function, recurse on the
3105 2017-04-10 Marek Polacek <polacek@redhat.com>
3108 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
3109 ORIG_TYPE earlier and not only when shortening.
3111 2017-04-07 Jason Merrill <jason@redhat.com>
3113 PR c++/80356 - ICE with reference to function template argument.
3115 * pt.c (convert_nontype_argument_function): Adjust type even with a
3116 value-dependent argument.
3118 PR c++/80267 - ICE with nested capture of reference
3120 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
3122 2017-04-07 Marek Polacek <polacek@redhat.com>
3125 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
3128 * call.c (build_over_call): Don't check cxx_dialect.
3129 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
3130 whether SUB is a CONSTRUCTOR.
3131 * init.c (build_new_1): Don't check cxx_dialect.
3132 * tree.c (replace_placeholders): Add a function comment. Return if
3133 not in C++14, or if the object isn't a (member of a) class.
3134 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
3135 TYPE is CLASS_TYPE_P.
3137 2017-04-05 Jakub Jelinek <jakub@redhat.com>
3140 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
3141 of a loop doing vec_safe_push of NULL. Formatting fixes.
3142 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
3143 to newidx before calling canonical_type_parameter on newtype.
3145 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
3148 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
3149 UNARY_PLUS_EXPR case.
3151 2017-04-03 Jason Merrill <jason@redhat.com>
3153 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
3155 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
3157 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
3158 * decl2.c (one_static_initialization_or_destruction): Likewise.
3159 * name-lookup.c (store_bindings): Likewise.
3160 * parser.c (make_call_declarator): Likewise.
3161 * pt.c (check_explicit_specialization): Likewise.
3163 2017-04-03 Jason Merrill <jason@redhat.com>
3165 PR sanitizer/79993 - ICE with VLA initialization from string
3166 PR c++/69487 - wrong VLA initialization from string
3167 * init.c (finish_length_check): Split out from build_vec_init.
3168 (build_vec_init): Handle STRING_CST.
3169 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
3170 (digest_init_r): Don't give a STRING_CST VLA type.
3172 2017-03-31 Jakub Jelinek <jakub@redhat.com>
3175 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
3176 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
3177 for NOP_EXPR to REFERENCE_TYPE.
3180 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
3181 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3183 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
3184 Remove extraneous parens.
3185 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
3186 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
3187 (cp_parser_trait_expr): Likewise.
3189 2017-03-27 Jakub Jelinek <jakub@redhat.com>
3192 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
3193 * typeck.c (cxx_mark_addressable): Likewise. Look through
3194 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
3196 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
3198 2017-03-24 Jason Merrill <jason@redhat.com>
3200 PR c++/77339 - ICE with invalid use of alias template.
3201 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
3204 2017-03-24 Marek Polacek <polacek@redhat.com>
3207 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
3208 doesn't have side effects.
3210 2017-03-23 Jason Merrill <jason@redhat.com>
3212 PR c++/80150 - ICE with overloaded variadic deduction.
3213 * pt.c (try_one_overload): Remove asserts.
3215 PR c++/77563 - missing ambiguous conversion error.
3216 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
3218 2017-03-23 Marek Polacek <polacek@redhat.com>
3220 * cp-tree.h: Remove a C_RID_YYCODE reference.
3222 2017-03-22 Jakub Jelinek <jakub@redhat.com>
3225 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
3226 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
3227 processing_template_decl.
3229 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
3232 * name-lookup.c (pushtag_1): Add check for bogus, non template,
3233 std::initializer_list.
3235 2017-03-21 Jakub Jelinek <jakub@redhat.com>
3238 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
3240 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
3243 * init.c (std_placement_new_fn_p): New.
3244 (build_new_1): Call it.
3246 2017-03-20 Jason Merrill <jason@redhat.com>
3248 PR c++/80096 - ICE with C++17 non-type auto.
3249 * pt.c (tsubst): Delay tsubst of type of template non-type
3252 PR c++/79519 - ICE with deleted template friend.
3253 * decl.c (grokdeclarator): Complain about misplaced function
3254 definition using =, as well.
3256 PR c++/79640 - infinite recursion with generic lambda.
3257 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
3258 before substituting its initializer.
3260 2017-03-20 Marek Polacek <polacek@redhat.com>
3261 Paolo Carlini <paolo.carlini@oracle.com>
3263 PR c++/80059 - ICE with noexcept and __transaction_atomic
3264 * except.c (build_must_not_throw_expr): Call
3265 instantiate_non_dependent_expr.
3267 2017-03-19 Jason Merrill <jason@redhat.com>
3269 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
3270 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
3271 reference decomposition.
3273 PR c++/80077 - error with constexpr and -fno-elide-constructors.
3274 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
3275 expanding trivial constructor.
3277 2017-03-17 Jason Merrill <jason@redhat.com>
3279 PR c++/78345 - ICE initializing array from lambda.
3280 * init.c (build_aggr_init): Check array initializer.
3281 (build_vec_init): Check the type of a CONSTRUCTOR.
3283 PR c++/80073 - C++17 ICE with virtual base.
3284 * decl.c (xref_basetypes): Also check for indirect vbases.
3286 2017-03-16 Jason Merrill <jason@redhat.com>
3288 * decl.c (start_enum): std::byte aliases anything.
3291 * constexpr.c (lookup_placeholder): Tweak.
3293 2017-03-15 Jason Merrill <jason@redhat.com>
3295 PR c++/80043 - ICE with -fpermissive
3296 * typeck.c (convert_for_assignment): Handle instantiate_type
3297 not giving an error.
3299 2017-03-14 Nathan Sidwell <nathan@acm.org>
3301 PR c++/79393 DR 1658 workaround
3302 * method.c (synthesized_method_base_walk): Inihibit abstract class
3303 virtual base access check here.
3304 (synthesized_method_walk): Not here.
3306 2017-03-13 Nathan Sidwell <nathan@acm.org>
3308 PR c++/79393 DR 1658 workaround
3309 * method.c (synthesized_method_walk): Check vbases of abstract
3310 classes for dtor walk.
3312 2017-03-10 David Malcolm <dmalcolm@redhat.com>
3314 PR translation/79848
3315 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
3317 2017-03-10 Jason Merrill <jason@redhat.com>
3319 PR c++/79960 - alias templates and partial ordering
3320 * pt.c (comp_template_args): Add partial_order parm.
3321 (template_args_equal): Likewise.
3322 (comp_template_args_porder): New.
3323 (get_partial_spec_bindings): Use it.
3325 2017-03-10 Marek Polacek <polacek@redhat.com>
3328 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
3330 2017-03-10 Jakub Jelinek <jakub@redhat.com>
3333 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
3334 Use XALLOCAVEC macro.
3337 * decl.c (finish_enum_value_list): If value is error_mark_node,
3338 don't copy it and change its type.
3339 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
3340 of CONST_DECL is error_mark_node.
3342 2017-03-09 Marek Polacek <polacek@redhat.com>
3344 PR c++/79900 - ICE in strip_typedefs
3345 * tree.c (strip_typedefs): Skip the attribute handling if T is
3346 a variant type which hasn't been updated yet.
3348 PR c++/79687 - wrong code with pointer-to-member
3349 * init.c (constant_value_1): Break if the variable has a dynamic
3352 2017-03-08 Jason Merrill <jason@redhat.com>
3354 PR c++/79797 - ICE with self-reference in array DMI.
3355 * constexpr.c (lookup_placeholder): Split out...
3356 (cxx_eval_constant_expression): ...from here.
3358 2017-03-07 Jakub Jelinek <jakub@redhat.com>
3361 * parser.c (cp_parser_omp_cancellation_point,
3362 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
3363 cp_parser_omp_target_update): Change "may only be used in compound
3364 statements" diagnostics, such that the same translatable string is
3365 used for all pragmas.
3366 (cp_parser_pragma): Likewise. Use error_at instead of
3367 cp_parser_error for that diagnostics.
3369 2017-03-06 Marek Polacek <polacek@redhat.com>
3371 PR c++/79796 - ICE with NSDMI and this pointer
3372 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
3373 replace_placeholders.
3375 2017-03-06 Jakub Jelinek <jakub@redhat.com>
3378 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
3381 2017-03-06 Jason Merrill <jason@redhat.com>
3383 Revert "Allow deduction guides to look into primary template."
3384 * cp-tree.h, parser.c, pt.c, search.c: Revert.
3386 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
3389 * except.c (build_must_not_throw_expr): Perform the implicit
3390 conversions on the condition.
3392 2017-03-03 Jason Merrill <jason@redhat.com>
3394 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
3397 Core issues 2273 and 2277
3398 * call.c (joust): Adjust using-declaration tiebreaker to handle
3399 the intermediate base case.
3400 * method.c (strip_inheriting_ctors): Just return the argument if
3401 !flag_new_inheriting_ctors.
3403 2017-03-03 Richard Biener <rguenther@suse.de>
3406 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
3408 2017-03-03 Marek Polacek <polacek@redhat.com>
3411 * typeck.c (string_conv_p): In C++11, always call pedwarn with
3414 2017-03-02 Jason Merrill <jason@redhat.com>
3416 Update overload resolution with deduction guides.
3417 * pt.c (do_class_deduction): Always build the copy guide.
3418 (copy_guide_p, template_guide_p): New.
3419 (build_deduction_guide): Remember the original constructor.
3420 * call.c (joust): Prefer the copy guide and non-template guides.
3422 Allow deduction guides to look into primary template.
3423 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
3424 (struct cp_decl_specifier_seq): Add constructor_p.
3425 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
3426 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
3427 Clear deduction_guide_type. Don't handle deduction guide names.
3428 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
3429 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
3430 (cp_parser_member_declaration, cp_parser_cache_defarg)
3431 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
3432 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
3433 (build_deduction_guide): Set deduction_guide_type.
3434 (dependent_scope_p): Check deduction_guide_type.
3435 * search.c (lookup_member): Likewise.
3437 2017-03-02 Jakub Jelinek <jakub@redhat.com>
3440 * init.c (mark_exp_read_r): New function.
3441 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
3442 whole arguments instead of plain mark_exp_read on TREE_LIST values.
3444 2017-03-01 Jason Merrill <jason@redhat.com>
3446 Class template argument deduction in new-expression
3447 * init.c (build_new): Handle deduction from no initializer.
3448 * parser.c (cp_parser_new_expression): Don't require a single
3449 expression for class template deduction.
3450 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
3451 class template placeholder.
3452 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
3453 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
3454 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
3456 2017-03-01 Jakub Jelinek <jakub@redhat.com>
3459 * init.c (emit_mem_initializers): When not constructing vbases of
3460 abstract classes, mark arguments as read for
3461 -Wunused-but-set-parameter.
3463 2017-02-28 Jason Merrill <jason@redhat.com>
3465 Class template argument deduction refinements
3466 * call.c (joust): Move deduction guide tiebreaker down.
3467 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
3468 deduction with no initializer.
3469 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
3470 (do_class_deduction): Use that rather than special case.
3471 (do_auto_deduction): Handle null initializer.
3473 2017-02-28 Jakub Jelinek <jakub@redhat.com>
3475 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
3476 instead of just cond ? "..." : "...".
3477 (grokdeclarator): Likewise.
3478 (build_enumerator): Likewise.
3479 * init.c (build_new_1): Likewise.
3480 * call.c (build_new_method_call_1): Likewise.
3481 * parser.c: Include intl.h.
3482 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
3483 "enter"/"exit" keyword.
3484 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
3487 2017-02-27 Jason Merrill <jason@redhat.com>
3489 PR c++/71568 - SFINAE forming pointer to member function
3490 * init.c (build_offset_ref): Check the return value of
3491 perform_or_defer_access_check.
3493 2017-02-27 Marek Polacek <polacek@redhat.com>
3495 * decl.c (expand_static_init): Add missing } in a comment.
3497 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
3499 * init.c: Include intl.h.
3500 (build_new_1): Move message strings into pedwarn to make them
3501 -Wformat-security friendly. Mark string for translation.
3502 * pt.c (tsubst_copy_and_build): Mark string for translation.
3503 Make the pointer const.
3504 * semantics.c (finish_id_expression): Mark strings for translation.
3506 2017-02-25 Jakub Jelinek <jakub@redhat.com>
3508 * call.c (build_op_delete_call): Make msg1 and msg2 const.
3510 2017-02-24 Jakub Jelinek <jakub@redhat.com>
3513 * call.c (build_over_call): Call check_function_arguments even for
3514 -Wrestrict, adjust check_function_arguments caller.
3515 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
3517 * typeck.c (cp_build_function_call_vec): Adjust
3518 check_function_arguments caller.
3520 2017-02-24 Marek Polacek <polacek@redhat.com>
3522 PR translation/79705
3523 * decl.c (check_redeclaration_exception_specification): Mark a string
3524 for translation. Make the pointer const.
3526 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
3529 * pt.c (register_specialization): Check duplicate_decls return value
3530 for error_mark_node and pass it back.
3532 2017-02-22 Jason Merrill <jason@redhat.com>
3534 PR c++/79679 - missing destructor for argument
3535 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
3538 * pt.c (do_class_deduction): Handle 0 argument case.
3540 2017-02-22 Jakub Jelinek <jakub@redhat.com>
3543 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
3544 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
3545 * constexpr.c (potential_constant_expression_1): Handle
3546 OMP_*, OACC_* and CILK_* trees. Use error_at with
3547 EXPR_LOC_OR_LOC (t, input_location) computed early
3548 instead of error, or error_at with location_of (t).
3550 2017-02-22 Marek Polacek <polacek@redhat.com>
3553 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
3554 if the alignas expression is erroneous.
3555 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
3559 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
3561 2017-02-21 Jason Merrill <jason@redhat.com>
3563 PR c++/50308 - wrong deprecated warning with ADL
3564 PR c++/17729 - duplicate deprecated warning
3565 * semantics.c (finish_id_expression): Only call mark_used on a
3566 function if we aren't building a call.
3568 PR c++/41727 - ICE with partial spec of partial instantiation
3569 * pt.c (process_partial_specialization): For now, don't check more
3570 specialized if there is more than one level of args.
3572 2017-02-21 Marek Polacek <polacek@redhat.com>
3575 * cp-tree.h (maybe_reject_flexarray_init): Declare.
3576 * init.c (maybe_reject_flexarray_init): No longer static.
3577 Add check for current_function_decl.
3578 * parser.c (cp_parser_late_parse_one_default_arg): Reject
3579 a default mem-initializer for a flexible array.
3581 2017-02-21 Jakub Jelinek <jakub@redhat.com>
3582 Paolo Carlini <paolo.carlini@oracle.com>
3585 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
3587 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
3588 decl after the decomposition artificial decl has error_mark_node.
3589 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
3590 instead of just == error_mark_node comparison.
3592 2017-02-21 Jakub Jelinek <jakub@redhat.com>
3595 * decl.c: Include gimplify.h.
3596 (cp_finish_decomp): Make sure there is no sharing of trees
3597 in between DECL_VALUE_EXPR of decomposition decls.
3600 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
3603 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
3604 call cplus_expand_constant on it first.
3606 2017-02-19 Jason Merrill <jason@redhat.com>
3608 PR c++/78139 - destructor needed by new-expression
3609 * call.c (build_special_member_call): Use tf_no_cleanup.
3611 PR c++/78282 - auto template and pack expansion
3612 * pt.c (find_parameter_packs_r): Don't walk into the type of
3613 templates other than template template-parameters.
3615 PR c++/79606 - ICE with this->base_member in NSDMI
3616 * class.c (build_base_path): Check processing_template_decl.
3618 PR c++/79607 - ICE with T{} initializer
3619 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
3621 PR c++/79566 - elaborated-type-specifier in range for
3622 * parser.c (cp_parser_simple_declaration): Fix check for type
3625 PR c++/79400 - confusing suggestion of 'noexcept'
3626 * parser.c (cp_parser_exception_specification_opt): Remove
3627 suggestion for deprecated dynamic exception-specification.
3629 PR c++/79470 - partial ordering with reference parameters
3630 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
3632 PR c++/79500 - ICE with non-template deduction guide
3633 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
3634 DECL_TEMPLATE_RESULT.
3636 PR c++/79580 - ICE with compound literal
3637 * parser.c (cp_parser_class_head): If we're in the middle of an
3638 expression, use ts_within_enclosing_non_class.
3640 PR c++/79503 - inherited ctor taking base class
3641 * call.c (add_function_candidate): Also check that
3642 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
3644 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
3647 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
3650 2017-02-19 Eric Fiselier <eric@efcs.ca>
3651 Jonathan Wakely <jwakely@redhat.com>
3654 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
3655 control warning about literal suffix identifiers without a leading
3658 2017-02-17 Jason Merrill <jason@redhat.com>
3660 PR c++/79508 - lookup error with member template
3661 * parser.c (cp_parser_template_name): Clear
3662 parser->context->object_type if we aren't doing lookup.
3664 PR c++/78690 - ICE with using and global type with same name
3665 * pt.c (type_dependent_object_expression_p): True for
3668 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3669 * pt.c (convert_template_argument): Just return an auto arg pack.
3670 (tsubst_template_args): Don't tsubst an auto pack type.
3672 PR c++/79556 - C++17 ICE with non-type auto
3673 * pt.c (do_auto_deduction): Don't try to deduce from null type.
3675 PR c++/79533 - C++17 ICE with temporary cast to reference
3676 * call.c (build_over_call): Conversion to a reference prevents copy
3679 2017-02-16 Jakub Jelinek <jakub@redhat.com>
3680 Jason Merrill <jason@redhat.com>
3682 PR c++/79502 - lost nodiscard attribute
3683 * pt.c (apply_late_template_attributes): Do apply non-dependent
3684 attributes to types.
3686 2017-02-16 Jason Merrill <jason@redhat.com>
3688 PR c++/78572 - ICE with self-modifying array initializer
3689 * constexpr.c (cxx_eval_store_expression): The object we're
3690 initializing is outside the constant-expression.
3691 (cxx_eval_call_expression): Set ctx->call.
3693 PR c++/79050 - ICE with undeduced auto and LTO
3694 * decl.c (poplevel): Remove undeduced auto decls.
3696 2017-02-16 Jakub Jelinek <jakub@redhat.com>
3699 * parser.c (cp_parser_omp_target): For -fopenmp-simd
3700 ignore #pragma omp target even when not followed by identifier.
3702 2017-02-15 Jason Merrill <jason@redhat.com>
3703 Jakub Jelinek <jakub@redhat.com>
3705 PR c++/79464 - ICE in IPA with omitted constructor parms
3706 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
3707 (adjust_clone_args): Adjust.
3708 (add_method): Remember omitted parms.
3709 * call.c (add_function_candidate): Likewise.
3710 * mangle.c (write_method_parms): Likewise.
3711 * method.c (ctor_omit_inherited_parms): Return false if there are no
3714 2017-02-15 Martin Sebor <msebor@redhat.com>
3717 * init.c (maybe_reject_flexarray_init): New function.
3718 (perform_member_init): Call it.
3720 2017-02-15 Jakub Jelinek <jakub@redhat.com>
3723 * parser.c (cp_parser_std_attribute): Don't pedwarn about
3724 [[deprecated]] with -std=c++11 and [[fallthrough]] with
3725 -std=c++11 and -std=c++14.
3728 * decl.c (grokdeclarator): For static data members, handle thread_p
3729 only after handling inline.
3731 2017-02-14 Marek Polacek <polacek@redhat.com>
3735 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
3736 clobbering if the postfix expression isn't an EXPR_P.
3738 2017-02-13 Jason Merrill <jason@redhat.com>
3740 PR c++/79461 - ICE with lambda in constexpr constructor
3741 * constexpr.c (build_data_member_initialization): Ignore
3742 initialization of a local variable.
3744 2017-02-13 Jakub Jelinek <jakub@redhat.com>
3746 * init.c (warn_placement_new_too_small): Add missing space in
3748 * parser.c (cp_parser_oacc_declare): Likewise.
3749 * mangle.c (maybe_check_abi_tags): Likewise.
3752 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
3753 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
3754 in the rightmost operand.
3756 2017-02-13 Nathan Sidwell <nathan@acm.org>
3758 PR c++/79296 - ICE mangling localized template instantiation
3759 * decl2.c (determine_visibility): Use template fn context for
3760 local class instantiations.
3762 2017-02-11 Jason Merrill <jason@redhat.com>
3764 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
3765 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
3766 (build_new_1): Use replace_placeholders.
3767 * tree.c (replace_placeholders_t): Also track whether we've seen a
3769 (replace_placeholders, replace_placeholders_r): Adjust.
3770 * cp-tree.h: Adjust.
3772 PR c++/77790 - ICE with auto function in C++11 mode
3773 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
3774 (require_deduced_type): Add complain parm, return bool.
3775 * cp-tree.h: Adjust.
3776 * decl2.c (mark_used): Use require_deduced_type.
3778 2017-02-10 Jason Merrill <jason@redhat.com>
3780 PR c++/78908 - template ops and bitfields
3781 * tree.c (build_min_non_dep): Use unlowered_expr_type.
3783 PR c++/78897 - constexpr union
3784 * constexpr.c (cxx_eval_store_expression): A store to a union member
3785 erases a previous store to another member.
3787 PR c++/71285 - member of fold-expression
3788 * semantics.c (finish_unary_fold_expr)
3789 (finish_binary_fold_expr): Use null type for fold-expressions.
3791 PR c++/79401 - protected inherited constructor
3792 * call.c (enforce_access): For inheriting constructor, find a base
3793 binfo in the path we already have.
3795 2017-02-10 Marek Polacek <polacek@redhat.com>
3798 * pt.c (type_dependent_expression_p): Check if the expression type
3802 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
3803 if warnings shouldn't be given.
3805 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
3808 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
3809 an error_mark_node as type.
3811 2017-02-09 Jakub Jelinek <jakub@redhat.com>
3812 Jason Merrill <jason@redhat.com>
3815 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
3816 from pattern to type.
3818 2017-02-09 Jason Merrill <jason@redhat.com>
3820 PR c++/79316 - default argument in deduction guide
3821 PR c++/79350 - explicit deduction guide
3822 * parser.c (cp_parser_constructor_declarator_p)
3823 (cp_parser_direct_declarator): Parse deduction guides more like
3825 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
3826 * tree.c (special_function_p): Return it.
3827 * decl.c (check_special_function_return_type): Handle it.
3828 (grokdeclarator, grokfndecl): Adjust.
3829 (cp_finish_decl): Pass flags to do_auto_deduction.
3830 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
3831 * pt.c (dguide_name_p): Take a const_tree.
3832 (do_class_deduction): Handle explicit.
3833 (do_auto_deduction): Pass flags through.
3834 (build_deduction_guide): Copy explicit flag.
3836 2017-02-09 Jakub Jelinek <jakub@redhat.com>
3839 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
3840 non-pragma_compound context here.
3841 (cp_parser_omp_target): Likewise.
3842 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
3843 parsing for ordered and target omp pragmas in non-pragma_stmt
3844 non-pragma_compound contexts.
3847 * parser.c (cp_parser_oacc_declare): Formatting fix.
3848 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
3849 automatic variables.
3851 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
3852 Chung-Lin Tang <cltang@codesourcery.com>
3854 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
3855 parsing. Parse constant expression. Remove semantic checking.
3856 (cp_parser_omp_clause_collapse): Disallow tile.
3857 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
3858 error about missing for after already emitting one. Use more
3859 conventional for idiom for unbounded loop.
3860 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
3861 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
3862 (finish_omp_for): Deal with tile clause.
3864 2017-02-07 Nathan Sidwell <nathan@acm.org>
3866 * method.c (synthesized_method_base_walk): New. Broken out of ...
3867 (synthesized_method_walk): ... here. Call it. Cleanup
3870 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
3873 * typeck2.c (process_init_constructor_union): Consider only
3874 FIELD_DECLs when looking for an NSDMI.
3876 2017-02-06 Jason Merrill <jason@redhat.com>
3878 PR c++/71193 - incomplete types in templates
3879 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
3880 handle incomplete type by pedwarning and then treating as dependent.
3882 2017-02-06 Jakub Jelinek <jakub@redhat.com>
3885 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
3886 (potential_constant_expression_1): Likewise.
3889 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
3890 allow one fewer than expected arguments if flag_permissive.
3893 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
3894 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
3895 with error_mark_node type.
3897 2017-02-03 Jason Merrill <jason@redhat.com>
3899 PR c++/78689 - ICE on constructor with label
3900 * optimize.c (maybe_clone_body): Replace omitted parameters with
3902 * class.c (build_clone): Fix logic for omitting inherited parms.
3904 PR c++/12245 - excessive memory use
3905 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
3906 back in. Don't cache constants.
3907 (maybe_constant_init): Don't cache constants.
3909 PR c++/79294 - ICE with invalid template argument
3910 * pt.c (convert_nontype_argument_function): Check value-dependence.
3911 (convert_nontype_argument): Don't check it here for function ptrs.
3913 2017-02-02 Richard Biener <rguenther@suse.de>
3916 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
3917 it lazily on the first changed element only and copy it
3918 fully upfront, only storing changed elements.
3920 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
3923 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
3926 2017-01-31 Jakub Jelinek <jakub@redhat.com>
3929 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
3932 2017-01-31 David Malcolm <dmalcolm@redhat.com>
3935 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
3936 any namespace aliases.
3938 2017-01-31 Nathan Sidwell <nathan@acm.org>
3941 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
3945 * pt.c: (instantiate_decl): Push to top level when current
3946 function scope doesn't match. Only push lmabda scope stack when
3949 * cp-tree.h (instantiate_decl): Make defer_ok bool.
3950 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
3951 (instantiate_decl): Simplify and reorder state saving and restoration.
3954 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
3955 * semantics.c (finish_member_declaration): Assert class is being
3958 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
3960 Introduce C++ support in libcc1.
3961 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
3962 (ansi_opname): Rename to...
3963 (cp_operator_id): ... this. Adjust all callers.
3964 (ansi_assopname): Rename to...
3965 (cp_assignment_operator_id): ... this. Adjust all callers.
3966 (cp_literal_operator_id): Declare.
3967 (set_global_friend): Declare.
3968 (is_global_friend): Declare.
3969 (enum cp_oracle_request): New type.
3970 (cp_binding_oracle_function): New type.
3971 (cp_binding_oracle): Declare.
3972 (cp_finish_injected_record_type): Declare.
3973 * friend.c (global_friend): New var.
3974 (set_global_friend): New fn.
3975 (is_global_friend): New fn.
3976 (is_friend): Call is_global_friend.
3977 * name-lookup.c (cp_binding_oracle): New var.
3978 (query_oracle): New fn.
3979 (qualified_lookup_using_namespace): Call query_oracle.
3980 (lookup_name_real_1): Likewise.
3981 * parser.c (cp_literal_operator_id): Drop static.
3982 * search.c (friend_accessible_p): Call is_global_friend.
3983 * semantics.c (is_this_parameter): Accept a variable if the
3984 binding oracle is enabled.
3986 2017-01-27 Jason Merrill <jason@redhat.com>
3988 PR c++/78771 - ICE with inherited constructor.
3989 * call.c (build_over_call): Call deduce_inheriting_ctor here.
3990 * pt.c (tsubst_decl): Not here.
3991 * class.c (add_method): Or here.
3992 * method.c (deduce_inheriting_ctor): Handle clones.
3993 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
3995 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
3998 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
4000 * cp/cp-tree.h: Declare it.
4001 * cp/semantics.c (finish_id_expression): Resolve names within a default
4002 capturing generic lambda defined within a template prior to
4003 instantiation to allow for captures to be added to the closure type.
4005 2017-01-26 Jakub Jelinek <jakub@redhat.com>
4008 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
4009 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
4010 * parser.c (cp_parser_builtin_offsetof): Pass result of
4011 build_static_cast of null_pointer_node to finish_offsetof.
4012 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
4013 it for -Winvalid-offsetof pedwarn instead of trying to guess
4014 original offsetof type from EXPR. Save OBJECT_PTR as a new
4015 second operand to OFFSETOF_EXPR.
4016 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
4017 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
4020 2017-01-26 Jason Merrill <jason@redhat.com>
4022 * name-lookup.c (parse_using_directive): Deprecate strong using.
4024 PR c++/79176 - lambda ICE with -flto -Os
4025 * decl2.c (vague_linkage_p): Handle decloned 'tors.
4026 * tree.c (decl_linkage): Likewise.
4028 2017-01-25 Martin Sebor <msebor@redhat.com>
4030 * decl.c (grokdeclarator): Fix a typo in a comment.
4032 2017-01-25 Jakub Jelinek <jakub@redhat.com>
4035 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
4039 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
4040 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
4042 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
4045 * decl.c (cxx_init_decl_processing): Pass main_input_filename
4046 to build_translation_unit_decl.
4048 2017-01-24 Jakub Jelinek <jakub@redhat.com>
4051 * cp-gimplify.c (cp_genericize_r): Add result of
4052 convert_from_reference on invisiref parm to p_set.
4054 2017-01-24 Nathan Sidwell <nathan@acm.org>
4056 PR c++/78469 - defaulted ctor and inaccessible dtor
4057 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
4058 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
4059 * tree.c (build_target_expr): Check tf_no_cleanup.
4061 PR c++/79118 - anon-members and constexpr
4062 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
4063 ctor decl. Recursively check anonymous members.
4064 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
4066 (explain_invalid_constexpr_fn): Likewise.
4068 2017-01-23 Nathan Sidwell <nathan@acm.org>
4070 PR c++/71710 - template using directive of field
4071 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
4074 PR c++/71406 - ICE with scope-ref'd template id exprs
4076 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
4077 before breaking up TEMPLATE_ID_EXPR.
4079 2017-01-20 Nathan Sidwell <nathan@acm.org>
4081 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
4082 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
4084 2017-01-20 David Malcolm <dmalcolm@redhat.com>
4088 * cp-tree.h (suggest_alternatives_for): Add bool param.
4089 (suggest_alternative_in_explicit_scope): New decl.
4090 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
4091 that isn't the global one, call new function
4092 suggest_alternative_in_explicit_scope, only calling
4093 suggest_alternatives_for if it fails, and disabling near match
4094 searches fort that case. When SCOPE is the global namespace,
4095 pass true for new param to suggest_alternatives_for to allow for
4097 * lex.c (unqualified_name_lookup_error): Pass true for new param
4098 to suggest_alternatives_for.
4099 * name-lookup.c (consider_binding_level): Add forward decl.
4100 (suggest_alternatives_for): Add "suggest_misspellings" param,
4101 using it to conditionalize the fuzzy name-lookup code.
4102 (suggest_alternative_in_explicit_scope): New function.
4103 * parser.c (cp_parser_primary_expression): When calling
4104 finish_id_expression, pass location of id_expression rather
4105 than that of id_expr_token.
4106 (cp_parser_id_expression): Convert local "unqualified_id" from
4107 tree to cp_expr to avoid implicitly dropping location information.
4109 2017-01-20 Marek Polacek <polacek@redhat.com>
4112 * call.c (build_conditional_expr_1): Warn about duplicated branches.
4113 * semantics.c (finish_expr_stmt): Build statement using the proper
4116 2017-01-19 Jason Merrill <jason@redhat.com>
4118 US 20 - forwarding references and class template argument deduction
4119 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
4120 * pt.c (push_template_decl_real): Set it.
4121 (maybe_adjust_types_for_deduction): Check it.
4122 (rewrite_template_parm): Copy it.
4124 US 19 - deduction guides and constructors
4125 * call.c (joust): Prefer deduction guides to constructors.
4126 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
4127 (deduction_guide_p): Check DECL_P.
4129 * decl.c (check_initializer): Always use build_aggr_init for array
4132 PR c++/79130 - decomposition and direct-initialization
4133 * init.c (build_aggr_init): Communicate direct-initialization to
4135 (build_vec_init): Check for array copy sooner.
4136 * parser.c (cp_parser_decomposition_declaration): Remove call to
4137 build_x_compound_expr_from_list.
4139 2017-01-18 Jason Merrill <jason@redhat.com>
4141 PR c++/68666 - member variable template-id
4142 * typeck.c (finish_class_member_access_expr): Handle variable
4144 * pt.c (lookup_and_finish_template_variable): No longer static.
4145 * cp-tree.h: Declare it.
4147 2017-01-18 Nathan Sidwell <nathan@acm.org>
4150 * call.c (build_over_call): When checking ellipsis conversions for
4151 an inherited ctor, make sure there is at least one conversion.
4153 2017-01-18 Jason Merrill <jason@redhat.com>
4155 PR c++/78894 - ICE with class deduction and default arg
4156 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
4158 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4161 * mangle.c (write_discriminator): Reorganize abi warning check.
4163 2017-01-18 Nathan Sidwell <nathan@acm.org>
4165 * cp-tree.h: Clarify exception spec node comment.
4166 * except.c (nothrow_spec_p): Simplify by checking node-equality.
4169 * mangle.c (write_exception_spec): Check nothrow explicitly.
4170 (write_encoding): Don't increment processing_template_decl around
4173 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4176 * mangle.c (write_template_args): Add "on" for operator names.
4178 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4181 * mangle.c (write_discriminator): Handle discriminator >= 10.
4183 2017-01-17 Nathan Sidwell <nathan@acm.org>
4186 * cp-tree.h (maybe_generic_this_capture): Declare.
4187 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
4188 (maybe_resolve_dummy): ... here. Call it.
4189 (maybe_generic_this_capture): New.
4190 * parser.c (cp_parser_postfix_expression): Speculatively capture
4191 this in generic lambda in unresolved member function call.
4192 * pt.c (tsubst_copy_and_build): Force hard error from failed
4193 member function lookup in generic lambda.
4195 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
4198 * cp-array-notation.c (expand_array_notation_exprs): Handle
4201 2017-01-11 Jason Merrill <jason@redhat.com>
4203 PR c++/78337 - ICE on invalid with generic lambda
4204 * semantics.c (process_outer_var_ref): Check if containing_function
4205 is null. Move inform call under complain test.
4207 2017-01-11 Nathan Sidwell <nathan@acm.org>
4210 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
4213 2017-01-11 Nathan Sidwell <nathan@acm.org>
4215 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
4217 2017-01-11 Jakub Jelinek <jakub@redhat.com>
4220 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
4221 assertion. Formatting fix.
4224 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
4227 2017-01-10 David Malcolm <dmalcolm@redhat.com>
4230 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
4231 a missing semicolon if we have a valid insertion location for
4234 2017-01-10 Jason Merrill <jason@redhat.com>
4236 FI 20, decomposition declaration with parenthesized initializer.
4237 * parser.c (cp_parser_decomposition_declaration): Use
4238 cp_parser_initializer.
4240 2017-01-09 Jason Merrill <jason@redhat.com>
4242 Implement P0195R2, C++17 variadic using.
4243 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
4244 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
4245 * error.c (dump_decl): Likewise.
4247 2017-01-09 Jakub Jelinek <jakub@redhat.com>
4249 PR translation/79019
4250 PR translation/79020
4251 * semantics.c (finish_omp_clauses): Add missing whitespace to
4252 translatable strings.
4253 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
4255 2017-01-07 Jason Merrill <jason@redhat.com>
4257 PR c++/78948 - instantiation from discarded statement
4258 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
4259 * cp-tree.h (in_discarded_stmt): Declare it.
4260 (struct saved_scope): Add discarded_stmt bitfield.
4261 (in_discarded_stmt): New macro.
4262 * decl2.c (mark_used): Check it.
4263 * parser.c (cp_parser_selection_statement): Adjust.
4264 (cp_parser_jump_statement): Adjust.
4266 2017-01-05 Jakub Jelinek <jakub@redhat.com>
4269 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
4270 REFERENCE_REF_P, set tt to its operand.
4273 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
4274 unions even for C++11 and later.
4276 2017-01-05 Nathan Sidwell <nathan@acm.org>
4279 * pt.c (convert_nontype_argument): Don't try and see if integral
4280 or enum expressions are constants prematurely.
4282 2017-01-04 Marek Polacek <polacek@redhat.com>
4285 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
4286 a zero character literal.
4288 2017-01-04 Jakub Jelinek <jakub@redhat.com>
4291 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
4295 * parser.c (cp_parser_simple_declaration): Only complain about
4296 inconsistent auto deduction if auto_result doesn't use auto.
4298 * parser.c (cp_parser_simple_declaration): Diagnose function
4299 declaration among more than one init-declarators with auto
4303 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
4304 assertion, as lexer->buffer may be NULL.
4306 2017-01-04 Marek Polacek <polacek@redhat.com>
4310 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
4312 2017-01-04 Nathan Sidwell <nathan@acm.org>
4315 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
4316 (lambda_capture_field_type): Update prototype.
4317 * lambda.c (lambda_capture_field_type): Add is_reference parm.
4318 Add referenceness here.
4319 (add_capture): Adjust lambda_capture_field_type call, refactor
4321 * pt.c (tsubst): Adjust lambda_capture_field_type call.
4323 2017-01-01 Jakub Jelinek <jakub@redhat.com>
4325 Update copyright years.
4327 Copyright (C) 2017 Free Software Foundation, Inc.
4329 Copying and distribution of this file, with or without modification,
4330 are permitted in any medium without royalty provided the copyright
4331 notice and this notice are preserved.