1 2017-09-13 Nathan Sidwell <nathan@acm.org>
3 Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
4 * cp-tree.h (struct lang_type): Rename methods to members.
5 (CLASSTYPE_METHOD_VEC): Rename to ...
6 (CLASSTYPE_MEMBER_VEC): ... this.
7 * name-lookup.h (get_method_slot): Rename to ...
8 (get_member_slot): ... this.
9 (resort_type_method_vec): Rename to ...
10 (resort_type_member_vec): ... this.
11 * class.c (add_method, warn_hidden): Adjust.
12 * search.c (dfs_locate_field_accessor_pre): Adjust.
13 * name-lookup.c (method_vec_binary_search): Rename to ...
14 (member_vec_binary_search): ... this and adjust.
15 (method_vec_linear_search): Rename to ...
16 (member_vec_linear_search): ... this and adjust.
17 (fields_linear_search, get_class_binding_direct): Adjust.
18 (get_method_slot): Rename to ...
19 (get_member_slot): ... this and adjust.
20 (method_name_slot): Rename to ...
21 (member_name_slot): ... this and adjust.
22 (resort_type_method_vec): Rename to ...
23 (resort_type_member_vec): ... this and adjust.
24 (method_vec_append_class_fields): Rename to ...
25 (member_vec_append_class_fields): ... this and adjust.
26 (method_vec_append_enum_values): Rename to ...
27 (member_vec_append_enum_values): ... this and adjust.
28 (method_vec_dedup): Rename to ...
29 (member_vec_dedup): ... this and adjust.
30 (set_class_bindings, insert_late_enum_def_bindings): Adjust.
32 2017-09-12 Paolo Carlini <paolo.carlini@oracle.com>
35 * decl.c (start_decl): Early return error_mark_node if duplicate_decls
36 returns it; avoid misleading error message.
38 2017-09-12 Nathan Sidwell <nathan@acm.org>
40 Kill CLASSTYPE_SORTED_FIELDS.
41 * cp-tree.h (struct lang_type): Lose sorted_fields member.
42 (CLASSTYPE_SORTED_FIELDS): Delete.
43 * name-lookup.h (set_class_bindings): Add EXTRA arg.
44 * name-lookup.c (fields_linear_search): New, broken out of ...
45 (lookup_field_1): ... here. Delete remainder of function.
46 (get_class_binding_direct): Reimplement without sorted_fields.
47 (get_class_binding): Rename TYPE arg to KLASS, for consistency.
48 (get_method_slot): Call set_class_binding when creating method_vec
50 (method_name_cmp): Order identically named slots.
51 (sorted_fields_type_new): Delete.
52 (field_vc_append_class_fields): Rename to ...
53 (method_vec_append_class_fields): ... here. Adjust.
54 (field_vec_append_enum_values): Renme to ...
55 (method_vec_append_enum_values): ... here. Adjust.
56 (method_vec_dedup): New.
57 (set_class_bindings): Reimplement.
58 (insert_late_enum_def_bindings): Reimplement.
60 * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
62 (restort_data): Move later.
63 (method_name_cmp, resort_method_name_cmp): Simplify.
64 (resort_type_method_vec): Reformat.
66 2017-09-09 Jason Merrill <jason@redhat.com>
68 * constexpr.c (reduced_constant_expression_p): If
69 CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
71 2017-09-09 Eric Botcazou <ebotcazou@adacore.com>
74 * cp-objcp-common.c (struct debug_type_hasher): New class.
75 (debug_type_hash): New variable.
76 (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
78 2017-09-08 Jason Merrill <jason@redhat.com>
80 PR c++/70029 - ICE with ref-qualifier and -flto
81 * tree.c (cxx_copy_lang_qualifiers): New.
82 * cp-tree.h: Declare it.
83 * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
85 2017-09-06 Jason Merrill <jason@redhat.com>
87 PR c++/82053 - ICE with default argument in lambda in template
88 * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
90 (retrieve_specialization): Use lambda_fn_in_template_p.
91 * cp-tree.h: Declare it.
93 PR c++/82070 - error with nested lambda capture
94 * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
95 register_local_specialization.
97 2017-09-06 Nathan Sidwell <nathan@acm.org>
99 * name-lookup.h (lookup_field_1): Delete.
100 (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
101 * name-lookup.c (lookup_field_1): make static
102 (method_vec_binary_search, method_vec_linear_search): New. Broken
104 (get_class_binding_direct): ... here. Add TYPE_OR_FNS argument.
105 Do complete search of this level.
106 (get_class_binding): Adjust.
107 * decl.c (reshape_init_class): Call get_class_binding.
108 * search.c (lookup_field_r): Move field searching into
109 get_class_binding_direct.
111 * class.c (warn_hidden): Don't barf on non-functions.
112 * decl2.c (check_classfn): Likewise. Check template match earlier.
114 * name-lookup.c (count_fields): Rename to ...
115 (count_class_fields): ... here. Take a class, don't count
117 (add_fields_to_record_type): Rename to ...
118 (field_vec_append_class_fields): ... here. Take a class, don't
119 add NULL-named fields.
120 (add_enum_fields_to_record_type): Rename to ...
121 (field_vec_append_enum_values): ... here.
122 (set_class_bindings): Adjust, assert we added expected number.
123 (insert_late_enum_def_bindings): Reimplement. Create vector if
124 there are now sufficient entries.
126 * name-lookup.h (lookup_fnfields_slot_nolazy,
127 lookup_fnfields_slot): Rename to ...
128 (get_class_binding_direct, get_class_binding): ... here.
129 * name-lookup.c (lookup_fnfields_slot_nolazy,
130 lookup_fnfields_slot): Rename to ...
131 (get_class_binding_direct, get_class_binding): ... here.
132 * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
133 * call.c (build_user_type_conversion_1): Adjust.
134 (has_trivial_copy_assign_p): Adjust.
135 (has_trivial_copy_p): Adjust.
136 * class.c (get_basefndecls) Adjust.
137 (vbase_has_user_provided_move_assign) Adjust.
138 (classtype_has_move_assign_or_move_ctor_p): Adjust.
139 (type_build_ctor_call, type_build_dtor_call): Adjust.
140 * decl.c (register_dtor_fn): Adjust.
141 * decl2.c (check_classfn): Adjust.
142 * pt.c (retrieve_specialization): Adjust.
143 (check_explicit_specialization): Adjust.
144 (do_class_deduction): Adjust.
145 * search.c (lookup_field_r): Adjust.
146 (look_for_overrides_here, lookup_conversions_r): Adjust.
147 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
148 * tree.c (type_has_nontrivial_copy_init): Adjust.
149 * method.c (lazily_declare_fn): Adjust comment.
151 2017-09-05 Nathan Sidwell <nathan@acm.org>
153 * name-lookup.c (do_class_using_decl): Elide read-once temps.
154 Move declarations to initializations.
156 * class.c (add_method): Move slot search and insertion to ...
157 * name-lookup.c (get_method_slot): ... this new function.
158 (lookup_fnfields_slot_nolazy): Cope with NULL slot.
159 * name-lookup.h (get_method_slot): Declare.
160 * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
162 (grok_special_member_properties): Set
163 TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
164 Improve TYPE_HAS_CONSTEXPR_CTOR setting.
166 * cp-tree.h (lang_decl_base): Rename template_conv_p to
168 (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
169 (DECL_CONV_FN_TYPE): FN must be conv op.
170 (DECL_TEMPLATE_CONV_FN_P): Delete.
171 (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
172 * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
175 * class.c (unreverse_member_declarations): Remove extraneous if.
176 * pt.c (push_template_decl_real): Use string concatenation, not
177 \<newline>. Add %<..%>.
179 2017-09-05 Paolo Carlini <paolo.carlini@oracle.com>
182 * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
183 * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
184 creating cdtor_label.
185 * constexpr.c (returns): Add the case of a constructor/destructor
186 returning via a LABEL_DECL_CDTOR label.
187 (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
189 2017-09-01 Nathan Sidwell <nathan@acm.org>
191 * cp-tree.h (resort_type_method_vec): Move declaration to ...
192 * name-lookup.h (resort_type_method_vec): ... here.
193 (set_class_bindings): Lose 2nd arg.
194 * class.c (finish_struct_1, finish_struct): Adjust
195 set_class_bindings call. Don't call finish_struct_methods.
196 (resort_data, method_name_cmp, resort_method_name_cmp,
197 resort_type_method_vec, finish_struct_methods): Move to ...
198 * name-lookup.c (resort_data, method_name_cmp,
199 resort_method_name_cmp, resort_type_method_vec): ... here.
200 (set_class_bindings): Lose fields arg. Swallow finish_struct_methods.
202 * class.c (finish_struct): Call set_class_bindings for the
205 * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
206 Don't call maybe_warn_about_overly_private_class here.
207 (warn_hidden): Cleanup declarations and comments.
208 (type_has_user_provided_constructor): No need to check
209 CLASSTYPE_METHOD_VEC.
210 (type_has_user_provided_or_explicit_constructor): Likewise.
211 (classtype_has_move_assign_or_move_ctor_p): Likewise.
212 (check_bases_and_members): Don't call finish_struct_methods here.
213 (finish_struct_1): Call finish_struct_methods and
214 set_class_bindings immediately after layout. Clear DECL_IN_AGGR_P
216 (finish_struct): For templates process USING_DECLS and clear
217 DECL_IN_AGGR_P before calling finish_struct_methods. Call
218 maybe_warn_about_overly_private_class here.
220 Revert 2017-08-28 Nathan Sidwell <nathan@acm.org>
221 Restore sorted_fields vector.
222 * cp-tree.h (lang_type): Restore sorted_fields vector.
223 (CLASSTYPE_SORTED_FIELDS): Restore.
224 (CLASSTYPE_BINDINGS): Delete.
225 * name-lookup.c (lookup_field_1): Restore binary search.
226 (sorted_fields_type_new, count_fields,
227 add_fields_to_record_type, add_enum_fields_to_record_type): Restore
228 (set_class_bindings): Revert.
229 (insert_late_enum_def_binding): Restore field_vec insertion.
231 2017-09-01 Jakub Jelinek <jakub@redhat.com>
234 * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
236 2017-09-01 Marek Polacek <polacek@redhat.com>
239 * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
241 2017-08-30 Jason Merrill <jason@redhat.com>
243 PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
244 * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
245 (regenerated_lambda_fn_p): New.
246 (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
247 (tsubst_copy) [VAR_DECL]: Likewise.
249 PR c++/82030 - ICE inheriting from multiple lambdas
251 * call.c (compare_ics): Handle null candidate.
253 2017-08-30 Ville Voutilainen <ville.voutilainen@gmail.com>
255 Make taking the address of an overloaded function a non-deduced context
257 * pt.c (unify_overload_resolution_failure): Remove.
258 (unify_one_argument): Adjust.
260 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
261 Alan Hayward <alan.hayward@arm.com>
262 David Sherwood <david.sherwood@arm.com>
264 * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
266 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
267 Alan Hayward <alan.hayward@arm.com>
268 David Sherwood <david.sherwood@arm.com>
270 * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
272 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
273 Alan Hayward <alan.hayward@arm.com>
274 David Sherwood <david.sherwood@arm.com>
276 * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
277 instead of TYPE_MODE.
279 2017-08-29 Jason Merrill <jason@redhat.com>
281 PR c++/81236 - ICE with template-id in generic lambda
282 * semantics.c (finish_id_expression): Remove special dependent case.
283 Avoid some later pieces when dependent.
284 (finish_qualified_id_expr): Do normal BASELINK handling in a
285 template. Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
286 (parsing_default_capturing_generic_lambda_in_template): Remove.
287 * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
288 error for types that will never be complete.
289 * mangle.c (write_expression): Add sanity check.
290 * tree.c (build_qualified_name): Add sanity check.
291 (cp_walk_subtrees): Walk into the class context of a BASELINK.
292 * lambda.c (add_capture): Improve diagnostic for generic lambda
294 * call.c (build_new_method_call_1): Print the right constructor
297 Reimplement handling of lambdas in templates.
298 * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
299 * decl.c (start_preparsed_function): Call start_lambda_scope.
300 (finish_function): Call finish_lambda_scope.
301 * init.c (get_nsdmi): Call start/finish_lambda_scope.
302 * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
303 * parser.c (cp_parser_function_definition_after_declarator): Don't
304 call start/finish_lambda_scope.
305 * pt.c (retrieve_specialization): Ignore lambda functions in
307 (find_parameter_packs_r): Ignore capture proxies. Look into
309 (check_for_bare_parameter_packs): Allow bare packs in lambdas.
310 (tsubst_default_argument): Call start/finish_lambda_scope.
311 (tsubst_function_decl): Handle lambda functions differently.
312 (tsubst_template_decl): Likewise.
313 (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
315 (tsubst_lambda_expr): Create a new closure rather than instantiate
316 the one from the template.
317 (tsubst_copy_and_build): Don't register a specialization of a pack.
318 (regenerate_decl_from_template): Call start/finish_lambda_scope.
319 (instantiate_decl): Remove special lambda function handling.
320 * semantics.c (process_outer_var_ref): Remove special generic lambda
321 handling. Don't implicitly capture in a lambda in a template. Look
322 for an existing proxy.
323 * class.c (current_nonlambda_class_type): Use decl_type_context.
325 * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
326 (LAMBDA_EXPR_RETURN_TYPE): Remove.
327 (struct tree_lambda_expr): Remove closure and return_type fields.
328 * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
329 * pt.c (tsubst_copy_and_build): Likewise.
330 * parser.c (cp_parser_lambda_declarator_opt): Track return type.
331 (cp_parser_lambda_body): Adjust unspecified return type check.
332 * ptree.c (cxx_print_lambda_node): Don't print closure or
335 PR c++/80935 - wrong C++17 error with lambda
336 * decl.c (check_for_uninitialized_const_var): Check
337 is_instantiation_of_constexpr.
338 * constexpr.c (ensure_literal_type_for_constexpr_object): Check
339 is_instantiation_of_constexpr.
340 (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
342 * lambda.c (build_lambda_object): Check for error_mark_node.
343 * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
345 (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
346 (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
348 PR c++/80767 - unnecessary instantiation of generic lambda
349 * call.c (convert_like_real): Call build_user_type_conversion_1 if
351 (add_conv_candidate): Build a ck_user conversion with no candidate.
353 Fix lambdas in template default argument of inherited ctor.
354 * method.c (synthesized_method_base_walk): Replace an inherited
355 template with its specialization.
356 (synthesized_method_walk): Make inheriting_ctor a pointer.
357 (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
358 (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
360 * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
361 template, not the function.
362 (template_guide_p): Adjust.
364 Support copying local_specializations.
365 * cp-tree.h (enum lss_policy): New.
366 (local_specialization_stack): Add policy parameter to default ctor.
367 * pt.c (local_specialization_stack): Copy local_specializations if
370 * constexpr.c (potential_constant_expression_1): Add "now" parm.
371 (is_constant_expression, require_constant_expression): New.
372 (is_static_init_expression, is_nondependent_constant_expression)
373 (is_nondependent_static_init_expression): Drop "potential".
374 * except.c (build_must_not_throw_expr): Do type conversion on
375 value-dependent argument.
376 * pt.c, semantics.c, typeck2.c: Use variants without "potential".
378 Instantiate default arguments/member initializers once.
379 * init.c (get_nsdmi): Remember NSDMI instantiations.
380 * parser.c (inject_this_parameter): Be more picky about
382 * pt.c (tsubst_copy): Simplify 'this' handling.
383 (tsubst_default_argument): Remember default argument
384 instantiations. Take parameter number.
385 (tsubst_default_arguments): Pass it.
386 * call.c (convert_default_arg): Likewise.
388 Fix default argument conversion failure and SFINAE.
389 * call.c (build_over_call): Check convert_default_arg result for
391 * parser.c (cp_parser_late_parsing_default_args): Remember
394 2017-08-28 Nathan Sidwell <nathan@acm.org>
396 * cp-tree.h (lang_type): Replace sorted_fields vector with
398 (CLASSTYPE_SORTED_FIELDS): Delete.
399 (CLASSTYPE_BINDINGS): New.
400 * decl.c (finish_enum_value_list): Swap args of
401 insert_late_enum_def_bindings.
402 * name-lookup.c (lookup_field_1): Replace binary search of sorted
403 fields with map->get.
404 (sorted_fields_type_new, count_fields,
405 add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
406 (add_class_member, add_class_members): New.
407 (set_class_bindings): Create map and insert.
408 (insert_late_enum_def_binding): Swap parms. Use add_clasS_member.
409 * ptree.c (cxx_print_type): Delete sorted fields printing.
411 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
413 * name-lookup.h (set_class_bindings,
414 insert_late_enum_def_bindings): Declare.
415 * decl.c (finish_enum_value_list): Adjust for
416 insert_late_enum_def_bindings name change.
417 * class.c (finish_struct_1): Call set_class_bindings.
418 (count_fields, add_fields_to_record_type,
419 add_enum_fields_to_record_type, sorted_fields_type_new,
420 insert_into_classtype_sorted_fields,
421 insert_late_enum_def_into_classtype_sorted_fields): Move to ...
422 * name-lookup.h (count_fields, add_fields_to_record_type,
423 add_enum_fields_to_record_type, sorted_fields_type_new,
424 set_class_bindings, insert_late_enum_def_bindings): ... here.
426 2017-08-25 Nathan Sidwell <nathan@acm.org>
428 * class.c (method_name_cmp, resort_method_name_cmp): Methods
431 Conversion operators have a special name
432 * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
433 (conv_op_marker, conv_op_identifier): New.
434 (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
435 * decl.c (initialize_predefined_identifiers): Add
437 (cxx_init_decl_processing): Create conv_op_marker.
438 * decl2.c (check_classfn): Lookup conv-ops by name.
439 * class.c (add_method): Use conv_op_identifier & conv_op_marker.
440 (resort_type_method_vec): Don't skip conv-ops.
441 (finish_struct_methods, warn_hidden): Likewise.
442 * name-lookup.h (lookup_all_conversions): Delete.
443 * name-lookup.c (lookup_conversion_operator): Replace with ...
444 (extract_conversion_operator): ... this.
445 (lookup_fnfields_slot_nolazy): Find conv-ops by name.
446 (lookup_all_conversions): Delete.
447 * pt.c (check_explicit_specialization): Find conv-ops by name.
448 * search.c (lookup_conversions_r): Likewise.
450 2017-08-24 Nathan Sidwell <nathan@acm.org>
452 Conversion operators kept on single overload set
453 * class.c (add_method): Keep all conv-ops on one slot.
454 * name-lookup.c (lookup_conversion_operator): Pull the desired
455 conv op out of overload set.
456 * search.c (lookup_conversions_r): Lose template/non-template
458 (lookup_conversions): Likewise.
460 2017-08-23 Nathan Sidwell <nathan@acm.org>
462 * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
463 lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
465 * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
466 lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
467 * search.c (lookup_conversion_operator,
468 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
469 lookup_all_conversions): Move to ...
470 * name-lookup.c (lookup_conversion_operator,
471 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
472 lookup_all_conversions): ... here.
474 * semantics.c (finish_member_declaration): Move USING_DECL check
475 earlier. Always set C++ linkage. Commonize TYPE_FIELD and
476 template decl list insertion.
478 * cp-tree.h (maybe_version_functions): Declare.
479 * decl.c (decls_match): Break function versioning check to
480 separate function. Call it.
481 (maybe_version_functions): Broken out of decls_match.
482 * class.c (add_method): Use maybe_version_functions.
484 * cp-tree.h (print_search_statistics,
485 reinit_search_statistics): Don't declare.
486 * search.c (n_fields_searched, n_calls_lookup_field,
487 n_calls_lookup_field_1, n_calls_lookup_fnfields,
488 n_calls_lookup_fnfields_1, n_calls_get_base_type,
489 n_outer_fields_searched, n_contexts_saved): Delete.
490 (lookup_field_1, lookup_member,
491 lookup_fnfields_slot_nolazy): Remove stat gathering.
492 (print_search_statistics, reinit_search_statistics): Delete.
493 * tree.c (cxx_print_statistics): Don't print search stats.
495 2017-08-21 Nathan Sidwell <nathan@acm.org>
497 * search.c (lookup_field_r): Remove obsolete code for type-named
500 * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
502 (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
503 (lookup_field_fuzzy_r): Adjust.
505 2017-08-21 David Malcolm <dmalcolm@redhat.com>
507 * call.c (build_over_call): Pass NULL for new parameter to
508 check_function_arguments.
509 * typeck.c (cp_build_function_call_vec): Likewise.
511 2017-08-21 Nathan Sidwell <nathan@acm.org>
514 * pt.c (instantiate_class_template_1):
515 BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
517 2017-08-18 David Malcolm <dmalcolm@redhat.com>
520 * name-lookup.c (maybe_suggest_missing_header): Convert return
521 type from void to bool; return true iff a suggestion was offered.
522 (suggest_alternative_in_explicit_scope): Move call to
523 maybe_suggest_missing_header to before use of best_match, and
524 return true if the former offers a suggestion.
526 2017-08-18 H.J. Lu <hongjiu.lu@intel.com>
529 * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
530 * decl2.c (grokbitfield): Don't allow bit-field with
531 warn_if_not_aligned type.
533 2017-08-17 Nathan Sidwell <nathan@acm.org>
535 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
536 * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
537 (TYPE_TEMPLATE_INFO): Simplify.
538 (SET_TYPE_TEMPLATE_INFO): Simplify.
540 * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
541 don't need lang_type.
542 (cxx_make_type): Use maybe_add_lang_type_raw return value.
543 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
546 * cp-tree.h (struct lang_type): Remove template_info field.
547 (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
548 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
550 2017-08-14 Martin Sebor <msebor@redhat.com>
553 * error.c (cp_printer): Handle 'G'.
555 2017-08-11 Martin Liska <mliska@suse.cz>
557 * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
558 TARGET_SUPPORTS_ALIASES.
559 (handle_tls_init): Likewise.
560 (note_mangling_alias): Likewise. Remove ATTRIBUTE_UNUSED for
562 * optimize.c (can_alias_cdtor): Likewise.
564 2017-08-11 Jason Merrill <jason@redhat.com>
566 PR c++/81671 - nullptr_t template parameter
567 * pt.c (convert_nontype_argument): Fix nullptr_t check.
569 2017-08-10 Jason Merrill <jason@redhat.com>
571 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
572 * method.c (synthesized_method_walk): Don't diagnose lack of
575 PR c++/80452 - Core 1579, implicit move semantics on return/throw
576 * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
577 tentatively changed the lvalue to an rvalue.
578 * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
579 (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
580 parameter is an rvalue reference.
581 * except.c (build_throw): Do maybe-rvalue overload resolution twice.
582 * typeck.c (check_return_expr): Likewise.
584 2017-08-10 David Malcolm <dmalcolm@redhat.com>
586 * parser.c (cp_parser_error): Update for new param to
588 (class token_pair): New class.
589 (struct matching_paren_traits): New struct.
590 (matching_parens): New typedef.
591 (struct matching_brace_traits): New struct.
592 (matching_braces): New typedef.
593 (cp_parser_statement_expr): Convert explicit parsing of
594 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
595 class matching_parens, so that the pertinent open parenthesis is
596 highlighted when there are problems locating the close
598 (cp_parser_primary_expression): Likewise.
599 (cp_parser_compound_literal_p): Remove consumption of opening
601 (cp_parser_postfix_expression): Convert explicit parsing of
602 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
603 above. Use it to consume the opening paren previously consumed by
604 cp_parser_compound_literal_p.
605 (cp_parser_parenthesized_expression_list): Likewise.
606 (cp_parser_unary_expression): Likewise.
607 (cp_parser_new_expression): Likewise.
608 (cp_parser_cast_expression): Likewise.
609 (cp_parser_builtin_offsetof): Likewise.
610 (cp_parser_trait_expr): Likewise.
611 (cp_parser_lambda_declarator_opt): Likewise.
612 (cp_parser_lambda_body): Likewise, for matching_braces.
613 (cp_parser_compound_statement): Likewise.
614 (cp_parser_selection_statement): Likewise, for matching_parens.
615 (cp_parser_iteration_statement): Likewise.
616 (cp_parser_already_scoped_statement): Likewise, for
618 (cp_parser_linkage_specification): Likewise.
619 (cp_parser_static_assert): Likewise, for matching_parens.
620 (cp_parser_decltype): Likewise.
621 (cp_parser_operator): Likewise.
622 (cp_parser_enum_specifier): Likewise.
623 (cp_parser_namespace_definition): Likewise.
624 (cp_parser_direct_declarator): Likewise.
625 (cp_parser_braced_list): Likewise.
626 (cp_parser_class_specifier_1): Likewise, for matching_braces.
627 (cp_parser_constant_initializer): Likewise.
628 (cp_parser_noexcept_specification_opt): Likewise, for
630 (cp_parser_exception_specification_opt): Likewise.
631 (cp_parser_handler): Likewise.
632 (cp_parser_asm_specification_opt): Likewise.
633 (cp_parser_asm_operand_list): Likewise.
634 (cp_parser_gnu_attributes_opt): Likewise.
635 (cp_parser_std_attribute_spec): Likewise.
636 (cp_parser_requirement_parameter_list): Likewise.
637 (cp_parser_requirement_body): Likewise, for matching_braces.
638 (cp_parser_compound_requirement): Likewise.
639 (cp_parser_template_introduction): Likewise.
640 (cp_parser_sizeof_pack): Likewise, for matching_parens.
641 (cp_parser_sizeof_operand): Likewise; use it to consume the
642 opening paren previously consumed by cp_parser_compound_literal_p.
643 (get_matching_symbol): New function.
644 (cp_parser_required_error): Add param "matching_location". Remove
645 calls to cp_parser_error, instead setting a non-NULL gmsgid, and
646 handling it if set by calling c_parse_error, potentially with a
647 secondary location if matching_location was set.
648 (cp_parser_require): Add param "matching_location", with a default
649 value of UNKNOWN_LOCATION.
650 (cp_parser_require_keyword): Update for new param of
651 cp_parser_required_error.
652 (cp_parser_objc_encode_expression): Update to class matching_parens
654 (cp_parser_objc_defs_expression): Likewise.
655 (cp_parser_objc_protocol_expression): Likewise.
656 (cp_parser_objc_selector_expression): Likewise.
657 (cp_parser_objc_typename): Likewise.
658 (cp_parser_objc_superclass_or_category): Likewise.
659 (cp_parser_objc_try_catch_finally_statement): Likewise.
660 (cp_parser_objc_synchronized_statement): Likewise.
661 (cp_parser_objc_at_property_declaration): Likewise.
662 (cp_parser_oacc_single_int_clause): Likewise.
663 (cp_parser_oacc_shape_clause): Likewise.
664 (cp_parser_omp_clause_collapse): Likewise.
665 (cp_parser_omp_clause_default): Likewise.
666 (cp_parser_omp_clause_final): Likewise.
667 (cp_parser_omp_clause_if): Likewise.
668 (cp_parser_omp_clause_num_threads): Likewise.
669 (cp_parser_omp_clause_num_tasks): Likewise.
670 (cp_parser_omp_clause_grainsize): Likewise.
671 (cp_parser_omp_clause_priority): Likewise.
672 (cp_parser_omp_clause_hint): Likewise.
673 (cp_parser_omp_clause_defaultmap): Likewise.
674 (cp_parser_omp_clause_ordered): Likewise.
675 (cp_parser_omp_clause_schedule): Likewise.
676 (cp_parser_omp_clause_num_teams): Likewise.
677 (cp_parser_omp_clause_thread_limit): Likewise.
678 (cp_parser_omp_clause_aligned): Likewise.
679 (cp_parser_omp_clause_linear): Likewise.
680 (cp_parser_omp_clause_safelen): Likewise.
681 (cp_parser_omp_clause_simdlen): Likewise.
682 (cp_parser_omp_clause_depend): Likewise.
683 (cp_parser_omp_clause_device): Likewise.
684 (cp_parser_omp_clause_dist_schedule): Likewise.
685 (cp_parser_oacc_clause_async): Likewise.
686 (cp_parser_omp_critical): Likewise.
687 (cp_parser_omp_for_loop): Likewise.
688 (cp_parser_omp_sections_scope): Likewise.
689 (cp_parser_omp_declare_reduction_exprs): Likewise.
690 Update for new param to cp_parser_required_error.
691 (cp_parser_oacc_routine): Likewise.
692 (cp_parser_transaction_expression): Likewise.
693 (cp_parser_cilk_simd_vectorlength): Likewise.
695 2017-08-09 Jason Merrill <jason@redhat.com>
697 PR c++/81525 - wrong constant value with generic lambda
698 * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
699 (tsubst_copy) [VAR_DECL]: Handle auto.
701 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
702 * init.c (get_nsdmi): Add complain parm.
703 * typeck2.c (digest_nsdmi_init): Add complain parm.
704 (process_init_constructor_record): Pass complain to get_nsdmi.
705 * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
706 * method.c (get_defaulted_eh_spec): Add complain parm. Pass it into
707 synthesized_method_walk.
708 (synthesized_method_walk): Adjust.
709 (walk_field_subobs): Pass complain to get_nsdmi.
710 (defaulted_late_check): Skip other checks if deleted.
711 * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
712 * call.c (build_aggr_conv): Pass complain to get_nsdmi.
713 * parser.c (defarg_location): New.
714 * error.c (location_of): Use it.
716 2017-08-09 Marek Polacek <polacek@redhat.com>
718 * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
719 * typeck.c (build_binary_op): Change the type of a parameter to bool.
720 (cp_truthvalue_conversion): Use true instead of 1.
722 2017-08-08 Marek Polacek <polacek@redhat.com>
725 * cp-gimplify.c (cp_fold): If folding exposed a branch of
726 a COND_EXPR, convert it to the original type of the COND_EXPR, if
729 2017-08-08 Martin Liska <mliska@suse.cz>
731 * call.c: Include header files.
732 * cp-gimplify.c: Likewise.
733 * cp-ubsan.c: Likewise.
736 * search.c: Likewise.
737 * semantics.c: Likewise.
738 * typeck.c: Likewise.
740 2017-08-07 Martin Liska <mliska@suse.cz>
742 * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
744 (cp_parser_std_attribute): Likewise.
745 * tree.c: Add new include.
747 2017-08-04 Paolo Carlini <paolo.carlini@oracle.com>
750 * pt.c (do_class_deduction): Handle the case of no viable implicit
751 deduction guides; simplify the code generating implicit deduction
754 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
757 * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
758 destructor as expressions.
760 2017-08-02 Jakub Jelinek <jakub@redhat.com>
763 * call.c (build_user_type_conversion_1): Only call
764 lookup_fnfields_slot if totype is CLASS_TYPE_P.
766 2017-07-31 Jason Merrill <jason@redhat.com>
768 * decl.c (declare_global_var): Set DECL_CONTEXT.
770 2017-07-31 Jan Hubicka <hubicka@ucw.cz>
771 Martin Liska <mliska@suse.cz>
773 * pt.c (tsubst_copy): Copy PREDICT_EXPR.
774 * semantics.c (finish_goto_stmt): Build gimple predict
776 * constexpr.c (potential_constant_expression_1): Handle
779 2017-07-31 Martin Liska <mliska@suse.cz>
782 * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
783 also with current_function_decl non-null equality.
784 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
785 * decl.c (compute_array_index_type): Likewise.
786 * init.c (finish_length_check): Likewise.
787 * typeck.c (cp_build_binary_op): Likewise.
789 2017-07-29 Jakub Jelinek <jakub@redhat.com>
791 * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
792 DW_AT_export_symbols.
793 * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
794 argument, pass it through to the debug hook.
795 (finish_namespace_using_directive): Adjust
796 emit_debug_info_using_namespace caller.
797 (push_namespace): Likewise. Call it after setting
798 DECL_NAMESPACE_INLINE_P.
799 (cp_emit_debug_info_for_using): Pass false as new argument to
800 the imported_module_or_decl debug hook.
802 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
804 * lex.c (copy_decl): Adjust.
805 (copy_type): Likewise.
807 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
810 * lambda.c (add_capture): Early return if we cannot capture by
813 2017-07-26 Jason Merrill <jason@redhat.com>
815 P0702R1 - List deduction of vector.
816 * pt.c (do_class_deduction): Special-case deduction from a single
817 element of related type.
819 2017-07-26 Leonid Koppel <lkoppel@uwaterloo.ca>
821 PR c++/67054 - Inherited ctor with non-default-constructible members
822 * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
823 when deducing an inheriting constructor.
825 2017-07-21 Nathan Sidwell <nathan@acm.org>
827 * search.c (lookup_conversion_operator): Return overloads.
828 (lookup_fnfields_idx_nolazy): Absorb into ...
829 (lookup_fnfields_slot_nolaxy): ... here.
830 (lookup_fnfields_1): Absorb into ...
831 (lookup_fnfields_slot): ... here.
833 Remove special CDtor METHOD_VEC slots.
834 * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
835 CLASSTYPE_DESTRUCTOR_SLOT): Delete.
836 (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
837 (CLASSTYPE_DESTRUCTOR): Likewise.
838 * class (add_method): Don't use special cdtor slots.
839 * search.c (lookup_fnfields_idx_nolazy): Likewise.
840 (look_for_overrides_here): Use lookup_fnfields_slot.
841 * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
843 * call.c (add_candidates): Move decls to initialization. Don't
846 2017-07-20 Nathan Sidwell <nathan@acm.org>
849 * class.c (maybe_warn_about_overly_private_class,
850 finish_struct_methods, one_inheriting_sig, count_fields,
851 add_fields_to_record_type, check_field_decls, check_methods,
852 clone_function_decl, set_method_tm_attributes,
853 finalize_literal_type_property, check_bases_and_members,
854 create_vtable_ptr, determine_key_method,
855 unreverse_member_declarations, finish_struct,
856 add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
857 * decl.c (fixup_anonymous_aggr): Likewise.
858 * decl2.c (reset_type_linkage_2): Likewise.
859 * method.c (after_nsdmi_defaulted_late_checks,
860 lazily_declare_fn): Likewise.
861 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
862 * pt.c (instantiate_class_template_1, tsubst_expr,
863 do_type_instantiation, instantiate_pending_templates): Likewise.
864 * search.c (lookup_field_1): Likewise.
865 * semantics.c (finish_member_declaration,
866 finish_omp_declare_simd_methods): Likewise.
868 2017-07-19 Nathan Sidwell <nathan@acm.org>
870 * class.c (add_implicitly_declared_members): Use
871 classtype_has_move_assign_or_move_ctor_p.
872 (classtype_has_move_assign_or_move_ctor,
873 classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
874 (classtype_has_move_assign_or_move_ctor_p): ... this new function.
875 * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
877 (classtype_has_move_assign_or_move_ctor_p): ... this.
878 * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
879 * tree.c (type_has_nontrivial_copy_init): Adjust.
881 * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
882 PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
884 2017-07-18 Nathan Sidwell <nathan@acm.org>
886 * cp-array-notation.c (build_array_notation_ref): Use
887 TYPE_{MIN,MAX}_VALUE.
889 * class.c (classtype_has_move_assign_or_move_ctor): Declare.
890 (add_implicitly_declared_members): Use it.
891 (type_has_move_constructor, type_has_move_assign): Merge into ...
892 (classtype_has_move_assign_or_move_ctor): ... this new function.
893 * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
895 2017-07-17 Volker Reichelt <v.reichelt@netcologne.de>
897 * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
898 friend outside class and obsolete auto as storage-class-specifier.
900 2017-07-17 Nathan Sidwell <nathan@acm.org>
902 * class.c (maybe_warn_about_overly_private_class): Ignore public
905 * class.c (type_has_user_declared_move_constructor,
906 type_has_user_declared_move_assign): Combine into ...
907 (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
908 * cp-tree.h (type_has_user_declared_move_constructor,
909 type_has_user_declared_move_assign): Combine into ...
910 (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
911 * method.c (maybe_explain_implicit_delete): Use it.
912 (lazily_declare_fn): Use it.
913 * tree.c (type_has_nontrivial_copy_init): Use it.
915 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
916 semantics, simplify implementation.
918 2017-07-16 Volker Reichelt <v.reichelt@netcologne.de>
920 * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
921 in old-style cast diagnostic.
922 * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
923 in useless cast diagnostic.
924 * error.c (type_to_string): Remove enum special handling.
926 2017-07-14 David Malcolm <dmalcolm@redhat.com>
928 * name-lookup.c (get_std_name_hint): Add '<' and '>' around
930 (maybe_suggest_missing_header): Update for addition of '<' and '>'
931 to above. Provide a fix-it hint.
932 * pt.c: Include "gcc-rich-location.h"
933 (listify): Attempt to add fix-it hint for missing
934 #include <initializer_list>.
935 * rtti.c: Include "gcc-rich-location.h".
936 (typeid_ok_p): Attempt to add fix-it hint for missing
939 2017-07-12 Jason Merrill <jason@redhat.com>
941 P0512R0 - Deduction from an initializer list.
942 * pt.c (do_class_deduction): Do list deduction in two phases.
944 2017-07-12 Nathan Sidwell <nathan@acm.org>
946 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
947 DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
949 * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
950 DECL_CXX_DESTRUCTOR explicitly.
951 * decl2.c (grokclassfn): Likewise.
952 * friend.c (do_friend): Likewise.
953 * method.c (make_thunk, make_alias_for,
954 implicitly_declare_fn): Likewise.
956 2017-07-11 Jason Merrill <jason@redhat.com>
959 * decl.c (grokparms): Downgrade error about array of unknown bound
960 to pedwarn and disable it for C++17.
962 2017-07-11 Nathan Sidwell <nathan@acm.org>
964 * decl2.c (reset_type_linkage_2): Dont't change ctor name.
966 2017-07-10 Martin Sebor <msebor@redhat.com>
968 * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
970 2017-07-06 Jason Merrill <jason@redhat.com>
972 PR c++/81204 - parse error with dependent template-name
973 * parser.c (cp_parser_lookup_name): Revert previous change.
975 2017-07-06 David Malcolm <dmalcolm@redhat.com>
977 * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
978 selftest::run_cp_tests.
979 (selftest::run_cp_tests): New function.
980 * cp-tree.h (selftest::run_cp_tests): New decl.
982 2017-07-04 Jakub Jelinek <jakub@redhat.com>
984 * parser.c (cp_parser_decomposition_declaration): Replace
985 decomposition declaration with structured binding in diagnostics.
986 * decl.c (cp_finish_decomp): Likewise.
987 (grokdeclarator): Likewise.
990 * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
991 forms of structured binding initializers.
993 2017-07-03 Paolo Carlini <paolo.carlini@oracle.com>
996 * decl.c (grokdeclarator): Move checks on function return type after
997 the splice_late_return_type call; if declspecs->locations[ds_type_spec]
998 is UNKNOWN_LOCATION fall back to input_location.
1000 2017-07-03 David Malcolm <dmalcolm@redhat.com>
1002 * parser.c (enum required_token): Fix spelling of
1003 RT_INTERATION to RT_ITERATION.
1004 (cp_parser_iteration_statement): Likewise.
1005 (cp_parser_required_error): Likewise.
1007 2017-06-30 Jason Merrill <jason@redhat.com>
1009 PR c++/81257 - ICE with invalid ::template.
1010 PR c++/54769 - wrong lookup of dependent template-name.
1011 * parser.c (cp_parser_template_name): Revert part of last change.
1013 2017-06-30 Nathan Sidwell <nathan@acm.org>
1015 * config-lang.in (gtfiles): Add cp/lex.c.
1016 * cp-tree.h (mangle_convop_name_for_type): Rename ...
1017 (make_conv_op_name): ... here. Move to lex.
1018 * lambda.c (maybe_add_lambda_conv_op): Update.
1019 * parser.c (cp_parser_conversion_function_id): Update.
1020 * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
1021 tsubst_copy_and_build): Update.
1022 * semantics.c (apply_deduced_return_type): Update.
1023 * mangle.c (conv_type_hasher, conv_type_names,
1024 mangle_conv_op_name_for_type): Move to ...
1025 * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
1028 2017-06-30 David Malcolm <dmalcolm@redhat.com>
1031 * parser.c (cp_parser_postfix_expression): Construct a location
1032 for typeid expressions.
1034 2017-06-30 Nathan Sidwell <nathan@acm.org>
1036 * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
1038 (lookup_all_conversions): Declare.
1039 * class.c (get_basefndecls): Use lookup_fnfields_slot.
1040 * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
1041 * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
1043 * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
1044 (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
1045 lookup_all_conversions.
1046 * search.c (lookup_fnfields_1): Make static.
1047 (lookup_all_conversions): New.
1048 (class_method_index_for_fn): Delete.
1049 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
1050 lookup_fnfields_slot.
1052 * call.c (build_new_method_call_1): Use constructo_name to get
1053 ctor name. Move argument processing earlier to merge cdtor
1055 * decl.c (grokfndecl): Cdtors have special names.
1056 * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
1057 * pt.c (check_explicit_specialization): Cdtor name is already
1059 * search.c (class_method_index_for_fn): Likewise.
1062 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
1063 a matching TYPE_DECL.
1065 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
1067 * class.c (add_method): Change pair of errors to error + inform.
1068 (handle_using_decl): Likewise.
1070 2017-06-29 Jason Merrill <jason@redhat.com>
1072 * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
1074 PR c++/81180 - ICE with C++17 deduction of member class template.
1075 * pt.c (build_deduction_guide): Correct member template handling.
1077 PR c++/81188 - matching decltype of member function call.
1078 * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
1080 2017-06-29 Nathan Sidwell <nathan@acm.org>
1083 * parser.c (cp_parser_namespace_definition): Immediately close the
1084 namespace if there's no open-brace.
1085 * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
1088 2017-06-29 Jason Merrill <jason@redhat.com>
1090 PR c++/81164 - ICE with invalid inherited constructor.
1091 * search.c (binfo_direct_p): New.
1092 * name-lookup.c (do_class_using_decl): Use it.
1094 2017-06-29 Nathan Sidwell <nathan@acm.org>
1096 * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
1097 VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
1098 * decl.c (initialize_predefined_identifiers): Name cdtor special
1099 names consistently. Use literals for above deleted defines.
1100 (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
1102 * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
1105 * call.c (check_dtor_name): Use constructor_name for enums too.
1106 (build_new_method_call_1): Use constructor_name for cdtors and
1108 * class.c (build_self_reference): Use TYPE_NAME to get name of
1110 * name-lookup (constructor_name): Use DECL_NAME directly.
1111 (constructor_name_p): Reimplement.
1112 (push_class_level_binding_1): Use TYPE_NAME directly.
1114 * class.c (finish_struct): Use OVL_P.
1115 (get_vfield_name): Measure constructor_name length.
1116 * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
1117 (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
1118 * cxx-pretty-print.c (is_destructor_name): Delete.
1119 (pp_cxx_unqualified_id): Remove bogus destructor name checking.
1120 * decl.c (grokfndecl): Move cheap checks first when looking for
1121 implicit extern cness.
1123 * parser.c (cp_parser_direct_declarator): Reorder if to avoid
1124 indentation. Remove unnecessary assignment of constructor name.
1126 Whitespace cleanups.
1127 * call.c (name_as_c_string): Move CONST_CAST to return.
1128 (build_new_method_call_1): Remove unneeded bracing.
1129 * class.c (include_empty_classes): Unbreak line.
1130 * constraint.cc (tsubst_check_constraint): Add space.
1131 * cp-tree.h (lang_decl_ns): Add comment.
1132 (PTRMEM_CST_MEMBER): Break line.
1133 * decl.c (grokfndecl): Add blank lines. Unbreak some others.
1134 (grokdeclarator): Remove lines, move declaration to first use.
1135 * decl2.c (decl_needed_p): Fix indentation.
1136 (c_parse_final_cleanups): Remove blank line.
1137 * method.c (implicitly_declare_fn): Move declaration to first use.
1138 * search.c (current_scope): Add blank lines.
1140 2017-06-28 Jason Merrill <jason@redhat.com>
1142 PR c++/72764 - ICE with invalid template typename.
1143 * decl.c (build_typename_type): No longer static.
1144 * tree.c (strip_typedefs): Use it instead of make_typename_type.
1146 PR c++/69300 - ICE with self-referential noexcept
1147 * pt.c (maybe_instantiate_noexcept): Check for recursion.
1149 PR c++/61022 - error with variadic template template parm
1150 * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
1152 PR c++/72801 - ICE with variadic partial specialization
1153 * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
1155 PR c++/55639 - partial specialization with ::template
1156 * parser.c (cp_parser_class_head): Handle ::template.
1158 PR c++/45976 - error with ::template in declarator.
1159 * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
1161 PR c++/54769 - wrong lookup of dependent template-name.
1162 * parser.c (cp_parser_template_name): Handle dependent object type.
1163 (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
1165 (cp_parser_id_expression): Pass it.
1166 (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
1168 * parser.c (cp_parser_template_id): Use the range location on the
1171 PR c++/81204 - parse error with dependent template-name
1172 * parser.c (cp_parser_lookup_name): Disqualify function templates
1175 2017-06-27 Nathan Sidwell <nathan@acm.org>
1177 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
1178 initialization point. Don't unnecessarily check for ctor name.
1180 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
1181 (CLASSTYPE_DESTRUCTOR): ... this.
1182 * class.c (accessible_nvdtor_p,
1183 maybe_warn_about_overly_private_class,
1184 add_implicitly_declared_members,
1185 clone_constructors_and_destructors, type_has_virtual_destructor):
1186 Adjust for CLASSTYPE_DESTRUCTOR.
1187 (deduce_noexcept_on_destructors): Absorb into ...
1188 (check_bases_and_members): ... here.
1189 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
1190 * init.c (build_delete): Likewise.
1191 * parser.c (cp_parser_lookup_name): Likewise.
1192 * pt.c (check_explicit_specialization): Likewise.
1193 * rtti.c (emit_support_tinfos): Likewise.
1194 * search.c (lookup_fnfields_idx_nolazy): Likewise.
1196 Kill IDENTIFIER_TEMPLATE.
1197 * cp-tree.h (lang_identifier): Remove class_template_info field.
1198 (IDENTIFIER_TEMPLATE): Delete.
1199 * name-lookup.c (constructor_name_full): Subsume into ...
1200 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
1201 (constructor_name_p): Likewise.
1202 * mangle.c (write_source_name): Likewise.
1203 * ptree.c (cxx_print_identifier): Likewise.
1205 2017-06-27 Marek Polacek <polacek@redhat.com>
1208 * parser.c (cp_parser_already_scoped_statement): Initialize
1211 2017-06-26 Jason Merrill <jason@redhat.com>
1213 PR c++/81215 - deduction failure with variadic TTP.
1214 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
1216 2017-06-26 Martin Sebor <msebor@redhat.com>
1219 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
1220 to detect casting away cv-qualifiers.
1222 2017-06-26 Nathan Sidwell <nathan@acm.org>
1224 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
1225 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
1227 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
1228 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
1229 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
1230 * decl.c (grok_op_properties): Adjust identifier checking.
1231 * init.c (expand_default_init): Adjust identifier descision.
1232 * method.c (implicitly_declare_fn): Don't use
1233 DECL_ASSIGNMENT_OPERATOR_P.
1234 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
1236 * call.c (in_charge_arg_for_name): Reimplement.
1237 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
1240 2017-06-26 Marek Polacek <polacek@redhat.com>
1243 * parser.c (cp_parser_statement): Add a default argument. Save the
1244 location of the expression-statement after labels have been parsed.
1245 (cp_parser_implicitly_scoped_statement): Set the location of the
1246 body of the conditional after parsing all the labels. Call
1247 warn_for_multistatement_macros.
1248 (cp_parser_already_scoped_statement): Likewise.
1250 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
1253 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
1254 'typename' in error messages about missing 'typename'.
1256 2017-06-23 Jason Merrill <jason@redhat.com>
1258 PR c++/79056 - C++17 ICE with invalid template syntax.
1259 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
1261 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
1262 * pt.c (template_placeholder_p): New.
1263 * cp-tree.h: Declare it.
1265 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
1267 * decl.c (duplicate_decls): Use builtin_structptr_types.
1269 2017-06-22 Nathan Sidwell <nathan@acm.org>
1271 Reorder IDENTIFIER flags
1273 * cp-tree.h (enum cp_identifier_kind): New.
1274 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
1275 IDENTIFIER_KIND_BIT_2): New.
1276 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
1277 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
1278 (C_IS_RESERVED_WORD): Replace with ...
1279 (IDENTIFIER_KEYWORD_P): ... this.
1280 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
1281 (IDENTIFIER_CDTOR_P): ... this.
1282 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
1283 (IDENTIFIER_OPNAME_P): Replace with ...
1284 (IDENTIFIER_ANY_OP_P): ... this.
1285 (IDENTIFIER_ASSIGN_OP_P): New.
1286 (IDENTIFIER_TYPENAME_P): Replace with ...
1287 (IDENTIFIER_CONV_OP_P): ... this.
1288 (NEW_DELETE_OPNAME_P): Replace with ...
1289 (IDENTIFIER_NEWDEL_OP_P): ... this.
1290 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
1291 (get_identifier_kind_name, set_identifier_kind): Declare.
1292 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
1293 (init_operators): Adjust to avoid keywords, use
1294 set_identifier_kind. Copy TYPE_EXPR slot.
1295 (init_reswords): Call set_identifier_kind.
1296 (unqualified_name_lookup_error): Adjust.
1297 * operators.def (TYPE_EXPR): Remove.
1298 * decl.c (struct predefined_identifier): Move into ...
1299 (initialize_predefined_identifiers): ... here. Call
1300 set_identifier_kind.
1301 (grokfndecl, check_var_type, grokdeclarator): Adjust.
1302 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
1304 * call.c (name_as_c_string): Adjust.
1305 (build_new_method_call_1): Likewise.
1306 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
1307 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
1308 * dump.c (cp_dump_tree): Adjust.
1309 * error.c (dump_decl_name): Adjust.
1310 * mangle.c (write_unqualified_id, write_member_name,
1311 write_expression): Adjust.
1312 (mangle_conv_op_name_for_type): Use set_identifier_kind.
1313 * name-lookup.c (do_class_using_decl): Adjust.
1314 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
1315 * parser.c (cp_lexer_get_preprocessor_token,
1316 cp_parser_direct_declarator): Likewise.
1317 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
1318 tsubst_copy, tsubst_copy_and_build): Adjust.
1319 * ptree.c (cxx_print_identifier): Print identifier kind.
1320 * search.c (lookup_field_r, lookup_member,
1321 lookup_fnfields_idx_nolazy): Adjust.
1322 * semantics.c (finish_id_expression): Adjust..
1323 * typeck.c (cp_build_addr_expr_1): Adjust.
1325 2017-06-21 Jakub Jelinek <jakub@redhat.com>
1328 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
1329 Complain about t not being a variable if t is OVERLOAD even
1330 when processing_template_decl.
1332 2017-06-21 David Malcolm <dmalcolm@redhat.com>
1334 * parser.c (get_cast_suggestion): New function.
1335 (maybe_add_cast_fixit): New function.
1336 (cp_parser_cast_expression): Capture the location of the closing
1337 parenthesis. Call maybe_add_cast_fixit when emitting warnings
1338 about old-style casts.
1340 2017-06-20 Jason Merrill <jason@redhat.com>
1342 PR c++/80972 - C++17 ICE with attribute packed.
1343 * call.c (build_over_call): Allow a TARGET_EXPR from reference
1346 2017-06-20 Nathan Sidwell <nathan@acm.org>
1348 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
1349 (nelts_identifier): Delete.
1350 * decl.c (initialize_predefined_identifiers): Remove nelts.
1352 PR c++/67074 - namespace aliases
1353 * decl.c (duplicate_decls): Don't error here on mismatched
1355 * name-lookup.c (name_lookup::add_value): Matching namespaces are
1357 (diagnose_name_conflict): Namespaces are never redeclarations.
1358 (update_binding): An alias can match a real namespace.
1360 2017-06-19 Jason Merrill <jason@redhat.com>
1362 PR c++/80562 - ICE with constexpr if.
1363 * semantics.c (finish_if_stmt_cond): Call
1364 instantiate_non_dependent_expr.
1366 PR c++/80829 - ICE with constexpr copy of base subobject.
1367 * constexpr.c (clear_no_implicit_zero): New.
1368 (cxx_eval_call_expression): Call it.
1370 2017-06-19 Nathan Sidwell <nathan@acm.org>
1374 * name-lookup.c (set_decl_namespace): Don't follow using
1375 directives and ignore using decls. Only check overly-explicit
1376 scope after discovering decl.
1378 2017-06-19 Jason Merrill <jason@redhat.com>
1380 PR c++/81073 - constexpr and static var in statement-expression.
1381 * typeck2.c (store_init_value): Always call
1382 require_potential_constant_expression.
1383 * pt.c (convert_nontype_argument): Likewise.
1384 * constexpr.c (potential_constant_expression_1): Adjust message.
1385 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
1386 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
1388 2017-06-19 Nathan Sidwell <nathan@acm.org>
1390 * pt.c (coerce_template_parms): Fix indentation.
1391 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
1395 * name-lookup.c (update_binding): Only warn about constructors
1396 hidden by functions.
1398 2017-06-17 Jason Merrill <jason@redhat.com>
1400 PR c++/60063 - -Wunused-local-typedefs and templates.
1401 * decl2.c (is_late_template_attribute): Return false for "used".
1403 PR c++/70844 - -Wuseless-cast and inheriting constructor.
1404 * method.c (forward_parm): Suppress warn_useless_cast.
1406 2017-06-16 Jason Merrill <jason@redhat.com>
1408 PR c++/81045 - Wrong type-dependence with auto return type.
1409 * pt.c (type_dependent_expression_p): An undeduced auto outside the
1410 template isn't dependent.
1411 * call.c (build_over_call): Instantiate undeduced auto even in a
1414 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
1415 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
1416 set longer for a generic lambda.
1418 PR c++/80614 - Wrong mangling for C++17 noexcept type
1419 * mangle.c (write_type): Put the eh spec back on the function type.
1421 PR c++/81102 - Wrong error with partial specialization.
1422 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
1423 types. Do type deduction later.
1425 PR c++/81074 - ICE with partial specialization of member template.
1427 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
1429 PR c++/80831 - ICE with -fsyntax-only.
1430 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
1432 PR c++/80639 - ICE with invalid PMF initialization.
1433 PR c++/80043 - ICE with -fpermissive
1434 * typeck.c (convert_for_assignment): Recurse when instantiate_type
1435 returns without an error.
1437 2017-06-16 Nathan Sidwell <nathan@acm.org>
1439 * pt.c (tsubst_baselink): Fix & clarify formatting.
1441 * cp-tree.h (build_this_parm, cp_build_parm_decl,
1442 build_artificial_parm): Add FN parm.
1443 * decl.c (start_cleanup_fn): Adjust.
1444 (build_this_parm): Add FN parm, pass it through.
1445 (grokfndecl): Adjust parm building.
1446 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
1447 (build_artificial_parm): Add FN parm, pass through.
1448 (maybe_retrofit_in_chrg): Adjust parm building.
1449 (start_static_storage_duration_function): Likwise.
1450 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
1451 * method.c (implicitly_declare_fn): Likewise.
1452 * parser.c (inject_this_parameter): Likewise.
1454 Symbol tables are insert only.
1455 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
1456 derive from pointer_hash. Make undeletable.
1458 * class.c (resort_type_method_vec): Avoid potential unsigned
1461 Don't defer noexcept_deferred_spec.
1462 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
1463 * decl.c (cxx_init_decl_processing): Initialize
1464 noexcept_deferred_spec.
1465 * except.c (unevaluated_noexcept_spec): Delete.
1466 * class.c (deduce_noexcept_on_destructor): Use
1467 noexcept_deferred_spec directly.
1468 * method.c (implicitly_declare_fn): Likewise.
1470 Make keyed_classes a vector.
1471 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
1472 (keyed_classes): Declare as vector.
1473 * decl.c (keyed_classes): Define.
1474 (cxx_init_decl_processing): Allocate it.
1475 (record_key_method_defined): Use vec_safe_push.
1476 * class.c (finish_struct_1): Likewise.
1477 * pt.c (instantiate_class_template_1): Likewise.
1478 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
1481 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
1482 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
1484 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
1485 (get_tinfo_decl): Use get_tinfo_desc.
1486 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
1487 (create_pseudo_type_info): Delete.
1488 (get_pseudo_ti_index): Just determine the index.
1489 (get_tinfo_desc): New. Create all types lazily.
1490 (create_tinfo_types): Just allocate the descriptor array.
1491 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
1494 2017-06-15 Martin Sebor <msebor@redhat.com>
1497 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
1499 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
1500 (build_cxx_call): Call maybe_warn_class_memaccess.
1502 2017-06-14 Jakub Jelinek <jakub@redhat.com>
1504 * cp-gimplify.c (cp_genericize_r): Turn most of the function
1505 into a switch (TREE_CODE (stmt)) statement from long else if
1508 2017-06-13 Jakub Jelinek <jakub@redhat.com>
1511 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
1512 argument even if it has REFERENCE_TYPE.
1515 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
1516 BLOCK_VARS (outer) chain.
1517 (cxx_omp_const_qual_no_mutable): Likewise.
1519 2017-06-13 Martin Liska <mliska@suse.cz>
1522 * class.c (build_base_path): Use sanitize_flags_p.
1523 * cp-gimplify.c (cp_genericize_r): Likewise.
1524 (cp_genericize_tree): Likewise.
1525 (cp_genericize): Likewise.
1526 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1527 * decl.c (compute_array_index_type): Likewise.
1528 (start_preparsed_function): Likewise.
1529 * decl2.c (one_static_initialization_or_destruction): Likewise.
1530 * init.c (finish_length_check): Likewise.
1531 * lambda.c (maybe_add_lambda_conv_op): Likewise.
1532 * typeck.c (cp_build_binary_op): Likewise.
1533 (build_static_cast_1): Likewise.
1535 2017-06-11 Jason Merrill <jason@redhat.com>
1537 * error.c (dump_expr): Use is_this_parameter.
1539 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
1542 2017-06-09 Jason Merrill <jason@redhat.com>
1544 Missing bits from N4268, constant evaluation for all non-type args.
1545 * call.c (build_converted_constant_expr): Rename from
1546 build_integral_nontype_arg_conv, handle all types.
1547 * pt.c (convert_nontype_argument): In C++17 call it for all types.
1548 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
1549 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
1551 Overhaul pointer-to-member conversion and template argument handling.
1552 * call.c (standard_conversion): Avoid creating ck_pmem when the
1553 class type is the same.
1554 * cvt.c (can_convert_qual): Split from
1555 perform_qualification_conversions.
1556 * constexpr.c (cxx_eval_constant_expression): Check it.
1557 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
1558 adjustment is necessary.
1559 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
1560 (convert_nontype_argument): Avoid redundant error.
1562 * call.c (convert_like_real): Remove "inner" parameter.
1563 Don't replace a constant with its value.
1564 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
1566 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
1569 * parser.c (cp_parser_constant_expression): Check
1570 potential_rvalue_constant_expression after decay_conversion.
1571 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
1573 PR c++/80384 - ICE with dependent noexcept-specifier
1574 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
1577 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
1579 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
1581 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
1582 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
1583 (excpet.c): Mark terminate as cold.
1585 2017-06-08 Jakub Jelinek <jakub@redhat.com>
1588 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
1589 to sizetype before size_binop.
1592 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
1593 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
1594 and OMP_CLAUSE_SHARED_READONLY flags.
1596 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
1598 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
1600 2017-06-07 Nathan Sidwell <nathan@acm.org>
1602 * class.c (layout_class_type): Restructure overlong-bitfield tpe
1605 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
1608 * pt.c (do_class_deduction): Build qualified type.
1610 2017-06-06 Nathan Sidwell <nathan@acm.org>
1612 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
1613 sans using directives. Don't walk into inline namespaces.
1616 * name-lookup.c (adl_class_only): Don't add visible friends.
1618 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
1620 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
1622 2017-06-02 Nathan Sidwell <nathan@acm.org>
1624 Remove lang_type_ptrmem.
1625 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
1627 (lang_type_class): ... this. Reorder bitfields. Rename to ...
1628 (lang_type): ... this. Delete old definition.
1629 (lang_type_ptrmem): Delete.
1630 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
1631 (LANG_TYPE_PTRMEM_CHECK): Delete.
1632 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
1633 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
1634 * decl.c (build_ptrmemfunc_type): Adjust.
1635 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
1636 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
1638 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
1641 Remove cp_binding_level::namespaces
1642 * name-lookup.h (cp_binding_level): Lose namespaces field.
1643 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
1645 (suggest_alternatives_for): Adjust for namespace list. Do
1646 breadth-first search.
1647 * decl2.c (collect_source_refs): Namespaces are on the regulr
1649 (collect_ada_namespace): Likewise.
1651 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
1653 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
1656 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
1659 * method.c (constructible_expr): Strip array types before calling
1662 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
1665 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
1666 for case INDIRECT_REF too in the main switch.
1668 2017-05-31 Jason Merrill <jason@redhat.com>
1670 PR c++/80840 - ICE with constexpr and reference
1671 * pt.c (convert_nontype_argument): Don't test whether a decl is
1672 value-dependent when binding to a reference.
1674 2017-05-31 Nathan Sidwell <nathan@acm.org>
1676 * cp-tree.h (lang_decl_slector): New enum.
1677 (lang_decl_base): Make selector an enum. Drop decomposition_p
1679 (lang_decl): Use enum for discrimination.
1680 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
1681 LANG_DECL_DEOMP_CHECK): Use enum.
1682 (DECL_DECOMPOSITION_P): Use selector value.
1683 (SET_DECL_DECOMPOSITION_P): Delete.
1684 (retrofit_lang_decl): Lose SEL parm.
1685 (fit_decomposition_lang_decl): Declare.
1686 * decl.c (cp_finish_decomp, grokdeclarator): Use
1687 fit_decomposition_lang_decl.
1688 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
1690 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
1691 (fit_decomposition_lang_decl): Likewise.
1692 (retrofit_lang_decl): Use worker functions.
1693 (cxx_dup_lang_specific_decl): Use selector enum.
1694 (maybe_add_lang_type_raw): New. Broken out of ...
1695 (cxx_make_type_name): ... here. Call it.
1697 2017-05-30 Jason Merrill <jason@redhat.com>
1699 PR c++/80856 - ICE with local extern in template
1700 * semantics.c (finish_call_expr): Replace a local extern overload
1701 set in a template with the IDENTIFIER_NODE.
1703 2017-05-30 David Malcolm <dmalcolm@redhat.com>
1705 * call.c (perform_implicit_conversion_flags): Convert
1706 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
1707 (print_conversion_rejection): Replace pairs of %qT with
1708 %qH and %qI in various places.
1709 (build_user_type_conversion_1): Likewise.
1710 (build_integral_nontype_arg_conv): Likewise.
1711 (build_conditional_expr_1): Likewise.
1712 (convert_like_real): Likewise.
1713 (convert_arg_to_ellipsis): Likewise.
1715 (initialize_reference): Likewise.
1716 * cvt.c (cp_convert_to_pointer): Likewise.
1717 (cp_convert_to_pointer): Likewise.
1718 (convert_to_reference): Likewise.
1719 (ocp_convert): Likewise.
1720 * error.c (cp_printer): Gain bool and const char ** parameters.
1721 (struct deferred_printed_type): New struct.
1722 (class cxx_format_postprocessor): New class.
1723 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
1724 to pp->m_format_postprocessor.
1725 (comparable_template_types_p): New function.
1726 (newline_and_indent): New function.
1727 (arg_to_string): New function.
1728 (print_nonequal_arg): New function.
1729 (print_template_differences): New function.
1730 (type_to_string_with_compare): New function.
1731 (print_template_tree_comparison): New function.
1732 (append_formatted_chunk): New function.
1733 (add_quotes): New function.
1734 (cxx_format_postprocessor::handle): New function.
1735 (defer_phase_2_of_type_diff): New function.
1736 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
1738 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
1739 %qH and %qI in various places.
1740 (convert_member_func_to_ptr): Likewise.
1741 (build_reinterpret_cast_1): Likewise.
1742 (convert_for_assignment): Likewise.
1743 * typeck2.c (check_narrowing): Likewise.
1745 2017-05-30 Nathan Sidwell <nathan@acm.org>
1747 Kill IDENTIFIER_NAMESPACE_BINDINGS
1748 * cp-tree.h (lang_identifier): Delete namespace_bindings.
1749 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
1750 (lang_decl_ns): Add bindings.
1751 (DECL_NAMESPACE_BINDINGS): New.
1752 * lex.c (retrofit_lang_decl): Create namespace hash table.
1753 * name-lookup.c (find_namespace_slot): Change to use hash-map.
1754 * ptree.c (cxx_print_binding): Delete.
1755 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
1757 * cp-tree.def (OVERLOAD): Fix comment.
1758 * cp-tree.h: Fix comments and whitespace.
1759 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
1760 * name-lookup.c (add_decl_to_level): Assert not class.
1761 (check_local_shadow): Use OVL_P.
1762 (pushdecl_with_scope_1): Rename to ...
1763 (do_pushdecl_with_Scope): ... here.
1764 (do_nonmember_using_decl): Use qualified_namespace_lookup return
1766 (push_class_level_binding_1): Use OVL_P.
1767 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
1768 (pushtag_1): Rename to ...
1769 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
1771 (store_class_bindings): Do not time here.
1772 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
1773 * pt.c (listify): Declare argvec at point of initialization.
1776 * name-lookup.c (add_decl_to_level): Assert not making a circular
1778 (update_binding): Don't prematurely slide artificial decl.
1780 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
1782 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
1784 2017-05-29 Nathan Sidwell <nathan@acm.org>
1786 PR c++/80891 (#1,#5)
1787 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
1788 * name-lookup.c (name_lookup): Add deduping field.
1789 (name_lookup::preserve_state, name_lookup::restore_state): Deal
1791 (name_lookup::add_overload): New.
1792 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
1793 (name_lookup::search_adl): Set deduping. Don't unmark here.
1794 * pt.c (most_specialized_instantiation): Revert previous change,
1795 Assert not given duplicates.
1796 * tree.c (lookup_mark): Just mark the underlying decls.
1797 (lookup_maybe_add): Dedup using marked decls.
1800 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
1801 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
1803 Stat hack representation
1804 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
1805 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
1807 (find_namespace_binding): Replace with ...
1808 (find_namespace_slot): ... this.
1809 (find_namespace_value): New.
1810 (name_lookup::search_namespace_only,
1811 name_lookup::adl_namespace_only): Adjust.
1812 (update_binding): Add SLOT parameter, adjust.
1813 (check_local_shadow): Use find_namespace_value.
1814 (set_local_extern_decl_linkage): Likewise.
1815 (do_pushdecl): Adjust for namespace slot.
1816 (push_local_binding): Assert not a namespace binding.
1817 (check_for_out_of_scope_variable): Use find_namespace_value.
1818 (set_identifier_type_value_with_scope): Likewise.
1819 (get_namespace_binding): Likewise.
1820 (set_namespace_binding): Delete.
1821 (set_global_binding): Directly update the binding.
1822 (finish_namespace_using_decl): Likewise.
1823 (lookup_type_scope_1): Use find_namespace_slot and update.
1824 (do_push_nested_namespace): Use find_namespace_value.
1827 * pt.c (most_specialized_instantiation): Cope with duplicate
1831 * cp-tree.h (build_min_nt_call_vec): Declare.
1832 * decl.c (build_offset_ref_call_from_tree): Call it.
1833 * parser.c (cp_parser_postfix_expression): Likewise.
1834 * pt.c (tsubst_copy_and_build): Likewise.
1835 * semantics.c (finish_call_expr): Likewise.
1836 * tree.c (build_min_nt_loc): Keep unresolved lookups.
1837 (build_min): Likewise.
1838 (build_min_non_dep): Likewise.
1839 (build_min_non_dep_call_vec): Likewise.
1840 (build_min_nt_call_vec): New.
1843 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
1845 (lookup_keep): Call it.
1847 2017-05-26 Nathan Sidwell <nathan@acm.org>
1850 * name-lookup.c (push_inline_namespaces): New.
1851 (push_namespace): Look inside inline namespaces.
1853 Inline and using namespace representation change.
1854 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
1856 (DECL_NAMESPACE_USING): Adjust.
1857 (DECL_NAMESPACE_INLINEES): New.
1858 * name-lookup.h (struct cp_binding_level): Change usings
1860 * name-lookup.c (name_lookup::do_queue_usings,
1861 name_lookup::queue_usings): Adjust.
1862 (name_lookup::search_namespace, name_lookup::search_usings,
1863 name_lookup::queue_namespace): Adjust.
1864 (name_lookup::adl_namespace_only): Adjust.
1865 (add_using_namespace, push_namespace): Push onto vector.
1866 (pop_namespace): Add timing logic.
1868 * call.c (build_operator_new_call): Do namelookup and ADL here.
1869 (build_new_op_1): Likewise.
1870 * name-lookup.h (lookup_function_nonclass): Delete declaration.
1871 (do_using_directive): Likewise.
1872 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
1874 (struct scope_binding): Delete.
1875 (EMPTY_SCOPE_BINDING): Delete.
1876 (set_decl_namespace): Use OVL_P.
1877 (finish_local_using_decl): Lose unnecesary checks.
1878 (lookup_function_nonclass): Delete.
1879 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
1881 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
1882 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
1884 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
1885 (lkp_iterator): Add outer field. Adjust ctor.
1886 (lkp_iterator::operator++): New.
1887 (lookup_mark, lookup_maybe_add): Declare.
1888 * name-lookup.c (name_lookup): Delete fn_set member.
1889 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
1891 (name_lookup::add_value): Use lookup_add directly.
1892 (name_lookup::add_fns: Use lookup_maybe_add.
1893 (name_lookup::search_adl): Mark and unmark fns.
1895 * pt.c (check_explicit_specialization): Use lookup_add directly.
1896 * ptree.c (cxx_print_xnode): Show complete overload structure.
1897 * tree.c (lookup_mark, lookup_maybe_add): New.
1899 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
1901 2017-05-26 Jakub Jelinek <jakub@redhat.com>
1903 * cp-tree.h (struct lang_decl_decomp): New type.
1904 (struct lang_decl): Add u.decomp.
1905 (LANG_DECL_DECOMP_CHECK): Define.
1906 (DECL_DECOMPOSITION_P): Note it is set also on the vars
1907 for user identifiers.
1908 (DECL_DECOMP_BASE): Define.
1909 (retrofit_lang_decl): Add extra int = 0 argument.
1910 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
1911 use it to influence the selector choices and for selector
1912 0 to non-zero transition copy old content.
1913 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
1914 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
1915 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
1916 wording if decl is a structured binding.
1917 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
1918 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
1919 of individual variables for tuple structured bindings.
1920 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
1921 Clear DECL_DECOMP_BASE.
1922 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
1923 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
1925 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
1928 2017-05-25 Jason Merrill <jason@redhat.com>
1930 PR c++/80605 - __is_standard_layout and zero-length array
1931 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
1933 2017-05-25 Nathan Sidwell <nathan@acm.org>
1935 Kill OVL_CURRENT, OVL_NEXT.
1936 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
1937 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
1938 (consider_binding_level): Use OVL_FIRST.
1939 (cp_emit_debug_info_for_using): Use lkp_iterator.
1940 * pt.c (check_explicit_specialization): Use ovl_iterator.
1942 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
1943 * cp-tree.h (lang_decl_ns): Remove ns_users field.
1944 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
1945 (TREE_INDIRECT_USING): Delete.
1946 * name-lookup.h (is_associated_namespace): Delete.
1947 * name-lookup.c (name_lookup::search_usings,
1948 name_lookup::do_queue_usings): Usings are always direct.
1949 (is_associated_namespace): Delete.
1950 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
1951 (namespace_ancestor_1, namespace_ancestor): Delete.
1952 (push_using_directive_1, push_using_directive): Delete.
1953 (add_using_namespace_1): Delete.
1954 (add_using_namespace): Reimplement.
1955 (emit_debug_info_using_namespace): New.
1956 (finish_namespace_using_directive, finish_local_using_directive,
1957 push_namespace): Adjust.
1958 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
1960 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
1962 * semantics.c (finish_handler_parms): Warn about non-reference type
1965 2017-05-25 Nathan Sidwell <nathan@acm.org>
1967 Reimplement unqualified namespace lookup.
1968 * name-lookup.c (name_lookup::using_pair,
1969 name_lookup::using_queue): New typedefs.
1970 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
1971 name_lookup::queue_usings): New.
1972 (name_lookup::search_unqualified): New.
1973 (merge_functions, same_entity_p, ambiguous_decl,
1974 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
1975 lookup_using_namespace): Delete.
1976 (lookup_name_real_1): Adjust.
1978 Reimplement qualified namespace lookup.
1979 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
1980 (name_lookup::ambiguous, name_lookup::add_value,
1981 name_lookup::add_type, name_lookup::process_binding): New.
1982 (name_lookup::search_namespace_only,
1983 name_lookup::search_namespace, name_lookup::search_usings): New.
1984 (name_lookup::search_qualified): New.
1985 (do_nonmember_using_decl, suggest_alternatives_for,
1986 lookup_qualified_name): Adjust.
1987 (tree_vec_contains): Delete.
1988 (qualified_lookup_using_namespace): Rename to ...
1989 (qualified_namespace_lookup): ... here. Reimplement.
1992 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
1993 * name-lookup.h (lookup_arg_dependent): Return plain tree.
1994 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
1995 arg_assoc_args_vec, arg_assoc_type, add_function,
1996 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
1997 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
1998 lookup_arg_dependent_1): Delete.
1999 (name_lookup): New lookup object.
2000 (name_lookup::preserve_state, name_lookup::restore_state,
2001 name_lookup::mark_seen, name_lookup::find_and_mark,
2002 name_lookup::add_fns, name_lookup::adl_namespace_only,
2003 name_lookup::adl_namespace, name_lookup::adl_class_only,
2004 name_lookup::adl_bases, name_lookup::adl_class,
2005 name_lookup::adl_expr, name_lookup::adl_type,
2006 name_lookup::adl_template_arg, name_lookup::search_adl): New.
2007 (lookup_arg_dependent): Return a plain tree. Adjust.
2008 (is_associated_namespace): Move later.
2010 2017-05-24 Nathan Sidwell <nathan@acm.org>
2012 * friend.c (do_friend): Remove check for existing decl.
2013 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
2014 * name-lookup.c (push_local_binding): Directly look for binding.
2015 (lookup_name_innermost_nonclass_level_1): Delete.
2016 (lookup_name_innermost_nonclass_level): Delete.
2018 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
2020 * cp-tree.h (cp_free_lang_data): Add extern.
2021 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
2023 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
2024 * typeck.c (type_unknown_p): Delete.
2025 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
2026 overload management.
2027 (dependent_name): Likewise.
2028 (decl_anon_ns_mem_p): Simplify.
2030 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
2033 * tree.c (reshape_init): Use unqualified type for direct enum init.
2034 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
2035 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
2036 non-class destination types.
2037 (build_const_cast_1): Strip cv-quals from destination types.
2038 (build_static_cast, build_reinterpret_cast, build_const_cast)
2039 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
2041 2017-05-24 Martin Sebor <msebor@redhat.com>
2044 * call.c (fully_fold_internal): Adjust.
2046 2017-05-24 Nathan Sidwell <nathan@acm.org>
2048 * cp-tree.h (ovl_skip_hidden): Declare.
2049 * tree.c (ovl_skip_hidden): New.
2050 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
2051 (lookup_arg_dependent_1): Likewise.
2052 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
2053 (hidden_name_p, remove_hidden_names): Delete.
2054 (lookup_name_real_1): Do not strip hidden names.
2055 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
2057 * cp-tree.h (OVL_HIDDEN_P): New.
2058 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
2059 (ovl_iterator::reveal_node): Declare.
2060 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
2061 (ovl_insert): Order on hiddenness.
2062 (ovl_iterator::reveal_node): New.
2063 * name-lookup.c (anticipated_builtin_p): New.
2064 (supplement_binding_1): Use it.
2065 (set_local_extern_decl_linkage): Use hidden_p.
2066 (do_pushdecl): Deal with unhiding a hidden decl, use
2067 anticipated_builtin_p.
2068 (do_nonmember_using_decl): Use anticipated_decl_p.
2069 (lookup_name_real_1): Use DECL_HIDDEN_P.
2071 2017-05-23 Jason Merrill <jason@redhat.com>
2073 -Wunused and C++17 structured bindings
2074 * decl.c (poplevel): Don't warn about unused structured bindings,
2075 only real variables.
2076 * error.c (dump_simple_decl): Handle structured bindings.
2077 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
2079 2017-05-23 Nathan Sidwell <nathan@acm.org>
2081 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
2082 * name-lookup.c (create_local_binding): New.
2083 (update_binding): New.
2084 (pushdecl_maybe_friend_1): Rename to ...
2085 (do_pushdecl): ... this. Reimplement.
2087 (push_overloaded_decl_1, push_overloaded_decl): Delete.
2089 2017-05-23 Jason Merrill <jason@redhat.com>
2091 PR c++/80396 - built-in for make_integer_sequence.
2092 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
2093 (expand_integer_pack, expand_builtin_pack_call): New.
2094 (find_parameter_packs_r): Check builtin_pack_call_p.
2095 (check_for_bare_parameter_packs): Handle it.
2096 (tsubst_pack_expansion): Call expand_builtin_pack_call.
2097 (declare_integer_pack): New.
2098 (init_template_processing): Call it.
2099 * decl2.c (mark_used): Check builtin_pack_fn_p.
2101 2017-05-23 Nathan Sidwell <nathan@acm.org>
2103 * name-lookup.c (find_namespace_binding): New.
2104 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
2105 (set_identifier_type_value_with_scope): Use find_namespace_binding.
2106 (find_binding, cp_binding_level_find_binding_for_name,
2107 binding_for_name, namespace_binding_1): Delete.
2108 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
2109 (get_namespace_binding, set_namespace_binding,
2110 finish_namespace_using_decl, unqualified_namespace_lookup_1,
2111 qualified_lookup_using_namespace, lookup_type_scope_1,
2112 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
2115 * parser.c (cp_parser_template_id): Keep the lookup when stashing
2118 * cp-tree.h (DECL_HIDDEN_P): New.
2119 * name-lookup.c (set_decl_context,
2120 set_local_extern_decl_linkage): New, broken out of ...
2121 (pushdecl_maybe_friend_1): ... here. Call them.
2123 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
2125 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
2126 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
2129 2017-05-23 Nathan Sidwell <nathan@acm.org>
2131 * cp-tree.h (OVL_P): New.
2132 * name-lookup.h (push_local_binding): Delete.
2133 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
2134 (finish_namespace_using_decl, finish_local_using_decl): ... here
2135 * name-lookup.c (add_decl_to_level): Swap args.
2136 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
2137 (diagnose_name_conflict): Check contexts are same for redecl.
2138 (update_local_overload): New.
2139 (compparms_for_decl_and_using): Rename to ...
2140 (matching_fn_p): ... here.
2141 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
2142 push_local_bindings call.
2143 (push_local_binding): Make static, replace FLAGS arg with
2145 (validate_nonmember_using_decl): Use OVL_FIRST.
2146 (do_nonmember_using_decl): Use in/out parameters. Use
2147 lkp_iterator and simplify.
2148 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
2149 (finish_namespace_using_decl, finish_local_using_decl): ... here.
2151 (lookup_type_current_level): Delete.
2152 * parser.c (cp_parser_using_declaration): Adjust.
2153 * pt.c (tsubst_expr): Adjust.
2155 2017-05-22 Nathan Sidwell <nathan@acm.org>
2157 * name-lookup.h (parse_using_directive): Replace with ...
2158 (finish_namespace_using_directive): ... this and ...
2159 (finish_local_using_directive): ... this.
2160 * name-lookup.c (add_using_namespace_1): Move later.
2161 (add_using_namespace): Move later, add namespace_p arg, remove
2163 (push_using_directive_1): Directly recurse.
2164 (do_using_directive, parse_using_directive): Delete, split into ...
2165 (finish_namespace_using_directive): ... this and ...
2166 (finish_local_using_directive): ... this.
2167 (push_namespace): Use add_using_namespace.
2168 * parser.c (cp_parser_using_directive): Call
2169 finish_namespace_using_directive or finish_local_using_directive.
2170 * pt.c (tsubst_expr): Call finish_local_using_directive.
2172 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
2173 * cp-tree.h (raw_dump_id): Declare.
2174 * decl2.c (raw_dump_id): Define.
2175 (dump_tu): Use raw_dump_id.
2177 * config-lang.in (gtfiles): Sort list, break lines.
2179 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
2180 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
2181 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
2182 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
2183 CPTI_RETHROW_FN): New.
2184 (noexcept_deferred_spec): New.
2185 (terminate_node, call_unexpected_node): Rename to ...
2186 (terminate_fn, call_unexpected_fn): ... here.
2187 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
2188 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
2189 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
2190 (init_exception_processing): Adjust.
2191 (declare_library_fn): Create and push the fns here.
2192 (do_get_exception_ptr, do_begin_catch, do_end_catch,
2193 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
2194 declare_library_fn use.
2195 (unevaluated_noexcept_spec): Adjust.
2196 * cp-gimplify.c (genericize_eh_spec_block,
2197 gimplify_most_not_throw_expr): Adjust.
2199 * name-lookup.c (pushdecl_top_level,
2200 pushdecl_top_level_and_finish): Move after namespace pushing and
2202 (push_to_top_level): Rename to ...
2203 (do_push_to_top_level): ... here. Remove timing code.
2204 (pop_from_top_level_1): Rename to ...
2205 (do_pop_from_top_level): ... here.
2206 (do_push_nested_namespace, do_pop_nested_namespace)
2207 (push_to_top_level): New wrapper for do_push_to_top_level.
2208 (pop_from_top_level): Adjust.
2209 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
2211 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
2213 * config-lang.in (gtfiles): Add c-family/c-format.c,
2214 except.c, init.c, lambda.c and friend.c.
2215 * class.c (dvirt_fn): Move out of function scope,
2217 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
2218 * init.c (fn): Likewise.
2219 * lambda.c (ptr_id, max_id): Likewise.
2220 * friend.c (global_friend): Add GTY attribute.
2222 2017-05-19 Nathan Sidwell <nathan@acm.org>
2224 * call.c (add_list_candidates): Use OVL_FIRST.
2225 (build_new_method_call_1): Likewise.
2226 * cp-tree.h (OVL_SINGLE_P): New.
2227 (TYPE_HIDDEN_P): New.
2228 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
2229 * dump.c (cp_tump_tree): Adjust overload dumping.
2230 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
2232 * method.c (lazily_declare_fn): Assert we added it.
2233 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
2235 (cp_parser_template_name): Use lkp_iterator.
2236 * pt.c (begin_template_parm_list): Fixup comment.
2237 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
2238 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
2239 (ovl_scope): Use lkp_iterator.
2241 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
2243 * parser.c (cp_parser_omp_clause_default): Handle
2244 "OMP_CLAUSE_DEFAULT_PRESENT".
2246 * parser.c (cp_parser_omp_clause_default): Avoid printing more
2247 than one syntax error message.
2249 2017-05-19 Nathan Sidwell <nathan@acm.org>
2251 * class.c (class_dump_id): Define.
2252 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
2253 * cp-objcp-common.c (cp_register_dumps): New.
2254 * cp-objcp-common.h (cp_register_dumps): Declare.
2255 (LANG_HOOKS_REGISTER_DUMPS): Override.
2256 * cp-tree.h (class_dump_id): Declare.
2258 2017-05-18 Nathan Sidwell <nathan@acm.org>
2260 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
2262 (lookup_keep): Declare.
2263 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
2264 * pt.c (tsubst_copy): Assert lookup is persistent.
2265 * semantics.c (finish_call_expr): Use lkp_iterator, call
2267 * tree.c (ovl_copy): New.
2268 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
2271 * cp-tree.h (OVL_USED): Replace with ...
2272 (OVL_USING_P): ... this.
2273 (ovl_iterator::using_p): Adjust.
2274 * name-lookup.c (push_overloaded_decl_1,
2275 do_nonmember_using_decl): Adjust.
2276 * search.c (lookup_field_r): Adjust.
2277 * tree.c (ovl_insert, ovl_scope): Adjust.
2279 * cp-tree.h (lookup_add): Swap args.
2280 (ovl_cons, build_overload): Delete.
2281 * name-lookup.c (add_function, push_overloaded_decl_1,
2282 do_nonmember_using_decl, merge_functions, remove_hidden_names):
2283 Use lookup_add, ovl_insert.
2284 * pt.c (check_explicit_specialization): Use lookup_add.
2285 (do_class_deduction): Likewise. Refactor if.
2286 * tree.c (lookup_add): Swap args.
2287 (ovl_cons, build_overload): Delete.
2289 * name-lookup.c (find_local_binding): New, broken out of ...
2290 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
2291 (set_namespace_binding): Swap scope & name args.
2292 (namespace_binding_1): Likewise.
2293 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
2294 (push_overloaded_decl_1): Likewise.
2295 (set_global_binding): Likewise.
2296 (get_namespace_binding): Adjust namespace_binding_1 call.
2298 2017-05-17 Nathan Sidwell <nathan@acm.org>
2300 * cp-tree.h (default_hash_traits <lang_identifier *>): New
2302 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
2303 (extern_c_fns): New hash table.
2304 (check_extern_c_conflict): New, broken out of ...
2305 (pushdecl_maybe_friend_1): ... here. Call it.
2306 (c_linkage_bindings): Just look in hash table.
2308 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
2312 Implement new C++ intrinsics __is_assignable and __is_constructible.
2313 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
2315 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
2316 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2317 * method.c (constructible_expr): Set cp_unevaluated.
2318 (is_xible_helper): New.
2319 (is_trivially_xible): Adjust.
2321 * parser.c (cp_parser_primary_expression): Handle
2322 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
2323 (cp_parser_trait_expr): Likewise.
2324 * semantics.c (trait_expr_value): Handle
2325 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2327 2017-05-17 Nathan Sidwell <nathan@acm.org>
2329 * cp-tree.h (ovl_iterator::using_p): New predicate.
2330 (ovl_iterator::remove_node): New worker.
2331 (ovl_insert): Declare.
2332 * tree.c (ovl_insert): New.
2333 (ovl_iterator::remove_node): New.
2334 * class.c (add_method): Use ovl_iterator, ovl_insert.
2335 (clone_function_decl): Fix description.
2336 (clone_constructors_and_destructors): Use ovl_iterator.
2338 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
2339 (maybe_warn_about_overly_private_class): Use ovl_iterator.
2340 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
2341 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
2342 (get_base_fndecls): Use ovl_iterator.
2343 (warn_hidden): Use OVL_NAME, ovl_iterator.
2344 (add_implicitly_declared_members): Use ovl_iterator.
2345 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
2347 (finish_shorthand_constraint): Simplify, use ovl_make.
2348 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
2349 * search.c (shared_member_p): Use ovl_iterator.
2350 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
2351 (lookup_conversion_operator): Use OVL_FIRST.
2352 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
2353 (look_for_overrides_here): Use ovl_iterator.
2354 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
2355 * typeck.c (build_x_unary_op): Use ovl_make.
2357 2017-05-17 Martin Liska <mliska@suse.cz>
2359 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
2360 use it instead of int type.
2361 (dump_vtable): Likewise.
2362 (dump_vtt): Likewise.
2363 * decl2.c (dump_tu): Likewise.
2365 2017-05-16 David Malcolm <dmalcolm@redhat.com>
2367 * call.c (enforce_access): Add access_failure_info * param and use
2368 it to record access failures.
2369 * cp-tree.h (class access_failure_info): New class.
2370 (enforce_access): Add access_failure_info * param, defaulting to
2372 (lookup_member): Likewise.
2373 (locate_field_accessor): New function decl.
2374 (perform_or_defer_access_check): Add access_failure_info * param,
2376 * search.c (lookup_member): Add access_failure_info * param and
2377 pass it on to call to perform_or_defer_access_check.
2378 (matches_code_and_type_p): New function.
2379 (field_access_p): New function.
2380 (direct_accessor_p): New function.
2381 (reference_accessor_p): New function.
2382 (field_accessor_p): New function.
2383 (struct locate_field_data): New struct.
2384 (dfs_locate_field_accessor_pre): New function.
2385 (locate_field_accessor): New function.
2386 * semantics.c (perform_or_defer_access_check): Add
2387 access_failure_info * param, and pass it on to call to
2389 * typeck.c (access_failure_info::record_access_failure): New method.
2390 (access_failure_info::maybe_suggest_accessor): New method.
2391 (finish_class_member_access_expr): Pass an access_failure_info
2392 instance to the lookup_member call, and call its
2393 maybe_suggest_accessor method afterwards.
2395 2017-05-16 Marek Polacek <polacek@redhat.com>
2399 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
2401 2017-05-16 Nathan Sidwell <nathan@acm.org>
2403 * name-lookup.c (check_local_shadow): New, broke out of ...
2404 (pushdecl_maybe_friend_1): ... here. Call it.
2406 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
2407 (ovl_first): Move inline definition to end of file.
2408 (ovl_make, lookup_add): Declare.
2409 (get_fns, get_first_fn): Make pure.
2410 * tree.c (ovl_cache): New.
2411 (ovl_make, lookup_add): New.
2412 * pt.c (do_class_deduction): Don't add candidates that will be
2415 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
2416 (print_error_for_call_failure): Use OVL_NAME.
2417 (build_op_call_1): Use ovl_iterator.
2418 (add_candidates): Use OVL_FIRST & lkp_iterator.
2419 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
2421 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
2422 (type_has_user_nondefault_constructor,
2423 in_class_defaulted_default_constructor,
2424 type_has_user_provided_constructor,
2425 type_has_user_provided_or_explicit_constructor,
2426 type_has_non_user_provided_default_constructor,
2427 vbase_has_user_provided_move_assign,
2428 type_has_move_constructor, type_has_move_assign,
2429 type_has_user_declared_move_constructor,
2430 type_has_user_declared_move_assign,
2431 type_build_ctor_call, type_build_dtor_call,
2432 type_requires_array_cookie, explain_non_literal_class): Likewise.
2433 (finish_struct): Use lkp_iterator.
2434 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
2435 (note_name_declared_in_class): Use OVL_NAME.
2436 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
2437 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
2438 cxx_pretty_printer::expression): Likewise.
2439 * decl2.c (check_classfn): Use ovl_iterator.
2440 * pt.c (retrieve_specialization): Use ovl_iterator.
2441 * tree.c (cp_tree_equal): Use lkp_iterator.
2442 (type_has_nontrivial_copy_init): Use ovl_iterator.
2444 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
2445 check is_overloaded_fn.
2447 2017-05-16 Martin Liska <mliska@suse.cz>
2449 * parser.c (cp_lexer_print_token): Add default value for flags
2450 argument of print_gimple_stmt, print_gimple_expr,
2451 print_generic_stmt and print_generic_expr.
2453 2017-05-16 Nathan Sidwell <nathan@acm.org>
2455 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
2457 (MAYBE_BASELINK_FUNCTIONS): New.
2458 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
2459 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
2460 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
2461 * method.c (inherited_ctor_binfo): Use ovl_iterator.
2462 (binfo_inherited_from): Likewise.
2463 * parser.c (lookup_literal_operator): Use lkp_iterator.
2464 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
2465 (print_candidates_1): Likewise.
2466 (determine_specialization): Likewise.
2467 (resolve_overloaded_unification): Likewise.
2468 (resolve_nondeduced_context): Likewise.
2469 (type_dependent_expression_p): Likewise.
2470 (dependent_template_p): Likewise.
2471 * ptree.c (cxx_print_xnode): Likewise.
2472 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
2473 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
2474 * typeck.c (check_template_keyword): Use lkp_iterator.
2476 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
2478 * constexpr.c (function_concept_check): Use OVL_FIRST.
2479 * cvt.c (build_expr_type_conversion): Likewise.
2480 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
2481 * decl2.c (mark_used): Use OVL_FIRST.
2482 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
2483 (dump_expr, location_of): Use OVL_FIRST.
2484 * friend.c (do_friend): Use OVL_NAME.
2485 * init.c (build_offset_ref): Use OVL_FIRST.
2486 * mangle.c (write_member_name): Likewise.
2487 (write_expression): Use OVL_NAME.
2488 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
2489 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
2490 * pt.c (check_explicit_specialization): Use OVL_FIRST.
2491 (check_template_shadow): Likewise.
2492 (tsubst_template_args): Use OVL_NAME.
2493 (tsubst_baselink): Use OVL_FIRST.
2494 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
2495 * tree.c (get_first_fn): Use OVL_FIRST.
2496 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
2497 (cp_build_addr_expr_1): Use OVL_FIRST.
2499 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
2501 * semantics.c (finish_id_expression): Directly init local var.
2502 (finish_omp_reduction_clause): Use really_overloaded_fn.
2503 * tree.c (get_fns): Document. Assert we got an overload.
2504 (get_first_fn) Document.
2505 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
2506 really_overloaded_fn.
2507 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
2509 * cp-tree.h (SCOPE_DEPTH): New.
2510 * name-lookup.h (is_nested_namespace): Declare.
2511 * name-lookup.c (is_nested_namespace): New.
2512 (is_ancestor): Use it.
2513 (set_decl_namespace): Likewise.
2514 (push_namespace): Set SCOPE_DEPTH.
2515 * pt.c (check_specialization_namespace): Use is_nested_namespace.
2516 (check_unqualigied_spec_or_inst): Likewise.
2518 2017-05-15 Nathan Sidwell <nathan@acm.org>
2521 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
2522 * name-lookup.h (push_namespace): Return int, add make_inline arg.
2523 * name-lookup.c (push_namespace): Deal with inline directly.
2524 Return pushed count.
2525 * parser.c (cp_parser_namespace_definition): Adjust for
2526 push_namespace change.
2528 2017-05-11 Nathan Sidwell <nathan@acm.org>
2530 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
2531 LANG_HOOKS_PUSHDECL): Move to ...
2532 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
2533 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
2534 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
2536 * name-lookup.h (pushdecl): Add default friend parm.
2537 (pushdecl_maybe_friend): Delete.
2538 (pushdecl_top_level): Add default friend parm.
2539 (pushdecl_top_level_maybe_friend): Delete.
2540 * name-lookup.c (pushdecl_maybe_friend): Delete.
2541 (pushdecl): Add is_friend parm.
2542 (pushdecl_top_level): Add is friend_parm.
2543 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
2544 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
2545 * friend.c (do_friend): Adjust.
2546 * pt.c (tsubst_friend_class): Adjust.
2548 Revert pushdecl_top_level_and_finish name change.
2549 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
2550 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
2551 * decl.c (cp_make_fname_decl): Adjust.
2552 * decl2.c (get_guard, handle_tls_init): Adjust.
2553 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
2555 * name-lookup.c (pushdecl_outermost_localscope): Always
2556 conditionally stop timer.
2558 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
2559 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
2561 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
2562 pushtag_top_level_maybe_friend,
2563 pushdecl_top_level_and_finish): Move declarations to ...
2564 * name-lookup.h: ... here. Group pushdecl variants.
2565 (pushdecl_top_level_and_finish): Rename to ...
2566 (pushdecl_top_level_with_init): ... here.
2567 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
2568 * decl2.c (get_guard, handle_tls_init): Likewise.
2569 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
2570 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
2571 * method.c (implicitly_declare_fn): Likewise.
2572 * searchc (node_debug_info_needed): Likewise.
2573 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
2574 (pushdecl_top_level_with_init): ... here.
2575 (pop_everything): Use namespace_bindings_p.
2577 * name-lookup.h (pop_binding): Rename to pop_local_binding.
2578 (getdecls): Rename to get_local_decls.
2579 * name-lookup.c (pop_binding): Rename to ...
2580 (pop_local_binding): ... here.
2581 (pop_bindings_and_leave_scope): Adjust.
2582 (getdecls): Rename to ...
2583 (get_local_decls): ... here. Assert local scope.
2584 * decl.c (poplevel): Assert not namespace. Adjust and simplify
2586 (store_parm_decls): Adjust get_local_decls call.
2587 (parser.c (synthesize_implicit_template_parm): Likewise.
2589 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
2592 * method.c (is_trivially_xible): Reject void types.
2594 2017-05-10 Nathan Sidwell <nathan@acm.org>
2596 * class.c (handle_using_decl): Always use OVL_CURRENT.
2597 (resolve_address_of_overloaded_function): Move iterator decl into
2598 for scope. Don't strip anticipated decls here.
2600 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
2602 (print_candidates): Adjust.
2604 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
2606 * call.c (build_new_function_call): Lose koenig_p arg. Remove
2607 koenig_p handling here.
2608 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
2609 (tsubst_omp_clauses): Likewise.
2610 (do_class_deduction): Adjust buld_new_function_call calls.
2611 * semantics.c (finish_call_expr): Likewise.
2613 2017-05-10 Jason Merrill <jason@redhat.com>
2615 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
2616 (unify_type_mismatch, unify_parameter_pack_mismatch)
2617 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
2618 (unify_parameter_pack_inconsistent, unify_inconsistency)
2619 (unify_vla_arg, unify_method_type_error, unify_arity)
2620 (unify_arg_conversion, unify_no_common_base)
2621 (unify_inconsistent_template_template_parameters)
2622 (unify_template_deduction_failure)
2623 (unify_template_argument_mismatch)
2624 (unify_overload_resolution_failure): Call unify_invalid.
2626 CWG 1847 - Clarifying compatibility during partial ordering
2627 * pt.c (more_specialized_fn): No order between two non-deducible
2630 * pt.c (dependent_type_p): Make sure we aren't called with
2633 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2634 * pt.c (convert_template_argument): Just return an argument pack.
2635 (coerce_template_parameter_pack, template_parm_to_arg)
2636 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
2637 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
2638 Don't set the type of a NONTYPE_ARGUMENT_PACK.
2639 * parser.c (make_char_string_pack, make_string_pack): Likewise.
2641 2017-05-10 Nathan Sidwell <nathan@acm.org>
2643 * cp-tree.h (add_method, clone_function_decl): Change last arg to
2645 * class.c (add_method): Change third arg to bool. Adjust.
2646 (one_inheriting_sig, one_inherited_ctor): Adjust.
2647 (clone_function_decl): Change 2nd arg to bool. Adjust.
2648 (clone_constructors_and_destructors): Adjust.
2649 * lambda.c (maybe_add_lambda_conv_op): Adjust.
2650 * method.c (lazily_declare_fn): Adjust.
2651 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
2652 * semantics.c (finish_member_declaration): Adjust.
2654 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
2657 * decl.c (finish_function): To improve error recovery, change the
2658 logic for calling apply_deduced_return_type.
2660 2017-05-09 Jason Merrill <jason@redhat.com>
2662 PR c++/80605 - __is_standard_layout and empty base
2663 * class.c (check_bases): Ignore empty bases.
2665 PR c++/70979 - literal class and closure types
2666 * class.c (finalize_literal_type_property): Handle closures
2668 (explain_non_literal_class): Likewise.
2670 PR c++/66297, DR 1684 - literal class and constexpr member fns
2671 * constexpr.c (is_valid_constexpr_fn): Only complain about
2672 non-literal enclosing class in C++11.
2673 * class.c (finalize_literal_type_property): Likewise.
2675 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
2678 * pt.c (tsubst_decl): Early return error_mark_node if
2679 grok_ctor_properties returns false.
2681 2017-05-09 Jason Merrill <jason@redhat.com>
2683 PR c++/70167 - array prvalue treated as lvalue
2684 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
2686 * semantics.c (finish_compound_literal): Add fcl_context parameter.
2687 Only make a static variable for C99 syntax.
2688 * parser.c (cp_parser_postfix_expression): Pass it.
2689 * pt.c (tsubst_copy_and_build): Likewise.
2690 * call.c (extend_ref_init_temps): Set
2691 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2693 2017-05-09 Nathan Sidwell <nathan@acm.org>
2695 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
2696 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
2697 * name-lookup.h (pushdecl_top_level): Declare.
2699 2017-05-08 Jason Merrill <jason@redhat.com>
2701 PR c++/80178 - parameter passing for uncopyable classes
2702 * tree.c (type_has_nontrivial_copy_init): True for classes with only
2703 deleted copy/move ctors.
2704 (remember_deleted_copy, maybe_warn_parm_abi): New.
2705 * decl.c (require_complete_types_for_parms, check_function_type):
2706 Call maybe_warn_parm_abi.
2707 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
2709 2017-05-08 Nathan Sidwell <nathan@acm.org>
2711 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
2712 (start_preparsed_function): Do decl pushing before setting
2713 current_funciton_decl and announcing it.
2715 * name-lookup.h (pushdecl_with_scope): Replace with ...
2716 (pushdecl_outermost_localscope): ... this.
2717 * name-lookup.c (pushdecl_with_scope): Replace with ...
2718 (pushdecl_outermost_localscope): ... this.
2719 (pushdecl_namespace_level): Adjust.
2720 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
2721 * lambda.c (insert_capture_proxy): Likewise.
2723 * class.c (build_vtbl_initializer): Don't shadow outer variable
2726 Revert _binding -> _value change.
2727 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
2728 (get_namespace_binding, set_global_binding): ... these.
2729 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
2730 (get_namespace_binding, set_global_binding): ... these.
2731 (arg_assoc_namespace, pushdecl_maybe_friend_1,
2732 check_for_out_of_scope_variable, push_overloaded_decl_1,
2733 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
2734 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
2735 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
2736 * decl.c (poplevel): Adjust.
2737 * pt.c (make_constrained_auto): Likewise.
2739 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
2741 PR translation/80280
2742 * call.c (print_z_candidate): Fix quoting.
2744 2017-05-05 David Malcolm <dmalcolm@redhat.com>
2746 * error.c (pedwarn_cxx98): Replace report_diagnostic
2747 with diagnostic_report_diagnostic.
2749 2017-05-05 Nathan Sidwell <nathan@acm.org>
2751 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
2752 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
2753 (IDENTIFIER_NAMESPACE_VALUE): Delete.
2754 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
2756 (get_namespace_value, set_global_value): ... these.
2757 (get_global_value_if_present, is_typename_at_global_scope): Delete.
2758 * decl.c (poplevel): Use get_namespace_value.
2759 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
2760 * class.c (build_vtbl_initializer): Stash library decl in
2761 static var. Use IDENTIFIER_GLOBAL_VALUE.
2762 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
2763 do_allocate_exception, do_free_exception, build_throw): Likewise.
2764 * init.c (throw_bad_array_new_length): Likewise.
2765 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
2766 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
2767 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
2768 get_namespace_value.
2769 (set_namespace_binding_1): Rename to
2770 (set_namespace_binding): ... here.
2771 (set_global_value): New.
2772 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
2773 get_namespace_value.
2774 * pt.c (listify): Use get_namespace_value.
2776 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
2778 * lex.c (unqualified_name_lookup_error): Likewise.
2780 * class.c (alter_class): Use retrofit_lang_decl directly.
2781 * decl.c (push_local_name, dupliate_decls): Likewise.
2782 * semantics.c (omp_privatize_field): Likewise.
2784 Kill walk_namespaces.
2785 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
2786 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
2788 Kill per-namespace static_decls.
2789 * cp-tree.h (static_decls): Declare.
2790 (wrapup_globals_for_namespace,
2791 diagnose_inline_vars_for_namespace): Replace with ...
2792 (wrapup_namespace_globals): ... this.
2793 * decl.c (static_decls): Define.
2794 (wrapup_globals_for_namespace,
2795 diagnose_inline_vars_for_namespace): Replace with ...
2796 (wrapup_namespace_globals): ... this.
2797 (cxx_init_decl_processing): Initialize static_decls.
2798 * decl2.c (c_parse_final_cleanups): Adjust.
2799 * name-lookup.h (cp_binding_level): Remove static_decls member.
2800 * name-lookup.c (add_decl_to_level): Adjust.
2801 (begin_scope): Adjust.
2803 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
2806 * decl.c (reshape_init): Unconditionally return error_mark_node
2807 upon error about too many initializers.
2809 2017-05-04 Nathan Sidwell <nathan@acm.org>
2811 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
2813 2017-05-04 Martin Sebor <msebor@redhat.com>
2815 PR translation/80280
2816 * call.c (print_z_candidate): Add missing quoting to %D and other
2818 (build_op_call_1): Same.
2819 * constraint.cc (diagnose_check_constraint): Same.
2820 * mangle.c (mangle_decl): Same.
2821 * name-lookup.c (cp_binding_level_debug): Same.
2822 (set_decl_namespace): Same.
2823 * parser.c (cp_parser_tx_qualifier_opt): Same.
2824 * pt.c (print_candidates_1): Same.
2825 (check_template_variable): Same.
2826 (tsubst_default_argument): Same.
2827 (most_specialized_partial_spec): Same.
2828 * semantics.c (omp_reduction_lookup): Same.
2829 * tree.c (check_abi_tag_redeclaration): Same.
2830 * typeck.c (comptypes): Same.
2831 * typeck2.c (abstract_virtuals_error_sfinae): Same.
2833 2017-05-04 Nathan Sidwell <nathan@acm.org>
2836 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
2837 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
2838 CPTI_INIT_LIST_IDENTIFIER.
2839 (global_namespace, global_type_node, global_identifier,
2840 anon_identifier, init_list_identifier): New.
2841 * decl.c (global_type_node, global_scope_name): Delete.
2842 (initialize_predefined_identifiers): Add new identifiers.
2843 (cxx_init_decl_processing): Adjust.
2844 * name-lookup.h (global_namespace, global_type_node): Delete.
2845 * name-lookup.c (global_namespace, anonymous_namespace_name,
2846 get_anonymous_namespace_name): Delete.
2847 (namespace_scope_ht_size, begin_scope, pushtag_1,
2848 push_namespace): Adjust,
2849 * call.c (type_has_extended_temps): Use init_list_identifier.
2850 * pt.c (listify): Likewise.
2852 * name-lookup.c: Reorder functions to make merging from modules
2855 2017-05-03 Jason Merrill <jason@redhat.com>
2857 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
2859 2017-05-03 Nathan Sidwell <nathan@acm.org>
2861 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
2862 along with #defines, to before name-lookup include.
2864 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
2866 * pt.c (is_auto_or_concept): Remove.
2867 (type_uses_auto_or_concept): Remove, unused.
2868 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
2869 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
2870 * cp-tree.h (is_auto_or_concept): Remove.
2872 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
2875 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
2876 add pedigree operation and detach call here.
2877 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
2878 cilk_cp_gimplify_call_params_in_spawned_fn.
2879 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
2880 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
2882 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
2884 * parser.c (cp_parser_member_declaration): Add fix-it hints for
2885 stray comma and missing semicolon at end of member declaration.
2887 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
2889 * parser.c (cp_parser_cast_expression): Add target type of cast to
2891 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
2893 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
2895 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
2896 return type to bool.
2897 * cp-tree.h (grok_ctor_properties): Update.
2899 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
2901 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
2902 information to diagnostic of invalid colon in nested-name-specifier.
2904 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
2906 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
2907 diagnostic of invalid class/struct keyword after enum.
2909 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2911 * parser.c (cp_parser_member_declaration): Add fix-it hint
2912 for removing stray semicolons.
2914 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2916 * name-lookup.c (get_std_name_hint): New function.
2917 (maybe_suggest_missing_header): New function.
2918 (suggest_alternative_in_explicit_scope): Call
2919 maybe_suggest_missing_header.
2921 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2924 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
2925 candidate type of bm from tree to const char *.
2926 (consider_binding_level): Likewise.
2927 (lookup_name_fuzzy): Likewise, using this to merge the best
2928 result from the preprocessor into bm, rather than immediately
2929 returning, so that better matches from reserved words can "win".
2930 Guard the rejection of keywords that don't start decl-specifiers
2931 so it only happens for FUZZY_LOOKUP_TYPENAME.
2933 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
2935 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
2936 (start_enum): Likewise.
2937 (build_enumerator): Likewise. Use %qE instead of plain %E.
2938 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
2939 %<%D%> in diagnostics.
2940 (cp_parser_elaborated_type_specifier): Likewise.
2941 * pt.c (make_pack_expansion): Use %qT and %qE instead of
2942 %<%T%> and %<%E%> in diagnostics.
2943 (tsubst_pack_expansion): Likewise.
2945 2017-04-24 David Malcolm <dmalcolm@redhat.com>
2948 * parser.c (cp_parser_unary_expression): Generate a location
2949 range for alignof and sizeof expressions.
2951 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
2953 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
2955 (cp_parser_virt_specifier_seq_opt): Likewise.
2956 (set_and_check_decl_spec_loc): Likewise twice.
2958 2017-04-21 Jason Merrill <jason@redhat.com>
2960 PR c++/80179 - ICE with initialized flexible array member.
2961 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
2963 2017-04-21 Richard Biener <rguenther@suse.de>
2965 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
2966 (copy_type): Likewise.
2967 * lex.c (copy_decl): Pass down mem-stat info.
2968 (copy_type): Likewise.
2970 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
2973 * init.c (build_new_1): Suppress notes about over-aligned new when
2974 the warning is suppressed.
2976 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
2978 * parser.c (cp_parser_member_declaration): Add warning with fixit
2979 information for extra semicolon after in-class function definition.
2981 2017-04-20 Jakub Jelinek <jakub@redhat.com>
2984 * tree.c (build_cplus_array_type): Call build_array_type
2985 with the intended TYPE_TYPELESS_STORAGE flag value, instead
2986 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
2989 2017-04-18 Marek Polacek <polacek@redhat.com>
2991 PR c++/80244 - ICE with attribute in template alias.
2992 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
2994 PR c++/80241 - ICE with alignas pack expansion.
2995 * error.c (dump_expr): Handle TREE_LIST.
2996 * parser.c (cp_parser_std_attribute_list): Return error_mark if
2997 make_pack_expansion returns an error.
2999 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
3002 * class.c (fixup_may_alias): Fix all type variants.
3004 2017-04-17 Jason Merrill <jason@redhat.com>
3006 PR c++/80415 - wrong error with default arg and array reference.
3007 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
3009 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
3011 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
3013 * decl.c (name_unnamed_type): Split out of...
3014 (grokdeclarator): ... this.
3015 * decl.h (name_unnamed_type): Declare.
3017 2017-04-12 Richard Biener <rguenther@suse.de>
3018 Bernd Edlinger <bernd.edlinger@hotmail.de>
3021 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
3022 for arrays of character or std::byte type.
3024 2017-04-11 Jason Merrill <jason@redhat.com>
3026 PR c++/80294 - ICE with constexpr and inheritance.
3027 * constexpr.c (reduced_constant_expression_p):
3028 A null constructor element is non-constant.
3029 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
3030 returning an empty base.
3032 2017-04-11 Jakub Jelinek <jakub@redhat.com>
3035 * decl.c (cp_finish_decomp): If processing_template_decl on
3036 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
3037 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
3038 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
3040 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
3041 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
3044 2017-04-11 Jakub Jelinek <jakub@redhat.com>
3047 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
3049 2017-04-10 Jakub Jelinek <jakub@redhat.com>
3052 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
3053 operand, if it is a static member function, recurse on the
3056 2017-04-10 Marek Polacek <polacek@redhat.com>
3059 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
3060 ORIG_TYPE earlier and not only when shortening.
3062 2017-04-07 Jason Merrill <jason@redhat.com>
3064 PR c++/80356 - ICE with reference to function template argument.
3066 * pt.c (convert_nontype_argument_function): Adjust type even with a
3067 value-dependent argument.
3069 PR c++/80267 - ICE with nested capture of reference
3071 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
3073 2017-04-07 Marek Polacek <polacek@redhat.com>
3076 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
3079 * call.c (build_over_call): Don't check cxx_dialect.
3080 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
3081 whether SUB is a CONSTRUCTOR.
3082 * init.c (build_new_1): Don't check cxx_dialect.
3083 * tree.c (replace_placeholders): Add a function comment. Return if
3084 not in C++14, or if the object isn't a (member of a) class.
3085 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
3086 TYPE is CLASS_TYPE_P.
3088 2017-04-05 Jakub Jelinek <jakub@redhat.com>
3091 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
3092 of a loop doing vec_safe_push of NULL. Formatting fixes.
3093 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
3094 to newidx before calling canonical_type_parameter on newtype.
3096 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
3099 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
3100 UNARY_PLUS_EXPR case.
3102 2017-04-03 Jason Merrill <jason@redhat.com>
3104 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
3106 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
3108 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
3109 * decl2.c (one_static_initialization_or_destruction): Likewise.
3110 * name-lookup.c (store_bindings): Likewise.
3111 * parser.c (make_call_declarator): Likewise.
3112 * pt.c (check_explicit_specialization): Likewise.
3114 2017-04-03 Jason Merrill <jason@redhat.com>
3116 PR sanitizer/79993 - ICE with VLA initialization from string
3117 PR c++/69487 - wrong VLA initialization from string
3118 * init.c (finish_length_check): Split out from build_vec_init.
3119 (build_vec_init): Handle STRING_CST.
3120 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
3121 (digest_init_r): Don't give a STRING_CST VLA type.
3123 2017-03-31 Jakub Jelinek <jakub@redhat.com>
3126 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
3127 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
3128 for NOP_EXPR to REFERENCE_TYPE.
3131 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
3132 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3134 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
3135 Remove extraneous parens.
3136 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
3137 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
3138 (cp_parser_trait_expr): Likewise.
3140 2017-03-27 Jakub Jelinek <jakub@redhat.com>
3143 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
3144 * typeck.c (cxx_mark_addressable): Likewise. Look through
3145 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
3147 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
3149 2017-03-24 Jason Merrill <jason@redhat.com>
3151 PR c++/77339 - ICE with invalid use of alias template.
3152 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
3155 2017-03-24 Marek Polacek <polacek@redhat.com>
3158 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
3159 doesn't have side effects.
3161 2017-03-23 Jason Merrill <jason@redhat.com>
3163 PR c++/80150 - ICE with overloaded variadic deduction.
3164 * pt.c (try_one_overload): Remove asserts.
3166 PR c++/77563 - missing ambiguous conversion error.
3167 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
3169 2017-03-23 Marek Polacek <polacek@redhat.com>
3171 * cp-tree.h: Remove a C_RID_YYCODE reference.
3173 2017-03-22 Jakub Jelinek <jakub@redhat.com>
3176 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
3177 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
3178 processing_template_decl.
3180 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
3183 * name-lookup.c (pushtag_1): Add check for bogus, non template,
3184 std::initializer_list.
3186 2017-03-21 Jakub Jelinek <jakub@redhat.com>
3189 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
3191 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
3194 * init.c (std_placement_new_fn_p): New.
3195 (build_new_1): Call it.
3197 2017-03-20 Jason Merrill <jason@redhat.com>
3199 PR c++/80096 - ICE with C++17 non-type auto.
3200 * pt.c (tsubst): Delay tsubst of type of template non-type
3203 PR c++/79519 - ICE with deleted template friend.
3204 * decl.c (grokdeclarator): Complain about misplaced function
3205 definition using =, as well.
3207 PR c++/79640 - infinite recursion with generic lambda.
3208 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
3209 before substituting its initializer.
3211 2017-03-20 Marek Polacek <polacek@redhat.com>
3212 Paolo Carlini <paolo.carlini@oracle.com>
3214 PR c++/80059 - ICE with noexcept and __transaction_atomic
3215 * except.c (build_must_not_throw_expr): Call
3216 instantiate_non_dependent_expr.
3218 2017-03-19 Jason Merrill <jason@redhat.com>
3220 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
3221 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
3222 reference decomposition.
3224 PR c++/80077 - error with constexpr and -fno-elide-constructors.
3225 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
3226 expanding trivial constructor.
3228 2017-03-17 Jason Merrill <jason@redhat.com>
3230 PR c++/78345 - ICE initializing array from lambda.
3231 * init.c (build_aggr_init): Check array initializer.
3232 (build_vec_init): Check the type of a CONSTRUCTOR.
3234 PR c++/80073 - C++17 ICE with virtual base.
3235 * decl.c (xref_basetypes): Also check for indirect vbases.
3237 2017-03-16 Jason Merrill <jason@redhat.com>
3239 * decl.c (start_enum): std::byte aliases anything.
3242 * constexpr.c (lookup_placeholder): Tweak.
3244 2017-03-15 Jason Merrill <jason@redhat.com>
3246 PR c++/80043 - ICE with -fpermissive
3247 * typeck.c (convert_for_assignment): Handle instantiate_type
3248 not giving an error.
3250 2017-03-14 Nathan Sidwell <nathan@acm.org>
3252 PR c++/79393 DR 1658 workaround
3253 * method.c (synthesized_method_base_walk): Inihibit abstract class
3254 virtual base access check here.
3255 (synthesized_method_walk): Not here.
3257 2017-03-13 Nathan Sidwell <nathan@acm.org>
3259 PR c++/79393 DR 1658 workaround
3260 * method.c (synthesized_method_walk): Check vbases of abstract
3261 classes for dtor walk.
3263 2017-03-10 David Malcolm <dmalcolm@redhat.com>
3265 PR translation/79848
3266 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
3268 2017-03-10 Jason Merrill <jason@redhat.com>
3270 PR c++/79960 - alias templates and partial ordering
3271 * pt.c (comp_template_args): Add partial_order parm.
3272 (template_args_equal): Likewise.
3273 (comp_template_args_porder): New.
3274 (get_partial_spec_bindings): Use it.
3276 2017-03-10 Marek Polacek <polacek@redhat.com>
3279 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
3281 2017-03-10 Jakub Jelinek <jakub@redhat.com>
3284 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
3285 Use XALLOCAVEC macro.
3288 * decl.c (finish_enum_value_list): If value is error_mark_node,
3289 don't copy it and change its type.
3290 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
3291 of CONST_DECL is error_mark_node.
3293 2017-03-09 Marek Polacek <polacek@redhat.com>
3295 PR c++/79900 - ICE in strip_typedefs
3296 * tree.c (strip_typedefs): Skip the attribute handling if T is
3297 a variant type which hasn't been updated yet.
3299 PR c++/79687 - wrong code with pointer-to-member
3300 * init.c (constant_value_1): Break if the variable has a dynamic
3303 2017-03-08 Jason Merrill <jason@redhat.com>
3305 PR c++/79797 - ICE with self-reference in array DMI.
3306 * constexpr.c (lookup_placeholder): Split out...
3307 (cxx_eval_constant_expression): ...from here.
3309 2017-03-07 Jakub Jelinek <jakub@redhat.com>
3312 * parser.c (cp_parser_omp_cancellation_point,
3313 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
3314 cp_parser_omp_target_update): Change "may only be used in compound
3315 statements" diagnostics, such that the same translatable string is
3316 used for all pragmas.
3317 (cp_parser_pragma): Likewise. Use error_at instead of
3318 cp_parser_error for that diagnostics.
3320 2017-03-06 Marek Polacek <polacek@redhat.com>
3322 PR c++/79796 - ICE with NSDMI and this pointer
3323 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
3324 replace_placeholders.
3326 2017-03-06 Jakub Jelinek <jakub@redhat.com>
3329 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
3332 2017-03-06 Jason Merrill <jason@redhat.com>
3334 Revert "Allow deduction guides to look into primary template."
3335 * cp-tree.h, parser.c, pt.c, search.c: Revert.
3337 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
3340 * except.c (build_must_not_throw_expr): Perform the implicit
3341 conversions on the condition.
3343 2017-03-03 Jason Merrill <jason@redhat.com>
3345 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
3348 Core issues 2273 and 2277
3349 * call.c (joust): Adjust using-declaration tiebreaker to handle
3350 the intermediate base case.
3351 * method.c (strip_inheriting_ctors): Just return the argument if
3352 !flag_new_inheriting_ctors.
3354 2017-03-03 Richard Biener <rguenther@suse.de>
3357 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
3359 2017-03-03 Marek Polacek <polacek@redhat.com>
3362 * typeck.c (string_conv_p): In C++11, always call pedwarn with
3365 2017-03-02 Jason Merrill <jason@redhat.com>
3367 Update overload resolution with deduction guides.
3368 * pt.c (do_class_deduction): Always build the copy guide.
3369 (copy_guide_p, template_guide_p): New.
3370 (build_deduction_guide): Remember the original constructor.
3371 * call.c (joust): Prefer the copy guide and non-template guides.
3373 Allow deduction guides to look into primary template.
3374 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
3375 (struct cp_decl_specifier_seq): Add constructor_p.
3376 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
3377 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
3378 Clear deduction_guide_type. Don't handle deduction guide names.
3379 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
3380 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
3381 (cp_parser_member_declaration, cp_parser_cache_defarg)
3382 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
3383 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
3384 (build_deduction_guide): Set deduction_guide_type.
3385 (dependent_scope_p): Check deduction_guide_type.
3386 * search.c (lookup_member): Likewise.
3388 2017-03-02 Jakub Jelinek <jakub@redhat.com>
3391 * init.c (mark_exp_read_r): New function.
3392 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
3393 whole arguments instead of plain mark_exp_read on TREE_LIST values.
3395 2017-03-01 Jason Merrill <jason@redhat.com>
3397 Class template argument deduction in new-expression
3398 * init.c (build_new): Handle deduction from no initializer.
3399 * parser.c (cp_parser_new_expression): Don't require a single
3400 expression for class template deduction.
3401 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
3402 class template placeholder.
3403 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
3404 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
3405 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
3407 2017-03-01 Jakub Jelinek <jakub@redhat.com>
3410 * init.c (emit_mem_initializers): When not constructing vbases of
3411 abstract classes, mark arguments as read for
3412 -Wunused-but-set-parameter.
3414 2017-02-28 Jason Merrill <jason@redhat.com>
3416 Class template argument deduction refinements
3417 * call.c (joust): Move deduction guide tiebreaker down.
3418 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
3419 deduction with no initializer.
3420 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
3421 (do_class_deduction): Use that rather than special case.
3422 (do_auto_deduction): Handle null initializer.
3424 2017-02-28 Jakub Jelinek <jakub@redhat.com>
3426 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
3427 instead of just cond ? "..." : "...".
3428 (grokdeclarator): Likewise.
3429 (build_enumerator): Likewise.
3430 * init.c (build_new_1): Likewise.
3431 * call.c (build_new_method_call_1): Likewise.
3432 * parser.c: Include intl.h.
3433 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
3434 "enter"/"exit" keyword.
3435 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
3438 2017-02-27 Jason Merrill <jason@redhat.com>
3440 PR c++/71568 - SFINAE forming pointer to member function
3441 * init.c (build_offset_ref): Check the return value of
3442 perform_or_defer_access_check.
3444 2017-02-27 Marek Polacek <polacek@redhat.com>
3446 * decl.c (expand_static_init): Add missing } in a comment.
3448 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
3450 * init.c: Include intl.h.
3451 (build_new_1): Move message strings into pedwarn to make them
3452 -Wformat-security friendly. Mark string for translation.
3453 * pt.c (tsubst_copy_and_build): Mark string for translation.
3454 Make the pointer const.
3455 * semantics.c (finish_id_expression): Mark strings for translation.
3457 2017-02-25 Jakub Jelinek <jakub@redhat.com>
3459 * call.c (build_op_delete_call): Make msg1 and msg2 const.
3461 2017-02-24 Jakub Jelinek <jakub@redhat.com>
3464 * call.c (build_over_call): Call check_function_arguments even for
3465 -Wrestrict, adjust check_function_arguments caller.
3466 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
3468 * typeck.c (cp_build_function_call_vec): Adjust
3469 check_function_arguments caller.
3471 2017-02-24 Marek Polacek <polacek@redhat.com>
3473 PR translation/79705
3474 * decl.c (check_redeclaration_exception_specification): Mark a string
3475 for translation. Make the pointer const.
3477 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
3480 * pt.c (register_specialization): Check duplicate_decls return value
3481 for error_mark_node and pass it back.
3483 2017-02-22 Jason Merrill <jason@redhat.com>
3485 PR c++/79679 - missing destructor for argument
3486 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
3489 * pt.c (do_class_deduction): Handle 0 argument case.
3491 2017-02-22 Jakub Jelinek <jakub@redhat.com>
3494 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
3495 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
3496 * constexpr.c (potential_constant_expression_1): Handle
3497 OMP_*, OACC_* and CILK_* trees. Use error_at with
3498 EXPR_LOC_OR_LOC (t, input_location) computed early
3499 instead of error, or error_at with location_of (t).
3501 2017-02-22 Marek Polacek <polacek@redhat.com>
3504 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
3505 if the alignas expression is erroneous.
3506 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
3510 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
3512 2017-02-21 Jason Merrill <jason@redhat.com>
3514 PR c++/50308 - wrong deprecated warning with ADL
3515 PR c++/17729 - duplicate deprecated warning
3516 * semantics.c (finish_id_expression): Only call mark_used on a
3517 function if we aren't building a call.
3519 PR c++/41727 - ICE with partial spec of partial instantiation
3520 * pt.c (process_partial_specialization): For now, don't check more
3521 specialized if there is more than one level of args.
3523 2017-02-21 Marek Polacek <polacek@redhat.com>
3526 * cp-tree.h (maybe_reject_flexarray_init): Declare.
3527 * init.c (maybe_reject_flexarray_init): No longer static.
3528 Add check for current_function_decl.
3529 * parser.c (cp_parser_late_parse_one_default_arg): Reject
3530 a default mem-initializer for a flexible array.
3532 2017-02-21 Jakub Jelinek <jakub@redhat.com>
3533 Paolo Carlini <paolo.carlini@oracle.com>
3536 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
3538 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
3539 decl after the decomposition artificial decl has error_mark_node.
3540 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
3541 instead of just == error_mark_node comparison.
3543 2017-02-21 Jakub Jelinek <jakub@redhat.com>
3546 * decl.c: Include gimplify.h.
3547 (cp_finish_decomp): Make sure there is no sharing of trees
3548 in between DECL_VALUE_EXPR of decomposition decls.
3551 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
3554 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
3555 call cplus_expand_constant on it first.
3557 2017-02-19 Jason Merrill <jason@redhat.com>
3559 PR c++/78139 - destructor needed by new-expression
3560 * call.c (build_special_member_call): Use tf_no_cleanup.
3562 PR c++/78282 - auto template and pack expansion
3563 * pt.c (find_parameter_packs_r): Don't walk into the type of
3564 templates other than template template-parameters.
3566 PR c++/79606 - ICE with this->base_member in NSDMI
3567 * class.c (build_base_path): Check processing_template_decl.
3569 PR c++/79607 - ICE with T{} initializer
3570 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
3572 PR c++/79566 - elaborated-type-specifier in range for
3573 * parser.c (cp_parser_simple_declaration): Fix check for type
3576 PR c++/79400 - confusing suggestion of 'noexcept'
3577 * parser.c (cp_parser_exception_specification_opt): Remove
3578 suggestion for deprecated dynamic exception-specification.
3580 PR c++/79470 - partial ordering with reference parameters
3581 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
3583 PR c++/79500 - ICE with non-template deduction guide
3584 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
3585 DECL_TEMPLATE_RESULT.
3587 PR c++/79580 - ICE with compound literal
3588 * parser.c (cp_parser_class_head): If we're in the middle of an
3589 expression, use ts_within_enclosing_non_class.
3591 PR c++/79503 - inherited ctor taking base class
3592 * call.c (add_function_candidate): Also check that
3593 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
3595 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
3598 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
3601 2017-02-19 Eric Fiselier <eric@efcs.ca>
3602 Jonathan Wakely <jwakely@redhat.com>
3605 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
3606 control warning about literal suffix identifiers without a leading
3609 2017-02-17 Jason Merrill <jason@redhat.com>
3611 PR c++/79508 - lookup error with member template
3612 * parser.c (cp_parser_template_name): Clear
3613 parser->context->object_type if we aren't doing lookup.
3615 PR c++/78690 - ICE with using and global type with same name
3616 * pt.c (type_dependent_object_expression_p): True for
3619 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3620 * pt.c (convert_template_argument): Just return an auto arg pack.
3621 (tsubst_template_args): Don't tsubst an auto pack type.
3623 PR c++/79556 - C++17 ICE with non-type auto
3624 * pt.c (do_auto_deduction): Don't try to deduce from null type.
3626 PR c++/79533 - C++17 ICE with temporary cast to reference
3627 * call.c (build_over_call): Conversion to a reference prevents copy
3630 2017-02-16 Jakub Jelinek <jakub@redhat.com>
3631 Jason Merrill <jason@redhat.com>
3633 PR c++/79502 - lost nodiscard attribute
3634 * pt.c (apply_late_template_attributes): Do apply non-dependent
3635 attributes to types.
3637 2017-02-16 Jason Merrill <jason@redhat.com>
3639 PR c++/78572 - ICE with self-modifying array initializer
3640 * constexpr.c (cxx_eval_store_expression): The object we're
3641 initializing is outside the constant-expression.
3642 (cxx_eval_call_expression): Set ctx->call.
3644 PR c++/79050 - ICE with undeduced auto and LTO
3645 * decl.c (poplevel): Remove undeduced auto decls.
3647 2017-02-16 Jakub Jelinek <jakub@redhat.com>
3650 * parser.c (cp_parser_omp_target): For -fopenmp-simd
3651 ignore #pragma omp target even when not followed by identifier.
3653 2017-02-15 Jason Merrill <jason@redhat.com>
3654 Jakub Jelinek <jakub@redhat.com>
3656 PR c++/79464 - ICE in IPA with omitted constructor parms
3657 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
3658 (adjust_clone_args): Adjust.
3659 (add_method): Remember omitted parms.
3660 * call.c (add_function_candidate): Likewise.
3661 * mangle.c (write_method_parms): Likewise.
3662 * method.c (ctor_omit_inherited_parms): Return false if there are no
3665 2017-02-15 Martin Sebor <msebor@redhat.com>
3668 * init.c (maybe_reject_flexarray_init): New function.
3669 (perform_member_init): Call it.
3671 2017-02-15 Jakub Jelinek <jakub@redhat.com>
3674 * parser.c (cp_parser_std_attribute): Don't pedwarn about
3675 [[deprecated]] with -std=c++11 and [[fallthrough]] with
3676 -std=c++11 and -std=c++14.
3679 * decl.c (grokdeclarator): For static data members, handle thread_p
3680 only after handling inline.
3682 2017-02-14 Marek Polacek <polacek@redhat.com>
3686 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
3687 clobbering if the postfix expression isn't an EXPR_P.
3689 2017-02-13 Jason Merrill <jason@redhat.com>
3691 PR c++/79461 - ICE with lambda in constexpr constructor
3692 * constexpr.c (build_data_member_initialization): Ignore
3693 initialization of a local variable.
3695 2017-02-13 Jakub Jelinek <jakub@redhat.com>
3697 * init.c (warn_placement_new_too_small): Add missing space in
3699 * parser.c (cp_parser_oacc_declare): Likewise.
3700 * mangle.c (maybe_check_abi_tags): Likewise.
3703 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
3704 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
3705 in the rightmost operand.
3707 2017-02-13 Nathan Sidwell <nathan@acm.org>
3709 PR c++/79296 - ICE mangling localized template instantiation
3710 * decl2.c (determine_visibility): Use template fn context for
3711 local class instantiations.
3713 2017-02-11 Jason Merrill <jason@redhat.com>
3715 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
3716 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
3717 (build_new_1): Use replace_placeholders.
3718 * tree.c (replace_placeholders_t): Also track whether we've seen a
3720 (replace_placeholders, replace_placeholders_r): Adjust.
3721 * cp-tree.h: Adjust.
3723 PR c++/77790 - ICE with auto function in C++11 mode
3724 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
3725 (require_deduced_type): Add complain parm, return bool.
3726 * cp-tree.h: Adjust.
3727 * decl2.c (mark_used): Use require_deduced_type.
3729 2017-02-10 Jason Merrill <jason@redhat.com>
3731 PR c++/78908 - template ops and bitfields
3732 * tree.c (build_min_non_dep): Use unlowered_expr_type.
3734 PR c++/78897 - constexpr union
3735 * constexpr.c (cxx_eval_store_expression): A store to a union member
3736 erases a previous store to another member.
3738 PR c++/71285 - member of fold-expression
3739 * semantics.c (finish_unary_fold_expr)
3740 (finish_binary_fold_expr): Use null type for fold-expressions.
3742 PR c++/79401 - protected inherited constructor
3743 * call.c (enforce_access): For inheriting constructor, find a base
3744 binfo in the path we already have.
3746 2017-02-10 Marek Polacek <polacek@redhat.com>
3749 * pt.c (type_dependent_expression_p): Check if the expression type
3753 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
3754 if warnings shouldn't be given.
3756 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
3759 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
3760 an error_mark_node as type.
3762 2017-02-09 Jakub Jelinek <jakub@redhat.com>
3763 Jason Merrill <jason@redhat.com>
3766 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
3767 from pattern to type.
3769 2017-02-09 Jason Merrill <jason@redhat.com>
3771 PR c++/79316 - default argument in deduction guide
3772 PR c++/79350 - explicit deduction guide
3773 * parser.c (cp_parser_constructor_declarator_p)
3774 (cp_parser_direct_declarator): Parse deduction guides more like
3776 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
3777 * tree.c (special_function_p): Return it.
3778 * decl.c (check_special_function_return_type): Handle it.
3779 (grokdeclarator, grokfndecl): Adjust.
3780 (cp_finish_decl): Pass flags to do_auto_deduction.
3781 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
3782 * pt.c (dguide_name_p): Take a const_tree.
3783 (do_class_deduction): Handle explicit.
3784 (do_auto_deduction): Pass flags through.
3785 (build_deduction_guide): Copy explicit flag.
3787 2017-02-09 Jakub Jelinek <jakub@redhat.com>
3790 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
3791 non-pragma_compound context here.
3792 (cp_parser_omp_target): Likewise.
3793 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
3794 parsing for ordered and target omp pragmas in non-pragma_stmt
3795 non-pragma_compound contexts.
3798 * parser.c (cp_parser_oacc_declare): Formatting fix.
3799 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
3800 automatic variables.
3802 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
3803 Chung-Lin Tang <cltang@codesourcery.com>
3805 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
3806 parsing. Parse constant expression. Remove semantic checking.
3807 (cp_parser_omp_clause_collapse): Disallow tile.
3808 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
3809 error about missing for after already emitting one. Use more
3810 conventional for idiom for unbounded loop.
3811 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
3812 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
3813 (finish_omp_for): Deal with tile clause.
3815 2017-02-07 Nathan Sidwell <nathan@acm.org>
3817 * method.c (synthesized_method_base_walk): New. Broken out of ...
3818 (synthesized_method_walk): ... here. Call it. Cleanup
3821 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
3824 * typeck2.c (process_init_constructor_union): Consider only
3825 FIELD_DECLs when looking for an NSDMI.
3827 2017-02-06 Jason Merrill <jason@redhat.com>
3829 PR c++/71193 - incomplete types in templates
3830 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
3831 handle incomplete type by pedwarning and then treating as dependent.
3833 2017-02-06 Jakub Jelinek <jakub@redhat.com>
3836 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
3837 (potential_constant_expression_1): Likewise.
3840 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
3841 allow one fewer than expected arguments if flag_permissive.
3844 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
3845 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
3846 with error_mark_node type.
3848 2017-02-03 Jason Merrill <jason@redhat.com>
3850 PR c++/78689 - ICE on constructor with label
3851 * optimize.c (maybe_clone_body): Replace omitted parameters with
3853 * class.c (build_clone): Fix logic for omitting inherited parms.
3855 PR c++/12245 - excessive memory use
3856 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
3857 back in. Don't cache constants.
3858 (maybe_constant_init): Don't cache constants.
3860 PR c++/79294 - ICE with invalid template argument
3861 * pt.c (convert_nontype_argument_function): Check value-dependence.
3862 (convert_nontype_argument): Don't check it here for function ptrs.
3864 2017-02-02 Richard Biener <rguenther@suse.de>
3867 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
3868 it lazily on the first changed element only and copy it
3869 fully upfront, only storing changed elements.
3871 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
3874 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
3877 2017-01-31 Jakub Jelinek <jakub@redhat.com>
3880 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
3883 2017-01-31 David Malcolm <dmalcolm@redhat.com>
3886 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
3887 any namespace aliases.
3889 2017-01-31 Nathan Sidwell <nathan@acm.org>
3892 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
3896 * pt.c: (instantiate_decl): Push to top level when current
3897 function scope doesn't match. Only push lmabda scope stack when
3900 * cp-tree.h (instantiate_decl): Make defer_ok bool.
3901 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
3902 (instantiate_decl): Simplify and reorder state saving and restoration.
3905 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
3906 * semantics.c (finish_member_declaration): Assert class is being
3909 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
3911 Introduce C++ support in libcc1.
3912 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
3913 (ansi_opname): Rename to...
3914 (cp_operator_id): ... this. Adjust all callers.
3915 (ansi_assopname): Rename to...
3916 (cp_assignment_operator_id): ... this. Adjust all callers.
3917 (cp_literal_operator_id): Declare.
3918 (set_global_friend): Declare.
3919 (is_global_friend): Declare.
3920 (enum cp_oracle_request): New type.
3921 (cp_binding_oracle_function): New type.
3922 (cp_binding_oracle): Declare.
3923 (cp_finish_injected_record_type): Declare.
3924 * friend.c (global_friend): New var.
3925 (set_global_friend): New fn.
3926 (is_global_friend): New fn.
3927 (is_friend): Call is_global_friend.
3928 * name-lookup.c (cp_binding_oracle): New var.
3929 (query_oracle): New fn.
3930 (qualified_lookup_using_namespace): Call query_oracle.
3931 (lookup_name_real_1): Likewise.
3932 * parser.c (cp_literal_operator_id): Drop static.
3933 * search.c (friend_accessible_p): Call is_global_friend.
3934 * semantics.c (is_this_parameter): Accept a variable if the
3935 binding oracle is enabled.
3937 2017-01-27 Jason Merrill <jason@redhat.com>
3939 PR c++/78771 - ICE with inherited constructor.
3940 * call.c (build_over_call): Call deduce_inheriting_ctor here.
3941 * pt.c (tsubst_decl): Not here.
3942 * class.c (add_method): Or here.
3943 * method.c (deduce_inheriting_ctor): Handle clones.
3944 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
3946 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
3949 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
3951 * cp/cp-tree.h: Declare it.
3952 * cp/semantics.c (finish_id_expression): Resolve names within a default
3953 capturing generic lambda defined within a template prior to
3954 instantiation to allow for captures to be added to the closure type.
3956 2017-01-26 Jakub Jelinek <jakub@redhat.com>
3959 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
3960 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
3961 * parser.c (cp_parser_builtin_offsetof): Pass result of
3962 build_static_cast of null_pointer_node to finish_offsetof.
3963 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
3964 it for -Winvalid-offsetof pedwarn instead of trying to guess
3965 original offsetof type from EXPR. Save OBJECT_PTR as a new
3966 second operand to OFFSETOF_EXPR.
3967 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
3968 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
3971 2017-01-26 Jason Merrill <jason@redhat.com>
3973 * name-lookup.c (parse_using_directive): Deprecate strong using.
3975 PR c++/79176 - lambda ICE with -flto -Os
3976 * decl2.c (vague_linkage_p): Handle decloned 'tors.
3977 * tree.c (decl_linkage): Likewise.
3979 2017-01-25 Martin Sebor <msebor@redhat.com>
3981 * decl.c (grokdeclarator): Fix a typo in a comment.
3983 2017-01-25 Jakub Jelinek <jakub@redhat.com>
3986 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
3990 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
3991 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
3993 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
3996 * decl.c (cxx_init_decl_processing): Pass main_input_filename
3997 to build_translation_unit_decl.
3999 2017-01-24 Jakub Jelinek <jakub@redhat.com>
4002 * cp-gimplify.c (cp_genericize_r): Add result of
4003 convert_from_reference on invisiref parm to p_set.
4005 2017-01-24 Nathan Sidwell <nathan@acm.org>
4007 PR c++/78469 - defaulted ctor and inaccessible dtor
4008 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
4009 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
4010 * tree.c (build_target_expr): Check tf_no_cleanup.
4012 PR c++/79118 - anon-members and constexpr
4013 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
4014 ctor decl. Recursively check anonymous members.
4015 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
4017 (explain_invalid_constexpr_fn): Likewise.
4019 2017-01-23 Nathan Sidwell <nathan@acm.org>
4021 PR c++/71710 - template using directive of field
4022 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
4025 PR c++/71406 - ICE with scope-ref'd template id exprs
4027 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
4028 before breaking up TEMPLATE_ID_EXPR.
4030 2017-01-20 Nathan Sidwell <nathan@acm.org>
4032 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
4033 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
4035 2017-01-20 David Malcolm <dmalcolm@redhat.com>
4039 * cp-tree.h (suggest_alternatives_for): Add bool param.
4040 (suggest_alternative_in_explicit_scope): New decl.
4041 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
4042 that isn't the global one, call new function
4043 suggest_alternative_in_explicit_scope, only calling
4044 suggest_alternatives_for if it fails, and disabling near match
4045 searches fort that case. When SCOPE is the global namespace,
4046 pass true for new param to suggest_alternatives_for to allow for
4048 * lex.c (unqualified_name_lookup_error): Pass true for new param
4049 to suggest_alternatives_for.
4050 * name-lookup.c (consider_binding_level): Add forward decl.
4051 (suggest_alternatives_for): Add "suggest_misspellings" param,
4052 using it to conditionalize the fuzzy name-lookup code.
4053 (suggest_alternative_in_explicit_scope): New function.
4054 * parser.c (cp_parser_primary_expression): When calling
4055 finish_id_expression, pass location of id_expression rather
4056 than that of id_expr_token.
4057 (cp_parser_id_expression): Convert local "unqualified_id" from
4058 tree to cp_expr to avoid implicitly dropping location information.
4060 2017-01-20 Marek Polacek <polacek@redhat.com>
4063 * call.c (build_conditional_expr_1): Warn about duplicated branches.
4064 * semantics.c (finish_expr_stmt): Build statement using the proper
4067 2017-01-19 Jason Merrill <jason@redhat.com>
4069 US 20 - forwarding references and class template argument deduction
4070 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
4071 * pt.c (push_template_decl_real): Set it.
4072 (maybe_adjust_types_for_deduction): Check it.
4073 (rewrite_template_parm): Copy it.
4075 US 19 - deduction guides and constructors
4076 * call.c (joust): Prefer deduction guides to constructors.
4077 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
4078 (deduction_guide_p): Check DECL_P.
4080 * decl.c (check_initializer): Always use build_aggr_init for array
4083 PR c++/79130 - decomposition and direct-initialization
4084 * init.c (build_aggr_init): Communicate direct-initialization to
4086 (build_vec_init): Check for array copy sooner.
4087 * parser.c (cp_parser_decomposition_declaration): Remove call to
4088 build_x_compound_expr_from_list.
4090 2017-01-18 Jason Merrill <jason@redhat.com>
4092 PR c++/68666 - member variable template-id
4093 * typeck.c (finish_class_member_access_expr): Handle variable
4095 * pt.c (lookup_and_finish_template_variable): No longer static.
4096 * cp-tree.h: Declare it.
4098 2017-01-18 Nathan Sidwell <nathan@acm.org>
4101 * call.c (build_over_call): When checking ellipsis conversions for
4102 an inherited ctor, make sure there is at least one conversion.
4104 2017-01-18 Jason Merrill <jason@redhat.com>
4106 PR c++/78894 - ICE with class deduction and default arg
4107 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
4109 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4112 * mangle.c (write_discriminator): Reorganize abi warning check.
4114 2017-01-18 Nathan Sidwell <nathan@acm.org>
4116 * cp-tree.h: Clarify exception spec node comment.
4117 * except.c (nothrow_spec_p): Simplify by checking node-equality.
4120 * mangle.c (write_exception_spec): Check nothrow explicitly.
4121 (write_encoding): Don't increment processing_template_decl around
4124 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4127 * mangle.c (write_template_args): Add "on" for operator names.
4129 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4132 * mangle.c (write_discriminator): Handle discriminator >= 10.
4134 2017-01-17 Nathan Sidwell <nathan@acm.org>
4137 * cp-tree.h (maybe_generic_this_capture): Declare.
4138 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
4139 (maybe_resolve_dummy): ... here. Call it.
4140 (maybe_generic_this_capture): New.
4141 * parser.c (cp_parser_postfix_expression): Speculatively capture
4142 this in generic lambda in unresolved member function call.
4143 * pt.c (tsubst_copy_and_build): Force hard error from failed
4144 member function lookup in generic lambda.
4146 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
4149 * cp-array-notation.c (expand_array_notation_exprs): Handle
4152 2017-01-11 Jason Merrill <jason@redhat.com>
4154 PR c++/78337 - ICE on invalid with generic lambda
4155 * semantics.c (process_outer_var_ref): Check if containing_function
4156 is null. Move inform call under complain test.
4158 2017-01-11 Nathan Sidwell <nathan@acm.org>
4161 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
4164 2017-01-11 Nathan Sidwell <nathan@acm.org>
4166 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
4168 2017-01-11 Jakub Jelinek <jakub@redhat.com>
4171 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
4172 assertion. Formatting fix.
4175 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
4178 2017-01-10 David Malcolm <dmalcolm@redhat.com>
4181 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
4182 a missing semicolon if we have a valid insertion location for
4185 2017-01-10 Jason Merrill <jason@redhat.com>
4187 FI 20, decomposition declaration with parenthesized initializer.
4188 * parser.c (cp_parser_decomposition_declaration): Use
4189 cp_parser_initializer.
4191 2017-01-09 Jason Merrill <jason@redhat.com>
4193 Implement P0195R2, C++17 variadic using.
4194 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
4195 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
4196 * error.c (dump_decl): Likewise.
4198 2017-01-09 Jakub Jelinek <jakub@redhat.com>
4200 PR translation/79019
4201 PR translation/79020
4202 * semantics.c (finish_omp_clauses): Add missing whitespace to
4203 translatable strings.
4204 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
4206 2017-01-07 Jason Merrill <jason@redhat.com>
4208 PR c++/78948 - instantiation from discarded statement
4209 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
4210 * cp-tree.h (in_discarded_stmt): Declare it.
4211 (struct saved_scope): Add discarded_stmt bitfield.
4212 (in_discarded_stmt): New macro.
4213 * decl2.c (mark_used): Check it.
4214 * parser.c (cp_parser_selection_statement): Adjust.
4215 (cp_parser_jump_statement): Adjust.
4217 2017-01-05 Jakub Jelinek <jakub@redhat.com>
4220 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
4221 REFERENCE_REF_P, set tt to its operand.
4224 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
4225 unions even for C++11 and later.
4227 2017-01-05 Nathan Sidwell <nathan@acm.org>
4230 * pt.c (convert_nontype_argument): Don't try and see if integral
4231 or enum expressions are constants prematurely.
4233 2017-01-04 Marek Polacek <polacek@redhat.com>
4236 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
4237 a zero character literal.
4239 2017-01-04 Jakub Jelinek <jakub@redhat.com>
4242 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
4246 * parser.c (cp_parser_simple_declaration): Only complain about
4247 inconsistent auto deduction if auto_result doesn't use auto.
4249 * parser.c (cp_parser_simple_declaration): Diagnose function
4250 declaration among more than one init-declarators with auto
4254 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
4255 assertion, as lexer->buffer may be NULL.
4257 2017-01-04 Marek Polacek <polacek@redhat.com>
4261 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
4263 2017-01-04 Nathan Sidwell <nathan@acm.org>
4266 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
4267 (lambda_capture_field_type): Update prototype.
4268 * lambda.c (lambda_capture_field_type): Add is_reference parm.
4269 Add referenceness here.
4270 (add_capture): Adjust lambda_capture_field_type call, refactor
4272 * pt.c (tsubst): Adjust lambda_capture_field_type call.
4274 2017-01-01 Jakub Jelinek <jakub@redhat.com>
4276 Update copyright years.
4278 Copyright (C) 2017 Free Software Foundation, Inc.
4280 Copying and distribution of this file, with or without modification,
4281 are permitted in any medium without royalty provided the copyright
4282 notice and this notice are preserved.