1 2017-11-22 Marek Polacek <polacek@redhat.com>
6 * class.c (layout_class_type): Set DECL_PADDING_P on padding.
7 * decl.c (cxx_init_decl_processing): Set TRANSLATION_UNIT_WARN_EMPTY_P.
8 (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.
10 2017-11-21 Martin Liska <mliska@suse.cz>
12 * class.c (finalize_literal_type_property): Add quotes for
14 (explain_non_literal_class): Likewise.
15 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
16 (is_valid_constexpr_fn): Likewise.
17 (check_constexpr_ctor_body): Likewise.
18 (register_constexpr_fundef): Likewise.
19 (explain_invalid_constexpr_fn): Likewise.
20 (cxx_eval_builtin_function_call): Likewise.
21 (cxx_eval_call_expression): Likewise.
22 (cxx_eval_loop_expr): Likewise.
23 (potential_constant_expression_1): Likewise.
24 * decl.c (check_previous_goto_1): Likewise.
25 (check_goto): Likewise.
26 (grokfndecl): Likewise.
27 (grokdeclarator): Likewise.
28 * error.c (maybe_print_constexpr_context): Likewise.
29 * method.c (process_subob_fn): Likewise.
30 (defaulted_late_check): Likewise.
31 * parser.c (cp_parser_compound_statement): Likewise.
33 2017-11-21 Marc Glisse <marc.glisse@inria.fr>
35 * constexpr.c (cxx_eval_constant_expression,
36 potential_constant_expression_1): Handle POINTER_DIFF_EXPR.
37 * cp-gimplify.c (cp_fold): Likewise.
38 * error.c (dump_expr): Likewise.
39 * typeck.c (pointer_diff): Use POINTER_DIFF_EXPR.
41 2017-11-21 Jakub Jelinek <jakub@redhat.com>
43 P0428R2 - familiar template syntax for generic lambdas
44 * parser.c (cp_parser_lambda_declarator_opt): Don't pedwarn
45 for cxx2a and above, reword pedwarn for C++14/C++17.
47 2017-11-20 David Malcolm <dmalcolm@redhat.com>
50 * name-lookup.c: Include "c-family/known-headers.h"
51 (lookup_name_fuzzy): Call get_cp_stdlib_header_for_name and
52 potentially return a new suggest_missing_header hint.
54 2017-11-20 David Malcolm <dmalcolm@redhat.com>
57 * name-lookup.c (class macro_use_before_def): New class.
58 (lookup_name_fuzzy): Detect macro that were used before being
59 defined, and report them as such.
61 2017-11-20 Jason Merrill <jason@redhat.com>
63 * decl2.c (constrain_class_visibility): Don't warn about artificial
66 2017-11-20 Jakub Jelinek <jakub@redhat.com>
68 P0329R4: Designated Initialization
69 * parser.c (cp_parser_initializer_clause): List in comment grammar
70 designated-initializer-list.
71 (cp_parser_initializer_list): Allow .identifier = without pedwarn for
72 C++2A, parse .identifier { ... }. Improve location_t argument to
73 pedwarn. Add pedwarn for [cst] = designators. Diagnose ... in
74 designated initializer list. Diagnose mixing designated and
75 non-designated initializer clauses for C++2A. Diagnose duplicated
76 identifiers in designators.
77 * name-lookup.h (search_anon_aggr): New declaration.
78 * name-lookup.c (fields_linear_search): Use search_anon_aggr.
79 (search_anon_aggr): New function.
80 * typeck2.c (process_init_constructor_record): Allow designator
81 to skip over some non-static data members. Handle anonymous
82 aggregates. Add diagnostics for designator order not matching
83 member declaration order.
85 2017-11-20 David Malcolm <dmalcolm@redhat.com>
87 * name-lookup.c: Define INCLUDE_UNIQUE_PTR before including system.h.
88 Include "c-family/name-hint.h"
89 (suggest_alternatives_for): Convert "fuzzy_name" from const char *
90 to name_hint, and rename to "hint". Pass location to
92 (lookup_name_fuzzy): Convert return type from const char *
93 to name_hint. Add location_t param.
94 * parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
95 Include "c-family/name-hint.h"
96 (cp_parser_diagnose_invalid_type_name): Convert
97 "suggestion" from const char * to name_hint, and rename to "hint".
98 Pass location to lookup_name_fuzzy.
100 2017-11-20 Nathan Sidwell <nathan@acm.org>
104 * call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited
106 * cp-gimplify.c (cp_genericize_r): Restore THUNK dereference
107 inhibibition check removed in previous c++/78495 change.
109 2017-11-20 Jakub Jelinek <jakub@redhat.com>
112 * constexpr.c (cxx_eval_vector_conditional_expression): New function.
113 (cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
114 of cxx_eval_conditional_expression.
116 2017-11-19 Jakub Jelinek <jakub@redhat.com>
120 * cp-gimplify.c (c_fully_fold): Add LVAL argument, call
121 cp_fold_maybe_rvalue instead of cp_fold_rvalue and pass it !LVAL.
123 2017-11-16 Jason Merrill <jason@redhat.com>
125 PR c++/79092 - non-type args of different types are different
126 * tree.c (cp_tree_equal): Check the type of constants.
127 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Handle UNIFY_ALLOW_INTEGER
128 when comparing to previously deduced argument.
129 (maybe_convert_nontype_argument): New.
130 (convert_nontype_argument): Call it.
131 (tsubst_copy_and_build): Handle partial instantiation of
133 (unify): Ignore type when deducing from array bound.
134 (dependent_type_p_r): Handle DEFERRED_NOEXCEPT.
135 (value_dependent_expression_p): Any type-dependent expression is
136 value-dependent. Handle IMPLICIT_CONV_EXPR.
137 * cp-tree.h (IMPLICIT_CONV_EXPR_NONTYPE_ARG): New.
138 * mangle.c (write_template_arg): Strip IMPLICIT_CONV_EXPR.
140 2017-11-16 Nathan Sidwell <nathan@acm.org>
144 * cp-objcp-common.h (LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME):
146 * cp-tree.h (overwrite_mangling): Declare.
147 * decl2.c (struct mangled_decl_hash): Entries are deletable.
148 (overwrite_mangling): New.
151 * decl.c (xref_tag_1): Push lambda into current scope.
152 * name-lookup.c (do_pushtag): Don't deal with ts_lambda here.
154 2017-11-15 Nathan Sidwell <nathan@acm.org>
157 * lambda.c (lambda_capture_field_type): Function references are
158 always catured by reference.
160 2017-11-15 Martin Liska <mliska@suse.cz>
162 * decl.c (begin_destructor_body): Use cp_build_fold_indirect_ref
163 instead of cp_build_indirect_ref.
165 2017-11-15 Martin Liska <mliska@suse.cz>
167 * decl.c (begin_destructor_body): In case of VPTR sanitization
168 (with disabled recovery), zero vptr in order to catch virtual calls
169 after lifetime of an object.
171 2017-11-14 Jason Merrill <jason@redhat.com>
173 Use GTY((cache)) on some hash tables.
174 * decl.c (decomp_type_table): Use tree_cache_map.
175 * init.c (nsdmi_inst): Likewise.
176 * pt.c (defarg_ints): Likewise.
177 * cp-objcp-common.c (cp_get_debug_type): Likewise.
179 2017-11-13 Jason Merrill <jason@redhat.com>
181 Capture adjustments for P0588R1.
182 * semantics.c (process_outer_var_ref): Capture variables when
183 they are named; complain about non-capture uses when odr-used.
184 * expr.c (mark_use): Rvalue use looks through capture proxy.
185 * constexpr.c (potential_constant_expression_1): Improve error about
186 use of captured variable.
187 * lambda.c (need_generic_capture, dependent_capture_r)
188 (do_dependent_capture, processing_nonlambda_template): Remove.
189 * call.c (build_this): Remove uses of the above.
190 * decl.c (cp_finish_decl): Likewise.
191 * semantics.c (maybe_cleanup_point_expr)
192 (maybe_cleanup_point_expr_void, finish_goto_stmt)
193 (maybe_convert_cond): Likewise.
194 * typeck.c (check_return_expr): Likewise.
197 * typeck.c (cp_build_fold_indirect_ref): New.
198 (cp_build_indirect_ref_1): Split out from cp_build_indirect_ref.
199 Add 'fold' parameter.
200 * cp-tree.h: Declare cp_build_fold_indirect_ref.
201 * call.c, class.c, cp-ubsan.c, decl.c, except.c, init.c, lambda.c,
202 parser.c, rtti.c, tree.c, typeck.c, typeck2.c: Use it.
203 * parser.c (do_range_for_auto_deduction): Use RO_UNARY_STAR.
204 (cp_convert_range_for): Likewise.
205 * typeck2.c (build_x_arrow): Use RO_ARROW.
207 * cp-ubsan.c (cp_ubsan_check_member_access_r): Fix handling of
208 INDIRECT_REF of ADDR_EXPR.
210 PR c++/82360 - ICE with static_cast in template.
211 * call.c (perform_direct_initialization_if_possible): Check
212 processing_template_decl.
213 * typeck.c (build_static_cast_1): Likewise.
215 2017-11-13 Ville Voutilainen <ville.voutilainen@gmail.com>
217 Remove the null check from placement new in all modes
218 * init.c (build_new_1): Don't do a null check for
219 a namespace-scope non-replaceable placement new
220 in any mode unless -fcheck-new is provided.
222 2017-11-07 Boris Kolpackov <boris@codesynthesis.com>
224 * Make-lang.in (CP_PLUGIN_HEADERS): Add operators.def since included
227 2017-11-07 Jakub Jelinek <jakub@redhat.com>
230 * cp-gimplify.c (cxx_omp_clause_apply_fn): For methods pass i - 1 to
231 convert_default_arg instead of i.
233 2017-11-06 Jason Merrill <jason@redhat.com>
235 P0704R1 - fixing const-qualified pointers to members
236 * typeck2.c (build_m_component_ref): Also accept in lower stds with
239 2017-11-06 Paolo Carlini <paolo.carlini@oracle.com>
242 * decl2.c (finish_static_data_member_decl): If there's an initializer,
243 complete the type and re-apply the quals.
245 2017-11-06 Martin Liska <mliska@suse.cz>
248 * constexpr.c (cxx_eval_builtin_function_call): Handle
249 __builtin_unreachable call.
250 (get_function_named_in_call): Declare function earlier.
251 (constexpr_fn_retval): Skip __builtin_unreachable.
252 * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Rename to
254 (cp_maybe_instrument_return): ... this.
255 (cp_genericize): Call the function unconditionally.
257 2017-11-03 Nathan Sidwell <nathan@acm.org>
260 * decl.c (grokdeclarator): Protect MAYBE_CLASS things from paren
263 2017-11-02 Paolo Carlini <paolo.carlini@oracle.com>
266 * pt.c (make_pack_expansion): Add tsubst_flags_t parameter.
267 (expand_integer_pack, convert_template_argument, coerce_template_parms,
268 gen_elem_of_pack_expansion_instantiation, tsubst_pack_expansion,
269 unify): Adjust calls.
270 * tree.c (cp_build_qualified_type_real): Likewise.
271 * cp-tree.h (make_pack_expansion): Adjust declaration.
273 2017-11-02 Nathan Sidwell <nathan@acm.org>
275 * cp-tree.h (IDENTIFIER_NEWDEL_OP_P): Restore, adjust.
276 (IDENTIFIER_NEW_OP_P): New.
277 * decl.c (grokdeclarator): Restore IDENTIFIER_NEWDEL_OP_P use.
278 * pt.c (push_template_decl_real): Likewise.
279 * typeck.c (check_return_expr): Use IDENTIFIER_NEW_OP_P.
282 * decl.c (grokdeclarator): Don't warn when parens protect a return
283 type from a qualified name.
285 2017-11-01 Nathan Sidwell <nathan@acm.org>
287 * cp-tree.h (enum cp_identifier_kind): Delete cik_newdel_op.
288 Renumber and reserve udlit value.
289 (IDENTIFIER_NEWDEL_OP_P): Delete.
290 (IDENTIFIER_OVL_OP_P): New.
291 (IDENTIFIER_ASSIGN_OP_P): Adjust.
292 (IDENTIFIER_CONV_OP_P): Adjust.
293 (IDENTIFIER_OVL_OP_INFO): Adjust.
294 (IDENTIFIER_OVL_OP_FLAGS): New.
295 * decl.c (grokdeclarator): Use IDENTIFIER_OVL_OP_FLAGS.
296 * lex.c (get_identifier_kind_name): Adjust.
297 (init_operators): Don't special case new/delete ops.
298 * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_P.
299 * pt.c (push_template_decl_real): Use IDENTIFIER_OVL_OP_FLAGS.
300 * typeck.c (check_return_expr): Likewise.
302 * cp-tree.h (assign_op_identifier, call_op_identifier): Use
304 (struct lang_decl_fn): Use compressed operator code.
305 (DECL_OVERLOADED_OPERATOR_CODE): Replace with ...
306 (DECL_OVERLOADED_OPERATOR_CODE_RAW): ... this.
307 (DECL_OVERLOADED_OPERATOR_CODE_IS): Use it.
308 * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE_RAW.
309 (build_library_fn): Likewise.
310 (grok_op_properties): Likewise.
311 * mangle.c (write_unqualified_name): Likewise.
312 * method.c (implicitly_declare_fn): Likewise.
313 * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_IS.
315 * cp-tree.h (IDENTIFIER_CP_INDEX): Define.
316 (enum ovl_op_flags): Add OVL_OP_FLAG_AMBIARY.
317 (enum ovl_op_code): New.
318 (struct ovl_op_info): Add ovl_op_code field.
319 (ovl_op_info): Size by OVL_OP_MAX.
320 (ovl_op_mapping, ovl_op_alternate): Declare.
321 (OVL_OP_INFO): Adjust for mapping array.
322 (IDENTIFIER_OVL_OP_INFO): New.
323 * decl.c (ambi_op_p, unary_op_p): Delete.
324 (grok_op_properties): Use IDENTIFIER_OVL_OP_INFO and
326 * lex.c (ovl_op_info): Adjust and static initialize.
327 (ovl_op_mappings, ovl_op_alternate): Define.
328 (init_operators): Iterate over ovl_op_info array and init mappings
330 * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_INFO.
331 * operators.def (DEF_OPERATOR): Remove KIND parm.
332 (DEF_SIMPLE_OPERATOR): Delete.
333 (OPERATOR_TRANSITION): Expand if defined.
335 2017-10-31 David Malcolm <dmalcolm@redhat.com>
337 * pt.c (listify): Use %< and %> for description of #include.
339 2017-10-31 David Malcolm <dmalcolm@redhat.com>
341 * class.c (explain_non_literal_class): Use UNKNOWN_LOCATION rather
343 * name-lookup.c (suggest_alternatives_for): Update for renaming of
345 (maybe_suggest_missing_header): Likewise.
346 (suggest_alternative_in_explicit_scope): Likewise.
347 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise for
348 renaming of error_at_rich_loc.
349 (cp_parser_string_literal): Likewise.
350 (cp_parser_nested_name_specifier_opt): Likewise.
351 (cp_parser_cast_expression): Likewise for renaming of
353 (cp_parser_decl_specifier_seq): Likewise for renaming of
354 error_at_rich_loc and warning_at_rich_loc.
355 (cp_parser_elaborated_type_specifier): Likewise for renaming of
357 (cp_parser_cv_qualifier_seq_opt): Likewise for renaming of
359 (cp_parser_virt_specifier_seq_opt): Likewise.
360 (cp_parser_class_specifier_1): Likewise.
361 (cp_parser_class_head): Likewise.
362 (cp_parser_member_declaration): Likewise for renaming of
363 pedwarn_at_rich_loc, warning_at_rich_loc, and error_at_rich_loc.
364 (cp_parser_enclosed_template_argument_list): Likewise for renaming
365 of error_at_rich_loc.
366 (set_and_check_decl_spec_loc): Likewise.
367 * pt.c (listify): Likewise.
368 * rtti.c (typeid_ok_p): Likewise.
369 * semantics.c (process_outer_var_ref): Use UNKNOWN_LOCATION rather
371 * typeck.c (access_failure_info::maybe_suggest_accessor): Update
372 for renaming of inform_at_rich_loc.
373 (finish_class_member_access_expr): Likewise for renaming of
376 2017-10-31 Nathan Sidwell <nathan@acm.org>
378 * cp-tree.h (struct operator_name_info_t): Rename to ...
379 (struct ovl_op_info_t): ... here. Add tree_code field.
380 (operator_name_info, assignment_operator_name_info): Delete.
381 (ovl_op_info): Declare.
382 (OVL_OP_INFO): Adjust.
383 * decl.c (grok_op_properties): Use ovl_op_flags.
384 * lex.c (operator_name_info, assignment_operator_name_info):
386 (ovl_op_info): Define.
387 (set_operator_ident): Adjust.
388 (init_operators): Set tree_code.
389 * mangle.c (write_unqualified_id): Adjust operator array scan.
391 * lex.c (init_operators): Allow NULL operator name. Don't add
393 * operators.def: Use NULL for mangling only operators. Move to
394 after regular operators but move assignment operators last.
396 * cp-tree.h (enum ovl_op_flags): New.
397 (struct operator_name_info_t): Rename arity to flags.
398 * lex.c (set_operator_ident): New.
399 (init_operators): Use it. Adjust for flags.
400 * mangle.c (write_unqualified_id): Adjust for flags.
401 * operators.def: Replace arity with flags.
403 * cp-tree.h (ovl_op_identifier): New.
404 (assign_op_identifier, call_op_identifier): Adjust.
405 (cp_operator_id, cp_assignment_operator_ide): Delete.
406 (SET_OVERLOADED_OPERATOR_CODE): Delete.
408 * call.c (op_error): Use OVL_OP_INFO.
409 (build_conditional_expr_1): Use ovl_op_identifier.
410 (build_new_op_1): Use OVL_OP_INFO & ovl_op_identifier.
411 (build_op_delete_call): Likewise.
412 * class.c (type_requires_array_cookie): Use ovl_op_identifier.
413 * decl.c (duplicate_decls): Directly copy operator code.
414 (builtin_function_1): Do not set operator code.
415 (build_library_fn): Directly set operator code.
416 (push_cp_library_fn): Use ovl_op_identifier.
417 (grok_op_properties): Directly set operator code.
418 * decl2.c (maybe_warn_sized_delete): Use ovl_op_identifier.
419 * error.c (dump_expr): Use OVL_OP_INFO.
420 (op_to_string): Add assop arg. Use OVL_OP_INFO.
421 (assop_to_string): Delete.
422 (args_to_string): Adjust.
423 * init.c (build_new_1): Use ovl_op_identifier.
424 * mangle.c (write_unqualified_name): Use OVL_OP_INFO.
425 (write_expression): Likewise.
426 * method.c (synthesized_method_walk): Use ovl_op_identifier.
427 (implicitly_declare_fn): Use assign_op_identifier. Directly set
429 * name-lookup.c (get_class_binding): Use assign_op_identifier.
430 * parser.c (cp_parser_operator): Use ovl_op_identifier.
431 (cp_parser_omp_clause_reduction): Likewise.
432 * semantics.c (omp_reduction_id): Likewise.
433 * typeck.c (cxx_sizeof_or_alignof_type): Use OVL_OP_INFO.
435 * cp-tree.h (assign_op_identifier, call_op_identifier): Define.
436 (LAMBDA_FUNCTION_P): Use DECL_OVERLOADED_OPERATOR_IS.
437 (DECL_OVERLOADED_OPERATOR_P): Just retuurn true/false.
438 (DECL_OVERLOADED_OPERATOR_CODE, DECL_OVERLOADED_OPERATOR_IS): Define.
439 * call.c (add_function_candidate): Use
440 DECL_OVERLOADED_OPERATOR_IS.
441 (build_op_call_1): Use call_op_identifier &
442 DECL_OVERLOADED_OPERATOR_IS.
443 (build_over_call): Likewise.
444 (has_trivial_copy_assign_p): Use assign_op_identifier.
445 (build_special_member_call): Likewise.
446 * class.c (dfs_declare_virt_assop_and_dtor): Likewise.
447 (vbase_has_user_provided_move_assign,
448 classtype_has_move_assign_or_move_ctor_p): Likewise.
449 * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE.
450 (grok_special_member_properties): Use assign_op_identifier.
451 (start_preparsed_function): Use DECL_OVERLOADED_OPERATOR_IS.
452 * decl2.c (mark_used): Use DECL_CONV_FN_P.
453 * dump.c (dump_access): Delete prototype.
455 (cp_dump_tree): Don't call it.
456 * lambda.c (lambda_function): Use call_op_identifier.
457 (maybe_add_lambda_conv_op): Not an overloaded operator. Remove
459 * mangle.c (write_unqualified_name): Use DECL_OVERLOADED_OPERTOR_CODE.
460 * method.c (do_build_copy_assign): Use assign_op_identifier.
461 (synthesize_method): Use DECL_OVERLOADED_OPERATOR_IS.
462 (get_copy_assign): Use assign_op_identifier.
463 (synthesized_method_walk): Likewise.
464 (defaultable_fn_check): Use DECL_OVERLOADED_OPERATOR_IS.
465 * parser.c (cp_parser_lambda_declarator_opt): Use
467 * semanitics.c (classtype_has_nothrow_assign_or_copy_p): Use
468 assign_op_identifier.
469 * tree.c (special_function_p): Use DECL_OVERLOADED_OPERATOR_IS.
470 * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_CODE.
471 (check_return_expr): Use assign_op_identifier.
473 2017-10-30 Paolo Carlini <paolo.carlini@oracle.com>
476 * pt.c (tsubst_copy_and_build, [INDIRECT_REF]): For a REFERENCE_REF_P,
477 unconditionally call convert_from_reference.
479 2017-10-30 Nathan Sidwell <nathan@acm.org>
481 * call.c (build_op_call_1): Test for FUNCTION_DECL in same manner
482 as a few lines earlier.
483 * cp-tree.h (PACK_EXPANSION_PATTERN): Fix white space.
484 * decl.c (grokfndecl): Fix indentation.
485 (compute_array_index_type): Use processing_template_decl_sentinel.
486 (grok_op_properties): Move warnings to end. Reorder other checks
487 to group similar entities. Tweak diagnostics.
488 * lex.c (unqualified_name_lookup_error): No need to check name is
489 not ERROR_MARK operator.
490 * parser.c (cp_parser_operator): Select operator code before
492 * typeck.c (check_return_expr): Fix indentation and line wrapping.
494 2017-10-27 Paolo Carlini <paolo.carlini@oracle.com>
496 * pt.c (invalid_nontype_parm_type_p): Return a bool instead of an int.
498 2017-10-26 Nathan Sidwell <nathan@acm.org>
500 * decl.c (sort_labels): Restore function.
501 (pop_labels): Sort labels
502 (identify_goto): Add translation markup.
504 2017-10-25 Nathan Sidwell <nathan@acm.org>
506 Kill IDENTIFIER_LABEL_VALUE.
507 * cp-tree.h (lang_identifier): Delete label_value slot.
508 (IDENTIFIER_LABEL_VALUE, SET_IDENTIFIER_LABEL_VALUE): Delete.
509 (struct named_label_hasher): Rename to ...
510 (struct named_label_hash): ... here. Reimplement.
511 (struct language_function): Adjust x_named_labels.
512 * name-lookup.h (struct cp_label_binding): Delete.
513 (struct cp_binding_level): Delete shadowed_labels slot.
514 * decl.c (struct named_label_entry): Add name and outer slots.
515 (pop_label): Rename to ...
516 (check_label_used): ... here. Don't pop.
517 (note_label, sort_labels): Delete.
518 (pop_labels, pop_local_label): Reimplement.
519 (poplevel): Pop local labels as any other decl. Remove
520 shadowed_labels handling.
521 (named_label_hash::hash, named_label_hash::equal): New.
522 (make_label_decl): Absorb into ...
523 (lookup_label_1): ... here. Add making_local_p arg, reimplement.
524 (lookup_label, declare_local_label): Adjust.
525 (check_goto, define_label): Adjust.
526 * lex.c (make_conv_op_name): Don't clear IDENTIFIER_LABEL_VALUE.
527 * ptree.c (cxx_print_identifier): Don't print identifier binding.
529 * decl.c (identifier_goto): Reduce duplication.
530 (check_previous_goto_1): Likewise.
531 (check_goto): Move var decls to initialization.
532 (check_omp_return, define_label_1, define_label): Likewise.
534 2017-10-25 Jakub Jelinek <jakub@redhat.com>
537 * decl.c (duplicate_decls): Copy "omp declare simd" attributes from
538 newdecl to corresponding __builtin_ if any.
540 2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
543 * decl.c (duplicate_decls): Warn for built-in functions declared as
544 non-function, use OPT_Wbuiltin_declaration_mismatch.
546 * decl.c (duplicate_decls): Avoid redundant '+' in warning_at.
548 2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
551 * pt.c (value_dependent_expression_p, [TRAIT_EXPR]): Handle
552 a TREE_LIST as TRAIT_EXPR_TYPE2.
554 2017-10-24 Mukesh Kapoor <mukesh.kapoor@oracle.com>
555 Paolo Carlini <paolo.carlini@oracle.com>
558 * cvt.c (type_promotes_to): Implement C++17, 7.6/4, about unscoped
559 enumeration type whose underlying type is fixed.
561 2017-10-23 Paolo Carlini <paolo.carlini@oracle.com>
564 * semantics.c (finish_compound_literal): Check do_auto_deduction
565 return value for error_mark_node.
567 2017-10-23 Jason Merrill <jason@redhat.com>
569 PR c++/77369 - wrong noexcept handling in C++14 and below
570 * tree.c (strip_typedefs): Canonicalize TYPE_RAISES_EXCEPTIONS.
572 2017-10-20 Nathan Sidwell <nathan@acm.org>
574 * class.c (layout_class_type): Cleanup as-base creation, determine
576 (finish_struct_1): ... not here.
578 2017-10-19 Jakub Jelinek <jakub@redhat.com>
581 * typeck.c (check_return_expr): Don't call
582 maybe_warn_about_returning_address_of_local in templates.
584 2017-10-17 Nathan Sidwell <nathan@acm.org>
587 * call.c (build_over_call): Don't pass tf_no_cleanup to nested
591 * cp-objcp-common.c (cp_tree_size): Reformat. Adjust returns size
594 2017-10-13 Jason Merrill <jason@redhat.com>
596 PR c++/82357 - bit-field in template
597 * tree.c (cp_stabilize_reference): Just return a NON_DEPENDENT_EXPR.
599 2017-10-13 David Malcolm <dmalcolm@redhat.com>
601 * cp-tree.h (maybe_show_extern_c_location): New decl.
602 * decl.c (grokfndecl): When complaining about literal operators
603 with C linkage, issue a note giving the location of the
605 * parser.c (cp_parser_new): Initialize new field
606 "innermost_linkage_specification_location".
607 (cp_parser_linkage_specification): Store the location
608 of the linkage specification within the cp_parser.
609 (cp_parser_explicit_specialization): When complaining about
610 template specializations with C linkage, issue a note giving the
611 location of the extern "C".
612 (cp_parser_explicit_template_declaration): Likewise for templates.
613 (maybe_show_extern_c_location): New function.
614 * parser.h (struct cp_parser): New field
615 "innermost_linkage_specification_location".
617 2017-10-12 Nathan Sidwell <nathan@acm.org>
619 * cp-tree.h (cp_expr): Add const operator * and operator->
621 (cp_tree_node_structure_enum): Delete TS_CP_BINDING,
622 TS_CP_WRAPPER, LAST_TS_CP_ENUM.
624 2017-10-12 David Malcolm <dmalcolm@redhat.com>
626 * parser.c (get_required_cpp_ttype): New function.
627 (cp_parser_error_1): Call it, using the result to call
628 maybe_suggest_missing_token_insertion.
630 2017-10-12 David Malcolm <dmalcolm@redhat.com>
632 * parser.c (get_matching_symbol): Move to before...
633 (cp_parser_error): Split out into...
634 (cp_parser_error_1): ...this new function, merging in content
636 (cp_parser_required_error): ...here. Eliminate partial duplicate
637 of body of cp_parser_error in favor of a call to the new
638 cp_parser_error_1 helper function.
640 2017-10-11 Nathan Sidwell <nathan@acm.org>
642 * decl2.c (struct mangled_decl_hash): Use DECL_ASSEMBLER_NAME_RAW.
643 (record_mangling): Likewise.
645 2017-10-10 Nathan Sidwell <nathan@acm.org>
647 * name-lookup.c (extern_c_fns): Rename to ...
648 (extern_c_decls): ... here.
649 (check_extern_c_conflict, extern_c_linkage_bindings): Update.
650 (do_pushdecl): Check extern-c fns and vars.
652 * cp-tree.h (default_hash_traits <lang_identifier *>): Delete
655 * decl2.c (struct mangled_decl_hash): New hash traits.
656 (mangled_decls): Make hash_table<mangled_decl_hash>.
657 (generate_mangling_alias, record_mangling): Adjust.
659 2017-10-10 Jason Merrill <jason@redhat.com>
661 More delayed lambda capture fixes.
662 * call.c (add_function_candidate): Use build_address.
663 (build_op_call_1): Call mark_lvalue_use early.
664 (build_over_call): Handle error from build_this.
665 * constexpr.c (cxx_bind_parameters_in_call): Use build_address.
666 (cxx_eval_increment_expression): Don't use rvalue().
667 * cvt.c (convert_to_void): Use mark_discarded_use.
668 * expr.c (mark_use): Handle PARM_DECL, NON_DEPENDENT_EXPR. Fix
669 reference handling. Don't copy the expression.
670 (mark_discarded_use): New.
671 * lambda.c (insert_capture_proxy): Add some sanity checking.
672 (maybe_add_lambda_conv_op): Set cp_unevaluated_operand.
673 * pt.c (register_local_specialization): Add sanity check.
674 * semantics.c (process_outer_var_ref): Fix check for existing proxy.
675 * typeck.c (cp_build_addr_expr_1): Handle error from
677 (cp_build_modify_expr): Call mark_lvalue_use_nonread, handle error
680 Handle generic lambda capture in dependent expressions.
681 * lambda.c (need_generic_capture, dependent_capture_r)
682 (do_dependent_capture): New.
683 * pt.c (processing_nonlambda_template): Use need_generic_capture.
684 * semantics.c (maybe_cleanup_point_expr)
685 (maybe_cleanup_point_expr_void, finish_goto_stmt)
686 (maybe_convert_cond): Call do_dependent_capture.
687 * typeck.c (build_static_cast): Remove dependent capture handling.
689 * typeck.c (condition_conversion): Assert !processing_template_decl.
690 * semantics.c (finish_omp_clauses): Don't
691 fold_build_cleanup_point_expr if processing_template_decl.
692 (outer_var_p): A temporary can't be from an outer scope.
693 * pt.c (type_dependent_expression_p): Fix dependency checking of
694 functions without DECL_TEMPLATE_INFO.
695 (instantiate_decl): Use lss_copy.
696 * constexpr.c (is_valid_constexpr_fn): Fix lambdas before C++17.
698 * typeck.c (check_return_expr): Check non-dependent conversion in
700 * constraint.cc (check_function_concept): Don't complain about an
701 empty concept if seen_error.
703 2017-10-10 Richard Sandiford <richard.sandiford@linaro.org>
705 * cvt.c (ignore_overflows): Use wi::to_wide when
706 operating on trees as wide_ints.
707 * decl.c (check_array_designated_initializer): Likewise.
708 * mangle.c (write_integer_cst): Likewise.
709 * semantics.c (cp_finish_omp_clause_depend_sink): Likewise.
711 2017-10-10 Nathan Sidwell <nathan@acm.org>
713 * name-lookup.c (set_global_binding): Don't deal with STAT_HACK.
715 2017-10-06 Paolo Carlini <paolo.carlini@oracle.com>
718 * decl.c (finish_function): Take a bool intead of an int; adjust.
719 * cp-tree.h (finish_function): Adjust declaration.
720 * decl2.c (generate_tls_wrapper, finish_objects,
721 finish_static_storage_duration_function): Adjust calls.
722 * lambda.c (maybe_add_lambda_conv_op, finish_lambda_function):
724 * method.c (synthesize_method): Likewise.
725 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
726 * pt.c (instantiate_decl): Likewise.
727 * parser.c (cp_parser_function_definition_after_declarator,
728 cp_parser_late_parsing_for_member, cp_parser_omp_declare_reduction):
730 (cp_parser_ctor_initializer_opt,
731 cp_parser_ctor_initializer_opt_and_function_body,
732 cp_parser_function_try_block,
733 cp_parser_function_definition_after_declarator,
734 cp_parser_function_transaction): Return void; adjust declarations.
736 2017-10-06 Nathan Sidwell <nathan@acm.org>
739 * name-lookup.c (check_local_shadow): Don't try and convert
742 2017-10-06 Jakub Jelinek <jakub@redhat.com>
745 * decl.c (reshape_init): Suppress warn_useless_cast for direct enum
747 * typeck.c (convert_for_assignment): Likewise.
749 P0704R1 - fixing const-qualified pointers to members
750 * typeck2.c (build_m_component_ref): For -std=c++2a allow
751 pointer to const & qualified method on rvalue.
753 2017-10-06 Nathan Sidwell <nathan@acm.org>
755 Use hash_table for extern "C" names
756 * name-lookup.c (extern_c_fns): Use hash_table.
757 (check_extern_c_conflict): Adjust.
758 (c_linkage_bindings): Adjust.
760 Use hash_table for namespace bindings
761 * cp-tree.h (struct named_decl_hash): New.
762 (lang_decl_ns): Change type of bindings field.
763 * lex.c (maybe_add_lang_decl_raw): Adjust.
764 * name-lookup.c (find_namespace_slot): Adjust.
765 (do_pushdecl): Push NULL-named namespace.
766 (do_push_nested_namespace): Adjust.
767 (push_namespace): Push anonymous namespace as NULL name.
769 2017-10-05 Jason Merrill <jason@redhat.com>
771 Pass variadic class objects exactly like named by-value args.
772 * call.c (convert_arg_to_ellipsis): Use the result of force_rvalue.
774 2017-10-05 Nathan Sidwell <nathan@acm.org>
776 Warn on MVP declarations
777 * cp-tree.h (struct cp_declarator): Add parenthesized field.
778 * decl.c (grokdeclarator): Warn about unnecessary parens.
779 * parser.c (make_declarator): Init parenthesized field.
780 (cp_parser_direct_declarator): Set parenthesized field.
782 Kill IDENTIFIER_GLOBAL_VALUE, SET_IDENTIFIER_GLOBAL_VALUE
783 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
784 SET_IDENTIFIER_GLOBAL_VALUE): Delete.
785 * name-lookup.h (set_global_binding): Remove NAME parm.
786 (get_global_binding): New inline fn.
787 * name-lookup.c (set_global_binding): Remove NAME parm. Adjust.
788 (identifier_global_value): Move to ...
789 * cp-objcp-common.c (identifier_global_value): ... here.
790 * class.c (build_ctor_vtbl_group, build_vtbl_initializer): Adjust.
791 * decl.c (record_builtin_type, expand_static_init,
792 grokdeclarator): Adjust.
793 * decl2.c (get_guard, get_local_tls_init_fn, get_tls_init_fn,
794 get_tls_wrapper_fn, maybe_warn_sized_delete): Adjust.
795 * except.c (declare_library_fn, build_throw): Adjust.
796 * init.c (throw_bad_array_length): Adjust.
797 * rtti.c (throw_bad_cast, throw_bad_typeid, get_tinfo_decl): Adjust.
799 * decl2.c (record_mangling): Fix spello and formatting from
802 2017-10-04 Nathan Sidwell <nathan@acm.org>
804 Give builtin types the correct name.
805 * name-lookup.c (set_global_binding): Assert name is DECL_NAME.
806 * decl.c (record_builtin_type): Reimplement, use new TYPE_DECL for
809 2017-10-04 Paolo Carlini <paolo.carlini@oracle.com>
810 Andrew Pinski <apinski@cavium.com>
813 * parser.c (cp_parser_lambda_body): Set parser->in_function_body.
815 2017-10-04 Nathan Sidwell <nathan@acm.org>
817 Move mangling aliases out of global namespace.
818 * cp-tree.h (record_mangling): New.
819 (maybe_remove_implicit_alias): Delete.
820 * decl2.c (mangled_decls): New hash map.
821 (generate_mangling_alias): Reimplement using mangled_decls.
822 (record_mangling): New.
823 * mangle.c (decl_implicit_alias_p,
824 maybe_remove_implicit_alias): Delete.
825 (mangle_decl): Use record_mangling.
826 * name-lookup.c (supplement_binding_1): Remove
827 maybe_remove_implicit_alias check.
829 2017-10-04 Jakub Jelinek <jakub@redhat.com>
832 * error.c (dump_function_decl): If show_return, call dump_type_suffix
833 on the same return type dump_type_prefix has been called on.
835 2017-10-04 Jason Merrill <jason@redhat.com>
837 PR c++/81525 - broken handling of auto in generic lambda.
838 * pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.
840 2017-10-04 Nathan Sidwell <nathan@acm.org>
842 * call.c (convert_arg_to_ellipsis): Correct comment about passing
845 2017-10-02 Richard Sandiford <richard.sandiford@linaro.org>
847 * constexpr.c (cxx_eval_store_expression): Use wi::to_widest
848 when comparing the array bounds with an ARRAY_REF index.
850 2017-09-30 Paolo Carlini <paolo.carlini@oracle.com>
853 * method.c (defaulted_late_check): Early return if the defaulted
854 declaration does not match the expected signature.
856 2017-09-29 Jakub Jelinek <jakub@redhat.com>
858 P0683R1 - default member initializers for bit-fields
859 * cp-tree.h (grokbitfield): Add INIT parameter.
860 * parser.c (cp_parser_constant_expression): Add STRICT_P argument,
861 if true, parse a conditional-expression rather than
862 assignment-expression.
863 (cp_parser_member_declaration): For C++11 and later pass true
864 as STRICT_P to cp_parser_constant_expression. Parse C++2A bitfield
865 NSDMIs. Adjust grokbitfield caller. Handle DECL_INITIAL also for
867 (cp_parser_objc_class_ivars): Adjust grokbitfield caller.
868 * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs.
869 (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs.
870 * decl2.c (grokbitfield): Add INIT parameter, pass it to
872 * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not
875 * class.c (check_bitfield_decl): Retrieve and clear width from
876 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
877 (check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than
879 (remove_zero_width_bit_fields): Adjust comment.
880 * decl2.c (grokbitfield): Stash width into
881 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
882 * pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr
883 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width.
885 * parser.c (cp_parser_member_declaration): Parse attributes before
886 colon of a bitfield in addition to after colon.
888 * Make-lang.in (check-c++-all): Test also c++2a.
890 2017-09-28 Jason Merrill <jason@redhat.com>
892 PR c++/56973, DR 696 - capture constant variables only as needed.
893 * expr.c (mark_use): Split out from mark_rvalue_use and
894 mark_lvalue_use. Handle lambda capture of constant variables.
895 (mark_lvalue_use_nonread): New.
896 * semantics.c (process_outer_var_ref): Don't capture a constant
897 variable until forced.
898 * pt.c (processing_nonlambda_template): New.
899 * call.c (build_this): Check it.
900 * decl2.c (grok_array_decl): Call mark_rvalue_use and
901 mark_lvalue_use_nonread.
902 * init.c (constant_value_1): Don't call mark_rvalue_use.
903 * typeck.c (build_static_cast): Handle lambda capture.
905 Use local_specializations to find capture proxies.
906 * cp-tree.h (DECL_CAPTURED_VARIABLE): New.
907 * lambda.c (build_capture_proxy): Set it.
908 (add_capture): Pass initializer to build_capture_proxy.
909 (start_lambda_function): Likewise.
910 (insert_capture_proxy): Use register_local_specialization.
911 (is_lambda_ignored_entity): Always ignore proxies.
912 * name-lookup.c (qualify_lookup): Don't check
913 is_lambda_ignored_entity if LOOKUP_HIDDEN is set.
914 * semantics.c (process_outer_var_ref): Use
915 retrieve_local_specialization.
916 * parser.c (cp_parser_lambda_body): Push local_specializations.
917 * pt.c (tsubst_expr): Pass LOOKUP_HIDDEN when looking for a proxy.
918 (tsubst_lambda_expr): Push local_specializations sooner.
919 (tsubst_copy_and_build): Don't register_local_specialization.
921 * call.c (build_special_member_call): Use the return value of
923 * decl.c (compute_array_index_type): Likewise.
924 * parser.c (cp_parser_oacc_wait_list): Likewise.
925 * lambda.c (is_normal_capture_proxy): Handle *this capture.
926 (add_capture): Clarify internal_error message.
928 2017-09-22 Eric Botcazou <ebotcazou@adacore.com>
931 * cp-objcp-common.c (cp_get_debug_type): Do only one lookup.
933 2017-09-22 Jakub Jelinek <jakub@redhat.com>
936 * tree.c (struct replace_placeholders_t): Add pset field.
937 (replace_placeholders_r): Call cp_walk_tree with d->pset as
938 last argument instead of NULL. Formatting fix.
939 (replace_placeholders): Add pset variable, add its address
940 into data. Pass &pset instead of NULL to cp_walk_tree.
942 2017-09-22 David Malcolm <dmalcolm@redhat.com>
944 * call.c (get_fndecl_argument_location): New function.
945 (convert_like_real): Use it when complaining about argument type
947 * cp-tree.h (struct cp_parameter_declarator): Add "loc" field.
948 * parser.c (make_parameter_declarator): Add "loc" param and use
949 it to initialize the new field.
950 (cp_parser_translation_unit): Add UNKNOWN_LOCATION for "loc" of
951 the "no_parameters" parameter.
952 (cp_parser_parameter_declaration_list): Set the location of the
953 result of grokdeclarator to be the parameter's loc, assuming no
955 (cp_parser_parameter_declaration): Generate a location for the
956 parameter and pass to make_parameter_declarator.
958 2017-09-20 Nathan Sidwell <nathan@acm.org>
960 * name-lookup.c (member_name_cmp): Use DECL_UID for final
963 2017-09-20 Jakub Jelinek <jakub@redhat.com>
965 P0409R2 - allow lambda capture [=, this]
966 * parser.c (cp_parser_lambda_introducer): For cxx2a don't pedwarn on
969 2017-09-18 Jason Merrill <jason@redhat.com>
971 PR c++/82069 - ICE with lambda in template
972 * semantics.c (process_outer_var_ref): Check uses_template_parms
973 instead of any_dependent_template_arguments_p.
975 2017-09-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
976 Paolo Carlini <paolo.carlini@oracle.com>
979 * decl2.c (finish_anon_union): Complain about "anonymous union with
980 no members" with a pedwarn.
982 2017-09-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
984 * typeck.c (build_reinterpret_cast_1,
985 build_const_cast_1): Implement -Wcast-align=strict.
987 2017-09-15 Jakub Jelinek <jakub@redhat.com>
989 * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
990 adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
991 to C++17 or -std=gnu++17 or -std=c++17. Adjust comments.
992 (cxx_init_decl_processing, next_initializable_field,
993 is_direct_enum_init, check_initializer, cp_finish_decl,
994 mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
995 finish_function): Likewise.
996 * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
997 * pt.c (mark_template_parm, convert_nontype_argument,
998 instantiate_class_template_1, type_unification_real, unify,
999 get_partial_spec_bindings, dependent_type_p_r): Likewise.
1000 * typeck.c (cp_build_unary_op): Likewise.
1001 * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
1002 * call.c (build_user_type_conversion_1, build_over_call,
1003 build_special_member_call): Likewise.
1004 * lambda.c (begin_lambda_type): Likewise.
1005 * typeck2.c (process_init_constructor_record): Likewise.
1006 * class.c (build_base_field, finalize_literal_type_property,
1007 explain_non_literal_class): Likewise.
1008 * parser.c (cp_parser_diagnose_invalid_type_name,
1009 cp_parser_primary_expression, cp_parser_lambda_introducer,
1010 cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
1011 cp_convert_range_for, cp_parser_perform_range_for_lookup,
1012 cp_parser_decomposition_declaration, cp_parser_linkage_specification,
1013 cp_parser_static_assert, cp_parser_simple_type_specifier,
1014 cp_parser_namespace_definition, cp_parser_using_declaration,
1015 cp_parser_init_declarator, cp_parser_type_parameter_key,
1016 cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
1017 cp_parser_constructor_declarator_p): Likewise.
1018 * mangle.c (struct globals): Rename need_cxx1z_warning to
1020 (write_exception_spec, start_mangling, mangle_decl): Likewise.
1021 * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
1023 (check-c++17): New goal. Use 17 instead of 1z.
1024 (check-c++-all): Use 17 instead of 1z.
1026 2017-09-14 Jakub Jelinek <jakub@redhat.com>
1029 * cp-gimplify.c (omp_var_to_track): Look through references.
1030 (omp_cxx_notice_variable): Likewise.
1032 2017-09-13 Nathan Sidwell <nathan@acm.org>
1034 Conv-op identifers not in identifier hash table
1035 * lex.c (conv_type_hasher): Make member fns inline.
1036 (make_conv_op_name): Directly clone conv_op_identifier.
1038 Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
1039 * cp-tree.h (struct lang_type): Rename methods to members.
1040 (CLASSTYPE_METHOD_VEC): Rename to ...
1041 (CLASSTYPE_MEMBER_VEC): ... this.
1042 * name-lookup.h (get_method_slot): Rename to ...
1043 (get_member_slot): ... this.
1044 (resort_type_method_vec): Rename to ...
1045 (resort_type_member_vec): ... this.
1046 * class.c (add_method, warn_hidden): Adjust.
1047 * search.c (dfs_locate_field_accessor_pre): Adjust.
1048 * name-lookup.c (method_vec_binary_search): Rename to ...
1049 (member_vec_binary_search): ... this and adjust.
1050 (method_vec_linear_search): Rename to ...
1051 (member_vec_linear_search): ... this and adjust.
1052 (fields_linear_search, get_class_binding_direct): Adjust.
1053 (get_method_slot): Rename to ...
1054 (get_member_slot): ... this and adjust.
1055 (method_name_slot): Rename to ...
1056 (member_name_slot): ... this and adjust.
1057 (resort_type_method_vec): Rename to ...
1058 (resort_type_member_vec): ... this and adjust.
1059 (method_vec_append_class_fields): Rename to ...
1060 (member_vec_append_class_fields): ... this and adjust.
1061 (method_vec_append_enum_values): Rename to ...
1062 (member_vec_append_enum_values): ... this and adjust.
1063 (method_vec_dedup): Rename to ...
1064 (member_vec_dedup): ... this and adjust.
1065 (set_class_bindings, insert_late_enum_def_bindings): Adjust.
1067 2017-09-12 Paolo Carlini <paolo.carlini@oracle.com>
1070 * decl.c (start_decl): Early return error_mark_node if duplicate_decls
1071 returns it; avoid misleading error message.
1073 2017-09-12 Nathan Sidwell <nathan@acm.org>
1075 Kill CLASSTYPE_SORTED_FIELDS.
1076 * cp-tree.h (struct lang_type): Lose sorted_fields member.
1077 (CLASSTYPE_SORTED_FIELDS): Delete.
1078 * name-lookup.h (set_class_bindings): Add EXTRA arg.
1079 * name-lookup.c (fields_linear_search): New, broken out of ...
1080 (lookup_field_1): ... here. Delete remainder of function.
1081 (get_class_binding_direct): Reimplement without sorted_fields.
1082 (get_class_binding): Rename TYPE arg to KLASS, for consistency.
1083 (get_method_slot): Call set_class_binding when creating method_vec
1085 (method_name_cmp): Order identically named slots.
1086 (sorted_fields_type_new): Delete.
1087 (field_vc_append_class_fields): Rename to ...
1088 (method_vec_append_class_fields): ... here. Adjust.
1089 (field_vec_append_enum_values): Renme to ...
1090 (method_vec_append_enum_values): ... here. Adjust.
1091 (method_vec_dedup): New.
1092 (set_class_bindings): Reimplement.
1093 (insert_late_enum_def_bindings): Reimplement.
1095 * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
1097 (restort_data): Move later.
1098 (method_name_cmp, resort_method_name_cmp): Simplify.
1099 (resort_type_method_vec): Reformat.
1101 2017-09-09 Jason Merrill <jason@redhat.com>
1103 * constexpr.c (reduced_constant_expression_p): If
1104 CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
1106 2017-09-09 Eric Botcazou <ebotcazou@adacore.com>
1109 * cp-objcp-common.c (struct debug_type_hasher): New class.
1110 (debug_type_hash): New variable.
1111 (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
1113 2017-09-08 Jason Merrill <jason@redhat.com>
1115 PR c++/70029 - ICE with ref-qualifier and -flto
1116 * tree.c (cxx_copy_lang_qualifiers): New.
1117 * cp-tree.h: Declare it.
1118 * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
1120 2017-09-06 Jason Merrill <jason@redhat.com>
1122 PR c++/82053 - ICE with default argument in lambda in template
1123 * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
1125 (retrieve_specialization): Use lambda_fn_in_template_p.
1126 * cp-tree.h: Declare it.
1128 PR c++/82070 - error with nested lambda capture
1129 * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
1130 register_local_specialization.
1132 2017-09-06 Nathan Sidwell <nathan@acm.org>
1134 * name-lookup.h (lookup_field_1): Delete.
1135 (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
1136 * name-lookup.c (lookup_field_1): make static
1137 (method_vec_binary_search, method_vec_linear_search): New. Broken
1139 (get_class_binding_direct): ... here. Add TYPE_OR_FNS argument.
1140 Do complete search of this level.
1141 (get_class_binding): Adjust.
1142 * decl.c (reshape_init_class): Call get_class_binding.
1143 * search.c (lookup_field_r): Move field searching into
1144 get_class_binding_direct.
1146 * class.c (warn_hidden): Don't barf on non-functions.
1147 * decl2.c (check_classfn): Likewise. Check template match earlier.
1149 * name-lookup.c (count_fields): Rename to ...
1150 (count_class_fields): ... here. Take a class, don't count
1152 (add_fields_to_record_type): Rename to ...
1153 (field_vec_append_class_fields): ... here. Take a class, don't
1154 add NULL-named fields.
1155 (add_enum_fields_to_record_type): Rename to ...
1156 (field_vec_append_enum_values): ... here.
1157 (set_class_bindings): Adjust, assert we added expected number.
1158 (insert_late_enum_def_bindings): Reimplement. Create vector if
1159 there are now sufficient entries.
1161 * name-lookup.h (lookup_fnfields_slot_nolazy,
1162 lookup_fnfields_slot): Rename to ...
1163 (get_class_binding_direct, get_class_binding): ... here.
1164 * name-lookup.c (lookup_fnfields_slot_nolazy,
1165 lookup_fnfields_slot): Rename to ...
1166 (get_class_binding_direct, get_class_binding): ... here.
1167 * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
1168 * call.c (build_user_type_conversion_1): Adjust.
1169 (has_trivial_copy_assign_p): Adjust.
1170 (has_trivial_copy_p): Adjust.
1171 * class.c (get_basefndecls) Adjust.
1172 (vbase_has_user_provided_move_assign) Adjust.
1173 (classtype_has_move_assign_or_move_ctor_p): Adjust.
1174 (type_build_ctor_call, type_build_dtor_call): Adjust.
1175 * decl.c (register_dtor_fn): Adjust.
1176 * decl2.c (check_classfn): Adjust.
1177 * pt.c (retrieve_specialization): Adjust.
1178 (check_explicit_specialization): Adjust.
1179 (do_class_deduction): Adjust.
1180 * search.c (lookup_field_r): Adjust.
1181 (look_for_overrides_here, lookup_conversions_r): Adjust.
1182 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
1183 * tree.c (type_has_nontrivial_copy_init): Adjust.
1184 * method.c (lazily_declare_fn): Adjust comment.
1186 2017-09-05 Nathan Sidwell <nathan@acm.org>
1188 * name-lookup.c (do_class_using_decl): Elide read-once temps.
1189 Move declarations to initializations.
1191 * class.c (add_method): Move slot search and insertion to ...
1192 * name-lookup.c (get_method_slot): ... this new function.
1193 (lookup_fnfields_slot_nolazy): Cope with NULL slot.
1194 * name-lookup.h (get_method_slot): Declare.
1195 * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
1197 (grok_special_member_properties): Set
1198 TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
1199 Improve TYPE_HAS_CONSTEXPR_CTOR setting.
1201 * cp-tree.h (lang_decl_base): Rename template_conv_p to
1203 (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
1204 (DECL_CONV_FN_TYPE): FN must be conv op.
1205 (DECL_TEMPLATE_CONV_FN_P): Delete.
1206 (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
1207 * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
1210 * class.c (unreverse_member_declarations): Remove extraneous if.
1211 * pt.c (push_template_decl_real): Use string concatenation, not
1212 \<newline>. Add %<..%>.
1214 2017-09-05 Paolo Carlini <paolo.carlini@oracle.com>
1217 * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
1218 * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
1219 creating cdtor_label.
1220 * constexpr.c (returns): Add the case of a constructor/destructor
1221 returning via a LABEL_DECL_CDTOR label.
1222 (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
1224 2017-09-01 Nathan Sidwell <nathan@acm.org>
1226 * cp-tree.h (resort_type_method_vec): Move declaration to ...
1227 * name-lookup.h (resort_type_method_vec): ... here.
1228 (set_class_bindings): Lose 2nd arg.
1229 * class.c (finish_struct_1, finish_struct): Adjust
1230 set_class_bindings call. Don't call finish_struct_methods.
1231 (resort_data, method_name_cmp, resort_method_name_cmp,
1232 resort_type_method_vec, finish_struct_methods): Move to ...
1233 * name-lookup.c (resort_data, method_name_cmp,
1234 resort_method_name_cmp, resort_type_method_vec): ... here.
1235 (set_class_bindings): Lose fields arg. Swallow finish_struct_methods.
1237 * class.c (finish_struct): Call set_class_bindings for the
1240 * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
1241 Don't call maybe_warn_about_overly_private_class here.
1242 (warn_hidden): Cleanup declarations and comments.
1243 (type_has_user_provided_constructor): No need to check
1244 CLASSTYPE_METHOD_VEC.
1245 (type_has_user_provided_or_explicit_constructor): Likewise.
1246 (classtype_has_move_assign_or_move_ctor_p): Likewise.
1247 (check_bases_and_members): Don't call finish_struct_methods here.
1248 (finish_struct_1): Call finish_struct_methods and
1249 set_class_bindings immediately after layout. Clear DECL_IN_AGGR_P
1251 (finish_struct): For templates process USING_DECLS and clear
1252 DECL_IN_AGGR_P before calling finish_struct_methods. Call
1253 maybe_warn_about_overly_private_class here.
1255 Revert 2017-08-28 Nathan Sidwell <nathan@acm.org>
1256 Restore sorted_fields vector.
1257 * cp-tree.h (lang_type): Restore sorted_fields vector.
1258 (CLASSTYPE_SORTED_FIELDS): Restore.
1259 (CLASSTYPE_BINDINGS): Delete.
1260 * name-lookup.c (lookup_field_1): Restore binary search.
1261 (sorted_fields_type_new, count_fields,
1262 add_fields_to_record_type, add_enum_fields_to_record_type): Restore
1263 (set_class_bindings): Revert.
1264 (insert_late_enum_def_binding): Restore field_vec insertion.
1266 2017-09-01 Jakub Jelinek <jakub@redhat.com>
1269 * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
1271 2017-09-01 Marek Polacek <polacek@redhat.com>
1274 * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
1276 2017-08-30 Jason Merrill <jason@redhat.com>
1278 PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
1279 * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
1280 (regenerated_lambda_fn_p): New.
1281 (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
1282 (tsubst_copy) [VAR_DECL]: Likewise.
1284 PR c++/82030 - ICE inheriting from multiple lambdas
1286 * call.c (compare_ics): Handle null candidate.
1288 2017-08-30 Ville Voutilainen <ville.voutilainen@gmail.com>
1290 Make taking the address of an overloaded function a non-deduced context
1292 * pt.c (unify_overload_resolution_failure): Remove.
1293 (unify_one_argument): Adjust.
1295 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1296 Alan Hayward <alan.hayward@arm.com>
1297 David Sherwood <david.sherwood@arm.com>
1299 * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
1301 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1302 Alan Hayward <alan.hayward@arm.com>
1303 David Sherwood <david.sherwood@arm.com>
1305 * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
1307 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1308 Alan Hayward <alan.hayward@arm.com>
1309 David Sherwood <david.sherwood@arm.com>
1311 * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
1312 instead of TYPE_MODE.
1314 2017-08-29 Jason Merrill <jason@redhat.com>
1316 PR c++/81236 - ICE with template-id in generic lambda
1317 * semantics.c (finish_id_expression): Remove special dependent case.
1318 Avoid some later pieces when dependent.
1319 (finish_qualified_id_expr): Do normal BASELINK handling in a
1320 template. Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
1321 (parsing_default_capturing_generic_lambda_in_template): Remove.
1322 * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
1323 error for types that will never be complete.
1324 * mangle.c (write_expression): Add sanity check.
1325 * tree.c (build_qualified_name): Add sanity check.
1326 (cp_walk_subtrees): Walk into the class context of a BASELINK.
1327 * lambda.c (add_capture): Improve diagnostic for generic lambda
1329 * call.c (build_new_method_call_1): Print the right constructor
1332 Reimplement handling of lambdas in templates.
1333 * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
1334 * decl.c (start_preparsed_function): Call start_lambda_scope.
1335 (finish_function): Call finish_lambda_scope.
1336 * init.c (get_nsdmi): Call start/finish_lambda_scope.
1337 * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
1338 * parser.c (cp_parser_function_definition_after_declarator): Don't
1339 call start/finish_lambda_scope.
1340 * pt.c (retrieve_specialization): Ignore lambda functions in
1342 (find_parameter_packs_r): Ignore capture proxies. Look into
1344 (check_for_bare_parameter_packs): Allow bare packs in lambdas.
1345 (tsubst_default_argument): Call start/finish_lambda_scope.
1346 (tsubst_function_decl): Handle lambda functions differently.
1347 (tsubst_template_decl): Likewise.
1348 (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
1350 (tsubst_lambda_expr): Create a new closure rather than instantiate
1351 the one from the template.
1352 (tsubst_copy_and_build): Don't register a specialization of a pack.
1353 (regenerate_decl_from_template): Call start/finish_lambda_scope.
1354 (instantiate_decl): Remove special lambda function handling.
1355 * semantics.c (process_outer_var_ref): Remove special generic lambda
1356 handling. Don't implicitly capture in a lambda in a template. Look
1357 for an existing proxy.
1358 * class.c (current_nonlambda_class_type): Use decl_type_context.
1360 * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
1361 (LAMBDA_EXPR_RETURN_TYPE): Remove.
1362 (struct tree_lambda_expr): Remove closure and return_type fields.
1363 * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
1364 * pt.c (tsubst_copy_and_build): Likewise.
1365 * parser.c (cp_parser_lambda_declarator_opt): Track return type.
1366 (cp_parser_lambda_body): Adjust unspecified return type check.
1367 * ptree.c (cxx_print_lambda_node): Don't print closure or
1370 PR c++/80935 - wrong C++17 error with lambda
1371 * decl.c (check_for_uninitialized_const_var): Check
1372 is_instantiation_of_constexpr.
1373 * constexpr.c (ensure_literal_type_for_constexpr_object): Check
1374 is_instantiation_of_constexpr.
1375 (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
1377 * lambda.c (build_lambda_object): Check for error_mark_node.
1378 * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
1380 (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
1381 (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
1383 PR c++/80767 - unnecessary instantiation of generic lambda
1384 * call.c (convert_like_real): Call build_user_type_conversion_1 if
1386 (add_conv_candidate): Build a ck_user conversion with no candidate.
1388 Fix lambdas in template default argument of inherited ctor.
1389 * method.c (synthesized_method_base_walk): Replace an inherited
1390 template with its specialization.
1391 (synthesized_method_walk): Make inheriting_ctor a pointer.
1392 (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
1393 (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
1395 * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
1396 template, not the function.
1397 (template_guide_p): Adjust.
1399 Support copying local_specializations.
1400 * cp-tree.h (enum lss_policy): New.
1401 (local_specialization_stack): Add policy parameter to default ctor.
1402 * pt.c (local_specialization_stack): Copy local_specializations if
1405 * constexpr.c (potential_constant_expression_1): Add "now" parm.
1406 (is_constant_expression, require_constant_expression): New.
1407 (is_static_init_expression, is_nondependent_constant_expression)
1408 (is_nondependent_static_init_expression): Drop "potential".
1409 * except.c (build_must_not_throw_expr): Do type conversion on
1410 value-dependent argument.
1411 * pt.c, semantics.c, typeck2.c: Use variants without "potential".
1413 Instantiate default arguments/member initializers once.
1414 * init.c (get_nsdmi): Remember NSDMI instantiations.
1415 * parser.c (inject_this_parameter): Be more picky about
1417 * pt.c (tsubst_copy): Simplify 'this' handling.
1418 (tsubst_default_argument): Remember default argument
1419 instantiations. Take parameter number.
1420 (tsubst_default_arguments): Pass it.
1421 * call.c (convert_default_arg): Likewise.
1423 Fix default argument conversion failure and SFINAE.
1424 * call.c (build_over_call): Check convert_default_arg result for
1426 * parser.c (cp_parser_late_parsing_default_args): Remember
1429 2017-08-28 Nathan Sidwell <nathan@acm.org>
1431 * cp-tree.h (lang_type): Replace sorted_fields vector with
1433 (CLASSTYPE_SORTED_FIELDS): Delete.
1434 (CLASSTYPE_BINDINGS): New.
1435 * decl.c (finish_enum_value_list): Swap args of
1436 insert_late_enum_def_bindings.
1437 * name-lookup.c (lookup_field_1): Replace binary search of sorted
1438 fields with map->get.
1439 (sorted_fields_type_new, count_fields,
1440 add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
1441 (add_class_member, add_class_members): New.
1442 (set_class_bindings): Create map and insert.
1443 (insert_late_enum_def_binding): Swap parms. Use add_clasS_member.
1444 * ptree.c (cxx_print_type): Delete sorted fields printing.
1446 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
1448 * name-lookup.h (set_class_bindings,
1449 insert_late_enum_def_bindings): Declare.
1450 * decl.c (finish_enum_value_list): Adjust for
1451 insert_late_enum_def_bindings name change.
1452 * class.c (finish_struct_1): Call set_class_bindings.
1453 (count_fields, add_fields_to_record_type,
1454 add_enum_fields_to_record_type, sorted_fields_type_new,
1455 insert_into_classtype_sorted_fields,
1456 insert_late_enum_def_into_classtype_sorted_fields): Move to ...
1457 * name-lookup.h (count_fields, add_fields_to_record_type,
1458 add_enum_fields_to_record_type, sorted_fields_type_new,
1459 set_class_bindings, insert_late_enum_def_bindings): ... here.
1461 2017-08-25 Nathan Sidwell <nathan@acm.org>
1463 * class.c (method_name_cmp, resort_method_name_cmp): Methods
1466 Conversion operators have a special name
1467 * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
1468 (conv_op_marker, conv_op_identifier): New.
1469 (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
1470 * decl.c (initialize_predefined_identifiers): Add
1472 (cxx_init_decl_processing): Create conv_op_marker.
1473 * decl2.c (check_classfn): Lookup conv-ops by name.
1474 * class.c (add_method): Use conv_op_identifier & conv_op_marker.
1475 (resort_type_method_vec): Don't skip conv-ops.
1476 (finish_struct_methods, warn_hidden): Likewise.
1477 * name-lookup.h (lookup_all_conversions): Delete.
1478 * name-lookup.c (lookup_conversion_operator): Replace with ...
1479 (extract_conversion_operator): ... this.
1480 (lookup_fnfields_slot_nolazy): Find conv-ops by name.
1481 (lookup_all_conversions): Delete.
1482 * pt.c (check_explicit_specialization): Find conv-ops by name.
1483 * search.c (lookup_conversions_r): Likewise.
1485 2017-08-24 Nathan Sidwell <nathan@acm.org>
1487 Conversion operators kept on single overload set
1488 * class.c (add_method): Keep all conv-ops on one slot.
1489 * name-lookup.c (lookup_conversion_operator): Pull the desired
1490 conv op out of overload set.
1491 * search.c (lookup_conversions_r): Lose template/non-template
1493 (lookup_conversions): Likewise.
1495 2017-08-23 Nathan Sidwell <nathan@acm.org>
1497 * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
1498 lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
1500 * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
1501 lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
1502 * search.c (lookup_conversion_operator,
1503 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1504 lookup_all_conversions): Move to ...
1505 * name-lookup.c (lookup_conversion_operator,
1506 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1507 lookup_all_conversions): ... here.
1509 * semantics.c (finish_member_declaration): Move USING_DECL check
1510 earlier. Always set C++ linkage. Commonize TYPE_FIELD and
1511 template decl list insertion.
1513 * cp-tree.h (maybe_version_functions): Declare.
1514 * decl.c (decls_match): Break function versioning check to
1515 separate function. Call it.
1516 (maybe_version_functions): Broken out of decls_match.
1517 * class.c (add_method): Use maybe_version_functions.
1519 * cp-tree.h (print_search_statistics,
1520 reinit_search_statistics): Don't declare.
1521 * search.c (n_fields_searched, n_calls_lookup_field,
1522 n_calls_lookup_field_1, n_calls_lookup_fnfields,
1523 n_calls_lookup_fnfields_1, n_calls_get_base_type,
1524 n_outer_fields_searched, n_contexts_saved): Delete.
1525 (lookup_field_1, lookup_member,
1526 lookup_fnfields_slot_nolazy): Remove stat gathering.
1527 (print_search_statistics, reinit_search_statistics): Delete.
1528 * tree.c (cxx_print_statistics): Don't print search stats.
1530 2017-08-21 Nathan Sidwell <nathan@acm.org>
1532 * search.c (lookup_field_r): Remove obsolete code for type-named
1535 * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
1537 (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
1538 (lookup_field_fuzzy_r): Adjust.
1540 2017-08-21 David Malcolm <dmalcolm@redhat.com>
1542 * call.c (build_over_call): Pass NULL for new parameter to
1543 check_function_arguments.
1544 * typeck.c (cp_build_function_call_vec): Likewise.
1546 2017-08-21 Nathan Sidwell <nathan@acm.org>
1549 * pt.c (instantiate_class_template_1):
1550 BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
1552 2017-08-18 David Malcolm <dmalcolm@redhat.com>
1555 * name-lookup.c (maybe_suggest_missing_header): Convert return
1556 type from void to bool; return true iff a suggestion was offered.
1557 (suggest_alternative_in_explicit_scope): Move call to
1558 maybe_suggest_missing_header to before use of best_match, and
1559 return true if the former offers a suggestion.
1561 2017-08-18 H.J. Lu <hongjiu.lu@intel.com>
1564 * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
1565 * decl2.c (grokbitfield): Don't allow bit-field with
1566 warn_if_not_aligned type.
1568 2017-08-17 Nathan Sidwell <nathan@acm.org>
1570 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
1571 * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
1572 (TYPE_TEMPLATE_INFO): Simplify.
1573 (SET_TYPE_TEMPLATE_INFO): Simplify.
1575 * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
1576 don't need lang_type.
1577 (cxx_make_type): Use maybe_add_lang_type_raw return value.
1578 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
1581 * cp-tree.h (struct lang_type): Remove template_info field.
1582 (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
1583 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
1585 2017-08-14 Martin Sebor <msebor@redhat.com>
1588 * error.c (cp_printer): Handle 'G'.
1590 2017-08-11 Martin Liska <mliska@suse.cz>
1592 * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
1593 TARGET_SUPPORTS_ALIASES.
1594 (handle_tls_init): Likewise.
1595 (note_mangling_alias): Likewise. Remove ATTRIBUTE_UNUSED for
1597 * optimize.c (can_alias_cdtor): Likewise.
1599 2017-08-11 Jason Merrill <jason@redhat.com>
1601 PR c++/81671 - nullptr_t template parameter
1602 * pt.c (convert_nontype_argument): Fix nullptr_t check.
1604 2017-08-10 Jason Merrill <jason@redhat.com>
1606 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1607 * method.c (synthesized_method_walk): Don't diagnose lack of
1610 PR c++/80452 - Core 1579, implicit move semantics on return/throw
1611 * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
1612 tentatively changed the lvalue to an rvalue.
1613 * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
1614 (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
1615 parameter is an rvalue reference.
1616 * except.c (build_throw): Do maybe-rvalue overload resolution twice.
1617 * typeck.c (check_return_expr): Likewise.
1619 2017-08-10 David Malcolm <dmalcolm@redhat.com>
1621 * parser.c (cp_parser_error): Update for new param to
1623 (class token_pair): New class.
1624 (struct matching_paren_traits): New struct.
1625 (matching_parens): New typedef.
1626 (struct matching_brace_traits): New struct.
1627 (matching_braces): New typedef.
1628 (cp_parser_statement_expr): Convert explicit parsing of
1629 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
1630 class matching_parens, so that the pertinent open parenthesis is
1631 highlighted when there are problems locating the close
1633 (cp_parser_primary_expression): Likewise.
1634 (cp_parser_compound_literal_p): Remove consumption of opening
1636 (cp_parser_postfix_expression): Convert explicit parsing of
1637 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
1638 above. Use it to consume the opening paren previously consumed by
1639 cp_parser_compound_literal_p.
1640 (cp_parser_parenthesized_expression_list): Likewise.
1641 (cp_parser_unary_expression): Likewise.
1642 (cp_parser_new_expression): Likewise.
1643 (cp_parser_cast_expression): Likewise.
1644 (cp_parser_builtin_offsetof): Likewise.
1645 (cp_parser_trait_expr): Likewise.
1646 (cp_parser_lambda_declarator_opt): Likewise.
1647 (cp_parser_lambda_body): Likewise, for matching_braces.
1648 (cp_parser_compound_statement): Likewise.
1649 (cp_parser_selection_statement): Likewise, for matching_parens.
1650 (cp_parser_iteration_statement): Likewise.
1651 (cp_parser_already_scoped_statement): Likewise, for
1653 (cp_parser_linkage_specification): Likewise.
1654 (cp_parser_static_assert): Likewise, for matching_parens.
1655 (cp_parser_decltype): Likewise.
1656 (cp_parser_operator): Likewise.
1657 (cp_parser_enum_specifier): Likewise.
1658 (cp_parser_namespace_definition): Likewise.
1659 (cp_parser_direct_declarator): Likewise.
1660 (cp_parser_braced_list): Likewise.
1661 (cp_parser_class_specifier_1): Likewise, for matching_braces.
1662 (cp_parser_constant_initializer): Likewise.
1663 (cp_parser_noexcept_specification_opt): Likewise, for
1665 (cp_parser_exception_specification_opt): Likewise.
1666 (cp_parser_handler): Likewise.
1667 (cp_parser_asm_specification_opt): Likewise.
1668 (cp_parser_asm_operand_list): Likewise.
1669 (cp_parser_gnu_attributes_opt): Likewise.
1670 (cp_parser_std_attribute_spec): Likewise.
1671 (cp_parser_requirement_parameter_list): Likewise.
1672 (cp_parser_requirement_body): Likewise, for matching_braces.
1673 (cp_parser_compound_requirement): Likewise.
1674 (cp_parser_template_introduction): Likewise.
1675 (cp_parser_sizeof_pack): Likewise, for matching_parens.
1676 (cp_parser_sizeof_operand): Likewise; use it to consume the
1677 opening paren previously consumed by cp_parser_compound_literal_p.
1678 (get_matching_symbol): New function.
1679 (cp_parser_required_error): Add param "matching_location". Remove
1680 calls to cp_parser_error, instead setting a non-NULL gmsgid, and
1681 handling it if set by calling c_parse_error, potentially with a
1682 secondary location if matching_location was set.
1683 (cp_parser_require): Add param "matching_location", with a default
1684 value of UNKNOWN_LOCATION.
1685 (cp_parser_require_keyword): Update for new param of
1686 cp_parser_required_error.
1687 (cp_parser_objc_encode_expression): Update to class matching_parens
1689 (cp_parser_objc_defs_expression): Likewise.
1690 (cp_parser_objc_protocol_expression): Likewise.
1691 (cp_parser_objc_selector_expression): Likewise.
1692 (cp_parser_objc_typename): Likewise.
1693 (cp_parser_objc_superclass_or_category): Likewise.
1694 (cp_parser_objc_try_catch_finally_statement): Likewise.
1695 (cp_parser_objc_synchronized_statement): Likewise.
1696 (cp_parser_objc_at_property_declaration): Likewise.
1697 (cp_parser_oacc_single_int_clause): Likewise.
1698 (cp_parser_oacc_shape_clause): Likewise.
1699 (cp_parser_omp_clause_collapse): Likewise.
1700 (cp_parser_omp_clause_default): Likewise.
1701 (cp_parser_omp_clause_final): Likewise.
1702 (cp_parser_omp_clause_if): Likewise.
1703 (cp_parser_omp_clause_num_threads): Likewise.
1704 (cp_parser_omp_clause_num_tasks): Likewise.
1705 (cp_parser_omp_clause_grainsize): Likewise.
1706 (cp_parser_omp_clause_priority): Likewise.
1707 (cp_parser_omp_clause_hint): Likewise.
1708 (cp_parser_omp_clause_defaultmap): Likewise.
1709 (cp_parser_omp_clause_ordered): Likewise.
1710 (cp_parser_omp_clause_schedule): Likewise.
1711 (cp_parser_omp_clause_num_teams): Likewise.
1712 (cp_parser_omp_clause_thread_limit): Likewise.
1713 (cp_parser_omp_clause_aligned): Likewise.
1714 (cp_parser_omp_clause_linear): Likewise.
1715 (cp_parser_omp_clause_safelen): Likewise.
1716 (cp_parser_omp_clause_simdlen): Likewise.
1717 (cp_parser_omp_clause_depend): Likewise.
1718 (cp_parser_omp_clause_device): Likewise.
1719 (cp_parser_omp_clause_dist_schedule): Likewise.
1720 (cp_parser_oacc_clause_async): Likewise.
1721 (cp_parser_omp_critical): Likewise.
1722 (cp_parser_omp_for_loop): Likewise.
1723 (cp_parser_omp_sections_scope): Likewise.
1724 (cp_parser_omp_declare_reduction_exprs): Likewise.
1725 Update for new param to cp_parser_required_error.
1726 (cp_parser_oacc_routine): Likewise.
1727 (cp_parser_transaction_expression): Likewise.
1728 (cp_parser_cilk_simd_vectorlength): Likewise.
1730 2017-08-09 Jason Merrill <jason@redhat.com>
1732 PR c++/81525 - wrong constant value with generic lambda
1733 * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
1734 (tsubst_copy) [VAR_DECL]: Handle auto.
1736 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1737 * init.c (get_nsdmi): Add complain parm.
1738 * typeck2.c (digest_nsdmi_init): Add complain parm.
1739 (process_init_constructor_record): Pass complain to get_nsdmi.
1740 * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
1741 * method.c (get_defaulted_eh_spec): Add complain parm. Pass it into
1742 synthesized_method_walk.
1743 (synthesized_method_walk): Adjust.
1744 (walk_field_subobs): Pass complain to get_nsdmi.
1745 (defaulted_late_check): Skip other checks if deleted.
1746 * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
1747 * call.c (build_aggr_conv): Pass complain to get_nsdmi.
1748 * parser.c (defarg_location): New.
1749 * error.c (location_of): Use it.
1751 2017-08-09 Marek Polacek <polacek@redhat.com>
1753 * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
1754 * typeck.c (build_binary_op): Change the type of a parameter to bool.
1755 (cp_truthvalue_conversion): Use true instead of 1.
1757 2017-08-08 Marek Polacek <polacek@redhat.com>
1760 * cp-gimplify.c (cp_fold): If folding exposed a branch of
1761 a COND_EXPR, convert it to the original type of the COND_EXPR, if
1764 2017-08-08 Martin Liska <mliska@suse.cz>
1766 * call.c: Include header files.
1767 * cp-gimplify.c: Likewise.
1768 * cp-ubsan.c: Likewise.
1771 * search.c: Likewise.
1772 * semantics.c: Likewise.
1773 * typeck.c: Likewise.
1775 2017-08-07 Martin Liska <mliska@suse.cz>
1777 * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
1779 (cp_parser_std_attribute): Likewise.
1780 * tree.c: Add new include.
1782 2017-08-04 Paolo Carlini <paolo.carlini@oracle.com>
1785 * pt.c (do_class_deduction): Handle the case of no viable implicit
1786 deduction guides; simplify the code generating implicit deduction
1789 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
1792 * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
1793 destructor as expressions.
1795 2017-08-02 Jakub Jelinek <jakub@redhat.com>
1798 * call.c (build_user_type_conversion_1): Only call
1799 lookup_fnfields_slot if totype is CLASS_TYPE_P.
1801 2017-07-31 Jason Merrill <jason@redhat.com>
1803 * decl.c (declare_global_var): Set DECL_CONTEXT.
1805 2017-07-31 Jan Hubicka <hubicka@ucw.cz>
1806 Martin Liska <mliska@suse.cz>
1808 * pt.c (tsubst_copy): Copy PREDICT_EXPR.
1809 * semantics.c (finish_goto_stmt): Build gimple predict
1811 * constexpr.c (potential_constant_expression_1): Handle
1814 2017-07-31 Martin Liska <mliska@suse.cz>
1817 * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
1818 also with current_function_decl non-null equality.
1819 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1820 * decl.c (compute_array_index_type): Likewise.
1821 * init.c (finish_length_check): Likewise.
1822 * typeck.c (cp_build_binary_op): Likewise.
1824 2017-07-29 Jakub Jelinek <jakub@redhat.com>
1826 * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
1827 DW_AT_export_symbols.
1828 * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
1829 argument, pass it through to the debug hook.
1830 (finish_namespace_using_directive): Adjust
1831 emit_debug_info_using_namespace caller.
1832 (push_namespace): Likewise. Call it after setting
1833 DECL_NAMESPACE_INLINE_P.
1834 (cp_emit_debug_info_for_using): Pass false as new argument to
1835 the imported_module_or_decl debug hook.
1837 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
1839 * lex.c (copy_decl): Adjust.
1840 (copy_type): Likewise.
1842 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
1845 * lambda.c (add_capture): Early return if we cannot capture by
1848 2017-07-26 Jason Merrill <jason@redhat.com>
1850 P0702R1 - List deduction of vector.
1851 * pt.c (do_class_deduction): Special-case deduction from a single
1852 element of related type.
1854 2017-07-26 Leonid Koppel <lkoppel@uwaterloo.ca>
1856 PR c++/67054 - Inherited ctor with non-default-constructible members
1857 * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
1858 when deducing an inheriting constructor.
1860 2017-07-21 Nathan Sidwell <nathan@acm.org>
1862 * search.c (lookup_conversion_operator): Return overloads.
1863 (lookup_fnfields_idx_nolazy): Absorb into ...
1864 (lookup_fnfields_slot_nolaxy): ... here.
1865 (lookup_fnfields_1): Absorb into ...
1866 (lookup_fnfields_slot): ... here.
1868 Remove special CDtor METHOD_VEC slots.
1869 * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
1870 CLASSTYPE_DESTRUCTOR_SLOT): Delete.
1871 (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
1872 (CLASSTYPE_DESTRUCTOR): Likewise.
1873 * class (add_method): Don't use special cdtor slots.
1874 * search.c (lookup_fnfields_idx_nolazy): Likewise.
1875 (look_for_overrides_here): Use lookup_fnfields_slot.
1876 * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
1878 * call.c (add_candidates): Move decls to initialization. Don't
1881 2017-07-20 Nathan Sidwell <nathan@acm.org>
1883 Remove TYPE_METHODS.
1884 * class.c (maybe_warn_about_overly_private_class,
1885 finish_struct_methods, one_inheriting_sig, count_fields,
1886 add_fields_to_record_type, check_field_decls, check_methods,
1887 clone_function_decl, set_method_tm_attributes,
1888 finalize_literal_type_property, check_bases_and_members,
1889 create_vtable_ptr, determine_key_method,
1890 unreverse_member_declarations, finish_struct,
1891 add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
1892 * decl.c (fixup_anonymous_aggr): Likewise.
1893 * decl2.c (reset_type_linkage_2): Likewise.
1894 * method.c (after_nsdmi_defaulted_late_checks,
1895 lazily_declare_fn): Likewise.
1896 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
1897 * pt.c (instantiate_class_template_1, tsubst_expr,
1898 do_type_instantiation, instantiate_pending_templates): Likewise.
1899 * search.c (lookup_field_1): Likewise.
1900 * semantics.c (finish_member_declaration,
1901 finish_omp_declare_simd_methods): Likewise.
1903 2017-07-19 Nathan Sidwell <nathan@acm.org>
1905 * class.c (add_implicitly_declared_members): Use
1906 classtype_has_move_assign_or_move_ctor_p.
1907 (classtype_has_move_assign_or_move_ctor,
1908 classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
1909 (classtype_has_move_assign_or_move_ctor_p): ... this new function.
1910 * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
1912 (classtype_has_move_assign_or_move_ctor_p): ... this.
1913 * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
1914 * tree.c (type_has_nontrivial_copy_init): Adjust.
1916 * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
1917 PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
1919 2017-07-18 Nathan Sidwell <nathan@acm.org>
1921 * cp-array-notation.c (build_array_notation_ref): Use
1922 TYPE_{MIN,MAX}_VALUE.
1924 * class.c (classtype_has_move_assign_or_move_ctor): Declare.
1925 (add_implicitly_declared_members): Use it.
1926 (type_has_move_constructor, type_has_move_assign): Merge into ...
1927 (classtype_has_move_assign_or_move_ctor): ... this new function.
1928 * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
1930 2017-07-17 Volker Reichelt <v.reichelt@netcologne.de>
1932 * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
1933 friend outside class and obsolete auto as storage-class-specifier.
1935 2017-07-17 Nathan Sidwell <nathan@acm.org>
1937 * class.c (maybe_warn_about_overly_private_class): Ignore public
1940 * class.c (type_has_user_declared_move_constructor,
1941 type_has_user_declared_move_assign): Combine into ...
1942 (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
1943 * cp-tree.h (type_has_user_declared_move_constructor,
1944 type_has_user_declared_move_assign): Combine into ...
1945 (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
1946 * method.c (maybe_explain_implicit_delete): Use it.
1947 (lazily_declare_fn): Use it.
1948 * tree.c (type_has_nontrivial_copy_init): Use it.
1950 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
1951 semantics, simplify implementation.
1953 2017-07-16 Volker Reichelt <v.reichelt@netcologne.de>
1955 * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
1956 in old-style cast diagnostic.
1957 * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
1958 in useless cast diagnostic.
1959 * error.c (type_to_string): Remove enum special handling.
1961 2017-07-14 David Malcolm <dmalcolm@redhat.com>
1963 * name-lookup.c (get_std_name_hint): Add '<' and '>' around
1965 (maybe_suggest_missing_header): Update for addition of '<' and '>'
1966 to above. Provide a fix-it hint.
1967 * pt.c: Include "gcc-rich-location.h"
1968 (listify): Attempt to add fix-it hint for missing
1969 #include <initializer_list>.
1970 * rtti.c: Include "gcc-rich-location.h".
1971 (typeid_ok_p): Attempt to add fix-it hint for missing
1972 #include <typeinfo>.
1974 2017-07-12 Jason Merrill <jason@redhat.com>
1976 P0512R0 - Deduction from an initializer list.
1977 * pt.c (do_class_deduction): Do list deduction in two phases.
1979 2017-07-12 Nathan Sidwell <nathan@acm.org>
1981 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
1982 DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
1984 * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
1985 DECL_CXX_DESTRUCTOR explicitly.
1986 * decl2.c (grokclassfn): Likewise.
1987 * friend.c (do_friend): Likewise.
1988 * method.c (make_thunk, make_alias_for,
1989 implicitly_declare_fn): Likewise.
1991 2017-07-11 Jason Merrill <jason@redhat.com>
1994 * decl.c (grokparms): Downgrade error about array of unknown bound
1995 to pedwarn and disable it for C++17.
1997 2017-07-11 Nathan Sidwell <nathan@acm.org>
1999 * decl2.c (reset_type_linkage_2): Dont't change ctor name.
2001 2017-07-10 Martin Sebor <msebor@redhat.com>
2003 * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
2005 2017-07-06 Jason Merrill <jason@redhat.com>
2007 PR c++/81204 - parse error with dependent template-name
2008 * parser.c (cp_parser_lookup_name): Revert previous change.
2010 2017-07-06 David Malcolm <dmalcolm@redhat.com>
2012 * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
2013 selftest::run_cp_tests.
2014 (selftest::run_cp_tests): New function.
2015 * cp-tree.h (selftest::run_cp_tests): New decl.
2017 2017-07-04 Jakub Jelinek <jakub@redhat.com>
2019 * parser.c (cp_parser_decomposition_declaration): Replace
2020 decomposition declaration with structured binding in diagnostics.
2021 * decl.c (cp_finish_decomp): Likewise.
2022 (grokdeclarator): Likewise.
2025 * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
2026 forms of structured binding initializers.
2028 2017-07-03 Paolo Carlini <paolo.carlini@oracle.com>
2031 * decl.c (grokdeclarator): Move checks on function return type after
2032 the splice_late_return_type call; if declspecs->locations[ds_type_spec]
2033 is UNKNOWN_LOCATION fall back to input_location.
2035 2017-07-03 David Malcolm <dmalcolm@redhat.com>
2037 * parser.c (enum required_token): Fix spelling of
2038 RT_INTERATION to RT_ITERATION.
2039 (cp_parser_iteration_statement): Likewise.
2040 (cp_parser_required_error): Likewise.
2042 2017-06-30 Jason Merrill <jason@redhat.com>
2044 PR c++/81257 - ICE with invalid ::template.
2045 PR c++/54769 - wrong lookup of dependent template-name.
2046 * parser.c (cp_parser_template_name): Revert part of last change.
2048 2017-06-30 Nathan Sidwell <nathan@acm.org>
2050 * config-lang.in (gtfiles): Add cp/lex.c.
2051 * cp-tree.h (mangle_convop_name_for_type): Rename ...
2052 (make_conv_op_name): ... here. Move to lex.
2053 * lambda.c (maybe_add_lambda_conv_op): Update.
2054 * parser.c (cp_parser_conversion_function_id): Update.
2055 * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
2056 tsubst_copy_and_build): Update.
2057 * semantics.c (apply_deduced_return_type): Update.
2058 * mangle.c (conv_type_hasher, conv_type_names,
2059 mangle_conv_op_name_for_type): Move to ...
2060 * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
2063 2017-06-30 David Malcolm <dmalcolm@redhat.com>
2066 * parser.c (cp_parser_postfix_expression): Construct a location
2067 for typeid expressions.
2069 2017-06-30 Nathan Sidwell <nathan@acm.org>
2071 * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
2073 (lookup_all_conversions): Declare.
2074 * class.c (get_basefndecls): Use lookup_fnfields_slot.
2075 * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
2076 * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
2078 * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
2079 (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
2080 lookup_all_conversions.
2081 * search.c (lookup_fnfields_1): Make static.
2082 (lookup_all_conversions): New.
2083 (class_method_index_for_fn): Delete.
2084 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
2085 lookup_fnfields_slot.
2087 * call.c (build_new_method_call_1): Use constructo_name to get
2088 ctor name. Move argument processing earlier to merge cdtor
2090 * decl.c (grokfndecl): Cdtors have special names.
2091 * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
2092 * pt.c (check_explicit_specialization): Cdtor name is already
2094 * search.c (class_method_index_for_fn): Likewise.
2097 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
2098 a matching TYPE_DECL.
2100 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
2102 * class.c (add_method): Change pair of errors to error + inform.
2103 (handle_using_decl): Likewise.
2105 2017-06-29 Jason Merrill <jason@redhat.com>
2107 * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
2109 PR c++/81180 - ICE with C++17 deduction of member class template.
2110 * pt.c (build_deduction_guide): Correct member template handling.
2112 PR c++/81188 - matching decltype of member function call.
2113 * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
2115 2017-06-29 Nathan Sidwell <nathan@acm.org>
2118 * parser.c (cp_parser_namespace_definition): Immediately close the
2119 namespace if there's no open-brace.
2120 * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
2123 2017-06-29 Jason Merrill <jason@redhat.com>
2125 PR c++/81164 - ICE with invalid inherited constructor.
2126 * search.c (binfo_direct_p): New.
2127 * name-lookup.c (do_class_using_decl): Use it.
2129 2017-06-29 Nathan Sidwell <nathan@acm.org>
2131 * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
2132 VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
2133 * decl.c (initialize_predefined_identifiers): Name cdtor special
2134 names consistently. Use literals for above deleted defines.
2135 (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
2137 * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
2140 * call.c (check_dtor_name): Use constructor_name for enums too.
2141 (build_new_method_call_1): Use constructor_name for cdtors and
2143 * class.c (build_self_reference): Use TYPE_NAME to get name of
2145 * name-lookup (constructor_name): Use DECL_NAME directly.
2146 (constructor_name_p): Reimplement.
2147 (push_class_level_binding_1): Use TYPE_NAME directly.
2149 * class.c (finish_struct): Use OVL_P.
2150 (get_vfield_name): Measure constructor_name length.
2151 * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
2152 (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
2153 * cxx-pretty-print.c (is_destructor_name): Delete.
2154 (pp_cxx_unqualified_id): Remove bogus destructor name checking.
2155 * decl.c (grokfndecl): Move cheap checks first when looking for
2156 implicit extern cness.
2158 * parser.c (cp_parser_direct_declarator): Reorder if to avoid
2159 indentation. Remove unnecessary assignment of constructor name.
2161 Whitespace cleanups.
2162 * call.c (name_as_c_string): Move CONST_CAST to return.
2163 (build_new_method_call_1): Remove unneeded bracing.
2164 * class.c (include_empty_classes): Unbreak line.
2165 * constraint.cc (tsubst_check_constraint): Add space.
2166 * cp-tree.h (lang_decl_ns): Add comment.
2167 (PTRMEM_CST_MEMBER): Break line.
2168 * decl.c (grokfndecl): Add blank lines. Unbreak some others.
2169 (grokdeclarator): Remove lines, move declaration to first use.
2170 * decl2.c (decl_needed_p): Fix indentation.
2171 (c_parse_final_cleanups): Remove blank line.
2172 * method.c (implicitly_declare_fn): Move declaration to first use.
2173 * search.c (current_scope): Add blank lines.
2175 2017-06-28 Jason Merrill <jason@redhat.com>
2177 PR c++/72764 - ICE with invalid template typename.
2178 * decl.c (build_typename_type): No longer static.
2179 * tree.c (strip_typedefs): Use it instead of make_typename_type.
2181 PR c++/69300 - ICE with self-referential noexcept
2182 * pt.c (maybe_instantiate_noexcept): Check for recursion.
2184 PR c++/61022 - error with variadic template template parm
2185 * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
2187 PR c++/72801 - ICE with variadic partial specialization
2188 * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
2190 PR c++/55639 - partial specialization with ::template
2191 * parser.c (cp_parser_class_head): Handle ::template.
2193 PR c++/45976 - error with ::template in declarator.
2194 * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
2196 PR c++/54769 - wrong lookup of dependent template-name.
2197 * parser.c (cp_parser_template_name): Handle dependent object type.
2198 (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
2200 (cp_parser_id_expression): Pass it.
2201 (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
2203 * parser.c (cp_parser_template_id): Use the range location on the
2206 PR c++/81204 - parse error with dependent template-name
2207 * parser.c (cp_parser_lookup_name): Disqualify function templates
2210 2017-06-27 Nathan Sidwell <nathan@acm.org>
2212 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
2213 initialization point. Don't unnecessarily check for ctor name.
2215 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
2216 (CLASSTYPE_DESTRUCTOR): ... this.
2217 * class.c (accessible_nvdtor_p,
2218 maybe_warn_about_overly_private_class,
2219 add_implicitly_declared_members,
2220 clone_constructors_and_destructors, type_has_virtual_destructor):
2221 Adjust for CLASSTYPE_DESTRUCTOR.
2222 (deduce_noexcept_on_destructors): Absorb into ...
2223 (check_bases_and_members): ... here.
2224 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
2225 * init.c (build_delete): Likewise.
2226 * parser.c (cp_parser_lookup_name): Likewise.
2227 * pt.c (check_explicit_specialization): Likewise.
2228 * rtti.c (emit_support_tinfos): Likewise.
2229 * search.c (lookup_fnfields_idx_nolazy): Likewise.
2231 Kill IDENTIFIER_TEMPLATE.
2232 * cp-tree.h (lang_identifier): Remove class_template_info field.
2233 (IDENTIFIER_TEMPLATE): Delete.
2234 * name-lookup.c (constructor_name_full): Subsume into ...
2235 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
2236 (constructor_name_p): Likewise.
2237 * mangle.c (write_source_name): Likewise.
2238 * ptree.c (cxx_print_identifier): Likewise.
2240 2017-06-27 Marek Polacek <polacek@redhat.com>
2243 * parser.c (cp_parser_already_scoped_statement): Initialize
2246 2017-06-26 Jason Merrill <jason@redhat.com>
2248 PR c++/81215 - deduction failure with variadic TTP.
2249 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
2251 2017-06-26 Martin Sebor <msebor@redhat.com>
2254 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
2255 to detect casting away cv-qualifiers.
2257 2017-06-26 Nathan Sidwell <nathan@acm.org>
2259 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
2260 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
2262 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
2263 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
2264 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
2265 * decl.c (grok_op_properties): Adjust identifier checking.
2266 * init.c (expand_default_init): Adjust identifier descision.
2267 * method.c (implicitly_declare_fn): Don't use
2268 DECL_ASSIGNMENT_OPERATOR_P.
2269 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
2271 * call.c (in_charge_arg_for_name): Reimplement.
2272 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
2275 2017-06-26 Marek Polacek <polacek@redhat.com>
2278 * parser.c (cp_parser_statement): Add a default argument. Save the
2279 location of the expression-statement after labels have been parsed.
2280 (cp_parser_implicitly_scoped_statement): Set the location of the
2281 body of the conditional after parsing all the labels. Call
2282 warn_for_multistatement_macros.
2283 (cp_parser_already_scoped_statement): Likewise.
2285 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
2288 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
2289 'typename' in error messages about missing 'typename'.
2291 2017-06-23 Jason Merrill <jason@redhat.com>
2293 PR c++/79056 - C++17 ICE with invalid template syntax.
2294 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
2296 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
2297 * pt.c (template_placeholder_p): New.
2298 * cp-tree.h: Declare it.
2300 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
2302 * decl.c (duplicate_decls): Use builtin_structptr_types.
2304 2017-06-22 Nathan Sidwell <nathan@acm.org>
2306 Reorder IDENTIFIER flags
2308 * cp-tree.h (enum cp_identifier_kind): New.
2309 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
2310 IDENTIFIER_KIND_BIT_2): New.
2311 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
2312 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
2313 (C_IS_RESERVED_WORD): Replace with ...
2314 (IDENTIFIER_KEYWORD_P): ... this.
2315 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
2316 (IDENTIFIER_CDTOR_P): ... this.
2317 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
2318 (IDENTIFIER_OPNAME_P): Replace with ...
2319 (IDENTIFIER_ANY_OP_P): ... this.
2320 (IDENTIFIER_ASSIGN_OP_P): New.
2321 (IDENTIFIER_TYPENAME_P): Replace with ...
2322 (IDENTIFIER_CONV_OP_P): ... this.
2323 (NEW_DELETE_OPNAME_P): Replace with ...
2324 (IDENTIFIER_NEWDEL_OP_P): ... this.
2325 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
2326 (get_identifier_kind_name, set_identifier_kind): Declare.
2327 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
2328 (init_operators): Adjust to avoid keywords, use
2329 set_identifier_kind. Copy TYPE_EXPR slot.
2330 (init_reswords): Call set_identifier_kind.
2331 (unqualified_name_lookup_error): Adjust.
2332 * operators.def (TYPE_EXPR): Remove.
2333 * decl.c (struct predefined_identifier): Move into ...
2334 (initialize_predefined_identifiers): ... here. Call
2335 set_identifier_kind.
2336 (grokfndecl, check_var_type, grokdeclarator): Adjust.
2337 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
2339 * call.c (name_as_c_string): Adjust.
2340 (build_new_method_call_1): Likewise.
2341 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
2342 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
2343 * dump.c (cp_dump_tree): Adjust.
2344 * error.c (dump_decl_name): Adjust.
2345 * mangle.c (write_unqualified_id, write_member_name,
2346 write_expression): Adjust.
2347 (mangle_conv_op_name_for_type): Use set_identifier_kind.
2348 * name-lookup.c (do_class_using_decl): Adjust.
2349 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
2350 * parser.c (cp_lexer_get_preprocessor_token,
2351 cp_parser_direct_declarator): Likewise.
2352 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
2353 tsubst_copy, tsubst_copy_and_build): Adjust.
2354 * ptree.c (cxx_print_identifier): Print identifier kind.
2355 * search.c (lookup_field_r, lookup_member,
2356 lookup_fnfields_idx_nolazy): Adjust.
2357 * semantics.c (finish_id_expression): Adjust..
2358 * typeck.c (cp_build_addr_expr_1): Adjust.
2360 2017-06-21 Jakub Jelinek <jakub@redhat.com>
2363 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
2364 Complain about t not being a variable if t is OVERLOAD even
2365 when processing_template_decl.
2367 2017-06-21 David Malcolm <dmalcolm@redhat.com>
2369 * parser.c (get_cast_suggestion): New function.
2370 (maybe_add_cast_fixit): New function.
2371 (cp_parser_cast_expression): Capture the location of the closing
2372 parenthesis. Call maybe_add_cast_fixit when emitting warnings
2373 about old-style casts.
2375 2017-06-20 Jason Merrill <jason@redhat.com>
2377 PR c++/80972 - C++17 ICE with attribute packed.
2378 * call.c (build_over_call): Allow a TARGET_EXPR from reference
2381 2017-06-20 Nathan Sidwell <nathan@acm.org>
2383 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
2384 (nelts_identifier): Delete.
2385 * decl.c (initialize_predefined_identifiers): Remove nelts.
2387 PR c++/67074 - namespace aliases
2388 * decl.c (duplicate_decls): Don't error here on mismatched
2390 * name-lookup.c (name_lookup::add_value): Matching namespaces are
2392 (diagnose_name_conflict): Namespaces are never redeclarations.
2393 (update_binding): An alias can match a real namespace.
2395 2017-06-19 Jason Merrill <jason@redhat.com>
2397 PR c++/80562 - ICE with constexpr if.
2398 * semantics.c (finish_if_stmt_cond): Call
2399 instantiate_non_dependent_expr.
2401 PR c++/80829 - ICE with constexpr copy of base subobject.
2402 * constexpr.c (clear_no_implicit_zero): New.
2403 (cxx_eval_call_expression): Call it.
2405 2017-06-19 Nathan Sidwell <nathan@acm.org>
2409 * name-lookup.c (set_decl_namespace): Don't follow using
2410 directives and ignore using decls. Only check overly-explicit
2411 scope after discovering decl.
2413 2017-06-19 Jason Merrill <jason@redhat.com>
2415 PR c++/81073 - constexpr and static var in statement-expression.
2416 * typeck2.c (store_init_value): Always call
2417 require_potential_constant_expression.
2418 * pt.c (convert_nontype_argument): Likewise.
2419 * constexpr.c (potential_constant_expression_1): Adjust message.
2420 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
2421 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
2423 2017-06-19 Nathan Sidwell <nathan@acm.org>
2425 * pt.c (coerce_template_parms): Fix indentation.
2426 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
2430 * name-lookup.c (update_binding): Only warn about constructors
2431 hidden by functions.
2433 2017-06-17 Jason Merrill <jason@redhat.com>
2435 PR c++/60063 - -Wunused-local-typedefs and templates.
2436 * decl2.c (is_late_template_attribute): Return false for "used".
2438 PR c++/70844 - -Wuseless-cast and inheriting constructor.
2439 * method.c (forward_parm): Suppress warn_useless_cast.
2441 2017-06-16 Jason Merrill <jason@redhat.com>
2443 PR c++/81045 - Wrong type-dependence with auto return type.
2444 * pt.c (type_dependent_expression_p): An undeduced auto outside the
2445 template isn't dependent.
2446 * call.c (build_over_call): Instantiate undeduced auto even in a
2449 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
2450 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
2451 set longer for a generic lambda.
2453 PR c++/80614 - Wrong mangling for C++17 noexcept type
2454 * mangle.c (write_type): Put the eh spec back on the function type.
2456 PR c++/81102 - Wrong error with partial specialization.
2457 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
2458 types. Do type deduction later.
2460 PR c++/81074 - ICE with partial specialization of member template.
2462 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
2464 PR c++/80831 - ICE with -fsyntax-only.
2465 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
2467 PR c++/80639 - ICE with invalid PMF initialization.
2468 PR c++/80043 - ICE with -fpermissive
2469 * typeck.c (convert_for_assignment): Recurse when instantiate_type
2470 returns without an error.
2472 2017-06-16 Nathan Sidwell <nathan@acm.org>
2474 * pt.c (tsubst_baselink): Fix & clarify formatting.
2476 * cp-tree.h (build_this_parm, cp_build_parm_decl,
2477 build_artificial_parm): Add FN parm.
2478 * decl.c (start_cleanup_fn): Adjust.
2479 (build_this_parm): Add FN parm, pass it through.
2480 (grokfndecl): Adjust parm building.
2481 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
2482 (build_artificial_parm): Add FN parm, pass through.
2483 (maybe_retrofit_in_chrg): Adjust parm building.
2484 (start_static_storage_duration_function): Likwise.
2485 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
2486 * method.c (implicitly_declare_fn): Likewise.
2487 * parser.c (inject_this_parameter): Likewise.
2489 Symbol tables are insert only.
2490 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
2491 derive from pointer_hash. Make undeletable.
2493 * class.c (resort_type_method_vec): Avoid potential unsigned
2496 Don't defer noexcept_deferred_spec.
2497 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
2498 * decl.c (cxx_init_decl_processing): Initialize
2499 noexcept_deferred_spec.
2500 * except.c (unevaluated_noexcept_spec): Delete.
2501 * class.c (deduce_noexcept_on_destructor): Use
2502 noexcept_deferred_spec directly.
2503 * method.c (implicitly_declare_fn): Likewise.
2505 Make keyed_classes a vector.
2506 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
2507 (keyed_classes): Declare as vector.
2508 * decl.c (keyed_classes): Define.
2509 (cxx_init_decl_processing): Allocate it.
2510 (record_key_method_defined): Use vec_safe_push.
2511 * class.c (finish_struct_1): Likewise.
2512 * pt.c (instantiate_class_template_1): Likewise.
2513 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
2516 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
2517 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
2519 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
2520 (get_tinfo_decl): Use get_tinfo_desc.
2521 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
2522 (create_pseudo_type_info): Delete.
2523 (get_pseudo_ti_index): Just determine the index.
2524 (get_tinfo_desc): New. Create all types lazily.
2525 (create_tinfo_types): Just allocate the descriptor array.
2526 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
2529 2017-06-15 Martin Sebor <msebor@redhat.com>
2532 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
2534 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
2535 (build_cxx_call): Call maybe_warn_class_memaccess.
2537 2017-06-14 Jakub Jelinek <jakub@redhat.com>
2539 * cp-gimplify.c (cp_genericize_r): Turn most of the function
2540 into a switch (TREE_CODE (stmt)) statement from long else if
2543 2017-06-13 Jakub Jelinek <jakub@redhat.com>
2546 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
2547 argument even if it has REFERENCE_TYPE.
2550 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
2551 BLOCK_VARS (outer) chain.
2552 (cxx_omp_const_qual_no_mutable): Likewise.
2554 2017-06-13 Martin Liska <mliska@suse.cz>
2557 * class.c (build_base_path): Use sanitize_flags_p.
2558 * cp-gimplify.c (cp_genericize_r): Likewise.
2559 (cp_genericize_tree): Likewise.
2560 (cp_genericize): Likewise.
2561 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2562 * decl.c (compute_array_index_type): Likewise.
2563 (start_preparsed_function): Likewise.
2564 * decl2.c (one_static_initialization_or_destruction): Likewise.
2565 * init.c (finish_length_check): Likewise.
2566 * lambda.c (maybe_add_lambda_conv_op): Likewise.
2567 * typeck.c (cp_build_binary_op): Likewise.
2568 (build_static_cast_1): Likewise.
2570 2017-06-11 Jason Merrill <jason@redhat.com>
2572 * error.c (dump_expr): Use is_this_parameter.
2574 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
2577 2017-06-09 Jason Merrill <jason@redhat.com>
2579 Missing bits from N4268, constant evaluation for all non-type args.
2580 * call.c (build_converted_constant_expr): Rename from
2581 build_integral_nontype_arg_conv, handle all types.
2582 * pt.c (convert_nontype_argument): In C++17 call it for all types.
2583 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
2584 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
2586 Overhaul pointer-to-member conversion and template argument handling.
2587 * call.c (standard_conversion): Avoid creating ck_pmem when the
2588 class type is the same.
2589 * cvt.c (can_convert_qual): Split from
2590 perform_qualification_conversions.
2591 * constexpr.c (cxx_eval_constant_expression): Check it.
2592 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
2593 adjustment is necessary.
2594 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
2595 (convert_nontype_argument): Avoid redundant error.
2597 * call.c (convert_like_real): Remove "inner" parameter.
2598 Don't replace a constant with its value.
2599 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
2601 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
2604 * parser.c (cp_parser_constant_expression): Check
2605 potential_rvalue_constant_expression after decay_conversion.
2606 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
2608 PR c++/80384 - ICE with dependent noexcept-specifier
2609 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
2612 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
2614 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
2616 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
2617 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
2618 (excpet.c): Mark terminate as cold.
2620 2017-06-08 Jakub Jelinek <jakub@redhat.com>
2623 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
2624 to sizetype before size_binop.
2627 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
2628 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
2629 and OMP_CLAUSE_SHARED_READONLY flags.
2631 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
2633 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
2635 2017-06-07 Nathan Sidwell <nathan@acm.org>
2637 * class.c (layout_class_type): Restructure overlong-bitfield tpe
2640 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
2643 * pt.c (do_class_deduction): Build qualified type.
2645 2017-06-06 Nathan Sidwell <nathan@acm.org>
2647 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
2648 sans using directives. Don't walk into inline namespaces.
2651 * name-lookup.c (adl_class_only): Don't add visible friends.
2653 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
2655 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
2657 2017-06-02 Nathan Sidwell <nathan@acm.org>
2659 Remove lang_type_ptrmem.
2660 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
2662 (lang_type_class): ... this. Reorder bitfields. Rename to ...
2663 (lang_type): ... this. Delete old definition.
2664 (lang_type_ptrmem): Delete.
2665 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
2666 (LANG_TYPE_PTRMEM_CHECK): Delete.
2667 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
2668 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
2669 * decl.c (build_ptrmemfunc_type): Adjust.
2670 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
2671 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
2673 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
2676 Remove cp_binding_level::namespaces
2677 * name-lookup.h (cp_binding_level): Lose namespaces field.
2678 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
2680 (suggest_alternatives_for): Adjust for namespace list. Do
2681 breadth-first search.
2682 * decl2.c (collect_source_refs): Namespaces are on the regulr
2684 (collect_ada_namespace): Likewise.
2686 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
2688 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
2691 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
2694 * method.c (constructible_expr): Strip array types before calling
2697 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
2700 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
2701 for case INDIRECT_REF too in the main switch.
2703 2017-05-31 Jason Merrill <jason@redhat.com>
2705 PR c++/80840 - ICE with constexpr and reference
2706 * pt.c (convert_nontype_argument): Don't test whether a decl is
2707 value-dependent when binding to a reference.
2709 2017-05-31 Nathan Sidwell <nathan@acm.org>
2711 * cp-tree.h (lang_decl_slector): New enum.
2712 (lang_decl_base): Make selector an enum. Drop decomposition_p
2714 (lang_decl): Use enum for discrimination.
2715 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
2716 LANG_DECL_DEOMP_CHECK): Use enum.
2717 (DECL_DECOMPOSITION_P): Use selector value.
2718 (SET_DECL_DECOMPOSITION_P): Delete.
2719 (retrofit_lang_decl): Lose SEL parm.
2720 (fit_decomposition_lang_decl): Declare.
2721 * decl.c (cp_finish_decomp, grokdeclarator): Use
2722 fit_decomposition_lang_decl.
2723 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
2725 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
2726 (fit_decomposition_lang_decl): Likewise.
2727 (retrofit_lang_decl): Use worker functions.
2728 (cxx_dup_lang_specific_decl): Use selector enum.
2729 (maybe_add_lang_type_raw): New. Broken out of ...
2730 (cxx_make_type_name): ... here. Call it.
2732 2017-05-30 Jason Merrill <jason@redhat.com>
2734 PR c++/80856 - ICE with local extern in template
2735 * semantics.c (finish_call_expr): Replace a local extern overload
2736 set in a template with the IDENTIFIER_NODE.
2738 2017-05-30 David Malcolm <dmalcolm@redhat.com>
2740 * call.c (perform_implicit_conversion_flags): Convert
2741 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
2742 (print_conversion_rejection): Replace pairs of %qT with
2743 %qH and %qI in various places.
2744 (build_user_type_conversion_1): Likewise.
2745 (build_integral_nontype_arg_conv): Likewise.
2746 (build_conditional_expr_1): Likewise.
2747 (convert_like_real): Likewise.
2748 (convert_arg_to_ellipsis): Likewise.
2750 (initialize_reference): Likewise.
2751 * cvt.c (cp_convert_to_pointer): Likewise.
2752 (cp_convert_to_pointer): Likewise.
2753 (convert_to_reference): Likewise.
2754 (ocp_convert): Likewise.
2755 * error.c (cp_printer): Gain bool and const char ** parameters.
2756 (struct deferred_printed_type): New struct.
2757 (class cxx_format_postprocessor): New class.
2758 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
2759 to pp->m_format_postprocessor.
2760 (comparable_template_types_p): New function.
2761 (newline_and_indent): New function.
2762 (arg_to_string): New function.
2763 (print_nonequal_arg): New function.
2764 (print_template_differences): New function.
2765 (type_to_string_with_compare): New function.
2766 (print_template_tree_comparison): New function.
2767 (append_formatted_chunk): New function.
2768 (add_quotes): New function.
2769 (cxx_format_postprocessor::handle): New function.
2770 (defer_phase_2_of_type_diff): New function.
2771 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
2773 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
2774 %qH and %qI in various places.
2775 (convert_member_func_to_ptr): Likewise.
2776 (build_reinterpret_cast_1): Likewise.
2777 (convert_for_assignment): Likewise.
2778 * typeck2.c (check_narrowing): Likewise.
2780 2017-05-30 Nathan Sidwell <nathan@acm.org>
2782 Kill IDENTIFIER_NAMESPACE_BINDINGS
2783 * cp-tree.h (lang_identifier): Delete namespace_bindings.
2784 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
2785 (lang_decl_ns): Add bindings.
2786 (DECL_NAMESPACE_BINDINGS): New.
2787 * lex.c (retrofit_lang_decl): Create namespace hash table.
2788 * name-lookup.c (find_namespace_slot): Change to use hash-map.
2789 * ptree.c (cxx_print_binding): Delete.
2790 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
2792 * cp-tree.def (OVERLOAD): Fix comment.
2793 * cp-tree.h: Fix comments and whitespace.
2794 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
2795 * name-lookup.c (add_decl_to_level): Assert not class.
2796 (check_local_shadow): Use OVL_P.
2797 (pushdecl_with_scope_1): Rename to ...
2798 (do_pushdecl_with_Scope): ... here.
2799 (do_nonmember_using_decl): Use qualified_namespace_lookup return
2801 (push_class_level_binding_1): Use OVL_P.
2802 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
2803 (pushtag_1): Rename to ...
2804 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
2806 (store_class_bindings): Do not time here.
2807 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
2808 * pt.c (listify): Declare argvec at point of initialization.
2811 * name-lookup.c (add_decl_to_level): Assert not making a circular
2813 (update_binding): Don't prematurely slide artificial decl.
2815 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
2817 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
2819 2017-05-29 Nathan Sidwell <nathan@acm.org>
2821 PR c++/80891 (#1,#5)
2822 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
2823 * name-lookup.c (name_lookup): Add deduping field.
2824 (name_lookup::preserve_state, name_lookup::restore_state): Deal
2826 (name_lookup::add_overload): New.
2827 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
2828 (name_lookup::search_adl): Set deduping. Don't unmark here.
2829 * pt.c (most_specialized_instantiation): Revert previous change,
2830 Assert not given duplicates.
2831 * tree.c (lookup_mark): Just mark the underlying decls.
2832 (lookup_maybe_add): Dedup using marked decls.
2835 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
2836 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
2838 Stat hack representation
2839 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
2840 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
2842 (find_namespace_binding): Replace with ...
2843 (find_namespace_slot): ... this.
2844 (find_namespace_value): New.
2845 (name_lookup::search_namespace_only,
2846 name_lookup::adl_namespace_only): Adjust.
2847 (update_binding): Add SLOT parameter, adjust.
2848 (check_local_shadow): Use find_namespace_value.
2849 (set_local_extern_decl_linkage): Likewise.
2850 (do_pushdecl): Adjust for namespace slot.
2851 (push_local_binding): Assert not a namespace binding.
2852 (check_for_out_of_scope_variable): Use find_namespace_value.
2853 (set_identifier_type_value_with_scope): Likewise.
2854 (get_namespace_binding): Likewise.
2855 (set_namespace_binding): Delete.
2856 (set_global_binding): Directly update the binding.
2857 (finish_namespace_using_decl): Likewise.
2858 (lookup_type_scope_1): Use find_namespace_slot and update.
2859 (do_push_nested_namespace): Use find_namespace_value.
2862 * pt.c (most_specialized_instantiation): Cope with duplicate
2866 * cp-tree.h (build_min_nt_call_vec): Declare.
2867 * decl.c (build_offset_ref_call_from_tree): Call it.
2868 * parser.c (cp_parser_postfix_expression): Likewise.
2869 * pt.c (tsubst_copy_and_build): Likewise.
2870 * semantics.c (finish_call_expr): Likewise.
2871 * tree.c (build_min_nt_loc): Keep unresolved lookups.
2872 (build_min): Likewise.
2873 (build_min_non_dep): Likewise.
2874 (build_min_non_dep_call_vec): Likewise.
2875 (build_min_nt_call_vec): New.
2878 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
2880 (lookup_keep): Call it.
2882 2017-05-26 Nathan Sidwell <nathan@acm.org>
2885 * name-lookup.c (push_inline_namespaces): New.
2886 (push_namespace): Look inside inline namespaces.
2888 Inline and using namespace representation change.
2889 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
2891 (DECL_NAMESPACE_USING): Adjust.
2892 (DECL_NAMESPACE_INLINEES): New.
2893 * name-lookup.h (struct cp_binding_level): Change usings
2895 * name-lookup.c (name_lookup::do_queue_usings,
2896 name_lookup::queue_usings): Adjust.
2897 (name_lookup::search_namespace, name_lookup::search_usings,
2898 name_lookup::queue_namespace): Adjust.
2899 (name_lookup::adl_namespace_only): Adjust.
2900 (add_using_namespace, push_namespace): Push onto vector.
2901 (pop_namespace): Add timing logic.
2903 * call.c (build_operator_new_call): Do namelookup and ADL here.
2904 (build_new_op_1): Likewise.
2905 * name-lookup.h (lookup_function_nonclass): Delete declaration.
2906 (do_using_directive): Likewise.
2907 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
2909 (struct scope_binding): Delete.
2910 (EMPTY_SCOPE_BINDING): Delete.
2911 (set_decl_namespace): Use OVL_P.
2912 (finish_local_using_decl): Lose unnecesary checks.
2913 (lookup_function_nonclass): Delete.
2914 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
2916 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
2917 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
2919 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
2920 (lkp_iterator): Add outer field. Adjust ctor.
2921 (lkp_iterator::operator++): New.
2922 (lookup_mark, lookup_maybe_add): Declare.
2923 * name-lookup.c (name_lookup): Delete fn_set member.
2924 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
2926 (name_lookup::add_value): Use lookup_add directly.
2927 (name_lookup::add_fns: Use lookup_maybe_add.
2928 (name_lookup::search_adl): Mark and unmark fns.
2930 * pt.c (check_explicit_specialization): Use lookup_add directly.
2931 * ptree.c (cxx_print_xnode): Show complete overload structure.
2932 * tree.c (lookup_mark, lookup_maybe_add): New.
2934 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
2936 2017-05-26 Jakub Jelinek <jakub@redhat.com>
2938 * cp-tree.h (struct lang_decl_decomp): New type.
2939 (struct lang_decl): Add u.decomp.
2940 (LANG_DECL_DECOMP_CHECK): Define.
2941 (DECL_DECOMPOSITION_P): Note it is set also on the vars
2942 for user identifiers.
2943 (DECL_DECOMP_BASE): Define.
2944 (retrofit_lang_decl): Add extra int = 0 argument.
2945 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
2946 use it to influence the selector choices and for selector
2947 0 to non-zero transition copy old content.
2948 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
2949 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
2950 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
2951 wording if decl is a structured binding.
2952 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
2953 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
2954 of individual variables for tuple structured bindings.
2955 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
2956 Clear DECL_DECOMP_BASE.
2957 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
2958 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
2960 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
2963 2017-05-25 Jason Merrill <jason@redhat.com>
2965 PR c++/80605 - __is_standard_layout and zero-length array
2966 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
2968 2017-05-25 Nathan Sidwell <nathan@acm.org>
2970 Kill OVL_CURRENT, OVL_NEXT.
2971 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
2972 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
2973 (consider_binding_level): Use OVL_FIRST.
2974 (cp_emit_debug_info_for_using): Use lkp_iterator.
2975 * pt.c (check_explicit_specialization): Use ovl_iterator.
2977 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
2978 * cp-tree.h (lang_decl_ns): Remove ns_users field.
2979 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
2980 (TREE_INDIRECT_USING): Delete.
2981 * name-lookup.h (is_associated_namespace): Delete.
2982 * name-lookup.c (name_lookup::search_usings,
2983 name_lookup::do_queue_usings): Usings are always direct.
2984 (is_associated_namespace): Delete.
2985 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
2986 (namespace_ancestor_1, namespace_ancestor): Delete.
2987 (push_using_directive_1, push_using_directive): Delete.
2988 (add_using_namespace_1): Delete.
2989 (add_using_namespace): Reimplement.
2990 (emit_debug_info_using_namespace): New.
2991 (finish_namespace_using_directive, finish_local_using_directive,
2992 push_namespace): Adjust.
2993 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
2995 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
2997 * semantics.c (finish_handler_parms): Warn about non-reference type
3000 2017-05-25 Nathan Sidwell <nathan@acm.org>
3002 Reimplement unqualified namespace lookup.
3003 * name-lookup.c (name_lookup::using_pair,
3004 name_lookup::using_queue): New typedefs.
3005 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
3006 name_lookup::queue_usings): New.
3007 (name_lookup::search_unqualified): New.
3008 (merge_functions, same_entity_p, ambiguous_decl,
3009 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
3010 lookup_using_namespace): Delete.
3011 (lookup_name_real_1): Adjust.
3013 Reimplement qualified namespace lookup.
3014 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
3015 (name_lookup::ambiguous, name_lookup::add_value,
3016 name_lookup::add_type, name_lookup::process_binding): New.
3017 (name_lookup::search_namespace_only,
3018 name_lookup::search_namespace, name_lookup::search_usings): New.
3019 (name_lookup::search_qualified): New.
3020 (do_nonmember_using_decl, suggest_alternatives_for,
3021 lookup_qualified_name): Adjust.
3022 (tree_vec_contains): Delete.
3023 (qualified_lookup_using_namespace): Rename to ...
3024 (qualified_namespace_lookup): ... here. Reimplement.
3027 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
3028 * name-lookup.h (lookup_arg_dependent): Return plain tree.
3029 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
3030 arg_assoc_args_vec, arg_assoc_type, add_function,
3031 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
3032 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
3033 lookup_arg_dependent_1): Delete.
3034 (name_lookup): New lookup object.
3035 (name_lookup::preserve_state, name_lookup::restore_state,
3036 name_lookup::mark_seen, name_lookup::find_and_mark,
3037 name_lookup::add_fns, name_lookup::adl_namespace_only,
3038 name_lookup::adl_namespace, name_lookup::adl_class_only,
3039 name_lookup::adl_bases, name_lookup::adl_class,
3040 name_lookup::adl_expr, name_lookup::adl_type,
3041 name_lookup::adl_template_arg, name_lookup::search_adl): New.
3042 (lookup_arg_dependent): Return a plain tree. Adjust.
3043 (is_associated_namespace): Move later.
3045 2017-05-24 Nathan Sidwell <nathan@acm.org>
3047 * friend.c (do_friend): Remove check for existing decl.
3048 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
3049 * name-lookup.c (push_local_binding): Directly look for binding.
3050 (lookup_name_innermost_nonclass_level_1): Delete.
3051 (lookup_name_innermost_nonclass_level): Delete.
3053 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
3055 * cp-tree.h (cp_free_lang_data): Add extern.
3056 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
3058 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
3059 * typeck.c (type_unknown_p): Delete.
3060 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
3061 overload management.
3062 (dependent_name): Likewise.
3063 (decl_anon_ns_mem_p): Simplify.
3065 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
3068 * tree.c (reshape_init): Use unqualified type for direct enum init.
3069 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
3070 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
3071 non-class destination types.
3072 (build_const_cast_1): Strip cv-quals from destination types.
3073 (build_static_cast, build_reinterpret_cast, build_const_cast)
3074 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
3076 2017-05-24 Martin Sebor <msebor@redhat.com>
3079 * call.c (fully_fold_internal): Adjust.
3081 2017-05-24 Nathan Sidwell <nathan@acm.org>
3083 * cp-tree.h (ovl_skip_hidden): Declare.
3084 * tree.c (ovl_skip_hidden): New.
3085 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
3086 (lookup_arg_dependent_1): Likewise.
3087 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
3088 (hidden_name_p, remove_hidden_names): Delete.
3089 (lookup_name_real_1): Do not strip hidden names.
3090 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
3092 * cp-tree.h (OVL_HIDDEN_P): New.
3093 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
3094 (ovl_iterator::reveal_node): Declare.
3095 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
3096 (ovl_insert): Order on hiddenness.
3097 (ovl_iterator::reveal_node): New.
3098 * name-lookup.c (anticipated_builtin_p): New.
3099 (supplement_binding_1): Use it.
3100 (set_local_extern_decl_linkage): Use hidden_p.
3101 (do_pushdecl): Deal with unhiding a hidden decl, use
3102 anticipated_builtin_p.
3103 (do_nonmember_using_decl): Use anticipated_decl_p.
3104 (lookup_name_real_1): Use DECL_HIDDEN_P.
3106 2017-05-23 Jason Merrill <jason@redhat.com>
3108 -Wunused and C++17 structured bindings
3109 * decl.c (poplevel): Don't warn about unused structured bindings,
3110 only real variables.
3111 * error.c (dump_simple_decl): Handle structured bindings.
3112 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
3114 2017-05-23 Nathan Sidwell <nathan@acm.org>
3116 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
3117 * name-lookup.c (create_local_binding): New.
3118 (update_binding): New.
3119 (pushdecl_maybe_friend_1): Rename to ...
3120 (do_pushdecl): ... this. Reimplement.
3122 (push_overloaded_decl_1, push_overloaded_decl): Delete.
3124 2017-05-23 Jason Merrill <jason@redhat.com>
3126 PR c++/80396 - built-in for make_integer_sequence.
3127 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
3128 (expand_integer_pack, expand_builtin_pack_call): New.
3129 (find_parameter_packs_r): Check builtin_pack_call_p.
3130 (check_for_bare_parameter_packs): Handle it.
3131 (tsubst_pack_expansion): Call expand_builtin_pack_call.
3132 (declare_integer_pack): New.
3133 (init_template_processing): Call it.
3134 * decl2.c (mark_used): Check builtin_pack_fn_p.
3136 2017-05-23 Nathan Sidwell <nathan@acm.org>
3138 * name-lookup.c (find_namespace_binding): New.
3139 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
3140 (set_identifier_type_value_with_scope): Use find_namespace_binding.
3141 (find_binding, cp_binding_level_find_binding_for_name,
3142 binding_for_name, namespace_binding_1): Delete.
3143 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
3144 (get_namespace_binding, set_namespace_binding,
3145 finish_namespace_using_decl, unqualified_namespace_lookup_1,
3146 qualified_lookup_using_namespace, lookup_type_scope_1,
3147 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
3150 * parser.c (cp_parser_template_id): Keep the lookup when stashing
3153 * cp-tree.h (DECL_HIDDEN_P): New.
3154 * name-lookup.c (set_decl_context,
3155 set_local_extern_decl_linkage): New, broken out of ...
3156 (pushdecl_maybe_friend_1): ... here. Call them.
3158 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
3160 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
3161 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
3164 2017-05-23 Nathan Sidwell <nathan@acm.org>
3166 * cp-tree.h (OVL_P): New.
3167 * name-lookup.h (push_local_binding): Delete.
3168 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3169 (finish_namespace_using_decl, finish_local_using_decl): ... here
3170 * name-lookup.c (add_decl_to_level): Swap args.
3171 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
3172 (diagnose_name_conflict): Check contexts are same for redecl.
3173 (update_local_overload): New.
3174 (compparms_for_decl_and_using): Rename to ...
3175 (matching_fn_p): ... here.
3176 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
3177 push_local_bindings call.
3178 (push_local_binding): Make static, replace FLAGS arg with
3180 (validate_nonmember_using_decl): Use OVL_FIRST.
3181 (do_nonmember_using_decl): Use in/out parameters. Use
3182 lkp_iterator and simplify.
3183 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3184 (finish_namespace_using_decl, finish_local_using_decl): ... here.
3186 (lookup_type_current_level): Delete.
3187 * parser.c (cp_parser_using_declaration): Adjust.
3188 * pt.c (tsubst_expr): Adjust.
3190 2017-05-22 Nathan Sidwell <nathan@acm.org>
3192 * name-lookup.h (parse_using_directive): Replace with ...
3193 (finish_namespace_using_directive): ... this and ...
3194 (finish_local_using_directive): ... this.
3195 * name-lookup.c (add_using_namespace_1): Move later.
3196 (add_using_namespace): Move later, add namespace_p arg, remove
3198 (push_using_directive_1): Directly recurse.
3199 (do_using_directive, parse_using_directive): Delete, split into ...
3200 (finish_namespace_using_directive): ... this and ...
3201 (finish_local_using_directive): ... this.
3202 (push_namespace): Use add_using_namespace.
3203 * parser.c (cp_parser_using_directive): Call
3204 finish_namespace_using_directive or finish_local_using_directive.
3205 * pt.c (tsubst_expr): Call finish_local_using_directive.
3207 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
3208 * cp-tree.h (raw_dump_id): Declare.
3209 * decl2.c (raw_dump_id): Define.
3210 (dump_tu): Use raw_dump_id.
3212 * config-lang.in (gtfiles): Sort list, break lines.
3214 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
3215 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
3216 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
3217 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
3218 CPTI_RETHROW_FN): New.
3219 (noexcept_deferred_spec): New.
3220 (terminate_node, call_unexpected_node): Rename to ...
3221 (terminate_fn, call_unexpected_fn): ... here.
3222 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
3223 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
3224 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
3225 (init_exception_processing): Adjust.
3226 (declare_library_fn): Create and push the fns here.
3227 (do_get_exception_ptr, do_begin_catch, do_end_catch,
3228 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
3229 declare_library_fn use.
3230 (unevaluated_noexcept_spec): Adjust.
3231 * cp-gimplify.c (genericize_eh_spec_block,
3232 gimplify_most_not_throw_expr): Adjust.
3234 * name-lookup.c (pushdecl_top_level,
3235 pushdecl_top_level_and_finish): Move after namespace pushing and
3237 (push_to_top_level): Rename to ...
3238 (do_push_to_top_level): ... here. Remove timing code.
3239 (pop_from_top_level_1): Rename to ...
3240 (do_pop_from_top_level): ... here.
3241 (do_push_nested_namespace, do_pop_nested_namespace)
3242 (push_to_top_level): New wrapper for do_push_to_top_level.
3243 (pop_from_top_level): Adjust.
3244 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
3246 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
3248 * config-lang.in (gtfiles): Add c-family/c-format.c,
3249 except.c, init.c, lambda.c and friend.c.
3250 * class.c (dvirt_fn): Move out of function scope,
3252 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
3253 * init.c (fn): Likewise.
3254 * lambda.c (ptr_id, max_id): Likewise.
3255 * friend.c (global_friend): Add GTY attribute.
3257 2017-05-19 Nathan Sidwell <nathan@acm.org>
3259 * call.c (add_list_candidates): Use OVL_FIRST.
3260 (build_new_method_call_1): Likewise.
3261 * cp-tree.h (OVL_SINGLE_P): New.
3262 (TYPE_HIDDEN_P): New.
3263 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
3264 * dump.c (cp_tump_tree): Adjust overload dumping.
3265 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
3267 * method.c (lazily_declare_fn): Assert we added it.
3268 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
3270 (cp_parser_template_name): Use lkp_iterator.
3271 * pt.c (begin_template_parm_list): Fixup comment.
3272 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
3273 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
3274 (ovl_scope): Use lkp_iterator.
3276 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
3278 * parser.c (cp_parser_omp_clause_default): Handle
3279 "OMP_CLAUSE_DEFAULT_PRESENT".
3281 * parser.c (cp_parser_omp_clause_default): Avoid printing more
3282 than one syntax error message.
3284 2017-05-19 Nathan Sidwell <nathan@acm.org>
3286 * class.c (class_dump_id): Define.
3287 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
3288 * cp-objcp-common.c (cp_register_dumps): New.
3289 * cp-objcp-common.h (cp_register_dumps): Declare.
3290 (LANG_HOOKS_REGISTER_DUMPS): Override.
3291 * cp-tree.h (class_dump_id): Declare.
3293 2017-05-18 Nathan Sidwell <nathan@acm.org>
3295 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
3297 (lookup_keep): Declare.
3298 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
3299 * pt.c (tsubst_copy): Assert lookup is persistent.
3300 * semantics.c (finish_call_expr): Use lkp_iterator, call
3302 * tree.c (ovl_copy): New.
3303 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
3306 * cp-tree.h (OVL_USED): Replace with ...
3307 (OVL_USING_P): ... this.
3308 (ovl_iterator::using_p): Adjust.
3309 * name-lookup.c (push_overloaded_decl_1,
3310 do_nonmember_using_decl): Adjust.
3311 * search.c (lookup_field_r): Adjust.
3312 * tree.c (ovl_insert, ovl_scope): Adjust.
3314 * cp-tree.h (lookup_add): Swap args.
3315 (ovl_cons, build_overload): Delete.
3316 * name-lookup.c (add_function, push_overloaded_decl_1,
3317 do_nonmember_using_decl, merge_functions, remove_hidden_names):
3318 Use lookup_add, ovl_insert.
3319 * pt.c (check_explicit_specialization): Use lookup_add.
3320 (do_class_deduction): Likewise. Refactor if.
3321 * tree.c (lookup_add): Swap args.
3322 (ovl_cons, build_overload): Delete.
3324 * name-lookup.c (find_local_binding): New, broken out of ...
3325 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
3326 (set_namespace_binding): Swap scope & name args.
3327 (namespace_binding_1): Likewise.
3328 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
3329 (push_overloaded_decl_1): Likewise.
3330 (set_global_binding): Likewise.
3331 (get_namespace_binding): Adjust namespace_binding_1 call.
3333 2017-05-17 Nathan Sidwell <nathan@acm.org>
3335 * cp-tree.h (default_hash_traits <lang_identifier *>): New
3337 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
3338 (extern_c_fns): New hash table.
3339 (check_extern_c_conflict): New, broken out of ...
3340 (pushdecl_maybe_friend_1): ... here. Call it.
3341 (c_linkage_bindings): Just look in hash table.
3343 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
3347 Implement new C++ intrinsics __is_assignable and __is_constructible.
3348 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
3350 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3351 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3352 * method.c (constructible_expr): Set cp_unevaluated.
3353 (is_xible_helper): New.
3354 (is_trivially_xible): Adjust.
3356 * parser.c (cp_parser_primary_expression): Handle
3357 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
3358 (cp_parser_trait_expr): Likewise.
3359 * semantics.c (trait_expr_value): Handle
3360 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3362 2017-05-17 Nathan Sidwell <nathan@acm.org>
3364 * cp-tree.h (ovl_iterator::using_p): New predicate.
3365 (ovl_iterator::remove_node): New worker.
3366 (ovl_insert): Declare.
3367 * tree.c (ovl_insert): New.
3368 (ovl_iterator::remove_node): New.
3369 * class.c (add_method): Use ovl_iterator, ovl_insert.
3370 (clone_function_decl): Fix description.
3371 (clone_constructors_and_destructors): Use ovl_iterator.
3373 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
3374 (maybe_warn_about_overly_private_class): Use ovl_iterator.
3375 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
3376 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
3377 (get_base_fndecls): Use ovl_iterator.
3378 (warn_hidden): Use OVL_NAME, ovl_iterator.
3379 (add_implicitly_declared_members): Use ovl_iterator.
3380 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
3382 (finish_shorthand_constraint): Simplify, use ovl_make.
3383 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
3384 * search.c (shared_member_p): Use ovl_iterator.
3385 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
3386 (lookup_conversion_operator): Use OVL_FIRST.
3387 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
3388 (look_for_overrides_here): Use ovl_iterator.
3389 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
3390 * typeck.c (build_x_unary_op): Use ovl_make.
3392 2017-05-17 Martin Liska <mliska@suse.cz>
3394 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
3395 use it instead of int type.
3396 (dump_vtable): Likewise.
3397 (dump_vtt): Likewise.
3398 * decl2.c (dump_tu): Likewise.
3400 2017-05-16 David Malcolm <dmalcolm@redhat.com>
3402 * call.c (enforce_access): Add access_failure_info * param and use
3403 it to record access failures.
3404 * cp-tree.h (class access_failure_info): New class.
3405 (enforce_access): Add access_failure_info * param, defaulting to
3407 (lookup_member): Likewise.
3408 (locate_field_accessor): New function decl.
3409 (perform_or_defer_access_check): Add access_failure_info * param,
3411 * search.c (lookup_member): Add access_failure_info * param and
3412 pass it on to call to perform_or_defer_access_check.
3413 (matches_code_and_type_p): New function.
3414 (field_access_p): New function.
3415 (direct_accessor_p): New function.
3416 (reference_accessor_p): New function.
3417 (field_accessor_p): New function.
3418 (struct locate_field_data): New struct.
3419 (dfs_locate_field_accessor_pre): New function.
3420 (locate_field_accessor): New function.
3421 * semantics.c (perform_or_defer_access_check): Add
3422 access_failure_info * param, and pass it on to call to
3424 * typeck.c (access_failure_info::record_access_failure): New method.
3425 (access_failure_info::maybe_suggest_accessor): New method.
3426 (finish_class_member_access_expr): Pass an access_failure_info
3427 instance to the lookup_member call, and call its
3428 maybe_suggest_accessor method afterwards.
3430 2017-05-16 Marek Polacek <polacek@redhat.com>
3434 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
3436 2017-05-16 Nathan Sidwell <nathan@acm.org>
3438 * name-lookup.c (check_local_shadow): New, broke out of ...
3439 (pushdecl_maybe_friend_1): ... here. Call it.
3441 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
3442 (ovl_first): Move inline definition to end of file.
3443 (ovl_make, lookup_add): Declare.
3444 (get_fns, get_first_fn): Make pure.
3445 * tree.c (ovl_cache): New.
3446 (ovl_make, lookup_add): New.
3447 * pt.c (do_class_deduction): Don't add candidates that will be
3450 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
3451 (print_error_for_call_failure): Use OVL_NAME.
3452 (build_op_call_1): Use ovl_iterator.
3453 (add_candidates): Use OVL_FIRST & lkp_iterator.
3454 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
3456 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
3457 (type_has_user_nondefault_constructor,
3458 in_class_defaulted_default_constructor,
3459 type_has_user_provided_constructor,
3460 type_has_user_provided_or_explicit_constructor,
3461 type_has_non_user_provided_default_constructor,
3462 vbase_has_user_provided_move_assign,
3463 type_has_move_constructor, type_has_move_assign,
3464 type_has_user_declared_move_constructor,
3465 type_has_user_declared_move_assign,
3466 type_build_ctor_call, type_build_dtor_call,
3467 type_requires_array_cookie, explain_non_literal_class): Likewise.
3468 (finish_struct): Use lkp_iterator.
3469 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
3470 (note_name_declared_in_class): Use OVL_NAME.
3471 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
3472 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
3473 cxx_pretty_printer::expression): Likewise.
3474 * decl2.c (check_classfn): Use ovl_iterator.
3475 * pt.c (retrieve_specialization): Use ovl_iterator.
3476 * tree.c (cp_tree_equal): Use lkp_iterator.
3477 (type_has_nontrivial_copy_init): Use ovl_iterator.
3479 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
3480 check is_overloaded_fn.
3482 2017-05-16 Martin Liska <mliska@suse.cz>
3484 * parser.c (cp_lexer_print_token): Add default value for flags
3485 argument of print_gimple_stmt, print_gimple_expr,
3486 print_generic_stmt and print_generic_expr.
3488 2017-05-16 Nathan Sidwell <nathan@acm.org>
3490 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
3492 (MAYBE_BASELINK_FUNCTIONS): New.
3493 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
3494 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
3495 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
3496 * method.c (inherited_ctor_binfo): Use ovl_iterator.
3497 (binfo_inherited_from): Likewise.
3498 * parser.c (lookup_literal_operator): Use lkp_iterator.
3499 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
3500 (print_candidates_1): Likewise.
3501 (determine_specialization): Likewise.
3502 (resolve_overloaded_unification): Likewise.
3503 (resolve_nondeduced_context): Likewise.
3504 (type_dependent_expression_p): Likewise.
3505 (dependent_template_p): Likewise.
3506 * ptree.c (cxx_print_xnode): Likewise.
3507 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
3508 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
3509 * typeck.c (check_template_keyword): Use lkp_iterator.
3511 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
3513 * constexpr.c (function_concept_check): Use OVL_FIRST.
3514 * cvt.c (build_expr_type_conversion): Likewise.
3515 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
3516 * decl2.c (mark_used): Use OVL_FIRST.
3517 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
3518 (dump_expr, location_of): Use OVL_FIRST.
3519 * friend.c (do_friend): Use OVL_NAME.
3520 * init.c (build_offset_ref): Use OVL_FIRST.
3521 * mangle.c (write_member_name): Likewise.
3522 (write_expression): Use OVL_NAME.
3523 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
3524 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
3525 * pt.c (check_explicit_specialization): Use OVL_FIRST.
3526 (check_template_shadow): Likewise.
3527 (tsubst_template_args): Use OVL_NAME.
3528 (tsubst_baselink): Use OVL_FIRST.
3529 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
3530 * tree.c (get_first_fn): Use OVL_FIRST.
3531 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
3532 (cp_build_addr_expr_1): Use OVL_FIRST.
3534 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
3536 * semantics.c (finish_id_expression): Directly init local var.
3537 (finish_omp_reduction_clause): Use really_overloaded_fn.
3538 * tree.c (get_fns): Document. Assert we got an overload.
3539 (get_first_fn) Document.
3540 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
3541 really_overloaded_fn.
3542 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
3544 * cp-tree.h (SCOPE_DEPTH): New.
3545 * name-lookup.h (is_nested_namespace): Declare.
3546 * name-lookup.c (is_nested_namespace): New.
3547 (is_ancestor): Use it.
3548 (set_decl_namespace): Likewise.
3549 (push_namespace): Set SCOPE_DEPTH.
3550 * pt.c (check_specialization_namespace): Use is_nested_namespace.
3551 (check_unqualigied_spec_or_inst): Likewise.
3553 2017-05-15 Nathan Sidwell <nathan@acm.org>
3556 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
3557 * name-lookup.h (push_namespace): Return int, add make_inline arg.
3558 * name-lookup.c (push_namespace): Deal with inline directly.
3559 Return pushed count.
3560 * parser.c (cp_parser_namespace_definition): Adjust for
3561 push_namespace change.
3563 2017-05-11 Nathan Sidwell <nathan@acm.org>
3565 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
3566 LANG_HOOKS_PUSHDECL): Move to ...
3567 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
3568 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
3569 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
3571 * name-lookup.h (pushdecl): Add default friend parm.
3572 (pushdecl_maybe_friend): Delete.
3573 (pushdecl_top_level): Add default friend parm.
3574 (pushdecl_top_level_maybe_friend): Delete.
3575 * name-lookup.c (pushdecl_maybe_friend): Delete.
3576 (pushdecl): Add is_friend parm.
3577 (pushdecl_top_level): Add is friend_parm.
3578 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
3579 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
3580 * friend.c (do_friend): Adjust.
3581 * pt.c (tsubst_friend_class): Adjust.
3583 Revert pushdecl_top_level_and_finish name change.
3584 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
3585 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
3586 * decl.c (cp_make_fname_decl): Adjust.
3587 * decl2.c (get_guard, handle_tls_init): Adjust.
3588 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
3590 * name-lookup.c (pushdecl_outermost_localscope): Always
3591 conditionally stop timer.
3593 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
3594 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
3596 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
3597 pushtag_top_level_maybe_friend,
3598 pushdecl_top_level_and_finish): Move declarations to ...
3599 * name-lookup.h: ... here. Group pushdecl variants.
3600 (pushdecl_top_level_and_finish): Rename to ...
3601 (pushdecl_top_level_with_init): ... here.
3602 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
3603 * decl2.c (get_guard, handle_tls_init): Likewise.
3604 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
3605 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
3606 * method.c (implicitly_declare_fn): Likewise.
3607 * searchc (node_debug_info_needed): Likewise.
3608 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
3609 (pushdecl_top_level_with_init): ... here.
3610 (pop_everything): Use namespace_bindings_p.
3612 * name-lookup.h (pop_binding): Rename to pop_local_binding.
3613 (getdecls): Rename to get_local_decls.
3614 * name-lookup.c (pop_binding): Rename to ...
3615 (pop_local_binding): ... here.
3616 (pop_bindings_and_leave_scope): Adjust.
3617 (getdecls): Rename to ...
3618 (get_local_decls): ... here. Assert local scope.
3619 * decl.c (poplevel): Assert not namespace. Adjust and simplify
3621 (store_parm_decls): Adjust get_local_decls call.
3622 (parser.c (synthesize_implicit_template_parm): Likewise.
3624 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
3627 * method.c (is_trivially_xible): Reject void types.
3629 2017-05-10 Nathan Sidwell <nathan@acm.org>
3631 * class.c (handle_using_decl): Always use OVL_CURRENT.
3632 (resolve_address_of_overloaded_function): Move iterator decl into
3633 for scope. Don't strip anticipated decls here.
3635 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
3637 (print_candidates): Adjust.
3639 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
3641 * call.c (build_new_function_call): Lose koenig_p arg. Remove
3642 koenig_p handling here.
3643 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
3644 (tsubst_omp_clauses): Likewise.
3645 (do_class_deduction): Adjust buld_new_function_call calls.
3646 * semantics.c (finish_call_expr): Likewise.
3648 2017-05-10 Jason Merrill <jason@redhat.com>
3650 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
3651 (unify_type_mismatch, unify_parameter_pack_mismatch)
3652 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
3653 (unify_parameter_pack_inconsistent, unify_inconsistency)
3654 (unify_vla_arg, unify_method_type_error, unify_arity)
3655 (unify_arg_conversion, unify_no_common_base)
3656 (unify_inconsistent_template_template_parameters)
3657 (unify_template_deduction_failure)
3658 (unify_template_argument_mismatch)
3659 (unify_overload_resolution_failure): Call unify_invalid.
3661 CWG 1847 - Clarifying compatibility during partial ordering
3662 * pt.c (more_specialized_fn): No order between two non-deducible
3665 * pt.c (dependent_type_p): Make sure we aren't called with
3668 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3669 * pt.c (convert_template_argument): Just return an argument pack.
3670 (coerce_template_parameter_pack, template_parm_to_arg)
3671 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
3672 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
3673 Don't set the type of a NONTYPE_ARGUMENT_PACK.
3674 * parser.c (make_char_string_pack, make_string_pack): Likewise.
3676 2017-05-10 Nathan Sidwell <nathan@acm.org>
3678 * cp-tree.h (add_method, clone_function_decl): Change last arg to
3680 * class.c (add_method): Change third arg to bool. Adjust.
3681 (one_inheriting_sig, one_inherited_ctor): Adjust.
3682 (clone_function_decl): Change 2nd arg to bool. Adjust.
3683 (clone_constructors_and_destructors): Adjust.
3684 * lambda.c (maybe_add_lambda_conv_op): Adjust.
3685 * method.c (lazily_declare_fn): Adjust.
3686 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
3687 * semantics.c (finish_member_declaration): Adjust.
3689 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
3692 * decl.c (finish_function): To improve error recovery, change the
3693 logic for calling apply_deduced_return_type.
3695 2017-05-09 Jason Merrill <jason@redhat.com>
3697 PR c++/80605 - __is_standard_layout and empty base
3698 * class.c (check_bases): Ignore empty bases.
3700 PR c++/70979 - literal class and closure types
3701 * class.c (finalize_literal_type_property): Handle closures
3703 (explain_non_literal_class): Likewise.
3705 PR c++/66297, DR 1684 - literal class and constexpr member fns
3706 * constexpr.c (is_valid_constexpr_fn): Only complain about
3707 non-literal enclosing class in C++11.
3708 * class.c (finalize_literal_type_property): Likewise.
3710 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
3713 * pt.c (tsubst_decl): Early return error_mark_node if
3714 grok_ctor_properties returns false.
3716 2017-05-09 Jason Merrill <jason@redhat.com>
3718 PR c++/70167 - array prvalue treated as lvalue
3719 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
3721 * semantics.c (finish_compound_literal): Add fcl_context parameter.
3722 Only make a static variable for C99 syntax.
3723 * parser.c (cp_parser_postfix_expression): Pass it.
3724 * pt.c (tsubst_copy_and_build): Likewise.
3725 * call.c (extend_ref_init_temps): Set
3726 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
3728 2017-05-09 Nathan Sidwell <nathan@acm.org>
3730 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
3731 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
3732 * name-lookup.h (pushdecl_top_level): Declare.
3734 2017-05-08 Jason Merrill <jason@redhat.com>
3736 PR c++/80178 - parameter passing for uncopyable classes
3737 * tree.c (type_has_nontrivial_copy_init): True for classes with only
3738 deleted copy/move ctors.
3739 (remember_deleted_copy, maybe_warn_parm_abi): New.
3740 * decl.c (require_complete_types_for_parms, check_function_type):
3741 Call maybe_warn_parm_abi.
3742 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
3744 2017-05-08 Nathan Sidwell <nathan@acm.org>
3746 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
3747 (start_preparsed_function): Do decl pushing before setting
3748 current_funciton_decl and announcing it.
3750 * name-lookup.h (pushdecl_with_scope): Replace with ...
3751 (pushdecl_outermost_localscope): ... this.
3752 * name-lookup.c (pushdecl_with_scope): Replace with ...
3753 (pushdecl_outermost_localscope): ... this.
3754 (pushdecl_namespace_level): Adjust.
3755 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
3756 * lambda.c (insert_capture_proxy): Likewise.
3758 * class.c (build_vtbl_initializer): Don't shadow outer variable
3761 Revert _binding -> _value change.
3762 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
3763 (get_namespace_binding, set_global_binding): ... these.
3764 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
3765 (get_namespace_binding, set_global_binding): ... these.
3766 (arg_assoc_namespace, pushdecl_maybe_friend_1,
3767 check_for_out_of_scope_variable, push_overloaded_decl_1,
3768 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
3769 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
3770 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
3771 * decl.c (poplevel): Adjust.
3772 * pt.c (make_constrained_auto): Likewise.
3774 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
3776 PR translation/80280
3777 * call.c (print_z_candidate): Fix quoting.
3779 2017-05-05 David Malcolm <dmalcolm@redhat.com>
3781 * error.c (pedwarn_cxx98): Replace report_diagnostic
3782 with diagnostic_report_diagnostic.
3784 2017-05-05 Nathan Sidwell <nathan@acm.org>
3786 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
3787 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
3788 (IDENTIFIER_NAMESPACE_VALUE): Delete.
3789 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
3791 (get_namespace_value, set_global_value): ... these.
3792 (get_global_value_if_present, is_typename_at_global_scope): Delete.
3793 * decl.c (poplevel): Use get_namespace_value.
3794 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
3795 * class.c (build_vtbl_initializer): Stash library decl in
3796 static var. Use IDENTIFIER_GLOBAL_VALUE.
3797 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
3798 do_allocate_exception, do_free_exception, build_throw): Likewise.
3799 * init.c (throw_bad_array_new_length): Likewise.
3800 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
3801 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
3802 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
3803 get_namespace_value.
3804 (set_namespace_binding_1): Rename to
3805 (set_namespace_binding): ... here.
3806 (set_global_value): New.
3807 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
3808 get_namespace_value.
3809 * pt.c (listify): Use get_namespace_value.
3811 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
3813 * lex.c (unqualified_name_lookup_error): Likewise.
3815 * class.c (alter_class): Use retrofit_lang_decl directly.
3816 * decl.c (push_local_name, dupliate_decls): Likewise.
3817 * semantics.c (omp_privatize_field): Likewise.
3819 Kill walk_namespaces.
3820 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
3821 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
3823 Kill per-namespace static_decls.
3824 * cp-tree.h (static_decls): Declare.
3825 (wrapup_globals_for_namespace,
3826 diagnose_inline_vars_for_namespace): Replace with ...
3827 (wrapup_namespace_globals): ... this.
3828 * decl.c (static_decls): Define.
3829 (wrapup_globals_for_namespace,
3830 diagnose_inline_vars_for_namespace): Replace with ...
3831 (wrapup_namespace_globals): ... this.
3832 (cxx_init_decl_processing): Initialize static_decls.
3833 * decl2.c (c_parse_final_cleanups): Adjust.
3834 * name-lookup.h (cp_binding_level): Remove static_decls member.
3835 * name-lookup.c (add_decl_to_level): Adjust.
3836 (begin_scope): Adjust.
3838 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
3841 * decl.c (reshape_init): Unconditionally return error_mark_node
3842 upon error about too many initializers.
3844 2017-05-04 Nathan Sidwell <nathan@acm.org>
3846 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
3848 2017-05-04 Martin Sebor <msebor@redhat.com>
3850 PR translation/80280
3851 * call.c (print_z_candidate): Add missing quoting to %D and other
3853 (build_op_call_1): Same.
3854 * constraint.cc (diagnose_check_constraint): Same.
3855 * mangle.c (mangle_decl): Same.
3856 * name-lookup.c (cp_binding_level_debug): Same.
3857 (set_decl_namespace): Same.
3858 * parser.c (cp_parser_tx_qualifier_opt): Same.
3859 * pt.c (print_candidates_1): Same.
3860 (check_template_variable): Same.
3861 (tsubst_default_argument): Same.
3862 (most_specialized_partial_spec): Same.
3863 * semantics.c (omp_reduction_lookup): Same.
3864 * tree.c (check_abi_tag_redeclaration): Same.
3865 * typeck.c (comptypes): Same.
3866 * typeck2.c (abstract_virtuals_error_sfinae): Same.
3868 2017-05-04 Nathan Sidwell <nathan@acm.org>
3871 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
3872 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
3873 CPTI_INIT_LIST_IDENTIFIER.
3874 (global_namespace, global_type_node, global_identifier,
3875 anon_identifier, init_list_identifier): New.
3876 * decl.c (global_type_node, global_scope_name): Delete.
3877 (initialize_predefined_identifiers): Add new identifiers.
3878 (cxx_init_decl_processing): Adjust.
3879 * name-lookup.h (global_namespace, global_type_node): Delete.
3880 * name-lookup.c (global_namespace, anonymous_namespace_name,
3881 get_anonymous_namespace_name): Delete.
3882 (namespace_scope_ht_size, begin_scope, pushtag_1,
3883 push_namespace): Adjust,
3884 * call.c (type_has_extended_temps): Use init_list_identifier.
3885 * pt.c (listify): Likewise.
3887 * name-lookup.c: Reorder functions to make merging from modules
3890 2017-05-03 Jason Merrill <jason@redhat.com>
3892 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
3894 2017-05-03 Nathan Sidwell <nathan@acm.org>
3896 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
3897 along with #defines, to before name-lookup include.
3899 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
3901 * pt.c (is_auto_or_concept): Remove.
3902 (type_uses_auto_or_concept): Remove, unused.
3903 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
3904 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
3905 * cp-tree.h (is_auto_or_concept): Remove.
3907 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
3910 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
3911 add pedigree operation and detach call here.
3912 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
3913 cilk_cp_gimplify_call_params_in_spawned_fn.
3914 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
3915 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
3917 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
3919 * parser.c (cp_parser_member_declaration): Add fix-it hints for
3920 stray comma and missing semicolon at end of member declaration.
3922 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
3924 * parser.c (cp_parser_cast_expression): Add target type of cast to
3926 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
3928 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
3930 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
3931 return type to bool.
3932 * cp-tree.h (grok_ctor_properties): Update.
3934 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
3936 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
3937 information to diagnostic of invalid colon in nested-name-specifier.
3939 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
3941 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
3942 diagnostic of invalid class/struct keyword after enum.
3944 2017-04-25 David Malcolm <dmalcolm@redhat.com>
3946 * parser.c (cp_parser_member_declaration): Add fix-it hint
3947 for removing stray semicolons.
3949 2017-04-25 David Malcolm <dmalcolm@redhat.com>
3951 * name-lookup.c (get_std_name_hint): New function.
3952 (maybe_suggest_missing_header): New function.
3953 (suggest_alternative_in_explicit_scope): Call
3954 maybe_suggest_missing_header.
3956 2017-04-25 David Malcolm <dmalcolm@redhat.com>
3959 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
3960 candidate type of bm from tree to const char *.
3961 (consider_binding_level): Likewise.
3962 (lookup_name_fuzzy): Likewise, using this to merge the best
3963 result from the preprocessor into bm, rather than immediately
3964 returning, so that better matches from reserved words can "win".
3965 Guard the rejection of keywords that don't start decl-specifiers
3966 so it only happens for FUZZY_LOOKUP_TYPENAME.
3968 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
3970 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
3971 (start_enum): Likewise.
3972 (build_enumerator): Likewise. Use %qE instead of plain %E.
3973 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
3974 %<%D%> in diagnostics.
3975 (cp_parser_elaborated_type_specifier): Likewise.
3976 * pt.c (make_pack_expansion): Use %qT and %qE instead of
3977 %<%T%> and %<%E%> in diagnostics.
3978 (tsubst_pack_expansion): Likewise.
3980 2017-04-24 David Malcolm <dmalcolm@redhat.com>
3983 * parser.c (cp_parser_unary_expression): Generate a location
3984 range for alignof and sizeof expressions.
3986 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
3988 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
3990 (cp_parser_virt_specifier_seq_opt): Likewise.
3991 (set_and_check_decl_spec_loc): Likewise twice.
3993 2017-04-21 Jason Merrill <jason@redhat.com>
3995 PR c++/80179 - ICE with initialized flexible array member.
3996 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
3998 2017-04-21 Richard Biener <rguenther@suse.de>
4000 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
4001 (copy_type): Likewise.
4002 * lex.c (copy_decl): Pass down mem-stat info.
4003 (copy_type): Likewise.
4005 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
4008 * init.c (build_new_1): Suppress notes about over-aligned new when
4009 the warning is suppressed.
4011 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
4013 * parser.c (cp_parser_member_declaration): Add warning with fixit
4014 information for extra semicolon after in-class function definition.
4016 2017-04-20 Jakub Jelinek <jakub@redhat.com>
4019 * tree.c (build_cplus_array_type): Call build_array_type
4020 with the intended TYPE_TYPELESS_STORAGE flag value, instead
4021 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
4024 2017-04-18 Marek Polacek <polacek@redhat.com>
4026 PR c++/80244 - ICE with attribute in template alias.
4027 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
4029 PR c++/80241 - ICE with alignas pack expansion.
4030 * error.c (dump_expr): Handle TREE_LIST.
4031 * parser.c (cp_parser_std_attribute_list): Return error_mark if
4032 make_pack_expansion returns an error.
4034 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
4037 * class.c (fixup_may_alias): Fix all type variants.
4039 2017-04-17 Jason Merrill <jason@redhat.com>
4041 PR c++/80415 - wrong error with default arg and array reference.
4042 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
4044 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
4046 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
4048 * decl.c (name_unnamed_type): Split out of...
4049 (grokdeclarator): ... this.
4050 * decl.h (name_unnamed_type): Declare.
4052 2017-04-12 Richard Biener <rguenther@suse.de>
4053 Bernd Edlinger <bernd.edlinger@hotmail.de>
4056 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
4057 for arrays of character or std::byte type.
4059 2017-04-11 Jason Merrill <jason@redhat.com>
4061 PR c++/80294 - ICE with constexpr and inheritance.
4062 * constexpr.c (reduced_constant_expression_p):
4063 A null constructor element is non-constant.
4064 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
4065 returning an empty base.
4067 2017-04-11 Jakub Jelinek <jakub@redhat.com>
4070 * decl.c (cp_finish_decomp): If processing_template_decl on
4071 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
4072 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
4073 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
4075 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
4076 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
4079 2017-04-11 Jakub Jelinek <jakub@redhat.com>
4082 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
4084 2017-04-10 Jakub Jelinek <jakub@redhat.com>
4087 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
4088 operand, if it is a static member function, recurse on the
4091 2017-04-10 Marek Polacek <polacek@redhat.com>
4094 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
4095 ORIG_TYPE earlier and not only when shortening.
4097 2017-04-07 Jason Merrill <jason@redhat.com>
4099 PR c++/80356 - ICE with reference to function template argument.
4101 * pt.c (convert_nontype_argument_function): Adjust type even with a
4102 value-dependent argument.
4104 PR c++/80267 - ICE with nested capture of reference
4106 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
4108 2017-04-07 Marek Polacek <polacek@redhat.com>
4111 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
4114 * call.c (build_over_call): Don't check cxx_dialect.
4115 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
4116 whether SUB is a CONSTRUCTOR.
4117 * init.c (build_new_1): Don't check cxx_dialect.
4118 * tree.c (replace_placeholders): Add a function comment. Return if
4119 not in C++14, or if the object isn't a (member of a) class.
4120 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
4121 TYPE is CLASS_TYPE_P.
4123 2017-04-05 Jakub Jelinek <jakub@redhat.com>
4126 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
4127 of a loop doing vec_safe_push of NULL. Formatting fixes.
4128 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
4129 to newidx before calling canonical_type_parameter on newtype.
4131 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
4134 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
4135 UNARY_PLUS_EXPR case.
4137 2017-04-03 Jason Merrill <jason@redhat.com>
4139 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
4141 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
4143 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
4144 * decl2.c (one_static_initialization_or_destruction): Likewise.
4145 * name-lookup.c (store_bindings): Likewise.
4146 * parser.c (make_call_declarator): Likewise.
4147 * pt.c (check_explicit_specialization): Likewise.
4149 2017-04-03 Jason Merrill <jason@redhat.com>
4151 PR sanitizer/79993 - ICE with VLA initialization from string
4152 PR c++/69487 - wrong VLA initialization from string
4153 * init.c (finish_length_check): Split out from build_vec_init.
4154 (build_vec_init): Handle STRING_CST.
4155 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
4156 (digest_init_r): Don't give a STRING_CST VLA type.
4158 2017-03-31 Jakub Jelinek <jakub@redhat.com>
4161 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
4162 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
4163 for NOP_EXPR to REFERENCE_TYPE.
4166 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
4167 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
4169 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
4170 Remove extraneous parens.
4171 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
4172 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
4173 (cp_parser_trait_expr): Likewise.
4175 2017-03-27 Jakub Jelinek <jakub@redhat.com>
4178 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
4179 * typeck.c (cxx_mark_addressable): Likewise. Look through
4180 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
4182 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
4184 2017-03-24 Jason Merrill <jason@redhat.com>
4186 PR c++/77339 - ICE with invalid use of alias template.
4187 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
4190 2017-03-24 Marek Polacek <polacek@redhat.com>
4193 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
4194 doesn't have side effects.
4196 2017-03-23 Jason Merrill <jason@redhat.com>
4198 PR c++/80150 - ICE with overloaded variadic deduction.
4199 * pt.c (try_one_overload): Remove asserts.
4201 PR c++/77563 - missing ambiguous conversion error.
4202 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
4204 2017-03-23 Marek Polacek <polacek@redhat.com>
4206 * cp-tree.h: Remove a C_RID_YYCODE reference.
4208 2017-03-22 Jakub Jelinek <jakub@redhat.com>
4211 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
4212 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
4213 processing_template_decl.
4215 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
4218 * name-lookup.c (pushtag_1): Add check for bogus, non template,
4219 std::initializer_list.
4221 2017-03-21 Jakub Jelinek <jakub@redhat.com>
4224 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
4226 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
4229 * init.c (std_placement_new_fn_p): New.
4230 (build_new_1): Call it.
4232 2017-03-20 Jason Merrill <jason@redhat.com>
4234 PR c++/80096 - ICE with C++17 non-type auto.
4235 * pt.c (tsubst): Delay tsubst of type of template non-type
4238 PR c++/79519 - ICE with deleted template friend.
4239 * decl.c (grokdeclarator): Complain about misplaced function
4240 definition using =, as well.
4242 PR c++/79640 - infinite recursion with generic lambda.
4243 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
4244 before substituting its initializer.
4246 2017-03-20 Marek Polacek <polacek@redhat.com>
4247 Paolo Carlini <paolo.carlini@oracle.com>
4249 PR c++/80059 - ICE with noexcept and __transaction_atomic
4250 * except.c (build_must_not_throw_expr): Call
4251 instantiate_non_dependent_expr.
4253 2017-03-19 Jason Merrill <jason@redhat.com>
4255 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
4256 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
4257 reference decomposition.
4259 PR c++/80077 - error with constexpr and -fno-elide-constructors.
4260 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
4261 expanding trivial constructor.
4263 2017-03-17 Jason Merrill <jason@redhat.com>
4265 PR c++/78345 - ICE initializing array from lambda.
4266 * init.c (build_aggr_init): Check array initializer.
4267 (build_vec_init): Check the type of a CONSTRUCTOR.
4269 PR c++/80073 - C++17 ICE with virtual base.
4270 * decl.c (xref_basetypes): Also check for indirect vbases.
4272 2017-03-16 Jason Merrill <jason@redhat.com>
4274 * decl.c (start_enum): std::byte aliases anything.
4277 * constexpr.c (lookup_placeholder): Tweak.
4279 2017-03-15 Jason Merrill <jason@redhat.com>
4281 PR c++/80043 - ICE with -fpermissive
4282 * typeck.c (convert_for_assignment): Handle instantiate_type
4283 not giving an error.
4285 2017-03-14 Nathan Sidwell <nathan@acm.org>
4287 PR c++/79393 DR 1658 workaround
4288 * method.c (synthesized_method_base_walk): Inihibit abstract class
4289 virtual base access check here.
4290 (synthesized_method_walk): Not here.
4292 2017-03-13 Nathan Sidwell <nathan@acm.org>
4294 PR c++/79393 DR 1658 workaround
4295 * method.c (synthesized_method_walk): Check vbases of abstract
4296 classes for dtor walk.
4298 2017-03-10 David Malcolm <dmalcolm@redhat.com>
4300 PR translation/79848
4301 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
4303 2017-03-10 Jason Merrill <jason@redhat.com>
4305 PR c++/79960 - alias templates and partial ordering
4306 * pt.c (comp_template_args): Add partial_order parm.
4307 (template_args_equal): Likewise.
4308 (comp_template_args_porder): New.
4309 (get_partial_spec_bindings): Use it.
4311 2017-03-10 Marek Polacek <polacek@redhat.com>
4314 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
4316 2017-03-10 Jakub Jelinek <jakub@redhat.com>
4319 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
4320 Use XALLOCAVEC macro.
4323 * decl.c (finish_enum_value_list): If value is error_mark_node,
4324 don't copy it and change its type.
4325 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
4326 of CONST_DECL is error_mark_node.
4328 2017-03-09 Marek Polacek <polacek@redhat.com>
4330 PR c++/79900 - ICE in strip_typedefs
4331 * tree.c (strip_typedefs): Skip the attribute handling if T is
4332 a variant type which hasn't been updated yet.
4334 PR c++/79687 - wrong code with pointer-to-member
4335 * init.c (constant_value_1): Break if the variable has a dynamic
4338 2017-03-08 Jason Merrill <jason@redhat.com>
4340 PR c++/79797 - ICE with self-reference in array DMI.
4341 * constexpr.c (lookup_placeholder): Split out...
4342 (cxx_eval_constant_expression): ...from here.
4344 2017-03-07 Jakub Jelinek <jakub@redhat.com>
4347 * parser.c (cp_parser_omp_cancellation_point,
4348 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
4349 cp_parser_omp_target_update): Change "may only be used in compound
4350 statements" diagnostics, such that the same translatable string is
4351 used for all pragmas.
4352 (cp_parser_pragma): Likewise. Use error_at instead of
4353 cp_parser_error for that diagnostics.
4355 2017-03-06 Marek Polacek <polacek@redhat.com>
4357 PR c++/79796 - ICE with NSDMI and this pointer
4358 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
4359 replace_placeholders.
4361 2017-03-06 Jakub Jelinek <jakub@redhat.com>
4364 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
4367 2017-03-06 Jason Merrill <jason@redhat.com>
4369 Revert "Allow deduction guides to look into primary template."
4370 * cp-tree.h, parser.c, pt.c, search.c: Revert.
4372 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
4375 * except.c (build_must_not_throw_expr): Perform the implicit
4376 conversions on the condition.
4378 2017-03-03 Jason Merrill <jason@redhat.com>
4380 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
4383 Core issues 2273 and 2277
4384 * call.c (joust): Adjust using-declaration tiebreaker to handle
4385 the intermediate base case.
4386 * method.c (strip_inheriting_ctors): Just return the argument if
4387 !flag_new_inheriting_ctors.
4389 2017-03-03 Richard Biener <rguenther@suse.de>
4392 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
4394 2017-03-03 Marek Polacek <polacek@redhat.com>
4397 * typeck.c (string_conv_p): In C++11, always call pedwarn with
4400 2017-03-02 Jason Merrill <jason@redhat.com>
4402 Update overload resolution with deduction guides.
4403 * pt.c (do_class_deduction): Always build the copy guide.
4404 (copy_guide_p, template_guide_p): New.
4405 (build_deduction_guide): Remember the original constructor.
4406 * call.c (joust): Prefer the copy guide and non-template guides.
4408 Allow deduction guides to look into primary template.
4409 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
4410 (struct cp_decl_specifier_seq): Add constructor_p.
4411 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
4412 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
4413 Clear deduction_guide_type. Don't handle deduction guide names.
4414 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
4415 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
4416 (cp_parser_member_declaration, cp_parser_cache_defarg)
4417 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
4418 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
4419 (build_deduction_guide): Set deduction_guide_type.
4420 (dependent_scope_p): Check deduction_guide_type.
4421 * search.c (lookup_member): Likewise.
4423 2017-03-02 Jakub Jelinek <jakub@redhat.com>
4426 * init.c (mark_exp_read_r): New function.
4427 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
4428 whole arguments instead of plain mark_exp_read on TREE_LIST values.
4430 2017-03-01 Jason Merrill <jason@redhat.com>
4432 Class template argument deduction in new-expression
4433 * init.c (build_new): Handle deduction from no initializer.
4434 * parser.c (cp_parser_new_expression): Don't require a single
4435 expression for class template deduction.
4436 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
4437 class template placeholder.
4438 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
4439 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
4440 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
4442 2017-03-01 Jakub Jelinek <jakub@redhat.com>
4445 * init.c (emit_mem_initializers): When not constructing vbases of
4446 abstract classes, mark arguments as read for
4447 -Wunused-but-set-parameter.
4449 2017-02-28 Jason Merrill <jason@redhat.com>
4451 Class template argument deduction refinements
4452 * call.c (joust): Move deduction guide tiebreaker down.
4453 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
4454 deduction with no initializer.
4455 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
4456 (do_class_deduction): Use that rather than special case.
4457 (do_auto_deduction): Handle null initializer.
4459 2017-02-28 Jakub Jelinek <jakub@redhat.com>
4461 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
4462 instead of just cond ? "..." : "...".
4463 (grokdeclarator): Likewise.
4464 (build_enumerator): Likewise.
4465 * init.c (build_new_1): Likewise.
4466 * call.c (build_new_method_call_1): Likewise.
4467 * parser.c: Include intl.h.
4468 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
4469 "enter"/"exit" keyword.
4470 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
4473 2017-02-27 Jason Merrill <jason@redhat.com>
4475 PR c++/71568 - SFINAE forming pointer to member function
4476 * init.c (build_offset_ref): Check the return value of
4477 perform_or_defer_access_check.
4479 2017-02-27 Marek Polacek <polacek@redhat.com>
4481 * decl.c (expand_static_init): Add missing } in a comment.
4483 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
4485 * init.c: Include intl.h.
4486 (build_new_1): Move message strings into pedwarn to make them
4487 -Wformat-security friendly. Mark string for translation.
4488 * pt.c (tsubst_copy_and_build): Mark string for translation.
4489 Make the pointer const.
4490 * semantics.c (finish_id_expression): Mark strings for translation.
4492 2017-02-25 Jakub Jelinek <jakub@redhat.com>
4494 * call.c (build_op_delete_call): Make msg1 and msg2 const.
4496 2017-02-24 Jakub Jelinek <jakub@redhat.com>
4499 * call.c (build_over_call): Call check_function_arguments even for
4500 -Wrestrict, adjust check_function_arguments caller.
4501 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
4503 * typeck.c (cp_build_function_call_vec): Adjust
4504 check_function_arguments caller.
4506 2017-02-24 Marek Polacek <polacek@redhat.com>
4508 PR translation/79705
4509 * decl.c (check_redeclaration_exception_specification): Mark a string
4510 for translation. Make the pointer const.
4512 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
4515 * pt.c (register_specialization): Check duplicate_decls return value
4516 for error_mark_node and pass it back.
4518 2017-02-22 Jason Merrill <jason@redhat.com>
4520 PR c++/79679 - missing destructor for argument
4521 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
4524 * pt.c (do_class_deduction): Handle 0 argument case.
4526 2017-02-22 Jakub Jelinek <jakub@redhat.com>
4529 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
4530 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
4531 * constexpr.c (potential_constant_expression_1): Handle
4532 OMP_*, OACC_* and CILK_* trees. Use error_at with
4533 EXPR_LOC_OR_LOC (t, input_location) computed early
4534 instead of error, or error_at with location_of (t).
4536 2017-02-22 Marek Polacek <polacek@redhat.com>
4539 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
4540 if the alignas expression is erroneous.
4541 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
4545 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
4547 2017-02-21 Jason Merrill <jason@redhat.com>
4549 PR c++/50308 - wrong deprecated warning with ADL
4550 PR c++/17729 - duplicate deprecated warning
4551 * semantics.c (finish_id_expression): Only call mark_used on a
4552 function if we aren't building a call.
4554 PR c++/41727 - ICE with partial spec of partial instantiation
4555 * pt.c (process_partial_specialization): For now, don't check more
4556 specialized if there is more than one level of args.
4558 2017-02-21 Marek Polacek <polacek@redhat.com>
4561 * cp-tree.h (maybe_reject_flexarray_init): Declare.
4562 * init.c (maybe_reject_flexarray_init): No longer static.
4563 Add check for current_function_decl.
4564 * parser.c (cp_parser_late_parse_one_default_arg): Reject
4565 a default mem-initializer for a flexible array.
4567 2017-02-21 Jakub Jelinek <jakub@redhat.com>
4568 Paolo Carlini <paolo.carlini@oracle.com>
4571 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
4573 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
4574 decl after the decomposition artificial decl has error_mark_node.
4575 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
4576 instead of just == error_mark_node comparison.
4578 2017-02-21 Jakub Jelinek <jakub@redhat.com>
4581 * decl.c: Include gimplify.h.
4582 (cp_finish_decomp): Make sure there is no sharing of trees
4583 in between DECL_VALUE_EXPR of decomposition decls.
4586 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
4589 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
4590 call cplus_expand_constant on it first.
4592 2017-02-19 Jason Merrill <jason@redhat.com>
4594 PR c++/78139 - destructor needed by new-expression
4595 * call.c (build_special_member_call): Use tf_no_cleanup.
4597 PR c++/78282 - auto template and pack expansion
4598 * pt.c (find_parameter_packs_r): Don't walk into the type of
4599 templates other than template template-parameters.
4601 PR c++/79606 - ICE with this->base_member in NSDMI
4602 * class.c (build_base_path): Check processing_template_decl.
4604 PR c++/79607 - ICE with T{} initializer
4605 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
4607 PR c++/79566 - elaborated-type-specifier in range for
4608 * parser.c (cp_parser_simple_declaration): Fix check for type
4611 PR c++/79400 - confusing suggestion of 'noexcept'
4612 * parser.c (cp_parser_exception_specification_opt): Remove
4613 suggestion for deprecated dynamic exception-specification.
4615 PR c++/79470 - partial ordering with reference parameters
4616 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
4618 PR c++/79500 - ICE with non-template deduction guide
4619 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
4620 DECL_TEMPLATE_RESULT.
4622 PR c++/79580 - ICE with compound literal
4623 * parser.c (cp_parser_class_head): If we're in the middle of an
4624 expression, use ts_within_enclosing_non_class.
4626 PR c++/79503 - inherited ctor taking base class
4627 * call.c (add_function_candidate): Also check that
4628 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
4630 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
4633 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
4636 2017-02-19 Eric Fiselier <eric@efcs.ca>
4637 Jonathan Wakely <jwakely@redhat.com>
4640 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
4641 control warning about literal suffix identifiers without a leading
4644 2017-02-17 Jason Merrill <jason@redhat.com>
4646 PR c++/79508 - lookup error with member template
4647 * parser.c (cp_parser_template_name): Clear
4648 parser->context->object_type if we aren't doing lookup.
4650 PR c++/78690 - ICE with using and global type with same name
4651 * pt.c (type_dependent_object_expression_p): True for
4654 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
4655 * pt.c (convert_template_argument): Just return an auto arg pack.
4656 (tsubst_template_args): Don't tsubst an auto pack type.
4658 PR c++/79556 - C++17 ICE with non-type auto
4659 * pt.c (do_auto_deduction): Don't try to deduce from null type.
4661 PR c++/79533 - C++17 ICE with temporary cast to reference
4662 * call.c (build_over_call): Conversion to a reference prevents copy
4665 2017-02-16 Jakub Jelinek <jakub@redhat.com>
4666 Jason Merrill <jason@redhat.com>
4668 PR c++/79502 - lost nodiscard attribute
4669 * pt.c (apply_late_template_attributes): Do apply non-dependent
4670 attributes to types.
4672 2017-02-16 Jason Merrill <jason@redhat.com>
4674 PR c++/78572 - ICE with self-modifying array initializer
4675 * constexpr.c (cxx_eval_store_expression): The object we're
4676 initializing is outside the constant-expression.
4677 (cxx_eval_call_expression): Set ctx->call.
4679 PR c++/79050 - ICE with undeduced auto and LTO
4680 * decl.c (poplevel): Remove undeduced auto decls.
4682 2017-02-16 Jakub Jelinek <jakub@redhat.com>
4685 * parser.c (cp_parser_omp_target): For -fopenmp-simd
4686 ignore #pragma omp target even when not followed by identifier.
4688 2017-02-15 Jason Merrill <jason@redhat.com>
4689 Jakub Jelinek <jakub@redhat.com>
4691 PR c++/79464 - ICE in IPA with omitted constructor parms
4692 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
4693 (adjust_clone_args): Adjust.
4694 (add_method): Remember omitted parms.
4695 * call.c (add_function_candidate): Likewise.
4696 * mangle.c (write_method_parms): Likewise.
4697 * method.c (ctor_omit_inherited_parms): Return false if there are no
4700 2017-02-15 Martin Sebor <msebor@redhat.com>
4703 * init.c (maybe_reject_flexarray_init): New function.
4704 (perform_member_init): Call it.
4706 2017-02-15 Jakub Jelinek <jakub@redhat.com>
4709 * parser.c (cp_parser_std_attribute): Don't pedwarn about
4710 [[deprecated]] with -std=c++11 and [[fallthrough]] with
4711 -std=c++11 and -std=c++14.
4714 * decl.c (grokdeclarator): For static data members, handle thread_p
4715 only after handling inline.
4717 2017-02-14 Marek Polacek <polacek@redhat.com>
4721 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
4722 clobbering if the postfix expression isn't an EXPR_P.
4724 2017-02-13 Jason Merrill <jason@redhat.com>
4726 PR c++/79461 - ICE with lambda in constexpr constructor
4727 * constexpr.c (build_data_member_initialization): Ignore
4728 initialization of a local variable.
4730 2017-02-13 Jakub Jelinek <jakub@redhat.com>
4732 * init.c (warn_placement_new_too_small): Add missing space in
4734 * parser.c (cp_parser_oacc_declare): Likewise.
4735 * mangle.c (maybe_check_abi_tags): Likewise.
4738 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
4739 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
4740 in the rightmost operand.
4742 2017-02-13 Nathan Sidwell <nathan@acm.org>
4744 PR c++/79296 - ICE mangling localized template instantiation
4745 * decl2.c (determine_visibility): Use template fn context for
4746 local class instantiations.
4748 2017-02-11 Jason Merrill <jason@redhat.com>
4750 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
4751 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
4752 (build_new_1): Use replace_placeholders.
4753 * tree.c (replace_placeholders_t): Also track whether we've seen a
4755 (replace_placeholders, replace_placeholders_r): Adjust.
4756 * cp-tree.h: Adjust.
4758 PR c++/77790 - ICE with auto function in C++11 mode
4759 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
4760 (require_deduced_type): Add complain parm, return bool.
4761 * cp-tree.h: Adjust.
4762 * decl2.c (mark_used): Use require_deduced_type.
4764 2017-02-10 Jason Merrill <jason@redhat.com>
4766 PR c++/78908 - template ops and bitfields
4767 * tree.c (build_min_non_dep): Use unlowered_expr_type.
4769 PR c++/78897 - constexpr union
4770 * constexpr.c (cxx_eval_store_expression): A store to a union member
4771 erases a previous store to another member.
4773 PR c++/71285 - member of fold-expression
4774 * semantics.c (finish_unary_fold_expr)
4775 (finish_binary_fold_expr): Use null type for fold-expressions.
4777 PR c++/79401 - protected inherited constructor
4778 * call.c (enforce_access): For inheriting constructor, find a base
4779 binfo in the path we already have.
4781 2017-02-10 Marek Polacek <polacek@redhat.com>
4784 * pt.c (type_dependent_expression_p): Check if the expression type
4788 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
4789 if warnings shouldn't be given.
4791 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
4794 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
4795 an error_mark_node as type.
4797 2017-02-09 Jakub Jelinek <jakub@redhat.com>
4798 Jason Merrill <jason@redhat.com>
4801 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
4802 from pattern to type.
4804 2017-02-09 Jason Merrill <jason@redhat.com>
4806 PR c++/79316 - default argument in deduction guide
4807 PR c++/79350 - explicit deduction guide
4808 * parser.c (cp_parser_constructor_declarator_p)
4809 (cp_parser_direct_declarator): Parse deduction guides more like
4811 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
4812 * tree.c (special_function_p): Return it.
4813 * decl.c (check_special_function_return_type): Handle it.
4814 (grokdeclarator, grokfndecl): Adjust.
4815 (cp_finish_decl): Pass flags to do_auto_deduction.
4816 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
4817 * pt.c (dguide_name_p): Take a const_tree.
4818 (do_class_deduction): Handle explicit.
4819 (do_auto_deduction): Pass flags through.
4820 (build_deduction_guide): Copy explicit flag.
4822 2017-02-09 Jakub Jelinek <jakub@redhat.com>
4825 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
4826 non-pragma_compound context here.
4827 (cp_parser_omp_target): Likewise.
4828 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
4829 parsing for ordered and target omp pragmas in non-pragma_stmt
4830 non-pragma_compound contexts.
4833 * parser.c (cp_parser_oacc_declare): Formatting fix.
4834 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
4835 automatic variables.
4837 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
4838 Chung-Lin Tang <cltang@codesourcery.com>
4840 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
4841 parsing. Parse constant expression. Remove semantic checking.
4842 (cp_parser_omp_clause_collapse): Disallow tile.
4843 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
4844 error about missing for after already emitting one. Use more
4845 conventional for idiom for unbounded loop.
4846 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
4847 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
4848 (finish_omp_for): Deal with tile clause.
4850 2017-02-07 Nathan Sidwell <nathan@acm.org>
4852 * method.c (synthesized_method_base_walk): New. Broken out of ...
4853 (synthesized_method_walk): ... here. Call it. Cleanup
4856 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
4859 * typeck2.c (process_init_constructor_union): Consider only
4860 FIELD_DECLs when looking for an NSDMI.
4862 2017-02-06 Jason Merrill <jason@redhat.com>
4864 PR c++/71193 - incomplete types in templates
4865 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
4866 handle incomplete type by pedwarning and then treating as dependent.
4868 2017-02-06 Jakub Jelinek <jakub@redhat.com>
4871 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
4872 (potential_constant_expression_1): Likewise.
4875 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
4876 allow one fewer than expected arguments if flag_permissive.
4879 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
4880 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
4881 with error_mark_node type.
4883 2017-02-03 Jason Merrill <jason@redhat.com>
4885 PR c++/78689 - ICE on constructor with label
4886 * optimize.c (maybe_clone_body): Replace omitted parameters with
4888 * class.c (build_clone): Fix logic for omitting inherited parms.
4890 PR c++/12245 - excessive memory use
4891 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
4892 back in. Don't cache constants.
4893 (maybe_constant_init): Don't cache constants.
4895 PR c++/79294 - ICE with invalid template argument
4896 * pt.c (convert_nontype_argument_function): Check value-dependence.
4897 (convert_nontype_argument): Don't check it here for function ptrs.
4899 2017-02-02 Richard Biener <rguenther@suse.de>
4902 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
4903 it lazily on the first changed element only and copy it
4904 fully upfront, only storing changed elements.
4906 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
4909 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
4912 2017-01-31 Jakub Jelinek <jakub@redhat.com>
4915 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
4918 2017-01-31 David Malcolm <dmalcolm@redhat.com>
4921 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
4922 any namespace aliases.
4924 2017-01-31 Nathan Sidwell <nathan@acm.org>
4927 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
4931 * pt.c: (instantiate_decl): Push to top level when current
4932 function scope doesn't match. Only push lmabda scope stack when
4935 * cp-tree.h (instantiate_decl): Make defer_ok bool.
4936 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
4937 (instantiate_decl): Simplify and reorder state saving and restoration.
4940 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
4941 * semantics.c (finish_member_declaration): Assert class is being
4944 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
4946 Introduce C++ support in libcc1.
4947 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
4948 (ansi_opname): Rename to...
4949 (cp_operator_id): ... this. Adjust all callers.
4950 (ansi_assopname): Rename to...
4951 (cp_assignment_operator_id): ... this. Adjust all callers.
4952 (cp_literal_operator_id): Declare.
4953 (set_global_friend): Declare.
4954 (is_global_friend): Declare.
4955 (enum cp_oracle_request): New type.
4956 (cp_binding_oracle_function): New type.
4957 (cp_binding_oracle): Declare.
4958 (cp_finish_injected_record_type): Declare.
4959 * friend.c (global_friend): New var.
4960 (set_global_friend): New fn.
4961 (is_global_friend): New fn.
4962 (is_friend): Call is_global_friend.
4963 * name-lookup.c (cp_binding_oracle): New var.
4964 (query_oracle): New fn.
4965 (qualified_lookup_using_namespace): Call query_oracle.
4966 (lookup_name_real_1): Likewise.
4967 * parser.c (cp_literal_operator_id): Drop static.
4968 * search.c (friend_accessible_p): Call is_global_friend.
4969 * semantics.c (is_this_parameter): Accept a variable if the
4970 binding oracle is enabled.
4972 2017-01-27 Jason Merrill <jason@redhat.com>
4974 PR c++/78771 - ICE with inherited constructor.
4975 * call.c (build_over_call): Call deduce_inheriting_ctor here.
4976 * pt.c (tsubst_decl): Not here.
4977 * class.c (add_method): Or here.
4978 * method.c (deduce_inheriting_ctor): Handle clones.
4979 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
4981 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
4984 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
4986 * cp/cp-tree.h: Declare it.
4987 * cp/semantics.c (finish_id_expression): Resolve names within a default
4988 capturing generic lambda defined within a template prior to
4989 instantiation to allow for captures to be added to the closure type.
4991 2017-01-26 Jakub Jelinek <jakub@redhat.com>
4994 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
4995 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
4996 * parser.c (cp_parser_builtin_offsetof): Pass result of
4997 build_static_cast of null_pointer_node to finish_offsetof.
4998 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
4999 it for -Winvalid-offsetof pedwarn instead of trying to guess
5000 original offsetof type from EXPR. Save OBJECT_PTR as a new
5001 second operand to OFFSETOF_EXPR.
5002 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
5003 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
5006 2017-01-26 Jason Merrill <jason@redhat.com>
5008 * name-lookup.c (parse_using_directive): Deprecate strong using.
5010 PR c++/79176 - lambda ICE with -flto -Os
5011 * decl2.c (vague_linkage_p): Handle decloned 'tors.
5012 * tree.c (decl_linkage): Likewise.
5014 2017-01-25 Martin Sebor <msebor@redhat.com>
5016 * decl.c (grokdeclarator): Fix a typo in a comment.
5018 2017-01-25 Jakub Jelinek <jakub@redhat.com>
5021 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
5025 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
5026 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
5028 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
5031 * decl.c (cxx_init_decl_processing): Pass main_input_filename
5032 to build_translation_unit_decl.
5034 2017-01-24 Jakub Jelinek <jakub@redhat.com>
5037 * cp-gimplify.c (cp_genericize_r): Add result of
5038 convert_from_reference on invisiref parm to p_set.
5040 2017-01-24 Nathan Sidwell <nathan@acm.org>
5042 PR c++/78469 - defaulted ctor and inaccessible dtor
5043 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
5044 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
5045 * tree.c (build_target_expr): Check tf_no_cleanup.
5047 PR c++/79118 - anon-members and constexpr
5048 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
5049 ctor decl. Recursively check anonymous members.
5050 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
5052 (explain_invalid_constexpr_fn): Likewise.
5054 2017-01-23 Nathan Sidwell <nathan@acm.org>
5056 PR c++/71710 - template using directive of field
5057 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
5060 PR c++/71406 - ICE with scope-ref'd template id exprs
5062 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
5063 before breaking up TEMPLATE_ID_EXPR.
5065 2017-01-20 Nathan Sidwell <nathan@acm.org>
5067 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
5068 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
5070 2017-01-20 David Malcolm <dmalcolm@redhat.com>
5074 * cp-tree.h (suggest_alternatives_for): Add bool param.
5075 (suggest_alternative_in_explicit_scope): New decl.
5076 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
5077 that isn't the global one, call new function
5078 suggest_alternative_in_explicit_scope, only calling
5079 suggest_alternatives_for if it fails, and disabling near match
5080 searches fort that case. When SCOPE is the global namespace,
5081 pass true for new param to suggest_alternatives_for to allow for
5083 * lex.c (unqualified_name_lookup_error): Pass true for new param
5084 to suggest_alternatives_for.
5085 * name-lookup.c (consider_binding_level): Add forward decl.
5086 (suggest_alternatives_for): Add "suggest_misspellings" param,
5087 using it to conditionalize the fuzzy name-lookup code.
5088 (suggest_alternative_in_explicit_scope): New function.
5089 * parser.c (cp_parser_primary_expression): When calling
5090 finish_id_expression, pass location of id_expression rather
5091 than that of id_expr_token.
5092 (cp_parser_id_expression): Convert local "unqualified_id" from
5093 tree to cp_expr to avoid implicitly dropping location information.
5095 2017-01-20 Marek Polacek <polacek@redhat.com>
5098 * call.c (build_conditional_expr_1): Warn about duplicated branches.
5099 * semantics.c (finish_expr_stmt): Build statement using the proper
5102 2017-01-19 Jason Merrill <jason@redhat.com>
5104 US 20 - forwarding references and class template argument deduction
5105 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
5106 * pt.c (push_template_decl_real): Set it.
5107 (maybe_adjust_types_for_deduction): Check it.
5108 (rewrite_template_parm): Copy it.
5110 US 19 - deduction guides and constructors
5111 * call.c (joust): Prefer deduction guides to constructors.
5112 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
5113 (deduction_guide_p): Check DECL_P.
5115 * decl.c (check_initializer): Always use build_aggr_init for array
5118 PR c++/79130 - decomposition and direct-initialization
5119 * init.c (build_aggr_init): Communicate direct-initialization to
5121 (build_vec_init): Check for array copy sooner.
5122 * parser.c (cp_parser_decomposition_declaration): Remove call to
5123 build_x_compound_expr_from_list.
5125 2017-01-18 Jason Merrill <jason@redhat.com>
5127 PR c++/68666 - member variable template-id
5128 * typeck.c (finish_class_member_access_expr): Handle variable
5130 * pt.c (lookup_and_finish_template_variable): No longer static.
5131 * cp-tree.h: Declare it.
5133 2017-01-18 Nathan Sidwell <nathan@acm.org>
5136 * call.c (build_over_call): When checking ellipsis conversions for
5137 an inherited ctor, make sure there is at least one conversion.
5139 2017-01-18 Jason Merrill <jason@redhat.com>
5141 PR c++/78894 - ICE with class deduction and default arg
5142 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
5144 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5147 * mangle.c (write_discriminator): Reorganize abi warning check.
5149 2017-01-18 Nathan Sidwell <nathan@acm.org>
5151 * cp-tree.h: Clarify exception spec node comment.
5152 * except.c (nothrow_spec_p): Simplify by checking node-equality.
5155 * mangle.c (write_exception_spec): Check nothrow explicitly.
5156 (write_encoding): Don't increment processing_template_decl around
5159 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5162 * mangle.c (write_template_args): Add "on" for operator names.
5164 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5167 * mangle.c (write_discriminator): Handle discriminator >= 10.
5169 2017-01-17 Nathan Sidwell <nathan@acm.org>
5172 * cp-tree.h (maybe_generic_this_capture): Declare.
5173 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
5174 (maybe_resolve_dummy): ... here. Call it.
5175 (maybe_generic_this_capture): New.
5176 * parser.c (cp_parser_postfix_expression): Speculatively capture
5177 this in generic lambda in unresolved member function call.
5178 * pt.c (tsubst_copy_and_build): Force hard error from failed
5179 member function lookup in generic lambda.
5181 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
5184 * cp-array-notation.c (expand_array_notation_exprs): Handle
5187 2017-01-11 Jason Merrill <jason@redhat.com>
5189 PR c++/78337 - ICE on invalid with generic lambda
5190 * semantics.c (process_outer_var_ref): Check if containing_function
5191 is null. Move inform call under complain test.
5193 2017-01-11 Nathan Sidwell <nathan@acm.org>
5196 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
5199 2017-01-11 Nathan Sidwell <nathan@acm.org>
5201 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
5203 2017-01-11 Jakub Jelinek <jakub@redhat.com>
5206 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
5207 assertion. Formatting fix.
5210 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
5213 2017-01-10 David Malcolm <dmalcolm@redhat.com>
5216 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
5217 a missing semicolon if we have a valid insertion location for
5220 2017-01-10 Jason Merrill <jason@redhat.com>
5222 FI 20, decomposition declaration with parenthesized initializer.
5223 * parser.c (cp_parser_decomposition_declaration): Use
5224 cp_parser_initializer.
5226 2017-01-09 Jason Merrill <jason@redhat.com>
5228 Implement P0195R2, C++17 variadic using.
5229 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
5230 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
5231 * error.c (dump_decl): Likewise.
5233 2017-01-09 Jakub Jelinek <jakub@redhat.com>
5235 PR translation/79019
5236 PR translation/79020
5237 * semantics.c (finish_omp_clauses): Add missing whitespace to
5238 translatable strings.
5239 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
5241 2017-01-07 Jason Merrill <jason@redhat.com>
5243 PR c++/78948 - instantiation from discarded statement
5244 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
5245 * cp-tree.h (in_discarded_stmt): Declare it.
5246 (struct saved_scope): Add discarded_stmt bitfield.
5247 (in_discarded_stmt): New macro.
5248 * decl2.c (mark_used): Check it.
5249 * parser.c (cp_parser_selection_statement): Adjust.
5250 (cp_parser_jump_statement): Adjust.
5252 2017-01-05 Jakub Jelinek <jakub@redhat.com>
5255 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
5256 REFERENCE_REF_P, set tt to its operand.
5259 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
5260 unions even for C++11 and later.
5262 2017-01-05 Nathan Sidwell <nathan@acm.org>
5265 * pt.c (convert_nontype_argument): Don't try and see if integral
5266 or enum expressions are constants prematurely.
5268 2017-01-04 Marek Polacek <polacek@redhat.com>
5271 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
5272 a zero character literal.
5274 2017-01-04 Jakub Jelinek <jakub@redhat.com>
5277 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
5281 * parser.c (cp_parser_simple_declaration): Only complain about
5282 inconsistent auto deduction if auto_result doesn't use auto.
5284 * parser.c (cp_parser_simple_declaration): Diagnose function
5285 declaration among more than one init-declarators with auto
5289 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
5290 assertion, as lexer->buffer may be NULL.
5292 2017-01-04 Marek Polacek <polacek@redhat.com>
5296 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
5298 2017-01-04 Nathan Sidwell <nathan@acm.org>
5301 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
5302 (lambda_capture_field_type): Update prototype.
5303 * lambda.c (lambda_capture_field_type): Add is_reference parm.
5304 Add referenceness here.
5305 (add_capture): Adjust lambda_capture_field_type call, refactor
5307 * pt.c (tsubst): Adjust lambda_capture_field_type call.
5309 2017-01-01 Jakub Jelinek <jakub@redhat.com>
5311 Update copyright years.
5313 Copyright (C) 2017 Free Software Foundation, Inc.
5315 Copying and distribution of this file, with or without modification,
5316 are permitted in any medium without royalty provided the copyright
5317 notice and this notice are preserved.