1 2017-10-12 Nathan Sidwell <nathan@acm.org>
3 * cp-tree.h (cp_expr): Add const operator * and operator->
5 (cp_tree_node_structure_enum): Delete TS_CP_BINDING,
6 TS_CP_WRAPPER, LAST_TS_CP_ENUM.
8 2017-10-12 David Malcolm <dmalcolm@redhat.com>
10 * parser.c (get_required_cpp_ttype): New function.
11 (cp_parser_error_1): Call it, using the result to call
12 maybe_suggest_missing_token_insertion.
14 2017-10-12 David Malcolm <dmalcolm@redhat.com>
16 * parser.c (get_matching_symbol): Move to before...
17 (cp_parser_error): Split out into...
18 (cp_parser_error_1): ...this new function, merging in content
20 (cp_parser_required_error): ...here. Eliminate partial duplicate
21 of body of cp_parser_error in favor of a call to the new
22 cp_parser_error_1 helper function.
24 2017-10-11 Nathan Sidwell <nathan@acm.org>
26 * decl2.c (struct mangled_decl_hash): Use DECL_ASSEMBLER_NAME_RAW.
27 (record_mangling): Likewise.
29 2017-10-10 Nathan Sidwell <nathan@acm.org>
31 * name-lookup.c (extern_c_fns): Rename to ...
32 (extern_c_decls): ... here.
33 (check_extern_c_conflict, extern_c_linkage_bindings): Update.
34 (do_pushdecl): Check extern-c fns and vars.
36 * cp-tree.h (default_hash_traits <lang_identifier *>): Delete
39 * decl2.c (struct mangled_decl_hash): New hash traits.
40 (mangled_decls): Make hash_table<mangled_decl_hash>.
41 (generate_mangling_alias, record_mangling): Adjust.
43 2017-10-10 Jason Merrill <jason@redhat.com>
45 More delayed lambda capture fixes.
46 * call.c (add_function_candidate): Use build_address.
47 (build_op_call_1): Call mark_lvalue_use early.
48 (build_over_call): Handle error from build_this.
49 * constexpr.c (cxx_bind_parameters_in_call): Use build_address.
50 (cxx_eval_increment_expression): Don't use rvalue().
51 * cvt.c (convert_to_void): Use mark_discarded_use.
52 * expr.c (mark_use): Handle PARM_DECL, NON_DEPENDENT_EXPR. Fix
53 reference handling. Don't copy the expression.
54 (mark_discarded_use): New.
55 * lambda.c (insert_capture_proxy): Add some sanity checking.
56 (maybe_add_lambda_conv_op): Set cp_unevaluated_operand.
57 * pt.c (register_local_specialization): Add sanity check.
58 * semantics.c (process_outer_var_ref): Fix check for existing proxy.
59 * typeck.c (cp_build_addr_expr_1): Handle error from
61 (cp_build_modify_expr): Call mark_lvalue_use_nonread, handle error
64 Handle generic lambda capture in dependent expressions.
65 * lambda.c (need_generic_capture, dependent_capture_r)
66 (do_dependent_capture): New.
67 * pt.c (processing_nonlambda_template): Use need_generic_capture.
68 * semantics.c (maybe_cleanup_point_expr)
69 (maybe_cleanup_point_expr_void, finish_goto_stmt)
70 (maybe_convert_cond): Call do_dependent_capture.
71 * typeck.c (build_static_cast): Remove dependent capture handling.
73 * typeck.c (condition_conversion): Assert !processing_template_decl.
74 * semantics.c (finish_omp_clauses): Don't
75 fold_build_cleanup_point_expr if processing_template_decl.
76 (outer_var_p): A temporary can't be from an outer scope.
77 * pt.c (type_dependent_expression_p): Fix dependency checking of
78 functions without DECL_TEMPLATE_INFO.
79 (instantiate_decl): Use lss_copy.
80 * constexpr.c (is_valid_constexpr_fn): Fix lambdas before C++17.
82 * typeck.c (check_return_expr): Check non-dependent conversion in
84 * constraint.cc (check_function_concept): Don't complain about an
85 empty concept if seen_error.
87 2017-10-10 Richard Sandiford <richard.sandiford@linaro.org>
89 * cvt.c (ignore_overflows): Use wi::to_wide when
90 operating on trees as wide_ints.
91 * decl.c (check_array_designated_initializer): Likewise.
92 * mangle.c (write_integer_cst): Likewise.
93 * semantics.c (cp_finish_omp_clause_depend_sink): Likewise.
95 2017-10-10 Nathan Sidwell <nathan@acm.org>
97 * name-lookup.c (set_global_binding): Don't deal with STAT_HACK.
99 2017-10-06 Paolo Carlini <paolo.carlini@oracle.com>
102 * decl.c (finish_function): Take a bool intead of an int; adjust.
103 * cp-tree.h (finish_function): Adjust declaration.
104 * decl2.c (generate_tls_wrapper, finish_objects,
105 finish_static_storage_duration_function): Adjust calls.
106 * lambda.c (maybe_add_lambda_conv_op, finish_lambda_function):
108 * method.c (synthesize_method): Likewise.
109 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
110 * pt.c (instantiate_decl): Likewise.
111 * parser.c (cp_parser_function_definition_after_declarator,
112 cp_parser_late_parsing_for_member, cp_parser_omp_declare_reduction):
114 (cp_parser_ctor_initializer_opt,
115 cp_parser_ctor_initializer_opt_and_function_body,
116 cp_parser_function_try_block,
117 cp_parser_function_definition_after_declarator,
118 cp_parser_function_transaction): Return void; adjust declarations.
120 2017-10-06 Nathan Sidwell <nathan@acm.org>
123 * name-lookup.c (check_local_shadow): Don't try and convert
126 2017-10-06 Jakub Jelinek <jakub@redhat.com>
129 * decl.c (reshape_init): Suppress warn_useless_cast for direct enum
131 * typeck.c (convert_for_assignment): Likewise.
133 P0704R1 - fixing const-qualified pointers to members
134 * typeck2.c (build_m_component_ref): For -std=c++2a allow
135 pointer to const & qualified method on rvalue.
137 2017-10-06 Nathan Sidwell <nathan@acm.org>
139 Use hash_table for extern "C" names
140 * name-lookup.c (extern_c_fns): Use hash_table.
141 (check_extern_c_conflict): Adjust.
142 (c_linkage_bindings): Adjust.
144 Use hash_table for namespace bindings
145 * cp-tree.h (struct named_decl_hash): New.
146 (lang_decl_ns): Change type of bindings field.
147 * lex.c (maybe_add_lang_decl_raw): Adjust.
148 * name-lookup.c (find_namespace_slot): Adjust.
149 (do_pushdecl): Push NULL-named namespace.
150 (do_push_nested_namespace): Adjust.
151 (push_namespace): Push anonymous namespace as NULL name.
153 2017-10-05 Jason Merrill <jason@redhat.com>
155 Pass variadic class objects exactly like named by-value args.
156 * call.c (convert_arg_to_ellipsis): Use the result of force_rvalue.
158 2017-10-05 Nathan Sidwell <nathan@acm.org>
160 Warn on MVP declarations
161 * cp-tree.h (struct cp_declarator): Add parenthesized field.
162 * decl.c (grokdeclarator): Warn about unnecessary parens.
163 * parser.c (make_declarator): Init parenthesized field.
164 (cp_parser_direct_declarator): Set parenthesized field.
166 Kill IDENTIFIER_GLOBAL_VALUE, SET_IDENTIFIER_GLOBAL_VALUE
167 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
168 SET_IDENTIFIER_GLOBAL_VALUE): Delete.
169 * name-lookup.h (set_global_binding): Remove NAME parm.
170 (get_global_binding): New inline fn.
171 * name-lookup.c (set_global_binding): Remove NAME parm. Adjust.
172 (identifier_global_value): Move to ...
173 * cp-objcp-common.c (identifier_global_value): ... here.
174 * class.c (build_ctor_vtbl_group, build_vtbl_initializer): Adjust.
175 * decl.c (record_builtin_type, expand_static_init,
176 grokdeclarator): Adjust.
177 * decl2.c (get_guard, get_local_tls_init_fn, get_tls_init_fn,
178 get_tls_wrapper_fn, maybe_warn_sized_delete): Adjust.
179 * except.c (declare_library_fn, build_throw): Adjust.
180 * init.c (throw_bad_array_length): Adjust.
181 * rtti.c (throw_bad_cast, throw_bad_typeid, get_tinfo_decl): Adjust.
183 * decl2.c (record_mangling): Fix spello and formatting from
186 2017-10-04 Nathan Sidwell <nathan@acm.org>
188 Give builtin types the correct name.
189 * name-lookup.c (set_global_binding): Assert name is DECL_NAME.
190 * decl.c (record_builtin_type): Reimplement, use new TYPE_DECL for
193 2017-10-04 Paolo Carlini <paolo.carlini@oracle.com>
194 Andrew Pinski <apinski@cavium.com>
197 * parser.c (cp_parser_lambda_body): Set parser->in_function_body.
199 2017-10-04 Nathan Sidwell <nathan@acm.org>
201 Move mangling aliases out of global namespace.
202 * cp-tree.h (record_mangling): New.
203 (maybe_remove_implicit_alias): Delete.
204 * decl2.c (mangled_decls): New hash map.
205 (generate_mangling_alias): Reimplement using mangled_decls.
206 (record_mangling): New.
207 * mangle.c (decl_implicit_alias_p,
208 maybe_remove_implicit_alias): Delete.
209 (mangle_decl): Use record_mangling.
210 * name-lookup.c (supplement_binding_1): Remove
211 maybe_remove_implicit_alias check.
213 2017-10-04 Jakub Jelinek <jakub@redhat.com>
216 * error.c (dump_function_decl): If show_return, call dump_type_suffix
217 on the same return type dump_type_prefix has been called on.
219 2017-10-04 Jason Merrill <jason@redhat.com>
221 PR c++/81525 - broken handling of auto in generic lambda.
222 * pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.
224 2017-10-04 Nathan Sidwell <nathan@acm.org>
226 * call.c (convert_arg_to_ellipsis): Correct comment about passing
229 2017-10-02 Richard Sandiford <richard.sandiford@linaro.org>
231 * constexpr.c (cxx_eval_store_expression): Use wi::to_widest
232 when comparing the array bounds with an ARRAY_REF index.
234 2017-09-30 Paolo Carlini <paolo.carlini@oracle.com>
237 * method.c (defaulted_late_check): Early return if the defaulted
238 declaration does not match the expected signature.
240 2017-09-29 Jakub Jelinek <jakub@redhat.com>
242 P0683R1 - default member initializers for bit-fields
243 * cp-tree.h (grokbitfield): Add INIT parameter.
244 * parser.c (cp_parser_constant_expression): Add STRICT_P argument,
245 if true, parse a conditional-expression rather than
246 assignment-expression.
247 (cp_parser_member_declaration): For C++11 and later pass true
248 as STRICT_P to cp_parser_constant_expression. Parse C++2A bitfield
249 NSDMIs. Adjust grokbitfield caller. Handle DECL_INITIAL also for
251 (cp_parser_objc_class_ivars): Adjust grokbitfield caller.
252 * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs.
253 (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs.
254 * decl2.c (grokbitfield): Add INIT parameter, pass it to
256 * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not
259 * class.c (check_bitfield_decl): Retrieve and clear width from
260 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
261 (check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than
263 (remove_zero_width_bit_fields): Adjust comment.
264 * decl2.c (grokbitfield): Stash width into
265 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
266 * pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr
267 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width.
269 * parser.c (cp_parser_member_declaration): Parse attributes before
270 colon of a bitfield in addition to after colon.
272 * Make-lang.in (check-c++-all): Test also c++2a.
274 2017-09-28 Jason Merrill <jason@redhat.com>
276 PR c++/56973, DR 696 - capture constant variables only as needed.
277 * expr.c (mark_use): Split out from mark_rvalue_use and
278 mark_lvalue_use. Handle lambda capture of constant variables.
279 (mark_lvalue_use_nonread): New.
280 * semantics.c (process_outer_var_ref): Don't capture a constant
281 variable until forced.
282 * pt.c (processing_nonlambda_template): New.
283 * call.c (build_this): Check it.
284 * decl2.c (grok_array_decl): Call mark_rvalue_use and
285 mark_lvalue_use_nonread.
286 * init.c (constant_value_1): Don't call mark_rvalue_use.
287 * typeck.c (build_static_cast): Handle lambda capture.
289 Use local_specializations to find capture proxies.
290 * cp-tree.h (DECL_CAPTURED_VARIABLE): New.
291 * lambda.c (build_capture_proxy): Set it.
292 (add_capture): Pass initializer to build_capture_proxy.
293 (start_lambda_function): Likewise.
294 (insert_capture_proxy): Use register_local_specialization.
295 (is_lambda_ignored_entity): Always ignore proxies.
296 * name-lookup.c (qualify_lookup): Don't check
297 is_lambda_ignored_entity if LOOKUP_HIDDEN is set.
298 * semantics.c (process_outer_var_ref): Use
299 retrieve_local_specialization.
300 * parser.c (cp_parser_lambda_body): Push local_specializations.
301 * pt.c (tsubst_expr): Pass LOOKUP_HIDDEN when looking for a proxy.
302 (tsubst_lambda_expr): Push local_specializations sooner.
303 (tsubst_copy_and_build): Don't register_local_specialization.
305 * call.c (build_special_member_call): Use the return value of
307 * decl.c (compute_array_index_type): Likewise.
308 * parser.c (cp_parser_oacc_wait_list): Likewise.
309 * lambda.c (is_normal_capture_proxy): Handle *this capture.
310 (add_capture): Clarify internal_error message.
312 2017-09-22 Eric Botcazou <ebotcazou@adacore.com>
315 * cp-objcp-common.c (cp_get_debug_type): Do only one lookup.
317 2017-09-22 Jakub Jelinek <jakub@redhat.com>
320 * tree.c (struct replace_placeholders_t): Add pset field.
321 (replace_placeholders_r): Call cp_walk_tree with d->pset as
322 last argument instead of NULL. Formatting fix.
323 (replace_placeholders): Add pset variable, add its address
324 into data. Pass &pset instead of NULL to cp_walk_tree.
326 2017-09-22 David Malcolm <dmalcolm@redhat.com>
328 * call.c (get_fndecl_argument_location): New function.
329 (convert_like_real): Use it when complaining about argument type
331 * cp-tree.h (struct cp_parameter_declarator): Add "loc" field.
332 * parser.c (make_parameter_declarator): Add "loc" param and use
333 it to initialize the new field.
334 (cp_parser_translation_unit): Add UNKNOWN_LOCATION for "loc" of
335 the "no_parameters" parameter.
336 (cp_parser_parameter_declaration_list): Set the location of the
337 result of grokdeclarator to be the parameter's loc, assuming no
339 (cp_parser_parameter_declaration): Generate a location for the
340 parameter and pass to make_parameter_declarator.
342 2017-09-20 Nathan Sidwell <nathan@acm.org>
344 * name-lookup.c (member_name_cmp): Use DECL_UID for final
347 2017-09-20 Jakub Jelinek <jakub@redhat.com>
349 P0409R2 - allow lambda capture [=, this]
350 * parser.c (cp_parser_lambda_introducer): For cxx2a don't pedwarn on
353 2017-09-18 Jason Merrill <jason@redhat.com>
355 PR c++/82069 - ICE with lambda in template
356 * semantics.c (process_outer_var_ref): Check uses_template_parms
357 instead of any_dependent_template_arguments_p.
359 2017-09-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
360 Paolo Carlini <paolo.carlini@oracle.com>
363 * decl2.c (finish_anon_union): Complain about "anonymous union with
364 no members" with a pedwarn.
366 2017-09-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
368 * typeck.c (build_reinterpret_cast_1,
369 build_const_cast_1): Implement -Wcast-align=strict.
371 2017-09-15 Jakub Jelinek <jakub@redhat.com>
373 * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
374 adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
375 to C++17 or -std=gnu++17 or -std=c++17. Adjust comments.
376 (cxx_init_decl_processing, next_initializable_field,
377 is_direct_enum_init, check_initializer, cp_finish_decl,
378 mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
379 finish_function): Likewise.
380 * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
381 * pt.c (mark_template_parm, convert_nontype_argument,
382 instantiate_class_template_1, type_unification_real, unify,
383 get_partial_spec_bindings, dependent_type_p_r): Likewise.
384 * typeck.c (cp_build_unary_op): Likewise.
385 * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
386 * call.c (build_user_type_conversion_1, build_over_call,
387 build_special_member_call): Likewise.
388 * lambda.c (begin_lambda_type): Likewise.
389 * typeck2.c (process_init_constructor_record): Likewise.
390 * class.c (build_base_field, finalize_literal_type_property,
391 explain_non_literal_class): Likewise.
392 * parser.c (cp_parser_diagnose_invalid_type_name,
393 cp_parser_primary_expression, cp_parser_lambda_introducer,
394 cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
395 cp_convert_range_for, cp_parser_perform_range_for_lookup,
396 cp_parser_decomposition_declaration, cp_parser_linkage_specification,
397 cp_parser_static_assert, cp_parser_simple_type_specifier,
398 cp_parser_namespace_definition, cp_parser_using_declaration,
399 cp_parser_init_declarator, cp_parser_type_parameter_key,
400 cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
401 cp_parser_constructor_declarator_p): Likewise.
402 * mangle.c (struct globals): Rename need_cxx1z_warning to
404 (write_exception_spec, start_mangling, mangle_decl): Likewise.
405 * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
407 (check-c++17): New goal. Use 17 instead of 1z.
408 (check-c++-all): Use 17 instead of 1z.
410 2017-09-14 Jakub Jelinek <jakub@redhat.com>
413 * cp-gimplify.c (omp_var_to_track): Look through references.
414 (omp_cxx_notice_variable): Likewise.
416 2017-09-13 Nathan Sidwell <nathan@acm.org>
418 Conv-op identifers not in identifier hash table
419 * lex.c (conv_type_hasher): Make member fns inline.
420 (make_conv_op_name): Directly clone conv_op_identifier.
422 Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
423 * cp-tree.h (struct lang_type): Rename methods to members.
424 (CLASSTYPE_METHOD_VEC): Rename to ...
425 (CLASSTYPE_MEMBER_VEC): ... this.
426 * name-lookup.h (get_method_slot): Rename to ...
427 (get_member_slot): ... this.
428 (resort_type_method_vec): Rename to ...
429 (resort_type_member_vec): ... this.
430 * class.c (add_method, warn_hidden): Adjust.
431 * search.c (dfs_locate_field_accessor_pre): Adjust.
432 * name-lookup.c (method_vec_binary_search): Rename to ...
433 (member_vec_binary_search): ... this and adjust.
434 (method_vec_linear_search): Rename to ...
435 (member_vec_linear_search): ... this and adjust.
436 (fields_linear_search, get_class_binding_direct): Adjust.
437 (get_method_slot): Rename to ...
438 (get_member_slot): ... this and adjust.
439 (method_name_slot): Rename to ...
440 (member_name_slot): ... this and adjust.
441 (resort_type_method_vec): Rename to ...
442 (resort_type_member_vec): ... this and adjust.
443 (method_vec_append_class_fields): Rename to ...
444 (member_vec_append_class_fields): ... this and adjust.
445 (method_vec_append_enum_values): Rename to ...
446 (member_vec_append_enum_values): ... this and adjust.
447 (method_vec_dedup): Rename to ...
448 (member_vec_dedup): ... this and adjust.
449 (set_class_bindings, insert_late_enum_def_bindings): Adjust.
451 2017-09-12 Paolo Carlini <paolo.carlini@oracle.com>
454 * decl.c (start_decl): Early return error_mark_node if duplicate_decls
455 returns it; avoid misleading error message.
457 2017-09-12 Nathan Sidwell <nathan@acm.org>
459 Kill CLASSTYPE_SORTED_FIELDS.
460 * cp-tree.h (struct lang_type): Lose sorted_fields member.
461 (CLASSTYPE_SORTED_FIELDS): Delete.
462 * name-lookup.h (set_class_bindings): Add EXTRA arg.
463 * name-lookup.c (fields_linear_search): New, broken out of ...
464 (lookup_field_1): ... here. Delete remainder of function.
465 (get_class_binding_direct): Reimplement without sorted_fields.
466 (get_class_binding): Rename TYPE arg to KLASS, for consistency.
467 (get_method_slot): Call set_class_binding when creating method_vec
469 (method_name_cmp): Order identically named slots.
470 (sorted_fields_type_new): Delete.
471 (field_vc_append_class_fields): Rename to ...
472 (method_vec_append_class_fields): ... here. Adjust.
473 (field_vec_append_enum_values): Renme to ...
474 (method_vec_append_enum_values): ... here. Adjust.
475 (method_vec_dedup): New.
476 (set_class_bindings): Reimplement.
477 (insert_late_enum_def_bindings): Reimplement.
479 * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
481 (restort_data): Move later.
482 (method_name_cmp, resort_method_name_cmp): Simplify.
483 (resort_type_method_vec): Reformat.
485 2017-09-09 Jason Merrill <jason@redhat.com>
487 * constexpr.c (reduced_constant_expression_p): If
488 CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
490 2017-09-09 Eric Botcazou <ebotcazou@adacore.com>
493 * cp-objcp-common.c (struct debug_type_hasher): New class.
494 (debug_type_hash): New variable.
495 (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
497 2017-09-08 Jason Merrill <jason@redhat.com>
499 PR c++/70029 - ICE with ref-qualifier and -flto
500 * tree.c (cxx_copy_lang_qualifiers): New.
501 * cp-tree.h: Declare it.
502 * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
504 2017-09-06 Jason Merrill <jason@redhat.com>
506 PR c++/82053 - ICE with default argument in lambda in template
507 * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
509 (retrieve_specialization): Use lambda_fn_in_template_p.
510 * cp-tree.h: Declare it.
512 PR c++/82070 - error with nested lambda capture
513 * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
514 register_local_specialization.
516 2017-09-06 Nathan Sidwell <nathan@acm.org>
518 * name-lookup.h (lookup_field_1): Delete.
519 (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
520 * name-lookup.c (lookup_field_1): make static
521 (method_vec_binary_search, method_vec_linear_search): New. Broken
523 (get_class_binding_direct): ... here. Add TYPE_OR_FNS argument.
524 Do complete search of this level.
525 (get_class_binding): Adjust.
526 * decl.c (reshape_init_class): Call get_class_binding.
527 * search.c (lookup_field_r): Move field searching into
528 get_class_binding_direct.
530 * class.c (warn_hidden): Don't barf on non-functions.
531 * decl2.c (check_classfn): Likewise. Check template match earlier.
533 * name-lookup.c (count_fields): Rename to ...
534 (count_class_fields): ... here. Take a class, don't count
536 (add_fields_to_record_type): Rename to ...
537 (field_vec_append_class_fields): ... here. Take a class, don't
538 add NULL-named fields.
539 (add_enum_fields_to_record_type): Rename to ...
540 (field_vec_append_enum_values): ... here.
541 (set_class_bindings): Adjust, assert we added expected number.
542 (insert_late_enum_def_bindings): Reimplement. Create vector if
543 there are now sufficient entries.
545 * name-lookup.h (lookup_fnfields_slot_nolazy,
546 lookup_fnfields_slot): Rename to ...
547 (get_class_binding_direct, get_class_binding): ... here.
548 * name-lookup.c (lookup_fnfields_slot_nolazy,
549 lookup_fnfields_slot): Rename to ...
550 (get_class_binding_direct, get_class_binding): ... here.
551 * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
552 * call.c (build_user_type_conversion_1): Adjust.
553 (has_trivial_copy_assign_p): Adjust.
554 (has_trivial_copy_p): Adjust.
555 * class.c (get_basefndecls) Adjust.
556 (vbase_has_user_provided_move_assign) Adjust.
557 (classtype_has_move_assign_or_move_ctor_p): Adjust.
558 (type_build_ctor_call, type_build_dtor_call): Adjust.
559 * decl.c (register_dtor_fn): Adjust.
560 * decl2.c (check_classfn): Adjust.
561 * pt.c (retrieve_specialization): Adjust.
562 (check_explicit_specialization): Adjust.
563 (do_class_deduction): Adjust.
564 * search.c (lookup_field_r): Adjust.
565 (look_for_overrides_here, lookup_conversions_r): Adjust.
566 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
567 * tree.c (type_has_nontrivial_copy_init): Adjust.
568 * method.c (lazily_declare_fn): Adjust comment.
570 2017-09-05 Nathan Sidwell <nathan@acm.org>
572 * name-lookup.c (do_class_using_decl): Elide read-once temps.
573 Move declarations to initializations.
575 * class.c (add_method): Move slot search and insertion to ...
576 * name-lookup.c (get_method_slot): ... this new function.
577 (lookup_fnfields_slot_nolazy): Cope with NULL slot.
578 * name-lookup.h (get_method_slot): Declare.
579 * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
581 (grok_special_member_properties): Set
582 TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
583 Improve TYPE_HAS_CONSTEXPR_CTOR setting.
585 * cp-tree.h (lang_decl_base): Rename template_conv_p to
587 (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
588 (DECL_CONV_FN_TYPE): FN must be conv op.
589 (DECL_TEMPLATE_CONV_FN_P): Delete.
590 (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
591 * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
594 * class.c (unreverse_member_declarations): Remove extraneous if.
595 * pt.c (push_template_decl_real): Use string concatenation, not
596 \<newline>. Add %<..%>.
598 2017-09-05 Paolo Carlini <paolo.carlini@oracle.com>
601 * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
602 * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
603 creating cdtor_label.
604 * constexpr.c (returns): Add the case of a constructor/destructor
605 returning via a LABEL_DECL_CDTOR label.
606 (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
608 2017-09-01 Nathan Sidwell <nathan@acm.org>
610 * cp-tree.h (resort_type_method_vec): Move declaration to ...
611 * name-lookup.h (resort_type_method_vec): ... here.
612 (set_class_bindings): Lose 2nd arg.
613 * class.c (finish_struct_1, finish_struct): Adjust
614 set_class_bindings call. Don't call finish_struct_methods.
615 (resort_data, method_name_cmp, resort_method_name_cmp,
616 resort_type_method_vec, finish_struct_methods): Move to ...
617 * name-lookup.c (resort_data, method_name_cmp,
618 resort_method_name_cmp, resort_type_method_vec): ... here.
619 (set_class_bindings): Lose fields arg. Swallow finish_struct_methods.
621 * class.c (finish_struct): Call set_class_bindings for the
624 * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
625 Don't call maybe_warn_about_overly_private_class here.
626 (warn_hidden): Cleanup declarations and comments.
627 (type_has_user_provided_constructor): No need to check
628 CLASSTYPE_METHOD_VEC.
629 (type_has_user_provided_or_explicit_constructor): Likewise.
630 (classtype_has_move_assign_or_move_ctor_p): Likewise.
631 (check_bases_and_members): Don't call finish_struct_methods here.
632 (finish_struct_1): Call finish_struct_methods and
633 set_class_bindings immediately after layout. Clear DECL_IN_AGGR_P
635 (finish_struct): For templates process USING_DECLS and clear
636 DECL_IN_AGGR_P before calling finish_struct_methods. Call
637 maybe_warn_about_overly_private_class here.
639 Revert 2017-08-28 Nathan Sidwell <nathan@acm.org>
640 Restore sorted_fields vector.
641 * cp-tree.h (lang_type): Restore sorted_fields vector.
642 (CLASSTYPE_SORTED_FIELDS): Restore.
643 (CLASSTYPE_BINDINGS): Delete.
644 * name-lookup.c (lookup_field_1): Restore binary search.
645 (sorted_fields_type_new, count_fields,
646 add_fields_to_record_type, add_enum_fields_to_record_type): Restore
647 (set_class_bindings): Revert.
648 (insert_late_enum_def_binding): Restore field_vec insertion.
650 2017-09-01 Jakub Jelinek <jakub@redhat.com>
653 * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
655 2017-09-01 Marek Polacek <polacek@redhat.com>
658 * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
660 2017-08-30 Jason Merrill <jason@redhat.com>
662 PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
663 * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
664 (regenerated_lambda_fn_p): New.
665 (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
666 (tsubst_copy) [VAR_DECL]: Likewise.
668 PR c++/82030 - ICE inheriting from multiple lambdas
670 * call.c (compare_ics): Handle null candidate.
672 2017-08-30 Ville Voutilainen <ville.voutilainen@gmail.com>
674 Make taking the address of an overloaded function a non-deduced context
676 * pt.c (unify_overload_resolution_failure): Remove.
677 (unify_one_argument): Adjust.
679 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
680 Alan Hayward <alan.hayward@arm.com>
681 David Sherwood <david.sherwood@arm.com>
683 * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
685 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
686 Alan Hayward <alan.hayward@arm.com>
687 David Sherwood <david.sherwood@arm.com>
689 * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
691 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
692 Alan Hayward <alan.hayward@arm.com>
693 David Sherwood <david.sherwood@arm.com>
695 * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
696 instead of TYPE_MODE.
698 2017-08-29 Jason Merrill <jason@redhat.com>
700 PR c++/81236 - ICE with template-id in generic lambda
701 * semantics.c (finish_id_expression): Remove special dependent case.
702 Avoid some later pieces when dependent.
703 (finish_qualified_id_expr): Do normal BASELINK handling in a
704 template. Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
705 (parsing_default_capturing_generic_lambda_in_template): Remove.
706 * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
707 error for types that will never be complete.
708 * mangle.c (write_expression): Add sanity check.
709 * tree.c (build_qualified_name): Add sanity check.
710 (cp_walk_subtrees): Walk into the class context of a BASELINK.
711 * lambda.c (add_capture): Improve diagnostic for generic lambda
713 * call.c (build_new_method_call_1): Print the right constructor
716 Reimplement handling of lambdas in templates.
717 * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
718 * decl.c (start_preparsed_function): Call start_lambda_scope.
719 (finish_function): Call finish_lambda_scope.
720 * init.c (get_nsdmi): Call start/finish_lambda_scope.
721 * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
722 * parser.c (cp_parser_function_definition_after_declarator): Don't
723 call start/finish_lambda_scope.
724 * pt.c (retrieve_specialization): Ignore lambda functions in
726 (find_parameter_packs_r): Ignore capture proxies. Look into
728 (check_for_bare_parameter_packs): Allow bare packs in lambdas.
729 (tsubst_default_argument): Call start/finish_lambda_scope.
730 (tsubst_function_decl): Handle lambda functions differently.
731 (tsubst_template_decl): Likewise.
732 (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
734 (tsubst_lambda_expr): Create a new closure rather than instantiate
735 the one from the template.
736 (tsubst_copy_and_build): Don't register a specialization of a pack.
737 (regenerate_decl_from_template): Call start/finish_lambda_scope.
738 (instantiate_decl): Remove special lambda function handling.
739 * semantics.c (process_outer_var_ref): Remove special generic lambda
740 handling. Don't implicitly capture in a lambda in a template. Look
741 for an existing proxy.
742 * class.c (current_nonlambda_class_type): Use decl_type_context.
744 * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
745 (LAMBDA_EXPR_RETURN_TYPE): Remove.
746 (struct tree_lambda_expr): Remove closure and return_type fields.
747 * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
748 * pt.c (tsubst_copy_and_build): Likewise.
749 * parser.c (cp_parser_lambda_declarator_opt): Track return type.
750 (cp_parser_lambda_body): Adjust unspecified return type check.
751 * ptree.c (cxx_print_lambda_node): Don't print closure or
754 PR c++/80935 - wrong C++17 error with lambda
755 * decl.c (check_for_uninitialized_const_var): Check
756 is_instantiation_of_constexpr.
757 * constexpr.c (ensure_literal_type_for_constexpr_object): Check
758 is_instantiation_of_constexpr.
759 (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
761 * lambda.c (build_lambda_object): Check for error_mark_node.
762 * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
764 (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
765 (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
767 PR c++/80767 - unnecessary instantiation of generic lambda
768 * call.c (convert_like_real): Call build_user_type_conversion_1 if
770 (add_conv_candidate): Build a ck_user conversion with no candidate.
772 Fix lambdas in template default argument of inherited ctor.
773 * method.c (synthesized_method_base_walk): Replace an inherited
774 template with its specialization.
775 (synthesized_method_walk): Make inheriting_ctor a pointer.
776 (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
777 (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
779 * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
780 template, not the function.
781 (template_guide_p): Adjust.
783 Support copying local_specializations.
784 * cp-tree.h (enum lss_policy): New.
785 (local_specialization_stack): Add policy parameter to default ctor.
786 * pt.c (local_specialization_stack): Copy local_specializations if
789 * constexpr.c (potential_constant_expression_1): Add "now" parm.
790 (is_constant_expression, require_constant_expression): New.
791 (is_static_init_expression, is_nondependent_constant_expression)
792 (is_nondependent_static_init_expression): Drop "potential".
793 * except.c (build_must_not_throw_expr): Do type conversion on
794 value-dependent argument.
795 * pt.c, semantics.c, typeck2.c: Use variants without "potential".
797 Instantiate default arguments/member initializers once.
798 * init.c (get_nsdmi): Remember NSDMI instantiations.
799 * parser.c (inject_this_parameter): Be more picky about
801 * pt.c (tsubst_copy): Simplify 'this' handling.
802 (tsubst_default_argument): Remember default argument
803 instantiations. Take parameter number.
804 (tsubst_default_arguments): Pass it.
805 * call.c (convert_default_arg): Likewise.
807 Fix default argument conversion failure and SFINAE.
808 * call.c (build_over_call): Check convert_default_arg result for
810 * parser.c (cp_parser_late_parsing_default_args): Remember
813 2017-08-28 Nathan Sidwell <nathan@acm.org>
815 * cp-tree.h (lang_type): Replace sorted_fields vector with
817 (CLASSTYPE_SORTED_FIELDS): Delete.
818 (CLASSTYPE_BINDINGS): New.
819 * decl.c (finish_enum_value_list): Swap args of
820 insert_late_enum_def_bindings.
821 * name-lookup.c (lookup_field_1): Replace binary search of sorted
822 fields with map->get.
823 (sorted_fields_type_new, count_fields,
824 add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
825 (add_class_member, add_class_members): New.
826 (set_class_bindings): Create map and insert.
827 (insert_late_enum_def_binding): Swap parms. Use add_clasS_member.
828 * ptree.c (cxx_print_type): Delete sorted fields printing.
830 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
832 * name-lookup.h (set_class_bindings,
833 insert_late_enum_def_bindings): Declare.
834 * decl.c (finish_enum_value_list): Adjust for
835 insert_late_enum_def_bindings name change.
836 * class.c (finish_struct_1): Call set_class_bindings.
837 (count_fields, add_fields_to_record_type,
838 add_enum_fields_to_record_type, sorted_fields_type_new,
839 insert_into_classtype_sorted_fields,
840 insert_late_enum_def_into_classtype_sorted_fields): Move to ...
841 * name-lookup.h (count_fields, add_fields_to_record_type,
842 add_enum_fields_to_record_type, sorted_fields_type_new,
843 set_class_bindings, insert_late_enum_def_bindings): ... here.
845 2017-08-25 Nathan Sidwell <nathan@acm.org>
847 * class.c (method_name_cmp, resort_method_name_cmp): Methods
850 Conversion operators have a special name
851 * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
852 (conv_op_marker, conv_op_identifier): New.
853 (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
854 * decl.c (initialize_predefined_identifiers): Add
856 (cxx_init_decl_processing): Create conv_op_marker.
857 * decl2.c (check_classfn): Lookup conv-ops by name.
858 * class.c (add_method): Use conv_op_identifier & conv_op_marker.
859 (resort_type_method_vec): Don't skip conv-ops.
860 (finish_struct_methods, warn_hidden): Likewise.
861 * name-lookup.h (lookup_all_conversions): Delete.
862 * name-lookup.c (lookup_conversion_operator): Replace with ...
863 (extract_conversion_operator): ... this.
864 (lookup_fnfields_slot_nolazy): Find conv-ops by name.
865 (lookup_all_conversions): Delete.
866 * pt.c (check_explicit_specialization): Find conv-ops by name.
867 * search.c (lookup_conversions_r): Likewise.
869 2017-08-24 Nathan Sidwell <nathan@acm.org>
871 Conversion operators kept on single overload set
872 * class.c (add_method): Keep all conv-ops on one slot.
873 * name-lookup.c (lookup_conversion_operator): Pull the desired
874 conv op out of overload set.
875 * search.c (lookup_conversions_r): Lose template/non-template
877 (lookup_conversions): Likewise.
879 2017-08-23 Nathan Sidwell <nathan@acm.org>
881 * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
882 lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
884 * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
885 lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
886 * search.c (lookup_conversion_operator,
887 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
888 lookup_all_conversions): Move to ...
889 * name-lookup.c (lookup_conversion_operator,
890 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
891 lookup_all_conversions): ... here.
893 * semantics.c (finish_member_declaration): Move USING_DECL check
894 earlier. Always set C++ linkage. Commonize TYPE_FIELD and
895 template decl list insertion.
897 * cp-tree.h (maybe_version_functions): Declare.
898 * decl.c (decls_match): Break function versioning check to
899 separate function. Call it.
900 (maybe_version_functions): Broken out of decls_match.
901 * class.c (add_method): Use maybe_version_functions.
903 * cp-tree.h (print_search_statistics,
904 reinit_search_statistics): Don't declare.
905 * search.c (n_fields_searched, n_calls_lookup_field,
906 n_calls_lookup_field_1, n_calls_lookup_fnfields,
907 n_calls_lookup_fnfields_1, n_calls_get_base_type,
908 n_outer_fields_searched, n_contexts_saved): Delete.
909 (lookup_field_1, lookup_member,
910 lookup_fnfields_slot_nolazy): Remove stat gathering.
911 (print_search_statistics, reinit_search_statistics): Delete.
912 * tree.c (cxx_print_statistics): Don't print search stats.
914 2017-08-21 Nathan Sidwell <nathan@acm.org>
916 * search.c (lookup_field_r): Remove obsolete code for type-named
919 * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
921 (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
922 (lookup_field_fuzzy_r): Adjust.
924 2017-08-21 David Malcolm <dmalcolm@redhat.com>
926 * call.c (build_over_call): Pass NULL for new parameter to
927 check_function_arguments.
928 * typeck.c (cp_build_function_call_vec): Likewise.
930 2017-08-21 Nathan Sidwell <nathan@acm.org>
933 * pt.c (instantiate_class_template_1):
934 BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
936 2017-08-18 David Malcolm <dmalcolm@redhat.com>
939 * name-lookup.c (maybe_suggest_missing_header): Convert return
940 type from void to bool; return true iff a suggestion was offered.
941 (suggest_alternative_in_explicit_scope): Move call to
942 maybe_suggest_missing_header to before use of best_match, and
943 return true if the former offers a suggestion.
945 2017-08-18 H.J. Lu <hongjiu.lu@intel.com>
948 * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
949 * decl2.c (grokbitfield): Don't allow bit-field with
950 warn_if_not_aligned type.
952 2017-08-17 Nathan Sidwell <nathan@acm.org>
954 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
955 * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
956 (TYPE_TEMPLATE_INFO): Simplify.
957 (SET_TYPE_TEMPLATE_INFO): Simplify.
959 * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
960 don't need lang_type.
961 (cxx_make_type): Use maybe_add_lang_type_raw return value.
962 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
965 * cp-tree.h (struct lang_type): Remove template_info field.
966 (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
967 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
969 2017-08-14 Martin Sebor <msebor@redhat.com>
972 * error.c (cp_printer): Handle 'G'.
974 2017-08-11 Martin Liska <mliska@suse.cz>
976 * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
977 TARGET_SUPPORTS_ALIASES.
978 (handle_tls_init): Likewise.
979 (note_mangling_alias): Likewise. Remove ATTRIBUTE_UNUSED for
981 * optimize.c (can_alias_cdtor): Likewise.
983 2017-08-11 Jason Merrill <jason@redhat.com>
985 PR c++/81671 - nullptr_t template parameter
986 * pt.c (convert_nontype_argument): Fix nullptr_t check.
988 2017-08-10 Jason Merrill <jason@redhat.com>
990 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
991 * method.c (synthesized_method_walk): Don't diagnose lack of
994 PR c++/80452 - Core 1579, implicit move semantics on return/throw
995 * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
996 tentatively changed the lvalue to an rvalue.
997 * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
998 (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
999 parameter is an rvalue reference.
1000 * except.c (build_throw): Do maybe-rvalue overload resolution twice.
1001 * typeck.c (check_return_expr): Likewise.
1003 2017-08-10 David Malcolm <dmalcolm@redhat.com>
1005 * parser.c (cp_parser_error): Update for new param to
1007 (class token_pair): New class.
1008 (struct matching_paren_traits): New struct.
1009 (matching_parens): New typedef.
1010 (struct matching_brace_traits): New struct.
1011 (matching_braces): New typedef.
1012 (cp_parser_statement_expr): Convert explicit parsing of
1013 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
1014 class matching_parens, so that the pertinent open parenthesis is
1015 highlighted when there are problems locating the close
1017 (cp_parser_primary_expression): Likewise.
1018 (cp_parser_compound_literal_p): Remove consumption of opening
1020 (cp_parser_postfix_expression): Convert explicit parsing of
1021 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
1022 above. Use it to consume the opening paren previously consumed by
1023 cp_parser_compound_literal_p.
1024 (cp_parser_parenthesized_expression_list): Likewise.
1025 (cp_parser_unary_expression): Likewise.
1026 (cp_parser_new_expression): Likewise.
1027 (cp_parser_cast_expression): Likewise.
1028 (cp_parser_builtin_offsetof): Likewise.
1029 (cp_parser_trait_expr): Likewise.
1030 (cp_parser_lambda_declarator_opt): Likewise.
1031 (cp_parser_lambda_body): Likewise, for matching_braces.
1032 (cp_parser_compound_statement): Likewise.
1033 (cp_parser_selection_statement): Likewise, for matching_parens.
1034 (cp_parser_iteration_statement): Likewise.
1035 (cp_parser_already_scoped_statement): Likewise, for
1037 (cp_parser_linkage_specification): Likewise.
1038 (cp_parser_static_assert): Likewise, for matching_parens.
1039 (cp_parser_decltype): Likewise.
1040 (cp_parser_operator): Likewise.
1041 (cp_parser_enum_specifier): Likewise.
1042 (cp_parser_namespace_definition): Likewise.
1043 (cp_parser_direct_declarator): Likewise.
1044 (cp_parser_braced_list): Likewise.
1045 (cp_parser_class_specifier_1): Likewise, for matching_braces.
1046 (cp_parser_constant_initializer): Likewise.
1047 (cp_parser_noexcept_specification_opt): Likewise, for
1049 (cp_parser_exception_specification_opt): Likewise.
1050 (cp_parser_handler): Likewise.
1051 (cp_parser_asm_specification_opt): Likewise.
1052 (cp_parser_asm_operand_list): Likewise.
1053 (cp_parser_gnu_attributes_opt): Likewise.
1054 (cp_parser_std_attribute_spec): Likewise.
1055 (cp_parser_requirement_parameter_list): Likewise.
1056 (cp_parser_requirement_body): Likewise, for matching_braces.
1057 (cp_parser_compound_requirement): Likewise.
1058 (cp_parser_template_introduction): Likewise.
1059 (cp_parser_sizeof_pack): Likewise, for matching_parens.
1060 (cp_parser_sizeof_operand): Likewise; use it to consume the
1061 opening paren previously consumed by cp_parser_compound_literal_p.
1062 (get_matching_symbol): New function.
1063 (cp_parser_required_error): Add param "matching_location". Remove
1064 calls to cp_parser_error, instead setting a non-NULL gmsgid, and
1065 handling it if set by calling c_parse_error, potentially with a
1066 secondary location if matching_location was set.
1067 (cp_parser_require): Add param "matching_location", with a default
1068 value of UNKNOWN_LOCATION.
1069 (cp_parser_require_keyword): Update for new param of
1070 cp_parser_required_error.
1071 (cp_parser_objc_encode_expression): Update to class matching_parens
1073 (cp_parser_objc_defs_expression): Likewise.
1074 (cp_parser_objc_protocol_expression): Likewise.
1075 (cp_parser_objc_selector_expression): Likewise.
1076 (cp_parser_objc_typename): Likewise.
1077 (cp_parser_objc_superclass_or_category): Likewise.
1078 (cp_parser_objc_try_catch_finally_statement): Likewise.
1079 (cp_parser_objc_synchronized_statement): Likewise.
1080 (cp_parser_objc_at_property_declaration): Likewise.
1081 (cp_parser_oacc_single_int_clause): Likewise.
1082 (cp_parser_oacc_shape_clause): Likewise.
1083 (cp_parser_omp_clause_collapse): Likewise.
1084 (cp_parser_omp_clause_default): Likewise.
1085 (cp_parser_omp_clause_final): Likewise.
1086 (cp_parser_omp_clause_if): Likewise.
1087 (cp_parser_omp_clause_num_threads): Likewise.
1088 (cp_parser_omp_clause_num_tasks): Likewise.
1089 (cp_parser_omp_clause_grainsize): Likewise.
1090 (cp_parser_omp_clause_priority): Likewise.
1091 (cp_parser_omp_clause_hint): Likewise.
1092 (cp_parser_omp_clause_defaultmap): Likewise.
1093 (cp_parser_omp_clause_ordered): Likewise.
1094 (cp_parser_omp_clause_schedule): Likewise.
1095 (cp_parser_omp_clause_num_teams): Likewise.
1096 (cp_parser_omp_clause_thread_limit): Likewise.
1097 (cp_parser_omp_clause_aligned): Likewise.
1098 (cp_parser_omp_clause_linear): Likewise.
1099 (cp_parser_omp_clause_safelen): Likewise.
1100 (cp_parser_omp_clause_simdlen): Likewise.
1101 (cp_parser_omp_clause_depend): Likewise.
1102 (cp_parser_omp_clause_device): Likewise.
1103 (cp_parser_omp_clause_dist_schedule): Likewise.
1104 (cp_parser_oacc_clause_async): Likewise.
1105 (cp_parser_omp_critical): Likewise.
1106 (cp_parser_omp_for_loop): Likewise.
1107 (cp_parser_omp_sections_scope): Likewise.
1108 (cp_parser_omp_declare_reduction_exprs): Likewise.
1109 Update for new param to cp_parser_required_error.
1110 (cp_parser_oacc_routine): Likewise.
1111 (cp_parser_transaction_expression): Likewise.
1112 (cp_parser_cilk_simd_vectorlength): Likewise.
1114 2017-08-09 Jason Merrill <jason@redhat.com>
1116 PR c++/81525 - wrong constant value with generic lambda
1117 * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
1118 (tsubst_copy) [VAR_DECL]: Handle auto.
1120 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1121 * init.c (get_nsdmi): Add complain parm.
1122 * typeck2.c (digest_nsdmi_init): Add complain parm.
1123 (process_init_constructor_record): Pass complain to get_nsdmi.
1124 * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
1125 * method.c (get_defaulted_eh_spec): Add complain parm. Pass it into
1126 synthesized_method_walk.
1127 (synthesized_method_walk): Adjust.
1128 (walk_field_subobs): Pass complain to get_nsdmi.
1129 (defaulted_late_check): Skip other checks if deleted.
1130 * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
1131 * call.c (build_aggr_conv): Pass complain to get_nsdmi.
1132 * parser.c (defarg_location): New.
1133 * error.c (location_of): Use it.
1135 2017-08-09 Marek Polacek <polacek@redhat.com>
1137 * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
1138 * typeck.c (build_binary_op): Change the type of a parameter to bool.
1139 (cp_truthvalue_conversion): Use true instead of 1.
1141 2017-08-08 Marek Polacek <polacek@redhat.com>
1144 * cp-gimplify.c (cp_fold): If folding exposed a branch of
1145 a COND_EXPR, convert it to the original type of the COND_EXPR, if
1148 2017-08-08 Martin Liska <mliska@suse.cz>
1150 * call.c: Include header files.
1151 * cp-gimplify.c: Likewise.
1152 * cp-ubsan.c: Likewise.
1155 * search.c: Likewise.
1156 * semantics.c: Likewise.
1157 * typeck.c: Likewise.
1159 2017-08-07 Martin Liska <mliska@suse.cz>
1161 * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
1163 (cp_parser_std_attribute): Likewise.
1164 * tree.c: Add new include.
1166 2017-08-04 Paolo Carlini <paolo.carlini@oracle.com>
1169 * pt.c (do_class_deduction): Handle the case of no viable implicit
1170 deduction guides; simplify the code generating implicit deduction
1173 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
1176 * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
1177 destructor as expressions.
1179 2017-08-02 Jakub Jelinek <jakub@redhat.com>
1182 * call.c (build_user_type_conversion_1): Only call
1183 lookup_fnfields_slot if totype is CLASS_TYPE_P.
1185 2017-07-31 Jason Merrill <jason@redhat.com>
1187 * decl.c (declare_global_var): Set DECL_CONTEXT.
1189 2017-07-31 Jan Hubicka <hubicka@ucw.cz>
1190 Martin Liska <mliska@suse.cz>
1192 * pt.c (tsubst_copy): Copy PREDICT_EXPR.
1193 * semantics.c (finish_goto_stmt): Build gimple predict
1195 * constexpr.c (potential_constant_expression_1): Handle
1198 2017-07-31 Martin Liska <mliska@suse.cz>
1201 * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
1202 also with current_function_decl non-null equality.
1203 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1204 * decl.c (compute_array_index_type): Likewise.
1205 * init.c (finish_length_check): Likewise.
1206 * typeck.c (cp_build_binary_op): Likewise.
1208 2017-07-29 Jakub Jelinek <jakub@redhat.com>
1210 * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
1211 DW_AT_export_symbols.
1212 * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
1213 argument, pass it through to the debug hook.
1214 (finish_namespace_using_directive): Adjust
1215 emit_debug_info_using_namespace caller.
1216 (push_namespace): Likewise. Call it after setting
1217 DECL_NAMESPACE_INLINE_P.
1218 (cp_emit_debug_info_for_using): Pass false as new argument to
1219 the imported_module_or_decl debug hook.
1221 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
1223 * lex.c (copy_decl): Adjust.
1224 (copy_type): Likewise.
1226 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
1229 * lambda.c (add_capture): Early return if we cannot capture by
1232 2017-07-26 Jason Merrill <jason@redhat.com>
1234 P0702R1 - List deduction of vector.
1235 * pt.c (do_class_deduction): Special-case deduction from a single
1236 element of related type.
1238 2017-07-26 Leonid Koppel <lkoppel@uwaterloo.ca>
1240 PR c++/67054 - Inherited ctor with non-default-constructible members
1241 * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
1242 when deducing an inheriting constructor.
1244 2017-07-21 Nathan Sidwell <nathan@acm.org>
1246 * search.c (lookup_conversion_operator): Return overloads.
1247 (lookup_fnfields_idx_nolazy): Absorb into ...
1248 (lookup_fnfields_slot_nolaxy): ... here.
1249 (lookup_fnfields_1): Absorb into ...
1250 (lookup_fnfields_slot): ... here.
1252 Remove special CDtor METHOD_VEC slots.
1253 * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
1254 CLASSTYPE_DESTRUCTOR_SLOT): Delete.
1255 (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
1256 (CLASSTYPE_DESTRUCTOR): Likewise.
1257 * class (add_method): Don't use special cdtor slots.
1258 * search.c (lookup_fnfields_idx_nolazy): Likewise.
1259 (look_for_overrides_here): Use lookup_fnfields_slot.
1260 * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
1262 * call.c (add_candidates): Move decls to initialization. Don't
1265 2017-07-20 Nathan Sidwell <nathan@acm.org>
1267 Remove TYPE_METHODS.
1268 * class.c (maybe_warn_about_overly_private_class,
1269 finish_struct_methods, one_inheriting_sig, count_fields,
1270 add_fields_to_record_type, check_field_decls, check_methods,
1271 clone_function_decl, set_method_tm_attributes,
1272 finalize_literal_type_property, check_bases_and_members,
1273 create_vtable_ptr, determine_key_method,
1274 unreverse_member_declarations, finish_struct,
1275 add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
1276 * decl.c (fixup_anonymous_aggr): Likewise.
1277 * decl2.c (reset_type_linkage_2): Likewise.
1278 * method.c (after_nsdmi_defaulted_late_checks,
1279 lazily_declare_fn): Likewise.
1280 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
1281 * pt.c (instantiate_class_template_1, tsubst_expr,
1282 do_type_instantiation, instantiate_pending_templates): Likewise.
1283 * search.c (lookup_field_1): Likewise.
1284 * semantics.c (finish_member_declaration,
1285 finish_omp_declare_simd_methods): Likewise.
1287 2017-07-19 Nathan Sidwell <nathan@acm.org>
1289 * class.c (add_implicitly_declared_members): Use
1290 classtype_has_move_assign_or_move_ctor_p.
1291 (classtype_has_move_assign_or_move_ctor,
1292 classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
1293 (classtype_has_move_assign_or_move_ctor_p): ... this new function.
1294 * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
1296 (classtype_has_move_assign_or_move_ctor_p): ... this.
1297 * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
1298 * tree.c (type_has_nontrivial_copy_init): Adjust.
1300 * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
1301 PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
1303 2017-07-18 Nathan Sidwell <nathan@acm.org>
1305 * cp-array-notation.c (build_array_notation_ref): Use
1306 TYPE_{MIN,MAX}_VALUE.
1308 * class.c (classtype_has_move_assign_or_move_ctor): Declare.
1309 (add_implicitly_declared_members): Use it.
1310 (type_has_move_constructor, type_has_move_assign): Merge into ...
1311 (classtype_has_move_assign_or_move_ctor): ... this new function.
1312 * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
1314 2017-07-17 Volker Reichelt <v.reichelt@netcologne.de>
1316 * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
1317 friend outside class and obsolete auto as storage-class-specifier.
1319 2017-07-17 Nathan Sidwell <nathan@acm.org>
1321 * class.c (maybe_warn_about_overly_private_class): Ignore public
1324 * class.c (type_has_user_declared_move_constructor,
1325 type_has_user_declared_move_assign): Combine into ...
1326 (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
1327 * cp-tree.h (type_has_user_declared_move_constructor,
1328 type_has_user_declared_move_assign): Combine into ...
1329 (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
1330 * method.c (maybe_explain_implicit_delete): Use it.
1331 (lazily_declare_fn): Use it.
1332 * tree.c (type_has_nontrivial_copy_init): Use it.
1334 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
1335 semantics, simplify implementation.
1337 2017-07-16 Volker Reichelt <v.reichelt@netcologne.de>
1339 * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
1340 in old-style cast diagnostic.
1341 * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
1342 in useless cast diagnostic.
1343 * error.c (type_to_string): Remove enum special handling.
1345 2017-07-14 David Malcolm <dmalcolm@redhat.com>
1347 * name-lookup.c (get_std_name_hint): Add '<' and '>' around
1349 (maybe_suggest_missing_header): Update for addition of '<' and '>'
1350 to above. Provide a fix-it hint.
1351 * pt.c: Include "gcc-rich-location.h"
1352 (listify): Attempt to add fix-it hint for missing
1353 #include <initializer_list>.
1354 * rtti.c: Include "gcc-rich-location.h".
1355 (typeid_ok_p): Attempt to add fix-it hint for missing
1356 #include <typeinfo>.
1358 2017-07-12 Jason Merrill <jason@redhat.com>
1360 P0512R0 - Deduction from an initializer list.
1361 * pt.c (do_class_deduction): Do list deduction in two phases.
1363 2017-07-12 Nathan Sidwell <nathan@acm.org>
1365 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
1366 DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
1368 * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
1369 DECL_CXX_DESTRUCTOR explicitly.
1370 * decl2.c (grokclassfn): Likewise.
1371 * friend.c (do_friend): Likewise.
1372 * method.c (make_thunk, make_alias_for,
1373 implicitly_declare_fn): Likewise.
1375 2017-07-11 Jason Merrill <jason@redhat.com>
1378 * decl.c (grokparms): Downgrade error about array of unknown bound
1379 to pedwarn and disable it for C++17.
1381 2017-07-11 Nathan Sidwell <nathan@acm.org>
1383 * decl2.c (reset_type_linkage_2): Dont't change ctor name.
1385 2017-07-10 Martin Sebor <msebor@redhat.com>
1387 * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
1389 2017-07-06 Jason Merrill <jason@redhat.com>
1391 PR c++/81204 - parse error with dependent template-name
1392 * parser.c (cp_parser_lookup_name): Revert previous change.
1394 2017-07-06 David Malcolm <dmalcolm@redhat.com>
1396 * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
1397 selftest::run_cp_tests.
1398 (selftest::run_cp_tests): New function.
1399 * cp-tree.h (selftest::run_cp_tests): New decl.
1401 2017-07-04 Jakub Jelinek <jakub@redhat.com>
1403 * parser.c (cp_parser_decomposition_declaration): Replace
1404 decomposition declaration with structured binding in diagnostics.
1405 * decl.c (cp_finish_decomp): Likewise.
1406 (grokdeclarator): Likewise.
1409 * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
1410 forms of structured binding initializers.
1412 2017-07-03 Paolo Carlini <paolo.carlini@oracle.com>
1415 * decl.c (grokdeclarator): Move checks on function return type after
1416 the splice_late_return_type call; if declspecs->locations[ds_type_spec]
1417 is UNKNOWN_LOCATION fall back to input_location.
1419 2017-07-03 David Malcolm <dmalcolm@redhat.com>
1421 * parser.c (enum required_token): Fix spelling of
1422 RT_INTERATION to RT_ITERATION.
1423 (cp_parser_iteration_statement): Likewise.
1424 (cp_parser_required_error): Likewise.
1426 2017-06-30 Jason Merrill <jason@redhat.com>
1428 PR c++/81257 - ICE with invalid ::template.
1429 PR c++/54769 - wrong lookup of dependent template-name.
1430 * parser.c (cp_parser_template_name): Revert part of last change.
1432 2017-06-30 Nathan Sidwell <nathan@acm.org>
1434 * config-lang.in (gtfiles): Add cp/lex.c.
1435 * cp-tree.h (mangle_convop_name_for_type): Rename ...
1436 (make_conv_op_name): ... here. Move to lex.
1437 * lambda.c (maybe_add_lambda_conv_op): Update.
1438 * parser.c (cp_parser_conversion_function_id): Update.
1439 * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
1440 tsubst_copy_and_build): Update.
1441 * semantics.c (apply_deduced_return_type): Update.
1442 * mangle.c (conv_type_hasher, conv_type_names,
1443 mangle_conv_op_name_for_type): Move to ...
1444 * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
1447 2017-06-30 David Malcolm <dmalcolm@redhat.com>
1450 * parser.c (cp_parser_postfix_expression): Construct a location
1451 for typeid expressions.
1453 2017-06-30 Nathan Sidwell <nathan@acm.org>
1455 * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
1457 (lookup_all_conversions): Declare.
1458 * class.c (get_basefndecls): Use lookup_fnfields_slot.
1459 * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
1460 * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
1462 * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
1463 (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
1464 lookup_all_conversions.
1465 * search.c (lookup_fnfields_1): Make static.
1466 (lookup_all_conversions): New.
1467 (class_method_index_for_fn): Delete.
1468 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
1469 lookup_fnfields_slot.
1471 * call.c (build_new_method_call_1): Use constructo_name to get
1472 ctor name. Move argument processing earlier to merge cdtor
1474 * decl.c (grokfndecl): Cdtors have special names.
1475 * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
1476 * pt.c (check_explicit_specialization): Cdtor name is already
1478 * search.c (class_method_index_for_fn): Likewise.
1481 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
1482 a matching TYPE_DECL.
1484 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
1486 * class.c (add_method): Change pair of errors to error + inform.
1487 (handle_using_decl): Likewise.
1489 2017-06-29 Jason Merrill <jason@redhat.com>
1491 * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
1493 PR c++/81180 - ICE with C++17 deduction of member class template.
1494 * pt.c (build_deduction_guide): Correct member template handling.
1496 PR c++/81188 - matching decltype of member function call.
1497 * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
1499 2017-06-29 Nathan Sidwell <nathan@acm.org>
1502 * parser.c (cp_parser_namespace_definition): Immediately close the
1503 namespace if there's no open-brace.
1504 * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
1507 2017-06-29 Jason Merrill <jason@redhat.com>
1509 PR c++/81164 - ICE with invalid inherited constructor.
1510 * search.c (binfo_direct_p): New.
1511 * name-lookup.c (do_class_using_decl): Use it.
1513 2017-06-29 Nathan Sidwell <nathan@acm.org>
1515 * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
1516 VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
1517 * decl.c (initialize_predefined_identifiers): Name cdtor special
1518 names consistently. Use literals for above deleted defines.
1519 (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
1521 * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
1524 * call.c (check_dtor_name): Use constructor_name for enums too.
1525 (build_new_method_call_1): Use constructor_name for cdtors and
1527 * class.c (build_self_reference): Use TYPE_NAME to get name of
1529 * name-lookup (constructor_name): Use DECL_NAME directly.
1530 (constructor_name_p): Reimplement.
1531 (push_class_level_binding_1): Use TYPE_NAME directly.
1533 * class.c (finish_struct): Use OVL_P.
1534 (get_vfield_name): Measure constructor_name length.
1535 * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
1536 (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
1537 * cxx-pretty-print.c (is_destructor_name): Delete.
1538 (pp_cxx_unqualified_id): Remove bogus destructor name checking.
1539 * decl.c (grokfndecl): Move cheap checks first when looking for
1540 implicit extern cness.
1542 * parser.c (cp_parser_direct_declarator): Reorder if to avoid
1543 indentation. Remove unnecessary assignment of constructor name.
1545 Whitespace cleanups.
1546 * call.c (name_as_c_string): Move CONST_CAST to return.
1547 (build_new_method_call_1): Remove unneeded bracing.
1548 * class.c (include_empty_classes): Unbreak line.
1549 * constraint.cc (tsubst_check_constraint): Add space.
1550 * cp-tree.h (lang_decl_ns): Add comment.
1551 (PTRMEM_CST_MEMBER): Break line.
1552 * decl.c (grokfndecl): Add blank lines. Unbreak some others.
1553 (grokdeclarator): Remove lines, move declaration to first use.
1554 * decl2.c (decl_needed_p): Fix indentation.
1555 (c_parse_final_cleanups): Remove blank line.
1556 * method.c (implicitly_declare_fn): Move declaration to first use.
1557 * search.c (current_scope): Add blank lines.
1559 2017-06-28 Jason Merrill <jason@redhat.com>
1561 PR c++/72764 - ICE with invalid template typename.
1562 * decl.c (build_typename_type): No longer static.
1563 * tree.c (strip_typedefs): Use it instead of make_typename_type.
1565 PR c++/69300 - ICE with self-referential noexcept
1566 * pt.c (maybe_instantiate_noexcept): Check for recursion.
1568 PR c++/61022 - error with variadic template template parm
1569 * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
1571 PR c++/72801 - ICE with variadic partial specialization
1572 * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
1574 PR c++/55639 - partial specialization with ::template
1575 * parser.c (cp_parser_class_head): Handle ::template.
1577 PR c++/45976 - error with ::template in declarator.
1578 * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
1580 PR c++/54769 - wrong lookup of dependent template-name.
1581 * parser.c (cp_parser_template_name): Handle dependent object type.
1582 (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
1584 (cp_parser_id_expression): Pass it.
1585 (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
1587 * parser.c (cp_parser_template_id): Use the range location on the
1590 PR c++/81204 - parse error with dependent template-name
1591 * parser.c (cp_parser_lookup_name): Disqualify function templates
1594 2017-06-27 Nathan Sidwell <nathan@acm.org>
1596 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
1597 initialization point. Don't unnecessarily check for ctor name.
1599 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
1600 (CLASSTYPE_DESTRUCTOR): ... this.
1601 * class.c (accessible_nvdtor_p,
1602 maybe_warn_about_overly_private_class,
1603 add_implicitly_declared_members,
1604 clone_constructors_and_destructors, type_has_virtual_destructor):
1605 Adjust for CLASSTYPE_DESTRUCTOR.
1606 (deduce_noexcept_on_destructors): Absorb into ...
1607 (check_bases_and_members): ... here.
1608 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
1609 * init.c (build_delete): Likewise.
1610 * parser.c (cp_parser_lookup_name): Likewise.
1611 * pt.c (check_explicit_specialization): Likewise.
1612 * rtti.c (emit_support_tinfos): Likewise.
1613 * search.c (lookup_fnfields_idx_nolazy): Likewise.
1615 Kill IDENTIFIER_TEMPLATE.
1616 * cp-tree.h (lang_identifier): Remove class_template_info field.
1617 (IDENTIFIER_TEMPLATE): Delete.
1618 * name-lookup.c (constructor_name_full): Subsume into ...
1619 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
1620 (constructor_name_p): Likewise.
1621 * mangle.c (write_source_name): Likewise.
1622 * ptree.c (cxx_print_identifier): Likewise.
1624 2017-06-27 Marek Polacek <polacek@redhat.com>
1627 * parser.c (cp_parser_already_scoped_statement): Initialize
1630 2017-06-26 Jason Merrill <jason@redhat.com>
1632 PR c++/81215 - deduction failure with variadic TTP.
1633 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
1635 2017-06-26 Martin Sebor <msebor@redhat.com>
1638 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
1639 to detect casting away cv-qualifiers.
1641 2017-06-26 Nathan Sidwell <nathan@acm.org>
1643 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
1644 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
1646 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
1647 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
1648 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
1649 * decl.c (grok_op_properties): Adjust identifier checking.
1650 * init.c (expand_default_init): Adjust identifier descision.
1651 * method.c (implicitly_declare_fn): Don't use
1652 DECL_ASSIGNMENT_OPERATOR_P.
1653 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
1655 * call.c (in_charge_arg_for_name): Reimplement.
1656 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
1659 2017-06-26 Marek Polacek <polacek@redhat.com>
1662 * parser.c (cp_parser_statement): Add a default argument. Save the
1663 location of the expression-statement after labels have been parsed.
1664 (cp_parser_implicitly_scoped_statement): Set the location of the
1665 body of the conditional after parsing all the labels. Call
1666 warn_for_multistatement_macros.
1667 (cp_parser_already_scoped_statement): Likewise.
1669 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
1672 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
1673 'typename' in error messages about missing 'typename'.
1675 2017-06-23 Jason Merrill <jason@redhat.com>
1677 PR c++/79056 - C++17 ICE with invalid template syntax.
1678 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
1680 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
1681 * pt.c (template_placeholder_p): New.
1682 * cp-tree.h: Declare it.
1684 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
1686 * decl.c (duplicate_decls): Use builtin_structptr_types.
1688 2017-06-22 Nathan Sidwell <nathan@acm.org>
1690 Reorder IDENTIFIER flags
1692 * cp-tree.h (enum cp_identifier_kind): New.
1693 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
1694 IDENTIFIER_KIND_BIT_2): New.
1695 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
1696 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
1697 (C_IS_RESERVED_WORD): Replace with ...
1698 (IDENTIFIER_KEYWORD_P): ... this.
1699 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
1700 (IDENTIFIER_CDTOR_P): ... this.
1701 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
1702 (IDENTIFIER_OPNAME_P): Replace with ...
1703 (IDENTIFIER_ANY_OP_P): ... this.
1704 (IDENTIFIER_ASSIGN_OP_P): New.
1705 (IDENTIFIER_TYPENAME_P): Replace with ...
1706 (IDENTIFIER_CONV_OP_P): ... this.
1707 (NEW_DELETE_OPNAME_P): Replace with ...
1708 (IDENTIFIER_NEWDEL_OP_P): ... this.
1709 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
1710 (get_identifier_kind_name, set_identifier_kind): Declare.
1711 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
1712 (init_operators): Adjust to avoid keywords, use
1713 set_identifier_kind. Copy TYPE_EXPR slot.
1714 (init_reswords): Call set_identifier_kind.
1715 (unqualified_name_lookup_error): Adjust.
1716 * operators.def (TYPE_EXPR): Remove.
1717 * decl.c (struct predefined_identifier): Move into ...
1718 (initialize_predefined_identifiers): ... here. Call
1719 set_identifier_kind.
1720 (grokfndecl, check_var_type, grokdeclarator): Adjust.
1721 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
1723 * call.c (name_as_c_string): Adjust.
1724 (build_new_method_call_1): Likewise.
1725 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
1726 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
1727 * dump.c (cp_dump_tree): Adjust.
1728 * error.c (dump_decl_name): Adjust.
1729 * mangle.c (write_unqualified_id, write_member_name,
1730 write_expression): Adjust.
1731 (mangle_conv_op_name_for_type): Use set_identifier_kind.
1732 * name-lookup.c (do_class_using_decl): Adjust.
1733 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
1734 * parser.c (cp_lexer_get_preprocessor_token,
1735 cp_parser_direct_declarator): Likewise.
1736 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
1737 tsubst_copy, tsubst_copy_and_build): Adjust.
1738 * ptree.c (cxx_print_identifier): Print identifier kind.
1739 * search.c (lookup_field_r, lookup_member,
1740 lookup_fnfields_idx_nolazy): Adjust.
1741 * semantics.c (finish_id_expression): Adjust..
1742 * typeck.c (cp_build_addr_expr_1): Adjust.
1744 2017-06-21 Jakub Jelinek <jakub@redhat.com>
1747 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
1748 Complain about t not being a variable if t is OVERLOAD even
1749 when processing_template_decl.
1751 2017-06-21 David Malcolm <dmalcolm@redhat.com>
1753 * parser.c (get_cast_suggestion): New function.
1754 (maybe_add_cast_fixit): New function.
1755 (cp_parser_cast_expression): Capture the location of the closing
1756 parenthesis. Call maybe_add_cast_fixit when emitting warnings
1757 about old-style casts.
1759 2017-06-20 Jason Merrill <jason@redhat.com>
1761 PR c++/80972 - C++17 ICE with attribute packed.
1762 * call.c (build_over_call): Allow a TARGET_EXPR from reference
1765 2017-06-20 Nathan Sidwell <nathan@acm.org>
1767 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
1768 (nelts_identifier): Delete.
1769 * decl.c (initialize_predefined_identifiers): Remove nelts.
1771 PR c++/67074 - namespace aliases
1772 * decl.c (duplicate_decls): Don't error here on mismatched
1774 * name-lookup.c (name_lookup::add_value): Matching namespaces are
1776 (diagnose_name_conflict): Namespaces are never redeclarations.
1777 (update_binding): An alias can match a real namespace.
1779 2017-06-19 Jason Merrill <jason@redhat.com>
1781 PR c++/80562 - ICE with constexpr if.
1782 * semantics.c (finish_if_stmt_cond): Call
1783 instantiate_non_dependent_expr.
1785 PR c++/80829 - ICE with constexpr copy of base subobject.
1786 * constexpr.c (clear_no_implicit_zero): New.
1787 (cxx_eval_call_expression): Call it.
1789 2017-06-19 Nathan Sidwell <nathan@acm.org>
1793 * name-lookup.c (set_decl_namespace): Don't follow using
1794 directives and ignore using decls. Only check overly-explicit
1795 scope after discovering decl.
1797 2017-06-19 Jason Merrill <jason@redhat.com>
1799 PR c++/81073 - constexpr and static var in statement-expression.
1800 * typeck2.c (store_init_value): Always call
1801 require_potential_constant_expression.
1802 * pt.c (convert_nontype_argument): Likewise.
1803 * constexpr.c (potential_constant_expression_1): Adjust message.
1804 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
1805 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
1807 2017-06-19 Nathan Sidwell <nathan@acm.org>
1809 * pt.c (coerce_template_parms): Fix indentation.
1810 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
1814 * name-lookup.c (update_binding): Only warn about constructors
1815 hidden by functions.
1817 2017-06-17 Jason Merrill <jason@redhat.com>
1819 PR c++/60063 - -Wunused-local-typedefs and templates.
1820 * decl2.c (is_late_template_attribute): Return false for "used".
1822 PR c++/70844 - -Wuseless-cast and inheriting constructor.
1823 * method.c (forward_parm): Suppress warn_useless_cast.
1825 2017-06-16 Jason Merrill <jason@redhat.com>
1827 PR c++/81045 - Wrong type-dependence with auto return type.
1828 * pt.c (type_dependent_expression_p): An undeduced auto outside the
1829 template isn't dependent.
1830 * call.c (build_over_call): Instantiate undeduced auto even in a
1833 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
1834 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
1835 set longer for a generic lambda.
1837 PR c++/80614 - Wrong mangling for C++17 noexcept type
1838 * mangle.c (write_type): Put the eh spec back on the function type.
1840 PR c++/81102 - Wrong error with partial specialization.
1841 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
1842 types. Do type deduction later.
1844 PR c++/81074 - ICE with partial specialization of member template.
1846 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
1848 PR c++/80831 - ICE with -fsyntax-only.
1849 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
1851 PR c++/80639 - ICE with invalid PMF initialization.
1852 PR c++/80043 - ICE with -fpermissive
1853 * typeck.c (convert_for_assignment): Recurse when instantiate_type
1854 returns without an error.
1856 2017-06-16 Nathan Sidwell <nathan@acm.org>
1858 * pt.c (tsubst_baselink): Fix & clarify formatting.
1860 * cp-tree.h (build_this_parm, cp_build_parm_decl,
1861 build_artificial_parm): Add FN parm.
1862 * decl.c (start_cleanup_fn): Adjust.
1863 (build_this_parm): Add FN parm, pass it through.
1864 (grokfndecl): Adjust parm building.
1865 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
1866 (build_artificial_parm): Add FN parm, pass through.
1867 (maybe_retrofit_in_chrg): Adjust parm building.
1868 (start_static_storage_duration_function): Likwise.
1869 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
1870 * method.c (implicitly_declare_fn): Likewise.
1871 * parser.c (inject_this_parameter): Likewise.
1873 Symbol tables are insert only.
1874 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
1875 derive from pointer_hash. Make undeletable.
1877 * class.c (resort_type_method_vec): Avoid potential unsigned
1880 Don't defer noexcept_deferred_spec.
1881 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
1882 * decl.c (cxx_init_decl_processing): Initialize
1883 noexcept_deferred_spec.
1884 * except.c (unevaluated_noexcept_spec): Delete.
1885 * class.c (deduce_noexcept_on_destructor): Use
1886 noexcept_deferred_spec directly.
1887 * method.c (implicitly_declare_fn): Likewise.
1889 Make keyed_classes a vector.
1890 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
1891 (keyed_classes): Declare as vector.
1892 * decl.c (keyed_classes): Define.
1893 (cxx_init_decl_processing): Allocate it.
1894 (record_key_method_defined): Use vec_safe_push.
1895 * class.c (finish_struct_1): Likewise.
1896 * pt.c (instantiate_class_template_1): Likewise.
1897 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
1900 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
1901 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
1903 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
1904 (get_tinfo_decl): Use get_tinfo_desc.
1905 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
1906 (create_pseudo_type_info): Delete.
1907 (get_pseudo_ti_index): Just determine the index.
1908 (get_tinfo_desc): New. Create all types lazily.
1909 (create_tinfo_types): Just allocate the descriptor array.
1910 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
1913 2017-06-15 Martin Sebor <msebor@redhat.com>
1916 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
1918 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
1919 (build_cxx_call): Call maybe_warn_class_memaccess.
1921 2017-06-14 Jakub Jelinek <jakub@redhat.com>
1923 * cp-gimplify.c (cp_genericize_r): Turn most of the function
1924 into a switch (TREE_CODE (stmt)) statement from long else if
1927 2017-06-13 Jakub Jelinek <jakub@redhat.com>
1930 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
1931 argument even if it has REFERENCE_TYPE.
1934 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
1935 BLOCK_VARS (outer) chain.
1936 (cxx_omp_const_qual_no_mutable): Likewise.
1938 2017-06-13 Martin Liska <mliska@suse.cz>
1941 * class.c (build_base_path): Use sanitize_flags_p.
1942 * cp-gimplify.c (cp_genericize_r): Likewise.
1943 (cp_genericize_tree): Likewise.
1944 (cp_genericize): Likewise.
1945 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1946 * decl.c (compute_array_index_type): Likewise.
1947 (start_preparsed_function): Likewise.
1948 * decl2.c (one_static_initialization_or_destruction): Likewise.
1949 * init.c (finish_length_check): Likewise.
1950 * lambda.c (maybe_add_lambda_conv_op): Likewise.
1951 * typeck.c (cp_build_binary_op): Likewise.
1952 (build_static_cast_1): Likewise.
1954 2017-06-11 Jason Merrill <jason@redhat.com>
1956 * error.c (dump_expr): Use is_this_parameter.
1958 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
1961 2017-06-09 Jason Merrill <jason@redhat.com>
1963 Missing bits from N4268, constant evaluation for all non-type args.
1964 * call.c (build_converted_constant_expr): Rename from
1965 build_integral_nontype_arg_conv, handle all types.
1966 * pt.c (convert_nontype_argument): In C++17 call it for all types.
1967 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
1968 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
1970 Overhaul pointer-to-member conversion and template argument handling.
1971 * call.c (standard_conversion): Avoid creating ck_pmem when the
1972 class type is the same.
1973 * cvt.c (can_convert_qual): Split from
1974 perform_qualification_conversions.
1975 * constexpr.c (cxx_eval_constant_expression): Check it.
1976 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
1977 adjustment is necessary.
1978 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
1979 (convert_nontype_argument): Avoid redundant error.
1981 * call.c (convert_like_real): Remove "inner" parameter.
1982 Don't replace a constant with its value.
1983 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
1985 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
1988 * parser.c (cp_parser_constant_expression): Check
1989 potential_rvalue_constant_expression after decay_conversion.
1990 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
1992 PR c++/80384 - ICE with dependent noexcept-specifier
1993 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
1996 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
1998 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
2000 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
2001 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
2002 (excpet.c): Mark terminate as cold.
2004 2017-06-08 Jakub Jelinek <jakub@redhat.com>
2007 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
2008 to sizetype before size_binop.
2011 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
2012 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
2013 and OMP_CLAUSE_SHARED_READONLY flags.
2015 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
2017 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
2019 2017-06-07 Nathan Sidwell <nathan@acm.org>
2021 * class.c (layout_class_type): Restructure overlong-bitfield tpe
2024 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
2027 * pt.c (do_class_deduction): Build qualified type.
2029 2017-06-06 Nathan Sidwell <nathan@acm.org>
2031 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
2032 sans using directives. Don't walk into inline namespaces.
2035 * name-lookup.c (adl_class_only): Don't add visible friends.
2037 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
2039 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
2041 2017-06-02 Nathan Sidwell <nathan@acm.org>
2043 Remove lang_type_ptrmem.
2044 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
2046 (lang_type_class): ... this. Reorder bitfields. Rename to ...
2047 (lang_type): ... this. Delete old definition.
2048 (lang_type_ptrmem): Delete.
2049 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
2050 (LANG_TYPE_PTRMEM_CHECK): Delete.
2051 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
2052 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
2053 * decl.c (build_ptrmemfunc_type): Adjust.
2054 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
2055 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
2057 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
2060 Remove cp_binding_level::namespaces
2061 * name-lookup.h (cp_binding_level): Lose namespaces field.
2062 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
2064 (suggest_alternatives_for): Adjust for namespace list. Do
2065 breadth-first search.
2066 * decl2.c (collect_source_refs): Namespaces are on the regulr
2068 (collect_ada_namespace): Likewise.
2070 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
2072 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
2075 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
2078 * method.c (constructible_expr): Strip array types before calling
2081 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
2084 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
2085 for case INDIRECT_REF too in the main switch.
2087 2017-05-31 Jason Merrill <jason@redhat.com>
2089 PR c++/80840 - ICE with constexpr and reference
2090 * pt.c (convert_nontype_argument): Don't test whether a decl is
2091 value-dependent when binding to a reference.
2093 2017-05-31 Nathan Sidwell <nathan@acm.org>
2095 * cp-tree.h (lang_decl_slector): New enum.
2096 (lang_decl_base): Make selector an enum. Drop decomposition_p
2098 (lang_decl): Use enum for discrimination.
2099 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
2100 LANG_DECL_DEOMP_CHECK): Use enum.
2101 (DECL_DECOMPOSITION_P): Use selector value.
2102 (SET_DECL_DECOMPOSITION_P): Delete.
2103 (retrofit_lang_decl): Lose SEL parm.
2104 (fit_decomposition_lang_decl): Declare.
2105 * decl.c (cp_finish_decomp, grokdeclarator): Use
2106 fit_decomposition_lang_decl.
2107 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
2109 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
2110 (fit_decomposition_lang_decl): Likewise.
2111 (retrofit_lang_decl): Use worker functions.
2112 (cxx_dup_lang_specific_decl): Use selector enum.
2113 (maybe_add_lang_type_raw): New. Broken out of ...
2114 (cxx_make_type_name): ... here. Call it.
2116 2017-05-30 Jason Merrill <jason@redhat.com>
2118 PR c++/80856 - ICE with local extern in template
2119 * semantics.c (finish_call_expr): Replace a local extern overload
2120 set in a template with the IDENTIFIER_NODE.
2122 2017-05-30 David Malcolm <dmalcolm@redhat.com>
2124 * call.c (perform_implicit_conversion_flags): Convert
2125 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
2126 (print_conversion_rejection): Replace pairs of %qT with
2127 %qH and %qI in various places.
2128 (build_user_type_conversion_1): Likewise.
2129 (build_integral_nontype_arg_conv): Likewise.
2130 (build_conditional_expr_1): Likewise.
2131 (convert_like_real): Likewise.
2132 (convert_arg_to_ellipsis): Likewise.
2134 (initialize_reference): Likewise.
2135 * cvt.c (cp_convert_to_pointer): Likewise.
2136 (cp_convert_to_pointer): Likewise.
2137 (convert_to_reference): Likewise.
2138 (ocp_convert): Likewise.
2139 * error.c (cp_printer): Gain bool and const char ** parameters.
2140 (struct deferred_printed_type): New struct.
2141 (class cxx_format_postprocessor): New class.
2142 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
2143 to pp->m_format_postprocessor.
2144 (comparable_template_types_p): New function.
2145 (newline_and_indent): New function.
2146 (arg_to_string): New function.
2147 (print_nonequal_arg): New function.
2148 (print_template_differences): New function.
2149 (type_to_string_with_compare): New function.
2150 (print_template_tree_comparison): New function.
2151 (append_formatted_chunk): New function.
2152 (add_quotes): New function.
2153 (cxx_format_postprocessor::handle): New function.
2154 (defer_phase_2_of_type_diff): New function.
2155 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
2157 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
2158 %qH and %qI in various places.
2159 (convert_member_func_to_ptr): Likewise.
2160 (build_reinterpret_cast_1): Likewise.
2161 (convert_for_assignment): Likewise.
2162 * typeck2.c (check_narrowing): Likewise.
2164 2017-05-30 Nathan Sidwell <nathan@acm.org>
2166 Kill IDENTIFIER_NAMESPACE_BINDINGS
2167 * cp-tree.h (lang_identifier): Delete namespace_bindings.
2168 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
2169 (lang_decl_ns): Add bindings.
2170 (DECL_NAMESPACE_BINDINGS): New.
2171 * lex.c (retrofit_lang_decl): Create namespace hash table.
2172 * name-lookup.c (find_namespace_slot): Change to use hash-map.
2173 * ptree.c (cxx_print_binding): Delete.
2174 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
2176 * cp-tree.def (OVERLOAD): Fix comment.
2177 * cp-tree.h: Fix comments and whitespace.
2178 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
2179 * name-lookup.c (add_decl_to_level): Assert not class.
2180 (check_local_shadow): Use OVL_P.
2181 (pushdecl_with_scope_1): Rename to ...
2182 (do_pushdecl_with_Scope): ... here.
2183 (do_nonmember_using_decl): Use qualified_namespace_lookup return
2185 (push_class_level_binding_1): Use OVL_P.
2186 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
2187 (pushtag_1): Rename to ...
2188 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
2190 (store_class_bindings): Do not time here.
2191 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
2192 * pt.c (listify): Declare argvec at point of initialization.
2195 * name-lookup.c (add_decl_to_level): Assert not making a circular
2197 (update_binding): Don't prematurely slide artificial decl.
2199 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
2201 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
2203 2017-05-29 Nathan Sidwell <nathan@acm.org>
2205 PR c++/80891 (#1,#5)
2206 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
2207 * name-lookup.c (name_lookup): Add deduping field.
2208 (name_lookup::preserve_state, name_lookup::restore_state): Deal
2210 (name_lookup::add_overload): New.
2211 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
2212 (name_lookup::search_adl): Set deduping. Don't unmark here.
2213 * pt.c (most_specialized_instantiation): Revert previous change,
2214 Assert not given duplicates.
2215 * tree.c (lookup_mark): Just mark the underlying decls.
2216 (lookup_maybe_add): Dedup using marked decls.
2219 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
2220 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
2222 Stat hack representation
2223 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
2224 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
2226 (find_namespace_binding): Replace with ...
2227 (find_namespace_slot): ... this.
2228 (find_namespace_value): New.
2229 (name_lookup::search_namespace_only,
2230 name_lookup::adl_namespace_only): Adjust.
2231 (update_binding): Add SLOT parameter, adjust.
2232 (check_local_shadow): Use find_namespace_value.
2233 (set_local_extern_decl_linkage): Likewise.
2234 (do_pushdecl): Adjust for namespace slot.
2235 (push_local_binding): Assert not a namespace binding.
2236 (check_for_out_of_scope_variable): Use find_namespace_value.
2237 (set_identifier_type_value_with_scope): Likewise.
2238 (get_namespace_binding): Likewise.
2239 (set_namespace_binding): Delete.
2240 (set_global_binding): Directly update the binding.
2241 (finish_namespace_using_decl): Likewise.
2242 (lookup_type_scope_1): Use find_namespace_slot and update.
2243 (do_push_nested_namespace): Use find_namespace_value.
2246 * pt.c (most_specialized_instantiation): Cope with duplicate
2250 * cp-tree.h (build_min_nt_call_vec): Declare.
2251 * decl.c (build_offset_ref_call_from_tree): Call it.
2252 * parser.c (cp_parser_postfix_expression): Likewise.
2253 * pt.c (tsubst_copy_and_build): Likewise.
2254 * semantics.c (finish_call_expr): Likewise.
2255 * tree.c (build_min_nt_loc): Keep unresolved lookups.
2256 (build_min): Likewise.
2257 (build_min_non_dep): Likewise.
2258 (build_min_non_dep_call_vec): Likewise.
2259 (build_min_nt_call_vec): New.
2262 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
2264 (lookup_keep): Call it.
2266 2017-05-26 Nathan Sidwell <nathan@acm.org>
2269 * name-lookup.c (push_inline_namespaces): New.
2270 (push_namespace): Look inside inline namespaces.
2272 Inline and using namespace representation change.
2273 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
2275 (DECL_NAMESPACE_USING): Adjust.
2276 (DECL_NAMESPACE_INLINEES): New.
2277 * name-lookup.h (struct cp_binding_level): Change usings
2279 * name-lookup.c (name_lookup::do_queue_usings,
2280 name_lookup::queue_usings): Adjust.
2281 (name_lookup::search_namespace, name_lookup::search_usings,
2282 name_lookup::queue_namespace): Adjust.
2283 (name_lookup::adl_namespace_only): Adjust.
2284 (add_using_namespace, push_namespace): Push onto vector.
2285 (pop_namespace): Add timing logic.
2287 * call.c (build_operator_new_call): Do namelookup and ADL here.
2288 (build_new_op_1): Likewise.
2289 * name-lookup.h (lookup_function_nonclass): Delete declaration.
2290 (do_using_directive): Likewise.
2291 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
2293 (struct scope_binding): Delete.
2294 (EMPTY_SCOPE_BINDING): Delete.
2295 (set_decl_namespace): Use OVL_P.
2296 (finish_local_using_decl): Lose unnecesary checks.
2297 (lookup_function_nonclass): Delete.
2298 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
2300 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
2301 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
2303 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
2304 (lkp_iterator): Add outer field. Adjust ctor.
2305 (lkp_iterator::operator++): New.
2306 (lookup_mark, lookup_maybe_add): Declare.
2307 * name-lookup.c (name_lookup): Delete fn_set member.
2308 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
2310 (name_lookup::add_value): Use lookup_add directly.
2311 (name_lookup::add_fns: Use lookup_maybe_add.
2312 (name_lookup::search_adl): Mark and unmark fns.
2314 * pt.c (check_explicit_specialization): Use lookup_add directly.
2315 * ptree.c (cxx_print_xnode): Show complete overload structure.
2316 * tree.c (lookup_mark, lookup_maybe_add): New.
2318 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
2320 2017-05-26 Jakub Jelinek <jakub@redhat.com>
2322 * cp-tree.h (struct lang_decl_decomp): New type.
2323 (struct lang_decl): Add u.decomp.
2324 (LANG_DECL_DECOMP_CHECK): Define.
2325 (DECL_DECOMPOSITION_P): Note it is set also on the vars
2326 for user identifiers.
2327 (DECL_DECOMP_BASE): Define.
2328 (retrofit_lang_decl): Add extra int = 0 argument.
2329 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
2330 use it to influence the selector choices and for selector
2331 0 to non-zero transition copy old content.
2332 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
2333 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
2334 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
2335 wording if decl is a structured binding.
2336 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
2337 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
2338 of individual variables for tuple structured bindings.
2339 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
2340 Clear DECL_DECOMP_BASE.
2341 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
2342 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
2344 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
2347 2017-05-25 Jason Merrill <jason@redhat.com>
2349 PR c++/80605 - __is_standard_layout and zero-length array
2350 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
2352 2017-05-25 Nathan Sidwell <nathan@acm.org>
2354 Kill OVL_CURRENT, OVL_NEXT.
2355 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
2356 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
2357 (consider_binding_level): Use OVL_FIRST.
2358 (cp_emit_debug_info_for_using): Use lkp_iterator.
2359 * pt.c (check_explicit_specialization): Use ovl_iterator.
2361 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
2362 * cp-tree.h (lang_decl_ns): Remove ns_users field.
2363 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
2364 (TREE_INDIRECT_USING): Delete.
2365 * name-lookup.h (is_associated_namespace): Delete.
2366 * name-lookup.c (name_lookup::search_usings,
2367 name_lookup::do_queue_usings): Usings are always direct.
2368 (is_associated_namespace): Delete.
2369 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
2370 (namespace_ancestor_1, namespace_ancestor): Delete.
2371 (push_using_directive_1, push_using_directive): Delete.
2372 (add_using_namespace_1): Delete.
2373 (add_using_namespace): Reimplement.
2374 (emit_debug_info_using_namespace): New.
2375 (finish_namespace_using_directive, finish_local_using_directive,
2376 push_namespace): Adjust.
2377 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
2379 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
2381 * semantics.c (finish_handler_parms): Warn about non-reference type
2384 2017-05-25 Nathan Sidwell <nathan@acm.org>
2386 Reimplement unqualified namespace lookup.
2387 * name-lookup.c (name_lookup::using_pair,
2388 name_lookup::using_queue): New typedefs.
2389 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
2390 name_lookup::queue_usings): New.
2391 (name_lookup::search_unqualified): New.
2392 (merge_functions, same_entity_p, ambiguous_decl,
2393 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
2394 lookup_using_namespace): Delete.
2395 (lookup_name_real_1): Adjust.
2397 Reimplement qualified namespace lookup.
2398 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
2399 (name_lookup::ambiguous, name_lookup::add_value,
2400 name_lookup::add_type, name_lookup::process_binding): New.
2401 (name_lookup::search_namespace_only,
2402 name_lookup::search_namespace, name_lookup::search_usings): New.
2403 (name_lookup::search_qualified): New.
2404 (do_nonmember_using_decl, suggest_alternatives_for,
2405 lookup_qualified_name): Adjust.
2406 (tree_vec_contains): Delete.
2407 (qualified_lookup_using_namespace): Rename to ...
2408 (qualified_namespace_lookup): ... here. Reimplement.
2411 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
2412 * name-lookup.h (lookup_arg_dependent): Return plain tree.
2413 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
2414 arg_assoc_args_vec, arg_assoc_type, add_function,
2415 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
2416 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
2417 lookup_arg_dependent_1): Delete.
2418 (name_lookup): New lookup object.
2419 (name_lookup::preserve_state, name_lookup::restore_state,
2420 name_lookup::mark_seen, name_lookup::find_and_mark,
2421 name_lookup::add_fns, name_lookup::adl_namespace_only,
2422 name_lookup::adl_namespace, name_lookup::adl_class_only,
2423 name_lookup::adl_bases, name_lookup::adl_class,
2424 name_lookup::adl_expr, name_lookup::adl_type,
2425 name_lookup::adl_template_arg, name_lookup::search_adl): New.
2426 (lookup_arg_dependent): Return a plain tree. Adjust.
2427 (is_associated_namespace): Move later.
2429 2017-05-24 Nathan Sidwell <nathan@acm.org>
2431 * friend.c (do_friend): Remove check for existing decl.
2432 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
2433 * name-lookup.c (push_local_binding): Directly look for binding.
2434 (lookup_name_innermost_nonclass_level_1): Delete.
2435 (lookup_name_innermost_nonclass_level): Delete.
2437 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
2439 * cp-tree.h (cp_free_lang_data): Add extern.
2440 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
2442 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
2443 * typeck.c (type_unknown_p): Delete.
2444 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
2445 overload management.
2446 (dependent_name): Likewise.
2447 (decl_anon_ns_mem_p): Simplify.
2449 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
2452 * tree.c (reshape_init): Use unqualified type for direct enum init.
2453 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
2454 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
2455 non-class destination types.
2456 (build_const_cast_1): Strip cv-quals from destination types.
2457 (build_static_cast, build_reinterpret_cast, build_const_cast)
2458 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
2460 2017-05-24 Martin Sebor <msebor@redhat.com>
2463 * call.c (fully_fold_internal): Adjust.
2465 2017-05-24 Nathan Sidwell <nathan@acm.org>
2467 * cp-tree.h (ovl_skip_hidden): Declare.
2468 * tree.c (ovl_skip_hidden): New.
2469 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
2470 (lookup_arg_dependent_1): Likewise.
2471 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
2472 (hidden_name_p, remove_hidden_names): Delete.
2473 (lookup_name_real_1): Do not strip hidden names.
2474 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
2476 * cp-tree.h (OVL_HIDDEN_P): New.
2477 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
2478 (ovl_iterator::reveal_node): Declare.
2479 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
2480 (ovl_insert): Order on hiddenness.
2481 (ovl_iterator::reveal_node): New.
2482 * name-lookup.c (anticipated_builtin_p): New.
2483 (supplement_binding_1): Use it.
2484 (set_local_extern_decl_linkage): Use hidden_p.
2485 (do_pushdecl): Deal with unhiding a hidden decl, use
2486 anticipated_builtin_p.
2487 (do_nonmember_using_decl): Use anticipated_decl_p.
2488 (lookup_name_real_1): Use DECL_HIDDEN_P.
2490 2017-05-23 Jason Merrill <jason@redhat.com>
2492 -Wunused and C++17 structured bindings
2493 * decl.c (poplevel): Don't warn about unused structured bindings,
2494 only real variables.
2495 * error.c (dump_simple_decl): Handle structured bindings.
2496 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
2498 2017-05-23 Nathan Sidwell <nathan@acm.org>
2500 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
2501 * name-lookup.c (create_local_binding): New.
2502 (update_binding): New.
2503 (pushdecl_maybe_friend_1): Rename to ...
2504 (do_pushdecl): ... this. Reimplement.
2506 (push_overloaded_decl_1, push_overloaded_decl): Delete.
2508 2017-05-23 Jason Merrill <jason@redhat.com>
2510 PR c++/80396 - built-in for make_integer_sequence.
2511 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
2512 (expand_integer_pack, expand_builtin_pack_call): New.
2513 (find_parameter_packs_r): Check builtin_pack_call_p.
2514 (check_for_bare_parameter_packs): Handle it.
2515 (tsubst_pack_expansion): Call expand_builtin_pack_call.
2516 (declare_integer_pack): New.
2517 (init_template_processing): Call it.
2518 * decl2.c (mark_used): Check builtin_pack_fn_p.
2520 2017-05-23 Nathan Sidwell <nathan@acm.org>
2522 * name-lookup.c (find_namespace_binding): New.
2523 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
2524 (set_identifier_type_value_with_scope): Use find_namespace_binding.
2525 (find_binding, cp_binding_level_find_binding_for_name,
2526 binding_for_name, namespace_binding_1): Delete.
2527 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
2528 (get_namespace_binding, set_namespace_binding,
2529 finish_namespace_using_decl, unqualified_namespace_lookup_1,
2530 qualified_lookup_using_namespace, lookup_type_scope_1,
2531 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
2534 * parser.c (cp_parser_template_id): Keep the lookup when stashing
2537 * cp-tree.h (DECL_HIDDEN_P): New.
2538 * name-lookup.c (set_decl_context,
2539 set_local_extern_decl_linkage): New, broken out of ...
2540 (pushdecl_maybe_friend_1): ... here. Call them.
2542 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
2544 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
2545 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
2548 2017-05-23 Nathan Sidwell <nathan@acm.org>
2550 * cp-tree.h (OVL_P): New.
2551 * name-lookup.h (push_local_binding): Delete.
2552 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
2553 (finish_namespace_using_decl, finish_local_using_decl): ... here
2554 * name-lookup.c (add_decl_to_level): Swap args.
2555 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
2556 (diagnose_name_conflict): Check contexts are same for redecl.
2557 (update_local_overload): New.
2558 (compparms_for_decl_and_using): Rename to ...
2559 (matching_fn_p): ... here.
2560 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
2561 push_local_bindings call.
2562 (push_local_binding): Make static, replace FLAGS arg with
2564 (validate_nonmember_using_decl): Use OVL_FIRST.
2565 (do_nonmember_using_decl): Use in/out parameters. Use
2566 lkp_iterator and simplify.
2567 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
2568 (finish_namespace_using_decl, finish_local_using_decl): ... here.
2570 (lookup_type_current_level): Delete.
2571 * parser.c (cp_parser_using_declaration): Adjust.
2572 * pt.c (tsubst_expr): Adjust.
2574 2017-05-22 Nathan Sidwell <nathan@acm.org>
2576 * name-lookup.h (parse_using_directive): Replace with ...
2577 (finish_namespace_using_directive): ... this and ...
2578 (finish_local_using_directive): ... this.
2579 * name-lookup.c (add_using_namespace_1): Move later.
2580 (add_using_namespace): Move later, add namespace_p arg, remove
2582 (push_using_directive_1): Directly recurse.
2583 (do_using_directive, parse_using_directive): Delete, split into ...
2584 (finish_namespace_using_directive): ... this and ...
2585 (finish_local_using_directive): ... this.
2586 (push_namespace): Use add_using_namespace.
2587 * parser.c (cp_parser_using_directive): Call
2588 finish_namespace_using_directive or finish_local_using_directive.
2589 * pt.c (tsubst_expr): Call finish_local_using_directive.
2591 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
2592 * cp-tree.h (raw_dump_id): Declare.
2593 * decl2.c (raw_dump_id): Define.
2594 (dump_tu): Use raw_dump_id.
2596 * config-lang.in (gtfiles): Sort list, break lines.
2598 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
2599 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
2600 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
2601 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
2602 CPTI_RETHROW_FN): New.
2603 (noexcept_deferred_spec): New.
2604 (terminate_node, call_unexpected_node): Rename to ...
2605 (terminate_fn, call_unexpected_fn): ... here.
2606 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
2607 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
2608 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
2609 (init_exception_processing): Adjust.
2610 (declare_library_fn): Create and push the fns here.
2611 (do_get_exception_ptr, do_begin_catch, do_end_catch,
2612 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
2613 declare_library_fn use.
2614 (unevaluated_noexcept_spec): Adjust.
2615 * cp-gimplify.c (genericize_eh_spec_block,
2616 gimplify_most_not_throw_expr): Adjust.
2618 * name-lookup.c (pushdecl_top_level,
2619 pushdecl_top_level_and_finish): Move after namespace pushing and
2621 (push_to_top_level): Rename to ...
2622 (do_push_to_top_level): ... here. Remove timing code.
2623 (pop_from_top_level_1): Rename to ...
2624 (do_pop_from_top_level): ... here.
2625 (do_push_nested_namespace, do_pop_nested_namespace)
2626 (push_to_top_level): New wrapper for do_push_to_top_level.
2627 (pop_from_top_level): Adjust.
2628 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
2630 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
2632 * config-lang.in (gtfiles): Add c-family/c-format.c,
2633 except.c, init.c, lambda.c and friend.c.
2634 * class.c (dvirt_fn): Move out of function scope,
2636 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
2637 * init.c (fn): Likewise.
2638 * lambda.c (ptr_id, max_id): Likewise.
2639 * friend.c (global_friend): Add GTY attribute.
2641 2017-05-19 Nathan Sidwell <nathan@acm.org>
2643 * call.c (add_list_candidates): Use OVL_FIRST.
2644 (build_new_method_call_1): Likewise.
2645 * cp-tree.h (OVL_SINGLE_P): New.
2646 (TYPE_HIDDEN_P): New.
2647 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
2648 * dump.c (cp_tump_tree): Adjust overload dumping.
2649 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
2651 * method.c (lazily_declare_fn): Assert we added it.
2652 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
2654 (cp_parser_template_name): Use lkp_iterator.
2655 * pt.c (begin_template_parm_list): Fixup comment.
2656 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
2657 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
2658 (ovl_scope): Use lkp_iterator.
2660 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
2662 * parser.c (cp_parser_omp_clause_default): Handle
2663 "OMP_CLAUSE_DEFAULT_PRESENT".
2665 * parser.c (cp_parser_omp_clause_default): Avoid printing more
2666 than one syntax error message.
2668 2017-05-19 Nathan Sidwell <nathan@acm.org>
2670 * class.c (class_dump_id): Define.
2671 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
2672 * cp-objcp-common.c (cp_register_dumps): New.
2673 * cp-objcp-common.h (cp_register_dumps): Declare.
2674 (LANG_HOOKS_REGISTER_DUMPS): Override.
2675 * cp-tree.h (class_dump_id): Declare.
2677 2017-05-18 Nathan Sidwell <nathan@acm.org>
2679 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
2681 (lookup_keep): Declare.
2682 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
2683 * pt.c (tsubst_copy): Assert lookup is persistent.
2684 * semantics.c (finish_call_expr): Use lkp_iterator, call
2686 * tree.c (ovl_copy): New.
2687 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
2690 * cp-tree.h (OVL_USED): Replace with ...
2691 (OVL_USING_P): ... this.
2692 (ovl_iterator::using_p): Adjust.
2693 * name-lookup.c (push_overloaded_decl_1,
2694 do_nonmember_using_decl): Adjust.
2695 * search.c (lookup_field_r): Adjust.
2696 * tree.c (ovl_insert, ovl_scope): Adjust.
2698 * cp-tree.h (lookup_add): Swap args.
2699 (ovl_cons, build_overload): Delete.
2700 * name-lookup.c (add_function, push_overloaded_decl_1,
2701 do_nonmember_using_decl, merge_functions, remove_hidden_names):
2702 Use lookup_add, ovl_insert.
2703 * pt.c (check_explicit_specialization): Use lookup_add.
2704 (do_class_deduction): Likewise. Refactor if.
2705 * tree.c (lookup_add): Swap args.
2706 (ovl_cons, build_overload): Delete.
2708 * name-lookup.c (find_local_binding): New, broken out of ...
2709 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
2710 (set_namespace_binding): Swap scope & name args.
2711 (namespace_binding_1): Likewise.
2712 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
2713 (push_overloaded_decl_1): Likewise.
2714 (set_global_binding): Likewise.
2715 (get_namespace_binding): Adjust namespace_binding_1 call.
2717 2017-05-17 Nathan Sidwell <nathan@acm.org>
2719 * cp-tree.h (default_hash_traits <lang_identifier *>): New
2721 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
2722 (extern_c_fns): New hash table.
2723 (check_extern_c_conflict): New, broken out of ...
2724 (pushdecl_maybe_friend_1): ... here. Call it.
2725 (c_linkage_bindings): Just look in hash table.
2727 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
2731 Implement new C++ intrinsics __is_assignable and __is_constructible.
2732 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
2734 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
2735 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2736 * method.c (constructible_expr): Set cp_unevaluated.
2737 (is_xible_helper): New.
2738 (is_trivially_xible): Adjust.
2740 * parser.c (cp_parser_primary_expression): Handle
2741 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
2742 (cp_parser_trait_expr): Likewise.
2743 * semantics.c (trait_expr_value): Handle
2744 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2746 2017-05-17 Nathan Sidwell <nathan@acm.org>
2748 * cp-tree.h (ovl_iterator::using_p): New predicate.
2749 (ovl_iterator::remove_node): New worker.
2750 (ovl_insert): Declare.
2751 * tree.c (ovl_insert): New.
2752 (ovl_iterator::remove_node): New.
2753 * class.c (add_method): Use ovl_iterator, ovl_insert.
2754 (clone_function_decl): Fix description.
2755 (clone_constructors_and_destructors): Use ovl_iterator.
2757 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
2758 (maybe_warn_about_overly_private_class): Use ovl_iterator.
2759 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
2760 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
2761 (get_base_fndecls): Use ovl_iterator.
2762 (warn_hidden): Use OVL_NAME, ovl_iterator.
2763 (add_implicitly_declared_members): Use ovl_iterator.
2764 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
2766 (finish_shorthand_constraint): Simplify, use ovl_make.
2767 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
2768 * search.c (shared_member_p): Use ovl_iterator.
2769 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
2770 (lookup_conversion_operator): Use OVL_FIRST.
2771 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
2772 (look_for_overrides_here): Use ovl_iterator.
2773 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
2774 * typeck.c (build_x_unary_op): Use ovl_make.
2776 2017-05-17 Martin Liska <mliska@suse.cz>
2778 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
2779 use it instead of int type.
2780 (dump_vtable): Likewise.
2781 (dump_vtt): Likewise.
2782 * decl2.c (dump_tu): Likewise.
2784 2017-05-16 David Malcolm <dmalcolm@redhat.com>
2786 * call.c (enforce_access): Add access_failure_info * param and use
2787 it to record access failures.
2788 * cp-tree.h (class access_failure_info): New class.
2789 (enforce_access): Add access_failure_info * param, defaulting to
2791 (lookup_member): Likewise.
2792 (locate_field_accessor): New function decl.
2793 (perform_or_defer_access_check): Add access_failure_info * param,
2795 * search.c (lookup_member): Add access_failure_info * param and
2796 pass it on to call to perform_or_defer_access_check.
2797 (matches_code_and_type_p): New function.
2798 (field_access_p): New function.
2799 (direct_accessor_p): New function.
2800 (reference_accessor_p): New function.
2801 (field_accessor_p): New function.
2802 (struct locate_field_data): New struct.
2803 (dfs_locate_field_accessor_pre): New function.
2804 (locate_field_accessor): New function.
2805 * semantics.c (perform_or_defer_access_check): Add
2806 access_failure_info * param, and pass it on to call to
2808 * typeck.c (access_failure_info::record_access_failure): New method.
2809 (access_failure_info::maybe_suggest_accessor): New method.
2810 (finish_class_member_access_expr): Pass an access_failure_info
2811 instance to the lookup_member call, and call its
2812 maybe_suggest_accessor method afterwards.
2814 2017-05-16 Marek Polacek <polacek@redhat.com>
2818 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
2820 2017-05-16 Nathan Sidwell <nathan@acm.org>
2822 * name-lookup.c (check_local_shadow): New, broke out of ...
2823 (pushdecl_maybe_friend_1): ... here. Call it.
2825 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
2826 (ovl_first): Move inline definition to end of file.
2827 (ovl_make, lookup_add): Declare.
2828 (get_fns, get_first_fn): Make pure.
2829 * tree.c (ovl_cache): New.
2830 (ovl_make, lookup_add): New.
2831 * pt.c (do_class_deduction): Don't add candidates that will be
2834 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
2835 (print_error_for_call_failure): Use OVL_NAME.
2836 (build_op_call_1): Use ovl_iterator.
2837 (add_candidates): Use OVL_FIRST & lkp_iterator.
2838 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
2840 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
2841 (type_has_user_nondefault_constructor,
2842 in_class_defaulted_default_constructor,
2843 type_has_user_provided_constructor,
2844 type_has_user_provided_or_explicit_constructor,
2845 type_has_non_user_provided_default_constructor,
2846 vbase_has_user_provided_move_assign,
2847 type_has_move_constructor, type_has_move_assign,
2848 type_has_user_declared_move_constructor,
2849 type_has_user_declared_move_assign,
2850 type_build_ctor_call, type_build_dtor_call,
2851 type_requires_array_cookie, explain_non_literal_class): Likewise.
2852 (finish_struct): Use lkp_iterator.
2853 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
2854 (note_name_declared_in_class): Use OVL_NAME.
2855 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
2856 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
2857 cxx_pretty_printer::expression): Likewise.
2858 * decl2.c (check_classfn): Use ovl_iterator.
2859 * pt.c (retrieve_specialization): Use ovl_iterator.
2860 * tree.c (cp_tree_equal): Use lkp_iterator.
2861 (type_has_nontrivial_copy_init): Use ovl_iterator.
2863 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
2864 check is_overloaded_fn.
2866 2017-05-16 Martin Liska <mliska@suse.cz>
2868 * parser.c (cp_lexer_print_token): Add default value for flags
2869 argument of print_gimple_stmt, print_gimple_expr,
2870 print_generic_stmt and print_generic_expr.
2872 2017-05-16 Nathan Sidwell <nathan@acm.org>
2874 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
2876 (MAYBE_BASELINK_FUNCTIONS): New.
2877 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
2878 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
2879 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
2880 * method.c (inherited_ctor_binfo): Use ovl_iterator.
2881 (binfo_inherited_from): Likewise.
2882 * parser.c (lookup_literal_operator): Use lkp_iterator.
2883 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
2884 (print_candidates_1): Likewise.
2885 (determine_specialization): Likewise.
2886 (resolve_overloaded_unification): Likewise.
2887 (resolve_nondeduced_context): Likewise.
2888 (type_dependent_expression_p): Likewise.
2889 (dependent_template_p): Likewise.
2890 * ptree.c (cxx_print_xnode): Likewise.
2891 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
2892 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
2893 * typeck.c (check_template_keyword): Use lkp_iterator.
2895 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
2897 * constexpr.c (function_concept_check): Use OVL_FIRST.
2898 * cvt.c (build_expr_type_conversion): Likewise.
2899 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
2900 * decl2.c (mark_used): Use OVL_FIRST.
2901 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
2902 (dump_expr, location_of): Use OVL_FIRST.
2903 * friend.c (do_friend): Use OVL_NAME.
2904 * init.c (build_offset_ref): Use OVL_FIRST.
2905 * mangle.c (write_member_name): Likewise.
2906 (write_expression): Use OVL_NAME.
2907 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
2908 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
2909 * pt.c (check_explicit_specialization): Use OVL_FIRST.
2910 (check_template_shadow): Likewise.
2911 (tsubst_template_args): Use OVL_NAME.
2912 (tsubst_baselink): Use OVL_FIRST.
2913 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
2914 * tree.c (get_first_fn): Use OVL_FIRST.
2915 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
2916 (cp_build_addr_expr_1): Use OVL_FIRST.
2918 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
2920 * semantics.c (finish_id_expression): Directly init local var.
2921 (finish_omp_reduction_clause): Use really_overloaded_fn.
2922 * tree.c (get_fns): Document. Assert we got an overload.
2923 (get_first_fn) Document.
2924 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
2925 really_overloaded_fn.
2926 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
2928 * cp-tree.h (SCOPE_DEPTH): New.
2929 * name-lookup.h (is_nested_namespace): Declare.
2930 * name-lookup.c (is_nested_namespace): New.
2931 (is_ancestor): Use it.
2932 (set_decl_namespace): Likewise.
2933 (push_namespace): Set SCOPE_DEPTH.
2934 * pt.c (check_specialization_namespace): Use is_nested_namespace.
2935 (check_unqualigied_spec_or_inst): Likewise.
2937 2017-05-15 Nathan Sidwell <nathan@acm.org>
2940 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
2941 * name-lookup.h (push_namespace): Return int, add make_inline arg.
2942 * name-lookup.c (push_namespace): Deal with inline directly.
2943 Return pushed count.
2944 * parser.c (cp_parser_namespace_definition): Adjust for
2945 push_namespace change.
2947 2017-05-11 Nathan Sidwell <nathan@acm.org>
2949 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
2950 LANG_HOOKS_PUSHDECL): Move to ...
2951 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
2952 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
2953 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
2955 * name-lookup.h (pushdecl): Add default friend parm.
2956 (pushdecl_maybe_friend): Delete.
2957 (pushdecl_top_level): Add default friend parm.
2958 (pushdecl_top_level_maybe_friend): Delete.
2959 * name-lookup.c (pushdecl_maybe_friend): Delete.
2960 (pushdecl): Add is_friend parm.
2961 (pushdecl_top_level): Add is friend_parm.
2962 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
2963 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
2964 * friend.c (do_friend): Adjust.
2965 * pt.c (tsubst_friend_class): Adjust.
2967 Revert pushdecl_top_level_and_finish name change.
2968 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
2969 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
2970 * decl.c (cp_make_fname_decl): Adjust.
2971 * decl2.c (get_guard, handle_tls_init): Adjust.
2972 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
2974 * name-lookup.c (pushdecl_outermost_localscope): Always
2975 conditionally stop timer.
2977 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
2978 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
2980 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
2981 pushtag_top_level_maybe_friend,
2982 pushdecl_top_level_and_finish): Move declarations to ...
2983 * name-lookup.h: ... here. Group pushdecl variants.
2984 (pushdecl_top_level_and_finish): Rename to ...
2985 (pushdecl_top_level_with_init): ... here.
2986 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
2987 * decl2.c (get_guard, handle_tls_init): Likewise.
2988 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
2989 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
2990 * method.c (implicitly_declare_fn): Likewise.
2991 * searchc (node_debug_info_needed): Likewise.
2992 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
2993 (pushdecl_top_level_with_init): ... here.
2994 (pop_everything): Use namespace_bindings_p.
2996 * name-lookup.h (pop_binding): Rename to pop_local_binding.
2997 (getdecls): Rename to get_local_decls.
2998 * name-lookup.c (pop_binding): Rename to ...
2999 (pop_local_binding): ... here.
3000 (pop_bindings_and_leave_scope): Adjust.
3001 (getdecls): Rename to ...
3002 (get_local_decls): ... here. Assert local scope.
3003 * decl.c (poplevel): Assert not namespace. Adjust and simplify
3005 (store_parm_decls): Adjust get_local_decls call.
3006 (parser.c (synthesize_implicit_template_parm): Likewise.
3008 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
3011 * method.c (is_trivially_xible): Reject void types.
3013 2017-05-10 Nathan Sidwell <nathan@acm.org>
3015 * class.c (handle_using_decl): Always use OVL_CURRENT.
3016 (resolve_address_of_overloaded_function): Move iterator decl into
3017 for scope. Don't strip anticipated decls here.
3019 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
3021 (print_candidates): Adjust.
3023 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
3025 * call.c (build_new_function_call): Lose koenig_p arg. Remove
3026 koenig_p handling here.
3027 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
3028 (tsubst_omp_clauses): Likewise.
3029 (do_class_deduction): Adjust buld_new_function_call calls.
3030 * semantics.c (finish_call_expr): Likewise.
3032 2017-05-10 Jason Merrill <jason@redhat.com>
3034 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
3035 (unify_type_mismatch, unify_parameter_pack_mismatch)
3036 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
3037 (unify_parameter_pack_inconsistent, unify_inconsistency)
3038 (unify_vla_arg, unify_method_type_error, unify_arity)
3039 (unify_arg_conversion, unify_no_common_base)
3040 (unify_inconsistent_template_template_parameters)
3041 (unify_template_deduction_failure)
3042 (unify_template_argument_mismatch)
3043 (unify_overload_resolution_failure): Call unify_invalid.
3045 CWG 1847 - Clarifying compatibility during partial ordering
3046 * pt.c (more_specialized_fn): No order between two non-deducible
3049 * pt.c (dependent_type_p): Make sure we aren't called with
3052 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3053 * pt.c (convert_template_argument): Just return an argument pack.
3054 (coerce_template_parameter_pack, template_parm_to_arg)
3055 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
3056 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
3057 Don't set the type of a NONTYPE_ARGUMENT_PACK.
3058 * parser.c (make_char_string_pack, make_string_pack): Likewise.
3060 2017-05-10 Nathan Sidwell <nathan@acm.org>
3062 * cp-tree.h (add_method, clone_function_decl): Change last arg to
3064 * class.c (add_method): Change third arg to bool. Adjust.
3065 (one_inheriting_sig, one_inherited_ctor): Adjust.
3066 (clone_function_decl): Change 2nd arg to bool. Adjust.
3067 (clone_constructors_and_destructors): Adjust.
3068 * lambda.c (maybe_add_lambda_conv_op): Adjust.
3069 * method.c (lazily_declare_fn): Adjust.
3070 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
3071 * semantics.c (finish_member_declaration): Adjust.
3073 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
3076 * decl.c (finish_function): To improve error recovery, change the
3077 logic for calling apply_deduced_return_type.
3079 2017-05-09 Jason Merrill <jason@redhat.com>
3081 PR c++/80605 - __is_standard_layout and empty base
3082 * class.c (check_bases): Ignore empty bases.
3084 PR c++/70979 - literal class and closure types
3085 * class.c (finalize_literal_type_property): Handle closures
3087 (explain_non_literal_class): Likewise.
3089 PR c++/66297, DR 1684 - literal class and constexpr member fns
3090 * constexpr.c (is_valid_constexpr_fn): Only complain about
3091 non-literal enclosing class in C++11.
3092 * class.c (finalize_literal_type_property): Likewise.
3094 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
3097 * pt.c (tsubst_decl): Early return error_mark_node if
3098 grok_ctor_properties returns false.
3100 2017-05-09 Jason Merrill <jason@redhat.com>
3102 PR c++/70167 - array prvalue treated as lvalue
3103 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
3105 * semantics.c (finish_compound_literal): Add fcl_context parameter.
3106 Only make a static variable for C99 syntax.
3107 * parser.c (cp_parser_postfix_expression): Pass it.
3108 * pt.c (tsubst_copy_and_build): Likewise.
3109 * call.c (extend_ref_init_temps): Set
3110 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
3112 2017-05-09 Nathan Sidwell <nathan@acm.org>
3114 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
3115 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
3116 * name-lookup.h (pushdecl_top_level): Declare.
3118 2017-05-08 Jason Merrill <jason@redhat.com>
3120 PR c++/80178 - parameter passing for uncopyable classes
3121 * tree.c (type_has_nontrivial_copy_init): True for classes with only
3122 deleted copy/move ctors.
3123 (remember_deleted_copy, maybe_warn_parm_abi): New.
3124 * decl.c (require_complete_types_for_parms, check_function_type):
3125 Call maybe_warn_parm_abi.
3126 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
3128 2017-05-08 Nathan Sidwell <nathan@acm.org>
3130 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
3131 (start_preparsed_function): Do decl pushing before setting
3132 current_funciton_decl and announcing it.
3134 * name-lookup.h (pushdecl_with_scope): Replace with ...
3135 (pushdecl_outermost_localscope): ... this.
3136 * name-lookup.c (pushdecl_with_scope): Replace with ...
3137 (pushdecl_outermost_localscope): ... this.
3138 (pushdecl_namespace_level): Adjust.
3139 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
3140 * lambda.c (insert_capture_proxy): Likewise.
3142 * class.c (build_vtbl_initializer): Don't shadow outer variable
3145 Revert _binding -> _value change.
3146 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
3147 (get_namespace_binding, set_global_binding): ... these.
3148 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
3149 (get_namespace_binding, set_global_binding): ... these.
3150 (arg_assoc_namespace, pushdecl_maybe_friend_1,
3151 check_for_out_of_scope_variable, push_overloaded_decl_1,
3152 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
3153 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
3154 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
3155 * decl.c (poplevel): Adjust.
3156 * pt.c (make_constrained_auto): Likewise.
3158 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
3160 PR translation/80280
3161 * call.c (print_z_candidate): Fix quoting.
3163 2017-05-05 David Malcolm <dmalcolm@redhat.com>
3165 * error.c (pedwarn_cxx98): Replace report_diagnostic
3166 with diagnostic_report_diagnostic.
3168 2017-05-05 Nathan Sidwell <nathan@acm.org>
3170 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
3171 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
3172 (IDENTIFIER_NAMESPACE_VALUE): Delete.
3173 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
3175 (get_namespace_value, set_global_value): ... these.
3176 (get_global_value_if_present, is_typename_at_global_scope): Delete.
3177 * decl.c (poplevel): Use get_namespace_value.
3178 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
3179 * class.c (build_vtbl_initializer): Stash library decl in
3180 static var. Use IDENTIFIER_GLOBAL_VALUE.
3181 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
3182 do_allocate_exception, do_free_exception, build_throw): Likewise.
3183 * init.c (throw_bad_array_new_length): Likewise.
3184 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
3185 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
3186 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
3187 get_namespace_value.
3188 (set_namespace_binding_1): Rename to
3189 (set_namespace_binding): ... here.
3190 (set_global_value): New.
3191 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
3192 get_namespace_value.
3193 * pt.c (listify): Use get_namespace_value.
3195 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
3197 * lex.c (unqualified_name_lookup_error): Likewise.
3199 * class.c (alter_class): Use retrofit_lang_decl directly.
3200 * decl.c (push_local_name, dupliate_decls): Likewise.
3201 * semantics.c (omp_privatize_field): Likewise.
3203 Kill walk_namespaces.
3204 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
3205 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
3207 Kill per-namespace static_decls.
3208 * cp-tree.h (static_decls): Declare.
3209 (wrapup_globals_for_namespace,
3210 diagnose_inline_vars_for_namespace): Replace with ...
3211 (wrapup_namespace_globals): ... this.
3212 * decl.c (static_decls): Define.
3213 (wrapup_globals_for_namespace,
3214 diagnose_inline_vars_for_namespace): Replace with ...
3215 (wrapup_namespace_globals): ... this.
3216 (cxx_init_decl_processing): Initialize static_decls.
3217 * decl2.c (c_parse_final_cleanups): Adjust.
3218 * name-lookup.h (cp_binding_level): Remove static_decls member.
3219 * name-lookup.c (add_decl_to_level): Adjust.
3220 (begin_scope): Adjust.
3222 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
3225 * decl.c (reshape_init): Unconditionally return error_mark_node
3226 upon error about too many initializers.
3228 2017-05-04 Nathan Sidwell <nathan@acm.org>
3230 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
3232 2017-05-04 Martin Sebor <msebor@redhat.com>
3234 PR translation/80280
3235 * call.c (print_z_candidate): Add missing quoting to %D and other
3237 (build_op_call_1): Same.
3238 * constraint.cc (diagnose_check_constraint): Same.
3239 * mangle.c (mangle_decl): Same.
3240 * name-lookup.c (cp_binding_level_debug): Same.
3241 (set_decl_namespace): Same.
3242 * parser.c (cp_parser_tx_qualifier_opt): Same.
3243 * pt.c (print_candidates_1): Same.
3244 (check_template_variable): Same.
3245 (tsubst_default_argument): Same.
3246 (most_specialized_partial_spec): Same.
3247 * semantics.c (omp_reduction_lookup): Same.
3248 * tree.c (check_abi_tag_redeclaration): Same.
3249 * typeck.c (comptypes): Same.
3250 * typeck2.c (abstract_virtuals_error_sfinae): Same.
3252 2017-05-04 Nathan Sidwell <nathan@acm.org>
3255 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
3256 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
3257 CPTI_INIT_LIST_IDENTIFIER.
3258 (global_namespace, global_type_node, global_identifier,
3259 anon_identifier, init_list_identifier): New.
3260 * decl.c (global_type_node, global_scope_name): Delete.
3261 (initialize_predefined_identifiers): Add new identifiers.
3262 (cxx_init_decl_processing): Adjust.
3263 * name-lookup.h (global_namespace, global_type_node): Delete.
3264 * name-lookup.c (global_namespace, anonymous_namespace_name,
3265 get_anonymous_namespace_name): Delete.
3266 (namespace_scope_ht_size, begin_scope, pushtag_1,
3267 push_namespace): Adjust,
3268 * call.c (type_has_extended_temps): Use init_list_identifier.
3269 * pt.c (listify): Likewise.
3271 * name-lookup.c: Reorder functions to make merging from modules
3274 2017-05-03 Jason Merrill <jason@redhat.com>
3276 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
3278 2017-05-03 Nathan Sidwell <nathan@acm.org>
3280 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
3281 along with #defines, to before name-lookup include.
3283 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
3285 * pt.c (is_auto_or_concept): Remove.
3286 (type_uses_auto_or_concept): Remove, unused.
3287 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
3288 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
3289 * cp-tree.h (is_auto_or_concept): Remove.
3291 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
3294 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
3295 add pedigree operation and detach call here.
3296 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
3297 cilk_cp_gimplify_call_params_in_spawned_fn.
3298 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
3299 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
3301 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
3303 * parser.c (cp_parser_member_declaration): Add fix-it hints for
3304 stray comma and missing semicolon at end of member declaration.
3306 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
3308 * parser.c (cp_parser_cast_expression): Add target type of cast to
3310 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
3312 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
3314 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
3315 return type to bool.
3316 * cp-tree.h (grok_ctor_properties): Update.
3318 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
3320 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
3321 information to diagnostic of invalid colon in nested-name-specifier.
3323 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
3325 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
3326 diagnostic of invalid class/struct keyword after enum.
3328 2017-04-25 David Malcolm <dmalcolm@redhat.com>
3330 * parser.c (cp_parser_member_declaration): Add fix-it hint
3331 for removing stray semicolons.
3333 2017-04-25 David Malcolm <dmalcolm@redhat.com>
3335 * name-lookup.c (get_std_name_hint): New function.
3336 (maybe_suggest_missing_header): New function.
3337 (suggest_alternative_in_explicit_scope): Call
3338 maybe_suggest_missing_header.
3340 2017-04-25 David Malcolm <dmalcolm@redhat.com>
3343 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
3344 candidate type of bm from tree to const char *.
3345 (consider_binding_level): Likewise.
3346 (lookup_name_fuzzy): Likewise, using this to merge the best
3347 result from the preprocessor into bm, rather than immediately
3348 returning, so that better matches from reserved words can "win".
3349 Guard the rejection of keywords that don't start decl-specifiers
3350 so it only happens for FUZZY_LOOKUP_TYPENAME.
3352 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
3354 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
3355 (start_enum): Likewise.
3356 (build_enumerator): Likewise. Use %qE instead of plain %E.
3357 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
3358 %<%D%> in diagnostics.
3359 (cp_parser_elaborated_type_specifier): Likewise.
3360 * pt.c (make_pack_expansion): Use %qT and %qE instead of
3361 %<%T%> and %<%E%> in diagnostics.
3362 (tsubst_pack_expansion): Likewise.
3364 2017-04-24 David Malcolm <dmalcolm@redhat.com>
3367 * parser.c (cp_parser_unary_expression): Generate a location
3368 range for alignof and sizeof expressions.
3370 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
3372 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
3374 (cp_parser_virt_specifier_seq_opt): Likewise.
3375 (set_and_check_decl_spec_loc): Likewise twice.
3377 2017-04-21 Jason Merrill <jason@redhat.com>
3379 PR c++/80179 - ICE with initialized flexible array member.
3380 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
3382 2017-04-21 Richard Biener <rguenther@suse.de>
3384 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
3385 (copy_type): Likewise.
3386 * lex.c (copy_decl): Pass down mem-stat info.
3387 (copy_type): Likewise.
3389 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
3392 * init.c (build_new_1): Suppress notes about over-aligned new when
3393 the warning is suppressed.
3395 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
3397 * parser.c (cp_parser_member_declaration): Add warning with fixit
3398 information for extra semicolon after in-class function definition.
3400 2017-04-20 Jakub Jelinek <jakub@redhat.com>
3403 * tree.c (build_cplus_array_type): Call build_array_type
3404 with the intended TYPE_TYPELESS_STORAGE flag value, instead
3405 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
3408 2017-04-18 Marek Polacek <polacek@redhat.com>
3410 PR c++/80244 - ICE with attribute in template alias.
3411 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
3413 PR c++/80241 - ICE with alignas pack expansion.
3414 * error.c (dump_expr): Handle TREE_LIST.
3415 * parser.c (cp_parser_std_attribute_list): Return error_mark if
3416 make_pack_expansion returns an error.
3418 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
3421 * class.c (fixup_may_alias): Fix all type variants.
3423 2017-04-17 Jason Merrill <jason@redhat.com>
3425 PR c++/80415 - wrong error with default arg and array reference.
3426 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
3428 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
3430 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
3432 * decl.c (name_unnamed_type): Split out of...
3433 (grokdeclarator): ... this.
3434 * decl.h (name_unnamed_type): Declare.
3436 2017-04-12 Richard Biener <rguenther@suse.de>
3437 Bernd Edlinger <bernd.edlinger@hotmail.de>
3440 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
3441 for arrays of character or std::byte type.
3443 2017-04-11 Jason Merrill <jason@redhat.com>
3445 PR c++/80294 - ICE with constexpr and inheritance.
3446 * constexpr.c (reduced_constant_expression_p):
3447 A null constructor element is non-constant.
3448 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
3449 returning an empty base.
3451 2017-04-11 Jakub Jelinek <jakub@redhat.com>
3454 * decl.c (cp_finish_decomp): If processing_template_decl on
3455 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
3456 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
3457 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
3459 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
3460 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
3463 2017-04-11 Jakub Jelinek <jakub@redhat.com>
3466 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
3468 2017-04-10 Jakub Jelinek <jakub@redhat.com>
3471 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
3472 operand, if it is a static member function, recurse on the
3475 2017-04-10 Marek Polacek <polacek@redhat.com>
3478 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
3479 ORIG_TYPE earlier and not only when shortening.
3481 2017-04-07 Jason Merrill <jason@redhat.com>
3483 PR c++/80356 - ICE with reference to function template argument.
3485 * pt.c (convert_nontype_argument_function): Adjust type even with a
3486 value-dependent argument.
3488 PR c++/80267 - ICE with nested capture of reference
3490 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
3492 2017-04-07 Marek Polacek <polacek@redhat.com>
3495 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
3498 * call.c (build_over_call): Don't check cxx_dialect.
3499 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
3500 whether SUB is a CONSTRUCTOR.
3501 * init.c (build_new_1): Don't check cxx_dialect.
3502 * tree.c (replace_placeholders): Add a function comment. Return if
3503 not in C++14, or if the object isn't a (member of a) class.
3504 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
3505 TYPE is CLASS_TYPE_P.
3507 2017-04-05 Jakub Jelinek <jakub@redhat.com>
3510 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
3511 of a loop doing vec_safe_push of NULL. Formatting fixes.
3512 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
3513 to newidx before calling canonical_type_parameter on newtype.
3515 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
3518 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
3519 UNARY_PLUS_EXPR case.
3521 2017-04-03 Jason Merrill <jason@redhat.com>
3523 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
3525 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
3527 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
3528 * decl2.c (one_static_initialization_or_destruction): Likewise.
3529 * name-lookup.c (store_bindings): Likewise.
3530 * parser.c (make_call_declarator): Likewise.
3531 * pt.c (check_explicit_specialization): Likewise.
3533 2017-04-03 Jason Merrill <jason@redhat.com>
3535 PR sanitizer/79993 - ICE with VLA initialization from string
3536 PR c++/69487 - wrong VLA initialization from string
3537 * init.c (finish_length_check): Split out from build_vec_init.
3538 (build_vec_init): Handle STRING_CST.
3539 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
3540 (digest_init_r): Don't give a STRING_CST VLA type.
3542 2017-03-31 Jakub Jelinek <jakub@redhat.com>
3545 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
3546 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
3547 for NOP_EXPR to REFERENCE_TYPE.
3550 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
3551 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3553 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
3554 Remove extraneous parens.
3555 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
3556 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
3557 (cp_parser_trait_expr): Likewise.
3559 2017-03-27 Jakub Jelinek <jakub@redhat.com>
3562 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
3563 * typeck.c (cxx_mark_addressable): Likewise. Look through
3564 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
3566 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
3568 2017-03-24 Jason Merrill <jason@redhat.com>
3570 PR c++/77339 - ICE with invalid use of alias template.
3571 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
3574 2017-03-24 Marek Polacek <polacek@redhat.com>
3577 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
3578 doesn't have side effects.
3580 2017-03-23 Jason Merrill <jason@redhat.com>
3582 PR c++/80150 - ICE with overloaded variadic deduction.
3583 * pt.c (try_one_overload): Remove asserts.
3585 PR c++/77563 - missing ambiguous conversion error.
3586 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
3588 2017-03-23 Marek Polacek <polacek@redhat.com>
3590 * cp-tree.h: Remove a C_RID_YYCODE reference.
3592 2017-03-22 Jakub Jelinek <jakub@redhat.com>
3595 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
3596 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
3597 processing_template_decl.
3599 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
3602 * name-lookup.c (pushtag_1): Add check for bogus, non template,
3603 std::initializer_list.
3605 2017-03-21 Jakub Jelinek <jakub@redhat.com>
3608 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
3610 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
3613 * init.c (std_placement_new_fn_p): New.
3614 (build_new_1): Call it.
3616 2017-03-20 Jason Merrill <jason@redhat.com>
3618 PR c++/80096 - ICE with C++17 non-type auto.
3619 * pt.c (tsubst): Delay tsubst of type of template non-type
3622 PR c++/79519 - ICE with deleted template friend.
3623 * decl.c (grokdeclarator): Complain about misplaced function
3624 definition using =, as well.
3626 PR c++/79640 - infinite recursion with generic lambda.
3627 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
3628 before substituting its initializer.
3630 2017-03-20 Marek Polacek <polacek@redhat.com>
3631 Paolo Carlini <paolo.carlini@oracle.com>
3633 PR c++/80059 - ICE with noexcept and __transaction_atomic
3634 * except.c (build_must_not_throw_expr): Call
3635 instantiate_non_dependent_expr.
3637 2017-03-19 Jason Merrill <jason@redhat.com>
3639 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
3640 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
3641 reference decomposition.
3643 PR c++/80077 - error with constexpr and -fno-elide-constructors.
3644 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
3645 expanding trivial constructor.
3647 2017-03-17 Jason Merrill <jason@redhat.com>
3649 PR c++/78345 - ICE initializing array from lambda.
3650 * init.c (build_aggr_init): Check array initializer.
3651 (build_vec_init): Check the type of a CONSTRUCTOR.
3653 PR c++/80073 - C++17 ICE with virtual base.
3654 * decl.c (xref_basetypes): Also check for indirect vbases.
3656 2017-03-16 Jason Merrill <jason@redhat.com>
3658 * decl.c (start_enum): std::byte aliases anything.
3661 * constexpr.c (lookup_placeholder): Tweak.
3663 2017-03-15 Jason Merrill <jason@redhat.com>
3665 PR c++/80043 - ICE with -fpermissive
3666 * typeck.c (convert_for_assignment): Handle instantiate_type
3667 not giving an error.
3669 2017-03-14 Nathan Sidwell <nathan@acm.org>
3671 PR c++/79393 DR 1658 workaround
3672 * method.c (synthesized_method_base_walk): Inihibit abstract class
3673 virtual base access check here.
3674 (synthesized_method_walk): Not here.
3676 2017-03-13 Nathan Sidwell <nathan@acm.org>
3678 PR c++/79393 DR 1658 workaround
3679 * method.c (synthesized_method_walk): Check vbases of abstract
3680 classes for dtor walk.
3682 2017-03-10 David Malcolm <dmalcolm@redhat.com>
3684 PR translation/79848
3685 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
3687 2017-03-10 Jason Merrill <jason@redhat.com>
3689 PR c++/79960 - alias templates and partial ordering
3690 * pt.c (comp_template_args): Add partial_order parm.
3691 (template_args_equal): Likewise.
3692 (comp_template_args_porder): New.
3693 (get_partial_spec_bindings): Use it.
3695 2017-03-10 Marek Polacek <polacek@redhat.com>
3698 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
3700 2017-03-10 Jakub Jelinek <jakub@redhat.com>
3703 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
3704 Use XALLOCAVEC macro.
3707 * decl.c (finish_enum_value_list): If value is error_mark_node,
3708 don't copy it and change its type.
3709 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
3710 of CONST_DECL is error_mark_node.
3712 2017-03-09 Marek Polacek <polacek@redhat.com>
3714 PR c++/79900 - ICE in strip_typedefs
3715 * tree.c (strip_typedefs): Skip the attribute handling if T is
3716 a variant type which hasn't been updated yet.
3718 PR c++/79687 - wrong code with pointer-to-member
3719 * init.c (constant_value_1): Break if the variable has a dynamic
3722 2017-03-08 Jason Merrill <jason@redhat.com>
3724 PR c++/79797 - ICE with self-reference in array DMI.
3725 * constexpr.c (lookup_placeholder): Split out...
3726 (cxx_eval_constant_expression): ...from here.
3728 2017-03-07 Jakub Jelinek <jakub@redhat.com>
3731 * parser.c (cp_parser_omp_cancellation_point,
3732 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
3733 cp_parser_omp_target_update): Change "may only be used in compound
3734 statements" diagnostics, such that the same translatable string is
3735 used for all pragmas.
3736 (cp_parser_pragma): Likewise. Use error_at instead of
3737 cp_parser_error for that diagnostics.
3739 2017-03-06 Marek Polacek <polacek@redhat.com>
3741 PR c++/79796 - ICE with NSDMI and this pointer
3742 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
3743 replace_placeholders.
3745 2017-03-06 Jakub Jelinek <jakub@redhat.com>
3748 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
3751 2017-03-06 Jason Merrill <jason@redhat.com>
3753 Revert "Allow deduction guides to look into primary template."
3754 * cp-tree.h, parser.c, pt.c, search.c: Revert.
3756 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
3759 * except.c (build_must_not_throw_expr): Perform the implicit
3760 conversions on the condition.
3762 2017-03-03 Jason Merrill <jason@redhat.com>
3764 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
3767 Core issues 2273 and 2277
3768 * call.c (joust): Adjust using-declaration tiebreaker to handle
3769 the intermediate base case.
3770 * method.c (strip_inheriting_ctors): Just return the argument if
3771 !flag_new_inheriting_ctors.
3773 2017-03-03 Richard Biener <rguenther@suse.de>
3776 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
3778 2017-03-03 Marek Polacek <polacek@redhat.com>
3781 * typeck.c (string_conv_p): In C++11, always call pedwarn with
3784 2017-03-02 Jason Merrill <jason@redhat.com>
3786 Update overload resolution with deduction guides.
3787 * pt.c (do_class_deduction): Always build the copy guide.
3788 (copy_guide_p, template_guide_p): New.
3789 (build_deduction_guide): Remember the original constructor.
3790 * call.c (joust): Prefer the copy guide and non-template guides.
3792 Allow deduction guides to look into primary template.
3793 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
3794 (struct cp_decl_specifier_seq): Add constructor_p.
3795 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
3796 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
3797 Clear deduction_guide_type. Don't handle deduction guide names.
3798 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
3799 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
3800 (cp_parser_member_declaration, cp_parser_cache_defarg)
3801 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
3802 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
3803 (build_deduction_guide): Set deduction_guide_type.
3804 (dependent_scope_p): Check deduction_guide_type.
3805 * search.c (lookup_member): Likewise.
3807 2017-03-02 Jakub Jelinek <jakub@redhat.com>
3810 * init.c (mark_exp_read_r): New function.
3811 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
3812 whole arguments instead of plain mark_exp_read on TREE_LIST values.
3814 2017-03-01 Jason Merrill <jason@redhat.com>
3816 Class template argument deduction in new-expression
3817 * init.c (build_new): Handle deduction from no initializer.
3818 * parser.c (cp_parser_new_expression): Don't require a single
3819 expression for class template deduction.
3820 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
3821 class template placeholder.
3822 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
3823 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
3824 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
3826 2017-03-01 Jakub Jelinek <jakub@redhat.com>
3829 * init.c (emit_mem_initializers): When not constructing vbases of
3830 abstract classes, mark arguments as read for
3831 -Wunused-but-set-parameter.
3833 2017-02-28 Jason Merrill <jason@redhat.com>
3835 Class template argument deduction refinements
3836 * call.c (joust): Move deduction guide tiebreaker down.
3837 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
3838 deduction with no initializer.
3839 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
3840 (do_class_deduction): Use that rather than special case.
3841 (do_auto_deduction): Handle null initializer.
3843 2017-02-28 Jakub Jelinek <jakub@redhat.com>
3845 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
3846 instead of just cond ? "..." : "...".
3847 (grokdeclarator): Likewise.
3848 (build_enumerator): Likewise.
3849 * init.c (build_new_1): Likewise.
3850 * call.c (build_new_method_call_1): Likewise.
3851 * parser.c: Include intl.h.
3852 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
3853 "enter"/"exit" keyword.
3854 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
3857 2017-02-27 Jason Merrill <jason@redhat.com>
3859 PR c++/71568 - SFINAE forming pointer to member function
3860 * init.c (build_offset_ref): Check the return value of
3861 perform_or_defer_access_check.
3863 2017-02-27 Marek Polacek <polacek@redhat.com>
3865 * decl.c (expand_static_init): Add missing } in a comment.
3867 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
3869 * init.c: Include intl.h.
3870 (build_new_1): Move message strings into pedwarn to make them
3871 -Wformat-security friendly. Mark string for translation.
3872 * pt.c (tsubst_copy_and_build): Mark string for translation.
3873 Make the pointer const.
3874 * semantics.c (finish_id_expression): Mark strings for translation.
3876 2017-02-25 Jakub Jelinek <jakub@redhat.com>
3878 * call.c (build_op_delete_call): Make msg1 and msg2 const.
3880 2017-02-24 Jakub Jelinek <jakub@redhat.com>
3883 * call.c (build_over_call): Call check_function_arguments even for
3884 -Wrestrict, adjust check_function_arguments caller.
3885 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
3887 * typeck.c (cp_build_function_call_vec): Adjust
3888 check_function_arguments caller.
3890 2017-02-24 Marek Polacek <polacek@redhat.com>
3892 PR translation/79705
3893 * decl.c (check_redeclaration_exception_specification): Mark a string
3894 for translation. Make the pointer const.
3896 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
3899 * pt.c (register_specialization): Check duplicate_decls return value
3900 for error_mark_node and pass it back.
3902 2017-02-22 Jason Merrill <jason@redhat.com>
3904 PR c++/79679 - missing destructor for argument
3905 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
3908 * pt.c (do_class_deduction): Handle 0 argument case.
3910 2017-02-22 Jakub Jelinek <jakub@redhat.com>
3913 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
3914 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
3915 * constexpr.c (potential_constant_expression_1): Handle
3916 OMP_*, OACC_* and CILK_* trees. Use error_at with
3917 EXPR_LOC_OR_LOC (t, input_location) computed early
3918 instead of error, or error_at with location_of (t).
3920 2017-02-22 Marek Polacek <polacek@redhat.com>
3923 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
3924 if the alignas expression is erroneous.
3925 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
3929 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
3931 2017-02-21 Jason Merrill <jason@redhat.com>
3933 PR c++/50308 - wrong deprecated warning with ADL
3934 PR c++/17729 - duplicate deprecated warning
3935 * semantics.c (finish_id_expression): Only call mark_used on a
3936 function if we aren't building a call.
3938 PR c++/41727 - ICE with partial spec of partial instantiation
3939 * pt.c (process_partial_specialization): For now, don't check more
3940 specialized if there is more than one level of args.
3942 2017-02-21 Marek Polacek <polacek@redhat.com>
3945 * cp-tree.h (maybe_reject_flexarray_init): Declare.
3946 * init.c (maybe_reject_flexarray_init): No longer static.
3947 Add check for current_function_decl.
3948 * parser.c (cp_parser_late_parse_one_default_arg): Reject
3949 a default mem-initializer for a flexible array.
3951 2017-02-21 Jakub Jelinek <jakub@redhat.com>
3952 Paolo Carlini <paolo.carlini@oracle.com>
3955 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
3957 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
3958 decl after the decomposition artificial decl has error_mark_node.
3959 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
3960 instead of just == error_mark_node comparison.
3962 2017-02-21 Jakub Jelinek <jakub@redhat.com>
3965 * decl.c: Include gimplify.h.
3966 (cp_finish_decomp): Make sure there is no sharing of trees
3967 in between DECL_VALUE_EXPR of decomposition decls.
3970 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
3973 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
3974 call cplus_expand_constant on it first.
3976 2017-02-19 Jason Merrill <jason@redhat.com>
3978 PR c++/78139 - destructor needed by new-expression
3979 * call.c (build_special_member_call): Use tf_no_cleanup.
3981 PR c++/78282 - auto template and pack expansion
3982 * pt.c (find_parameter_packs_r): Don't walk into the type of
3983 templates other than template template-parameters.
3985 PR c++/79606 - ICE with this->base_member in NSDMI
3986 * class.c (build_base_path): Check processing_template_decl.
3988 PR c++/79607 - ICE with T{} initializer
3989 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
3991 PR c++/79566 - elaborated-type-specifier in range for
3992 * parser.c (cp_parser_simple_declaration): Fix check for type
3995 PR c++/79400 - confusing suggestion of 'noexcept'
3996 * parser.c (cp_parser_exception_specification_opt): Remove
3997 suggestion for deprecated dynamic exception-specification.
3999 PR c++/79470 - partial ordering with reference parameters
4000 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
4002 PR c++/79500 - ICE with non-template deduction guide
4003 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
4004 DECL_TEMPLATE_RESULT.
4006 PR c++/79580 - ICE with compound literal
4007 * parser.c (cp_parser_class_head): If we're in the middle of an
4008 expression, use ts_within_enclosing_non_class.
4010 PR c++/79503 - inherited ctor taking base class
4011 * call.c (add_function_candidate): Also check that
4012 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
4014 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
4017 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
4020 2017-02-19 Eric Fiselier <eric@efcs.ca>
4021 Jonathan Wakely <jwakely@redhat.com>
4024 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
4025 control warning about literal suffix identifiers without a leading
4028 2017-02-17 Jason Merrill <jason@redhat.com>
4030 PR c++/79508 - lookup error with member template
4031 * parser.c (cp_parser_template_name): Clear
4032 parser->context->object_type if we aren't doing lookup.
4034 PR c++/78690 - ICE with using and global type with same name
4035 * pt.c (type_dependent_object_expression_p): True for
4038 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
4039 * pt.c (convert_template_argument): Just return an auto arg pack.
4040 (tsubst_template_args): Don't tsubst an auto pack type.
4042 PR c++/79556 - C++17 ICE with non-type auto
4043 * pt.c (do_auto_deduction): Don't try to deduce from null type.
4045 PR c++/79533 - C++17 ICE with temporary cast to reference
4046 * call.c (build_over_call): Conversion to a reference prevents copy
4049 2017-02-16 Jakub Jelinek <jakub@redhat.com>
4050 Jason Merrill <jason@redhat.com>
4052 PR c++/79502 - lost nodiscard attribute
4053 * pt.c (apply_late_template_attributes): Do apply non-dependent
4054 attributes to types.
4056 2017-02-16 Jason Merrill <jason@redhat.com>
4058 PR c++/78572 - ICE with self-modifying array initializer
4059 * constexpr.c (cxx_eval_store_expression): The object we're
4060 initializing is outside the constant-expression.
4061 (cxx_eval_call_expression): Set ctx->call.
4063 PR c++/79050 - ICE with undeduced auto and LTO
4064 * decl.c (poplevel): Remove undeduced auto decls.
4066 2017-02-16 Jakub Jelinek <jakub@redhat.com>
4069 * parser.c (cp_parser_omp_target): For -fopenmp-simd
4070 ignore #pragma omp target even when not followed by identifier.
4072 2017-02-15 Jason Merrill <jason@redhat.com>
4073 Jakub Jelinek <jakub@redhat.com>
4075 PR c++/79464 - ICE in IPA with omitted constructor parms
4076 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
4077 (adjust_clone_args): Adjust.
4078 (add_method): Remember omitted parms.
4079 * call.c (add_function_candidate): Likewise.
4080 * mangle.c (write_method_parms): Likewise.
4081 * method.c (ctor_omit_inherited_parms): Return false if there are no
4084 2017-02-15 Martin Sebor <msebor@redhat.com>
4087 * init.c (maybe_reject_flexarray_init): New function.
4088 (perform_member_init): Call it.
4090 2017-02-15 Jakub Jelinek <jakub@redhat.com>
4093 * parser.c (cp_parser_std_attribute): Don't pedwarn about
4094 [[deprecated]] with -std=c++11 and [[fallthrough]] with
4095 -std=c++11 and -std=c++14.
4098 * decl.c (grokdeclarator): For static data members, handle thread_p
4099 only after handling inline.
4101 2017-02-14 Marek Polacek <polacek@redhat.com>
4105 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
4106 clobbering if the postfix expression isn't an EXPR_P.
4108 2017-02-13 Jason Merrill <jason@redhat.com>
4110 PR c++/79461 - ICE with lambda in constexpr constructor
4111 * constexpr.c (build_data_member_initialization): Ignore
4112 initialization of a local variable.
4114 2017-02-13 Jakub Jelinek <jakub@redhat.com>
4116 * init.c (warn_placement_new_too_small): Add missing space in
4118 * parser.c (cp_parser_oacc_declare): Likewise.
4119 * mangle.c (maybe_check_abi_tags): Likewise.
4122 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
4123 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
4124 in the rightmost operand.
4126 2017-02-13 Nathan Sidwell <nathan@acm.org>
4128 PR c++/79296 - ICE mangling localized template instantiation
4129 * decl2.c (determine_visibility): Use template fn context for
4130 local class instantiations.
4132 2017-02-11 Jason Merrill <jason@redhat.com>
4134 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
4135 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
4136 (build_new_1): Use replace_placeholders.
4137 * tree.c (replace_placeholders_t): Also track whether we've seen a
4139 (replace_placeholders, replace_placeholders_r): Adjust.
4140 * cp-tree.h: Adjust.
4142 PR c++/77790 - ICE with auto function in C++11 mode
4143 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
4144 (require_deduced_type): Add complain parm, return bool.
4145 * cp-tree.h: Adjust.
4146 * decl2.c (mark_used): Use require_deduced_type.
4148 2017-02-10 Jason Merrill <jason@redhat.com>
4150 PR c++/78908 - template ops and bitfields
4151 * tree.c (build_min_non_dep): Use unlowered_expr_type.
4153 PR c++/78897 - constexpr union
4154 * constexpr.c (cxx_eval_store_expression): A store to a union member
4155 erases a previous store to another member.
4157 PR c++/71285 - member of fold-expression
4158 * semantics.c (finish_unary_fold_expr)
4159 (finish_binary_fold_expr): Use null type for fold-expressions.
4161 PR c++/79401 - protected inherited constructor
4162 * call.c (enforce_access): For inheriting constructor, find a base
4163 binfo in the path we already have.
4165 2017-02-10 Marek Polacek <polacek@redhat.com>
4168 * pt.c (type_dependent_expression_p): Check if the expression type
4172 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
4173 if warnings shouldn't be given.
4175 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
4178 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
4179 an error_mark_node as type.
4181 2017-02-09 Jakub Jelinek <jakub@redhat.com>
4182 Jason Merrill <jason@redhat.com>
4185 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
4186 from pattern to type.
4188 2017-02-09 Jason Merrill <jason@redhat.com>
4190 PR c++/79316 - default argument in deduction guide
4191 PR c++/79350 - explicit deduction guide
4192 * parser.c (cp_parser_constructor_declarator_p)
4193 (cp_parser_direct_declarator): Parse deduction guides more like
4195 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
4196 * tree.c (special_function_p): Return it.
4197 * decl.c (check_special_function_return_type): Handle it.
4198 (grokdeclarator, grokfndecl): Adjust.
4199 (cp_finish_decl): Pass flags to do_auto_deduction.
4200 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
4201 * pt.c (dguide_name_p): Take a const_tree.
4202 (do_class_deduction): Handle explicit.
4203 (do_auto_deduction): Pass flags through.
4204 (build_deduction_guide): Copy explicit flag.
4206 2017-02-09 Jakub Jelinek <jakub@redhat.com>
4209 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
4210 non-pragma_compound context here.
4211 (cp_parser_omp_target): Likewise.
4212 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
4213 parsing for ordered and target omp pragmas in non-pragma_stmt
4214 non-pragma_compound contexts.
4217 * parser.c (cp_parser_oacc_declare): Formatting fix.
4218 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
4219 automatic variables.
4221 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
4222 Chung-Lin Tang <cltang@codesourcery.com>
4224 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
4225 parsing. Parse constant expression. Remove semantic checking.
4226 (cp_parser_omp_clause_collapse): Disallow tile.
4227 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
4228 error about missing for after already emitting one. Use more
4229 conventional for idiom for unbounded loop.
4230 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
4231 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
4232 (finish_omp_for): Deal with tile clause.
4234 2017-02-07 Nathan Sidwell <nathan@acm.org>
4236 * method.c (synthesized_method_base_walk): New. Broken out of ...
4237 (synthesized_method_walk): ... here. Call it. Cleanup
4240 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
4243 * typeck2.c (process_init_constructor_union): Consider only
4244 FIELD_DECLs when looking for an NSDMI.
4246 2017-02-06 Jason Merrill <jason@redhat.com>
4248 PR c++/71193 - incomplete types in templates
4249 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
4250 handle incomplete type by pedwarning and then treating as dependent.
4252 2017-02-06 Jakub Jelinek <jakub@redhat.com>
4255 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
4256 (potential_constant_expression_1): Likewise.
4259 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
4260 allow one fewer than expected arguments if flag_permissive.
4263 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
4264 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
4265 with error_mark_node type.
4267 2017-02-03 Jason Merrill <jason@redhat.com>
4269 PR c++/78689 - ICE on constructor with label
4270 * optimize.c (maybe_clone_body): Replace omitted parameters with
4272 * class.c (build_clone): Fix logic for omitting inherited parms.
4274 PR c++/12245 - excessive memory use
4275 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
4276 back in. Don't cache constants.
4277 (maybe_constant_init): Don't cache constants.
4279 PR c++/79294 - ICE with invalid template argument
4280 * pt.c (convert_nontype_argument_function): Check value-dependence.
4281 (convert_nontype_argument): Don't check it here for function ptrs.
4283 2017-02-02 Richard Biener <rguenther@suse.de>
4286 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
4287 it lazily on the first changed element only and copy it
4288 fully upfront, only storing changed elements.
4290 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
4293 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
4296 2017-01-31 Jakub Jelinek <jakub@redhat.com>
4299 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
4302 2017-01-31 David Malcolm <dmalcolm@redhat.com>
4305 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
4306 any namespace aliases.
4308 2017-01-31 Nathan Sidwell <nathan@acm.org>
4311 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
4315 * pt.c: (instantiate_decl): Push to top level when current
4316 function scope doesn't match. Only push lmabda scope stack when
4319 * cp-tree.h (instantiate_decl): Make defer_ok bool.
4320 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
4321 (instantiate_decl): Simplify and reorder state saving and restoration.
4324 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
4325 * semantics.c (finish_member_declaration): Assert class is being
4328 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
4330 Introduce C++ support in libcc1.
4331 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
4332 (ansi_opname): Rename to...
4333 (cp_operator_id): ... this. Adjust all callers.
4334 (ansi_assopname): Rename to...
4335 (cp_assignment_operator_id): ... this. Adjust all callers.
4336 (cp_literal_operator_id): Declare.
4337 (set_global_friend): Declare.
4338 (is_global_friend): Declare.
4339 (enum cp_oracle_request): New type.
4340 (cp_binding_oracle_function): New type.
4341 (cp_binding_oracle): Declare.
4342 (cp_finish_injected_record_type): Declare.
4343 * friend.c (global_friend): New var.
4344 (set_global_friend): New fn.
4345 (is_global_friend): New fn.
4346 (is_friend): Call is_global_friend.
4347 * name-lookup.c (cp_binding_oracle): New var.
4348 (query_oracle): New fn.
4349 (qualified_lookup_using_namespace): Call query_oracle.
4350 (lookup_name_real_1): Likewise.
4351 * parser.c (cp_literal_operator_id): Drop static.
4352 * search.c (friend_accessible_p): Call is_global_friend.
4353 * semantics.c (is_this_parameter): Accept a variable if the
4354 binding oracle is enabled.
4356 2017-01-27 Jason Merrill <jason@redhat.com>
4358 PR c++/78771 - ICE with inherited constructor.
4359 * call.c (build_over_call): Call deduce_inheriting_ctor here.
4360 * pt.c (tsubst_decl): Not here.
4361 * class.c (add_method): Or here.
4362 * method.c (deduce_inheriting_ctor): Handle clones.
4363 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
4365 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
4368 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
4370 * cp/cp-tree.h: Declare it.
4371 * cp/semantics.c (finish_id_expression): Resolve names within a default
4372 capturing generic lambda defined within a template prior to
4373 instantiation to allow for captures to be added to the closure type.
4375 2017-01-26 Jakub Jelinek <jakub@redhat.com>
4378 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
4379 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
4380 * parser.c (cp_parser_builtin_offsetof): Pass result of
4381 build_static_cast of null_pointer_node to finish_offsetof.
4382 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
4383 it for -Winvalid-offsetof pedwarn instead of trying to guess
4384 original offsetof type from EXPR. Save OBJECT_PTR as a new
4385 second operand to OFFSETOF_EXPR.
4386 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
4387 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
4390 2017-01-26 Jason Merrill <jason@redhat.com>
4392 * name-lookup.c (parse_using_directive): Deprecate strong using.
4394 PR c++/79176 - lambda ICE with -flto -Os
4395 * decl2.c (vague_linkage_p): Handle decloned 'tors.
4396 * tree.c (decl_linkage): Likewise.
4398 2017-01-25 Martin Sebor <msebor@redhat.com>
4400 * decl.c (grokdeclarator): Fix a typo in a comment.
4402 2017-01-25 Jakub Jelinek <jakub@redhat.com>
4405 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
4409 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
4410 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
4412 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
4415 * decl.c (cxx_init_decl_processing): Pass main_input_filename
4416 to build_translation_unit_decl.
4418 2017-01-24 Jakub Jelinek <jakub@redhat.com>
4421 * cp-gimplify.c (cp_genericize_r): Add result of
4422 convert_from_reference on invisiref parm to p_set.
4424 2017-01-24 Nathan Sidwell <nathan@acm.org>
4426 PR c++/78469 - defaulted ctor and inaccessible dtor
4427 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
4428 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
4429 * tree.c (build_target_expr): Check tf_no_cleanup.
4431 PR c++/79118 - anon-members and constexpr
4432 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
4433 ctor decl. Recursively check anonymous members.
4434 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
4436 (explain_invalid_constexpr_fn): Likewise.
4438 2017-01-23 Nathan Sidwell <nathan@acm.org>
4440 PR c++/71710 - template using directive of field
4441 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
4444 PR c++/71406 - ICE with scope-ref'd template id exprs
4446 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
4447 before breaking up TEMPLATE_ID_EXPR.
4449 2017-01-20 Nathan Sidwell <nathan@acm.org>
4451 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
4452 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
4454 2017-01-20 David Malcolm <dmalcolm@redhat.com>
4458 * cp-tree.h (suggest_alternatives_for): Add bool param.
4459 (suggest_alternative_in_explicit_scope): New decl.
4460 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
4461 that isn't the global one, call new function
4462 suggest_alternative_in_explicit_scope, only calling
4463 suggest_alternatives_for if it fails, and disabling near match
4464 searches fort that case. When SCOPE is the global namespace,
4465 pass true for new param to suggest_alternatives_for to allow for
4467 * lex.c (unqualified_name_lookup_error): Pass true for new param
4468 to suggest_alternatives_for.
4469 * name-lookup.c (consider_binding_level): Add forward decl.
4470 (suggest_alternatives_for): Add "suggest_misspellings" param,
4471 using it to conditionalize the fuzzy name-lookup code.
4472 (suggest_alternative_in_explicit_scope): New function.
4473 * parser.c (cp_parser_primary_expression): When calling
4474 finish_id_expression, pass location of id_expression rather
4475 than that of id_expr_token.
4476 (cp_parser_id_expression): Convert local "unqualified_id" from
4477 tree to cp_expr to avoid implicitly dropping location information.
4479 2017-01-20 Marek Polacek <polacek@redhat.com>
4482 * call.c (build_conditional_expr_1): Warn about duplicated branches.
4483 * semantics.c (finish_expr_stmt): Build statement using the proper
4486 2017-01-19 Jason Merrill <jason@redhat.com>
4488 US 20 - forwarding references and class template argument deduction
4489 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
4490 * pt.c (push_template_decl_real): Set it.
4491 (maybe_adjust_types_for_deduction): Check it.
4492 (rewrite_template_parm): Copy it.
4494 US 19 - deduction guides and constructors
4495 * call.c (joust): Prefer deduction guides to constructors.
4496 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
4497 (deduction_guide_p): Check DECL_P.
4499 * decl.c (check_initializer): Always use build_aggr_init for array
4502 PR c++/79130 - decomposition and direct-initialization
4503 * init.c (build_aggr_init): Communicate direct-initialization to
4505 (build_vec_init): Check for array copy sooner.
4506 * parser.c (cp_parser_decomposition_declaration): Remove call to
4507 build_x_compound_expr_from_list.
4509 2017-01-18 Jason Merrill <jason@redhat.com>
4511 PR c++/68666 - member variable template-id
4512 * typeck.c (finish_class_member_access_expr): Handle variable
4514 * pt.c (lookup_and_finish_template_variable): No longer static.
4515 * cp-tree.h: Declare it.
4517 2017-01-18 Nathan Sidwell <nathan@acm.org>
4520 * call.c (build_over_call): When checking ellipsis conversions for
4521 an inherited ctor, make sure there is at least one conversion.
4523 2017-01-18 Jason Merrill <jason@redhat.com>
4525 PR c++/78894 - ICE with class deduction and default arg
4526 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
4528 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4531 * mangle.c (write_discriminator): Reorganize abi warning check.
4533 2017-01-18 Nathan Sidwell <nathan@acm.org>
4535 * cp-tree.h: Clarify exception spec node comment.
4536 * except.c (nothrow_spec_p): Simplify by checking node-equality.
4539 * mangle.c (write_exception_spec): Check nothrow explicitly.
4540 (write_encoding): Don't increment processing_template_decl around
4543 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4546 * mangle.c (write_template_args): Add "on" for operator names.
4548 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
4551 * mangle.c (write_discriminator): Handle discriminator >= 10.
4553 2017-01-17 Nathan Sidwell <nathan@acm.org>
4556 * cp-tree.h (maybe_generic_this_capture): Declare.
4557 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
4558 (maybe_resolve_dummy): ... here. Call it.
4559 (maybe_generic_this_capture): New.
4560 * parser.c (cp_parser_postfix_expression): Speculatively capture
4561 this in generic lambda in unresolved member function call.
4562 * pt.c (tsubst_copy_and_build): Force hard error from failed
4563 member function lookup in generic lambda.
4565 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
4568 * cp-array-notation.c (expand_array_notation_exprs): Handle
4571 2017-01-11 Jason Merrill <jason@redhat.com>
4573 PR c++/78337 - ICE on invalid with generic lambda
4574 * semantics.c (process_outer_var_ref): Check if containing_function
4575 is null. Move inform call under complain test.
4577 2017-01-11 Nathan Sidwell <nathan@acm.org>
4580 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
4583 2017-01-11 Nathan Sidwell <nathan@acm.org>
4585 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
4587 2017-01-11 Jakub Jelinek <jakub@redhat.com>
4590 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
4591 assertion. Formatting fix.
4594 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
4597 2017-01-10 David Malcolm <dmalcolm@redhat.com>
4600 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
4601 a missing semicolon if we have a valid insertion location for
4604 2017-01-10 Jason Merrill <jason@redhat.com>
4606 FI 20, decomposition declaration with parenthesized initializer.
4607 * parser.c (cp_parser_decomposition_declaration): Use
4608 cp_parser_initializer.
4610 2017-01-09 Jason Merrill <jason@redhat.com>
4612 Implement P0195R2, C++17 variadic using.
4613 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
4614 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
4615 * error.c (dump_decl): Likewise.
4617 2017-01-09 Jakub Jelinek <jakub@redhat.com>
4619 PR translation/79019
4620 PR translation/79020
4621 * semantics.c (finish_omp_clauses): Add missing whitespace to
4622 translatable strings.
4623 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
4625 2017-01-07 Jason Merrill <jason@redhat.com>
4627 PR c++/78948 - instantiation from discarded statement
4628 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
4629 * cp-tree.h (in_discarded_stmt): Declare it.
4630 (struct saved_scope): Add discarded_stmt bitfield.
4631 (in_discarded_stmt): New macro.
4632 * decl2.c (mark_used): Check it.
4633 * parser.c (cp_parser_selection_statement): Adjust.
4634 (cp_parser_jump_statement): Adjust.
4636 2017-01-05 Jakub Jelinek <jakub@redhat.com>
4639 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
4640 REFERENCE_REF_P, set tt to its operand.
4643 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
4644 unions even for C++11 and later.
4646 2017-01-05 Nathan Sidwell <nathan@acm.org>
4649 * pt.c (convert_nontype_argument): Don't try and see if integral
4650 or enum expressions are constants prematurely.
4652 2017-01-04 Marek Polacek <polacek@redhat.com>
4655 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
4656 a zero character literal.
4658 2017-01-04 Jakub Jelinek <jakub@redhat.com>
4661 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
4665 * parser.c (cp_parser_simple_declaration): Only complain about
4666 inconsistent auto deduction if auto_result doesn't use auto.
4668 * parser.c (cp_parser_simple_declaration): Diagnose function
4669 declaration among more than one init-declarators with auto
4673 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
4674 assertion, as lexer->buffer may be NULL.
4676 2017-01-04 Marek Polacek <polacek@redhat.com>
4680 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
4682 2017-01-04 Nathan Sidwell <nathan@acm.org>
4685 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
4686 (lambda_capture_field_type): Update prototype.
4687 * lambda.c (lambda_capture_field_type): Add is_reference parm.
4688 Add referenceness here.
4689 (add_capture): Adjust lambda_capture_field_type call, refactor
4691 * pt.c (tsubst): Adjust lambda_capture_field_type call.
4693 2017-01-01 Jakub Jelinek <jakub@redhat.com>
4695 Update copyright years.
4697 Copyright (C) 2017 Free Software Foundation, Inc.
4699 Copying and distribution of this file, with or without modification,
4700 are permitted in any medium without royalty provided the copyright
4701 notice and this notice are preserved.