1 2017-09-09 Jason Merrill <jason@redhat.com>
3 * constexpr.c (reduced_constant_expression_p): If
4 CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
6 2017-09-09 Eric Botcazou <ebotcazou@adacore.com>
9 * cp-objcp-common.c (struct debug_type_hasher): New class.
10 (debug_type_hash): New variable.
11 (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
13 2017-09-08 Jason Merrill <jason@redhat.com>
15 PR c++/70029 - ICE with ref-qualifier and -flto
16 * tree.c (cxx_copy_lang_qualifiers): New.
17 * cp-tree.h: Declare it.
18 * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
20 2017-09-06 Jason Merrill <jason@redhat.com>
22 PR c++/82053 - ICE with default argument in lambda in template
23 * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
25 (retrieve_specialization): Use lambda_fn_in_template_p.
26 * cp-tree.h: Declare it.
28 PR c++/82070 - error with nested lambda capture
29 * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
30 register_local_specialization.
32 2017-09-06 Nathan Sidwell <nathan@acm.org>
34 * name-lookup.h (lookup_field_1): Delete.
35 (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
36 * name-lookup.c (lookup_field_1): make static
37 (method_vec_binary_search, method_vec_linear_search): New. Broken
39 (get_class_binding_direct): ... here. Add TYPE_OR_FNS argument.
40 Do complete search of this level.
41 (get_class_binding): Adjust.
42 * decl.c (reshape_init_class): Call get_class_binding.
43 * search.c (lookup_field_r): Move field searching into
44 get_class_binding_direct.
46 * class.c (warn_hidden): Don't barf on non-functions.
47 * decl2.c (check_classfn): Likewise. Check template match earlier.
49 * name-lookup.c (count_fields): Rename to ...
50 (count_class_fields): ... here. Take a class, don't count
52 (add_fields_to_record_type): Rename to ...
53 (field_vec_append_class_fields): ... here. Take a class, don't
54 add NULL-named fields.
55 (add_enum_fields_to_record_type): Rename to ...
56 (field_vec_append_enum_values): ... here.
57 (set_class_bindings): Adjust, assert we added expected number.
58 (insert_late_enum_def_bindings): Reimplement. Create vector if
59 there are now sufficient entries.
61 * name-lookup.h (lookup_fnfields_slot_nolazy,
62 lookup_fnfields_slot): Rename to ...
63 (get_class_binding_direct, get_class_binding): ... here.
64 * name-lookup.c (lookup_fnfields_slot_nolazy,
65 lookup_fnfields_slot): Rename to ...
66 (get_class_binding_direct, get_class_binding): ... here.
67 * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
68 * call.c (build_user_type_conversion_1): Adjust.
69 (has_trivial_copy_assign_p): Adjust.
70 (has_trivial_copy_p): Adjust.
71 * class.c (get_basefndecls) Adjust.
72 (vbase_has_user_provided_move_assign) Adjust.
73 (classtype_has_move_assign_or_move_ctor_p): Adjust.
74 (type_build_ctor_call, type_build_dtor_call): Adjust.
75 * decl.c (register_dtor_fn): Adjust.
76 * decl2.c (check_classfn): Adjust.
77 * pt.c (retrieve_specialization): Adjust.
78 (check_explicit_specialization): Adjust.
79 (do_class_deduction): Adjust.
80 * search.c (lookup_field_r): Adjust.
81 (look_for_overrides_here, lookup_conversions_r): Adjust.
82 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
83 * tree.c (type_has_nontrivial_copy_init): Adjust.
84 * method.c (lazily_declare_fn): Adjust comment.
86 2017-09-05 Nathan Sidwell <nathan@acm.org>
88 * name-lookup.c (do_class_using_decl): Elide read-once temps.
89 Move declarations to initializations.
91 * class.c (add_method): Move slot search and insertion to ...
92 * name-lookup.c (get_method_slot): ... this new function.
93 (lookup_fnfields_slot_nolazy): Cope with NULL slot.
94 * name-lookup.h (get_method_slot): Declare.
95 * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
97 (grok_special_member_properties): Set
98 TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
99 Improve TYPE_HAS_CONSTEXPR_CTOR setting.
101 * cp-tree.h (lang_decl_base): Rename template_conv_p to
103 (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
104 (DECL_CONV_FN_TYPE): FN must be conv op.
105 (DECL_TEMPLATE_CONV_FN_P): Delete.
106 (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
107 * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
110 * class.c (unreverse_member_declarations): Remove extraneous if.
111 * pt.c (push_template_decl_real): Use string concatenation, not
112 \<newline>. Add %<..%>.
114 2017-09-05 Paolo Carlini <paolo.carlini@oracle.com>
117 * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
118 * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
119 creating cdtor_label.
120 * constexpr.c (returns): Add the case of a constructor/destructor
121 returning via a LABEL_DECL_CDTOR label.
122 (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
124 2017-09-01 Nathan Sidwell <nathan@acm.org>
126 * cp-tree.h (resort_type_method_vec): Move declaration to ...
127 * name-lookup.h (resort_type_method_vec): ... here.
128 (set_class_bindings): Lose 2nd arg.
129 * class.c (finish_struct_1, finish_struct): Adjust
130 set_class_bindings call. Don't call finish_struct_methods.
131 (resort_data, method_name_cmp, resort_method_name_cmp,
132 resort_type_method_vec, finish_struct_methods): Move to ...
133 * name-lookup.c (resort_data, method_name_cmp,
134 resort_method_name_cmp, resort_type_method_vec): ... here.
135 (set_class_bindings): Lose fields arg. Swallow finish_struct_methods.
137 * class.c (finish_struct): Call set_class_bindings for the
140 * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
141 Don't call maybe_warn_about_overly_private_class here.
142 (warn_hidden): Cleanup declarations and comments.
143 (type_has_user_provided_constructor): No need to check
144 CLASSTYPE_METHOD_VEC.
145 (type_has_user_provided_or_explicit_constructor): Likewise.
146 (classtype_has_move_assign_or_move_ctor_p): Likewise.
147 (check_bases_and_members): Don't call finish_struct_methods here.
148 (finish_struct_1): Call finish_struct_methods and
149 set_class_bindings immediately after layout. Clear DECL_IN_AGGR_P
151 (finish_struct): For templates process USING_DECLS and clear
152 DECL_IN_AGGR_P before calling finish_struct_methods. Call
153 maybe_warn_about_overly_private_class here.
155 Revert 2017-08-28 Nathan Sidwell <nathan@acm.org>
156 Restore sorted_fields vector.
157 * cp-tree.h (lang_type): Restore sorted_fields vector.
158 (CLASSTYPE_SORTED_FIELDS): Restore.
159 (CLASSTYPE_BINDINGS): Delete.
160 * name-lookup.c (lookup_field_1): Restore binary search.
161 (sorted_fields_type_new, count_fields,
162 add_fields_to_record_type, add_enum_fields_to_record_type): Restore
163 (set_class_bindings): Revert.
164 (insert_late_enum_def_binding): Restore field_vec insertion.
166 2017-09-01 Jakub Jelinek <jakub@redhat.com>
169 * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
171 2017-09-01 Marek Polacek <polacek@redhat.com>
174 * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
176 2017-08-30 Jason Merrill <jason@redhat.com>
178 PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
179 * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
180 (regenerated_lambda_fn_p): New.
181 (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
182 (tsubst_copy) [VAR_DECL]: Likewise.
184 PR c++/82030 - ICE inheriting from multiple lambdas
186 * call.c (compare_ics): Handle null candidate.
188 2017-08-30 Ville Voutilainen <ville.voutilainen@gmail.com>
190 Make taking the address of an overloaded function a non-deduced context
192 * pt.c (unify_overload_resolution_failure): Remove.
193 (unify_one_argument): Adjust.
195 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
196 Alan Hayward <alan.hayward@arm.com>
197 David Sherwood <david.sherwood@arm.com>
199 * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
201 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
202 Alan Hayward <alan.hayward@arm.com>
203 David Sherwood <david.sherwood@arm.com>
205 * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
207 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
208 Alan Hayward <alan.hayward@arm.com>
209 David Sherwood <david.sherwood@arm.com>
211 * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
212 instead of TYPE_MODE.
214 2017-08-29 Jason Merrill <jason@redhat.com>
216 PR c++/81236 - ICE with template-id in generic lambda
217 * semantics.c (finish_id_expression): Remove special dependent case.
218 Avoid some later pieces when dependent.
219 (finish_qualified_id_expr): Do normal BASELINK handling in a
220 template. Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
221 (parsing_default_capturing_generic_lambda_in_template): Remove.
222 * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
223 error for types that will never be complete.
224 * mangle.c (write_expression): Add sanity check.
225 * tree.c (build_qualified_name): Add sanity check.
226 (cp_walk_subtrees): Walk into the class context of a BASELINK.
227 * lambda.c (add_capture): Improve diagnostic for generic lambda
229 * call.c (build_new_method_call_1): Print the right constructor
232 Reimplement handling of lambdas in templates.
233 * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
234 * decl.c (start_preparsed_function): Call start_lambda_scope.
235 (finish_function): Call finish_lambda_scope.
236 * init.c (get_nsdmi): Call start/finish_lambda_scope.
237 * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
238 * parser.c (cp_parser_function_definition_after_declarator): Don't
239 call start/finish_lambda_scope.
240 * pt.c (retrieve_specialization): Ignore lambda functions in
242 (find_parameter_packs_r): Ignore capture proxies. Look into
244 (check_for_bare_parameter_packs): Allow bare packs in lambdas.
245 (tsubst_default_argument): Call start/finish_lambda_scope.
246 (tsubst_function_decl): Handle lambda functions differently.
247 (tsubst_template_decl): Likewise.
248 (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
250 (tsubst_lambda_expr): Create a new closure rather than instantiate
251 the one from the template.
252 (tsubst_copy_and_build): Don't register a specialization of a pack.
253 (regenerate_decl_from_template): Call start/finish_lambda_scope.
254 (instantiate_decl): Remove special lambda function handling.
255 * semantics.c (process_outer_var_ref): Remove special generic lambda
256 handling. Don't implicitly capture in a lambda in a template. Look
257 for an existing proxy.
258 * class.c (current_nonlambda_class_type): Use decl_type_context.
260 * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
261 (LAMBDA_EXPR_RETURN_TYPE): Remove.
262 (struct tree_lambda_expr): Remove closure and return_type fields.
263 * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
264 * pt.c (tsubst_copy_and_build): Likewise.
265 * parser.c (cp_parser_lambda_declarator_opt): Track return type.
266 (cp_parser_lambda_body): Adjust unspecified return type check.
267 * ptree.c (cxx_print_lambda_node): Don't print closure or
270 PR c++/80935 - wrong C++17 error with lambda
271 * decl.c (check_for_uninitialized_const_var): Check
272 is_instantiation_of_constexpr.
273 * constexpr.c (ensure_literal_type_for_constexpr_object): Check
274 is_instantiation_of_constexpr.
275 (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
277 * lambda.c (build_lambda_object): Check for error_mark_node.
278 * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
280 (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
281 (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
283 PR c++/80767 - unnecessary instantiation of generic lambda
284 * call.c (convert_like_real): Call build_user_type_conversion_1 if
286 (add_conv_candidate): Build a ck_user conversion with no candidate.
288 Fix lambdas in template default argument of inherited ctor.
289 * method.c (synthesized_method_base_walk): Replace an inherited
290 template with its specialization.
291 (synthesized_method_walk): Make inheriting_ctor a pointer.
292 (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
293 (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
295 * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
296 template, not the function.
297 (template_guide_p): Adjust.
299 Support copying local_specializations.
300 * cp-tree.h (enum lss_policy): New.
301 (local_specialization_stack): Add policy parameter to default ctor.
302 * pt.c (local_specialization_stack): Copy local_specializations if
305 * constexpr.c (potential_constant_expression_1): Add "now" parm.
306 (is_constant_expression, require_constant_expression): New.
307 (is_static_init_expression, is_nondependent_constant_expression)
308 (is_nondependent_static_init_expression): Drop "potential".
309 * except.c (build_must_not_throw_expr): Do type conversion on
310 value-dependent argument.
311 * pt.c, semantics.c, typeck2.c: Use variants without "potential".
313 Instantiate default arguments/member initializers once.
314 * init.c (get_nsdmi): Remember NSDMI instantiations.
315 * parser.c (inject_this_parameter): Be more picky about
317 * pt.c (tsubst_copy): Simplify 'this' handling.
318 (tsubst_default_argument): Remember default argument
319 instantiations. Take parameter number.
320 (tsubst_default_arguments): Pass it.
321 * call.c (convert_default_arg): Likewise.
323 Fix default argument conversion failure and SFINAE.
324 * call.c (build_over_call): Check convert_default_arg result for
326 * parser.c (cp_parser_late_parsing_default_args): Remember
329 2017-08-28 Nathan Sidwell <nathan@acm.org>
331 * cp-tree.h (lang_type): Replace sorted_fields vector with
333 (CLASSTYPE_SORTED_FIELDS): Delete.
334 (CLASSTYPE_BINDINGS): New.
335 * decl.c (finish_enum_value_list): Swap args of
336 insert_late_enum_def_bindings.
337 * name-lookup.c (lookup_field_1): Replace binary search of sorted
338 fields with map->get.
339 (sorted_fields_type_new, count_fields,
340 add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
341 (add_class_member, add_class_members): New.
342 (set_class_bindings): Create map and insert.
343 (insert_late_enum_def_binding): Swap parms. Use add_clasS_member.
344 * ptree.c (cxx_print_type): Delete sorted fields printing.
346 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
348 * name-lookup.h (set_class_bindings,
349 insert_late_enum_def_bindings): Declare.
350 * decl.c (finish_enum_value_list): Adjust for
351 insert_late_enum_def_bindings name change.
352 * class.c (finish_struct_1): Call set_class_bindings.
353 (count_fields, add_fields_to_record_type,
354 add_enum_fields_to_record_type, sorted_fields_type_new,
355 insert_into_classtype_sorted_fields,
356 insert_late_enum_def_into_classtype_sorted_fields): Move to ...
357 * name-lookup.h (count_fields, add_fields_to_record_type,
358 add_enum_fields_to_record_type, sorted_fields_type_new,
359 set_class_bindings, insert_late_enum_def_bindings): ... here.
361 2017-08-25 Nathan Sidwell <nathan@acm.org>
363 * class.c (method_name_cmp, resort_method_name_cmp): Methods
366 Conversion operators have a special name
367 * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
368 (conv_op_marker, conv_op_identifier): New.
369 (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
370 * decl.c (initialize_predefined_identifiers): Add
372 (cxx_init_decl_processing): Create conv_op_marker.
373 * decl2.c (check_classfn): Lookup conv-ops by name.
374 * class.c (add_method): Use conv_op_identifier & conv_op_marker.
375 (resort_type_method_vec): Don't skip conv-ops.
376 (finish_struct_methods, warn_hidden): Likewise.
377 * name-lookup.h (lookup_all_conversions): Delete.
378 * name-lookup.c (lookup_conversion_operator): Replace with ...
379 (extract_conversion_operator): ... this.
380 (lookup_fnfields_slot_nolazy): Find conv-ops by name.
381 (lookup_all_conversions): Delete.
382 * pt.c (check_explicit_specialization): Find conv-ops by name.
383 * search.c (lookup_conversions_r): Likewise.
385 2017-08-24 Nathan Sidwell <nathan@acm.org>
387 Conversion operators kept on single overload set
388 * class.c (add_method): Keep all conv-ops on one slot.
389 * name-lookup.c (lookup_conversion_operator): Pull the desired
390 conv op out of overload set.
391 * search.c (lookup_conversions_r): Lose template/non-template
393 (lookup_conversions): Likewise.
395 2017-08-23 Nathan Sidwell <nathan@acm.org>
397 * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
398 lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
400 * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
401 lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
402 * search.c (lookup_conversion_operator,
403 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
404 lookup_all_conversions): Move to ...
405 * name-lookup.c (lookup_conversion_operator,
406 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
407 lookup_all_conversions): ... here.
409 * semantics.c (finish_member_declaration): Move USING_DECL check
410 earlier. Always set C++ linkage. Commonize TYPE_FIELD and
411 template decl list insertion.
413 * cp-tree.h (maybe_version_functions): Declare.
414 * decl.c (decls_match): Break function versioning check to
415 separate function. Call it.
416 (maybe_version_functions): Broken out of decls_match.
417 * class.c (add_method): Use maybe_version_functions.
419 * cp-tree.h (print_search_statistics,
420 reinit_search_statistics): Don't declare.
421 * search.c (n_fields_searched, n_calls_lookup_field,
422 n_calls_lookup_field_1, n_calls_lookup_fnfields,
423 n_calls_lookup_fnfields_1, n_calls_get_base_type,
424 n_outer_fields_searched, n_contexts_saved): Delete.
425 (lookup_field_1, lookup_member,
426 lookup_fnfields_slot_nolazy): Remove stat gathering.
427 (print_search_statistics, reinit_search_statistics): Delete.
428 * tree.c (cxx_print_statistics): Don't print search stats.
430 2017-08-21 Nathan Sidwell <nathan@acm.org>
432 * search.c (lookup_field_r): Remove obsolete code for type-named
435 * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
437 (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
438 (lookup_field_fuzzy_r): Adjust.
440 2017-08-21 David Malcolm <dmalcolm@redhat.com>
442 * call.c (build_over_call): Pass NULL for new parameter to
443 check_function_arguments.
444 * typeck.c (cp_build_function_call_vec): Likewise.
446 2017-08-21 Nathan Sidwell <nathan@acm.org>
449 * pt.c (instantiate_class_template_1):
450 BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
452 2017-08-18 David Malcolm <dmalcolm@redhat.com>
455 * name-lookup.c (maybe_suggest_missing_header): Convert return
456 type from void to bool; return true iff a suggestion was offered.
457 (suggest_alternative_in_explicit_scope): Move call to
458 maybe_suggest_missing_header to before use of best_match, and
459 return true if the former offers a suggestion.
461 2017-08-18 H.J. Lu <hongjiu.lu@intel.com>
464 * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
465 * decl2.c (grokbitfield): Don't allow bit-field with
466 warn_if_not_aligned type.
468 2017-08-17 Nathan Sidwell <nathan@acm.org>
470 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
471 * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
472 (TYPE_TEMPLATE_INFO): Simplify.
473 (SET_TYPE_TEMPLATE_INFO): Simplify.
475 * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
476 don't need lang_type.
477 (cxx_make_type): Use maybe_add_lang_type_raw return value.
478 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
481 * cp-tree.h (struct lang_type): Remove template_info field.
482 (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
483 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
485 2017-08-14 Martin Sebor <msebor@redhat.com>
488 * error.c (cp_printer): Handle 'G'.
490 2017-08-11 Martin Liska <mliska@suse.cz>
492 * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
493 TARGET_SUPPORTS_ALIASES.
494 (handle_tls_init): Likewise.
495 (note_mangling_alias): Likewise. Remove ATTRIBUTE_UNUSED for
497 * optimize.c (can_alias_cdtor): Likewise.
499 2017-08-11 Jason Merrill <jason@redhat.com>
501 PR c++/81671 - nullptr_t template parameter
502 * pt.c (convert_nontype_argument): Fix nullptr_t check.
504 2017-08-10 Jason Merrill <jason@redhat.com>
506 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
507 * method.c (synthesized_method_walk): Don't diagnose lack of
510 PR c++/80452 - Core 1579, implicit move semantics on return/throw
511 * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
512 tentatively changed the lvalue to an rvalue.
513 * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
514 (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
515 parameter is an rvalue reference.
516 * except.c (build_throw): Do maybe-rvalue overload resolution twice.
517 * typeck.c (check_return_expr): Likewise.
519 2017-08-10 David Malcolm <dmalcolm@redhat.com>
521 * parser.c (cp_parser_error): Update for new param to
523 (class token_pair): New class.
524 (struct matching_paren_traits): New struct.
525 (matching_parens): New typedef.
526 (struct matching_brace_traits): New struct.
527 (matching_braces): New typedef.
528 (cp_parser_statement_expr): Convert explicit parsing of
529 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
530 class matching_parens, so that the pertinent open parenthesis is
531 highlighted when there are problems locating the close
533 (cp_parser_primary_expression): Likewise.
534 (cp_parser_compound_literal_p): Remove consumption of opening
536 (cp_parser_postfix_expression): Convert explicit parsing of
537 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
538 above. Use it to consume the opening paren previously consumed by
539 cp_parser_compound_literal_p.
540 (cp_parser_parenthesized_expression_list): Likewise.
541 (cp_parser_unary_expression): Likewise.
542 (cp_parser_new_expression): Likewise.
543 (cp_parser_cast_expression): Likewise.
544 (cp_parser_builtin_offsetof): Likewise.
545 (cp_parser_trait_expr): Likewise.
546 (cp_parser_lambda_declarator_opt): Likewise.
547 (cp_parser_lambda_body): Likewise, for matching_braces.
548 (cp_parser_compound_statement): Likewise.
549 (cp_parser_selection_statement): Likewise, for matching_parens.
550 (cp_parser_iteration_statement): Likewise.
551 (cp_parser_already_scoped_statement): Likewise, for
553 (cp_parser_linkage_specification): Likewise.
554 (cp_parser_static_assert): Likewise, for matching_parens.
555 (cp_parser_decltype): Likewise.
556 (cp_parser_operator): Likewise.
557 (cp_parser_enum_specifier): Likewise.
558 (cp_parser_namespace_definition): Likewise.
559 (cp_parser_direct_declarator): Likewise.
560 (cp_parser_braced_list): Likewise.
561 (cp_parser_class_specifier_1): Likewise, for matching_braces.
562 (cp_parser_constant_initializer): Likewise.
563 (cp_parser_noexcept_specification_opt): Likewise, for
565 (cp_parser_exception_specification_opt): Likewise.
566 (cp_parser_handler): Likewise.
567 (cp_parser_asm_specification_opt): Likewise.
568 (cp_parser_asm_operand_list): Likewise.
569 (cp_parser_gnu_attributes_opt): Likewise.
570 (cp_parser_std_attribute_spec): Likewise.
571 (cp_parser_requirement_parameter_list): Likewise.
572 (cp_parser_requirement_body): Likewise, for matching_braces.
573 (cp_parser_compound_requirement): Likewise.
574 (cp_parser_template_introduction): Likewise.
575 (cp_parser_sizeof_pack): Likewise, for matching_parens.
576 (cp_parser_sizeof_operand): Likewise; use it to consume the
577 opening paren previously consumed by cp_parser_compound_literal_p.
578 (get_matching_symbol): New function.
579 (cp_parser_required_error): Add param "matching_location". Remove
580 calls to cp_parser_error, instead setting a non-NULL gmsgid, and
581 handling it if set by calling c_parse_error, potentially with a
582 secondary location if matching_location was set.
583 (cp_parser_require): Add param "matching_location", with a default
584 value of UNKNOWN_LOCATION.
585 (cp_parser_require_keyword): Update for new param of
586 cp_parser_required_error.
587 (cp_parser_objc_encode_expression): Update to class matching_parens
589 (cp_parser_objc_defs_expression): Likewise.
590 (cp_parser_objc_protocol_expression): Likewise.
591 (cp_parser_objc_selector_expression): Likewise.
592 (cp_parser_objc_typename): Likewise.
593 (cp_parser_objc_superclass_or_category): Likewise.
594 (cp_parser_objc_try_catch_finally_statement): Likewise.
595 (cp_parser_objc_synchronized_statement): Likewise.
596 (cp_parser_objc_at_property_declaration): Likewise.
597 (cp_parser_oacc_single_int_clause): Likewise.
598 (cp_parser_oacc_shape_clause): Likewise.
599 (cp_parser_omp_clause_collapse): Likewise.
600 (cp_parser_omp_clause_default): Likewise.
601 (cp_parser_omp_clause_final): Likewise.
602 (cp_parser_omp_clause_if): Likewise.
603 (cp_parser_omp_clause_num_threads): Likewise.
604 (cp_parser_omp_clause_num_tasks): Likewise.
605 (cp_parser_omp_clause_grainsize): Likewise.
606 (cp_parser_omp_clause_priority): Likewise.
607 (cp_parser_omp_clause_hint): Likewise.
608 (cp_parser_omp_clause_defaultmap): Likewise.
609 (cp_parser_omp_clause_ordered): Likewise.
610 (cp_parser_omp_clause_schedule): Likewise.
611 (cp_parser_omp_clause_num_teams): Likewise.
612 (cp_parser_omp_clause_thread_limit): Likewise.
613 (cp_parser_omp_clause_aligned): Likewise.
614 (cp_parser_omp_clause_linear): Likewise.
615 (cp_parser_omp_clause_safelen): Likewise.
616 (cp_parser_omp_clause_simdlen): Likewise.
617 (cp_parser_omp_clause_depend): Likewise.
618 (cp_parser_omp_clause_device): Likewise.
619 (cp_parser_omp_clause_dist_schedule): Likewise.
620 (cp_parser_oacc_clause_async): Likewise.
621 (cp_parser_omp_critical): Likewise.
622 (cp_parser_omp_for_loop): Likewise.
623 (cp_parser_omp_sections_scope): Likewise.
624 (cp_parser_omp_declare_reduction_exprs): Likewise.
625 Update for new param to cp_parser_required_error.
626 (cp_parser_oacc_routine): Likewise.
627 (cp_parser_transaction_expression): Likewise.
628 (cp_parser_cilk_simd_vectorlength): Likewise.
630 2017-08-09 Jason Merrill <jason@redhat.com>
632 PR c++/81525 - wrong constant value with generic lambda
633 * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
634 (tsubst_copy) [VAR_DECL]: Handle auto.
636 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
637 * init.c (get_nsdmi): Add complain parm.
638 * typeck2.c (digest_nsdmi_init): Add complain parm.
639 (process_init_constructor_record): Pass complain to get_nsdmi.
640 * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
641 * method.c (get_defaulted_eh_spec): Add complain parm. Pass it into
642 synthesized_method_walk.
643 (synthesized_method_walk): Adjust.
644 (walk_field_subobs): Pass complain to get_nsdmi.
645 (defaulted_late_check): Skip other checks if deleted.
646 * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
647 * call.c (build_aggr_conv): Pass complain to get_nsdmi.
648 * parser.c (defarg_location): New.
649 * error.c (location_of): Use it.
651 2017-08-09 Marek Polacek <polacek@redhat.com>
653 * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
654 * typeck.c (build_binary_op): Change the type of a parameter to bool.
655 (cp_truthvalue_conversion): Use true instead of 1.
657 2017-08-08 Marek Polacek <polacek@redhat.com>
660 * cp-gimplify.c (cp_fold): If folding exposed a branch of
661 a COND_EXPR, convert it to the original type of the COND_EXPR, if
664 2017-08-08 Martin Liska <mliska@suse.cz>
666 * call.c: Include header files.
667 * cp-gimplify.c: Likewise.
668 * cp-ubsan.c: Likewise.
671 * search.c: Likewise.
672 * semantics.c: Likewise.
673 * typeck.c: Likewise.
675 2017-08-07 Martin Liska <mliska@suse.cz>
677 * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
679 (cp_parser_std_attribute): Likewise.
680 * tree.c: Add new include.
682 2017-08-04 Paolo Carlini <paolo.carlini@oracle.com>
685 * pt.c (do_class_deduction): Handle the case of no viable implicit
686 deduction guides; simplify the code generating implicit deduction
689 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
692 * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
693 destructor as expressions.
695 2017-08-02 Jakub Jelinek <jakub@redhat.com>
698 * call.c (build_user_type_conversion_1): Only call
699 lookup_fnfields_slot if totype is CLASS_TYPE_P.
701 2017-07-31 Jason Merrill <jason@redhat.com>
703 * decl.c (declare_global_var): Set DECL_CONTEXT.
705 2017-07-31 Jan Hubicka <hubicka@ucw.cz>
706 Martin Liska <mliska@suse.cz>
708 * pt.c (tsubst_copy): Copy PREDICT_EXPR.
709 * semantics.c (finish_goto_stmt): Build gimple predict
711 * constexpr.c (potential_constant_expression_1): Handle
714 2017-07-31 Martin Liska <mliska@suse.cz>
717 * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
718 also with current_function_decl non-null equality.
719 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
720 * decl.c (compute_array_index_type): Likewise.
721 * init.c (finish_length_check): Likewise.
722 * typeck.c (cp_build_binary_op): Likewise.
724 2017-07-29 Jakub Jelinek <jakub@redhat.com>
726 * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
727 DW_AT_export_symbols.
728 * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
729 argument, pass it through to the debug hook.
730 (finish_namespace_using_directive): Adjust
731 emit_debug_info_using_namespace caller.
732 (push_namespace): Likewise. Call it after setting
733 DECL_NAMESPACE_INLINE_P.
734 (cp_emit_debug_info_for_using): Pass false as new argument to
735 the imported_module_or_decl debug hook.
737 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
739 * lex.c (copy_decl): Adjust.
740 (copy_type): Likewise.
742 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
745 * lambda.c (add_capture): Early return if we cannot capture by
748 2017-07-26 Jason Merrill <jason@redhat.com>
750 P0702R1 - List deduction of vector.
751 * pt.c (do_class_deduction): Special-case deduction from a single
752 element of related type.
754 2017-07-26 Leonid Koppel <lkoppel@uwaterloo.ca>
756 PR c++/67054 - Inherited ctor with non-default-constructible members
757 * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
758 when deducing an inheriting constructor.
760 2017-07-21 Nathan Sidwell <nathan@acm.org>
762 * search.c (lookup_conversion_operator): Return overloads.
763 (lookup_fnfields_idx_nolazy): Absorb into ...
764 (lookup_fnfields_slot_nolaxy): ... here.
765 (lookup_fnfields_1): Absorb into ...
766 (lookup_fnfields_slot): ... here.
768 Remove special CDtor METHOD_VEC slots.
769 * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
770 CLASSTYPE_DESTRUCTOR_SLOT): Delete.
771 (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
772 (CLASSTYPE_DESTRUCTOR): Likewise.
773 * class (add_method): Don't use special cdtor slots.
774 * search.c (lookup_fnfields_idx_nolazy): Likewise.
775 (look_for_overrides_here): Use lookup_fnfields_slot.
776 * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
778 * call.c (add_candidates): Move decls to initialization. Don't
781 2017-07-20 Nathan Sidwell <nathan@acm.org>
784 * class.c (maybe_warn_about_overly_private_class,
785 finish_struct_methods, one_inheriting_sig, count_fields,
786 add_fields_to_record_type, check_field_decls, check_methods,
787 clone_function_decl, set_method_tm_attributes,
788 finalize_literal_type_property, check_bases_and_members,
789 create_vtable_ptr, determine_key_method,
790 unreverse_member_declarations, finish_struct,
791 add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
792 * decl.c (fixup_anonymous_aggr): Likewise.
793 * decl2.c (reset_type_linkage_2): Likewise.
794 * method.c (after_nsdmi_defaulted_late_checks,
795 lazily_declare_fn): Likewise.
796 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
797 * pt.c (instantiate_class_template_1, tsubst_expr,
798 do_type_instantiation, instantiate_pending_templates): Likewise.
799 * search.c (lookup_field_1): Likewise.
800 * semantics.c (finish_member_declaration,
801 finish_omp_declare_simd_methods): Likewise.
803 2017-07-19 Nathan Sidwell <nathan@acm.org>
805 * class.c (add_implicitly_declared_members): Use
806 classtype_has_move_assign_or_move_ctor_p.
807 (classtype_has_move_assign_or_move_ctor,
808 classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
809 (classtype_has_move_assign_or_move_ctor_p): ... this new function.
810 * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
812 (classtype_has_move_assign_or_move_ctor_p): ... this.
813 * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
814 * tree.c (type_has_nontrivial_copy_init): Adjust.
816 * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
817 PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
819 2017-07-18 Nathan Sidwell <nathan@acm.org>
821 * cp-array-notation.c (build_array_notation_ref): Use
822 TYPE_{MIN,MAX}_VALUE.
824 * class.c (classtype_has_move_assign_or_move_ctor): Declare.
825 (add_implicitly_declared_members): Use it.
826 (type_has_move_constructor, type_has_move_assign): Merge into ...
827 (classtype_has_move_assign_or_move_ctor): ... this new function.
828 * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
830 2017-07-17 Volker Reichelt <v.reichelt@netcologne.de>
832 * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
833 friend outside class and obsolete auto as storage-class-specifier.
835 2017-07-17 Nathan Sidwell <nathan@acm.org>
837 * class.c (maybe_warn_about_overly_private_class): Ignore public
840 * class.c (type_has_user_declared_move_constructor,
841 type_has_user_declared_move_assign): Combine into ...
842 (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
843 * cp-tree.h (type_has_user_declared_move_constructor,
844 type_has_user_declared_move_assign): Combine into ...
845 (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
846 * method.c (maybe_explain_implicit_delete): Use it.
847 (lazily_declare_fn): Use it.
848 * tree.c (type_has_nontrivial_copy_init): Use it.
850 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
851 semantics, simplify implementation.
853 2017-07-16 Volker Reichelt <v.reichelt@netcologne.de>
855 * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
856 in old-style cast diagnostic.
857 * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
858 in useless cast diagnostic.
859 * error.c (type_to_string): Remove enum special handling.
861 2017-07-14 David Malcolm <dmalcolm@redhat.com>
863 * name-lookup.c (get_std_name_hint): Add '<' and '>' around
865 (maybe_suggest_missing_header): Update for addition of '<' and '>'
866 to above. Provide a fix-it hint.
867 * pt.c: Include "gcc-rich-location.h"
868 (listify): Attempt to add fix-it hint for missing
869 #include <initializer_list>.
870 * rtti.c: Include "gcc-rich-location.h".
871 (typeid_ok_p): Attempt to add fix-it hint for missing
874 2017-07-12 Jason Merrill <jason@redhat.com>
876 P0512R0 - Deduction from an initializer list.
877 * pt.c (do_class_deduction): Do list deduction in two phases.
879 2017-07-12 Nathan Sidwell <nathan@acm.org>
881 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
882 DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
884 * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
885 DECL_CXX_DESTRUCTOR explicitly.
886 * decl2.c (grokclassfn): Likewise.
887 * friend.c (do_friend): Likewise.
888 * method.c (make_thunk, make_alias_for,
889 implicitly_declare_fn): Likewise.
891 2017-07-11 Jason Merrill <jason@redhat.com>
894 * decl.c (grokparms): Downgrade error about array of unknown bound
895 to pedwarn and disable it for C++17.
897 2017-07-11 Nathan Sidwell <nathan@acm.org>
899 * decl2.c (reset_type_linkage_2): Dont't change ctor name.
901 2017-07-10 Martin Sebor <msebor@redhat.com>
903 * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
905 2017-07-06 Jason Merrill <jason@redhat.com>
907 PR c++/81204 - parse error with dependent template-name
908 * parser.c (cp_parser_lookup_name): Revert previous change.
910 2017-07-06 David Malcolm <dmalcolm@redhat.com>
912 * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
913 selftest::run_cp_tests.
914 (selftest::run_cp_tests): New function.
915 * cp-tree.h (selftest::run_cp_tests): New decl.
917 2017-07-04 Jakub Jelinek <jakub@redhat.com>
919 * parser.c (cp_parser_decomposition_declaration): Replace
920 decomposition declaration with structured binding in diagnostics.
921 * decl.c (cp_finish_decomp): Likewise.
922 (grokdeclarator): Likewise.
925 * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
926 forms of structured binding initializers.
928 2017-07-03 Paolo Carlini <paolo.carlini@oracle.com>
931 * decl.c (grokdeclarator): Move checks on function return type after
932 the splice_late_return_type call; if declspecs->locations[ds_type_spec]
933 is UNKNOWN_LOCATION fall back to input_location.
935 2017-07-03 David Malcolm <dmalcolm@redhat.com>
937 * parser.c (enum required_token): Fix spelling of
938 RT_INTERATION to RT_ITERATION.
939 (cp_parser_iteration_statement): Likewise.
940 (cp_parser_required_error): Likewise.
942 2017-06-30 Jason Merrill <jason@redhat.com>
944 PR c++/81257 - ICE with invalid ::template.
945 PR c++/54769 - wrong lookup of dependent template-name.
946 * parser.c (cp_parser_template_name): Revert part of last change.
948 2017-06-30 Nathan Sidwell <nathan@acm.org>
950 * config-lang.in (gtfiles): Add cp/lex.c.
951 * cp-tree.h (mangle_convop_name_for_type): Rename ...
952 (make_conv_op_name): ... here. Move to lex.
953 * lambda.c (maybe_add_lambda_conv_op): Update.
954 * parser.c (cp_parser_conversion_function_id): Update.
955 * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
956 tsubst_copy_and_build): Update.
957 * semantics.c (apply_deduced_return_type): Update.
958 * mangle.c (conv_type_hasher, conv_type_names,
959 mangle_conv_op_name_for_type): Move to ...
960 * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
963 2017-06-30 David Malcolm <dmalcolm@redhat.com>
966 * parser.c (cp_parser_postfix_expression): Construct a location
967 for typeid expressions.
969 2017-06-30 Nathan Sidwell <nathan@acm.org>
971 * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
973 (lookup_all_conversions): Declare.
974 * class.c (get_basefndecls): Use lookup_fnfields_slot.
975 * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
976 * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
978 * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
979 (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
980 lookup_all_conversions.
981 * search.c (lookup_fnfields_1): Make static.
982 (lookup_all_conversions): New.
983 (class_method_index_for_fn): Delete.
984 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
985 lookup_fnfields_slot.
987 * call.c (build_new_method_call_1): Use constructo_name to get
988 ctor name. Move argument processing earlier to merge cdtor
990 * decl.c (grokfndecl): Cdtors have special names.
991 * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
992 * pt.c (check_explicit_specialization): Cdtor name is already
994 * search.c (class_method_index_for_fn): Likewise.
997 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
998 a matching TYPE_DECL.
1000 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
1002 * class.c (add_method): Change pair of errors to error + inform.
1003 (handle_using_decl): Likewise.
1005 2017-06-29 Jason Merrill <jason@redhat.com>
1007 * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
1009 PR c++/81180 - ICE with C++17 deduction of member class template.
1010 * pt.c (build_deduction_guide): Correct member template handling.
1012 PR c++/81188 - matching decltype of member function call.
1013 * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
1015 2017-06-29 Nathan Sidwell <nathan@acm.org>
1018 * parser.c (cp_parser_namespace_definition): Immediately close the
1019 namespace if there's no open-brace.
1020 * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
1023 2017-06-29 Jason Merrill <jason@redhat.com>
1025 PR c++/81164 - ICE with invalid inherited constructor.
1026 * search.c (binfo_direct_p): New.
1027 * name-lookup.c (do_class_using_decl): Use it.
1029 2017-06-29 Nathan Sidwell <nathan@acm.org>
1031 * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
1032 VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
1033 * decl.c (initialize_predefined_identifiers): Name cdtor special
1034 names consistently. Use literals for above deleted defines.
1035 (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
1037 * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
1040 * call.c (check_dtor_name): Use constructor_name for enums too.
1041 (build_new_method_call_1): Use constructor_name for cdtors and
1043 * class.c (build_self_reference): Use TYPE_NAME to get name of
1045 * name-lookup (constructor_name): Use DECL_NAME directly.
1046 (constructor_name_p): Reimplement.
1047 (push_class_level_binding_1): Use TYPE_NAME directly.
1049 * class.c (finish_struct): Use OVL_P.
1050 (get_vfield_name): Measure constructor_name length.
1051 * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
1052 (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
1053 * cxx-pretty-print.c (is_destructor_name): Delete.
1054 (pp_cxx_unqualified_id): Remove bogus destructor name checking.
1055 * decl.c (grokfndecl): Move cheap checks first when looking for
1056 implicit extern cness.
1058 * parser.c (cp_parser_direct_declarator): Reorder if to avoid
1059 indentation. Remove unnecessary assignment of constructor name.
1061 Whitespace cleanups.
1062 * call.c (name_as_c_string): Move CONST_CAST to return.
1063 (build_new_method_call_1): Remove unneeded bracing.
1064 * class.c (include_empty_classes): Unbreak line.
1065 * constraint.cc (tsubst_check_constraint): Add space.
1066 * cp-tree.h (lang_decl_ns): Add comment.
1067 (PTRMEM_CST_MEMBER): Break line.
1068 * decl.c (grokfndecl): Add blank lines. Unbreak some others.
1069 (grokdeclarator): Remove lines, move declaration to first use.
1070 * decl2.c (decl_needed_p): Fix indentation.
1071 (c_parse_final_cleanups): Remove blank line.
1072 * method.c (implicitly_declare_fn): Move declaration to first use.
1073 * search.c (current_scope): Add blank lines.
1075 2017-06-28 Jason Merrill <jason@redhat.com>
1077 PR c++/72764 - ICE with invalid template typename.
1078 * decl.c (build_typename_type): No longer static.
1079 * tree.c (strip_typedefs): Use it instead of make_typename_type.
1081 PR c++/69300 - ICE with self-referential noexcept
1082 * pt.c (maybe_instantiate_noexcept): Check for recursion.
1084 PR c++/61022 - error with variadic template template parm
1085 * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
1087 PR c++/72801 - ICE with variadic partial specialization
1088 * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
1090 PR c++/55639 - partial specialization with ::template
1091 * parser.c (cp_parser_class_head): Handle ::template.
1093 PR c++/45976 - error with ::template in declarator.
1094 * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
1096 PR c++/54769 - wrong lookup of dependent template-name.
1097 * parser.c (cp_parser_template_name): Handle dependent object type.
1098 (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
1100 (cp_parser_id_expression): Pass it.
1101 (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
1103 * parser.c (cp_parser_template_id): Use the range location on the
1106 PR c++/81204 - parse error with dependent template-name
1107 * parser.c (cp_parser_lookup_name): Disqualify function templates
1110 2017-06-27 Nathan Sidwell <nathan@acm.org>
1112 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
1113 initialization point. Don't unnecessarily check for ctor name.
1115 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
1116 (CLASSTYPE_DESTRUCTOR): ... this.
1117 * class.c (accessible_nvdtor_p,
1118 maybe_warn_about_overly_private_class,
1119 add_implicitly_declared_members,
1120 clone_constructors_and_destructors, type_has_virtual_destructor):
1121 Adjust for CLASSTYPE_DESTRUCTOR.
1122 (deduce_noexcept_on_destructors): Absorb into ...
1123 (check_bases_and_members): ... here.
1124 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
1125 * init.c (build_delete): Likewise.
1126 * parser.c (cp_parser_lookup_name): Likewise.
1127 * pt.c (check_explicit_specialization): Likewise.
1128 * rtti.c (emit_support_tinfos): Likewise.
1129 * search.c (lookup_fnfields_idx_nolazy): Likewise.
1131 Kill IDENTIFIER_TEMPLATE.
1132 * cp-tree.h (lang_identifier): Remove class_template_info field.
1133 (IDENTIFIER_TEMPLATE): Delete.
1134 * name-lookup.c (constructor_name_full): Subsume into ...
1135 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
1136 (constructor_name_p): Likewise.
1137 * mangle.c (write_source_name): Likewise.
1138 * ptree.c (cxx_print_identifier): Likewise.
1140 2017-06-27 Marek Polacek <polacek@redhat.com>
1143 * parser.c (cp_parser_already_scoped_statement): Initialize
1146 2017-06-26 Jason Merrill <jason@redhat.com>
1148 PR c++/81215 - deduction failure with variadic TTP.
1149 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
1151 2017-06-26 Martin Sebor <msebor@redhat.com>
1154 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
1155 to detect casting away cv-qualifiers.
1157 2017-06-26 Nathan Sidwell <nathan@acm.org>
1159 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
1160 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
1162 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
1163 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
1164 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
1165 * decl.c (grok_op_properties): Adjust identifier checking.
1166 * init.c (expand_default_init): Adjust identifier descision.
1167 * method.c (implicitly_declare_fn): Don't use
1168 DECL_ASSIGNMENT_OPERATOR_P.
1169 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
1171 * call.c (in_charge_arg_for_name): Reimplement.
1172 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
1175 2017-06-26 Marek Polacek <polacek@redhat.com>
1178 * parser.c (cp_parser_statement): Add a default argument. Save the
1179 location of the expression-statement after labels have been parsed.
1180 (cp_parser_implicitly_scoped_statement): Set the location of the
1181 body of the conditional after parsing all the labels. Call
1182 warn_for_multistatement_macros.
1183 (cp_parser_already_scoped_statement): Likewise.
1185 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
1188 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
1189 'typename' in error messages about missing 'typename'.
1191 2017-06-23 Jason Merrill <jason@redhat.com>
1193 PR c++/79056 - C++17 ICE with invalid template syntax.
1194 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
1196 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
1197 * pt.c (template_placeholder_p): New.
1198 * cp-tree.h: Declare it.
1200 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
1202 * decl.c (duplicate_decls): Use builtin_structptr_types.
1204 2017-06-22 Nathan Sidwell <nathan@acm.org>
1206 Reorder IDENTIFIER flags
1208 * cp-tree.h (enum cp_identifier_kind): New.
1209 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
1210 IDENTIFIER_KIND_BIT_2): New.
1211 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
1212 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
1213 (C_IS_RESERVED_WORD): Replace with ...
1214 (IDENTIFIER_KEYWORD_P): ... this.
1215 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
1216 (IDENTIFIER_CDTOR_P): ... this.
1217 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
1218 (IDENTIFIER_OPNAME_P): Replace with ...
1219 (IDENTIFIER_ANY_OP_P): ... this.
1220 (IDENTIFIER_ASSIGN_OP_P): New.
1221 (IDENTIFIER_TYPENAME_P): Replace with ...
1222 (IDENTIFIER_CONV_OP_P): ... this.
1223 (NEW_DELETE_OPNAME_P): Replace with ...
1224 (IDENTIFIER_NEWDEL_OP_P): ... this.
1225 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
1226 (get_identifier_kind_name, set_identifier_kind): Declare.
1227 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
1228 (init_operators): Adjust to avoid keywords, use
1229 set_identifier_kind. Copy TYPE_EXPR slot.
1230 (init_reswords): Call set_identifier_kind.
1231 (unqualified_name_lookup_error): Adjust.
1232 * operators.def (TYPE_EXPR): Remove.
1233 * decl.c (struct predefined_identifier): Move into ...
1234 (initialize_predefined_identifiers): ... here. Call
1235 set_identifier_kind.
1236 (grokfndecl, check_var_type, grokdeclarator): Adjust.
1237 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
1239 * call.c (name_as_c_string): Adjust.
1240 (build_new_method_call_1): Likewise.
1241 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
1242 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
1243 * dump.c (cp_dump_tree): Adjust.
1244 * error.c (dump_decl_name): Adjust.
1245 * mangle.c (write_unqualified_id, write_member_name,
1246 write_expression): Adjust.
1247 (mangle_conv_op_name_for_type): Use set_identifier_kind.
1248 * name-lookup.c (do_class_using_decl): Adjust.
1249 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
1250 * parser.c (cp_lexer_get_preprocessor_token,
1251 cp_parser_direct_declarator): Likewise.
1252 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
1253 tsubst_copy, tsubst_copy_and_build): Adjust.
1254 * ptree.c (cxx_print_identifier): Print identifier kind.
1255 * search.c (lookup_field_r, lookup_member,
1256 lookup_fnfields_idx_nolazy): Adjust.
1257 * semantics.c (finish_id_expression): Adjust..
1258 * typeck.c (cp_build_addr_expr_1): Adjust.
1260 2017-06-21 Jakub Jelinek <jakub@redhat.com>
1263 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
1264 Complain about t not being a variable if t is OVERLOAD even
1265 when processing_template_decl.
1267 2017-06-21 David Malcolm <dmalcolm@redhat.com>
1269 * parser.c (get_cast_suggestion): New function.
1270 (maybe_add_cast_fixit): New function.
1271 (cp_parser_cast_expression): Capture the location of the closing
1272 parenthesis. Call maybe_add_cast_fixit when emitting warnings
1273 about old-style casts.
1275 2017-06-20 Jason Merrill <jason@redhat.com>
1277 PR c++/80972 - C++17 ICE with attribute packed.
1278 * call.c (build_over_call): Allow a TARGET_EXPR from reference
1281 2017-06-20 Nathan Sidwell <nathan@acm.org>
1283 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
1284 (nelts_identifier): Delete.
1285 * decl.c (initialize_predefined_identifiers): Remove nelts.
1287 PR c++/67074 - namespace aliases
1288 * decl.c (duplicate_decls): Don't error here on mismatched
1290 * name-lookup.c (name_lookup::add_value): Matching namespaces are
1292 (diagnose_name_conflict): Namespaces are never redeclarations.
1293 (update_binding): An alias can match a real namespace.
1295 2017-06-19 Jason Merrill <jason@redhat.com>
1297 PR c++/80562 - ICE with constexpr if.
1298 * semantics.c (finish_if_stmt_cond): Call
1299 instantiate_non_dependent_expr.
1301 PR c++/80829 - ICE with constexpr copy of base subobject.
1302 * constexpr.c (clear_no_implicit_zero): New.
1303 (cxx_eval_call_expression): Call it.
1305 2017-06-19 Nathan Sidwell <nathan@acm.org>
1309 * name-lookup.c (set_decl_namespace): Don't follow using
1310 directives and ignore using decls. Only check overly-explicit
1311 scope after discovering decl.
1313 2017-06-19 Jason Merrill <jason@redhat.com>
1315 PR c++/81073 - constexpr and static var in statement-expression.
1316 * typeck2.c (store_init_value): Always call
1317 require_potential_constant_expression.
1318 * pt.c (convert_nontype_argument): Likewise.
1319 * constexpr.c (potential_constant_expression_1): Adjust message.
1320 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
1321 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
1323 2017-06-19 Nathan Sidwell <nathan@acm.org>
1325 * pt.c (coerce_template_parms): Fix indentation.
1326 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
1330 * name-lookup.c (update_binding): Only warn about constructors
1331 hidden by functions.
1333 2017-06-17 Jason Merrill <jason@redhat.com>
1335 PR c++/60063 - -Wunused-local-typedefs and templates.
1336 * decl2.c (is_late_template_attribute): Return false for "used".
1338 PR c++/70844 - -Wuseless-cast and inheriting constructor.
1339 * method.c (forward_parm): Suppress warn_useless_cast.
1341 2017-06-16 Jason Merrill <jason@redhat.com>
1343 PR c++/81045 - Wrong type-dependence with auto return type.
1344 * pt.c (type_dependent_expression_p): An undeduced auto outside the
1345 template isn't dependent.
1346 * call.c (build_over_call): Instantiate undeduced auto even in a
1349 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
1350 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
1351 set longer for a generic lambda.
1353 PR c++/80614 - Wrong mangling for C++17 noexcept type
1354 * mangle.c (write_type): Put the eh spec back on the function type.
1356 PR c++/81102 - Wrong error with partial specialization.
1357 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
1358 types. Do type deduction later.
1360 PR c++/81074 - ICE with partial specialization of member template.
1362 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
1364 PR c++/80831 - ICE with -fsyntax-only.
1365 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
1367 PR c++/80639 - ICE with invalid PMF initialization.
1368 PR c++/80043 - ICE with -fpermissive
1369 * typeck.c (convert_for_assignment): Recurse when instantiate_type
1370 returns without an error.
1372 2017-06-16 Nathan Sidwell <nathan@acm.org>
1374 * pt.c (tsubst_baselink): Fix & clarify formatting.
1376 * cp-tree.h (build_this_parm, cp_build_parm_decl,
1377 build_artificial_parm): Add FN parm.
1378 * decl.c (start_cleanup_fn): Adjust.
1379 (build_this_parm): Add FN parm, pass it through.
1380 (grokfndecl): Adjust parm building.
1381 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
1382 (build_artificial_parm): Add FN parm, pass through.
1383 (maybe_retrofit_in_chrg): Adjust parm building.
1384 (start_static_storage_duration_function): Likwise.
1385 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
1386 * method.c (implicitly_declare_fn): Likewise.
1387 * parser.c (inject_this_parameter): Likewise.
1389 Symbol tables are insert only.
1390 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
1391 derive from pointer_hash. Make undeletable.
1393 * class.c (resort_type_method_vec): Avoid potential unsigned
1396 Don't defer noexcept_deferred_spec.
1397 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
1398 * decl.c (cxx_init_decl_processing): Initialize
1399 noexcept_deferred_spec.
1400 * except.c (unevaluated_noexcept_spec): Delete.
1401 * class.c (deduce_noexcept_on_destructor): Use
1402 noexcept_deferred_spec directly.
1403 * method.c (implicitly_declare_fn): Likewise.
1405 Make keyed_classes a vector.
1406 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
1407 (keyed_classes): Declare as vector.
1408 * decl.c (keyed_classes): Define.
1409 (cxx_init_decl_processing): Allocate it.
1410 (record_key_method_defined): Use vec_safe_push.
1411 * class.c (finish_struct_1): Likewise.
1412 * pt.c (instantiate_class_template_1): Likewise.
1413 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
1416 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
1417 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
1419 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
1420 (get_tinfo_decl): Use get_tinfo_desc.
1421 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
1422 (create_pseudo_type_info): Delete.
1423 (get_pseudo_ti_index): Just determine the index.
1424 (get_tinfo_desc): New. Create all types lazily.
1425 (create_tinfo_types): Just allocate the descriptor array.
1426 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
1429 2017-06-15 Martin Sebor <msebor@redhat.com>
1432 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
1434 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
1435 (build_cxx_call): Call maybe_warn_class_memaccess.
1437 2017-06-14 Jakub Jelinek <jakub@redhat.com>
1439 * cp-gimplify.c (cp_genericize_r): Turn most of the function
1440 into a switch (TREE_CODE (stmt)) statement from long else if
1443 2017-06-13 Jakub Jelinek <jakub@redhat.com>
1446 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
1447 argument even if it has REFERENCE_TYPE.
1450 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
1451 BLOCK_VARS (outer) chain.
1452 (cxx_omp_const_qual_no_mutable): Likewise.
1454 2017-06-13 Martin Liska <mliska@suse.cz>
1457 * class.c (build_base_path): Use sanitize_flags_p.
1458 * cp-gimplify.c (cp_genericize_r): Likewise.
1459 (cp_genericize_tree): Likewise.
1460 (cp_genericize): Likewise.
1461 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1462 * decl.c (compute_array_index_type): Likewise.
1463 (start_preparsed_function): Likewise.
1464 * decl2.c (one_static_initialization_or_destruction): Likewise.
1465 * init.c (finish_length_check): Likewise.
1466 * lambda.c (maybe_add_lambda_conv_op): Likewise.
1467 * typeck.c (cp_build_binary_op): Likewise.
1468 (build_static_cast_1): Likewise.
1470 2017-06-11 Jason Merrill <jason@redhat.com>
1472 * error.c (dump_expr): Use is_this_parameter.
1474 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
1477 2017-06-09 Jason Merrill <jason@redhat.com>
1479 Missing bits from N4268, constant evaluation for all non-type args.
1480 * call.c (build_converted_constant_expr): Rename from
1481 build_integral_nontype_arg_conv, handle all types.
1482 * pt.c (convert_nontype_argument): In C++17 call it for all types.
1483 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
1484 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
1486 Overhaul pointer-to-member conversion and template argument handling.
1487 * call.c (standard_conversion): Avoid creating ck_pmem when the
1488 class type is the same.
1489 * cvt.c (can_convert_qual): Split from
1490 perform_qualification_conversions.
1491 * constexpr.c (cxx_eval_constant_expression): Check it.
1492 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
1493 adjustment is necessary.
1494 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
1495 (convert_nontype_argument): Avoid redundant error.
1497 * call.c (convert_like_real): Remove "inner" parameter.
1498 Don't replace a constant with its value.
1499 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
1501 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
1504 * parser.c (cp_parser_constant_expression): Check
1505 potential_rvalue_constant_expression after decay_conversion.
1506 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
1508 PR c++/80384 - ICE with dependent noexcept-specifier
1509 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
1512 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
1514 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
1516 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
1517 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
1518 (excpet.c): Mark terminate as cold.
1520 2017-06-08 Jakub Jelinek <jakub@redhat.com>
1523 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
1524 to sizetype before size_binop.
1527 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
1528 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
1529 and OMP_CLAUSE_SHARED_READONLY flags.
1531 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
1533 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
1535 2017-06-07 Nathan Sidwell <nathan@acm.org>
1537 * class.c (layout_class_type): Restructure overlong-bitfield tpe
1540 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
1543 * pt.c (do_class_deduction): Build qualified type.
1545 2017-06-06 Nathan Sidwell <nathan@acm.org>
1547 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
1548 sans using directives. Don't walk into inline namespaces.
1551 * name-lookup.c (adl_class_only): Don't add visible friends.
1553 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
1555 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
1557 2017-06-02 Nathan Sidwell <nathan@acm.org>
1559 Remove lang_type_ptrmem.
1560 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
1562 (lang_type_class): ... this. Reorder bitfields. Rename to ...
1563 (lang_type): ... this. Delete old definition.
1564 (lang_type_ptrmem): Delete.
1565 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
1566 (LANG_TYPE_PTRMEM_CHECK): Delete.
1567 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
1568 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
1569 * decl.c (build_ptrmemfunc_type): Adjust.
1570 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
1571 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
1573 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
1576 Remove cp_binding_level::namespaces
1577 * name-lookup.h (cp_binding_level): Lose namespaces field.
1578 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
1580 (suggest_alternatives_for): Adjust for namespace list. Do
1581 breadth-first search.
1582 * decl2.c (collect_source_refs): Namespaces are on the regulr
1584 (collect_ada_namespace): Likewise.
1586 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
1588 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
1591 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
1594 * method.c (constructible_expr): Strip array types before calling
1597 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
1600 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
1601 for case INDIRECT_REF too in the main switch.
1603 2017-05-31 Jason Merrill <jason@redhat.com>
1605 PR c++/80840 - ICE with constexpr and reference
1606 * pt.c (convert_nontype_argument): Don't test whether a decl is
1607 value-dependent when binding to a reference.
1609 2017-05-31 Nathan Sidwell <nathan@acm.org>
1611 * cp-tree.h (lang_decl_slector): New enum.
1612 (lang_decl_base): Make selector an enum. Drop decomposition_p
1614 (lang_decl): Use enum for discrimination.
1615 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
1616 LANG_DECL_DEOMP_CHECK): Use enum.
1617 (DECL_DECOMPOSITION_P): Use selector value.
1618 (SET_DECL_DECOMPOSITION_P): Delete.
1619 (retrofit_lang_decl): Lose SEL parm.
1620 (fit_decomposition_lang_decl): Declare.
1621 * decl.c (cp_finish_decomp, grokdeclarator): Use
1622 fit_decomposition_lang_decl.
1623 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
1625 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
1626 (fit_decomposition_lang_decl): Likewise.
1627 (retrofit_lang_decl): Use worker functions.
1628 (cxx_dup_lang_specific_decl): Use selector enum.
1629 (maybe_add_lang_type_raw): New. Broken out of ...
1630 (cxx_make_type_name): ... here. Call it.
1632 2017-05-30 Jason Merrill <jason@redhat.com>
1634 PR c++/80856 - ICE with local extern in template
1635 * semantics.c (finish_call_expr): Replace a local extern overload
1636 set in a template with the IDENTIFIER_NODE.
1638 2017-05-30 David Malcolm <dmalcolm@redhat.com>
1640 * call.c (perform_implicit_conversion_flags): Convert
1641 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
1642 (print_conversion_rejection): Replace pairs of %qT with
1643 %qH and %qI in various places.
1644 (build_user_type_conversion_1): Likewise.
1645 (build_integral_nontype_arg_conv): Likewise.
1646 (build_conditional_expr_1): Likewise.
1647 (convert_like_real): Likewise.
1648 (convert_arg_to_ellipsis): Likewise.
1650 (initialize_reference): Likewise.
1651 * cvt.c (cp_convert_to_pointer): Likewise.
1652 (cp_convert_to_pointer): Likewise.
1653 (convert_to_reference): Likewise.
1654 (ocp_convert): Likewise.
1655 * error.c (cp_printer): Gain bool and const char ** parameters.
1656 (struct deferred_printed_type): New struct.
1657 (class cxx_format_postprocessor): New class.
1658 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
1659 to pp->m_format_postprocessor.
1660 (comparable_template_types_p): New function.
1661 (newline_and_indent): New function.
1662 (arg_to_string): New function.
1663 (print_nonequal_arg): New function.
1664 (print_template_differences): New function.
1665 (type_to_string_with_compare): New function.
1666 (print_template_tree_comparison): New function.
1667 (append_formatted_chunk): New function.
1668 (add_quotes): New function.
1669 (cxx_format_postprocessor::handle): New function.
1670 (defer_phase_2_of_type_diff): New function.
1671 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
1673 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
1674 %qH and %qI in various places.
1675 (convert_member_func_to_ptr): Likewise.
1676 (build_reinterpret_cast_1): Likewise.
1677 (convert_for_assignment): Likewise.
1678 * typeck2.c (check_narrowing): Likewise.
1680 2017-05-30 Nathan Sidwell <nathan@acm.org>
1682 Kill IDENTIFIER_NAMESPACE_BINDINGS
1683 * cp-tree.h (lang_identifier): Delete namespace_bindings.
1684 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
1685 (lang_decl_ns): Add bindings.
1686 (DECL_NAMESPACE_BINDINGS): New.
1687 * lex.c (retrofit_lang_decl): Create namespace hash table.
1688 * name-lookup.c (find_namespace_slot): Change to use hash-map.
1689 * ptree.c (cxx_print_binding): Delete.
1690 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
1692 * cp-tree.def (OVERLOAD): Fix comment.
1693 * cp-tree.h: Fix comments and whitespace.
1694 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
1695 * name-lookup.c (add_decl_to_level): Assert not class.
1696 (check_local_shadow): Use OVL_P.
1697 (pushdecl_with_scope_1): Rename to ...
1698 (do_pushdecl_with_Scope): ... here.
1699 (do_nonmember_using_decl): Use qualified_namespace_lookup return
1701 (push_class_level_binding_1): Use OVL_P.
1702 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
1703 (pushtag_1): Rename to ...
1704 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
1706 (store_class_bindings): Do not time here.
1707 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
1708 * pt.c (listify): Declare argvec at point of initialization.
1711 * name-lookup.c (add_decl_to_level): Assert not making a circular
1713 (update_binding): Don't prematurely slide artificial decl.
1715 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
1717 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
1719 2017-05-29 Nathan Sidwell <nathan@acm.org>
1721 PR c++/80891 (#1,#5)
1722 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
1723 * name-lookup.c (name_lookup): Add deduping field.
1724 (name_lookup::preserve_state, name_lookup::restore_state): Deal
1726 (name_lookup::add_overload): New.
1727 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
1728 (name_lookup::search_adl): Set deduping. Don't unmark here.
1729 * pt.c (most_specialized_instantiation): Revert previous change,
1730 Assert not given duplicates.
1731 * tree.c (lookup_mark): Just mark the underlying decls.
1732 (lookup_maybe_add): Dedup using marked decls.
1735 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
1736 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
1738 Stat hack representation
1739 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
1740 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
1742 (find_namespace_binding): Replace with ...
1743 (find_namespace_slot): ... this.
1744 (find_namespace_value): New.
1745 (name_lookup::search_namespace_only,
1746 name_lookup::adl_namespace_only): Adjust.
1747 (update_binding): Add SLOT parameter, adjust.
1748 (check_local_shadow): Use find_namespace_value.
1749 (set_local_extern_decl_linkage): Likewise.
1750 (do_pushdecl): Adjust for namespace slot.
1751 (push_local_binding): Assert not a namespace binding.
1752 (check_for_out_of_scope_variable): Use find_namespace_value.
1753 (set_identifier_type_value_with_scope): Likewise.
1754 (get_namespace_binding): Likewise.
1755 (set_namespace_binding): Delete.
1756 (set_global_binding): Directly update the binding.
1757 (finish_namespace_using_decl): Likewise.
1758 (lookup_type_scope_1): Use find_namespace_slot and update.
1759 (do_push_nested_namespace): Use find_namespace_value.
1762 * pt.c (most_specialized_instantiation): Cope with duplicate
1766 * cp-tree.h (build_min_nt_call_vec): Declare.
1767 * decl.c (build_offset_ref_call_from_tree): Call it.
1768 * parser.c (cp_parser_postfix_expression): Likewise.
1769 * pt.c (tsubst_copy_and_build): Likewise.
1770 * semantics.c (finish_call_expr): Likewise.
1771 * tree.c (build_min_nt_loc): Keep unresolved lookups.
1772 (build_min): Likewise.
1773 (build_min_non_dep): Likewise.
1774 (build_min_non_dep_call_vec): Likewise.
1775 (build_min_nt_call_vec): New.
1778 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
1780 (lookup_keep): Call it.
1782 2017-05-26 Nathan Sidwell <nathan@acm.org>
1785 * name-lookup.c (push_inline_namespaces): New.
1786 (push_namespace): Look inside inline namespaces.
1788 Inline and using namespace representation change.
1789 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
1791 (DECL_NAMESPACE_USING): Adjust.
1792 (DECL_NAMESPACE_INLINEES): New.
1793 * name-lookup.h (struct cp_binding_level): Change usings
1795 * name-lookup.c (name_lookup::do_queue_usings,
1796 name_lookup::queue_usings): Adjust.
1797 (name_lookup::search_namespace, name_lookup::search_usings,
1798 name_lookup::queue_namespace): Adjust.
1799 (name_lookup::adl_namespace_only): Adjust.
1800 (add_using_namespace, push_namespace): Push onto vector.
1801 (pop_namespace): Add timing logic.
1803 * call.c (build_operator_new_call): Do namelookup and ADL here.
1804 (build_new_op_1): Likewise.
1805 * name-lookup.h (lookup_function_nonclass): Delete declaration.
1806 (do_using_directive): Likewise.
1807 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
1809 (struct scope_binding): Delete.
1810 (EMPTY_SCOPE_BINDING): Delete.
1811 (set_decl_namespace): Use OVL_P.
1812 (finish_local_using_decl): Lose unnecesary checks.
1813 (lookup_function_nonclass): Delete.
1814 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
1816 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
1817 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
1819 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
1820 (lkp_iterator): Add outer field. Adjust ctor.
1821 (lkp_iterator::operator++): New.
1822 (lookup_mark, lookup_maybe_add): Declare.
1823 * name-lookup.c (name_lookup): Delete fn_set member.
1824 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
1826 (name_lookup::add_value): Use lookup_add directly.
1827 (name_lookup::add_fns: Use lookup_maybe_add.
1828 (name_lookup::search_adl): Mark and unmark fns.
1830 * pt.c (check_explicit_specialization): Use lookup_add directly.
1831 * ptree.c (cxx_print_xnode): Show complete overload structure.
1832 * tree.c (lookup_mark, lookup_maybe_add): New.
1834 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
1836 2017-05-26 Jakub Jelinek <jakub@redhat.com>
1838 * cp-tree.h (struct lang_decl_decomp): New type.
1839 (struct lang_decl): Add u.decomp.
1840 (LANG_DECL_DECOMP_CHECK): Define.
1841 (DECL_DECOMPOSITION_P): Note it is set also on the vars
1842 for user identifiers.
1843 (DECL_DECOMP_BASE): Define.
1844 (retrofit_lang_decl): Add extra int = 0 argument.
1845 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
1846 use it to influence the selector choices and for selector
1847 0 to non-zero transition copy old content.
1848 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
1849 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
1850 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
1851 wording if decl is a structured binding.
1852 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
1853 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
1854 of individual variables for tuple structured bindings.
1855 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
1856 Clear DECL_DECOMP_BASE.
1857 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
1858 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
1860 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
1863 2017-05-25 Jason Merrill <jason@redhat.com>
1865 PR c++/80605 - __is_standard_layout and zero-length array
1866 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
1868 2017-05-25 Nathan Sidwell <nathan@acm.org>
1870 Kill OVL_CURRENT, OVL_NEXT.
1871 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
1872 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
1873 (consider_binding_level): Use OVL_FIRST.
1874 (cp_emit_debug_info_for_using): Use lkp_iterator.
1875 * pt.c (check_explicit_specialization): Use ovl_iterator.
1877 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
1878 * cp-tree.h (lang_decl_ns): Remove ns_users field.
1879 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
1880 (TREE_INDIRECT_USING): Delete.
1881 * name-lookup.h (is_associated_namespace): Delete.
1882 * name-lookup.c (name_lookup::search_usings,
1883 name_lookup::do_queue_usings): Usings are always direct.
1884 (is_associated_namespace): Delete.
1885 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
1886 (namespace_ancestor_1, namespace_ancestor): Delete.
1887 (push_using_directive_1, push_using_directive): Delete.
1888 (add_using_namespace_1): Delete.
1889 (add_using_namespace): Reimplement.
1890 (emit_debug_info_using_namespace): New.
1891 (finish_namespace_using_directive, finish_local_using_directive,
1892 push_namespace): Adjust.
1893 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
1895 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
1897 * semantics.c (finish_handler_parms): Warn about non-reference type
1900 2017-05-25 Nathan Sidwell <nathan@acm.org>
1902 Reimplement unqualified namespace lookup.
1903 * name-lookup.c (name_lookup::using_pair,
1904 name_lookup::using_queue): New typedefs.
1905 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
1906 name_lookup::queue_usings): New.
1907 (name_lookup::search_unqualified): New.
1908 (merge_functions, same_entity_p, ambiguous_decl,
1909 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
1910 lookup_using_namespace): Delete.
1911 (lookup_name_real_1): Adjust.
1913 Reimplement qualified namespace lookup.
1914 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
1915 (name_lookup::ambiguous, name_lookup::add_value,
1916 name_lookup::add_type, name_lookup::process_binding): New.
1917 (name_lookup::search_namespace_only,
1918 name_lookup::search_namespace, name_lookup::search_usings): New.
1919 (name_lookup::search_qualified): New.
1920 (do_nonmember_using_decl, suggest_alternatives_for,
1921 lookup_qualified_name): Adjust.
1922 (tree_vec_contains): Delete.
1923 (qualified_lookup_using_namespace): Rename to ...
1924 (qualified_namespace_lookup): ... here. Reimplement.
1927 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
1928 * name-lookup.h (lookup_arg_dependent): Return plain tree.
1929 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
1930 arg_assoc_args_vec, arg_assoc_type, add_function,
1931 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
1932 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
1933 lookup_arg_dependent_1): Delete.
1934 (name_lookup): New lookup object.
1935 (name_lookup::preserve_state, name_lookup::restore_state,
1936 name_lookup::mark_seen, name_lookup::find_and_mark,
1937 name_lookup::add_fns, name_lookup::adl_namespace_only,
1938 name_lookup::adl_namespace, name_lookup::adl_class_only,
1939 name_lookup::adl_bases, name_lookup::adl_class,
1940 name_lookup::adl_expr, name_lookup::adl_type,
1941 name_lookup::adl_template_arg, name_lookup::search_adl): New.
1942 (lookup_arg_dependent): Return a plain tree. Adjust.
1943 (is_associated_namespace): Move later.
1945 2017-05-24 Nathan Sidwell <nathan@acm.org>
1947 * friend.c (do_friend): Remove check for existing decl.
1948 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
1949 * name-lookup.c (push_local_binding): Directly look for binding.
1950 (lookup_name_innermost_nonclass_level_1): Delete.
1951 (lookup_name_innermost_nonclass_level): Delete.
1953 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
1955 * cp-tree.h (cp_free_lang_data): Add extern.
1956 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
1958 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
1959 * typeck.c (type_unknown_p): Delete.
1960 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
1961 overload management.
1962 (dependent_name): Likewise.
1963 (decl_anon_ns_mem_p): Simplify.
1965 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
1968 * tree.c (reshape_init): Use unqualified type for direct enum init.
1969 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
1970 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
1971 non-class destination types.
1972 (build_const_cast_1): Strip cv-quals from destination types.
1973 (build_static_cast, build_reinterpret_cast, build_const_cast)
1974 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
1976 2017-05-24 Martin Sebor <msebor@redhat.com>
1979 * call.c (fully_fold_internal): Adjust.
1981 2017-05-24 Nathan Sidwell <nathan@acm.org>
1983 * cp-tree.h (ovl_skip_hidden): Declare.
1984 * tree.c (ovl_skip_hidden): New.
1985 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
1986 (lookup_arg_dependent_1): Likewise.
1987 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
1988 (hidden_name_p, remove_hidden_names): Delete.
1989 (lookup_name_real_1): Do not strip hidden names.
1990 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
1992 * cp-tree.h (OVL_HIDDEN_P): New.
1993 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
1994 (ovl_iterator::reveal_node): Declare.
1995 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
1996 (ovl_insert): Order on hiddenness.
1997 (ovl_iterator::reveal_node): New.
1998 * name-lookup.c (anticipated_builtin_p): New.
1999 (supplement_binding_1): Use it.
2000 (set_local_extern_decl_linkage): Use hidden_p.
2001 (do_pushdecl): Deal with unhiding a hidden decl, use
2002 anticipated_builtin_p.
2003 (do_nonmember_using_decl): Use anticipated_decl_p.
2004 (lookup_name_real_1): Use DECL_HIDDEN_P.
2006 2017-05-23 Jason Merrill <jason@redhat.com>
2008 -Wunused and C++17 structured bindings
2009 * decl.c (poplevel): Don't warn about unused structured bindings,
2010 only real variables.
2011 * error.c (dump_simple_decl): Handle structured bindings.
2012 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
2014 2017-05-23 Nathan Sidwell <nathan@acm.org>
2016 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
2017 * name-lookup.c (create_local_binding): New.
2018 (update_binding): New.
2019 (pushdecl_maybe_friend_1): Rename to ...
2020 (do_pushdecl): ... this. Reimplement.
2022 (push_overloaded_decl_1, push_overloaded_decl): Delete.
2024 2017-05-23 Jason Merrill <jason@redhat.com>
2026 PR c++/80396 - built-in for make_integer_sequence.
2027 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
2028 (expand_integer_pack, expand_builtin_pack_call): New.
2029 (find_parameter_packs_r): Check builtin_pack_call_p.
2030 (check_for_bare_parameter_packs): Handle it.
2031 (tsubst_pack_expansion): Call expand_builtin_pack_call.
2032 (declare_integer_pack): New.
2033 (init_template_processing): Call it.
2034 * decl2.c (mark_used): Check builtin_pack_fn_p.
2036 2017-05-23 Nathan Sidwell <nathan@acm.org>
2038 * name-lookup.c (find_namespace_binding): New.
2039 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
2040 (set_identifier_type_value_with_scope): Use find_namespace_binding.
2041 (find_binding, cp_binding_level_find_binding_for_name,
2042 binding_for_name, namespace_binding_1): Delete.
2043 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
2044 (get_namespace_binding, set_namespace_binding,
2045 finish_namespace_using_decl, unqualified_namespace_lookup_1,
2046 qualified_lookup_using_namespace, lookup_type_scope_1,
2047 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
2050 * parser.c (cp_parser_template_id): Keep the lookup when stashing
2053 * cp-tree.h (DECL_HIDDEN_P): New.
2054 * name-lookup.c (set_decl_context,
2055 set_local_extern_decl_linkage): New, broken out of ...
2056 (pushdecl_maybe_friend_1): ... here. Call them.
2058 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
2060 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
2061 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
2064 2017-05-23 Nathan Sidwell <nathan@acm.org>
2066 * cp-tree.h (OVL_P): New.
2067 * name-lookup.h (push_local_binding): Delete.
2068 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
2069 (finish_namespace_using_decl, finish_local_using_decl): ... here
2070 * name-lookup.c (add_decl_to_level): Swap args.
2071 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
2072 (diagnose_name_conflict): Check contexts are same for redecl.
2073 (update_local_overload): New.
2074 (compparms_for_decl_and_using): Rename to ...
2075 (matching_fn_p): ... here.
2076 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
2077 push_local_bindings call.
2078 (push_local_binding): Make static, replace FLAGS arg with
2080 (validate_nonmember_using_decl): Use OVL_FIRST.
2081 (do_nonmember_using_decl): Use in/out parameters. Use
2082 lkp_iterator and simplify.
2083 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
2084 (finish_namespace_using_decl, finish_local_using_decl): ... here.
2086 (lookup_type_current_level): Delete.
2087 * parser.c (cp_parser_using_declaration): Adjust.
2088 * pt.c (tsubst_expr): Adjust.
2090 2017-05-22 Nathan Sidwell <nathan@acm.org>
2092 * name-lookup.h (parse_using_directive): Replace with ...
2093 (finish_namespace_using_directive): ... this and ...
2094 (finish_local_using_directive): ... this.
2095 * name-lookup.c (add_using_namespace_1): Move later.
2096 (add_using_namespace): Move later, add namespace_p arg, remove
2098 (push_using_directive_1): Directly recurse.
2099 (do_using_directive, parse_using_directive): Delete, split into ...
2100 (finish_namespace_using_directive): ... this and ...
2101 (finish_local_using_directive): ... this.
2102 (push_namespace): Use add_using_namespace.
2103 * parser.c (cp_parser_using_directive): Call
2104 finish_namespace_using_directive or finish_local_using_directive.
2105 * pt.c (tsubst_expr): Call finish_local_using_directive.
2107 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
2108 * cp-tree.h (raw_dump_id): Declare.
2109 * decl2.c (raw_dump_id): Define.
2110 (dump_tu): Use raw_dump_id.
2112 * config-lang.in (gtfiles): Sort list, break lines.
2114 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
2115 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
2116 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
2117 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
2118 CPTI_RETHROW_FN): New.
2119 (noexcept_deferred_spec): New.
2120 (terminate_node, call_unexpected_node): Rename to ...
2121 (terminate_fn, call_unexpected_fn): ... here.
2122 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
2123 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
2124 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
2125 (init_exception_processing): Adjust.
2126 (declare_library_fn): Create and push the fns here.
2127 (do_get_exception_ptr, do_begin_catch, do_end_catch,
2128 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
2129 declare_library_fn use.
2130 (unevaluated_noexcept_spec): Adjust.
2131 * cp-gimplify.c (genericize_eh_spec_block,
2132 gimplify_most_not_throw_expr): Adjust.
2134 * name-lookup.c (pushdecl_top_level,
2135 pushdecl_top_level_and_finish): Move after namespace pushing and
2137 (push_to_top_level): Rename to ...
2138 (do_push_to_top_level): ... here. Remove timing code.
2139 (pop_from_top_level_1): Rename to ...
2140 (do_pop_from_top_level): ... here.
2141 (do_push_nested_namespace, do_pop_nested_namespace)
2142 (push_to_top_level): New wrapper for do_push_to_top_level.
2143 (pop_from_top_level): Adjust.
2144 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
2146 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
2148 * config-lang.in (gtfiles): Add c-family/c-format.c,
2149 except.c, init.c, lambda.c and friend.c.
2150 * class.c (dvirt_fn): Move out of function scope,
2152 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
2153 * init.c (fn): Likewise.
2154 * lambda.c (ptr_id, max_id): Likewise.
2155 * friend.c (global_friend): Add GTY attribute.
2157 2017-05-19 Nathan Sidwell <nathan@acm.org>
2159 * call.c (add_list_candidates): Use OVL_FIRST.
2160 (build_new_method_call_1): Likewise.
2161 * cp-tree.h (OVL_SINGLE_P): New.
2162 (TYPE_HIDDEN_P): New.
2163 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
2164 * dump.c (cp_tump_tree): Adjust overload dumping.
2165 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
2167 * method.c (lazily_declare_fn): Assert we added it.
2168 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
2170 (cp_parser_template_name): Use lkp_iterator.
2171 * pt.c (begin_template_parm_list): Fixup comment.
2172 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
2173 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
2174 (ovl_scope): Use lkp_iterator.
2176 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
2178 * parser.c (cp_parser_omp_clause_default): Handle
2179 "OMP_CLAUSE_DEFAULT_PRESENT".
2181 * parser.c (cp_parser_omp_clause_default): Avoid printing more
2182 than one syntax error message.
2184 2017-05-19 Nathan Sidwell <nathan@acm.org>
2186 * class.c (class_dump_id): Define.
2187 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
2188 * cp-objcp-common.c (cp_register_dumps): New.
2189 * cp-objcp-common.h (cp_register_dumps): Declare.
2190 (LANG_HOOKS_REGISTER_DUMPS): Override.
2191 * cp-tree.h (class_dump_id): Declare.
2193 2017-05-18 Nathan Sidwell <nathan@acm.org>
2195 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
2197 (lookup_keep): Declare.
2198 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
2199 * pt.c (tsubst_copy): Assert lookup is persistent.
2200 * semantics.c (finish_call_expr): Use lkp_iterator, call
2202 * tree.c (ovl_copy): New.
2203 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
2206 * cp-tree.h (OVL_USED): Replace with ...
2207 (OVL_USING_P): ... this.
2208 (ovl_iterator::using_p): Adjust.
2209 * name-lookup.c (push_overloaded_decl_1,
2210 do_nonmember_using_decl): Adjust.
2211 * search.c (lookup_field_r): Adjust.
2212 * tree.c (ovl_insert, ovl_scope): Adjust.
2214 * cp-tree.h (lookup_add): Swap args.
2215 (ovl_cons, build_overload): Delete.
2216 * name-lookup.c (add_function, push_overloaded_decl_1,
2217 do_nonmember_using_decl, merge_functions, remove_hidden_names):
2218 Use lookup_add, ovl_insert.
2219 * pt.c (check_explicit_specialization): Use lookup_add.
2220 (do_class_deduction): Likewise. Refactor if.
2221 * tree.c (lookup_add): Swap args.
2222 (ovl_cons, build_overload): Delete.
2224 * name-lookup.c (find_local_binding): New, broken out of ...
2225 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
2226 (set_namespace_binding): Swap scope & name args.
2227 (namespace_binding_1): Likewise.
2228 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
2229 (push_overloaded_decl_1): Likewise.
2230 (set_global_binding): Likewise.
2231 (get_namespace_binding): Adjust namespace_binding_1 call.
2233 2017-05-17 Nathan Sidwell <nathan@acm.org>
2235 * cp-tree.h (default_hash_traits <lang_identifier *>): New
2237 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
2238 (extern_c_fns): New hash table.
2239 (check_extern_c_conflict): New, broken out of ...
2240 (pushdecl_maybe_friend_1): ... here. Call it.
2241 (c_linkage_bindings): Just look in hash table.
2243 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
2247 Implement new C++ intrinsics __is_assignable and __is_constructible.
2248 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
2250 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
2251 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2252 * method.c (constructible_expr): Set cp_unevaluated.
2253 (is_xible_helper): New.
2254 (is_trivially_xible): Adjust.
2256 * parser.c (cp_parser_primary_expression): Handle
2257 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
2258 (cp_parser_trait_expr): Likewise.
2259 * semantics.c (trait_expr_value): Handle
2260 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2262 2017-05-17 Nathan Sidwell <nathan@acm.org>
2264 * cp-tree.h (ovl_iterator::using_p): New predicate.
2265 (ovl_iterator::remove_node): New worker.
2266 (ovl_insert): Declare.
2267 * tree.c (ovl_insert): New.
2268 (ovl_iterator::remove_node): New.
2269 * class.c (add_method): Use ovl_iterator, ovl_insert.
2270 (clone_function_decl): Fix description.
2271 (clone_constructors_and_destructors): Use ovl_iterator.
2273 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
2274 (maybe_warn_about_overly_private_class): Use ovl_iterator.
2275 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
2276 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
2277 (get_base_fndecls): Use ovl_iterator.
2278 (warn_hidden): Use OVL_NAME, ovl_iterator.
2279 (add_implicitly_declared_members): Use ovl_iterator.
2280 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
2282 (finish_shorthand_constraint): Simplify, use ovl_make.
2283 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
2284 * search.c (shared_member_p): Use ovl_iterator.
2285 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
2286 (lookup_conversion_operator): Use OVL_FIRST.
2287 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
2288 (look_for_overrides_here): Use ovl_iterator.
2289 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
2290 * typeck.c (build_x_unary_op): Use ovl_make.
2292 2017-05-17 Martin Liska <mliska@suse.cz>
2294 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
2295 use it instead of int type.
2296 (dump_vtable): Likewise.
2297 (dump_vtt): Likewise.
2298 * decl2.c (dump_tu): Likewise.
2300 2017-05-16 David Malcolm <dmalcolm@redhat.com>
2302 * call.c (enforce_access): Add access_failure_info * param and use
2303 it to record access failures.
2304 * cp-tree.h (class access_failure_info): New class.
2305 (enforce_access): Add access_failure_info * param, defaulting to
2307 (lookup_member): Likewise.
2308 (locate_field_accessor): New function decl.
2309 (perform_or_defer_access_check): Add access_failure_info * param,
2311 * search.c (lookup_member): Add access_failure_info * param and
2312 pass it on to call to perform_or_defer_access_check.
2313 (matches_code_and_type_p): New function.
2314 (field_access_p): New function.
2315 (direct_accessor_p): New function.
2316 (reference_accessor_p): New function.
2317 (field_accessor_p): New function.
2318 (struct locate_field_data): New struct.
2319 (dfs_locate_field_accessor_pre): New function.
2320 (locate_field_accessor): New function.
2321 * semantics.c (perform_or_defer_access_check): Add
2322 access_failure_info * param, and pass it on to call to
2324 * typeck.c (access_failure_info::record_access_failure): New method.
2325 (access_failure_info::maybe_suggest_accessor): New method.
2326 (finish_class_member_access_expr): Pass an access_failure_info
2327 instance to the lookup_member call, and call its
2328 maybe_suggest_accessor method afterwards.
2330 2017-05-16 Marek Polacek <polacek@redhat.com>
2334 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
2336 2017-05-16 Nathan Sidwell <nathan@acm.org>
2338 * name-lookup.c (check_local_shadow): New, broke out of ...
2339 (pushdecl_maybe_friend_1): ... here. Call it.
2341 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
2342 (ovl_first): Move inline definition to end of file.
2343 (ovl_make, lookup_add): Declare.
2344 (get_fns, get_first_fn): Make pure.
2345 * tree.c (ovl_cache): New.
2346 (ovl_make, lookup_add): New.
2347 * pt.c (do_class_deduction): Don't add candidates that will be
2350 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
2351 (print_error_for_call_failure): Use OVL_NAME.
2352 (build_op_call_1): Use ovl_iterator.
2353 (add_candidates): Use OVL_FIRST & lkp_iterator.
2354 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
2356 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
2357 (type_has_user_nondefault_constructor,
2358 in_class_defaulted_default_constructor,
2359 type_has_user_provided_constructor,
2360 type_has_user_provided_or_explicit_constructor,
2361 type_has_non_user_provided_default_constructor,
2362 vbase_has_user_provided_move_assign,
2363 type_has_move_constructor, type_has_move_assign,
2364 type_has_user_declared_move_constructor,
2365 type_has_user_declared_move_assign,
2366 type_build_ctor_call, type_build_dtor_call,
2367 type_requires_array_cookie, explain_non_literal_class): Likewise.
2368 (finish_struct): Use lkp_iterator.
2369 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
2370 (note_name_declared_in_class): Use OVL_NAME.
2371 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
2372 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
2373 cxx_pretty_printer::expression): Likewise.
2374 * decl2.c (check_classfn): Use ovl_iterator.
2375 * pt.c (retrieve_specialization): Use ovl_iterator.
2376 * tree.c (cp_tree_equal): Use lkp_iterator.
2377 (type_has_nontrivial_copy_init): Use ovl_iterator.
2379 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
2380 check is_overloaded_fn.
2382 2017-05-16 Martin Liska <mliska@suse.cz>
2384 * parser.c (cp_lexer_print_token): Add default value for flags
2385 argument of print_gimple_stmt, print_gimple_expr,
2386 print_generic_stmt and print_generic_expr.
2388 2017-05-16 Nathan Sidwell <nathan@acm.org>
2390 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
2392 (MAYBE_BASELINK_FUNCTIONS): New.
2393 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
2394 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
2395 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
2396 * method.c (inherited_ctor_binfo): Use ovl_iterator.
2397 (binfo_inherited_from): Likewise.
2398 * parser.c (lookup_literal_operator): Use lkp_iterator.
2399 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
2400 (print_candidates_1): Likewise.
2401 (determine_specialization): Likewise.
2402 (resolve_overloaded_unification): Likewise.
2403 (resolve_nondeduced_context): Likewise.
2404 (type_dependent_expression_p): Likewise.
2405 (dependent_template_p): Likewise.
2406 * ptree.c (cxx_print_xnode): Likewise.
2407 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
2408 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
2409 * typeck.c (check_template_keyword): Use lkp_iterator.
2411 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
2413 * constexpr.c (function_concept_check): Use OVL_FIRST.
2414 * cvt.c (build_expr_type_conversion): Likewise.
2415 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
2416 * decl2.c (mark_used): Use OVL_FIRST.
2417 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
2418 (dump_expr, location_of): Use OVL_FIRST.
2419 * friend.c (do_friend): Use OVL_NAME.
2420 * init.c (build_offset_ref): Use OVL_FIRST.
2421 * mangle.c (write_member_name): Likewise.
2422 (write_expression): Use OVL_NAME.
2423 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
2424 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
2425 * pt.c (check_explicit_specialization): Use OVL_FIRST.
2426 (check_template_shadow): Likewise.
2427 (tsubst_template_args): Use OVL_NAME.
2428 (tsubst_baselink): Use OVL_FIRST.
2429 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
2430 * tree.c (get_first_fn): Use OVL_FIRST.
2431 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
2432 (cp_build_addr_expr_1): Use OVL_FIRST.
2434 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
2436 * semantics.c (finish_id_expression): Directly init local var.
2437 (finish_omp_reduction_clause): Use really_overloaded_fn.
2438 * tree.c (get_fns): Document. Assert we got an overload.
2439 (get_first_fn) Document.
2440 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
2441 really_overloaded_fn.
2442 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
2444 * cp-tree.h (SCOPE_DEPTH): New.
2445 * name-lookup.h (is_nested_namespace): Declare.
2446 * name-lookup.c (is_nested_namespace): New.
2447 (is_ancestor): Use it.
2448 (set_decl_namespace): Likewise.
2449 (push_namespace): Set SCOPE_DEPTH.
2450 * pt.c (check_specialization_namespace): Use is_nested_namespace.
2451 (check_unqualigied_spec_or_inst): Likewise.
2453 2017-05-15 Nathan Sidwell <nathan@acm.org>
2456 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
2457 * name-lookup.h (push_namespace): Return int, add make_inline arg.
2458 * name-lookup.c (push_namespace): Deal with inline directly.
2459 Return pushed count.
2460 * parser.c (cp_parser_namespace_definition): Adjust for
2461 push_namespace change.
2463 2017-05-11 Nathan Sidwell <nathan@acm.org>
2465 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
2466 LANG_HOOKS_PUSHDECL): Move to ...
2467 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
2468 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
2469 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
2471 * name-lookup.h (pushdecl): Add default friend parm.
2472 (pushdecl_maybe_friend): Delete.
2473 (pushdecl_top_level): Add default friend parm.
2474 (pushdecl_top_level_maybe_friend): Delete.
2475 * name-lookup.c (pushdecl_maybe_friend): Delete.
2476 (pushdecl): Add is_friend parm.
2477 (pushdecl_top_level): Add is friend_parm.
2478 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
2479 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
2480 * friend.c (do_friend): Adjust.
2481 * pt.c (tsubst_friend_class): Adjust.
2483 Revert pushdecl_top_level_and_finish name change.
2484 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
2485 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
2486 * decl.c (cp_make_fname_decl): Adjust.
2487 * decl2.c (get_guard, handle_tls_init): Adjust.
2488 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
2490 * name-lookup.c (pushdecl_outermost_localscope): Always
2491 conditionally stop timer.
2493 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
2494 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
2496 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
2497 pushtag_top_level_maybe_friend,
2498 pushdecl_top_level_and_finish): Move declarations to ...
2499 * name-lookup.h: ... here. Group pushdecl variants.
2500 (pushdecl_top_level_and_finish): Rename to ...
2501 (pushdecl_top_level_with_init): ... here.
2502 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
2503 * decl2.c (get_guard, handle_tls_init): Likewise.
2504 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
2505 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
2506 * method.c (implicitly_declare_fn): Likewise.
2507 * searchc (node_debug_info_needed): Likewise.
2508 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
2509 (pushdecl_top_level_with_init): ... here.
2510 (pop_everything): Use namespace_bindings_p.
2512 * name-lookup.h (pop_binding): Rename to pop_local_binding.
2513 (getdecls): Rename to get_local_decls.
2514 * name-lookup.c (pop_binding): Rename to ...
2515 (pop_local_binding): ... here.
2516 (pop_bindings_and_leave_scope): Adjust.
2517 (getdecls): Rename to ...
2518 (get_local_decls): ... here. Assert local scope.
2519 * decl.c (poplevel): Assert not namespace. Adjust and simplify
2521 (store_parm_decls): Adjust get_local_decls call.
2522 (parser.c (synthesize_implicit_template_parm): Likewise.
2524 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
2527 * method.c (is_trivially_xible): Reject void types.
2529 2017-05-10 Nathan Sidwell <nathan@acm.org>
2531 * class.c (handle_using_decl): Always use OVL_CURRENT.
2532 (resolve_address_of_overloaded_function): Move iterator decl into
2533 for scope. Don't strip anticipated decls here.
2535 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
2537 (print_candidates): Adjust.
2539 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
2541 * call.c (build_new_function_call): Lose koenig_p arg. Remove
2542 koenig_p handling here.
2543 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
2544 (tsubst_omp_clauses): Likewise.
2545 (do_class_deduction): Adjust buld_new_function_call calls.
2546 * semantics.c (finish_call_expr): Likewise.
2548 2017-05-10 Jason Merrill <jason@redhat.com>
2550 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
2551 (unify_type_mismatch, unify_parameter_pack_mismatch)
2552 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
2553 (unify_parameter_pack_inconsistent, unify_inconsistency)
2554 (unify_vla_arg, unify_method_type_error, unify_arity)
2555 (unify_arg_conversion, unify_no_common_base)
2556 (unify_inconsistent_template_template_parameters)
2557 (unify_template_deduction_failure)
2558 (unify_template_argument_mismatch)
2559 (unify_overload_resolution_failure): Call unify_invalid.
2561 CWG 1847 - Clarifying compatibility during partial ordering
2562 * pt.c (more_specialized_fn): No order between two non-deducible
2565 * pt.c (dependent_type_p): Make sure we aren't called with
2568 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2569 * pt.c (convert_template_argument): Just return an argument pack.
2570 (coerce_template_parameter_pack, template_parm_to_arg)
2571 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
2572 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
2573 Don't set the type of a NONTYPE_ARGUMENT_PACK.
2574 * parser.c (make_char_string_pack, make_string_pack): Likewise.
2576 2017-05-10 Nathan Sidwell <nathan@acm.org>
2578 * cp-tree.h (add_method, clone_function_decl): Change last arg to
2580 * class.c (add_method): Change third arg to bool. Adjust.
2581 (one_inheriting_sig, one_inherited_ctor): Adjust.
2582 (clone_function_decl): Change 2nd arg to bool. Adjust.
2583 (clone_constructors_and_destructors): Adjust.
2584 * lambda.c (maybe_add_lambda_conv_op): Adjust.
2585 * method.c (lazily_declare_fn): Adjust.
2586 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
2587 * semantics.c (finish_member_declaration): Adjust.
2589 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
2592 * decl.c (finish_function): To improve error recovery, change the
2593 logic for calling apply_deduced_return_type.
2595 2017-05-09 Jason Merrill <jason@redhat.com>
2597 PR c++/80605 - __is_standard_layout and empty base
2598 * class.c (check_bases): Ignore empty bases.
2600 PR c++/70979 - literal class and closure types
2601 * class.c (finalize_literal_type_property): Handle closures
2603 (explain_non_literal_class): Likewise.
2605 PR c++/66297, DR 1684 - literal class and constexpr member fns
2606 * constexpr.c (is_valid_constexpr_fn): Only complain about
2607 non-literal enclosing class in C++11.
2608 * class.c (finalize_literal_type_property): Likewise.
2610 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
2613 * pt.c (tsubst_decl): Early return error_mark_node if
2614 grok_ctor_properties returns false.
2616 2017-05-09 Jason Merrill <jason@redhat.com>
2618 PR c++/70167 - array prvalue treated as lvalue
2619 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
2621 * semantics.c (finish_compound_literal): Add fcl_context parameter.
2622 Only make a static variable for C99 syntax.
2623 * parser.c (cp_parser_postfix_expression): Pass it.
2624 * pt.c (tsubst_copy_and_build): Likewise.
2625 * call.c (extend_ref_init_temps): Set
2626 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2628 2017-05-09 Nathan Sidwell <nathan@acm.org>
2630 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
2631 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
2632 * name-lookup.h (pushdecl_top_level): Declare.
2634 2017-05-08 Jason Merrill <jason@redhat.com>
2636 PR c++/80178 - parameter passing for uncopyable classes
2637 * tree.c (type_has_nontrivial_copy_init): True for classes with only
2638 deleted copy/move ctors.
2639 (remember_deleted_copy, maybe_warn_parm_abi): New.
2640 * decl.c (require_complete_types_for_parms, check_function_type):
2641 Call maybe_warn_parm_abi.
2642 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
2644 2017-05-08 Nathan Sidwell <nathan@acm.org>
2646 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
2647 (start_preparsed_function): Do decl pushing before setting
2648 current_funciton_decl and announcing it.
2650 * name-lookup.h (pushdecl_with_scope): Replace with ...
2651 (pushdecl_outermost_localscope): ... this.
2652 * name-lookup.c (pushdecl_with_scope): Replace with ...
2653 (pushdecl_outermost_localscope): ... this.
2654 (pushdecl_namespace_level): Adjust.
2655 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
2656 * lambda.c (insert_capture_proxy): Likewise.
2658 * class.c (build_vtbl_initializer): Don't shadow outer variable
2661 Revert _binding -> _value change.
2662 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
2663 (get_namespace_binding, set_global_binding): ... these.
2664 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
2665 (get_namespace_binding, set_global_binding): ... these.
2666 (arg_assoc_namespace, pushdecl_maybe_friend_1,
2667 check_for_out_of_scope_variable, push_overloaded_decl_1,
2668 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
2669 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
2670 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
2671 * decl.c (poplevel): Adjust.
2672 * pt.c (make_constrained_auto): Likewise.
2674 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
2676 PR translation/80280
2677 * call.c (print_z_candidate): Fix quoting.
2679 2017-05-05 David Malcolm <dmalcolm@redhat.com>
2681 * error.c (pedwarn_cxx98): Replace report_diagnostic
2682 with diagnostic_report_diagnostic.
2684 2017-05-05 Nathan Sidwell <nathan@acm.org>
2686 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
2687 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
2688 (IDENTIFIER_NAMESPACE_VALUE): Delete.
2689 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
2691 (get_namespace_value, set_global_value): ... these.
2692 (get_global_value_if_present, is_typename_at_global_scope): Delete.
2693 * decl.c (poplevel): Use get_namespace_value.
2694 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
2695 * class.c (build_vtbl_initializer): Stash library decl in
2696 static var. Use IDENTIFIER_GLOBAL_VALUE.
2697 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
2698 do_allocate_exception, do_free_exception, build_throw): Likewise.
2699 * init.c (throw_bad_array_new_length): Likewise.
2700 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
2701 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
2702 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
2703 get_namespace_value.
2704 (set_namespace_binding_1): Rename to
2705 (set_namespace_binding): ... here.
2706 (set_global_value): New.
2707 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
2708 get_namespace_value.
2709 * pt.c (listify): Use get_namespace_value.
2711 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
2713 * lex.c (unqualified_name_lookup_error): Likewise.
2715 * class.c (alter_class): Use retrofit_lang_decl directly.
2716 * decl.c (push_local_name, dupliate_decls): Likewise.
2717 * semantics.c (omp_privatize_field): Likewise.
2719 Kill walk_namespaces.
2720 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
2721 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
2723 Kill per-namespace static_decls.
2724 * cp-tree.h (static_decls): Declare.
2725 (wrapup_globals_for_namespace,
2726 diagnose_inline_vars_for_namespace): Replace with ...
2727 (wrapup_namespace_globals): ... this.
2728 * decl.c (static_decls): Define.
2729 (wrapup_globals_for_namespace,
2730 diagnose_inline_vars_for_namespace): Replace with ...
2731 (wrapup_namespace_globals): ... this.
2732 (cxx_init_decl_processing): Initialize static_decls.
2733 * decl2.c (c_parse_final_cleanups): Adjust.
2734 * name-lookup.h (cp_binding_level): Remove static_decls member.
2735 * name-lookup.c (add_decl_to_level): Adjust.
2736 (begin_scope): Adjust.
2738 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
2741 * decl.c (reshape_init): Unconditionally return error_mark_node
2742 upon error about too many initializers.
2744 2017-05-04 Nathan Sidwell <nathan@acm.org>
2746 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
2748 2017-05-04 Martin Sebor <msebor@redhat.com>
2750 PR translation/80280
2751 * call.c (print_z_candidate): Add missing quoting to %D and other
2753 (build_op_call_1): Same.
2754 * constraint.cc (diagnose_check_constraint): Same.
2755 * mangle.c (mangle_decl): Same.
2756 * name-lookup.c (cp_binding_level_debug): Same.
2757 (set_decl_namespace): Same.
2758 * parser.c (cp_parser_tx_qualifier_opt): Same.
2759 * pt.c (print_candidates_1): Same.
2760 (check_template_variable): Same.
2761 (tsubst_default_argument): Same.
2762 (most_specialized_partial_spec): Same.
2763 * semantics.c (omp_reduction_lookup): Same.
2764 * tree.c (check_abi_tag_redeclaration): Same.
2765 * typeck.c (comptypes): Same.
2766 * typeck2.c (abstract_virtuals_error_sfinae): Same.
2768 2017-05-04 Nathan Sidwell <nathan@acm.org>
2771 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
2772 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
2773 CPTI_INIT_LIST_IDENTIFIER.
2774 (global_namespace, global_type_node, global_identifier,
2775 anon_identifier, init_list_identifier): New.
2776 * decl.c (global_type_node, global_scope_name): Delete.
2777 (initialize_predefined_identifiers): Add new identifiers.
2778 (cxx_init_decl_processing): Adjust.
2779 * name-lookup.h (global_namespace, global_type_node): Delete.
2780 * name-lookup.c (global_namespace, anonymous_namespace_name,
2781 get_anonymous_namespace_name): Delete.
2782 (namespace_scope_ht_size, begin_scope, pushtag_1,
2783 push_namespace): Adjust,
2784 * call.c (type_has_extended_temps): Use init_list_identifier.
2785 * pt.c (listify): Likewise.
2787 * name-lookup.c: Reorder functions to make merging from modules
2790 2017-05-03 Jason Merrill <jason@redhat.com>
2792 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
2794 2017-05-03 Nathan Sidwell <nathan@acm.org>
2796 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
2797 along with #defines, to before name-lookup include.
2799 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
2801 * pt.c (is_auto_or_concept): Remove.
2802 (type_uses_auto_or_concept): Remove, unused.
2803 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
2804 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
2805 * cp-tree.h (is_auto_or_concept): Remove.
2807 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
2810 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
2811 add pedigree operation and detach call here.
2812 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
2813 cilk_cp_gimplify_call_params_in_spawned_fn.
2814 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
2815 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
2817 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
2819 * parser.c (cp_parser_member_declaration): Add fix-it hints for
2820 stray comma and missing semicolon at end of member declaration.
2822 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
2824 * parser.c (cp_parser_cast_expression): Add target type of cast to
2826 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
2828 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
2830 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
2831 return type to bool.
2832 * cp-tree.h (grok_ctor_properties): Update.
2834 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
2836 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
2837 information to diagnostic of invalid colon in nested-name-specifier.
2839 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
2841 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
2842 diagnostic of invalid class/struct keyword after enum.
2844 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2846 * parser.c (cp_parser_member_declaration): Add fix-it hint
2847 for removing stray semicolons.
2849 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2851 * name-lookup.c (get_std_name_hint): New function.
2852 (maybe_suggest_missing_header): New function.
2853 (suggest_alternative_in_explicit_scope): Call
2854 maybe_suggest_missing_header.
2856 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2859 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
2860 candidate type of bm from tree to const char *.
2861 (consider_binding_level): Likewise.
2862 (lookup_name_fuzzy): Likewise, using this to merge the best
2863 result from the preprocessor into bm, rather than immediately
2864 returning, so that better matches from reserved words can "win".
2865 Guard the rejection of keywords that don't start decl-specifiers
2866 so it only happens for FUZZY_LOOKUP_TYPENAME.
2868 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
2870 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
2871 (start_enum): Likewise.
2872 (build_enumerator): Likewise. Use %qE instead of plain %E.
2873 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
2874 %<%D%> in diagnostics.
2875 (cp_parser_elaborated_type_specifier): Likewise.
2876 * pt.c (make_pack_expansion): Use %qT and %qE instead of
2877 %<%T%> and %<%E%> in diagnostics.
2878 (tsubst_pack_expansion): Likewise.
2880 2017-04-24 David Malcolm <dmalcolm@redhat.com>
2883 * parser.c (cp_parser_unary_expression): Generate a location
2884 range for alignof and sizeof expressions.
2886 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
2888 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
2890 (cp_parser_virt_specifier_seq_opt): Likewise.
2891 (set_and_check_decl_spec_loc): Likewise twice.
2893 2017-04-21 Jason Merrill <jason@redhat.com>
2895 PR c++/80179 - ICE with initialized flexible array member.
2896 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
2898 2017-04-21 Richard Biener <rguenther@suse.de>
2900 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
2901 (copy_type): Likewise.
2902 * lex.c (copy_decl): Pass down mem-stat info.
2903 (copy_type): Likewise.
2905 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
2908 * init.c (build_new_1): Suppress notes about over-aligned new when
2909 the warning is suppressed.
2911 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
2913 * parser.c (cp_parser_member_declaration): Add warning with fixit
2914 information for extra semicolon after in-class function definition.
2916 2017-04-20 Jakub Jelinek <jakub@redhat.com>
2919 * tree.c (build_cplus_array_type): Call build_array_type
2920 with the intended TYPE_TYPELESS_STORAGE flag value, instead
2921 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
2924 2017-04-18 Marek Polacek <polacek@redhat.com>
2926 PR c++/80244 - ICE with attribute in template alias.
2927 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
2929 PR c++/80241 - ICE with alignas pack expansion.
2930 * error.c (dump_expr): Handle TREE_LIST.
2931 * parser.c (cp_parser_std_attribute_list): Return error_mark if
2932 make_pack_expansion returns an error.
2934 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
2937 * class.c (fixup_may_alias): Fix all type variants.
2939 2017-04-17 Jason Merrill <jason@redhat.com>
2941 PR c++/80415 - wrong error with default arg and array reference.
2942 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
2944 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
2946 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
2948 * decl.c (name_unnamed_type): Split out of...
2949 (grokdeclarator): ... this.
2950 * decl.h (name_unnamed_type): Declare.
2952 2017-04-12 Richard Biener <rguenther@suse.de>
2953 Bernd Edlinger <bernd.edlinger@hotmail.de>
2956 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
2957 for arrays of character or std::byte type.
2959 2017-04-11 Jason Merrill <jason@redhat.com>
2961 PR c++/80294 - ICE with constexpr and inheritance.
2962 * constexpr.c (reduced_constant_expression_p):
2963 A null constructor element is non-constant.
2964 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
2965 returning an empty base.
2967 2017-04-11 Jakub Jelinek <jakub@redhat.com>
2970 * decl.c (cp_finish_decomp): If processing_template_decl on
2971 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
2972 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
2973 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
2975 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
2976 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
2979 2017-04-11 Jakub Jelinek <jakub@redhat.com>
2982 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
2984 2017-04-10 Jakub Jelinek <jakub@redhat.com>
2987 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
2988 operand, if it is a static member function, recurse on the
2991 2017-04-10 Marek Polacek <polacek@redhat.com>
2994 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
2995 ORIG_TYPE earlier and not only when shortening.
2997 2017-04-07 Jason Merrill <jason@redhat.com>
2999 PR c++/80356 - ICE with reference to function template argument.
3001 * pt.c (convert_nontype_argument_function): Adjust type even with a
3002 value-dependent argument.
3004 PR c++/80267 - ICE with nested capture of reference
3006 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
3008 2017-04-07 Marek Polacek <polacek@redhat.com>
3011 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
3014 * call.c (build_over_call): Don't check cxx_dialect.
3015 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
3016 whether SUB is a CONSTRUCTOR.
3017 * init.c (build_new_1): Don't check cxx_dialect.
3018 * tree.c (replace_placeholders): Add a function comment. Return if
3019 not in C++14, or if the object isn't a (member of a) class.
3020 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
3021 TYPE is CLASS_TYPE_P.
3023 2017-04-05 Jakub Jelinek <jakub@redhat.com>
3026 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
3027 of a loop doing vec_safe_push of NULL. Formatting fixes.
3028 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
3029 to newidx before calling canonical_type_parameter on newtype.
3031 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
3034 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
3035 UNARY_PLUS_EXPR case.
3037 2017-04-03 Jason Merrill <jason@redhat.com>
3039 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
3041 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
3043 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
3044 * decl2.c (one_static_initialization_or_destruction): Likewise.
3045 * name-lookup.c (store_bindings): Likewise.
3046 * parser.c (make_call_declarator): Likewise.
3047 * pt.c (check_explicit_specialization): Likewise.
3049 2017-04-03 Jason Merrill <jason@redhat.com>
3051 PR sanitizer/79993 - ICE with VLA initialization from string
3052 PR c++/69487 - wrong VLA initialization from string
3053 * init.c (finish_length_check): Split out from build_vec_init.
3054 (build_vec_init): Handle STRING_CST.
3055 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
3056 (digest_init_r): Don't give a STRING_CST VLA type.
3058 2017-03-31 Jakub Jelinek <jakub@redhat.com>
3061 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
3062 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
3063 for NOP_EXPR to REFERENCE_TYPE.
3066 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
3067 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3069 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
3070 Remove extraneous parens.
3071 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
3072 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
3073 (cp_parser_trait_expr): Likewise.
3075 2017-03-27 Jakub Jelinek <jakub@redhat.com>
3078 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
3079 * typeck.c (cxx_mark_addressable): Likewise. Look through
3080 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
3082 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
3084 2017-03-24 Jason Merrill <jason@redhat.com>
3086 PR c++/77339 - ICE with invalid use of alias template.
3087 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
3090 2017-03-24 Marek Polacek <polacek@redhat.com>
3093 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
3094 doesn't have side effects.
3096 2017-03-23 Jason Merrill <jason@redhat.com>
3098 PR c++/80150 - ICE with overloaded variadic deduction.
3099 * pt.c (try_one_overload): Remove asserts.
3101 PR c++/77563 - missing ambiguous conversion error.
3102 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
3104 2017-03-23 Marek Polacek <polacek@redhat.com>
3106 * cp-tree.h: Remove a C_RID_YYCODE reference.
3108 2017-03-22 Jakub Jelinek <jakub@redhat.com>
3111 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
3112 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
3113 processing_template_decl.
3115 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
3118 * name-lookup.c (pushtag_1): Add check for bogus, non template,
3119 std::initializer_list.
3121 2017-03-21 Jakub Jelinek <jakub@redhat.com>
3124 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
3126 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
3129 * init.c (std_placement_new_fn_p): New.
3130 (build_new_1): Call it.
3132 2017-03-20 Jason Merrill <jason@redhat.com>
3134 PR c++/80096 - ICE with C++17 non-type auto.
3135 * pt.c (tsubst): Delay tsubst of type of template non-type
3138 PR c++/79519 - ICE with deleted template friend.
3139 * decl.c (grokdeclarator): Complain about misplaced function
3140 definition using =, as well.
3142 PR c++/79640 - infinite recursion with generic lambda.
3143 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
3144 before substituting its initializer.
3146 2017-03-20 Marek Polacek <polacek@redhat.com>
3147 Paolo Carlini <paolo.carlini@oracle.com>
3149 PR c++/80059 - ICE with noexcept and __transaction_atomic
3150 * except.c (build_must_not_throw_expr): Call
3151 instantiate_non_dependent_expr.
3153 2017-03-19 Jason Merrill <jason@redhat.com>
3155 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
3156 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
3157 reference decomposition.
3159 PR c++/80077 - error with constexpr and -fno-elide-constructors.
3160 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
3161 expanding trivial constructor.
3163 2017-03-17 Jason Merrill <jason@redhat.com>
3165 PR c++/78345 - ICE initializing array from lambda.
3166 * init.c (build_aggr_init): Check array initializer.
3167 (build_vec_init): Check the type of a CONSTRUCTOR.
3169 PR c++/80073 - C++17 ICE with virtual base.
3170 * decl.c (xref_basetypes): Also check for indirect vbases.
3172 2017-03-16 Jason Merrill <jason@redhat.com>
3174 * decl.c (start_enum): std::byte aliases anything.
3177 * constexpr.c (lookup_placeholder): Tweak.
3179 2017-03-15 Jason Merrill <jason@redhat.com>
3181 PR c++/80043 - ICE with -fpermissive
3182 * typeck.c (convert_for_assignment): Handle instantiate_type
3183 not giving an error.
3185 2017-03-14 Nathan Sidwell <nathan@acm.org>
3187 PR c++/79393 DR 1658 workaround
3188 * method.c (synthesized_method_base_walk): Inihibit abstract class
3189 virtual base access check here.
3190 (synthesized_method_walk): Not here.
3192 2017-03-13 Nathan Sidwell <nathan@acm.org>
3194 PR c++/79393 DR 1658 workaround
3195 * method.c (synthesized_method_walk): Check vbases of abstract
3196 classes for dtor walk.
3198 2017-03-10 David Malcolm <dmalcolm@redhat.com>
3200 PR translation/79848
3201 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
3203 2017-03-10 Jason Merrill <jason@redhat.com>
3205 PR c++/79960 - alias templates and partial ordering
3206 * pt.c (comp_template_args): Add partial_order parm.
3207 (template_args_equal): Likewise.
3208 (comp_template_args_porder): New.
3209 (get_partial_spec_bindings): Use it.
3211 2017-03-10 Marek Polacek <polacek@redhat.com>
3214 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
3216 2017-03-10 Jakub Jelinek <jakub@redhat.com>
3219 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
3220 Use XALLOCAVEC macro.
3223 * decl.c (finish_enum_value_list): If value is error_mark_node,
3224 don't copy it and change its type.
3225 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
3226 of CONST_DECL is error_mark_node.
3228 2017-03-09 Marek Polacek <polacek@redhat.com>
3230 PR c++/79900 - ICE in strip_typedefs
3231 * tree.c (strip_typedefs): Skip the attribute handling if T is
3232 a variant type which hasn't been updated yet.
3234 PR c++/79687 - wrong code with pointer-to-member
3235 * init.c (constant_value_1): Break if the variable has a dynamic
3238 2017-03-08 Jason Merrill <jason@redhat.com>
3240 PR c++/79797 - ICE with self-reference in array DMI.
3241 * constexpr.c (lookup_placeholder): Split out...
3242 (cxx_eval_constant_expression): ...from here.
3244 2017-03-07 Jakub Jelinek <jakub@redhat.com>
3247 * parser.c (cp_parser_omp_cancellation_point,
3248 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
3249 cp_parser_omp_target_update): Change "may only be used in compound
3250 statements" diagnostics, such that the same translatable string is
3251 used for all pragmas.
3252 (cp_parser_pragma): Likewise. Use error_at instead of
3253 cp_parser_error for that diagnostics.
3255 2017-03-06 Marek Polacek <polacek@redhat.com>
3257 PR c++/79796 - ICE with NSDMI and this pointer
3258 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
3259 replace_placeholders.
3261 2017-03-06 Jakub Jelinek <jakub@redhat.com>
3264 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
3267 2017-03-06 Jason Merrill <jason@redhat.com>
3269 Revert "Allow deduction guides to look into primary template."
3270 * cp-tree.h, parser.c, pt.c, search.c: Revert.
3272 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
3275 * except.c (build_must_not_throw_expr): Perform the implicit
3276 conversions on the condition.
3278 2017-03-03 Jason Merrill <jason@redhat.com>
3280 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
3283 Core issues 2273 and 2277
3284 * call.c (joust): Adjust using-declaration tiebreaker to handle
3285 the intermediate base case.
3286 * method.c (strip_inheriting_ctors): Just return the argument if
3287 !flag_new_inheriting_ctors.
3289 2017-03-03 Richard Biener <rguenther@suse.de>
3292 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
3294 2017-03-03 Marek Polacek <polacek@redhat.com>
3297 * typeck.c (string_conv_p): In C++11, always call pedwarn with
3300 2017-03-02 Jason Merrill <jason@redhat.com>
3302 Update overload resolution with deduction guides.
3303 * pt.c (do_class_deduction): Always build the copy guide.
3304 (copy_guide_p, template_guide_p): New.
3305 (build_deduction_guide): Remember the original constructor.
3306 * call.c (joust): Prefer the copy guide and non-template guides.
3308 Allow deduction guides to look into primary template.
3309 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
3310 (struct cp_decl_specifier_seq): Add constructor_p.
3311 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
3312 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
3313 Clear deduction_guide_type. Don't handle deduction guide names.
3314 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
3315 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
3316 (cp_parser_member_declaration, cp_parser_cache_defarg)
3317 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
3318 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
3319 (build_deduction_guide): Set deduction_guide_type.
3320 (dependent_scope_p): Check deduction_guide_type.
3321 * search.c (lookup_member): Likewise.
3323 2017-03-02 Jakub Jelinek <jakub@redhat.com>
3326 * init.c (mark_exp_read_r): New function.
3327 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
3328 whole arguments instead of plain mark_exp_read on TREE_LIST values.
3330 2017-03-01 Jason Merrill <jason@redhat.com>
3332 Class template argument deduction in new-expression
3333 * init.c (build_new): Handle deduction from no initializer.
3334 * parser.c (cp_parser_new_expression): Don't require a single
3335 expression for class template deduction.
3336 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
3337 class template placeholder.
3338 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
3339 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
3340 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
3342 2017-03-01 Jakub Jelinek <jakub@redhat.com>
3345 * init.c (emit_mem_initializers): When not constructing vbases of
3346 abstract classes, mark arguments as read for
3347 -Wunused-but-set-parameter.
3349 2017-02-28 Jason Merrill <jason@redhat.com>
3351 Class template argument deduction refinements
3352 * call.c (joust): Move deduction guide tiebreaker down.
3353 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
3354 deduction with no initializer.
3355 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
3356 (do_class_deduction): Use that rather than special case.
3357 (do_auto_deduction): Handle null initializer.
3359 2017-02-28 Jakub Jelinek <jakub@redhat.com>
3361 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
3362 instead of just cond ? "..." : "...".
3363 (grokdeclarator): Likewise.
3364 (build_enumerator): Likewise.
3365 * init.c (build_new_1): Likewise.
3366 * call.c (build_new_method_call_1): Likewise.
3367 * parser.c: Include intl.h.
3368 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
3369 "enter"/"exit" keyword.
3370 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
3373 2017-02-27 Jason Merrill <jason@redhat.com>
3375 PR c++/71568 - SFINAE forming pointer to member function
3376 * init.c (build_offset_ref): Check the return value of
3377 perform_or_defer_access_check.
3379 2017-02-27 Marek Polacek <polacek@redhat.com>
3381 * decl.c (expand_static_init): Add missing } in a comment.
3383 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
3385 * init.c: Include intl.h.
3386 (build_new_1): Move message strings into pedwarn to make them
3387 -Wformat-security friendly. Mark string for translation.
3388 * pt.c (tsubst_copy_and_build): Mark string for translation.
3389 Make the pointer const.
3390 * semantics.c (finish_id_expression): Mark strings for translation.
3392 2017-02-25 Jakub Jelinek <jakub@redhat.com>
3394 * call.c (build_op_delete_call): Make msg1 and msg2 const.
3396 2017-02-24 Jakub Jelinek <jakub@redhat.com>
3399 * call.c (build_over_call): Call check_function_arguments even for
3400 -Wrestrict, adjust check_function_arguments caller.
3401 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
3403 * typeck.c (cp_build_function_call_vec): Adjust
3404 check_function_arguments caller.
3406 2017-02-24 Marek Polacek <polacek@redhat.com>
3408 PR translation/79705
3409 * decl.c (check_redeclaration_exception_specification): Mark a string
3410 for translation. Make the pointer const.
3412 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
3415 * pt.c (register_specialization): Check duplicate_decls return value
3416 for error_mark_node and pass it back.
3418 2017-02-22 Jason Merrill <jason@redhat.com>
3420 PR c++/79679 - missing destructor for argument
3421 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
3424 * pt.c (do_class_deduction): Handle 0 argument case.
3426 2017-02-22 Jakub Jelinek <jakub@redhat.com>
3429 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
3430 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
3431 * constexpr.c (potential_constant_expression_1): Handle
3432 OMP_*, OACC_* and CILK_* trees. Use error_at with
3433 EXPR_LOC_OR_LOC (t, input_location) computed early
3434 instead of error, or error_at with location_of (t).
3436 2017-02-22 Marek Polacek <polacek@redhat.com>
3439 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
3440 if the alignas expression is erroneous.
3441 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
3445 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
3447 2017-02-21 Jason Merrill <jason@redhat.com>
3449 PR c++/50308 - wrong deprecated warning with ADL
3450 PR c++/17729 - duplicate deprecated warning
3451 * semantics.c (finish_id_expression): Only call mark_used on a
3452 function if we aren't building a call.
3454 PR c++/41727 - ICE with partial spec of partial instantiation
3455 * pt.c (process_partial_specialization): For now, don't check more
3456 specialized if there is more than one level of args.
3458 2017-02-21 Marek Polacek <polacek@redhat.com>
3461 * cp-tree.h (maybe_reject_flexarray_init): Declare.
3462 * init.c (maybe_reject_flexarray_init): No longer static.
3463 Add check for current_function_decl.
3464 * parser.c (cp_parser_late_parse_one_default_arg): Reject
3465 a default mem-initializer for a flexible array.
3467 2017-02-21 Jakub Jelinek <jakub@redhat.com>
3468 Paolo Carlini <paolo.carlini@oracle.com>
3471 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
3473 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
3474 decl after the decomposition artificial decl has error_mark_node.
3475 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
3476 instead of just == error_mark_node comparison.
3478 2017-02-21 Jakub Jelinek <jakub@redhat.com>
3481 * decl.c: Include gimplify.h.
3482 (cp_finish_decomp): Make sure there is no sharing of trees
3483 in between DECL_VALUE_EXPR of decomposition decls.
3486 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
3489 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
3490 call cplus_expand_constant on it first.
3492 2017-02-19 Jason Merrill <jason@redhat.com>
3494 PR c++/78139 - destructor needed by new-expression
3495 * call.c (build_special_member_call): Use tf_no_cleanup.
3497 PR c++/78282 - auto template and pack expansion
3498 * pt.c (find_parameter_packs_r): Don't walk into the type of
3499 templates other than template template-parameters.
3501 PR c++/79606 - ICE with this->base_member in NSDMI
3502 * class.c (build_base_path): Check processing_template_decl.
3504 PR c++/79607 - ICE with T{} initializer
3505 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
3507 PR c++/79566 - elaborated-type-specifier in range for
3508 * parser.c (cp_parser_simple_declaration): Fix check for type
3511 PR c++/79400 - confusing suggestion of 'noexcept'
3512 * parser.c (cp_parser_exception_specification_opt): Remove
3513 suggestion for deprecated dynamic exception-specification.
3515 PR c++/79470 - partial ordering with reference parameters
3516 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
3518 PR c++/79500 - ICE with non-template deduction guide
3519 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
3520 DECL_TEMPLATE_RESULT.
3522 PR c++/79580 - ICE with compound literal
3523 * parser.c (cp_parser_class_head): If we're in the middle of an
3524 expression, use ts_within_enclosing_non_class.
3526 PR c++/79503 - inherited ctor taking base class
3527 * call.c (add_function_candidate): Also check that
3528 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
3530 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
3533 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
3536 2017-02-19 Eric Fiselier <eric@efcs.ca>
3537 Jonathan Wakely <jwakely@redhat.com>
3540 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
3541 control warning about literal suffix identifiers without a leading
3544 2017-02-17 Jason Merrill <jason@redhat.com>
3546 PR c++/79508 - lookup error with member template
3547 * parser.c (cp_parser_template_name): Clear
3548 parser->context->object_type if we aren't doing lookup.
3550 PR c++/78690 - ICE with using and global type with same name
3551 * pt.c (type_dependent_object_expression_p): True for
3554 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3555 * pt.c (convert_template_argument): Just return an auto arg pack.
3556 (tsubst_template_args): Don't tsubst an auto pack type.
3558 PR c++/79556 - C++17 ICE with non-type auto
3559 * pt.c (do_auto_deduction): Don't try to deduce from null type.
3561 PR c++/79533 - C++17 ICE with temporary cast to reference
3562 * call.c (build_over_call): Conversion to a reference prevents copy
3565 2017-02-16 Jakub Jelinek <jakub@redhat.com>
3566 Jason Merrill <jason@redhat.com>
3568 PR c++/79502 - lost nodiscard attribute
3569 * pt.c (apply_late_template_attributes): Do apply non-dependent
3570 attributes to types.
3572 2017-02-16 Jason Merrill <jason@redhat.com>
3574 PR c++/78572 - ICE with self-modifying array initializer
3575 * constexpr.c (cxx_eval_store_expression): The object we're
3576 initializing is outside the constant-expression.
3577 (cxx_eval_call_expression): Set ctx->call.
3579 PR c++/79050 - ICE with undeduced auto and LTO
3580 * decl.c (poplevel): Remove undeduced auto decls.
3582 2017-02-16 Jakub Jelinek <jakub@redhat.com>
3585 * parser.c (cp_parser_omp_target): For -fopenmp-simd
3586 ignore #pragma omp target even when not followed by identifier.
3588 2017-02-15 Jason Merrill <jason@redhat.com>
3589 Jakub Jelinek <jakub@redhat.com>
3591 PR c++/79464 - ICE in IPA with omitted constructor parms
3592 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
3593 (adjust_clone_args): Adjust.
3594 (add_method): Remember omitted parms.
3595 * call.c (add_function_candidate): Likewise.
3596 * mangle.c (write_method_parms): Likewise.
3597 * method.c (ctor_omit_inherited_parms): Return false if there are no
3600 2017-02-15 Martin Sebor <msebor@redhat.com>
3603 * init.c (maybe_reject_flexarray_init): New function.
3604 (perform_member_init): Call it.
3606 2017-02-15 Jakub Jelinek <jakub@redhat.com>
3609 * parser.c (cp_parser_std_attribute): Don't pedwarn about
3610 [[deprecated]] with -std=c++11 and [[fallthrough]] with
3611 -std=c++11 and -std=c++14.
3614 * decl.c (grokdeclarator): For static data members, handle thread_p
3615 only after handling inline.
3617 2017-02-14 Marek Polacek <polacek@redhat.com>
3621 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
3622 clobbering if the postfix expression isn't an EXPR_P.
3624 2017-02-13 Jason Merrill <jason@redhat.com>
3626 PR c++/79461 - ICE with lambda in constexpr constructor
3627 * constexpr.c (build_data_member_initialization): Ignore
3628 initialization of a local variable.
3630 2017-02-13 Jakub Jelinek <jakub@redhat.com>
3632 * init.c (warn_placement_new_too_small): Add missing space in
3634 * parser.c (cp_parser_oacc_declare): Likewise.
3635 * mangle.c (maybe_check_abi_tags): Likewise.
3638 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
3639 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
3640 in the rightmost operand.
3642 2017-02-13 Nathan Sidwell <nathan@acm.org>
3644 PR c++/79296 - ICE mangling localized template instantiation
3645 * decl2.c (determine_visibility): Use template fn context for
3646 local class instantiations.
3648 2017-02-11 Jason Merrill <jason@redhat.com>
3650 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
3651 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
3652 (build_new_1): Use replace_placeholders.
3653 * tree.c (replace_placeholders_t): Also track whether we've seen a
3655 (replace_placeholders, replace_placeholders_r): Adjust.
3656 * cp-tree.h: Adjust.
3658 PR c++/77790 - ICE with auto function in C++11 mode
3659 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
3660 (require_deduced_type): Add complain parm, return bool.
3661 * cp-tree.h: Adjust.
3662 * decl2.c (mark_used): Use require_deduced_type.
3664 2017-02-10 Jason Merrill <jason@redhat.com>
3666 PR c++/78908 - template ops and bitfields
3667 * tree.c (build_min_non_dep): Use unlowered_expr_type.
3669 PR c++/78897 - constexpr union
3670 * constexpr.c (cxx_eval_store_expression): A store to a union member
3671 erases a previous store to another member.
3673 PR c++/71285 - member of fold-expression
3674 * semantics.c (finish_unary_fold_expr)
3675 (finish_binary_fold_expr): Use null type for fold-expressions.
3677 PR c++/79401 - protected inherited constructor
3678 * call.c (enforce_access): For inheriting constructor, find a base
3679 binfo in the path we already have.
3681 2017-02-10 Marek Polacek <polacek@redhat.com>
3684 * pt.c (type_dependent_expression_p): Check if the expression type
3688 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
3689 if warnings shouldn't be given.
3691 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
3694 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
3695 an error_mark_node as type.
3697 2017-02-09 Jakub Jelinek <jakub@redhat.com>
3698 Jason Merrill <jason@redhat.com>
3701 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
3702 from pattern to type.
3704 2017-02-09 Jason Merrill <jason@redhat.com>
3706 PR c++/79316 - default argument in deduction guide
3707 PR c++/79350 - explicit deduction guide
3708 * parser.c (cp_parser_constructor_declarator_p)
3709 (cp_parser_direct_declarator): Parse deduction guides more like
3711 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
3712 * tree.c (special_function_p): Return it.
3713 * decl.c (check_special_function_return_type): Handle it.
3714 (grokdeclarator, grokfndecl): Adjust.
3715 (cp_finish_decl): Pass flags to do_auto_deduction.
3716 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
3717 * pt.c (dguide_name_p): Take a const_tree.
3718 (do_class_deduction): Handle explicit.
3719 (do_auto_deduction): Pass flags through.
3720 (build_deduction_guide): Copy explicit flag.
3722 2017-02-09 Jakub Jelinek <jakub@redhat.com>
3725 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
3726 non-pragma_compound context here.
3727 (cp_parser_omp_target): Likewise.
3728 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
3729 parsing for ordered and target omp pragmas in non-pragma_stmt
3730 non-pragma_compound contexts.
3733 * parser.c (cp_parser_oacc_declare): Formatting fix.
3734 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
3735 automatic variables.
3737 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
3738 Chung-Lin Tang <cltang@codesourcery.com>
3740 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
3741 parsing. Parse constant expression. Remove semantic checking.
3742 (cp_parser_omp_clause_collapse): Disallow tile.
3743 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
3744 error about missing for after already emitting one. Use more
3745 conventional for idiom for unbounded loop.
3746 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
3747 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
3748 (finish_omp_for): Deal with tile clause.
3750 2017-02-07 Nathan Sidwell <nathan@acm.org>
3752 * method.c (synthesized_method_base_walk): New. Broken out of ...
3753 (synthesized_method_walk): ... here. Call it. Cleanup
3756 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
3759 * typeck2.c (process_init_constructor_union): Consider only
3760 FIELD_DECLs when looking for an NSDMI.
3762 2017-02-06 Jason Merrill <jason@redhat.com>
3764 PR c++/71193 - incomplete types in templates
3765 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
3766 handle incomplete type by pedwarning and then treating as dependent.
3768 2017-02-06 Jakub Jelinek <jakub@redhat.com>
3771 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
3772 (potential_constant_expression_1): Likewise.
3775 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
3776 allow one fewer than expected arguments if flag_permissive.
3779 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
3780 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
3781 with error_mark_node type.
3783 2017-02-03 Jason Merrill <jason@redhat.com>
3785 PR c++/78689 - ICE on constructor with label
3786 * optimize.c (maybe_clone_body): Replace omitted parameters with
3788 * class.c (build_clone): Fix logic for omitting inherited parms.
3790 PR c++/12245 - excessive memory use
3791 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
3792 back in. Don't cache constants.
3793 (maybe_constant_init): Don't cache constants.
3795 PR c++/79294 - ICE with invalid template argument
3796 * pt.c (convert_nontype_argument_function): Check value-dependence.
3797 (convert_nontype_argument): Don't check it here for function ptrs.
3799 2017-02-02 Richard Biener <rguenther@suse.de>
3802 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
3803 it lazily on the first changed element only and copy it
3804 fully upfront, only storing changed elements.
3806 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
3809 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
3812 2017-01-31 Jakub Jelinek <jakub@redhat.com>
3815 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
3818 2017-01-31 David Malcolm <dmalcolm@redhat.com>
3821 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
3822 any namespace aliases.
3824 2017-01-31 Nathan Sidwell <nathan@acm.org>
3827 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
3831 * pt.c: (instantiate_decl): Push to top level when current
3832 function scope doesn't match. Only push lmabda scope stack when
3835 * cp-tree.h (instantiate_decl): Make defer_ok bool.
3836 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
3837 (instantiate_decl): Simplify and reorder state saving and restoration.
3840 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
3841 * semantics.c (finish_member_declaration): Assert class is being
3844 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
3846 Introduce C++ support in libcc1.
3847 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
3848 (ansi_opname): Rename to...
3849 (cp_operator_id): ... this. Adjust all callers.
3850 (ansi_assopname): Rename to...
3851 (cp_assignment_operator_id): ... this. Adjust all callers.
3852 (cp_literal_operator_id): Declare.
3853 (set_global_friend): Declare.
3854 (is_global_friend): Declare.
3855 (enum cp_oracle_request): New type.
3856 (cp_binding_oracle_function): New type.
3857 (cp_binding_oracle): Declare.
3858 (cp_finish_injected_record_type): Declare.
3859 * friend.c (global_friend): New var.
3860 (set_global_friend): New fn.
3861 (is_global_friend): New fn.
3862 (is_friend): Call is_global_friend.
3863 * name-lookup.c (cp_binding_oracle): New var.
3864 (query_oracle): New fn.
3865 (qualified_lookup_using_namespace): Call query_oracle.
3866 (lookup_name_real_1): Likewise.
3867 * parser.c (cp_literal_operator_id): Drop static.
3868 * search.c (friend_accessible_p): Call is_global_friend.
3869 * semantics.c (is_this_parameter): Accept a variable if the
3870 binding oracle is enabled.
3872 2017-01-27 Jason Merrill <jason@redhat.com>
3874 PR c++/78771 - ICE with inherited constructor.
3875 * call.c (build_over_call): Call deduce_inheriting_ctor here.
3876 * pt.c (tsubst_decl): Not here.
3877 * class.c (add_method): Or here.
3878 * method.c (deduce_inheriting_ctor): Handle clones.
3879 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
3881 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
3884 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
3886 * cp/cp-tree.h: Declare it.
3887 * cp/semantics.c (finish_id_expression): Resolve names within a default
3888 capturing generic lambda defined within a template prior to
3889 instantiation to allow for captures to be added to the closure type.
3891 2017-01-26 Jakub Jelinek <jakub@redhat.com>
3894 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
3895 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
3896 * parser.c (cp_parser_builtin_offsetof): Pass result of
3897 build_static_cast of null_pointer_node to finish_offsetof.
3898 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
3899 it for -Winvalid-offsetof pedwarn instead of trying to guess
3900 original offsetof type from EXPR. Save OBJECT_PTR as a new
3901 second operand to OFFSETOF_EXPR.
3902 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
3903 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
3906 2017-01-26 Jason Merrill <jason@redhat.com>
3908 * name-lookup.c (parse_using_directive): Deprecate strong using.
3910 PR c++/79176 - lambda ICE with -flto -Os
3911 * decl2.c (vague_linkage_p): Handle decloned 'tors.
3912 * tree.c (decl_linkage): Likewise.
3914 2017-01-25 Martin Sebor <msebor@redhat.com>
3916 * decl.c (grokdeclarator): Fix a typo in a comment.
3918 2017-01-25 Jakub Jelinek <jakub@redhat.com>
3921 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
3925 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
3926 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
3928 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
3931 * decl.c (cxx_init_decl_processing): Pass main_input_filename
3932 to build_translation_unit_decl.
3934 2017-01-24 Jakub Jelinek <jakub@redhat.com>
3937 * cp-gimplify.c (cp_genericize_r): Add result of
3938 convert_from_reference on invisiref parm to p_set.
3940 2017-01-24 Nathan Sidwell <nathan@acm.org>
3942 PR c++/78469 - defaulted ctor and inaccessible dtor
3943 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
3944 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
3945 * tree.c (build_target_expr): Check tf_no_cleanup.
3947 PR c++/79118 - anon-members and constexpr
3948 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
3949 ctor decl. Recursively check anonymous members.
3950 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
3952 (explain_invalid_constexpr_fn): Likewise.
3954 2017-01-23 Nathan Sidwell <nathan@acm.org>
3956 PR c++/71710 - template using directive of field
3957 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
3960 PR c++/71406 - ICE with scope-ref'd template id exprs
3962 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
3963 before breaking up TEMPLATE_ID_EXPR.
3965 2017-01-20 Nathan Sidwell <nathan@acm.org>
3967 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
3968 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
3970 2017-01-20 David Malcolm <dmalcolm@redhat.com>
3974 * cp-tree.h (suggest_alternatives_for): Add bool param.
3975 (suggest_alternative_in_explicit_scope): New decl.
3976 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
3977 that isn't the global one, call new function
3978 suggest_alternative_in_explicit_scope, only calling
3979 suggest_alternatives_for if it fails, and disabling near match
3980 searches fort that case. When SCOPE is the global namespace,
3981 pass true for new param to suggest_alternatives_for to allow for
3983 * lex.c (unqualified_name_lookup_error): Pass true for new param
3984 to suggest_alternatives_for.
3985 * name-lookup.c (consider_binding_level): Add forward decl.
3986 (suggest_alternatives_for): Add "suggest_misspellings" param,
3987 using it to conditionalize the fuzzy name-lookup code.
3988 (suggest_alternative_in_explicit_scope): New function.
3989 * parser.c (cp_parser_primary_expression): When calling
3990 finish_id_expression, pass location of id_expression rather
3991 than that of id_expr_token.
3992 (cp_parser_id_expression): Convert local "unqualified_id" from
3993 tree to cp_expr to avoid implicitly dropping location information.
3995 2017-01-20 Marek Polacek <polacek@redhat.com>
3998 * call.c (build_conditional_expr_1): Warn about duplicated branches.
3999 * semantics.c (finish_expr_stmt): Build statement using the proper
4002 2017-01-19 Jason Merrill <jason@redhat.com>
4004 US 20 - forwarding references and class template argument deduction
4005 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
4006 * pt.c (push_template_decl_real): Set it.
4007 (maybe_adjust_types_for_deduction): Check it.
4008 (rewrite_template_parm): Copy it.
4010 US 19 - deduction guides and constructors
4011 * call.c (joust): Prefer deduction guides to constructors.
4012 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
4013 (deduction_guide_p): Check DECL_P.
4015 * decl.c (check_initializer): Always use build_aggr_init for array
4018 PR c++/79130 - decomposition and direct-initialization
4019 * init.c (build_aggr_init): Communicate direct-initialization to
4021 (build_vec_init): Check for array copy sooner.
4022 * parser.c (cp_parser_decomposition_declaration): Remove call to
4023 build_x_compound_expr_from_list.
4025 2017-01-18 Jason Merrill <jason@redhat.com>
4027 PR c++/68666 - member variable template-id
4028 * typeck.c (finish_class_member_access_expr): Handle variable
4030 * pt.c (lookup_and_finish_template_variable): No longer static.
4031 * cp-tree.h: Declare it.
4033 2017-01-18 Nathan Sidwell <nathan@acm.org>
4036 * call.c (build_over_call): When checking ellipsis conversions for
4037 an inherited ctor, make sure there is at least one conversion.
4039 2017-01-18 Jason Merrill <jason@redhat.com>
4041 PR c++/78894 - ICE with class deduction and default arg
4042 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
4044 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4047 * mangle.c (write_discriminator): Reorganize abi warning check.
4049 2017-01-18 Nathan Sidwell <nathan@acm.org>
4051 * cp-tree.h: Clarify exception spec node comment.
4052 * except.c (nothrow_spec_p): Simplify by checking node-equality.
4055 * mangle.c (write_exception_spec): Check nothrow explicitly.
4056 (write_encoding): Don't increment processing_template_decl around
4059 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4062 * mangle.c (write_template_args): Add "on" for operator names.
4064 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4067 * mangle.c (write_discriminator): Handle discriminator >= 10.
4069 2017-01-17 Nathan Sidwell <nathan@acm.org>
4072 * cp-tree.h (maybe_generic_this_capture): Declare.
4073 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
4074 (maybe_resolve_dummy): ... here. Call it.
4075 (maybe_generic_this_capture): New.
4076 * parser.c (cp_parser_postfix_expression): Speculatively capture
4077 this in generic lambda in unresolved member function call.
4078 * pt.c (tsubst_copy_and_build): Force hard error from failed
4079 member function lookup in generic lambda.
4081 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
4084 * cp-array-notation.c (expand_array_notation_exprs): Handle
4087 2017-01-11 Jason Merrill <jason@redhat.com>
4089 PR c++/78337 - ICE on invalid with generic lambda
4090 * semantics.c (process_outer_var_ref): Check if containing_function
4091 is null. Move inform call under complain test.
4093 2017-01-11 Nathan Sidwell <nathan@acm.org>
4096 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
4099 2017-01-11 Nathan Sidwell <nathan@acm.org>
4101 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
4103 2017-01-11 Jakub Jelinek <jakub@redhat.com>
4106 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
4107 assertion. Formatting fix.
4110 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
4113 2017-01-10 David Malcolm <dmalcolm@redhat.com>
4116 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
4117 a missing semicolon if we have a valid insertion location for
4120 2017-01-10 Jason Merrill <jason@redhat.com>
4122 FI 20, decomposition declaration with parenthesized initializer.
4123 * parser.c (cp_parser_decomposition_declaration): Use
4124 cp_parser_initializer.
4126 2017-01-09 Jason Merrill <jason@redhat.com>
4128 Implement P0195R2, C++17 variadic using.
4129 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
4130 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
4131 * error.c (dump_decl): Likewise.
4133 2017-01-09 Jakub Jelinek <jakub@redhat.com>
4135 PR translation/79019
4136 PR translation/79020
4137 * semantics.c (finish_omp_clauses): Add missing whitespace to
4138 translatable strings.
4139 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
4141 2017-01-07 Jason Merrill <jason@redhat.com>
4143 PR c++/78948 - instantiation from discarded statement
4144 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
4145 * cp-tree.h (in_discarded_stmt): Declare it.
4146 (struct saved_scope): Add discarded_stmt bitfield.
4147 (in_discarded_stmt): New macro.
4148 * decl2.c (mark_used): Check it.
4149 * parser.c (cp_parser_selection_statement): Adjust.
4150 (cp_parser_jump_statement): Adjust.
4152 2017-01-05 Jakub Jelinek <jakub@redhat.com>
4155 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
4156 REFERENCE_REF_P, set tt to its operand.
4159 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
4160 unions even for C++11 and later.
4162 2017-01-05 Nathan Sidwell <nathan@acm.org>
4165 * pt.c (convert_nontype_argument): Don't try and see if integral
4166 or enum expressions are constants prematurely.
4168 2017-01-04 Marek Polacek <polacek@redhat.com>
4171 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
4172 a zero character literal.
4174 2017-01-04 Jakub Jelinek <jakub@redhat.com>
4177 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
4181 * parser.c (cp_parser_simple_declaration): Only complain about
4182 inconsistent auto deduction if auto_result doesn't use auto.
4184 * parser.c (cp_parser_simple_declaration): Diagnose function
4185 declaration among more than one init-declarators with auto
4189 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
4190 assertion, as lexer->buffer may be NULL.
4192 2017-01-04 Marek Polacek <polacek@redhat.com>
4196 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
4198 2017-01-04 Nathan Sidwell <nathan@acm.org>
4201 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
4202 (lambda_capture_field_type): Update prototype.
4203 * lambda.c (lambda_capture_field_type): Add is_reference parm.
4204 Add referenceness here.
4205 (add_capture): Adjust lambda_capture_field_type call, refactor
4207 * pt.c (tsubst): Adjust lambda_capture_field_type call.
4209 2017-01-01 Jakub Jelinek <jakub@redhat.com>
4211 Update copyright years.
4213 Copyright (C) 2017 Free Software Foundation, Inc.
4215 Copying and distribution of this file, with or without modification,
4216 are permitted in any medium without royalty provided the copyright
4217 notice and this notice are preserved.