1 2017-11-21 Martin Liska <mliska@suse.cz>
3 * class.c (finalize_literal_type_property): Add quotes for
5 (explain_non_literal_class): Likewise.
6 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
7 (is_valid_constexpr_fn): Likewise.
8 (check_constexpr_ctor_body): Likewise.
9 (register_constexpr_fundef): Likewise.
10 (explain_invalid_constexpr_fn): Likewise.
11 (cxx_eval_builtin_function_call): Likewise.
12 (cxx_eval_call_expression): Likewise.
13 (cxx_eval_loop_expr): Likewise.
14 (potential_constant_expression_1): Likewise.
15 * decl.c (check_previous_goto_1): Likewise.
16 (check_goto): Likewise.
17 (grokfndecl): Likewise.
18 (grokdeclarator): Likewise.
19 * error.c (maybe_print_constexpr_context): Likewise.
20 * method.c (process_subob_fn): Likewise.
21 (defaulted_late_check): Likewise.
22 * parser.c (cp_parser_compound_statement): Likewise.
24 2017-11-21 Marc Glisse <marc.glisse@inria.fr>
26 * constexpr.c (cxx_eval_constant_expression,
27 potential_constant_expression_1): Handle POINTER_DIFF_EXPR.
28 * cp-gimplify.c (cp_fold): Likewise.
29 * error.c (dump_expr): Likewise.
30 * typeck.c (pointer_diff): Use POINTER_DIFF_EXPR.
32 2017-11-21 Jakub Jelinek <jakub@redhat.com>
34 P0428R2 - familiar template syntax for generic lambdas
35 * parser.c (cp_parser_lambda_declarator_opt): Don't pedwarn
36 for cxx2a and above, reword pedwarn for C++14/C++17.
38 2017-11-20 David Malcolm <dmalcolm@redhat.com>
41 * name-lookup.c: Include "c-family/known-headers.h"
42 (lookup_name_fuzzy): Call get_cp_stdlib_header_for_name and
43 potentially return a new suggest_missing_header hint.
45 2017-11-20 David Malcolm <dmalcolm@redhat.com>
48 * name-lookup.c (class macro_use_before_def): New class.
49 (lookup_name_fuzzy): Detect macro that were used before being
50 defined, and report them as such.
52 2017-11-20 Jason Merrill <jason@redhat.com>
54 * decl2.c (constrain_class_visibility): Don't warn about artificial
57 2017-11-20 Jakub Jelinek <jakub@redhat.com>
59 P0329R4: Designated Initialization
60 * parser.c (cp_parser_initializer_clause): List in comment grammar
61 designated-initializer-list.
62 (cp_parser_initializer_list): Allow .identifier = without pedwarn for
63 C++2A, parse .identifier { ... }. Improve location_t argument to
64 pedwarn. Add pedwarn for [cst] = designators. Diagnose ... in
65 designated initializer list. Diagnose mixing designated and
66 non-designated initializer clauses for C++2A. Diagnose duplicated
67 identifiers in designators.
68 * name-lookup.h (search_anon_aggr): New declaration.
69 * name-lookup.c (fields_linear_search): Use search_anon_aggr.
70 (search_anon_aggr): New function.
71 * typeck2.c (process_init_constructor_record): Allow designator
72 to skip over some non-static data members. Handle anonymous
73 aggregates. Add diagnostics for designator order not matching
74 member declaration order.
76 2017-11-20 David Malcolm <dmalcolm@redhat.com>
78 * name-lookup.c: Define INCLUDE_UNIQUE_PTR before including system.h.
79 Include "c-family/name-hint.h"
80 (suggest_alternatives_for): Convert "fuzzy_name" from const char *
81 to name_hint, and rename to "hint". Pass location to
83 (lookup_name_fuzzy): Convert return type from const char *
84 to name_hint. Add location_t param.
85 * parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
86 Include "c-family/name-hint.h"
87 (cp_parser_diagnose_invalid_type_name): Convert
88 "suggestion" from const char * to name_hint, and rename to "hint".
89 Pass location to lookup_name_fuzzy.
91 2017-11-20 Nathan Sidwell <nathan@acm.org>
95 * call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited
97 * cp-gimplify.c (cp_genericize_r): Restore THUNK dereference
98 inhibibition check removed in previous c++/78495 change.
100 2017-11-20 Jakub Jelinek <jakub@redhat.com>
103 * constexpr.c (cxx_eval_vector_conditional_expression): New function.
104 (cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
105 of cxx_eval_conditional_expression.
107 2017-11-19 Jakub Jelinek <jakub@redhat.com>
111 * cp-gimplify.c (c_fully_fold): Add LVAL argument, call
112 cp_fold_maybe_rvalue instead of cp_fold_rvalue and pass it !LVAL.
114 2017-11-16 Jason Merrill <jason@redhat.com>
116 PR c++/79092 - non-type args of different types are different
117 * tree.c (cp_tree_equal): Check the type of constants.
118 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Handle UNIFY_ALLOW_INTEGER
119 when comparing to previously deduced argument.
120 (maybe_convert_nontype_argument): New.
121 (convert_nontype_argument): Call it.
122 (tsubst_copy_and_build): Handle partial instantiation of
124 (unify): Ignore type when deducing from array bound.
125 (dependent_type_p_r): Handle DEFERRED_NOEXCEPT.
126 (value_dependent_expression_p): Any type-dependent expression is
127 value-dependent. Handle IMPLICIT_CONV_EXPR.
128 * cp-tree.h (IMPLICIT_CONV_EXPR_NONTYPE_ARG): New.
129 * mangle.c (write_template_arg): Strip IMPLICIT_CONV_EXPR.
131 2017-11-16 Nathan Sidwell <nathan@acm.org>
135 * cp-objcp-common.h (LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME):
137 * cp-tree.h (overwrite_mangling): Declare.
138 * decl2.c (struct mangled_decl_hash): Entries are deletable.
139 (overwrite_mangling): New.
142 * decl.c (xref_tag_1): Push lambda into current scope.
143 * name-lookup.c (do_pushtag): Don't deal with ts_lambda here.
145 2017-11-15 Nathan Sidwell <nathan@acm.org>
148 * lambda.c (lambda_capture_field_type): Function references are
149 always catured by reference.
151 2017-11-15 Martin Liska <mliska@suse.cz>
153 * decl.c (begin_destructor_body): Use cp_build_fold_indirect_ref
154 instead of cp_build_indirect_ref.
156 2017-11-15 Martin Liska <mliska@suse.cz>
158 * decl.c (begin_destructor_body): In case of VPTR sanitization
159 (with disabled recovery), zero vptr in order to catch virtual calls
160 after lifetime of an object.
162 2017-11-14 Jason Merrill <jason@redhat.com>
164 Use GTY((cache)) on some hash tables.
165 * decl.c (decomp_type_table): Use tree_cache_map.
166 * init.c (nsdmi_inst): Likewise.
167 * pt.c (defarg_ints): Likewise.
168 * cp-objcp-common.c (cp_get_debug_type): Likewise.
170 2017-11-13 Jason Merrill <jason@redhat.com>
172 Capture adjustments for P0588R1.
173 * semantics.c (process_outer_var_ref): Capture variables when
174 they are named; complain about non-capture uses when odr-used.
175 * expr.c (mark_use): Rvalue use looks through capture proxy.
176 * constexpr.c (potential_constant_expression_1): Improve error about
177 use of captured variable.
178 * lambda.c (need_generic_capture, dependent_capture_r)
179 (do_dependent_capture, processing_nonlambda_template): Remove.
180 * call.c (build_this): Remove uses of the above.
181 * decl.c (cp_finish_decl): Likewise.
182 * semantics.c (maybe_cleanup_point_expr)
183 (maybe_cleanup_point_expr_void, finish_goto_stmt)
184 (maybe_convert_cond): Likewise.
185 * typeck.c (check_return_expr): Likewise.
188 * typeck.c (cp_build_fold_indirect_ref): New.
189 (cp_build_indirect_ref_1): Split out from cp_build_indirect_ref.
190 Add 'fold' parameter.
191 * cp-tree.h: Declare cp_build_fold_indirect_ref.
192 * call.c, class.c, cp-ubsan.c, decl.c, except.c, init.c, lambda.c,
193 parser.c, rtti.c, tree.c, typeck.c, typeck2.c: Use it.
194 * parser.c (do_range_for_auto_deduction): Use RO_UNARY_STAR.
195 (cp_convert_range_for): Likewise.
196 * typeck2.c (build_x_arrow): Use RO_ARROW.
198 * cp-ubsan.c (cp_ubsan_check_member_access_r): Fix handling of
199 INDIRECT_REF of ADDR_EXPR.
201 PR c++/82360 - ICE with static_cast in template.
202 * call.c (perform_direct_initialization_if_possible): Check
203 processing_template_decl.
204 * typeck.c (build_static_cast_1): Likewise.
206 2017-11-13 Ville Voutilainen <ville.voutilainen@gmail.com>
208 Remove the null check from placement new in all modes
209 * init.c (build_new_1): Don't do a null check for
210 a namespace-scope non-replaceable placement new
211 in any mode unless -fcheck-new is provided.
213 2017-11-07 Boris Kolpackov <boris@codesynthesis.com>
215 * Make-lang.in (CP_PLUGIN_HEADERS): Add operators.def since included
218 2017-11-07 Jakub Jelinek <jakub@redhat.com>
221 * cp-gimplify.c (cxx_omp_clause_apply_fn): For methods pass i - 1 to
222 convert_default_arg instead of i.
224 2017-11-06 Jason Merrill <jason@redhat.com>
226 P0704R1 - fixing const-qualified pointers to members
227 * typeck2.c (build_m_component_ref): Also accept in lower stds with
230 2017-11-06 Paolo Carlini <paolo.carlini@oracle.com>
233 * decl2.c (finish_static_data_member_decl): If there's an initializer,
234 complete the type and re-apply the quals.
236 2017-11-06 Martin Liska <mliska@suse.cz>
239 * constexpr.c (cxx_eval_builtin_function_call): Handle
240 __builtin_unreachable call.
241 (get_function_named_in_call): Declare function earlier.
242 (constexpr_fn_retval): Skip __builtin_unreachable.
243 * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Rename to
245 (cp_maybe_instrument_return): ... this.
246 (cp_genericize): Call the function unconditionally.
248 2017-11-03 Nathan Sidwell <nathan@acm.org>
251 * decl.c (grokdeclarator): Protect MAYBE_CLASS things from paren
254 2017-11-02 Paolo Carlini <paolo.carlini@oracle.com>
257 * pt.c (make_pack_expansion): Add tsubst_flags_t parameter.
258 (expand_integer_pack, convert_template_argument, coerce_template_parms,
259 gen_elem_of_pack_expansion_instantiation, tsubst_pack_expansion,
260 unify): Adjust calls.
261 * tree.c (cp_build_qualified_type_real): Likewise.
262 * cp-tree.h (make_pack_expansion): Adjust declaration.
264 2017-11-02 Nathan Sidwell <nathan@acm.org>
266 * cp-tree.h (IDENTIFIER_NEWDEL_OP_P): Restore, adjust.
267 (IDENTIFIER_NEW_OP_P): New.
268 * decl.c (grokdeclarator): Restore IDENTIFIER_NEWDEL_OP_P use.
269 * pt.c (push_template_decl_real): Likewise.
270 * typeck.c (check_return_expr): Use IDENTIFIER_NEW_OP_P.
273 * decl.c (grokdeclarator): Don't warn when parens protect a return
274 type from a qualified name.
276 2017-11-01 Nathan Sidwell <nathan@acm.org>
278 * cp-tree.h (enum cp_identifier_kind): Delete cik_newdel_op.
279 Renumber and reserve udlit value.
280 (IDENTIFIER_NEWDEL_OP_P): Delete.
281 (IDENTIFIER_OVL_OP_P): New.
282 (IDENTIFIER_ASSIGN_OP_P): Adjust.
283 (IDENTIFIER_CONV_OP_P): Adjust.
284 (IDENTIFIER_OVL_OP_INFO): Adjust.
285 (IDENTIFIER_OVL_OP_FLAGS): New.
286 * decl.c (grokdeclarator): Use IDENTIFIER_OVL_OP_FLAGS.
287 * lex.c (get_identifier_kind_name): Adjust.
288 (init_operators): Don't special case new/delete ops.
289 * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_P.
290 * pt.c (push_template_decl_real): Use IDENTIFIER_OVL_OP_FLAGS.
291 * typeck.c (check_return_expr): Likewise.
293 * cp-tree.h (assign_op_identifier, call_op_identifier): Use
295 (struct lang_decl_fn): Use compressed operator code.
296 (DECL_OVERLOADED_OPERATOR_CODE): Replace with ...
297 (DECL_OVERLOADED_OPERATOR_CODE_RAW): ... this.
298 (DECL_OVERLOADED_OPERATOR_CODE_IS): Use it.
299 * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE_RAW.
300 (build_library_fn): Likewise.
301 (grok_op_properties): Likewise.
302 * mangle.c (write_unqualified_name): Likewise.
303 * method.c (implicitly_declare_fn): Likewise.
304 * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_IS.
306 * cp-tree.h (IDENTIFIER_CP_INDEX): Define.
307 (enum ovl_op_flags): Add OVL_OP_FLAG_AMBIARY.
308 (enum ovl_op_code): New.
309 (struct ovl_op_info): Add ovl_op_code field.
310 (ovl_op_info): Size by OVL_OP_MAX.
311 (ovl_op_mapping, ovl_op_alternate): Declare.
312 (OVL_OP_INFO): Adjust for mapping array.
313 (IDENTIFIER_OVL_OP_INFO): New.
314 * decl.c (ambi_op_p, unary_op_p): Delete.
315 (grok_op_properties): Use IDENTIFIER_OVL_OP_INFO and
317 * lex.c (ovl_op_info): Adjust and static initialize.
318 (ovl_op_mappings, ovl_op_alternate): Define.
319 (init_operators): Iterate over ovl_op_info array and init mappings
321 * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_INFO.
322 * operators.def (DEF_OPERATOR): Remove KIND parm.
323 (DEF_SIMPLE_OPERATOR): Delete.
324 (OPERATOR_TRANSITION): Expand if defined.
326 2017-10-31 David Malcolm <dmalcolm@redhat.com>
328 * pt.c (listify): Use %< and %> for description of #include.
330 2017-10-31 David Malcolm <dmalcolm@redhat.com>
332 * class.c (explain_non_literal_class): Use UNKNOWN_LOCATION rather
334 * name-lookup.c (suggest_alternatives_for): Update for renaming of
336 (maybe_suggest_missing_header): Likewise.
337 (suggest_alternative_in_explicit_scope): Likewise.
338 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise for
339 renaming of error_at_rich_loc.
340 (cp_parser_string_literal): Likewise.
341 (cp_parser_nested_name_specifier_opt): Likewise.
342 (cp_parser_cast_expression): Likewise for renaming of
344 (cp_parser_decl_specifier_seq): Likewise for renaming of
345 error_at_rich_loc and warning_at_rich_loc.
346 (cp_parser_elaborated_type_specifier): Likewise for renaming of
348 (cp_parser_cv_qualifier_seq_opt): Likewise for renaming of
350 (cp_parser_virt_specifier_seq_opt): Likewise.
351 (cp_parser_class_specifier_1): Likewise.
352 (cp_parser_class_head): Likewise.
353 (cp_parser_member_declaration): Likewise for renaming of
354 pedwarn_at_rich_loc, warning_at_rich_loc, and error_at_rich_loc.
355 (cp_parser_enclosed_template_argument_list): Likewise for renaming
356 of error_at_rich_loc.
357 (set_and_check_decl_spec_loc): Likewise.
358 * pt.c (listify): Likewise.
359 * rtti.c (typeid_ok_p): Likewise.
360 * semantics.c (process_outer_var_ref): Use UNKNOWN_LOCATION rather
362 * typeck.c (access_failure_info::maybe_suggest_accessor): Update
363 for renaming of inform_at_rich_loc.
364 (finish_class_member_access_expr): Likewise for renaming of
367 2017-10-31 Nathan Sidwell <nathan@acm.org>
369 * cp-tree.h (struct operator_name_info_t): Rename to ...
370 (struct ovl_op_info_t): ... here. Add tree_code field.
371 (operator_name_info, assignment_operator_name_info): Delete.
372 (ovl_op_info): Declare.
373 (OVL_OP_INFO): Adjust.
374 * decl.c (grok_op_properties): Use ovl_op_flags.
375 * lex.c (operator_name_info, assignment_operator_name_info):
377 (ovl_op_info): Define.
378 (set_operator_ident): Adjust.
379 (init_operators): Set tree_code.
380 * mangle.c (write_unqualified_id): Adjust operator array scan.
382 * lex.c (init_operators): Allow NULL operator name. Don't add
384 * operators.def: Use NULL for mangling only operators. Move to
385 after regular operators but move assignment operators last.
387 * cp-tree.h (enum ovl_op_flags): New.
388 (struct operator_name_info_t): Rename arity to flags.
389 * lex.c (set_operator_ident): New.
390 (init_operators): Use it. Adjust for flags.
391 * mangle.c (write_unqualified_id): Adjust for flags.
392 * operators.def: Replace arity with flags.
394 * cp-tree.h (ovl_op_identifier): New.
395 (assign_op_identifier, call_op_identifier): Adjust.
396 (cp_operator_id, cp_assignment_operator_ide): Delete.
397 (SET_OVERLOADED_OPERATOR_CODE): Delete.
399 * call.c (op_error): Use OVL_OP_INFO.
400 (build_conditional_expr_1): Use ovl_op_identifier.
401 (build_new_op_1): Use OVL_OP_INFO & ovl_op_identifier.
402 (build_op_delete_call): Likewise.
403 * class.c (type_requires_array_cookie): Use ovl_op_identifier.
404 * decl.c (duplicate_decls): Directly copy operator code.
405 (builtin_function_1): Do not set operator code.
406 (build_library_fn): Directly set operator code.
407 (push_cp_library_fn): Use ovl_op_identifier.
408 (grok_op_properties): Directly set operator code.
409 * decl2.c (maybe_warn_sized_delete): Use ovl_op_identifier.
410 * error.c (dump_expr): Use OVL_OP_INFO.
411 (op_to_string): Add assop arg. Use OVL_OP_INFO.
412 (assop_to_string): Delete.
413 (args_to_string): Adjust.
414 * init.c (build_new_1): Use ovl_op_identifier.
415 * mangle.c (write_unqualified_name): Use OVL_OP_INFO.
416 (write_expression): Likewise.
417 * method.c (synthesized_method_walk): Use ovl_op_identifier.
418 (implicitly_declare_fn): Use assign_op_identifier. Directly set
420 * name-lookup.c (get_class_binding): Use assign_op_identifier.
421 * parser.c (cp_parser_operator): Use ovl_op_identifier.
422 (cp_parser_omp_clause_reduction): Likewise.
423 * semantics.c (omp_reduction_id): Likewise.
424 * typeck.c (cxx_sizeof_or_alignof_type): Use OVL_OP_INFO.
426 * cp-tree.h (assign_op_identifier, call_op_identifier): Define.
427 (LAMBDA_FUNCTION_P): Use DECL_OVERLOADED_OPERATOR_IS.
428 (DECL_OVERLOADED_OPERATOR_P): Just retuurn true/false.
429 (DECL_OVERLOADED_OPERATOR_CODE, DECL_OVERLOADED_OPERATOR_IS): Define.
430 * call.c (add_function_candidate): Use
431 DECL_OVERLOADED_OPERATOR_IS.
432 (build_op_call_1): Use call_op_identifier &
433 DECL_OVERLOADED_OPERATOR_IS.
434 (build_over_call): Likewise.
435 (has_trivial_copy_assign_p): Use assign_op_identifier.
436 (build_special_member_call): Likewise.
437 * class.c (dfs_declare_virt_assop_and_dtor): Likewise.
438 (vbase_has_user_provided_move_assign,
439 classtype_has_move_assign_or_move_ctor_p): Likewise.
440 * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE.
441 (grok_special_member_properties): Use assign_op_identifier.
442 (start_preparsed_function): Use DECL_OVERLOADED_OPERATOR_IS.
443 * decl2.c (mark_used): Use DECL_CONV_FN_P.
444 * dump.c (dump_access): Delete prototype.
446 (cp_dump_tree): Don't call it.
447 * lambda.c (lambda_function): Use call_op_identifier.
448 (maybe_add_lambda_conv_op): Not an overloaded operator. Remove
450 * mangle.c (write_unqualified_name): Use DECL_OVERLOADED_OPERTOR_CODE.
451 * method.c (do_build_copy_assign): Use assign_op_identifier.
452 (synthesize_method): Use DECL_OVERLOADED_OPERATOR_IS.
453 (get_copy_assign): Use assign_op_identifier.
454 (synthesized_method_walk): Likewise.
455 (defaultable_fn_check): Use DECL_OVERLOADED_OPERATOR_IS.
456 * parser.c (cp_parser_lambda_declarator_opt): Use
458 * semanitics.c (classtype_has_nothrow_assign_or_copy_p): Use
459 assign_op_identifier.
460 * tree.c (special_function_p): Use DECL_OVERLOADED_OPERATOR_IS.
461 * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_CODE.
462 (check_return_expr): Use assign_op_identifier.
464 2017-10-30 Paolo Carlini <paolo.carlini@oracle.com>
467 * pt.c (tsubst_copy_and_build, [INDIRECT_REF]): For a REFERENCE_REF_P,
468 unconditionally call convert_from_reference.
470 2017-10-30 Nathan Sidwell <nathan@acm.org>
472 * call.c (build_op_call_1): Test for FUNCTION_DECL in same manner
473 as a few lines earlier.
474 * cp-tree.h (PACK_EXPANSION_PATTERN): Fix white space.
475 * decl.c (grokfndecl): Fix indentation.
476 (compute_array_index_type): Use processing_template_decl_sentinel.
477 (grok_op_properties): Move warnings to end. Reorder other checks
478 to group similar entities. Tweak diagnostics.
479 * lex.c (unqualified_name_lookup_error): No need to check name is
480 not ERROR_MARK operator.
481 * parser.c (cp_parser_operator): Select operator code before
483 * typeck.c (check_return_expr): Fix indentation and line wrapping.
485 2017-10-27 Paolo Carlini <paolo.carlini@oracle.com>
487 * pt.c (invalid_nontype_parm_type_p): Return a bool instead of an int.
489 2017-10-26 Nathan Sidwell <nathan@acm.org>
491 * decl.c (sort_labels): Restore function.
492 (pop_labels): Sort labels
493 (identify_goto): Add translation markup.
495 2017-10-25 Nathan Sidwell <nathan@acm.org>
497 Kill IDENTIFIER_LABEL_VALUE.
498 * cp-tree.h (lang_identifier): Delete label_value slot.
499 (IDENTIFIER_LABEL_VALUE, SET_IDENTIFIER_LABEL_VALUE): Delete.
500 (struct named_label_hasher): Rename to ...
501 (struct named_label_hash): ... here. Reimplement.
502 (struct language_function): Adjust x_named_labels.
503 * name-lookup.h (struct cp_label_binding): Delete.
504 (struct cp_binding_level): Delete shadowed_labels slot.
505 * decl.c (struct named_label_entry): Add name and outer slots.
506 (pop_label): Rename to ...
507 (check_label_used): ... here. Don't pop.
508 (note_label, sort_labels): Delete.
509 (pop_labels, pop_local_label): Reimplement.
510 (poplevel): Pop local labels as any other decl. Remove
511 shadowed_labels handling.
512 (named_label_hash::hash, named_label_hash::equal): New.
513 (make_label_decl): Absorb into ...
514 (lookup_label_1): ... here. Add making_local_p arg, reimplement.
515 (lookup_label, declare_local_label): Adjust.
516 (check_goto, define_label): Adjust.
517 * lex.c (make_conv_op_name): Don't clear IDENTIFIER_LABEL_VALUE.
518 * ptree.c (cxx_print_identifier): Don't print identifier binding.
520 * decl.c (identifier_goto): Reduce duplication.
521 (check_previous_goto_1): Likewise.
522 (check_goto): Move var decls to initialization.
523 (check_omp_return, define_label_1, define_label): Likewise.
525 2017-10-25 Jakub Jelinek <jakub@redhat.com>
528 * decl.c (duplicate_decls): Copy "omp declare simd" attributes from
529 newdecl to corresponding __builtin_ if any.
531 2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
534 * decl.c (duplicate_decls): Warn for built-in functions declared as
535 non-function, use OPT_Wbuiltin_declaration_mismatch.
537 * decl.c (duplicate_decls): Avoid redundant '+' in warning_at.
539 2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
542 * pt.c (value_dependent_expression_p, [TRAIT_EXPR]): Handle
543 a TREE_LIST as TRAIT_EXPR_TYPE2.
545 2017-10-24 Mukesh Kapoor <mukesh.kapoor@oracle.com>
546 Paolo Carlini <paolo.carlini@oracle.com>
549 * cvt.c (type_promotes_to): Implement C++17, 7.6/4, about unscoped
550 enumeration type whose underlying type is fixed.
552 2017-10-23 Paolo Carlini <paolo.carlini@oracle.com>
555 * semantics.c (finish_compound_literal): Check do_auto_deduction
556 return value for error_mark_node.
558 2017-10-23 Jason Merrill <jason@redhat.com>
560 PR c++/77369 - wrong noexcept handling in C++14 and below
561 * tree.c (strip_typedefs): Canonicalize TYPE_RAISES_EXCEPTIONS.
563 2017-10-20 Nathan Sidwell <nathan@acm.org>
565 * class.c (layout_class_type): Cleanup as-base creation, determine
567 (finish_struct_1): ... not here.
569 2017-10-19 Jakub Jelinek <jakub@redhat.com>
572 * typeck.c (check_return_expr): Don't call
573 maybe_warn_about_returning_address_of_local in templates.
575 2017-10-17 Nathan Sidwell <nathan@acm.org>
578 * call.c (build_over_call): Don't pass tf_no_cleanup to nested
582 * cp-objcp-common.c (cp_tree_size): Reformat. Adjust returns size
585 2017-10-13 Jason Merrill <jason@redhat.com>
587 PR c++/82357 - bit-field in template
588 * tree.c (cp_stabilize_reference): Just return a NON_DEPENDENT_EXPR.
590 2017-10-13 David Malcolm <dmalcolm@redhat.com>
592 * cp-tree.h (maybe_show_extern_c_location): New decl.
593 * decl.c (grokfndecl): When complaining about literal operators
594 with C linkage, issue a note giving the location of the
596 * parser.c (cp_parser_new): Initialize new field
597 "innermost_linkage_specification_location".
598 (cp_parser_linkage_specification): Store the location
599 of the linkage specification within the cp_parser.
600 (cp_parser_explicit_specialization): When complaining about
601 template specializations with C linkage, issue a note giving the
602 location of the extern "C".
603 (cp_parser_explicit_template_declaration): Likewise for templates.
604 (maybe_show_extern_c_location): New function.
605 * parser.h (struct cp_parser): New field
606 "innermost_linkage_specification_location".
608 2017-10-12 Nathan Sidwell <nathan@acm.org>
610 * cp-tree.h (cp_expr): Add const operator * and operator->
612 (cp_tree_node_structure_enum): Delete TS_CP_BINDING,
613 TS_CP_WRAPPER, LAST_TS_CP_ENUM.
615 2017-10-12 David Malcolm <dmalcolm@redhat.com>
617 * parser.c (get_required_cpp_ttype): New function.
618 (cp_parser_error_1): Call it, using the result to call
619 maybe_suggest_missing_token_insertion.
621 2017-10-12 David Malcolm <dmalcolm@redhat.com>
623 * parser.c (get_matching_symbol): Move to before...
624 (cp_parser_error): Split out into...
625 (cp_parser_error_1): ...this new function, merging in content
627 (cp_parser_required_error): ...here. Eliminate partial duplicate
628 of body of cp_parser_error in favor of a call to the new
629 cp_parser_error_1 helper function.
631 2017-10-11 Nathan Sidwell <nathan@acm.org>
633 * decl2.c (struct mangled_decl_hash): Use DECL_ASSEMBLER_NAME_RAW.
634 (record_mangling): Likewise.
636 2017-10-10 Nathan Sidwell <nathan@acm.org>
638 * name-lookup.c (extern_c_fns): Rename to ...
639 (extern_c_decls): ... here.
640 (check_extern_c_conflict, extern_c_linkage_bindings): Update.
641 (do_pushdecl): Check extern-c fns and vars.
643 * cp-tree.h (default_hash_traits <lang_identifier *>): Delete
646 * decl2.c (struct mangled_decl_hash): New hash traits.
647 (mangled_decls): Make hash_table<mangled_decl_hash>.
648 (generate_mangling_alias, record_mangling): Adjust.
650 2017-10-10 Jason Merrill <jason@redhat.com>
652 More delayed lambda capture fixes.
653 * call.c (add_function_candidate): Use build_address.
654 (build_op_call_1): Call mark_lvalue_use early.
655 (build_over_call): Handle error from build_this.
656 * constexpr.c (cxx_bind_parameters_in_call): Use build_address.
657 (cxx_eval_increment_expression): Don't use rvalue().
658 * cvt.c (convert_to_void): Use mark_discarded_use.
659 * expr.c (mark_use): Handle PARM_DECL, NON_DEPENDENT_EXPR. Fix
660 reference handling. Don't copy the expression.
661 (mark_discarded_use): New.
662 * lambda.c (insert_capture_proxy): Add some sanity checking.
663 (maybe_add_lambda_conv_op): Set cp_unevaluated_operand.
664 * pt.c (register_local_specialization): Add sanity check.
665 * semantics.c (process_outer_var_ref): Fix check for existing proxy.
666 * typeck.c (cp_build_addr_expr_1): Handle error from
668 (cp_build_modify_expr): Call mark_lvalue_use_nonread, handle error
671 Handle generic lambda capture in dependent expressions.
672 * lambda.c (need_generic_capture, dependent_capture_r)
673 (do_dependent_capture): New.
674 * pt.c (processing_nonlambda_template): Use need_generic_capture.
675 * semantics.c (maybe_cleanup_point_expr)
676 (maybe_cleanup_point_expr_void, finish_goto_stmt)
677 (maybe_convert_cond): Call do_dependent_capture.
678 * typeck.c (build_static_cast): Remove dependent capture handling.
680 * typeck.c (condition_conversion): Assert !processing_template_decl.
681 * semantics.c (finish_omp_clauses): Don't
682 fold_build_cleanup_point_expr if processing_template_decl.
683 (outer_var_p): A temporary can't be from an outer scope.
684 * pt.c (type_dependent_expression_p): Fix dependency checking of
685 functions without DECL_TEMPLATE_INFO.
686 (instantiate_decl): Use lss_copy.
687 * constexpr.c (is_valid_constexpr_fn): Fix lambdas before C++17.
689 * typeck.c (check_return_expr): Check non-dependent conversion in
691 * constraint.cc (check_function_concept): Don't complain about an
692 empty concept if seen_error.
694 2017-10-10 Richard Sandiford <richard.sandiford@linaro.org>
696 * cvt.c (ignore_overflows): Use wi::to_wide when
697 operating on trees as wide_ints.
698 * decl.c (check_array_designated_initializer): Likewise.
699 * mangle.c (write_integer_cst): Likewise.
700 * semantics.c (cp_finish_omp_clause_depend_sink): Likewise.
702 2017-10-10 Nathan Sidwell <nathan@acm.org>
704 * name-lookup.c (set_global_binding): Don't deal with STAT_HACK.
706 2017-10-06 Paolo Carlini <paolo.carlini@oracle.com>
709 * decl.c (finish_function): Take a bool intead of an int; adjust.
710 * cp-tree.h (finish_function): Adjust declaration.
711 * decl2.c (generate_tls_wrapper, finish_objects,
712 finish_static_storage_duration_function): Adjust calls.
713 * lambda.c (maybe_add_lambda_conv_op, finish_lambda_function):
715 * method.c (synthesize_method): Likewise.
716 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
717 * pt.c (instantiate_decl): Likewise.
718 * parser.c (cp_parser_function_definition_after_declarator,
719 cp_parser_late_parsing_for_member, cp_parser_omp_declare_reduction):
721 (cp_parser_ctor_initializer_opt,
722 cp_parser_ctor_initializer_opt_and_function_body,
723 cp_parser_function_try_block,
724 cp_parser_function_definition_after_declarator,
725 cp_parser_function_transaction): Return void; adjust declarations.
727 2017-10-06 Nathan Sidwell <nathan@acm.org>
730 * name-lookup.c (check_local_shadow): Don't try and convert
733 2017-10-06 Jakub Jelinek <jakub@redhat.com>
736 * decl.c (reshape_init): Suppress warn_useless_cast for direct enum
738 * typeck.c (convert_for_assignment): Likewise.
740 P0704R1 - fixing const-qualified pointers to members
741 * typeck2.c (build_m_component_ref): For -std=c++2a allow
742 pointer to const & qualified method on rvalue.
744 2017-10-06 Nathan Sidwell <nathan@acm.org>
746 Use hash_table for extern "C" names
747 * name-lookup.c (extern_c_fns): Use hash_table.
748 (check_extern_c_conflict): Adjust.
749 (c_linkage_bindings): Adjust.
751 Use hash_table for namespace bindings
752 * cp-tree.h (struct named_decl_hash): New.
753 (lang_decl_ns): Change type of bindings field.
754 * lex.c (maybe_add_lang_decl_raw): Adjust.
755 * name-lookup.c (find_namespace_slot): Adjust.
756 (do_pushdecl): Push NULL-named namespace.
757 (do_push_nested_namespace): Adjust.
758 (push_namespace): Push anonymous namespace as NULL name.
760 2017-10-05 Jason Merrill <jason@redhat.com>
762 Pass variadic class objects exactly like named by-value args.
763 * call.c (convert_arg_to_ellipsis): Use the result of force_rvalue.
765 2017-10-05 Nathan Sidwell <nathan@acm.org>
767 Warn on MVP declarations
768 * cp-tree.h (struct cp_declarator): Add parenthesized field.
769 * decl.c (grokdeclarator): Warn about unnecessary parens.
770 * parser.c (make_declarator): Init parenthesized field.
771 (cp_parser_direct_declarator): Set parenthesized field.
773 Kill IDENTIFIER_GLOBAL_VALUE, SET_IDENTIFIER_GLOBAL_VALUE
774 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
775 SET_IDENTIFIER_GLOBAL_VALUE): Delete.
776 * name-lookup.h (set_global_binding): Remove NAME parm.
777 (get_global_binding): New inline fn.
778 * name-lookup.c (set_global_binding): Remove NAME parm. Adjust.
779 (identifier_global_value): Move to ...
780 * cp-objcp-common.c (identifier_global_value): ... here.
781 * class.c (build_ctor_vtbl_group, build_vtbl_initializer): Adjust.
782 * decl.c (record_builtin_type, expand_static_init,
783 grokdeclarator): Adjust.
784 * decl2.c (get_guard, get_local_tls_init_fn, get_tls_init_fn,
785 get_tls_wrapper_fn, maybe_warn_sized_delete): Adjust.
786 * except.c (declare_library_fn, build_throw): Adjust.
787 * init.c (throw_bad_array_length): Adjust.
788 * rtti.c (throw_bad_cast, throw_bad_typeid, get_tinfo_decl): Adjust.
790 * decl2.c (record_mangling): Fix spello and formatting from
793 2017-10-04 Nathan Sidwell <nathan@acm.org>
795 Give builtin types the correct name.
796 * name-lookup.c (set_global_binding): Assert name is DECL_NAME.
797 * decl.c (record_builtin_type): Reimplement, use new TYPE_DECL for
800 2017-10-04 Paolo Carlini <paolo.carlini@oracle.com>
801 Andrew Pinski <apinski@cavium.com>
804 * parser.c (cp_parser_lambda_body): Set parser->in_function_body.
806 2017-10-04 Nathan Sidwell <nathan@acm.org>
808 Move mangling aliases out of global namespace.
809 * cp-tree.h (record_mangling): New.
810 (maybe_remove_implicit_alias): Delete.
811 * decl2.c (mangled_decls): New hash map.
812 (generate_mangling_alias): Reimplement using mangled_decls.
813 (record_mangling): New.
814 * mangle.c (decl_implicit_alias_p,
815 maybe_remove_implicit_alias): Delete.
816 (mangle_decl): Use record_mangling.
817 * name-lookup.c (supplement_binding_1): Remove
818 maybe_remove_implicit_alias check.
820 2017-10-04 Jakub Jelinek <jakub@redhat.com>
823 * error.c (dump_function_decl): If show_return, call dump_type_suffix
824 on the same return type dump_type_prefix has been called on.
826 2017-10-04 Jason Merrill <jason@redhat.com>
828 PR c++/81525 - broken handling of auto in generic lambda.
829 * pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.
831 2017-10-04 Nathan Sidwell <nathan@acm.org>
833 * call.c (convert_arg_to_ellipsis): Correct comment about passing
836 2017-10-02 Richard Sandiford <richard.sandiford@linaro.org>
838 * constexpr.c (cxx_eval_store_expression): Use wi::to_widest
839 when comparing the array bounds with an ARRAY_REF index.
841 2017-09-30 Paolo Carlini <paolo.carlini@oracle.com>
844 * method.c (defaulted_late_check): Early return if the defaulted
845 declaration does not match the expected signature.
847 2017-09-29 Jakub Jelinek <jakub@redhat.com>
849 P0683R1 - default member initializers for bit-fields
850 * cp-tree.h (grokbitfield): Add INIT parameter.
851 * parser.c (cp_parser_constant_expression): Add STRICT_P argument,
852 if true, parse a conditional-expression rather than
853 assignment-expression.
854 (cp_parser_member_declaration): For C++11 and later pass true
855 as STRICT_P to cp_parser_constant_expression. Parse C++2A bitfield
856 NSDMIs. Adjust grokbitfield caller. Handle DECL_INITIAL also for
858 (cp_parser_objc_class_ivars): Adjust grokbitfield caller.
859 * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs.
860 (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs.
861 * decl2.c (grokbitfield): Add INIT parameter, pass it to
863 * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not
866 * class.c (check_bitfield_decl): Retrieve and clear width from
867 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
868 (check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than
870 (remove_zero_width_bit_fields): Adjust comment.
871 * decl2.c (grokbitfield): Stash width into
872 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
873 * pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr
874 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width.
876 * parser.c (cp_parser_member_declaration): Parse attributes before
877 colon of a bitfield in addition to after colon.
879 * Make-lang.in (check-c++-all): Test also c++2a.
881 2017-09-28 Jason Merrill <jason@redhat.com>
883 PR c++/56973, DR 696 - capture constant variables only as needed.
884 * expr.c (mark_use): Split out from mark_rvalue_use and
885 mark_lvalue_use. Handle lambda capture of constant variables.
886 (mark_lvalue_use_nonread): New.
887 * semantics.c (process_outer_var_ref): Don't capture a constant
888 variable until forced.
889 * pt.c (processing_nonlambda_template): New.
890 * call.c (build_this): Check it.
891 * decl2.c (grok_array_decl): Call mark_rvalue_use and
892 mark_lvalue_use_nonread.
893 * init.c (constant_value_1): Don't call mark_rvalue_use.
894 * typeck.c (build_static_cast): Handle lambda capture.
896 Use local_specializations to find capture proxies.
897 * cp-tree.h (DECL_CAPTURED_VARIABLE): New.
898 * lambda.c (build_capture_proxy): Set it.
899 (add_capture): Pass initializer to build_capture_proxy.
900 (start_lambda_function): Likewise.
901 (insert_capture_proxy): Use register_local_specialization.
902 (is_lambda_ignored_entity): Always ignore proxies.
903 * name-lookup.c (qualify_lookup): Don't check
904 is_lambda_ignored_entity if LOOKUP_HIDDEN is set.
905 * semantics.c (process_outer_var_ref): Use
906 retrieve_local_specialization.
907 * parser.c (cp_parser_lambda_body): Push local_specializations.
908 * pt.c (tsubst_expr): Pass LOOKUP_HIDDEN when looking for a proxy.
909 (tsubst_lambda_expr): Push local_specializations sooner.
910 (tsubst_copy_and_build): Don't register_local_specialization.
912 * call.c (build_special_member_call): Use the return value of
914 * decl.c (compute_array_index_type): Likewise.
915 * parser.c (cp_parser_oacc_wait_list): Likewise.
916 * lambda.c (is_normal_capture_proxy): Handle *this capture.
917 (add_capture): Clarify internal_error message.
919 2017-09-22 Eric Botcazou <ebotcazou@adacore.com>
922 * cp-objcp-common.c (cp_get_debug_type): Do only one lookup.
924 2017-09-22 Jakub Jelinek <jakub@redhat.com>
927 * tree.c (struct replace_placeholders_t): Add pset field.
928 (replace_placeholders_r): Call cp_walk_tree with d->pset as
929 last argument instead of NULL. Formatting fix.
930 (replace_placeholders): Add pset variable, add its address
931 into data. Pass &pset instead of NULL to cp_walk_tree.
933 2017-09-22 David Malcolm <dmalcolm@redhat.com>
935 * call.c (get_fndecl_argument_location): New function.
936 (convert_like_real): Use it when complaining about argument type
938 * cp-tree.h (struct cp_parameter_declarator): Add "loc" field.
939 * parser.c (make_parameter_declarator): Add "loc" param and use
940 it to initialize the new field.
941 (cp_parser_translation_unit): Add UNKNOWN_LOCATION for "loc" of
942 the "no_parameters" parameter.
943 (cp_parser_parameter_declaration_list): Set the location of the
944 result of grokdeclarator to be the parameter's loc, assuming no
946 (cp_parser_parameter_declaration): Generate a location for the
947 parameter and pass to make_parameter_declarator.
949 2017-09-20 Nathan Sidwell <nathan@acm.org>
951 * name-lookup.c (member_name_cmp): Use DECL_UID for final
954 2017-09-20 Jakub Jelinek <jakub@redhat.com>
956 P0409R2 - allow lambda capture [=, this]
957 * parser.c (cp_parser_lambda_introducer): For cxx2a don't pedwarn on
960 2017-09-18 Jason Merrill <jason@redhat.com>
962 PR c++/82069 - ICE with lambda in template
963 * semantics.c (process_outer_var_ref): Check uses_template_parms
964 instead of any_dependent_template_arguments_p.
966 2017-09-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
967 Paolo Carlini <paolo.carlini@oracle.com>
970 * decl2.c (finish_anon_union): Complain about "anonymous union with
971 no members" with a pedwarn.
973 2017-09-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
975 * typeck.c (build_reinterpret_cast_1,
976 build_const_cast_1): Implement -Wcast-align=strict.
978 2017-09-15 Jakub Jelinek <jakub@redhat.com>
980 * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
981 adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
982 to C++17 or -std=gnu++17 or -std=c++17. Adjust comments.
983 (cxx_init_decl_processing, next_initializable_field,
984 is_direct_enum_init, check_initializer, cp_finish_decl,
985 mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
986 finish_function): Likewise.
987 * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
988 * pt.c (mark_template_parm, convert_nontype_argument,
989 instantiate_class_template_1, type_unification_real, unify,
990 get_partial_spec_bindings, dependent_type_p_r): Likewise.
991 * typeck.c (cp_build_unary_op): Likewise.
992 * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
993 * call.c (build_user_type_conversion_1, build_over_call,
994 build_special_member_call): Likewise.
995 * lambda.c (begin_lambda_type): Likewise.
996 * typeck2.c (process_init_constructor_record): Likewise.
997 * class.c (build_base_field, finalize_literal_type_property,
998 explain_non_literal_class): Likewise.
999 * parser.c (cp_parser_diagnose_invalid_type_name,
1000 cp_parser_primary_expression, cp_parser_lambda_introducer,
1001 cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
1002 cp_convert_range_for, cp_parser_perform_range_for_lookup,
1003 cp_parser_decomposition_declaration, cp_parser_linkage_specification,
1004 cp_parser_static_assert, cp_parser_simple_type_specifier,
1005 cp_parser_namespace_definition, cp_parser_using_declaration,
1006 cp_parser_init_declarator, cp_parser_type_parameter_key,
1007 cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
1008 cp_parser_constructor_declarator_p): Likewise.
1009 * mangle.c (struct globals): Rename need_cxx1z_warning to
1011 (write_exception_spec, start_mangling, mangle_decl): Likewise.
1012 * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
1014 (check-c++17): New goal. Use 17 instead of 1z.
1015 (check-c++-all): Use 17 instead of 1z.
1017 2017-09-14 Jakub Jelinek <jakub@redhat.com>
1020 * cp-gimplify.c (omp_var_to_track): Look through references.
1021 (omp_cxx_notice_variable): Likewise.
1023 2017-09-13 Nathan Sidwell <nathan@acm.org>
1025 Conv-op identifers not in identifier hash table
1026 * lex.c (conv_type_hasher): Make member fns inline.
1027 (make_conv_op_name): Directly clone conv_op_identifier.
1029 Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
1030 * cp-tree.h (struct lang_type): Rename methods to members.
1031 (CLASSTYPE_METHOD_VEC): Rename to ...
1032 (CLASSTYPE_MEMBER_VEC): ... this.
1033 * name-lookup.h (get_method_slot): Rename to ...
1034 (get_member_slot): ... this.
1035 (resort_type_method_vec): Rename to ...
1036 (resort_type_member_vec): ... this.
1037 * class.c (add_method, warn_hidden): Adjust.
1038 * search.c (dfs_locate_field_accessor_pre): Adjust.
1039 * name-lookup.c (method_vec_binary_search): Rename to ...
1040 (member_vec_binary_search): ... this and adjust.
1041 (method_vec_linear_search): Rename to ...
1042 (member_vec_linear_search): ... this and adjust.
1043 (fields_linear_search, get_class_binding_direct): Adjust.
1044 (get_method_slot): Rename to ...
1045 (get_member_slot): ... this and adjust.
1046 (method_name_slot): Rename to ...
1047 (member_name_slot): ... this and adjust.
1048 (resort_type_method_vec): Rename to ...
1049 (resort_type_member_vec): ... this and adjust.
1050 (method_vec_append_class_fields): Rename to ...
1051 (member_vec_append_class_fields): ... this and adjust.
1052 (method_vec_append_enum_values): Rename to ...
1053 (member_vec_append_enum_values): ... this and adjust.
1054 (method_vec_dedup): Rename to ...
1055 (member_vec_dedup): ... this and adjust.
1056 (set_class_bindings, insert_late_enum_def_bindings): Adjust.
1058 2017-09-12 Paolo Carlini <paolo.carlini@oracle.com>
1061 * decl.c (start_decl): Early return error_mark_node if duplicate_decls
1062 returns it; avoid misleading error message.
1064 2017-09-12 Nathan Sidwell <nathan@acm.org>
1066 Kill CLASSTYPE_SORTED_FIELDS.
1067 * cp-tree.h (struct lang_type): Lose sorted_fields member.
1068 (CLASSTYPE_SORTED_FIELDS): Delete.
1069 * name-lookup.h (set_class_bindings): Add EXTRA arg.
1070 * name-lookup.c (fields_linear_search): New, broken out of ...
1071 (lookup_field_1): ... here. Delete remainder of function.
1072 (get_class_binding_direct): Reimplement without sorted_fields.
1073 (get_class_binding): Rename TYPE arg to KLASS, for consistency.
1074 (get_method_slot): Call set_class_binding when creating method_vec
1076 (method_name_cmp): Order identically named slots.
1077 (sorted_fields_type_new): Delete.
1078 (field_vc_append_class_fields): Rename to ...
1079 (method_vec_append_class_fields): ... here. Adjust.
1080 (field_vec_append_enum_values): Renme to ...
1081 (method_vec_append_enum_values): ... here. Adjust.
1082 (method_vec_dedup): New.
1083 (set_class_bindings): Reimplement.
1084 (insert_late_enum_def_bindings): Reimplement.
1086 * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
1088 (restort_data): Move later.
1089 (method_name_cmp, resort_method_name_cmp): Simplify.
1090 (resort_type_method_vec): Reformat.
1092 2017-09-09 Jason Merrill <jason@redhat.com>
1094 * constexpr.c (reduced_constant_expression_p): If
1095 CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
1097 2017-09-09 Eric Botcazou <ebotcazou@adacore.com>
1100 * cp-objcp-common.c (struct debug_type_hasher): New class.
1101 (debug_type_hash): New variable.
1102 (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
1104 2017-09-08 Jason Merrill <jason@redhat.com>
1106 PR c++/70029 - ICE with ref-qualifier and -flto
1107 * tree.c (cxx_copy_lang_qualifiers): New.
1108 * cp-tree.h: Declare it.
1109 * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
1111 2017-09-06 Jason Merrill <jason@redhat.com>
1113 PR c++/82053 - ICE with default argument in lambda in template
1114 * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
1116 (retrieve_specialization): Use lambda_fn_in_template_p.
1117 * cp-tree.h: Declare it.
1119 PR c++/82070 - error with nested lambda capture
1120 * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
1121 register_local_specialization.
1123 2017-09-06 Nathan Sidwell <nathan@acm.org>
1125 * name-lookup.h (lookup_field_1): Delete.
1126 (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
1127 * name-lookup.c (lookup_field_1): make static
1128 (method_vec_binary_search, method_vec_linear_search): New. Broken
1130 (get_class_binding_direct): ... here. Add TYPE_OR_FNS argument.
1131 Do complete search of this level.
1132 (get_class_binding): Adjust.
1133 * decl.c (reshape_init_class): Call get_class_binding.
1134 * search.c (lookup_field_r): Move field searching into
1135 get_class_binding_direct.
1137 * class.c (warn_hidden): Don't barf on non-functions.
1138 * decl2.c (check_classfn): Likewise. Check template match earlier.
1140 * name-lookup.c (count_fields): Rename to ...
1141 (count_class_fields): ... here. Take a class, don't count
1143 (add_fields_to_record_type): Rename to ...
1144 (field_vec_append_class_fields): ... here. Take a class, don't
1145 add NULL-named fields.
1146 (add_enum_fields_to_record_type): Rename to ...
1147 (field_vec_append_enum_values): ... here.
1148 (set_class_bindings): Adjust, assert we added expected number.
1149 (insert_late_enum_def_bindings): Reimplement. Create vector if
1150 there are now sufficient entries.
1152 * name-lookup.h (lookup_fnfields_slot_nolazy,
1153 lookup_fnfields_slot): Rename to ...
1154 (get_class_binding_direct, get_class_binding): ... here.
1155 * name-lookup.c (lookup_fnfields_slot_nolazy,
1156 lookup_fnfields_slot): Rename to ...
1157 (get_class_binding_direct, get_class_binding): ... here.
1158 * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
1159 * call.c (build_user_type_conversion_1): Adjust.
1160 (has_trivial_copy_assign_p): Adjust.
1161 (has_trivial_copy_p): Adjust.
1162 * class.c (get_basefndecls) Adjust.
1163 (vbase_has_user_provided_move_assign) Adjust.
1164 (classtype_has_move_assign_or_move_ctor_p): Adjust.
1165 (type_build_ctor_call, type_build_dtor_call): Adjust.
1166 * decl.c (register_dtor_fn): Adjust.
1167 * decl2.c (check_classfn): Adjust.
1168 * pt.c (retrieve_specialization): Adjust.
1169 (check_explicit_specialization): Adjust.
1170 (do_class_deduction): Adjust.
1171 * search.c (lookup_field_r): Adjust.
1172 (look_for_overrides_here, lookup_conversions_r): Adjust.
1173 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
1174 * tree.c (type_has_nontrivial_copy_init): Adjust.
1175 * method.c (lazily_declare_fn): Adjust comment.
1177 2017-09-05 Nathan Sidwell <nathan@acm.org>
1179 * name-lookup.c (do_class_using_decl): Elide read-once temps.
1180 Move declarations to initializations.
1182 * class.c (add_method): Move slot search and insertion to ...
1183 * name-lookup.c (get_method_slot): ... this new function.
1184 (lookup_fnfields_slot_nolazy): Cope with NULL slot.
1185 * name-lookup.h (get_method_slot): Declare.
1186 * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
1188 (grok_special_member_properties): Set
1189 TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
1190 Improve TYPE_HAS_CONSTEXPR_CTOR setting.
1192 * cp-tree.h (lang_decl_base): Rename template_conv_p to
1194 (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
1195 (DECL_CONV_FN_TYPE): FN must be conv op.
1196 (DECL_TEMPLATE_CONV_FN_P): Delete.
1197 (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
1198 * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
1201 * class.c (unreverse_member_declarations): Remove extraneous if.
1202 * pt.c (push_template_decl_real): Use string concatenation, not
1203 \<newline>. Add %<..%>.
1205 2017-09-05 Paolo Carlini <paolo.carlini@oracle.com>
1208 * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
1209 * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
1210 creating cdtor_label.
1211 * constexpr.c (returns): Add the case of a constructor/destructor
1212 returning via a LABEL_DECL_CDTOR label.
1213 (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
1215 2017-09-01 Nathan Sidwell <nathan@acm.org>
1217 * cp-tree.h (resort_type_method_vec): Move declaration to ...
1218 * name-lookup.h (resort_type_method_vec): ... here.
1219 (set_class_bindings): Lose 2nd arg.
1220 * class.c (finish_struct_1, finish_struct): Adjust
1221 set_class_bindings call. Don't call finish_struct_methods.
1222 (resort_data, method_name_cmp, resort_method_name_cmp,
1223 resort_type_method_vec, finish_struct_methods): Move to ...
1224 * name-lookup.c (resort_data, method_name_cmp,
1225 resort_method_name_cmp, resort_type_method_vec): ... here.
1226 (set_class_bindings): Lose fields arg. Swallow finish_struct_methods.
1228 * class.c (finish_struct): Call set_class_bindings for the
1231 * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
1232 Don't call maybe_warn_about_overly_private_class here.
1233 (warn_hidden): Cleanup declarations and comments.
1234 (type_has_user_provided_constructor): No need to check
1235 CLASSTYPE_METHOD_VEC.
1236 (type_has_user_provided_or_explicit_constructor): Likewise.
1237 (classtype_has_move_assign_or_move_ctor_p): Likewise.
1238 (check_bases_and_members): Don't call finish_struct_methods here.
1239 (finish_struct_1): Call finish_struct_methods and
1240 set_class_bindings immediately after layout. Clear DECL_IN_AGGR_P
1242 (finish_struct): For templates process USING_DECLS and clear
1243 DECL_IN_AGGR_P before calling finish_struct_methods. Call
1244 maybe_warn_about_overly_private_class here.
1246 Revert 2017-08-28 Nathan Sidwell <nathan@acm.org>
1247 Restore sorted_fields vector.
1248 * cp-tree.h (lang_type): Restore sorted_fields vector.
1249 (CLASSTYPE_SORTED_FIELDS): Restore.
1250 (CLASSTYPE_BINDINGS): Delete.
1251 * name-lookup.c (lookup_field_1): Restore binary search.
1252 (sorted_fields_type_new, count_fields,
1253 add_fields_to_record_type, add_enum_fields_to_record_type): Restore
1254 (set_class_bindings): Revert.
1255 (insert_late_enum_def_binding): Restore field_vec insertion.
1257 2017-09-01 Jakub Jelinek <jakub@redhat.com>
1260 * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
1262 2017-09-01 Marek Polacek <polacek@redhat.com>
1265 * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
1267 2017-08-30 Jason Merrill <jason@redhat.com>
1269 PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
1270 * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
1271 (regenerated_lambda_fn_p): New.
1272 (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
1273 (tsubst_copy) [VAR_DECL]: Likewise.
1275 PR c++/82030 - ICE inheriting from multiple lambdas
1277 * call.c (compare_ics): Handle null candidate.
1279 2017-08-30 Ville Voutilainen <ville.voutilainen@gmail.com>
1281 Make taking the address of an overloaded function a non-deduced context
1283 * pt.c (unify_overload_resolution_failure): Remove.
1284 (unify_one_argument): Adjust.
1286 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1287 Alan Hayward <alan.hayward@arm.com>
1288 David Sherwood <david.sherwood@arm.com>
1290 * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
1292 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1293 Alan Hayward <alan.hayward@arm.com>
1294 David Sherwood <david.sherwood@arm.com>
1296 * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
1298 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1299 Alan Hayward <alan.hayward@arm.com>
1300 David Sherwood <david.sherwood@arm.com>
1302 * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
1303 instead of TYPE_MODE.
1305 2017-08-29 Jason Merrill <jason@redhat.com>
1307 PR c++/81236 - ICE with template-id in generic lambda
1308 * semantics.c (finish_id_expression): Remove special dependent case.
1309 Avoid some later pieces when dependent.
1310 (finish_qualified_id_expr): Do normal BASELINK handling in a
1311 template. Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
1312 (parsing_default_capturing_generic_lambda_in_template): Remove.
1313 * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
1314 error for types that will never be complete.
1315 * mangle.c (write_expression): Add sanity check.
1316 * tree.c (build_qualified_name): Add sanity check.
1317 (cp_walk_subtrees): Walk into the class context of a BASELINK.
1318 * lambda.c (add_capture): Improve diagnostic for generic lambda
1320 * call.c (build_new_method_call_1): Print the right constructor
1323 Reimplement handling of lambdas in templates.
1324 * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
1325 * decl.c (start_preparsed_function): Call start_lambda_scope.
1326 (finish_function): Call finish_lambda_scope.
1327 * init.c (get_nsdmi): Call start/finish_lambda_scope.
1328 * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
1329 * parser.c (cp_parser_function_definition_after_declarator): Don't
1330 call start/finish_lambda_scope.
1331 * pt.c (retrieve_specialization): Ignore lambda functions in
1333 (find_parameter_packs_r): Ignore capture proxies. Look into
1335 (check_for_bare_parameter_packs): Allow bare packs in lambdas.
1336 (tsubst_default_argument): Call start/finish_lambda_scope.
1337 (tsubst_function_decl): Handle lambda functions differently.
1338 (tsubst_template_decl): Likewise.
1339 (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
1341 (tsubst_lambda_expr): Create a new closure rather than instantiate
1342 the one from the template.
1343 (tsubst_copy_and_build): Don't register a specialization of a pack.
1344 (regenerate_decl_from_template): Call start/finish_lambda_scope.
1345 (instantiate_decl): Remove special lambda function handling.
1346 * semantics.c (process_outer_var_ref): Remove special generic lambda
1347 handling. Don't implicitly capture in a lambda in a template. Look
1348 for an existing proxy.
1349 * class.c (current_nonlambda_class_type): Use decl_type_context.
1351 * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
1352 (LAMBDA_EXPR_RETURN_TYPE): Remove.
1353 (struct tree_lambda_expr): Remove closure and return_type fields.
1354 * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
1355 * pt.c (tsubst_copy_and_build): Likewise.
1356 * parser.c (cp_parser_lambda_declarator_opt): Track return type.
1357 (cp_parser_lambda_body): Adjust unspecified return type check.
1358 * ptree.c (cxx_print_lambda_node): Don't print closure or
1361 PR c++/80935 - wrong C++17 error with lambda
1362 * decl.c (check_for_uninitialized_const_var): Check
1363 is_instantiation_of_constexpr.
1364 * constexpr.c (ensure_literal_type_for_constexpr_object): Check
1365 is_instantiation_of_constexpr.
1366 (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
1368 * lambda.c (build_lambda_object): Check for error_mark_node.
1369 * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
1371 (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
1372 (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
1374 PR c++/80767 - unnecessary instantiation of generic lambda
1375 * call.c (convert_like_real): Call build_user_type_conversion_1 if
1377 (add_conv_candidate): Build a ck_user conversion with no candidate.
1379 Fix lambdas in template default argument of inherited ctor.
1380 * method.c (synthesized_method_base_walk): Replace an inherited
1381 template with its specialization.
1382 (synthesized_method_walk): Make inheriting_ctor a pointer.
1383 (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
1384 (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
1386 * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
1387 template, not the function.
1388 (template_guide_p): Adjust.
1390 Support copying local_specializations.
1391 * cp-tree.h (enum lss_policy): New.
1392 (local_specialization_stack): Add policy parameter to default ctor.
1393 * pt.c (local_specialization_stack): Copy local_specializations if
1396 * constexpr.c (potential_constant_expression_1): Add "now" parm.
1397 (is_constant_expression, require_constant_expression): New.
1398 (is_static_init_expression, is_nondependent_constant_expression)
1399 (is_nondependent_static_init_expression): Drop "potential".
1400 * except.c (build_must_not_throw_expr): Do type conversion on
1401 value-dependent argument.
1402 * pt.c, semantics.c, typeck2.c: Use variants without "potential".
1404 Instantiate default arguments/member initializers once.
1405 * init.c (get_nsdmi): Remember NSDMI instantiations.
1406 * parser.c (inject_this_parameter): Be more picky about
1408 * pt.c (tsubst_copy): Simplify 'this' handling.
1409 (tsubst_default_argument): Remember default argument
1410 instantiations. Take parameter number.
1411 (tsubst_default_arguments): Pass it.
1412 * call.c (convert_default_arg): Likewise.
1414 Fix default argument conversion failure and SFINAE.
1415 * call.c (build_over_call): Check convert_default_arg result for
1417 * parser.c (cp_parser_late_parsing_default_args): Remember
1420 2017-08-28 Nathan Sidwell <nathan@acm.org>
1422 * cp-tree.h (lang_type): Replace sorted_fields vector with
1424 (CLASSTYPE_SORTED_FIELDS): Delete.
1425 (CLASSTYPE_BINDINGS): New.
1426 * decl.c (finish_enum_value_list): Swap args of
1427 insert_late_enum_def_bindings.
1428 * name-lookup.c (lookup_field_1): Replace binary search of sorted
1429 fields with map->get.
1430 (sorted_fields_type_new, count_fields,
1431 add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
1432 (add_class_member, add_class_members): New.
1433 (set_class_bindings): Create map and insert.
1434 (insert_late_enum_def_binding): Swap parms. Use add_clasS_member.
1435 * ptree.c (cxx_print_type): Delete sorted fields printing.
1437 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
1439 * name-lookup.h (set_class_bindings,
1440 insert_late_enum_def_bindings): Declare.
1441 * decl.c (finish_enum_value_list): Adjust for
1442 insert_late_enum_def_bindings name change.
1443 * class.c (finish_struct_1): Call set_class_bindings.
1444 (count_fields, add_fields_to_record_type,
1445 add_enum_fields_to_record_type, sorted_fields_type_new,
1446 insert_into_classtype_sorted_fields,
1447 insert_late_enum_def_into_classtype_sorted_fields): Move to ...
1448 * name-lookup.h (count_fields, add_fields_to_record_type,
1449 add_enum_fields_to_record_type, sorted_fields_type_new,
1450 set_class_bindings, insert_late_enum_def_bindings): ... here.
1452 2017-08-25 Nathan Sidwell <nathan@acm.org>
1454 * class.c (method_name_cmp, resort_method_name_cmp): Methods
1457 Conversion operators have a special name
1458 * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
1459 (conv_op_marker, conv_op_identifier): New.
1460 (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
1461 * decl.c (initialize_predefined_identifiers): Add
1463 (cxx_init_decl_processing): Create conv_op_marker.
1464 * decl2.c (check_classfn): Lookup conv-ops by name.
1465 * class.c (add_method): Use conv_op_identifier & conv_op_marker.
1466 (resort_type_method_vec): Don't skip conv-ops.
1467 (finish_struct_methods, warn_hidden): Likewise.
1468 * name-lookup.h (lookup_all_conversions): Delete.
1469 * name-lookup.c (lookup_conversion_operator): Replace with ...
1470 (extract_conversion_operator): ... this.
1471 (lookup_fnfields_slot_nolazy): Find conv-ops by name.
1472 (lookup_all_conversions): Delete.
1473 * pt.c (check_explicit_specialization): Find conv-ops by name.
1474 * search.c (lookup_conversions_r): Likewise.
1476 2017-08-24 Nathan Sidwell <nathan@acm.org>
1478 Conversion operators kept on single overload set
1479 * class.c (add_method): Keep all conv-ops on one slot.
1480 * name-lookup.c (lookup_conversion_operator): Pull the desired
1481 conv op out of overload set.
1482 * search.c (lookup_conversions_r): Lose template/non-template
1484 (lookup_conversions): Likewise.
1486 2017-08-23 Nathan Sidwell <nathan@acm.org>
1488 * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
1489 lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
1491 * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
1492 lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
1493 * search.c (lookup_conversion_operator,
1494 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1495 lookup_all_conversions): Move to ...
1496 * name-lookup.c (lookup_conversion_operator,
1497 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1498 lookup_all_conversions): ... here.
1500 * semantics.c (finish_member_declaration): Move USING_DECL check
1501 earlier. Always set C++ linkage. Commonize TYPE_FIELD and
1502 template decl list insertion.
1504 * cp-tree.h (maybe_version_functions): Declare.
1505 * decl.c (decls_match): Break function versioning check to
1506 separate function. Call it.
1507 (maybe_version_functions): Broken out of decls_match.
1508 * class.c (add_method): Use maybe_version_functions.
1510 * cp-tree.h (print_search_statistics,
1511 reinit_search_statistics): Don't declare.
1512 * search.c (n_fields_searched, n_calls_lookup_field,
1513 n_calls_lookup_field_1, n_calls_lookup_fnfields,
1514 n_calls_lookup_fnfields_1, n_calls_get_base_type,
1515 n_outer_fields_searched, n_contexts_saved): Delete.
1516 (lookup_field_1, lookup_member,
1517 lookup_fnfields_slot_nolazy): Remove stat gathering.
1518 (print_search_statistics, reinit_search_statistics): Delete.
1519 * tree.c (cxx_print_statistics): Don't print search stats.
1521 2017-08-21 Nathan Sidwell <nathan@acm.org>
1523 * search.c (lookup_field_r): Remove obsolete code for type-named
1526 * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
1528 (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
1529 (lookup_field_fuzzy_r): Adjust.
1531 2017-08-21 David Malcolm <dmalcolm@redhat.com>
1533 * call.c (build_over_call): Pass NULL for new parameter to
1534 check_function_arguments.
1535 * typeck.c (cp_build_function_call_vec): Likewise.
1537 2017-08-21 Nathan Sidwell <nathan@acm.org>
1540 * pt.c (instantiate_class_template_1):
1541 BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
1543 2017-08-18 David Malcolm <dmalcolm@redhat.com>
1546 * name-lookup.c (maybe_suggest_missing_header): Convert return
1547 type from void to bool; return true iff a suggestion was offered.
1548 (suggest_alternative_in_explicit_scope): Move call to
1549 maybe_suggest_missing_header to before use of best_match, and
1550 return true if the former offers a suggestion.
1552 2017-08-18 H.J. Lu <hongjiu.lu@intel.com>
1555 * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
1556 * decl2.c (grokbitfield): Don't allow bit-field with
1557 warn_if_not_aligned type.
1559 2017-08-17 Nathan Sidwell <nathan@acm.org>
1561 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
1562 * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
1563 (TYPE_TEMPLATE_INFO): Simplify.
1564 (SET_TYPE_TEMPLATE_INFO): Simplify.
1566 * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
1567 don't need lang_type.
1568 (cxx_make_type): Use maybe_add_lang_type_raw return value.
1569 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
1572 * cp-tree.h (struct lang_type): Remove template_info field.
1573 (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
1574 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
1576 2017-08-14 Martin Sebor <msebor@redhat.com>
1579 * error.c (cp_printer): Handle 'G'.
1581 2017-08-11 Martin Liska <mliska@suse.cz>
1583 * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
1584 TARGET_SUPPORTS_ALIASES.
1585 (handle_tls_init): Likewise.
1586 (note_mangling_alias): Likewise. Remove ATTRIBUTE_UNUSED for
1588 * optimize.c (can_alias_cdtor): Likewise.
1590 2017-08-11 Jason Merrill <jason@redhat.com>
1592 PR c++/81671 - nullptr_t template parameter
1593 * pt.c (convert_nontype_argument): Fix nullptr_t check.
1595 2017-08-10 Jason Merrill <jason@redhat.com>
1597 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1598 * method.c (synthesized_method_walk): Don't diagnose lack of
1601 PR c++/80452 - Core 1579, implicit move semantics on return/throw
1602 * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
1603 tentatively changed the lvalue to an rvalue.
1604 * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
1605 (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
1606 parameter is an rvalue reference.
1607 * except.c (build_throw): Do maybe-rvalue overload resolution twice.
1608 * typeck.c (check_return_expr): Likewise.
1610 2017-08-10 David Malcolm <dmalcolm@redhat.com>
1612 * parser.c (cp_parser_error): Update for new param to
1614 (class token_pair): New class.
1615 (struct matching_paren_traits): New struct.
1616 (matching_parens): New typedef.
1617 (struct matching_brace_traits): New struct.
1618 (matching_braces): New typedef.
1619 (cp_parser_statement_expr): Convert explicit parsing of
1620 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
1621 class matching_parens, so that the pertinent open parenthesis is
1622 highlighted when there are problems locating the close
1624 (cp_parser_primary_expression): Likewise.
1625 (cp_parser_compound_literal_p): Remove consumption of opening
1627 (cp_parser_postfix_expression): Convert explicit parsing of
1628 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
1629 above. Use it to consume the opening paren previously consumed by
1630 cp_parser_compound_literal_p.
1631 (cp_parser_parenthesized_expression_list): Likewise.
1632 (cp_parser_unary_expression): Likewise.
1633 (cp_parser_new_expression): Likewise.
1634 (cp_parser_cast_expression): Likewise.
1635 (cp_parser_builtin_offsetof): Likewise.
1636 (cp_parser_trait_expr): Likewise.
1637 (cp_parser_lambda_declarator_opt): Likewise.
1638 (cp_parser_lambda_body): Likewise, for matching_braces.
1639 (cp_parser_compound_statement): Likewise.
1640 (cp_parser_selection_statement): Likewise, for matching_parens.
1641 (cp_parser_iteration_statement): Likewise.
1642 (cp_parser_already_scoped_statement): Likewise, for
1644 (cp_parser_linkage_specification): Likewise.
1645 (cp_parser_static_assert): Likewise, for matching_parens.
1646 (cp_parser_decltype): Likewise.
1647 (cp_parser_operator): Likewise.
1648 (cp_parser_enum_specifier): Likewise.
1649 (cp_parser_namespace_definition): Likewise.
1650 (cp_parser_direct_declarator): Likewise.
1651 (cp_parser_braced_list): Likewise.
1652 (cp_parser_class_specifier_1): Likewise, for matching_braces.
1653 (cp_parser_constant_initializer): Likewise.
1654 (cp_parser_noexcept_specification_opt): Likewise, for
1656 (cp_parser_exception_specification_opt): Likewise.
1657 (cp_parser_handler): Likewise.
1658 (cp_parser_asm_specification_opt): Likewise.
1659 (cp_parser_asm_operand_list): Likewise.
1660 (cp_parser_gnu_attributes_opt): Likewise.
1661 (cp_parser_std_attribute_spec): Likewise.
1662 (cp_parser_requirement_parameter_list): Likewise.
1663 (cp_parser_requirement_body): Likewise, for matching_braces.
1664 (cp_parser_compound_requirement): Likewise.
1665 (cp_parser_template_introduction): Likewise.
1666 (cp_parser_sizeof_pack): Likewise, for matching_parens.
1667 (cp_parser_sizeof_operand): Likewise; use it to consume the
1668 opening paren previously consumed by cp_parser_compound_literal_p.
1669 (get_matching_symbol): New function.
1670 (cp_parser_required_error): Add param "matching_location". Remove
1671 calls to cp_parser_error, instead setting a non-NULL gmsgid, and
1672 handling it if set by calling c_parse_error, potentially with a
1673 secondary location if matching_location was set.
1674 (cp_parser_require): Add param "matching_location", with a default
1675 value of UNKNOWN_LOCATION.
1676 (cp_parser_require_keyword): Update for new param of
1677 cp_parser_required_error.
1678 (cp_parser_objc_encode_expression): Update to class matching_parens
1680 (cp_parser_objc_defs_expression): Likewise.
1681 (cp_parser_objc_protocol_expression): Likewise.
1682 (cp_parser_objc_selector_expression): Likewise.
1683 (cp_parser_objc_typename): Likewise.
1684 (cp_parser_objc_superclass_or_category): Likewise.
1685 (cp_parser_objc_try_catch_finally_statement): Likewise.
1686 (cp_parser_objc_synchronized_statement): Likewise.
1687 (cp_parser_objc_at_property_declaration): Likewise.
1688 (cp_parser_oacc_single_int_clause): Likewise.
1689 (cp_parser_oacc_shape_clause): Likewise.
1690 (cp_parser_omp_clause_collapse): Likewise.
1691 (cp_parser_omp_clause_default): Likewise.
1692 (cp_parser_omp_clause_final): Likewise.
1693 (cp_parser_omp_clause_if): Likewise.
1694 (cp_parser_omp_clause_num_threads): Likewise.
1695 (cp_parser_omp_clause_num_tasks): Likewise.
1696 (cp_parser_omp_clause_grainsize): Likewise.
1697 (cp_parser_omp_clause_priority): Likewise.
1698 (cp_parser_omp_clause_hint): Likewise.
1699 (cp_parser_omp_clause_defaultmap): Likewise.
1700 (cp_parser_omp_clause_ordered): Likewise.
1701 (cp_parser_omp_clause_schedule): Likewise.
1702 (cp_parser_omp_clause_num_teams): Likewise.
1703 (cp_parser_omp_clause_thread_limit): Likewise.
1704 (cp_parser_omp_clause_aligned): Likewise.
1705 (cp_parser_omp_clause_linear): Likewise.
1706 (cp_parser_omp_clause_safelen): Likewise.
1707 (cp_parser_omp_clause_simdlen): Likewise.
1708 (cp_parser_omp_clause_depend): Likewise.
1709 (cp_parser_omp_clause_device): Likewise.
1710 (cp_parser_omp_clause_dist_schedule): Likewise.
1711 (cp_parser_oacc_clause_async): Likewise.
1712 (cp_parser_omp_critical): Likewise.
1713 (cp_parser_omp_for_loop): Likewise.
1714 (cp_parser_omp_sections_scope): Likewise.
1715 (cp_parser_omp_declare_reduction_exprs): Likewise.
1716 Update for new param to cp_parser_required_error.
1717 (cp_parser_oacc_routine): Likewise.
1718 (cp_parser_transaction_expression): Likewise.
1719 (cp_parser_cilk_simd_vectorlength): Likewise.
1721 2017-08-09 Jason Merrill <jason@redhat.com>
1723 PR c++/81525 - wrong constant value with generic lambda
1724 * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
1725 (tsubst_copy) [VAR_DECL]: Handle auto.
1727 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1728 * init.c (get_nsdmi): Add complain parm.
1729 * typeck2.c (digest_nsdmi_init): Add complain parm.
1730 (process_init_constructor_record): Pass complain to get_nsdmi.
1731 * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
1732 * method.c (get_defaulted_eh_spec): Add complain parm. Pass it into
1733 synthesized_method_walk.
1734 (synthesized_method_walk): Adjust.
1735 (walk_field_subobs): Pass complain to get_nsdmi.
1736 (defaulted_late_check): Skip other checks if deleted.
1737 * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
1738 * call.c (build_aggr_conv): Pass complain to get_nsdmi.
1739 * parser.c (defarg_location): New.
1740 * error.c (location_of): Use it.
1742 2017-08-09 Marek Polacek <polacek@redhat.com>
1744 * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
1745 * typeck.c (build_binary_op): Change the type of a parameter to bool.
1746 (cp_truthvalue_conversion): Use true instead of 1.
1748 2017-08-08 Marek Polacek <polacek@redhat.com>
1751 * cp-gimplify.c (cp_fold): If folding exposed a branch of
1752 a COND_EXPR, convert it to the original type of the COND_EXPR, if
1755 2017-08-08 Martin Liska <mliska@suse.cz>
1757 * call.c: Include header files.
1758 * cp-gimplify.c: Likewise.
1759 * cp-ubsan.c: Likewise.
1762 * search.c: Likewise.
1763 * semantics.c: Likewise.
1764 * typeck.c: Likewise.
1766 2017-08-07 Martin Liska <mliska@suse.cz>
1768 * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
1770 (cp_parser_std_attribute): Likewise.
1771 * tree.c: Add new include.
1773 2017-08-04 Paolo Carlini <paolo.carlini@oracle.com>
1776 * pt.c (do_class_deduction): Handle the case of no viable implicit
1777 deduction guides; simplify the code generating implicit deduction
1780 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
1783 * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
1784 destructor as expressions.
1786 2017-08-02 Jakub Jelinek <jakub@redhat.com>
1789 * call.c (build_user_type_conversion_1): Only call
1790 lookup_fnfields_slot if totype is CLASS_TYPE_P.
1792 2017-07-31 Jason Merrill <jason@redhat.com>
1794 * decl.c (declare_global_var): Set DECL_CONTEXT.
1796 2017-07-31 Jan Hubicka <hubicka@ucw.cz>
1797 Martin Liska <mliska@suse.cz>
1799 * pt.c (tsubst_copy): Copy PREDICT_EXPR.
1800 * semantics.c (finish_goto_stmt): Build gimple predict
1802 * constexpr.c (potential_constant_expression_1): Handle
1805 2017-07-31 Martin Liska <mliska@suse.cz>
1808 * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
1809 also with current_function_decl non-null equality.
1810 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1811 * decl.c (compute_array_index_type): Likewise.
1812 * init.c (finish_length_check): Likewise.
1813 * typeck.c (cp_build_binary_op): Likewise.
1815 2017-07-29 Jakub Jelinek <jakub@redhat.com>
1817 * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
1818 DW_AT_export_symbols.
1819 * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
1820 argument, pass it through to the debug hook.
1821 (finish_namespace_using_directive): Adjust
1822 emit_debug_info_using_namespace caller.
1823 (push_namespace): Likewise. Call it after setting
1824 DECL_NAMESPACE_INLINE_P.
1825 (cp_emit_debug_info_for_using): Pass false as new argument to
1826 the imported_module_or_decl debug hook.
1828 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
1830 * lex.c (copy_decl): Adjust.
1831 (copy_type): Likewise.
1833 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
1836 * lambda.c (add_capture): Early return if we cannot capture by
1839 2017-07-26 Jason Merrill <jason@redhat.com>
1841 P0702R1 - List deduction of vector.
1842 * pt.c (do_class_deduction): Special-case deduction from a single
1843 element of related type.
1845 2017-07-26 Leonid Koppel <lkoppel@uwaterloo.ca>
1847 PR c++/67054 - Inherited ctor with non-default-constructible members
1848 * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
1849 when deducing an inheriting constructor.
1851 2017-07-21 Nathan Sidwell <nathan@acm.org>
1853 * search.c (lookup_conversion_operator): Return overloads.
1854 (lookup_fnfields_idx_nolazy): Absorb into ...
1855 (lookup_fnfields_slot_nolaxy): ... here.
1856 (lookup_fnfields_1): Absorb into ...
1857 (lookup_fnfields_slot): ... here.
1859 Remove special CDtor METHOD_VEC slots.
1860 * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
1861 CLASSTYPE_DESTRUCTOR_SLOT): Delete.
1862 (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
1863 (CLASSTYPE_DESTRUCTOR): Likewise.
1864 * class (add_method): Don't use special cdtor slots.
1865 * search.c (lookup_fnfields_idx_nolazy): Likewise.
1866 (look_for_overrides_here): Use lookup_fnfields_slot.
1867 * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
1869 * call.c (add_candidates): Move decls to initialization. Don't
1872 2017-07-20 Nathan Sidwell <nathan@acm.org>
1874 Remove TYPE_METHODS.
1875 * class.c (maybe_warn_about_overly_private_class,
1876 finish_struct_methods, one_inheriting_sig, count_fields,
1877 add_fields_to_record_type, check_field_decls, check_methods,
1878 clone_function_decl, set_method_tm_attributes,
1879 finalize_literal_type_property, check_bases_and_members,
1880 create_vtable_ptr, determine_key_method,
1881 unreverse_member_declarations, finish_struct,
1882 add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
1883 * decl.c (fixup_anonymous_aggr): Likewise.
1884 * decl2.c (reset_type_linkage_2): Likewise.
1885 * method.c (after_nsdmi_defaulted_late_checks,
1886 lazily_declare_fn): Likewise.
1887 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
1888 * pt.c (instantiate_class_template_1, tsubst_expr,
1889 do_type_instantiation, instantiate_pending_templates): Likewise.
1890 * search.c (lookup_field_1): Likewise.
1891 * semantics.c (finish_member_declaration,
1892 finish_omp_declare_simd_methods): Likewise.
1894 2017-07-19 Nathan Sidwell <nathan@acm.org>
1896 * class.c (add_implicitly_declared_members): Use
1897 classtype_has_move_assign_or_move_ctor_p.
1898 (classtype_has_move_assign_or_move_ctor,
1899 classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
1900 (classtype_has_move_assign_or_move_ctor_p): ... this new function.
1901 * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
1903 (classtype_has_move_assign_or_move_ctor_p): ... this.
1904 * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
1905 * tree.c (type_has_nontrivial_copy_init): Adjust.
1907 * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
1908 PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
1910 2017-07-18 Nathan Sidwell <nathan@acm.org>
1912 * cp-array-notation.c (build_array_notation_ref): Use
1913 TYPE_{MIN,MAX}_VALUE.
1915 * class.c (classtype_has_move_assign_or_move_ctor): Declare.
1916 (add_implicitly_declared_members): Use it.
1917 (type_has_move_constructor, type_has_move_assign): Merge into ...
1918 (classtype_has_move_assign_or_move_ctor): ... this new function.
1919 * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
1921 2017-07-17 Volker Reichelt <v.reichelt@netcologne.de>
1923 * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
1924 friend outside class and obsolete auto as storage-class-specifier.
1926 2017-07-17 Nathan Sidwell <nathan@acm.org>
1928 * class.c (maybe_warn_about_overly_private_class): Ignore public
1931 * class.c (type_has_user_declared_move_constructor,
1932 type_has_user_declared_move_assign): Combine into ...
1933 (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
1934 * cp-tree.h (type_has_user_declared_move_constructor,
1935 type_has_user_declared_move_assign): Combine into ...
1936 (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
1937 * method.c (maybe_explain_implicit_delete): Use it.
1938 (lazily_declare_fn): Use it.
1939 * tree.c (type_has_nontrivial_copy_init): Use it.
1941 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
1942 semantics, simplify implementation.
1944 2017-07-16 Volker Reichelt <v.reichelt@netcologne.de>
1946 * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
1947 in old-style cast diagnostic.
1948 * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
1949 in useless cast diagnostic.
1950 * error.c (type_to_string): Remove enum special handling.
1952 2017-07-14 David Malcolm <dmalcolm@redhat.com>
1954 * name-lookup.c (get_std_name_hint): Add '<' and '>' around
1956 (maybe_suggest_missing_header): Update for addition of '<' and '>'
1957 to above. Provide a fix-it hint.
1958 * pt.c: Include "gcc-rich-location.h"
1959 (listify): Attempt to add fix-it hint for missing
1960 #include <initializer_list>.
1961 * rtti.c: Include "gcc-rich-location.h".
1962 (typeid_ok_p): Attempt to add fix-it hint for missing
1963 #include <typeinfo>.
1965 2017-07-12 Jason Merrill <jason@redhat.com>
1967 P0512R0 - Deduction from an initializer list.
1968 * pt.c (do_class_deduction): Do list deduction in two phases.
1970 2017-07-12 Nathan Sidwell <nathan@acm.org>
1972 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
1973 DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
1975 * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
1976 DECL_CXX_DESTRUCTOR explicitly.
1977 * decl2.c (grokclassfn): Likewise.
1978 * friend.c (do_friend): Likewise.
1979 * method.c (make_thunk, make_alias_for,
1980 implicitly_declare_fn): Likewise.
1982 2017-07-11 Jason Merrill <jason@redhat.com>
1985 * decl.c (grokparms): Downgrade error about array of unknown bound
1986 to pedwarn and disable it for C++17.
1988 2017-07-11 Nathan Sidwell <nathan@acm.org>
1990 * decl2.c (reset_type_linkage_2): Dont't change ctor name.
1992 2017-07-10 Martin Sebor <msebor@redhat.com>
1994 * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
1996 2017-07-06 Jason Merrill <jason@redhat.com>
1998 PR c++/81204 - parse error with dependent template-name
1999 * parser.c (cp_parser_lookup_name): Revert previous change.
2001 2017-07-06 David Malcolm <dmalcolm@redhat.com>
2003 * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
2004 selftest::run_cp_tests.
2005 (selftest::run_cp_tests): New function.
2006 * cp-tree.h (selftest::run_cp_tests): New decl.
2008 2017-07-04 Jakub Jelinek <jakub@redhat.com>
2010 * parser.c (cp_parser_decomposition_declaration): Replace
2011 decomposition declaration with structured binding in diagnostics.
2012 * decl.c (cp_finish_decomp): Likewise.
2013 (grokdeclarator): Likewise.
2016 * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
2017 forms of structured binding initializers.
2019 2017-07-03 Paolo Carlini <paolo.carlini@oracle.com>
2022 * decl.c (grokdeclarator): Move checks on function return type after
2023 the splice_late_return_type call; if declspecs->locations[ds_type_spec]
2024 is UNKNOWN_LOCATION fall back to input_location.
2026 2017-07-03 David Malcolm <dmalcolm@redhat.com>
2028 * parser.c (enum required_token): Fix spelling of
2029 RT_INTERATION to RT_ITERATION.
2030 (cp_parser_iteration_statement): Likewise.
2031 (cp_parser_required_error): Likewise.
2033 2017-06-30 Jason Merrill <jason@redhat.com>
2035 PR c++/81257 - ICE with invalid ::template.
2036 PR c++/54769 - wrong lookup of dependent template-name.
2037 * parser.c (cp_parser_template_name): Revert part of last change.
2039 2017-06-30 Nathan Sidwell <nathan@acm.org>
2041 * config-lang.in (gtfiles): Add cp/lex.c.
2042 * cp-tree.h (mangle_convop_name_for_type): Rename ...
2043 (make_conv_op_name): ... here. Move to lex.
2044 * lambda.c (maybe_add_lambda_conv_op): Update.
2045 * parser.c (cp_parser_conversion_function_id): Update.
2046 * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
2047 tsubst_copy_and_build): Update.
2048 * semantics.c (apply_deduced_return_type): Update.
2049 * mangle.c (conv_type_hasher, conv_type_names,
2050 mangle_conv_op_name_for_type): Move to ...
2051 * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
2054 2017-06-30 David Malcolm <dmalcolm@redhat.com>
2057 * parser.c (cp_parser_postfix_expression): Construct a location
2058 for typeid expressions.
2060 2017-06-30 Nathan Sidwell <nathan@acm.org>
2062 * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
2064 (lookup_all_conversions): Declare.
2065 * class.c (get_basefndecls): Use lookup_fnfields_slot.
2066 * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
2067 * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
2069 * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
2070 (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
2071 lookup_all_conversions.
2072 * search.c (lookup_fnfields_1): Make static.
2073 (lookup_all_conversions): New.
2074 (class_method_index_for_fn): Delete.
2075 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
2076 lookup_fnfields_slot.
2078 * call.c (build_new_method_call_1): Use constructo_name to get
2079 ctor name. Move argument processing earlier to merge cdtor
2081 * decl.c (grokfndecl): Cdtors have special names.
2082 * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
2083 * pt.c (check_explicit_specialization): Cdtor name is already
2085 * search.c (class_method_index_for_fn): Likewise.
2088 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
2089 a matching TYPE_DECL.
2091 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
2093 * class.c (add_method): Change pair of errors to error + inform.
2094 (handle_using_decl): Likewise.
2096 2017-06-29 Jason Merrill <jason@redhat.com>
2098 * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
2100 PR c++/81180 - ICE with C++17 deduction of member class template.
2101 * pt.c (build_deduction_guide): Correct member template handling.
2103 PR c++/81188 - matching decltype of member function call.
2104 * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
2106 2017-06-29 Nathan Sidwell <nathan@acm.org>
2109 * parser.c (cp_parser_namespace_definition): Immediately close the
2110 namespace if there's no open-brace.
2111 * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
2114 2017-06-29 Jason Merrill <jason@redhat.com>
2116 PR c++/81164 - ICE with invalid inherited constructor.
2117 * search.c (binfo_direct_p): New.
2118 * name-lookup.c (do_class_using_decl): Use it.
2120 2017-06-29 Nathan Sidwell <nathan@acm.org>
2122 * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
2123 VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
2124 * decl.c (initialize_predefined_identifiers): Name cdtor special
2125 names consistently. Use literals for above deleted defines.
2126 (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
2128 * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
2131 * call.c (check_dtor_name): Use constructor_name for enums too.
2132 (build_new_method_call_1): Use constructor_name for cdtors and
2134 * class.c (build_self_reference): Use TYPE_NAME to get name of
2136 * name-lookup (constructor_name): Use DECL_NAME directly.
2137 (constructor_name_p): Reimplement.
2138 (push_class_level_binding_1): Use TYPE_NAME directly.
2140 * class.c (finish_struct): Use OVL_P.
2141 (get_vfield_name): Measure constructor_name length.
2142 * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
2143 (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
2144 * cxx-pretty-print.c (is_destructor_name): Delete.
2145 (pp_cxx_unqualified_id): Remove bogus destructor name checking.
2146 * decl.c (grokfndecl): Move cheap checks first when looking for
2147 implicit extern cness.
2149 * parser.c (cp_parser_direct_declarator): Reorder if to avoid
2150 indentation. Remove unnecessary assignment of constructor name.
2152 Whitespace cleanups.
2153 * call.c (name_as_c_string): Move CONST_CAST to return.
2154 (build_new_method_call_1): Remove unneeded bracing.
2155 * class.c (include_empty_classes): Unbreak line.
2156 * constraint.cc (tsubst_check_constraint): Add space.
2157 * cp-tree.h (lang_decl_ns): Add comment.
2158 (PTRMEM_CST_MEMBER): Break line.
2159 * decl.c (grokfndecl): Add blank lines. Unbreak some others.
2160 (grokdeclarator): Remove lines, move declaration to first use.
2161 * decl2.c (decl_needed_p): Fix indentation.
2162 (c_parse_final_cleanups): Remove blank line.
2163 * method.c (implicitly_declare_fn): Move declaration to first use.
2164 * search.c (current_scope): Add blank lines.
2166 2017-06-28 Jason Merrill <jason@redhat.com>
2168 PR c++/72764 - ICE with invalid template typename.
2169 * decl.c (build_typename_type): No longer static.
2170 * tree.c (strip_typedefs): Use it instead of make_typename_type.
2172 PR c++/69300 - ICE with self-referential noexcept
2173 * pt.c (maybe_instantiate_noexcept): Check for recursion.
2175 PR c++/61022 - error with variadic template template parm
2176 * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
2178 PR c++/72801 - ICE with variadic partial specialization
2179 * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
2181 PR c++/55639 - partial specialization with ::template
2182 * parser.c (cp_parser_class_head): Handle ::template.
2184 PR c++/45976 - error with ::template in declarator.
2185 * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
2187 PR c++/54769 - wrong lookup of dependent template-name.
2188 * parser.c (cp_parser_template_name): Handle dependent object type.
2189 (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
2191 (cp_parser_id_expression): Pass it.
2192 (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
2194 * parser.c (cp_parser_template_id): Use the range location on the
2197 PR c++/81204 - parse error with dependent template-name
2198 * parser.c (cp_parser_lookup_name): Disqualify function templates
2201 2017-06-27 Nathan Sidwell <nathan@acm.org>
2203 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
2204 initialization point. Don't unnecessarily check for ctor name.
2206 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
2207 (CLASSTYPE_DESTRUCTOR): ... this.
2208 * class.c (accessible_nvdtor_p,
2209 maybe_warn_about_overly_private_class,
2210 add_implicitly_declared_members,
2211 clone_constructors_and_destructors, type_has_virtual_destructor):
2212 Adjust for CLASSTYPE_DESTRUCTOR.
2213 (deduce_noexcept_on_destructors): Absorb into ...
2214 (check_bases_and_members): ... here.
2215 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
2216 * init.c (build_delete): Likewise.
2217 * parser.c (cp_parser_lookup_name): Likewise.
2218 * pt.c (check_explicit_specialization): Likewise.
2219 * rtti.c (emit_support_tinfos): Likewise.
2220 * search.c (lookup_fnfields_idx_nolazy): Likewise.
2222 Kill IDENTIFIER_TEMPLATE.
2223 * cp-tree.h (lang_identifier): Remove class_template_info field.
2224 (IDENTIFIER_TEMPLATE): Delete.
2225 * name-lookup.c (constructor_name_full): Subsume into ...
2226 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
2227 (constructor_name_p): Likewise.
2228 * mangle.c (write_source_name): Likewise.
2229 * ptree.c (cxx_print_identifier): Likewise.
2231 2017-06-27 Marek Polacek <polacek@redhat.com>
2234 * parser.c (cp_parser_already_scoped_statement): Initialize
2237 2017-06-26 Jason Merrill <jason@redhat.com>
2239 PR c++/81215 - deduction failure with variadic TTP.
2240 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
2242 2017-06-26 Martin Sebor <msebor@redhat.com>
2245 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
2246 to detect casting away cv-qualifiers.
2248 2017-06-26 Nathan Sidwell <nathan@acm.org>
2250 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
2251 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
2253 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
2254 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
2255 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
2256 * decl.c (grok_op_properties): Adjust identifier checking.
2257 * init.c (expand_default_init): Adjust identifier descision.
2258 * method.c (implicitly_declare_fn): Don't use
2259 DECL_ASSIGNMENT_OPERATOR_P.
2260 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
2262 * call.c (in_charge_arg_for_name): Reimplement.
2263 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
2266 2017-06-26 Marek Polacek <polacek@redhat.com>
2269 * parser.c (cp_parser_statement): Add a default argument. Save the
2270 location of the expression-statement after labels have been parsed.
2271 (cp_parser_implicitly_scoped_statement): Set the location of the
2272 body of the conditional after parsing all the labels. Call
2273 warn_for_multistatement_macros.
2274 (cp_parser_already_scoped_statement): Likewise.
2276 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
2279 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
2280 'typename' in error messages about missing 'typename'.
2282 2017-06-23 Jason Merrill <jason@redhat.com>
2284 PR c++/79056 - C++17 ICE with invalid template syntax.
2285 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
2287 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
2288 * pt.c (template_placeholder_p): New.
2289 * cp-tree.h: Declare it.
2291 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
2293 * decl.c (duplicate_decls): Use builtin_structptr_types.
2295 2017-06-22 Nathan Sidwell <nathan@acm.org>
2297 Reorder IDENTIFIER flags
2299 * cp-tree.h (enum cp_identifier_kind): New.
2300 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
2301 IDENTIFIER_KIND_BIT_2): New.
2302 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
2303 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
2304 (C_IS_RESERVED_WORD): Replace with ...
2305 (IDENTIFIER_KEYWORD_P): ... this.
2306 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
2307 (IDENTIFIER_CDTOR_P): ... this.
2308 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
2309 (IDENTIFIER_OPNAME_P): Replace with ...
2310 (IDENTIFIER_ANY_OP_P): ... this.
2311 (IDENTIFIER_ASSIGN_OP_P): New.
2312 (IDENTIFIER_TYPENAME_P): Replace with ...
2313 (IDENTIFIER_CONV_OP_P): ... this.
2314 (NEW_DELETE_OPNAME_P): Replace with ...
2315 (IDENTIFIER_NEWDEL_OP_P): ... this.
2316 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
2317 (get_identifier_kind_name, set_identifier_kind): Declare.
2318 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
2319 (init_operators): Adjust to avoid keywords, use
2320 set_identifier_kind. Copy TYPE_EXPR slot.
2321 (init_reswords): Call set_identifier_kind.
2322 (unqualified_name_lookup_error): Adjust.
2323 * operators.def (TYPE_EXPR): Remove.
2324 * decl.c (struct predefined_identifier): Move into ...
2325 (initialize_predefined_identifiers): ... here. Call
2326 set_identifier_kind.
2327 (grokfndecl, check_var_type, grokdeclarator): Adjust.
2328 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
2330 * call.c (name_as_c_string): Adjust.
2331 (build_new_method_call_1): Likewise.
2332 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
2333 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
2334 * dump.c (cp_dump_tree): Adjust.
2335 * error.c (dump_decl_name): Adjust.
2336 * mangle.c (write_unqualified_id, write_member_name,
2337 write_expression): Adjust.
2338 (mangle_conv_op_name_for_type): Use set_identifier_kind.
2339 * name-lookup.c (do_class_using_decl): Adjust.
2340 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
2341 * parser.c (cp_lexer_get_preprocessor_token,
2342 cp_parser_direct_declarator): Likewise.
2343 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
2344 tsubst_copy, tsubst_copy_and_build): Adjust.
2345 * ptree.c (cxx_print_identifier): Print identifier kind.
2346 * search.c (lookup_field_r, lookup_member,
2347 lookup_fnfields_idx_nolazy): Adjust.
2348 * semantics.c (finish_id_expression): Adjust..
2349 * typeck.c (cp_build_addr_expr_1): Adjust.
2351 2017-06-21 Jakub Jelinek <jakub@redhat.com>
2354 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
2355 Complain about t not being a variable if t is OVERLOAD even
2356 when processing_template_decl.
2358 2017-06-21 David Malcolm <dmalcolm@redhat.com>
2360 * parser.c (get_cast_suggestion): New function.
2361 (maybe_add_cast_fixit): New function.
2362 (cp_parser_cast_expression): Capture the location of the closing
2363 parenthesis. Call maybe_add_cast_fixit when emitting warnings
2364 about old-style casts.
2366 2017-06-20 Jason Merrill <jason@redhat.com>
2368 PR c++/80972 - C++17 ICE with attribute packed.
2369 * call.c (build_over_call): Allow a TARGET_EXPR from reference
2372 2017-06-20 Nathan Sidwell <nathan@acm.org>
2374 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
2375 (nelts_identifier): Delete.
2376 * decl.c (initialize_predefined_identifiers): Remove nelts.
2378 PR c++/67074 - namespace aliases
2379 * decl.c (duplicate_decls): Don't error here on mismatched
2381 * name-lookup.c (name_lookup::add_value): Matching namespaces are
2383 (diagnose_name_conflict): Namespaces are never redeclarations.
2384 (update_binding): An alias can match a real namespace.
2386 2017-06-19 Jason Merrill <jason@redhat.com>
2388 PR c++/80562 - ICE with constexpr if.
2389 * semantics.c (finish_if_stmt_cond): Call
2390 instantiate_non_dependent_expr.
2392 PR c++/80829 - ICE with constexpr copy of base subobject.
2393 * constexpr.c (clear_no_implicit_zero): New.
2394 (cxx_eval_call_expression): Call it.
2396 2017-06-19 Nathan Sidwell <nathan@acm.org>
2400 * name-lookup.c (set_decl_namespace): Don't follow using
2401 directives and ignore using decls. Only check overly-explicit
2402 scope after discovering decl.
2404 2017-06-19 Jason Merrill <jason@redhat.com>
2406 PR c++/81073 - constexpr and static var in statement-expression.
2407 * typeck2.c (store_init_value): Always call
2408 require_potential_constant_expression.
2409 * pt.c (convert_nontype_argument): Likewise.
2410 * constexpr.c (potential_constant_expression_1): Adjust message.
2411 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
2412 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
2414 2017-06-19 Nathan Sidwell <nathan@acm.org>
2416 * pt.c (coerce_template_parms): Fix indentation.
2417 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
2421 * name-lookup.c (update_binding): Only warn about constructors
2422 hidden by functions.
2424 2017-06-17 Jason Merrill <jason@redhat.com>
2426 PR c++/60063 - -Wunused-local-typedefs and templates.
2427 * decl2.c (is_late_template_attribute): Return false for "used".
2429 PR c++/70844 - -Wuseless-cast and inheriting constructor.
2430 * method.c (forward_parm): Suppress warn_useless_cast.
2432 2017-06-16 Jason Merrill <jason@redhat.com>
2434 PR c++/81045 - Wrong type-dependence with auto return type.
2435 * pt.c (type_dependent_expression_p): An undeduced auto outside the
2436 template isn't dependent.
2437 * call.c (build_over_call): Instantiate undeduced auto even in a
2440 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
2441 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
2442 set longer for a generic lambda.
2444 PR c++/80614 - Wrong mangling for C++17 noexcept type
2445 * mangle.c (write_type): Put the eh spec back on the function type.
2447 PR c++/81102 - Wrong error with partial specialization.
2448 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
2449 types. Do type deduction later.
2451 PR c++/81074 - ICE with partial specialization of member template.
2453 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
2455 PR c++/80831 - ICE with -fsyntax-only.
2456 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
2458 PR c++/80639 - ICE with invalid PMF initialization.
2459 PR c++/80043 - ICE with -fpermissive
2460 * typeck.c (convert_for_assignment): Recurse when instantiate_type
2461 returns without an error.
2463 2017-06-16 Nathan Sidwell <nathan@acm.org>
2465 * pt.c (tsubst_baselink): Fix & clarify formatting.
2467 * cp-tree.h (build_this_parm, cp_build_parm_decl,
2468 build_artificial_parm): Add FN parm.
2469 * decl.c (start_cleanup_fn): Adjust.
2470 (build_this_parm): Add FN parm, pass it through.
2471 (grokfndecl): Adjust parm building.
2472 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
2473 (build_artificial_parm): Add FN parm, pass through.
2474 (maybe_retrofit_in_chrg): Adjust parm building.
2475 (start_static_storage_duration_function): Likwise.
2476 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
2477 * method.c (implicitly_declare_fn): Likewise.
2478 * parser.c (inject_this_parameter): Likewise.
2480 Symbol tables are insert only.
2481 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
2482 derive from pointer_hash. Make undeletable.
2484 * class.c (resort_type_method_vec): Avoid potential unsigned
2487 Don't defer noexcept_deferred_spec.
2488 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
2489 * decl.c (cxx_init_decl_processing): Initialize
2490 noexcept_deferred_spec.
2491 * except.c (unevaluated_noexcept_spec): Delete.
2492 * class.c (deduce_noexcept_on_destructor): Use
2493 noexcept_deferred_spec directly.
2494 * method.c (implicitly_declare_fn): Likewise.
2496 Make keyed_classes a vector.
2497 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
2498 (keyed_classes): Declare as vector.
2499 * decl.c (keyed_classes): Define.
2500 (cxx_init_decl_processing): Allocate it.
2501 (record_key_method_defined): Use vec_safe_push.
2502 * class.c (finish_struct_1): Likewise.
2503 * pt.c (instantiate_class_template_1): Likewise.
2504 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
2507 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
2508 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
2510 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
2511 (get_tinfo_decl): Use get_tinfo_desc.
2512 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
2513 (create_pseudo_type_info): Delete.
2514 (get_pseudo_ti_index): Just determine the index.
2515 (get_tinfo_desc): New. Create all types lazily.
2516 (create_tinfo_types): Just allocate the descriptor array.
2517 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
2520 2017-06-15 Martin Sebor <msebor@redhat.com>
2523 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
2525 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
2526 (build_cxx_call): Call maybe_warn_class_memaccess.
2528 2017-06-14 Jakub Jelinek <jakub@redhat.com>
2530 * cp-gimplify.c (cp_genericize_r): Turn most of the function
2531 into a switch (TREE_CODE (stmt)) statement from long else if
2534 2017-06-13 Jakub Jelinek <jakub@redhat.com>
2537 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
2538 argument even if it has REFERENCE_TYPE.
2541 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
2542 BLOCK_VARS (outer) chain.
2543 (cxx_omp_const_qual_no_mutable): Likewise.
2545 2017-06-13 Martin Liska <mliska@suse.cz>
2548 * class.c (build_base_path): Use sanitize_flags_p.
2549 * cp-gimplify.c (cp_genericize_r): Likewise.
2550 (cp_genericize_tree): Likewise.
2551 (cp_genericize): Likewise.
2552 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2553 * decl.c (compute_array_index_type): Likewise.
2554 (start_preparsed_function): Likewise.
2555 * decl2.c (one_static_initialization_or_destruction): Likewise.
2556 * init.c (finish_length_check): Likewise.
2557 * lambda.c (maybe_add_lambda_conv_op): Likewise.
2558 * typeck.c (cp_build_binary_op): Likewise.
2559 (build_static_cast_1): Likewise.
2561 2017-06-11 Jason Merrill <jason@redhat.com>
2563 * error.c (dump_expr): Use is_this_parameter.
2565 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
2568 2017-06-09 Jason Merrill <jason@redhat.com>
2570 Missing bits from N4268, constant evaluation for all non-type args.
2571 * call.c (build_converted_constant_expr): Rename from
2572 build_integral_nontype_arg_conv, handle all types.
2573 * pt.c (convert_nontype_argument): In C++17 call it for all types.
2574 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
2575 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
2577 Overhaul pointer-to-member conversion and template argument handling.
2578 * call.c (standard_conversion): Avoid creating ck_pmem when the
2579 class type is the same.
2580 * cvt.c (can_convert_qual): Split from
2581 perform_qualification_conversions.
2582 * constexpr.c (cxx_eval_constant_expression): Check it.
2583 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
2584 adjustment is necessary.
2585 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
2586 (convert_nontype_argument): Avoid redundant error.
2588 * call.c (convert_like_real): Remove "inner" parameter.
2589 Don't replace a constant with its value.
2590 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
2592 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
2595 * parser.c (cp_parser_constant_expression): Check
2596 potential_rvalue_constant_expression after decay_conversion.
2597 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
2599 PR c++/80384 - ICE with dependent noexcept-specifier
2600 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
2603 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
2605 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
2607 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
2608 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
2609 (excpet.c): Mark terminate as cold.
2611 2017-06-08 Jakub Jelinek <jakub@redhat.com>
2614 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
2615 to sizetype before size_binop.
2618 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
2619 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
2620 and OMP_CLAUSE_SHARED_READONLY flags.
2622 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
2624 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
2626 2017-06-07 Nathan Sidwell <nathan@acm.org>
2628 * class.c (layout_class_type): Restructure overlong-bitfield tpe
2631 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
2634 * pt.c (do_class_deduction): Build qualified type.
2636 2017-06-06 Nathan Sidwell <nathan@acm.org>
2638 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
2639 sans using directives. Don't walk into inline namespaces.
2642 * name-lookup.c (adl_class_only): Don't add visible friends.
2644 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
2646 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
2648 2017-06-02 Nathan Sidwell <nathan@acm.org>
2650 Remove lang_type_ptrmem.
2651 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
2653 (lang_type_class): ... this. Reorder bitfields. Rename to ...
2654 (lang_type): ... this. Delete old definition.
2655 (lang_type_ptrmem): Delete.
2656 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
2657 (LANG_TYPE_PTRMEM_CHECK): Delete.
2658 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
2659 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
2660 * decl.c (build_ptrmemfunc_type): Adjust.
2661 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
2662 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
2664 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
2667 Remove cp_binding_level::namespaces
2668 * name-lookup.h (cp_binding_level): Lose namespaces field.
2669 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
2671 (suggest_alternatives_for): Adjust for namespace list. Do
2672 breadth-first search.
2673 * decl2.c (collect_source_refs): Namespaces are on the regulr
2675 (collect_ada_namespace): Likewise.
2677 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
2679 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
2682 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
2685 * method.c (constructible_expr): Strip array types before calling
2688 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
2691 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
2692 for case INDIRECT_REF too in the main switch.
2694 2017-05-31 Jason Merrill <jason@redhat.com>
2696 PR c++/80840 - ICE with constexpr and reference
2697 * pt.c (convert_nontype_argument): Don't test whether a decl is
2698 value-dependent when binding to a reference.
2700 2017-05-31 Nathan Sidwell <nathan@acm.org>
2702 * cp-tree.h (lang_decl_slector): New enum.
2703 (lang_decl_base): Make selector an enum. Drop decomposition_p
2705 (lang_decl): Use enum for discrimination.
2706 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
2707 LANG_DECL_DEOMP_CHECK): Use enum.
2708 (DECL_DECOMPOSITION_P): Use selector value.
2709 (SET_DECL_DECOMPOSITION_P): Delete.
2710 (retrofit_lang_decl): Lose SEL parm.
2711 (fit_decomposition_lang_decl): Declare.
2712 * decl.c (cp_finish_decomp, grokdeclarator): Use
2713 fit_decomposition_lang_decl.
2714 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
2716 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
2717 (fit_decomposition_lang_decl): Likewise.
2718 (retrofit_lang_decl): Use worker functions.
2719 (cxx_dup_lang_specific_decl): Use selector enum.
2720 (maybe_add_lang_type_raw): New. Broken out of ...
2721 (cxx_make_type_name): ... here. Call it.
2723 2017-05-30 Jason Merrill <jason@redhat.com>
2725 PR c++/80856 - ICE with local extern in template
2726 * semantics.c (finish_call_expr): Replace a local extern overload
2727 set in a template with the IDENTIFIER_NODE.
2729 2017-05-30 David Malcolm <dmalcolm@redhat.com>
2731 * call.c (perform_implicit_conversion_flags): Convert
2732 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
2733 (print_conversion_rejection): Replace pairs of %qT with
2734 %qH and %qI in various places.
2735 (build_user_type_conversion_1): Likewise.
2736 (build_integral_nontype_arg_conv): Likewise.
2737 (build_conditional_expr_1): Likewise.
2738 (convert_like_real): Likewise.
2739 (convert_arg_to_ellipsis): Likewise.
2741 (initialize_reference): Likewise.
2742 * cvt.c (cp_convert_to_pointer): Likewise.
2743 (cp_convert_to_pointer): Likewise.
2744 (convert_to_reference): Likewise.
2745 (ocp_convert): Likewise.
2746 * error.c (cp_printer): Gain bool and const char ** parameters.
2747 (struct deferred_printed_type): New struct.
2748 (class cxx_format_postprocessor): New class.
2749 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
2750 to pp->m_format_postprocessor.
2751 (comparable_template_types_p): New function.
2752 (newline_and_indent): New function.
2753 (arg_to_string): New function.
2754 (print_nonequal_arg): New function.
2755 (print_template_differences): New function.
2756 (type_to_string_with_compare): New function.
2757 (print_template_tree_comparison): New function.
2758 (append_formatted_chunk): New function.
2759 (add_quotes): New function.
2760 (cxx_format_postprocessor::handle): New function.
2761 (defer_phase_2_of_type_diff): New function.
2762 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
2764 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
2765 %qH and %qI in various places.
2766 (convert_member_func_to_ptr): Likewise.
2767 (build_reinterpret_cast_1): Likewise.
2768 (convert_for_assignment): Likewise.
2769 * typeck2.c (check_narrowing): Likewise.
2771 2017-05-30 Nathan Sidwell <nathan@acm.org>
2773 Kill IDENTIFIER_NAMESPACE_BINDINGS
2774 * cp-tree.h (lang_identifier): Delete namespace_bindings.
2775 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
2776 (lang_decl_ns): Add bindings.
2777 (DECL_NAMESPACE_BINDINGS): New.
2778 * lex.c (retrofit_lang_decl): Create namespace hash table.
2779 * name-lookup.c (find_namespace_slot): Change to use hash-map.
2780 * ptree.c (cxx_print_binding): Delete.
2781 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
2783 * cp-tree.def (OVERLOAD): Fix comment.
2784 * cp-tree.h: Fix comments and whitespace.
2785 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
2786 * name-lookup.c (add_decl_to_level): Assert not class.
2787 (check_local_shadow): Use OVL_P.
2788 (pushdecl_with_scope_1): Rename to ...
2789 (do_pushdecl_with_Scope): ... here.
2790 (do_nonmember_using_decl): Use qualified_namespace_lookup return
2792 (push_class_level_binding_1): Use OVL_P.
2793 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
2794 (pushtag_1): Rename to ...
2795 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
2797 (store_class_bindings): Do not time here.
2798 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
2799 * pt.c (listify): Declare argvec at point of initialization.
2802 * name-lookup.c (add_decl_to_level): Assert not making a circular
2804 (update_binding): Don't prematurely slide artificial decl.
2806 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
2808 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
2810 2017-05-29 Nathan Sidwell <nathan@acm.org>
2812 PR c++/80891 (#1,#5)
2813 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
2814 * name-lookup.c (name_lookup): Add deduping field.
2815 (name_lookup::preserve_state, name_lookup::restore_state): Deal
2817 (name_lookup::add_overload): New.
2818 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
2819 (name_lookup::search_adl): Set deduping. Don't unmark here.
2820 * pt.c (most_specialized_instantiation): Revert previous change,
2821 Assert not given duplicates.
2822 * tree.c (lookup_mark): Just mark the underlying decls.
2823 (lookup_maybe_add): Dedup using marked decls.
2826 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
2827 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
2829 Stat hack representation
2830 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
2831 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
2833 (find_namespace_binding): Replace with ...
2834 (find_namespace_slot): ... this.
2835 (find_namespace_value): New.
2836 (name_lookup::search_namespace_only,
2837 name_lookup::adl_namespace_only): Adjust.
2838 (update_binding): Add SLOT parameter, adjust.
2839 (check_local_shadow): Use find_namespace_value.
2840 (set_local_extern_decl_linkage): Likewise.
2841 (do_pushdecl): Adjust for namespace slot.
2842 (push_local_binding): Assert not a namespace binding.
2843 (check_for_out_of_scope_variable): Use find_namespace_value.
2844 (set_identifier_type_value_with_scope): Likewise.
2845 (get_namespace_binding): Likewise.
2846 (set_namespace_binding): Delete.
2847 (set_global_binding): Directly update the binding.
2848 (finish_namespace_using_decl): Likewise.
2849 (lookup_type_scope_1): Use find_namespace_slot and update.
2850 (do_push_nested_namespace): Use find_namespace_value.
2853 * pt.c (most_specialized_instantiation): Cope with duplicate
2857 * cp-tree.h (build_min_nt_call_vec): Declare.
2858 * decl.c (build_offset_ref_call_from_tree): Call it.
2859 * parser.c (cp_parser_postfix_expression): Likewise.
2860 * pt.c (tsubst_copy_and_build): Likewise.
2861 * semantics.c (finish_call_expr): Likewise.
2862 * tree.c (build_min_nt_loc): Keep unresolved lookups.
2863 (build_min): Likewise.
2864 (build_min_non_dep): Likewise.
2865 (build_min_non_dep_call_vec): Likewise.
2866 (build_min_nt_call_vec): New.
2869 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
2871 (lookup_keep): Call it.
2873 2017-05-26 Nathan Sidwell <nathan@acm.org>
2876 * name-lookup.c (push_inline_namespaces): New.
2877 (push_namespace): Look inside inline namespaces.
2879 Inline and using namespace representation change.
2880 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
2882 (DECL_NAMESPACE_USING): Adjust.
2883 (DECL_NAMESPACE_INLINEES): New.
2884 * name-lookup.h (struct cp_binding_level): Change usings
2886 * name-lookup.c (name_lookup::do_queue_usings,
2887 name_lookup::queue_usings): Adjust.
2888 (name_lookup::search_namespace, name_lookup::search_usings,
2889 name_lookup::queue_namespace): Adjust.
2890 (name_lookup::adl_namespace_only): Adjust.
2891 (add_using_namespace, push_namespace): Push onto vector.
2892 (pop_namespace): Add timing logic.
2894 * call.c (build_operator_new_call): Do namelookup and ADL here.
2895 (build_new_op_1): Likewise.
2896 * name-lookup.h (lookup_function_nonclass): Delete declaration.
2897 (do_using_directive): Likewise.
2898 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
2900 (struct scope_binding): Delete.
2901 (EMPTY_SCOPE_BINDING): Delete.
2902 (set_decl_namespace): Use OVL_P.
2903 (finish_local_using_decl): Lose unnecesary checks.
2904 (lookup_function_nonclass): Delete.
2905 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
2907 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
2908 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
2910 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
2911 (lkp_iterator): Add outer field. Adjust ctor.
2912 (lkp_iterator::operator++): New.
2913 (lookup_mark, lookup_maybe_add): Declare.
2914 * name-lookup.c (name_lookup): Delete fn_set member.
2915 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
2917 (name_lookup::add_value): Use lookup_add directly.
2918 (name_lookup::add_fns: Use lookup_maybe_add.
2919 (name_lookup::search_adl): Mark and unmark fns.
2921 * pt.c (check_explicit_specialization): Use lookup_add directly.
2922 * ptree.c (cxx_print_xnode): Show complete overload structure.
2923 * tree.c (lookup_mark, lookup_maybe_add): New.
2925 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
2927 2017-05-26 Jakub Jelinek <jakub@redhat.com>
2929 * cp-tree.h (struct lang_decl_decomp): New type.
2930 (struct lang_decl): Add u.decomp.
2931 (LANG_DECL_DECOMP_CHECK): Define.
2932 (DECL_DECOMPOSITION_P): Note it is set also on the vars
2933 for user identifiers.
2934 (DECL_DECOMP_BASE): Define.
2935 (retrofit_lang_decl): Add extra int = 0 argument.
2936 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
2937 use it to influence the selector choices and for selector
2938 0 to non-zero transition copy old content.
2939 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
2940 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
2941 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
2942 wording if decl is a structured binding.
2943 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
2944 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
2945 of individual variables for tuple structured bindings.
2946 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
2947 Clear DECL_DECOMP_BASE.
2948 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
2949 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
2951 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
2954 2017-05-25 Jason Merrill <jason@redhat.com>
2956 PR c++/80605 - __is_standard_layout and zero-length array
2957 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
2959 2017-05-25 Nathan Sidwell <nathan@acm.org>
2961 Kill OVL_CURRENT, OVL_NEXT.
2962 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
2963 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
2964 (consider_binding_level): Use OVL_FIRST.
2965 (cp_emit_debug_info_for_using): Use lkp_iterator.
2966 * pt.c (check_explicit_specialization): Use ovl_iterator.
2968 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
2969 * cp-tree.h (lang_decl_ns): Remove ns_users field.
2970 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
2971 (TREE_INDIRECT_USING): Delete.
2972 * name-lookup.h (is_associated_namespace): Delete.
2973 * name-lookup.c (name_lookup::search_usings,
2974 name_lookup::do_queue_usings): Usings are always direct.
2975 (is_associated_namespace): Delete.
2976 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
2977 (namespace_ancestor_1, namespace_ancestor): Delete.
2978 (push_using_directive_1, push_using_directive): Delete.
2979 (add_using_namespace_1): Delete.
2980 (add_using_namespace): Reimplement.
2981 (emit_debug_info_using_namespace): New.
2982 (finish_namespace_using_directive, finish_local_using_directive,
2983 push_namespace): Adjust.
2984 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
2986 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
2988 * semantics.c (finish_handler_parms): Warn about non-reference type
2991 2017-05-25 Nathan Sidwell <nathan@acm.org>
2993 Reimplement unqualified namespace lookup.
2994 * name-lookup.c (name_lookup::using_pair,
2995 name_lookup::using_queue): New typedefs.
2996 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
2997 name_lookup::queue_usings): New.
2998 (name_lookup::search_unqualified): New.
2999 (merge_functions, same_entity_p, ambiguous_decl,
3000 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
3001 lookup_using_namespace): Delete.
3002 (lookup_name_real_1): Adjust.
3004 Reimplement qualified namespace lookup.
3005 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
3006 (name_lookup::ambiguous, name_lookup::add_value,
3007 name_lookup::add_type, name_lookup::process_binding): New.
3008 (name_lookup::search_namespace_only,
3009 name_lookup::search_namespace, name_lookup::search_usings): New.
3010 (name_lookup::search_qualified): New.
3011 (do_nonmember_using_decl, suggest_alternatives_for,
3012 lookup_qualified_name): Adjust.
3013 (tree_vec_contains): Delete.
3014 (qualified_lookup_using_namespace): Rename to ...
3015 (qualified_namespace_lookup): ... here. Reimplement.
3018 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
3019 * name-lookup.h (lookup_arg_dependent): Return plain tree.
3020 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
3021 arg_assoc_args_vec, arg_assoc_type, add_function,
3022 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
3023 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
3024 lookup_arg_dependent_1): Delete.
3025 (name_lookup): New lookup object.
3026 (name_lookup::preserve_state, name_lookup::restore_state,
3027 name_lookup::mark_seen, name_lookup::find_and_mark,
3028 name_lookup::add_fns, name_lookup::adl_namespace_only,
3029 name_lookup::adl_namespace, name_lookup::adl_class_only,
3030 name_lookup::adl_bases, name_lookup::adl_class,
3031 name_lookup::adl_expr, name_lookup::adl_type,
3032 name_lookup::adl_template_arg, name_lookup::search_adl): New.
3033 (lookup_arg_dependent): Return a plain tree. Adjust.
3034 (is_associated_namespace): Move later.
3036 2017-05-24 Nathan Sidwell <nathan@acm.org>
3038 * friend.c (do_friend): Remove check for existing decl.
3039 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
3040 * name-lookup.c (push_local_binding): Directly look for binding.
3041 (lookup_name_innermost_nonclass_level_1): Delete.
3042 (lookup_name_innermost_nonclass_level): Delete.
3044 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
3046 * cp-tree.h (cp_free_lang_data): Add extern.
3047 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
3049 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
3050 * typeck.c (type_unknown_p): Delete.
3051 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
3052 overload management.
3053 (dependent_name): Likewise.
3054 (decl_anon_ns_mem_p): Simplify.
3056 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
3059 * tree.c (reshape_init): Use unqualified type for direct enum init.
3060 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
3061 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
3062 non-class destination types.
3063 (build_const_cast_1): Strip cv-quals from destination types.
3064 (build_static_cast, build_reinterpret_cast, build_const_cast)
3065 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
3067 2017-05-24 Martin Sebor <msebor@redhat.com>
3070 * call.c (fully_fold_internal): Adjust.
3072 2017-05-24 Nathan Sidwell <nathan@acm.org>
3074 * cp-tree.h (ovl_skip_hidden): Declare.
3075 * tree.c (ovl_skip_hidden): New.
3076 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
3077 (lookup_arg_dependent_1): Likewise.
3078 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
3079 (hidden_name_p, remove_hidden_names): Delete.
3080 (lookup_name_real_1): Do not strip hidden names.
3081 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
3083 * cp-tree.h (OVL_HIDDEN_P): New.
3084 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
3085 (ovl_iterator::reveal_node): Declare.
3086 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
3087 (ovl_insert): Order on hiddenness.
3088 (ovl_iterator::reveal_node): New.
3089 * name-lookup.c (anticipated_builtin_p): New.
3090 (supplement_binding_1): Use it.
3091 (set_local_extern_decl_linkage): Use hidden_p.
3092 (do_pushdecl): Deal with unhiding a hidden decl, use
3093 anticipated_builtin_p.
3094 (do_nonmember_using_decl): Use anticipated_decl_p.
3095 (lookup_name_real_1): Use DECL_HIDDEN_P.
3097 2017-05-23 Jason Merrill <jason@redhat.com>
3099 -Wunused and C++17 structured bindings
3100 * decl.c (poplevel): Don't warn about unused structured bindings,
3101 only real variables.
3102 * error.c (dump_simple_decl): Handle structured bindings.
3103 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
3105 2017-05-23 Nathan Sidwell <nathan@acm.org>
3107 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
3108 * name-lookup.c (create_local_binding): New.
3109 (update_binding): New.
3110 (pushdecl_maybe_friend_1): Rename to ...
3111 (do_pushdecl): ... this. Reimplement.
3113 (push_overloaded_decl_1, push_overloaded_decl): Delete.
3115 2017-05-23 Jason Merrill <jason@redhat.com>
3117 PR c++/80396 - built-in for make_integer_sequence.
3118 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
3119 (expand_integer_pack, expand_builtin_pack_call): New.
3120 (find_parameter_packs_r): Check builtin_pack_call_p.
3121 (check_for_bare_parameter_packs): Handle it.
3122 (tsubst_pack_expansion): Call expand_builtin_pack_call.
3123 (declare_integer_pack): New.
3124 (init_template_processing): Call it.
3125 * decl2.c (mark_used): Check builtin_pack_fn_p.
3127 2017-05-23 Nathan Sidwell <nathan@acm.org>
3129 * name-lookup.c (find_namespace_binding): New.
3130 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
3131 (set_identifier_type_value_with_scope): Use find_namespace_binding.
3132 (find_binding, cp_binding_level_find_binding_for_name,
3133 binding_for_name, namespace_binding_1): Delete.
3134 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
3135 (get_namespace_binding, set_namespace_binding,
3136 finish_namespace_using_decl, unqualified_namespace_lookup_1,
3137 qualified_lookup_using_namespace, lookup_type_scope_1,
3138 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
3141 * parser.c (cp_parser_template_id): Keep the lookup when stashing
3144 * cp-tree.h (DECL_HIDDEN_P): New.
3145 * name-lookup.c (set_decl_context,
3146 set_local_extern_decl_linkage): New, broken out of ...
3147 (pushdecl_maybe_friend_1): ... here. Call them.
3149 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
3151 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
3152 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
3155 2017-05-23 Nathan Sidwell <nathan@acm.org>
3157 * cp-tree.h (OVL_P): New.
3158 * name-lookup.h (push_local_binding): Delete.
3159 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3160 (finish_namespace_using_decl, finish_local_using_decl): ... here
3161 * name-lookup.c (add_decl_to_level): Swap args.
3162 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
3163 (diagnose_name_conflict): Check contexts are same for redecl.
3164 (update_local_overload): New.
3165 (compparms_for_decl_and_using): Rename to ...
3166 (matching_fn_p): ... here.
3167 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
3168 push_local_bindings call.
3169 (push_local_binding): Make static, replace FLAGS arg with
3171 (validate_nonmember_using_decl): Use OVL_FIRST.
3172 (do_nonmember_using_decl): Use in/out parameters. Use
3173 lkp_iterator and simplify.
3174 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3175 (finish_namespace_using_decl, finish_local_using_decl): ... here.
3177 (lookup_type_current_level): Delete.
3178 * parser.c (cp_parser_using_declaration): Adjust.
3179 * pt.c (tsubst_expr): Adjust.
3181 2017-05-22 Nathan Sidwell <nathan@acm.org>
3183 * name-lookup.h (parse_using_directive): Replace with ...
3184 (finish_namespace_using_directive): ... this and ...
3185 (finish_local_using_directive): ... this.
3186 * name-lookup.c (add_using_namespace_1): Move later.
3187 (add_using_namespace): Move later, add namespace_p arg, remove
3189 (push_using_directive_1): Directly recurse.
3190 (do_using_directive, parse_using_directive): Delete, split into ...
3191 (finish_namespace_using_directive): ... this and ...
3192 (finish_local_using_directive): ... this.
3193 (push_namespace): Use add_using_namespace.
3194 * parser.c (cp_parser_using_directive): Call
3195 finish_namespace_using_directive or finish_local_using_directive.
3196 * pt.c (tsubst_expr): Call finish_local_using_directive.
3198 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
3199 * cp-tree.h (raw_dump_id): Declare.
3200 * decl2.c (raw_dump_id): Define.
3201 (dump_tu): Use raw_dump_id.
3203 * config-lang.in (gtfiles): Sort list, break lines.
3205 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
3206 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
3207 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
3208 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
3209 CPTI_RETHROW_FN): New.
3210 (noexcept_deferred_spec): New.
3211 (terminate_node, call_unexpected_node): Rename to ...
3212 (terminate_fn, call_unexpected_fn): ... here.
3213 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
3214 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
3215 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
3216 (init_exception_processing): Adjust.
3217 (declare_library_fn): Create and push the fns here.
3218 (do_get_exception_ptr, do_begin_catch, do_end_catch,
3219 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
3220 declare_library_fn use.
3221 (unevaluated_noexcept_spec): Adjust.
3222 * cp-gimplify.c (genericize_eh_spec_block,
3223 gimplify_most_not_throw_expr): Adjust.
3225 * name-lookup.c (pushdecl_top_level,
3226 pushdecl_top_level_and_finish): Move after namespace pushing and
3228 (push_to_top_level): Rename to ...
3229 (do_push_to_top_level): ... here. Remove timing code.
3230 (pop_from_top_level_1): Rename to ...
3231 (do_pop_from_top_level): ... here.
3232 (do_push_nested_namespace, do_pop_nested_namespace)
3233 (push_to_top_level): New wrapper for do_push_to_top_level.
3234 (pop_from_top_level): Adjust.
3235 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
3237 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
3239 * config-lang.in (gtfiles): Add c-family/c-format.c,
3240 except.c, init.c, lambda.c and friend.c.
3241 * class.c (dvirt_fn): Move out of function scope,
3243 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
3244 * init.c (fn): Likewise.
3245 * lambda.c (ptr_id, max_id): Likewise.
3246 * friend.c (global_friend): Add GTY attribute.
3248 2017-05-19 Nathan Sidwell <nathan@acm.org>
3250 * call.c (add_list_candidates): Use OVL_FIRST.
3251 (build_new_method_call_1): Likewise.
3252 * cp-tree.h (OVL_SINGLE_P): New.
3253 (TYPE_HIDDEN_P): New.
3254 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
3255 * dump.c (cp_tump_tree): Adjust overload dumping.
3256 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
3258 * method.c (lazily_declare_fn): Assert we added it.
3259 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
3261 (cp_parser_template_name): Use lkp_iterator.
3262 * pt.c (begin_template_parm_list): Fixup comment.
3263 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
3264 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
3265 (ovl_scope): Use lkp_iterator.
3267 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
3269 * parser.c (cp_parser_omp_clause_default): Handle
3270 "OMP_CLAUSE_DEFAULT_PRESENT".
3272 * parser.c (cp_parser_omp_clause_default): Avoid printing more
3273 than one syntax error message.
3275 2017-05-19 Nathan Sidwell <nathan@acm.org>
3277 * class.c (class_dump_id): Define.
3278 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
3279 * cp-objcp-common.c (cp_register_dumps): New.
3280 * cp-objcp-common.h (cp_register_dumps): Declare.
3281 (LANG_HOOKS_REGISTER_DUMPS): Override.
3282 * cp-tree.h (class_dump_id): Declare.
3284 2017-05-18 Nathan Sidwell <nathan@acm.org>
3286 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
3288 (lookup_keep): Declare.
3289 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
3290 * pt.c (tsubst_copy): Assert lookup is persistent.
3291 * semantics.c (finish_call_expr): Use lkp_iterator, call
3293 * tree.c (ovl_copy): New.
3294 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
3297 * cp-tree.h (OVL_USED): Replace with ...
3298 (OVL_USING_P): ... this.
3299 (ovl_iterator::using_p): Adjust.
3300 * name-lookup.c (push_overloaded_decl_1,
3301 do_nonmember_using_decl): Adjust.
3302 * search.c (lookup_field_r): Adjust.
3303 * tree.c (ovl_insert, ovl_scope): Adjust.
3305 * cp-tree.h (lookup_add): Swap args.
3306 (ovl_cons, build_overload): Delete.
3307 * name-lookup.c (add_function, push_overloaded_decl_1,
3308 do_nonmember_using_decl, merge_functions, remove_hidden_names):
3309 Use lookup_add, ovl_insert.
3310 * pt.c (check_explicit_specialization): Use lookup_add.
3311 (do_class_deduction): Likewise. Refactor if.
3312 * tree.c (lookup_add): Swap args.
3313 (ovl_cons, build_overload): Delete.
3315 * name-lookup.c (find_local_binding): New, broken out of ...
3316 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
3317 (set_namespace_binding): Swap scope & name args.
3318 (namespace_binding_1): Likewise.
3319 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
3320 (push_overloaded_decl_1): Likewise.
3321 (set_global_binding): Likewise.
3322 (get_namespace_binding): Adjust namespace_binding_1 call.
3324 2017-05-17 Nathan Sidwell <nathan@acm.org>
3326 * cp-tree.h (default_hash_traits <lang_identifier *>): New
3328 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
3329 (extern_c_fns): New hash table.
3330 (check_extern_c_conflict): New, broken out of ...
3331 (pushdecl_maybe_friend_1): ... here. Call it.
3332 (c_linkage_bindings): Just look in hash table.
3334 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
3338 Implement new C++ intrinsics __is_assignable and __is_constructible.
3339 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
3341 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3342 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3343 * method.c (constructible_expr): Set cp_unevaluated.
3344 (is_xible_helper): New.
3345 (is_trivially_xible): Adjust.
3347 * parser.c (cp_parser_primary_expression): Handle
3348 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
3349 (cp_parser_trait_expr): Likewise.
3350 * semantics.c (trait_expr_value): Handle
3351 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3353 2017-05-17 Nathan Sidwell <nathan@acm.org>
3355 * cp-tree.h (ovl_iterator::using_p): New predicate.
3356 (ovl_iterator::remove_node): New worker.
3357 (ovl_insert): Declare.
3358 * tree.c (ovl_insert): New.
3359 (ovl_iterator::remove_node): New.
3360 * class.c (add_method): Use ovl_iterator, ovl_insert.
3361 (clone_function_decl): Fix description.
3362 (clone_constructors_and_destructors): Use ovl_iterator.
3364 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
3365 (maybe_warn_about_overly_private_class): Use ovl_iterator.
3366 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
3367 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
3368 (get_base_fndecls): Use ovl_iterator.
3369 (warn_hidden): Use OVL_NAME, ovl_iterator.
3370 (add_implicitly_declared_members): Use ovl_iterator.
3371 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
3373 (finish_shorthand_constraint): Simplify, use ovl_make.
3374 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
3375 * search.c (shared_member_p): Use ovl_iterator.
3376 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
3377 (lookup_conversion_operator): Use OVL_FIRST.
3378 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
3379 (look_for_overrides_here): Use ovl_iterator.
3380 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
3381 * typeck.c (build_x_unary_op): Use ovl_make.
3383 2017-05-17 Martin Liska <mliska@suse.cz>
3385 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
3386 use it instead of int type.
3387 (dump_vtable): Likewise.
3388 (dump_vtt): Likewise.
3389 * decl2.c (dump_tu): Likewise.
3391 2017-05-16 David Malcolm <dmalcolm@redhat.com>
3393 * call.c (enforce_access): Add access_failure_info * param and use
3394 it to record access failures.
3395 * cp-tree.h (class access_failure_info): New class.
3396 (enforce_access): Add access_failure_info * param, defaulting to
3398 (lookup_member): Likewise.
3399 (locate_field_accessor): New function decl.
3400 (perform_or_defer_access_check): Add access_failure_info * param,
3402 * search.c (lookup_member): Add access_failure_info * param and
3403 pass it on to call to perform_or_defer_access_check.
3404 (matches_code_and_type_p): New function.
3405 (field_access_p): New function.
3406 (direct_accessor_p): New function.
3407 (reference_accessor_p): New function.
3408 (field_accessor_p): New function.
3409 (struct locate_field_data): New struct.
3410 (dfs_locate_field_accessor_pre): New function.
3411 (locate_field_accessor): New function.
3412 * semantics.c (perform_or_defer_access_check): Add
3413 access_failure_info * param, and pass it on to call to
3415 * typeck.c (access_failure_info::record_access_failure): New method.
3416 (access_failure_info::maybe_suggest_accessor): New method.
3417 (finish_class_member_access_expr): Pass an access_failure_info
3418 instance to the lookup_member call, and call its
3419 maybe_suggest_accessor method afterwards.
3421 2017-05-16 Marek Polacek <polacek@redhat.com>
3425 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
3427 2017-05-16 Nathan Sidwell <nathan@acm.org>
3429 * name-lookup.c (check_local_shadow): New, broke out of ...
3430 (pushdecl_maybe_friend_1): ... here. Call it.
3432 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
3433 (ovl_first): Move inline definition to end of file.
3434 (ovl_make, lookup_add): Declare.
3435 (get_fns, get_first_fn): Make pure.
3436 * tree.c (ovl_cache): New.
3437 (ovl_make, lookup_add): New.
3438 * pt.c (do_class_deduction): Don't add candidates that will be
3441 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
3442 (print_error_for_call_failure): Use OVL_NAME.
3443 (build_op_call_1): Use ovl_iterator.
3444 (add_candidates): Use OVL_FIRST & lkp_iterator.
3445 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
3447 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
3448 (type_has_user_nondefault_constructor,
3449 in_class_defaulted_default_constructor,
3450 type_has_user_provided_constructor,
3451 type_has_user_provided_or_explicit_constructor,
3452 type_has_non_user_provided_default_constructor,
3453 vbase_has_user_provided_move_assign,
3454 type_has_move_constructor, type_has_move_assign,
3455 type_has_user_declared_move_constructor,
3456 type_has_user_declared_move_assign,
3457 type_build_ctor_call, type_build_dtor_call,
3458 type_requires_array_cookie, explain_non_literal_class): Likewise.
3459 (finish_struct): Use lkp_iterator.
3460 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
3461 (note_name_declared_in_class): Use OVL_NAME.
3462 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
3463 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
3464 cxx_pretty_printer::expression): Likewise.
3465 * decl2.c (check_classfn): Use ovl_iterator.
3466 * pt.c (retrieve_specialization): Use ovl_iterator.
3467 * tree.c (cp_tree_equal): Use lkp_iterator.
3468 (type_has_nontrivial_copy_init): Use ovl_iterator.
3470 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
3471 check is_overloaded_fn.
3473 2017-05-16 Martin Liska <mliska@suse.cz>
3475 * parser.c (cp_lexer_print_token): Add default value for flags
3476 argument of print_gimple_stmt, print_gimple_expr,
3477 print_generic_stmt and print_generic_expr.
3479 2017-05-16 Nathan Sidwell <nathan@acm.org>
3481 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
3483 (MAYBE_BASELINK_FUNCTIONS): New.
3484 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
3485 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
3486 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
3487 * method.c (inherited_ctor_binfo): Use ovl_iterator.
3488 (binfo_inherited_from): Likewise.
3489 * parser.c (lookup_literal_operator): Use lkp_iterator.
3490 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
3491 (print_candidates_1): Likewise.
3492 (determine_specialization): Likewise.
3493 (resolve_overloaded_unification): Likewise.
3494 (resolve_nondeduced_context): Likewise.
3495 (type_dependent_expression_p): Likewise.
3496 (dependent_template_p): Likewise.
3497 * ptree.c (cxx_print_xnode): Likewise.
3498 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
3499 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
3500 * typeck.c (check_template_keyword): Use lkp_iterator.
3502 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
3504 * constexpr.c (function_concept_check): Use OVL_FIRST.
3505 * cvt.c (build_expr_type_conversion): Likewise.
3506 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
3507 * decl2.c (mark_used): Use OVL_FIRST.
3508 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
3509 (dump_expr, location_of): Use OVL_FIRST.
3510 * friend.c (do_friend): Use OVL_NAME.
3511 * init.c (build_offset_ref): Use OVL_FIRST.
3512 * mangle.c (write_member_name): Likewise.
3513 (write_expression): Use OVL_NAME.
3514 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
3515 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
3516 * pt.c (check_explicit_specialization): Use OVL_FIRST.
3517 (check_template_shadow): Likewise.
3518 (tsubst_template_args): Use OVL_NAME.
3519 (tsubst_baselink): Use OVL_FIRST.
3520 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
3521 * tree.c (get_first_fn): Use OVL_FIRST.
3522 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
3523 (cp_build_addr_expr_1): Use OVL_FIRST.
3525 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
3527 * semantics.c (finish_id_expression): Directly init local var.
3528 (finish_omp_reduction_clause): Use really_overloaded_fn.
3529 * tree.c (get_fns): Document. Assert we got an overload.
3530 (get_first_fn) Document.
3531 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
3532 really_overloaded_fn.
3533 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
3535 * cp-tree.h (SCOPE_DEPTH): New.
3536 * name-lookup.h (is_nested_namespace): Declare.
3537 * name-lookup.c (is_nested_namespace): New.
3538 (is_ancestor): Use it.
3539 (set_decl_namespace): Likewise.
3540 (push_namespace): Set SCOPE_DEPTH.
3541 * pt.c (check_specialization_namespace): Use is_nested_namespace.
3542 (check_unqualigied_spec_or_inst): Likewise.
3544 2017-05-15 Nathan Sidwell <nathan@acm.org>
3547 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
3548 * name-lookup.h (push_namespace): Return int, add make_inline arg.
3549 * name-lookup.c (push_namespace): Deal with inline directly.
3550 Return pushed count.
3551 * parser.c (cp_parser_namespace_definition): Adjust for
3552 push_namespace change.
3554 2017-05-11 Nathan Sidwell <nathan@acm.org>
3556 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
3557 LANG_HOOKS_PUSHDECL): Move to ...
3558 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
3559 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
3560 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
3562 * name-lookup.h (pushdecl): Add default friend parm.
3563 (pushdecl_maybe_friend): Delete.
3564 (pushdecl_top_level): Add default friend parm.
3565 (pushdecl_top_level_maybe_friend): Delete.
3566 * name-lookup.c (pushdecl_maybe_friend): Delete.
3567 (pushdecl): Add is_friend parm.
3568 (pushdecl_top_level): Add is friend_parm.
3569 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
3570 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
3571 * friend.c (do_friend): Adjust.
3572 * pt.c (tsubst_friend_class): Adjust.
3574 Revert pushdecl_top_level_and_finish name change.
3575 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
3576 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
3577 * decl.c (cp_make_fname_decl): Adjust.
3578 * decl2.c (get_guard, handle_tls_init): Adjust.
3579 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
3581 * name-lookup.c (pushdecl_outermost_localscope): Always
3582 conditionally stop timer.
3584 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
3585 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
3587 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
3588 pushtag_top_level_maybe_friend,
3589 pushdecl_top_level_and_finish): Move declarations to ...
3590 * name-lookup.h: ... here. Group pushdecl variants.
3591 (pushdecl_top_level_and_finish): Rename to ...
3592 (pushdecl_top_level_with_init): ... here.
3593 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
3594 * decl2.c (get_guard, handle_tls_init): Likewise.
3595 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
3596 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
3597 * method.c (implicitly_declare_fn): Likewise.
3598 * searchc (node_debug_info_needed): Likewise.
3599 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
3600 (pushdecl_top_level_with_init): ... here.
3601 (pop_everything): Use namespace_bindings_p.
3603 * name-lookup.h (pop_binding): Rename to pop_local_binding.
3604 (getdecls): Rename to get_local_decls.
3605 * name-lookup.c (pop_binding): Rename to ...
3606 (pop_local_binding): ... here.
3607 (pop_bindings_and_leave_scope): Adjust.
3608 (getdecls): Rename to ...
3609 (get_local_decls): ... here. Assert local scope.
3610 * decl.c (poplevel): Assert not namespace. Adjust and simplify
3612 (store_parm_decls): Adjust get_local_decls call.
3613 (parser.c (synthesize_implicit_template_parm): Likewise.
3615 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
3618 * method.c (is_trivially_xible): Reject void types.
3620 2017-05-10 Nathan Sidwell <nathan@acm.org>
3622 * class.c (handle_using_decl): Always use OVL_CURRENT.
3623 (resolve_address_of_overloaded_function): Move iterator decl into
3624 for scope. Don't strip anticipated decls here.
3626 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
3628 (print_candidates): Adjust.
3630 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
3632 * call.c (build_new_function_call): Lose koenig_p arg. Remove
3633 koenig_p handling here.
3634 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
3635 (tsubst_omp_clauses): Likewise.
3636 (do_class_deduction): Adjust buld_new_function_call calls.
3637 * semantics.c (finish_call_expr): Likewise.
3639 2017-05-10 Jason Merrill <jason@redhat.com>
3641 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
3642 (unify_type_mismatch, unify_parameter_pack_mismatch)
3643 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
3644 (unify_parameter_pack_inconsistent, unify_inconsistency)
3645 (unify_vla_arg, unify_method_type_error, unify_arity)
3646 (unify_arg_conversion, unify_no_common_base)
3647 (unify_inconsistent_template_template_parameters)
3648 (unify_template_deduction_failure)
3649 (unify_template_argument_mismatch)
3650 (unify_overload_resolution_failure): Call unify_invalid.
3652 CWG 1847 - Clarifying compatibility during partial ordering
3653 * pt.c (more_specialized_fn): No order between two non-deducible
3656 * pt.c (dependent_type_p): Make sure we aren't called with
3659 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3660 * pt.c (convert_template_argument): Just return an argument pack.
3661 (coerce_template_parameter_pack, template_parm_to_arg)
3662 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
3663 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
3664 Don't set the type of a NONTYPE_ARGUMENT_PACK.
3665 * parser.c (make_char_string_pack, make_string_pack): Likewise.
3667 2017-05-10 Nathan Sidwell <nathan@acm.org>
3669 * cp-tree.h (add_method, clone_function_decl): Change last arg to
3671 * class.c (add_method): Change third arg to bool. Adjust.
3672 (one_inheriting_sig, one_inherited_ctor): Adjust.
3673 (clone_function_decl): Change 2nd arg to bool. Adjust.
3674 (clone_constructors_and_destructors): Adjust.
3675 * lambda.c (maybe_add_lambda_conv_op): Adjust.
3676 * method.c (lazily_declare_fn): Adjust.
3677 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
3678 * semantics.c (finish_member_declaration): Adjust.
3680 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
3683 * decl.c (finish_function): To improve error recovery, change the
3684 logic for calling apply_deduced_return_type.
3686 2017-05-09 Jason Merrill <jason@redhat.com>
3688 PR c++/80605 - __is_standard_layout and empty base
3689 * class.c (check_bases): Ignore empty bases.
3691 PR c++/70979 - literal class and closure types
3692 * class.c (finalize_literal_type_property): Handle closures
3694 (explain_non_literal_class): Likewise.
3696 PR c++/66297, DR 1684 - literal class and constexpr member fns
3697 * constexpr.c (is_valid_constexpr_fn): Only complain about
3698 non-literal enclosing class in C++11.
3699 * class.c (finalize_literal_type_property): Likewise.
3701 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
3704 * pt.c (tsubst_decl): Early return error_mark_node if
3705 grok_ctor_properties returns false.
3707 2017-05-09 Jason Merrill <jason@redhat.com>
3709 PR c++/70167 - array prvalue treated as lvalue
3710 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
3712 * semantics.c (finish_compound_literal): Add fcl_context parameter.
3713 Only make a static variable for C99 syntax.
3714 * parser.c (cp_parser_postfix_expression): Pass it.
3715 * pt.c (tsubst_copy_and_build): Likewise.
3716 * call.c (extend_ref_init_temps): Set
3717 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
3719 2017-05-09 Nathan Sidwell <nathan@acm.org>
3721 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
3722 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
3723 * name-lookup.h (pushdecl_top_level): Declare.
3725 2017-05-08 Jason Merrill <jason@redhat.com>
3727 PR c++/80178 - parameter passing for uncopyable classes
3728 * tree.c (type_has_nontrivial_copy_init): True for classes with only
3729 deleted copy/move ctors.
3730 (remember_deleted_copy, maybe_warn_parm_abi): New.
3731 * decl.c (require_complete_types_for_parms, check_function_type):
3732 Call maybe_warn_parm_abi.
3733 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
3735 2017-05-08 Nathan Sidwell <nathan@acm.org>
3737 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
3738 (start_preparsed_function): Do decl pushing before setting
3739 current_funciton_decl and announcing it.
3741 * name-lookup.h (pushdecl_with_scope): Replace with ...
3742 (pushdecl_outermost_localscope): ... this.
3743 * name-lookup.c (pushdecl_with_scope): Replace with ...
3744 (pushdecl_outermost_localscope): ... this.
3745 (pushdecl_namespace_level): Adjust.
3746 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
3747 * lambda.c (insert_capture_proxy): Likewise.
3749 * class.c (build_vtbl_initializer): Don't shadow outer variable
3752 Revert _binding -> _value change.
3753 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
3754 (get_namespace_binding, set_global_binding): ... these.
3755 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
3756 (get_namespace_binding, set_global_binding): ... these.
3757 (arg_assoc_namespace, pushdecl_maybe_friend_1,
3758 check_for_out_of_scope_variable, push_overloaded_decl_1,
3759 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
3760 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
3761 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
3762 * decl.c (poplevel): Adjust.
3763 * pt.c (make_constrained_auto): Likewise.
3765 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
3767 PR translation/80280
3768 * call.c (print_z_candidate): Fix quoting.
3770 2017-05-05 David Malcolm <dmalcolm@redhat.com>
3772 * error.c (pedwarn_cxx98): Replace report_diagnostic
3773 with diagnostic_report_diagnostic.
3775 2017-05-05 Nathan Sidwell <nathan@acm.org>
3777 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
3778 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
3779 (IDENTIFIER_NAMESPACE_VALUE): Delete.
3780 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
3782 (get_namespace_value, set_global_value): ... these.
3783 (get_global_value_if_present, is_typename_at_global_scope): Delete.
3784 * decl.c (poplevel): Use get_namespace_value.
3785 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
3786 * class.c (build_vtbl_initializer): Stash library decl in
3787 static var. Use IDENTIFIER_GLOBAL_VALUE.
3788 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
3789 do_allocate_exception, do_free_exception, build_throw): Likewise.
3790 * init.c (throw_bad_array_new_length): Likewise.
3791 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
3792 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
3793 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
3794 get_namespace_value.
3795 (set_namespace_binding_1): Rename to
3796 (set_namespace_binding): ... here.
3797 (set_global_value): New.
3798 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
3799 get_namespace_value.
3800 * pt.c (listify): Use get_namespace_value.
3802 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
3804 * lex.c (unqualified_name_lookup_error): Likewise.
3806 * class.c (alter_class): Use retrofit_lang_decl directly.
3807 * decl.c (push_local_name, dupliate_decls): Likewise.
3808 * semantics.c (omp_privatize_field): Likewise.
3810 Kill walk_namespaces.
3811 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
3812 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
3814 Kill per-namespace static_decls.
3815 * cp-tree.h (static_decls): Declare.
3816 (wrapup_globals_for_namespace,
3817 diagnose_inline_vars_for_namespace): Replace with ...
3818 (wrapup_namespace_globals): ... this.
3819 * decl.c (static_decls): Define.
3820 (wrapup_globals_for_namespace,
3821 diagnose_inline_vars_for_namespace): Replace with ...
3822 (wrapup_namespace_globals): ... this.
3823 (cxx_init_decl_processing): Initialize static_decls.
3824 * decl2.c (c_parse_final_cleanups): Adjust.
3825 * name-lookup.h (cp_binding_level): Remove static_decls member.
3826 * name-lookup.c (add_decl_to_level): Adjust.
3827 (begin_scope): Adjust.
3829 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
3832 * decl.c (reshape_init): Unconditionally return error_mark_node
3833 upon error about too many initializers.
3835 2017-05-04 Nathan Sidwell <nathan@acm.org>
3837 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
3839 2017-05-04 Martin Sebor <msebor@redhat.com>
3841 PR translation/80280
3842 * call.c (print_z_candidate): Add missing quoting to %D and other
3844 (build_op_call_1): Same.
3845 * constraint.cc (diagnose_check_constraint): Same.
3846 * mangle.c (mangle_decl): Same.
3847 * name-lookup.c (cp_binding_level_debug): Same.
3848 (set_decl_namespace): Same.
3849 * parser.c (cp_parser_tx_qualifier_opt): Same.
3850 * pt.c (print_candidates_1): Same.
3851 (check_template_variable): Same.
3852 (tsubst_default_argument): Same.
3853 (most_specialized_partial_spec): Same.
3854 * semantics.c (omp_reduction_lookup): Same.
3855 * tree.c (check_abi_tag_redeclaration): Same.
3856 * typeck.c (comptypes): Same.
3857 * typeck2.c (abstract_virtuals_error_sfinae): Same.
3859 2017-05-04 Nathan Sidwell <nathan@acm.org>
3862 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
3863 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
3864 CPTI_INIT_LIST_IDENTIFIER.
3865 (global_namespace, global_type_node, global_identifier,
3866 anon_identifier, init_list_identifier): New.
3867 * decl.c (global_type_node, global_scope_name): Delete.
3868 (initialize_predefined_identifiers): Add new identifiers.
3869 (cxx_init_decl_processing): Adjust.
3870 * name-lookup.h (global_namespace, global_type_node): Delete.
3871 * name-lookup.c (global_namespace, anonymous_namespace_name,
3872 get_anonymous_namespace_name): Delete.
3873 (namespace_scope_ht_size, begin_scope, pushtag_1,
3874 push_namespace): Adjust,
3875 * call.c (type_has_extended_temps): Use init_list_identifier.
3876 * pt.c (listify): Likewise.
3878 * name-lookup.c: Reorder functions to make merging from modules
3881 2017-05-03 Jason Merrill <jason@redhat.com>
3883 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
3885 2017-05-03 Nathan Sidwell <nathan@acm.org>
3887 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
3888 along with #defines, to before name-lookup include.
3890 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
3892 * pt.c (is_auto_or_concept): Remove.
3893 (type_uses_auto_or_concept): Remove, unused.
3894 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
3895 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
3896 * cp-tree.h (is_auto_or_concept): Remove.
3898 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
3901 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
3902 add pedigree operation and detach call here.
3903 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
3904 cilk_cp_gimplify_call_params_in_spawned_fn.
3905 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
3906 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
3908 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
3910 * parser.c (cp_parser_member_declaration): Add fix-it hints for
3911 stray comma and missing semicolon at end of member declaration.
3913 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
3915 * parser.c (cp_parser_cast_expression): Add target type of cast to
3917 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
3919 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
3921 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
3922 return type to bool.
3923 * cp-tree.h (grok_ctor_properties): Update.
3925 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
3927 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
3928 information to diagnostic of invalid colon in nested-name-specifier.
3930 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
3932 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
3933 diagnostic of invalid class/struct keyword after enum.
3935 2017-04-25 David Malcolm <dmalcolm@redhat.com>
3937 * parser.c (cp_parser_member_declaration): Add fix-it hint
3938 for removing stray semicolons.
3940 2017-04-25 David Malcolm <dmalcolm@redhat.com>
3942 * name-lookup.c (get_std_name_hint): New function.
3943 (maybe_suggest_missing_header): New function.
3944 (suggest_alternative_in_explicit_scope): Call
3945 maybe_suggest_missing_header.
3947 2017-04-25 David Malcolm <dmalcolm@redhat.com>
3950 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
3951 candidate type of bm from tree to const char *.
3952 (consider_binding_level): Likewise.
3953 (lookup_name_fuzzy): Likewise, using this to merge the best
3954 result from the preprocessor into bm, rather than immediately
3955 returning, so that better matches from reserved words can "win".
3956 Guard the rejection of keywords that don't start decl-specifiers
3957 so it only happens for FUZZY_LOOKUP_TYPENAME.
3959 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
3961 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
3962 (start_enum): Likewise.
3963 (build_enumerator): Likewise. Use %qE instead of plain %E.
3964 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
3965 %<%D%> in diagnostics.
3966 (cp_parser_elaborated_type_specifier): Likewise.
3967 * pt.c (make_pack_expansion): Use %qT and %qE instead of
3968 %<%T%> and %<%E%> in diagnostics.
3969 (tsubst_pack_expansion): Likewise.
3971 2017-04-24 David Malcolm <dmalcolm@redhat.com>
3974 * parser.c (cp_parser_unary_expression): Generate a location
3975 range for alignof and sizeof expressions.
3977 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
3979 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
3981 (cp_parser_virt_specifier_seq_opt): Likewise.
3982 (set_and_check_decl_spec_loc): Likewise twice.
3984 2017-04-21 Jason Merrill <jason@redhat.com>
3986 PR c++/80179 - ICE with initialized flexible array member.
3987 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
3989 2017-04-21 Richard Biener <rguenther@suse.de>
3991 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
3992 (copy_type): Likewise.
3993 * lex.c (copy_decl): Pass down mem-stat info.
3994 (copy_type): Likewise.
3996 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
3999 * init.c (build_new_1): Suppress notes about over-aligned new when
4000 the warning is suppressed.
4002 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
4004 * parser.c (cp_parser_member_declaration): Add warning with fixit
4005 information for extra semicolon after in-class function definition.
4007 2017-04-20 Jakub Jelinek <jakub@redhat.com>
4010 * tree.c (build_cplus_array_type): Call build_array_type
4011 with the intended TYPE_TYPELESS_STORAGE flag value, instead
4012 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
4015 2017-04-18 Marek Polacek <polacek@redhat.com>
4017 PR c++/80244 - ICE with attribute in template alias.
4018 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
4020 PR c++/80241 - ICE with alignas pack expansion.
4021 * error.c (dump_expr): Handle TREE_LIST.
4022 * parser.c (cp_parser_std_attribute_list): Return error_mark if
4023 make_pack_expansion returns an error.
4025 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
4028 * class.c (fixup_may_alias): Fix all type variants.
4030 2017-04-17 Jason Merrill <jason@redhat.com>
4032 PR c++/80415 - wrong error with default arg and array reference.
4033 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
4035 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
4037 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
4039 * decl.c (name_unnamed_type): Split out of...
4040 (grokdeclarator): ... this.
4041 * decl.h (name_unnamed_type): Declare.
4043 2017-04-12 Richard Biener <rguenther@suse.de>
4044 Bernd Edlinger <bernd.edlinger@hotmail.de>
4047 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
4048 for arrays of character or std::byte type.
4050 2017-04-11 Jason Merrill <jason@redhat.com>
4052 PR c++/80294 - ICE with constexpr and inheritance.
4053 * constexpr.c (reduced_constant_expression_p):
4054 A null constructor element is non-constant.
4055 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
4056 returning an empty base.
4058 2017-04-11 Jakub Jelinek <jakub@redhat.com>
4061 * decl.c (cp_finish_decomp): If processing_template_decl on
4062 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
4063 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
4064 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
4066 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
4067 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
4070 2017-04-11 Jakub Jelinek <jakub@redhat.com>
4073 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
4075 2017-04-10 Jakub Jelinek <jakub@redhat.com>
4078 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
4079 operand, if it is a static member function, recurse on the
4082 2017-04-10 Marek Polacek <polacek@redhat.com>
4085 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
4086 ORIG_TYPE earlier and not only when shortening.
4088 2017-04-07 Jason Merrill <jason@redhat.com>
4090 PR c++/80356 - ICE with reference to function template argument.
4092 * pt.c (convert_nontype_argument_function): Adjust type even with a
4093 value-dependent argument.
4095 PR c++/80267 - ICE with nested capture of reference
4097 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
4099 2017-04-07 Marek Polacek <polacek@redhat.com>
4102 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
4105 * call.c (build_over_call): Don't check cxx_dialect.
4106 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
4107 whether SUB is a CONSTRUCTOR.
4108 * init.c (build_new_1): Don't check cxx_dialect.
4109 * tree.c (replace_placeholders): Add a function comment. Return if
4110 not in C++14, or if the object isn't a (member of a) class.
4111 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
4112 TYPE is CLASS_TYPE_P.
4114 2017-04-05 Jakub Jelinek <jakub@redhat.com>
4117 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
4118 of a loop doing vec_safe_push of NULL. Formatting fixes.
4119 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
4120 to newidx before calling canonical_type_parameter on newtype.
4122 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
4125 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
4126 UNARY_PLUS_EXPR case.
4128 2017-04-03 Jason Merrill <jason@redhat.com>
4130 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
4132 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
4134 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
4135 * decl2.c (one_static_initialization_or_destruction): Likewise.
4136 * name-lookup.c (store_bindings): Likewise.
4137 * parser.c (make_call_declarator): Likewise.
4138 * pt.c (check_explicit_specialization): Likewise.
4140 2017-04-03 Jason Merrill <jason@redhat.com>
4142 PR sanitizer/79993 - ICE with VLA initialization from string
4143 PR c++/69487 - wrong VLA initialization from string
4144 * init.c (finish_length_check): Split out from build_vec_init.
4145 (build_vec_init): Handle STRING_CST.
4146 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
4147 (digest_init_r): Don't give a STRING_CST VLA type.
4149 2017-03-31 Jakub Jelinek <jakub@redhat.com>
4152 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
4153 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
4154 for NOP_EXPR to REFERENCE_TYPE.
4157 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
4158 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
4160 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
4161 Remove extraneous parens.
4162 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
4163 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
4164 (cp_parser_trait_expr): Likewise.
4166 2017-03-27 Jakub Jelinek <jakub@redhat.com>
4169 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
4170 * typeck.c (cxx_mark_addressable): Likewise. Look through
4171 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
4173 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
4175 2017-03-24 Jason Merrill <jason@redhat.com>
4177 PR c++/77339 - ICE with invalid use of alias template.
4178 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
4181 2017-03-24 Marek Polacek <polacek@redhat.com>
4184 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
4185 doesn't have side effects.
4187 2017-03-23 Jason Merrill <jason@redhat.com>
4189 PR c++/80150 - ICE with overloaded variadic deduction.
4190 * pt.c (try_one_overload): Remove asserts.
4192 PR c++/77563 - missing ambiguous conversion error.
4193 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
4195 2017-03-23 Marek Polacek <polacek@redhat.com>
4197 * cp-tree.h: Remove a C_RID_YYCODE reference.
4199 2017-03-22 Jakub Jelinek <jakub@redhat.com>
4202 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
4203 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
4204 processing_template_decl.
4206 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
4209 * name-lookup.c (pushtag_1): Add check for bogus, non template,
4210 std::initializer_list.
4212 2017-03-21 Jakub Jelinek <jakub@redhat.com>
4215 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
4217 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
4220 * init.c (std_placement_new_fn_p): New.
4221 (build_new_1): Call it.
4223 2017-03-20 Jason Merrill <jason@redhat.com>
4225 PR c++/80096 - ICE with C++17 non-type auto.
4226 * pt.c (tsubst): Delay tsubst of type of template non-type
4229 PR c++/79519 - ICE with deleted template friend.
4230 * decl.c (grokdeclarator): Complain about misplaced function
4231 definition using =, as well.
4233 PR c++/79640 - infinite recursion with generic lambda.
4234 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
4235 before substituting its initializer.
4237 2017-03-20 Marek Polacek <polacek@redhat.com>
4238 Paolo Carlini <paolo.carlini@oracle.com>
4240 PR c++/80059 - ICE with noexcept and __transaction_atomic
4241 * except.c (build_must_not_throw_expr): Call
4242 instantiate_non_dependent_expr.
4244 2017-03-19 Jason Merrill <jason@redhat.com>
4246 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
4247 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
4248 reference decomposition.
4250 PR c++/80077 - error with constexpr and -fno-elide-constructors.
4251 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
4252 expanding trivial constructor.
4254 2017-03-17 Jason Merrill <jason@redhat.com>
4256 PR c++/78345 - ICE initializing array from lambda.
4257 * init.c (build_aggr_init): Check array initializer.
4258 (build_vec_init): Check the type of a CONSTRUCTOR.
4260 PR c++/80073 - C++17 ICE with virtual base.
4261 * decl.c (xref_basetypes): Also check for indirect vbases.
4263 2017-03-16 Jason Merrill <jason@redhat.com>
4265 * decl.c (start_enum): std::byte aliases anything.
4268 * constexpr.c (lookup_placeholder): Tweak.
4270 2017-03-15 Jason Merrill <jason@redhat.com>
4272 PR c++/80043 - ICE with -fpermissive
4273 * typeck.c (convert_for_assignment): Handle instantiate_type
4274 not giving an error.
4276 2017-03-14 Nathan Sidwell <nathan@acm.org>
4278 PR c++/79393 DR 1658 workaround
4279 * method.c (synthesized_method_base_walk): Inihibit abstract class
4280 virtual base access check here.
4281 (synthesized_method_walk): Not here.
4283 2017-03-13 Nathan Sidwell <nathan@acm.org>
4285 PR c++/79393 DR 1658 workaround
4286 * method.c (synthesized_method_walk): Check vbases of abstract
4287 classes for dtor walk.
4289 2017-03-10 David Malcolm <dmalcolm@redhat.com>
4291 PR translation/79848
4292 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
4294 2017-03-10 Jason Merrill <jason@redhat.com>
4296 PR c++/79960 - alias templates and partial ordering
4297 * pt.c (comp_template_args): Add partial_order parm.
4298 (template_args_equal): Likewise.
4299 (comp_template_args_porder): New.
4300 (get_partial_spec_bindings): Use it.
4302 2017-03-10 Marek Polacek <polacek@redhat.com>
4305 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
4307 2017-03-10 Jakub Jelinek <jakub@redhat.com>
4310 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
4311 Use XALLOCAVEC macro.
4314 * decl.c (finish_enum_value_list): If value is error_mark_node,
4315 don't copy it and change its type.
4316 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
4317 of CONST_DECL is error_mark_node.
4319 2017-03-09 Marek Polacek <polacek@redhat.com>
4321 PR c++/79900 - ICE in strip_typedefs
4322 * tree.c (strip_typedefs): Skip the attribute handling if T is
4323 a variant type which hasn't been updated yet.
4325 PR c++/79687 - wrong code with pointer-to-member
4326 * init.c (constant_value_1): Break if the variable has a dynamic
4329 2017-03-08 Jason Merrill <jason@redhat.com>
4331 PR c++/79797 - ICE with self-reference in array DMI.
4332 * constexpr.c (lookup_placeholder): Split out...
4333 (cxx_eval_constant_expression): ...from here.
4335 2017-03-07 Jakub Jelinek <jakub@redhat.com>
4338 * parser.c (cp_parser_omp_cancellation_point,
4339 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
4340 cp_parser_omp_target_update): Change "may only be used in compound
4341 statements" diagnostics, such that the same translatable string is
4342 used for all pragmas.
4343 (cp_parser_pragma): Likewise. Use error_at instead of
4344 cp_parser_error for that diagnostics.
4346 2017-03-06 Marek Polacek <polacek@redhat.com>
4348 PR c++/79796 - ICE with NSDMI and this pointer
4349 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
4350 replace_placeholders.
4352 2017-03-06 Jakub Jelinek <jakub@redhat.com>
4355 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
4358 2017-03-06 Jason Merrill <jason@redhat.com>
4360 Revert "Allow deduction guides to look into primary template."
4361 * cp-tree.h, parser.c, pt.c, search.c: Revert.
4363 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
4366 * except.c (build_must_not_throw_expr): Perform the implicit
4367 conversions on the condition.
4369 2017-03-03 Jason Merrill <jason@redhat.com>
4371 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
4374 Core issues 2273 and 2277
4375 * call.c (joust): Adjust using-declaration tiebreaker to handle
4376 the intermediate base case.
4377 * method.c (strip_inheriting_ctors): Just return the argument if
4378 !flag_new_inheriting_ctors.
4380 2017-03-03 Richard Biener <rguenther@suse.de>
4383 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
4385 2017-03-03 Marek Polacek <polacek@redhat.com>
4388 * typeck.c (string_conv_p): In C++11, always call pedwarn with
4391 2017-03-02 Jason Merrill <jason@redhat.com>
4393 Update overload resolution with deduction guides.
4394 * pt.c (do_class_deduction): Always build the copy guide.
4395 (copy_guide_p, template_guide_p): New.
4396 (build_deduction_guide): Remember the original constructor.
4397 * call.c (joust): Prefer the copy guide and non-template guides.
4399 Allow deduction guides to look into primary template.
4400 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
4401 (struct cp_decl_specifier_seq): Add constructor_p.
4402 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
4403 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
4404 Clear deduction_guide_type. Don't handle deduction guide names.
4405 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
4406 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
4407 (cp_parser_member_declaration, cp_parser_cache_defarg)
4408 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
4409 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
4410 (build_deduction_guide): Set deduction_guide_type.
4411 (dependent_scope_p): Check deduction_guide_type.
4412 * search.c (lookup_member): Likewise.
4414 2017-03-02 Jakub Jelinek <jakub@redhat.com>
4417 * init.c (mark_exp_read_r): New function.
4418 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
4419 whole arguments instead of plain mark_exp_read on TREE_LIST values.
4421 2017-03-01 Jason Merrill <jason@redhat.com>
4423 Class template argument deduction in new-expression
4424 * init.c (build_new): Handle deduction from no initializer.
4425 * parser.c (cp_parser_new_expression): Don't require a single
4426 expression for class template deduction.
4427 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
4428 class template placeholder.
4429 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
4430 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
4431 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
4433 2017-03-01 Jakub Jelinek <jakub@redhat.com>
4436 * init.c (emit_mem_initializers): When not constructing vbases of
4437 abstract classes, mark arguments as read for
4438 -Wunused-but-set-parameter.
4440 2017-02-28 Jason Merrill <jason@redhat.com>
4442 Class template argument deduction refinements
4443 * call.c (joust): Move deduction guide tiebreaker down.
4444 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
4445 deduction with no initializer.
4446 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
4447 (do_class_deduction): Use that rather than special case.
4448 (do_auto_deduction): Handle null initializer.
4450 2017-02-28 Jakub Jelinek <jakub@redhat.com>
4452 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
4453 instead of just cond ? "..." : "...".
4454 (grokdeclarator): Likewise.
4455 (build_enumerator): Likewise.
4456 * init.c (build_new_1): Likewise.
4457 * call.c (build_new_method_call_1): Likewise.
4458 * parser.c: Include intl.h.
4459 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
4460 "enter"/"exit" keyword.
4461 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
4464 2017-02-27 Jason Merrill <jason@redhat.com>
4466 PR c++/71568 - SFINAE forming pointer to member function
4467 * init.c (build_offset_ref): Check the return value of
4468 perform_or_defer_access_check.
4470 2017-02-27 Marek Polacek <polacek@redhat.com>
4472 * decl.c (expand_static_init): Add missing } in a comment.
4474 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
4476 * init.c: Include intl.h.
4477 (build_new_1): Move message strings into pedwarn to make them
4478 -Wformat-security friendly. Mark string for translation.
4479 * pt.c (tsubst_copy_and_build): Mark string for translation.
4480 Make the pointer const.
4481 * semantics.c (finish_id_expression): Mark strings for translation.
4483 2017-02-25 Jakub Jelinek <jakub@redhat.com>
4485 * call.c (build_op_delete_call): Make msg1 and msg2 const.
4487 2017-02-24 Jakub Jelinek <jakub@redhat.com>
4490 * call.c (build_over_call): Call check_function_arguments even for
4491 -Wrestrict, adjust check_function_arguments caller.
4492 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
4494 * typeck.c (cp_build_function_call_vec): Adjust
4495 check_function_arguments caller.
4497 2017-02-24 Marek Polacek <polacek@redhat.com>
4499 PR translation/79705
4500 * decl.c (check_redeclaration_exception_specification): Mark a string
4501 for translation. Make the pointer const.
4503 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
4506 * pt.c (register_specialization): Check duplicate_decls return value
4507 for error_mark_node and pass it back.
4509 2017-02-22 Jason Merrill <jason@redhat.com>
4511 PR c++/79679 - missing destructor for argument
4512 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
4515 * pt.c (do_class_deduction): Handle 0 argument case.
4517 2017-02-22 Jakub Jelinek <jakub@redhat.com>
4520 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
4521 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
4522 * constexpr.c (potential_constant_expression_1): Handle
4523 OMP_*, OACC_* and CILK_* trees. Use error_at with
4524 EXPR_LOC_OR_LOC (t, input_location) computed early
4525 instead of error, or error_at with location_of (t).
4527 2017-02-22 Marek Polacek <polacek@redhat.com>
4530 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
4531 if the alignas expression is erroneous.
4532 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
4536 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
4538 2017-02-21 Jason Merrill <jason@redhat.com>
4540 PR c++/50308 - wrong deprecated warning with ADL
4541 PR c++/17729 - duplicate deprecated warning
4542 * semantics.c (finish_id_expression): Only call mark_used on a
4543 function if we aren't building a call.
4545 PR c++/41727 - ICE with partial spec of partial instantiation
4546 * pt.c (process_partial_specialization): For now, don't check more
4547 specialized if there is more than one level of args.
4549 2017-02-21 Marek Polacek <polacek@redhat.com>
4552 * cp-tree.h (maybe_reject_flexarray_init): Declare.
4553 * init.c (maybe_reject_flexarray_init): No longer static.
4554 Add check for current_function_decl.
4555 * parser.c (cp_parser_late_parse_one_default_arg): Reject
4556 a default mem-initializer for a flexible array.
4558 2017-02-21 Jakub Jelinek <jakub@redhat.com>
4559 Paolo Carlini <paolo.carlini@oracle.com>
4562 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
4564 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
4565 decl after the decomposition artificial decl has error_mark_node.
4566 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
4567 instead of just == error_mark_node comparison.
4569 2017-02-21 Jakub Jelinek <jakub@redhat.com>
4572 * decl.c: Include gimplify.h.
4573 (cp_finish_decomp): Make sure there is no sharing of trees
4574 in between DECL_VALUE_EXPR of decomposition decls.
4577 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
4580 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
4581 call cplus_expand_constant on it first.
4583 2017-02-19 Jason Merrill <jason@redhat.com>
4585 PR c++/78139 - destructor needed by new-expression
4586 * call.c (build_special_member_call): Use tf_no_cleanup.
4588 PR c++/78282 - auto template and pack expansion
4589 * pt.c (find_parameter_packs_r): Don't walk into the type of
4590 templates other than template template-parameters.
4592 PR c++/79606 - ICE with this->base_member in NSDMI
4593 * class.c (build_base_path): Check processing_template_decl.
4595 PR c++/79607 - ICE with T{} initializer
4596 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
4598 PR c++/79566 - elaborated-type-specifier in range for
4599 * parser.c (cp_parser_simple_declaration): Fix check for type
4602 PR c++/79400 - confusing suggestion of 'noexcept'
4603 * parser.c (cp_parser_exception_specification_opt): Remove
4604 suggestion for deprecated dynamic exception-specification.
4606 PR c++/79470 - partial ordering with reference parameters
4607 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
4609 PR c++/79500 - ICE with non-template deduction guide
4610 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
4611 DECL_TEMPLATE_RESULT.
4613 PR c++/79580 - ICE with compound literal
4614 * parser.c (cp_parser_class_head): If we're in the middle of an
4615 expression, use ts_within_enclosing_non_class.
4617 PR c++/79503 - inherited ctor taking base class
4618 * call.c (add_function_candidate): Also check that
4619 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
4621 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
4624 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
4627 2017-02-19 Eric Fiselier <eric@efcs.ca>
4628 Jonathan Wakely <jwakely@redhat.com>
4631 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
4632 control warning about literal suffix identifiers without a leading
4635 2017-02-17 Jason Merrill <jason@redhat.com>
4637 PR c++/79508 - lookup error with member template
4638 * parser.c (cp_parser_template_name): Clear
4639 parser->context->object_type if we aren't doing lookup.
4641 PR c++/78690 - ICE with using and global type with same name
4642 * pt.c (type_dependent_object_expression_p): True for
4645 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
4646 * pt.c (convert_template_argument): Just return an auto arg pack.
4647 (tsubst_template_args): Don't tsubst an auto pack type.
4649 PR c++/79556 - C++17 ICE with non-type auto
4650 * pt.c (do_auto_deduction): Don't try to deduce from null type.
4652 PR c++/79533 - C++17 ICE with temporary cast to reference
4653 * call.c (build_over_call): Conversion to a reference prevents copy
4656 2017-02-16 Jakub Jelinek <jakub@redhat.com>
4657 Jason Merrill <jason@redhat.com>
4659 PR c++/79502 - lost nodiscard attribute
4660 * pt.c (apply_late_template_attributes): Do apply non-dependent
4661 attributes to types.
4663 2017-02-16 Jason Merrill <jason@redhat.com>
4665 PR c++/78572 - ICE with self-modifying array initializer
4666 * constexpr.c (cxx_eval_store_expression): The object we're
4667 initializing is outside the constant-expression.
4668 (cxx_eval_call_expression): Set ctx->call.
4670 PR c++/79050 - ICE with undeduced auto and LTO
4671 * decl.c (poplevel): Remove undeduced auto decls.
4673 2017-02-16 Jakub Jelinek <jakub@redhat.com>
4676 * parser.c (cp_parser_omp_target): For -fopenmp-simd
4677 ignore #pragma omp target even when not followed by identifier.
4679 2017-02-15 Jason Merrill <jason@redhat.com>
4680 Jakub Jelinek <jakub@redhat.com>
4682 PR c++/79464 - ICE in IPA with omitted constructor parms
4683 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
4684 (adjust_clone_args): Adjust.
4685 (add_method): Remember omitted parms.
4686 * call.c (add_function_candidate): Likewise.
4687 * mangle.c (write_method_parms): Likewise.
4688 * method.c (ctor_omit_inherited_parms): Return false if there are no
4691 2017-02-15 Martin Sebor <msebor@redhat.com>
4694 * init.c (maybe_reject_flexarray_init): New function.
4695 (perform_member_init): Call it.
4697 2017-02-15 Jakub Jelinek <jakub@redhat.com>
4700 * parser.c (cp_parser_std_attribute): Don't pedwarn about
4701 [[deprecated]] with -std=c++11 and [[fallthrough]] with
4702 -std=c++11 and -std=c++14.
4705 * decl.c (grokdeclarator): For static data members, handle thread_p
4706 only after handling inline.
4708 2017-02-14 Marek Polacek <polacek@redhat.com>
4712 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
4713 clobbering if the postfix expression isn't an EXPR_P.
4715 2017-02-13 Jason Merrill <jason@redhat.com>
4717 PR c++/79461 - ICE with lambda in constexpr constructor
4718 * constexpr.c (build_data_member_initialization): Ignore
4719 initialization of a local variable.
4721 2017-02-13 Jakub Jelinek <jakub@redhat.com>
4723 * init.c (warn_placement_new_too_small): Add missing space in
4725 * parser.c (cp_parser_oacc_declare): Likewise.
4726 * mangle.c (maybe_check_abi_tags): Likewise.
4729 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
4730 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
4731 in the rightmost operand.
4733 2017-02-13 Nathan Sidwell <nathan@acm.org>
4735 PR c++/79296 - ICE mangling localized template instantiation
4736 * decl2.c (determine_visibility): Use template fn context for
4737 local class instantiations.
4739 2017-02-11 Jason Merrill <jason@redhat.com>
4741 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
4742 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
4743 (build_new_1): Use replace_placeholders.
4744 * tree.c (replace_placeholders_t): Also track whether we've seen a
4746 (replace_placeholders, replace_placeholders_r): Adjust.
4747 * cp-tree.h: Adjust.
4749 PR c++/77790 - ICE with auto function in C++11 mode
4750 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
4751 (require_deduced_type): Add complain parm, return bool.
4752 * cp-tree.h: Adjust.
4753 * decl2.c (mark_used): Use require_deduced_type.
4755 2017-02-10 Jason Merrill <jason@redhat.com>
4757 PR c++/78908 - template ops and bitfields
4758 * tree.c (build_min_non_dep): Use unlowered_expr_type.
4760 PR c++/78897 - constexpr union
4761 * constexpr.c (cxx_eval_store_expression): A store to a union member
4762 erases a previous store to another member.
4764 PR c++/71285 - member of fold-expression
4765 * semantics.c (finish_unary_fold_expr)
4766 (finish_binary_fold_expr): Use null type for fold-expressions.
4768 PR c++/79401 - protected inherited constructor
4769 * call.c (enforce_access): For inheriting constructor, find a base
4770 binfo in the path we already have.
4772 2017-02-10 Marek Polacek <polacek@redhat.com>
4775 * pt.c (type_dependent_expression_p): Check if the expression type
4779 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
4780 if warnings shouldn't be given.
4782 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
4785 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
4786 an error_mark_node as type.
4788 2017-02-09 Jakub Jelinek <jakub@redhat.com>
4789 Jason Merrill <jason@redhat.com>
4792 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
4793 from pattern to type.
4795 2017-02-09 Jason Merrill <jason@redhat.com>
4797 PR c++/79316 - default argument in deduction guide
4798 PR c++/79350 - explicit deduction guide
4799 * parser.c (cp_parser_constructor_declarator_p)
4800 (cp_parser_direct_declarator): Parse deduction guides more like
4802 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
4803 * tree.c (special_function_p): Return it.
4804 * decl.c (check_special_function_return_type): Handle it.
4805 (grokdeclarator, grokfndecl): Adjust.
4806 (cp_finish_decl): Pass flags to do_auto_deduction.
4807 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
4808 * pt.c (dguide_name_p): Take a const_tree.
4809 (do_class_deduction): Handle explicit.
4810 (do_auto_deduction): Pass flags through.
4811 (build_deduction_guide): Copy explicit flag.
4813 2017-02-09 Jakub Jelinek <jakub@redhat.com>
4816 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
4817 non-pragma_compound context here.
4818 (cp_parser_omp_target): Likewise.
4819 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
4820 parsing for ordered and target omp pragmas in non-pragma_stmt
4821 non-pragma_compound contexts.
4824 * parser.c (cp_parser_oacc_declare): Formatting fix.
4825 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
4826 automatic variables.
4828 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
4829 Chung-Lin Tang <cltang@codesourcery.com>
4831 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
4832 parsing. Parse constant expression. Remove semantic checking.
4833 (cp_parser_omp_clause_collapse): Disallow tile.
4834 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
4835 error about missing for after already emitting one. Use more
4836 conventional for idiom for unbounded loop.
4837 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
4838 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
4839 (finish_omp_for): Deal with tile clause.
4841 2017-02-07 Nathan Sidwell <nathan@acm.org>
4843 * method.c (synthesized_method_base_walk): New. Broken out of ...
4844 (synthesized_method_walk): ... here. Call it. Cleanup
4847 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
4850 * typeck2.c (process_init_constructor_union): Consider only
4851 FIELD_DECLs when looking for an NSDMI.
4853 2017-02-06 Jason Merrill <jason@redhat.com>
4855 PR c++/71193 - incomplete types in templates
4856 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
4857 handle incomplete type by pedwarning and then treating as dependent.
4859 2017-02-06 Jakub Jelinek <jakub@redhat.com>
4862 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
4863 (potential_constant_expression_1): Likewise.
4866 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
4867 allow one fewer than expected arguments if flag_permissive.
4870 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
4871 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
4872 with error_mark_node type.
4874 2017-02-03 Jason Merrill <jason@redhat.com>
4876 PR c++/78689 - ICE on constructor with label
4877 * optimize.c (maybe_clone_body): Replace omitted parameters with
4879 * class.c (build_clone): Fix logic for omitting inherited parms.
4881 PR c++/12245 - excessive memory use
4882 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
4883 back in. Don't cache constants.
4884 (maybe_constant_init): Don't cache constants.
4886 PR c++/79294 - ICE with invalid template argument
4887 * pt.c (convert_nontype_argument_function): Check value-dependence.
4888 (convert_nontype_argument): Don't check it here for function ptrs.
4890 2017-02-02 Richard Biener <rguenther@suse.de>
4893 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
4894 it lazily on the first changed element only and copy it
4895 fully upfront, only storing changed elements.
4897 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
4900 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
4903 2017-01-31 Jakub Jelinek <jakub@redhat.com>
4906 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
4909 2017-01-31 David Malcolm <dmalcolm@redhat.com>
4912 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
4913 any namespace aliases.
4915 2017-01-31 Nathan Sidwell <nathan@acm.org>
4918 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
4922 * pt.c: (instantiate_decl): Push to top level when current
4923 function scope doesn't match. Only push lmabda scope stack when
4926 * cp-tree.h (instantiate_decl): Make defer_ok bool.
4927 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
4928 (instantiate_decl): Simplify and reorder state saving and restoration.
4931 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
4932 * semantics.c (finish_member_declaration): Assert class is being
4935 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
4937 Introduce C++ support in libcc1.
4938 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
4939 (ansi_opname): Rename to...
4940 (cp_operator_id): ... this. Adjust all callers.
4941 (ansi_assopname): Rename to...
4942 (cp_assignment_operator_id): ... this. Adjust all callers.
4943 (cp_literal_operator_id): Declare.
4944 (set_global_friend): Declare.
4945 (is_global_friend): Declare.
4946 (enum cp_oracle_request): New type.
4947 (cp_binding_oracle_function): New type.
4948 (cp_binding_oracle): Declare.
4949 (cp_finish_injected_record_type): Declare.
4950 * friend.c (global_friend): New var.
4951 (set_global_friend): New fn.
4952 (is_global_friend): New fn.
4953 (is_friend): Call is_global_friend.
4954 * name-lookup.c (cp_binding_oracle): New var.
4955 (query_oracle): New fn.
4956 (qualified_lookup_using_namespace): Call query_oracle.
4957 (lookup_name_real_1): Likewise.
4958 * parser.c (cp_literal_operator_id): Drop static.
4959 * search.c (friend_accessible_p): Call is_global_friend.
4960 * semantics.c (is_this_parameter): Accept a variable if the
4961 binding oracle is enabled.
4963 2017-01-27 Jason Merrill <jason@redhat.com>
4965 PR c++/78771 - ICE with inherited constructor.
4966 * call.c (build_over_call): Call deduce_inheriting_ctor here.
4967 * pt.c (tsubst_decl): Not here.
4968 * class.c (add_method): Or here.
4969 * method.c (deduce_inheriting_ctor): Handle clones.
4970 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
4972 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
4975 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
4977 * cp/cp-tree.h: Declare it.
4978 * cp/semantics.c (finish_id_expression): Resolve names within a default
4979 capturing generic lambda defined within a template prior to
4980 instantiation to allow for captures to be added to the closure type.
4982 2017-01-26 Jakub Jelinek <jakub@redhat.com>
4985 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
4986 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
4987 * parser.c (cp_parser_builtin_offsetof): Pass result of
4988 build_static_cast of null_pointer_node to finish_offsetof.
4989 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
4990 it for -Winvalid-offsetof pedwarn instead of trying to guess
4991 original offsetof type from EXPR. Save OBJECT_PTR as a new
4992 second operand to OFFSETOF_EXPR.
4993 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
4994 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
4997 2017-01-26 Jason Merrill <jason@redhat.com>
4999 * name-lookup.c (parse_using_directive): Deprecate strong using.
5001 PR c++/79176 - lambda ICE with -flto -Os
5002 * decl2.c (vague_linkage_p): Handle decloned 'tors.
5003 * tree.c (decl_linkage): Likewise.
5005 2017-01-25 Martin Sebor <msebor@redhat.com>
5007 * decl.c (grokdeclarator): Fix a typo in a comment.
5009 2017-01-25 Jakub Jelinek <jakub@redhat.com>
5012 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
5016 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
5017 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
5019 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
5022 * decl.c (cxx_init_decl_processing): Pass main_input_filename
5023 to build_translation_unit_decl.
5025 2017-01-24 Jakub Jelinek <jakub@redhat.com>
5028 * cp-gimplify.c (cp_genericize_r): Add result of
5029 convert_from_reference on invisiref parm to p_set.
5031 2017-01-24 Nathan Sidwell <nathan@acm.org>
5033 PR c++/78469 - defaulted ctor and inaccessible dtor
5034 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
5035 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
5036 * tree.c (build_target_expr): Check tf_no_cleanup.
5038 PR c++/79118 - anon-members and constexpr
5039 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
5040 ctor decl. Recursively check anonymous members.
5041 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
5043 (explain_invalid_constexpr_fn): Likewise.
5045 2017-01-23 Nathan Sidwell <nathan@acm.org>
5047 PR c++/71710 - template using directive of field
5048 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
5051 PR c++/71406 - ICE with scope-ref'd template id exprs
5053 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
5054 before breaking up TEMPLATE_ID_EXPR.
5056 2017-01-20 Nathan Sidwell <nathan@acm.org>
5058 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
5059 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
5061 2017-01-20 David Malcolm <dmalcolm@redhat.com>
5065 * cp-tree.h (suggest_alternatives_for): Add bool param.
5066 (suggest_alternative_in_explicit_scope): New decl.
5067 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
5068 that isn't the global one, call new function
5069 suggest_alternative_in_explicit_scope, only calling
5070 suggest_alternatives_for if it fails, and disabling near match
5071 searches fort that case. When SCOPE is the global namespace,
5072 pass true for new param to suggest_alternatives_for to allow for
5074 * lex.c (unqualified_name_lookup_error): Pass true for new param
5075 to suggest_alternatives_for.
5076 * name-lookup.c (consider_binding_level): Add forward decl.
5077 (suggest_alternatives_for): Add "suggest_misspellings" param,
5078 using it to conditionalize the fuzzy name-lookup code.
5079 (suggest_alternative_in_explicit_scope): New function.
5080 * parser.c (cp_parser_primary_expression): When calling
5081 finish_id_expression, pass location of id_expression rather
5082 than that of id_expr_token.
5083 (cp_parser_id_expression): Convert local "unqualified_id" from
5084 tree to cp_expr to avoid implicitly dropping location information.
5086 2017-01-20 Marek Polacek <polacek@redhat.com>
5089 * call.c (build_conditional_expr_1): Warn about duplicated branches.
5090 * semantics.c (finish_expr_stmt): Build statement using the proper
5093 2017-01-19 Jason Merrill <jason@redhat.com>
5095 US 20 - forwarding references and class template argument deduction
5096 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
5097 * pt.c (push_template_decl_real): Set it.
5098 (maybe_adjust_types_for_deduction): Check it.
5099 (rewrite_template_parm): Copy it.
5101 US 19 - deduction guides and constructors
5102 * call.c (joust): Prefer deduction guides to constructors.
5103 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
5104 (deduction_guide_p): Check DECL_P.
5106 * decl.c (check_initializer): Always use build_aggr_init for array
5109 PR c++/79130 - decomposition and direct-initialization
5110 * init.c (build_aggr_init): Communicate direct-initialization to
5112 (build_vec_init): Check for array copy sooner.
5113 * parser.c (cp_parser_decomposition_declaration): Remove call to
5114 build_x_compound_expr_from_list.
5116 2017-01-18 Jason Merrill <jason@redhat.com>
5118 PR c++/68666 - member variable template-id
5119 * typeck.c (finish_class_member_access_expr): Handle variable
5121 * pt.c (lookup_and_finish_template_variable): No longer static.
5122 * cp-tree.h: Declare it.
5124 2017-01-18 Nathan Sidwell <nathan@acm.org>
5127 * call.c (build_over_call): When checking ellipsis conversions for
5128 an inherited ctor, make sure there is at least one conversion.
5130 2017-01-18 Jason Merrill <jason@redhat.com>
5132 PR c++/78894 - ICE with class deduction and default arg
5133 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
5135 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5138 * mangle.c (write_discriminator): Reorganize abi warning check.
5140 2017-01-18 Nathan Sidwell <nathan@acm.org>
5142 * cp-tree.h: Clarify exception spec node comment.
5143 * except.c (nothrow_spec_p): Simplify by checking node-equality.
5146 * mangle.c (write_exception_spec): Check nothrow explicitly.
5147 (write_encoding): Don't increment processing_template_decl around
5150 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5153 * mangle.c (write_template_args): Add "on" for operator names.
5155 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5158 * mangle.c (write_discriminator): Handle discriminator >= 10.
5160 2017-01-17 Nathan Sidwell <nathan@acm.org>
5163 * cp-tree.h (maybe_generic_this_capture): Declare.
5164 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
5165 (maybe_resolve_dummy): ... here. Call it.
5166 (maybe_generic_this_capture): New.
5167 * parser.c (cp_parser_postfix_expression): Speculatively capture
5168 this in generic lambda in unresolved member function call.
5169 * pt.c (tsubst_copy_and_build): Force hard error from failed
5170 member function lookup in generic lambda.
5172 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
5175 * cp-array-notation.c (expand_array_notation_exprs): Handle
5178 2017-01-11 Jason Merrill <jason@redhat.com>
5180 PR c++/78337 - ICE on invalid with generic lambda
5181 * semantics.c (process_outer_var_ref): Check if containing_function
5182 is null. Move inform call under complain test.
5184 2017-01-11 Nathan Sidwell <nathan@acm.org>
5187 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
5190 2017-01-11 Nathan Sidwell <nathan@acm.org>
5192 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
5194 2017-01-11 Jakub Jelinek <jakub@redhat.com>
5197 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
5198 assertion. Formatting fix.
5201 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
5204 2017-01-10 David Malcolm <dmalcolm@redhat.com>
5207 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
5208 a missing semicolon if we have a valid insertion location for
5211 2017-01-10 Jason Merrill <jason@redhat.com>
5213 FI 20, decomposition declaration with parenthesized initializer.
5214 * parser.c (cp_parser_decomposition_declaration): Use
5215 cp_parser_initializer.
5217 2017-01-09 Jason Merrill <jason@redhat.com>
5219 Implement P0195R2, C++17 variadic using.
5220 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
5221 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
5222 * error.c (dump_decl): Likewise.
5224 2017-01-09 Jakub Jelinek <jakub@redhat.com>
5226 PR translation/79019
5227 PR translation/79020
5228 * semantics.c (finish_omp_clauses): Add missing whitespace to
5229 translatable strings.
5230 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
5232 2017-01-07 Jason Merrill <jason@redhat.com>
5234 PR c++/78948 - instantiation from discarded statement
5235 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
5236 * cp-tree.h (in_discarded_stmt): Declare it.
5237 (struct saved_scope): Add discarded_stmt bitfield.
5238 (in_discarded_stmt): New macro.
5239 * decl2.c (mark_used): Check it.
5240 * parser.c (cp_parser_selection_statement): Adjust.
5241 (cp_parser_jump_statement): Adjust.
5243 2017-01-05 Jakub Jelinek <jakub@redhat.com>
5246 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
5247 REFERENCE_REF_P, set tt to its operand.
5250 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
5251 unions even for C++11 and later.
5253 2017-01-05 Nathan Sidwell <nathan@acm.org>
5256 * pt.c (convert_nontype_argument): Don't try and see if integral
5257 or enum expressions are constants prematurely.
5259 2017-01-04 Marek Polacek <polacek@redhat.com>
5262 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
5263 a zero character literal.
5265 2017-01-04 Jakub Jelinek <jakub@redhat.com>
5268 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
5272 * parser.c (cp_parser_simple_declaration): Only complain about
5273 inconsistent auto deduction if auto_result doesn't use auto.
5275 * parser.c (cp_parser_simple_declaration): Diagnose function
5276 declaration among more than one init-declarators with auto
5280 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
5281 assertion, as lexer->buffer may be NULL.
5283 2017-01-04 Marek Polacek <polacek@redhat.com>
5287 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
5289 2017-01-04 Nathan Sidwell <nathan@acm.org>
5292 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
5293 (lambda_capture_field_type): Update prototype.
5294 * lambda.c (lambda_capture_field_type): Add is_reference parm.
5295 Add referenceness here.
5296 (add_capture): Adjust lambda_capture_field_type call, refactor
5298 * pt.c (tsubst): Adjust lambda_capture_field_type call.
5300 2017-01-01 Jakub Jelinek <jakub@redhat.com>
5302 Update copyright years.
5304 Copyright (C) 2017 Free Software Foundation, Inc.
5306 Copying and distribution of this file, with or without modification,
5307 are permitted in any medium without royalty provided the copyright
5308 notice and this notice are preserved.