1 2017-11-20 David Malcolm <dmalcolm@redhat.com>
3 * name-lookup.c: Define INCLUDE_UNIQUE_PTR before including system.h.
4 Include "c-family/name-hint.h"
5 (suggest_alternatives_for): Convert "fuzzy_name" from const char *
6 to name_hint, and rename to "hint". Pass location to
8 (lookup_name_fuzzy): Convert return type from const char *
9 to name_hint. Add location_t param.
10 * parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
11 Include "c-family/name-hint.h"
12 (cp_parser_diagnose_invalid_type_name): Convert
13 "suggestion" from const char * to name_hint, and rename to "hint".
14 Pass location to lookup_name_fuzzy.
16 2017-11-20 Nathan Sidwell <nathan@acm.org>
20 * call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited
22 * cp-gimplify.c (cp_genericize_r): Restore THUNK dereference
23 inhibibition check removed in previous c++/78495 change.
25 2017-11-20 Jakub Jelinek <jakub@redhat.com>
28 * constexpr.c (cxx_eval_vector_conditional_expression): New function.
29 (cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
30 of cxx_eval_conditional_expression.
32 2017-11-19 Jakub Jelinek <jakub@redhat.com>
36 * cp-gimplify.c (c_fully_fold): Add LVAL argument, call
37 cp_fold_maybe_rvalue instead of cp_fold_rvalue and pass it !LVAL.
39 2017-11-16 Jason Merrill <jason@redhat.com>
41 PR c++/79092 - non-type args of different types are different
42 * tree.c (cp_tree_equal): Check the type of constants.
43 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Handle UNIFY_ALLOW_INTEGER
44 when comparing to previously deduced argument.
45 (maybe_convert_nontype_argument): New.
46 (convert_nontype_argument): Call it.
47 (tsubst_copy_and_build): Handle partial instantiation of
49 (unify): Ignore type when deducing from array bound.
50 (dependent_type_p_r): Handle DEFERRED_NOEXCEPT.
51 (value_dependent_expression_p): Any type-dependent expression is
52 value-dependent. Handle IMPLICIT_CONV_EXPR.
53 * cp-tree.h (IMPLICIT_CONV_EXPR_NONTYPE_ARG): New.
54 * mangle.c (write_template_arg): Strip IMPLICIT_CONV_EXPR.
56 2017-11-16 Nathan Sidwell <nathan@acm.org>
60 * cp-objcp-common.h (LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME):
62 * cp-tree.h (overwrite_mangling): Declare.
63 * decl2.c (struct mangled_decl_hash): Entries are deletable.
64 (overwrite_mangling): New.
67 * decl.c (xref_tag_1): Push lambda into current scope.
68 * name-lookup.c (do_pushtag): Don't deal with ts_lambda here.
70 2017-11-15 Nathan Sidwell <nathan@acm.org>
73 * lambda.c (lambda_capture_field_type): Function references are
74 always catured by reference.
76 2017-11-15 Martin Liska <mliska@suse.cz>
78 * decl.c (begin_destructor_body): Use cp_build_fold_indirect_ref
79 instead of cp_build_indirect_ref.
81 2017-11-15 Martin Liska <mliska@suse.cz>
83 * decl.c (begin_destructor_body): In case of VPTR sanitization
84 (with disabled recovery), zero vptr in order to catch virtual calls
85 after lifetime of an object.
87 2017-11-14 Jason Merrill <jason@redhat.com>
89 Use GTY((cache)) on some hash tables.
90 * decl.c (decomp_type_table): Use tree_cache_map.
91 * init.c (nsdmi_inst): Likewise.
92 * pt.c (defarg_ints): Likewise.
93 * cp-objcp-common.c (cp_get_debug_type): Likewise.
95 2017-11-13 Jason Merrill <jason@redhat.com>
97 Capture adjustments for P0588R1.
98 * semantics.c (process_outer_var_ref): Capture variables when
99 they are named; complain about non-capture uses when odr-used.
100 * expr.c (mark_use): Rvalue use looks through capture proxy.
101 * constexpr.c (potential_constant_expression_1): Improve error about
102 use of captured variable.
103 * lambda.c (need_generic_capture, dependent_capture_r)
104 (do_dependent_capture, processing_nonlambda_template): Remove.
105 * call.c (build_this): Remove uses of the above.
106 * decl.c (cp_finish_decl): Likewise.
107 * semantics.c (maybe_cleanup_point_expr)
108 (maybe_cleanup_point_expr_void, finish_goto_stmt)
109 (maybe_convert_cond): Likewise.
110 * typeck.c (check_return_expr): Likewise.
113 * typeck.c (cp_build_fold_indirect_ref): New.
114 (cp_build_indirect_ref_1): Split out from cp_build_indirect_ref.
115 Add 'fold' parameter.
116 * cp-tree.h: Declare cp_build_fold_indirect_ref.
117 * call.c, class.c, cp-ubsan.c, decl.c, except.c, init.c, lambda.c,
118 parser.c, rtti.c, tree.c, typeck.c, typeck2.c: Use it.
119 * parser.c (do_range_for_auto_deduction): Use RO_UNARY_STAR.
120 (cp_convert_range_for): Likewise.
121 * typeck2.c (build_x_arrow): Use RO_ARROW.
123 * cp-ubsan.c (cp_ubsan_check_member_access_r): Fix handling of
124 INDIRECT_REF of ADDR_EXPR.
126 PR c++/82360 - ICE with static_cast in template.
127 * call.c (perform_direct_initialization_if_possible): Check
128 processing_template_decl.
129 * typeck.c (build_static_cast_1): Likewise.
131 2017-11-13 Ville Voutilainen <ville.voutilainen@gmail.com>
133 Remove the null check from placement new in all modes
134 * init.c (build_new_1): Don't do a null check for
135 a namespace-scope non-replaceable placement new
136 in any mode unless -fcheck-new is provided.
138 2017-11-07 Boris Kolpackov <boris@codesynthesis.com>
140 * Make-lang.in (CP_PLUGIN_HEADERS): Add operators.def since included
143 2017-11-07 Jakub Jelinek <jakub@redhat.com>
146 * cp-gimplify.c (cxx_omp_clause_apply_fn): For methods pass i - 1 to
147 convert_default_arg instead of i.
149 2017-11-06 Jason Merrill <jason@redhat.com>
151 P0704R1 - fixing const-qualified pointers to members
152 * typeck2.c (build_m_component_ref): Also accept in lower stds with
155 2017-11-06 Paolo Carlini <paolo.carlini@oracle.com>
158 * decl2.c (finish_static_data_member_decl): If there's an initializer,
159 complete the type and re-apply the quals.
161 2017-11-06 Martin Liska <mliska@suse.cz>
164 * constexpr.c (cxx_eval_builtin_function_call): Handle
165 __builtin_unreachable call.
166 (get_function_named_in_call): Declare function earlier.
167 (constexpr_fn_retval): Skip __builtin_unreachable.
168 * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Rename to
170 (cp_maybe_instrument_return): ... this.
171 (cp_genericize): Call the function unconditionally.
173 2017-11-03 Nathan Sidwell <nathan@acm.org>
176 * decl.c (grokdeclarator): Protect MAYBE_CLASS things from paren
179 2017-11-02 Paolo Carlini <paolo.carlini@oracle.com>
182 * pt.c (make_pack_expansion): Add tsubst_flags_t parameter.
183 (expand_integer_pack, convert_template_argument, coerce_template_parms,
184 gen_elem_of_pack_expansion_instantiation, tsubst_pack_expansion,
185 unify): Adjust calls.
186 * tree.c (cp_build_qualified_type_real): Likewise.
187 * cp-tree.h (make_pack_expansion): Adjust declaration.
189 2017-11-02 Nathan Sidwell <nathan@acm.org>
191 * cp-tree.h (IDENTIFIER_NEWDEL_OP_P): Restore, adjust.
192 (IDENTIFIER_NEW_OP_P): New.
193 * decl.c (grokdeclarator): Restore IDENTIFIER_NEWDEL_OP_P use.
194 * pt.c (push_template_decl_real): Likewise.
195 * typeck.c (check_return_expr): Use IDENTIFIER_NEW_OP_P.
198 * decl.c (grokdeclarator): Don't warn when parens protect a return
199 type from a qualified name.
201 2017-11-01 Nathan Sidwell <nathan@acm.org>
203 * cp-tree.h (enum cp_identifier_kind): Delete cik_newdel_op.
204 Renumber and reserve udlit value.
205 (IDENTIFIER_NEWDEL_OP_P): Delete.
206 (IDENTIFIER_OVL_OP_P): New.
207 (IDENTIFIER_ASSIGN_OP_P): Adjust.
208 (IDENTIFIER_CONV_OP_P): Adjust.
209 (IDENTIFIER_OVL_OP_INFO): Adjust.
210 (IDENTIFIER_OVL_OP_FLAGS): New.
211 * decl.c (grokdeclarator): Use IDENTIFIER_OVL_OP_FLAGS.
212 * lex.c (get_identifier_kind_name): Adjust.
213 (init_operators): Don't special case new/delete ops.
214 * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_P.
215 * pt.c (push_template_decl_real): Use IDENTIFIER_OVL_OP_FLAGS.
216 * typeck.c (check_return_expr): Likewise.
218 * cp-tree.h (assign_op_identifier, call_op_identifier): Use
220 (struct lang_decl_fn): Use compressed operator code.
221 (DECL_OVERLOADED_OPERATOR_CODE): Replace with ...
222 (DECL_OVERLOADED_OPERATOR_CODE_RAW): ... this.
223 (DECL_OVERLOADED_OPERATOR_CODE_IS): Use it.
224 * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE_RAW.
225 (build_library_fn): Likewise.
226 (grok_op_properties): Likewise.
227 * mangle.c (write_unqualified_name): Likewise.
228 * method.c (implicitly_declare_fn): Likewise.
229 * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_IS.
231 * cp-tree.h (IDENTIFIER_CP_INDEX): Define.
232 (enum ovl_op_flags): Add OVL_OP_FLAG_AMBIARY.
233 (enum ovl_op_code): New.
234 (struct ovl_op_info): Add ovl_op_code field.
235 (ovl_op_info): Size by OVL_OP_MAX.
236 (ovl_op_mapping, ovl_op_alternate): Declare.
237 (OVL_OP_INFO): Adjust for mapping array.
238 (IDENTIFIER_OVL_OP_INFO): New.
239 * decl.c (ambi_op_p, unary_op_p): Delete.
240 (grok_op_properties): Use IDENTIFIER_OVL_OP_INFO and
242 * lex.c (ovl_op_info): Adjust and static initialize.
243 (ovl_op_mappings, ovl_op_alternate): Define.
244 (init_operators): Iterate over ovl_op_info array and init mappings
246 * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_INFO.
247 * operators.def (DEF_OPERATOR): Remove KIND parm.
248 (DEF_SIMPLE_OPERATOR): Delete.
249 (OPERATOR_TRANSITION): Expand if defined.
251 2017-10-31 David Malcolm <dmalcolm@redhat.com>
253 * pt.c (listify): Use %< and %> for description of #include.
255 2017-10-31 David Malcolm <dmalcolm@redhat.com>
257 * class.c (explain_non_literal_class): Use UNKNOWN_LOCATION rather
259 * name-lookup.c (suggest_alternatives_for): Update for renaming of
261 (maybe_suggest_missing_header): Likewise.
262 (suggest_alternative_in_explicit_scope): Likewise.
263 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise for
264 renaming of error_at_rich_loc.
265 (cp_parser_string_literal): Likewise.
266 (cp_parser_nested_name_specifier_opt): Likewise.
267 (cp_parser_cast_expression): Likewise for renaming of
269 (cp_parser_decl_specifier_seq): Likewise for renaming of
270 error_at_rich_loc and warning_at_rich_loc.
271 (cp_parser_elaborated_type_specifier): Likewise for renaming of
273 (cp_parser_cv_qualifier_seq_opt): Likewise for renaming of
275 (cp_parser_virt_specifier_seq_opt): Likewise.
276 (cp_parser_class_specifier_1): Likewise.
277 (cp_parser_class_head): Likewise.
278 (cp_parser_member_declaration): Likewise for renaming of
279 pedwarn_at_rich_loc, warning_at_rich_loc, and error_at_rich_loc.
280 (cp_parser_enclosed_template_argument_list): Likewise for renaming
281 of error_at_rich_loc.
282 (set_and_check_decl_spec_loc): Likewise.
283 * pt.c (listify): Likewise.
284 * rtti.c (typeid_ok_p): Likewise.
285 * semantics.c (process_outer_var_ref): Use UNKNOWN_LOCATION rather
287 * typeck.c (access_failure_info::maybe_suggest_accessor): Update
288 for renaming of inform_at_rich_loc.
289 (finish_class_member_access_expr): Likewise for renaming of
292 2017-10-31 Nathan Sidwell <nathan@acm.org>
294 * cp-tree.h (struct operator_name_info_t): Rename to ...
295 (struct ovl_op_info_t): ... here. Add tree_code field.
296 (operator_name_info, assignment_operator_name_info): Delete.
297 (ovl_op_info): Declare.
298 (OVL_OP_INFO): Adjust.
299 * decl.c (grok_op_properties): Use ovl_op_flags.
300 * lex.c (operator_name_info, assignment_operator_name_info):
302 (ovl_op_info): Define.
303 (set_operator_ident): Adjust.
304 (init_operators): Set tree_code.
305 * mangle.c (write_unqualified_id): Adjust operator array scan.
307 * lex.c (init_operators): Allow NULL operator name. Don't add
309 * operators.def: Use NULL for mangling only operators. Move to
310 after regular operators but move assignment operators last.
312 * cp-tree.h (enum ovl_op_flags): New.
313 (struct operator_name_info_t): Rename arity to flags.
314 * lex.c (set_operator_ident): New.
315 (init_operators): Use it. Adjust for flags.
316 * mangle.c (write_unqualified_id): Adjust for flags.
317 * operators.def: Replace arity with flags.
319 * cp-tree.h (ovl_op_identifier): New.
320 (assign_op_identifier, call_op_identifier): Adjust.
321 (cp_operator_id, cp_assignment_operator_ide): Delete.
322 (SET_OVERLOADED_OPERATOR_CODE): Delete.
324 * call.c (op_error): Use OVL_OP_INFO.
325 (build_conditional_expr_1): Use ovl_op_identifier.
326 (build_new_op_1): Use OVL_OP_INFO & ovl_op_identifier.
327 (build_op_delete_call): Likewise.
328 * class.c (type_requires_array_cookie): Use ovl_op_identifier.
329 * decl.c (duplicate_decls): Directly copy operator code.
330 (builtin_function_1): Do not set operator code.
331 (build_library_fn): Directly set operator code.
332 (push_cp_library_fn): Use ovl_op_identifier.
333 (grok_op_properties): Directly set operator code.
334 * decl2.c (maybe_warn_sized_delete): Use ovl_op_identifier.
335 * error.c (dump_expr): Use OVL_OP_INFO.
336 (op_to_string): Add assop arg. Use OVL_OP_INFO.
337 (assop_to_string): Delete.
338 (args_to_string): Adjust.
339 * init.c (build_new_1): Use ovl_op_identifier.
340 * mangle.c (write_unqualified_name): Use OVL_OP_INFO.
341 (write_expression): Likewise.
342 * method.c (synthesized_method_walk): Use ovl_op_identifier.
343 (implicitly_declare_fn): Use assign_op_identifier. Directly set
345 * name-lookup.c (get_class_binding): Use assign_op_identifier.
346 * parser.c (cp_parser_operator): Use ovl_op_identifier.
347 (cp_parser_omp_clause_reduction): Likewise.
348 * semantics.c (omp_reduction_id): Likewise.
349 * typeck.c (cxx_sizeof_or_alignof_type): Use OVL_OP_INFO.
351 * cp-tree.h (assign_op_identifier, call_op_identifier): Define.
352 (LAMBDA_FUNCTION_P): Use DECL_OVERLOADED_OPERATOR_IS.
353 (DECL_OVERLOADED_OPERATOR_P): Just retuurn true/false.
354 (DECL_OVERLOADED_OPERATOR_CODE, DECL_OVERLOADED_OPERATOR_IS): Define.
355 * call.c (add_function_candidate): Use
356 DECL_OVERLOADED_OPERATOR_IS.
357 (build_op_call_1): Use call_op_identifier &
358 DECL_OVERLOADED_OPERATOR_IS.
359 (build_over_call): Likewise.
360 (has_trivial_copy_assign_p): Use assign_op_identifier.
361 (build_special_member_call): Likewise.
362 * class.c (dfs_declare_virt_assop_and_dtor): Likewise.
363 (vbase_has_user_provided_move_assign,
364 classtype_has_move_assign_or_move_ctor_p): Likewise.
365 * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE.
366 (grok_special_member_properties): Use assign_op_identifier.
367 (start_preparsed_function): Use DECL_OVERLOADED_OPERATOR_IS.
368 * decl2.c (mark_used): Use DECL_CONV_FN_P.
369 * dump.c (dump_access): Delete prototype.
371 (cp_dump_tree): Don't call it.
372 * lambda.c (lambda_function): Use call_op_identifier.
373 (maybe_add_lambda_conv_op): Not an overloaded operator. Remove
375 * mangle.c (write_unqualified_name): Use DECL_OVERLOADED_OPERTOR_CODE.
376 * method.c (do_build_copy_assign): Use assign_op_identifier.
377 (synthesize_method): Use DECL_OVERLOADED_OPERATOR_IS.
378 (get_copy_assign): Use assign_op_identifier.
379 (synthesized_method_walk): Likewise.
380 (defaultable_fn_check): Use DECL_OVERLOADED_OPERATOR_IS.
381 * parser.c (cp_parser_lambda_declarator_opt): Use
383 * semanitics.c (classtype_has_nothrow_assign_or_copy_p): Use
384 assign_op_identifier.
385 * tree.c (special_function_p): Use DECL_OVERLOADED_OPERATOR_IS.
386 * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_CODE.
387 (check_return_expr): Use assign_op_identifier.
389 2017-10-30 Paolo Carlini <paolo.carlini@oracle.com>
392 * pt.c (tsubst_copy_and_build, [INDIRECT_REF]): For a REFERENCE_REF_P,
393 unconditionally call convert_from_reference.
395 2017-10-30 Nathan Sidwell <nathan@acm.org>
397 * call.c (build_op_call_1): Test for FUNCTION_DECL in same manner
398 as a few lines earlier.
399 * cp-tree.h (PACK_EXPANSION_PATTERN): Fix white space.
400 * decl.c (grokfndecl): Fix indentation.
401 (compute_array_index_type): Use processing_template_decl_sentinel.
402 (grok_op_properties): Move warnings to end. Reorder other checks
403 to group similar entities. Tweak diagnostics.
404 * lex.c (unqualified_name_lookup_error): No need to check name is
405 not ERROR_MARK operator.
406 * parser.c (cp_parser_operator): Select operator code before
408 * typeck.c (check_return_expr): Fix indentation and line wrapping.
410 2017-10-27 Paolo Carlini <paolo.carlini@oracle.com>
412 * pt.c (invalid_nontype_parm_type_p): Return a bool instead of an int.
414 2017-10-26 Nathan Sidwell <nathan@acm.org>
416 * decl.c (sort_labels): Restore function.
417 (pop_labels): Sort labels
418 (identify_goto): Add translation markup.
420 2017-10-25 Nathan Sidwell <nathan@acm.org>
422 Kill IDENTIFIER_LABEL_VALUE.
423 * cp-tree.h (lang_identifier): Delete label_value slot.
424 (IDENTIFIER_LABEL_VALUE, SET_IDENTIFIER_LABEL_VALUE): Delete.
425 (struct named_label_hasher): Rename to ...
426 (struct named_label_hash): ... here. Reimplement.
427 (struct language_function): Adjust x_named_labels.
428 * name-lookup.h (struct cp_label_binding): Delete.
429 (struct cp_binding_level): Delete shadowed_labels slot.
430 * decl.c (struct named_label_entry): Add name and outer slots.
431 (pop_label): Rename to ...
432 (check_label_used): ... here. Don't pop.
433 (note_label, sort_labels): Delete.
434 (pop_labels, pop_local_label): Reimplement.
435 (poplevel): Pop local labels as any other decl. Remove
436 shadowed_labels handling.
437 (named_label_hash::hash, named_label_hash::equal): New.
438 (make_label_decl): Absorb into ...
439 (lookup_label_1): ... here. Add making_local_p arg, reimplement.
440 (lookup_label, declare_local_label): Adjust.
441 (check_goto, define_label): Adjust.
442 * lex.c (make_conv_op_name): Don't clear IDENTIFIER_LABEL_VALUE.
443 * ptree.c (cxx_print_identifier): Don't print identifier binding.
445 * decl.c (identifier_goto): Reduce duplication.
446 (check_previous_goto_1): Likewise.
447 (check_goto): Move var decls to initialization.
448 (check_omp_return, define_label_1, define_label): Likewise.
450 2017-10-25 Jakub Jelinek <jakub@redhat.com>
453 * decl.c (duplicate_decls): Copy "omp declare simd" attributes from
454 newdecl to corresponding __builtin_ if any.
456 2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
459 * decl.c (duplicate_decls): Warn for built-in functions declared as
460 non-function, use OPT_Wbuiltin_declaration_mismatch.
462 * decl.c (duplicate_decls): Avoid redundant '+' in warning_at.
464 2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
467 * pt.c (value_dependent_expression_p, [TRAIT_EXPR]): Handle
468 a TREE_LIST as TRAIT_EXPR_TYPE2.
470 2017-10-24 Mukesh Kapoor <mukesh.kapoor@oracle.com>
471 Paolo Carlini <paolo.carlini@oracle.com>
474 * cvt.c (type_promotes_to): Implement C++17, 7.6/4, about unscoped
475 enumeration type whose underlying type is fixed.
477 2017-10-23 Paolo Carlini <paolo.carlini@oracle.com>
480 * semantics.c (finish_compound_literal): Check do_auto_deduction
481 return value for error_mark_node.
483 2017-10-23 Jason Merrill <jason@redhat.com>
485 PR c++/77369 - wrong noexcept handling in C++14 and below
486 * tree.c (strip_typedefs): Canonicalize TYPE_RAISES_EXCEPTIONS.
488 2017-10-20 Nathan Sidwell <nathan@acm.org>
490 * class.c (layout_class_type): Cleanup as-base creation, determine
492 (finish_struct_1): ... not here.
494 2017-10-19 Jakub Jelinek <jakub@redhat.com>
497 * typeck.c (check_return_expr): Don't call
498 maybe_warn_about_returning_address_of_local in templates.
500 2017-10-17 Nathan Sidwell <nathan@acm.org>
503 * call.c (build_over_call): Don't pass tf_no_cleanup to nested
507 * cp-objcp-common.c (cp_tree_size): Reformat. Adjust returns size
510 2017-10-13 Jason Merrill <jason@redhat.com>
512 PR c++/82357 - bit-field in template
513 * tree.c (cp_stabilize_reference): Just return a NON_DEPENDENT_EXPR.
515 2017-10-13 David Malcolm <dmalcolm@redhat.com>
517 * cp-tree.h (maybe_show_extern_c_location): New decl.
518 * decl.c (grokfndecl): When complaining about literal operators
519 with C linkage, issue a note giving the location of the
521 * parser.c (cp_parser_new): Initialize new field
522 "innermost_linkage_specification_location".
523 (cp_parser_linkage_specification): Store the location
524 of the linkage specification within the cp_parser.
525 (cp_parser_explicit_specialization): When complaining about
526 template specializations with C linkage, issue a note giving the
527 location of the extern "C".
528 (cp_parser_explicit_template_declaration): Likewise for templates.
529 (maybe_show_extern_c_location): New function.
530 * parser.h (struct cp_parser): New field
531 "innermost_linkage_specification_location".
533 2017-10-12 Nathan Sidwell <nathan@acm.org>
535 * cp-tree.h (cp_expr): Add const operator * and operator->
537 (cp_tree_node_structure_enum): Delete TS_CP_BINDING,
538 TS_CP_WRAPPER, LAST_TS_CP_ENUM.
540 2017-10-12 David Malcolm <dmalcolm@redhat.com>
542 * parser.c (get_required_cpp_ttype): New function.
543 (cp_parser_error_1): Call it, using the result to call
544 maybe_suggest_missing_token_insertion.
546 2017-10-12 David Malcolm <dmalcolm@redhat.com>
548 * parser.c (get_matching_symbol): Move to before...
549 (cp_parser_error): Split out into...
550 (cp_parser_error_1): ...this new function, merging in content
552 (cp_parser_required_error): ...here. Eliminate partial duplicate
553 of body of cp_parser_error in favor of a call to the new
554 cp_parser_error_1 helper function.
556 2017-10-11 Nathan Sidwell <nathan@acm.org>
558 * decl2.c (struct mangled_decl_hash): Use DECL_ASSEMBLER_NAME_RAW.
559 (record_mangling): Likewise.
561 2017-10-10 Nathan Sidwell <nathan@acm.org>
563 * name-lookup.c (extern_c_fns): Rename to ...
564 (extern_c_decls): ... here.
565 (check_extern_c_conflict, extern_c_linkage_bindings): Update.
566 (do_pushdecl): Check extern-c fns and vars.
568 * cp-tree.h (default_hash_traits <lang_identifier *>): Delete
571 * decl2.c (struct mangled_decl_hash): New hash traits.
572 (mangled_decls): Make hash_table<mangled_decl_hash>.
573 (generate_mangling_alias, record_mangling): Adjust.
575 2017-10-10 Jason Merrill <jason@redhat.com>
577 More delayed lambda capture fixes.
578 * call.c (add_function_candidate): Use build_address.
579 (build_op_call_1): Call mark_lvalue_use early.
580 (build_over_call): Handle error from build_this.
581 * constexpr.c (cxx_bind_parameters_in_call): Use build_address.
582 (cxx_eval_increment_expression): Don't use rvalue().
583 * cvt.c (convert_to_void): Use mark_discarded_use.
584 * expr.c (mark_use): Handle PARM_DECL, NON_DEPENDENT_EXPR. Fix
585 reference handling. Don't copy the expression.
586 (mark_discarded_use): New.
587 * lambda.c (insert_capture_proxy): Add some sanity checking.
588 (maybe_add_lambda_conv_op): Set cp_unevaluated_operand.
589 * pt.c (register_local_specialization): Add sanity check.
590 * semantics.c (process_outer_var_ref): Fix check for existing proxy.
591 * typeck.c (cp_build_addr_expr_1): Handle error from
593 (cp_build_modify_expr): Call mark_lvalue_use_nonread, handle error
596 Handle generic lambda capture in dependent expressions.
597 * lambda.c (need_generic_capture, dependent_capture_r)
598 (do_dependent_capture): New.
599 * pt.c (processing_nonlambda_template): Use need_generic_capture.
600 * semantics.c (maybe_cleanup_point_expr)
601 (maybe_cleanup_point_expr_void, finish_goto_stmt)
602 (maybe_convert_cond): Call do_dependent_capture.
603 * typeck.c (build_static_cast): Remove dependent capture handling.
605 * typeck.c (condition_conversion): Assert !processing_template_decl.
606 * semantics.c (finish_omp_clauses): Don't
607 fold_build_cleanup_point_expr if processing_template_decl.
608 (outer_var_p): A temporary can't be from an outer scope.
609 * pt.c (type_dependent_expression_p): Fix dependency checking of
610 functions without DECL_TEMPLATE_INFO.
611 (instantiate_decl): Use lss_copy.
612 * constexpr.c (is_valid_constexpr_fn): Fix lambdas before C++17.
614 * typeck.c (check_return_expr): Check non-dependent conversion in
616 * constraint.cc (check_function_concept): Don't complain about an
617 empty concept if seen_error.
619 2017-10-10 Richard Sandiford <richard.sandiford@linaro.org>
621 * cvt.c (ignore_overflows): Use wi::to_wide when
622 operating on trees as wide_ints.
623 * decl.c (check_array_designated_initializer): Likewise.
624 * mangle.c (write_integer_cst): Likewise.
625 * semantics.c (cp_finish_omp_clause_depend_sink): Likewise.
627 2017-10-10 Nathan Sidwell <nathan@acm.org>
629 * name-lookup.c (set_global_binding): Don't deal with STAT_HACK.
631 2017-10-06 Paolo Carlini <paolo.carlini@oracle.com>
634 * decl.c (finish_function): Take a bool intead of an int; adjust.
635 * cp-tree.h (finish_function): Adjust declaration.
636 * decl2.c (generate_tls_wrapper, finish_objects,
637 finish_static_storage_duration_function): Adjust calls.
638 * lambda.c (maybe_add_lambda_conv_op, finish_lambda_function):
640 * method.c (synthesize_method): Likewise.
641 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
642 * pt.c (instantiate_decl): Likewise.
643 * parser.c (cp_parser_function_definition_after_declarator,
644 cp_parser_late_parsing_for_member, cp_parser_omp_declare_reduction):
646 (cp_parser_ctor_initializer_opt,
647 cp_parser_ctor_initializer_opt_and_function_body,
648 cp_parser_function_try_block,
649 cp_parser_function_definition_after_declarator,
650 cp_parser_function_transaction): Return void; adjust declarations.
652 2017-10-06 Nathan Sidwell <nathan@acm.org>
655 * name-lookup.c (check_local_shadow): Don't try and convert
658 2017-10-06 Jakub Jelinek <jakub@redhat.com>
661 * decl.c (reshape_init): Suppress warn_useless_cast for direct enum
663 * typeck.c (convert_for_assignment): Likewise.
665 P0704R1 - fixing const-qualified pointers to members
666 * typeck2.c (build_m_component_ref): For -std=c++2a allow
667 pointer to const & qualified method on rvalue.
669 2017-10-06 Nathan Sidwell <nathan@acm.org>
671 Use hash_table for extern "C" names
672 * name-lookup.c (extern_c_fns): Use hash_table.
673 (check_extern_c_conflict): Adjust.
674 (c_linkage_bindings): Adjust.
676 Use hash_table for namespace bindings
677 * cp-tree.h (struct named_decl_hash): New.
678 (lang_decl_ns): Change type of bindings field.
679 * lex.c (maybe_add_lang_decl_raw): Adjust.
680 * name-lookup.c (find_namespace_slot): Adjust.
681 (do_pushdecl): Push NULL-named namespace.
682 (do_push_nested_namespace): Adjust.
683 (push_namespace): Push anonymous namespace as NULL name.
685 2017-10-05 Jason Merrill <jason@redhat.com>
687 Pass variadic class objects exactly like named by-value args.
688 * call.c (convert_arg_to_ellipsis): Use the result of force_rvalue.
690 2017-10-05 Nathan Sidwell <nathan@acm.org>
692 Warn on MVP declarations
693 * cp-tree.h (struct cp_declarator): Add parenthesized field.
694 * decl.c (grokdeclarator): Warn about unnecessary parens.
695 * parser.c (make_declarator): Init parenthesized field.
696 (cp_parser_direct_declarator): Set parenthesized field.
698 Kill IDENTIFIER_GLOBAL_VALUE, SET_IDENTIFIER_GLOBAL_VALUE
699 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
700 SET_IDENTIFIER_GLOBAL_VALUE): Delete.
701 * name-lookup.h (set_global_binding): Remove NAME parm.
702 (get_global_binding): New inline fn.
703 * name-lookup.c (set_global_binding): Remove NAME parm. Adjust.
704 (identifier_global_value): Move to ...
705 * cp-objcp-common.c (identifier_global_value): ... here.
706 * class.c (build_ctor_vtbl_group, build_vtbl_initializer): Adjust.
707 * decl.c (record_builtin_type, expand_static_init,
708 grokdeclarator): Adjust.
709 * decl2.c (get_guard, get_local_tls_init_fn, get_tls_init_fn,
710 get_tls_wrapper_fn, maybe_warn_sized_delete): Adjust.
711 * except.c (declare_library_fn, build_throw): Adjust.
712 * init.c (throw_bad_array_length): Adjust.
713 * rtti.c (throw_bad_cast, throw_bad_typeid, get_tinfo_decl): Adjust.
715 * decl2.c (record_mangling): Fix spello and formatting from
718 2017-10-04 Nathan Sidwell <nathan@acm.org>
720 Give builtin types the correct name.
721 * name-lookup.c (set_global_binding): Assert name is DECL_NAME.
722 * decl.c (record_builtin_type): Reimplement, use new TYPE_DECL for
725 2017-10-04 Paolo Carlini <paolo.carlini@oracle.com>
726 Andrew Pinski <apinski@cavium.com>
729 * parser.c (cp_parser_lambda_body): Set parser->in_function_body.
731 2017-10-04 Nathan Sidwell <nathan@acm.org>
733 Move mangling aliases out of global namespace.
734 * cp-tree.h (record_mangling): New.
735 (maybe_remove_implicit_alias): Delete.
736 * decl2.c (mangled_decls): New hash map.
737 (generate_mangling_alias): Reimplement using mangled_decls.
738 (record_mangling): New.
739 * mangle.c (decl_implicit_alias_p,
740 maybe_remove_implicit_alias): Delete.
741 (mangle_decl): Use record_mangling.
742 * name-lookup.c (supplement_binding_1): Remove
743 maybe_remove_implicit_alias check.
745 2017-10-04 Jakub Jelinek <jakub@redhat.com>
748 * error.c (dump_function_decl): If show_return, call dump_type_suffix
749 on the same return type dump_type_prefix has been called on.
751 2017-10-04 Jason Merrill <jason@redhat.com>
753 PR c++/81525 - broken handling of auto in generic lambda.
754 * pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.
756 2017-10-04 Nathan Sidwell <nathan@acm.org>
758 * call.c (convert_arg_to_ellipsis): Correct comment about passing
761 2017-10-02 Richard Sandiford <richard.sandiford@linaro.org>
763 * constexpr.c (cxx_eval_store_expression): Use wi::to_widest
764 when comparing the array bounds with an ARRAY_REF index.
766 2017-09-30 Paolo Carlini <paolo.carlini@oracle.com>
769 * method.c (defaulted_late_check): Early return if the defaulted
770 declaration does not match the expected signature.
772 2017-09-29 Jakub Jelinek <jakub@redhat.com>
774 P0683R1 - default member initializers for bit-fields
775 * cp-tree.h (grokbitfield): Add INIT parameter.
776 * parser.c (cp_parser_constant_expression): Add STRICT_P argument,
777 if true, parse a conditional-expression rather than
778 assignment-expression.
779 (cp_parser_member_declaration): For C++11 and later pass true
780 as STRICT_P to cp_parser_constant_expression. Parse C++2A bitfield
781 NSDMIs. Adjust grokbitfield caller. Handle DECL_INITIAL also for
783 (cp_parser_objc_class_ivars): Adjust grokbitfield caller.
784 * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs.
785 (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs.
786 * decl2.c (grokbitfield): Add INIT parameter, pass it to
788 * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not
791 * class.c (check_bitfield_decl): Retrieve and clear width from
792 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
793 (check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than
795 (remove_zero_width_bit_fields): Adjust comment.
796 * decl2.c (grokbitfield): Stash width into
797 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
798 * pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr
799 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width.
801 * parser.c (cp_parser_member_declaration): Parse attributes before
802 colon of a bitfield in addition to after colon.
804 * Make-lang.in (check-c++-all): Test also c++2a.
806 2017-09-28 Jason Merrill <jason@redhat.com>
808 PR c++/56973, DR 696 - capture constant variables only as needed.
809 * expr.c (mark_use): Split out from mark_rvalue_use and
810 mark_lvalue_use. Handle lambda capture of constant variables.
811 (mark_lvalue_use_nonread): New.
812 * semantics.c (process_outer_var_ref): Don't capture a constant
813 variable until forced.
814 * pt.c (processing_nonlambda_template): New.
815 * call.c (build_this): Check it.
816 * decl2.c (grok_array_decl): Call mark_rvalue_use and
817 mark_lvalue_use_nonread.
818 * init.c (constant_value_1): Don't call mark_rvalue_use.
819 * typeck.c (build_static_cast): Handle lambda capture.
821 Use local_specializations to find capture proxies.
822 * cp-tree.h (DECL_CAPTURED_VARIABLE): New.
823 * lambda.c (build_capture_proxy): Set it.
824 (add_capture): Pass initializer to build_capture_proxy.
825 (start_lambda_function): Likewise.
826 (insert_capture_proxy): Use register_local_specialization.
827 (is_lambda_ignored_entity): Always ignore proxies.
828 * name-lookup.c (qualify_lookup): Don't check
829 is_lambda_ignored_entity if LOOKUP_HIDDEN is set.
830 * semantics.c (process_outer_var_ref): Use
831 retrieve_local_specialization.
832 * parser.c (cp_parser_lambda_body): Push local_specializations.
833 * pt.c (tsubst_expr): Pass LOOKUP_HIDDEN when looking for a proxy.
834 (tsubst_lambda_expr): Push local_specializations sooner.
835 (tsubst_copy_and_build): Don't register_local_specialization.
837 * call.c (build_special_member_call): Use the return value of
839 * decl.c (compute_array_index_type): Likewise.
840 * parser.c (cp_parser_oacc_wait_list): Likewise.
841 * lambda.c (is_normal_capture_proxy): Handle *this capture.
842 (add_capture): Clarify internal_error message.
844 2017-09-22 Eric Botcazou <ebotcazou@adacore.com>
847 * cp-objcp-common.c (cp_get_debug_type): Do only one lookup.
849 2017-09-22 Jakub Jelinek <jakub@redhat.com>
852 * tree.c (struct replace_placeholders_t): Add pset field.
853 (replace_placeholders_r): Call cp_walk_tree with d->pset as
854 last argument instead of NULL. Formatting fix.
855 (replace_placeholders): Add pset variable, add its address
856 into data. Pass &pset instead of NULL to cp_walk_tree.
858 2017-09-22 David Malcolm <dmalcolm@redhat.com>
860 * call.c (get_fndecl_argument_location): New function.
861 (convert_like_real): Use it when complaining about argument type
863 * cp-tree.h (struct cp_parameter_declarator): Add "loc" field.
864 * parser.c (make_parameter_declarator): Add "loc" param and use
865 it to initialize the new field.
866 (cp_parser_translation_unit): Add UNKNOWN_LOCATION for "loc" of
867 the "no_parameters" parameter.
868 (cp_parser_parameter_declaration_list): Set the location of the
869 result of grokdeclarator to be the parameter's loc, assuming no
871 (cp_parser_parameter_declaration): Generate a location for the
872 parameter and pass to make_parameter_declarator.
874 2017-09-20 Nathan Sidwell <nathan@acm.org>
876 * name-lookup.c (member_name_cmp): Use DECL_UID for final
879 2017-09-20 Jakub Jelinek <jakub@redhat.com>
881 P0409R2 - allow lambda capture [=, this]
882 * parser.c (cp_parser_lambda_introducer): For cxx2a don't pedwarn on
885 2017-09-18 Jason Merrill <jason@redhat.com>
887 PR c++/82069 - ICE with lambda in template
888 * semantics.c (process_outer_var_ref): Check uses_template_parms
889 instead of any_dependent_template_arguments_p.
891 2017-09-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
892 Paolo Carlini <paolo.carlini@oracle.com>
895 * decl2.c (finish_anon_union): Complain about "anonymous union with
896 no members" with a pedwarn.
898 2017-09-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
900 * typeck.c (build_reinterpret_cast_1,
901 build_const_cast_1): Implement -Wcast-align=strict.
903 2017-09-15 Jakub Jelinek <jakub@redhat.com>
905 * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
906 adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
907 to C++17 or -std=gnu++17 or -std=c++17. Adjust comments.
908 (cxx_init_decl_processing, next_initializable_field,
909 is_direct_enum_init, check_initializer, cp_finish_decl,
910 mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
911 finish_function): Likewise.
912 * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
913 * pt.c (mark_template_parm, convert_nontype_argument,
914 instantiate_class_template_1, type_unification_real, unify,
915 get_partial_spec_bindings, dependent_type_p_r): Likewise.
916 * typeck.c (cp_build_unary_op): Likewise.
917 * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
918 * call.c (build_user_type_conversion_1, build_over_call,
919 build_special_member_call): Likewise.
920 * lambda.c (begin_lambda_type): Likewise.
921 * typeck2.c (process_init_constructor_record): Likewise.
922 * class.c (build_base_field, finalize_literal_type_property,
923 explain_non_literal_class): Likewise.
924 * parser.c (cp_parser_diagnose_invalid_type_name,
925 cp_parser_primary_expression, cp_parser_lambda_introducer,
926 cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
927 cp_convert_range_for, cp_parser_perform_range_for_lookup,
928 cp_parser_decomposition_declaration, cp_parser_linkage_specification,
929 cp_parser_static_assert, cp_parser_simple_type_specifier,
930 cp_parser_namespace_definition, cp_parser_using_declaration,
931 cp_parser_init_declarator, cp_parser_type_parameter_key,
932 cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
933 cp_parser_constructor_declarator_p): Likewise.
934 * mangle.c (struct globals): Rename need_cxx1z_warning to
936 (write_exception_spec, start_mangling, mangle_decl): Likewise.
937 * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
939 (check-c++17): New goal. Use 17 instead of 1z.
940 (check-c++-all): Use 17 instead of 1z.
942 2017-09-14 Jakub Jelinek <jakub@redhat.com>
945 * cp-gimplify.c (omp_var_to_track): Look through references.
946 (omp_cxx_notice_variable): Likewise.
948 2017-09-13 Nathan Sidwell <nathan@acm.org>
950 Conv-op identifers not in identifier hash table
951 * lex.c (conv_type_hasher): Make member fns inline.
952 (make_conv_op_name): Directly clone conv_op_identifier.
954 Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
955 * cp-tree.h (struct lang_type): Rename methods to members.
956 (CLASSTYPE_METHOD_VEC): Rename to ...
957 (CLASSTYPE_MEMBER_VEC): ... this.
958 * name-lookup.h (get_method_slot): Rename to ...
959 (get_member_slot): ... this.
960 (resort_type_method_vec): Rename to ...
961 (resort_type_member_vec): ... this.
962 * class.c (add_method, warn_hidden): Adjust.
963 * search.c (dfs_locate_field_accessor_pre): Adjust.
964 * name-lookup.c (method_vec_binary_search): Rename to ...
965 (member_vec_binary_search): ... this and adjust.
966 (method_vec_linear_search): Rename to ...
967 (member_vec_linear_search): ... this and adjust.
968 (fields_linear_search, get_class_binding_direct): Adjust.
969 (get_method_slot): Rename to ...
970 (get_member_slot): ... this and adjust.
971 (method_name_slot): Rename to ...
972 (member_name_slot): ... this and adjust.
973 (resort_type_method_vec): Rename to ...
974 (resort_type_member_vec): ... this and adjust.
975 (method_vec_append_class_fields): Rename to ...
976 (member_vec_append_class_fields): ... this and adjust.
977 (method_vec_append_enum_values): Rename to ...
978 (member_vec_append_enum_values): ... this and adjust.
979 (method_vec_dedup): Rename to ...
980 (member_vec_dedup): ... this and adjust.
981 (set_class_bindings, insert_late_enum_def_bindings): Adjust.
983 2017-09-12 Paolo Carlini <paolo.carlini@oracle.com>
986 * decl.c (start_decl): Early return error_mark_node if duplicate_decls
987 returns it; avoid misleading error message.
989 2017-09-12 Nathan Sidwell <nathan@acm.org>
991 Kill CLASSTYPE_SORTED_FIELDS.
992 * cp-tree.h (struct lang_type): Lose sorted_fields member.
993 (CLASSTYPE_SORTED_FIELDS): Delete.
994 * name-lookup.h (set_class_bindings): Add EXTRA arg.
995 * name-lookup.c (fields_linear_search): New, broken out of ...
996 (lookup_field_1): ... here. Delete remainder of function.
997 (get_class_binding_direct): Reimplement without sorted_fields.
998 (get_class_binding): Rename TYPE arg to KLASS, for consistency.
999 (get_method_slot): Call set_class_binding when creating method_vec
1001 (method_name_cmp): Order identically named slots.
1002 (sorted_fields_type_new): Delete.
1003 (field_vc_append_class_fields): Rename to ...
1004 (method_vec_append_class_fields): ... here. Adjust.
1005 (field_vec_append_enum_values): Renme to ...
1006 (method_vec_append_enum_values): ... here. Adjust.
1007 (method_vec_dedup): New.
1008 (set_class_bindings): Reimplement.
1009 (insert_late_enum_def_bindings): Reimplement.
1011 * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
1013 (restort_data): Move later.
1014 (method_name_cmp, resort_method_name_cmp): Simplify.
1015 (resort_type_method_vec): Reformat.
1017 2017-09-09 Jason Merrill <jason@redhat.com>
1019 * constexpr.c (reduced_constant_expression_p): If
1020 CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
1022 2017-09-09 Eric Botcazou <ebotcazou@adacore.com>
1025 * cp-objcp-common.c (struct debug_type_hasher): New class.
1026 (debug_type_hash): New variable.
1027 (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
1029 2017-09-08 Jason Merrill <jason@redhat.com>
1031 PR c++/70029 - ICE with ref-qualifier and -flto
1032 * tree.c (cxx_copy_lang_qualifiers): New.
1033 * cp-tree.h: Declare it.
1034 * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
1036 2017-09-06 Jason Merrill <jason@redhat.com>
1038 PR c++/82053 - ICE with default argument in lambda in template
1039 * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
1041 (retrieve_specialization): Use lambda_fn_in_template_p.
1042 * cp-tree.h: Declare it.
1044 PR c++/82070 - error with nested lambda capture
1045 * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
1046 register_local_specialization.
1048 2017-09-06 Nathan Sidwell <nathan@acm.org>
1050 * name-lookup.h (lookup_field_1): Delete.
1051 (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
1052 * name-lookup.c (lookup_field_1): make static
1053 (method_vec_binary_search, method_vec_linear_search): New. Broken
1055 (get_class_binding_direct): ... here. Add TYPE_OR_FNS argument.
1056 Do complete search of this level.
1057 (get_class_binding): Adjust.
1058 * decl.c (reshape_init_class): Call get_class_binding.
1059 * search.c (lookup_field_r): Move field searching into
1060 get_class_binding_direct.
1062 * class.c (warn_hidden): Don't barf on non-functions.
1063 * decl2.c (check_classfn): Likewise. Check template match earlier.
1065 * name-lookup.c (count_fields): Rename to ...
1066 (count_class_fields): ... here. Take a class, don't count
1068 (add_fields_to_record_type): Rename to ...
1069 (field_vec_append_class_fields): ... here. Take a class, don't
1070 add NULL-named fields.
1071 (add_enum_fields_to_record_type): Rename to ...
1072 (field_vec_append_enum_values): ... here.
1073 (set_class_bindings): Adjust, assert we added expected number.
1074 (insert_late_enum_def_bindings): Reimplement. Create vector if
1075 there are now sufficient entries.
1077 * name-lookup.h (lookup_fnfields_slot_nolazy,
1078 lookup_fnfields_slot): Rename to ...
1079 (get_class_binding_direct, get_class_binding): ... here.
1080 * name-lookup.c (lookup_fnfields_slot_nolazy,
1081 lookup_fnfields_slot): Rename to ...
1082 (get_class_binding_direct, get_class_binding): ... here.
1083 * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
1084 * call.c (build_user_type_conversion_1): Adjust.
1085 (has_trivial_copy_assign_p): Adjust.
1086 (has_trivial_copy_p): Adjust.
1087 * class.c (get_basefndecls) Adjust.
1088 (vbase_has_user_provided_move_assign) Adjust.
1089 (classtype_has_move_assign_or_move_ctor_p): Adjust.
1090 (type_build_ctor_call, type_build_dtor_call): Adjust.
1091 * decl.c (register_dtor_fn): Adjust.
1092 * decl2.c (check_classfn): Adjust.
1093 * pt.c (retrieve_specialization): Adjust.
1094 (check_explicit_specialization): Adjust.
1095 (do_class_deduction): Adjust.
1096 * search.c (lookup_field_r): Adjust.
1097 (look_for_overrides_here, lookup_conversions_r): Adjust.
1098 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
1099 * tree.c (type_has_nontrivial_copy_init): Adjust.
1100 * method.c (lazily_declare_fn): Adjust comment.
1102 2017-09-05 Nathan Sidwell <nathan@acm.org>
1104 * name-lookup.c (do_class_using_decl): Elide read-once temps.
1105 Move declarations to initializations.
1107 * class.c (add_method): Move slot search and insertion to ...
1108 * name-lookup.c (get_method_slot): ... this new function.
1109 (lookup_fnfields_slot_nolazy): Cope with NULL slot.
1110 * name-lookup.h (get_method_slot): Declare.
1111 * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
1113 (grok_special_member_properties): Set
1114 TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
1115 Improve TYPE_HAS_CONSTEXPR_CTOR setting.
1117 * cp-tree.h (lang_decl_base): Rename template_conv_p to
1119 (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
1120 (DECL_CONV_FN_TYPE): FN must be conv op.
1121 (DECL_TEMPLATE_CONV_FN_P): Delete.
1122 (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
1123 * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
1126 * class.c (unreverse_member_declarations): Remove extraneous if.
1127 * pt.c (push_template_decl_real): Use string concatenation, not
1128 \<newline>. Add %<..%>.
1130 2017-09-05 Paolo Carlini <paolo.carlini@oracle.com>
1133 * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
1134 * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
1135 creating cdtor_label.
1136 * constexpr.c (returns): Add the case of a constructor/destructor
1137 returning via a LABEL_DECL_CDTOR label.
1138 (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
1140 2017-09-01 Nathan Sidwell <nathan@acm.org>
1142 * cp-tree.h (resort_type_method_vec): Move declaration to ...
1143 * name-lookup.h (resort_type_method_vec): ... here.
1144 (set_class_bindings): Lose 2nd arg.
1145 * class.c (finish_struct_1, finish_struct): Adjust
1146 set_class_bindings call. Don't call finish_struct_methods.
1147 (resort_data, method_name_cmp, resort_method_name_cmp,
1148 resort_type_method_vec, finish_struct_methods): Move to ...
1149 * name-lookup.c (resort_data, method_name_cmp,
1150 resort_method_name_cmp, resort_type_method_vec): ... here.
1151 (set_class_bindings): Lose fields arg. Swallow finish_struct_methods.
1153 * class.c (finish_struct): Call set_class_bindings for the
1156 * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
1157 Don't call maybe_warn_about_overly_private_class here.
1158 (warn_hidden): Cleanup declarations and comments.
1159 (type_has_user_provided_constructor): No need to check
1160 CLASSTYPE_METHOD_VEC.
1161 (type_has_user_provided_or_explicit_constructor): Likewise.
1162 (classtype_has_move_assign_or_move_ctor_p): Likewise.
1163 (check_bases_and_members): Don't call finish_struct_methods here.
1164 (finish_struct_1): Call finish_struct_methods and
1165 set_class_bindings immediately after layout. Clear DECL_IN_AGGR_P
1167 (finish_struct): For templates process USING_DECLS and clear
1168 DECL_IN_AGGR_P before calling finish_struct_methods. Call
1169 maybe_warn_about_overly_private_class here.
1171 Revert 2017-08-28 Nathan Sidwell <nathan@acm.org>
1172 Restore sorted_fields vector.
1173 * cp-tree.h (lang_type): Restore sorted_fields vector.
1174 (CLASSTYPE_SORTED_FIELDS): Restore.
1175 (CLASSTYPE_BINDINGS): Delete.
1176 * name-lookup.c (lookup_field_1): Restore binary search.
1177 (sorted_fields_type_new, count_fields,
1178 add_fields_to_record_type, add_enum_fields_to_record_type): Restore
1179 (set_class_bindings): Revert.
1180 (insert_late_enum_def_binding): Restore field_vec insertion.
1182 2017-09-01 Jakub Jelinek <jakub@redhat.com>
1185 * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
1187 2017-09-01 Marek Polacek <polacek@redhat.com>
1190 * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
1192 2017-08-30 Jason Merrill <jason@redhat.com>
1194 PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
1195 * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
1196 (regenerated_lambda_fn_p): New.
1197 (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
1198 (tsubst_copy) [VAR_DECL]: Likewise.
1200 PR c++/82030 - ICE inheriting from multiple lambdas
1202 * call.c (compare_ics): Handle null candidate.
1204 2017-08-30 Ville Voutilainen <ville.voutilainen@gmail.com>
1206 Make taking the address of an overloaded function a non-deduced context
1208 * pt.c (unify_overload_resolution_failure): Remove.
1209 (unify_one_argument): Adjust.
1211 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1212 Alan Hayward <alan.hayward@arm.com>
1213 David Sherwood <david.sherwood@arm.com>
1215 * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
1217 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1218 Alan Hayward <alan.hayward@arm.com>
1219 David Sherwood <david.sherwood@arm.com>
1221 * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
1223 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1224 Alan Hayward <alan.hayward@arm.com>
1225 David Sherwood <david.sherwood@arm.com>
1227 * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
1228 instead of TYPE_MODE.
1230 2017-08-29 Jason Merrill <jason@redhat.com>
1232 PR c++/81236 - ICE with template-id in generic lambda
1233 * semantics.c (finish_id_expression): Remove special dependent case.
1234 Avoid some later pieces when dependent.
1235 (finish_qualified_id_expr): Do normal BASELINK handling in a
1236 template. Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
1237 (parsing_default_capturing_generic_lambda_in_template): Remove.
1238 * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
1239 error for types that will never be complete.
1240 * mangle.c (write_expression): Add sanity check.
1241 * tree.c (build_qualified_name): Add sanity check.
1242 (cp_walk_subtrees): Walk into the class context of a BASELINK.
1243 * lambda.c (add_capture): Improve diagnostic for generic lambda
1245 * call.c (build_new_method_call_1): Print the right constructor
1248 Reimplement handling of lambdas in templates.
1249 * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
1250 * decl.c (start_preparsed_function): Call start_lambda_scope.
1251 (finish_function): Call finish_lambda_scope.
1252 * init.c (get_nsdmi): Call start/finish_lambda_scope.
1253 * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
1254 * parser.c (cp_parser_function_definition_after_declarator): Don't
1255 call start/finish_lambda_scope.
1256 * pt.c (retrieve_specialization): Ignore lambda functions in
1258 (find_parameter_packs_r): Ignore capture proxies. Look into
1260 (check_for_bare_parameter_packs): Allow bare packs in lambdas.
1261 (tsubst_default_argument): Call start/finish_lambda_scope.
1262 (tsubst_function_decl): Handle lambda functions differently.
1263 (tsubst_template_decl): Likewise.
1264 (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
1266 (tsubst_lambda_expr): Create a new closure rather than instantiate
1267 the one from the template.
1268 (tsubst_copy_and_build): Don't register a specialization of a pack.
1269 (regenerate_decl_from_template): Call start/finish_lambda_scope.
1270 (instantiate_decl): Remove special lambda function handling.
1271 * semantics.c (process_outer_var_ref): Remove special generic lambda
1272 handling. Don't implicitly capture in a lambda in a template. Look
1273 for an existing proxy.
1274 * class.c (current_nonlambda_class_type): Use decl_type_context.
1276 * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
1277 (LAMBDA_EXPR_RETURN_TYPE): Remove.
1278 (struct tree_lambda_expr): Remove closure and return_type fields.
1279 * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
1280 * pt.c (tsubst_copy_and_build): Likewise.
1281 * parser.c (cp_parser_lambda_declarator_opt): Track return type.
1282 (cp_parser_lambda_body): Adjust unspecified return type check.
1283 * ptree.c (cxx_print_lambda_node): Don't print closure or
1286 PR c++/80935 - wrong C++17 error with lambda
1287 * decl.c (check_for_uninitialized_const_var): Check
1288 is_instantiation_of_constexpr.
1289 * constexpr.c (ensure_literal_type_for_constexpr_object): Check
1290 is_instantiation_of_constexpr.
1291 (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
1293 * lambda.c (build_lambda_object): Check for error_mark_node.
1294 * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
1296 (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
1297 (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
1299 PR c++/80767 - unnecessary instantiation of generic lambda
1300 * call.c (convert_like_real): Call build_user_type_conversion_1 if
1302 (add_conv_candidate): Build a ck_user conversion with no candidate.
1304 Fix lambdas in template default argument of inherited ctor.
1305 * method.c (synthesized_method_base_walk): Replace an inherited
1306 template with its specialization.
1307 (synthesized_method_walk): Make inheriting_ctor a pointer.
1308 (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
1309 (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
1311 * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
1312 template, not the function.
1313 (template_guide_p): Adjust.
1315 Support copying local_specializations.
1316 * cp-tree.h (enum lss_policy): New.
1317 (local_specialization_stack): Add policy parameter to default ctor.
1318 * pt.c (local_specialization_stack): Copy local_specializations if
1321 * constexpr.c (potential_constant_expression_1): Add "now" parm.
1322 (is_constant_expression, require_constant_expression): New.
1323 (is_static_init_expression, is_nondependent_constant_expression)
1324 (is_nondependent_static_init_expression): Drop "potential".
1325 * except.c (build_must_not_throw_expr): Do type conversion on
1326 value-dependent argument.
1327 * pt.c, semantics.c, typeck2.c: Use variants without "potential".
1329 Instantiate default arguments/member initializers once.
1330 * init.c (get_nsdmi): Remember NSDMI instantiations.
1331 * parser.c (inject_this_parameter): Be more picky about
1333 * pt.c (tsubst_copy): Simplify 'this' handling.
1334 (tsubst_default_argument): Remember default argument
1335 instantiations. Take parameter number.
1336 (tsubst_default_arguments): Pass it.
1337 * call.c (convert_default_arg): Likewise.
1339 Fix default argument conversion failure and SFINAE.
1340 * call.c (build_over_call): Check convert_default_arg result for
1342 * parser.c (cp_parser_late_parsing_default_args): Remember
1345 2017-08-28 Nathan Sidwell <nathan@acm.org>
1347 * cp-tree.h (lang_type): Replace sorted_fields vector with
1349 (CLASSTYPE_SORTED_FIELDS): Delete.
1350 (CLASSTYPE_BINDINGS): New.
1351 * decl.c (finish_enum_value_list): Swap args of
1352 insert_late_enum_def_bindings.
1353 * name-lookup.c (lookup_field_1): Replace binary search of sorted
1354 fields with map->get.
1355 (sorted_fields_type_new, count_fields,
1356 add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
1357 (add_class_member, add_class_members): New.
1358 (set_class_bindings): Create map and insert.
1359 (insert_late_enum_def_binding): Swap parms. Use add_clasS_member.
1360 * ptree.c (cxx_print_type): Delete sorted fields printing.
1362 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
1364 * name-lookup.h (set_class_bindings,
1365 insert_late_enum_def_bindings): Declare.
1366 * decl.c (finish_enum_value_list): Adjust for
1367 insert_late_enum_def_bindings name change.
1368 * class.c (finish_struct_1): Call set_class_bindings.
1369 (count_fields, add_fields_to_record_type,
1370 add_enum_fields_to_record_type, sorted_fields_type_new,
1371 insert_into_classtype_sorted_fields,
1372 insert_late_enum_def_into_classtype_sorted_fields): Move to ...
1373 * name-lookup.h (count_fields, add_fields_to_record_type,
1374 add_enum_fields_to_record_type, sorted_fields_type_new,
1375 set_class_bindings, insert_late_enum_def_bindings): ... here.
1377 2017-08-25 Nathan Sidwell <nathan@acm.org>
1379 * class.c (method_name_cmp, resort_method_name_cmp): Methods
1382 Conversion operators have a special name
1383 * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
1384 (conv_op_marker, conv_op_identifier): New.
1385 (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
1386 * decl.c (initialize_predefined_identifiers): Add
1388 (cxx_init_decl_processing): Create conv_op_marker.
1389 * decl2.c (check_classfn): Lookup conv-ops by name.
1390 * class.c (add_method): Use conv_op_identifier & conv_op_marker.
1391 (resort_type_method_vec): Don't skip conv-ops.
1392 (finish_struct_methods, warn_hidden): Likewise.
1393 * name-lookup.h (lookup_all_conversions): Delete.
1394 * name-lookup.c (lookup_conversion_operator): Replace with ...
1395 (extract_conversion_operator): ... this.
1396 (lookup_fnfields_slot_nolazy): Find conv-ops by name.
1397 (lookup_all_conversions): Delete.
1398 * pt.c (check_explicit_specialization): Find conv-ops by name.
1399 * search.c (lookup_conversions_r): Likewise.
1401 2017-08-24 Nathan Sidwell <nathan@acm.org>
1403 Conversion operators kept on single overload set
1404 * class.c (add_method): Keep all conv-ops on one slot.
1405 * name-lookup.c (lookup_conversion_operator): Pull the desired
1406 conv op out of overload set.
1407 * search.c (lookup_conversions_r): Lose template/non-template
1409 (lookup_conversions): Likewise.
1411 2017-08-23 Nathan Sidwell <nathan@acm.org>
1413 * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
1414 lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
1416 * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
1417 lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
1418 * search.c (lookup_conversion_operator,
1419 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1420 lookup_all_conversions): Move to ...
1421 * name-lookup.c (lookup_conversion_operator,
1422 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1423 lookup_all_conversions): ... here.
1425 * semantics.c (finish_member_declaration): Move USING_DECL check
1426 earlier. Always set C++ linkage. Commonize TYPE_FIELD and
1427 template decl list insertion.
1429 * cp-tree.h (maybe_version_functions): Declare.
1430 * decl.c (decls_match): Break function versioning check to
1431 separate function. Call it.
1432 (maybe_version_functions): Broken out of decls_match.
1433 * class.c (add_method): Use maybe_version_functions.
1435 * cp-tree.h (print_search_statistics,
1436 reinit_search_statistics): Don't declare.
1437 * search.c (n_fields_searched, n_calls_lookup_field,
1438 n_calls_lookup_field_1, n_calls_lookup_fnfields,
1439 n_calls_lookup_fnfields_1, n_calls_get_base_type,
1440 n_outer_fields_searched, n_contexts_saved): Delete.
1441 (lookup_field_1, lookup_member,
1442 lookup_fnfields_slot_nolazy): Remove stat gathering.
1443 (print_search_statistics, reinit_search_statistics): Delete.
1444 * tree.c (cxx_print_statistics): Don't print search stats.
1446 2017-08-21 Nathan Sidwell <nathan@acm.org>
1448 * search.c (lookup_field_r): Remove obsolete code for type-named
1451 * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
1453 (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
1454 (lookup_field_fuzzy_r): Adjust.
1456 2017-08-21 David Malcolm <dmalcolm@redhat.com>
1458 * call.c (build_over_call): Pass NULL for new parameter to
1459 check_function_arguments.
1460 * typeck.c (cp_build_function_call_vec): Likewise.
1462 2017-08-21 Nathan Sidwell <nathan@acm.org>
1465 * pt.c (instantiate_class_template_1):
1466 BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
1468 2017-08-18 David Malcolm <dmalcolm@redhat.com>
1471 * name-lookup.c (maybe_suggest_missing_header): Convert return
1472 type from void to bool; return true iff a suggestion was offered.
1473 (suggest_alternative_in_explicit_scope): Move call to
1474 maybe_suggest_missing_header to before use of best_match, and
1475 return true if the former offers a suggestion.
1477 2017-08-18 H.J. Lu <hongjiu.lu@intel.com>
1480 * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
1481 * decl2.c (grokbitfield): Don't allow bit-field with
1482 warn_if_not_aligned type.
1484 2017-08-17 Nathan Sidwell <nathan@acm.org>
1486 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
1487 * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
1488 (TYPE_TEMPLATE_INFO): Simplify.
1489 (SET_TYPE_TEMPLATE_INFO): Simplify.
1491 * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
1492 don't need lang_type.
1493 (cxx_make_type): Use maybe_add_lang_type_raw return value.
1494 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
1497 * cp-tree.h (struct lang_type): Remove template_info field.
1498 (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
1499 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
1501 2017-08-14 Martin Sebor <msebor@redhat.com>
1504 * error.c (cp_printer): Handle 'G'.
1506 2017-08-11 Martin Liska <mliska@suse.cz>
1508 * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
1509 TARGET_SUPPORTS_ALIASES.
1510 (handle_tls_init): Likewise.
1511 (note_mangling_alias): Likewise. Remove ATTRIBUTE_UNUSED for
1513 * optimize.c (can_alias_cdtor): Likewise.
1515 2017-08-11 Jason Merrill <jason@redhat.com>
1517 PR c++/81671 - nullptr_t template parameter
1518 * pt.c (convert_nontype_argument): Fix nullptr_t check.
1520 2017-08-10 Jason Merrill <jason@redhat.com>
1522 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1523 * method.c (synthesized_method_walk): Don't diagnose lack of
1526 PR c++/80452 - Core 1579, implicit move semantics on return/throw
1527 * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
1528 tentatively changed the lvalue to an rvalue.
1529 * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
1530 (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
1531 parameter is an rvalue reference.
1532 * except.c (build_throw): Do maybe-rvalue overload resolution twice.
1533 * typeck.c (check_return_expr): Likewise.
1535 2017-08-10 David Malcolm <dmalcolm@redhat.com>
1537 * parser.c (cp_parser_error): Update for new param to
1539 (class token_pair): New class.
1540 (struct matching_paren_traits): New struct.
1541 (matching_parens): New typedef.
1542 (struct matching_brace_traits): New struct.
1543 (matching_braces): New typedef.
1544 (cp_parser_statement_expr): Convert explicit parsing of
1545 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
1546 class matching_parens, so that the pertinent open parenthesis is
1547 highlighted when there are problems locating the close
1549 (cp_parser_primary_expression): Likewise.
1550 (cp_parser_compound_literal_p): Remove consumption of opening
1552 (cp_parser_postfix_expression): Convert explicit parsing of
1553 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
1554 above. Use it to consume the opening paren previously consumed by
1555 cp_parser_compound_literal_p.
1556 (cp_parser_parenthesized_expression_list): Likewise.
1557 (cp_parser_unary_expression): Likewise.
1558 (cp_parser_new_expression): Likewise.
1559 (cp_parser_cast_expression): Likewise.
1560 (cp_parser_builtin_offsetof): Likewise.
1561 (cp_parser_trait_expr): Likewise.
1562 (cp_parser_lambda_declarator_opt): Likewise.
1563 (cp_parser_lambda_body): Likewise, for matching_braces.
1564 (cp_parser_compound_statement): Likewise.
1565 (cp_parser_selection_statement): Likewise, for matching_parens.
1566 (cp_parser_iteration_statement): Likewise.
1567 (cp_parser_already_scoped_statement): Likewise, for
1569 (cp_parser_linkage_specification): Likewise.
1570 (cp_parser_static_assert): Likewise, for matching_parens.
1571 (cp_parser_decltype): Likewise.
1572 (cp_parser_operator): Likewise.
1573 (cp_parser_enum_specifier): Likewise.
1574 (cp_parser_namespace_definition): Likewise.
1575 (cp_parser_direct_declarator): Likewise.
1576 (cp_parser_braced_list): Likewise.
1577 (cp_parser_class_specifier_1): Likewise, for matching_braces.
1578 (cp_parser_constant_initializer): Likewise.
1579 (cp_parser_noexcept_specification_opt): Likewise, for
1581 (cp_parser_exception_specification_opt): Likewise.
1582 (cp_parser_handler): Likewise.
1583 (cp_parser_asm_specification_opt): Likewise.
1584 (cp_parser_asm_operand_list): Likewise.
1585 (cp_parser_gnu_attributes_opt): Likewise.
1586 (cp_parser_std_attribute_spec): Likewise.
1587 (cp_parser_requirement_parameter_list): Likewise.
1588 (cp_parser_requirement_body): Likewise, for matching_braces.
1589 (cp_parser_compound_requirement): Likewise.
1590 (cp_parser_template_introduction): Likewise.
1591 (cp_parser_sizeof_pack): Likewise, for matching_parens.
1592 (cp_parser_sizeof_operand): Likewise; use it to consume the
1593 opening paren previously consumed by cp_parser_compound_literal_p.
1594 (get_matching_symbol): New function.
1595 (cp_parser_required_error): Add param "matching_location". Remove
1596 calls to cp_parser_error, instead setting a non-NULL gmsgid, and
1597 handling it if set by calling c_parse_error, potentially with a
1598 secondary location if matching_location was set.
1599 (cp_parser_require): Add param "matching_location", with a default
1600 value of UNKNOWN_LOCATION.
1601 (cp_parser_require_keyword): Update for new param of
1602 cp_parser_required_error.
1603 (cp_parser_objc_encode_expression): Update to class matching_parens
1605 (cp_parser_objc_defs_expression): Likewise.
1606 (cp_parser_objc_protocol_expression): Likewise.
1607 (cp_parser_objc_selector_expression): Likewise.
1608 (cp_parser_objc_typename): Likewise.
1609 (cp_parser_objc_superclass_or_category): Likewise.
1610 (cp_parser_objc_try_catch_finally_statement): Likewise.
1611 (cp_parser_objc_synchronized_statement): Likewise.
1612 (cp_parser_objc_at_property_declaration): Likewise.
1613 (cp_parser_oacc_single_int_clause): Likewise.
1614 (cp_parser_oacc_shape_clause): Likewise.
1615 (cp_parser_omp_clause_collapse): Likewise.
1616 (cp_parser_omp_clause_default): Likewise.
1617 (cp_parser_omp_clause_final): Likewise.
1618 (cp_parser_omp_clause_if): Likewise.
1619 (cp_parser_omp_clause_num_threads): Likewise.
1620 (cp_parser_omp_clause_num_tasks): Likewise.
1621 (cp_parser_omp_clause_grainsize): Likewise.
1622 (cp_parser_omp_clause_priority): Likewise.
1623 (cp_parser_omp_clause_hint): Likewise.
1624 (cp_parser_omp_clause_defaultmap): Likewise.
1625 (cp_parser_omp_clause_ordered): Likewise.
1626 (cp_parser_omp_clause_schedule): Likewise.
1627 (cp_parser_omp_clause_num_teams): Likewise.
1628 (cp_parser_omp_clause_thread_limit): Likewise.
1629 (cp_parser_omp_clause_aligned): Likewise.
1630 (cp_parser_omp_clause_linear): Likewise.
1631 (cp_parser_omp_clause_safelen): Likewise.
1632 (cp_parser_omp_clause_simdlen): Likewise.
1633 (cp_parser_omp_clause_depend): Likewise.
1634 (cp_parser_omp_clause_device): Likewise.
1635 (cp_parser_omp_clause_dist_schedule): Likewise.
1636 (cp_parser_oacc_clause_async): Likewise.
1637 (cp_parser_omp_critical): Likewise.
1638 (cp_parser_omp_for_loop): Likewise.
1639 (cp_parser_omp_sections_scope): Likewise.
1640 (cp_parser_omp_declare_reduction_exprs): Likewise.
1641 Update for new param to cp_parser_required_error.
1642 (cp_parser_oacc_routine): Likewise.
1643 (cp_parser_transaction_expression): Likewise.
1644 (cp_parser_cilk_simd_vectorlength): Likewise.
1646 2017-08-09 Jason Merrill <jason@redhat.com>
1648 PR c++/81525 - wrong constant value with generic lambda
1649 * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
1650 (tsubst_copy) [VAR_DECL]: Handle auto.
1652 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1653 * init.c (get_nsdmi): Add complain parm.
1654 * typeck2.c (digest_nsdmi_init): Add complain parm.
1655 (process_init_constructor_record): Pass complain to get_nsdmi.
1656 * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
1657 * method.c (get_defaulted_eh_spec): Add complain parm. Pass it into
1658 synthesized_method_walk.
1659 (synthesized_method_walk): Adjust.
1660 (walk_field_subobs): Pass complain to get_nsdmi.
1661 (defaulted_late_check): Skip other checks if deleted.
1662 * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
1663 * call.c (build_aggr_conv): Pass complain to get_nsdmi.
1664 * parser.c (defarg_location): New.
1665 * error.c (location_of): Use it.
1667 2017-08-09 Marek Polacek <polacek@redhat.com>
1669 * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
1670 * typeck.c (build_binary_op): Change the type of a parameter to bool.
1671 (cp_truthvalue_conversion): Use true instead of 1.
1673 2017-08-08 Marek Polacek <polacek@redhat.com>
1676 * cp-gimplify.c (cp_fold): If folding exposed a branch of
1677 a COND_EXPR, convert it to the original type of the COND_EXPR, if
1680 2017-08-08 Martin Liska <mliska@suse.cz>
1682 * call.c: Include header files.
1683 * cp-gimplify.c: Likewise.
1684 * cp-ubsan.c: Likewise.
1687 * search.c: Likewise.
1688 * semantics.c: Likewise.
1689 * typeck.c: Likewise.
1691 2017-08-07 Martin Liska <mliska@suse.cz>
1693 * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
1695 (cp_parser_std_attribute): Likewise.
1696 * tree.c: Add new include.
1698 2017-08-04 Paolo Carlini <paolo.carlini@oracle.com>
1701 * pt.c (do_class_deduction): Handle the case of no viable implicit
1702 deduction guides; simplify the code generating implicit deduction
1705 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
1708 * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
1709 destructor as expressions.
1711 2017-08-02 Jakub Jelinek <jakub@redhat.com>
1714 * call.c (build_user_type_conversion_1): Only call
1715 lookup_fnfields_slot if totype is CLASS_TYPE_P.
1717 2017-07-31 Jason Merrill <jason@redhat.com>
1719 * decl.c (declare_global_var): Set DECL_CONTEXT.
1721 2017-07-31 Jan Hubicka <hubicka@ucw.cz>
1722 Martin Liska <mliska@suse.cz>
1724 * pt.c (tsubst_copy): Copy PREDICT_EXPR.
1725 * semantics.c (finish_goto_stmt): Build gimple predict
1727 * constexpr.c (potential_constant_expression_1): Handle
1730 2017-07-31 Martin Liska <mliska@suse.cz>
1733 * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
1734 also with current_function_decl non-null equality.
1735 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1736 * decl.c (compute_array_index_type): Likewise.
1737 * init.c (finish_length_check): Likewise.
1738 * typeck.c (cp_build_binary_op): Likewise.
1740 2017-07-29 Jakub Jelinek <jakub@redhat.com>
1742 * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
1743 DW_AT_export_symbols.
1744 * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
1745 argument, pass it through to the debug hook.
1746 (finish_namespace_using_directive): Adjust
1747 emit_debug_info_using_namespace caller.
1748 (push_namespace): Likewise. Call it after setting
1749 DECL_NAMESPACE_INLINE_P.
1750 (cp_emit_debug_info_for_using): Pass false as new argument to
1751 the imported_module_or_decl debug hook.
1753 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
1755 * lex.c (copy_decl): Adjust.
1756 (copy_type): Likewise.
1758 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
1761 * lambda.c (add_capture): Early return if we cannot capture by
1764 2017-07-26 Jason Merrill <jason@redhat.com>
1766 P0702R1 - List deduction of vector.
1767 * pt.c (do_class_deduction): Special-case deduction from a single
1768 element of related type.
1770 2017-07-26 Leonid Koppel <lkoppel@uwaterloo.ca>
1772 PR c++/67054 - Inherited ctor with non-default-constructible members
1773 * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
1774 when deducing an inheriting constructor.
1776 2017-07-21 Nathan Sidwell <nathan@acm.org>
1778 * search.c (lookup_conversion_operator): Return overloads.
1779 (lookup_fnfields_idx_nolazy): Absorb into ...
1780 (lookup_fnfields_slot_nolaxy): ... here.
1781 (lookup_fnfields_1): Absorb into ...
1782 (lookup_fnfields_slot): ... here.
1784 Remove special CDtor METHOD_VEC slots.
1785 * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
1786 CLASSTYPE_DESTRUCTOR_SLOT): Delete.
1787 (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
1788 (CLASSTYPE_DESTRUCTOR): Likewise.
1789 * class (add_method): Don't use special cdtor slots.
1790 * search.c (lookup_fnfields_idx_nolazy): Likewise.
1791 (look_for_overrides_here): Use lookup_fnfields_slot.
1792 * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
1794 * call.c (add_candidates): Move decls to initialization. Don't
1797 2017-07-20 Nathan Sidwell <nathan@acm.org>
1799 Remove TYPE_METHODS.
1800 * class.c (maybe_warn_about_overly_private_class,
1801 finish_struct_methods, one_inheriting_sig, count_fields,
1802 add_fields_to_record_type, check_field_decls, check_methods,
1803 clone_function_decl, set_method_tm_attributes,
1804 finalize_literal_type_property, check_bases_and_members,
1805 create_vtable_ptr, determine_key_method,
1806 unreverse_member_declarations, finish_struct,
1807 add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
1808 * decl.c (fixup_anonymous_aggr): Likewise.
1809 * decl2.c (reset_type_linkage_2): Likewise.
1810 * method.c (after_nsdmi_defaulted_late_checks,
1811 lazily_declare_fn): Likewise.
1812 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
1813 * pt.c (instantiate_class_template_1, tsubst_expr,
1814 do_type_instantiation, instantiate_pending_templates): Likewise.
1815 * search.c (lookup_field_1): Likewise.
1816 * semantics.c (finish_member_declaration,
1817 finish_omp_declare_simd_methods): Likewise.
1819 2017-07-19 Nathan Sidwell <nathan@acm.org>
1821 * class.c (add_implicitly_declared_members): Use
1822 classtype_has_move_assign_or_move_ctor_p.
1823 (classtype_has_move_assign_or_move_ctor,
1824 classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
1825 (classtype_has_move_assign_or_move_ctor_p): ... this new function.
1826 * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
1828 (classtype_has_move_assign_or_move_ctor_p): ... this.
1829 * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
1830 * tree.c (type_has_nontrivial_copy_init): Adjust.
1832 * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
1833 PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
1835 2017-07-18 Nathan Sidwell <nathan@acm.org>
1837 * cp-array-notation.c (build_array_notation_ref): Use
1838 TYPE_{MIN,MAX}_VALUE.
1840 * class.c (classtype_has_move_assign_or_move_ctor): Declare.
1841 (add_implicitly_declared_members): Use it.
1842 (type_has_move_constructor, type_has_move_assign): Merge into ...
1843 (classtype_has_move_assign_or_move_ctor): ... this new function.
1844 * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
1846 2017-07-17 Volker Reichelt <v.reichelt@netcologne.de>
1848 * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
1849 friend outside class and obsolete auto as storage-class-specifier.
1851 2017-07-17 Nathan Sidwell <nathan@acm.org>
1853 * class.c (maybe_warn_about_overly_private_class): Ignore public
1856 * class.c (type_has_user_declared_move_constructor,
1857 type_has_user_declared_move_assign): Combine into ...
1858 (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
1859 * cp-tree.h (type_has_user_declared_move_constructor,
1860 type_has_user_declared_move_assign): Combine into ...
1861 (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
1862 * method.c (maybe_explain_implicit_delete): Use it.
1863 (lazily_declare_fn): Use it.
1864 * tree.c (type_has_nontrivial_copy_init): Use it.
1866 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
1867 semantics, simplify implementation.
1869 2017-07-16 Volker Reichelt <v.reichelt@netcologne.de>
1871 * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
1872 in old-style cast diagnostic.
1873 * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
1874 in useless cast diagnostic.
1875 * error.c (type_to_string): Remove enum special handling.
1877 2017-07-14 David Malcolm <dmalcolm@redhat.com>
1879 * name-lookup.c (get_std_name_hint): Add '<' and '>' around
1881 (maybe_suggest_missing_header): Update for addition of '<' and '>'
1882 to above. Provide a fix-it hint.
1883 * pt.c: Include "gcc-rich-location.h"
1884 (listify): Attempt to add fix-it hint for missing
1885 #include <initializer_list>.
1886 * rtti.c: Include "gcc-rich-location.h".
1887 (typeid_ok_p): Attempt to add fix-it hint for missing
1888 #include <typeinfo>.
1890 2017-07-12 Jason Merrill <jason@redhat.com>
1892 P0512R0 - Deduction from an initializer list.
1893 * pt.c (do_class_deduction): Do list deduction in two phases.
1895 2017-07-12 Nathan Sidwell <nathan@acm.org>
1897 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
1898 DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
1900 * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
1901 DECL_CXX_DESTRUCTOR explicitly.
1902 * decl2.c (grokclassfn): Likewise.
1903 * friend.c (do_friend): Likewise.
1904 * method.c (make_thunk, make_alias_for,
1905 implicitly_declare_fn): Likewise.
1907 2017-07-11 Jason Merrill <jason@redhat.com>
1910 * decl.c (grokparms): Downgrade error about array of unknown bound
1911 to pedwarn and disable it for C++17.
1913 2017-07-11 Nathan Sidwell <nathan@acm.org>
1915 * decl2.c (reset_type_linkage_2): Dont't change ctor name.
1917 2017-07-10 Martin Sebor <msebor@redhat.com>
1919 * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
1921 2017-07-06 Jason Merrill <jason@redhat.com>
1923 PR c++/81204 - parse error with dependent template-name
1924 * parser.c (cp_parser_lookup_name): Revert previous change.
1926 2017-07-06 David Malcolm <dmalcolm@redhat.com>
1928 * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
1929 selftest::run_cp_tests.
1930 (selftest::run_cp_tests): New function.
1931 * cp-tree.h (selftest::run_cp_tests): New decl.
1933 2017-07-04 Jakub Jelinek <jakub@redhat.com>
1935 * parser.c (cp_parser_decomposition_declaration): Replace
1936 decomposition declaration with structured binding in diagnostics.
1937 * decl.c (cp_finish_decomp): Likewise.
1938 (grokdeclarator): Likewise.
1941 * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
1942 forms of structured binding initializers.
1944 2017-07-03 Paolo Carlini <paolo.carlini@oracle.com>
1947 * decl.c (grokdeclarator): Move checks on function return type after
1948 the splice_late_return_type call; if declspecs->locations[ds_type_spec]
1949 is UNKNOWN_LOCATION fall back to input_location.
1951 2017-07-03 David Malcolm <dmalcolm@redhat.com>
1953 * parser.c (enum required_token): Fix spelling of
1954 RT_INTERATION to RT_ITERATION.
1955 (cp_parser_iteration_statement): Likewise.
1956 (cp_parser_required_error): Likewise.
1958 2017-06-30 Jason Merrill <jason@redhat.com>
1960 PR c++/81257 - ICE with invalid ::template.
1961 PR c++/54769 - wrong lookup of dependent template-name.
1962 * parser.c (cp_parser_template_name): Revert part of last change.
1964 2017-06-30 Nathan Sidwell <nathan@acm.org>
1966 * config-lang.in (gtfiles): Add cp/lex.c.
1967 * cp-tree.h (mangle_convop_name_for_type): Rename ...
1968 (make_conv_op_name): ... here. Move to lex.
1969 * lambda.c (maybe_add_lambda_conv_op): Update.
1970 * parser.c (cp_parser_conversion_function_id): Update.
1971 * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
1972 tsubst_copy_and_build): Update.
1973 * semantics.c (apply_deduced_return_type): Update.
1974 * mangle.c (conv_type_hasher, conv_type_names,
1975 mangle_conv_op_name_for_type): Move to ...
1976 * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
1979 2017-06-30 David Malcolm <dmalcolm@redhat.com>
1982 * parser.c (cp_parser_postfix_expression): Construct a location
1983 for typeid expressions.
1985 2017-06-30 Nathan Sidwell <nathan@acm.org>
1987 * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
1989 (lookup_all_conversions): Declare.
1990 * class.c (get_basefndecls): Use lookup_fnfields_slot.
1991 * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
1992 * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
1994 * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
1995 (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
1996 lookup_all_conversions.
1997 * search.c (lookup_fnfields_1): Make static.
1998 (lookup_all_conversions): New.
1999 (class_method_index_for_fn): Delete.
2000 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
2001 lookup_fnfields_slot.
2003 * call.c (build_new_method_call_1): Use constructo_name to get
2004 ctor name. Move argument processing earlier to merge cdtor
2006 * decl.c (grokfndecl): Cdtors have special names.
2007 * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
2008 * pt.c (check_explicit_specialization): Cdtor name is already
2010 * search.c (class_method_index_for_fn): Likewise.
2013 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
2014 a matching TYPE_DECL.
2016 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
2018 * class.c (add_method): Change pair of errors to error + inform.
2019 (handle_using_decl): Likewise.
2021 2017-06-29 Jason Merrill <jason@redhat.com>
2023 * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
2025 PR c++/81180 - ICE with C++17 deduction of member class template.
2026 * pt.c (build_deduction_guide): Correct member template handling.
2028 PR c++/81188 - matching decltype of member function call.
2029 * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
2031 2017-06-29 Nathan Sidwell <nathan@acm.org>
2034 * parser.c (cp_parser_namespace_definition): Immediately close the
2035 namespace if there's no open-brace.
2036 * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
2039 2017-06-29 Jason Merrill <jason@redhat.com>
2041 PR c++/81164 - ICE with invalid inherited constructor.
2042 * search.c (binfo_direct_p): New.
2043 * name-lookup.c (do_class_using_decl): Use it.
2045 2017-06-29 Nathan Sidwell <nathan@acm.org>
2047 * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
2048 VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
2049 * decl.c (initialize_predefined_identifiers): Name cdtor special
2050 names consistently. Use literals for above deleted defines.
2051 (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
2053 * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
2056 * call.c (check_dtor_name): Use constructor_name for enums too.
2057 (build_new_method_call_1): Use constructor_name for cdtors and
2059 * class.c (build_self_reference): Use TYPE_NAME to get name of
2061 * name-lookup (constructor_name): Use DECL_NAME directly.
2062 (constructor_name_p): Reimplement.
2063 (push_class_level_binding_1): Use TYPE_NAME directly.
2065 * class.c (finish_struct): Use OVL_P.
2066 (get_vfield_name): Measure constructor_name length.
2067 * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
2068 (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
2069 * cxx-pretty-print.c (is_destructor_name): Delete.
2070 (pp_cxx_unqualified_id): Remove bogus destructor name checking.
2071 * decl.c (grokfndecl): Move cheap checks first when looking for
2072 implicit extern cness.
2074 * parser.c (cp_parser_direct_declarator): Reorder if to avoid
2075 indentation. Remove unnecessary assignment of constructor name.
2077 Whitespace cleanups.
2078 * call.c (name_as_c_string): Move CONST_CAST to return.
2079 (build_new_method_call_1): Remove unneeded bracing.
2080 * class.c (include_empty_classes): Unbreak line.
2081 * constraint.cc (tsubst_check_constraint): Add space.
2082 * cp-tree.h (lang_decl_ns): Add comment.
2083 (PTRMEM_CST_MEMBER): Break line.
2084 * decl.c (grokfndecl): Add blank lines. Unbreak some others.
2085 (grokdeclarator): Remove lines, move declaration to first use.
2086 * decl2.c (decl_needed_p): Fix indentation.
2087 (c_parse_final_cleanups): Remove blank line.
2088 * method.c (implicitly_declare_fn): Move declaration to first use.
2089 * search.c (current_scope): Add blank lines.
2091 2017-06-28 Jason Merrill <jason@redhat.com>
2093 PR c++/72764 - ICE with invalid template typename.
2094 * decl.c (build_typename_type): No longer static.
2095 * tree.c (strip_typedefs): Use it instead of make_typename_type.
2097 PR c++/69300 - ICE with self-referential noexcept
2098 * pt.c (maybe_instantiate_noexcept): Check for recursion.
2100 PR c++/61022 - error with variadic template template parm
2101 * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
2103 PR c++/72801 - ICE with variadic partial specialization
2104 * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
2106 PR c++/55639 - partial specialization with ::template
2107 * parser.c (cp_parser_class_head): Handle ::template.
2109 PR c++/45976 - error with ::template in declarator.
2110 * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
2112 PR c++/54769 - wrong lookup of dependent template-name.
2113 * parser.c (cp_parser_template_name): Handle dependent object type.
2114 (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
2116 (cp_parser_id_expression): Pass it.
2117 (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
2119 * parser.c (cp_parser_template_id): Use the range location on the
2122 PR c++/81204 - parse error with dependent template-name
2123 * parser.c (cp_parser_lookup_name): Disqualify function templates
2126 2017-06-27 Nathan Sidwell <nathan@acm.org>
2128 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
2129 initialization point. Don't unnecessarily check for ctor name.
2131 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
2132 (CLASSTYPE_DESTRUCTOR): ... this.
2133 * class.c (accessible_nvdtor_p,
2134 maybe_warn_about_overly_private_class,
2135 add_implicitly_declared_members,
2136 clone_constructors_and_destructors, type_has_virtual_destructor):
2137 Adjust for CLASSTYPE_DESTRUCTOR.
2138 (deduce_noexcept_on_destructors): Absorb into ...
2139 (check_bases_and_members): ... here.
2140 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
2141 * init.c (build_delete): Likewise.
2142 * parser.c (cp_parser_lookup_name): Likewise.
2143 * pt.c (check_explicit_specialization): Likewise.
2144 * rtti.c (emit_support_tinfos): Likewise.
2145 * search.c (lookup_fnfields_idx_nolazy): Likewise.
2147 Kill IDENTIFIER_TEMPLATE.
2148 * cp-tree.h (lang_identifier): Remove class_template_info field.
2149 (IDENTIFIER_TEMPLATE): Delete.
2150 * name-lookup.c (constructor_name_full): Subsume into ...
2151 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
2152 (constructor_name_p): Likewise.
2153 * mangle.c (write_source_name): Likewise.
2154 * ptree.c (cxx_print_identifier): Likewise.
2156 2017-06-27 Marek Polacek <polacek@redhat.com>
2159 * parser.c (cp_parser_already_scoped_statement): Initialize
2162 2017-06-26 Jason Merrill <jason@redhat.com>
2164 PR c++/81215 - deduction failure with variadic TTP.
2165 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
2167 2017-06-26 Martin Sebor <msebor@redhat.com>
2170 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
2171 to detect casting away cv-qualifiers.
2173 2017-06-26 Nathan Sidwell <nathan@acm.org>
2175 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
2176 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
2178 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
2179 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
2180 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
2181 * decl.c (grok_op_properties): Adjust identifier checking.
2182 * init.c (expand_default_init): Adjust identifier descision.
2183 * method.c (implicitly_declare_fn): Don't use
2184 DECL_ASSIGNMENT_OPERATOR_P.
2185 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
2187 * call.c (in_charge_arg_for_name): Reimplement.
2188 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
2191 2017-06-26 Marek Polacek <polacek@redhat.com>
2194 * parser.c (cp_parser_statement): Add a default argument. Save the
2195 location of the expression-statement after labels have been parsed.
2196 (cp_parser_implicitly_scoped_statement): Set the location of the
2197 body of the conditional after parsing all the labels. Call
2198 warn_for_multistatement_macros.
2199 (cp_parser_already_scoped_statement): Likewise.
2201 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
2204 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
2205 'typename' in error messages about missing 'typename'.
2207 2017-06-23 Jason Merrill <jason@redhat.com>
2209 PR c++/79056 - C++17 ICE with invalid template syntax.
2210 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
2212 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
2213 * pt.c (template_placeholder_p): New.
2214 * cp-tree.h: Declare it.
2216 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
2218 * decl.c (duplicate_decls): Use builtin_structptr_types.
2220 2017-06-22 Nathan Sidwell <nathan@acm.org>
2222 Reorder IDENTIFIER flags
2224 * cp-tree.h (enum cp_identifier_kind): New.
2225 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
2226 IDENTIFIER_KIND_BIT_2): New.
2227 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
2228 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
2229 (C_IS_RESERVED_WORD): Replace with ...
2230 (IDENTIFIER_KEYWORD_P): ... this.
2231 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
2232 (IDENTIFIER_CDTOR_P): ... this.
2233 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
2234 (IDENTIFIER_OPNAME_P): Replace with ...
2235 (IDENTIFIER_ANY_OP_P): ... this.
2236 (IDENTIFIER_ASSIGN_OP_P): New.
2237 (IDENTIFIER_TYPENAME_P): Replace with ...
2238 (IDENTIFIER_CONV_OP_P): ... this.
2239 (NEW_DELETE_OPNAME_P): Replace with ...
2240 (IDENTIFIER_NEWDEL_OP_P): ... this.
2241 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
2242 (get_identifier_kind_name, set_identifier_kind): Declare.
2243 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
2244 (init_operators): Adjust to avoid keywords, use
2245 set_identifier_kind. Copy TYPE_EXPR slot.
2246 (init_reswords): Call set_identifier_kind.
2247 (unqualified_name_lookup_error): Adjust.
2248 * operators.def (TYPE_EXPR): Remove.
2249 * decl.c (struct predefined_identifier): Move into ...
2250 (initialize_predefined_identifiers): ... here. Call
2251 set_identifier_kind.
2252 (grokfndecl, check_var_type, grokdeclarator): Adjust.
2253 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
2255 * call.c (name_as_c_string): Adjust.
2256 (build_new_method_call_1): Likewise.
2257 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
2258 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
2259 * dump.c (cp_dump_tree): Adjust.
2260 * error.c (dump_decl_name): Adjust.
2261 * mangle.c (write_unqualified_id, write_member_name,
2262 write_expression): Adjust.
2263 (mangle_conv_op_name_for_type): Use set_identifier_kind.
2264 * name-lookup.c (do_class_using_decl): Adjust.
2265 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
2266 * parser.c (cp_lexer_get_preprocessor_token,
2267 cp_parser_direct_declarator): Likewise.
2268 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
2269 tsubst_copy, tsubst_copy_and_build): Adjust.
2270 * ptree.c (cxx_print_identifier): Print identifier kind.
2271 * search.c (lookup_field_r, lookup_member,
2272 lookup_fnfields_idx_nolazy): Adjust.
2273 * semantics.c (finish_id_expression): Adjust..
2274 * typeck.c (cp_build_addr_expr_1): Adjust.
2276 2017-06-21 Jakub Jelinek <jakub@redhat.com>
2279 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
2280 Complain about t not being a variable if t is OVERLOAD even
2281 when processing_template_decl.
2283 2017-06-21 David Malcolm <dmalcolm@redhat.com>
2285 * parser.c (get_cast_suggestion): New function.
2286 (maybe_add_cast_fixit): New function.
2287 (cp_parser_cast_expression): Capture the location of the closing
2288 parenthesis. Call maybe_add_cast_fixit when emitting warnings
2289 about old-style casts.
2291 2017-06-20 Jason Merrill <jason@redhat.com>
2293 PR c++/80972 - C++17 ICE with attribute packed.
2294 * call.c (build_over_call): Allow a TARGET_EXPR from reference
2297 2017-06-20 Nathan Sidwell <nathan@acm.org>
2299 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
2300 (nelts_identifier): Delete.
2301 * decl.c (initialize_predefined_identifiers): Remove nelts.
2303 PR c++/67074 - namespace aliases
2304 * decl.c (duplicate_decls): Don't error here on mismatched
2306 * name-lookup.c (name_lookup::add_value): Matching namespaces are
2308 (diagnose_name_conflict): Namespaces are never redeclarations.
2309 (update_binding): An alias can match a real namespace.
2311 2017-06-19 Jason Merrill <jason@redhat.com>
2313 PR c++/80562 - ICE with constexpr if.
2314 * semantics.c (finish_if_stmt_cond): Call
2315 instantiate_non_dependent_expr.
2317 PR c++/80829 - ICE with constexpr copy of base subobject.
2318 * constexpr.c (clear_no_implicit_zero): New.
2319 (cxx_eval_call_expression): Call it.
2321 2017-06-19 Nathan Sidwell <nathan@acm.org>
2325 * name-lookup.c (set_decl_namespace): Don't follow using
2326 directives and ignore using decls. Only check overly-explicit
2327 scope after discovering decl.
2329 2017-06-19 Jason Merrill <jason@redhat.com>
2331 PR c++/81073 - constexpr and static var in statement-expression.
2332 * typeck2.c (store_init_value): Always call
2333 require_potential_constant_expression.
2334 * pt.c (convert_nontype_argument): Likewise.
2335 * constexpr.c (potential_constant_expression_1): Adjust message.
2336 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
2337 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
2339 2017-06-19 Nathan Sidwell <nathan@acm.org>
2341 * pt.c (coerce_template_parms): Fix indentation.
2342 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
2346 * name-lookup.c (update_binding): Only warn about constructors
2347 hidden by functions.
2349 2017-06-17 Jason Merrill <jason@redhat.com>
2351 PR c++/60063 - -Wunused-local-typedefs and templates.
2352 * decl2.c (is_late_template_attribute): Return false for "used".
2354 PR c++/70844 - -Wuseless-cast and inheriting constructor.
2355 * method.c (forward_parm): Suppress warn_useless_cast.
2357 2017-06-16 Jason Merrill <jason@redhat.com>
2359 PR c++/81045 - Wrong type-dependence with auto return type.
2360 * pt.c (type_dependent_expression_p): An undeduced auto outside the
2361 template isn't dependent.
2362 * call.c (build_over_call): Instantiate undeduced auto even in a
2365 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
2366 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
2367 set longer for a generic lambda.
2369 PR c++/80614 - Wrong mangling for C++17 noexcept type
2370 * mangle.c (write_type): Put the eh spec back on the function type.
2372 PR c++/81102 - Wrong error with partial specialization.
2373 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
2374 types. Do type deduction later.
2376 PR c++/81074 - ICE with partial specialization of member template.
2378 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
2380 PR c++/80831 - ICE with -fsyntax-only.
2381 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
2383 PR c++/80639 - ICE with invalid PMF initialization.
2384 PR c++/80043 - ICE with -fpermissive
2385 * typeck.c (convert_for_assignment): Recurse when instantiate_type
2386 returns without an error.
2388 2017-06-16 Nathan Sidwell <nathan@acm.org>
2390 * pt.c (tsubst_baselink): Fix & clarify formatting.
2392 * cp-tree.h (build_this_parm, cp_build_parm_decl,
2393 build_artificial_parm): Add FN parm.
2394 * decl.c (start_cleanup_fn): Adjust.
2395 (build_this_parm): Add FN parm, pass it through.
2396 (grokfndecl): Adjust parm building.
2397 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
2398 (build_artificial_parm): Add FN parm, pass through.
2399 (maybe_retrofit_in_chrg): Adjust parm building.
2400 (start_static_storage_duration_function): Likwise.
2401 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
2402 * method.c (implicitly_declare_fn): Likewise.
2403 * parser.c (inject_this_parameter): Likewise.
2405 Symbol tables are insert only.
2406 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
2407 derive from pointer_hash. Make undeletable.
2409 * class.c (resort_type_method_vec): Avoid potential unsigned
2412 Don't defer noexcept_deferred_spec.
2413 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
2414 * decl.c (cxx_init_decl_processing): Initialize
2415 noexcept_deferred_spec.
2416 * except.c (unevaluated_noexcept_spec): Delete.
2417 * class.c (deduce_noexcept_on_destructor): Use
2418 noexcept_deferred_spec directly.
2419 * method.c (implicitly_declare_fn): Likewise.
2421 Make keyed_classes a vector.
2422 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
2423 (keyed_classes): Declare as vector.
2424 * decl.c (keyed_classes): Define.
2425 (cxx_init_decl_processing): Allocate it.
2426 (record_key_method_defined): Use vec_safe_push.
2427 * class.c (finish_struct_1): Likewise.
2428 * pt.c (instantiate_class_template_1): Likewise.
2429 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
2432 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
2433 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
2435 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
2436 (get_tinfo_decl): Use get_tinfo_desc.
2437 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
2438 (create_pseudo_type_info): Delete.
2439 (get_pseudo_ti_index): Just determine the index.
2440 (get_tinfo_desc): New. Create all types lazily.
2441 (create_tinfo_types): Just allocate the descriptor array.
2442 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
2445 2017-06-15 Martin Sebor <msebor@redhat.com>
2448 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
2450 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
2451 (build_cxx_call): Call maybe_warn_class_memaccess.
2453 2017-06-14 Jakub Jelinek <jakub@redhat.com>
2455 * cp-gimplify.c (cp_genericize_r): Turn most of the function
2456 into a switch (TREE_CODE (stmt)) statement from long else if
2459 2017-06-13 Jakub Jelinek <jakub@redhat.com>
2462 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
2463 argument even if it has REFERENCE_TYPE.
2466 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
2467 BLOCK_VARS (outer) chain.
2468 (cxx_omp_const_qual_no_mutable): Likewise.
2470 2017-06-13 Martin Liska <mliska@suse.cz>
2473 * class.c (build_base_path): Use sanitize_flags_p.
2474 * cp-gimplify.c (cp_genericize_r): Likewise.
2475 (cp_genericize_tree): Likewise.
2476 (cp_genericize): Likewise.
2477 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2478 * decl.c (compute_array_index_type): Likewise.
2479 (start_preparsed_function): Likewise.
2480 * decl2.c (one_static_initialization_or_destruction): Likewise.
2481 * init.c (finish_length_check): Likewise.
2482 * lambda.c (maybe_add_lambda_conv_op): Likewise.
2483 * typeck.c (cp_build_binary_op): Likewise.
2484 (build_static_cast_1): Likewise.
2486 2017-06-11 Jason Merrill <jason@redhat.com>
2488 * error.c (dump_expr): Use is_this_parameter.
2490 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
2493 2017-06-09 Jason Merrill <jason@redhat.com>
2495 Missing bits from N4268, constant evaluation for all non-type args.
2496 * call.c (build_converted_constant_expr): Rename from
2497 build_integral_nontype_arg_conv, handle all types.
2498 * pt.c (convert_nontype_argument): In C++17 call it for all types.
2499 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
2500 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
2502 Overhaul pointer-to-member conversion and template argument handling.
2503 * call.c (standard_conversion): Avoid creating ck_pmem when the
2504 class type is the same.
2505 * cvt.c (can_convert_qual): Split from
2506 perform_qualification_conversions.
2507 * constexpr.c (cxx_eval_constant_expression): Check it.
2508 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
2509 adjustment is necessary.
2510 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
2511 (convert_nontype_argument): Avoid redundant error.
2513 * call.c (convert_like_real): Remove "inner" parameter.
2514 Don't replace a constant with its value.
2515 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
2517 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
2520 * parser.c (cp_parser_constant_expression): Check
2521 potential_rvalue_constant_expression after decay_conversion.
2522 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
2524 PR c++/80384 - ICE with dependent noexcept-specifier
2525 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
2528 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
2530 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
2532 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
2533 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
2534 (excpet.c): Mark terminate as cold.
2536 2017-06-08 Jakub Jelinek <jakub@redhat.com>
2539 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
2540 to sizetype before size_binop.
2543 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
2544 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
2545 and OMP_CLAUSE_SHARED_READONLY flags.
2547 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
2549 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
2551 2017-06-07 Nathan Sidwell <nathan@acm.org>
2553 * class.c (layout_class_type): Restructure overlong-bitfield tpe
2556 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
2559 * pt.c (do_class_deduction): Build qualified type.
2561 2017-06-06 Nathan Sidwell <nathan@acm.org>
2563 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
2564 sans using directives. Don't walk into inline namespaces.
2567 * name-lookup.c (adl_class_only): Don't add visible friends.
2569 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
2571 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
2573 2017-06-02 Nathan Sidwell <nathan@acm.org>
2575 Remove lang_type_ptrmem.
2576 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
2578 (lang_type_class): ... this. Reorder bitfields. Rename to ...
2579 (lang_type): ... this. Delete old definition.
2580 (lang_type_ptrmem): Delete.
2581 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
2582 (LANG_TYPE_PTRMEM_CHECK): Delete.
2583 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
2584 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
2585 * decl.c (build_ptrmemfunc_type): Adjust.
2586 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
2587 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
2589 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
2592 Remove cp_binding_level::namespaces
2593 * name-lookup.h (cp_binding_level): Lose namespaces field.
2594 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
2596 (suggest_alternatives_for): Adjust for namespace list. Do
2597 breadth-first search.
2598 * decl2.c (collect_source_refs): Namespaces are on the regulr
2600 (collect_ada_namespace): Likewise.
2602 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
2604 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
2607 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
2610 * method.c (constructible_expr): Strip array types before calling
2613 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
2616 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
2617 for case INDIRECT_REF too in the main switch.
2619 2017-05-31 Jason Merrill <jason@redhat.com>
2621 PR c++/80840 - ICE with constexpr and reference
2622 * pt.c (convert_nontype_argument): Don't test whether a decl is
2623 value-dependent when binding to a reference.
2625 2017-05-31 Nathan Sidwell <nathan@acm.org>
2627 * cp-tree.h (lang_decl_slector): New enum.
2628 (lang_decl_base): Make selector an enum. Drop decomposition_p
2630 (lang_decl): Use enum for discrimination.
2631 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
2632 LANG_DECL_DEOMP_CHECK): Use enum.
2633 (DECL_DECOMPOSITION_P): Use selector value.
2634 (SET_DECL_DECOMPOSITION_P): Delete.
2635 (retrofit_lang_decl): Lose SEL parm.
2636 (fit_decomposition_lang_decl): Declare.
2637 * decl.c (cp_finish_decomp, grokdeclarator): Use
2638 fit_decomposition_lang_decl.
2639 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
2641 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
2642 (fit_decomposition_lang_decl): Likewise.
2643 (retrofit_lang_decl): Use worker functions.
2644 (cxx_dup_lang_specific_decl): Use selector enum.
2645 (maybe_add_lang_type_raw): New. Broken out of ...
2646 (cxx_make_type_name): ... here. Call it.
2648 2017-05-30 Jason Merrill <jason@redhat.com>
2650 PR c++/80856 - ICE with local extern in template
2651 * semantics.c (finish_call_expr): Replace a local extern overload
2652 set in a template with the IDENTIFIER_NODE.
2654 2017-05-30 David Malcolm <dmalcolm@redhat.com>
2656 * call.c (perform_implicit_conversion_flags): Convert
2657 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
2658 (print_conversion_rejection): Replace pairs of %qT with
2659 %qH and %qI in various places.
2660 (build_user_type_conversion_1): Likewise.
2661 (build_integral_nontype_arg_conv): Likewise.
2662 (build_conditional_expr_1): Likewise.
2663 (convert_like_real): Likewise.
2664 (convert_arg_to_ellipsis): Likewise.
2666 (initialize_reference): Likewise.
2667 * cvt.c (cp_convert_to_pointer): Likewise.
2668 (cp_convert_to_pointer): Likewise.
2669 (convert_to_reference): Likewise.
2670 (ocp_convert): Likewise.
2671 * error.c (cp_printer): Gain bool and const char ** parameters.
2672 (struct deferred_printed_type): New struct.
2673 (class cxx_format_postprocessor): New class.
2674 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
2675 to pp->m_format_postprocessor.
2676 (comparable_template_types_p): New function.
2677 (newline_and_indent): New function.
2678 (arg_to_string): New function.
2679 (print_nonequal_arg): New function.
2680 (print_template_differences): New function.
2681 (type_to_string_with_compare): New function.
2682 (print_template_tree_comparison): New function.
2683 (append_formatted_chunk): New function.
2684 (add_quotes): New function.
2685 (cxx_format_postprocessor::handle): New function.
2686 (defer_phase_2_of_type_diff): New function.
2687 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
2689 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
2690 %qH and %qI in various places.
2691 (convert_member_func_to_ptr): Likewise.
2692 (build_reinterpret_cast_1): Likewise.
2693 (convert_for_assignment): Likewise.
2694 * typeck2.c (check_narrowing): Likewise.
2696 2017-05-30 Nathan Sidwell <nathan@acm.org>
2698 Kill IDENTIFIER_NAMESPACE_BINDINGS
2699 * cp-tree.h (lang_identifier): Delete namespace_bindings.
2700 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
2701 (lang_decl_ns): Add bindings.
2702 (DECL_NAMESPACE_BINDINGS): New.
2703 * lex.c (retrofit_lang_decl): Create namespace hash table.
2704 * name-lookup.c (find_namespace_slot): Change to use hash-map.
2705 * ptree.c (cxx_print_binding): Delete.
2706 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
2708 * cp-tree.def (OVERLOAD): Fix comment.
2709 * cp-tree.h: Fix comments and whitespace.
2710 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
2711 * name-lookup.c (add_decl_to_level): Assert not class.
2712 (check_local_shadow): Use OVL_P.
2713 (pushdecl_with_scope_1): Rename to ...
2714 (do_pushdecl_with_Scope): ... here.
2715 (do_nonmember_using_decl): Use qualified_namespace_lookup return
2717 (push_class_level_binding_1): Use OVL_P.
2718 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
2719 (pushtag_1): Rename to ...
2720 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
2722 (store_class_bindings): Do not time here.
2723 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
2724 * pt.c (listify): Declare argvec at point of initialization.
2727 * name-lookup.c (add_decl_to_level): Assert not making a circular
2729 (update_binding): Don't prematurely slide artificial decl.
2731 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
2733 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
2735 2017-05-29 Nathan Sidwell <nathan@acm.org>
2737 PR c++/80891 (#1,#5)
2738 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
2739 * name-lookup.c (name_lookup): Add deduping field.
2740 (name_lookup::preserve_state, name_lookup::restore_state): Deal
2742 (name_lookup::add_overload): New.
2743 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
2744 (name_lookup::search_adl): Set deduping. Don't unmark here.
2745 * pt.c (most_specialized_instantiation): Revert previous change,
2746 Assert not given duplicates.
2747 * tree.c (lookup_mark): Just mark the underlying decls.
2748 (lookup_maybe_add): Dedup using marked decls.
2751 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
2752 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
2754 Stat hack representation
2755 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
2756 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
2758 (find_namespace_binding): Replace with ...
2759 (find_namespace_slot): ... this.
2760 (find_namespace_value): New.
2761 (name_lookup::search_namespace_only,
2762 name_lookup::adl_namespace_only): Adjust.
2763 (update_binding): Add SLOT parameter, adjust.
2764 (check_local_shadow): Use find_namespace_value.
2765 (set_local_extern_decl_linkage): Likewise.
2766 (do_pushdecl): Adjust for namespace slot.
2767 (push_local_binding): Assert not a namespace binding.
2768 (check_for_out_of_scope_variable): Use find_namespace_value.
2769 (set_identifier_type_value_with_scope): Likewise.
2770 (get_namespace_binding): Likewise.
2771 (set_namespace_binding): Delete.
2772 (set_global_binding): Directly update the binding.
2773 (finish_namespace_using_decl): Likewise.
2774 (lookup_type_scope_1): Use find_namespace_slot and update.
2775 (do_push_nested_namespace): Use find_namespace_value.
2778 * pt.c (most_specialized_instantiation): Cope with duplicate
2782 * cp-tree.h (build_min_nt_call_vec): Declare.
2783 * decl.c (build_offset_ref_call_from_tree): Call it.
2784 * parser.c (cp_parser_postfix_expression): Likewise.
2785 * pt.c (tsubst_copy_and_build): Likewise.
2786 * semantics.c (finish_call_expr): Likewise.
2787 * tree.c (build_min_nt_loc): Keep unresolved lookups.
2788 (build_min): Likewise.
2789 (build_min_non_dep): Likewise.
2790 (build_min_non_dep_call_vec): Likewise.
2791 (build_min_nt_call_vec): New.
2794 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
2796 (lookup_keep): Call it.
2798 2017-05-26 Nathan Sidwell <nathan@acm.org>
2801 * name-lookup.c (push_inline_namespaces): New.
2802 (push_namespace): Look inside inline namespaces.
2804 Inline and using namespace representation change.
2805 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
2807 (DECL_NAMESPACE_USING): Adjust.
2808 (DECL_NAMESPACE_INLINEES): New.
2809 * name-lookup.h (struct cp_binding_level): Change usings
2811 * name-lookup.c (name_lookup::do_queue_usings,
2812 name_lookup::queue_usings): Adjust.
2813 (name_lookup::search_namespace, name_lookup::search_usings,
2814 name_lookup::queue_namespace): Adjust.
2815 (name_lookup::adl_namespace_only): Adjust.
2816 (add_using_namespace, push_namespace): Push onto vector.
2817 (pop_namespace): Add timing logic.
2819 * call.c (build_operator_new_call): Do namelookup and ADL here.
2820 (build_new_op_1): Likewise.
2821 * name-lookup.h (lookup_function_nonclass): Delete declaration.
2822 (do_using_directive): Likewise.
2823 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
2825 (struct scope_binding): Delete.
2826 (EMPTY_SCOPE_BINDING): Delete.
2827 (set_decl_namespace): Use OVL_P.
2828 (finish_local_using_decl): Lose unnecesary checks.
2829 (lookup_function_nonclass): Delete.
2830 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
2832 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
2833 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
2835 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
2836 (lkp_iterator): Add outer field. Adjust ctor.
2837 (lkp_iterator::operator++): New.
2838 (lookup_mark, lookup_maybe_add): Declare.
2839 * name-lookup.c (name_lookup): Delete fn_set member.
2840 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
2842 (name_lookup::add_value): Use lookup_add directly.
2843 (name_lookup::add_fns: Use lookup_maybe_add.
2844 (name_lookup::search_adl): Mark and unmark fns.
2846 * pt.c (check_explicit_specialization): Use lookup_add directly.
2847 * ptree.c (cxx_print_xnode): Show complete overload structure.
2848 * tree.c (lookup_mark, lookup_maybe_add): New.
2850 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
2852 2017-05-26 Jakub Jelinek <jakub@redhat.com>
2854 * cp-tree.h (struct lang_decl_decomp): New type.
2855 (struct lang_decl): Add u.decomp.
2856 (LANG_DECL_DECOMP_CHECK): Define.
2857 (DECL_DECOMPOSITION_P): Note it is set also on the vars
2858 for user identifiers.
2859 (DECL_DECOMP_BASE): Define.
2860 (retrofit_lang_decl): Add extra int = 0 argument.
2861 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
2862 use it to influence the selector choices and for selector
2863 0 to non-zero transition copy old content.
2864 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
2865 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
2866 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
2867 wording if decl is a structured binding.
2868 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
2869 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
2870 of individual variables for tuple structured bindings.
2871 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
2872 Clear DECL_DECOMP_BASE.
2873 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
2874 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
2876 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
2879 2017-05-25 Jason Merrill <jason@redhat.com>
2881 PR c++/80605 - __is_standard_layout and zero-length array
2882 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
2884 2017-05-25 Nathan Sidwell <nathan@acm.org>
2886 Kill OVL_CURRENT, OVL_NEXT.
2887 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
2888 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
2889 (consider_binding_level): Use OVL_FIRST.
2890 (cp_emit_debug_info_for_using): Use lkp_iterator.
2891 * pt.c (check_explicit_specialization): Use ovl_iterator.
2893 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
2894 * cp-tree.h (lang_decl_ns): Remove ns_users field.
2895 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
2896 (TREE_INDIRECT_USING): Delete.
2897 * name-lookup.h (is_associated_namespace): Delete.
2898 * name-lookup.c (name_lookup::search_usings,
2899 name_lookup::do_queue_usings): Usings are always direct.
2900 (is_associated_namespace): Delete.
2901 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
2902 (namespace_ancestor_1, namespace_ancestor): Delete.
2903 (push_using_directive_1, push_using_directive): Delete.
2904 (add_using_namespace_1): Delete.
2905 (add_using_namespace): Reimplement.
2906 (emit_debug_info_using_namespace): New.
2907 (finish_namespace_using_directive, finish_local_using_directive,
2908 push_namespace): Adjust.
2909 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
2911 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
2913 * semantics.c (finish_handler_parms): Warn about non-reference type
2916 2017-05-25 Nathan Sidwell <nathan@acm.org>
2918 Reimplement unqualified namespace lookup.
2919 * name-lookup.c (name_lookup::using_pair,
2920 name_lookup::using_queue): New typedefs.
2921 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
2922 name_lookup::queue_usings): New.
2923 (name_lookup::search_unqualified): New.
2924 (merge_functions, same_entity_p, ambiguous_decl,
2925 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
2926 lookup_using_namespace): Delete.
2927 (lookup_name_real_1): Adjust.
2929 Reimplement qualified namespace lookup.
2930 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
2931 (name_lookup::ambiguous, name_lookup::add_value,
2932 name_lookup::add_type, name_lookup::process_binding): New.
2933 (name_lookup::search_namespace_only,
2934 name_lookup::search_namespace, name_lookup::search_usings): New.
2935 (name_lookup::search_qualified): New.
2936 (do_nonmember_using_decl, suggest_alternatives_for,
2937 lookup_qualified_name): Adjust.
2938 (tree_vec_contains): Delete.
2939 (qualified_lookup_using_namespace): Rename to ...
2940 (qualified_namespace_lookup): ... here. Reimplement.
2943 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
2944 * name-lookup.h (lookup_arg_dependent): Return plain tree.
2945 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
2946 arg_assoc_args_vec, arg_assoc_type, add_function,
2947 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
2948 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
2949 lookup_arg_dependent_1): Delete.
2950 (name_lookup): New lookup object.
2951 (name_lookup::preserve_state, name_lookup::restore_state,
2952 name_lookup::mark_seen, name_lookup::find_and_mark,
2953 name_lookup::add_fns, name_lookup::adl_namespace_only,
2954 name_lookup::adl_namespace, name_lookup::adl_class_only,
2955 name_lookup::adl_bases, name_lookup::adl_class,
2956 name_lookup::adl_expr, name_lookup::adl_type,
2957 name_lookup::adl_template_arg, name_lookup::search_adl): New.
2958 (lookup_arg_dependent): Return a plain tree. Adjust.
2959 (is_associated_namespace): Move later.
2961 2017-05-24 Nathan Sidwell <nathan@acm.org>
2963 * friend.c (do_friend): Remove check for existing decl.
2964 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
2965 * name-lookup.c (push_local_binding): Directly look for binding.
2966 (lookup_name_innermost_nonclass_level_1): Delete.
2967 (lookup_name_innermost_nonclass_level): Delete.
2969 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
2971 * cp-tree.h (cp_free_lang_data): Add extern.
2972 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
2974 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
2975 * typeck.c (type_unknown_p): Delete.
2976 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
2977 overload management.
2978 (dependent_name): Likewise.
2979 (decl_anon_ns_mem_p): Simplify.
2981 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
2984 * tree.c (reshape_init): Use unqualified type for direct enum init.
2985 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
2986 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
2987 non-class destination types.
2988 (build_const_cast_1): Strip cv-quals from destination types.
2989 (build_static_cast, build_reinterpret_cast, build_const_cast)
2990 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
2992 2017-05-24 Martin Sebor <msebor@redhat.com>
2995 * call.c (fully_fold_internal): Adjust.
2997 2017-05-24 Nathan Sidwell <nathan@acm.org>
2999 * cp-tree.h (ovl_skip_hidden): Declare.
3000 * tree.c (ovl_skip_hidden): New.
3001 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
3002 (lookup_arg_dependent_1): Likewise.
3003 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
3004 (hidden_name_p, remove_hidden_names): Delete.
3005 (lookup_name_real_1): Do not strip hidden names.
3006 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
3008 * cp-tree.h (OVL_HIDDEN_P): New.
3009 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
3010 (ovl_iterator::reveal_node): Declare.
3011 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
3012 (ovl_insert): Order on hiddenness.
3013 (ovl_iterator::reveal_node): New.
3014 * name-lookup.c (anticipated_builtin_p): New.
3015 (supplement_binding_1): Use it.
3016 (set_local_extern_decl_linkage): Use hidden_p.
3017 (do_pushdecl): Deal with unhiding a hidden decl, use
3018 anticipated_builtin_p.
3019 (do_nonmember_using_decl): Use anticipated_decl_p.
3020 (lookup_name_real_1): Use DECL_HIDDEN_P.
3022 2017-05-23 Jason Merrill <jason@redhat.com>
3024 -Wunused and C++17 structured bindings
3025 * decl.c (poplevel): Don't warn about unused structured bindings,
3026 only real variables.
3027 * error.c (dump_simple_decl): Handle structured bindings.
3028 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
3030 2017-05-23 Nathan Sidwell <nathan@acm.org>
3032 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
3033 * name-lookup.c (create_local_binding): New.
3034 (update_binding): New.
3035 (pushdecl_maybe_friend_1): Rename to ...
3036 (do_pushdecl): ... this. Reimplement.
3038 (push_overloaded_decl_1, push_overloaded_decl): Delete.
3040 2017-05-23 Jason Merrill <jason@redhat.com>
3042 PR c++/80396 - built-in for make_integer_sequence.
3043 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
3044 (expand_integer_pack, expand_builtin_pack_call): New.
3045 (find_parameter_packs_r): Check builtin_pack_call_p.
3046 (check_for_bare_parameter_packs): Handle it.
3047 (tsubst_pack_expansion): Call expand_builtin_pack_call.
3048 (declare_integer_pack): New.
3049 (init_template_processing): Call it.
3050 * decl2.c (mark_used): Check builtin_pack_fn_p.
3052 2017-05-23 Nathan Sidwell <nathan@acm.org>
3054 * name-lookup.c (find_namespace_binding): New.
3055 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
3056 (set_identifier_type_value_with_scope): Use find_namespace_binding.
3057 (find_binding, cp_binding_level_find_binding_for_name,
3058 binding_for_name, namespace_binding_1): Delete.
3059 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
3060 (get_namespace_binding, set_namespace_binding,
3061 finish_namespace_using_decl, unqualified_namespace_lookup_1,
3062 qualified_lookup_using_namespace, lookup_type_scope_1,
3063 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
3066 * parser.c (cp_parser_template_id): Keep the lookup when stashing
3069 * cp-tree.h (DECL_HIDDEN_P): New.
3070 * name-lookup.c (set_decl_context,
3071 set_local_extern_decl_linkage): New, broken out of ...
3072 (pushdecl_maybe_friend_1): ... here. Call them.
3074 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
3076 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
3077 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
3080 2017-05-23 Nathan Sidwell <nathan@acm.org>
3082 * cp-tree.h (OVL_P): New.
3083 * name-lookup.h (push_local_binding): Delete.
3084 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3085 (finish_namespace_using_decl, finish_local_using_decl): ... here
3086 * name-lookup.c (add_decl_to_level): Swap args.
3087 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
3088 (diagnose_name_conflict): Check contexts are same for redecl.
3089 (update_local_overload): New.
3090 (compparms_for_decl_and_using): Rename to ...
3091 (matching_fn_p): ... here.
3092 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
3093 push_local_bindings call.
3094 (push_local_binding): Make static, replace FLAGS arg with
3096 (validate_nonmember_using_decl): Use OVL_FIRST.
3097 (do_nonmember_using_decl): Use in/out parameters. Use
3098 lkp_iterator and simplify.
3099 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3100 (finish_namespace_using_decl, finish_local_using_decl): ... here.
3102 (lookup_type_current_level): Delete.
3103 * parser.c (cp_parser_using_declaration): Adjust.
3104 * pt.c (tsubst_expr): Adjust.
3106 2017-05-22 Nathan Sidwell <nathan@acm.org>
3108 * name-lookup.h (parse_using_directive): Replace with ...
3109 (finish_namespace_using_directive): ... this and ...
3110 (finish_local_using_directive): ... this.
3111 * name-lookup.c (add_using_namespace_1): Move later.
3112 (add_using_namespace): Move later, add namespace_p arg, remove
3114 (push_using_directive_1): Directly recurse.
3115 (do_using_directive, parse_using_directive): Delete, split into ...
3116 (finish_namespace_using_directive): ... this and ...
3117 (finish_local_using_directive): ... this.
3118 (push_namespace): Use add_using_namespace.
3119 * parser.c (cp_parser_using_directive): Call
3120 finish_namespace_using_directive or finish_local_using_directive.
3121 * pt.c (tsubst_expr): Call finish_local_using_directive.
3123 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
3124 * cp-tree.h (raw_dump_id): Declare.
3125 * decl2.c (raw_dump_id): Define.
3126 (dump_tu): Use raw_dump_id.
3128 * config-lang.in (gtfiles): Sort list, break lines.
3130 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
3131 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
3132 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
3133 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
3134 CPTI_RETHROW_FN): New.
3135 (noexcept_deferred_spec): New.
3136 (terminate_node, call_unexpected_node): Rename to ...
3137 (terminate_fn, call_unexpected_fn): ... here.
3138 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
3139 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
3140 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
3141 (init_exception_processing): Adjust.
3142 (declare_library_fn): Create and push the fns here.
3143 (do_get_exception_ptr, do_begin_catch, do_end_catch,
3144 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
3145 declare_library_fn use.
3146 (unevaluated_noexcept_spec): Adjust.
3147 * cp-gimplify.c (genericize_eh_spec_block,
3148 gimplify_most_not_throw_expr): Adjust.
3150 * name-lookup.c (pushdecl_top_level,
3151 pushdecl_top_level_and_finish): Move after namespace pushing and
3153 (push_to_top_level): Rename to ...
3154 (do_push_to_top_level): ... here. Remove timing code.
3155 (pop_from_top_level_1): Rename to ...
3156 (do_pop_from_top_level): ... here.
3157 (do_push_nested_namespace, do_pop_nested_namespace)
3158 (push_to_top_level): New wrapper for do_push_to_top_level.
3159 (pop_from_top_level): Adjust.
3160 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
3162 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
3164 * config-lang.in (gtfiles): Add c-family/c-format.c,
3165 except.c, init.c, lambda.c and friend.c.
3166 * class.c (dvirt_fn): Move out of function scope,
3168 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
3169 * init.c (fn): Likewise.
3170 * lambda.c (ptr_id, max_id): Likewise.
3171 * friend.c (global_friend): Add GTY attribute.
3173 2017-05-19 Nathan Sidwell <nathan@acm.org>
3175 * call.c (add_list_candidates): Use OVL_FIRST.
3176 (build_new_method_call_1): Likewise.
3177 * cp-tree.h (OVL_SINGLE_P): New.
3178 (TYPE_HIDDEN_P): New.
3179 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
3180 * dump.c (cp_tump_tree): Adjust overload dumping.
3181 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
3183 * method.c (lazily_declare_fn): Assert we added it.
3184 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
3186 (cp_parser_template_name): Use lkp_iterator.
3187 * pt.c (begin_template_parm_list): Fixup comment.
3188 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
3189 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
3190 (ovl_scope): Use lkp_iterator.
3192 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
3194 * parser.c (cp_parser_omp_clause_default): Handle
3195 "OMP_CLAUSE_DEFAULT_PRESENT".
3197 * parser.c (cp_parser_omp_clause_default): Avoid printing more
3198 than one syntax error message.
3200 2017-05-19 Nathan Sidwell <nathan@acm.org>
3202 * class.c (class_dump_id): Define.
3203 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
3204 * cp-objcp-common.c (cp_register_dumps): New.
3205 * cp-objcp-common.h (cp_register_dumps): Declare.
3206 (LANG_HOOKS_REGISTER_DUMPS): Override.
3207 * cp-tree.h (class_dump_id): Declare.
3209 2017-05-18 Nathan Sidwell <nathan@acm.org>
3211 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
3213 (lookup_keep): Declare.
3214 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
3215 * pt.c (tsubst_copy): Assert lookup is persistent.
3216 * semantics.c (finish_call_expr): Use lkp_iterator, call
3218 * tree.c (ovl_copy): New.
3219 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
3222 * cp-tree.h (OVL_USED): Replace with ...
3223 (OVL_USING_P): ... this.
3224 (ovl_iterator::using_p): Adjust.
3225 * name-lookup.c (push_overloaded_decl_1,
3226 do_nonmember_using_decl): Adjust.
3227 * search.c (lookup_field_r): Adjust.
3228 * tree.c (ovl_insert, ovl_scope): Adjust.
3230 * cp-tree.h (lookup_add): Swap args.
3231 (ovl_cons, build_overload): Delete.
3232 * name-lookup.c (add_function, push_overloaded_decl_1,
3233 do_nonmember_using_decl, merge_functions, remove_hidden_names):
3234 Use lookup_add, ovl_insert.
3235 * pt.c (check_explicit_specialization): Use lookup_add.
3236 (do_class_deduction): Likewise. Refactor if.
3237 * tree.c (lookup_add): Swap args.
3238 (ovl_cons, build_overload): Delete.
3240 * name-lookup.c (find_local_binding): New, broken out of ...
3241 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
3242 (set_namespace_binding): Swap scope & name args.
3243 (namespace_binding_1): Likewise.
3244 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
3245 (push_overloaded_decl_1): Likewise.
3246 (set_global_binding): Likewise.
3247 (get_namespace_binding): Adjust namespace_binding_1 call.
3249 2017-05-17 Nathan Sidwell <nathan@acm.org>
3251 * cp-tree.h (default_hash_traits <lang_identifier *>): New
3253 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
3254 (extern_c_fns): New hash table.
3255 (check_extern_c_conflict): New, broken out of ...
3256 (pushdecl_maybe_friend_1): ... here. Call it.
3257 (c_linkage_bindings): Just look in hash table.
3259 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
3263 Implement new C++ intrinsics __is_assignable and __is_constructible.
3264 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
3266 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3267 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3268 * method.c (constructible_expr): Set cp_unevaluated.
3269 (is_xible_helper): New.
3270 (is_trivially_xible): Adjust.
3272 * parser.c (cp_parser_primary_expression): Handle
3273 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
3274 (cp_parser_trait_expr): Likewise.
3275 * semantics.c (trait_expr_value): Handle
3276 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3278 2017-05-17 Nathan Sidwell <nathan@acm.org>
3280 * cp-tree.h (ovl_iterator::using_p): New predicate.
3281 (ovl_iterator::remove_node): New worker.
3282 (ovl_insert): Declare.
3283 * tree.c (ovl_insert): New.
3284 (ovl_iterator::remove_node): New.
3285 * class.c (add_method): Use ovl_iterator, ovl_insert.
3286 (clone_function_decl): Fix description.
3287 (clone_constructors_and_destructors): Use ovl_iterator.
3289 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
3290 (maybe_warn_about_overly_private_class): Use ovl_iterator.
3291 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
3292 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
3293 (get_base_fndecls): Use ovl_iterator.
3294 (warn_hidden): Use OVL_NAME, ovl_iterator.
3295 (add_implicitly_declared_members): Use ovl_iterator.
3296 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
3298 (finish_shorthand_constraint): Simplify, use ovl_make.
3299 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
3300 * search.c (shared_member_p): Use ovl_iterator.
3301 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
3302 (lookup_conversion_operator): Use OVL_FIRST.
3303 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
3304 (look_for_overrides_here): Use ovl_iterator.
3305 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
3306 * typeck.c (build_x_unary_op): Use ovl_make.
3308 2017-05-17 Martin Liska <mliska@suse.cz>
3310 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
3311 use it instead of int type.
3312 (dump_vtable): Likewise.
3313 (dump_vtt): Likewise.
3314 * decl2.c (dump_tu): Likewise.
3316 2017-05-16 David Malcolm <dmalcolm@redhat.com>
3318 * call.c (enforce_access): Add access_failure_info * param and use
3319 it to record access failures.
3320 * cp-tree.h (class access_failure_info): New class.
3321 (enforce_access): Add access_failure_info * param, defaulting to
3323 (lookup_member): Likewise.
3324 (locate_field_accessor): New function decl.
3325 (perform_or_defer_access_check): Add access_failure_info * param,
3327 * search.c (lookup_member): Add access_failure_info * param and
3328 pass it on to call to perform_or_defer_access_check.
3329 (matches_code_and_type_p): New function.
3330 (field_access_p): New function.
3331 (direct_accessor_p): New function.
3332 (reference_accessor_p): New function.
3333 (field_accessor_p): New function.
3334 (struct locate_field_data): New struct.
3335 (dfs_locate_field_accessor_pre): New function.
3336 (locate_field_accessor): New function.
3337 * semantics.c (perform_or_defer_access_check): Add
3338 access_failure_info * param, and pass it on to call to
3340 * typeck.c (access_failure_info::record_access_failure): New method.
3341 (access_failure_info::maybe_suggest_accessor): New method.
3342 (finish_class_member_access_expr): Pass an access_failure_info
3343 instance to the lookup_member call, and call its
3344 maybe_suggest_accessor method afterwards.
3346 2017-05-16 Marek Polacek <polacek@redhat.com>
3350 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
3352 2017-05-16 Nathan Sidwell <nathan@acm.org>
3354 * name-lookup.c (check_local_shadow): New, broke out of ...
3355 (pushdecl_maybe_friend_1): ... here. Call it.
3357 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
3358 (ovl_first): Move inline definition to end of file.
3359 (ovl_make, lookup_add): Declare.
3360 (get_fns, get_first_fn): Make pure.
3361 * tree.c (ovl_cache): New.
3362 (ovl_make, lookup_add): New.
3363 * pt.c (do_class_deduction): Don't add candidates that will be
3366 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
3367 (print_error_for_call_failure): Use OVL_NAME.
3368 (build_op_call_1): Use ovl_iterator.
3369 (add_candidates): Use OVL_FIRST & lkp_iterator.
3370 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
3372 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
3373 (type_has_user_nondefault_constructor,
3374 in_class_defaulted_default_constructor,
3375 type_has_user_provided_constructor,
3376 type_has_user_provided_or_explicit_constructor,
3377 type_has_non_user_provided_default_constructor,
3378 vbase_has_user_provided_move_assign,
3379 type_has_move_constructor, type_has_move_assign,
3380 type_has_user_declared_move_constructor,
3381 type_has_user_declared_move_assign,
3382 type_build_ctor_call, type_build_dtor_call,
3383 type_requires_array_cookie, explain_non_literal_class): Likewise.
3384 (finish_struct): Use lkp_iterator.
3385 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
3386 (note_name_declared_in_class): Use OVL_NAME.
3387 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
3388 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
3389 cxx_pretty_printer::expression): Likewise.
3390 * decl2.c (check_classfn): Use ovl_iterator.
3391 * pt.c (retrieve_specialization): Use ovl_iterator.
3392 * tree.c (cp_tree_equal): Use lkp_iterator.
3393 (type_has_nontrivial_copy_init): Use ovl_iterator.
3395 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
3396 check is_overloaded_fn.
3398 2017-05-16 Martin Liska <mliska@suse.cz>
3400 * parser.c (cp_lexer_print_token): Add default value for flags
3401 argument of print_gimple_stmt, print_gimple_expr,
3402 print_generic_stmt and print_generic_expr.
3404 2017-05-16 Nathan Sidwell <nathan@acm.org>
3406 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
3408 (MAYBE_BASELINK_FUNCTIONS): New.
3409 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
3410 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
3411 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
3412 * method.c (inherited_ctor_binfo): Use ovl_iterator.
3413 (binfo_inherited_from): Likewise.
3414 * parser.c (lookup_literal_operator): Use lkp_iterator.
3415 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
3416 (print_candidates_1): Likewise.
3417 (determine_specialization): Likewise.
3418 (resolve_overloaded_unification): Likewise.
3419 (resolve_nondeduced_context): Likewise.
3420 (type_dependent_expression_p): Likewise.
3421 (dependent_template_p): Likewise.
3422 * ptree.c (cxx_print_xnode): Likewise.
3423 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
3424 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
3425 * typeck.c (check_template_keyword): Use lkp_iterator.
3427 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
3429 * constexpr.c (function_concept_check): Use OVL_FIRST.
3430 * cvt.c (build_expr_type_conversion): Likewise.
3431 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
3432 * decl2.c (mark_used): Use OVL_FIRST.
3433 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
3434 (dump_expr, location_of): Use OVL_FIRST.
3435 * friend.c (do_friend): Use OVL_NAME.
3436 * init.c (build_offset_ref): Use OVL_FIRST.
3437 * mangle.c (write_member_name): Likewise.
3438 (write_expression): Use OVL_NAME.
3439 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
3440 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
3441 * pt.c (check_explicit_specialization): Use OVL_FIRST.
3442 (check_template_shadow): Likewise.
3443 (tsubst_template_args): Use OVL_NAME.
3444 (tsubst_baselink): Use OVL_FIRST.
3445 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
3446 * tree.c (get_first_fn): Use OVL_FIRST.
3447 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
3448 (cp_build_addr_expr_1): Use OVL_FIRST.
3450 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
3452 * semantics.c (finish_id_expression): Directly init local var.
3453 (finish_omp_reduction_clause): Use really_overloaded_fn.
3454 * tree.c (get_fns): Document. Assert we got an overload.
3455 (get_first_fn) Document.
3456 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
3457 really_overloaded_fn.
3458 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
3460 * cp-tree.h (SCOPE_DEPTH): New.
3461 * name-lookup.h (is_nested_namespace): Declare.
3462 * name-lookup.c (is_nested_namespace): New.
3463 (is_ancestor): Use it.
3464 (set_decl_namespace): Likewise.
3465 (push_namespace): Set SCOPE_DEPTH.
3466 * pt.c (check_specialization_namespace): Use is_nested_namespace.
3467 (check_unqualigied_spec_or_inst): Likewise.
3469 2017-05-15 Nathan Sidwell <nathan@acm.org>
3472 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
3473 * name-lookup.h (push_namespace): Return int, add make_inline arg.
3474 * name-lookup.c (push_namespace): Deal with inline directly.
3475 Return pushed count.
3476 * parser.c (cp_parser_namespace_definition): Adjust for
3477 push_namespace change.
3479 2017-05-11 Nathan Sidwell <nathan@acm.org>
3481 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
3482 LANG_HOOKS_PUSHDECL): Move to ...
3483 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
3484 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
3485 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
3487 * name-lookup.h (pushdecl): Add default friend parm.
3488 (pushdecl_maybe_friend): Delete.
3489 (pushdecl_top_level): Add default friend parm.
3490 (pushdecl_top_level_maybe_friend): Delete.
3491 * name-lookup.c (pushdecl_maybe_friend): Delete.
3492 (pushdecl): Add is_friend parm.
3493 (pushdecl_top_level): Add is friend_parm.
3494 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
3495 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
3496 * friend.c (do_friend): Adjust.
3497 * pt.c (tsubst_friend_class): Adjust.
3499 Revert pushdecl_top_level_and_finish name change.
3500 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
3501 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
3502 * decl.c (cp_make_fname_decl): Adjust.
3503 * decl2.c (get_guard, handle_tls_init): Adjust.
3504 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
3506 * name-lookup.c (pushdecl_outermost_localscope): Always
3507 conditionally stop timer.
3509 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
3510 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
3512 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
3513 pushtag_top_level_maybe_friend,
3514 pushdecl_top_level_and_finish): Move declarations to ...
3515 * name-lookup.h: ... here. Group pushdecl variants.
3516 (pushdecl_top_level_and_finish): Rename to ...
3517 (pushdecl_top_level_with_init): ... here.
3518 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
3519 * decl2.c (get_guard, handle_tls_init): Likewise.
3520 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
3521 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
3522 * method.c (implicitly_declare_fn): Likewise.
3523 * searchc (node_debug_info_needed): Likewise.
3524 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
3525 (pushdecl_top_level_with_init): ... here.
3526 (pop_everything): Use namespace_bindings_p.
3528 * name-lookup.h (pop_binding): Rename to pop_local_binding.
3529 (getdecls): Rename to get_local_decls.
3530 * name-lookup.c (pop_binding): Rename to ...
3531 (pop_local_binding): ... here.
3532 (pop_bindings_and_leave_scope): Adjust.
3533 (getdecls): Rename to ...
3534 (get_local_decls): ... here. Assert local scope.
3535 * decl.c (poplevel): Assert not namespace. Adjust and simplify
3537 (store_parm_decls): Adjust get_local_decls call.
3538 (parser.c (synthesize_implicit_template_parm): Likewise.
3540 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
3543 * method.c (is_trivially_xible): Reject void types.
3545 2017-05-10 Nathan Sidwell <nathan@acm.org>
3547 * class.c (handle_using_decl): Always use OVL_CURRENT.
3548 (resolve_address_of_overloaded_function): Move iterator decl into
3549 for scope. Don't strip anticipated decls here.
3551 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
3553 (print_candidates): Adjust.
3555 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
3557 * call.c (build_new_function_call): Lose koenig_p arg. Remove
3558 koenig_p handling here.
3559 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
3560 (tsubst_omp_clauses): Likewise.
3561 (do_class_deduction): Adjust buld_new_function_call calls.
3562 * semantics.c (finish_call_expr): Likewise.
3564 2017-05-10 Jason Merrill <jason@redhat.com>
3566 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
3567 (unify_type_mismatch, unify_parameter_pack_mismatch)
3568 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
3569 (unify_parameter_pack_inconsistent, unify_inconsistency)
3570 (unify_vla_arg, unify_method_type_error, unify_arity)
3571 (unify_arg_conversion, unify_no_common_base)
3572 (unify_inconsistent_template_template_parameters)
3573 (unify_template_deduction_failure)
3574 (unify_template_argument_mismatch)
3575 (unify_overload_resolution_failure): Call unify_invalid.
3577 CWG 1847 - Clarifying compatibility during partial ordering
3578 * pt.c (more_specialized_fn): No order between two non-deducible
3581 * pt.c (dependent_type_p): Make sure we aren't called with
3584 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3585 * pt.c (convert_template_argument): Just return an argument pack.
3586 (coerce_template_parameter_pack, template_parm_to_arg)
3587 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
3588 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
3589 Don't set the type of a NONTYPE_ARGUMENT_PACK.
3590 * parser.c (make_char_string_pack, make_string_pack): Likewise.
3592 2017-05-10 Nathan Sidwell <nathan@acm.org>
3594 * cp-tree.h (add_method, clone_function_decl): Change last arg to
3596 * class.c (add_method): Change third arg to bool. Adjust.
3597 (one_inheriting_sig, one_inherited_ctor): Adjust.
3598 (clone_function_decl): Change 2nd arg to bool. Adjust.
3599 (clone_constructors_and_destructors): Adjust.
3600 * lambda.c (maybe_add_lambda_conv_op): Adjust.
3601 * method.c (lazily_declare_fn): Adjust.
3602 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
3603 * semantics.c (finish_member_declaration): Adjust.
3605 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
3608 * decl.c (finish_function): To improve error recovery, change the
3609 logic for calling apply_deduced_return_type.
3611 2017-05-09 Jason Merrill <jason@redhat.com>
3613 PR c++/80605 - __is_standard_layout and empty base
3614 * class.c (check_bases): Ignore empty bases.
3616 PR c++/70979 - literal class and closure types
3617 * class.c (finalize_literal_type_property): Handle closures
3619 (explain_non_literal_class): Likewise.
3621 PR c++/66297, DR 1684 - literal class and constexpr member fns
3622 * constexpr.c (is_valid_constexpr_fn): Only complain about
3623 non-literal enclosing class in C++11.
3624 * class.c (finalize_literal_type_property): Likewise.
3626 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
3629 * pt.c (tsubst_decl): Early return error_mark_node if
3630 grok_ctor_properties returns false.
3632 2017-05-09 Jason Merrill <jason@redhat.com>
3634 PR c++/70167 - array prvalue treated as lvalue
3635 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
3637 * semantics.c (finish_compound_literal): Add fcl_context parameter.
3638 Only make a static variable for C99 syntax.
3639 * parser.c (cp_parser_postfix_expression): Pass it.
3640 * pt.c (tsubst_copy_and_build): Likewise.
3641 * call.c (extend_ref_init_temps): Set
3642 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
3644 2017-05-09 Nathan Sidwell <nathan@acm.org>
3646 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
3647 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
3648 * name-lookup.h (pushdecl_top_level): Declare.
3650 2017-05-08 Jason Merrill <jason@redhat.com>
3652 PR c++/80178 - parameter passing for uncopyable classes
3653 * tree.c (type_has_nontrivial_copy_init): True for classes with only
3654 deleted copy/move ctors.
3655 (remember_deleted_copy, maybe_warn_parm_abi): New.
3656 * decl.c (require_complete_types_for_parms, check_function_type):
3657 Call maybe_warn_parm_abi.
3658 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
3660 2017-05-08 Nathan Sidwell <nathan@acm.org>
3662 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
3663 (start_preparsed_function): Do decl pushing before setting
3664 current_funciton_decl and announcing it.
3666 * name-lookup.h (pushdecl_with_scope): Replace with ...
3667 (pushdecl_outermost_localscope): ... this.
3668 * name-lookup.c (pushdecl_with_scope): Replace with ...
3669 (pushdecl_outermost_localscope): ... this.
3670 (pushdecl_namespace_level): Adjust.
3671 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
3672 * lambda.c (insert_capture_proxy): Likewise.
3674 * class.c (build_vtbl_initializer): Don't shadow outer variable
3677 Revert _binding -> _value change.
3678 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
3679 (get_namespace_binding, set_global_binding): ... these.
3680 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
3681 (get_namespace_binding, set_global_binding): ... these.
3682 (arg_assoc_namespace, pushdecl_maybe_friend_1,
3683 check_for_out_of_scope_variable, push_overloaded_decl_1,
3684 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
3685 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
3686 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
3687 * decl.c (poplevel): Adjust.
3688 * pt.c (make_constrained_auto): Likewise.
3690 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
3692 PR translation/80280
3693 * call.c (print_z_candidate): Fix quoting.
3695 2017-05-05 David Malcolm <dmalcolm@redhat.com>
3697 * error.c (pedwarn_cxx98): Replace report_diagnostic
3698 with diagnostic_report_diagnostic.
3700 2017-05-05 Nathan Sidwell <nathan@acm.org>
3702 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
3703 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
3704 (IDENTIFIER_NAMESPACE_VALUE): Delete.
3705 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
3707 (get_namespace_value, set_global_value): ... these.
3708 (get_global_value_if_present, is_typename_at_global_scope): Delete.
3709 * decl.c (poplevel): Use get_namespace_value.
3710 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
3711 * class.c (build_vtbl_initializer): Stash library decl in
3712 static var. Use IDENTIFIER_GLOBAL_VALUE.
3713 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
3714 do_allocate_exception, do_free_exception, build_throw): Likewise.
3715 * init.c (throw_bad_array_new_length): Likewise.
3716 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
3717 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
3718 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
3719 get_namespace_value.
3720 (set_namespace_binding_1): Rename to
3721 (set_namespace_binding): ... here.
3722 (set_global_value): New.
3723 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
3724 get_namespace_value.
3725 * pt.c (listify): Use get_namespace_value.
3727 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
3729 * lex.c (unqualified_name_lookup_error): Likewise.
3731 * class.c (alter_class): Use retrofit_lang_decl directly.
3732 * decl.c (push_local_name, dupliate_decls): Likewise.
3733 * semantics.c (omp_privatize_field): Likewise.
3735 Kill walk_namespaces.
3736 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
3737 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
3739 Kill per-namespace static_decls.
3740 * cp-tree.h (static_decls): Declare.
3741 (wrapup_globals_for_namespace,
3742 diagnose_inline_vars_for_namespace): Replace with ...
3743 (wrapup_namespace_globals): ... this.
3744 * decl.c (static_decls): Define.
3745 (wrapup_globals_for_namespace,
3746 diagnose_inline_vars_for_namespace): Replace with ...
3747 (wrapup_namespace_globals): ... this.
3748 (cxx_init_decl_processing): Initialize static_decls.
3749 * decl2.c (c_parse_final_cleanups): Adjust.
3750 * name-lookup.h (cp_binding_level): Remove static_decls member.
3751 * name-lookup.c (add_decl_to_level): Adjust.
3752 (begin_scope): Adjust.
3754 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
3757 * decl.c (reshape_init): Unconditionally return error_mark_node
3758 upon error about too many initializers.
3760 2017-05-04 Nathan Sidwell <nathan@acm.org>
3762 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
3764 2017-05-04 Martin Sebor <msebor@redhat.com>
3766 PR translation/80280
3767 * call.c (print_z_candidate): Add missing quoting to %D and other
3769 (build_op_call_1): Same.
3770 * constraint.cc (diagnose_check_constraint): Same.
3771 * mangle.c (mangle_decl): Same.
3772 * name-lookup.c (cp_binding_level_debug): Same.
3773 (set_decl_namespace): Same.
3774 * parser.c (cp_parser_tx_qualifier_opt): Same.
3775 * pt.c (print_candidates_1): Same.
3776 (check_template_variable): Same.
3777 (tsubst_default_argument): Same.
3778 (most_specialized_partial_spec): Same.
3779 * semantics.c (omp_reduction_lookup): Same.
3780 * tree.c (check_abi_tag_redeclaration): Same.
3781 * typeck.c (comptypes): Same.
3782 * typeck2.c (abstract_virtuals_error_sfinae): Same.
3784 2017-05-04 Nathan Sidwell <nathan@acm.org>
3787 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
3788 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
3789 CPTI_INIT_LIST_IDENTIFIER.
3790 (global_namespace, global_type_node, global_identifier,
3791 anon_identifier, init_list_identifier): New.
3792 * decl.c (global_type_node, global_scope_name): Delete.
3793 (initialize_predefined_identifiers): Add new identifiers.
3794 (cxx_init_decl_processing): Adjust.
3795 * name-lookup.h (global_namespace, global_type_node): Delete.
3796 * name-lookup.c (global_namespace, anonymous_namespace_name,
3797 get_anonymous_namespace_name): Delete.
3798 (namespace_scope_ht_size, begin_scope, pushtag_1,
3799 push_namespace): Adjust,
3800 * call.c (type_has_extended_temps): Use init_list_identifier.
3801 * pt.c (listify): Likewise.
3803 * name-lookup.c: Reorder functions to make merging from modules
3806 2017-05-03 Jason Merrill <jason@redhat.com>
3808 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
3810 2017-05-03 Nathan Sidwell <nathan@acm.org>
3812 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
3813 along with #defines, to before name-lookup include.
3815 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
3817 * pt.c (is_auto_or_concept): Remove.
3818 (type_uses_auto_or_concept): Remove, unused.
3819 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
3820 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
3821 * cp-tree.h (is_auto_or_concept): Remove.
3823 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
3826 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
3827 add pedigree operation and detach call here.
3828 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
3829 cilk_cp_gimplify_call_params_in_spawned_fn.
3830 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
3831 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
3833 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
3835 * parser.c (cp_parser_member_declaration): Add fix-it hints for
3836 stray comma and missing semicolon at end of member declaration.
3838 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
3840 * parser.c (cp_parser_cast_expression): Add target type of cast to
3842 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
3844 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
3846 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
3847 return type to bool.
3848 * cp-tree.h (grok_ctor_properties): Update.
3850 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
3852 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
3853 information to diagnostic of invalid colon in nested-name-specifier.
3855 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
3857 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
3858 diagnostic of invalid class/struct keyword after enum.
3860 2017-04-25 David Malcolm <dmalcolm@redhat.com>
3862 * parser.c (cp_parser_member_declaration): Add fix-it hint
3863 for removing stray semicolons.
3865 2017-04-25 David Malcolm <dmalcolm@redhat.com>
3867 * name-lookup.c (get_std_name_hint): New function.
3868 (maybe_suggest_missing_header): New function.
3869 (suggest_alternative_in_explicit_scope): Call
3870 maybe_suggest_missing_header.
3872 2017-04-25 David Malcolm <dmalcolm@redhat.com>
3875 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
3876 candidate type of bm from tree to const char *.
3877 (consider_binding_level): Likewise.
3878 (lookup_name_fuzzy): Likewise, using this to merge the best
3879 result from the preprocessor into bm, rather than immediately
3880 returning, so that better matches from reserved words can "win".
3881 Guard the rejection of keywords that don't start decl-specifiers
3882 so it only happens for FUZZY_LOOKUP_TYPENAME.
3884 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
3886 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
3887 (start_enum): Likewise.
3888 (build_enumerator): Likewise. Use %qE instead of plain %E.
3889 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
3890 %<%D%> in diagnostics.
3891 (cp_parser_elaborated_type_specifier): Likewise.
3892 * pt.c (make_pack_expansion): Use %qT and %qE instead of
3893 %<%T%> and %<%E%> in diagnostics.
3894 (tsubst_pack_expansion): Likewise.
3896 2017-04-24 David Malcolm <dmalcolm@redhat.com>
3899 * parser.c (cp_parser_unary_expression): Generate a location
3900 range for alignof and sizeof expressions.
3902 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
3904 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
3906 (cp_parser_virt_specifier_seq_opt): Likewise.
3907 (set_and_check_decl_spec_loc): Likewise twice.
3909 2017-04-21 Jason Merrill <jason@redhat.com>
3911 PR c++/80179 - ICE with initialized flexible array member.
3912 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
3914 2017-04-21 Richard Biener <rguenther@suse.de>
3916 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
3917 (copy_type): Likewise.
3918 * lex.c (copy_decl): Pass down mem-stat info.
3919 (copy_type): Likewise.
3921 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
3924 * init.c (build_new_1): Suppress notes about over-aligned new when
3925 the warning is suppressed.
3927 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
3929 * parser.c (cp_parser_member_declaration): Add warning with fixit
3930 information for extra semicolon after in-class function definition.
3932 2017-04-20 Jakub Jelinek <jakub@redhat.com>
3935 * tree.c (build_cplus_array_type): Call build_array_type
3936 with the intended TYPE_TYPELESS_STORAGE flag value, instead
3937 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
3940 2017-04-18 Marek Polacek <polacek@redhat.com>
3942 PR c++/80244 - ICE with attribute in template alias.
3943 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
3945 PR c++/80241 - ICE with alignas pack expansion.
3946 * error.c (dump_expr): Handle TREE_LIST.
3947 * parser.c (cp_parser_std_attribute_list): Return error_mark if
3948 make_pack_expansion returns an error.
3950 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
3953 * class.c (fixup_may_alias): Fix all type variants.
3955 2017-04-17 Jason Merrill <jason@redhat.com>
3957 PR c++/80415 - wrong error with default arg and array reference.
3958 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
3960 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
3962 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
3964 * decl.c (name_unnamed_type): Split out of...
3965 (grokdeclarator): ... this.
3966 * decl.h (name_unnamed_type): Declare.
3968 2017-04-12 Richard Biener <rguenther@suse.de>
3969 Bernd Edlinger <bernd.edlinger@hotmail.de>
3972 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
3973 for arrays of character or std::byte type.
3975 2017-04-11 Jason Merrill <jason@redhat.com>
3977 PR c++/80294 - ICE with constexpr and inheritance.
3978 * constexpr.c (reduced_constant_expression_p):
3979 A null constructor element is non-constant.
3980 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
3981 returning an empty base.
3983 2017-04-11 Jakub Jelinek <jakub@redhat.com>
3986 * decl.c (cp_finish_decomp): If processing_template_decl on
3987 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
3988 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
3989 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
3991 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
3992 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
3995 2017-04-11 Jakub Jelinek <jakub@redhat.com>
3998 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
4000 2017-04-10 Jakub Jelinek <jakub@redhat.com>
4003 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
4004 operand, if it is a static member function, recurse on the
4007 2017-04-10 Marek Polacek <polacek@redhat.com>
4010 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
4011 ORIG_TYPE earlier and not only when shortening.
4013 2017-04-07 Jason Merrill <jason@redhat.com>
4015 PR c++/80356 - ICE with reference to function template argument.
4017 * pt.c (convert_nontype_argument_function): Adjust type even with a
4018 value-dependent argument.
4020 PR c++/80267 - ICE with nested capture of reference
4022 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
4024 2017-04-07 Marek Polacek <polacek@redhat.com>
4027 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
4030 * call.c (build_over_call): Don't check cxx_dialect.
4031 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
4032 whether SUB is a CONSTRUCTOR.
4033 * init.c (build_new_1): Don't check cxx_dialect.
4034 * tree.c (replace_placeholders): Add a function comment. Return if
4035 not in C++14, or if the object isn't a (member of a) class.
4036 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
4037 TYPE is CLASS_TYPE_P.
4039 2017-04-05 Jakub Jelinek <jakub@redhat.com>
4042 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
4043 of a loop doing vec_safe_push of NULL. Formatting fixes.
4044 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
4045 to newidx before calling canonical_type_parameter on newtype.
4047 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
4050 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
4051 UNARY_PLUS_EXPR case.
4053 2017-04-03 Jason Merrill <jason@redhat.com>
4055 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
4057 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
4059 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
4060 * decl2.c (one_static_initialization_or_destruction): Likewise.
4061 * name-lookup.c (store_bindings): Likewise.
4062 * parser.c (make_call_declarator): Likewise.
4063 * pt.c (check_explicit_specialization): Likewise.
4065 2017-04-03 Jason Merrill <jason@redhat.com>
4067 PR sanitizer/79993 - ICE with VLA initialization from string
4068 PR c++/69487 - wrong VLA initialization from string
4069 * init.c (finish_length_check): Split out from build_vec_init.
4070 (build_vec_init): Handle STRING_CST.
4071 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
4072 (digest_init_r): Don't give a STRING_CST VLA type.
4074 2017-03-31 Jakub Jelinek <jakub@redhat.com>
4077 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
4078 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
4079 for NOP_EXPR to REFERENCE_TYPE.
4082 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
4083 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
4085 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
4086 Remove extraneous parens.
4087 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
4088 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
4089 (cp_parser_trait_expr): Likewise.
4091 2017-03-27 Jakub Jelinek <jakub@redhat.com>
4094 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
4095 * typeck.c (cxx_mark_addressable): Likewise. Look through
4096 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
4098 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
4100 2017-03-24 Jason Merrill <jason@redhat.com>
4102 PR c++/77339 - ICE with invalid use of alias template.
4103 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
4106 2017-03-24 Marek Polacek <polacek@redhat.com>
4109 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
4110 doesn't have side effects.
4112 2017-03-23 Jason Merrill <jason@redhat.com>
4114 PR c++/80150 - ICE with overloaded variadic deduction.
4115 * pt.c (try_one_overload): Remove asserts.
4117 PR c++/77563 - missing ambiguous conversion error.
4118 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
4120 2017-03-23 Marek Polacek <polacek@redhat.com>
4122 * cp-tree.h: Remove a C_RID_YYCODE reference.
4124 2017-03-22 Jakub Jelinek <jakub@redhat.com>
4127 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
4128 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
4129 processing_template_decl.
4131 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
4134 * name-lookup.c (pushtag_1): Add check for bogus, non template,
4135 std::initializer_list.
4137 2017-03-21 Jakub Jelinek <jakub@redhat.com>
4140 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
4142 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
4145 * init.c (std_placement_new_fn_p): New.
4146 (build_new_1): Call it.
4148 2017-03-20 Jason Merrill <jason@redhat.com>
4150 PR c++/80096 - ICE with C++17 non-type auto.
4151 * pt.c (tsubst): Delay tsubst of type of template non-type
4154 PR c++/79519 - ICE with deleted template friend.
4155 * decl.c (grokdeclarator): Complain about misplaced function
4156 definition using =, as well.
4158 PR c++/79640 - infinite recursion with generic lambda.
4159 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
4160 before substituting its initializer.
4162 2017-03-20 Marek Polacek <polacek@redhat.com>
4163 Paolo Carlini <paolo.carlini@oracle.com>
4165 PR c++/80059 - ICE with noexcept and __transaction_atomic
4166 * except.c (build_must_not_throw_expr): Call
4167 instantiate_non_dependent_expr.
4169 2017-03-19 Jason Merrill <jason@redhat.com>
4171 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
4172 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
4173 reference decomposition.
4175 PR c++/80077 - error with constexpr and -fno-elide-constructors.
4176 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
4177 expanding trivial constructor.
4179 2017-03-17 Jason Merrill <jason@redhat.com>
4181 PR c++/78345 - ICE initializing array from lambda.
4182 * init.c (build_aggr_init): Check array initializer.
4183 (build_vec_init): Check the type of a CONSTRUCTOR.
4185 PR c++/80073 - C++17 ICE with virtual base.
4186 * decl.c (xref_basetypes): Also check for indirect vbases.
4188 2017-03-16 Jason Merrill <jason@redhat.com>
4190 * decl.c (start_enum): std::byte aliases anything.
4193 * constexpr.c (lookup_placeholder): Tweak.
4195 2017-03-15 Jason Merrill <jason@redhat.com>
4197 PR c++/80043 - ICE with -fpermissive
4198 * typeck.c (convert_for_assignment): Handle instantiate_type
4199 not giving an error.
4201 2017-03-14 Nathan Sidwell <nathan@acm.org>
4203 PR c++/79393 DR 1658 workaround
4204 * method.c (synthesized_method_base_walk): Inihibit abstract class
4205 virtual base access check here.
4206 (synthesized_method_walk): Not here.
4208 2017-03-13 Nathan Sidwell <nathan@acm.org>
4210 PR c++/79393 DR 1658 workaround
4211 * method.c (synthesized_method_walk): Check vbases of abstract
4212 classes for dtor walk.
4214 2017-03-10 David Malcolm <dmalcolm@redhat.com>
4216 PR translation/79848
4217 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
4219 2017-03-10 Jason Merrill <jason@redhat.com>
4221 PR c++/79960 - alias templates and partial ordering
4222 * pt.c (comp_template_args): Add partial_order parm.
4223 (template_args_equal): Likewise.
4224 (comp_template_args_porder): New.
4225 (get_partial_spec_bindings): Use it.
4227 2017-03-10 Marek Polacek <polacek@redhat.com>
4230 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
4232 2017-03-10 Jakub Jelinek <jakub@redhat.com>
4235 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
4236 Use XALLOCAVEC macro.
4239 * decl.c (finish_enum_value_list): If value is error_mark_node,
4240 don't copy it and change its type.
4241 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
4242 of CONST_DECL is error_mark_node.
4244 2017-03-09 Marek Polacek <polacek@redhat.com>
4246 PR c++/79900 - ICE in strip_typedefs
4247 * tree.c (strip_typedefs): Skip the attribute handling if T is
4248 a variant type which hasn't been updated yet.
4250 PR c++/79687 - wrong code with pointer-to-member
4251 * init.c (constant_value_1): Break if the variable has a dynamic
4254 2017-03-08 Jason Merrill <jason@redhat.com>
4256 PR c++/79797 - ICE with self-reference in array DMI.
4257 * constexpr.c (lookup_placeholder): Split out...
4258 (cxx_eval_constant_expression): ...from here.
4260 2017-03-07 Jakub Jelinek <jakub@redhat.com>
4263 * parser.c (cp_parser_omp_cancellation_point,
4264 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
4265 cp_parser_omp_target_update): Change "may only be used in compound
4266 statements" diagnostics, such that the same translatable string is
4267 used for all pragmas.
4268 (cp_parser_pragma): Likewise. Use error_at instead of
4269 cp_parser_error for that diagnostics.
4271 2017-03-06 Marek Polacek <polacek@redhat.com>
4273 PR c++/79796 - ICE with NSDMI and this pointer
4274 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
4275 replace_placeholders.
4277 2017-03-06 Jakub Jelinek <jakub@redhat.com>
4280 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
4283 2017-03-06 Jason Merrill <jason@redhat.com>
4285 Revert "Allow deduction guides to look into primary template."
4286 * cp-tree.h, parser.c, pt.c, search.c: Revert.
4288 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
4291 * except.c (build_must_not_throw_expr): Perform the implicit
4292 conversions on the condition.
4294 2017-03-03 Jason Merrill <jason@redhat.com>
4296 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
4299 Core issues 2273 and 2277
4300 * call.c (joust): Adjust using-declaration tiebreaker to handle
4301 the intermediate base case.
4302 * method.c (strip_inheriting_ctors): Just return the argument if
4303 !flag_new_inheriting_ctors.
4305 2017-03-03 Richard Biener <rguenther@suse.de>
4308 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
4310 2017-03-03 Marek Polacek <polacek@redhat.com>
4313 * typeck.c (string_conv_p): In C++11, always call pedwarn with
4316 2017-03-02 Jason Merrill <jason@redhat.com>
4318 Update overload resolution with deduction guides.
4319 * pt.c (do_class_deduction): Always build the copy guide.
4320 (copy_guide_p, template_guide_p): New.
4321 (build_deduction_guide): Remember the original constructor.
4322 * call.c (joust): Prefer the copy guide and non-template guides.
4324 Allow deduction guides to look into primary template.
4325 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
4326 (struct cp_decl_specifier_seq): Add constructor_p.
4327 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
4328 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
4329 Clear deduction_guide_type. Don't handle deduction guide names.
4330 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
4331 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
4332 (cp_parser_member_declaration, cp_parser_cache_defarg)
4333 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
4334 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
4335 (build_deduction_guide): Set deduction_guide_type.
4336 (dependent_scope_p): Check deduction_guide_type.
4337 * search.c (lookup_member): Likewise.
4339 2017-03-02 Jakub Jelinek <jakub@redhat.com>
4342 * init.c (mark_exp_read_r): New function.
4343 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
4344 whole arguments instead of plain mark_exp_read on TREE_LIST values.
4346 2017-03-01 Jason Merrill <jason@redhat.com>
4348 Class template argument deduction in new-expression
4349 * init.c (build_new): Handle deduction from no initializer.
4350 * parser.c (cp_parser_new_expression): Don't require a single
4351 expression for class template deduction.
4352 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
4353 class template placeholder.
4354 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
4355 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
4356 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
4358 2017-03-01 Jakub Jelinek <jakub@redhat.com>
4361 * init.c (emit_mem_initializers): When not constructing vbases of
4362 abstract classes, mark arguments as read for
4363 -Wunused-but-set-parameter.
4365 2017-02-28 Jason Merrill <jason@redhat.com>
4367 Class template argument deduction refinements
4368 * call.c (joust): Move deduction guide tiebreaker down.
4369 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
4370 deduction with no initializer.
4371 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
4372 (do_class_deduction): Use that rather than special case.
4373 (do_auto_deduction): Handle null initializer.
4375 2017-02-28 Jakub Jelinek <jakub@redhat.com>
4377 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
4378 instead of just cond ? "..." : "...".
4379 (grokdeclarator): Likewise.
4380 (build_enumerator): Likewise.
4381 * init.c (build_new_1): Likewise.
4382 * call.c (build_new_method_call_1): Likewise.
4383 * parser.c: Include intl.h.
4384 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
4385 "enter"/"exit" keyword.
4386 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
4389 2017-02-27 Jason Merrill <jason@redhat.com>
4391 PR c++/71568 - SFINAE forming pointer to member function
4392 * init.c (build_offset_ref): Check the return value of
4393 perform_or_defer_access_check.
4395 2017-02-27 Marek Polacek <polacek@redhat.com>
4397 * decl.c (expand_static_init): Add missing } in a comment.
4399 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
4401 * init.c: Include intl.h.
4402 (build_new_1): Move message strings into pedwarn to make them
4403 -Wformat-security friendly. Mark string for translation.
4404 * pt.c (tsubst_copy_and_build): Mark string for translation.
4405 Make the pointer const.
4406 * semantics.c (finish_id_expression): Mark strings for translation.
4408 2017-02-25 Jakub Jelinek <jakub@redhat.com>
4410 * call.c (build_op_delete_call): Make msg1 and msg2 const.
4412 2017-02-24 Jakub Jelinek <jakub@redhat.com>
4415 * call.c (build_over_call): Call check_function_arguments even for
4416 -Wrestrict, adjust check_function_arguments caller.
4417 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
4419 * typeck.c (cp_build_function_call_vec): Adjust
4420 check_function_arguments caller.
4422 2017-02-24 Marek Polacek <polacek@redhat.com>
4424 PR translation/79705
4425 * decl.c (check_redeclaration_exception_specification): Mark a string
4426 for translation. Make the pointer const.
4428 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
4431 * pt.c (register_specialization): Check duplicate_decls return value
4432 for error_mark_node and pass it back.
4434 2017-02-22 Jason Merrill <jason@redhat.com>
4436 PR c++/79679 - missing destructor for argument
4437 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
4440 * pt.c (do_class_deduction): Handle 0 argument case.
4442 2017-02-22 Jakub Jelinek <jakub@redhat.com>
4445 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
4446 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
4447 * constexpr.c (potential_constant_expression_1): Handle
4448 OMP_*, OACC_* and CILK_* trees. Use error_at with
4449 EXPR_LOC_OR_LOC (t, input_location) computed early
4450 instead of error, or error_at with location_of (t).
4452 2017-02-22 Marek Polacek <polacek@redhat.com>
4455 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
4456 if the alignas expression is erroneous.
4457 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
4461 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
4463 2017-02-21 Jason Merrill <jason@redhat.com>
4465 PR c++/50308 - wrong deprecated warning with ADL
4466 PR c++/17729 - duplicate deprecated warning
4467 * semantics.c (finish_id_expression): Only call mark_used on a
4468 function if we aren't building a call.
4470 PR c++/41727 - ICE with partial spec of partial instantiation
4471 * pt.c (process_partial_specialization): For now, don't check more
4472 specialized if there is more than one level of args.
4474 2017-02-21 Marek Polacek <polacek@redhat.com>
4477 * cp-tree.h (maybe_reject_flexarray_init): Declare.
4478 * init.c (maybe_reject_flexarray_init): No longer static.
4479 Add check for current_function_decl.
4480 * parser.c (cp_parser_late_parse_one_default_arg): Reject
4481 a default mem-initializer for a flexible array.
4483 2017-02-21 Jakub Jelinek <jakub@redhat.com>
4484 Paolo Carlini <paolo.carlini@oracle.com>
4487 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
4489 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
4490 decl after the decomposition artificial decl has error_mark_node.
4491 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
4492 instead of just == error_mark_node comparison.
4494 2017-02-21 Jakub Jelinek <jakub@redhat.com>
4497 * decl.c: Include gimplify.h.
4498 (cp_finish_decomp): Make sure there is no sharing of trees
4499 in between DECL_VALUE_EXPR of decomposition decls.
4502 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
4505 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
4506 call cplus_expand_constant on it first.
4508 2017-02-19 Jason Merrill <jason@redhat.com>
4510 PR c++/78139 - destructor needed by new-expression
4511 * call.c (build_special_member_call): Use tf_no_cleanup.
4513 PR c++/78282 - auto template and pack expansion
4514 * pt.c (find_parameter_packs_r): Don't walk into the type of
4515 templates other than template template-parameters.
4517 PR c++/79606 - ICE with this->base_member in NSDMI
4518 * class.c (build_base_path): Check processing_template_decl.
4520 PR c++/79607 - ICE with T{} initializer
4521 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
4523 PR c++/79566 - elaborated-type-specifier in range for
4524 * parser.c (cp_parser_simple_declaration): Fix check for type
4527 PR c++/79400 - confusing suggestion of 'noexcept'
4528 * parser.c (cp_parser_exception_specification_opt): Remove
4529 suggestion for deprecated dynamic exception-specification.
4531 PR c++/79470 - partial ordering with reference parameters
4532 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
4534 PR c++/79500 - ICE with non-template deduction guide
4535 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
4536 DECL_TEMPLATE_RESULT.
4538 PR c++/79580 - ICE with compound literal
4539 * parser.c (cp_parser_class_head): If we're in the middle of an
4540 expression, use ts_within_enclosing_non_class.
4542 PR c++/79503 - inherited ctor taking base class
4543 * call.c (add_function_candidate): Also check that
4544 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
4546 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
4549 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
4552 2017-02-19 Eric Fiselier <eric@efcs.ca>
4553 Jonathan Wakely <jwakely@redhat.com>
4556 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
4557 control warning about literal suffix identifiers without a leading
4560 2017-02-17 Jason Merrill <jason@redhat.com>
4562 PR c++/79508 - lookup error with member template
4563 * parser.c (cp_parser_template_name): Clear
4564 parser->context->object_type if we aren't doing lookup.
4566 PR c++/78690 - ICE with using and global type with same name
4567 * pt.c (type_dependent_object_expression_p): True for
4570 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
4571 * pt.c (convert_template_argument): Just return an auto arg pack.
4572 (tsubst_template_args): Don't tsubst an auto pack type.
4574 PR c++/79556 - C++17 ICE with non-type auto
4575 * pt.c (do_auto_deduction): Don't try to deduce from null type.
4577 PR c++/79533 - C++17 ICE with temporary cast to reference
4578 * call.c (build_over_call): Conversion to a reference prevents copy
4581 2017-02-16 Jakub Jelinek <jakub@redhat.com>
4582 Jason Merrill <jason@redhat.com>
4584 PR c++/79502 - lost nodiscard attribute
4585 * pt.c (apply_late_template_attributes): Do apply non-dependent
4586 attributes to types.
4588 2017-02-16 Jason Merrill <jason@redhat.com>
4590 PR c++/78572 - ICE with self-modifying array initializer
4591 * constexpr.c (cxx_eval_store_expression): The object we're
4592 initializing is outside the constant-expression.
4593 (cxx_eval_call_expression): Set ctx->call.
4595 PR c++/79050 - ICE with undeduced auto and LTO
4596 * decl.c (poplevel): Remove undeduced auto decls.
4598 2017-02-16 Jakub Jelinek <jakub@redhat.com>
4601 * parser.c (cp_parser_omp_target): For -fopenmp-simd
4602 ignore #pragma omp target even when not followed by identifier.
4604 2017-02-15 Jason Merrill <jason@redhat.com>
4605 Jakub Jelinek <jakub@redhat.com>
4607 PR c++/79464 - ICE in IPA with omitted constructor parms
4608 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
4609 (adjust_clone_args): Adjust.
4610 (add_method): Remember omitted parms.
4611 * call.c (add_function_candidate): Likewise.
4612 * mangle.c (write_method_parms): Likewise.
4613 * method.c (ctor_omit_inherited_parms): Return false if there are no
4616 2017-02-15 Martin Sebor <msebor@redhat.com>
4619 * init.c (maybe_reject_flexarray_init): New function.
4620 (perform_member_init): Call it.
4622 2017-02-15 Jakub Jelinek <jakub@redhat.com>
4625 * parser.c (cp_parser_std_attribute): Don't pedwarn about
4626 [[deprecated]] with -std=c++11 and [[fallthrough]] with
4627 -std=c++11 and -std=c++14.
4630 * decl.c (grokdeclarator): For static data members, handle thread_p
4631 only after handling inline.
4633 2017-02-14 Marek Polacek <polacek@redhat.com>
4637 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
4638 clobbering if the postfix expression isn't an EXPR_P.
4640 2017-02-13 Jason Merrill <jason@redhat.com>
4642 PR c++/79461 - ICE with lambda in constexpr constructor
4643 * constexpr.c (build_data_member_initialization): Ignore
4644 initialization of a local variable.
4646 2017-02-13 Jakub Jelinek <jakub@redhat.com>
4648 * init.c (warn_placement_new_too_small): Add missing space in
4650 * parser.c (cp_parser_oacc_declare): Likewise.
4651 * mangle.c (maybe_check_abi_tags): Likewise.
4654 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
4655 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
4656 in the rightmost operand.
4658 2017-02-13 Nathan Sidwell <nathan@acm.org>
4660 PR c++/79296 - ICE mangling localized template instantiation
4661 * decl2.c (determine_visibility): Use template fn context for
4662 local class instantiations.
4664 2017-02-11 Jason Merrill <jason@redhat.com>
4666 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
4667 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
4668 (build_new_1): Use replace_placeholders.
4669 * tree.c (replace_placeholders_t): Also track whether we've seen a
4671 (replace_placeholders, replace_placeholders_r): Adjust.
4672 * cp-tree.h: Adjust.
4674 PR c++/77790 - ICE with auto function in C++11 mode
4675 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
4676 (require_deduced_type): Add complain parm, return bool.
4677 * cp-tree.h: Adjust.
4678 * decl2.c (mark_used): Use require_deduced_type.
4680 2017-02-10 Jason Merrill <jason@redhat.com>
4682 PR c++/78908 - template ops and bitfields
4683 * tree.c (build_min_non_dep): Use unlowered_expr_type.
4685 PR c++/78897 - constexpr union
4686 * constexpr.c (cxx_eval_store_expression): A store to a union member
4687 erases a previous store to another member.
4689 PR c++/71285 - member of fold-expression
4690 * semantics.c (finish_unary_fold_expr)
4691 (finish_binary_fold_expr): Use null type for fold-expressions.
4693 PR c++/79401 - protected inherited constructor
4694 * call.c (enforce_access): For inheriting constructor, find a base
4695 binfo in the path we already have.
4697 2017-02-10 Marek Polacek <polacek@redhat.com>
4700 * pt.c (type_dependent_expression_p): Check if the expression type
4704 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
4705 if warnings shouldn't be given.
4707 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
4710 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
4711 an error_mark_node as type.
4713 2017-02-09 Jakub Jelinek <jakub@redhat.com>
4714 Jason Merrill <jason@redhat.com>
4717 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
4718 from pattern to type.
4720 2017-02-09 Jason Merrill <jason@redhat.com>
4722 PR c++/79316 - default argument in deduction guide
4723 PR c++/79350 - explicit deduction guide
4724 * parser.c (cp_parser_constructor_declarator_p)
4725 (cp_parser_direct_declarator): Parse deduction guides more like
4727 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
4728 * tree.c (special_function_p): Return it.
4729 * decl.c (check_special_function_return_type): Handle it.
4730 (grokdeclarator, grokfndecl): Adjust.
4731 (cp_finish_decl): Pass flags to do_auto_deduction.
4732 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
4733 * pt.c (dguide_name_p): Take a const_tree.
4734 (do_class_deduction): Handle explicit.
4735 (do_auto_deduction): Pass flags through.
4736 (build_deduction_guide): Copy explicit flag.
4738 2017-02-09 Jakub Jelinek <jakub@redhat.com>
4741 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
4742 non-pragma_compound context here.
4743 (cp_parser_omp_target): Likewise.
4744 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
4745 parsing for ordered and target omp pragmas in non-pragma_stmt
4746 non-pragma_compound contexts.
4749 * parser.c (cp_parser_oacc_declare): Formatting fix.
4750 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
4751 automatic variables.
4753 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
4754 Chung-Lin Tang <cltang@codesourcery.com>
4756 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
4757 parsing. Parse constant expression. Remove semantic checking.
4758 (cp_parser_omp_clause_collapse): Disallow tile.
4759 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
4760 error about missing for after already emitting one. Use more
4761 conventional for idiom for unbounded loop.
4762 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
4763 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
4764 (finish_omp_for): Deal with tile clause.
4766 2017-02-07 Nathan Sidwell <nathan@acm.org>
4768 * method.c (synthesized_method_base_walk): New. Broken out of ...
4769 (synthesized_method_walk): ... here. Call it. Cleanup
4772 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
4775 * typeck2.c (process_init_constructor_union): Consider only
4776 FIELD_DECLs when looking for an NSDMI.
4778 2017-02-06 Jason Merrill <jason@redhat.com>
4780 PR c++/71193 - incomplete types in templates
4781 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
4782 handle incomplete type by pedwarning and then treating as dependent.
4784 2017-02-06 Jakub Jelinek <jakub@redhat.com>
4787 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
4788 (potential_constant_expression_1): Likewise.
4791 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
4792 allow one fewer than expected arguments if flag_permissive.
4795 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
4796 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
4797 with error_mark_node type.
4799 2017-02-03 Jason Merrill <jason@redhat.com>
4801 PR c++/78689 - ICE on constructor with label
4802 * optimize.c (maybe_clone_body): Replace omitted parameters with
4804 * class.c (build_clone): Fix logic for omitting inherited parms.
4806 PR c++/12245 - excessive memory use
4807 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
4808 back in. Don't cache constants.
4809 (maybe_constant_init): Don't cache constants.
4811 PR c++/79294 - ICE with invalid template argument
4812 * pt.c (convert_nontype_argument_function): Check value-dependence.
4813 (convert_nontype_argument): Don't check it here for function ptrs.
4815 2017-02-02 Richard Biener <rguenther@suse.de>
4818 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
4819 it lazily on the first changed element only and copy it
4820 fully upfront, only storing changed elements.
4822 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
4825 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
4828 2017-01-31 Jakub Jelinek <jakub@redhat.com>
4831 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
4834 2017-01-31 David Malcolm <dmalcolm@redhat.com>
4837 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
4838 any namespace aliases.
4840 2017-01-31 Nathan Sidwell <nathan@acm.org>
4843 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
4847 * pt.c: (instantiate_decl): Push to top level when current
4848 function scope doesn't match. Only push lmabda scope stack when
4851 * cp-tree.h (instantiate_decl): Make defer_ok bool.
4852 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
4853 (instantiate_decl): Simplify and reorder state saving and restoration.
4856 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
4857 * semantics.c (finish_member_declaration): Assert class is being
4860 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
4862 Introduce C++ support in libcc1.
4863 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
4864 (ansi_opname): Rename to...
4865 (cp_operator_id): ... this. Adjust all callers.
4866 (ansi_assopname): Rename to...
4867 (cp_assignment_operator_id): ... this. Adjust all callers.
4868 (cp_literal_operator_id): Declare.
4869 (set_global_friend): Declare.
4870 (is_global_friend): Declare.
4871 (enum cp_oracle_request): New type.
4872 (cp_binding_oracle_function): New type.
4873 (cp_binding_oracle): Declare.
4874 (cp_finish_injected_record_type): Declare.
4875 * friend.c (global_friend): New var.
4876 (set_global_friend): New fn.
4877 (is_global_friend): New fn.
4878 (is_friend): Call is_global_friend.
4879 * name-lookup.c (cp_binding_oracle): New var.
4880 (query_oracle): New fn.
4881 (qualified_lookup_using_namespace): Call query_oracle.
4882 (lookup_name_real_1): Likewise.
4883 * parser.c (cp_literal_operator_id): Drop static.
4884 * search.c (friend_accessible_p): Call is_global_friend.
4885 * semantics.c (is_this_parameter): Accept a variable if the
4886 binding oracle is enabled.
4888 2017-01-27 Jason Merrill <jason@redhat.com>
4890 PR c++/78771 - ICE with inherited constructor.
4891 * call.c (build_over_call): Call deduce_inheriting_ctor here.
4892 * pt.c (tsubst_decl): Not here.
4893 * class.c (add_method): Or here.
4894 * method.c (deduce_inheriting_ctor): Handle clones.
4895 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
4897 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
4900 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
4902 * cp/cp-tree.h: Declare it.
4903 * cp/semantics.c (finish_id_expression): Resolve names within a default
4904 capturing generic lambda defined within a template prior to
4905 instantiation to allow for captures to be added to the closure type.
4907 2017-01-26 Jakub Jelinek <jakub@redhat.com>
4910 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
4911 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
4912 * parser.c (cp_parser_builtin_offsetof): Pass result of
4913 build_static_cast of null_pointer_node to finish_offsetof.
4914 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
4915 it for -Winvalid-offsetof pedwarn instead of trying to guess
4916 original offsetof type from EXPR. Save OBJECT_PTR as a new
4917 second operand to OFFSETOF_EXPR.
4918 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
4919 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
4922 2017-01-26 Jason Merrill <jason@redhat.com>
4924 * name-lookup.c (parse_using_directive): Deprecate strong using.
4926 PR c++/79176 - lambda ICE with -flto -Os
4927 * decl2.c (vague_linkage_p): Handle decloned 'tors.
4928 * tree.c (decl_linkage): Likewise.
4930 2017-01-25 Martin Sebor <msebor@redhat.com>
4932 * decl.c (grokdeclarator): Fix a typo in a comment.
4934 2017-01-25 Jakub Jelinek <jakub@redhat.com>
4937 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
4941 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
4942 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
4944 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
4947 * decl.c (cxx_init_decl_processing): Pass main_input_filename
4948 to build_translation_unit_decl.
4950 2017-01-24 Jakub Jelinek <jakub@redhat.com>
4953 * cp-gimplify.c (cp_genericize_r): Add result of
4954 convert_from_reference on invisiref parm to p_set.
4956 2017-01-24 Nathan Sidwell <nathan@acm.org>
4958 PR c++/78469 - defaulted ctor and inaccessible dtor
4959 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
4960 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
4961 * tree.c (build_target_expr): Check tf_no_cleanup.
4963 PR c++/79118 - anon-members and constexpr
4964 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
4965 ctor decl. Recursively check anonymous members.
4966 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
4968 (explain_invalid_constexpr_fn): Likewise.
4970 2017-01-23 Nathan Sidwell <nathan@acm.org>
4972 PR c++/71710 - template using directive of field
4973 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
4976 PR c++/71406 - ICE with scope-ref'd template id exprs
4978 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
4979 before breaking up TEMPLATE_ID_EXPR.
4981 2017-01-20 Nathan Sidwell <nathan@acm.org>
4983 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
4984 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
4986 2017-01-20 David Malcolm <dmalcolm@redhat.com>
4990 * cp-tree.h (suggest_alternatives_for): Add bool param.
4991 (suggest_alternative_in_explicit_scope): New decl.
4992 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
4993 that isn't the global one, call new function
4994 suggest_alternative_in_explicit_scope, only calling
4995 suggest_alternatives_for if it fails, and disabling near match
4996 searches fort that case. When SCOPE is the global namespace,
4997 pass true for new param to suggest_alternatives_for to allow for
4999 * lex.c (unqualified_name_lookup_error): Pass true for new param
5000 to suggest_alternatives_for.
5001 * name-lookup.c (consider_binding_level): Add forward decl.
5002 (suggest_alternatives_for): Add "suggest_misspellings" param,
5003 using it to conditionalize the fuzzy name-lookup code.
5004 (suggest_alternative_in_explicit_scope): New function.
5005 * parser.c (cp_parser_primary_expression): When calling
5006 finish_id_expression, pass location of id_expression rather
5007 than that of id_expr_token.
5008 (cp_parser_id_expression): Convert local "unqualified_id" from
5009 tree to cp_expr to avoid implicitly dropping location information.
5011 2017-01-20 Marek Polacek <polacek@redhat.com>
5014 * call.c (build_conditional_expr_1): Warn about duplicated branches.
5015 * semantics.c (finish_expr_stmt): Build statement using the proper
5018 2017-01-19 Jason Merrill <jason@redhat.com>
5020 US 20 - forwarding references and class template argument deduction
5021 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
5022 * pt.c (push_template_decl_real): Set it.
5023 (maybe_adjust_types_for_deduction): Check it.
5024 (rewrite_template_parm): Copy it.
5026 US 19 - deduction guides and constructors
5027 * call.c (joust): Prefer deduction guides to constructors.
5028 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
5029 (deduction_guide_p): Check DECL_P.
5031 * decl.c (check_initializer): Always use build_aggr_init for array
5034 PR c++/79130 - decomposition and direct-initialization
5035 * init.c (build_aggr_init): Communicate direct-initialization to
5037 (build_vec_init): Check for array copy sooner.
5038 * parser.c (cp_parser_decomposition_declaration): Remove call to
5039 build_x_compound_expr_from_list.
5041 2017-01-18 Jason Merrill <jason@redhat.com>
5043 PR c++/68666 - member variable template-id
5044 * typeck.c (finish_class_member_access_expr): Handle variable
5046 * pt.c (lookup_and_finish_template_variable): No longer static.
5047 * cp-tree.h: Declare it.
5049 2017-01-18 Nathan Sidwell <nathan@acm.org>
5052 * call.c (build_over_call): When checking ellipsis conversions for
5053 an inherited ctor, make sure there is at least one conversion.
5055 2017-01-18 Jason Merrill <jason@redhat.com>
5057 PR c++/78894 - ICE with class deduction and default arg
5058 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
5060 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5063 * mangle.c (write_discriminator): Reorganize abi warning check.
5065 2017-01-18 Nathan Sidwell <nathan@acm.org>
5067 * cp-tree.h: Clarify exception spec node comment.
5068 * except.c (nothrow_spec_p): Simplify by checking node-equality.
5071 * mangle.c (write_exception_spec): Check nothrow explicitly.
5072 (write_encoding): Don't increment processing_template_decl around
5075 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5078 * mangle.c (write_template_args): Add "on" for operator names.
5080 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5083 * mangle.c (write_discriminator): Handle discriminator >= 10.
5085 2017-01-17 Nathan Sidwell <nathan@acm.org>
5088 * cp-tree.h (maybe_generic_this_capture): Declare.
5089 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
5090 (maybe_resolve_dummy): ... here. Call it.
5091 (maybe_generic_this_capture): New.
5092 * parser.c (cp_parser_postfix_expression): Speculatively capture
5093 this in generic lambda in unresolved member function call.
5094 * pt.c (tsubst_copy_and_build): Force hard error from failed
5095 member function lookup in generic lambda.
5097 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
5100 * cp-array-notation.c (expand_array_notation_exprs): Handle
5103 2017-01-11 Jason Merrill <jason@redhat.com>
5105 PR c++/78337 - ICE on invalid with generic lambda
5106 * semantics.c (process_outer_var_ref): Check if containing_function
5107 is null. Move inform call under complain test.
5109 2017-01-11 Nathan Sidwell <nathan@acm.org>
5112 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
5115 2017-01-11 Nathan Sidwell <nathan@acm.org>
5117 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
5119 2017-01-11 Jakub Jelinek <jakub@redhat.com>
5122 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
5123 assertion. Formatting fix.
5126 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
5129 2017-01-10 David Malcolm <dmalcolm@redhat.com>
5132 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
5133 a missing semicolon if we have a valid insertion location for
5136 2017-01-10 Jason Merrill <jason@redhat.com>
5138 FI 20, decomposition declaration with parenthesized initializer.
5139 * parser.c (cp_parser_decomposition_declaration): Use
5140 cp_parser_initializer.
5142 2017-01-09 Jason Merrill <jason@redhat.com>
5144 Implement P0195R2, C++17 variadic using.
5145 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
5146 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
5147 * error.c (dump_decl): Likewise.
5149 2017-01-09 Jakub Jelinek <jakub@redhat.com>
5151 PR translation/79019
5152 PR translation/79020
5153 * semantics.c (finish_omp_clauses): Add missing whitespace to
5154 translatable strings.
5155 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
5157 2017-01-07 Jason Merrill <jason@redhat.com>
5159 PR c++/78948 - instantiation from discarded statement
5160 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
5161 * cp-tree.h (in_discarded_stmt): Declare it.
5162 (struct saved_scope): Add discarded_stmt bitfield.
5163 (in_discarded_stmt): New macro.
5164 * decl2.c (mark_used): Check it.
5165 * parser.c (cp_parser_selection_statement): Adjust.
5166 (cp_parser_jump_statement): Adjust.
5168 2017-01-05 Jakub Jelinek <jakub@redhat.com>
5171 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
5172 REFERENCE_REF_P, set tt to its operand.
5175 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
5176 unions even for C++11 and later.
5178 2017-01-05 Nathan Sidwell <nathan@acm.org>
5181 * pt.c (convert_nontype_argument): Don't try and see if integral
5182 or enum expressions are constants prematurely.
5184 2017-01-04 Marek Polacek <polacek@redhat.com>
5187 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
5188 a zero character literal.
5190 2017-01-04 Jakub Jelinek <jakub@redhat.com>
5193 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
5197 * parser.c (cp_parser_simple_declaration): Only complain about
5198 inconsistent auto deduction if auto_result doesn't use auto.
5200 * parser.c (cp_parser_simple_declaration): Diagnose function
5201 declaration among more than one init-declarators with auto
5205 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
5206 assertion, as lexer->buffer may be NULL.
5208 2017-01-04 Marek Polacek <polacek@redhat.com>
5212 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
5214 2017-01-04 Nathan Sidwell <nathan@acm.org>
5217 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
5218 (lambda_capture_field_type): Update prototype.
5219 * lambda.c (lambda_capture_field_type): Add is_reference parm.
5220 Add referenceness here.
5221 (add_capture): Adjust lambda_capture_field_type call, refactor
5223 * pt.c (tsubst): Adjust lambda_capture_field_type call.
5225 2017-01-01 Jakub Jelinek <jakub@redhat.com>
5227 Update copyright years.
5229 Copyright (C) 2017 Free Software Foundation, Inc.
5231 Copying and distribution of this file, with or without modification,
5232 are permitted in any medium without royalty provided the copyright
5233 notice and this notice are preserved.