1 2017-10-06 Nathan Sidwell <nathan@acm.org>
4 * name-lookup.c (check_local_shadow): Don't try and convert
7 2017-10-06 Jakub Jelinek <jakub@redhat.com>
10 * decl.c (reshape_init): Suppress warn_useless_cast for direct enum
12 * typeck.c (convert_for_assignment): Likewise.
14 P0704R1 - fixing const-qualified pointers to members
15 * typeck2.c (build_m_component_ref): For -std=c++2a allow
16 pointer to const & qualified method on rvalue.
18 2017-10-06 Nathan Sidwell <nathan@acm.org>
20 Use hash_table for extern "C" names
21 * name-lookup.c (extern_c_fns): Use hash_table.
22 (check_extern_c_conflict): Adjust.
23 (c_linkage_bindings): Adjust.
25 Use hash_table for namespace bindings
26 * cp-tree.h (struct named_decl_hash): New.
27 (lang_decl_ns): Change type of bindings field.
28 * lex.c (maybe_add_lang_decl_raw): Adjust.
29 * name-lookup.c (find_namespace_slot): Adjust.
30 (do_pushdecl): Push NULL-named namespace.
31 (do_push_nested_namespace): Adjust.
32 (push_namespace): Push anonymous namespace as NULL name.
34 2017-10-05 Jason Merrill <jason@redhat.com>
36 Pass variadic class objects exactly like named by-value args.
37 * call.c (convert_arg_to_ellipsis): Use the result of force_rvalue.
39 2017-10-05 Nathan Sidwell <nathan@acm.org>
41 Warn on MVP declarations
42 * cp-tree.h (struct cp_declarator): Add parenthesized field.
43 * decl.c (grokdeclarator): Warn about unnecessary parens.
44 * parser.c (make_declarator): Init parenthesized field.
45 (cp_parser_direct_declarator): Set parenthesized field.
47 Kill IDENTIFIER_GLOBAL_VALUE, SET_IDENTIFIER_GLOBAL_VALUE
48 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
49 SET_IDENTIFIER_GLOBAL_VALUE): Delete.
50 * name-lookup.h (set_global_binding): Remove NAME parm.
51 (get_global_binding): New inline fn.
52 * name-lookup.c (set_global_binding): Remove NAME parm. Adjust.
53 (identifier_global_value): Move to ...
54 * cp-objcp-common.c (identifier_global_value): ... here.
55 * class.c (build_ctor_vtbl_group, build_vtbl_initializer): Adjust.
56 * decl.c (record_builtin_type, expand_static_init,
57 grokdeclarator): Adjust.
58 * decl2.c (get_guard, get_local_tls_init_fn, get_tls_init_fn,
59 get_tls_wrapper_fn, maybe_warn_sized_delete): Adjust.
60 * except.c (declare_library_fn, build_throw): Adjust.
61 * init.c (throw_bad_array_length): Adjust.
62 * rtti.c (throw_bad_cast, throw_bad_typeid, get_tinfo_decl): Adjust.
64 * decl2.c (record_mangling): Fix spello and formatting from
67 2017-10-04 Nathan Sidwell <nathan@acm.org>
69 Give builtin types the correct name.
70 * name-lookup.c (set_global_binding): Assert name is DECL_NAME.
71 * decl.c (record_builtin_type): Reimplement, use new TYPE_DECL for
74 2017-10-04 Paolo Carlini <paolo.carlini@oracle.com>
75 Andrew Pinski <apinski@cavium.com>
78 * parser.c (cp_parser_lambda_body): Set parser->in_function_body.
80 2017-10-04 Nathan Sidwell <nathan@acm.org>
82 Move mangling aliases out of global namespace.
83 * cp-tree.h (record_mangling): New.
84 (maybe_remove_implicit_alias): Delete.
85 * decl2.c (mangled_decls): New hash map.
86 (generate_mangling_alias): Reimplement using mangled_decls.
87 (record_mangling): New.
88 * mangle.c (decl_implicit_alias_p,
89 maybe_remove_implicit_alias): Delete.
90 (mangle_decl): Use record_mangling.
91 * name-lookup.c (supplement_binding_1): Remove
92 maybe_remove_implicit_alias check.
94 2017-10-04 Jakub Jelinek <jakub@redhat.com>
97 * error.c (dump_function_decl): If show_return, call dump_type_suffix
98 on the same return type dump_type_prefix has been called on.
100 2017-10-04 Jason Merrill <jason@redhat.com>
102 PR c++/81525 - broken handling of auto in generic lambda.
103 * pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.
105 2017-10-04 Nathan Sidwell <nathan@acm.org>
107 * call.c (convert_arg_to_ellipsis): Correct comment about passing
110 2017-10-02 Richard Sandiford <richard.sandiford@linaro.org>
112 * constexpr.c (cxx_eval_store_expression): Use wi::to_widest
113 when comparing the array bounds with an ARRAY_REF index.
115 2017-09-30 Paolo Carlini <paolo.carlini@oracle.com>
118 * method.c (defaulted_late_check): Early return if the defaulted
119 declaration does not match the expected signature.
121 2017-09-29 Jakub Jelinek <jakub@redhat.com>
123 P0683R1 - default member initializers for bit-fields
124 * cp-tree.h (grokbitfield): Add INIT parameter.
125 * parser.c (cp_parser_constant_expression): Add STRICT_P argument,
126 if true, parse a conditional-expression rather than
127 assignment-expression.
128 (cp_parser_member_declaration): For C++11 and later pass true
129 as STRICT_P to cp_parser_constant_expression. Parse C++2A bitfield
130 NSDMIs. Adjust grokbitfield caller. Handle DECL_INITIAL also for
132 (cp_parser_objc_class_ivars): Adjust grokbitfield caller.
133 * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs.
134 (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs.
135 * decl2.c (grokbitfield): Add INIT parameter, pass it to
137 * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not
140 * class.c (check_bitfield_decl): Retrieve and clear width from
141 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
142 (check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than
144 (remove_zero_width_bit_fields): Adjust comment.
145 * decl2.c (grokbitfield): Stash width into
146 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
147 * pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr
148 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width.
150 * parser.c (cp_parser_member_declaration): Parse attributes before
151 colon of a bitfield in addition to after colon.
153 * Make-lang.in (check-c++-all): Test also c++2a.
155 2017-09-28 Jason Merrill <jason@redhat.com>
157 PR c++/56973, DR 696 - capture constant variables only as needed.
158 * expr.c (mark_use): Split out from mark_rvalue_use and
159 mark_lvalue_use. Handle lambda capture of constant variables.
160 (mark_lvalue_use_nonread): New.
161 * semantics.c (process_outer_var_ref): Don't capture a constant
162 variable until forced.
163 * pt.c (processing_nonlambda_template): New.
164 * call.c (build_this): Check it.
165 * decl2.c (grok_array_decl): Call mark_rvalue_use and
166 mark_lvalue_use_nonread.
167 * init.c (constant_value_1): Don't call mark_rvalue_use.
168 * typeck.c (build_static_cast): Handle lambda capture.
170 Use local_specializations to find capture proxies.
171 * cp-tree.h (DECL_CAPTURED_VARIABLE): New.
172 * lambda.c (build_capture_proxy): Set it.
173 (add_capture): Pass initializer to build_capture_proxy.
174 (start_lambda_function): Likewise.
175 (insert_capture_proxy): Use register_local_specialization.
176 (is_lambda_ignored_entity): Always ignore proxies.
177 * name-lookup.c (qualify_lookup): Don't check
178 is_lambda_ignored_entity if LOOKUP_HIDDEN is set.
179 * semantics.c (process_outer_var_ref): Use
180 retrieve_local_specialization.
181 * parser.c (cp_parser_lambda_body): Push local_specializations.
182 * pt.c (tsubst_expr): Pass LOOKUP_HIDDEN when looking for a proxy.
183 (tsubst_lambda_expr): Push local_specializations sooner.
184 (tsubst_copy_and_build): Don't register_local_specialization.
186 * call.c (build_special_member_call): Use the return value of
188 * decl.c (compute_array_index_type): Likewise.
189 * parser.c (cp_parser_oacc_wait_list): Likewise.
190 * lambda.c (is_normal_capture_proxy): Handle *this capture.
191 (add_capture): Clarify internal_error message.
193 2017-09-22 Eric Botcazou <ebotcazou@adacore.com>
196 * cp-objcp-common.c (cp_get_debug_type): Do only one lookup.
198 2017-09-22 Jakub Jelinek <jakub@redhat.com>
201 * tree.c (struct replace_placeholders_t): Add pset field.
202 (replace_placeholders_r): Call cp_walk_tree with d->pset as
203 last argument instead of NULL. Formatting fix.
204 (replace_placeholders): Add pset variable, add its address
205 into data. Pass &pset instead of NULL to cp_walk_tree.
207 2017-09-22 David Malcolm <dmalcolm@redhat.com>
209 * call.c (get_fndecl_argument_location): New function.
210 (convert_like_real): Use it when complaining about argument type
212 * cp-tree.h (struct cp_parameter_declarator): Add "loc" field.
213 * parser.c (make_parameter_declarator): Add "loc" param and use
214 it to initialize the new field.
215 (cp_parser_translation_unit): Add UNKNOWN_LOCATION for "loc" of
216 the "no_parameters" parameter.
217 (cp_parser_parameter_declaration_list): Set the location of the
218 result of grokdeclarator to be the parameter's loc, assuming no
220 (cp_parser_parameter_declaration): Generate a location for the
221 parameter and pass to make_parameter_declarator.
223 2017-09-20 Nathan Sidwell <nathan@acm.org>
225 * name-lookup.c (member_name_cmp): Use DECL_UID for final
228 2017-09-20 Jakub Jelinek <jakub@redhat.com>
230 P0409R2 - allow lambda capture [=, this]
231 * parser.c (cp_parser_lambda_introducer): For cxx2a don't pedwarn on
234 2017-09-18 Jason Merrill <jason@redhat.com>
236 PR c++/82069 - ICE with lambda in template
237 * semantics.c (process_outer_var_ref): Check uses_template_parms
238 instead of any_dependent_template_arguments_p.
240 2017-09-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
241 Paolo Carlini <paolo.carlini@oracle.com>
244 * decl2.c (finish_anon_union): Complain about "anonymous union with
245 no members" with a pedwarn.
247 2017-09-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
249 * typeck.c (build_reinterpret_cast_1,
250 build_const_cast_1): Implement -Wcast-align=strict.
252 2017-09-15 Jakub Jelinek <jakub@redhat.com>
254 * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
255 adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
256 to C++17 or -std=gnu++17 or -std=c++17. Adjust comments.
257 (cxx_init_decl_processing, next_initializable_field,
258 is_direct_enum_init, check_initializer, cp_finish_decl,
259 mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
260 finish_function): Likewise.
261 * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
262 * pt.c (mark_template_parm, convert_nontype_argument,
263 instantiate_class_template_1, type_unification_real, unify,
264 get_partial_spec_bindings, dependent_type_p_r): Likewise.
265 * typeck.c (cp_build_unary_op): Likewise.
266 * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
267 * call.c (build_user_type_conversion_1, build_over_call,
268 build_special_member_call): Likewise.
269 * lambda.c (begin_lambda_type): Likewise.
270 * typeck2.c (process_init_constructor_record): Likewise.
271 * class.c (build_base_field, finalize_literal_type_property,
272 explain_non_literal_class): Likewise.
273 * parser.c (cp_parser_diagnose_invalid_type_name,
274 cp_parser_primary_expression, cp_parser_lambda_introducer,
275 cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
276 cp_convert_range_for, cp_parser_perform_range_for_lookup,
277 cp_parser_decomposition_declaration, cp_parser_linkage_specification,
278 cp_parser_static_assert, cp_parser_simple_type_specifier,
279 cp_parser_namespace_definition, cp_parser_using_declaration,
280 cp_parser_init_declarator, cp_parser_type_parameter_key,
281 cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
282 cp_parser_constructor_declarator_p): Likewise.
283 * mangle.c (struct globals): Rename need_cxx1z_warning to
285 (write_exception_spec, start_mangling, mangle_decl): Likewise.
286 * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
288 (check-c++17): New goal. Use 17 instead of 1z.
289 (check-c++-all): Use 17 instead of 1z.
291 2017-09-14 Jakub Jelinek <jakub@redhat.com>
294 * cp-gimplify.c (omp_var_to_track): Look through references.
295 (omp_cxx_notice_variable): Likewise.
297 2017-09-13 Nathan Sidwell <nathan@acm.org>
299 Conv-op identifers not in identifier hash table
300 * lex.c (conv_type_hasher): Make member fns inline.
301 (make_conv_op_name): Directly clone conv_op_identifier.
303 Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
304 * cp-tree.h (struct lang_type): Rename methods to members.
305 (CLASSTYPE_METHOD_VEC): Rename to ...
306 (CLASSTYPE_MEMBER_VEC): ... this.
307 * name-lookup.h (get_method_slot): Rename to ...
308 (get_member_slot): ... this.
309 (resort_type_method_vec): Rename to ...
310 (resort_type_member_vec): ... this.
311 * class.c (add_method, warn_hidden): Adjust.
312 * search.c (dfs_locate_field_accessor_pre): Adjust.
313 * name-lookup.c (method_vec_binary_search): Rename to ...
314 (member_vec_binary_search): ... this and adjust.
315 (method_vec_linear_search): Rename to ...
316 (member_vec_linear_search): ... this and adjust.
317 (fields_linear_search, get_class_binding_direct): Adjust.
318 (get_method_slot): Rename to ...
319 (get_member_slot): ... this and adjust.
320 (method_name_slot): Rename to ...
321 (member_name_slot): ... this and adjust.
322 (resort_type_method_vec): Rename to ...
323 (resort_type_member_vec): ... this and adjust.
324 (method_vec_append_class_fields): Rename to ...
325 (member_vec_append_class_fields): ... this and adjust.
326 (method_vec_append_enum_values): Rename to ...
327 (member_vec_append_enum_values): ... this and adjust.
328 (method_vec_dedup): Rename to ...
329 (member_vec_dedup): ... this and adjust.
330 (set_class_bindings, insert_late_enum_def_bindings): Adjust.
332 2017-09-12 Paolo Carlini <paolo.carlini@oracle.com>
335 * decl.c (start_decl): Early return error_mark_node if duplicate_decls
336 returns it; avoid misleading error message.
338 2017-09-12 Nathan Sidwell <nathan@acm.org>
340 Kill CLASSTYPE_SORTED_FIELDS.
341 * cp-tree.h (struct lang_type): Lose sorted_fields member.
342 (CLASSTYPE_SORTED_FIELDS): Delete.
343 * name-lookup.h (set_class_bindings): Add EXTRA arg.
344 * name-lookup.c (fields_linear_search): New, broken out of ...
345 (lookup_field_1): ... here. Delete remainder of function.
346 (get_class_binding_direct): Reimplement without sorted_fields.
347 (get_class_binding): Rename TYPE arg to KLASS, for consistency.
348 (get_method_slot): Call set_class_binding when creating method_vec
350 (method_name_cmp): Order identically named slots.
351 (sorted_fields_type_new): Delete.
352 (field_vc_append_class_fields): Rename to ...
353 (method_vec_append_class_fields): ... here. Adjust.
354 (field_vec_append_enum_values): Renme to ...
355 (method_vec_append_enum_values): ... here. Adjust.
356 (method_vec_dedup): New.
357 (set_class_bindings): Reimplement.
358 (insert_late_enum_def_bindings): Reimplement.
360 * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
362 (restort_data): Move later.
363 (method_name_cmp, resort_method_name_cmp): Simplify.
364 (resort_type_method_vec): Reformat.
366 2017-09-09 Jason Merrill <jason@redhat.com>
368 * constexpr.c (reduced_constant_expression_p): If
369 CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
371 2017-09-09 Eric Botcazou <ebotcazou@adacore.com>
374 * cp-objcp-common.c (struct debug_type_hasher): New class.
375 (debug_type_hash): New variable.
376 (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
378 2017-09-08 Jason Merrill <jason@redhat.com>
380 PR c++/70029 - ICE with ref-qualifier and -flto
381 * tree.c (cxx_copy_lang_qualifiers): New.
382 * cp-tree.h: Declare it.
383 * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
385 2017-09-06 Jason Merrill <jason@redhat.com>
387 PR c++/82053 - ICE with default argument in lambda in template
388 * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
390 (retrieve_specialization): Use lambda_fn_in_template_p.
391 * cp-tree.h: Declare it.
393 PR c++/82070 - error with nested lambda capture
394 * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
395 register_local_specialization.
397 2017-09-06 Nathan Sidwell <nathan@acm.org>
399 * name-lookup.h (lookup_field_1): Delete.
400 (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
401 * name-lookup.c (lookup_field_1): make static
402 (method_vec_binary_search, method_vec_linear_search): New. Broken
404 (get_class_binding_direct): ... here. Add TYPE_OR_FNS argument.
405 Do complete search of this level.
406 (get_class_binding): Adjust.
407 * decl.c (reshape_init_class): Call get_class_binding.
408 * search.c (lookup_field_r): Move field searching into
409 get_class_binding_direct.
411 * class.c (warn_hidden): Don't barf on non-functions.
412 * decl2.c (check_classfn): Likewise. Check template match earlier.
414 * name-lookup.c (count_fields): Rename to ...
415 (count_class_fields): ... here. Take a class, don't count
417 (add_fields_to_record_type): Rename to ...
418 (field_vec_append_class_fields): ... here. Take a class, don't
419 add NULL-named fields.
420 (add_enum_fields_to_record_type): Rename to ...
421 (field_vec_append_enum_values): ... here.
422 (set_class_bindings): Adjust, assert we added expected number.
423 (insert_late_enum_def_bindings): Reimplement. Create vector if
424 there are now sufficient entries.
426 * name-lookup.h (lookup_fnfields_slot_nolazy,
427 lookup_fnfields_slot): Rename to ...
428 (get_class_binding_direct, get_class_binding): ... here.
429 * name-lookup.c (lookup_fnfields_slot_nolazy,
430 lookup_fnfields_slot): Rename to ...
431 (get_class_binding_direct, get_class_binding): ... here.
432 * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
433 * call.c (build_user_type_conversion_1): Adjust.
434 (has_trivial_copy_assign_p): Adjust.
435 (has_trivial_copy_p): Adjust.
436 * class.c (get_basefndecls) Adjust.
437 (vbase_has_user_provided_move_assign) Adjust.
438 (classtype_has_move_assign_or_move_ctor_p): Adjust.
439 (type_build_ctor_call, type_build_dtor_call): Adjust.
440 * decl.c (register_dtor_fn): Adjust.
441 * decl2.c (check_classfn): Adjust.
442 * pt.c (retrieve_specialization): Adjust.
443 (check_explicit_specialization): Adjust.
444 (do_class_deduction): Adjust.
445 * search.c (lookup_field_r): Adjust.
446 (look_for_overrides_here, lookup_conversions_r): Adjust.
447 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
448 * tree.c (type_has_nontrivial_copy_init): Adjust.
449 * method.c (lazily_declare_fn): Adjust comment.
451 2017-09-05 Nathan Sidwell <nathan@acm.org>
453 * name-lookup.c (do_class_using_decl): Elide read-once temps.
454 Move declarations to initializations.
456 * class.c (add_method): Move slot search and insertion to ...
457 * name-lookup.c (get_method_slot): ... this new function.
458 (lookup_fnfields_slot_nolazy): Cope with NULL slot.
459 * name-lookup.h (get_method_slot): Declare.
460 * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
462 (grok_special_member_properties): Set
463 TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
464 Improve TYPE_HAS_CONSTEXPR_CTOR setting.
466 * cp-tree.h (lang_decl_base): Rename template_conv_p to
468 (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
469 (DECL_CONV_FN_TYPE): FN must be conv op.
470 (DECL_TEMPLATE_CONV_FN_P): Delete.
471 (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
472 * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
475 * class.c (unreverse_member_declarations): Remove extraneous if.
476 * pt.c (push_template_decl_real): Use string concatenation, not
477 \<newline>. Add %<..%>.
479 2017-09-05 Paolo Carlini <paolo.carlini@oracle.com>
482 * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
483 * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
484 creating cdtor_label.
485 * constexpr.c (returns): Add the case of a constructor/destructor
486 returning via a LABEL_DECL_CDTOR label.
487 (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
489 2017-09-01 Nathan Sidwell <nathan@acm.org>
491 * cp-tree.h (resort_type_method_vec): Move declaration to ...
492 * name-lookup.h (resort_type_method_vec): ... here.
493 (set_class_bindings): Lose 2nd arg.
494 * class.c (finish_struct_1, finish_struct): Adjust
495 set_class_bindings call. Don't call finish_struct_methods.
496 (resort_data, method_name_cmp, resort_method_name_cmp,
497 resort_type_method_vec, finish_struct_methods): Move to ...
498 * name-lookup.c (resort_data, method_name_cmp,
499 resort_method_name_cmp, resort_type_method_vec): ... here.
500 (set_class_bindings): Lose fields arg. Swallow finish_struct_methods.
502 * class.c (finish_struct): Call set_class_bindings for the
505 * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
506 Don't call maybe_warn_about_overly_private_class here.
507 (warn_hidden): Cleanup declarations and comments.
508 (type_has_user_provided_constructor): No need to check
509 CLASSTYPE_METHOD_VEC.
510 (type_has_user_provided_or_explicit_constructor): Likewise.
511 (classtype_has_move_assign_or_move_ctor_p): Likewise.
512 (check_bases_and_members): Don't call finish_struct_methods here.
513 (finish_struct_1): Call finish_struct_methods and
514 set_class_bindings immediately after layout. Clear DECL_IN_AGGR_P
516 (finish_struct): For templates process USING_DECLS and clear
517 DECL_IN_AGGR_P before calling finish_struct_methods. Call
518 maybe_warn_about_overly_private_class here.
520 Revert 2017-08-28 Nathan Sidwell <nathan@acm.org>
521 Restore sorted_fields vector.
522 * cp-tree.h (lang_type): Restore sorted_fields vector.
523 (CLASSTYPE_SORTED_FIELDS): Restore.
524 (CLASSTYPE_BINDINGS): Delete.
525 * name-lookup.c (lookup_field_1): Restore binary search.
526 (sorted_fields_type_new, count_fields,
527 add_fields_to_record_type, add_enum_fields_to_record_type): Restore
528 (set_class_bindings): Revert.
529 (insert_late_enum_def_binding): Restore field_vec insertion.
531 2017-09-01 Jakub Jelinek <jakub@redhat.com>
534 * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
536 2017-09-01 Marek Polacek <polacek@redhat.com>
539 * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
541 2017-08-30 Jason Merrill <jason@redhat.com>
543 PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
544 * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
545 (regenerated_lambda_fn_p): New.
546 (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
547 (tsubst_copy) [VAR_DECL]: Likewise.
549 PR c++/82030 - ICE inheriting from multiple lambdas
551 * call.c (compare_ics): Handle null candidate.
553 2017-08-30 Ville Voutilainen <ville.voutilainen@gmail.com>
555 Make taking the address of an overloaded function a non-deduced context
557 * pt.c (unify_overload_resolution_failure): Remove.
558 (unify_one_argument): Adjust.
560 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
561 Alan Hayward <alan.hayward@arm.com>
562 David Sherwood <david.sherwood@arm.com>
564 * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
566 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
567 Alan Hayward <alan.hayward@arm.com>
568 David Sherwood <david.sherwood@arm.com>
570 * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
572 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
573 Alan Hayward <alan.hayward@arm.com>
574 David Sherwood <david.sherwood@arm.com>
576 * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
577 instead of TYPE_MODE.
579 2017-08-29 Jason Merrill <jason@redhat.com>
581 PR c++/81236 - ICE with template-id in generic lambda
582 * semantics.c (finish_id_expression): Remove special dependent case.
583 Avoid some later pieces when dependent.
584 (finish_qualified_id_expr): Do normal BASELINK handling in a
585 template. Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
586 (parsing_default_capturing_generic_lambda_in_template): Remove.
587 * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
588 error for types that will never be complete.
589 * mangle.c (write_expression): Add sanity check.
590 * tree.c (build_qualified_name): Add sanity check.
591 (cp_walk_subtrees): Walk into the class context of a BASELINK.
592 * lambda.c (add_capture): Improve diagnostic for generic lambda
594 * call.c (build_new_method_call_1): Print the right constructor
597 Reimplement handling of lambdas in templates.
598 * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
599 * decl.c (start_preparsed_function): Call start_lambda_scope.
600 (finish_function): Call finish_lambda_scope.
601 * init.c (get_nsdmi): Call start/finish_lambda_scope.
602 * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
603 * parser.c (cp_parser_function_definition_after_declarator): Don't
604 call start/finish_lambda_scope.
605 * pt.c (retrieve_specialization): Ignore lambda functions in
607 (find_parameter_packs_r): Ignore capture proxies. Look into
609 (check_for_bare_parameter_packs): Allow bare packs in lambdas.
610 (tsubst_default_argument): Call start/finish_lambda_scope.
611 (tsubst_function_decl): Handle lambda functions differently.
612 (tsubst_template_decl): Likewise.
613 (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
615 (tsubst_lambda_expr): Create a new closure rather than instantiate
616 the one from the template.
617 (tsubst_copy_and_build): Don't register a specialization of a pack.
618 (regenerate_decl_from_template): Call start/finish_lambda_scope.
619 (instantiate_decl): Remove special lambda function handling.
620 * semantics.c (process_outer_var_ref): Remove special generic lambda
621 handling. Don't implicitly capture in a lambda in a template. Look
622 for an existing proxy.
623 * class.c (current_nonlambda_class_type): Use decl_type_context.
625 * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
626 (LAMBDA_EXPR_RETURN_TYPE): Remove.
627 (struct tree_lambda_expr): Remove closure and return_type fields.
628 * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
629 * pt.c (tsubst_copy_and_build): Likewise.
630 * parser.c (cp_parser_lambda_declarator_opt): Track return type.
631 (cp_parser_lambda_body): Adjust unspecified return type check.
632 * ptree.c (cxx_print_lambda_node): Don't print closure or
635 PR c++/80935 - wrong C++17 error with lambda
636 * decl.c (check_for_uninitialized_const_var): Check
637 is_instantiation_of_constexpr.
638 * constexpr.c (ensure_literal_type_for_constexpr_object): Check
639 is_instantiation_of_constexpr.
640 (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
642 * lambda.c (build_lambda_object): Check for error_mark_node.
643 * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
645 (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
646 (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
648 PR c++/80767 - unnecessary instantiation of generic lambda
649 * call.c (convert_like_real): Call build_user_type_conversion_1 if
651 (add_conv_candidate): Build a ck_user conversion with no candidate.
653 Fix lambdas in template default argument of inherited ctor.
654 * method.c (synthesized_method_base_walk): Replace an inherited
655 template with its specialization.
656 (synthesized_method_walk): Make inheriting_ctor a pointer.
657 (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
658 (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
660 * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
661 template, not the function.
662 (template_guide_p): Adjust.
664 Support copying local_specializations.
665 * cp-tree.h (enum lss_policy): New.
666 (local_specialization_stack): Add policy parameter to default ctor.
667 * pt.c (local_specialization_stack): Copy local_specializations if
670 * constexpr.c (potential_constant_expression_1): Add "now" parm.
671 (is_constant_expression, require_constant_expression): New.
672 (is_static_init_expression, is_nondependent_constant_expression)
673 (is_nondependent_static_init_expression): Drop "potential".
674 * except.c (build_must_not_throw_expr): Do type conversion on
675 value-dependent argument.
676 * pt.c, semantics.c, typeck2.c: Use variants without "potential".
678 Instantiate default arguments/member initializers once.
679 * init.c (get_nsdmi): Remember NSDMI instantiations.
680 * parser.c (inject_this_parameter): Be more picky about
682 * pt.c (tsubst_copy): Simplify 'this' handling.
683 (tsubst_default_argument): Remember default argument
684 instantiations. Take parameter number.
685 (tsubst_default_arguments): Pass it.
686 * call.c (convert_default_arg): Likewise.
688 Fix default argument conversion failure and SFINAE.
689 * call.c (build_over_call): Check convert_default_arg result for
691 * parser.c (cp_parser_late_parsing_default_args): Remember
694 2017-08-28 Nathan Sidwell <nathan@acm.org>
696 * cp-tree.h (lang_type): Replace sorted_fields vector with
698 (CLASSTYPE_SORTED_FIELDS): Delete.
699 (CLASSTYPE_BINDINGS): New.
700 * decl.c (finish_enum_value_list): Swap args of
701 insert_late_enum_def_bindings.
702 * name-lookup.c (lookup_field_1): Replace binary search of sorted
703 fields with map->get.
704 (sorted_fields_type_new, count_fields,
705 add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
706 (add_class_member, add_class_members): New.
707 (set_class_bindings): Create map and insert.
708 (insert_late_enum_def_binding): Swap parms. Use add_clasS_member.
709 * ptree.c (cxx_print_type): Delete sorted fields printing.
711 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
713 * name-lookup.h (set_class_bindings,
714 insert_late_enum_def_bindings): Declare.
715 * decl.c (finish_enum_value_list): Adjust for
716 insert_late_enum_def_bindings name change.
717 * class.c (finish_struct_1): Call set_class_bindings.
718 (count_fields, add_fields_to_record_type,
719 add_enum_fields_to_record_type, sorted_fields_type_new,
720 insert_into_classtype_sorted_fields,
721 insert_late_enum_def_into_classtype_sorted_fields): Move to ...
722 * name-lookup.h (count_fields, add_fields_to_record_type,
723 add_enum_fields_to_record_type, sorted_fields_type_new,
724 set_class_bindings, insert_late_enum_def_bindings): ... here.
726 2017-08-25 Nathan Sidwell <nathan@acm.org>
728 * class.c (method_name_cmp, resort_method_name_cmp): Methods
731 Conversion operators have a special name
732 * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
733 (conv_op_marker, conv_op_identifier): New.
734 (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
735 * decl.c (initialize_predefined_identifiers): Add
737 (cxx_init_decl_processing): Create conv_op_marker.
738 * decl2.c (check_classfn): Lookup conv-ops by name.
739 * class.c (add_method): Use conv_op_identifier & conv_op_marker.
740 (resort_type_method_vec): Don't skip conv-ops.
741 (finish_struct_methods, warn_hidden): Likewise.
742 * name-lookup.h (lookup_all_conversions): Delete.
743 * name-lookup.c (lookup_conversion_operator): Replace with ...
744 (extract_conversion_operator): ... this.
745 (lookup_fnfields_slot_nolazy): Find conv-ops by name.
746 (lookup_all_conversions): Delete.
747 * pt.c (check_explicit_specialization): Find conv-ops by name.
748 * search.c (lookup_conversions_r): Likewise.
750 2017-08-24 Nathan Sidwell <nathan@acm.org>
752 Conversion operators kept on single overload set
753 * class.c (add_method): Keep all conv-ops on one slot.
754 * name-lookup.c (lookup_conversion_operator): Pull the desired
755 conv op out of overload set.
756 * search.c (lookup_conversions_r): Lose template/non-template
758 (lookup_conversions): Likewise.
760 2017-08-23 Nathan Sidwell <nathan@acm.org>
762 * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
763 lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
765 * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
766 lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
767 * search.c (lookup_conversion_operator,
768 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
769 lookup_all_conversions): Move to ...
770 * name-lookup.c (lookup_conversion_operator,
771 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
772 lookup_all_conversions): ... here.
774 * semantics.c (finish_member_declaration): Move USING_DECL check
775 earlier. Always set C++ linkage. Commonize TYPE_FIELD and
776 template decl list insertion.
778 * cp-tree.h (maybe_version_functions): Declare.
779 * decl.c (decls_match): Break function versioning check to
780 separate function. Call it.
781 (maybe_version_functions): Broken out of decls_match.
782 * class.c (add_method): Use maybe_version_functions.
784 * cp-tree.h (print_search_statistics,
785 reinit_search_statistics): Don't declare.
786 * search.c (n_fields_searched, n_calls_lookup_field,
787 n_calls_lookup_field_1, n_calls_lookup_fnfields,
788 n_calls_lookup_fnfields_1, n_calls_get_base_type,
789 n_outer_fields_searched, n_contexts_saved): Delete.
790 (lookup_field_1, lookup_member,
791 lookup_fnfields_slot_nolazy): Remove stat gathering.
792 (print_search_statistics, reinit_search_statistics): Delete.
793 * tree.c (cxx_print_statistics): Don't print search stats.
795 2017-08-21 Nathan Sidwell <nathan@acm.org>
797 * search.c (lookup_field_r): Remove obsolete code for type-named
800 * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
802 (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
803 (lookup_field_fuzzy_r): Adjust.
805 2017-08-21 David Malcolm <dmalcolm@redhat.com>
807 * call.c (build_over_call): Pass NULL for new parameter to
808 check_function_arguments.
809 * typeck.c (cp_build_function_call_vec): Likewise.
811 2017-08-21 Nathan Sidwell <nathan@acm.org>
814 * pt.c (instantiate_class_template_1):
815 BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
817 2017-08-18 David Malcolm <dmalcolm@redhat.com>
820 * name-lookup.c (maybe_suggest_missing_header): Convert return
821 type from void to bool; return true iff a suggestion was offered.
822 (suggest_alternative_in_explicit_scope): Move call to
823 maybe_suggest_missing_header to before use of best_match, and
824 return true if the former offers a suggestion.
826 2017-08-18 H.J. Lu <hongjiu.lu@intel.com>
829 * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
830 * decl2.c (grokbitfield): Don't allow bit-field with
831 warn_if_not_aligned type.
833 2017-08-17 Nathan Sidwell <nathan@acm.org>
835 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
836 * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
837 (TYPE_TEMPLATE_INFO): Simplify.
838 (SET_TYPE_TEMPLATE_INFO): Simplify.
840 * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
841 don't need lang_type.
842 (cxx_make_type): Use maybe_add_lang_type_raw return value.
843 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
846 * cp-tree.h (struct lang_type): Remove template_info field.
847 (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
848 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
850 2017-08-14 Martin Sebor <msebor@redhat.com>
853 * error.c (cp_printer): Handle 'G'.
855 2017-08-11 Martin Liska <mliska@suse.cz>
857 * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
858 TARGET_SUPPORTS_ALIASES.
859 (handle_tls_init): Likewise.
860 (note_mangling_alias): Likewise. Remove ATTRIBUTE_UNUSED for
862 * optimize.c (can_alias_cdtor): Likewise.
864 2017-08-11 Jason Merrill <jason@redhat.com>
866 PR c++/81671 - nullptr_t template parameter
867 * pt.c (convert_nontype_argument): Fix nullptr_t check.
869 2017-08-10 Jason Merrill <jason@redhat.com>
871 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
872 * method.c (synthesized_method_walk): Don't diagnose lack of
875 PR c++/80452 - Core 1579, implicit move semantics on return/throw
876 * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
877 tentatively changed the lvalue to an rvalue.
878 * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
879 (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
880 parameter is an rvalue reference.
881 * except.c (build_throw): Do maybe-rvalue overload resolution twice.
882 * typeck.c (check_return_expr): Likewise.
884 2017-08-10 David Malcolm <dmalcolm@redhat.com>
886 * parser.c (cp_parser_error): Update for new param to
888 (class token_pair): New class.
889 (struct matching_paren_traits): New struct.
890 (matching_parens): New typedef.
891 (struct matching_brace_traits): New struct.
892 (matching_braces): New typedef.
893 (cp_parser_statement_expr): Convert explicit parsing of
894 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
895 class matching_parens, so that the pertinent open parenthesis is
896 highlighted when there are problems locating the close
898 (cp_parser_primary_expression): Likewise.
899 (cp_parser_compound_literal_p): Remove consumption of opening
901 (cp_parser_postfix_expression): Convert explicit parsing of
902 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
903 above. Use it to consume the opening paren previously consumed by
904 cp_parser_compound_literal_p.
905 (cp_parser_parenthesized_expression_list): Likewise.
906 (cp_parser_unary_expression): Likewise.
907 (cp_parser_new_expression): Likewise.
908 (cp_parser_cast_expression): Likewise.
909 (cp_parser_builtin_offsetof): Likewise.
910 (cp_parser_trait_expr): Likewise.
911 (cp_parser_lambda_declarator_opt): Likewise.
912 (cp_parser_lambda_body): Likewise, for matching_braces.
913 (cp_parser_compound_statement): Likewise.
914 (cp_parser_selection_statement): Likewise, for matching_parens.
915 (cp_parser_iteration_statement): Likewise.
916 (cp_parser_already_scoped_statement): Likewise, for
918 (cp_parser_linkage_specification): Likewise.
919 (cp_parser_static_assert): Likewise, for matching_parens.
920 (cp_parser_decltype): Likewise.
921 (cp_parser_operator): Likewise.
922 (cp_parser_enum_specifier): Likewise.
923 (cp_parser_namespace_definition): Likewise.
924 (cp_parser_direct_declarator): Likewise.
925 (cp_parser_braced_list): Likewise.
926 (cp_parser_class_specifier_1): Likewise, for matching_braces.
927 (cp_parser_constant_initializer): Likewise.
928 (cp_parser_noexcept_specification_opt): Likewise, for
930 (cp_parser_exception_specification_opt): Likewise.
931 (cp_parser_handler): Likewise.
932 (cp_parser_asm_specification_opt): Likewise.
933 (cp_parser_asm_operand_list): Likewise.
934 (cp_parser_gnu_attributes_opt): Likewise.
935 (cp_parser_std_attribute_spec): Likewise.
936 (cp_parser_requirement_parameter_list): Likewise.
937 (cp_parser_requirement_body): Likewise, for matching_braces.
938 (cp_parser_compound_requirement): Likewise.
939 (cp_parser_template_introduction): Likewise.
940 (cp_parser_sizeof_pack): Likewise, for matching_parens.
941 (cp_parser_sizeof_operand): Likewise; use it to consume the
942 opening paren previously consumed by cp_parser_compound_literal_p.
943 (get_matching_symbol): New function.
944 (cp_parser_required_error): Add param "matching_location". Remove
945 calls to cp_parser_error, instead setting a non-NULL gmsgid, and
946 handling it if set by calling c_parse_error, potentially with a
947 secondary location if matching_location was set.
948 (cp_parser_require): Add param "matching_location", with a default
949 value of UNKNOWN_LOCATION.
950 (cp_parser_require_keyword): Update for new param of
951 cp_parser_required_error.
952 (cp_parser_objc_encode_expression): Update to class matching_parens
954 (cp_parser_objc_defs_expression): Likewise.
955 (cp_parser_objc_protocol_expression): Likewise.
956 (cp_parser_objc_selector_expression): Likewise.
957 (cp_parser_objc_typename): Likewise.
958 (cp_parser_objc_superclass_or_category): Likewise.
959 (cp_parser_objc_try_catch_finally_statement): Likewise.
960 (cp_parser_objc_synchronized_statement): Likewise.
961 (cp_parser_objc_at_property_declaration): Likewise.
962 (cp_parser_oacc_single_int_clause): Likewise.
963 (cp_parser_oacc_shape_clause): Likewise.
964 (cp_parser_omp_clause_collapse): Likewise.
965 (cp_parser_omp_clause_default): Likewise.
966 (cp_parser_omp_clause_final): Likewise.
967 (cp_parser_omp_clause_if): Likewise.
968 (cp_parser_omp_clause_num_threads): Likewise.
969 (cp_parser_omp_clause_num_tasks): Likewise.
970 (cp_parser_omp_clause_grainsize): Likewise.
971 (cp_parser_omp_clause_priority): Likewise.
972 (cp_parser_omp_clause_hint): Likewise.
973 (cp_parser_omp_clause_defaultmap): Likewise.
974 (cp_parser_omp_clause_ordered): Likewise.
975 (cp_parser_omp_clause_schedule): Likewise.
976 (cp_parser_omp_clause_num_teams): Likewise.
977 (cp_parser_omp_clause_thread_limit): Likewise.
978 (cp_parser_omp_clause_aligned): Likewise.
979 (cp_parser_omp_clause_linear): Likewise.
980 (cp_parser_omp_clause_safelen): Likewise.
981 (cp_parser_omp_clause_simdlen): Likewise.
982 (cp_parser_omp_clause_depend): Likewise.
983 (cp_parser_omp_clause_device): Likewise.
984 (cp_parser_omp_clause_dist_schedule): Likewise.
985 (cp_parser_oacc_clause_async): Likewise.
986 (cp_parser_omp_critical): Likewise.
987 (cp_parser_omp_for_loop): Likewise.
988 (cp_parser_omp_sections_scope): Likewise.
989 (cp_parser_omp_declare_reduction_exprs): Likewise.
990 Update for new param to cp_parser_required_error.
991 (cp_parser_oacc_routine): Likewise.
992 (cp_parser_transaction_expression): Likewise.
993 (cp_parser_cilk_simd_vectorlength): Likewise.
995 2017-08-09 Jason Merrill <jason@redhat.com>
997 PR c++/81525 - wrong constant value with generic lambda
998 * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
999 (tsubst_copy) [VAR_DECL]: Handle auto.
1001 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1002 * init.c (get_nsdmi): Add complain parm.
1003 * typeck2.c (digest_nsdmi_init): Add complain parm.
1004 (process_init_constructor_record): Pass complain to get_nsdmi.
1005 * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
1006 * method.c (get_defaulted_eh_spec): Add complain parm. Pass it into
1007 synthesized_method_walk.
1008 (synthesized_method_walk): Adjust.
1009 (walk_field_subobs): Pass complain to get_nsdmi.
1010 (defaulted_late_check): Skip other checks if deleted.
1011 * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
1012 * call.c (build_aggr_conv): Pass complain to get_nsdmi.
1013 * parser.c (defarg_location): New.
1014 * error.c (location_of): Use it.
1016 2017-08-09 Marek Polacek <polacek@redhat.com>
1018 * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
1019 * typeck.c (build_binary_op): Change the type of a parameter to bool.
1020 (cp_truthvalue_conversion): Use true instead of 1.
1022 2017-08-08 Marek Polacek <polacek@redhat.com>
1025 * cp-gimplify.c (cp_fold): If folding exposed a branch of
1026 a COND_EXPR, convert it to the original type of the COND_EXPR, if
1029 2017-08-08 Martin Liska <mliska@suse.cz>
1031 * call.c: Include header files.
1032 * cp-gimplify.c: Likewise.
1033 * cp-ubsan.c: Likewise.
1036 * search.c: Likewise.
1037 * semantics.c: Likewise.
1038 * typeck.c: Likewise.
1040 2017-08-07 Martin Liska <mliska@suse.cz>
1042 * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
1044 (cp_parser_std_attribute): Likewise.
1045 * tree.c: Add new include.
1047 2017-08-04 Paolo Carlini <paolo.carlini@oracle.com>
1050 * pt.c (do_class_deduction): Handle the case of no viable implicit
1051 deduction guides; simplify the code generating implicit deduction
1054 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
1057 * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
1058 destructor as expressions.
1060 2017-08-02 Jakub Jelinek <jakub@redhat.com>
1063 * call.c (build_user_type_conversion_1): Only call
1064 lookup_fnfields_slot if totype is CLASS_TYPE_P.
1066 2017-07-31 Jason Merrill <jason@redhat.com>
1068 * decl.c (declare_global_var): Set DECL_CONTEXT.
1070 2017-07-31 Jan Hubicka <hubicka@ucw.cz>
1071 Martin Liska <mliska@suse.cz>
1073 * pt.c (tsubst_copy): Copy PREDICT_EXPR.
1074 * semantics.c (finish_goto_stmt): Build gimple predict
1076 * constexpr.c (potential_constant_expression_1): Handle
1079 2017-07-31 Martin Liska <mliska@suse.cz>
1082 * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
1083 also with current_function_decl non-null equality.
1084 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1085 * decl.c (compute_array_index_type): Likewise.
1086 * init.c (finish_length_check): Likewise.
1087 * typeck.c (cp_build_binary_op): Likewise.
1089 2017-07-29 Jakub Jelinek <jakub@redhat.com>
1091 * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
1092 DW_AT_export_symbols.
1093 * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
1094 argument, pass it through to the debug hook.
1095 (finish_namespace_using_directive): Adjust
1096 emit_debug_info_using_namespace caller.
1097 (push_namespace): Likewise. Call it after setting
1098 DECL_NAMESPACE_INLINE_P.
1099 (cp_emit_debug_info_for_using): Pass false as new argument to
1100 the imported_module_or_decl debug hook.
1102 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
1104 * lex.c (copy_decl): Adjust.
1105 (copy_type): Likewise.
1107 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
1110 * lambda.c (add_capture): Early return if we cannot capture by
1113 2017-07-26 Jason Merrill <jason@redhat.com>
1115 P0702R1 - List deduction of vector.
1116 * pt.c (do_class_deduction): Special-case deduction from a single
1117 element of related type.
1119 2017-07-26 Leonid Koppel <lkoppel@uwaterloo.ca>
1121 PR c++/67054 - Inherited ctor with non-default-constructible members
1122 * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
1123 when deducing an inheriting constructor.
1125 2017-07-21 Nathan Sidwell <nathan@acm.org>
1127 * search.c (lookup_conversion_operator): Return overloads.
1128 (lookup_fnfields_idx_nolazy): Absorb into ...
1129 (lookup_fnfields_slot_nolaxy): ... here.
1130 (lookup_fnfields_1): Absorb into ...
1131 (lookup_fnfields_slot): ... here.
1133 Remove special CDtor METHOD_VEC slots.
1134 * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
1135 CLASSTYPE_DESTRUCTOR_SLOT): Delete.
1136 (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
1137 (CLASSTYPE_DESTRUCTOR): Likewise.
1138 * class (add_method): Don't use special cdtor slots.
1139 * search.c (lookup_fnfields_idx_nolazy): Likewise.
1140 (look_for_overrides_here): Use lookup_fnfields_slot.
1141 * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
1143 * call.c (add_candidates): Move decls to initialization. Don't
1146 2017-07-20 Nathan Sidwell <nathan@acm.org>
1148 Remove TYPE_METHODS.
1149 * class.c (maybe_warn_about_overly_private_class,
1150 finish_struct_methods, one_inheriting_sig, count_fields,
1151 add_fields_to_record_type, check_field_decls, check_methods,
1152 clone_function_decl, set_method_tm_attributes,
1153 finalize_literal_type_property, check_bases_and_members,
1154 create_vtable_ptr, determine_key_method,
1155 unreverse_member_declarations, finish_struct,
1156 add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
1157 * decl.c (fixup_anonymous_aggr): Likewise.
1158 * decl2.c (reset_type_linkage_2): Likewise.
1159 * method.c (after_nsdmi_defaulted_late_checks,
1160 lazily_declare_fn): Likewise.
1161 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
1162 * pt.c (instantiate_class_template_1, tsubst_expr,
1163 do_type_instantiation, instantiate_pending_templates): Likewise.
1164 * search.c (lookup_field_1): Likewise.
1165 * semantics.c (finish_member_declaration,
1166 finish_omp_declare_simd_methods): Likewise.
1168 2017-07-19 Nathan Sidwell <nathan@acm.org>
1170 * class.c (add_implicitly_declared_members): Use
1171 classtype_has_move_assign_or_move_ctor_p.
1172 (classtype_has_move_assign_or_move_ctor,
1173 classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
1174 (classtype_has_move_assign_or_move_ctor_p): ... this new function.
1175 * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
1177 (classtype_has_move_assign_or_move_ctor_p): ... this.
1178 * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
1179 * tree.c (type_has_nontrivial_copy_init): Adjust.
1181 * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
1182 PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
1184 2017-07-18 Nathan Sidwell <nathan@acm.org>
1186 * cp-array-notation.c (build_array_notation_ref): Use
1187 TYPE_{MIN,MAX}_VALUE.
1189 * class.c (classtype_has_move_assign_or_move_ctor): Declare.
1190 (add_implicitly_declared_members): Use it.
1191 (type_has_move_constructor, type_has_move_assign): Merge into ...
1192 (classtype_has_move_assign_or_move_ctor): ... this new function.
1193 * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
1195 2017-07-17 Volker Reichelt <v.reichelt@netcologne.de>
1197 * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
1198 friend outside class and obsolete auto as storage-class-specifier.
1200 2017-07-17 Nathan Sidwell <nathan@acm.org>
1202 * class.c (maybe_warn_about_overly_private_class): Ignore public
1205 * class.c (type_has_user_declared_move_constructor,
1206 type_has_user_declared_move_assign): Combine into ...
1207 (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
1208 * cp-tree.h (type_has_user_declared_move_constructor,
1209 type_has_user_declared_move_assign): Combine into ...
1210 (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
1211 * method.c (maybe_explain_implicit_delete): Use it.
1212 (lazily_declare_fn): Use it.
1213 * tree.c (type_has_nontrivial_copy_init): Use it.
1215 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
1216 semantics, simplify implementation.
1218 2017-07-16 Volker Reichelt <v.reichelt@netcologne.de>
1220 * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
1221 in old-style cast diagnostic.
1222 * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
1223 in useless cast diagnostic.
1224 * error.c (type_to_string): Remove enum special handling.
1226 2017-07-14 David Malcolm <dmalcolm@redhat.com>
1228 * name-lookup.c (get_std_name_hint): Add '<' and '>' around
1230 (maybe_suggest_missing_header): Update for addition of '<' and '>'
1231 to above. Provide a fix-it hint.
1232 * pt.c: Include "gcc-rich-location.h"
1233 (listify): Attempt to add fix-it hint for missing
1234 #include <initializer_list>.
1235 * rtti.c: Include "gcc-rich-location.h".
1236 (typeid_ok_p): Attempt to add fix-it hint for missing
1237 #include <typeinfo>.
1239 2017-07-12 Jason Merrill <jason@redhat.com>
1241 P0512R0 - Deduction from an initializer list.
1242 * pt.c (do_class_deduction): Do list deduction in two phases.
1244 2017-07-12 Nathan Sidwell <nathan@acm.org>
1246 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
1247 DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
1249 * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
1250 DECL_CXX_DESTRUCTOR explicitly.
1251 * decl2.c (grokclassfn): Likewise.
1252 * friend.c (do_friend): Likewise.
1253 * method.c (make_thunk, make_alias_for,
1254 implicitly_declare_fn): Likewise.
1256 2017-07-11 Jason Merrill <jason@redhat.com>
1259 * decl.c (grokparms): Downgrade error about array of unknown bound
1260 to pedwarn and disable it for C++17.
1262 2017-07-11 Nathan Sidwell <nathan@acm.org>
1264 * decl2.c (reset_type_linkage_2): Dont't change ctor name.
1266 2017-07-10 Martin Sebor <msebor@redhat.com>
1268 * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
1270 2017-07-06 Jason Merrill <jason@redhat.com>
1272 PR c++/81204 - parse error with dependent template-name
1273 * parser.c (cp_parser_lookup_name): Revert previous change.
1275 2017-07-06 David Malcolm <dmalcolm@redhat.com>
1277 * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
1278 selftest::run_cp_tests.
1279 (selftest::run_cp_tests): New function.
1280 * cp-tree.h (selftest::run_cp_tests): New decl.
1282 2017-07-04 Jakub Jelinek <jakub@redhat.com>
1284 * parser.c (cp_parser_decomposition_declaration): Replace
1285 decomposition declaration with structured binding in diagnostics.
1286 * decl.c (cp_finish_decomp): Likewise.
1287 (grokdeclarator): Likewise.
1290 * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
1291 forms of structured binding initializers.
1293 2017-07-03 Paolo Carlini <paolo.carlini@oracle.com>
1296 * decl.c (grokdeclarator): Move checks on function return type after
1297 the splice_late_return_type call; if declspecs->locations[ds_type_spec]
1298 is UNKNOWN_LOCATION fall back to input_location.
1300 2017-07-03 David Malcolm <dmalcolm@redhat.com>
1302 * parser.c (enum required_token): Fix spelling of
1303 RT_INTERATION to RT_ITERATION.
1304 (cp_parser_iteration_statement): Likewise.
1305 (cp_parser_required_error): Likewise.
1307 2017-06-30 Jason Merrill <jason@redhat.com>
1309 PR c++/81257 - ICE with invalid ::template.
1310 PR c++/54769 - wrong lookup of dependent template-name.
1311 * parser.c (cp_parser_template_name): Revert part of last change.
1313 2017-06-30 Nathan Sidwell <nathan@acm.org>
1315 * config-lang.in (gtfiles): Add cp/lex.c.
1316 * cp-tree.h (mangle_convop_name_for_type): Rename ...
1317 (make_conv_op_name): ... here. Move to lex.
1318 * lambda.c (maybe_add_lambda_conv_op): Update.
1319 * parser.c (cp_parser_conversion_function_id): Update.
1320 * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
1321 tsubst_copy_and_build): Update.
1322 * semantics.c (apply_deduced_return_type): Update.
1323 * mangle.c (conv_type_hasher, conv_type_names,
1324 mangle_conv_op_name_for_type): Move to ...
1325 * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
1328 2017-06-30 David Malcolm <dmalcolm@redhat.com>
1331 * parser.c (cp_parser_postfix_expression): Construct a location
1332 for typeid expressions.
1334 2017-06-30 Nathan Sidwell <nathan@acm.org>
1336 * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
1338 (lookup_all_conversions): Declare.
1339 * class.c (get_basefndecls): Use lookup_fnfields_slot.
1340 * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
1341 * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
1343 * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
1344 (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
1345 lookup_all_conversions.
1346 * search.c (lookup_fnfields_1): Make static.
1347 (lookup_all_conversions): New.
1348 (class_method_index_for_fn): Delete.
1349 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
1350 lookup_fnfields_slot.
1352 * call.c (build_new_method_call_1): Use constructo_name to get
1353 ctor name. Move argument processing earlier to merge cdtor
1355 * decl.c (grokfndecl): Cdtors have special names.
1356 * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
1357 * pt.c (check_explicit_specialization): Cdtor name is already
1359 * search.c (class_method_index_for_fn): Likewise.
1362 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
1363 a matching TYPE_DECL.
1365 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
1367 * class.c (add_method): Change pair of errors to error + inform.
1368 (handle_using_decl): Likewise.
1370 2017-06-29 Jason Merrill <jason@redhat.com>
1372 * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
1374 PR c++/81180 - ICE with C++17 deduction of member class template.
1375 * pt.c (build_deduction_guide): Correct member template handling.
1377 PR c++/81188 - matching decltype of member function call.
1378 * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
1380 2017-06-29 Nathan Sidwell <nathan@acm.org>
1383 * parser.c (cp_parser_namespace_definition): Immediately close the
1384 namespace if there's no open-brace.
1385 * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
1388 2017-06-29 Jason Merrill <jason@redhat.com>
1390 PR c++/81164 - ICE with invalid inherited constructor.
1391 * search.c (binfo_direct_p): New.
1392 * name-lookup.c (do_class_using_decl): Use it.
1394 2017-06-29 Nathan Sidwell <nathan@acm.org>
1396 * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
1397 VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
1398 * decl.c (initialize_predefined_identifiers): Name cdtor special
1399 names consistently. Use literals for above deleted defines.
1400 (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
1402 * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
1405 * call.c (check_dtor_name): Use constructor_name for enums too.
1406 (build_new_method_call_1): Use constructor_name for cdtors and
1408 * class.c (build_self_reference): Use TYPE_NAME to get name of
1410 * name-lookup (constructor_name): Use DECL_NAME directly.
1411 (constructor_name_p): Reimplement.
1412 (push_class_level_binding_1): Use TYPE_NAME directly.
1414 * class.c (finish_struct): Use OVL_P.
1415 (get_vfield_name): Measure constructor_name length.
1416 * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
1417 (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
1418 * cxx-pretty-print.c (is_destructor_name): Delete.
1419 (pp_cxx_unqualified_id): Remove bogus destructor name checking.
1420 * decl.c (grokfndecl): Move cheap checks first when looking for
1421 implicit extern cness.
1423 * parser.c (cp_parser_direct_declarator): Reorder if to avoid
1424 indentation. Remove unnecessary assignment of constructor name.
1426 Whitespace cleanups.
1427 * call.c (name_as_c_string): Move CONST_CAST to return.
1428 (build_new_method_call_1): Remove unneeded bracing.
1429 * class.c (include_empty_classes): Unbreak line.
1430 * constraint.cc (tsubst_check_constraint): Add space.
1431 * cp-tree.h (lang_decl_ns): Add comment.
1432 (PTRMEM_CST_MEMBER): Break line.
1433 * decl.c (grokfndecl): Add blank lines. Unbreak some others.
1434 (grokdeclarator): Remove lines, move declaration to first use.
1435 * decl2.c (decl_needed_p): Fix indentation.
1436 (c_parse_final_cleanups): Remove blank line.
1437 * method.c (implicitly_declare_fn): Move declaration to first use.
1438 * search.c (current_scope): Add blank lines.
1440 2017-06-28 Jason Merrill <jason@redhat.com>
1442 PR c++/72764 - ICE with invalid template typename.
1443 * decl.c (build_typename_type): No longer static.
1444 * tree.c (strip_typedefs): Use it instead of make_typename_type.
1446 PR c++/69300 - ICE with self-referential noexcept
1447 * pt.c (maybe_instantiate_noexcept): Check for recursion.
1449 PR c++/61022 - error with variadic template template parm
1450 * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
1452 PR c++/72801 - ICE with variadic partial specialization
1453 * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
1455 PR c++/55639 - partial specialization with ::template
1456 * parser.c (cp_parser_class_head): Handle ::template.
1458 PR c++/45976 - error with ::template in declarator.
1459 * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
1461 PR c++/54769 - wrong lookup of dependent template-name.
1462 * parser.c (cp_parser_template_name): Handle dependent object type.
1463 (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
1465 (cp_parser_id_expression): Pass it.
1466 (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
1468 * parser.c (cp_parser_template_id): Use the range location on the
1471 PR c++/81204 - parse error with dependent template-name
1472 * parser.c (cp_parser_lookup_name): Disqualify function templates
1475 2017-06-27 Nathan Sidwell <nathan@acm.org>
1477 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
1478 initialization point. Don't unnecessarily check for ctor name.
1480 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
1481 (CLASSTYPE_DESTRUCTOR): ... this.
1482 * class.c (accessible_nvdtor_p,
1483 maybe_warn_about_overly_private_class,
1484 add_implicitly_declared_members,
1485 clone_constructors_and_destructors, type_has_virtual_destructor):
1486 Adjust for CLASSTYPE_DESTRUCTOR.
1487 (deduce_noexcept_on_destructors): Absorb into ...
1488 (check_bases_and_members): ... here.
1489 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
1490 * init.c (build_delete): Likewise.
1491 * parser.c (cp_parser_lookup_name): Likewise.
1492 * pt.c (check_explicit_specialization): Likewise.
1493 * rtti.c (emit_support_tinfos): Likewise.
1494 * search.c (lookup_fnfields_idx_nolazy): Likewise.
1496 Kill IDENTIFIER_TEMPLATE.
1497 * cp-tree.h (lang_identifier): Remove class_template_info field.
1498 (IDENTIFIER_TEMPLATE): Delete.
1499 * name-lookup.c (constructor_name_full): Subsume into ...
1500 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
1501 (constructor_name_p): Likewise.
1502 * mangle.c (write_source_name): Likewise.
1503 * ptree.c (cxx_print_identifier): Likewise.
1505 2017-06-27 Marek Polacek <polacek@redhat.com>
1508 * parser.c (cp_parser_already_scoped_statement): Initialize
1511 2017-06-26 Jason Merrill <jason@redhat.com>
1513 PR c++/81215 - deduction failure with variadic TTP.
1514 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
1516 2017-06-26 Martin Sebor <msebor@redhat.com>
1519 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
1520 to detect casting away cv-qualifiers.
1522 2017-06-26 Nathan Sidwell <nathan@acm.org>
1524 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
1525 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
1527 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
1528 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
1529 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
1530 * decl.c (grok_op_properties): Adjust identifier checking.
1531 * init.c (expand_default_init): Adjust identifier descision.
1532 * method.c (implicitly_declare_fn): Don't use
1533 DECL_ASSIGNMENT_OPERATOR_P.
1534 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
1536 * call.c (in_charge_arg_for_name): Reimplement.
1537 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
1540 2017-06-26 Marek Polacek <polacek@redhat.com>
1543 * parser.c (cp_parser_statement): Add a default argument. Save the
1544 location of the expression-statement after labels have been parsed.
1545 (cp_parser_implicitly_scoped_statement): Set the location of the
1546 body of the conditional after parsing all the labels. Call
1547 warn_for_multistatement_macros.
1548 (cp_parser_already_scoped_statement): Likewise.
1550 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
1553 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
1554 'typename' in error messages about missing 'typename'.
1556 2017-06-23 Jason Merrill <jason@redhat.com>
1558 PR c++/79056 - C++17 ICE with invalid template syntax.
1559 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
1561 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
1562 * pt.c (template_placeholder_p): New.
1563 * cp-tree.h: Declare it.
1565 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
1567 * decl.c (duplicate_decls): Use builtin_structptr_types.
1569 2017-06-22 Nathan Sidwell <nathan@acm.org>
1571 Reorder IDENTIFIER flags
1573 * cp-tree.h (enum cp_identifier_kind): New.
1574 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
1575 IDENTIFIER_KIND_BIT_2): New.
1576 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
1577 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
1578 (C_IS_RESERVED_WORD): Replace with ...
1579 (IDENTIFIER_KEYWORD_P): ... this.
1580 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
1581 (IDENTIFIER_CDTOR_P): ... this.
1582 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
1583 (IDENTIFIER_OPNAME_P): Replace with ...
1584 (IDENTIFIER_ANY_OP_P): ... this.
1585 (IDENTIFIER_ASSIGN_OP_P): New.
1586 (IDENTIFIER_TYPENAME_P): Replace with ...
1587 (IDENTIFIER_CONV_OP_P): ... this.
1588 (NEW_DELETE_OPNAME_P): Replace with ...
1589 (IDENTIFIER_NEWDEL_OP_P): ... this.
1590 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
1591 (get_identifier_kind_name, set_identifier_kind): Declare.
1592 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
1593 (init_operators): Adjust to avoid keywords, use
1594 set_identifier_kind. Copy TYPE_EXPR slot.
1595 (init_reswords): Call set_identifier_kind.
1596 (unqualified_name_lookup_error): Adjust.
1597 * operators.def (TYPE_EXPR): Remove.
1598 * decl.c (struct predefined_identifier): Move into ...
1599 (initialize_predefined_identifiers): ... here. Call
1600 set_identifier_kind.
1601 (grokfndecl, check_var_type, grokdeclarator): Adjust.
1602 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
1604 * call.c (name_as_c_string): Adjust.
1605 (build_new_method_call_1): Likewise.
1606 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
1607 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
1608 * dump.c (cp_dump_tree): Adjust.
1609 * error.c (dump_decl_name): Adjust.
1610 * mangle.c (write_unqualified_id, write_member_name,
1611 write_expression): Adjust.
1612 (mangle_conv_op_name_for_type): Use set_identifier_kind.
1613 * name-lookup.c (do_class_using_decl): Adjust.
1614 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
1615 * parser.c (cp_lexer_get_preprocessor_token,
1616 cp_parser_direct_declarator): Likewise.
1617 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
1618 tsubst_copy, tsubst_copy_and_build): Adjust.
1619 * ptree.c (cxx_print_identifier): Print identifier kind.
1620 * search.c (lookup_field_r, lookup_member,
1621 lookup_fnfields_idx_nolazy): Adjust.
1622 * semantics.c (finish_id_expression): Adjust..
1623 * typeck.c (cp_build_addr_expr_1): Adjust.
1625 2017-06-21 Jakub Jelinek <jakub@redhat.com>
1628 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
1629 Complain about t not being a variable if t is OVERLOAD even
1630 when processing_template_decl.
1632 2017-06-21 David Malcolm <dmalcolm@redhat.com>
1634 * parser.c (get_cast_suggestion): New function.
1635 (maybe_add_cast_fixit): New function.
1636 (cp_parser_cast_expression): Capture the location of the closing
1637 parenthesis. Call maybe_add_cast_fixit when emitting warnings
1638 about old-style casts.
1640 2017-06-20 Jason Merrill <jason@redhat.com>
1642 PR c++/80972 - C++17 ICE with attribute packed.
1643 * call.c (build_over_call): Allow a TARGET_EXPR from reference
1646 2017-06-20 Nathan Sidwell <nathan@acm.org>
1648 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
1649 (nelts_identifier): Delete.
1650 * decl.c (initialize_predefined_identifiers): Remove nelts.
1652 PR c++/67074 - namespace aliases
1653 * decl.c (duplicate_decls): Don't error here on mismatched
1655 * name-lookup.c (name_lookup::add_value): Matching namespaces are
1657 (diagnose_name_conflict): Namespaces are never redeclarations.
1658 (update_binding): An alias can match a real namespace.
1660 2017-06-19 Jason Merrill <jason@redhat.com>
1662 PR c++/80562 - ICE with constexpr if.
1663 * semantics.c (finish_if_stmt_cond): Call
1664 instantiate_non_dependent_expr.
1666 PR c++/80829 - ICE with constexpr copy of base subobject.
1667 * constexpr.c (clear_no_implicit_zero): New.
1668 (cxx_eval_call_expression): Call it.
1670 2017-06-19 Nathan Sidwell <nathan@acm.org>
1674 * name-lookup.c (set_decl_namespace): Don't follow using
1675 directives and ignore using decls. Only check overly-explicit
1676 scope after discovering decl.
1678 2017-06-19 Jason Merrill <jason@redhat.com>
1680 PR c++/81073 - constexpr and static var in statement-expression.
1681 * typeck2.c (store_init_value): Always call
1682 require_potential_constant_expression.
1683 * pt.c (convert_nontype_argument): Likewise.
1684 * constexpr.c (potential_constant_expression_1): Adjust message.
1685 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
1686 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
1688 2017-06-19 Nathan Sidwell <nathan@acm.org>
1690 * pt.c (coerce_template_parms): Fix indentation.
1691 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
1695 * name-lookup.c (update_binding): Only warn about constructors
1696 hidden by functions.
1698 2017-06-17 Jason Merrill <jason@redhat.com>
1700 PR c++/60063 - -Wunused-local-typedefs and templates.
1701 * decl2.c (is_late_template_attribute): Return false for "used".
1703 PR c++/70844 - -Wuseless-cast and inheriting constructor.
1704 * method.c (forward_parm): Suppress warn_useless_cast.
1706 2017-06-16 Jason Merrill <jason@redhat.com>
1708 PR c++/81045 - Wrong type-dependence with auto return type.
1709 * pt.c (type_dependent_expression_p): An undeduced auto outside the
1710 template isn't dependent.
1711 * call.c (build_over_call): Instantiate undeduced auto even in a
1714 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
1715 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
1716 set longer for a generic lambda.
1718 PR c++/80614 - Wrong mangling for C++17 noexcept type
1719 * mangle.c (write_type): Put the eh spec back on the function type.
1721 PR c++/81102 - Wrong error with partial specialization.
1722 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
1723 types. Do type deduction later.
1725 PR c++/81074 - ICE with partial specialization of member template.
1727 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
1729 PR c++/80831 - ICE with -fsyntax-only.
1730 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
1732 PR c++/80639 - ICE with invalid PMF initialization.
1733 PR c++/80043 - ICE with -fpermissive
1734 * typeck.c (convert_for_assignment): Recurse when instantiate_type
1735 returns without an error.
1737 2017-06-16 Nathan Sidwell <nathan@acm.org>
1739 * pt.c (tsubst_baselink): Fix & clarify formatting.
1741 * cp-tree.h (build_this_parm, cp_build_parm_decl,
1742 build_artificial_parm): Add FN parm.
1743 * decl.c (start_cleanup_fn): Adjust.
1744 (build_this_parm): Add FN parm, pass it through.
1745 (grokfndecl): Adjust parm building.
1746 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
1747 (build_artificial_parm): Add FN parm, pass through.
1748 (maybe_retrofit_in_chrg): Adjust parm building.
1749 (start_static_storage_duration_function): Likwise.
1750 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
1751 * method.c (implicitly_declare_fn): Likewise.
1752 * parser.c (inject_this_parameter): Likewise.
1754 Symbol tables are insert only.
1755 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
1756 derive from pointer_hash. Make undeletable.
1758 * class.c (resort_type_method_vec): Avoid potential unsigned
1761 Don't defer noexcept_deferred_spec.
1762 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
1763 * decl.c (cxx_init_decl_processing): Initialize
1764 noexcept_deferred_spec.
1765 * except.c (unevaluated_noexcept_spec): Delete.
1766 * class.c (deduce_noexcept_on_destructor): Use
1767 noexcept_deferred_spec directly.
1768 * method.c (implicitly_declare_fn): Likewise.
1770 Make keyed_classes a vector.
1771 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
1772 (keyed_classes): Declare as vector.
1773 * decl.c (keyed_classes): Define.
1774 (cxx_init_decl_processing): Allocate it.
1775 (record_key_method_defined): Use vec_safe_push.
1776 * class.c (finish_struct_1): Likewise.
1777 * pt.c (instantiate_class_template_1): Likewise.
1778 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
1781 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
1782 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
1784 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
1785 (get_tinfo_decl): Use get_tinfo_desc.
1786 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
1787 (create_pseudo_type_info): Delete.
1788 (get_pseudo_ti_index): Just determine the index.
1789 (get_tinfo_desc): New. Create all types lazily.
1790 (create_tinfo_types): Just allocate the descriptor array.
1791 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
1794 2017-06-15 Martin Sebor <msebor@redhat.com>
1797 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
1799 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
1800 (build_cxx_call): Call maybe_warn_class_memaccess.
1802 2017-06-14 Jakub Jelinek <jakub@redhat.com>
1804 * cp-gimplify.c (cp_genericize_r): Turn most of the function
1805 into a switch (TREE_CODE (stmt)) statement from long else if
1808 2017-06-13 Jakub Jelinek <jakub@redhat.com>
1811 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
1812 argument even if it has REFERENCE_TYPE.
1815 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
1816 BLOCK_VARS (outer) chain.
1817 (cxx_omp_const_qual_no_mutable): Likewise.
1819 2017-06-13 Martin Liska <mliska@suse.cz>
1822 * class.c (build_base_path): Use sanitize_flags_p.
1823 * cp-gimplify.c (cp_genericize_r): Likewise.
1824 (cp_genericize_tree): Likewise.
1825 (cp_genericize): Likewise.
1826 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1827 * decl.c (compute_array_index_type): Likewise.
1828 (start_preparsed_function): Likewise.
1829 * decl2.c (one_static_initialization_or_destruction): Likewise.
1830 * init.c (finish_length_check): Likewise.
1831 * lambda.c (maybe_add_lambda_conv_op): Likewise.
1832 * typeck.c (cp_build_binary_op): Likewise.
1833 (build_static_cast_1): Likewise.
1835 2017-06-11 Jason Merrill <jason@redhat.com>
1837 * error.c (dump_expr): Use is_this_parameter.
1839 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
1842 2017-06-09 Jason Merrill <jason@redhat.com>
1844 Missing bits from N4268, constant evaluation for all non-type args.
1845 * call.c (build_converted_constant_expr): Rename from
1846 build_integral_nontype_arg_conv, handle all types.
1847 * pt.c (convert_nontype_argument): In C++17 call it for all types.
1848 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
1849 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
1851 Overhaul pointer-to-member conversion and template argument handling.
1852 * call.c (standard_conversion): Avoid creating ck_pmem when the
1853 class type is the same.
1854 * cvt.c (can_convert_qual): Split from
1855 perform_qualification_conversions.
1856 * constexpr.c (cxx_eval_constant_expression): Check it.
1857 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
1858 adjustment is necessary.
1859 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
1860 (convert_nontype_argument): Avoid redundant error.
1862 * call.c (convert_like_real): Remove "inner" parameter.
1863 Don't replace a constant with its value.
1864 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
1866 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
1869 * parser.c (cp_parser_constant_expression): Check
1870 potential_rvalue_constant_expression after decay_conversion.
1871 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
1873 PR c++/80384 - ICE with dependent noexcept-specifier
1874 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
1877 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
1879 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
1881 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
1882 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
1883 (excpet.c): Mark terminate as cold.
1885 2017-06-08 Jakub Jelinek <jakub@redhat.com>
1888 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
1889 to sizetype before size_binop.
1892 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
1893 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
1894 and OMP_CLAUSE_SHARED_READONLY flags.
1896 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
1898 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
1900 2017-06-07 Nathan Sidwell <nathan@acm.org>
1902 * class.c (layout_class_type): Restructure overlong-bitfield tpe
1905 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
1908 * pt.c (do_class_deduction): Build qualified type.
1910 2017-06-06 Nathan Sidwell <nathan@acm.org>
1912 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
1913 sans using directives. Don't walk into inline namespaces.
1916 * name-lookup.c (adl_class_only): Don't add visible friends.
1918 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
1920 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
1922 2017-06-02 Nathan Sidwell <nathan@acm.org>
1924 Remove lang_type_ptrmem.
1925 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
1927 (lang_type_class): ... this. Reorder bitfields. Rename to ...
1928 (lang_type): ... this. Delete old definition.
1929 (lang_type_ptrmem): Delete.
1930 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
1931 (LANG_TYPE_PTRMEM_CHECK): Delete.
1932 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
1933 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
1934 * decl.c (build_ptrmemfunc_type): Adjust.
1935 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
1936 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
1938 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
1941 Remove cp_binding_level::namespaces
1942 * name-lookup.h (cp_binding_level): Lose namespaces field.
1943 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
1945 (suggest_alternatives_for): Adjust for namespace list. Do
1946 breadth-first search.
1947 * decl2.c (collect_source_refs): Namespaces are on the regulr
1949 (collect_ada_namespace): Likewise.
1951 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
1953 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
1956 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
1959 * method.c (constructible_expr): Strip array types before calling
1962 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
1965 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
1966 for case INDIRECT_REF too in the main switch.
1968 2017-05-31 Jason Merrill <jason@redhat.com>
1970 PR c++/80840 - ICE with constexpr and reference
1971 * pt.c (convert_nontype_argument): Don't test whether a decl is
1972 value-dependent when binding to a reference.
1974 2017-05-31 Nathan Sidwell <nathan@acm.org>
1976 * cp-tree.h (lang_decl_slector): New enum.
1977 (lang_decl_base): Make selector an enum. Drop decomposition_p
1979 (lang_decl): Use enum for discrimination.
1980 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
1981 LANG_DECL_DEOMP_CHECK): Use enum.
1982 (DECL_DECOMPOSITION_P): Use selector value.
1983 (SET_DECL_DECOMPOSITION_P): Delete.
1984 (retrofit_lang_decl): Lose SEL parm.
1985 (fit_decomposition_lang_decl): Declare.
1986 * decl.c (cp_finish_decomp, grokdeclarator): Use
1987 fit_decomposition_lang_decl.
1988 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
1990 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
1991 (fit_decomposition_lang_decl): Likewise.
1992 (retrofit_lang_decl): Use worker functions.
1993 (cxx_dup_lang_specific_decl): Use selector enum.
1994 (maybe_add_lang_type_raw): New. Broken out of ...
1995 (cxx_make_type_name): ... here. Call it.
1997 2017-05-30 Jason Merrill <jason@redhat.com>
1999 PR c++/80856 - ICE with local extern in template
2000 * semantics.c (finish_call_expr): Replace a local extern overload
2001 set in a template with the IDENTIFIER_NODE.
2003 2017-05-30 David Malcolm <dmalcolm@redhat.com>
2005 * call.c (perform_implicit_conversion_flags): Convert
2006 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
2007 (print_conversion_rejection): Replace pairs of %qT with
2008 %qH and %qI in various places.
2009 (build_user_type_conversion_1): Likewise.
2010 (build_integral_nontype_arg_conv): Likewise.
2011 (build_conditional_expr_1): Likewise.
2012 (convert_like_real): Likewise.
2013 (convert_arg_to_ellipsis): Likewise.
2015 (initialize_reference): Likewise.
2016 * cvt.c (cp_convert_to_pointer): Likewise.
2017 (cp_convert_to_pointer): Likewise.
2018 (convert_to_reference): Likewise.
2019 (ocp_convert): Likewise.
2020 * error.c (cp_printer): Gain bool and const char ** parameters.
2021 (struct deferred_printed_type): New struct.
2022 (class cxx_format_postprocessor): New class.
2023 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
2024 to pp->m_format_postprocessor.
2025 (comparable_template_types_p): New function.
2026 (newline_and_indent): New function.
2027 (arg_to_string): New function.
2028 (print_nonequal_arg): New function.
2029 (print_template_differences): New function.
2030 (type_to_string_with_compare): New function.
2031 (print_template_tree_comparison): New function.
2032 (append_formatted_chunk): New function.
2033 (add_quotes): New function.
2034 (cxx_format_postprocessor::handle): New function.
2035 (defer_phase_2_of_type_diff): New function.
2036 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
2038 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
2039 %qH and %qI in various places.
2040 (convert_member_func_to_ptr): Likewise.
2041 (build_reinterpret_cast_1): Likewise.
2042 (convert_for_assignment): Likewise.
2043 * typeck2.c (check_narrowing): Likewise.
2045 2017-05-30 Nathan Sidwell <nathan@acm.org>
2047 Kill IDENTIFIER_NAMESPACE_BINDINGS
2048 * cp-tree.h (lang_identifier): Delete namespace_bindings.
2049 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
2050 (lang_decl_ns): Add bindings.
2051 (DECL_NAMESPACE_BINDINGS): New.
2052 * lex.c (retrofit_lang_decl): Create namespace hash table.
2053 * name-lookup.c (find_namespace_slot): Change to use hash-map.
2054 * ptree.c (cxx_print_binding): Delete.
2055 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
2057 * cp-tree.def (OVERLOAD): Fix comment.
2058 * cp-tree.h: Fix comments and whitespace.
2059 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
2060 * name-lookup.c (add_decl_to_level): Assert not class.
2061 (check_local_shadow): Use OVL_P.
2062 (pushdecl_with_scope_1): Rename to ...
2063 (do_pushdecl_with_Scope): ... here.
2064 (do_nonmember_using_decl): Use qualified_namespace_lookup return
2066 (push_class_level_binding_1): Use OVL_P.
2067 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
2068 (pushtag_1): Rename to ...
2069 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
2071 (store_class_bindings): Do not time here.
2072 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
2073 * pt.c (listify): Declare argvec at point of initialization.
2076 * name-lookup.c (add_decl_to_level): Assert not making a circular
2078 (update_binding): Don't prematurely slide artificial decl.
2080 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
2082 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
2084 2017-05-29 Nathan Sidwell <nathan@acm.org>
2086 PR c++/80891 (#1,#5)
2087 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
2088 * name-lookup.c (name_lookup): Add deduping field.
2089 (name_lookup::preserve_state, name_lookup::restore_state): Deal
2091 (name_lookup::add_overload): New.
2092 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
2093 (name_lookup::search_adl): Set deduping. Don't unmark here.
2094 * pt.c (most_specialized_instantiation): Revert previous change,
2095 Assert not given duplicates.
2096 * tree.c (lookup_mark): Just mark the underlying decls.
2097 (lookup_maybe_add): Dedup using marked decls.
2100 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
2101 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
2103 Stat hack representation
2104 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
2105 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
2107 (find_namespace_binding): Replace with ...
2108 (find_namespace_slot): ... this.
2109 (find_namespace_value): New.
2110 (name_lookup::search_namespace_only,
2111 name_lookup::adl_namespace_only): Adjust.
2112 (update_binding): Add SLOT parameter, adjust.
2113 (check_local_shadow): Use find_namespace_value.
2114 (set_local_extern_decl_linkage): Likewise.
2115 (do_pushdecl): Adjust for namespace slot.
2116 (push_local_binding): Assert not a namespace binding.
2117 (check_for_out_of_scope_variable): Use find_namespace_value.
2118 (set_identifier_type_value_with_scope): Likewise.
2119 (get_namespace_binding): Likewise.
2120 (set_namespace_binding): Delete.
2121 (set_global_binding): Directly update the binding.
2122 (finish_namespace_using_decl): Likewise.
2123 (lookup_type_scope_1): Use find_namespace_slot and update.
2124 (do_push_nested_namespace): Use find_namespace_value.
2127 * pt.c (most_specialized_instantiation): Cope with duplicate
2131 * cp-tree.h (build_min_nt_call_vec): Declare.
2132 * decl.c (build_offset_ref_call_from_tree): Call it.
2133 * parser.c (cp_parser_postfix_expression): Likewise.
2134 * pt.c (tsubst_copy_and_build): Likewise.
2135 * semantics.c (finish_call_expr): Likewise.
2136 * tree.c (build_min_nt_loc): Keep unresolved lookups.
2137 (build_min): Likewise.
2138 (build_min_non_dep): Likewise.
2139 (build_min_non_dep_call_vec): Likewise.
2140 (build_min_nt_call_vec): New.
2143 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
2145 (lookup_keep): Call it.
2147 2017-05-26 Nathan Sidwell <nathan@acm.org>
2150 * name-lookup.c (push_inline_namespaces): New.
2151 (push_namespace): Look inside inline namespaces.
2153 Inline and using namespace representation change.
2154 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
2156 (DECL_NAMESPACE_USING): Adjust.
2157 (DECL_NAMESPACE_INLINEES): New.
2158 * name-lookup.h (struct cp_binding_level): Change usings
2160 * name-lookup.c (name_lookup::do_queue_usings,
2161 name_lookup::queue_usings): Adjust.
2162 (name_lookup::search_namespace, name_lookup::search_usings,
2163 name_lookup::queue_namespace): Adjust.
2164 (name_lookup::adl_namespace_only): Adjust.
2165 (add_using_namespace, push_namespace): Push onto vector.
2166 (pop_namespace): Add timing logic.
2168 * call.c (build_operator_new_call): Do namelookup and ADL here.
2169 (build_new_op_1): Likewise.
2170 * name-lookup.h (lookup_function_nonclass): Delete declaration.
2171 (do_using_directive): Likewise.
2172 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
2174 (struct scope_binding): Delete.
2175 (EMPTY_SCOPE_BINDING): Delete.
2176 (set_decl_namespace): Use OVL_P.
2177 (finish_local_using_decl): Lose unnecesary checks.
2178 (lookup_function_nonclass): Delete.
2179 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
2181 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
2182 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
2184 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
2185 (lkp_iterator): Add outer field. Adjust ctor.
2186 (lkp_iterator::operator++): New.
2187 (lookup_mark, lookup_maybe_add): Declare.
2188 * name-lookup.c (name_lookup): Delete fn_set member.
2189 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
2191 (name_lookup::add_value): Use lookup_add directly.
2192 (name_lookup::add_fns: Use lookup_maybe_add.
2193 (name_lookup::search_adl): Mark and unmark fns.
2195 * pt.c (check_explicit_specialization): Use lookup_add directly.
2196 * ptree.c (cxx_print_xnode): Show complete overload structure.
2197 * tree.c (lookup_mark, lookup_maybe_add): New.
2199 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
2201 2017-05-26 Jakub Jelinek <jakub@redhat.com>
2203 * cp-tree.h (struct lang_decl_decomp): New type.
2204 (struct lang_decl): Add u.decomp.
2205 (LANG_DECL_DECOMP_CHECK): Define.
2206 (DECL_DECOMPOSITION_P): Note it is set also on the vars
2207 for user identifiers.
2208 (DECL_DECOMP_BASE): Define.
2209 (retrofit_lang_decl): Add extra int = 0 argument.
2210 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
2211 use it to influence the selector choices and for selector
2212 0 to non-zero transition copy old content.
2213 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
2214 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
2215 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
2216 wording if decl is a structured binding.
2217 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
2218 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
2219 of individual variables for tuple structured bindings.
2220 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
2221 Clear DECL_DECOMP_BASE.
2222 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
2223 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
2225 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
2228 2017-05-25 Jason Merrill <jason@redhat.com>
2230 PR c++/80605 - __is_standard_layout and zero-length array
2231 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
2233 2017-05-25 Nathan Sidwell <nathan@acm.org>
2235 Kill OVL_CURRENT, OVL_NEXT.
2236 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
2237 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
2238 (consider_binding_level): Use OVL_FIRST.
2239 (cp_emit_debug_info_for_using): Use lkp_iterator.
2240 * pt.c (check_explicit_specialization): Use ovl_iterator.
2242 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
2243 * cp-tree.h (lang_decl_ns): Remove ns_users field.
2244 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
2245 (TREE_INDIRECT_USING): Delete.
2246 * name-lookup.h (is_associated_namespace): Delete.
2247 * name-lookup.c (name_lookup::search_usings,
2248 name_lookup::do_queue_usings): Usings are always direct.
2249 (is_associated_namespace): Delete.
2250 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
2251 (namespace_ancestor_1, namespace_ancestor): Delete.
2252 (push_using_directive_1, push_using_directive): Delete.
2253 (add_using_namespace_1): Delete.
2254 (add_using_namespace): Reimplement.
2255 (emit_debug_info_using_namespace): New.
2256 (finish_namespace_using_directive, finish_local_using_directive,
2257 push_namespace): Adjust.
2258 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
2260 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
2262 * semantics.c (finish_handler_parms): Warn about non-reference type
2265 2017-05-25 Nathan Sidwell <nathan@acm.org>
2267 Reimplement unqualified namespace lookup.
2268 * name-lookup.c (name_lookup::using_pair,
2269 name_lookup::using_queue): New typedefs.
2270 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
2271 name_lookup::queue_usings): New.
2272 (name_lookup::search_unqualified): New.
2273 (merge_functions, same_entity_p, ambiguous_decl,
2274 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
2275 lookup_using_namespace): Delete.
2276 (lookup_name_real_1): Adjust.
2278 Reimplement qualified namespace lookup.
2279 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
2280 (name_lookup::ambiguous, name_lookup::add_value,
2281 name_lookup::add_type, name_lookup::process_binding): New.
2282 (name_lookup::search_namespace_only,
2283 name_lookup::search_namespace, name_lookup::search_usings): New.
2284 (name_lookup::search_qualified): New.
2285 (do_nonmember_using_decl, suggest_alternatives_for,
2286 lookup_qualified_name): Adjust.
2287 (tree_vec_contains): Delete.
2288 (qualified_lookup_using_namespace): Rename to ...
2289 (qualified_namespace_lookup): ... here. Reimplement.
2292 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
2293 * name-lookup.h (lookup_arg_dependent): Return plain tree.
2294 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
2295 arg_assoc_args_vec, arg_assoc_type, add_function,
2296 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
2297 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
2298 lookup_arg_dependent_1): Delete.
2299 (name_lookup): New lookup object.
2300 (name_lookup::preserve_state, name_lookup::restore_state,
2301 name_lookup::mark_seen, name_lookup::find_and_mark,
2302 name_lookup::add_fns, name_lookup::adl_namespace_only,
2303 name_lookup::adl_namespace, name_lookup::adl_class_only,
2304 name_lookup::adl_bases, name_lookup::adl_class,
2305 name_lookup::adl_expr, name_lookup::adl_type,
2306 name_lookup::adl_template_arg, name_lookup::search_adl): New.
2307 (lookup_arg_dependent): Return a plain tree. Adjust.
2308 (is_associated_namespace): Move later.
2310 2017-05-24 Nathan Sidwell <nathan@acm.org>
2312 * friend.c (do_friend): Remove check for existing decl.
2313 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
2314 * name-lookup.c (push_local_binding): Directly look for binding.
2315 (lookup_name_innermost_nonclass_level_1): Delete.
2316 (lookup_name_innermost_nonclass_level): Delete.
2318 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
2320 * cp-tree.h (cp_free_lang_data): Add extern.
2321 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
2323 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
2324 * typeck.c (type_unknown_p): Delete.
2325 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
2326 overload management.
2327 (dependent_name): Likewise.
2328 (decl_anon_ns_mem_p): Simplify.
2330 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
2333 * tree.c (reshape_init): Use unqualified type for direct enum init.
2334 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
2335 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
2336 non-class destination types.
2337 (build_const_cast_1): Strip cv-quals from destination types.
2338 (build_static_cast, build_reinterpret_cast, build_const_cast)
2339 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
2341 2017-05-24 Martin Sebor <msebor@redhat.com>
2344 * call.c (fully_fold_internal): Adjust.
2346 2017-05-24 Nathan Sidwell <nathan@acm.org>
2348 * cp-tree.h (ovl_skip_hidden): Declare.
2349 * tree.c (ovl_skip_hidden): New.
2350 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
2351 (lookup_arg_dependent_1): Likewise.
2352 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
2353 (hidden_name_p, remove_hidden_names): Delete.
2354 (lookup_name_real_1): Do not strip hidden names.
2355 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
2357 * cp-tree.h (OVL_HIDDEN_P): New.
2358 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
2359 (ovl_iterator::reveal_node): Declare.
2360 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
2361 (ovl_insert): Order on hiddenness.
2362 (ovl_iterator::reveal_node): New.
2363 * name-lookup.c (anticipated_builtin_p): New.
2364 (supplement_binding_1): Use it.
2365 (set_local_extern_decl_linkage): Use hidden_p.
2366 (do_pushdecl): Deal with unhiding a hidden decl, use
2367 anticipated_builtin_p.
2368 (do_nonmember_using_decl): Use anticipated_decl_p.
2369 (lookup_name_real_1): Use DECL_HIDDEN_P.
2371 2017-05-23 Jason Merrill <jason@redhat.com>
2373 -Wunused and C++17 structured bindings
2374 * decl.c (poplevel): Don't warn about unused structured bindings,
2375 only real variables.
2376 * error.c (dump_simple_decl): Handle structured bindings.
2377 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
2379 2017-05-23 Nathan Sidwell <nathan@acm.org>
2381 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
2382 * name-lookup.c (create_local_binding): New.
2383 (update_binding): New.
2384 (pushdecl_maybe_friend_1): Rename to ...
2385 (do_pushdecl): ... this. Reimplement.
2387 (push_overloaded_decl_1, push_overloaded_decl): Delete.
2389 2017-05-23 Jason Merrill <jason@redhat.com>
2391 PR c++/80396 - built-in for make_integer_sequence.
2392 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
2393 (expand_integer_pack, expand_builtin_pack_call): New.
2394 (find_parameter_packs_r): Check builtin_pack_call_p.
2395 (check_for_bare_parameter_packs): Handle it.
2396 (tsubst_pack_expansion): Call expand_builtin_pack_call.
2397 (declare_integer_pack): New.
2398 (init_template_processing): Call it.
2399 * decl2.c (mark_used): Check builtin_pack_fn_p.
2401 2017-05-23 Nathan Sidwell <nathan@acm.org>
2403 * name-lookup.c (find_namespace_binding): New.
2404 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
2405 (set_identifier_type_value_with_scope): Use find_namespace_binding.
2406 (find_binding, cp_binding_level_find_binding_for_name,
2407 binding_for_name, namespace_binding_1): Delete.
2408 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
2409 (get_namespace_binding, set_namespace_binding,
2410 finish_namespace_using_decl, unqualified_namespace_lookup_1,
2411 qualified_lookup_using_namespace, lookup_type_scope_1,
2412 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
2415 * parser.c (cp_parser_template_id): Keep the lookup when stashing
2418 * cp-tree.h (DECL_HIDDEN_P): New.
2419 * name-lookup.c (set_decl_context,
2420 set_local_extern_decl_linkage): New, broken out of ...
2421 (pushdecl_maybe_friend_1): ... here. Call them.
2423 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
2425 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
2426 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
2429 2017-05-23 Nathan Sidwell <nathan@acm.org>
2431 * cp-tree.h (OVL_P): New.
2432 * name-lookup.h (push_local_binding): Delete.
2433 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
2434 (finish_namespace_using_decl, finish_local_using_decl): ... here
2435 * name-lookup.c (add_decl_to_level): Swap args.
2436 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
2437 (diagnose_name_conflict): Check contexts are same for redecl.
2438 (update_local_overload): New.
2439 (compparms_for_decl_and_using): Rename to ...
2440 (matching_fn_p): ... here.
2441 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
2442 push_local_bindings call.
2443 (push_local_binding): Make static, replace FLAGS arg with
2445 (validate_nonmember_using_decl): Use OVL_FIRST.
2446 (do_nonmember_using_decl): Use in/out parameters. Use
2447 lkp_iterator and simplify.
2448 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
2449 (finish_namespace_using_decl, finish_local_using_decl): ... here.
2451 (lookup_type_current_level): Delete.
2452 * parser.c (cp_parser_using_declaration): Adjust.
2453 * pt.c (tsubst_expr): Adjust.
2455 2017-05-22 Nathan Sidwell <nathan@acm.org>
2457 * name-lookup.h (parse_using_directive): Replace with ...
2458 (finish_namespace_using_directive): ... this and ...
2459 (finish_local_using_directive): ... this.
2460 * name-lookup.c (add_using_namespace_1): Move later.
2461 (add_using_namespace): Move later, add namespace_p arg, remove
2463 (push_using_directive_1): Directly recurse.
2464 (do_using_directive, parse_using_directive): Delete, split into ...
2465 (finish_namespace_using_directive): ... this and ...
2466 (finish_local_using_directive): ... this.
2467 (push_namespace): Use add_using_namespace.
2468 * parser.c (cp_parser_using_directive): Call
2469 finish_namespace_using_directive or finish_local_using_directive.
2470 * pt.c (tsubst_expr): Call finish_local_using_directive.
2472 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
2473 * cp-tree.h (raw_dump_id): Declare.
2474 * decl2.c (raw_dump_id): Define.
2475 (dump_tu): Use raw_dump_id.
2477 * config-lang.in (gtfiles): Sort list, break lines.
2479 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
2480 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
2481 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
2482 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
2483 CPTI_RETHROW_FN): New.
2484 (noexcept_deferred_spec): New.
2485 (terminate_node, call_unexpected_node): Rename to ...
2486 (terminate_fn, call_unexpected_fn): ... here.
2487 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
2488 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
2489 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
2490 (init_exception_processing): Adjust.
2491 (declare_library_fn): Create and push the fns here.
2492 (do_get_exception_ptr, do_begin_catch, do_end_catch,
2493 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
2494 declare_library_fn use.
2495 (unevaluated_noexcept_spec): Adjust.
2496 * cp-gimplify.c (genericize_eh_spec_block,
2497 gimplify_most_not_throw_expr): Adjust.
2499 * name-lookup.c (pushdecl_top_level,
2500 pushdecl_top_level_and_finish): Move after namespace pushing and
2502 (push_to_top_level): Rename to ...
2503 (do_push_to_top_level): ... here. Remove timing code.
2504 (pop_from_top_level_1): Rename to ...
2505 (do_pop_from_top_level): ... here.
2506 (do_push_nested_namespace, do_pop_nested_namespace)
2507 (push_to_top_level): New wrapper for do_push_to_top_level.
2508 (pop_from_top_level): Adjust.
2509 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
2511 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
2513 * config-lang.in (gtfiles): Add c-family/c-format.c,
2514 except.c, init.c, lambda.c and friend.c.
2515 * class.c (dvirt_fn): Move out of function scope,
2517 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
2518 * init.c (fn): Likewise.
2519 * lambda.c (ptr_id, max_id): Likewise.
2520 * friend.c (global_friend): Add GTY attribute.
2522 2017-05-19 Nathan Sidwell <nathan@acm.org>
2524 * call.c (add_list_candidates): Use OVL_FIRST.
2525 (build_new_method_call_1): Likewise.
2526 * cp-tree.h (OVL_SINGLE_P): New.
2527 (TYPE_HIDDEN_P): New.
2528 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
2529 * dump.c (cp_tump_tree): Adjust overload dumping.
2530 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
2532 * method.c (lazily_declare_fn): Assert we added it.
2533 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
2535 (cp_parser_template_name): Use lkp_iterator.
2536 * pt.c (begin_template_parm_list): Fixup comment.
2537 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
2538 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
2539 (ovl_scope): Use lkp_iterator.
2541 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
2543 * parser.c (cp_parser_omp_clause_default): Handle
2544 "OMP_CLAUSE_DEFAULT_PRESENT".
2546 * parser.c (cp_parser_omp_clause_default): Avoid printing more
2547 than one syntax error message.
2549 2017-05-19 Nathan Sidwell <nathan@acm.org>
2551 * class.c (class_dump_id): Define.
2552 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
2553 * cp-objcp-common.c (cp_register_dumps): New.
2554 * cp-objcp-common.h (cp_register_dumps): Declare.
2555 (LANG_HOOKS_REGISTER_DUMPS): Override.
2556 * cp-tree.h (class_dump_id): Declare.
2558 2017-05-18 Nathan Sidwell <nathan@acm.org>
2560 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
2562 (lookup_keep): Declare.
2563 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
2564 * pt.c (tsubst_copy): Assert lookup is persistent.
2565 * semantics.c (finish_call_expr): Use lkp_iterator, call
2567 * tree.c (ovl_copy): New.
2568 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
2571 * cp-tree.h (OVL_USED): Replace with ...
2572 (OVL_USING_P): ... this.
2573 (ovl_iterator::using_p): Adjust.
2574 * name-lookup.c (push_overloaded_decl_1,
2575 do_nonmember_using_decl): Adjust.
2576 * search.c (lookup_field_r): Adjust.
2577 * tree.c (ovl_insert, ovl_scope): Adjust.
2579 * cp-tree.h (lookup_add): Swap args.
2580 (ovl_cons, build_overload): Delete.
2581 * name-lookup.c (add_function, push_overloaded_decl_1,
2582 do_nonmember_using_decl, merge_functions, remove_hidden_names):
2583 Use lookup_add, ovl_insert.
2584 * pt.c (check_explicit_specialization): Use lookup_add.
2585 (do_class_deduction): Likewise. Refactor if.
2586 * tree.c (lookup_add): Swap args.
2587 (ovl_cons, build_overload): Delete.
2589 * name-lookup.c (find_local_binding): New, broken out of ...
2590 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
2591 (set_namespace_binding): Swap scope & name args.
2592 (namespace_binding_1): Likewise.
2593 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
2594 (push_overloaded_decl_1): Likewise.
2595 (set_global_binding): Likewise.
2596 (get_namespace_binding): Adjust namespace_binding_1 call.
2598 2017-05-17 Nathan Sidwell <nathan@acm.org>
2600 * cp-tree.h (default_hash_traits <lang_identifier *>): New
2602 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
2603 (extern_c_fns): New hash table.
2604 (check_extern_c_conflict): New, broken out of ...
2605 (pushdecl_maybe_friend_1): ... here. Call it.
2606 (c_linkage_bindings): Just look in hash table.
2608 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
2612 Implement new C++ intrinsics __is_assignable and __is_constructible.
2613 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
2615 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
2616 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2617 * method.c (constructible_expr): Set cp_unevaluated.
2618 (is_xible_helper): New.
2619 (is_trivially_xible): Adjust.
2621 * parser.c (cp_parser_primary_expression): Handle
2622 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
2623 (cp_parser_trait_expr): Likewise.
2624 * semantics.c (trait_expr_value): Handle
2625 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2627 2017-05-17 Nathan Sidwell <nathan@acm.org>
2629 * cp-tree.h (ovl_iterator::using_p): New predicate.
2630 (ovl_iterator::remove_node): New worker.
2631 (ovl_insert): Declare.
2632 * tree.c (ovl_insert): New.
2633 (ovl_iterator::remove_node): New.
2634 * class.c (add_method): Use ovl_iterator, ovl_insert.
2635 (clone_function_decl): Fix description.
2636 (clone_constructors_and_destructors): Use ovl_iterator.
2638 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
2639 (maybe_warn_about_overly_private_class): Use ovl_iterator.
2640 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
2641 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
2642 (get_base_fndecls): Use ovl_iterator.
2643 (warn_hidden): Use OVL_NAME, ovl_iterator.
2644 (add_implicitly_declared_members): Use ovl_iterator.
2645 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
2647 (finish_shorthand_constraint): Simplify, use ovl_make.
2648 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
2649 * search.c (shared_member_p): Use ovl_iterator.
2650 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
2651 (lookup_conversion_operator): Use OVL_FIRST.
2652 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
2653 (look_for_overrides_here): Use ovl_iterator.
2654 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
2655 * typeck.c (build_x_unary_op): Use ovl_make.
2657 2017-05-17 Martin Liska <mliska@suse.cz>
2659 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
2660 use it instead of int type.
2661 (dump_vtable): Likewise.
2662 (dump_vtt): Likewise.
2663 * decl2.c (dump_tu): Likewise.
2665 2017-05-16 David Malcolm <dmalcolm@redhat.com>
2667 * call.c (enforce_access): Add access_failure_info * param and use
2668 it to record access failures.
2669 * cp-tree.h (class access_failure_info): New class.
2670 (enforce_access): Add access_failure_info * param, defaulting to
2672 (lookup_member): Likewise.
2673 (locate_field_accessor): New function decl.
2674 (perform_or_defer_access_check): Add access_failure_info * param,
2676 * search.c (lookup_member): Add access_failure_info * param and
2677 pass it on to call to perform_or_defer_access_check.
2678 (matches_code_and_type_p): New function.
2679 (field_access_p): New function.
2680 (direct_accessor_p): New function.
2681 (reference_accessor_p): New function.
2682 (field_accessor_p): New function.
2683 (struct locate_field_data): New struct.
2684 (dfs_locate_field_accessor_pre): New function.
2685 (locate_field_accessor): New function.
2686 * semantics.c (perform_or_defer_access_check): Add
2687 access_failure_info * param, and pass it on to call to
2689 * typeck.c (access_failure_info::record_access_failure): New method.
2690 (access_failure_info::maybe_suggest_accessor): New method.
2691 (finish_class_member_access_expr): Pass an access_failure_info
2692 instance to the lookup_member call, and call its
2693 maybe_suggest_accessor method afterwards.
2695 2017-05-16 Marek Polacek <polacek@redhat.com>
2699 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
2701 2017-05-16 Nathan Sidwell <nathan@acm.org>
2703 * name-lookup.c (check_local_shadow): New, broke out of ...
2704 (pushdecl_maybe_friend_1): ... here. Call it.
2706 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
2707 (ovl_first): Move inline definition to end of file.
2708 (ovl_make, lookup_add): Declare.
2709 (get_fns, get_first_fn): Make pure.
2710 * tree.c (ovl_cache): New.
2711 (ovl_make, lookup_add): New.
2712 * pt.c (do_class_deduction): Don't add candidates that will be
2715 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
2716 (print_error_for_call_failure): Use OVL_NAME.
2717 (build_op_call_1): Use ovl_iterator.
2718 (add_candidates): Use OVL_FIRST & lkp_iterator.
2719 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
2721 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
2722 (type_has_user_nondefault_constructor,
2723 in_class_defaulted_default_constructor,
2724 type_has_user_provided_constructor,
2725 type_has_user_provided_or_explicit_constructor,
2726 type_has_non_user_provided_default_constructor,
2727 vbase_has_user_provided_move_assign,
2728 type_has_move_constructor, type_has_move_assign,
2729 type_has_user_declared_move_constructor,
2730 type_has_user_declared_move_assign,
2731 type_build_ctor_call, type_build_dtor_call,
2732 type_requires_array_cookie, explain_non_literal_class): Likewise.
2733 (finish_struct): Use lkp_iterator.
2734 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
2735 (note_name_declared_in_class): Use OVL_NAME.
2736 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
2737 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
2738 cxx_pretty_printer::expression): Likewise.
2739 * decl2.c (check_classfn): Use ovl_iterator.
2740 * pt.c (retrieve_specialization): Use ovl_iterator.
2741 * tree.c (cp_tree_equal): Use lkp_iterator.
2742 (type_has_nontrivial_copy_init): Use ovl_iterator.
2744 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
2745 check is_overloaded_fn.
2747 2017-05-16 Martin Liska <mliska@suse.cz>
2749 * parser.c (cp_lexer_print_token): Add default value for flags
2750 argument of print_gimple_stmt, print_gimple_expr,
2751 print_generic_stmt and print_generic_expr.
2753 2017-05-16 Nathan Sidwell <nathan@acm.org>
2755 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
2757 (MAYBE_BASELINK_FUNCTIONS): New.
2758 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
2759 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
2760 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
2761 * method.c (inherited_ctor_binfo): Use ovl_iterator.
2762 (binfo_inherited_from): Likewise.
2763 * parser.c (lookup_literal_operator): Use lkp_iterator.
2764 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
2765 (print_candidates_1): Likewise.
2766 (determine_specialization): Likewise.
2767 (resolve_overloaded_unification): Likewise.
2768 (resolve_nondeduced_context): Likewise.
2769 (type_dependent_expression_p): Likewise.
2770 (dependent_template_p): Likewise.
2771 * ptree.c (cxx_print_xnode): Likewise.
2772 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
2773 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
2774 * typeck.c (check_template_keyword): Use lkp_iterator.
2776 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
2778 * constexpr.c (function_concept_check): Use OVL_FIRST.
2779 * cvt.c (build_expr_type_conversion): Likewise.
2780 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
2781 * decl2.c (mark_used): Use OVL_FIRST.
2782 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
2783 (dump_expr, location_of): Use OVL_FIRST.
2784 * friend.c (do_friend): Use OVL_NAME.
2785 * init.c (build_offset_ref): Use OVL_FIRST.
2786 * mangle.c (write_member_name): Likewise.
2787 (write_expression): Use OVL_NAME.
2788 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
2789 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
2790 * pt.c (check_explicit_specialization): Use OVL_FIRST.
2791 (check_template_shadow): Likewise.
2792 (tsubst_template_args): Use OVL_NAME.
2793 (tsubst_baselink): Use OVL_FIRST.
2794 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
2795 * tree.c (get_first_fn): Use OVL_FIRST.
2796 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
2797 (cp_build_addr_expr_1): Use OVL_FIRST.
2799 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
2801 * semantics.c (finish_id_expression): Directly init local var.
2802 (finish_omp_reduction_clause): Use really_overloaded_fn.
2803 * tree.c (get_fns): Document. Assert we got an overload.
2804 (get_first_fn) Document.
2805 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
2806 really_overloaded_fn.
2807 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
2809 * cp-tree.h (SCOPE_DEPTH): New.
2810 * name-lookup.h (is_nested_namespace): Declare.
2811 * name-lookup.c (is_nested_namespace): New.
2812 (is_ancestor): Use it.
2813 (set_decl_namespace): Likewise.
2814 (push_namespace): Set SCOPE_DEPTH.
2815 * pt.c (check_specialization_namespace): Use is_nested_namespace.
2816 (check_unqualigied_spec_or_inst): Likewise.
2818 2017-05-15 Nathan Sidwell <nathan@acm.org>
2821 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
2822 * name-lookup.h (push_namespace): Return int, add make_inline arg.
2823 * name-lookup.c (push_namespace): Deal with inline directly.
2824 Return pushed count.
2825 * parser.c (cp_parser_namespace_definition): Adjust for
2826 push_namespace change.
2828 2017-05-11 Nathan Sidwell <nathan@acm.org>
2830 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
2831 LANG_HOOKS_PUSHDECL): Move to ...
2832 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
2833 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
2834 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
2836 * name-lookup.h (pushdecl): Add default friend parm.
2837 (pushdecl_maybe_friend): Delete.
2838 (pushdecl_top_level): Add default friend parm.
2839 (pushdecl_top_level_maybe_friend): Delete.
2840 * name-lookup.c (pushdecl_maybe_friend): Delete.
2841 (pushdecl): Add is_friend parm.
2842 (pushdecl_top_level): Add is friend_parm.
2843 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
2844 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
2845 * friend.c (do_friend): Adjust.
2846 * pt.c (tsubst_friend_class): Adjust.
2848 Revert pushdecl_top_level_and_finish name change.
2849 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
2850 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
2851 * decl.c (cp_make_fname_decl): Adjust.
2852 * decl2.c (get_guard, handle_tls_init): Adjust.
2853 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
2855 * name-lookup.c (pushdecl_outermost_localscope): Always
2856 conditionally stop timer.
2858 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
2859 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
2861 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
2862 pushtag_top_level_maybe_friend,
2863 pushdecl_top_level_and_finish): Move declarations to ...
2864 * name-lookup.h: ... here. Group pushdecl variants.
2865 (pushdecl_top_level_and_finish): Rename to ...
2866 (pushdecl_top_level_with_init): ... here.
2867 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
2868 * decl2.c (get_guard, handle_tls_init): Likewise.
2869 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
2870 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
2871 * method.c (implicitly_declare_fn): Likewise.
2872 * searchc (node_debug_info_needed): Likewise.
2873 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
2874 (pushdecl_top_level_with_init): ... here.
2875 (pop_everything): Use namespace_bindings_p.
2877 * name-lookup.h (pop_binding): Rename to pop_local_binding.
2878 (getdecls): Rename to get_local_decls.
2879 * name-lookup.c (pop_binding): Rename to ...
2880 (pop_local_binding): ... here.
2881 (pop_bindings_and_leave_scope): Adjust.
2882 (getdecls): Rename to ...
2883 (get_local_decls): ... here. Assert local scope.
2884 * decl.c (poplevel): Assert not namespace. Adjust and simplify
2886 (store_parm_decls): Adjust get_local_decls call.
2887 (parser.c (synthesize_implicit_template_parm): Likewise.
2889 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
2892 * method.c (is_trivially_xible): Reject void types.
2894 2017-05-10 Nathan Sidwell <nathan@acm.org>
2896 * class.c (handle_using_decl): Always use OVL_CURRENT.
2897 (resolve_address_of_overloaded_function): Move iterator decl into
2898 for scope. Don't strip anticipated decls here.
2900 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
2902 (print_candidates): Adjust.
2904 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
2906 * call.c (build_new_function_call): Lose koenig_p arg. Remove
2907 koenig_p handling here.
2908 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
2909 (tsubst_omp_clauses): Likewise.
2910 (do_class_deduction): Adjust buld_new_function_call calls.
2911 * semantics.c (finish_call_expr): Likewise.
2913 2017-05-10 Jason Merrill <jason@redhat.com>
2915 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
2916 (unify_type_mismatch, unify_parameter_pack_mismatch)
2917 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
2918 (unify_parameter_pack_inconsistent, unify_inconsistency)
2919 (unify_vla_arg, unify_method_type_error, unify_arity)
2920 (unify_arg_conversion, unify_no_common_base)
2921 (unify_inconsistent_template_template_parameters)
2922 (unify_template_deduction_failure)
2923 (unify_template_argument_mismatch)
2924 (unify_overload_resolution_failure): Call unify_invalid.
2926 CWG 1847 - Clarifying compatibility during partial ordering
2927 * pt.c (more_specialized_fn): No order between two non-deducible
2930 * pt.c (dependent_type_p): Make sure we aren't called with
2933 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2934 * pt.c (convert_template_argument): Just return an argument pack.
2935 (coerce_template_parameter_pack, template_parm_to_arg)
2936 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
2937 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
2938 Don't set the type of a NONTYPE_ARGUMENT_PACK.
2939 * parser.c (make_char_string_pack, make_string_pack): Likewise.
2941 2017-05-10 Nathan Sidwell <nathan@acm.org>
2943 * cp-tree.h (add_method, clone_function_decl): Change last arg to
2945 * class.c (add_method): Change third arg to bool. Adjust.
2946 (one_inheriting_sig, one_inherited_ctor): Adjust.
2947 (clone_function_decl): Change 2nd arg to bool. Adjust.
2948 (clone_constructors_and_destructors): Adjust.
2949 * lambda.c (maybe_add_lambda_conv_op): Adjust.
2950 * method.c (lazily_declare_fn): Adjust.
2951 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
2952 * semantics.c (finish_member_declaration): Adjust.
2954 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
2957 * decl.c (finish_function): To improve error recovery, change the
2958 logic for calling apply_deduced_return_type.
2960 2017-05-09 Jason Merrill <jason@redhat.com>
2962 PR c++/80605 - __is_standard_layout and empty base
2963 * class.c (check_bases): Ignore empty bases.
2965 PR c++/70979 - literal class and closure types
2966 * class.c (finalize_literal_type_property): Handle closures
2968 (explain_non_literal_class): Likewise.
2970 PR c++/66297, DR 1684 - literal class and constexpr member fns
2971 * constexpr.c (is_valid_constexpr_fn): Only complain about
2972 non-literal enclosing class in C++11.
2973 * class.c (finalize_literal_type_property): Likewise.
2975 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
2978 * pt.c (tsubst_decl): Early return error_mark_node if
2979 grok_ctor_properties returns false.
2981 2017-05-09 Jason Merrill <jason@redhat.com>
2983 PR c++/70167 - array prvalue treated as lvalue
2984 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
2986 * semantics.c (finish_compound_literal): Add fcl_context parameter.
2987 Only make a static variable for C99 syntax.
2988 * parser.c (cp_parser_postfix_expression): Pass it.
2989 * pt.c (tsubst_copy_and_build): Likewise.
2990 * call.c (extend_ref_init_temps): Set
2991 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2993 2017-05-09 Nathan Sidwell <nathan@acm.org>
2995 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
2996 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
2997 * name-lookup.h (pushdecl_top_level): Declare.
2999 2017-05-08 Jason Merrill <jason@redhat.com>
3001 PR c++/80178 - parameter passing for uncopyable classes
3002 * tree.c (type_has_nontrivial_copy_init): True for classes with only
3003 deleted copy/move ctors.
3004 (remember_deleted_copy, maybe_warn_parm_abi): New.
3005 * decl.c (require_complete_types_for_parms, check_function_type):
3006 Call maybe_warn_parm_abi.
3007 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
3009 2017-05-08 Nathan Sidwell <nathan@acm.org>
3011 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
3012 (start_preparsed_function): Do decl pushing before setting
3013 current_funciton_decl and announcing it.
3015 * name-lookup.h (pushdecl_with_scope): Replace with ...
3016 (pushdecl_outermost_localscope): ... this.
3017 * name-lookup.c (pushdecl_with_scope): Replace with ...
3018 (pushdecl_outermost_localscope): ... this.
3019 (pushdecl_namespace_level): Adjust.
3020 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
3021 * lambda.c (insert_capture_proxy): Likewise.
3023 * class.c (build_vtbl_initializer): Don't shadow outer variable
3026 Revert _binding -> _value change.
3027 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
3028 (get_namespace_binding, set_global_binding): ... these.
3029 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
3030 (get_namespace_binding, set_global_binding): ... these.
3031 (arg_assoc_namespace, pushdecl_maybe_friend_1,
3032 check_for_out_of_scope_variable, push_overloaded_decl_1,
3033 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
3034 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
3035 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
3036 * decl.c (poplevel): Adjust.
3037 * pt.c (make_constrained_auto): Likewise.
3039 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
3041 PR translation/80280
3042 * call.c (print_z_candidate): Fix quoting.
3044 2017-05-05 David Malcolm <dmalcolm@redhat.com>
3046 * error.c (pedwarn_cxx98): Replace report_diagnostic
3047 with diagnostic_report_diagnostic.
3049 2017-05-05 Nathan Sidwell <nathan@acm.org>
3051 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
3052 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
3053 (IDENTIFIER_NAMESPACE_VALUE): Delete.
3054 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
3056 (get_namespace_value, set_global_value): ... these.
3057 (get_global_value_if_present, is_typename_at_global_scope): Delete.
3058 * decl.c (poplevel): Use get_namespace_value.
3059 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
3060 * class.c (build_vtbl_initializer): Stash library decl in
3061 static var. Use IDENTIFIER_GLOBAL_VALUE.
3062 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
3063 do_allocate_exception, do_free_exception, build_throw): Likewise.
3064 * init.c (throw_bad_array_new_length): Likewise.
3065 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
3066 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
3067 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
3068 get_namespace_value.
3069 (set_namespace_binding_1): Rename to
3070 (set_namespace_binding): ... here.
3071 (set_global_value): New.
3072 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
3073 get_namespace_value.
3074 * pt.c (listify): Use get_namespace_value.
3076 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
3078 * lex.c (unqualified_name_lookup_error): Likewise.
3080 * class.c (alter_class): Use retrofit_lang_decl directly.
3081 * decl.c (push_local_name, dupliate_decls): Likewise.
3082 * semantics.c (omp_privatize_field): Likewise.
3084 Kill walk_namespaces.
3085 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
3086 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
3088 Kill per-namespace static_decls.
3089 * cp-tree.h (static_decls): Declare.
3090 (wrapup_globals_for_namespace,
3091 diagnose_inline_vars_for_namespace): Replace with ...
3092 (wrapup_namespace_globals): ... this.
3093 * decl.c (static_decls): Define.
3094 (wrapup_globals_for_namespace,
3095 diagnose_inline_vars_for_namespace): Replace with ...
3096 (wrapup_namespace_globals): ... this.
3097 (cxx_init_decl_processing): Initialize static_decls.
3098 * decl2.c (c_parse_final_cleanups): Adjust.
3099 * name-lookup.h (cp_binding_level): Remove static_decls member.
3100 * name-lookup.c (add_decl_to_level): Adjust.
3101 (begin_scope): Adjust.
3103 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
3106 * decl.c (reshape_init): Unconditionally return error_mark_node
3107 upon error about too many initializers.
3109 2017-05-04 Nathan Sidwell <nathan@acm.org>
3111 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
3113 2017-05-04 Martin Sebor <msebor@redhat.com>
3115 PR translation/80280
3116 * call.c (print_z_candidate): Add missing quoting to %D and other
3118 (build_op_call_1): Same.
3119 * constraint.cc (diagnose_check_constraint): Same.
3120 * mangle.c (mangle_decl): Same.
3121 * name-lookup.c (cp_binding_level_debug): Same.
3122 (set_decl_namespace): Same.
3123 * parser.c (cp_parser_tx_qualifier_opt): Same.
3124 * pt.c (print_candidates_1): Same.
3125 (check_template_variable): Same.
3126 (tsubst_default_argument): Same.
3127 (most_specialized_partial_spec): Same.
3128 * semantics.c (omp_reduction_lookup): Same.
3129 * tree.c (check_abi_tag_redeclaration): Same.
3130 * typeck.c (comptypes): Same.
3131 * typeck2.c (abstract_virtuals_error_sfinae): Same.
3133 2017-05-04 Nathan Sidwell <nathan@acm.org>
3136 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
3137 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
3138 CPTI_INIT_LIST_IDENTIFIER.
3139 (global_namespace, global_type_node, global_identifier,
3140 anon_identifier, init_list_identifier): New.
3141 * decl.c (global_type_node, global_scope_name): Delete.
3142 (initialize_predefined_identifiers): Add new identifiers.
3143 (cxx_init_decl_processing): Adjust.
3144 * name-lookup.h (global_namespace, global_type_node): Delete.
3145 * name-lookup.c (global_namespace, anonymous_namespace_name,
3146 get_anonymous_namespace_name): Delete.
3147 (namespace_scope_ht_size, begin_scope, pushtag_1,
3148 push_namespace): Adjust,
3149 * call.c (type_has_extended_temps): Use init_list_identifier.
3150 * pt.c (listify): Likewise.
3152 * name-lookup.c: Reorder functions to make merging from modules
3155 2017-05-03 Jason Merrill <jason@redhat.com>
3157 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
3159 2017-05-03 Nathan Sidwell <nathan@acm.org>
3161 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
3162 along with #defines, to before name-lookup include.
3164 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
3166 * pt.c (is_auto_or_concept): Remove.
3167 (type_uses_auto_or_concept): Remove, unused.
3168 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
3169 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
3170 * cp-tree.h (is_auto_or_concept): Remove.
3172 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
3175 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
3176 add pedigree operation and detach call here.
3177 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
3178 cilk_cp_gimplify_call_params_in_spawned_fn.
3179 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
3180 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
3182 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
3184 * parser.c (cp_parser_member_declaration): Add fix-it hints for
3185 stray comma and missing semicolon at end of member declaration.
3187 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
3189 * parser.c (cp_parser_cast_expression): Add target type of cast to
3191 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
3193 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
3195 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
3196 return type to bool.
3197 * cp-tree.h (grok_ctor_properties): Update.
3199 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
3201 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
3202 information to diagnostic of invalid colon in nested-name-specifier.
3204 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
3206 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
3207 diagnostic of invalid class/struct keyword after enum.
3209 2017-04-25 David Malcolm <dmalcolm@redhat.com>
3211 * parser.c (cp_parser_member_declaration): Add fix-it hint
3212 for removing stray semicolons.
3214 2017-04-25 David Malcolm <dmalcolm@redhat.com>
3216 * name-lookup.c (get_std_name_hint): New function.
3217 (maybe_suggest_missing_header): New function.
3218 (suggest_alternative_in_explicit_scope): Call
3219 maybe_suggest_missing_header.
3221 2017-04-25 David Malcolm <dmalcolm@redhat.com>
3224 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
3225 candidate type of bm from tree to const char *.
3226 (consider_binding_level): Likewise.
3227 (lookup_name_fuzzy): Likewise, using this to merge the best
3228 result from the preprocessor into bm, rather than immediately
3229 returning, so that better matches from reserved words can "win".
3230 Guard the rejection of keywords that don't start decl-specifiers
3231 so it only happens for FUZZY_LOOKUP_TYPENAME.
3233 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
3235 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
3236 (start_enum): Likewise.
3237 (build_enumerator): Likewise. Use %qE instead of plain %E.
3238 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
3239 %<%D%> in diagnostics.
3240 (cp_parser_elaborated_type_specifier): Likewise.
3241 * pt.c (make_pack_expansion): Use %qT and %qE instead of
3242 %<%T%> and %<%E%> in diagnostics.
3243 (tsubst_pack_expansion): Likewise.
3245 2017-04-24 David Malcolm <dmalcolm@redhat.com>
3248 * parser.c (cp_parser_unary_expression): Generate a location
3249 range for alignof and sizeof expressions.
3251 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
3253 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
3255 (cp_parser_virt_specifier_seq_opt): Likewise.
3256 (set_and_check_decl_spec_loc): Likewise twice.
3258 2017-04-21 Jason Merrill <jason@redhat.com>
3260 PR c++/80179 - ICE with initialized flexible array member.
3261 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
3263 2017-04-21 Richard Biener <rguenther@suse.de>
3265 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
3266 (copy_type): Likewise.
3267 * lex.c (copy_decl): Pass down mem-stat info.
3268 (copy_type): Likewise.
3270 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
3273 * init.c (build_new_1): Suppress notes about over-aligned new when
3274 the warning is suppressed.
3276 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
3278 * parser.c (cp_parser_member_declaration): Add warning with fixit
3279 information for extra semicolon after in-class function definition.
3281 2017-04-20 Jakub Jelinek <jakub@redhat.com>
3284 * tree.c (build_cplus_array_type): Call build_array_type
3285 with the intended TYPE_TYPELESS_STORAGE flag value, instead
3286 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
3289 2017-04-18 Marek Polacek <polacek@redhat.com>
3291 PR c++/80244 - ICE with attribute in template alias.
3292 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
3294 PR c++/80241 - ICE with alignas pack expansion.
3295 * error.c (dump_expr): Handle TREE_LIST.
3296 * parser.c (cp_parser_std_attribute_list): Return error_mark if
3297 make_pack_expansion returns an error.
3299 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
3302 * class.c (fixup_may_alias): Fix all type variants.
3304 2017-04-17 Jason Merrill <jason@redhat.com>
3306 PR c++/80415 - wrong error with default arg and array reference.
3307 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
3309 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
3311 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
3313 * decl.c (name_unnamed_type): Split out of...
3314 (grokdeclarator): ... this.
3315 * decl.h (name_unnamed_type): Declare.
3317 2017-04-12 Richard Biener <rguenther@suse.de>
3318 Bernd Edlinger <bernd.edlinger@hotmail.de>
3321 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
3322 for arrays of character or std::byte type.
3324 2017-04-11 Jason Merrill <jason@redhat.com>
3326 PR c++/80294 - ICE with constexpr and inheritance.
3327 * constexpr.c (reduced_constant_expression_p):
3328 A null constructor element is non-constant.
3329 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
3330 returning an empty base.
3332 2017-04-11 Jakub Jelinek <jakub@redhat.com>
3335 * decl.c (cp_finish_decomp): If processing_template_decl on
3336 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
3337 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
3338 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
3340 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
3341 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
3344 2017-04-11 Jakub Jelinek <jakub@redhat.com>
3347 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
3349 2017-04-10 Jakub Jelinek <jakub@redhat.com>
3352 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
3353 operand, if it is a static member function, recurse on the
3356 2017-04-10 Marek Polacek <polacek@redhat.com>
3359 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
3360 ORIG_TYPE earlier and not only when shortening.
3362 2017-04-07 Jason Merrill <jason@redhat.com>
3364 PR c++/80356 - ICE with reference to function template argument.
3366 * pt.c (convert_nontype_argument_function): Adjust type even with a
3367 value-dependent argument.
3369 PR c++/80267 - ICE with nested capture of reference
3371 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
3373 2017-04-07 Marek Polacek <polacek@redhat.com>
3376 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
3379 * call.c (build_over_call): Don't check cxx_dialect.
3380 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
3381 whether SUB is a CONSTRUCTOR.
3382 * init.c (build_new_1): Don't check cxx_dialect.
3383 * tree.c (replace_placeholders): Add a function comment. Return if
3384 not in C++14, or if the object isn't a (member of a) class.
3385 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
3386 TYPE is CLASS_TYPE_P.
3388 2017-04-05 Jakub Jelinek <jakub@redhat.com>
3391 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
3392 of a loop doing vec_safe_push of NULL. Formatting fixes.
3393 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
3394 to newidx before calling canonical_type_parameter on newtype.
3396 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
3399 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
3400 UNARY_PLUS_EXPR case.
3402 2017-04-03 Jason Merrill <jason@redhat.com>
3404 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
3406 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
3408 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
3409 * decl2.c (one_static_initialization_or_destruction): Likewise.
3410 * name-lookup.c (store_bindings): Likewise.
3411 * parser.c (make_call_declarator): Likewise.
3412 * pt.c (check_explicit_specialization): Likewise.
3414 2017-04-03 Jason Merrill <jason@redhat.com>
3416 PR sanitizer/79993 - ICE with VLA initialization from string
3417 PR c++/69487 - wrong VLA initialization from string
3418 * init.c (finish_length_check): Split out from build_vec_init.
3419 (build_vec_init): Handle STRING_CST.
3420 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
3421 (digest_init_r): Don't give a STRING_CST VLA type.
3423 2017-03-31 Jakub Jelinek <jakub@redhat.com>
3426 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
3427 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
3428 for NOP_EXPR to REFERENCE_TYPE.
3431 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
3432 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3434 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
3435 Remove extraneous parens.
3436 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
3437 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
3438 (cp_parser_trait_expr): Likewise.
3440 2017-03-27 Jakub Jelinek <jakub@redhat.com>
3443 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
3444 * typeck.c (cxx_mark_addressable): Likewise. Look through
3445 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
3447 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
3449 2017-03-24 Jason Merrill <jason@redhat.com>
3451 PR c++/77339 - ICE with invalid use of alias template.
3452 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
3455 2017-03-24 Marek Polacek <polacek@redhat.com>
3458 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
3459 doesn't have side effects.
3461 2017-03-23 Jason Merrill <jason@redhat.com>
3463 PR c++/80150 - ICE with overloaded variadic deduction.
3464 * pt.c (try_one_overload): Remove asserts.
3466 PR c++/77563 - missing ambiguous conversion error.
3467 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
3469 2017-03-23 Marek Polacek <polacek@redhat.com>
3471 * cp-tree.h: Remove a C_RID_YYCODE reference.
3473 2017-03-22 Jakub Jelinek <jakub@redhat.com>
3476 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
3477 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
3478 processing_template_decl.
3480 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
3483 * name-lookup.c (pushtag_1): Add check for bogus, non template,
3484 std::initializer_list.
3486 2017-03-21 Jakub Jelinek <jakub@redhat.com>
3489 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
3491 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
3494 * init.c (std_placement_new_fn_p): New.
3495 (build_new_1): Call it.
3497 2017-03-20 Jason Merrill <jason@redhat.com>
3499 PR c++/80096 - ICE with C++17 non-type auto.
3500 * pt.c (tsubst): Delay tsubst of type of template non-type
3503 PR c++/79519 - ICE with deleted template friend.
3504 * decl.c (grokdeclarator): Complain about misplaced function
3505 definition using =, as well.
3507 PR c++/79640 - infinite recursion with generic lambda.
3508 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
3509 before substituting its initializer.
3511 2017-03-20 Marek Polacek <polacek@redhat.com>
3512 Paolo Carlini <paolo.carlini@oracle.com>
3514 PR c++/80059 - ICE with noexcept and __transaction_atomic
3515 * except.c (build_must_not_throw_expr): Call
3516 instantiate_non_dependent_expr.
3518 2017-03-19 Jason Merrill <jason@redhat.com>
3520 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
3521 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
3522 reference decomposition.
3524 PR c++/80077 - error with constexpr and -fno-elide-constructors.
3525 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
3526 expanding trivial constructor.
3528 2017-03-17 Jason Merrill <jason@redhat.com>
3530 PR c++/78345 - ICE initializing array from lambda.
3531 * init.c (build_aggr_init): Check array initializer.
3532 (build_vec_init): Check the type of a CONSTRUCTOR.
3534 PR c++/80073 - C++17 ICE with virtual base.
3535 * decl.c (xref_basetypes): Also check for indirect vbases.
3537 2017-03-16 Jason Merrill <jason@redhat.com>
3539 * decl.c (start_enum): std::byte aliases anything.
3542 * constexpr.c (lookup_placeholder): Tweak.
3544 2017-03-15 Jason Merrill <jason@redhat.com>
3546 PR c++/80043 - ICE with -fpermissive
3547 * typeck.c (convert_for_assignment): Handle instantiate_type
3548 not giving an error.
3550 2017-03-14 Nathan Sidwell <nathan@acm.org>
3552 PR c++/79393 DR 1658 workaround
3553 * method.c (synthesized_method_base_walk): Inihibit abstract class
3554 virtual base access check here.
3555 (synthesized_method_walk): Not here.
3557 2017-03-13 Nathan Sidwell <nathan@acm.org>
3559 PR c++/79393 DR 1658 workaround
3560 * method.c (synthesized_method_walk): Check vbases of abstract
3561 classes for dtor walk.
3563 2017-03-10 David Malcolm <dmalcolm@redhat.com>
3565 PR translation/79848
3566 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
3568 2017-03-10 Jason Merrill <jason@redhat.com>
3570 PR c++/79960 - alias templates and partial ordering
3571 * pt.c (comp_template_args): Add partial_order parm.
3572 (template_args_equal): Likewise.
3573 (comp_template_args_porder): New.
3574 (get_partial_spec_bindings): Use it.
3576 2017-03-10 Marek Polacek <polacek@redhat.com>
3579 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
3581 2017-03-10 Jakub Jelinek <jakub@redhat.com>
3584 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
3585 Use XALLOCAVEC macro.
3588 * decl.c (finish_enum_value_list): If value is error_mark_node,
3589 don't copy it and change its type.
3590 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
3591 of CONST_DECL is error_mark_node.
3593 2017-03-09 Marek Polacek <polacek@redhat.com>
3595 PR c++/79900 - ICE in strip_typedefs
3596 * tree.c (strip_typedefs): Skip the attribute handling if T is
3597 a variant type which hasn't been updated yet.
3599 PR c++/79687 - wrong code with pointer-to-member
3600 * init.c (constant_value_1): Break if the variable has a dynamic
3603 2017-03-08 Jason Merrill <jason@redhat.com>
3605 PR c++/79797 - ICE with self-reference in array DMI.
3606 * constexpr.c (lookup_placeholder): Split out...
3607 (cxx_eval_constant_expression): ...from here.
3609 2017-03-07 Jakub Jelinek <jakub@redhat.com>
3612 * parser.c (cp_parser_omp_cancellation_point,
3613 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
3614 cp_parser_omp_target_update): Change "may only be used in compound
3615 statements" diagnostics, such that the same translatable string is
3616 used for all pragmas.
3617 (cp_parser_pragma): Likewise. Use error_at instead of
3618 cp_parser_error for that diagnostics.
3620 2017-03-06 Marek Polacek <polacek@redhat.com>
3622 PR c++/79796 - ICE with NSDMI and this pointer
3623 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
3624 replace_placeholders.
3626 2017-03-06 Jakub Jelinek <jakub@redhat.com>
3629 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
3632 2017-03-06 Jason Merrill <jason@redhat.com>
3634 Revert "Allow deduction guides to look into primary template."
3635 * cp-tree.h, parser.c, pt.c, search.c: Revert.
3637 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
3640 * except.c (build_must_not_throw_expr): Perform the implicit
3641 conversions on the condition.
3643 2017-03-03 Jason Merrill <jason@redhat.com>
3645 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
3648 Core issues 2273 and 2277
3649 * call.c (joust): Adjust using-declaration tiebreaker to handle
3650 the intermediate base case.
3651 * method.c (strip_inheriting_ctors): Just return the argument if
3652 !flag_new_inheriting_ctors.
3654 2017-03-03 Richard Biener <rguenther@suse.de>
3657 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
3659 2017-03-03 Marek Polacek <polacek@redhat.com>
3662 * typeck.c (string_conv_p): In C++11, always call pedwarn with
3665 2017-03-02 Jason Merrill <jason@redhat.com>
3667 Update overload resolution with deduction guides.
3668 * pt.c (do_class_deduction): Always build the copy guide.
3669 (copy_guide_p, template_guide_p): New.
3670 (build_deduction_guide): Remember the original constructor.
3671 * call.c (joust): Prefer the copy guide and non-template guides.
3673 Allow deduction guides to look into primary template.
3674 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
3675 (struct cp_decl_specifier_seq): Add constructor_p.
3676 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
3677 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
3678 Clear deduction_guide_type. Don't handle deduction guide names.
3679 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
3680 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
3681 (cp_parser_member_declaration, cp_parser_cache_defarg)
3682 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
3683 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
3684 (build_deduction_guide): Set deduction_guide_type.
3685 (dependent_scope_p): Check deduction_guide_type.
3686 * search.c (lookup_member): Likewise.
3688 2017-03-02 Jakub Jelinek <jakub@redhat.com>
3691 * init.c (mark_exp_read_r): New function.
3692 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
3693 whole arguments instead of plain mark_exp_read on TREE_LIST values.
3695 2017-03-01 Jason Merrill <jason@redhat.com>
3697 Class template argument deduction in new-expression
3698 * init.c (build_new): Handle deduction from no initializer.
3699 * parser.c (cp_parser_new_expression): Don't require a single
3700 expression for class template deduction.
3701 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
3702 class template placeholder.
3703 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
3704 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
3705 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
3707 2017-03-01 Jakub Jelinek <jakub@redhat.com>
3710 * init.c (emit_mem_initializers): When not constructing vbases of
3711 abstract classes, mark arguments as read for
3712 -Wunused-but-set-parameter.
3714 2017-02-28 Jason Merrill <jason@redhat.com>
3716 Class template argument deduction refinements
3717 * call.c (joust): Move deduction guide tiebreaker down.
3718 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
3719 deduction with no initializer.
3720 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
3721 (do_class_deduction): Use that rather than special case.
3722 (do_auto_deduction): Handle null initializer.
3724 2017-02-28 Jakub Jelinek <jakub@redhat.com>
3726 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
3727 instead of just cond ? "..." : "...".
3728 (grokdeclarator): Likewise.
3729 (build_enumerator): Likewise.
3730 * init.c (build_new_1): Likewise.
3731 * call.c (build_new_method_call_1): Likewise.
3732 * parser.c: Include intl.h.
3733 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
3734 "enter"/"exit" keyword.
3735 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
3738 2017-02-27 Jason Merrill <jason@redhat.com>
3740 PR c++/71568 - SFINAE forming pointer to member function
3741 * init.c (build_offset_ref): Check the return value of
3742 perform_or_defer_access_check.
3744 2017-02-27 Marek Polacek <polacek@redhat.com>
3746 * decl.c (expand_static_init): Add missing } in a comment.
3748 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
3750 * init.c: Include intl.h.
3751 (build_new_1): Move message strings into pedwarn to make them
3752 -Wformat-security friendly. Mark string for translation.
3753 * pt.c (tsubst_copy_and_build): Mark string for translation.
3754 Make the pointer const.
3755 * semantics.c (finish_id_expression): Mark strings for translation.
3757 2017-02-25 Jakub Jelinek <jakub@redhat.com>
3759 * call.c (build_op_delete_call): Make msg1 and msg2 const.
3761 2017-02-24 Jakub Jelinek <jakub@redhat.com>
3764 * call.c (build_over_call): Call check_function_arguments even for
3765 -Wrestrict, adjust check_function_arguments caller.
3766 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
3768 * typeck.c (cp_build_function_call_vec): Adjust
3769 check_function_arguments caller.
3771 2017-02-24 Marek Polacek <polacek@redhat.com>
3773 PR translation/79705
3774 * decl.c (check_redeclaration_exception_specification): Mark a string
3775 for translation. Make the pointer const.
3777 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
3780 * pt.c (register_specialization): Check duplicate_decls return value
3781 for error_mark_node and pass it back.
3783 2017-02-22 Jason Merrill <jason@redhat.com>
3785 PR c++/79679 - missing destructor for argument
3786 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
3789 * pt.c (do_class_deduction): Handle 0 argument case.
3791 2017-02-22 Jakub Jelinek <jakub@redhat.com>
3794 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
3795 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
3796 * constexpr.c (potential_constant_expression_1): Handle
3797 OMP_*, OACC_* and CILK_* trees. Use error_at with
3798 EXPR_LOC_OR_LOC (t, input_location) computed early
3799 instead of error, or error_at with location_of (t).
3801 2017-02-22 Marek Polacek <polacek@redhat.com>
3804 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
3805 if the alignas expression is erroneous.
3806 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
3810 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
3812 2017-02-21 Jason Merrill <jason@redhat.com>
3814 PR c++/50308 - wrong deprecated warning with ADL
3815 PR c++/17729 - duplicate deprecated warning
3816 * semantics.c (finish_id_expression): Only call mark_used on a
3817 function if we aren't building a call.
3819 PR c++/41727 - ICE with partial spec of partial instantiation
3820 * pt.c (process_partial_specialization): For now, don't check more
3821 specialized if there is more than one level of args.
3823 2017-02-21 Marek Polacek <polacek@redhat.com>
3826 * cp-tree.h (maybe_reject_flexarray_init): Declare.
3827 * init.c (maybe_reject_flexarray_init): No longer static.
3828 Add check for current_function_decl.
3829 * parser.c (cp_parser_late_parse_one_default_arg): Reject
3830 a default mem-initializer for a flexible array.
3832 2017-02-21 Jakub Jelinek <jakub@redhat.com>
3833 Paolo Carlini <paolo.carlini@oracle.com>
3836 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
3838 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
3839 decl after the decomposition artificial decl has error_mark_node.
3840 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
3841 instead of just == error_mark_node comparison.
3843 2017-02-21 Jakub Jelinek <jakub@redhat.com>
3846 * decl.c: Include gimplify.h.
3847 (cp_finish_decomp): Make sure there is no sharing of trees
3848 in between DECL_VALUE_EXPR of decomposition decls.
3851 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
3854 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
3855 call cplus_expand_constant on it first.
3857 2017-02-19 Jason Merrill <jason@redhat.com>
3859 PR c++/78139 - destructor needed by new-expression
3860 * call.c (build_special_member_call): Use tf_no_cleanup.
3862 PR c++/78282 - auto template and pack expansion
3863 * pt.c (find_parameter_packs_r): Don't walk into the type of
3864 templates other than template template-parameters.
3866 PR c++/79606 - ICE with this->base_member in NSDMI
3867 * class.c (build_base_path): Check processing_template_decl.
3869 PR c++/79607 - ICE with T{} initializer
3870 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
3872 PR c++/79566 - elaborated-type-specifier in range for
3873 * parser.c (cp_parser_simple_declaration): Fix check for type
3876 PR c++/79400 - confusing suggestion of 'noexcept'
3877 * parser.c (cp_parser_exception_specification_opt): Remove
3878 suggestion for deprecated dynamic exception-specification.
3880 PR c++/79470 - partial ordering with reference parameters
3881 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
3883 PR c++/79500 - ICE with non-template deduction guide
3884 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
3885 DECL_TEMPLATE_RESULT.
3887 PR c++/79580 - ICE with compound literal
3888 * parser.c (cp_parser_class_head): If we're in the middle of an
3889 expression, use ts_within_enclosing_non_class.
3891 PR c++/79503 - inherited ctor taking base class
3892 * call.c (add_function_candidate): Also check that
3893 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
3895 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
3898 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
3901 2017-02-19 Eric Fiselier <eric@efcs.ca>
3902 Jonathan Wakely <jwakely@redhat.com>
3905 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
3906 control warning about literal suffix identifiers without a leading
3909 2017-02-17 Jason Merrill <jason@redhat.com>
3911 PR c++/79508 - lookup error with member template
3912 * parser.c (cp_parser_template_name): Clear
3913 parser->context->object_type if we aren't doing lookup.
3915 PR c++/78690 - ICE with using and global type with same name
3916 * pt.c (type_dependent_object_expression_p): True for
3919 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3920 * pt.c (convert_template_argument): Just return an auto arg pack.
3921 (tsubst_template_args): Don't tsubst an auto pack type.
3923 PR c++/79556 - C++17 ICE with non-type auto
3924 * pt.c (do_auto_deduction): Don't try to deduce from null type.
3926 PR c++/79533 - C++17 ICE with temporary cast to reference
3927 * call.c (build_over_call): Conversion to a reference prevents copy
3930 2017-02-16 Jakub Jelinek <jakub@redhat.com>
3931 Jason Merrill <jason@redhat.com>
3933 PR c++/79502 - lost nodiscard attribute
3934 * pt.c (apply_late_template_attributes): Do apply non-dependent
3935 attributes to types.
3937 2017-02-16 Jason Merrill <jason@redhat.com>
3939 PR c++/78572 - ICE with self-modifying array initializer
3940 * constexpr.c (cxx_eval_store_expression): The object we're
3941 initializing is outside the constant-expression.
3942 (cxx_eval_call_expression): Set ctx->call.
3944 PR c++/79050 - ICE with undeduced auto and LTO
3945 * decl.c (poplevel): Remove undeduced auto decls.
3947 2017-02-16 Jakub Jelinek <jakub@redhat.com>
3950 * parser.c (cp_parser_omp_target): For -fopenmp-simd
3951 ignore #pragma omp target even when not followed by identifier.
3953 2017-02-15 Jason Merrill <jason@redhat.com>
3954 Jakub Jelinek <jakub@redhat.com>
3956 PR c++/79464 - ICE in IPA with omitted constructor parms
3957 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
3958 (adjust_clone_args): Adjust.
3959 (add_method): Remember omitted parms.
3960 * call.c (add_function_candidate): Likewise.
3961 * mangle.c (write_method_parms): Likewise.
3962 * method.c (ctor_omit_inherited_parms): Return false if there are no
3965 2017-02-15 Martin Sebor <msebor@redhat.com>
3968 * init.c (maybe_reject_flexarray_init): New function.
3969 (perform_member_init): Call it.
3971 2017-02-15 Jakub Jelinek <jakub@redhat.com>
3974 * parser.c (cp_parser_std_attribute): Don't pedwarn about
3975 [[deprecated]] with -std=c++11 and [[fallthrough]] with
3976 -std=c++11 and -std=c++14.
3979 * decl.c (grokdeclarator): For static data members, handle thread_p
3980 only after handling inline.
3982 2017-02-14 Marek Polacek <polacek@redhat.com>
3986 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
3987 clobbering if the postfix expression isn't an EXPR_P.
3989 2017-02-13 Jason Merrill <jason@redhat.com>
3991 PR c++/79461 - ICE with lambda in constexpr constructor
3992 * constexpr.c (build_data_member_initialization): Ignore
3993 initialization of a local variable.
3995 2017-02-13 Jakub Jelinek <jakub@redhat.com>
3997 * init.c (warn_placement_new_too_small): Add missing space in
3999 * parser.c (cp_parser_oacc_declare): Likewise.
4000 * mangle.c (maybe_check_abi_tags): Likewise.
4003 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
4004 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
4005 in the rightmost operand.
4007 2017-02-13 Nathan Sidwell <nathan@acm.org>
4009 PR c++/79296 - ICE mangling localized template instantiation
4010 * decl2.c (determine_visibility): Use template fn context for
4011 local class instantiations.
4013 2017-02-11 Jason Merrill <jason@redhat.com>
4015 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
4016 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
4017 (build_new_1): Use replace_placeholders.
4018 * tree.c (replace_placeholders_t): Also track whether we've seen a
4020 (replace_placeholders, replace_placeholders_r): Adjust.
4021 * cp-tree.h: Adjust.
4023 PR c++/77790 - ICE with auto function in C++11 mode
4024 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
4025 (require_deduced_type): Add complain parm, return bool.
4026 * cp-tree.h: Adjust.
4027 * decl2.c (mark_used): Use require_deduced_type.
4029 2017-02-10 Jason Merrill <jason@redhat.com>
4031 PR c++/78908 - template ops and bitfields
4032 * tree.c (build_min_non_dep): Use unlowered_expr_type.
4034 PR c++/78897 - constexpr union
4035 * constexpr.c (cxx_eval_store_expression): A store to a union member
4036 erases a previous store to another member.
4038 PR c++/71285 - member of fold-expression
4039 * semantics.c (finish_unary_fold_expr)
4040 (finish_binary_fold_expr): Use null type for fold-expressions.
4042 PR c++/79401 - protected inherited constructor
4043 * call.c (enforce_access): For inheriting constructor, find a base
4044 binfo in the path we already have.
4046 2017-02-10 Marek Polacek <polacek@redhat.com>
4049 * pt.c (type_dependent_expression_p): Check if the expression type
4053 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
4054 if warnings shouldn't be given.
4056 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
4059 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
4060 an error_mark_node as type.
4062 2017-02-09 Jakub Jelinek <jakub@redhat.com>
4063 Jason Merrill <jason@redhat.com>
4066 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
4067 from pattern to type.
4069 2017-02-09 Jason Merrill <jason@redhat.com>
4071 PR c++/79316 - default argument in deduction guide
4072 PR c++/79350 - explicit deduction guide
4073 * parser.c (cp_parser_constructor_declarator_p)
4074 (cp_parser_direct_declarator): Parse deduction guides more like
4076 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
4077 * tree.c (special_function_p): Return it.
4078 * decl.c (check_special_function_return_type): Handle it.
4079 (grokdeclarator, grokfndecl): Adjust.
4080 (cp_finish_decl): Pass flags to do_auto_deduction.
4081 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
4082 * pt.c (dguide_name_p): Take a const_tree.
4083 (do_class_deduction): Handle explicit.
4084 (do_auto_deduction): Pass flags through.
4085 (build_deduction_guide): Copy explicit flag.
4087 2017-02-09 Jakub Jelinek <jakub@redhat.com>
4090 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
4091 non-pragma_compound context here.
4092 (cp_parser_omp_target): Likewise.
4093 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
4094 parsing for ordered and target omp pragmas in non-pragma_stmt
4095 non-pragma_compound contexts.
4098 * parser.c (cp_parser_oacc_declare): Formatting fix.
4099 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
4100 automatic variables.
4102 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
4103 Chung-Lin Tang <cltang@codesourcery.com>
4105 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
4106 parsing. Parse constant expression. Remove semantic checking.
4107 (cp_parser_omp_clause_collapse): Disallow tile.
4108 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
4109 error about missing for after already emitting one. Use more
4110 conventional for idiom for unbounded loop.
4111 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
4112 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
4113 (finish_omp_for): Deal with tile clause.
4115 2017-02-07 Nathan Sidwell <nathan@acm.org>
4117 * method.c (synthesized_method_base_walk): New. Broken out of ...
4118 (synthesized_method_walk): ... here. Call it. Cleanup
4121 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
4124 * typeck2.c (process_init_constructor_union): Consider only
4125 FIELD_DECLs when looking for an NSDMI.
4127 2017-02-06 Jason Merrill <jason@redhat.com>
4129 PR c++/71193 - incomplete types in templates
4130 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
4131 handle incomplete type by pedwarning and then treating as dependent.
4133 2017-02-06 Jakub Jelinek <jakub@redhat.com>
4136 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
4137 (potential_constant_expression_1): Likewise.
4140 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
4141 allow one fewer than expected arguments if flag_permissive.
4144 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
4145 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
4146 with error_mark_node type.
4148 2017-02-03 Jason Merrill <jason@redhat.com>
4150 PR c++/78689 - ICE on constructor with label
4151 * optimize.c (maybe_clone_body): Replace omitted parameters with
4153 * class.c (build_clone): Fix logic for omitting inherited parms.
4155 PR c++/12245 - excessive memory use
4156 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
4157 back in. Don't cache constants.
4158 (maybe_constant_init): Don't cache constants.
4160 PR c++/79294 - ICE with invalid template argument
4161 * pt.c (convert_nontype_argument_function): Check value-dependence.
4162 (convert_nontype_argument): Don't check it here for function ptrs.
4164 2017-02-02 Richard Biener <rguenther@suse.de>
4167 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
4168 it lazily on the first changed element only and copy it
4169 fully upfront, only storing changed elements.
4171 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
4174 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
4177 2017-01-31 Jakub Jelinek <jakub@redhat.com>
4180 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
4183 2017-01-31 David Malcolm <dmalcolm@redhat.com>
4186 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
4187 any namespace aliases.
4189 2017-01-31 Nathan Sidwell <nathan@acm.org>
4192 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
4196 * pt.c: (instantiate_decl): Push to top level when current
4197 function scope doesn't match. Only push lmabda scope stack when
4200 * cp-tree.h (instantiate_decl): Make defer_ok bool.
4201 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
4202 (instantiate_decl): Simplify and reorder state saving and restoration.
4205 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
4206 * semantics.c (finish_member_declaration): Assert class is being
4209 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
4211 Introduce C++ support in libcc1.
4212 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
4213 (ansi_opname): Rename to...
4214 (cp_operator_id): ... this. Adjust all callers.
4215 (ansi_assopname): Rename to...
4216 (cp_assignment_operator_id): ... this. Adjust all callers.
4217 (cp_literal_operator_id): Declare.
4218 (set_global_friend): Declare.
4219 (is_global_friend): Declare.
4220 (enum cp_oracle_request): New type.
4221 (cp_binding_oracle_function): New type.
4222 (cp_binding_oracle): Declare.
4223 (cp_finish_injected_record_type): Declare.
4224 * friend.c (global_friend): New var.
4225 (set_global_friend): New fn.
4226 (is_global_friend): New fn.
4227 (is_friend): Call is_global_friend.
4228 * name-lookup.c (cp_binding_oracle): New var.
4229 (query_oracle): New fn.
4230 (qualified_lookup_using_namespace): Call query_oracle.
4231 (lookup_name_real_1): Likewise.
4232 * parser.c (cp_literal_operator_id): Drop static.
4233 * search.c (friend_accessible_p): Call is_global_friend.
4234 * semantics.c (is_this_parameter): Accept a variable if the
4235 binding oracle is enabled.
4237 2017-01-27 Jason Merrill <jason@redhat.com>
4239 PR c++/78771 - ICE with inherited constructor.
4240 * call.c (build_over_call): Call deduce_inheriting_ctor here.
4241 * pt.c (tsubst_decl): Not here.
4242 * class.c (add_method): Or here.
4243 * method.c (deduce_inheriting_ctor): Handle clones.
4244 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
4246 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
4249 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
4251 * cp/cp-tree.h: Declare it.
4252 * cp/semantics.c (finish_id_expression): Resolve names within a default
4253 capturing generic lambda defined within a template prior to
4254 instantiation to allow for captures to be added to the closure type.
4256 2017-01-26 Jakub Jelinek <jakub@redhat.com>
4259 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
4260 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
4261 * parser.c (cp_parser_builtin_offsetof): Pass result of
4262 build_static_cast of null_pointer_node to finish_offsetof.
4263 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
4264 it for -Winvalid-offsetof pedwarn instead of trying to guess
4265 original offsetof type from EXPR. Save OBJECT_PTR as a new
4266 second operand to OFFSETOF_EXPR.
4267 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
4268 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
4271 2017-01-26 Jason Merrill <jason@redhat.com>
4273 * name-lookup.c (parse_using_directive): Deprecate strong using.
4275 PR c++/79176 - lambda ICE with -flto -Os
4276 * decl2.c (vague_linkage_p): Handle decloned 'tors.
4277 * tree.c (decl_linkage): Likewise.
4279 2017-01-25 Martin Sebor <msebor@redhat.com>
4281 * decl.c (grokdeclarator): Fix a typo in a comment.
4283 2017-01-25 Jakub Jelinek <jakub@redhat.com>
4286 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
4290 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
4291 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
4293 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
4296 * decl.c (cxx_init_decl_processing): Pass main_input_filename
4297 to build_translation_unit_decl.
4299 2017-01-24 Jakub Jelinek <jakub@redhat.com>
4302 * cp-gimplify.c (cp_genericize_r): Add result of
4303 convert_from_reference on invisiref parm to p_set.
4305 2017-01-24 Nathan Sidwell <nathan@acm.org>
4307 PR c++/78469 - defaulted ctor and inaccessible dtor
4308 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
4309 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
4310 * tree.c (build_target_expr): Check tf_no_cleanup.
4312 PR c++/79118 - anon-members and constexpr
4313 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
4314 ctor decl. Recursively check anonymous members.
4315 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
4317 (explain_invalid_constexpr_fn): Likewise.
4319 2017-01-23 Nathan Sidwell <nathan@acm.org>
4321 PR c++/71710 - template using directive of field
4322 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
4325 PR c++/71406 - ICE with scope-ref'd template id exprs
4327 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
4328 before breaking up TEMPLATE_ID_EXPR.
4330 2017-01-20 Nathan Sidwell <nathan@acm.org>
4332 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
4333 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
4335 2017-01-20 David Malcolm <dmalcolm@redhat.com>
4339 * cp-tree.h (suggest_alternatives_for): Add bool param.
4340 (suggest_alternative_in_explicit_scope): New decl.
4341 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
4342 that isn't the global one, call new function
4343 suggest_alternative_in_explicit_scope, only calling
4344 suggest_alternatives_for if it fails, and disabling near match
4345 searches fort that case. When SCOPE is the global namespace,
4346 pass true for new param to suggest_alternatives_for to allow for
4348 * lex.c (unqualified_name_lookup_error): Pass true for new param
4349 to suggest_alternatives_for.
4350 * name-lookup.c (consider_binding_level): Add forward decl.
4351 (suggest_alternatives_for): Add "suggest_misspellings" param,
4352 using it to conditionalize the fuzzy name-lookup code.
4353 (suggest_alternative_in_explicit_scope): New function.
4354 * parser.c (cp_parser_primary_expression): When calling
4355 finish_id_expression, pass location of id_expression rather
4356 than that of id_expr_token.
4357 (cp_parser_id_expression): Convert local "unqualified_id" from
4358 tree to cp_expr to avoid implicitly dropping location information.
4360 2017-01-20 Marek Polacek <polacek@redhat.com>
4363 * call.c (build_conditional_expr_1): Warn about duplicated branches.
4364 * semantics.c (finish_expr_stmt): Build statement using the proper
4367 2017-01-19 Jason Merrill <jason@redhat.com>
4369 US 20 - forwarding references and class template argument deduction
4370 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
4371 * pt.c (push_template_decl_real): Set it.
4372 (maybe_adjust_types_for_deduction): Check it.
4373 (rewrite_template_parm): Copy it.
4375 US 19 - deduction guides and constructors
4376 * call.c (joust): Prefer deduction guides to constructors.
4377 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
4378 (deduction_guide_p): Check DECL_P.
4380 * decl.c (check_initializer): Always use build_aggr_init for array
4383 PR c++/79130 - decomposition and direct-initialization
4384 * init.c (build_aggr_init): Communicate direct-initialization to
4386 (build_vec_init): Check for array copy sooner.
4387 * parser.c (cp_parser_decomposition_declaration): Remove call to
4388 build_x_compound_expr_from_list.
4390 2017-01-18 Jason Merrill <jason@redhat.com>
4392 PR c++/68666 - member variable template-id
4393 * typeck.c (finish_class_member_access_expr): Handle variable
4395 * pt.c (lookup_and_finish_template_variable): No longer static.
4396 * cp-tree.h: Declare it.
4398 2017-01-18 Nathan Sidwell <nathan@acm.org>
4401 * call.c (build_over_call): When checking ellipsis conversions for
4402 an inherited ctor, make sure there is at least one conversion.
4404 2017-01-18 Jason Merrill <jason@redhat.com>
4406 PR c++/78894 - ICE with class deduction and default arg
4407 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
4409 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4412 * mangle.c (write_discriminator): Reorganize abi warning check.
4414 2017-01-18 Nathan Sidwell <nathan@acm.org>
4416 * cp-tree.h: Clarify exception spec node comment.
4417 * except.c (nothrow_spec_p): Simplify by checking node-equality.
4420 * mangle.c (write_exception_spec): Check nothrow explicitly.
4421 (write_encoding): Don't increment processing_template_decl around
4424 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4427 * mangle.c (write_template_args): Add "on" for operator names.
4429 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4432 * mangle.c (write_discriminator): Handle discriminator >= 10.
4434 2017-01-17 Nathan Sidwell <nathan@acm.org>
4437 * cp-tree.h (maybe_generic_this_capture): Declare.
4438 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
4439 (maybe_resolve_dummy): ... here. Call it.
4440 (maybe_generic_this_capture): New.
4441 * parser.c (cp_parser_postfix_expression): Speculatively capture
4442 this in generic lambda in unresolved member function call.
4443 * pt.c (tsubst_copy_and_build): Force hard error from failed
4444 member function lookup in generic lambda.
4446 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
4449 * cp-array-notation.c (expand_array_notation_exprs): Handle
4452 2017-01-11 Jason Merrill <jason@redhat.com>
4454 PR c++/78337 - ICE on invalid with generic lambda
4455 * semantics.c (process_outer_var_ref): Check if containing_function
4456 is null. Move inform call under complain test.
4458 2017-01-11 Nathan Sidwell <nathan@acm.org>
4461 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
4464 2017-01-11 Nathan Sidwell <nathan@acm.org>
4466 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
4468 2017-01-11 Jakub Jelinek <jakub@redhat.com>
4471 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
4472 assertion. Formatting fix.
4475 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
4478 2017-01-10 David Malcolm <dmalcolm@redhat.com>
4481 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
4482 a missing semicolon if we have a valid insertion location for
4485 2017-01-10 Jason Merrill <jason@redhat.com>
4487 FI 20, decomposition declaration with parenthesized initializer.
4488 * parser.c (cp_parser_decomposition_declaration): Use
4489 cp_parser_initializer.
4491 2017-01-09 Jason Merrill <jason@redhat.com>
4493 Implement P0195R2, C++17 variadic using.
4494 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
4495 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
4496 * error.c (dump_decl): Likewise.
4498 2017-01-09 Jakub Jelinek <jakub@redhat.com>
4500 PR translation/79019
4501 PR translation/79020
4502 * semantics.c (finish_omp_clauses): Add missing whitespace to
4503 translatable strings.
4504 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
4506 2017-01-07 Jason Merrill <jason@redhat.com>
4508 PR c++/78948 - instantiation from discarded statement
4509 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
4510 * cp-tree.h (in_discarded_stmt): Declare it.
4511 (struct saved_scope): Add discarded_stmt bitfield.
4512 (in_discarded_stmt): New macro.
4513 * decl2.c (mark_used): Check it.
4514 * parser.c (cp_parser_selection_statement): Adjust.
4515 (cp_parser_jump_statement): Adjust.
4517 2017-01-05 Jakub Jelinek <jakub@redhat.com>
4520 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
4521 REFERENCE_REF_P, set tt to its operand.
4524 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
4525 unions even for C++11 and later.
4527 2017-01-05 Nathan Sidwell <nathan@acm.org>
4530 * pt.c (convert_nontype_argument): Don't try and see if integral
4531 or enum expressions are constants prematurely.
4533 2017-01-04 Marek Polacek <polacek@redhat.com>
4536 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
4537 a zero character literal.
4539 2017-01-04 Jakub Jelinek <jakub@redhat.com>
4542 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
4546 * parser.c (cp_parser_simple_declaration): Only complain about
4547 inconsistent auto deduction if auto_result doesn't use auto.
4549 * parser.c (cp_parser_simple_declaration): Diagnose function
4550 declaration among more than one init-declarators with auto
4554 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
4555 assertion, as lexer->buffer may be NULL.
4557 2017-01-04 Marek Polacek <polacek@redhat.com>
4561 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
4563 2017-01-04 Nathan Sidwell <nathan@acm.org>
4566 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
4567 (lambda_capture_field_type): Update prototype.
4568 * lambda.c (lambda_capture_field_type): Add is_reference parm.
4569 Add referenceness here.
4570 (add_capture): Adjust lambda_capture_field_type call, refactor
4572 * pt.c (tsubst): Adjust lambda_capture_field_type call.
4574 2017-01-01 Jakub Jelinek <jakub@redhat.com>
4576 Update copyright years.
4578 Copyright (C) 2017 Free Software Foundation, Inc.
4580 Copying and distribution of this file, with or without modification,
4581 are permitted in any medium without royalty provided the copyright
4582 notice and this notice are preserved.