1 2017-09-18 Jason Merrill <jason@redhat.com>
3 PR c++/82069 - ICE with lambda in template
4 * semantics.c (process_outer_var_ref): Check uses_template_parms
5 instead of any_dependent_template_arguments_p.
7 2017-09-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
8 Paolo Carlini <paolo.carlini@oracle.com>
11 * decl2.c (finish_anon_union): Complain about "anonymous union with
12 no members" with a pedwarn.
14 2017-09-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
16 * typeck.c (build_reinterpret_cast_1,
17 build_const_cast_1): Implement -Wcast-align=strict.
19 2017-09-15 Jakub Jelinek <jakub@redhat.com>
21 * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
22 adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
23 to C++17 or -std=gnu++17 or -std=c++17. Adjust comments.
24 (cxx_init_decl_processing, next_initializable_field,
25 is_direct_enum_init, check_initializer, cp_finish_decl,
26 mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
27 finish_function): Likewise.
28 * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
29 * pt.c (mark_template_parm, convert_nontype_argument,
30 instantiate_class_template_1, type_unification_real, unify,
31 get_partial_spec_bindings, dependent_type_p_r): Likewise.
32 * typeck.c (cp_build_unary_op): Likewise.
33 * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
34 * call.c (build_user_type_conversion_1, build_over_call,
35 build_special_member_call): Likewise.
36 * lambda.c (begin_lambda_type): Likewise.
37 * typeck2.c (process_init_constructor_record): Likewise.
38 * class.c (build_base_field, finalize_literal_type_property,
39 explain_non_literal_class): Likewise.
40 * parser.c (cp_parser_diagnose_invalid_type_name,
41 cp_parser_primary_expression, cp_parser_lambda_introducer,
42 cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
43 cp_convert_range_for, cp_parser_perform_range_for_lookup,
44 cp_parser_decomposition_declaration, cp_parser_linkage_specification,
45 cp_parser_static_assert, cp_parser_simple_type_specifier,
46 cp_parser_namespace_definition, cp_parser_using_declaration,
47 cp_parser_init_declarator, cp_parser_type_parameter_key,
48 cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
49 cp_parser_constructor_declarator_p): Likewise.
50 * mangle.c (struct globals): Rename need_cxx1z_warning to
52 (write_exception_spec, start_mangling, mangle_decl): Likewise.
53 * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
55 (check-c++17): New goal. Use 17 instead of 1z.
56 (check-c++-all): Use 17 instead of 1z.
58 2017-09-14 Jakub Jelinek <jakub@redhat.com>
61 * cp-gimplify.c (omp_var_to_track): Look through references.
62 (omp_cxx_notice_variable): Likewise.
64 2017-09-13 Nathan Sidwell <nathan@acm.org>
66 Conv-op identifers not in identifier hash table
67 * lex.c (conv_type_hasher): Make member fns inline.
68 (make_conv_op_name): Directly clone conv_op_identifier.
70 Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
71 * cp-tree.h (struct lang_type): Rename methods to members.
72 (CLASSTYPE_METHOD_VEC): Rename to ...
73 (CLASSTYPE_MEMBER_VEC): ... this.
74 * name-lookup.h (get_method_slot): Rename to ...
75 (get_member_slot): ... this.
76 (resort_type_method_vec): Rename to ...
77 (resort_type_member_vec): ... this.
78 * class.c (add_method, warn_hidden): Adjust.
79 * search.c (dfs_locate_field_accessor_pre): Adjust.
80 * name-lookup.c (method_vec_binary_search): Rename to ...
81 (member_vec_binary_search): ... this and adjust.
82 (method_vec_linear_search): Rename to ...
83 (member_vec_linear_search): ... this and adjust.
84 (fields_linear_search, get_class_binding_direct): Adjust.
85 (get_method_slot): Rename to ...
86 (get_member_slot): ... this and adjust.
87 (method_name_slot): Rename to ...
88 (member_name_slot): ... this and adjust.
89 (resort_type_method_vec): Rename to ...
90 (resort_type_member_vec): ... this and adjust.
91 (method_vec_append_class_fields): Rename to ...
92 (member_vec_append_class_fields): ... this and adjust.
93 (method_vec_append_enum_values): Rename to ...
94 (member_vec_append_enum_values): ... this and adjust.
95 (method_vec_dedup): Rename to ...
96 (member_vec_dedup): ... this and adjust.
97 (set_class_bindings, insert_late_enum_def_bindings): Adjust.
99 2017-09-12 Paolo Carlini <paolo.carlini@oracle.com>
102 * decl.c (start_decl): Early return error_mark_node if duplicate_decls
103 returns it; avoid misleading error message.
105 2017-09-12 Nathan Sidwell <nathan@acm.org>
107 Kill CLASSTYPE_SORTED_FIELDS.
108 * cp-tree.h (struct lang_type): Lose sorted_fields member.
109 (CLASSTYPE_SORTED_FIELDS): Delete.
110 * name-lookup.h (set_class_bindings): Add EXTRA arg.
111 * name-lookup.c (fields_linear_search): New, broken out of ...
112 (lookup_field_1): ... here. Delete remainder of function.
113 (get_class_binding_direct): Reimplement without sorted_fields.
114 (get_class_binding): Rename TYPE arg to KLASS, for consistency.
115 (get_method_slot): Call set_class_binding when creating method_vec
117 (method_name_cmp): Order identically named slots.
118 (sorted_fields_type_new): Delete.
119 (field_vc_append_class_fields): Rename to ...
120 (method_vec_append_class_fields): ... here. Adjust.
121 (field_vec_append_enum_values): Renme to ...
122 (method_vec_append_enum_values): ... here. Adjust.
123 (method_vec_dedup): New.
124 (set_class_bindings): Reimplement.
125 (insert_late_enum_def_bindings): Reimplement.
127 * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
129 (restort_data): Move later.
130 (method_name_cmp, resort_method_name_cmp): Simplify.
131 (resort_type_method_vec): Reformat.
133 2017-09-09 Jason Merrill <jason@redhat.com>
135 * constexpr.c (reduced_constant_expression_p): If
136 CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
138 2017-09-09 Eric Botcazou <ebotcazou@adacore.com>
141 * cp-objcp-common.c (struct debug_type_hasher): New class.
142 (debug_type_hash): New variable.
143 (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
145 2017-09-08 Jason Merrill <jason@redhat.com>
147 PR c++/70029 - ICE with ref-qualifier and -flto
148 * tree.c (cxx_copy_lang_qualifiers): New.
149 * cp-tree.h: Declare it.
150 * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
152 2017-09-06 Jason Merrill <jason@redhat.com>
154 PR c++/82053 - ICE with default argument in lambda in template
155 * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
157 (retrieve_specialization): Use lambda_fn_in_template_p.
158 * cp-tree.h: Declare it.
160 PR c++/82070 - error with nested lambda capture
161 * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
162 register_local_specialization.
164 2017-09-06 Nathan Sidwell <nathan@acm.org>
166 * name-lookup.h (lookup_field_1): Delete.
167 (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
168 * name-lookup.c (lookup_field_1): make static
169 (method_vec_binary_search, method_vec_linear_search): New. Broken
171 (get_class_binding_direct): ... here. Add TYPE_OR_FNS argument.
172 Do complete search of this level.
173 (get_class_binding): Adjust.
174 * decl.c (reshape_init_class): Call get_class_binding.
175 * search.c (lookup_field_r): Move field searching into
176 get_class_binding_direct.
178 * class.c (warn_hidden): Don't barf on non-functions.
179 * decl2.c (check_classfn): Likewise. Check template match earlier.
181 * name-lookup.c (count_fields): Rename to ...
182 (count_class_fields): ... here. Take a class, don't count
184 (add_fields_to_record_type): Rename to ...
185 (field_vec_append_class_fields): ... here. Take a class, don't
186 add NULL-named fields.
187 (add_enum_fields_to_record_type): Rename to ...
188 (field_vec_append_enum_values): ... here.
189 (set_class_bindings): Adjust, assert we added expected number.
190 (insert_late_enum_def_bindings): Reimplement. Create vector if
191 there are now sufficient entries.
193 * name-lookup.h (lookup_fnfields_slot_nolazy,
194 lookup_fnfields_slot): Rename to ...
195 (get_class_binding_direct, get_class_binding): ... here.
196 * name-lookup.c (lookup_fnfields_slot_nolazy,
197 lookup_fnfields_slot): Rename to ...
198 (get_class_binding_direct, get_class_binding): ... here.
199 * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
200 * call.c (build_user_type_conversion_1): Adjust.
201 (has_trivial_copy_assign_p): Adjust.
202 (has_trivial_copy_p): Adjust.
203 * class.c (get_basefndecls) Adjust.
204 (vbase_has_user_provided_move_assign) Adjust.
205 (classtype_has_move_assign_or_move_ctor_p): Adjust.
206 (type_build_ctor_call, type_build_dtor_call): Adjust.
207 * decl.c (register_dtor_fn): Adjust.
208 * decl2.c (check_classfn): Adjust.
209 * pt.c (retrieve_specialization): Adjust.
210 (check_explicit_specialization): Adjust.
211 (do_class_deduction): Adjust.
212 * search.c (lookup_field_r): Adjust.
213 (look_for_overrides_here, lookup_conversions_r): Adjust.
214 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
215 * tree.c (type_has_nontrivial_copy_init): Adjust.
216 * method.c (lazily_declare_fn): Adjust comment.
218 2017-09-05 Nathan Sidwell <nathan@acm.org>
220 * name-lookup.c (do_class_using_decl): Elide read-once temps.
221 Move declarations to initializations.
223 * class.c (add_method): Move slot search and insertion to ...
224 * name-lookup.c (get_method_slot): ... this new function.
225 (lookup_fnfields_slot_nolazy): Cope with NULL slot.
226 * name-lookup.h (get_method_slot): Declare.
227 * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
229 (grok_special_member_properties): Set
230 TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
231 Improve TYPE_HAS_CONSTEXPR_CTOR setting.
233 * cp-tree.h (lang_decl_base): Rename template_conv_p to
235 (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
236 (DECL_CONV_FN_TYPE): FN must be conv op.
237 (DECL_TEMPLATE_CONV_FN_P): Delete.
238 (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
239 * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
242 * class.c (unreverse_member_declarations): Remove extraneous if.
243 * pt.c (push_template_decl_real): Use string concatenation, not
244 \<newline>. Add %<..%>.
246 2017-09-05 Paolo Carlini <paolo.carlini@oracle.com>
249 * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
250 * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
251 creating cdtor_label.
252 * constexpr.c (returns): Add the case of a constructor/destructor
253 returning via a LABEL_DECL_CDTOR label.
254 (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
256 2017-09-01 Nathan Sidwell <nathan@acm.org>
258 * cp-tree.h (resort_type_method_vec): Move declaration to ...
259 * name-lookup.h (resort_type_method_vec): ... here.
260 (set_class_bindings): Lose 2nd arg.
261 * class.c (finish_struct_1, finish_struct): Adjust
262 set_class_bindings call. Don't call finish_struct_methods.
263 (resort_data, method_name_cmp, resort_method_name_cmp,
264 resort_type_method_vec, finish_struct_methods): Move to ...
265 * name-lookup.c (resort_data, method_name_cmp,
266 resort_method_name_cmp, resort_type_method_vec): ... here.
267 (set_class_bindings): Lose fields arg. Swallow finish_struct_methods.
269 * class.c (finish_struct): Call set_class_bindings for the
272 * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
273 Don't call maybe_warn_about_overly_private_class here.
274 (warn_hidden): Cleanup declarations and comments.
275 (type_has_user_provided_constructor): No need to check
276 CLASSTYPE_METHOD_VEC.
277 (type_has_user_provided_or_explicit_constructor): Likewise.
278 (classtype_has_move_assign_or_move_ctor_p): Likewise.
279 (check_bases_and_members): Don't call finish_struct_methods here.
280 (finish_struct_1): Call finish_struct_methods and
281 set_class_bindings immediately after layout. Clear DECL_IN_AGGR_P
283 (finish_struct): For templates process USING_DECLS and clear
284 DECL_IN_AGGR_P before calling finish_struct_methods. Call
285 maybe_warn_about_overly_private_class here.
287 Revert 2017-08-28 Nathan Sidwell <nathan@acm.org>
288 Restore sorted_fields vector.
289 * cp-tree.h (lang_type): Restore sorted_fields vector.
290 (CLASSTYPE_SORTED_FIELDS): Restore.
291 (CLASSTYPE_BINDINGS): Delete.
292 * name-lookup.c (lookup_field_1): Restore binary search.
293 (sorted_fields_type_new, count_fields,
294 add_fields_to_record_type, add_enum_fields_to_record_type): Restore
295 (set_class_bindings): Revert.
296 (insert_late_enum_def_binding): Restore field_vec insertion.
298 2017-09-01 Jakub Jelinek <jakub@redhat.com>
301 * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
303 2017-09-01 Marek Polacek <polacek@redhat.com>
306 * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
308 2017-08-30 Jason Merrill <jason@redhat.com>
310 PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
311 * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
312 (regenerated_lambda_fn_p): New.
313 (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
314 (tsubst_copy) [VAR_DECL]: Likewise.
316 PR c++/82030 - ICE inheriting from multiple lambdas
318 * call.c (compare_ics): Handle null candidate.
320 2017-08-30 Ville Voutilainen <ville.voutilainen@gmail.com>
322 Make taking the address of an overloaded function a non-deduced context
324 * pt.c (unify_overload_resolution_failure): Remove.
325 (unify_one_argument): Adjust.
327 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
328 Alan Hayward <alan.hayward@arm.com>
329 David Sherwood <david.sherwood@arm.com>
331 * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
333 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
334 Alan Hayward <alan.hayward@arm.com>
335 David Sherwood <david.sherwood@arm.com>
337 * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
339 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
340 Alan Hayward <alan.hayward@arm.com>
341 David Sherwood <david.sherwood@arm.com>
343 * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
344 instead of TYPE_MODE.
346 2017-08-29 Jason Merrill <jason@redhat.com>
348 PR c++/81236 - ICE with template-id in generic lambda
349 * semantics.c (finish_id_expression): Remove special dependent case.
350 Avoid some later pieces when dependent.
351 (finish_qualified_id_expr): Do normal BASELINK handling in a
352 template. Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
353 (parsing_default_capturing_generic_lambda_in_template): Remove.
354 * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
355 error for types that will never be complete.
356 * mangle.c (write_expression): Add sanity check.
357 * tree.c (build_qualified_name): Add sanity check.
358 (cp_walk_subtrees): Walk into the class context of a BASELINK.
359 * lambda.c (add_capture): Improve diagnostic for generic lambda
361 * call.c (build_new_method_call_1): Print the right constructor
364 Reimplement handling of lambdas in templates.
365 * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
366 * decl.c (start_preparsed_function): Call start_lambda_scope.
367 (finish_function): Call finish_lambda_scope.
368 * init.c (get_nsdmi): Call start/finish_lambda_scope.
369 * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
370 * parser.c (cp_parser_function_definition_after_declarator): Don't
371 call start/finish_lambda_scope.
372 * pt.c (retrieve_specialization): Ignore lambda functions in
374 (find_parameter_packs_r): Ignore capture proxies. Look into
376 (check_for_bare_parameter_packs): Allow bare packs in lambdas.
377 (tsubst_default_argument): Call start/finish_lambda_scope.
378 (tsubst_function_decl): Handle lambda functions differently.
379 (tsubst_template_decl): Likewise.
380 (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
382 (tsubst_lambda_expr): Create a new closure rather than instantiate
383 the one from the template.
384 (tsubst_copy_and_build): Don't register a specialization of a pack.
385 (regenerate_decl_from_template): Call start/finish_lambda_scope.
386 (instantiate_decl): Remove special lambda function handling.
387 * semantics.c (process_outer_var_ref): Remove special generic lambda
388 handling. Don't implicitly capture in a lambda in a template. Look
389 for an existing proxy.
390 * class.c (current_nonlambda_class_type): Use decl_type_context.
392 * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
393 (LAMBDA_EXPR_RETURN_TYPE): Remove.
394 (struct tree_lambda_expr): Remove closure and return_type fields.
395 * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
396 * pt.c (tsubst_copy_and_build): Likewise.
397 * parser.c (cp_parser_lambda_declarator_opt): Track return type.
398 (cp_parser_lambda_body): Adjust unspecified return type check.
399 * ptree.c (cxx_print_lambda_node): Don't print closure or
402 PR c++/80935 - wrong C++17 error with lambda
403 * decl.c (check_for_uninitialized_const_var): Check
404 is_instantiation_of_constexpr.
405 * constexpr.c (ensure_literal_type_for_constexpr_object): Check
406 is_instantiation_of_constexpr.
407 (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
409 * lambda.c (build_lambda_object): Check for error_mark_node.
410 * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
412 (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
413 (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
415 PR c++/80767 - unnecessary instantiation of generic lambda
416 * call.c (convert_like_real): Call build_user_type_conversion_1 if
418 (add_conv_candidate): Build a ck_user conversion with no candidate.
420 Fix lambdas in template default argument of inherited ctor.
421 * method.c (synthesized_method_base_walk): Replace an inherited
422 template with its specialization.
423 (synthesized_method_walk): Make inheriting_ctor a pointer.
424 (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
425 (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
427 * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
428 template, not the function.
429 (template_guide_p): Adjust.
431 Support copying local_specializations.
432 * cp-tree.h (enum lss_policy): New.
433 (local_specialization_stack): Add policy parameter to default ctor.
434 * pt.c (local_specialization_stack): Copy local_specializations if
437 * constexpr.c (potential_constant_expression_1): Add "now" parm.
438 (is_constant_expression, require_constant_expression): New.
439 (is_static_init_expression, is_nondependent_constant_expression)
440 (is_nondependent_static_init_expression): Drop "potential".
441 * except.c (build_must_not_throw_expr): Do type conversion on
442 value-dependent argument.
443 * pt.c, semantics.c, typeck2.c: Use variants without "potential".
445 Instantiate default arguments/member initializers once.
446 * init.c (get_nsdmi): Remember NSDMI instantiations.
447 * parser.c (inject_this_parameter): Be more picky about
449 * pt.c (tsubst_copy): Simplify 'this' handling.
450 (tsubst_default_argument): Remember default argument
451 instantiations. Take parameter number.
452 (tsubst_default_arguments): Pass it.
453 * call.c (convert_default_arg): Likewise.
455 Fix default argument conversion failure and SFINAE.
456 * call.c (build_over_call): Check convert_default_arg result for
458 * parser.c (cp_parser_late_parsing_default_args): Remember
461 2017-08-28 Nathan Sidwell <nathan@acm.org>
463 * cp-tree.h (lang_type): Replace sorted_fields vector with
465 (CLASSTYPE_SORTED_FIELDS): Delete.
466 (CLASSTYPE_BINDINGS): New.
467 * decl.c (finish_enum_value_list): Swap args of
468 insert_late_enum_def_bindings.
469 * name-lookup.c (lookup_field_1): Replace binary search of sorted
470 fields with map->get.
471 (sorted_fields_type_new, count_fields,
472 add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
473 (add_class_member, add_class_members): New.
474 (set_class_bindings): Create map and insert.
475 (insert_late_enum_def_binding): Swap parms. Use add_clasS_member.
476 * ptree.c (cxx_print_type): Delete sorted fields printing.
478 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
480 * name-lookup.h (set_class_bindings,
481 insert_late_enum_def_bindings): Declare.
482 * decl.c (finish_enum_value_list): Adjust for
483 insert_late_enum_def_bindings name change.
484 * class.c (finish_struct_1): Call set_class_bindings.
485 (count_fields, add_fields_to_record_type,
486 add_enum_fields_to_record_type, sorted_fields_type_new,
487 insert_into_classtype_sorted_fields,
488 insert_late_enum_def_into_classtype_sorted_fields): Move to ...
489 * name-lookup.h (count_fields, add_fields_to_record_type,
490 add_enum_fields_to_record_type, sorted_fields_type_new,
491 set_class_bindings, insert_late_enum_def_bindings): ... here.
493 2017-08-25 Nathan Sidwell <nathan@acm.org>
495 * class.c (method_name_cmp, resort_method_name_cmp): Methods
498 Conversion operators have a special name
499 * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
500 (conv_op_marker, conv_op_identifier): New.
501 (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
502 * decl.c (initialize_predefined_identifiers): Add
504 (cxx_init_decl_processing): Create conv_op_marker.
505 * decl2.c (check_classfn): Lookup conv-ops by name.
506 * class.c (add_method): Use conv_op_identifier & conv_op_marker.
507 (resort_type_method_vec): Don't skip conv-ops.
508 (finish_struct_methods, warn_hidden): Likewise.
509 * name-lookup.h (lookup_all_conversions): Delete.
510 * name-lookup.c (lookup_conversion_operator): Replace with ...
511 (extract_conversion_operator): ... this.
512 (lookup_fnfields_slot_nolazy): Find conv-ops by name.
513 (lookup_all_conversions): Delete.
514 * pt.c (check_explicit_specialization): Find conv-ops by name.
515 * search.c (lookup_conversions_r): Likewise.
517 2017-08-24 Nathan Sidwell <nathan@acm.org>
519 Conversion operators kept on single overload set
520 * class.c (add_method): Keep all conv-ops on one slot.
521 * name-lookup.c (lookup_conversion_operator): Pull the desired
522 conv op out of overload set.
523 * search.c (lookup_conversions_r): Lose template/non-template
525 (lookup_conversions): Likewise.
527 2017-08-23 Nathan Sidwell <nathan@acm.org>
529 * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
530 lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
532 * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
533 lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
534 * search.c (lookup_conversion_operator,
535 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
536 lookup_all_conversions): Move to ...
537 * name-lookup.c (lookup_conversion_operator,
538 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
539 lookup_all_conversions): ... here.
541 * semantics.c (finish_member_declaration): Move USING_DECL check
542 earlier. Always set C++ linkage. Commonize TYPE_FIELD and
543 template decl list insertion.
545 * cp-tree.h (maybe_version_functions): Declare.
546 * decl.c (decls_match): Break function versioning check to
547 separate function. Call it.
548 (maybe_version_functions): Broken out of decls_match.
549 * class.c (add_method): Use maybe_version_functions.
551 * cp-tree.h (print_search_statistics,
552 reinit_search_statistics): Don't declare.
553 * search.c (n_fields_searched, n_calls_lookup_field,
554 n_calls_lookup_field_1, n_calls_lookup_fnfields,
555 n_calls_lookup_fnfields_1, n_calls_get_base_type,
556 n_outer_fields_searched, n_contexts_saved): Delete.
557 (lookup_field_1, lookup_member,
558 lookup_fnfields_slot_nolazy): Remove stat gathering.
559 (print_search_statistics, reinit_search_statistics): Delete.
560 * tree.c (cxx_print_statistics): Don't print search stats.
562 2017-08-21 Nathan Sidwell <nathan@acm.org>
564 * search.c (lookup_field_r): Remove obsolete code for type-named
567 * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
569 (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
570 (lookup_field_fuzzy_r): Adjust.
572 2017-08-21 David Malcolm <dmalcolm@redhat.com>
574 * call.c (build_over_call): Pass NULL for new parameter to
575 check_function_arguments.
576 * typeck.c (cp_build_function_call_vec): Likewise.
578 2017-08-21 Nathan Sidwell <nathan@acm.org>
581 * pt.c (instantiate_class_template_1):
582 BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
584 2017-08-18 David Malcolm <dmalcolm@redhat.com>
587 * name-lookup.c (maybe_suggest_missing_header): Convert return
588 type from void to bool; return true iff a suggestion was offered.
589 (suggest_alternative_in_explicit_scope): Move call to
590 maybe_suggest_missing_header to before use of best_match, and
591 return true if the former offers a suggestion.
593 2017-08-18 H.J. Lu <hongjiu.lu@intel.com>
596 * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
597 * decl2.c (grokbitfield): Don't allow bit-field with
598 warn_if_not_aligned type.
600 2017-08-17 Nathan Sidwell <nathan@acm.org>
602 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
603 * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
604 (TYPE_TEMPLATE_INFO): Simplify.
605 (SET_TYPE_TEMPLATE_INFO): Simplify.
607 * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
608 don't need lang_type.
609 (cxx_make_type): Use maybe_add_lang_type_raw return value.
610 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
613 * cp-tree.h (struct lang_type): Remove template_info field.
614 (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
615 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
617 2017-08-14 Martin Sebor <msebor@redhat.com>
620 * error.c (cp_printer): Handle 'G'.
622 2017-08-11 Martin Liska <mliska@suse.cz>
624 * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
625 TARGET_SUPPORTS_ALIASES.
626 (handle_tls_init): Likewise.
627 (note_mangling_alias): Likewise. Remove ATTRIBUTE_UNUSED for
629 * optimize.c (can_alias_cdtor): Likewise.
631 2017-08-11 Jason Merrill <jason@redhat.com>
633 PR c++/81671 - nullptr_t template parameter
634 * pt.c (convert_nontype_argument): Fix nullptr_t check.
636 2017-08-10 Jason Merrill <jason@redhat.com>
638 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
639 * method.c (synthesized_method_walk): Don't diagnose lack of
642 PR c++/80452 - Core 1579, implicit move semantics on return/throw
643 * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
644 tentatively changed the lvalue to an rvalue.
645 * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
646 (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
647 parameter is an rvalue reference.
648 * except.c (build_throw): Do maybe-rvalue overload resolution twice.
649 * typeck.c (check_return_expr): Likewise.
651 2017-08-10 David Malcolm <dmalcolm@redhat.com>
653 * parser.c (cp_parser_error): Update for new param to
655 (class token_pair): New class.
656 (struct matching_paren_traits): New struct.
657 (matching_parens): New typedef.
658 (struct matching_brace_traits): New struct.
659 (matching_braces): New typedef.
660 (cp_parser_statement_expr): Convert explicit parsing of
661 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
662 class matching_parens, so that the pertinent open parenthesis is
663 highlighted when there are problems locating the close
665 (cp_parser_primary_expression): Likewise.
666 (cp_parser_compound_literal_p): Remove consumption of opening
668 (cp_parser_postfix_expression): Convert explicit parsing of
669 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
670 above. Use it to consume the opening paren previously consumed by
671 cp_parser_compound_literal_p.
672 (cp_parser_parenthesized_expression_list): Likewise.
673 (cp_parser_unary_expression): Likewise.
674 (cp_parser_new_expression): Likewise.
675 (cp_parser_cast_expression): Likewise.
676 (cp_parser_builtin_offsetof): Likewise.
677 (cp_parser_trait_expr): Likewise.
678 (cp_parser_lambda_declarator_opt): Likewise.
679 (cp_parser_lambda_body): Likewise, for matching_braces.
680 (cp_parser_compound_statement): Likewise.
681 (cp_parser_selection_statement): Likewise, for matching_parens.
682 (cp_parser_iteration_statement): Likewise.
683 (cp_parser_already_scoped_statement): Likewise, for
685 (cp_parser_linkage_specification): Likewise.
686 (cp_parser_static_assert): Likewise, for matching_parens.
687 (cp_parser_decltype): Likewise.
688 (cp_parser_operator): Likewise.
689 (cp_parser_enum_specifier): Likewise.
690 (cp_parser_namespace_definition): Likewise.
691 (cp_parser_direct_declarator): Likewise.
692 (cp_parser_braced_list): Likewise.
693 (cp_parser_class_specifier_1): Likewise, for matching_braces.
694 (cp_parser_constant_initializer): Likewise.
695 (cp_parser_noexcept_specification_opt): Likewise, for
697 (cp_parser_exception_specification_opt): Likewise.
698 (cp_parser_handler): Likewise.
699 (cp_parser_asm_specification_opt): Likewise.
700 (cp_parser_asm_operand_list): Likewise.
701 (cp_parser_gnu_attributes_opt): Likewise.
702 (cp_parser_std_attribute_spec): Likewise.
703 (cp_parser_requirement_parameter_list): Likewise.
704 (cp_parser_requirement_body): Likewise, for matching_braces.
705 (cp_parser_compound_requirement): Likewise.
706 (cp_parser_template_introduction): Likewise.
707 (cp_parser_sizeof_pack): Likewise, for matching_parens.
708 (cp_parser_sizeof_operand): Likewise; use it to consume the
709 opening paren previously consumed by cp_parser_compound_literal_p.
710 (get_matching_symbol): New function.
711 (cp_parser_required_error): Add param "matching_location". Remove
712 calls to cp_parser_error, instead setting a non-NULL gmsgid, and
713 handling it if set by calling c_parse_error, potentially with a
714 secondary location if matching_location was set.
715 (cp_parser_require): Add param "matching_location", with a default
716 value of UNKNOWN_LOCATION.
717 (cp_parser_require_keyword): Update for new param of
718 cp_parser_required_error.
719 (cp_parser_objc_encode_expression): Update to class matching_parens
721 (cp_parser_objc_defs_expression): Likewise.
722 (cp_parser_objc_protocol_expression): Likewise.
723 (cp_parser_objc_selector_expression): Likewise.
724 (cp_parser_objc_typename): Likewise.
725 (cp_parser_objc_superclass_or_category): Likewise.
726 (cp_parser_objc_try_catch_finally_statement): Likewise.
727 (cp_parser_objc_synchronized_statement): Likewise.
728 (cp_parser_objc_at_property_declaration): Likewise.
729 (cp_parser_oacc_single_int_clause): Likewise.
730 (cp_parser_oacc_shape_clause): Likewise.
731 (cp_parser_omp_clause_collapse): Likewise.
732 (cp_parser_omp_clause_default): Likewise.
733 (cp_parser_omp_clause_final): Likewise.
734 (cp_parser_omp_clause_if): Likewise.
735 (cp_parser_omp_clause_num_threads): Likewise.
736 (cp_parser_omp_clause_num_tasks): Likewise.
737 (cp_parser_omp_clause_grainsize): Likewise.
738 (cp_parser_omp_clause_priority): Likewise.
739 (cp_parser_omp_clause_hint): Likewise.
740 (cp_parser_omp_clause_defaultmap): Likewise.
741 (cp_parser_omp_clause_ordered): Likewise.
742 (cp_parser_omp_clause_schedule): Likewise.
743 (cp_parser_omp_clause_num_teams): Likewise.
744 (cp_parser_omp_clause_thread_limit): Likewise.
745 (cp_parser_omp_clause_aligned): Likewise.
746 (cp_parser_omp_clause_linear): Likewise.
747 (cp_parser_omp_clause_safelen): Likewise.
748 (cp_parser_omp_clause_simdlen): Likewise.
749 (cp_parser_omp_clause_depend): Likewise.
750 (cp_parser_omp_clause_device): Likewise.
751 (cp_parser_omp_clause_dist_schedule): Likewise.
752 (cp_parser_oacc_clause_async): Likewise.
753 (cp_parser_omp_critical): Likewise.
754 (cp_parser_omp_for_loop): Likewise.
755 (cp_parser_omp_sections_scope): Likewise.
756 (cp_parser_omp_declare_reduction_exprs): Likewise.
757 Update for new param to cp_parser_required_error.
758 (cp_parser_oacc_routine): Likewise.
759 (cp_parser_transaction_expression): Likewise.
760 (cp_parser_cilk_simd_vectorlength): Likewise.
762 2017-08-09 Jason Merrill <jason@redhat.com>
764 PR c++/81525 - wrong constant value with generic lambda
765 * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
766 (tsubst_copy) [VAR_DECL]: Handle auto.
768 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
769 * init.c (get_nsdmi): Add complain parm.
770 * typeck2.c (digest_nsdmi_init): Add complain parm.
771 (process_init_constructor_record): Pass complain to get_nsdmi.
772 * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
773 * method.c (get_defaulted_eh_spec): Add complain parm. Pass it into
774 synthesized_method_walk.
775 (synthesized_method_walk): Adjust.
776 (walk_field_subobs): Pass complain to get_nsdmi.
777 (defaulted_late_check): Skip other checks if deleted.
778 * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
779 * call.c (build_aggr_conv): Pass complain to get_nsdmi.
780 * parser.c (defarg_location): New.
781 * error.c (location_of): Use it.
783 2017-08-09 Marek Polacek <polacek@redhat.com>
785 * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
786 * typeck.c (build_binary_op): Change the type of a parameter to bool.
787 (cp_truthvalue_conversion): Use true instead of 1.
789 2017-08-08 Marek Polacek <polacek@redhat.com>
792 * cp-gimplify.c (cp_fold): If folding exposed a branch of
793 a COND_EXPR, convert it to the original type of the COND_EXPR, if
796 2017-08-08 Martin Liska <mliska@suse.cz>
798 * call.c: Include header files.
799 * cp-gimplify.c: Likewise.
800 * cp-ubsan.c: Likewise.
803 * search.c: Likewise.
804 * semantics.c: Likewise.
805 * typeck.c: Likewise.
807 2017-08-07 Martin Liska <mliska@suse.cz>
809 * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
811 (cp_parser_std_attribute): Likewise.
812 * tree.c: Add new include.
814 2017-08-04 Paolo Carlini <paolo.carlini@oracle.com>
817 * pt.c (do_class_deduction): Handle the case of no viable implicit
818 deduction guides; simplify the code generating implicit deduction
821 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
824 * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
825 destructor as expressions.
827 2017-08-02 Jakub Jelinek <jakub@redhat.com>
830 * call.c (build_user_type_conversion_1): Only call
831 lookup_fnfields_slot if totype is CLASS_TYPE_P.
833 2017-07-31 Jason Merrill <jason@redhat.com>
835 * decl.c (declare_global_var): Set DECL_CONTEXT.
837 2017-07-31 Jan Hubicka <hubicka@ucw.cz>
838 Martin Liska <mliska@suse.cz>
840 * pt.c (tsubst_copy): Copy PREDICT_EXPR.
841 * semantics.c (finish_goto_stmt): Build gimple predict
843 * constexpr.c (potential_constant_expression_1): Handle
846 2017-07-31 Martin Liska <mliska@suse.cz>
849 * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
850 also with current_function_decl non-null equality.
851 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
852 * decl.c (compute_array_index_type): Likewise.
853 * init.c (finish_length_check): Likewise.
854 * typeck.c (cp_build_binary_op): Likewise.
856 2017-07-29 Jakub Jelinek <jakub@redhat.com>
858 * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
859 DW_AT_export_symbols.
860 * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
861 argument, pass it through to the debug hook.
862 (finish_namespace_using_directive): Adjust
863 emit_debug_info_using_namespace caller.
864 (push_namespace): Likewise. Call it after setting
865 DECL_NAMESPACE_INLINE_P.
866 (cp_emit_debug_info_for_using): Pass false as new argument to
867 the imported_module_or_decl debug hook.
869 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
871 * lex.c (copy_decl): Adjust.
872 (copy_type): Likewise.
874 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
877 * lambda.c (add_capture): Early return if we cannot capture by
880 2017-07-26 Jason Merrill <jason@redhat.com>
882 P0702R1 - List deduction of vector.
883 * pt.c (do_class_deduction): Special-case deduction from a single
884 element of related type.
886 2017-07-26 Leonid Koppel <lkoppel@uwaterloo.ca>
888 PR c++/67054 - Inherited ctor with non-default-constructible members
889 * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
890 when deducing an inheriting constructor.
892 2017-07-21 Nathan Sidwell <nathan@acm.org>
894 * search.c (lookup_conversion_operator): Return overloads.
895 (lookup_fnfields_idx_nolazy): Absorb into ...
896 (lookup_fnfields_slot_nolaxy): ... here.
897 (lookup_fnfields_1): Absorb into ...
898 (lookup_fnfields_slot): ... here.
900 Remove special CDtor METHOD_VEC slots.
901 * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
902 CLASSTYPE_DESTRUCTOR_SLOT): Delete.
903 (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
904 (CLASSTYPE_DESTRUCTOR): Likewise.
905 * class (add_method): Don't use special cdtor slots.
906 * search.c (lookup_fnfields_idx_nolazy): Likewise.
907 (look_for_overrides_here): Use lookup_fnfields_slot.
908 * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
910 * call.c (add_candidates): Move decls to initialization. Don't
913 2017-07-20 Nathan Sidwell <nathan@acm.org>
916 * class.c (maybe_warn_about_overly_private_class,
917 finish_struct_methods, one_inheriting_sig, count_fields,
918 add_fields_to_record_type, check_field_decls, check_methods,
919 clone_function_decl, set_method_tm_attributes,
920 finalize_literal_type_property, check_bases_and_members,
921 create_vtable_ptr, determine_key_method,
922 unreverse_member_declarations, finish_struct,
923 add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
924 * decl.c (fixup_anonymous_aggr): Likewise.
925 * decl2.c (reset_type_linkage_2): Likewise.
926 * method.c (after_nsdmi_defaulted_late_checks,
927 lazily_declare_fn): Likewise.
928 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
929 * pt.c (instantiate_class_template_1, tsubst_expr,
930 do_type_instantiation, instantiate_pending_templates): Likewise.
931 * search.c (lookup_field_1): Likewise.
932 * semantics.c (finish_member_declaration,
933 finish_omp_declare_simd_methods): Likewise.
935 2017-07-19 Nathan Sidwell <nathan@acm.org>
937 * class.c (add_implicitly_declared_members): Use
938 classtype_has_move_assign_or_move_ctor_p.
939 (classtype_has_move_assign_or_move_ctor,
940 classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
941 (classtype_has_move_assign_or_move_ctor_p): ... this new function.
942 * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
944 (classtype_has_move_assign_or_move_ctor_p): ... this.
945 * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
946 * tree.c (type_has_nontrivial_copy_init): Adjust.
948 * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
949 PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
951 2017-07-18 Nathan Sidwell <nathan@acm.org>
953 * cp-array-notation.c (build_array_notation_ref): Use
954 TYPE_{MIN,MAX}_VALUE.
956 * class.c (classtype_has_move_assign_or_move_ctor): Declare.
957 (add_implicitly_declared_members): Use it.
958 (type_has_move_constructor, type_has_move_assign): Merge into ...
959 (classtype_has_move_assign_or_move_ctor): ... this new function.
960 * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
962 2017-07-17 Volker Reichelt <v.reichelt@netcologne.de>
964 * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
965 friend outside class and obsolete auto as storage-class-specifier.
967 2017-07-17 Nathan Sidwell <nathan@acm.org>
969 * class.c (maybe_warn_about_overly_private_class): Ignore public
972 * class.c (type_has_user_declared_move_constructor,
973 type_has_user_declared_move_assign): Combine into ...
974 (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
975 * cp-tree.h (type_has_user_declared_move_constructor,
976 type_has_user_declared_move_assign): Combine into ...
977 (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
978 * method.c (maybe_explain_implicit_delete): Use it.
979 (lazily_declare_fn): Use it.
980 * tree.c (type_has_nontrivial_copy_init): Use it.
982 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
983 semantics, simplify implementation.
985 2017-07-16 Volker Reichelt <v.reichelt@netcologne.de>
987 * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
988 in old-style cast diagnostic.
989 * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
990 in useless cast diagnostic.
991 * error.c (type_to_string): Remove enum special handling.
993 2017-07-14 David Malcolm <dmalcolm@redhat.com>
995 * name-lookup.c (get_std_name_hint): Add '<' and '>' around
997 (maybe_suggest_missing_header): Update for addition of '<' and '>'
998 to above. Provide a fix-it hint.
999 * pt.c: Include "gcc-rich-location.h"
1000 (listify): Attempt to add fix-it hint for missing
1001 #include <initializer_list>.
1002 * rtti.c: Include "gcc-rich-location.h".
1003 (typeid_ok_p): Attempt to add fix-it hint for missing
1004 #include <typeinfo>.
1006 2017-07-12 Jason Merrill <jason@redhat.com>
1008 P0512R0 - Deduction from an initializer list.
1009 * pt.c (do_class_deduction): Do list deduction in two phases.
1011 2017-07-12 Nathan Sidwell <nathan@acm.org>
1013 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
1014 DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
1016 * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
1017 DECL_CXX_DESTRUCTOR explicitly.
1018 * decl2.c (grokclassfn): Likewise.
1019 * friend.c (do_friend): Likewise.
1020 * method.c (make_thunk, make_alias_for,
1021 implicitly_declare_fn): Likewise.
1023 2017-07-11 Jason Merrill <jason@redhat.com>
1026 * decl.c (grokparms): Downgrade error about array of unknown bound
1027 to pedwarn and disable it for C++17.
1029 2017-07-11 Nathan Sidwell <nathan@acm.org>
1031 * decl2.c (reset_type_linkage_2): Dont't change ctor name.
1033 2017-07-10 Martin Sebor <msebor@redhat.com>
1035 * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
1037 2017-07-06 Jason Merrill <jason@redhat.com>
1039 PR c++/81204 - parse error with dependent template-name
1040 * parser.c (cp_parser_lookup_name): Revert previous change.
1042 2017-07-06 David Malcolm <dmalcolm@redhat.com>
1044 * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
1045 selftest::run_cp_tests.
1046 (selftest::run_cp_tests): New function.
1047 * cp-tree.h (selftest::run_cp_tests): New decl.
1049 2017-07-04 Jakub Jelinek <jakub@redhat.com>
1051 * parser.c (cp_parser_decomposition_declaration): Replace
1052 decomposition declaration with structured binding in diagnostics.
1053 * decl.c (cp_finish_decomp): Likewise.
1054 (grokdeclarator): Likewise.
1057 * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
1058 forms of structured binding initializers.
1060 2017-07-03 Paolo Carlini <paolo.carlini@oracle.com>
1063 * decl.c (grokdeclarator): Move checks on function return type after
1064 the splice_late_return_type call; if declspecs->locations[ds_type_spec]
1065 is UNKNOWN_LOCATION fall back to input_location.
1067 2017-07-03 David Malcolm <dmalcolm@redhat.com>
1069 * parser.c (enum required_token): Fix spelling of
1070 RT_INTERATION to RT_ITERATION.
1071 (cp_parser_iteration_statement): Likewise.
1072 (cp_parser_required_error): Likewise.
1074 2017-06-30 Jason Merrill <jason@redhat.com>
1076 PR c++/81257 - ICE with invalid ::template.
1077 PR c++/54769 - wrong lookup of dependent template-name.
1078 * parser.c (cp_parser_template_name): Revert part of last change.
1080 2017-06-30 Nathan Sidwell <nathan@acm.org>
1082 * config-lang.in (gtfiles): Add cp/lex.c.
1083 * cp-tree.h (mangle_convop_name_for_type): Rename ...
1084 (make_conv_op_name): ... here. Move to lex.
1085 * lambda.c (maybe_add_lambda_conv_op): Update.
1086 * parser.c (cp_parser_conversion_function_id): Update.
1087 * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
1088 tsubst_copy_and_build): Update.
1089 * semantics.c (apply_deduced_return_type): Update.
1090 * mangle.c (conv_type_hasher, conv_type_names,
1091 mangle_conv_op_name_for_type): Move to ...
1092 * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
1095 2017-06-30 David Malcolm <dmalcolm@redhat.com>
1098 * parser.c (cp_parser_postfix_expression): Construct a location
1099 for typeid expressions.
1101 2017-06-30 Nathan Sidwell <nathan@acm.org>
1103 * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
1105 (lookup_all_conversions): Declare.
1106 * class.c (get_basefndecls): Use lookup_fnfields_slot.
1107 * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
1108 * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
1110 * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
1111 (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
1112 lookup_all_conversions.
1113 * search.c (lookup_fnfields_1): Make static.
1114 (lookup_all_conversions): New.
1115 (class_method_index_for_fn): Delete.
1116 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
1117 lookup_fnfields_slot.
1119 * call.c (build_new_method_call_1): Use constructo_name to get
1120 ctor name. Move argument processing earlier to merge cdtor
1122 * decl.c (grokfndecl): Cdtors have special names.
1123 * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
1124 * pt.c (check_explicit_specialization): Cdtor name is already
1126 * search.c (class_method_index_for_fn): Likewise.
1129 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
1130 a matching TYPE_DECL.
1132 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
1134 * class.c (add_method): Change pair of errors to error + inform.
1135 (handle_using_decl): Likewise.
1137 2017-06-29 Jason Merrill <jason@redhat.com>
1139 * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
1141 PR c++/81180 - ICE with C++17 deduction of member class template.
1142 * pt.c (build_deduction_guide): Correct member template handling.
1144 PR c++/81188 - matching decltype of member function call.
1145 * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
1147 2017-06-29 Nathan Sidwell <nathan@acm.org>
1150 * parser.c (cp_parser_namespace_definition): Immediately close the
1151 namespace if there's no open-brace.
1152 * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
1155 2017-06-29 Jason Merrill <jason@redhat.com>
1157 PR c++/81164 - ICE with invalid inherited constructor.
1158 * search.c (binfo_direct_p): New.
1159 * name-lookup.c (do_class_using_decl): Use it.
1161 2017-06-29 Nathan Sidwell <nathan@acm.org>
1163 * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
1164 VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
1165 * decl.c (initialize_predefined_identifiers): Name cdtor special
1166 names consistently. Use literals for above deleted defines.
1167 (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
1169 * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
1172 * call.c (check_dtor_name): Use constructor_name for enums too.
1173 (build_new_method_call_1): Use constructor_name for cdtors and
1175 * class.c (build_self_reference): Use TYPE_NAME to get name of
1177 * name-lookup (constructor_name): Use DECL_NAME directly.
1178 (constructor_name_p): Reimplement.
1179 (push_class_level_binding_1): Use TYPE_NAME directly.
1181 * class.c (finish_struct): Use OVL_P.
1182 (get_vfield_name): Measure constructor_name length.
1183 * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
1184 (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
1185 * cxx-pretty-print.c (is_destructor_name): Delete.
1186 (pp_cxx_unqualified_id): Remove bogus destructor name checking.
1187 * decl.c (grokfndecl): Move cheap checks first when looking for
1188 implicit extern cness.
1190 * parser.c (cp_parser_direct_declarator): Reorder if to avoid
1191 indentation. Remove unnecessary assignment of constructor name.
1193 Whitespace cleanups.
1194 * call.c (name_as_c_string): Move CONST_CAST to return.
1195 (build_new_method_call_1): Remove unneeded bracing.
1196 * class.c (include_empty_classes): Unbreak line.
1197 * constraint.cc (tsubst_check_constraint): Add space.
1198 * cp-tree.h (lang_decl_ns): Add comment.
1199 (PTRMEM_CST_MEMBER): Break line.
1200 * decl.c (grokfndecl): Add blank lines. Unbreak some others.
1201 (grokdeclarator): Remove lines, move declaration to first use.
1202 * decl2.c (decl_needed_p): Fix indentation.
1203 (c_parse_final_cleanups): Remove blank line.
1204 * method.c (implicitly_declare_fn): Move declaration to first use.
1205 * search.c (current_scope): Add blank lines.
1207 2017-06-28 Jason Merrill <jason@redhat.com>
1209 PR c++/72764 - ICE with invalid template typename.
1210 * decl.c (build_typename_type): No longer static.
1211 * tree.c (strip_typedefs): Use it instead of make_typename_type.
1213 PR c++/69300 - ICE with self-referential noexcept
1214 * pt.c (maybe_instantiate_noexcept): Check for recursion.
1216 PR c++/61022 - error with variadic template template parm
1217 * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
1219 PR c++/72801 - ICE with variadic partial specialization
1220 * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
1222 PR c++/55639 - partial specialization with ::template
1223 * parser.c (cp_parser_class_head): Handle ::template.
1225 PR c++/45976 - error with ::template in declarator.
1226 * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
1228 PR c++/54769 - wrong lookup of dependent template-name.
1229 * parser.c (cp_parser_template_name): Handle dependent object type.
1230 (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
1232 (cp_parser_id_expression): Pass it.
1233 (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
1235 * parser.c (cp_parser_template_id): Use the range location on the
1238 PR c++/81204 - parse error with dependent template-name
1239 * parser.c (cp_parser_lookup_name): Disqualify function templates
1242 2017-06-27 Nathan Sidwell <nathan@acm.org>
1244 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
1245 initialization point. Don't unnecessarily check for ctor name.
1247 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
1248 (CLASSTYPE_DESTRUCTOR): ... this.
1249 * class.c (accessible_nvdtor_p,
1250 maybe_warn_about_overly_private_class,
1251 add_implicitly_declared_members,
1252 clone_constructors_and_destructors, type_has_virtual_destructor):
1253 Adjust for CLASSTYPE_DESTRUCTOR.
1254 (deduce_noexcept_on_destructors): Absorb into ...
1255 (check_bases_and_members): ... here.
1256 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
1257 * init.c (build_delete): Likewise.
1258 * parser.c (cp_parser_lookup_name): Likewise.
1259 * pt.c (check_explicit_specialization): Likewise.
1260 * rtti.c (emit_support_tinfos): Likewise.
1261 * search.c (lookup_fnfields_idx_nolazy): Likewise.
1263 Kill IDENTIFIER_TEMPLATE.
1264 * cp-tree.h (lang_identifier): Remove class_template_info field.
1265 (IDENTIFIER_TEMPLATE): Delete.
1266 * name-lookup.c (constructor_name_full): Subsume into ...
1267 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
1268 (constructor_name_p): Likewise.
1269 * mangle.c (write_source_name): Likewise.
1270 * ptree.c (cxx_print_identifier): Likewise.
1272 2017-06-27 Marek Polacek <polacek@redhat.com>
1275 * parser.c (cp_parser_already_scoped_statement): Initialize
1278 2017-06-26 Jason Merrill <jason@redhat.com>
1280 PR c++/81215 - deduction failure with variadic TTP.
1281 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
1283 2017-06-26 Martin Sebor <msebor@redhat.com>
1286 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
1287 to detect casting away cv-qualifiers.
1289 2017-06-26 Nathan Sidwell <nathan@acm.org>
1291 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
1292 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
1294 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
1295 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
1296 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
1297 * decl.c (grok_op_properties): Adjust identifier checking.
1298 * init.c (expand_default_init): Adjust identifier descision.
1299 * method.c (implicitly_declare_fn): Don't use
1300 DECL_ASSIGNMENT_OPERATOR_P.
1301 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
1303 * call.c (in_charge_arg_for_name): Reimplement.
1304 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
1307 2017-06-26 Marek Polacek <polacek@redhat.com>
1310 * parser.c (cp_parser_statement): Add a default argument. Save the
1311 location of the expression-statement after labels have been parsed.
1312 (cp_parser_implicitly_scoped_statement): Set the location of the
1313 body of the conditional after parsing all the labels. Call
1314 warn_for_multistatement_macros.
1315 (cp_parser_already_scoped_statement): Likewise.
1317 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
1320 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
1321 'typename' in error messages about missing 'typename'.
1323 2017-06-23 Jason Merrill <jason@redhat.com>
1325 PR c++/79056 - C++17 ICE with invalid template syntax.
1326 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
1328 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
1329 * pt.c (template_placeholder_p): New.
1330 * cp-tree.h: Declare it.
1332 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
1334 * decl.c (duplicate_decls): Use builtin_structptr_types.
1336 2017-06-22 Nathan Sidwell <nathan@acm.org>
1338 Reorder IDENTIFIER flags
1340 * cp-tree.h (enum cp_identifier_kind): New.
1341 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
1342 IDENTIFIER_KIND_BIT_2): New.
1343 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
1344 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
1345 (C_IS_RESERVED_WORD): Replace with ...
1346 (IDENTIFIER_KEYWORD_P): ... this.
1347 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
1348 (IDENTIFIER_CDTOR_P): ... this.
1349 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
1350 (IDENTIFIER_OPNAME_P): Replace with ...
1351 (IDENTIFIER_ANY_OP_P): ... this.
1352 (IDENTIFIER_ASSIGN_OP_P): New.
1353 (IDENTIFIER_TYPENAME_P): Replace with ...
1354 (IDENTIFIER_CONV_OP_P): ... this.
1355 (NEW_DELETE_OPNAME_P): Replace with ...
1356 (IDENTIFIER_NEWDEL_OP_P): ... this.
1357 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
1358 (get_identifier_kind_name, set_identifier_kind): Declare.
1359 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
1360 (init_operators): Adjust to avoid keywords, use
1361 set_identifier_kind. Copy TYPE_EXPR slot.
1362 (init_reswords): Call set_identifier_kind.
1363 (unqualified_name_lookup_error): Adjust.
1364 * operators.def (TYPE_EXPR): Remove.
1365 * decl.c (struct predefined_identifier): Move into ...
1366 (initialize_predefined_identifiers): ... here. Call
1367 set_identifier_kind.
1368 (grokfndecl, check_var_type, grokdeclarator): Adjust.
1369 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
1371 * call.c (name_as_c_string): Adjust.
1372 (build_new_method_call_1): Likewise.
1373 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
1374 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
1375 * dump.c (cp_dump_tree): Adjust.
1376 * error.c (dump_decl_name): Adjust.
1377 * mangle.c (write_unqualified_id, write_member_name,
1378 write_expression): Adjust.
1379 (mangle_conv_op_name_for_type): Use set_identifier_kind.
1380 * name-lookup.c (do_class_using_decl): Adjust.
1381 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
1382 * parser.c (cp_lexer_get_preprocessor_token,
1383 cp_parser_direct_declarator): Likewise.
1384 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
1385 tsubst_copy, tsubst_copy_and_build): Adjust.
1386 * ptree.c (cxx_print_identifier): Print identifier kind.
1387 * search.c (lookup_field_r, lookup_member,
1388 lookup_fnfields_idx_nolazy): Adjust.
1389 * semantics.c (finish_id_expression): Adjust..
1390 * typeck.c (cp_build_addr_expr_1): Adjust.
1392 2017-06-21 Jakub Jelinek <jakub@redhat.com>
1395 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
1396 Complain about t not being a variable if t is OVERLOAD even
1397 when processing_template_decl.
1399 2017-06-21 David Malcolm <dmalcolm@redhat.com>
1401 * parser.c (get_cast_suggestion): New function.
1402 (maybe_add_cast_fixit): New function.
1403 (cp_parser_cast_expression): Capture the location of the closing
1404 parenthesis. Call maybe_add_cast_fixit when emitting warnings
1405 about old-style casts.
1407 2017-06-20 Jason Merrill <jason@redhat.com>
1409 PR c++/80972 - C++17 ICE with attribute packed.
1410 * call.c (build_over_call): Allow a TARGET_EXPR from reference
1413 2017-06-20 Nathan Sidwell <nathan@acm.org>
1415 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
1416 (nelts_identifier): Delete.
1417 * decl.c (initialize_predefined_identifiers): Remove nelts.
1419 PR c++/67074 - namespace aliases
1420 * decl.c (duplicate_decls): Don't error here on mismatched
1422 * name-lookup.c (name_lookup::add_value): Matching namespaces are
1424 (diagnose_name_conflict): Namespaces are never redeclarations.
1425 (update_binding): An alias can match a real namespace.
1427 2017-06-19 Jason Merrill <jason@redhat.com>
1429 PR c++/80562 - ICE with constexpr if.
1430 * semantics.c (finish_if_stmt_cond): Call
1431 instantiate_non_dependent_expr.
1433 PR c++/80829 - ICE with constexpr copy of base subobject.
1434 * constexpr.c (clear_no_implicit_zero): New.
1435 (cxx_eval_call_expression): Call it.
1437 2017-06-19 Nathan Sidwell <nathan@acm.org>
1441 * name-lookup.c (set_decl_namespace): Don't follow using
1442 directives and ignore using decls. Only check overly-explicit
1443 scope after discovering decl.
1445 2017-06-19 Jason Merrill <jason@redhat.com>
1447 PR c++/81073 - constexpr and static var in statement-expression.
1448 * typeck2.c (store_init_value): Always call
1449 require_potential_constant_expression.
1450 * pt.c (convert_nontype_argument): Likewise.
1451 * constexpr.c (potential_constant_expression_1): Adjust message.
1452 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
1453 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
1455 2017-06-19 Nathan Sidwell <nathan@acm.org>
1457 * pt.c (coerce_template_parms): Fix indentation.
1458 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
1462 * name-lookup.c (update_binding): Only warn about constructors
1463 hidden by functions.
1465 2017-06-17 Jason Merrill <jason@redhat.com>
1467 PR c++/60063 - -Wunused-local-typedefs and templates.
1468 * decl2.c (is_late_template_attribute): Return false for "used".
1470 PR c++/70844 - -Wuseless-cast and inheriting constructor.
1471 * method.c (forward_parm): Suppress warn_useless_cast.
1473 2017-06-16 Jason Merrill <jason@redhat.com>
1475 PR c++/81045 - Wrong type-dependence with auto return type.
1476 * pt.c (type_dependent_expression_p): An undeduced auto outside the
1477 template isn't dependent.
1478 * call.c (build_over_call): Instantiate undeduced auto even in a
1481 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
1482 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
1483 set longer for a generic lambda.
1485 PR c++/80614 - Wrong mangling for C++17 noexcept type
1486 * mangle.c (write_type): Put the eh spec back on the function type.
1488 PR c++/81102 - Wrong error with partial specialization.
1489 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
1490 types. Do type deduction later.
1492 PR c++/81074 - ICE with partial specialization of member template.
1494 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
1496 PR c++/80831 - ICE with -fsyntax-only.
1497 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
1499 PR c++/80639 - ICE with invalid PMF initialization.
1500 PR c++/80043 - ICE with -fpermissive
1501 * typeck.c (convert_for_assignment): Recurse when instantiate_type
1502 returns without an error.
1504 2017-06-16 Nathan Sidwell <nathan@acm.org>
1506 * pt.c (tsubst_baselink): Fix & clarify formatting.
1508 * cp-tree.h (build_this_parm, cp_build_parm_decl,
1509 build_artificial_parm): Add FN parm.
1510 * decl.c (start_cleanup_fn): Adjust.
1511 (build_this_parm): Add FN parm, pass it through.
1512 (grokfndecl): Adjust parm building.
1513 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
1514 (build_artificial_parm): Add FN parm, pass through.
1515 (maybe_retrofit_in_chrg): Adjust parm building.
1516 (start_static_storage_duration_function): Likwise.
1517 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
1518 * method.c (implicitly_declare_fn): Likewise.
1519 * parser.c (inject_this_parameter): Likewise.
1521 Symbol tables are insert only.
1522 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
1523 derive from pointer_hash. Make undeletable.
1525 * class.c (resort_type_method_vec): Avoid potential unsigned
1528 Don't defer noexcept_deferred_spec.
1529 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
1530 * decl.c (cxx_init_decl_processing): Initialize
1531 noexcept_deferred_spec.
1532 * except.c (unevaluated_noexcept_spec): Delete.
1533 * class.c (deduce_noexcept_on_destructor): Use
1534 noexcept_deferred_spec directly.
1535 * method.c (implicitly_declare_fn): Likewise.
1537 Make keyed_classes a vector.
1538 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
1539 (keyed_classes): Declare as vector.
1540 * decl.c (keyed_classes): Define.
1541 (cxx_init_decl_processing): Allocate it.
1542 (record_key_method_defined): Use vec_safe_push.
1543 * class.c (finish_struct_1): Likewise.
1544 * pt.c (instantiate_class_template_1): Likewise.
1545 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
1548 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
1549 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
1551 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
1552 (get_tinfo_decl): Use get_tinfo_desc.
1553 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
1554 (create_pseudo_type_info): Delete.
1555 (get_pseudo_ti_index): Just determine the index.
1556 (get_tinfo_desc): New. Create all types lazily.
1557 (create_tinfo_types): Just allocate the descriptor array.
1558 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
1561 2017-06-15 Martin Sebor <msebor@redhat.com>
1564 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
1566 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
1567 (build_cxx_call): Call maybe_warn_class_memaccess.
1569 2017-06-14 Jakub Jelinek <jakub@redhat.com>
1571 * cp-gimplify.c (cp_genericize_r): Turn most of the function
1572 into a switch (TREE_CODE (stmt)) statement from long else if
1575 2017-06-13 Jakub Jelinek <jakub@redhat.com>
1578 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
1579 argument even if it has REFERENCE_TYPE.
1582 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
1583 BLOCK_VARS (outer) chain.
1584 (cxx_omp_const_qual_no_mutable): Likewise.
1586 2017-06-13 Martin Liska <mliska@suse.cz>
1589 * class.c (build_base_path): Use sanitize_flags_p.
1590 * cp-gimplify.c (cp_genericize_r): Likewise.
1591 (cp_genericize_tree): Likewise.
1592 (cp_genericize): Likewise.
1593 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1594 * decl.c (compute_array_index_type): Likewise.
1595 (start_preparsed_function): Likewise.
1596 * decl2.c (one_static_initialization_or_destruction): Likewise.
1597 * init.c (finish_length_check): Likewise.
1598 * lambda.c (maybe_add_lambda_conv_op): Likewise.
1599 * typeck.c (cp_build_binary_op): Likewise.
1600 (build_static_cast_1): Likewise.
1602 2017-06-11 Jason Merrill <jason@redhat.com>
1604 * error.c (dump_expr): Use is_this_parameter.
1606 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
1609 2017-06-09 Jason Merrill <jason@redhat.com>
1611 Missing bits from N4268, constant evaluation for all non-type args.
1612 * call.c (build_converted_constant_expr): Rename from
1613 build_integral_nontype_arg_conv, handle all types.
1614 * pt.c (convert_nontype_argument): In C++17 call it for all types.
1615 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
1616 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
1618 Overhaul pointer-to-member conversion and template argument handling.
1619 * call.c (standard_conversion): Avoid creating ck_pmem when the
1620 class type is the same.
1621 * cvt.c (can_convert_qual): Split from
1622 perform_qualification_conversions.
1623 * constexpr.c (cxx_eval_constant_expression): Check it.
1624 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
1625 adjustment is necessary.
1626 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
1627 (convert_nontype_argument): Avoid redundant error.
1629 * call.c (convert_like_real): Remove "inner" parameter.
1630 Don't replace a constant with its value.
1631 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
1633 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
1636 * parser.c (cp_parser_constant_expression): Check
1637 potential_rvalue_constant_expression after decay_conversion.
1638 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
1640 PR c++/80384 - ICE with dependent noexcept-specifier
1641 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
1644 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
1646 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
1648 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
1649 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
1650 (excpet.c): Mark terminate as cold.
1652 2017-06-08 Jakub Jelinek <jakub@redhat.com>
1655 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
1656 to sizetype before size_binop.
1659 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
1660 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
1661 and OMP_CLAUSE_SHARED_READONLY flags.
1663 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
1665 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
1667 2017-06-07 Nathan Sidwell <nathan@acm.org>
1669 * class.c (layout_class_type): Restructure overlong-bitfield tpe
1672 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
1675 * pt.c (do_class_deduction): Build qualified type.
1677 2017-06-06 Nathan Sidwell <nathan@acm.org>
1679 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
1680 sans using directives. Don't walk into inline namespaces.
1683 * name-lookup.c (adl_class_only): Don't add visible friends.
1685 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
1687 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
1689 2017-06-02 Nathan Sidwell <nathan@acm.org>
1691 Remove lang_type_ptrmem.
1692 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
1694 (lang_type_class): ... this. Reorder bitfields. Rename to ...
1695 (lang_type): ... this. Delete old definition.
1696 (lang_type_ptrmem): Delete.
1697 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
1698 (LANG_TYPE_PTRMEM_CHECK): Delete.
1699 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
1700 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
1701 * decl.c (build_ptrmemfunc_type): Adjust.
1702 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
1703 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
1705 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
1708 Remove cp_binding_level::namespaces
1709 * name-lookup.h (cp_binding_level): Lose namespaces field.
1710 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
1712 (suggest_alternatives_for): Adjust for namespace list. Do
1713 breadth-first search.
1714 * decl2.c (collect_source_refs): Namespaces are on the regulr
1716 (collect_ada_namespace): Likewise.
1718 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
1720 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
1723 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
1726 * method.c (constructible_expr): Strip array types before calling
1729 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
1732 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
1733 for case INDIRECT_REF too in the main switch.
1735 2017-05-31 Jason Merrill <jason@redhat.com>
1737 PR c++/80840 - ICE with constexpr and reference
1738 * pt.c (convert_nontype_argument): Don't test whether a decl is
1739 value-dependent when binding to a reference.
1741 2017-05-31 Nathan Sidwell <nathan@acm.org>
1743 * cp-tree.h (lang_decl_slector): New enum.
1744 (lang_decl_base): Make selector an enum. Drop decomposition_p
1746 (lang_decl): Use enum for discrimination.
1747 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
1748 LANG_DECL_DEOMP_CHECK): Use enum.
1749 (DECL_DECOMPOSITION_P): Use selector value.
1750 (SET_DECL_DECOMPOSITION_P): Delete.
1751 (retrofit_lang_decl): Lose SEL parm.
1752 (fit_decomposition_lang_decl): Declare.
1753 * decl.c (cp_finish_decomp, grokdeclarator): Use
1754 fit_decomposition_lang_decl.
1755 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
1757 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
1758 (fit_decomposition_lang_decl): Likewise.
1759 (retrofit_lang_decl): Use worker functions.
1760 (cxx_dup_lang_specific_decl): Use selector enum.
1761 (maybe_add_lang_type_raw): New. Broken out of ...
1762 (cxx_make_type_name): ... here. Call it.
1764 2017-05-30 Jason Merrill <jason@redhat.com>
1766 PR c++/80856 - ICE with local extern in template
1767 * semantics.c (finish_call_expr): Replace a local extern overload
1768 set in a template with the IDENTIFIER_NODE.
1770 2017-05-30 David Malcolm <dmalcolm@redhat.com>
1772 * call.c (perform_implicit_conversion_flags): Convert
1773 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
1774 (print_conversion_rejection): Replace pairs of %qT with
1775 %qH and %qI in various places.
1776 (build_user_type_conversion_1): Likewise.
1777 (build_integral_nontype_arg_conv): Likewise.
1778 (build_conditional_expr_1): Likewise.
1779 (convert_like_real): Likewise.
1780 (convert_arg_to_ellipsis): Likewise.
1782 (initialize_reference): Likewise.
1783 * cvt.c (cp_convert_to_pointer): Likewise.
1784 (cp_convert_to_pointer): Likewise.
1785 (convert_to_reference): Likewise.
1786 (ocp_convert): Likewise.
1787 * error.c (cp_printer): Gain bool and const char ** parameters.
1788 (struct deferred_printed_type): New struct.
1789 (class cxx_format_postprocessor): New class.
1790 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
1791 to pp->m_format_postprocessor.
1792 (comparable_template_types_p): New function.
1793 (newline_and_indent): New function.
1794 (arg_to_string): New function.
1795 (print_nonequal_arg): New function.
1796 (print_template_differences): New function.
1797 (type_to_string_with_compare): New function.
1798 (print_template_tree_comparison): New function.
1799 (append_formatted_chunk): New function.
1800 (add_quotes): New function.
1801 (cxx_format_postprocessor::handle): New function.
1802 (defer_phase_2_of_type_diff): New function.
1803 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
1805 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
1806 %qH and %qI in various places.
1807 (convert_member_func_to_ptr): Likewise.
1808 (build_reinterpret_cast_1): Likewise.
1809 (convert_for_assignment): Likewise.
1810 * typeck2.c (check_narrowing): Likewise.
1812 2017-05-30 Nathan Sidwell <nathan@acm.org>
1814 Kill IDENTIFIER_NAMESPACE_BINDINGS
1815 * cp-tree.h (lang_identifier): Delete namespace_bindings.
1816 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
1817 (lang_decl_ns): Add bindings.
1818 (DECL_NAMESPACE_BINDINGS): New.
1819 * lex.c (retrofit_lang_decl): Create namespace hash table.
1820 * name-lookup.c (find_namespace_slot): Change to use hash-map.
1821 * ptree.c (cxx_print_binding): Delete.
1822 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
1824 * cp-tree.def (OVERLOAD): Fix comment.
1825 * cp-tree.h: Fix comments and whitespace.
1826 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
1827 * name-lookup.c (add_decl_to_level): Assert not class.
1828 (check_local_shadow): Use OVL_P.
1829 (pushdecl_with_scope_1): Rename to ...
1830 (do_pushdecl_with_Scope): ... here.
1831 (do_nonmember_using_decl): Use qualified_namespace_lookup return
1833 (push_class_level_binding_1): Use OVL_P.
1834 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
1835 (pushtag_1): Rename to ...
1836 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
1838 (store_class_bindings): Do not time here.
1839 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
1840 * pt.c (listify): Declare argvec at point of initialization.
1843 * name-lookup.c (add_decl_to_level): Assert not making a circular
1845 (update_binding): Don't prematurely slide artificial decl.
1847 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
1849 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
1851 2017-05-29 Nathan Sidwell <nathan@acm.org>
1853 PR c++/80891 (#1,#5)
1854 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
1855 * name-lookup.c (name_lookup): Add deduping field.
1856 (name_lookup::preserve_state, name_lookup::restore_state): Deal
1858 (name_lookup::add_overload): New.
1859 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
1860 (name_lookup::search_adl): Set deduping. Don't unmark here.
1861 * pt.c (most_specialized_instantiation): Revert previous change,
1862 Assert not given duplicates.
1863 * tree.c (lookup_mark): Just mark the underlying decls.
1864 (lookup_maybe_add): Dedup using marked decls.
1867 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
1868 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
1870 Stat hack representation
1871 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
1872 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
1874 (find_namespace_binding): Replace with ...
1875 (find_namespace_slot): ... this.
1876 (find_namespace_value): New.
1877 (name_lookup::search_namespace_only,
1878 name_lookup::adl_namespace_only): Adjust.
1879 (update_binding): Add SLOT parameter, adjust.
1880 (check_local_shadow): Use find_namespace_value.
1881 (set_local_extern_decl_linkage): Likewise.
1882 (do_pushdecl): Adjust for namespace slot.
1883 (push_local_binding): Assert not a namespace binding.
1884 (check_for_out_of_scope_variable): Use find_namespace_value.
1885 (set_identifier_type_value_with_scope): Likewise.
1886 (get_namespace_binding): Likewise.
1887 (set_namespace_binding): Delete.
1888 (set_global_binding): Directly update the binding.
1889 (finish_namespace_using_decl): Likewise.
1890 (lookup_type_scope_1): Use find_namespace_slot and update.
1891 (do_push_nested_namespace): Use find_namespace_value.
1894 * pt.c (most_specialized_instantiation): Cope with duplicate
1898 * cp-tree.h (build_min_nt_call_vec): Declare.
1899 * decl.c (build_offset_ref_call_from_tree): Call it.
1900 * parser.c (cp_parser_postfix_expression): Likewise.
1901 * pt.c (tsubst_copy_and_build): Likewise.
1902 * semantics.c (finish_call_expr): Likewise.
1903 * tree.c (build_min_nt_loc): Keep unresolved lookups.
1904 (build_min): Likewise.
1905 (build_min_non_dep): Likewise.
1906 (build_min_non_dep_call_vec): Likewise.
1907 (build_min_nt_call_vec): New.
1910 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
1912 (lookup_keep): Call it.
1914 2017-05-26 Nathan Sidwell <nathan@acm.org>
1917 * name-lookup.c (push_inline_namespaces): New.
1918 (push_namespace): Look inside inline namespaces.
1920 Inline and using namespace representation change.
1921 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
1923 (DECL_NAMESPACE_USING): Adjust.
1924 (DECL_NAMESPACE_INLINEES): New.
1925 * name-lookup.h (struct cp_binding_level): Change usings
1927 * name-lookup.c (name_lookup::do_queue_usings,
1928 name_lookup::queue_usings): Adjust.
1929 (name_lookup::search_namespace, name_lookup::search_usings,
1930 name_lookup::queue_namespace): Adjust.
1931 (name_lookup::adl_namespace_only): Adjust.
1932 (add_using_namespace, push_namespace): Push onto vector.
1933 (pop_namespace): Add timing logic.
1935 * call.c (build_operator_new_call): Do namelookup and ADL here.
1936 (build_new_op_1): Likewise.
1937 * name-lookup.h (lookup_function_nonclass): Delete declaration.
1938 (do_using_directive): Likewise.
1939 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
1941 (struct scope_binding): Delete.
1942 (EMPTY_SCOPE_BINDING): Delete.
1943 (set_decl_namespace): Use OVL_P.
1944 (finish_local_using_decl): Lose unnecesary checks.
1945 (lookup_function_nonclass): Delete.
1946 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
1948 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
1949 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
1951 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
1952 (lkp_iterator): Add outer field. Adjust ctor.
1953 (lkp_iterator::operator++): New.
1954 (lookup_mark, lookup_maybe_add): Declare.
1955 * name-lookup.c (name_lookup): Delete fn_set member.
1956 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
1958 (name_lookup::add_value): Use lookup_add directly.
1959 (name_lookup::add_fns: Use lookup_maybe_add.
1960 (name_lookup::search_adl): Mark and unmark fns.
1962 * pt.c (check_explicit_specialization): Use lookup_add directly.
1963 * ptree.c (cxx_print_xnode): Show complete overload structure.
1964 * tree.c (lookup_mark, lookup_maybe_add): New.
1966 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
1968 2017-05-26 Jakub Jelinek <jakub@redhat.com>
1970 * cp-tree.h (struct lang_decl_decomp): New type.
1971 (struct lang_decl): Add u.decomp.
1972 (LANG_DECL_DECOMP_CHECK): Define.
1973 (DECL_DECOMPOSITION_P): Note it is set also on the vars
1974 for user identifiers.
1975 (DECL_DECOMP_BASE): Define.
1976 (retrofit_lang_decl): Add extra int = 0 argument.
1977 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
1978 use it to influence the selector choices and for selector
1979 0 to non-zero transition copy old content.
1980 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
1981 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
1982 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
1983 wording if decl is a structured binding.
1984 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
1985 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
1986 of individual variables for tuple structured bindings.
1987 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
1988 Clear DECL_DECOMP_BASE.
1989 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
1990 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
1992 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
1995 2017-05-25 Jason Merrill <jason@redhat.com>
1997 PR c++/80605 - __is_standard_layout and zero-length array
1998 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
2000 2017-05-25 Nathan Sidwell <nathan@acm.org>
2002 Kill OVL_CURRENT, OVL_NEXT.
2003 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
2004 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
2005 (consider_binding_level): Use OVL_FIRST.
2006 (cp_emit_debug_info_for_using): Use lkp_iterator.
2007 * pt.c (check_explicit_specialization): Use ovl_iterator.
2009 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
2010 * cp-tree.h (lang_decl_ns): Remove ns_users field.
2011 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
2012 (TREE_INDIRECT_USING): Delete.
2013 * name-lookup.h (is_associated_namespace): Delete.
2014 * name-lookup.c (name_lookup::search_usings,
2015 name_lookup::do_queue_usings): Usings are always direct.
2016 (is_associated_namespace): Delete.
2017 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
2018 (namespace_ancestor_1, namespace_ancestor): Delete.
2019 (push_using_directive_1, push_using_directive): Delete.
2020 (add_using_namespace_1): Delete.
2021 (add_using_namespace): Reimplement.
2022 (emit_debug_info_using_namespace): New.
2023 (finish_namespace_using_directive, finish_local_using_directive,
2024 push_namespace): Adjust.
2025 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
2027 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
2029 * semantics.c (finish_handler_parms): Warn about non-reference type
2032 2017-05-25 Nathan Sidwell <nathan@acm.org>
2034 Reimplement unqualified namespace lookup.
2035 * name-lookup.c (name_lookup::using_pair,
2036 name_lookup::using_queue): New typedefs.
2037 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
2038 name_lookup::queue_usings): New.
2039 (name_lookup::search_unqualified): New.
2040 (merge_functions, same_entity_p, ambiguous_decl,
2041 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
2042 lookup_using_namespace): Delete.
2043 (lookup_name_real_1): Adjust.
2045 Reimplement qualified namespace lookup.
2046 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
2047 (name_lookup::ambiguous, name_lookup::add_value,
2048 name_lookup::add_type, name_lookup::process_binding): New.
2049 (name_lookup::search_namespace_only,
2050 name_lookup::search_namespace, name_lookup::search_usings): New.
2051 (name_lookup::search_qualified): New.
2052 (do_nonmember_using_decl, suggest_alternatives_for,
2053 lookup_qualified_name): Adjust.
2054 (tree_vec_contains): Delete.
2055 (qualified_lookup_using_namespace): Rename to ...
2056 (qualified_namespace_lookup): ... here. Reimplement.
2059 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
2060 * name-lookup.h (lookup_arg_dependent): Return plain tree.
2061 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
2062 arg_assoc_args_vec, arg_assoc_type, add_function,
2063 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
2064 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
2065 lookup_arg_dependent_1): Delete.
2066 (name_lookup): New lookup object.
2067 (name_lookup::preserve_state, name_lookup::restore_state,
2068 name_lookup::mark_seen, name_lookup::find_and_mark,
2069 name_lookup::add_fns, name_lookup::adl_namespace_only,
2070 name_lookup::adl_namespace, name_lookup::adl_class_only,
2071 name_lookup::adl_bases, name_lookup::adl_class,
2072 name_lookup::adl_expr, name_lookup::adl_type,
2073 name_lookup::adl_template_arg, name_lookup::search_adl): New.
2074 (lookup_arg_dependent): Return a plain tree. Adjust.
2075 (is_associated_namespace): Move later.
2077 2017-05-24 Nathan Sidwell <nathan@acm.org>
2079 * friend.c (do_friend): Remove check for existing decl.
2080 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
2081 * name-lookup.c (push_local_binding): Directly look for binding.
2082 (lookup_name_innermost_nonclass_level_1): Delete.
2083 (lookup_name_innermost_nonclass_level): Delete.
2085 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
2087 * cp-tree.h (cp_free_lang_data): Add extern.
2088 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
2090 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
2091 * typeck.c (type_unknown_p): Delete.
2092 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
2093 overload management.
2094 (dependent_name): Likewise.
2095 (decl_anon_ns_mem_p): Simplify.
2097 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
2100 * tree.c (reshape_init): Use unqualified type for direct enum init.
2101 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
2102 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
2103 non-class destination types.
2104 (build_const_cast_1): Strip cv-quals from destination types.
2105 (build_static_cast, build_reinterpret_cast, build_const_cast)
2106 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
2108 2017-05-24 Martin Sebor <msebor@redhat.com>
2111 * call.c (fully_fold_internal): Adjust.
2113 2017-05-24 Nathan Sidwell <nathan@acm.org>
2115 * cp-tree.h (ovl_skip_hidden): Declare.
2116 * tree.c (ovl_skip_hidden): New.
2117 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
2118 (lookup_arg_dependent_1): Likewise.
2119 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
2120 (hidden_name_p, remove_hidden_names): Delete.
2121 (lookup_name_real_1): Do not strip hidden names.
2122 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
2124 * cp-tree.h (OVL_HIDDEN_P): New.
2125 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
2126 (ovl_iterator::reveal_node): Declare.
2127 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
2128 (ovl_insert): Order on hiddenness.
2129 (ovl_iterator::reveal_node): New.
2130 * name-lookup.c (anticipated_builtin_p): New.
2131 (supplement_binding_1): Use it.
2132 (set_local_extern_decl_linkage): Use hidden_p.
2133 (do_pushdecl): Deal with unhiding a hidden decl, use
2134 anticipated_builtin_p.
2135 (do_nonmember_using_decl): Use anticipated_decl_p.
2136 (lookup_name_real_1): Use DECL_HIDDEN_P.
2138 2017-05-23 Jason Merrill <jason@redhat.com>
2140 -Wunused and C++17 structured bindings
2141 * decl.c (poplevel): Don't warn about unused structured bindings,
2142 only real variables.
2143 * error.c (dump_simple_decl): Handle structured bindings.
2144 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
2146 2017-05-23 Nathan Sidwell <nathan@acm.org>
2148 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
2149 * name-lookup.c (create_local_binding): New.
2150 (update_binding): New.
2151 (pushdecl_maybe_friend_1): Rename to ...
2152 (do_pushdecl): ... this. Reimplement.
2154 (push_overloaded_decl_1, push_overloaded_decl): Delete.
2156 2017-05-23 Jason Merrill <jason@redhat.com>
2158 PR c++/80396 - built-in for make_integer_sequence.
2159 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
2160 (expand_integer_pack, expand_builtin_pack_call): New.
2161 (find_parameter_packs_r): Check builtin_pack_call_p.
2162 (check_for_bare_parameter_packs): Handle it.
2163 (tsubst_pack_expansion): Call expand_builtin_pack_call.
2164 (declare_integer_pack): New.
2165 (init_template_processing): Call it.
2166 * decl2.c (mark_used): Check builtin_pack_fn_p.
2168 2017-05-23 Nathan Sidwell <nathan@acm.org>
2170 * name-lookup.c (find_namespace_binding): New.
2171 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
2172 (set_identifier_type_value_with_scope): Use find_namespace_binding.
2173 (find_binding, cp_binding_level_find_binding_for_name,
2174 binding_for_name, namespace_binding_1): Delete.
2175 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
2176 (get_namespace_binding, set_namespace_binding,
2177 finish_namespace_using_decl, unqualified_namespace_lookup_1,
2178 qualified_lookup_using_namespace, lookup_type_scope_1,
2179 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
2182 * parser.c (cp_parser_template_id): Keep the lookup when stashing
2185 * cp-tree.h (DECL_HIDDEN_P): New.
2186 * name-lookup.c (set_decl_context,
2187 set_local_extern_decl_linkage): New, broken out of ...
2188 (pushdecl_maybe_friend_1): ... here. Call them.
2190 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
2192 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
2193 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
2196 2017-05-23 Nathan Sidwell <nathan@acm.org>
2198 * cp-tree.h (OVL_P): New.
2199 * name-lookup.h (push_local_binding): Delete.
2200 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
2201 (finish_namespace_using_decl, finish_local_using_decl): ... here
2202 * name-lookup.c (add_decl_to_level): Swap args.
2203 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
2204 (diagnose_name_conflict): Check contexts are same for redecl.
2205 (update_local_overload): New.
2206 (compparms_for_decl_and_using): Rename to ...
2207 (matching_fn_p): ... here.
2208 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
2209 push_local_bindings call.
2210 (push_local_binding): Make static, replace FLAGS arg with
2212 (validate_nonmember_using_decl): Use OVL_FIRST.
2213 (do_nonmember_using_decl): Use in/out parameters. Use
2214 lkp_iterator and simplify.
2215 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
2216 (finish_namespace_using_decl, finish_local_using_decl): ... here.
2218 (lookup_type_current_level): Delete.
2219 * parser.c (cp_parser_using_declaration): Adjust.
2220 * pt.c (tsubst_expr): Adjust.
2222 2017-05-22 Nathan Sidwell <nathan@acm.org>
2224 * name-lookup.h (parse_using_directive): Replace with ...
2225 (finish_namespace_using_directive): ... this and ...
2226 (finish_local_using_directive): ... this.
2227 * name-lookup.c (add_using_namespace_1): Move later.
2228 (add_using_namespace): Move later, add namespace_p arg, remove
2230 (push_using_directive_1): Directly recurse.
2231 (do_using_directive, parse_using_directive): Delete, split into ...
2232 (finish_namespace_using_directive): ... this and ...
2233 (finish_local_using_directive): ... this.
2234 (push_namespace): Use add_using_namespace.
2235 * parser.c (cp_parser_using_directive): Call
2236 finish_namespace_using_directive or finish_local_using_directive.
2237 * pt.c (tsubst_expr): Call finish_local_using_directive.
2239 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
2240 * cp-tree.h (raw_dump_id): Declare.
2241 * decl2.c (raw_dump_id): Define.
2242 (dump_tu): Use raw_dump_id.
2244 * config-lang.in (gtfiles): Sort list, break lines.
2246 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
2247 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
2248 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
2249 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
2250 CPTI_RETHROW_FN): New.
2251 (noexcept_deferred_spec): New.
2252 (terminate_node, call_unexpected_node): Rename to ...
2253 (terminate_fn, call_unexpected_fn): ... here.
2254 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
2255 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
2256 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
2257 (init_exception_processing): Adjust.
2258 (declare_library_fn): Create and push the fns here.
2259 (do_get_exception_ptr, do_begin_catch, do_end_catch,
2260 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
2261 declare_library_fn use.
2262 (unevaluated_noexcept_spec): Adjust.
2263 * cp-gimplify.c (genericize_eh_spec_block,
2264 gimplify_most_not_throw_expr): Adjust.
2266 * name-lookup.c (pushdecl_top_level,
2267 pushdecl_top_level_and_finish): Move after namespace pushing and
2269 (push_to_top_level): Rename to ...
2270 (do_push_to_top_level): ... here. Remove timing code.
2271 (pop_from_top_level_1): Rename to ...
2272 (do_pop_from_top_level): ... here.
2273 (do_push_nested_namespace, do_pop_nested_namespace)
2274 (push_to_top_level): New wrapper for do_push_to_top_level.
2275 (pop_from_top_level): Adjust.
2276 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
2278 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
2280 * config-lang.in (gtfiles): Add c-family/c-format.c,
2281 except.c, init.c, lambda.c and friend.c.
2282 * class.c (dvirt_fn): Move out of function scope,
2284 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
2285 * init.c (fn): Likewise.
2286 * lambda.c (ptr_id, max_id): Likewise.
2287 * friend.c (global_friend): Add GTY attribute.
2289 2017-05-19 Nathan Sidwell <nathan@acm.org>
2291 * call.c (add_list_candidates): Use OVL_FIRST.
2292 (build_new_method_call_1): Likewise.
2293 * cp-tree.h (OVL_SINGLE_P): New.
2294 (TYPE_HIDDEN_P): New.
2295 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
2296 * dump.c (cp_tump_tree): Adjust overload dumping.
2297 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
2299 * method.c (lazily_declare_fn): Assert we added it.
2300 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
2302 (cp_parser_template_name): Use lkp_iterator.
2303 * pt.c (begin_template_parm_list): Fixup comment.
2304 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
2305 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
2306 (ovl_scope): Use lkp_iterator.
2308 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
2310 * parser.c (cp_parser_omp_clause_default): Handle
2311 "OMP_CLAUSE_DEFAULT_PRESENT".
2313 * parser.c (cp_parser_omp_clause_default): Avoid printing more
2314 than one syntax error message.
2316 2017-05-19 Nathan Sidwell <nathan@acm.org>
2318 * class.c (class_dump_id): Define.
2319 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
2320 * cp-objcp-common.c (cp_register_dumps): New.
2321 * cp-objcp-common.h (cp_register_dumps): Declare.
2322 (LANG_HOOKS_REGISTER_DUMPS): Override.
2323 * cp-tree.h (class_dump_id): Declare.
2325 2017-05-18 Nathan Sidwell <nathan@acm.org>
2327 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
2329 (lookup_keep): Declare.
2330 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
2331 * pt.c (tsubst_copy): Assert lookup is persistent.
2332 * semantics.c (finish_call_expr): Use lkp_iterator, call
2334 * tree.c (ovl_copy): New.
2335 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
2338 * cp-tree.h (OVL_USED): Replace with ...
2339 (OVL_USING_P): ... this.
2340 (ovl_iterator::using_p): Adjust.
2341 * name-lookup.c (push_overloaded_decl_1,
2342 do_nonmember_using_decl): Adjust.
2343 * search.c (lookup_field_r): Adjust.
2344 * tree.c (ovl_insert, ovl_scope): Adjust.
2346 * cp-tree.h (lookup_add): Swap args.
2347 (ovl_cons, build_overload): Delete.
2348 * name-lookup.c (add_function, push_overloaded_decl_1,
2349 do_nonmember_using_decl, merge_functions, remove_hidden_names):
2350 Use lookup_add, ovl_insert.
2351 * pt.c (check_explicit_specialization): Use lookup_add.
2352 (do_class_deduction): Likewise. Refactor if.
2353 * tree.c (lookup_add): Swap args.
2354 (ovl_cons, build_overload): Delete.
2356 * name-lookup.c (find_local_binding): New, broken out of ...
2357 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
2358 (set_namespace_binding): Swap scope & name args.
2359 (namespace_binding_1): Likewise.
2360 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
2361 (push_overloaded_decl_1): Likewise.
2362 (set_global_binding): Likewise.
2363 (get_namespace_binding): Adjust namespace_binding_1 call.
2365 2017-05-17 Nathan Sidwell <nathan@acm.org>
2367 * cp-tree.h (default_hash_traits <lang_identifier *>): New
2369 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
2370 (extern_c_fns): New hash table.
2371 (check_extern_c_conflict): New, broken out of ...
2372 (pushdecl_maybe_friend_1): ... here. Call it.
2373 (c_linkage_bindings): Just look in hash table.
2375 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
2379 Implement new C++ intrinsics __is_assignable and __is_constructible.
2380 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
2382 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
2383 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2384 * method.c (constructible_expr): Set cp_unevaluated.
2385 (is_xible_helper): New.
2386 (is_trivially_xible): Adjust.
2388 * parser.c (cp_parser_primary_expression): Handle
2389 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
2390 (cp_parser_trait_expr): Likewise.
2391 * semantics.c (trait_expr_value): Handle
2392 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2394 2017-05-17 Nathan Sidwell <nathan@acm.org>
2396 * cp-tree.h (ovl_iterator::using_p): New predicate.
2397 (ovl_iterator::remove_node): New worker.
2398 (ovl_insert): Declare.
2399 * tree.c (ovl_insert): New.
2400 (ovl_iterator::remove_node): New.
2401 * class.c (add_method): Use ovl_iterator, ovl_insert.
2402 (clone_function_decl): Fix description.
2403 (clone_constructors_and_destructors): Use ovl_iterator.
2405 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
2406 (maybe_warn_about_overly_private_class): Use ovl_iterator.
2407 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
2408 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
2409 (get_base_fndecls): Use ovl_iterator.
2410 (warn_hidden): Use OVL_NAME, ovl_iterator.
2411 (add_implicitly_declared_members): Use ovl_iterator.
2412 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
2414 (finish_shorthand_constraint): Simplify, use ovl_make.
2415 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
2416 * search.c (shared_member_p): Use ovl_iterator.
2417 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
2418 (lookup_conversion_operator): Use OVL_FIRST.
2419 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
2420 (look_for_overrides_here): Use ovl_iterator.
2421 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
2422 * typeck.c (build_x_unary_op): Use ovl_make.
2424 2017-05-17 Martin Liska <mliska@suse.cz>
2426 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
2427 use it instead of int type.
2428 (dump_vtable): Likewise.
2429 (dump_vtt): Likewise.
2430 * decl2.c (dump_tu): Likewise.
2432 2017-05-16 David Malcolm <dmalcolm@redhat.com>
2434 * call.c (enforce_access): Add access_failure_info * param and use
2435 it to record access failures.
2436 * cp-tree.h (class access_failure_info): New class.
2437 (enforce_access): Add access_failure_info * param, defaulting to
2439 (lookup_member): Likewise.
2440 (locate_field_accessor): New function decl.
2441 (perform_or_defer_access_check): Add access_failure_info * param,
2443 * search.c (lookup_member): Add access_failure_info * param and
2444 pass it on to call to perform_or_defer_access_check.
2445 (matches_code_and_type_p): New function.
2446 (field_access_p): New function.
2447 (direct_accessor_p): New function.
2448 (reference_accessor_p): New function.
2449 (field_accessor_p): New function.
2450 (struct locate_field_data): New struct.
2451 (dfs_locate_field_accessor_pre): New function.
2452 (locate_field_accessor): New function.
2453 * semantics.c (perform_or_defer_access_check): Add
2454 access_failure_info * param, and pass it on to call to
2456 * typeck.c (access_failure_info::record_access_failure): New method.
2457 (access_failure_info::maybe_suggest_accessor): New method.
2458 (finish_class_member_access_expr): Pass an access_failure_info
2459 instance to the lookup_member call, and call its
2460 maybe_suggest_accessor method afterwards.
2462 2017-05-16 Marek Polacek <polacek@redhat.com>
2466 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
2468 2017-05-16 Nathan Sidwell <nathan@acm.org>
2470 * name-lookup.c (check_local_shadow): New, broke out of ...
2471 (pushdecl_maybe_friend_1): ... here. Call it.
2473 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
2474 (ovl_first): Move inline definition to end of file.
2475 (ovl_make, lookup_add): Declare.
2476 (get_fns, get_first_fn): Make pure.
2477 * tree.c (ovl_cache): New.
2478 (ovl_make, lookup_add): New.
2479 * pt.c (do_class_deduction): Don't add candidates that will be
2482 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
2483 (print_error_for_call_failure): Use OVL_NAME.
2484 (build_op_call_1): Use ovl_iterator.
2485 (add_candidates): Use OVL_FIRST & lkp_iterator.
2486 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
2488 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
2489 (type_has_user_nondefault_constructor,
2490 in_class_defaulted_default_constructor,
2491 type_has_user_provided_constructor,
2492 type_has_user_provided_or_explicit_constructor,
2493 type_has_non_user_provided_default_constructor,
2494 vbase_has_user_provided_move_assign,
2495 type_has_move_constructor, type_has_move_assign,
2496 type_has_user_declared_move_constructor,
2497 type_has_user_declared_move_assign,
2498 type_build_ctor_call, type_build_dtor_call,
2499 type_requires_array_cookie, explain_non_literal_class): Likewise.
2500 (finish_struct): Use lkp_iterator.
2501 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
2502 (note_name_declared_in_class): Use OVL_NAME.
2503 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
2504 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
2505 cxx_pretty_printer::expression): Likewise.
2506 * decl2.c (check_classfn): Use ovl_iterator.
2507 * pt.c (retrieve_specialization): Use ovl_iterator.
2508 * tree.c (cp_tree_equal): Use lkp_iterator.
2509 (type_has_nontrivial_copy_init): Use ovl_iterator.
2511 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
2512 check is_overloaded_fn.
2514 2017-05-16 Martin Liska <mliska@suse.cz>
2516 * parser.c (cp_lexer_print_token): Add default value for flags
2517 argument of print_gimple_stmt, print_gimple_expr,
2518 print_generic_stmt and print_generic_expr.
2520 2017-05-16 Nathan Sidwell <nathan@acm.org>
2522 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
2524 (MAYBE_BASELINK_FUNCTIONS): New.
2525 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
2526 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
2527 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
2528 * method.c (inherited_ctor_binfo): Use ovl_iterator.
2529 (binfo_inherited_from): Likewise.
2530 * parser.c (lookup_literal_operator): Use lkp_iterator.
2531 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
2532 (print_candidates_1): Likewise.
2533 (determine_specialization): Likewise.
2534 (resolve_overloaded_unification): Likewise.
2535 (resolve_nondeduced_context): Likewise.
2536 (type_dependent_expression_p): Likewise.
2537 (dependent_template_p): Likewise.
2538 * ptree.c (cxx_print_xnode): Likewise.
2539 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
2540 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
2541 * typeck.c (check_template_keyword): Use lkp_iterator.
2543 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
2545 * constexpr.c (function_concept_check): Use OVL_FIRST.
2546 * cvt.c (build_expr_type_conversion): Likewise.
2547 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
2548 * decl2.c (mark_used): Use OVL_FIRST.
2549 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
2550 (dump_expr, location_of): Use OVL_FIRST.
2551 * friend.c (do_friend): Use OVL_NAME.
2552 * init.c (build_offset_ref): Use OVL_FIRST.
2553 * mangle.c (write_member_name): Likewise.
2554 (write_expression): Use OVL_NAME.
2555 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
2556 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
2557 * pt.c (check_explicit_specialization): Use OVL_FIRST.
2558 (check_template_shadow): Likewise.
2559 (tsubst_template_args): Use OVL_NAME.
2560 (tsubst_baselink): Use OVL_FIRST.
2561 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
2562 * tree.c (get_first_fn): Use OVL_FIRST.
2563 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
2564 (cp_build_addr_expr_1): Use OVL_FIRST.
2566 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
2568 * semantics.c (finish_id_expression): Directly init local var.
2569 (finish_omp_reduction_clause): Use really_overloaded_fn.
2570 * tree.c (get_fns): Document. Assert we got an overload.
2571 (get_first_fn) Document.
2572 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
2573 really_overloaded_fn.
2574 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
2576 * cp-tree.h (SCOPE_DEPTH): New.
2577 * name-lookup.h (is_nested_namespace): Declare.
2578 * name-lookup.c (is_nested_namespace): New.
2579 (is_ancestor): Use it.
2580 (set_decl_namespace): Likewise.
2581 (push_namespace): Set SCOPE_DEPTH.
2582 * pt.c (check_specialization_namespace): Use is_nested_namespace.
2583 (check_unqualigied_spec_or_inst): Likewise.
2585 2017-05-15 Nathan Sidwell <nathan@acm.org>
2588 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
2589 * name-lookup.h (push_namespace): Return int, add make_inline arg.
2590 * name-lookup.c (push_namespace): Deal with inline directly.
2591 Return pushed count.
2592 * parser.c (cp_parser_namespace_definition): Adjust for
2593 push_namespace change.
2595 2017-05-11 Nathan Sidwell <nathan@acm.org>
2597 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
2598 LANG_HOOKS_PUSHDECL): Move to ...
2599 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
2600 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
2601 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
2603 * name-lookup.h (pushdecl): Add default friend parm.
2604 (pushdecl_maybe_friend): Delete.
2605 (pushdecl_top_level): Add default friend parm.
2606 (pushdecl_top_level_maybe_friend): Delete.
2607 * name-lookup.c (pushdecl_maybe_friend): Delete.
2608 (pushdecl): Add is_friend parm.
2609 (pushdecl_top_level): Add is friend_parm.
2610 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
2611 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
2612 * friend.c (do_friend): Adjust.
2613 * pt.c (tsubst_friend_class): Adjust.
2615 Revert pushdecl_top_level_and_finish name change.
2616 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
2617 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
2618 * decl.c (cp_make_fname_decl): Adjust.
2619 * decl2.c (get_guard, handle_tls_init): Adjust.
2620 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
2622 * name-lookup.c (pushdecl_outermost_localscope): Always
2623 conditionally stop timer.
2625 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
2626 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
2628 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
2629 pushtag_top_level_maybe_friend,
2630 pushdecl_top_level_and_finish): Move declarations to ...
2631 * name-lookup.h: ... here. Group pushdecl variants.
2632 (pushdecl_top_level_and_finish): Rename to ...
2633 (pushdecl_top_level_with_init): ... here.
2634 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
2635 * decl2.c (get_guard, handle_tls_init): Likewise.
2636 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
2637 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
2638 * method.c (implicitly_declare_fn): Likewise.
2639 * searchc (node_debug_info_needed): Likewise.
2640 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
2641 (pushdecl_top_level_with_init): ... here.
2642 (pop_everything): Use namespace_bindings_p.
2644 * name-lookup.h (pop_binding): Rename to pop_local_binding.
2645 (getdecls): Rename to get_local_decls.
2646 * name-lookup.c (pop_binding): Rename to ...
2647 (pop_local_binding): ... here.
2648 (pop_bindings_and_leave_scope): Adjust.
2649 (getdecls): Rename to ...
2650 (get_local_decls): ... here. Assert local scope.
2651 * decl.c (poplevel): Assert not namespace. Adjust and simplify
2653 (store_parm_decls): Adjust get_local_decls call.
2654 (parser.c (synthesize_implicit_template_parm): Likewise.
2656 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
2659 * method.c (is_trivially_xible): Reject void types.
2661 2017-05-10 Nathan Sidwell <nathan@acm.org>
2663 * class.c (handle_using_decl): Always use OVL_CURRENT.
2664 (resolve_address_of_overloaded_function): Move iterator decl into
2665 for scope. Don't strip anticipated decls here.
2667 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
2669 (print_candidates): Adjust.
2671 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
2673 * call.c (build_new_function_call): Lose koenig_p arg. Remove
2674 koenig_p handling here.
2675 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
2676 (tsubst_omp_clauses): Likewise.
2677 (do_class_deduction): Adjust buld_new_function_call calls.
2678 * semantics.c (finish_call_expr): Likewise.
2680 2017-05-10 Jason Merrill <jason@redhat.com>
2682 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
2683 (unify_type_mismatch, unify_parameter_pack_mismatch)
2684 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
2685 (unify_parameter_pack_inconsistent, unify_inconsistency)
2686 (unify_vla_arg, unify_method_type_error, unify_arity)
2687 (unify_arg_conversion, unify_no_common_base)
2688 (unify_inconsistent_template_template_parameters)
2689 (unify_template_deduction_failure)
2690 (unify_template_argument_mismatch)
2691 (unify_overload_resolution_failure): Call unify_invalid.
2693 CWG 1847 - Clarifying compatibility during partial ordering
2694 * pt.c (more_specialized_fn): No order between two non-deducible
2697 * pt.c (dependent_type_p): Make sure we aren't called with
2700 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2701 * pt.c (convert_template_argument): Just return an argument pack.
2702 (coerce_template_parameter_pack, template_parm_to_arg)
2703 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
2704 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
2705 Don't set the type of a NONTYPE_ARGUMENT_PACK.
2706 * parser.c (make_char_string_pack, make_string_pack): Likewise.
2708 2017-05-10 Nathan Sidwell <nathan@acm.org>
2710 * cp-tree.h (add_method, clone_function_decl): Change last arg to
2712 * class.c (add_method): Change third arg to bool. Adjust.
2713 (one_inheriting_sig, one_inherited_ctor): Adjust.
2714 (clone_function_decl): Change 2nd arg to bool. Adjust.
2715 (clone_constructors_and_destructors): Adjust.
2716 * lambda.c (maybe_add_lambda_conv_op): Adjust.
2717 * method.c (lazily_declare_fn): Adjust.
2718 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
2719 * semantics.c (finish_member_declaration): Adjust.
2721 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
2724 * decl.c (finish_function): To improve error recovery, change the
2725 logic for calling apply_deduced_return_type.
2727 2017-05-09 Jason Merrill <jason@redhat.com>
2729 PR c++/80605 - __is_standard_layout and empty base
2730 * class.c (check_bases): Ignore empty bases.
2732 PR c++/70979 - literal class and closure types
2733 * class.c (finalize_literal_type_property): Handle closures
2735 (explain_non_literal_class): Likewise.
2737 PR c++/66297, DR 1684 - literal class and constexpr member fns
2738 * constexpr.c (is_valid_constexpr_fn): Only complain about
2739 non-literal enclosing class in C++11.
2740 * class.c (finalize_literal_type_property): Likewise.
2742 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
2745 * pt.c (tsubst_decl): Early return error_mark_node if
2746 grok_ctor_properties returns false.
2748 2017-05-09 Jason Merrill <jason@redhat.com>
2750 PR c++/70167 - array prvalue treated as lvalue
2751 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
2753 * semantics.c (finish_compound_literal): Add fcl_context parameter.
2754 Only make a static variable for C99 syntax.
2755 * parser.c (cp_parser_postfix_expression): Pass it.
2756 * pt.c (tsubst_copy_and_build): Likewise.
2757 * call.c (extend_ref_init_temps): Set
2758 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2760 2017-05-09 Nathan Sidwell <nathan@acm.org>
2762 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
2763 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
2764 * name-lookup.h (pushdecl_top_level): Declare.
2766 2017-05-08 Jason Merrill <jason@redhat.com>
2768 PR c++/80178 - parameter passing for uncopyable classes
2769 * tree.c (type_has_nontrivial_copy_init): True for classes with only
2770 deleted copy/move ctors.
2771 (remember_deleted_copy, maybe_warn_parm_abi): New.
2772 * decl.c (require_complete_types_for_parms, check_function_type):
2773 Call maybe_warn_parm_abi.
2774 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
2776 2017-05-08 Nathan Sidwell <nathan@acm.org>
2778 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
2779 (start_preparsed_function): Do decl pushing before setting
2780 current_funciton_decl and announcing it.
2782 * name-lookup.h (pushdecl_with_scope): Replace with ...
2783 (pushdecl_outermost_localscope): ... this.
2784 * name-lookup.c (pushdecl_with_scope): Replace with ...
2785 (pushdecl_outermost_localscope): ... this.
2786 (pushdecl_namespace_level): Adjust.
2787 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
2788 * lambda.c (insert_capture_proxy): Likewise.
2790 * class.c (build_vtbl_initializer): Don't shadow outer variable
2793 Revert _binding -> _value change.
2794 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
2795 (get_namespace_binding, set_global_binding): ... these.
2796 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
2797 (get_namespace_binding, set_global_binding): ... these.
2798 (arg_assoc_namespace, pushdecl_maybe_friend_1,
2799 check_for_out_of_scope_variable, push_overloaded_decl_1,
2800 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
2801 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
2802 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
2803 * decl.c (poplevel): Adjust.
2804 * pt.c (make_constrained_auto): Likewise.
2806 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
2808 PR translation/80280
2809 * call.c (print_z_candidate): Fix quoting.
2811 2017-05-05 David Malcolm <dmalcolm@redhat.com>
2813 * error.c (pedwarn_cxx98): Replace report_diagnostic
2814 with diagnostic_report_diagnostic.
2816 2017-05-05 Nathan Sidwell <nathan@acm.org>
2818 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
2819 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
2820 (IDENTIFIER_NAMESPACE_VALUE): Delete.
2821 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
2823 (get_namespace_value, set_global_value): ... these.
2824 (get_global_value_if_present, is_typename_at_global_scope): Delete.
2825 * decl.c (poplevel): Use get_namespace_value.
2826 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
2827 * class.c (build_vtbl_initializer): Stash library decl in
2828 static var. Use IDENTIFIER_GLOBAL_VALUE.
2829 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
2830 do_allocate_exception, do_free_exception, build_throw): Likewise.
2831 * init.c (throw_bad_array_new_length): Likewise.
2832 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
2833 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
2834 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
2835 get_namespace_value.
2836 (set_namespace_binding_1): Rename to
2837 (set_namespace_binding): ... here.
2838 (set_global_value): New.
2839 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
2840 get_namespace_value.
2841 * pt.c (listify): Use get_namespace_value.
2843 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
2845 * lex.c (unqualified_name_lookup_error): Likewise.
2847 * class.c (alter_class): Use retrofit_lang_decl directly.
2848 * decl.c (push_local_name, dupliate_decls): Likewise.
2849 * semantics.c (omp_privatize_field): Likewise.
2851 Kill walk_namespaces.
2852 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
2853 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
2855 Kill per-namespace static_decls.
2856 * cp-tree.h (static_decls): Declare.
2857 (wrapup_globals_for_namespace,
2858 diagnose_inline_vars_for_namespace): Replace with ...
2859 (wrapup_namespace_globals): ... this.
2860 * decl.c (static_decls): Define.
2861 (wrapup_globals_for_namespace,
2862 diagnose_inline_vars_for_namespace): Replace with ...
2863 (wrapup_namespace_globals): ... this.
2864 (cxx_init_decl_processing): Initialize static_decls.
2865 * decl2.c (c_parse_final_cleanups): Adjust.
2866 * name-lookup.h (cp_binding_level): Remove static_decls member.
2867 * name-lookup.c (add_decl_to_level): Adjust.
2868 (begin_scope): Adjust.
2870 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
2873 * decl.c (reshape_init): Unconditionally return error_mark_node
2874 upon error about too many initializers.
2876 2017-05-04 Nathan Sidwell <nathan@acm.org>
2878 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
2880 2017-05-04 Martin Sebor <msebor@redhat.com>
2882 PR translation/80280
2883 * call.c (print_z_candidate): Add missing quoting to %D and other
2885 (build_op_call_1): Same.
2886 * constraint.cc (diagnose_check_constraint): Same.
2887 * mangle.c (mangle_decl): Same.
2888 * name-lookup.c (cp_binding_level_debug): Same.
2889 (set_decl_namespace): Same.
2890 * parser.c (cp_parser_tx_qualifier_opt): Same.
2891 * pt.c (print_candidates_1): Same.
2892 (check_template_variable): Same.
2893 (tsubst_default_argument): Same.
2894 (most_specialized_partial_spec): Same.
2895 * semantics.c (omp_reduction_lookup): Same.
2896 * tree.c (check_abi_tag_redeclaration): Same.
2897 * typeck.c (comptypes): Same.
2898 * typeck2.c (abstract_virtuals_error_sfinae): Same.
2900 2017-05-04 Nathan Sidwell <nathan@acm.org>
2903 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
2904 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
2905 CPTI_INIT_LIST_IDENTIFIER.
2906 (global_namespace, global_type_node, global_identifier,
2907 anon_identifier, init_list_identifier): New.
2908 * decl.c (global_type_node, global_scope_name): Delete.
2909 (initialize_predefined_identifiers): Add new identifiers.
2910 (cxx_init_decl_processing): Adjust.
2911 * name-lookup.h (global_namespace, global_type_node): Delete.
2912 * name-lookup.c (global_namespace, anonymous_namespace_name,
2913 get_anonymous_namespace_name): Delete.
2914 (namespace_scope_ht_size, begin_scope, pushtag_1,
2915 push_namespace): Adjust,
2916 * call.c (type_has_extended_temps): Use init_list_identifier.
2917 * pt.c (listify): Likewise.
2919 * name-lookup.c: Reorder functions to make merging from modules
2922 2017-05-03 Jason Merrill <jason@redhat.com>
2924 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
2926 2017-05-03 Nathan Sidwell <nathan@acm.org>
2928 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
2929 along with #defines, to before name-lookup include.
2931 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
2933 * pt.c (is_auto_or_concept): Remove.
2934 (type_uses_auto_or_concept): Remove, unused.
2935 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
2936 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
2937 * cp-tree.h (is_auto_or_concept): Remove.
2939 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
2942 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
2943 add pedigree operation and detach call here.
2944 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
2945 cilk_cp_gimplify_call_params_in_spawned_fn.
2946 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
2947 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
2949 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
2951 * parser.c (cp_parser_member_declaration): Add fix-it hints for
2952 stray comma and missing semicolon at end of member declaration.
2954 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
2956 * parser.c (cp_parser_cast_expression): Add target type of cast to
2958 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
2960 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
2962 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
2963 return type to bool.
2964 * cp-tree.h (grok_ctor_properties): Update.
2966 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
2968 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
2969 information to diagnostic of invalid colon in nested-name-specifier.
2971 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
2973 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
2974 diagnostic of invalid class/struct keyword after enum.
2976 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2978 * parser.c (cp_parser_member_declaration): Add fix-it hint
2979 for removing stray semicolons.
2981 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2983 * name-lookup.c (get_std_name_hint): New function.
2984 (maybe_suggest_missing_header): New function.
2985 (suggest_alternative_in_explicit_scope): Call
2986 maybe_suggest_missing_header.
2988 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2991 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
2992 candidate type of bm from tree to const char *.
2993 (consider_binding_level): Likewise.
2994 (lookup_name_fuzzy): Likewise, using this to merge the best
2995 result from the preprocessor into bm, rather than immediately
2996 returning, so that better matches from reserved words can "win".
2997 Guard the rejection of keywords that don't start decl-specifiers
2998 so it only happens for FUZZY_LOOKUP_TYPENAME.
3000 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
3002 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
3003 (start_enum): Likewise.
3004 (build_enumerator): Likewise. Use %qE instead of plain %E.
3005 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
3006 %<%D%> in diagnostics.
3007 (cp_parser_elaborated_type_specifier): Likewise.
3008 * pt.c (make_pack_expansion): Use %qT and %qE instead of
3009 %<%T%> and %<%E%> in diagnostics.
3010 (tsubst_pack_expansion): Likewise.
3012 2017-04-24 David Malcolm <dmalcolm@redhat.com>
3015 * parser.c (cp_parser_unary_expression): Generate a location
3016 range for alignof and sizeof expressions.
3018 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
3020 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
3022 (cp_parser_virt_specifier_seq_opt): Likewise.
3023 (set_and_check_decl_spec_loc): Likewise twice.
3025 2017-04-21 Jason Merrill <jason@redhat.com>
3027 PR c++/80179 - ICE with initialized flexible array member.
3028 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
3030 2017-04-21 Richard Biener <rguenther@suse.de>
3032 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
3033 (copy_type): Likewise.
3034 * lex.c (copy_decl): Pass down mem-stat info.
3035 (copy_type): Likewise.
3037 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
3040 * init.c (build_new_1): Suppress notes about over-aligned new when
3041 the warning is suppressed.
3043 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
3045 * parser.c (cp_parser_member_declaration): Add warning with fixit
3046 information for extra semicolon after in-class function definition.
3048 2017-04-20 Jakub Jelinek <jakub@redhat.com>
3051 * tree.c (build_cplus_array_type): Call build_array_type
3052 with the intended TYPE_TYPELESS_STORAGE flag value, instead
3053 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
3056 2017-04-18 Marek Polacek <polacek@redhat.com>
3058 PR c++/80244 - ICE with attribute in template alias.
3059 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
3061 PR c++/80241 - ICE with alignas pack expansion.
3062 * error.c (dump_expr): Handle TREE_LIST.
3063 * parser.c (cp_parser_std_attribute_list): Return error_mark if
3064 make_pack_expansion returns an error.
3066 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
3069 * class.c (fixup_may_alias): Fix all type variants.
3071 2017-04-17 Jason Merrill <jason@redhat.com>
3073 PR c++/80415 - wrong error with default arg and array reference.
3074 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
3076 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
3078 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
3080 * decl.c (name_unnamed_type): Split out of...
3081 (grokdeclarator): ... this.
3082 * decl.h (name_unnamed_type): Declare.
3084 2017-04-12 Richard Biener <rguenther@suse.de>
3085 Bernd Edlinger <bernd.edlinger@hotmail.de>
3088 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
3089 for arrays of character or std::byte type.
3091 2017-04-11 Jason Merrill <jason@redhat.com>
3093 PR c++/80294 - ICE with constexpr and inheritance.
3094 * constexpr.c (reduced_constant_expression_p):
3095 A null constructor element is non-constant.
3096 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
3097 returning an empty base.
3099 2017-04-11 Jakub Jelinek <jakub@redhat.com>
3102 * decl.c (cp_finish_decomp): If processing_template_decl on
3103 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
3104 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
3105 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
3107 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
3108 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
3111 2017-04-11 Jakub Jelinek <jakub@redhat.com>
3114 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
3116 2017-04-10 Jakub Jelinek <jakub@redhat.com>
3119 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
3120 operand, if it is a static member function, recurse on the
3123 2017-04-10 Marek Polacek <polacek@redhat.com>
3126 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
3127 ORIG_TYPE earlier and not only when shortening.
3129 2017-04-07 Jason Merrill <jason@redhat.com>
3131 PR c++/80356 - ICE with reference to function template argument.
3133 * pt.c (convert_nontype_argument_function): Adjust type even with a
3134 value-dependent argument.
3136 PR c++/80267 - ICE with nested capture of reference
3138 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
3140 2017-04-07 Marek Polacek <polacek@redhat.com>
3143 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
3146 * call.c (build_over_call): Don't check cxx_dialect.
3147 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
3148 whether SUB is a CONSTRUCTOR.
3149 * init.c (build_new_1): Don't check cxx_dialect.
3150 * tree.c (replace_placeholders): Add a function comment. Return if
3151 not in C++14, or if the object isn't a (member of a) class.
3152 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
3153 TYPE is CLASS_TYPE_P.
3155 2017-04-05 Jakub Jelinek <jakub@redhat.com>
3158 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
3159 of a loop doing vec_safe_push of NULL. Formatting fixes.
3160 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
3161 to newidx before calling canonical_type_parameter on newtype.
3163 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
3166 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
3167 UNARY_PLUS_EXPR case.
3169 2017-04-03 Jason Merrill <jason@redhat.com>
3171 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
3173 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
3175 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
3176 * decl2.c (one_static_initialization_or_destruction): Likewise.
3177 * name-lookup.c (store_bindings): Likewise.
3178 * parser.c (make_call_declarator): Likewise.
3179 * pt.c (check_explicit_specialization): Likewise.
3181 2017-04-03 Jason Merrill <jason@redhat.com>
3183 PR sanitizer/79993 - ICE with VLA initialization from string
3184 PR c++/69487 - wrong VLA initialization from string
3185 * init.c (finish_length_check): Split out from build_vec_init.
3186 (build_vec_init): Handle STRING_CST.
3187 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
3188 (digest_init_r): Don't give a STRING_CST VLA type.
3190 2017-03-31 Jakub Jelinek <jakub@redhat.com>
3193 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
3194 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
3195 for NOP_EXPR to REFERENCE_TYPE.
3198 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
3199 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3201 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
3202 Remove extraneous parens.
3203 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
3204 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
3205 (cp_parser_trait_expr): Likewise.
3207 2017-03-27 Jakub Jelinek <jakub@redhat.com>
3210 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
3211 * typeck.c (cxx_mark_addressable): Likewise. Look through
3212 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
3214 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
3216 2017-03-24 Jason Merrill <jason@redhat.com>
3218 PR c++/77339 - ICE with invalid use of alias template.
3219 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
3222 2017-03-24 Marek Polacek <polacek@redhat.com>
3225 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
3226 doesn't have side effects.
3228 2017-03-23 Jason Merrill <jason@redhat.com>
3230 PR c++/80150 - ICE with overloaded variadic deduction.
3231 * pt.c (try_one_overload): Remove asserts.
3233 PR c++/77563 - missing ambiguous conversion error.
3234 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
3236 2017-03-23 Marek Polacek <polacek@redhat.com>
3238 * cp-tree.h: Remove a C_RID_YYCODE reference.
3240 2017-03-22 Jakub Jelinek <jakub@redhat.com>
3243 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
3244 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
3245 processing_template_decl.
3247 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
3250 * name-lookup.c (pushtag_1): Add check for bogus, non template,
3251 std::initializer_list.
3253 2017-03-21 Jakub Jelinek <jakub@redhat.com>
3256 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
3258 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
3261 * init.c (std_placement_new_fn_p): New.
3262 (build_new_1): Call it.
3264 2017-03-20 Jason Merrill <jason@redhat.com>
3266 PR c++/80096 - ICE with C++17 non-type auto.
3267 * pt.c (tsubst): Delay tsubst of type of template non-type
3270 PR c++/79519 - ICE with deleted template friend.
3271 * decl.c (grokdeclarator): Complain about misplaced function
3272 definition using =, as well.
3274 PR c++/79640 - infinite recursion with generic lambda.
3275 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
3276 before substituting its initializer.
3278 2017-03-20 Marek Polacek <polacek@redhat.com>
3279 Paolo Carlini <paolo.carlini@oracle.com>
3281 PR c++/80059 - ICE with noexcept and __transaction_atomic
3282 * except.c (build_must_not_throw_expr): Call
3283 instantiate_non_dependent_expr.
3285 2017-03-19 Jason Merrill <jason@redhat.com>
3287 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
3288 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
3289 reference decomposition.
3291 PR c++/80077 - error with constexpr and -fno-elide-constructors.
3292 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
3293 expanding trivial constructor.
3295 2017-03-17 Jason Merrill <jason@redhat.com>
3297 PR c++/78345 - ICE initializing array from lambda.
3298 * init.c (build_aggr_init): Check array initializer.
3299 (build_vec_init): Check the type of a CONSTRUCTOR.
3301 PR c++/80073 - C++17 ICE with virtual base.
3302 * decl.c (xref_basetypes): Also check for indirect vbases.
3304 2017-03-16 Jason Merrill <jason@redhat.com>
3306 * decl.c (start_enum): std::byte aliases anything.
3309 * constexpr.c (lookup_placeholder): Tweak.
3311 2017-03-15 Jason Merrill <jason@redhat.com>
3313 PR c++/80043 - ICE with -fpermissive
3314 * typeck.c (convert_for_assignment): Handle instantiate_type
3315 not giving an error.
3317 2017-03-14 Nathan Sidwell <nathan@acm.org>
3319 PR c++/79393 DR 1658 workaround
3320 * method.c (synthesized_method_base_walk): Inihibit abstract class
3321 virtual base access check here.
3322 (synthesized_method_walk): Not here.
3324 2017-03-13 Nathan Sidwell <nathan@acm.org>
3326 PR c++/79393 DR 1658 workaround
3327 * method.c (synthesized_method_walk): Check vbases of abstract
3328 classes for dtor walk.
3330 2017-03-10 David Malcolm <dmalcolm@redhat.com>
3332 PR translation/79848
3333 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
3335 2017-03-10 Jason Merrill <jason@redhat.com>
3337 PR c++/79960 - alias templates and partial ordering
3338 * pt.c (comp_template_args): Add partial_order parm.
3339 (template_args_equal): Likewise.
3340 (comp_template_args_porder): New.
3341 (get_partial_spec_bindings): Use it.
3343 2017-03-10 Marek Polacek <polacek@redhat.com>
3346 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
3348 2017-03-10 Jakub Jelinek <jakub@redhat.com>
3351 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
3352 Use XALLOCAVEC macro.
3355 * decl.c (finish_enum_value_list): If value is error_mark_node,
3356 don't copy it and change its type.
3357 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
3358 of CONST_DECL is error_mark_node.
3360 2017-03-09 Marek Polacek <polacek@redhat.com>
3362 PR c++/79900 - ICE in strip_typedefs
3363 * tree.c (strip_typedefs): Skip the attribute handling if T is
3364 a variant type which hasn't been updated yet.
3366 PR c++/79687 - wrong code with pointer-to-member
3367 * init.c (constant_value_1): Break if the variable has a dynamic
3370 2017-03-08 Jason Merrill <jason@redhat.com>
3372 PR c++/79797 - ICE with self-reference in array DMI.
3373 * constexpr.c (lookup_placeholder): Split out...
3374 (cxx_eval_constant_expression): ...from here.
3376 2017-03-07 Jakub Jelinek <jakub@redhat.com>
3379 * parser.c (cp_parser_omp_cancellation_point,
3380 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
3381 cp_parser_omp_target_update): Change "may only be used in compound
3382 statements" diagnostics, such that the same translatable string is
3383 used for all pragmas.
3384 (cp_parser_pragma): Likewise. Use error_at instead of
3385 cp_parser_error for that diagnostics.
3387 2017-03-06 Marek Polacek <polacek@redhat.com>
3389 PR c++/79796 - ICE with NSDMI and this pointer
3390 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
3391 replace_placeholders.
3393 2017-03-06 Jakub Jelinek <jakub@redhat.com>
3396 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
3399 2017-03-06 Jason Merrill <jason@redhat.com>
3401 Revert "Allow deduction guides to look into primary template."
3402 * cp-tree.h, parser.c, pt.c, search.c: Revert.
3404 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
3407 * except.c (build_must_not_throw_expr): Perform the implicit
3408 conversions on the condition.
3410 2017-03-03 Jason Merrill <jason@redhat.com>
3412 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
3415 Core issues 2273 and 2277
3416 * call.c (joust): Adjust using-declaration tiebreaker to handle
3417 the intermediate base case.
3418 * method.c (strip_inheriting_ctors): Just return the argument if
3419 !flag_new_inheriting_ctors.
3421 2017-03-03 Richard Biener <rguenther@suse.de>
3424 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
3426 2017-03-03 Marek Polacek <polacek@redhat.com>
3429 * typeck.c (string_conv_p): In C++11, always call pedwarn with
3432 2017-03-02 Jason Merrill <jason@redhat.com>
3434 Update overload resolution with deduction guides.
3435 * pt.c (do_class_deduction): Always build the copy guide.
3436 (copy_guide_p, template_guide_p): New.
3437 (build_deduction_guide): Remember the original constructor.
3438 * call.c (joust): Prefer the copy guide and non-template guides.
3440 Allow deduction guides to look into primary template.
3441 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
3442 (struct cp_decl_specifier_seq): Add constructor_p.
3443 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
3444 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
3445 Clear deduction_guide_type. Don't handle deduction guide names.
3446 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
3447 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
3448 (cp_parser_member_declaration, cp_parser_cache_defarg)
3449 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
3450 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
3451 (build_deduction_guide): Set deduction_guide_type.
3452 (dependent_scope_p): Check deduction_guide_type.
3453 * search.c (lookup_member): Likewise.
3455 2017-03-02 Jakub Jelinek <jakub@redhat.com>
3458 * init.c (mark_exp_read_r): New function.
3459 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
3460 whole arguments instead of plain mark_exp_read on TREE_LIST values.
3462 2017-03-01 Jason Merrill <jason@redhat.com>
3464 Class template argument deduction in new-expression
3465 * init.c (build_new): Handle deduction from no initializer.
3466 * parser.c (cp_parser_new_expression): Don't require a single
3467 expression for class template deduction.
3468 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
3469 class template placeholder.
3470 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
3471 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
3472 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
3474 2017-03-01 Jakub Jelinek <jakub@redhat.com>
3477 * init.c (emit_mem_initializers): When not constructing vbases of
3478 abstract classes, mark arguments as read for
3479 -Wunused-but-set-parameter.
3481 2017-02-28 Jason Merrill <jason@redhat.com>
3483 Class template argument deduction refinements
3484 * call.c (joust): Move deduction guide tiebreaker down.
3485 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
3486 deduction with no initializer.
3487 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
3488 (do_class_deduction): Use that rather than special case.
3489 (do_auto_deduction): Handle null initializer.
3491 2017-02-28 Jakub Jelinek <jakub@redhat.com>
3493 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
3494 instead of just cond ? "..." : "...".
3495 (grokdeclarator): Likewise.
3496 (build_enumerator): Likewise.
3497 * init.c (build_new_1): Likewise.
3498 * call.c (build_new_method_call_1): Likewise.
3499 * parser.c: Include intl.h.
3500 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
3501 "enter"/"exit" keyword.
3502 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
3505 2017-02-27 Jason Merrill <jason@redhat.com>
3507 PR c++/71568 - SFINAE forming pointer to member function
3508 * init.c (build_offset_ref): Check the return value of
3509 perform_or_defer_access_check.
3511 2017-02-27 Marek Polacek <polacek@redhat.com>
3513 * decl.c (expand_static_init): Add missing } in a comment.
3515 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
3517 * init.c: Include intl.h.
3518 (build_new_1): Move message strings into pedwarn to make them
3519 -Wformat-security friendly. Mark string for translation.
3520 * pt.c (tsubst_copy_and_build): Mark string for translation.
3521 Make the pointer const.
3522 * semantics.c (finish_id_expression): Mark strings for translation.
3524 2017-02-25 Jakub Jelinek <jakub@redhat.com>
3526 * call.c (build_op_delete_call): Make msg1 and msg2 const.
3528 2017-02-24 Jakub Jelinek <jakub@redhat.com>
3531 * call.c (build_over_call): Call check_function_arguments even for
3532 -Wrestrict, adjust check_function_arguments caller.
3533 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
3535 * typeck.c (cp_build_function_call_vec): Adjust
3536 check_function_arguments caller.
3538 2017-02-24 Marek Polacek <polacek@redhat.com>
3540 PR translation/79705
3541 * decl.c (check_redeclaration_exception_specification): Mark a string
3542 for translation. Make the pointer const.
3544 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
3547 * pt.c (register_specialization): Check duplicate_decls return value
3548 for error_mark_node and pass it back.
3550 2017-02-22 Jason Merrill <jason@redhat.com>
3552 PR c++/79679 - missing destructor for argument
3553 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
3556 * pt.c (do_class_deduction): Handle 0 argument case.
3558 2017-02-22 Jakub Jelinek <jakub@redhat.com>
3561 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
3562 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
3563 * constexpr.c (potential_constant_expression_1): Handle
3564 OMP_*, OACC_* and CILK_* trees. Use error_at with
3565 EXPR_LOC_OR_LOC (t, input_location) computed early
3566 instead of error, or error_at with location_of (t).
3568 2017-02-22 Marek Polacek <polacek@redhat.com>
3571 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
3572 if the alignas expression is erroneous.
3573 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
3577 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
3579 2017-02-21 Jason Merrill <jason@redhat.com>
3581 PR c++/50308 - wrong deprecated warning with ADL
3582 PR c++/17729 - duplicate deprecated warning
3583 * semantics.c (finish_id_expression): Only call mark_used on a
3584 function if we aren't building a call.
3586 PR c++/41727 - ICE with partial spec of partial instantiation
3587 * pt.c (process_partial_specialization): For now, don't check more
3588 specialized if there is more than one level of args.
3590 2017-02-21 Marek Polacek <polacek@redhat.com>
3593 * cp-tree.h (maybe_reject_flexarray_init): Declare.
3594 * init.c (maybe_reject_flexarray_init): No longer static.
3595 Add check for current_function_decl.
3596 * parser.c (cp_parser_late_parse_one_default_arg): Reject
3597 a default mem-initializer for a flexible array.
3599 2017-02-21 Jakub Jelinek <jakub@redhat.com>
3600 Paolo Carlini <paolo.carlini@oracle.com>
3603 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
3605 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
3606 decl after the decomposition artificial decl has error_mark_node.
3607 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
3608 instead of just == error_mark_node comparison.
3610 2017-02-21 Jakub Jelinek <jakub@redhat.com>
3613 * decl.c: Include gimplify.h.
3614 (cp_finish_decomp): Make sure there is no sharing of trees
3615 in between DECL_VALUE_EXPR of decomposition decls.
3618 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
3621 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
3622 call cplus_expand_constant on it first.
3624 2017-02-19 Jason Merrill <jason@redhat.com>
3626 PR c++/78139 - destructor needed by new-expression
3627 * call.c (build_special_member_call): Use tf_no_cleanup.
3629 PR c++/78282 - auto template and pack expansion
3630 * pt.c (find_parameter_packs_r): Don't walk into the type of
3631 templates other than template template-parameters.
3633 PR c++/79606 - ICE with this->base_member in NSDMI
3634 * class.c (build_base_path): Check processing_template_decl.
3636 PR c++/79607 - ICE with T{} initializer
3637 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
3639 PR c++/79566 - elaborated-type-specifier in range for
3640 * parser.c (cp_parser_simple_declaration): Fix check for type
3643 PR c++/79400 - confusing suggestion of 'noexcept'
3644 * parser.c (cp_parser_exception_specification_opt): Remove
3645 suggestion for deprecated dynamic exception-specification.
3647 PR c++/79470 - partial ordering with reference parameters
3648 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
3650 PR c++/79500 - ICE with non-template deduction guide
3651 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
3652 DECL_TEMPLATE_RESULT.
3654 PR c++/79580 - ICE with compound literal
3655 * parser.c (cp_parser_class_head): If we're in the middle of an
3656 expression, use ts_within_enclosing_non_class.
3658 PR c++/79503 - inherited ctor taking base class
3659 * call.c (add_function_candidate): Also check that
3660 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
3662 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
3665 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
3668 2017-02-19 Eric Fiselier <eric@efcs.ca>
3669 Jonathan Wakely <jwakely@redhat.com>
3672 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
3673 control warning about literal suffix identifiers without a leading
3676 2017-02-17 Jason Merrill <jason@redhat.com>
3678 PR c++/79508 - lookup error with member template
3679 * parser.c (cp_parser_template_name): Clear
3680 parser->context->object_type if we aren't doing lookup.
3682 PR c++/78690 - ICE with using and global type with same name
3683 * pt.c (type_dependent_object_expression_p): True for
3686 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3687 * pt.c (convert_template_argument): Just return an auto arg pack.
3688 (tsubst_template_args): Don't tsubst an auto pack type.
3690 PR c++/79556 - C++17 ICE with non-type auto
3691 * pt.c (do_auto_deduction): Don't try to deduce from null type.
3693 PR c++/79533 - C++17 ICE with temporary cast to reference
3694 * call.c (build_over_call): Conversion to a reference prevents copy
3697 2017-02-16 Jakub Jelinek <jakub@redhat.com>
3698 Jason Merrill <jason@redhat.com>
3700 PR c++/79502 - lost nodiscard attribute
3701 * pt.c (apply_late_template_attributes): Do apply non-dependent
3702 attributes to types.
3704 2017-02-16 Jason Merrill <jason@redhat.com>
3706 PR c++/78572 - ICE with self-modifying array initializer
3707 * constexpr.c (cxx_eval_store_expression): The object we're
3708 initializing is outside the constant-expression.
3709 (cxx_eval_call_expression): Set ctx->call.
3711 PR c++/79050 - ICE with undeduced auto and LTO
3712 * decl.c (poplevel): Remove undeduced auto decls.
3714 2017-02-16 Jakub Jelinek <jakub@redhat.com>
3717 * parser.c (cp_parser_omp_target): For -fopenmp-simd
3718 ignore #pragma omp target even when not followed by identifier.
3720 2017-02-15 Jason Merrill <jason@redhat.com>
3721 Jakub Jelinek <jakub@redhat.com>
3723 PR c++/79464 - ICE in IPA with omitted constructor parms
3724 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
3725 (adjust_clone_args): Adjust.
3726 (add_method): Remember omitted parms.
3727 * call.c (add_function_candidate): Likewise.
3728 * mangle.c (write_method_parms): Likewise.
3729 * method.c (ctor_omit_inherited_parms): Return false if there are no
3732 2017-02-15 Martin Sebor <msebor@redhat.com>
3735 * init.c (maybe_reject_flexarray_init): New function.
3736 (perform_member_init): Call it.
3738 2017-02-15 Jakub Jelinek <jakub@redhat.com>
3741 * parser.c (cp_parser_std_attribute): Don't pedwarn about
3742 [[deprecated]] with -std=c++11 and [[fallthrough]] with
3743 -std=c++11 and -std=c++14.
3746 * decl.c (grokdeclarator): For static data members, handle thread_p
3747 only after handling inline.
3749 2017-02-14 Marek Polacek <polacek@redhat.com>
3753 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
3754 clobbering if the postfix expression isn't an EXPR_P.
3756 2017-02-13 Jason Merrill <jason@redhat.com>
3758 PR c++/79461 - ICE with lambda in constexpr constructor
3759 * constexpr.c (build_data_member_initialization): Ignore
3760 initialization of a local variable.
3762 2017-02-13 Jakub Jelinek <jakub@redhat.com>
3764 * init.c (warn_placement_new_too_small): Add missing space in
3766 * parser.c (cp_parser_oacc_declare): Likewise.
3767 * mangle.c (maybe_check_abi_tags): Likewise.
3770 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
3771 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
3772 in the rightmost operand.
3774 2017-02-13 Nathan Sidwell <nathan@acm.org>
3776 PR c++/79296 - ICE mangling localized template instantiation
3777 * decl2.c (determine_visibility): Use template fn context for
3778 local class instantiations.
3780 2017-02-11 Jason Merrill <jason@redhat.com>
3782 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
3783 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
3784 (build_new_1): Use replace_placeholders.
3785 * tree.c (replace_placeholders_t): Also track whether we've seen a
3787 (replace_placeholders, replace_placeholders_r): Adjust.
3788 * cp-tree.h: Adjust.
3790 PR c++/77790 - ICE with auto function in C++11 mode
3791 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
3792 (require_deduced_type): Add complain parm, return bool.
3793 * cp-tree.h: Adjust.
3794 * decl2.c (mark_used): Use require_deduced_type.
3796 2017-02-10 Jason Merrill <jason@redhat.com>
3798 PR c++/78908 - template ops and bitfields
3799 * tree.c (build_min_non_dep): Use unlowered_expr_type.
3801 PR c++/78897 - constexpr union
3802 * constexpr.c (cxx_eval_store_expression): A store to a union member
3803 erases a previous store to another member.
3805 PR c++/71285 - member of fold-expression
3806 * semantics.c (finish_unary_fold_expr)
3807 (finish_binary_fold_expr): Use null type for fold-expressions.
3809 PR c++/79401 - protected inherited constructor
3810 * call.c (enforce_access): For inheriting constructor, find a base
3811 binfo in the path we already have.
3813 2017-02-10 Marek Polacek <polacek@redhat.com>
3816 * pt.c (type_dependent_expression_p): Check if the expression type
3820 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
3821 if warnings shouldn't be given.
3823 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
3826 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
3827 an error_mark_node as type.
3829 2017-02-09 Jakub Jelinek <jakub@redhat.com>
3830 Jason Merrill <jason@redhat.com>
3833 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
3834 from pattern to type.
3836 2017-02-09 Jason Merrill <jason@redhat.com>
3838 PR c++/79316 - default argument in deduction guide
3839 PR c++/79350 - explicit deduction guide
3840 * parser.c (cp_parser_constructor_declarator_p)
3841 (cp_parser_direct_declarator): Parse deduction guides more like
3843 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
3844 * tree.c (special_function_p): Return it.
3845 * decl.c (check_special_function_return_type): Handle it.
3846 (grokdeclarator, grokfndecl): Adjust.
3847 (cp_finish_decl): Pass flags to do_auto_deduction.
3848 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
3849 * pt.c (dguide_name_p): Take a const_tree.
3850 (do_class_deduction): Handle explicit.
3851 (do_auto_deduction): Pass flags through.
3852 (build_deduction_guide): Copy explicit flag.
3854 2017-02-09 Jakub Jelinek <jakub@redhat.com>
3857 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
3858 non-pragma_compound context here.
3859 (cp_parser_omp_target): Likewise.
3860 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
3861 parsing for ordered and target omp pragmas in non-pragma_stmt
3862 non-pragma_compound contexts.
3865 * parser.c (cp_parser_oacc_declare): Formatting fix.
3866 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
3867 automatic variables.
3869 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
3870 Chung-Lin Tang <cltang@codesourcery.com>
3872 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
3873 parsing. Parse constant expression. Remove semantic checking.
3874 (cp_parser_omp_clause_collapse): Disallow tile.
3875 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
3876 error about missing for after already emitting one. Use more
3877 conventional for idiom for unbounded loop.
3878 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
3879 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
3880 (finish_omp_for): Deal with tile clause.
3882 2017-02-07 Nathan Sidwell <nathan@acm.org>
3884 * method.c (synthesized_method_base_walk): New. Broken out of ...
3885 (synthesized_method_walk): ... here. Call it. Cleanup
3888 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
3891 * typeck2.c (process_init_constructor_union): Consider only
3892 FIELD_DECLs when looking for an NSDMI.
3894 2017-02-06 Jason Merrill <jason@redhat.com>
3896 PR c++/71193 - incomplete types in templates
3897 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
3898 handle incomplete type by pedwarning and then treating as dependent.
3900 2017-02-06 Jakub Jelinek <jakub@redhat.com>
3903 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
3904 (potential_constant_expression_1): Likewise.
3907 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
3908 allow one fewer than expected arguments if flag_permissive.
3911 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
3912 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
3913 with error_mark_node type.
3915 2017-02-03 Jason Merrill <jason@redhat.com>
3917 PR c++/78689 - ICE on constructor with label
3918 * optimize.c (maybe_clone_body): Replace omitted parameters with
3920 * class.c (build_clone): Fix logic for omitting inherited parms.
3922 PR c++/12245 - excessive memory use
3923 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
3924 back in. Don't cache constants.
3925 (maybe_constant_init): Don't cache constants.
3927 PR c++/79294 - ICE with invalid template argument
3928 * pt.c (convert_nontype_argument_function): Check value-dependence.
3929 (convert_nontype_argument): Don't check it here for function ptrs.
3931 2017-02-02 Richard Biener <rguenther@suse.de>
3934 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
3935 it lazily on the first changed element only and copy it
3936 fully upfront, only storing changed elements.
3938 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
3941 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
3944 2017-01-31 Jakub Jelinek <jakub@redhat.com>
3947 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
3950 2017-01-31 David Malcolm <dmalcolm@redhat.com>
3953 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
3954 any namespace aliases.
3956 2017-01-31 Nathan Sidwell <nathan@acm.org>
3959 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
3963 * pt.c: (instantiate_decl): Push to top level when current
3964 function scope doesn't match. Only push lmabda scope stack when
3967 * cp-tree.h (instantiate_decl): Make defer_ok bool.
3968 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
3969 (instantiate_decl): Simplify and reorder state saving and restoration.
3972 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
3973 * semantics.c (finish_member_declaration): Assert class is being
3976 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
3978 Introduce C++ support in libcc1.
3979 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
3980 (ansi_opname): Rename to...
3981 (cp_operator_id): ... this. Adjust all callers.
3982 (ansi_assopname): Rename to...
3983 (cp_assignment_operator_id): ... this. Adjust all callers.
3984 (cp_literal_operator_id): Declare.
3985 (set_global_friend): Declare.
3986 (is_global_friend): Declare.
3987 (enum cp_oracle_request): New type.
3988 (cp_binding_oracle_function): New type.
3989 (cp_binding_oracle): Declare.
3990 (cp_finish_injected_record_type): Declare.
3991 * friend.c (global_friend): New var.
3992 (set_global_friend): New fn.
3993 (is_global_friend): New fn.
3994 (is_friend): Call is_global_friend.
3995 * name-lookup.c (cp_binding_oracle): New var.
3996 (query_oracle): New fn.
3997 (qualified_lookup_using_namespace): Call query_oracle.
3998 (lookup_name_real_1): Likewise.
3999 * parser.c (cp_literal_operator_id): Drop static.
4000 * search.c (friend_accessible_p): Call is_global_friend.
4001 * semantics.c (is_this_parameter): Accept a variable if the
4002 binding oracle is enabled.
4004 2017-01-27 Jason Merrill <jason@redhat.com>
4006 PR c++/78771 - ICE with inherited constructor.
4007 * call.c (build_over_call): Call deduce_inheriting_ctor here.
4008 * pt.c (tsubst_decl): Not here.
4009 * class.c (add_method): Or here.
4010 * method.c (deduce_inheriting_ctor): Handle clones.
4011 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
4013 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
4016 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
4018 * cp/cp-tree.h: Declare it.
4019 * cp/semantics.c (finish_id_expression): Resolve names within a default
4020 capturing generic lambda defined within a template prior to
4021 instantiation to allow for captures to be added to the closure type.
4023 2017-01-26 Jakub Jelinek <jakub@redhat.com>
4026 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
4027 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
4028 * parser.c (cp_parser_builtin_offsetof): Pass result of
4029 build_static_cast of null_pointer_node to finish_offsetof.
4030 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
4031 it for -Winvalid-offsetof pedwarn instead of trying to guess
4032 original offsetof type from EXPR. Save OBJECT_PTR as a new
4033 second operand to OFFSETOF_EXPR.
4034 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
4035 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
4038 2017-01-26 Jason Merrill <jason@redhat.com>
4040 * name-lookup.c (parse_using_directive): Deprecate strong using.
4042 PR c++/79176 - lambda ICE with -flto -Os
4043 * decl2.c (vague_linkage_p): Handle decloned 'tors.
4044 * tree.c (decl_linkage): Likewise.
4046 2017-01-25 Martin Sebor <msebor@redhat.com>
4048 * decl.c (grokdeclarator): Fix a typo in a comment.
4050 2017-01-25 Jakub Jelinek <jakub@redhat.com>
4053 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
4057 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
4058 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
4060 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
4063 * decl.c (cxx_init_decl_processing): Pass main_input_filename
4064 to build_translation_unit_decl.
4066 2017-01-24 Jakub Jelinek <jakub@redhat.com>
4069 * cp-gimplify.c (cp_genericize_r): Add result of
4070 convert_from_reference on invisiref parm to p_set.
4072 2017-01-24 Nathan Sidwell <nathan@acm.org>
4074 PR c++/78469 - defaulted ctor and inaccessible dtor
4075 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
4076 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
4077 * tree.c (build_target_expr): Check tf_no_cleanup.
4079 PR c++/79118 - anon-members and constexpr
4080 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
4081 ctor decl. Recursively check anonymous members.
4082 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
4084 (explain_invalid_constexpr_fn): Likewise.
4086 2017-01-23 Nathan Sidwell <nathan@acm.org>
4088 PR c++/71710 - template using directive of field
4089 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
4092 PR c++/71406 - ICE with scope-ref'd template id exprs
4094 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
4095 before breaking up TEMPLATE_ID_EXPR.
4097 2017-01-20 Nathan Sidwell <nathan@acm.org>
4099 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
4100 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
4102 2017-01-20 David Malcolm <dmalcolm@redhat.com>
4106 * cp-tree.h (suggest_alternatives_for): Add bool param.
4107 (suggest_alternative_in_explicit_scope): New decl.
4108 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
4109 that isn't the global one, call new function
4110 suggest_alternative_in_explicit_scope, only calling
4111 suggest_alternatives_for if it fails, and disabling near match
4112 searches fort that case. When SCOPE is the global namespace,
4113 pass true for new param to suggest_alternatives_for to allow for
4115 * lex.c (unqualified_name_lookup_error): Pass true for new param
4116 to suggest_alternatives_for.
4117 * name-lookup.c (consider_binding_level): Add forward decl.
4118 (suggest_alternatives_for): Add "suggest_misspellings" param,
4119 using it to conditionalize the fuzzy name-lookup code.
4120 (suggest_alternative_in_explicit_scope): New function.
4121 * parser.c (cp_parser_primary_expression): When calling
4122 finish_id_expression, pass location of id_expression rather
4123 than that of id_expr_token.
4124 (cp_parser_id_expression): Convert local "unqualified_id" from
4125 tree to cp_expr to avoid implicitly dropping location information.
4127 2017-01-20 Marek Polacek <polacek@redhat.com>
4130 * call.c (build_conditional_expr_1): Warn about duplicated branches.
4131 * semantics.c (finish_expr_stmt): Build statement using the proper
4134 2017-01-19 Jason Merrill <jason@redhat.com>
4136 US 20 - forwarding references and class template argument deduction
4137 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
4138 * pt.c (push_template_decl_real): Set it.
4139 (maybe_adjust_types_for_deduction): Check it.
4140 (rewrite_template_parm): Copy it.
4142 US 19 - deduction guides and constructors
4143 * call.c (joust): Prefer deduction guides to constructors.
4144 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
4145 (deduction_guide_p): Check DECL_P.
4147 * decl.c (check_initializer): Always use build_aggr_init for array
4150 PR c++/79130 - decomposition and direct-initialization
4151 * init.c (build_aggr_init): Communicate direct-initialization to
4153 (build_vec_init): Check for array copy sooner.
4154 * parser.c (cp_parser_decomposition_declaration): Remove call to
4155 build_x_compound_expr_from_list.
4157 2017-01-18 Jason Merrill <jason@redhat.com>
4159 PR c++/68666 - member variable template-id
4160 * typeck.c (finish_class_member_access_expr): Handle variable
4162 * pt.c (lookup_and_finish_template_variable): No longer static.
4163 * cp-tree.h: Declare it.
4165 2017-01-18 Nathan Sidwell <nathan@acm.org>
4168 * call.c (build_over_call): When checking ellipsis conversions for
4169 an inherited ctor, make sure there is at least one conversion.
4171 2017-01-18 Jason Merrill <jason@redhat.com>
4173 PR c++/78894 - ICE with class deduction and default arg
4174 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
4176 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4179 * mangle.c (write_discriminator): Reorganize abi warning check.
4181 2017-01-18 Nathan Sidwell <nathan@acm.org>
4183 * cp-tree.h: Clarify exception spec node comment.
4184 * except.c (nothrow_spec_p): Simplify by checking node-equality.
4187 * mangle.c (write_exception_spec): Check nothrow explicitly.
4188 (write_encoding): Don't increment processing_template_decl around
4191 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4194 * mangle.c (write_template_args): Add "on" for operator names.
4196 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4199 * mangle.c (write_discriminator): Handle discriminator >= 10.
4201 2017-01-17 Nathan Sidwell <nathan@acm.org>
4204 * cp-tree.h (maybe_generic_this_capture): Declare.
4205 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
4206 (maybe_resolve_dummy): ... here. Call it.
4207 (maybe_generic_this_capture): New.
4208 * parser.c (cp_parser_postfix_expression): Speculatively capture
4209 this in generic lambda in unresolved member function call.
4210 * pt.c (tsubst_copy_and_build): Force hard error from failed
4211 member function lookup in generic lambda.
4213 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
4216 * cp-array-notation.c (expand_array_notation_exprs): Handle
4219 2017-01-11 Jason Merrill <jason@redhat.com>
4221 PR c++/78337 - ICE on invalid with generic lambda
4222 * semantics.c (process_outer_var_ref): Check if containing_function
4223 is null. Move inform call under complain test.
4225 2017-01-11 Nathan Sidwell <nathan@acm.org>
4228 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
4231 2017-01-11 Nathan Sidwell <nathan@acm.org>
4233 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
4235 2017-01-11 Jakub Jelinek <jakub@redhat.com>
4238 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
4239 assertion. Formatting fix.
4242 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
4245 2017-01-10 David Malcolm <dmalcolm@redhat.com>
4248 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
4249 a missing semicolon if we have a valid insertion location for
4252 2017-01-10 Jason Merrill <jason@redhat.com>
4254 FI 20, decomposition declaration with parenthesized initializer.
4255 * parser.c (cp_parser_decomposition_declaration): Use
4256 cp_parser_initializer.
4258 2017-01-09 Jason Merrill <jason@redhat.com>
4260 Implement P0195R2, C++17 variadic using.
4261 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
4262 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
4263 * error.c (dump_decl): Likewise.
4265 2017-01-09 Jakub Jelinek <jakub@redhat.com>
4267 PR translation/79019
4268 PR translation/79020
4269 * semantics.c (finish_omp_clauses): Add missing whitespace to
4270 translatable strings.
4271 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
4273 2017-01-07 Jason Merrill <jason@redhat.com>
4275 PR c++/78948 - instantiation from discarded statement
4276 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
4277 * cp-tree.h (in_discarded_stmt): Declare it.
4278 (struct saved_scope): Add discarded_stmt bitfield.
4279 (in_discarded_stmt): New macro.
4280 * decl2.c (mark_used): Check it.
4281 * parser.c (cp_parser_selection_statement): Adjust.
4282 (cp_parser_jump_statement): Adjust.
4284 2017-01-05 Jakub Jelinek <jakub@redhat.com>
4287 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
4288 REFERENCE_REF_P, set tt to its operand.
4291 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
4292 unions even for C++11 and later.
4294 2017-01-05 Nathan Sidwell <nathan@acm.org>
4297 * pt.c (convert_nontype_argument): Don't try and see if integral
4298 or enum expressions are constants prematurely.
4300 2017-01-04 Marek Polacek <polacek@redhat.com>
4303 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
4304 a zero character literal.
4306 2017-01-04 Jakub Jelinek <jakub@redhat.com>
4309 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
4313 * parser.c (cp_parser_simple_declaration): Only complain about
4314 inconsistent auto deduction if auto_result doesn't use auto.
4316 * parser.c (cp_parser_simple_declaration): Diagnose function
4317 declaration among more than one init-declarators with auto
4321 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
4322 assertion, as lexer->buffer may be NULL.
4324 2017-01-04 Marek Polacek <polacek@redhat.com>
4328 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
4330 2017-01-04 Nathan Sidwell <nathan@acm.org>
4333 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
4334 (lambda_capture_field_type): Update prototype.
4335 * lambda.c (lambda_capture_field_type): Add is_reference parm.
4336 Add referenceness here.
4337 (add_capture): Adjust lambda_capture_field_type call, refactor
4339 * pt.c (tsubst): Adjust lambda_capture_field_type call.
4341 2017-01-01 Jakub Jelinek <jakub@redhat.com>
4343 Update copyright years.
4345 Copyright (C) 2017 Free Software Foundation, Inc.
4347 Copying and distribution of this file, with or without modification,
4348 are permitted in any medium without royalty provided the copyright
4349 notice and this notice are preserved.