1 2017-11-27 Martin Sebor <msebor@redhat.com>
4 * init.c (warn_placement_new_too_small): Use offset_int instead of
7 2017-11-27 Jakub Jelinek <jakub@redhat.com>
10 * parser.c (cp_parser_decomposition_declaration): Reject just
11 BRACE_ENCLOSED_INITIALIZER_P initializers with nelts != 1 rather
12 than all such CONSTRUCTORs, and only if is_direct_init is true.
14 2017-11-27 Jason Merrill <jason@redhat.com>
16 * pt.c (primary_template_specialization_p): Rename from
17 primary_template_instantiation_p. Don't check
18 DECL_TEMPLATE_INSTANTIATION.
19 * call.c, cp-tree.h, decl2.c: Adjust.
21 2017-11-27 Jakub Jelinek <jakub@redhat.com>
24 * cp-gimplify.c (cp_fold) <case COND_EXPR>: Don't return immediately
25 for VOID_TYPE_P COND_EXPRs, instead fold the operands and if op0 is
26 INTEGER_CST, ensure that both op1 and op2 are non-NULL and fall
27 through into normal folding, otherwise just rebuild x if any op
30 * g++.dg/warn/pr81675.C: New test.
32 2017-11-14 Boris Kolpackov <boris@codesynthesis.com>
34 * Make-lang.in (c++.install-plugin): Install backend import library.
36 2017-11-23 Jakub Jelinek <jakub@redhat.com>
38 * parser.c (cp_parser_omp_declare): Change return type to bool from
39 void, return true for declare simd.
40 (cp_parser_pragma): Return cp_parser_omp_declare returned value
41 rather than always false.
43 2017-11-23 Mike Stump <mikestump@comcast.net>
44 Eric Botcazou <ebotcazou@adacore.com>
46 * pt.c (tsubst_expr) <ANNOTATE_EXPR>: Recurse on 3rd operand.
47 * semantics.c (finish_while_stmt_cond): Pass 3rd operand to
49 (finish_do_stmt): Likewise.
50 (finish_for_cond): Likewise.
52 2017-11-22 Jakub Jelinek <jakub@redhat.com>
55 * name-lookup.c (member_name_cmp): Return 0 if a == b.
57 2017-11-22 David Malcolm <dmalcolm@redhat.com>
60 * error.c (type_to_string): Add leading comment. Add params
61 "postprocessed", "quote", and "show_color", using them to fix
62 quoting of the "aka" for types involving typedefs.
63 (arg_to_string): Update for new params to type_to_string.
64 (cxx_format_postprocessor::handle): Likewise.
65 (cp_printer): Convert penultimate param from bool to bool *.
66 Update call to type_to_string and calls to
67 defer_phase_2_of_type_diff.
69 2017-11-22 Marek Polacek <polacek@redhat.com>
74 * class.c (layout_class_type): Set DECL_PADDING_P on padding.
75 * decl.c (cxx_init_decl_processing): Set TRANSLATION_UNIT_WARN_EMPTY_P.
76 (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.
78 2017-11-21 Martin Liska <mliska@suse.cz>
80 * class.c (finalize_literal_type_property): Add quotes for
82 (explain_non_literal_class): Likewise.
83 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
84 (is_valid_constexpr_fn): Likewise.
85 (check_constexpr_ctor_body): Likewise.
86 (register_constexpr_fundef): Likewise.
87 (explain_invalid_constexpr_fn): Likewise.
88 (cxx_eval_builtin_function_call): Likewise.
89 (cxx_eval_call_expression): Likewise.
90 (cxx_eval_loop_expr): Likewise.
91 (potential_constant_expression_1): Likewise.
92 * decl.c (check_previous_goto_1): Likewise.
93 (check_goto): Likewise.
94 (grokfndecl): Likewise.
95 (grokdeclarator): Likewise.
96 * error.c (maybe_print_constexpr_context): Likewise.
97 * method.c (process_subob_fn): Likewise.
98 (defaulted_late_check): Likewise.
99 * parser.c (cp_parser_compound_statement): Likewise.
101 2017-11-21 Marc Glisse <marc.glisse@inria.fr>
103 * constexpr.c (cxx_eval_constant_expression,
104 potential_constant_expression_1): Handle POINTER_DIFF_EXPR.
105 * cp-gimplify.c (cp_fold): Likewise.
106 * error.c (dump_expr): Likewise.
107 * typeck.c (pointer_diff): Use POINTER_DIFF_EXPR.
109 2017-11-21 Jakub Jelinek <jakub@redhat.com>
111 P0428R2 - familiar template syntax for generic lambdas
112 * parser.c (cp_parser_lambda_declarator_opt): Don't pedwarn
113 for cxx2a and above, reword pedwarn for C++14/C++17.
115 2017-11-20 David Malcolm <dmalcolm@redhat.com>
118 * name-lookup.c: Include "c-family/known-headers.h"
119 (lookup_name_fuzzy): Call get_cp_stdlib_header_for_name and
120 potentially return a new suggest_missing_header hint.
122 2017-11-20 David Malcolm <dmalcolm@redhat.com>
125 * name-lookup.c (class macro_use_before_def): New class.
126 (lookup_name_fuzzy): Detect macro that were used before being
127 defined, and report them as such.
129 2017-11-20 Jason Merrill <jason@redhat.com>
131 * decl2.c (constrain_class_visibility): Don't warn about artificial
134 2017-11-20 Jakub Jelinek <jakub@redhat.com>
136 P0329R4: Designated Initialization
137 * parser.c (cp_parser_initializer_clause): List in comment grammar
138 designated-initializer-list.
139 (cp_parser_initializer_list): Allow .identifier = without pedwarn for
140 C++2A, parse .identifier { ... }. Improve location_t argument to
141 pedwarn. Add pedwarn for [cst] = designators. Diagnose ... in
142 designated initializer list. Diagnose mixing designated and
143 non-designated initializer clauses for C++2A. Diagnose duplicated
144 identifiers in designators.
145 * name-lookup.h (search_anon_aggr): New declaration.
146 * name-lookup.c (fields_linear_search): Use search_anon_aggr.
147 (search_anon_aggr): New function.
148 * typeck2.c (process_init_constructor_record): Allow designator
149 to skip over some non-static data members. Handle anonymous
150 aggregates. Add diagnostics for designator order not matching
151 member declaration order.
153 2017-11-20 David Malcolm <dmalcolm@redhat.com>
155 * name-lookup.c: Define INCLUDE_UNIQUE_PTR before including system.h.
156 Include "c-family/name-hint.h"
157 (suggest_alternatives_for): Convert "fuzzy_name" from const char *
158 to name_hint, and rename to "hint". Pass location to
160 (lookup_name_fuzzy): Convert return type from const char *
161 to name_hint. Add location_t param.
162 * parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
163 Include "c-family/name-hint.h"
164 (cp_parser_diagnose_invalid_type_name): Convert
165 "suggestion" from const char * to name_hint, and rename to "hint".
166 Pass location to lookup_name_fuzzy.
168 2017-11-20 Nathan Sidwell <nathan@acm.org>
172 * call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited
174 * cp-gimplify.c (cp_genericize_r): Restore THUNK dereference
175 inhibibition check removed in previous c++/78495 change.
177 2017-11-20 Jakub Jelinek <jakub@redhat.com>
180 * constexpr.c (cxx_eval_vector_conditional_expression): New function.
181 (cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
182 of cxx_eval_conditional_expression.
184 2017-11-19 Jakub Jelinek <jakub@redhat.com>
188 * cp-gimplify.c (c_fully_fold): Add LVAL argument, call
189 cp_fold_maybe_rvalue instead of cp_fold_rvalue and pass it !LVAL.
191 2017-11-16 Jason Merrill <jason@redhat.com>
193 PR c++/79092 - non-type args of different types are different
194 * tree.c (cp_tree_equal): Check the type of constants.
195 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Handle UNIFY_ALLOW_INTEGER
196 when comparing to previously deduced argument.
197 (maybe_convert_nontype_argument): New.
198 (convert_nontype_argument): Call it.
199 (tsubst_copy_and_build): Handle partial instantiation of
201 (unify): Ignore type when deducing from array bound.
202 (dependent_type_p_r): Handle DEFERRED_NOEXCEPT.
203 (value_dependent_expression_p): Any type-dependent expression is
204 value-dependent. Handle IMPLICIT_CONV_EXPR.
205 * cp-tree.h (IMPLICIT_CONV_EXPR_NONTYPE_ARG): New.
206 * mangle.c (write_template_arg): Strip IMPLICIT_CONV_EXPR.
208 2017-11-16 Nathan Sidwell <nathan@acm.org>
212 * cp-objcp-common.h (LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME):
214 * cp-tree.h (overwrite_mangling): Declare.
215 * decl2.c (struct mangled_decl_hash): Entries are deletable.
216 (overwrite_mangling): New.
219 * decl.c (xref_tag_1): Push lambda into current scope.
220 * name-lookup.c (do_pushtag): Don't deal with ts_lambda here.
222 2017-11-15 Nathan Sidwell <nathan@acm.org>
225 * lambda.c (lambda_capture_field_type): Function references are
226 always catured by reference.
228 2017-11-15 Martin Liska <mliska@suse.cz>
230 * decl.c (begin_destructor_body): Use cp_build_fold_indirect_ref
231 instead of cp_build_indirect_ref.
233 2017-11-15 Martin Liska <mliska@suse.cz>
235 * decl.c (begin_destructor_body): In case of VPTR sanitization
236 (with disabled recovery), zero vptr in order to catch virtual calls
237 after lifetime of an object.
239 2017-11-14 Jason Merrill <jason@redhat.com>
241 Use GTY((cache)) on some hash tables.
242 * decl.c (decomp_type_table): Use tree_cache_map.
243 * init.c (nsdmi_inst): Likewise.
244 * pt.c (defarg_ints): Likewise.
245 * cp-objcp-common.c (cp_get_debug_type): Likewise.
247 2017-11-13 Jason Merrill <jason@redhat.com>
249 Capture adjustments for P0588R1.
250 * semantics.c (process_outer_var_ref): Capture variables when
251 they are named; complain about non-capture uses when odr-used.
252 * expr.c (mark_use): Rvalue use looks through capture proxy.
253 * constexpr.c (potential_constant_expression_1): Improve error about
254 use of captured variable.
255 * lambda.c (need_generic_capture, dependent_capture_r)
256 (do_dependent_capture, processing_nonlambda_template): Remove.
257 * call.c (build_this): Remove uses of the above.
258 * decl.c (cp_finish_decl): Likewise.
259 * semantics.c (maybe_cleanup_point_expr)
260 (maybe_cleanup_point_expr_void, finish_goto_stmt)
261 (maybe_convert_cond): Likewise.
262 * typeck.c (check_return_expr): Likewise.
265 * typeck.c (cp_build_fold_indirect_ref): New.
266 (cp_build_indirect_ref_1): Split out from cp_build_indirect_ref.
267 Add 'fold' parameter.
268 * cp-tree.h: Declare cp_build_fold_indirect_ref.
269 * call.c, class.c, cp-ubsan.c, decl.c, except.c, init.c, lambda.c,
270 parser.c, rtti.c, tree.c, typeck.c, typeck2.c: Use it.
271 * parser.c (do_range_for_auto_deduction): Use RO_UNARY_STAR.
272 (cp_convert_range_for): Likewise.
273 * typeck2.c (build_x_arrow): Use RO_ARROW.
275 * cp-ubsan.c (cp_ubsan_check_member_access_r): Fix handling of
276 INDIRECT_REF of ADDR_EXPR.
278 PR c++/82360 - ICE with static_cast in template.
279 * call.c (perform_direct_initialization_if_possible): Check
280 processing_template_decl.
281 * typeck.c (build_static_cast_1): Likewise.
283 2017-11-13 Ville Voutilainen <ville.voutilainen@gmail.com>
285 Remove the null check from placement new in all modes
286 * init.c (build_new_1): Don't do a null check for
287 a namespace-scope non-replaceable placement new
288 in any mode unless -fcheck-new is provided.
290 2017-11-07 Boris Kolpackov <boris@codesynthesis.com>
292 * Make-lang.in (CP_PLUGIN_HEADERS): Add operators.def since included
295 2017-11-07 Jakub Jelinek <jakub@redhat.com>
298 * cp-gimplify.c (cxx_omp_clause_apply_fn): For methods pass i - 1 to
299 convert_default_arg instead of i.
301 2017-11-06 Jason Merrill <jason@redhat.com>
303 P0704R1 - fixing const-qualified pointers to members
304 * typeck2.c (build_m_component_ref): Also accept in lower stds with
307 2017-11-06 Paolo Carlini <paolo.carlini@oracle.com>
310 * decl2.c (finish_static_data_member_decl): If there's an initializer,
311 complete the type and re-apply the quals.
313 2017-11-06 Martin Liska <mliska@suse.cz>
316 * constexpr.c (cxx_eval_builtin_function_call): Handle
317 __builtin_unreachable call.
318 (get_function_named_in_call): Declare function earlier.
319 (constexpr_fn_retval): Skip __builtin_unreachable.
320 * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Rename to
322 (cp_maybe_instrument_return): ... this.
323 (cp_genericize): Call the function unconditionally.
325 2017-11-03 Nathan Sidwell <nathan@acm.org>
328 * decl.c (grokdeclarator): Protect MAYBE_CLASS things from paren
331 2017-11-02 Paolo Carlini <paolo.carlini@oracle.com>
334 * pt.c (make_pack_expansion): Add tsubst_flags_t parameter.
335 (expand_integer_pack, convert_template_argument, coerce_template_parms,
336 gen_elem_of_pack_expansion_instantiation, tsubst_pack_expansion,
337 unify): Adjust calls.
338 * tree.c (cp_build_qualified_type_real): Likewise.
339 * cp-tree.h (make_pack_expansion): Adjust declaration.
341 2017-11-02 Nathan Sidwell <nathan@acm.org>
343 * cp-tree.h (IDENTIFIER_NEWDEL_OP_P): Restore, adjust.
344 (IDENTIFIER_NEW_OP_P): New.
345 * decl.c (grokdeclarator): Restore IDENTIFIER_NEWDEL_OP_P use.
346 * pt.c (push_template_decl_real): Likewise.
347 * typeck.c (check_return_expr): Use IDENTIFIER_NEW_OP_P.
350 * decl.c (grokdeclarator): Don't warn when parens protect a return
351 type from a qualified name.
353 2017-11-01 Nathan Sidwell <nathan@acm.org>
355 * cp-tree.h (enum cp_identifier_kind): Delete cik_newdel_op.
356 Renumber and reserve udlit value.
357 (IDENTIFIER_NEWDEL_OP_P): Delete.
358 (IDENTIFIER_OVL_OP_P): New.
359 (IDENTIFIER_ASSIGN_OP_P): Adjust.
360 (IDENTIFIER_CONV_OP_P): Adjust.
361 (IDENTIFIER_OVL_OP_INFO): Adjust.
362 (IDENTIFIER_OVL_OP_FLAGS): New.
363 * decl.c (grokdeclarator): Use IDENTIFIER_OVL_OP_FLAGS.
364 * lex.c (get_identifier_kind_name): Adjust.
365 (init_operators): Don't special case new/delete ops.
366 * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_P.
367 * pt.c (push_template_decl_real): Use IDENTIFIER_OVL_OP_FLAGS.
368 * typeck.c (check_return_expr): Likewise.
370 * cp-tree.h (assign_op_identifier, call_op_identifier): Use
372 (struct lang_decl_fn): Use compressed operator code.
373 (DECL_OVERLOADED_OPERATOR_CODE): Replace with ...
374 (DECL_OVERLOADED_OPERATOR_CODE_RAW): ... this.
375 (DECL_OVERLOADED_OPERATOR_CODE_IS): Use it.
376 * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE_RAW.
377 (build_library_fn): Likewise.
378 (grok_op_properties): Likewise.
379 * mangle.c (write_unqualified_name): Likewise.
380 * method.c (implicitly_declare_fn): Likewise.
381 * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_IS.
383 * cp-tree.h (IDENTIFIER_CP_INDEX): Define.
384 (enum ovl_op_flags): Add OVL_OP_FLAG_AMBIARY.
385 (enum ovl_op_code): New.
386 (struct ovl_op_info): Add ovl_op_code field.
387 (ovl_op_info): Size by OVL_OP_MAX.
388 (ovl_op_mapping, ovl_op_alternate): Declare.
389 (OVL_OP_INFO): Adjust for mapping array.
390 (IDENTIFIER_OVL_OP_INFO): New.
391 * decl.c (ambi_op_p, unary_op_p): Delete.
392 (grok_op_properties): Use IDENTIFIER_OVL_OP_INFO and
394 * lex.c (ovl_op_info): Adjust and static initialize.
395 (ovl_op_mappings, ovl_op_alternate): Define.
396 (init_operators): Iterate over ovl_op_info array and init mappings
398 * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_INFO.
399 * operators.def (DEF_OPERATOR): Remove KIND parm.
400 (DEF_SIMPLE_OPERATOR): Delete.
401 (OPERATOR_TRANSITION): Expand if defined.
403 2017-10-31 David Malcolm <dmalcolm@redhat.com>
405 * pt.c (listify): Use %< and %> for description of #include.
407 2017-10-31 David Malcolm <dmalcolm@redhat.com>
409 * class.c (explain_non_literal_class): Use UNKNOWN_LOCATION rather
411 * name-lookup.c (suggest_alternatives_for): Update for renaming of
413 (maybe_suggest_missing_header): Likewise.
414 (suggest_alternative_in_explicit_scope): Likewise.
415 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise for
416 renaming of error_at_rich_loc.
417 (cp_parser_string_literal): Likewise.
418 (cp_parser_nested_name_specifier_opt): Likewise.
419 (cp_parser_cast_expression): Likewise for renaming of
421 (cp_parser_decl_specifier_seq): Likewise for renaming of
422 error_at_rich_loc and warning_at_rich_loc.
423 (cp_parser_elaborated_type_specifier): Likewise for renaming of
425 (cp_parser_cv_qualifier_seq_opt): Likewise for renaming of
427 (cp_parser_virt_specifier_seq_opt): Likewise.
428 (cp_parser_class_specifier_1): Likewise.
429 (cp_parser_class_head): Likewise.
430 (cp_parser_member_declaration): Likewise for renaming of
431 pedwarn_at_rich_loc, warning_at_rich_loc, and error_at_rich_loc.
432 (cp_parser_enclosed_template_argument_list): Likewise for renaming
433 of error_at_rich_loc.
434 (set_and_check_decl_spec_loc): Likewise.
435 * pt.c (listify): Likewise.
436 * rtti.c (typeid_ok_p): Likewise.
437 * semantics.c (process_outer_var_ref): Use UNKNOWN_LOCATION rather
439 * typeck.c (access_failure_info::maybe_suggest_accessor): Update
440 for renaming of inform_at_rich_loc.
441 (finish_class_member_access_expr): Likewise for renaming of
444 2017-10-31 Nathan Sidwell <nathan@acm.org>
446 * cp-tree.h (struct operator_name_info_t): Rename to ...
447 (struct ovl_op_info_t): ... here. Add tree_code field.
448 (operator_name_info, assignment_operator_name_info): Delete.
449 (ovl_op_info): Declare.
450 (OVL_OP_INFO): Adjust.
451 * decl.c (grok_op_properties): Use ovl_op_flags.
452 * lex.c (operator_name_info, assignment_operator_name_info):
454 (ovl_op_info): Define.
455 (set_operator_ident): Adjust.
456 (init_operators): Set tree_code.
457 * mangle.c (write_unqualified_id): Adjust operator array scan.
459 * lex.c (init_operators): Allow NULL operator name. Don't add
461 * operators.def: Use NULL for mangling only operators. Move to
462 after regular operators but move assignment operators last.
464 * cp-tree.h (enum ovl_op_flags): New.
465 (struct operator_name_info_t): Rename arity to flags.
466 * lex.c (set_operator_ident): New.
467 (init_operators): Use it. Adjust for flags.
468 * mangle.c (write_unqualified_id): Adjust for flags.
469 * operators.def: Replace arity with flags.
471 * cp-tree.h (ovl_op_identifier): New.
472 (assign_op_identifier, call_op_identifier): Adjust.
473 (cp_operator_id, cp_assignment_operator_ide): Delete.
474 (SET_OVERLOADED_OPERATOR_CODE): Delete.
476 * call.c (op_error): Use OVL_OP_INFO.
477 (build_conditional_expr_1): Use ovl_op_identifier.
478 (build_new_op_1): Use OVL_OP_INFO & ovl_op_identifier.
479 (build_op_delete_call): Likewise.
480 * class.c (type_requires_array_cookie): Use ovl_op_identifier.
481 * decl.c (duplicate_decls): Directly copy operator code.
482 (builtin_function_1): Do not set operator code.
483 (build_library_fn): Directly set operator code.
484 (push_cp_library_fn): Use ovl_op_identifier.
485 (grok_op_properties): Directly set operator code.
486 * decl2.c (maybe_warn_sized_delete): Use ovl_op_identifier.
487 * error.c (dump_expr): Use OVL_OP_INFO.
488 (op_to_string): Add assop arg. Use OVL_OP_INFO.
489 (assop_to_string): Delete.
490 (args_to_string): Adjust.
491 * init.c (build_new_1): Use ovl_op_identifier.
492 * mangle.c (write_unqualified_name): Use OVL_OP_INFO.
493 (write_expression): Likewise.
494 * method.c (synthesized_method_walk): Use ovl_op_identifier.
495 (implicitly_declare_fn): Use assign_op_identifier. Directly set
497 * name-lookup.c (get_class_binding): Use assign_op_identifier.
498 * parser.c (cp_parser_operator): Use ovl_op_identifier.
499 (cp_parser_omp_clause_reduction): Likewise.
500 * semantics.c (omp_reduction_id): Likewise.
501 * typeck.c (cxx_sizeof_or_alignof_type): Use OVL_OP_INFO.
503 * cp-tree.h (assign_op_identifier, call_op_identifier): Define.
504 (LAMBDA_FUNCTION_P): Use DECL_OVERLOADED_OPERATOR_IS.
505 (DECL_OVERLOADED_OPERATOR_P): Just retuurn true/false.
506 (DECL_OVERLOADED_OPERATOR_CODE, DECL_OVERLOADED_OPERATOR_IS): Define.
507 * call.c (add_function_candidate): Use
508 DECL_OVERLOADED_OPERATOR_IS.
509 (build_op_call_1): Use call_op_identifier &
510 DECL_OVERLOADED_OPERATOR_IS.
511 (build_over_call): Likewise.
512 (has_trivial_copy_assign_p): Use assign_op_identifier.
513 (build_special_member_call): Likewise.
514 * class.c (dfs_declare_virt_assop_and_dtor): Likewise.
515 (vbase_has_user_provided_move_assign,
516 classtype_has_move_assign_or_move_ctor_p): Likewise.
517 * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE.
518 (grok_special_member_properties): Use assign_op_identifier.
519 (start_preparsed_function): Use DECL_OVERLOADED_OPERATOR_IS.
520 * decl2.c (mark_used): Use DECL_CONV_FN_P.
521 * dump.c (dump_access): Delete prototype.
523 (cp_dump_tree): Don't call it.
524 * lambda.c (lambda_function): Use call_op_identifier.
525 (maybe_add_lambda_conv_op): Not an overloaded operator. Remove
527 * mangle.c (write_unqualified_name): Use DECL_OVERLOADED_OPERTOR_CODE.
528 * method.c (do_build_copy_assign): Use assign_op_identifier.
529 (synthesize_method): Use DECL_OVERLOADED_OPERATOR_IS.
530 (get_copy_assign): Use assign_op_identifier.
531 (synthesized_method_walk): Likewise.
532 (defaultable_fn_check): Use DECL_OVERLOADED_OPERATOR_IS.
533 * parser.c (cp_parser_lambda_declarator_opt): Use
535 * semanitics.c (classtype_has_nothrow_assign_or_copy_p): Use
536 assign_op_identifier.
537 * tree.c (special_function_p): Use DECL_OVERLOADED_OPERATOR_IS.
538 * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_CODE.
539 (check_return_expr): Use assign_op_identifier.
541 2017-10-30 Paolo Carlini <paolo.carlini@oracle.com>
544 * pt.c (tsubst_copy_and_build, [INDIRECT_REF]): For a REFERENCE_REF_P,
545 unconditionally call convert_from_reference.
547 2017-10-30 Nathan Sidwell <nathan@acm.org>
549 * call.c (build_op_call_1): Test for FUNCTION_DECL in same manner
550 as a few lines earlier.
551 * cp-tree.h (PACK_EXPANSION_PATTERN): Fix white space.
552 * decl.c (grokfndecl): Fix indentation.
553 (compute_array_index_type): Use processing_template_decl_sentinel.
554 (grok_op_properties): Move warnings to end. Reorder other checks
555 to group similar entities. Tweak diagnostics.
556 * lex.c (unqualified_name_lookup_error): No need to check name is
557 not ERROR_MARK operator.
558 * parser.c (cp_parser_operator): Select operator code before
560 * typeck.c (check_return_expr): Fix indentation and line wrapping.
562 2017-10-27 Paolo Carlini <paolo.carlini@oracle.com>
564 * pt.c (invalid_nontype_parm_type_p): Return a bool instead of an int.
566 2017-10-26 Nathan Sidwell <nathan@acm.org>
568 * decl.c (sort_labels): Restore function.
569 (pop_labels): Sort labels
570 (identify_goto): Add translation markup.
572 2017-10-25 Nathan Sidwell <nathan@acm.org>
574 Kill IDENTIFIER_LABEL_VALUE.
575 * cp-tree.h (lang_identifier): Delete label_value slot.
576 (IDENTIFIER_LABEL_VALUE, SET_IDENTIFIER_LABEL_VALUE): Delete.
577 (struct named_label_hasher): Rename to ...
578 (struct named_label_hash): ... here. Reimplement.
579 (struct language_function): Adjust x_named_labels.
580 * name-lookup.h (struct cp_label_binding): Delete.
581 (struct cp_binding_level): Delete shadowed_labels slot.
582 * decl.c (struct named_label_entry): Add name and outer slots.
583 (pop_label): Rename to ...
584 (check_label_used): ... here. Don't pop.
585 (note_label, sort_labels): Delete.
586 (pop_labels, pop_local_label): Reimplement.
587 (poplevel): Pop local labels as any other decl. Remove
588 shadowed_labels handling.
589 (named_label_hash::hash, named_label_hash::equal): New.
590 (make_label_decl): Absorb into ...
591 (lookup_label_1): ... here. Add making_local_p arg, reimplement.
592 (lookup_label, declare_local_label): Adjust.
593 (check_goto, define_label): Adjust.
594 * lex.c (make_conv_op_name): Don't clear IDENTIFIER_LABEL_VALUE.
595 * ptree.c (cxx_print_identifier): Don't print identifier binding.
597 * decl.c (identifier_goto): Reduce duplication.
598 (check_previous_goto_1): Likewise.
599 (check_goto): Move var decls to initialization.
600 (check_omp_return, define_label_1, define_label): Likewise.
602 2017-10-25 Jakub Jelinek <jakub@redhat.com>
605 * decl.c (duplicate_decls): Copy "omp declare simd" attributes from
606 newdecl to corresponding __builtin_ if any.
608 2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
611 * decl.c (duplicate_decls): Warn for built-in functions declared as
612 non-function, use OPT_Wbuiltin_declaration_mismatch.
614 * decl.c (duplicate_decls): Avoid redundant '+' in warning_at.
616 2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
619 * pt.c (value_dependent_expression_p, [TRAIT_EXPR]): Handle
620 a TREE_LIST as TRAIT_EXPR_TYPE2.
622 2017-10-24 Mukesh Kapoor <mukesh.kapoor@oracle.com>
623 Paolo Carlini <paolo.carlini@oracle.com>
626 * cvt.c (type_promotes_to): Implement C++17, 7.6/4, about unscoped
627 enumeration type whose underlying type is fixed.
629 2017-10-23 Paolo Carlini <paolo.carlini@oracle.com>
632 * semantics.c (finish_compound_literal): Check do_auto_deduction
633 return value for error_mark_node.
635 2017-10-23 Jason Merrill <jason@redhat.com>
637 PR c++/77369 - wrong noexcept handling in C++14 and below
638 * tree.c (strip_typedefs): Canonicalize TYPE_RAISES_EXCEPTIONS.
640 2017-10-20 Nathan Sidwell <nathan@acm.org>
642 * class.c (layout_class_type): Cleanup as-base creation, determine
644 (finish_struct_1): ... not here.
646 2017-10-19 Jakub Jelinek <jakub@redhat.com>
649 * typeck.c (check_return_expr): Don't call
650 maybe_warn_about_returning_address_of_local in templates.
652 2017-10-17 Nathan Sidwell <nathan@acm.org>
655 * call.c (build_over_call): Don't pass tf_no_cleanup to nested
659 * cp-objcp-common.c (cp_tree_size): Reformat. Adjust returns size
662 2017-10-13 Jason Merrill <jason@redhat.com>
664 PR c++/82357 - bit-field in template
665 * tree.c (cp_stabilize_reference): Just return a NON_DEPENDENT_EXPR.
667 2017-10-13 David Malcolm <dmalcolm@redhat.com>
669 * cp-tree.h (maybe_show_extern_c_location): New decl.
670 * decl.c (grokfndecl): When complaining about literal operators
671 with C linkage, issue a note giving the location of the
673 * parser.c (cp_parser_new): Initialize new field
674 "innermost_linkage_specification_location".
675 (cp_parser_linkage_specification): Store the location
676 of the linkage specification within the cp_parser.
677 (cp_parser_explicit_specialization): When complaining about
678 template specializations with C linkage, issue a note giving the
679 location of the extern "C".
680 (cp_parser_explicit_template_declaration): Likewise for templates.
681 (maybe_show_extern_c_location): New function.
682 * parser.h (struct cp_parser): New field
683 "innermost_linkage_specification_location".
685 2017-10-12 Nathan Sidwell <nathan@acm.org>
687 * cp-tree.h (cp_expr): Add const operator * and operator->
689 (cp_tree_node_structure_enum): Delete TS_CP_BINDING,
690 TS_CP_WRAPPER, LAST_TS_CP_ENUM.
692 2017-10-12 David Malcolm <dmalcolm@redhat.com>
694 * parser.c (get_required_cpp_ttype): New function.
695 (cp_parser_error_1): Call it, using the result to call
696 maybe_suggest_missing_token_insertion.
698 2017-10-12 David Malcolm <dmalcolm@redhat.com>
700 * parser.c (get_matching_symbol): Move to before...
701 (cp_parser_error): Split out into...
702 (cp_parser_error_1): ...this new function, merging in content
704 (cp_parser_required_error): ...here. Eliminate partial duplicate
705 of body of cp_parser_error in favor of a call to the new
706 cp_parser_error_1 helper function.
708 2017-10-11 Nathan Sidwell <nathan@acm.org>
710 * decl2.c (struct mangled_decl_hash): Use DECL_ASSEMBLER_NAME_RAW.
711 (record_mangling): Likewise.
713 2017-10-10 Nathan Sidwell <nathan@acm.org>
715 * name-lookup.c (extern_c_fns): Rename to ...
716 (extern_c_decls): ... here.
717 (check_extern_c_conflict, extern_c_linkage_bindings): Update.
718 (do_pushdecl): Check extern-c fns and vars.
720 * cp-tree.h (default_hash_traits <lang_identifier *>): Delete
723 * decl2.c (struct mangled_decl_hash): New hash traits.
724 (mangled_decls): Make hash_table<mangled_decl_hash>.
725 (generate_mangling_alias, record_mangling): Adjust.
727 2017-10-10 Jason Merrill <jason@redhat.com>
729 More delayed lambda capture fixes.
730 * call.c (add_function_candidate): Use build_address.
731 (build_op_call_1): Call mark_lvalue_use early.
732 (build_over_call): Handle error from build_this.
733 * constexpr.c (cxx_bind_parameters_in_call): Use build_address.
734 (cxx_eval_increment_expression): Don't use rvalue().
735 * cvt.c (convert_to_void): Use mark_discarded_use.
736 * expr.c (mark_use): Handle PARM_DECL, NON_DEPENDENT_EXPR. Fix
737 reference handling. Don't copy the expression.
738 (mark_discarded_use): New.
739 * lambda.c (insert_capture_proxy): Add some sanity checking.
740 (maybe_add_lambda_conv_op): Set cp_unevaluated_operand.
741 * pt.c (register_local_specialization): Add sanity check.
742 * semantics.c (process_outer_var_ref): Fix check for existing proxy.
743 * typeck.c (cp_build_addr_expr_1): Handle error from
745 (cp_build_modify_expr): Call mark_lvalue_use_nonread, handle error
748 Handle generic lambda capture in dependent expressions.
749 * lambda.c (need_generic_capture, dependent_capture_r)
750 (do_dependent_capture): New.
751 * pt.c (processing_nonlambda_template): Use need_generic_capture.
752 * semantics.c (maybe_cleanup_point_expr)
753 (maybe_cleanup_point_expr_void, finish_goto_stmt)
754 (maybe_convert_cond): Call do_dependent_capture.
755 * typeck.c (build_static_cast): Remove dependent capture handling.
757 * typeck.c (condition_conversion): Assert !processing_template_decl.
758 * semantics.c (finish_omp_clauses): Don't
759 fold_build_cleanup_point_expr if processing_template_decl.
760 (outer_var_p): A temporary can't be from an outer scope.
761 * pt.c (type_dependent_expression_p): Fix dependency checking of
762 functions without DECL_TEMPLATE_INFO.
763 (instantiate_decl): Use lss_copy.
764 * constexpr.c (is_valid_constexpr_fn): Fix lambdas before C++17.
766 * typeck.c (check_return_expr): Check non-dependent conversion in
768 * constraint.cc (check_function_concept): Don't complain about an
769 empty concept if seen_error.
771 2017-10-10 Richard Sandiford <richard.sandiford@linaro.org>
773 * cvt.c (ignore_overflows): Use wi::to_wide when
774 operating on trees as wide_ints.
775 * decl.c (check_array_designated_initializer): Likewise.
776 * mangle.c (write_integer_cst): Likewise.
777 * semantics.c (cp_finish_omp_clause_depend_sink): Likewise.
779 2017-10-10 Nathan Sidwell <nathan@acm.org>
781 * name-lookup.c (set_global_binding): Don't deal with STAT_HACK.
783 2017-10-06 Paolo Carlini <paolo.carlini@oracle.com>
786 * decl.c (finish_function): Take a bool intead of an int; adjust.
787 * cp-tree.h (finish_function): Adjust declaration.
788 * decl2.c (generate_tls_wrapper, finish_objects,
789 finish_static_storage_duration_function): Adjust calls.
790 * lambda.c (maybe_add_lambda_conv_op, finish_lambda_function):
792 * method.c (synthesize_method): Likewise.
793 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
794 * pt.c (instantiate_decl): Likewise.
795 * parser.c (cp_parser_function_definition_after_declarator,
796 cp_parser_late_parsing_for_member, cp_parser_omp_declare_reduction):
798 (cp_parser_ctor_initializer_opt,
799 cp_parser_ctor_initializer_opt_and_function_body,
800 cp_parser_function_try_block,
801 cp_parser_function_definition_after_declarator,
802 cp_parser_function_transaction): Return void; adjust declarations.
804 2017-10-06 Nathan Sidwell <nathan@acm.org>
807 * name-lookup.c (check_local_shadow): Don't try and convert
810 2017-10-06 Jakub Jelinek <jakub@redhat.com>
813 * decl.c (reshape_init): Suppress warn_useless_cast for direct enum
815 * typeck.c (convert_for_assignment): Likewise.
817 P0704R1 - fixing const-qualified pointers to members
818 * typeck2.c (build_m_component_ref): For -std=c++2a allow
819 pointer to const & qualified method on rvalue.
821 2017-10-06 Nathan Sidwell <nathan@acm.org>
823 Use hash_table for extern "C" names
824 * name-lookup.c (extern_c_fns): Use hash_table.
825 (check_extern_c_conflict): Adjust.
826 (c_linkage_bindings): Adjust.
828 Use hash_table for namespace bindings
829 * cp-tree.h (struct named_decl_hash): New.
830 (lang_decl_ns): Change type of bindings field.
831 * lex.c (maybe_add_lang_decl_raw): Adjust.
832 * name-lookup.c (find_namespace_slot): Adjust.
833 (do_pushdecl): Push NULL-named namespace.
834 (do_push_nested_namespace): Adjust.
835 (push_namespace): Push anonymous namespace as NULL name.
837 2017-10-05 Jason Merrill <jason@redhat.com>
839 Pass variadic class objects exactly like named by-value args.
840 * call.c (convert_arg_to_ellipsis): Use the result of force_rvalue.
842 2017-10-05 Nathan Sidwell <nathan@acm.org>
844 Warn on MVP declarations
845 * cp-tree.h (struct cp_declarator): Add parenthesized field.
846 * decl.c (grokdeclarator): Warn about unnecessary parens.
847 * parser.c (make_declarator): Init parenthesized field.
848 (cp_parser_direct_declarator): Set parenthesized field.
850 Kill IDENTIFIER_GLOBAL_VALUE, SET_IDENTIFIER_GLOBAL_VALUE
851 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
852 SET_IDENTIFIER_GLOBAL_VALUE): Delete.
853 * name-lookup.h (set_global_binding): Remove NAME parm.
854 (get_global_binding): New inline fn.
855 * name-lookup.c (set_global_binding): Remove NAME parm. Adjust.
856 (identifier_global_value): Move to ...
857 * cp-objcp-common.c (identifier_global_value): ... here.
858 * class.c (build_ctor_vtbl_group, build_vtbl_initializer): Adjust.
859 * decl.c (record_builtin_type, expand_static_init,
860 grokdeclarator): Adjust.
861 * decl2.c (get_guard, get_local_tls_init_fn, get_tls_init_fn,
862 get_tls_wrapper_fn, maybe_warn_sized_delete): Adjust.
863 * except.c (declare_library_fn, build_throw): Adjust.
864 * init.c (throw_bad_array_length): Adjust.
865 * rtti.c (throw_bad_cast, throw_bad_typeid, get_tinfo_decl): Adjust.
867 * decl2.c (record_mangling): Fix spello and formatting from
870 2017-10-04 Nathan Sidwell <nathan@acm.org>
872 Give builtin types the correct name.
873 * name-lookup.c (set_global_binding): Assert name is DECL_NAME.
874 * decl.c (record_builtin_type): Reimplement, use new TYPE_DECL for
877 2017-10-04 Paolo Carlini <paolo.carlini@oracle.com>
878 Andrew Pinski <apinski@cavium.com>
881 * parser.c (cp_parser_lambda_body): Set parser->in_function_body.
883 2017-10-04 Nathan Sidwell <nathan@acm.org>
885 Move mangling aliases out of global namespace.
886 * cp-tree.h (record_mangling): New.
887 (maybe_remove_implicit_alias): Delete.
888 * decl2.c (mangled_decls): New hash map.
889 (generate_mangling_alias): Reimplement using mangled_decls.
890 (record_mangling): New.
891 * mangle.c (decl_implicit_alias_p,
892 maybe_remove_implicit_alias): Delete.
893 (mangle_decl): Use record_mangling.
894 * name-lookup.c (supplement_binding_1): Remove
895 maybe_remove_implicit_alias check.
897 2017-10-04 Jakub Jelinek <jakub@redhat.com>
900 * error.c (dump_function_decl): If show_return, call dump_type_suffix
901 on the same return type dump_type_prefix has been called on.
903 2017-10-04 Jason Merrill <jason@redhat.com>
905 PR c++/81525 - broken handling of auto in generic lambda.
906 * pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.
908 2017-10-04 Nathan Sidwell <nathan@acm.org>
910 * call.c (convert_arg_to_ellipsis): Correct comment about passing
913 2017-10-02 Richard Sandiford <richard.sandiford@linaro.org>
915 * constexpr.c (cxx_eval_store_expression): Use wi::to_widest
916 when comparing the array bounds with an ARRAY_REF index.
918 2017-09-30 Paolo Carlini <paolo.carlini@oracle.com>
921 * method.c (defaulted_late_check): Early return if the defaulted
922 declaration does not match the expected signature.
924 2017-09-29 Jakub Jelinek <jakub@redhat.com>
926 P0683R1 - default member initializers for bit-fields
927 * cp-tree.h (grokbitfield): Add INIT parameter.
928 * parser.c (cp_parser_constant_expression): Add STRICT_P argument,
929 if true, parse a conditional-expression rather than
930 assignment-expression.
931 (cp_parser_member_declaration): For C++11 and later pass true
932 as STRICT_P to cp_parser_constant_expression. Parse C++2A bitfield
933 NSDMIs. Adjust grokbitfield caller. Handle DECL_INITIAL also for
935 (cp_parser_objc_class_ivars): Adjust grokbitfield caller.
936 * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs.
937 (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs.
938 * decl2.c (grokbitfield): Add INIT parameter, pass it to
940 * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not
943 * class.c (check_bitfield_decl): Retrieve and clear width from
944 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
945 (check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than
947 (remove_zero_width_bit_fields): Adjust comment.
948 * decl2.c (grokbitfield): Stash width into
949 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
950 * pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr
951 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width.
953 * parser.c (cp_parser_member_declaration): Parse attributes before
954 colon of a bitfield in addition to after colon.
956 * Make-lang.in (check-c++-all): Test also c++2a.
958 2017-09-28 Jason Merrill <jason@redhat.com>
960 PR c++/56973, DR 696 - capture constant variables only as needed.
961 * expr.c (mark_use): Split out from mark_rvalue_use and
962 mark_lvalue_use. Handle lambda capture of constant variables.
963 (mark_lvalue_use_nonread): New.
964 * semantics.c (process_outer_var_ref): Don't capture a constant
965 variable until forced.
966 * pt.c (processing_nonlambda_template): New.
967 * call.c (build_this): Check it.
968 * decl2.c (grok_array_decl): Call mark_rvalue_use and
969 mark_lvalue_use_nonread.
970 * init.c (constant_value_1): Don't call mark_rvalue_use.
971 * typeck.c (build_static_cast): Handle lambda capture.
973 Use local_specializations to find capture proxies.
974 * cp-tree.h (DECL_CAPTURED_VARIABLE): New.
975 * lambda.c (build_capture_proxy): Set it.
976 (add_capture): Pass initializer to build_capture_proxy.
977 (start_lambda_function): Likewise.
978 (insert_capture_proxy): Use register_local_specialization.
979 (is_lambda_ignored_entity): Always ignore proxies.
980 * name-lookup.c (qualify_lookup): Don't check
981 is_lambda_ignored_entity if LOOKUP_HIDDEN is set.
982 * semantics.c (process_outer_var_ref): Use
983 retrieve_local_specialization.
984 * parser.c (cp_parser_lambda_body): Push local_specializations.
985 * pt.c (tsubst_expr): Pass LOOKUP_HIDDEN when looking for a proxy.
986 (tsubst_lambda_expr): Push local_specializations sooner.
987 (tsubst_copy_and_build): Don't register_local_specialization.
989 * call.c (build_special_member_call): Use the return value of
991 * decl.c (compute_array_index_type): Likewise.
992 * parser.c (cp_parser_oacc_wait_list): Likewise.
993 * lambda.c (is_normal_capture_proxy): Handle *this capture.
994 (add_capture): Clarify internal_error message.
996 2017-09-22 Eric Botcazou <ebotcazou@adacore.com>
999 * cp-objcp-common.c (cp_get_debug_type): Do only one lookup.
1001 2017-09-22 Jakub Jelinek <jakub@redhat.com>
1004 * tree.c (struct replace_placeholders_t): Add pset field.
1005 (replace_placeholders_r): Call cp_walk_tree with d->pset as
1006 last argument instead of NULL. Formatting fix.
1007 (replace_placeholders): Add pset variable, add its address
1008 into data. Pass &pset instead of NULL to cp_walk_tree.
1010 2017-09-22 David Malcolm <dmalcolm@redhat.com>
1012 * call.c (get_fndecl_argument_location): New function.
1013 (convert_like_real): Use it when complaining about argument type
1015 * cp-tree.h (struct cp_parameter_declarator): Add "loc" field.
1016 * parser.c (make_parameter_declarator): Add "loc" param and use
1017 it to initialize the new field.
1018 (cp_parser_translation_unit): Add UNKNOWN_LOCATION for "loc" of
1019 the "no_parameters" parameter.
1020 (cp_parser_parameter_declaration_list): Set the location of the
1021 result of grokdeclarator to be the parameter's loc, assuming no
1023 (cp_parser_parameter_declaration): Generate a location for the
1024 parameter and pass to make_parameter_declarator.
1026 2017-09-20 Nathan Sidwell <nathan@acm.org>
1028 * name-lookup.c (member_name_cmp): Use DECL_UID for final
1031 2017-09-20 Jakub Jelinek <jakub@redhat.com>
1033 P0409R2 - allow lambda capture [=, this]
1034 * parser.c (cp_parser_lambda_introducer): For cxx2a don't pedwarn on
1035 redundant [=, this].
1037 2017-09-18 Jason Merrill <jason@redhat.com>
1039 PR c++/82069 - ICE with lambda in template
1040 * semantics.c (process_outer_var_ref): Check uses_template_parms
1041 instead of any_dependent_template_arguments_p.
1043 2017-09-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1044 Paolo Carlini <paolo.carlini@oracle.com>
1047 * decl2.c (finish_anon_union): Complain about "anonymous union with
1048 no members" with a pedwarn.
1050 2017-09-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
1052 * typeck.c (build_reinterpret_cast_1,
1053 build_const_cast_1): Implement -Wcast-align=strict.
1055 2017-09-15 Jakub Jelinek <jakub@redhat.com>
1057 * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
1058 adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
1059 to C++17 or -std=gnu++17 or -std=c++17. Adjust comments.
1060 (cxx_init_decl_processing, next_initializable_field,
1061 is_direct_enum_init, check_initializer, cp_finish_decl,
1062 mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
1063 finish_function): Likewise.
1064 * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
1065 * pt.c (mark_template_parm, convert_nontype_argument,
1066 instantiate_class_template_1, type_unification_real, unify,
1067 get_partial_spec_bindings, dependent_type_p_r): Likewise.
1068 * typeck.c (cp_build_unary_op): Likewise.
1069 * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
1070 * call.c (build_user_type_conversion_1, build_over_call,
1071 build_special_member_call): Likewise.
1072 * lambda.c (begin_lambda_type): Likewise.
1073 * typeck2.c (process_init_constructor_record): Likewise.
1074 * class.c (build_base_field, finalize_literal_type_property,
1075 explain_non_literal_class): Likewise.
1076 * parser.c (cp_parser_diagnose_invalid_type_name,
1077 cp_parser_primary_expression, cp_parser_lambda_introducer,
1078 cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
1079 cp_convert_range_for, cp_parser_perform_range_for_lookup,
1080 cp_parser_decomposition_declaration, cp_parser_linkage_specification,
1081 cp_parser_static_assert, cp_parser_simple_type_specifier,
1082 cp_parser_namespace_definition, cp_parser_using_declaration,
1083 cp_parser_init_declarator, cp_parser_type_parameter_key,
1084 cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
1085 cp_parser_constructor_declarator_p): Likewise.
1086 * mangle.c (struct globals): Rename need_cxx1z_warning to
1088 (write_exception_spec, start_mangling, mangle_decl): Likewise.
1089 * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
1091 (check-c++17): New goal. Use 17 instead of 1z.
1092 (check-c++-all): Use 17 instead of 1z.
1094 2017-09-14 Jakub Jelinek <jakub@redhat.com>
1097 * cp-gimplify.c (omp_var_to_track): Look through references.
1098 (omp_cxx_notice_variable): Likewise.
1100 2017-09-13 Nathan Sidwell <nathan@acm.org>
1102 Conv-op identifers not in identifier hash table
1103 * lex.c (conv_type_hasher): Make member fns inline.
1104 (make_conv_op_name): Directly clone conv_op_identifier.
1106 Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
1107 * cp-tree.h (struct lang_type): Rename methods to members.
1108 (CLASSTYPE_METHOD_VEC): Rename to ...
1109 (CLASSTYPE_MEMBER_VEC): ... this.
1110 * name-lookup.h (get_method_slot): Rename to ...
1111 (get_member_slot): ... this.
1112 (resort_type_method_vec): Rename to ...
1113 (resort_type_member_vec): ... this.
1114 * class.c (add_method, warn_hidden): Adjust.
1115 * search.c (dfs_locate_field_accessor_pre): Adjust.
1116 * name-lookup.c (method_vec_binary_search): Rename to ...
1117 (member_vec_binary_search): ... this and adjust.
1118 (method_vec_linear_search): Rename to ...
1119 (member_vec_linear_search): ... this and adjust.
1120 (fields_linear_search, get_class_binding_direct): Adjust.
1121 (get_method_slot): Rename to ...
1122 (get_member_slot): ... this and adjust.
1123 (method_name_slot): Rename to ...
1124 (member_name_slot): ... this and adjust.
1125 (resort_type_method_vec): Rename to ...
1126 (resort_type_member_vec): ... this and adjust.
1127 (method_vec_append_class_fields): Rename to ...
1128 (member_vec_append_class_fields): ... this and adjust.
1129 (method_vec_append_enum_values): Rename to ...
1130 (member_vec_append_enum_values): ... this and adjust.
1131 (method_vec_dedup): Rename to ...
1132 (member_vec_dedup): ... this and adjust.
1133 (set_class_bindings, insert_late_enum_def_bindings): Adjust.
1135 2017-09-12 Paolo Carlini <paolo.carlini@oracle.com>
1138 * decl.c (start_decl): Early return error_mark_node if duplicate_decls
1139 returns it; avoid misleading error message.
1141 2017-09-12 Nathan Sidwell <nathan@acm.org>
1143 Kill CLASSTYPE_SORTED_FIELDS.
1144 * cp-tree.h (struct lang_type): Lose sorted_fields member.
1145 (CLASSTYPE_SORTED_FIELDS): Delete.
1146 * name-lookup.h (set_class_bindings): Add EXTRA arg.
1147 * name-lookup.c (fields_linear_search): New, broken out of ...
1148 (lookup_field_1): ... here. Delete remainder of function.
1149 (get_class_binding_direct): Reimplement without sorted_fields.
1150 (get_class_binding): Rename TYPE arg to KLASS, for consistency.
1151 (get_method_slot): Call set_class_binding when creating method_vec
1153 (method_name_cmp): Order identically named slots.
1154 (sorted_fields_type_new): Delete.
1155 (field_vc_append_class_fields): Rename to ...
1156 (method_vec_append_class_fields): ... here. Adjust.
1157 (field_vec_append_enum_values): Renme to ...
1158 (method_vec_append_enum_values): ... here. Adjust.
1159 (method_vec_dedup): New.
1160 (set_class_bindings): Reimplement.
1161 (insert_late_enum_def_bindings): Reimplement.
1163 * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
1165 (restort_data): Move later.
1166 (method_name_cmp, resort_method_name_cmp): Simplify.
1167 (resort_type_method_vec): Reformat.
1169 2017-09-09 Jason Merrill <jason@redhat.com>
1171 * constexpr.c (reduced_constant_expression_p): If
1172 CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
1174 2017-09-09 Eric Botcazou <ebotcazou@adacore.com>
1177 * cp-objcp-common.c (struct debug_type_hasher): New class.
1178 (debug_type_hash): New variable.
1179 (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
1181 2017-09-08 Jason Merrill <jason@redhat.com>
1183 PR c++/70029 - ICE with ref-qualifier and -flto
1184 * tree.c (cxx_copy_lang_qualifiers): New.
1185 * cp-tree.h: Declare it.
1186 * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
1188 2017-09-06 Jason Merrill <jason@redhat.com>
1190 PR c++/82053 - ICE with default argument in lambda in template
1191 * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
1193 (retrieve_specialization): Use lambda_fn_in_template_p.
1194 * cp-tree.h: Declare it.
1196 PR c++/82070 - error with nested lambda capture
1197 * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
1198 register_local_specialization.
1200 2017-09-06 Nathan Sidwell <nathan@acm.org>
1202 * name-lookup.h (lookup_field_1): Delete.
1203 (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
1204 * name-lookup.c (lookup_field_1): make static
1205 (method_vec_binary_search, method_vec_linear_search): New. Broken
1207 (get_class_binding_direct): ... here. Add TYPE_OR_FNS argument.
1208 Do complete search of this level.
1209 (get_class_binding): Adjust.
1210 * decl.c (reshape_init_class): Call get_class_binding.
1211 * search.c (lookup_field_r): Move field searching into
1212 get_class_binding_direct.
1214 * class.c (warn_hidden): Don't barf on non-functions.
1215 * decl2.c (check_classfn): Likewise. Check template match earlier.
1217 * name-lookup.c (count_fields): Rename to ...
1218 (count_class_fields): ... here. Take a class, don't count
1220 (add_fields_to_record_type): Rename to ...
1221 (field_vec_append_class_fields): ... here. Take a class, don't
1222 add NULL-named fields.
1223 (add_enum_fields_to_record_type): Rename to ...
1224 (field_vec_append_enum_values): ... here.
1225 (set_class_bindings): Adjust, assert we added expected number.
1226 (insert_late_enum_def_bindings): Reimplement. Create vector if
1227 there are now sufficient entries.
1229 * name-lookup.h (lookup_fnfields_slot_nolazy,
1230 lookup_fnfields_slot): Rename to ...
1231 (get_class_binding_direct, get_class_binding): ... here.
1232 * name-lookup.c (lookup_fnfields_slot_nolazy,
1233 lookup_fnfields_slot): Rename to ...
1234 (get_class_binding_direct, get_class_binding): ... here.
1235 * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
1236 * call.c (build_user_type_conversion_1): Adjust.
1237 (has_trivial_copy_assign_p): Adjust.
1238 (has_trivial_copy_p): Adjust.
1239 * class.c (get_basefndecls) Adjust.
1240 (vbase_has_user_provided_move_assign) Adjust.
1241 (classtype_has_move_assign_or_move_ctor_p): Adjust.
1242 (type_build_ctor_call, type_build_dtor_call): Adjust.
1243 * decl.c (register_dtor_fn): Adjust.
1244 * decl2.c (check_classfn): Adjust.
1245 * pt.c (retrieve_specialization): Adjust.
1246 (check_explicit_specialization): Adjust.
1247 (do_class_deduction): Adjust.
1248 * search.c (lookup_field_r): Adjust.
1249 (look_for_overrides_here, lookup_conversions_r): Adjust.
1250 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
1251 * tree.c (type_has_nontrivial_copy_init): Adjust.
1252 * method.c (lazily_declare_fn): Adjust comment.
1254 2017-09-05 Nathan Sidwell <nathan@acm.org>
1256 * name-lookup.c (do_class_using_decl): Elide read-once temps.
1257 Move declarations to initializations.
1259 * class.c (add_method): Move slot search and insertion to ...
1260 * name-lookup.c (get_method_slot): ... this new function.
1261 (lookup_fnfields_slot_nolazy): Cope with NULL slot.
1262 * name-lookup.h (get_method_slot): Declare.
1263 * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
1265 (grok_special_member_properties): Set
1266 TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
1267 Improve TYPE_HAS_CONSTEXPR_CTOR setting.
1269 * cp-tree.h (lang_decl_base): Rename template_conv_p to
1271 (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
1272 (DECL_CONV_FN_TYPE): FN must be conv op.
1273 (DECL_TEMPLATE_CONV_FN_P): Delete.
1274 (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
1275 * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
1278 * class.c (unreverse_member_declarations): Remove extraneous if.
1279 * pt.c (push_template_decl_real): Use string concatenation, not
1280 \<newline>. Add %<..%>.
1282 2017-09-05 Paolo Carlini <paolo.carlini@oracle.com>
1285 * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
1286 * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
1287 creating cdtor_label.
1288 * constexpr.c (returns): Add the case of a constructor/destructor
1289 returning via a LABEL_DECL_CDTOR label.
1290 (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
1292 2017-09-01 Nathan Sidwell <nathan@acm.org>
1294 * cp-tree.h (resort_type_method_vec): Move declaration to ...
1295 * name-lookup.h (resort_type_method_vec): ... here.
1296 (set_class_bindings): Lose 2nd arg.
1297 * class.c (finish_struct_1, finish_struct): Adjust
1298 set_class_bindings call. Don't call finish_struct_methods.
1299 (resort_data, method_name_cmp, resort_method_name_cmp,
1300 resort_type_method_vec, finish_struct_methods): Move to ...
1301 * name-lookup.c (resort_data, method_name_cmp,
1302 resort_method_name_cmp, resort_type_method_vec): ... here.
1303 (set_class_bindings): Lose fields arg. Swallow finish_struct_methods.
1305 * class.c (finish_struct): Call set_class_bindings for the
1308 * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
1309 Don't call maybe_warn_about_overly_private_class here.
1310 (warn_hidden): Cleanup declarations and comments.
1311 (type_has_user_provided_constructor): No need to check
1312 CLASSTYPE_METHOD_VEC.
1313 (type_has_user_provided_or_explicit_constructor): Likewise.
1314 (classtype_has_move_assign_or_move_ctor_p): Likewise.
1315 (check_bases_and_members): Don't call finish_struct_methods here.
1316 (finish_struct_1): Call finish_struct_methods and
1317 set_class_bindings immediately after layout. Clear DECL_IN_AGGR_P
1319 (finish_struct): For templates process USING_DECLS and clear
1320 DECL_IN_AGGR_P before calling finish_struct_methods. Call
1321 maybe_warn_about_overly_private_class here.
1323 Revert 2017-08-28 Nathan Sidwell <nathan@acm.org>
1324 Restore sorted_fields vector.
1325 * cp-tree.h (lang_type): Restore sorted_fields vector.
1326 (CLASSTYPE_SORTED_FIELDS): Restore.
1327 (CLASSTYPE_BINDINGS): Delete.
1328 * name-lookup.c (lookup_field_1): Restore binary search.
1329 (sorted_fields_type_new, count_fields,
1330 add_fields_to_record_type, add_enum_fields_to_record_type): Restore
1331 (set_class_bindings): Revert.
1332 (insert_late_enum_def_binding): Restore field_vec insertion.
1334 2017-09-01 Jakub Jelinek <jakub@redhat.com>
1337 * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
1339 2017-09-01 Marek Polacek <polacek@redhat.com>
1342 * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
1344 2017-08-30 Jason Merrill <jason@redhat.com>
1346 PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
1347 * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
1348 (regenerated_lambda_fn_p): New.
1349 (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
1350 (tsubst_copy) [VAR_DECL]: Likewise.
1352 PR c++/82030 - ICE inheriting from multiple lambdas
1354 * call.c (compare_ics): Handle null candidate.
1356 2017-08-30 Ville Voutilainen <ville.voutilainen@gmail.com>
1358 Make taking the address of an overloaded function a non-deduced context
1360 * pt.c (unify_overload_resolution_failure): Remove.
1361 (unify_one_argument): Adjust.
1363 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1364 Alan Hayward <alan.hayward@arm.com>
1365 David Sherwood <david.sherwood@arm.com>
1367 * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
1369 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1370 Alan Hayward <alan.hayward@arm.com>
1371 David Sherwood <david.sherwood@arm.com>
1373 * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
1375 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1376 Alan Hayward <alan.hayward@arm.com>
1377 David Sherwood <david.sherwood@arm.com>
1379 * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
1380 instead of TYPE_MODE.
1382 2017-08-29 Jason Merrill <jason@redhat.com>
1384 PR c++/81236 - ICE with template-id in generic lambda
1385 * semantics.c (finish_id_expression): Remove special dependent case.
1386 Avoid some later pieces when dependent.
1387 (finish_qualified_id_expr): Do normal BASELINK handling in a
1388 template. Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
1389 (parsing_default_capturing_generic_lambda_in_template): Remove.
1390 * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
1391 error for types that will never be complete.
1392 * mangle.c (write_expression): Add sanity check.
1393 * tree.c (build_qualified_name): Add sanity check.
1394 (cp_walk_subtrees): Walk into the class context of a BASELINK.
1395 * lambda.c (add_capture): Improve diagnostic for generic lambda
1397 * call.c (build_new_method_call_1): Print the right constructor
1400 Reimplement handling of lambdas in templates.
1401 * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
1402 * decl.c (start_preparsed_function): Call start_lambda_scope.
1403 (finish_function): Call finish_lambda_scope.
1404 * init.c (get_nsdmi): Call start/finish_lambda_scope.
1405 * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
1406 * parser.c (cp_parser_function_definition_after_declarator): Don't
1407 call start/finish_lambda_scope.
1408 * pt.c (retrieve_specialization): Ignore lambda functions in
1410 (find_parameter_packs_r): Ignore capture proxies. Look into
1412 (check_for_bare_parameter_packs): Allow bare packs in lambdas.
1413 (tsubst_default_argument): Call start/finish_lambda_scope.
1414 (tsubst_function_decl): Handle lambda functions differently.
1415 (tsubst_template_decl): Likewise.
1416 (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
1418 (tsubst_lambda_expr): Create a new closure rather than instantiate
1419 the one from the template.
1420 (tsubst_copy_and_build): Don't register a specialization of a pack.
1421 (regenerate_decl_from_template): Call start/finish_lambda_scope.
1422 (instantiate_decl): Remove special lambda function handling.
1423 * semantics.c (process_outer_var_ref): Remove special generic lambda
1424 handling. Don't implicitly capture in a lambda in a template. Look
1425 for an existing proxy.
1426 * class.c (current_nonlambda_class_type): Use decl_type_context.
1428 * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
1429 (LAMBDA_EXPR_RETURN_TYPE): Remove.
1430 (struct tree_lambda_expr): Remove closure and return_type fields.
1431 * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
1432 * pt.c (tsubst_copy_and_build): Likewise.
1433 * parser.c (cp_parser_lambda_declarator_opt): Track return type.
1434 (cp_parser_lambda_body): Adjust unspecified return type check.
1435 * ptree.c (cxx_print_lambda_node): Don't print closure or
1438 PR c++/80935 - wrong C++17 error with lambda
1439 * decl.c (check_for_uninitialized_const_var): Check
1440 is_instantiation_of_constexpr.
1441 * constexpr.c (ensure_literal_type_for_constexpr_object): Check
1442 is_instantiation_of_constexpr.
1443 (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
1445 * lambda.c (build_lambda_object): Check for error_mark_node.
1446 * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
1448 (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
1449 (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
1451 PR c++/80767 - unnecessary instantiation of generic lambda
1452 * call.c (convert_like_real): Call build_user_type_conversion_1 if
1454 (add_conv_candidate): Build a ck_user conversion with no candidate.
1456 Fix lambdas in template default argument of inherited ctor.
1457 * method.c (synthesized_method_base_walk): Replace an inherited
1458 template with its specialization.
1459 (synthesized_method_walk): Make inheriting_ctor a pointer.
1460 (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
1461 (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
1463 * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
1464 template, not the function.
1465 (template_guide_p): Adjust.
1467 Support copying local_specializations.
1468 * cp-tree.h (enum lss_policy): New.
1469 (local_specialization_stack): Add policy parameter to default ctor.
1470 * pt.c (local_specialization_stack): Copy local_specializations if
1473 * constexpr.c (potential_constant_expression_1): Add "now" parm.
1474 (is_constant_expression, require_constant_expression): New.
1475 (is_static_init_expression, is_nondependent_constant_expression)
1476 (is_nondependent_static_init_expression): Drop "potential".
1477 * except.c (build_must_not_throw_expr): Do type conversion on
1478 value-dependent argument.
1479 * pt.c, semantics.c, typeck2.c: Use variants without "potential".
1481 Instantiate default arguments/member initializers once.
1482 * init.c (get_nsdmi): Remember NSDMI instantiations.
1483 * parser.c (inject_this_parameter): Be more picky about
1485 * pt.c (tsubst_copy): Simplify 'this' handling.
1486 (tsubst_default_argument): Remember default argument
1487 instantiations. Take parameter number.
1488 (tsubst_default_arguments): Pass it.
1489 * call.c (convert_default_arg): Likewise.
1491 Fix default argument conversion failure and SFINAE.
1492 * call.c (build_over_call): Check convert_default_arg result for
1494 * parser.c (cp_parser_late_parsing_default_args): Remember
1497 2017-08-28 Nathan Sidwell <nathan@acm.org>
1499 * cp-tree.h (lang_type): Replace sorted_fields vector with
1501 (CLASSTYPE_SORTED_FIELDS): Delete.
1502 (CLASSTYPE_BINDINGS): New.
1503 * decl.c (finish_enum_value_list): Swap args of
1504 insert_late_enum_def_bindings.
1505 * name-lookup.c (lookup_field_1): Replace binary search of sorted
1506 fields with map->get.
1507 (sorted_fields_type_new, count_fields,
1508 add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
1509 (add_class_member, add_class_members): New.
1510 (set_class_bindings): Create map and insert.
1511 (insert_late_enum_def_binding): Swap parms. Use add_clasS_member.
1512 * ptree.c (cxx_print_type): Delete sorted fields printing.
1514 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
1516 * name-lookup.h (set_class_bindings,
1517 insert_late_enum_def_bindings): Declare.
1518 * decl.c (finish_enum_value_list): Adjust for
1519 insert_late_enum_def_bindings name change.
1520 * class.c (finish_struct_1): Call set_class_bindings.
1521 (count_fields, add_fields_to_record_type,
1522 add_enum_fields_to_record_type, sorted_fields_type_new,
1523 insert_into_classtype_sorted_fields,
1524 insert_late_enum_def_into_classtype_sorted_fields): Move to ...
1525 * name-lookup.h (count_fields, add_fields_to_record_type,
1526 add_enum_fields_to_record_type, sorted_fields_type_new,
1527 set_class_bindings, insert_late_enum_def_bindings): ... here.
1529 2017-08-25 Nathan Sidwell <nathan@acm.org>
1531 * class.c (method_name_cmp, resort_method_name_cmp): Methods
1534 Conversion operators have a special name
1535 * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
1536 (conv_op_marker, conv_op_identifier): New.
1537 (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
1538 * decl.c (initialize_predefined_identifiers): Add
1540 (cxx_init_decl_processing): Create conv_op_marker.
1541 * decl2.c (check_classfn): Lookup conv-ops by name.
1542 * class.c (add_method): Use conv_op_identifier & conv_op_marker.
1543 (resort_type_method_vec): Don't skip conv-ops.
1544 (finish_struct_methods, warn_hidden): Likewise.
1545 * name-lookup.h (lookup_all_conversions): Delete.
1546 * name-lookup.c (lookup_conversion_operator): Replace with ...
1547 (extract_conversion_operator): ... this.
1548 (lookup_fnfields_slot_nolazy): Find conv-ops by name.
1549 (lookup_all_conversions): Delete.
1550 * pt.c (check_explicit_specialization): Find conv-ops by name.
1551 * search.c (lookup_conversions_r): Likewise.
1553 2017-08-24 Nathan Sidwell <nathan@acm.org>
1555 Conversion operators kept on single overload set
1556 * class.c (add_method): Keep all conv-ops on one slot.
1557 * name-lookup.c (lookup_conversion_operator): Pull the desired
1558 conv op out of overload set.
1559 * search.c (lookup_conversions_r): Lose template/non-template
1561 (lookup_conversions): Likewise.
1563 2017-08-23 Nathan Sidwell <nathan@acm.org>
1565 * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
1566 lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
1568 * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
1569 lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
1570 * search.c (lookup_conversion_operator,
1571 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1572 lookup_all_conversions): Move to ...
1573 * name-lookup.c (lookup_conversion_operator,
1574 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1575 lookup_all_conversions): ... here.
1577 * semantics.c (finish_member_declaration): Move USING_DECL check
1578 earlier. Always set C++ linkage. Commonize TYPE_FIELD and
1579 template decl list insertion.
1581 * cp-tree.h (maybe_version_functions): Declare.
1582 * decl.c (decls_match): Break function versioning check to
1583 separate function. Call it.
1584 (maybe_version_functions): Broken out of decls_match.
1585 * class.c (add_method): Use maybe_version_functions.
1587 * cp-tree.h (print_search_statistics,
1588 reinit_search_statistics): Don't declare.
1589 * search.c (n_fields_searched, n_calls_lookup_field,
1590 n_calls_lookup_field_1, n_calls_lookup_fnfields,
1591 n_calls_lookup_fnfields_1, n_calls_get_base_type,
1592 n_outer_fields_searched, n_contexts_saved): Delete.
1593 (lookup_field_1, lookup_member,
1594 lookup_fnfields_slot_nolazy): Remove stat gathering.
1595 (print_search_statistics, reinit_search_statistics): Delete.
1596 * tree.c (cxx_print_statistics): Don't print search stats.
1598 2017-08-21 Nathan Sidwell <nathan@acm.org>
1600 * search.c (lookup_field_r): Remove obsolete code for type-named
1603 * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
1605 (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
1606 (lookup_field_fuzzy_r): Adjust.
1608 2017-08-21 David Malcolm <dmalcolm@redhat.com>
1610 * call.c (build_over_call): Pass NULL for new parameter to
1611 check_function_arguments.
1612 * typeck.c (cp_build_function_call_vec): Likewise.
1614 2017-08-21 Nathan Sidwell <nathan@acm.org>
1617 * pt.c (instantiate_class_template_1):
1618 BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
1620 2017-08-18 David Malcolm <dmalcolm@redhat.com>
1623 * name-lookup.c (maybe_suggest_missing_header): Convert return
1624 type from void to bool; return true iff a suggestion was offered.
1625 (suggest_alternative_in_explicit_scope): Move call to
1626 maybe_suggest_missing_header to before use of best_match, and
1627 return true if the former offers a suggestion.
1629 2017-08-18 H.J. Lu <hongjiu.lu@intel.com>
1632 * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
1633 * decl2.c (grokbitfield): Don't allow bit-field with
1634 warn_if_not_aligned type.
1636 2017-08-17 Nathan Sidwell <nathan@acm.org>
1638 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
1639 * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
1640 (TYPE_TEMPLATE_INFO): Simplify.
1641 (SET_TYPE_TEMPLATE_INFO): Simplify.
1643 * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
1644 don't need lang_type.
1645 (cxx_make_type): Use maybe_add_lang_type_raw return value.
1646 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
1649 * cp-tree.h (struct lang_type): Remove template_info field.
1650 (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
1651 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
1653 2017-08-14 Martin Sebor <msebor@redhat.com>
1656 * error.c (cp_printer): Handle 'G'.
1658 2017-08-11 Martin Liska <mliska@suse.cz>
1660 * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
1661 TARGET_SUPPORTS_ALIASES.
1662 (handle_tls_init): Likewise.
1663 (note_mangling_alias): Likewise. Remove ATTRIBUTE_UNUSED for
1665 * optimize.c (can_alias_cdtor): Likewise.
1667 2017-08-11 Jason Merrill <jason@redhat.com>
1669 PR c++/81671 - nullptr_t template parameter
1670 * pt.c (convert_nontype_argument): Fix nullptr_t check.
1672 2017-08-10 Jason Merrill <jason@redhat.com>
1674 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1675 * method.c (synthesized_method_walk): Don't diagnose lack of
1678 PR c++/80452 - Core 1579, implicit move semantics on return/throw
1679 * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
1680 tentatively changed the lvalue to an rvalue.
1681 * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
1682 (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
1683 parameter is an rvalue reference.
1684 * except.c (build_throw): Do maybe-rvalue overload resolution twice.
1685 * typeck.c (check_return_expr): Likewise.
1687 2017-08-10 David Malcolm <dmalcolm@redhat.com>
1689 * parser.c (cp_parser_error): Update for new param to
1691 (class token_pair): New class.
1692 (struct matching_paren_traits): New struct.
1693 (matching_parens): New typedef.
1694 (struct matching_brace_traits): New struct.
1695 (matching_braces): New typedef.
1696 (cp_parser_statement_expr): Convert explicit parsing of
1697 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
1698 class matching_parens, so that the pertinent open parenthesis is
1699 highlighted when there are problems locating the close
1701 (cp_parser_primary_expression): Likewise.
1702 (cp_parser_compound_literal_p): Remove consumption of opening
1704 (cp_parser_postfix_expression): Convert explicit parsing of
1705 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
1706 above. Use it to consume the opening paren previously consumed by
1707 cp_parser_compound_literal_p.
1708 (cp_parser_parenthesized_expression_list): Likewise.
1709 (cp_parser_unary_expression): Likewise.
1710 (cp_parser_new_expression): Likewise.
1711 (cp_parser_cast_expression): Likewise.
1712 (cp_parser_builtin_offsetof): Likewise.
1713 (cp_parser_trait_expr): Likewise.
1714 (cp_parser_lambda_declarator_opt): Likewise.
1715 (cp_parser_lambda_body): Likewise, for matching_braces.
1716 (cp_parser_compound_statement): Likewise.
1717 (cp_parser_selection_statement): Likewise, for matching_parens.
1718 (cp_parser_iteration_statement): Likewise.
1719 (cp_parser_already_scoped_statement): Likewise, for
1721 (cp_parser_linkage_specification): Likewise.
1722 (cp_parser_static_assert): Likewise, for matching_parens.
1723 (cp_parser_decltype): Likewise.
1724 (cp_parser_operator): Likewise.
1725 (cp_parser_enum_specifier): Likewise.
1726 (cp_parser_namespace_definition): Likewise.
1727 (cp_parser_direct_declarator): Likewise.
1728 (cp_parser_braced_list): Likewise.
1729 (cp_parser_class_specifier_1): Likewise, for matching_braces.
1730 (cp_parser_constant_initializer): Likewise.
1731 (cp_parser_noexcept_specification_opt): Likewise, for
1733 (cp_parser_exception_specification_opt): Likewise.
1734 (cp_parser_handler): Likewise.
1735 (cp_parser_asm_specification_opt): Likewise.
1736 (cp_parser_asm_operand_list): Likewise.
1737 (cp_parser_gnu_attributes_opt): Likewise.
1738 (cp_parser_std_attribute_spec): Likewise.
1739 (cp_parser_requirement_parameter_list): Likewise.
1740 (cp_parser_requirement_body): Likewise, for matching_braces.
1741 (cp_parser_compound_requirement): Likewise.
1742 (cp_parser_template_introduction): Likewise.
1743 (cp_parser_sizeof_pack): Likewise, for matching_parens.
1744 (cp_parser_sizeof_operand): Likewise; use it to consume the
1745 opening paren previously consumed by cp_parser_compound_literal_p.
1746 (get_matching_symbol): New function.
1747 (cp_parser_required_error): Add param "matching_location". Remove
1748 calls to cp_parser_error, instead setting a non-NULL gmsgid, and
1749 handling it if set by calling c_parse_error, potentially with a
1750 secondary location if matching_location was set.
1751 (cp_parser_require): Add param "matching_location", with a default
1752 value of UNKNOWN_LOCATION.
1753 (cp_parser_require_keyword): Update for new param of
1754 cp_parser_required_error.
1755 (cp_parser_objc_encode_expression): Update to class matching_parens
1757 (cp_parser_objc_defs_expression): Likewise.
1758 (cp_parser_objc_protocol_expression): Likewise.
1759 (cp_parser_objc_selector_expression): Likewise.
1760 (cp_parser_objc_typename): Likewise.
1761 (cp_parser_objc_superclass_or_category): Likewise.
1762 (cp_parser_objc_try_catch_finally_statement): Likewise.
1763 (cp_parser_objc_synchronized_statement): Likewise.
1764 (cp_parser_objc_at_property_declaration): Likewise.
1765 (cp_parser_oacc_single_int_clause): Likewise.
1766 (cp_parser_oacc_shape_clause): Likewise.
1767 (cp_parser_omp_clause_collapse): Likewise.
1768 (cp_parser_omp_clause_default): Likewise.
1769 (cp_parser_omp_clause_final): Likewise.
1770 (cp_parser_omp_clause_if): Likewise.
1771 (cp_parser_omp_clause_num_threads): Likewise.
1772 (cp_parser_omp_clause_num_tasks): Likewise.
1773 (cp_parser_omp_clause_grainsize): Likewise.
1774 (cp_parser_omp_clause_priority): Likewise.
1775 (cp_parser_omp_clause_hint): Likewise.
1776 (cp_parser_omp_clause_defaultmap): Likewise.
1777 (cp_parser_omp_clause_ordered): Likewise.
1778 (cp_parser_omp_clause_schedule): Likewise.
1779 (cp_parser_omp_clause_num_teams): Likewise.
1780 (cp_parser_omp_clause_thread_limit): Likewise.
1781 (cp_parser_omp_clause_aligned): Likewise.
1782 (cp_parser_omp_clause_linear): Likewise.
1783 (cp_parser_omp_clause_safelen): Likewise.
1784 (cp_parser_omp_clause_simdlen): Likewise.
1785 (cp_parser_omp_clause_depend): Likewise.
1786 (cp_parser_omp_clause_device): Likewise.
1787 (cp_parser_omp_clause_dist_schedule): Likewise.
1788 (cp_parser_oacc_clause_async): Likewise.
1789 (cp_parser_omp_critical): Likewise.
1790 (cp_parser_omp_for_loop): Likewise.
1791 (cp_parser_omp_sections_scope): Likewise.
1792 (cp_parser_omp_declare_reduction_exprs): Likewise.
1793 Update for new param to cp_parser_required_error.
1794 (cp_parser_oacc_routine): Likewise.
1795 (cp_parser_transaction_expression): Likewise.
1796 (cp_parser_cilk_simd_vectorlength): Likewise.
1798 2017-08-09 Jason Merrill <jason@redhat.com>
1800 PR c++/81525 - wrong constant value with generic lambda
1801 * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
1802 (tsubst_copy) [VAR_DECL]: Handle auto.
1804 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1805 * init.c (get_nsdmi): Add complain parm.
1806 * typeck2.c (digest_nsdmi_init): Add complain parm.
1807 (process_init_constructor_record): Pass complain to get_nsdmi.
1808 * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
1809 * method.c (get_defaulted_eh_spec): Add complain parm. Pass it into
1810 synthesized_method_walk.
1811 (synthesized_method_walk): Adjust.
1812 (walk_field_subobs): Pass complain to get_nsdmi.
1813 (defaulted_late_check): Skip other checks if deleted.
1814 * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
1815 * call.c (build_aggr_conv): Pass complain to get_nsdmi.
1816 * parser.c (defarg_location): New.
1817 * error.c (location_of): Use it.
1819 2017-08-09 Marek Polacek <polacek@redhat.com>
1821 * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
1822 * typeck.c (build_binary_op): Change the type of a parameter to bool.
1823 (cp_truthvalue_conversion): Use true instead of 1.
1825 2017-08-08 Marek Polacek <polacek@redhat.com>
1828 * cp-gimplify.c (cp_fold): If folding exposed a branch of
1829 a COND_EXPR, convert it to the original type of the COND_EXPR, if
1832 2017-08-08 Martin Liska <mliska@suse.cz>
1834 * call.c: Include header files.
1835 * cp-gimplify.c: Likewise.
1836 * cp-ubsan.c: Likewise.
1839 * search.c: Likewise.
1840 * semantics.c: Likewise.
1841 * typeck.c: Likewise.
1843 2017-08-07 Martin Liska <mliska@suse.cz>
1845 * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
1847 (cp_parser_std_attribute): Likewise.
1848 * tree.c: Add new include.
1850 2017-08-04 Paolo Carlini <paolo.carlini@oracle.com>
1853 * pt.c (do_class_deduction): Handle the case of no viable implicit
1854 deduction guides; simplify the code generating implicit deduction
1857 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
1860 * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
1861 destructor as expressions.
1863 2017-08-02 Jakub Jelinek <jakub@redhat.com>
1866 * call.c (build_user_type_conversion_1): Only call
1867 lookup_fnfields_slot if totype is CLASS_TYPE_P.
1869 2017-07-31 Jason Merrill <jason@redhat.com>
1871 * decl.c (declare_global_var): Set DECL_CONTEXT.
1873 2017-07-31 Jan Hubicka <hubicka@ucw.cz>
1874 Martin Liska <mliska@suse.cz>
1876 * pt.c (tsubst_copy): Copy PREDICT_EXPR.
1877 * semantics.c (finish_goto_stmt): Build gimple predict
1879 * constexpr.c (potential_constant_expression_1): Handle
1882 2017-07-31 Martin Liska <mliska@suse.cz>
1885 * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
1886 also with current_function_decl non-null equality.
1887 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1888 * decl.c (compute_array_index_type): Likewise.
1889 * init.c (finish_length_check): Likewise.
1890 * typeck.c (cp_build_binary_op): Likewise.
1892 2017-07-29 Jakub Jelinek <jakub@redhat.com>
1894 * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
1895 DW_AT_export_symbols.
1896 * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
1897 argument, pass it through to the debug hook.
1898 (finish_namespace_using_directive): Adjust
1899 emit_debug_info_using_namespace caller.
1900 (push_namespace): Likewise. Call it after setting
1901 DECL_NAMESPACE_INLINE_P.
1902 (cp_emit_debug_info_for_using): Pass false as new argument to
1903 the imported_module_or_decl debug hook.
1905 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
1907 * lex.c (copy_decl): Adjust.
1908 (copy_type): Likewise.
1910 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
1913 * lambda.c (add_capture): Early return if we cannot capture by
1916 2017-07-26 Jason Merrill <jason@redhat.com>
1918 P0702R1 - List deduction of vector.
1919 * pt.c (do_class_deduction): Special-case deduction from a single
1920 element of related type.
1922 2017-07-26 Leonid Koppel <lkoppel@uwaterloo.ca>
1924 PR c++/67054 - Inherited ctor with non-default-constructible members
1925 * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
1926 when deducing an inheriting constructor.
1928 2017-07-21 Nathan Sidwell <nathan@acm.org>
1930 * search.c (lookup_conversion_operator): Return overloads.
1931 (lookup_fnfields_idx_nolazy): Absorb into ...
1932 (lookup_fnfields_slot_nolaxy): ... here.
1933 (lookup_fnfields_1): Absorb into ...
1934 (lookup_fnfields_slot): ... here.
1936 Remove special CDtor METHOD_VEC slots.
1937 * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
1938 CLASSTYPE_DESTRUCTOR_SLOT): Delete.
1939 (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
1940 (CLASSTYPE_DESTRUCTOR): Likewise.
1941 * class (add_method): Don't use special cdtor slots.
1942 * search.c (lookup_fnfields_idx_nolazy): Likewise.
1943 (look_for_overrides_here): Use lookup_fnfields_slot.
1944 * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
1946 * call.c (add_candidates): Move decls to initialization. Don't
1949 2017-07-20 Nathan Sidwell <nathan@acm.org>
1951 Remove TYPE_METHODS.
1952 * class.c (maybe_warn_about_overly_private_class,
1953 finish_struct_methods, one_inheriting_sig, count_fields,
1954 add_fields_to_record_type, check_field_decls, check_methods,
1955 clone_function_decl, set_method_tm_attributes,
1956 finalize_literal_type_property, check_bases_and_members,
1957 create_vtable_ptr, determine_key_method,
1958 unreverse_member_declarations, finish_struct,
1959 add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
1960 * decl.c (fixup_anonymous_aggr): Likewise.
1961 * decl2.c (reset_type_linkage_2): Likewise.
1962 * method.c (after_nsdmi_defaulted_late_checks,
1963 lazily_declare_fn): Likewise.
1964 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
1965 * pt.c (instantiate_class_template_1, tsubst_expr,
1966 do_type_instantiation, instantiate_pending_templates): Likewise.
1967 * search.c (lookup_field_1): Likewise.
1968 * semantics.c (finish_member_declaration,
1969 finish_omp_declare_simd_methods): Likewise.
1971 2017-07-19 Nathan Sidwell <nathan@acm.org>
1973 * class.c (add_implicitly_declared_members): Use
1974 classtype_has_move_assign_or_move_ctor_p.
1975 (classtype_has_move_assign_or_move_ctor,
1976 classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
1977 (classtype_has_move_assign_or_move_ctor_p): ... this new function.
1978 * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
1980 (classtype_has_move_assign_or_move_ctor_p): ... this.
1981 * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
1982 * tree.c (type_has_nontrivial_copy_init): Adjust.
1984 * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
1985 PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
1987 2017-07-18 Nathan Sidwell <nathan@acm.org>
1989 * cp-array-notation.c (build_array_notation_ref): Use
1990 TYPE_{MIN,MAX}_VALUE.
1992 * class.c (classtype_has_move_assign_or_move_ctor): Declare.
1993 (add_implicitly_declared_members): Use it.
1994 (type_has_move_constructor, type_has_move_assign): Merge into ...
1995 (classtype_has_move_assign_or_move_ctor): ... this new function.
1996 * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
1998 2017-07-17 Volker Reichelt <v.reichelt@netcologne.de>
2000 * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
2001 friend outside class and obsolete auto as storage-class-specifier.
2003 2017-07-17 Nathan Sidwell <nathan@acm.org>
2005 * class.c (maybe_warn_about_overly_private_class): Ignore public
2008 * class.c (type_has_user_declared_move_constructor,
2009 type_has_user_declared_move_assign): Combine into ...
2010 (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
2011 * cp-tree.h (type_has_user_declared_move_constructor,
2012 type_has_user_declared_move_assign): Combine into ...
2013 (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
2014 * method.c (maybe_explain_implicit_delete): Use it.
2015 (lazily_declare_fn): Use it.
2016 * tree.c (type_has_nontrivial_copy_init): Use it.
2018 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
2019 semantics, simplify implementation.
2021 2017-07-16 Volker Reichelt <v.reichelt@netcologne.de>
2023 * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
2024 in old-style cast diagnostic.
2025 * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
2026 in useless cast diagnostic.
2027 * error.c (type_to_string): Remove enum special handling.
2029 2017-07-14 David Malcolm <dmalcolm@redhat.com>
2031 * name-lookup.c (get_std_name_hint): Add '<' and '>' around
2033 (maybe_suggest_missing_header): Update for addition of '<' and '>'
2034 to above. Provide a fix-it hint.
2035 * pt.c: Include "gcc-rich-location.h"
2036 (listify): Attempt to add fix-it hint for missing
2037 #include <initializer_list>.
2038 * rtti.c: Include "gcc-rich-location.h".
2039 (typeid_ok_p): Attempt to add fix-it hint for missing
2040 #include <typeinfo>.
2042 2017-07-12 Jason Merrill <jason@redhat.com>
2044 P0512R0 - Deduction from an initializer list.
2045 * pt.c (do_class_deduction): Do list deduction in two phases.
2047 2017-07-12 Nathan Sidwell <nathan@acm.org>
2049 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
2050 DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
2052 * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
2053 DECL_CXX_DESTRUCTOR explicitly.
2054 * decl2.c (grokclassfn): Likewise.
2055 * friend.c (do_friend): Likewise.
2056 * method.c (make_thunk, make_alias_for,
2057 implicitly_declare_fn): Likewise.
2059 2017-07-11 Jason Merrill <jason@redhat.com>
2062 * decl.c (grokparms): Downgrade error about array of unknown bound
2063 to pedwarn and disable it for C++17.
2065 2017-07-11 Nathan Sidwell <nathan@acm.org>
2067 * decl2.c (reset_type_linkage_2): Dont't change ctor name.
2069 2017-07-10 Martin Sebor <msebor@redhat.com>
2071 * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
2073 2017-07-06 Jason Merrill <jason@redhat.com>
2075 PR c++/81204 - parse error with dependent template-name
2076 * parser.c (cp_parser_lookup_name): Revert previous change.
2078 2017-07-06 David Malcolm <dmalcolm@redhat.com>
2080 * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
2081 selftest::run_cp_tests.
2082 (selftest::run_cp_tests): New function.
2083 * cp-tree.h (selftest::run_cp_tests): New decl.
2085 2017-07-04 Jakub Jelinek <jakub@redhat.com>
2087 * parser.c (cp_parser_decomposition_declaration): Replace
2088 decomposition declaration with structured binding in diagnostics.
2089 * decl.c (cp_finish_decomp): Likewise.
2090 (grokdeclarator): Likewise.
2093 * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
2094 forms of structured binding initializers.
2096 2017-07-03 Paolo Carlini <paolo.carlini@oracle.com>
2099 * decl.c (grokdeclarator): Move checks on function return type after
2100 the splice_late_return_type call; if declspecs->locations[ds_type_spec]
2101 is UNKNOWN_LOCATION fall back to input_location.
2103 2017-07-03 David Malcolm <dmalcolm@redhat.com>
2105 * parser.c (enum required_token): Fix spelling of
2106 RT_INTERATION to RT_ITERATION.
2107 (cp_parser_iteration_statement): Likewise.
2108 (cp_parser_required_error): Likewise.
2110 2017-06-30 Jason Merrill <jason@redhat.com>
2112 PR c++/81257 - ICE with invalid ::template.
2113 PR c++/54769 - wrong lookup of dependent template-name.
2114 * parser.c (cp_parser_template_name): Revert part of last change.
2116 2017-06-30 Nathan Sidwell <nathan@acm.org>
2118 * config-lang.in (gtfiles): Add cp/lex.c.
2119 * cp-tree.h (mangle_convop_name_for_type): Rename ...
2120 (make_conv_op_name): ... here. Move to lex.
2121 * lambda.c (maybe_add_lambda_conv_op): Update.
2122 * parser.c (cp_parser_conversion_function_id): Update.
2123 * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
2124 tsubst_copy_and_build): Update.
2125 * semantics.c (apply_deduced_return_type): Update.
2126 * mangle.c (conv_type_hasher, conv_type_names,
2127 mangle_conv_op_name_for_type): Move to ...
2128 * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
2131 2017-06-30 David Malcolm <dmalcolm@redhat.com>
2134 * parser.c (cp_parser_postfix_expression): Construct a location
2135 for typeid expressions.
2137 2017-06-30 Nathan Sidwell <nathan@acm.org>
2139 * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
2141 (lookup_all_conversions): Declare.
2142 * class.c (get_basefndecls): Use lookup_fnfields_slot.
2143 * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
2144 * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
2146 * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
2147 (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
2148 lookup_all_conversions.
2149 * search.c (lookup_fnfields_1): Make static.
2150 (lookup_all_conversions): New.
2151 (class_method_index_for_fn): Delete.
2152 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
2153 lookup_fnfields_slot.
2155 * call.c (build_new_method_call_1): Use constructo_name to get
2156 ctor name. Move argument processing earlier to merge cdtor
2158 * decl.c (grokfndecl): Cdtors have special names.
2159 * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
2160 * pt.c (check_explicit_specialization): Cdtor name is already
2162 * search.c (class_method_index_for_fn): Likewise.
2165 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
2166 a matching TYPE_DECL.
2168 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
2170 * class.c (add_method): Change pair of errors to error + inform.
2171 (handle_using_decl): Likewise.
2173 2017-06-29 Jason Merrill <jason@redhat.com>
2175 * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
2177 PR c++/81180 - ICE with C++17 deduction of member class template.
2178 * pt.c (build_deduction_guide): Correct member template handling.
2180 PR c++/81188 - matching decltype of member function call.
2181 * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
2183 2017-06-29 Nathan Sidwell <nathan@acm.org>
2186 * parser.c (cp_parser_namespace_definition): Immediately close the
2187 namespace if there's no open-brace.
2188 * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
2191 2017-06-29 Jason Merrill <jason@redhat.com>
2193 PR c++/81164 - ICE with invalid inherited constructor.
2194 * search.c (binfo_direct_p): New.
2195 * name-lookup.c (do_class_using_decl): Use it.
2197 2017-06-29 Nathan Sidwell <nathan@acm.org>
2199 * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
2200 VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
2201 * decl.c (initialize_predefined_identifiers): Name cdtor special
2202 names consistently. Use literals for above deleted defines.
2203 (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
2205 * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
2208 * call.c (check_dtor_name): Use constructor_name for enums too.
2209 (build_new_method_call_1): Use constructor_name for cdtors and
2211 * class.c (build_self_reference): Use TYPE_NAME to get name of
2213 * name-lookup (constructor_name): Use DECL_NAME directly.
2214 (constructor_name_p): Reimplement.
2215 (push_class_level_binding_1): Use TYPE_NAME directly.
2217 * class.c (finish_struct): Use OVL_P.
2218 (get_vfield_name): Measure constructor_name length.
2219 * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
2220 (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
2221 * cxx-pretty-print.c (is_destructor_name): Delete.
2222 (pp_cxx_unqualified_id): Remove bogus destructor name checking.
2223 * decl.c (grokfndecl): Move cheap checks first when looking for
2224 implicit extern cness.
2226 * parser.c (cp_parser_direct_declarator): Reorder if to avoid
2227 indentation. Remove unnecessary assignment of constructor name.
2229 Whitespace cleanups.
2230 * call.c (name_as_c_string): Move CONST_CAST to return.
2231 (build_new_method_call_1): Remove unneeded bracing.
2232 * class.c (include_empty_classes): Unbreak line.
2233 * constraint.cc (tsubst_check_constraint): Add space.
2234 * cp-tree.h (lang_decl_ns): Add comment.
2235 (PTRMEM_CST_MEMBER): Break line.
2236 * decl.c (grokfndecl): Add blank lines. Unbreak some others.
2237 (grokdeclarator): Remove lines, move declaration to first use.
2238 * decl2.c (decl_needed_p): Fix indentation.
2239 (c_parse_final_cleanups): Remove blank line.
2240 * method.c (implicitly_declare_fn): Move declaration to first use.
2241 * search.c (current_scope): Add blank lines.
2243 2017-06-28 Jason Merrill <jason@redhat.com>
2245 PR c++/72764 - ICE with invalid template typename.
2246 * decl.c (build_typename_type): No longer static.
2247 * tree.c (strip_typedefs): Use it instead of make_typename_type.
2249 PR c++/69300 - ICE with self-referential noexcept
2250 * pt.c (maybe_instantiate_noexcept): Check for recursion.
2252 PR c++/61022 - error with variadic template template parm
2253 * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
2255 PR c++/72801 - ICE with variadic partial specialization
2256 * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
2258 PR c++/55639 - partial specialization with ::template
2259 * parser.c (cp_parser_class_head): Handle ::template.
2261 PR c++/45976 - error with ::template in declarator.
2262 * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
2264 PR c++/54769 - wrong lookup of dependent template-name.
2265 * parser.c (cp_parser_template_name): Handle dependent object type.
2266 (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
2268 (cp_parser_id_expression): Pass it.
2269 (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
2271 * parser.c (cp_parser_template_id): Use the range location on the
2274 PR c++/81204 - parse error with dependent template-name
2275 * parser.c (cp_parser_lookup_name): Disqualify function templates
2278 2017-06-27 Nathan Sidwell <nathan@acm.org>
2280 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
2281 initialization point. Don't unnecessarily check for ctor name.
2283 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
2284 (CLASSTYPE_DESTRUCTOR): ... this.
2285 * class.c (accessible_nvdtor_p,
2286 maybe_warn_about_overly_private_class,
2287 add_implicitly_declared_members,
2288 clone_constructors_and_destructors, type_has_virtual_destructor):
2289 Adjust for CLASSTYPE_DESTRUCTOR.
2290 (deduce_noexcept_on_destructors): Absorb into ...
2291 (check_bases_and_members): ... here.
2292 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
2293 * init.c (build_delete): Likewise.
2294 * parser.c (cp_parser_lookup_name): Likewise.
2295 * pt.c (check_explicit_specialization): Likewise.
2296 * rtti.c (emit_support_tinfos): Likewise.
2297 * search.c (lookup_fnfields_idx_nolazy): Likewise.
2299 Kill IDENTIFIER_TEMPLATE.
2300 * cp-tree.h (lang_identifier): Remove class_template_info field.
2301 (IDENTIFIER_TEMPLATE): Delete.
2302 * name-lookup.c (constructor_name_full): Subsume into ...
2303 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
2304 (constructor_name_p): Likewise.
2305 * mangle.c (write_source_name): Likewise.
2306 * ptree.c (cxx_print_identifier): Likewise.
2308 2017-06-27 Marek Polacek <polacek@redhat.com>
2311 * parser.c (cp_parser_already_scoped_statement): Initialize
2314 2017-06-26 Jason Merrill <jason@redhat.com>
2316 PR c++/81215 - deduction failure with variadic TTP.
2317 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
2319 2017-06-26 Martin Sebor <msebor@redhat.com>
2322 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
2323 to detect casting away cv-qualifiers.
2325 2017-06-26 Nathan Sidwell <nathan@acm.org>
2327 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
2328 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
2330 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
2331 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
2332 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
2333 * decl.c (grok_op_properties): Adjust identifier checking.
2334 * init.c (expand_default_init): Adjust identifier descision.
2335 * method.c (implicitly_declare_fn): Don't use
2336 DECL_ASSIGNMENT_OPERATOR_P.
2337 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
2339 * call.c (in_charge_arg_for_name): Reimplement.
2340 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
2343 2017-06-26 Marek Polacek <polacek@redhat.com>
2346 * parser.c (cp_parser_statement): Add a default argument. Save the
2347 location of the expression-statement after labels have been parsed.
2348 (cp_parser_implicitly_scoped_statement): Set the location of the
2349 body of the conditional after parsing all the labels. Call
2350 warn_for_multistatement_macros.
2351 (cp_parser_already_scoped_statement): Likewise.
2353 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
2356 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
2357 'typename' in error messages about missing 'typename'.
2359 2017-06-23 Jason Merrill <jason@redhat.com>
2361 PR c++/79056 - C++17 ICE with invalid template syntax.
2362 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
2364 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
2365 * pt.c (template_placeholder_p): New.
2366 * cp-tree.h: Declare it.
2368 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
2370 * decl.c (duplicate_decls): Use builtin_structptr_types.
2372 2017-06-22 Nathan Sidwell <nathan@acm.org>
2374 Reorder IDENTIFIER flags
2376 * cp-tree.h (enum cp_identifier_kind): New.
2377 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
2378 IDENTIFIER_KIND_BIT_2): New.
2379 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
2380 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
2381 (C_IS_RESERVED_WORD): Replace with ...
2382 (IDENTIFIER_KEYWORD_P): ... this.
2383 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
2384 (IDENTIFIER_CDTOR_P): ... this.
2385 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
2386 (IDENTIFIER_OPNAME_P): Replace with ...
2387 (IDENTIFIER_ANY_OP_P): ... this.
2388 (IDENTIFIER_ASSIGN_OP_P): New.
2389 (IDENTIFIER_TYPENAME_P): Replace with ...
2390 (IDENTIFIER_CONV_OP_P): ... this.
2391 (NEW_DELETE_OPNAME_P): Replace with ...
2392 (IDENTIFIER_NEWDEL_OP_P): ... this.
2393 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
2394 (get_identifier_kind_name, set_identifier_kind): Declare.
2395 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
2396 (init_operators): Adjust to avoid keywords, use
2397 set_identifier_kind. Copy TYPE_EXPR slot.
2398 (init_reswords): Call set_identifier_kind.
2399 (unqualified_name_lookup_error): Adjust.
2400 * operators.def (TYPE_EXPR): Remove.
2401 * decl.c (struct predefined_identifier): Move into ...
2402 (initialize_predefined_identifiers): ... here. Call
2403 set_identifier_kind.
2404 (grokfndecl, check_var_type, grokdeclarator): Adjust.
2405 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
2407 * call.c (name_as_c_string): Adjust.
2408 (build_new_method_call_1): Likewise.
2409 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
2410 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
2411 * dump.c (cp_dump_tree): Adjust.
2412 * error.c (dump_decl_name): Adjust.
2413 * mangle.c (write_unqualified_id, write_member_name,
2414 write_expression): Adjust.
2415 (mangle_conv_op_name_for_type): Use set_identifier_kind.
2416 * name-lookup.c (do_class_using_decl): Adjust.
2417 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
2418 * parser.c (cp_lexer_get_preprocessor_token,
2419 cp_parser_direct_declarator): Likewise.
2420 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
2421 tsubst_copy, tsubst_copy_and_build): Adjust.
2422 * ptree.c (cxx_print_identifier): Print identifier kind.
2423 * search.c (lookup_field_r, lookup_member,
2424 lookup_fnfields_idx_nolazy): Adjust.
2425 * semantics.c (finish_id_expression): Adjust..
2426 * typeck.c (cp_build_addr_expr_1): Adjust.
2428 2017-06-21 Jakub Jelinek <jakub@redhat.com>
2431 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
2432 Complain about t not being a variable if t is OVERLOAD even
2433 when processing_template_decl.
2435 2017-06-21 David Malcolm <dmalcolm@redhat.com>
2437 * parser.c (get_cast_suggestion): New function.
2438 (maybe_add_cast_fixit): New function.
2439 (cp_parser_cast_expression): Capture the location of the closing
2440 parenthesis. Call maybe_add_cast_fixit when emitting warnings
2441 about old-style casts.
2443 2017-06-20 Jason Merrill <jason@redhat.com>
2445 PR c++/80972 - C++17 ICE with attribute packed.
2446 * call.c (build_over_call): Allow a TARGET_EXPR from reference
2449 2017-06-20 Nathan Sidwell <nathan@acm.org>
2451 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
2452 (nelts_identifier): Delete.
2453 * decl.c (initialize_predefined_identifiers): Remove nelts.
2455 PR c++/67074 - namespace aliases
2456 * decl.c (duplicate_decls): Don't error here on mismatched
2458 * name-lookup.c (name_lookup::add_value): Matching namespaces are
2460 (diagnose_name_conflict): Namespaces are never redeclarations.
2461 (update_binding): An alias can match a real namespace.
2463 2017-06-19 Jason Merrill <jason@redhat.com>
2465 PR c++/80562 - ICE with constexpr if.
2466 * semantics.c (finish_if_stmt_cond): Call
2467 instantiate_non_dependent_expr.
2469 PR c++/80829 - ICE with constexpr copy of base subobject.
2470 * constexpr.c (clear_no_implicit_zero): New.
2471 (cxx_eval_call_expression): Call it.
2473 2017-06-19 Nathan Sidwell <nathan@acm.org>
2477 * name-lookup.c (set_decl_namespace): Don't follow using
2478 directives and ignore using decls. Only check overly-explicit
2479 scope after discovering decl.
2481 2017-06-19 Jason Merrill <jason@redhat.com>
2483 PR c++/81073 - constexpr and static var in statement-expression.
2484 * typeck2.c (store_init_value): Always call
2485 require_potential_constant_expression.
2486 * pt.c (convert_nontype_argument): Likewise.
2487 * constexpr.c (potential_constant_expression_1): Adjust message.
2488 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
2489 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
2491 2017-06-19 Nathan Sidwell <nathan@acm.org>
2493 * pt.c (coerce_template_parms): Fix indentation.
2494 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
2498 * name-lookup.c (update_binding): Only warn about constructors
2499 hidden by functions.
2501 2017-06-17 Jason Merrill <jason@redhat.com>
2503 PR c++/60063 - -Wunused-local-typedefs and templates.
2504 * decl2.c (is_late_template_attribute): Return false for "used".
2506 PR c++/70844 - -Wuseless-cast and inheriting constructor.
2507 * method.c (forward_parm): Suppress warn_useless_cast.
2509 2017-06-16 Jason Merrill <jason@redhat.com>
2511 PR c++/81045 - Wrong type-dependence with auto return type.
2512 * pt.c (type_dependent_expression_p): An undeduced auto outside the
2513 template isn't dependent.
2514 * call.c (build_over_call): Instantiate undeduced auto even in a
2517 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
2518 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
2519 set longer for a generic lambda.
2521 PR c++/80614 - Wrong mangling for C++17 noexcept type
2522 * mangle.c (write_type): Put the eh spec back on the function type.
2524 PR c++/81102 - Wrong error with partial specialization.
2525 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
2526 types. Do type deduction later.
2528 PR c++/81074 - ICE with partial specialization of member template.
2530 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
2532 PR c++/80831 - ICE with -fsyntax-only.
2533 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
2535 PR c++/80639 - ICE with invalid PMF initialization.
2536 PR c++/80043 - ICE with -fpermissive
2537 * typeck.c (convert_for_assignment): Recurse when instantiate_type
2538 returns without an error.
2540 2017-06-16 Nathan Sidwell <nathan@acm.org>
2542 * pt.c (tsubst_baselink): Fix & clarify formatting.
2544 * cp-tree.h (build_this_parm, cp_build_parm_decl,
2545 build_artificial_parm): Add FN parm.
2546 * decl.c (start_cleanup_fn): Adjust.
2547 (build_this_parm): Add FN parm, pass it through.
2548 (grokfndecl): Adjust parm building.
2549 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
2550 (build_artificial_parm): Add FN parm, pass through.
2551 (maybe_retrofit_in_chrg): Adjust parm building.
2552 (start_static_storage_duration_function): Likwise.
2553 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
2554 * method.c (implicitly_declare_fn): Likewise.
2555 * parser.c (inject_this_parameter): Likewise.
2557 Symbol tables are insert only.
2558 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
2559 derive from pointer_hash. Make undeletable.
2561 * class.c (resort_type_method_vec): Avoid potential unsigned
2564 Don't defer noexcept_deferred_spec.
2565 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
2566 * decl.c (cxx_init_decl_processing): Initialize
2567 noexcept_deferred_spec.
2568 * except.c (unevaluated_noexcept_spec): Delete.
2569 * class.c (deduce_noexcept_on_destructor): Use
2570 noexcept_deferred_spec directly.
2571 * method.c (implicitly_declare_fn): Likewise.
2573 Make keyed_classes a vector.
2574 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
2575 (keyed_classes): Declare as vector.
2576 * decl.c (keyed_classes): Define.
2577 (cxx_init_decl_processing): Allocate it.
2578 (record_key_method_defined): Use vec_safe_push.
2579 * class.c (finish_struct_1): Likewise.
2580 * pt.c (instantiate_class_template_1): Likewise.
2581 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
2584 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
2585 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
2587 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
2588 (get_tinfo_decl): Use get_tinfo_desc.
2589 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
2590 (create_pseudo_type_info): Delete.
2591 (get_pseudo_ti_index): Just determine the index.
2592 (get_tinfo_desc): New. Create all types lazily.
2593 (create_tinfo_types): Just allocate the descriptor array.
2594 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
2597 2017-06-15 Martin Sebor <msebor@redhat.com>
2600 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
2602 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
2603 (build_cxx_call): Call maybe_warn_class_memaccess.
2605 2017-06-14 Jakub Jelinek <jakub@redhat.com>
2607 * cp-gimplify.c (cp_genericize_r): Turn most of the function
2608 into a switch (TREE_CODE (stmt)) statement from long else if
2611 2017-06-13 Jakub Jelinek <jakub@redhat.com>
2614 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
2615 argument even if it has REFERENCE_TYPE.
2618 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
2619 BLOCK_VARS (outer) chain.
2620 (cxx_omp_const_qual_no_mutable): Likewise.
2622 2017-06-13 Martin Liska <mliska@suse.cz>
2625 * class.c (build_base_path): Use sanitize_flags_p.
2626 * cp-gimplify.c (cp_genericize_r): Likewise.
2627 (cp_genericize_tree): Likewise.
2628 (cp_genericize): Likewise.
2629 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2630 * decl.c (compute_array_index_type): Likewise.
2631 (start_preparsed_function): Likewise.
2632 * decl2.c (one_static_initialization_or_destruction): Likewise.
2633 * init.c (finish_length_check): Likewise.
2634 * lambda.c (maybe_add_lambda_conv_op): Likewise.
2635 * typeck.c (cp_build_binary_op): Likewise.
2636 (build_static_cast_1): Likewise.
2638 2017-06-11 Jason Merrill <jason@redhat.com>
2640 * error.c (dump_expr): Use is_this_parameter.
2642 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
2645 2017-06-09 Jason Merrill <jason@redhat.com>
2647 Missing bits from N4268, constant evaluation for all non-type args.
2648 * call.c (build_converted_constant_expr): Rename from
2649 build_integral_nontype_arg_conv, handle all types.
2650 * pt.c (convert_nontype_argument): In C++17 call it for all types.
2651 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
2652 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
2654 Overhaul pointer-to-member conversion and template argument handling.
2655 * call.c (standard_conversion): Avoid creating ck_pmem when the
2656 class type is the same.
2657 * cvt.c (can_convert_qual): Split from
2658 perform_qualification_conversions.
2659 * constexpr.c (cxx_eval_constant_expression): Check it.
2660 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
2661 adjustment is necessary.
2662 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
2663 (convert_nontype_argument): Avoid redundant error.
2665 * call.c (convert_like_real): Remove "inner" parameter.
2666 Don't replace a constant with its value.
2667 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
2669 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
2672 * parser.c (cp_parser_constant_expression): Check
2673 potential_rvalue_constant_expression after decay_conversion.
2674 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
2676 PR c++/80384 - ICE with dependent noexcept-specifier
2677 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
2680 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
2682 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
2684 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
2685 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
2686 (excpet.c): Mark terminate as cold.
2688 2017-06-08 Jakub Jelinek <jakub@redhat.com>
2691 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
2692 to sizetype before size_binop.
2695 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
2696 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
2697 and OMP_CLAUSE_SHARED_READONLY flags.
2699 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
2701 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
2703 2017-06-07 Nathan Sidwell <nathan@acm.org>
2705 * class.c (layout_class_type): Restructure overlong-bitfield tpe
2708 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
2711 * pt.c (do_class_deduction): Build qualified type.
2713 2017-06-06 Nathan Sidwell <nathan@acm.org>
2715 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
2716 sans using directives. Don't walk into inline namespaces.
2719 * name-lookup.c (adl_class_only): Don't add visible friends.
2721 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
2723 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
2725 2017-06-02 Nathan Sidwell <nathan@acm.org>
2727 Remove lang_type_ptrmem.
2728 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
2730 (lang_type_class): ... this. Reorder bitfields. Rename to ...
2731 (lang_type): ... this. Delete old definition.
2732 (lang_type_ptrmem): Delete.
2733 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
2734 (LANG_TYPE_PTRMEM_CHECK): Delete.
2735 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
2736 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
2737 * decl.c (build_ptrmemfunc_type): Adjust.
2738 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
2739 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
2741 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
2744 Remove cp_binding_level::namespaces
2745 * name-lookup.h (cp_binding_level): Lose namespaces field.
2746 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
2748 (suggest_alternatives_for): Adjust for namespace list. Do
2749 breadth-first search.
2750 * decl2.c (collect_source_refs): Namespaces are on the regulr
2752 (collect_ada_namespace): Likewise.
2754 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
2756 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
2759 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
2762 * method.c (constructible_expr): Strip array types before calling
2765 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
2768 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
2769 for case INDIRECT_REF too in the main switch.
2771 2017-05-31 Jason Merrill <jason@redhat.com>
2773 PR c++/80840 - ICE with constexpr and reference
2774 * pt.c (convert_nontype_argument): Don't test whether a decl is
2775 value-dependent when binding to a reference.
2777 2017-05-31 Nathan Sidwell <nathan@acm.org>
2779 * cp-tree.h (lang_decl_slector): New enum.
2780 (lang_decl_base): Make selector an enum. Drop decomposition_p
2782 (lang_decl): Use enum for discrimination.
2783 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
2784 LANG_DECL_DEOMP_CHECK): Use enum.
2785 (DECL_DECOMPOSITION_P): Use selector value.
2786 (SET_DECL_DECOMPOSITION_P): Delete.
2787 (retrofit_lang_decl): Lose SEL parm.
2788 (fit_decomposition_lang_decl): Declare.
2789 * decl.c (cp_finish_decomp, grokdeclarator): Use
2790 fit_decomposition_lang_decl.
2791 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
2793 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
2794 (fit_decomposition_lang_decl): Likewise.
2795 (retrofit_lang_decl): Use worker functions.
2796 (cxx_dup_lang_specific_decl): Use selector enum.
2797 (maybe_add_lang_type_raw): New. Broken out of ...
2798 (cxx_make_type_name): ... here. Call it.
2800 2017-05-30 Jason Merrill <jason@redhat.com>
2802 PR c++/80856 - ICE with local extern in template
2803 * semantics.c (finish_call_expr): Replace a local extern overload
2804 set in a template with the IDENTIFIER_NODE.
2806 2017-05-30 David Malcolm <dmalcolm@redhat.com>
2808 * call.c (perform_implicit_conversion_flags): Convert
2809 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
2810 (print_conversion_rejection): Replace pairs of %qT with
2811 %qH and %qI in various places.
2812 (build_user_type_conversion_1): Likewise.
2813 (build_integral_nontype_arg_conv): Likewise.
2814 (build_conditional_expr_1): Likewise.
2815 (convert_like_real): Likewise.
2816 (convert_arg_to_ellipsis): Likewise.
2818 (initialize_reference): Likewise.
2819 * cvt.c (cp_convert_to_pointer): Likewise.
2820 (cp_convert_to_pointer): Likewise.
2821 (convert_to_reference): Likewise.
2822 (ocp_convert): Likewise.
2823 * error.c (cp_printer): Gain bool and const char ** parameters.
2824 (struct deferred_printed_type): New struct.
2825 (class cxx_format_postprocessor): New class.
2826 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
2827 to pp->m_format_postprocessor.
2828 (comparable_template_types_p): New function.
2829 (newline_and_indent): New function.
2830 (arg_to_string): New function.
2831 (print_nonequal_arg): New function.
2832 (print_template_differences): New function.
2833 (type_to_string_with_compare): New function.
2834 (print_template_tree_comparison): New function.
2835 (append_formatted_chunk): New function.
2836 (add_quotes): New function.
2837 (cxx_format_postprocessor::handle): New function.
2838 (defer_phase_2_of_type_diff): New function.
2839 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
2841 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
2842 %qH and %qI in various places.
2843 (convert_member_func_to_ptr): Likewise.
2844 (build_reinterpret_cast_1): Likewise.
2845 (convert_for_assignment): Likewise.
2846 * typeck2.c (check_narrowing): Likewise.
2848 2017-05-30 Nathan Sidwell <nathan@acm.org>
2850 Kill IDENTIFIER_NAMESPACE_BINDINGS
2851 * cp-tree.h (lang_identifier): Delete namespace_bindings.
2852 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
2853 (lang_decl_ns): Add bindings.
2854 (DECL_NAMESPACE_BINDINGS): New.
2855 * lex.c (retrofit_lang_decl): Create namespace hash table.
2856 * name-lookup.c (find_namespace_slot): Change to use hash-map.
2857 * ptree.c (cxx_print_binding): Delete.
2858 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
2860 * cp-tree.def (OVERLOAD): Fix comment.
2861 * cp-tree.h: Fix comments and whitespace.
2862 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
2863 * name-lookup.c (add_decl_to_level): Assert not class.
2864 (check_local_shadow): Use OVL_P.
2865 (pushdecl_with_scope_1): Rename to ...
2866 (do_pushdecl_with_Scope): ... here.
2867 (do_nonmember_using_decl): Use qualified_namespace_lookup return
2869 (push_class_level_binding_1): Use OVL_P.
2870 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
2871 (pushtag_1): Rename to ...
2872 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
2874 (store_class_bindings): Do not time here.
2875 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
2876 * pt.c (listify): Declare argvec at point of initialization.
2879 * name-lookup.c (add_decl_to_level): Assert not making a circular
2881 (update_binding): Don't prematurely slide artificial decl.
2883 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
2885 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
2887 2017-05-29 Nathan Sidwell <nathan@acm.org>
2889 PR c++/80891 (#1,#5)
2890 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
2891 * name-lookup.c (name_lookup): Add deduping field.
2892 (name_lookup::preserve_state, name_lookup::restore_state): Deal
2894 (name_lookup::add_overload): New.
2895 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
2896 (name_lookup::search_adl): Set deduping. Don't unmark here.
2897 * pt.c (most_specialized_instantiation): Revert previous change,
2898 Assert not given duplicates.
2899 * tree.c (lookup_mark): Just mark the underlying decls.
2900 (lookup_maybe_add): Dedup using marked decls.
2903 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
2904 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
2906 Stat hack representation
2907 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
2908 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
2910 (find_namespace_binding): Replace with ...
2911 (find_namespace_slot): ... this.
2912 (find_namespace_value): New.
2913 (name_lookup::search_namespace_only,
2914 name_lookup::adl_namespace_only): Adjust.
2915 (update_binding): Add SLOT parameter, adjust.
2916 (check_local_shadow): Use find_namespace_value.
2917 (set_local_extern_decl_linkage): Likewise.
2918 (do_pushdecl): Adjust for namespace slot.
2919 (push_local_binding): Assert not a namespace binding.
2920 (check_for_out_of_scope_variable): Use find_namespace_value.
2921 (set_identifier_type_value_with_scope): Likewise.
2922 (get_namespace_binding): Likewise.
2923 (set_namespace_binding): Delete.
2924 (set_global_binding): Directly update the binding.
2925 (finish_namespace_using_decl): Likewise.
2926 (lookup_type_scope_1): Use find_namespace_slot and update.
2927 (do_push_nested_namespace): Use find_namespace_value.
2930 * pt.c (most_specialized_instantiation): Cope with duplicate
2934 * cp-tree.h (build_min_nt_call_vec): Declare.
2935 * decl.c (build_offset_ref_call_from_tree): Call it.
2936 * parser.c (cp_parser_postfix_expression): Likewise.
2937 * pt.c (tsubst_copy_and_build): Likewise.
2938 * semantics.c (finish_call_expr): Likewise.
2939 * tree.c (build_min_nt_loc): Keep unresolved lookups.
2940 (build_min): Likewise.
2941 (build_min_non_dep): Likewise.
2942 (build_min_non_dep_call_vec): Likewise.
2943 (build_min_nt_call_vec): New.
2946 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
2948 (lookup_keep): Call it.
2950 2017-05-26 Nathan Sidwell <nathan@acm.org>
2953 * name-lookup.c (push_inline_namespaces): New.
2954 (push_namespace): Look inside inline namespaces.
2956 Inline and using namespace representation change.
2957 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
2959 (DECL_NAMESPACE_USING): Adjust.
2960 (DECL_NAMESPACE_INLINEES): New.
2961 * name-lookup.h (struct cp_binding_level): Change usings
2963 * name-lookup.c (name_lookup::do_queue_usings,
2964 name_lookup::queue_usings): Adjust.
2965 (name_lookup::search_namespace, name_lookup::search_usings,
2966 name_lookup::queue_namespace): Adjust.
2967 (name_lookup::adl_namespace_only): Adjust.
2968 (add_using_namespace, push_namespace): Push onto vector.
2969 (pop_namespace): Add timing logic.
2971 * call.c (build_operator_new_call): Do namelookup and ADL here.
2972 (build_new_op_1): Likewise.
2973 * name-lookup.h (lookup_function_nonclass): Delete declaration.
2974 (do_using_directive): Likewise.
2975 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
2977 (struct scope_binding): Delete.
2978 (EMPTY_SCOPE_BINDING): Delete.
2979 (set_decl_namespace): Use OVL_P.
2980 (finish_local_using_decl): Lose unnecesary checks.
2981 (lookup_function_nonclass): Delete.
2982 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
2984 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
2985 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
2987 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
2988 (lkp_iterator): Add outer field. Adjust ctor.
2989 (lkp_iterator::operator++): New.
2990 (lookup_mark, lookup_maybe_add): Declare.
2991 * name-lookup.c (name_lookup): Delete fn_set member.
2992 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
2994 (name_lookup::add_value): Use lookup_add directly.
2995 (name_lookup::add_fns: Use lookup_maybe_add.
2996 (name_lookup::search_adl): Mark and unmark fns.
2998 * pt.c (check_explicit_specialization): Use lookup_add directly.
2999 * ptree.c (cxx_print_xnode): Show complete overload structure.
3000 * tree.c (lookup_mark, lookup_maybe_add): New.
3002 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
3004 2017-05-26 Jakub Jelinek <jakub@redhat.com>
3006 * cp-tree.h (struct lang_decl_decomp): New type.
3007 (struct lang_decl): Add u.decomp.
3008 (LANG_DECL_DECOMP_CHECK): Define.
3009 (DECL_DECOMPOSITION_P): Note it is set also on the vars
3010 for user identifiers.
3011 (DECL_DECOMP_BASE): Define.
3012 (retrofit_lang_decl): Add extra int = 0 argument.
3013 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
3014 use it to influence the selector choices and for selector
3015 0 to non-zero transition copy old content.
3016 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
3017 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
3018 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
3019 wording if decl is a structured binding.
3020 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
3021 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
3022 of individual variables for tuple structured bindings.
3023 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
3024 Clear DECL_DECOMP_BASE.
3025 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
3026 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
3028 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
3031 2017-05-25 Jason Merrill <jason@redhat.com>
3033 PR c++/80605 - __is_standard_layout and zero-length array
3034 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
3036 2017-05-25 Nathan Sidwell <nathan@acm.org>
3038 Kill OVL_CURRENT, OVL_NEXT.
3039 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
3040 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
3041 (consider_binding_level): Use OVL_FIRST.
3042 (cp_emit_debug_info_for_using): Use lkp_iterator.
3043 * pt.c (check_explicit_specialization): Use ovl_iterator.
3045 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
3046 * cp-tree.h (lang_decl_ns): Remove ns_users field.
3047 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
3048 (TREE_INDIRECT_USING): Delete.
3049 * name-lookup.h (is_associated_namespace): Delete.
3050 * name-lookup.c (name_lookup::search_usings,
3051 name_lookup::do_queue_usings): Usings are always direct.
3052 (is_associated_namespace): Delete.
3053 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
3054 (namespace_ancestor_1, namespace_ancestor): Delete.
3055 (push_using_directive_1, push_using_directive): Delete.
3056 (add_using_namespace_1): Delete.
3057 (add_using_namespace): Reimplement.
3058 (emit_debug_info_using_namespace): New.
3059 (finish_namespace_using_directive, finish_local_using_directive,
3060 push_namespace): Adjust.
3061 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
3063 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
3065 * semantics.c (finish_handler_parms): Warn about non-reference type
3068 2017-05-25 Nathan Sidwell <nathan@acm.org>
3070 Reimplement unqualified namespace lookup.
3071 * name-lookup.c (name_lookup::using_pair,
3072 name_lookup::using_queue): New typedefs.
3073 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
3074 name_lookup::queue_usings): New.
3075 (name_lookup::search_unqualified): New.
3076 (merge_functions, same_entity_p, ambiguous_decl,
3077 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
3078 lookup_using_namespace): Delete.
3079 (lookup_name_real_1): Adjust.
3081 Reimplement qualified namespace lookup.
3082 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
3083 (name_lookup::ambiguous, name_lookup::add_value,
3084 name_lookup::add_type, name_lookup::process_binding): New.
3085 (name_lookup::search_namespace_only,
3086 name_lookup::search_namespace, name_lookup::search_usings): New.
3087 (name_lookup::search_qualified): New.
3088 (do_nonmember_using_decl, suggest_alternatives_for,
3089 lookup_qualified_name): Adjust.
3090 (tree_vec_contains): Delete.
3091 (qualified_lookup_using_namespace): Rename to ...
3092 (qualified_namespace_lookup): ... here. Reimplement.
3095 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
3096 * name-lookup.h (lookup_arg_dependent): Return plain tree.
3097 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
3098 arg_assoc_args_vec, arg_assoc_type, add_function,
3099 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
3100 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
3101 lookup_arg_dependent_1): Delete.
3102 (name_lookup): New lookup object.
3103 (name_lookup::preserve_state, name_lookup::restore_state,
3104 name_lookup::mark_seen, name_lookup::find_and_mark,
3105 name_lookup::add_fns, name_lookup::adl_namespace_only,
3106 name_lookup::adl_namespace, name_lookup::adl_class_only,
3107 name_lookup::adl_bases, name_lookup::adl_class,
3108 name_lookup::adl_expr, name_lookup::adl_type,
3109 name_lookup::adl_template_arg, name_lookup::search_adl): New.
3110 (lookup_arg_dependent): Return a plain tree. Adjust.
3111 (is_associated_namespace): Move later.
3113 2017-05-24 Nathan Sidwell <nathan@acm.org>
3115 * friend.c (do_friend): Remove check for existing decl.
3116 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
3117 * name-lookup.c (push_local_binding): Directly look for binding.
3118 (lookup_name_innermost_nonclass_level_1): Delete.
3119 (lookup_name_innermost_nonclass_level): Delete.
3121 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
3123 * cp-tree.h (cp_free_lang_data): Add extern.
3124 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
3126 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
3127 * typeck.c (type_unknown_p): Delete.
3128 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
3129 overload management.
3130 (dependent_name): Likewise.
3131 (decl_anon_ns_mem_p): Simplify.
3133 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
3136 * tree.c (reshape_init): Use unqualified type for direct enum init.
3137 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
3138 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
3139 non-class destination types.
3140 (build_const_cast_1): Strip cv-quals from destination types.
3141 (build_static_cast, build_reinterpret_cast, build_const_cast)
3142 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
3144 2017-05-24 Martin Sebor <msebor@redhat.com>
3147 * call.c (fully_fold_internal): Adjust.
3149 2017-05-24 Nathan Sidwell <nathan@acm.org>
3151 * cp-tree.h (ovl_skip_hidden): Declare.
3152 * tree.c (ovl_skip_hidden): New.
3153 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
3154 (lookup_arg_dependent_1): Likewise.
3155 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
3156 (hidden_name_p, remove_hidden_names): Delete.
3157 (lookup_name_real_1): Do not strip hidden names.
3158 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
3160 * cp-tree.h (OVL_HIDDEN_P): New.
3161 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
3162 (ovl_iterator::reveal_node): Declare.
3163 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
3164 (ovl_insert): Order on hiddenness.
3165 (ovl_iterator::reveal_node): New.
3166 * name-lookup.c (anticipated_builtin_p): New.
3167 (supplement_binding_1): Use it.
3168 (set_local_extern_decl_linkage): Use hidden_p.
3169 (do_pushdecl): Deal with unhiding a hidden decl, use
3170 anticipated_builtin_p.
3171 (do_nonmember_using_decl): Use anticipated_decl_p.
3172 (lookup_name_real_1): Use DECL_HIDDEN_P.
3174 2017-05-23 Jason Merrill <jason@redhat.com>
3176 -Wunused and C++17 structured bindings
3177 * decl.c (poplevel): Don't warn about unused structured bindings,
3178 only real variables.
3179 * error.c (dump_simple_decl): Handle structured bindings.
3180 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
3182 2017-05-23 Nathan Sidwell <nathan@acm.org>
3184 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
3185 * name-lookup.c (create_local_binding): New.
3186 (update_binding): New.
3187 (pushdecl_maybe_friend_1): Rename to ...
3188 (do_pushdecl): ... this. Reimplement.
3190 (push_overloaded_decl_1, push_overloaded_decl): Delete.
3192 2017-05-23 Jason Merrill <jason@redhat.com>
3194 PR c++/80396 - built-in for make_integer_sequence.
3195 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
3196 (expand_integer_pack, expand_builtin_pack_call): New.
3197 (find_parameter_packs_r): Check builtin_pack_call_p.
3198 (check_for_bare_parameter_packs): Handle it.
3199 (tsubst_pack_expansion): Call expand_builtin_pack_call.
3200 (declare_integer_pack): New.
3201 (init_template_processing): Call it.
3202 * decl2.c (mark_used): Check builtin_pack_fn_p.
3204 2017-05-23 Nathan Sidwell <nathan@acm.org>
3206 * name-lookup.c (find_namespace_binding): New.
3207 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
3208 (set_identifier_type_value_with_scope): Use find_namespace_binding.
3209 (find_binding, cp_binding_level_find_binding_for_name,
3210 binding_for_name, namespace_binding_1): Delete.
3211 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
3212 (get_namespace_binding, set_namespace_binding,
3213 finish_namespace_using_decl, unqualified_namespace_lookup_1,
3214 qualified_lookup_using_namespace, lookup_type_scope_1,
3215 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
3218 * parser.c (cp_parser_template_id): Keep the lookup when stashing
3221 * cp-tree.h (DECL_HIDDEN_P): New.
3222 * name-lookup.c (set_decl_context,
3223 set_local_extern_decl_linkage): New, broken out of ...
3224 (pushdecl_maybe_friend_1): ... here. Call them.
3226 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
3228 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
3229 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
3232 2017-05-23 Nathan Sidwell <nathan@acm.org>
3234 * cp-tree.h (OVL_P): New.
3235 * name-lookup.h (push_local_binding): Delete.
3236 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3237 (finish_namespace_using_decl, finish_local_using_decl): ... here
3238 * name-lookup.c (add_decl_to_level): Swap args.
3239 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
3240 (diagnose_name_conflict): Check contexts are same for redecl.
3241 (update_local_overload): New.
3242 (compparms_for_decl_and_using): Rename to ...
3243 (matching_fn_p): ... here.
3244 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
3245 push_local_bindings call.
3246 (push_local_binding): Make static, replace FLAGS arg with
3248 (validate_nonmember_using_decl): Use OVL_FIRST.
3249 (do_nonmember_using_decl): Use in/out parameters. Use
3250 lkp_iterator and simplify.
3251 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3252 (finish_namespace_using_decl, finish_local_using_decl): ... here.
3254 (lookup_type_current_level): Delete.
3255 * parser.c (cp_parser_using_declaration): Adjust.
3256 * pt.c (tsubst_expr): Adjust.
3258 2017-05-22 Nathan Sidwell <nathan@acm.org>
3260 * name-lookup.h (parse_using_directive): Replace with ...
3261 (finish_namespace_using_directive): ... this and ...
3262 (finish_local_using_directive): ... this.
3263 * name-lookup.c (add_using_namespace_1): Move later.
3264 (add_using_namespace): Move later, add namespace_p arg, remove
3266 (push_using_directive_1): Directly recurse.
3267 (do_using_directive, parse_using_directive): Delete, split into ...
3268 (finish_namespace_using_directive): ... this and ...
3269 (finish_local_using_directive): ... this.
3270 (push_namespace): Use add_using_namespace.
3271 * parser.c (cp_parser_using_directive): Call
3272 finish_namespace_using_directive or finish_local_using_directive.
3273 * pt.c (tsubst_expr): Call finish_local_using_directive.
3275 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
3276 * cp-tree.h (raw_dump_id): Declare.
3277 * decl2.c (raw_dump_id): Define.
3278 (dump_tu): Use raw_dump_id.
3280 * config-lang.in (gtfiles): Sort list, break lines.
3282 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
3283 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
3284 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
3285 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
3286 CPTI_RETHROW_FN): New.
3287 (noexcept_deferred_spec): New.
3288 (terminate_node, call_unexpected_node): Rename to ...
3289 (terminate_fn, call_unexpected_fn): ... here.
3290 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
3291 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
3292 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
3293 (init_exception_processing): Adjust.
3294 (declare_library_fn): Create and push the fns here.
3295 (do_get_exception_ptr, do_begin_catch, do_end_catch,
3296 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
3297 declare_library_fn use.
3298 (unevaluated_noexcept_spec): Adjust.
3299 * cp-gimplify.c (genericize_eh_spec_block,
3300 gimplify_most_not_throw_expr): Adjust.
3302 * name-lookup.c (pushdecl_top_level,
3303 pushdecl_top_level_and_finish): Move after namespace pushing and
3305 (push_to_top_level): Rename to ...
3306 (do_push_to_top_level): ... here. Remove timing code.
3307 (pop_from_top_level_1): Rename to ...
3308 (do_pop_from_top_level): ... here.
3309 (do_push_nested_namespace, do_pop_nested_namespace)
3310 (push_to_top_level): New wrapper for do_push_to_top_level.
3311 (pop_from_top_level): Adjust.
3312 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
3314 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
3316 * config-lang.in (gtfiles): Add c-family/c-format.c,
3317 except.c, init.c, lambda.c and friend.c.
3318 * class.c (dvirt_fn): Move out of function scope,
3320 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
3321 * init.c (fn): Likewise.
3322 * lambda.c (ptr_id, max_id): Likewise.
3323 * friend.c (global_friend): Add GTY attribute.
3325 2017-05-19 Nathan Sidwell <nathan@acm.org>
3327 * call.c (add_list_candidates): Use OVL_FIRST.
3328 (build_new_method_call_1): Likewise.
3329 * cp-tree.h (OVL_SINGLE_P): New.
3330 (TYPE_HIDDEN_P): New.
3331 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
3332 * dump.c (cp_tump_tree): Adjust overload dumping.
3333 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
3335 * method.c (lazily_declare_fn): Assert we added it.
3336 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
3338 (cp_parser_template_name): Use lkp_iterator.
3339 * pt.c (begin_template_parm_list): Fixup comment.
3340 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
3341 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
3342 (ovl_scope): Use lkp_iterator.
3344 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
3346 * parser.c (cp_parser_omp_clause_default): Handle
3347 "OMP_CLAUSE_DEFAULT_PRESENT".
3349 * parser.c (cp_parser_omp_clause_default): Avoid printing more
3350 than one syntax error message.
3352 2017-05-19 Nathan Sidwell <nathan@acm.org>
3354 * class.c (class_dump_id): Define.
3355 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
3356 * cp-objcp-common.c (cp_register_dumps): New.
3357 * cp-objcp-common.h (cp_register_dumps): Declare.
3358 (LANG_HOOKS_REGISTER_DUMPS): Override.
3359 * cp-tree.h (class_dump_id): Declare.
3361 2017-05-18 Nathan Sidwell <nathan@acm.org>
3363 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
3365 (lookup_keep): Declare.
3366 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
3367 * pt.c (tsubst_copy): Assert lookup is persistent.
3368 * semantics.c (finish_call_expr): Use lkp_iterator, call
3370 * tree.c (ovl_copy): New.
3371 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
3374 * cp-tree.h (OVL_USED): Replace with ...
3375 (OVL_USING_P): ... this.
3376 (ovl_iterator::using_p): Adjust.
3377 * name-lookup.c (push_overloaded_decl_1,
3378 do_nonmember_using_decl): Adjust.
3379 * search.c (lookup_field_r): Adjust.
3380 * tree.c (ovl_insert, ovl_scope): Adjust.
3382 * cp-tree.h (lookup_add): Swap args.
3383 (ovl_cons, build_overload): Delete.
3384 * name-lookup.c (add_function, push_overloaded_decl_1,
3385 do_nonmember_using_decl, merge_functions, remove_hidden_names):
3386 Use lookup_add, ovl_insert.
3387 * pt.c (check_explicit_specialization): Use lookup_add.
3388 (do_class_deduction): Likewise. Refactor if.
3389 * tree.c (lookup_add): Swap args.
3390 (ovl_cons, build_overload): Delete.
3392 * name-lookup.c (find_local_binding): New, broken out of ...
3393 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
3394 (set_namespace_binding): Swap scope & name args.
3395 (namespace_binding_1): Likewise.
3396 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
3397 (push_overloaded_decl_1): Likewise.
3398 (set_global_binding): Likewise.
3399 (get_namespace_binding): Adjust namespace_binding_1 call.
3401 2017-05-17 Nathan Sidwell <nathan@acm.org>
3403 * cp-tree.h (default_hash_traits <lang_identifier *>): New
3405 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
3406 (extern_c_fns): New hash table.
3407 (check_extern_c_conflict): New, broken out of ...
3408 (pushdecl_maybe_friend_1): ... here. Call it.
3409 (c_linkage_bindings): Just look in hash table.
3411 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
3415 Implement new C++ intrinsics __is_assignable and __is_constructible.
3416 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
3418 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3419 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3420 * method.c (constructible_expr): Set cp_unevaluated.
3421 (is_xible_helper): New.
3422 (is_trivially_xible): Adjust.
3424 * parser.c (cp_parser_primary_expression): Handle
3425 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
3426 (cp_parser_trait_expr): Likewise.
3427 * semantics.c (trait_expr_value): Handle
3428 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3430 2017-05-17 Nathan Sidwell <nathan@acm.org>
3432 * cp-tree.h (ovl_iterator::using_p): New predicate.
3433 (ovl_iterator::remove_node): New worker.
3434 (ovl_insert): Declare.
3435 * tree.c (ovl_insert): New.
3436 (ovl_iterator::remove_node): New.
3437 * class.c (add_method): Use ovl_iterator, ovl_insert.
3438 (clone_function_decl): Fix description.
3439 (clone_constructors_and_destructors): Use ovl_iterator.
3441 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
3442 (maybe_warn_about_overly_private_class): Use ovl_iterator.
3443 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
3444 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
3445 (get_base_fndecls): Use ovl_iterator.
3446 (warn_hidden): Use OVL_NAME, ovl_iterator.
3447 (add_implicitly_declared_members): Use ovl_iterator.
3448 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
3450 (finish_shorthand_constraint): Simplify, use ovl_make.
3451 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
3452 * search.c (shared_member_p): Use ovl_iterator.
3453 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
3454 (lookup_conversion_operator): Use OVL_FIRST.
3455 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
3456 (look_for_overrides_here): Use ovl_iterator.
3457 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
3458 * typeck.c (build_x_unary_op): Use ovl_make.
3460 2017-05-17 Martin Liska <mliska@suse.cz>
3462 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
3463 use it instead of int type.
3464 (dump_vtable): Likewise.
3465 (dump_vtt): Likewise.
3466 * decl2.c (dump_tu): Likewise.
3468 2017-05-16 David Malcolm <dmalcolm@redhat.com>
3470 * call.c (enforce_access): Add access_failure_info * param and use
3471 it to record access failures.
3472 * cp-tree.h (class access_failure_info): New class.
3473 (enforce_access): Add access_failure_info * param, defaulting to
3475 (lookup_member): Likewise.
3476 (locate_field_accessor): New function decl.
3477 (perform_or_defer_access_check): Add access_failure_info * param,
3479 * search.c (lookup_member): Add access_failure_info * param and
3480 pass it on to call to perform_or_defer_access_check.
3481 (matches_code_and_type_p): New function.
3482 (field_access_p): New function.
3483 (direct_accessor_p): New function.
3484 (reference_accessor_p): New function.
3485 (field_accessor_p): New function.
3486 (struct locate_field_data): New struct.
3487 (dfs_locate_field_accessor_pre): New function.
3488 (locate_field_accessor): New function.
3489 * semantics.c (perform_or_defer_access_check): Add
3490 access_failure_info * param, and pass it on to call to
3492 * typeck.c (access_failure_info::record_access_failure): New method.
3493 (access_failure_info::maybe_suggest_accessor): New method.
3494 (finish_class_member_access_expr): Pass an access_failure_info
3495 instance to the lookup_member call, and call its
3496 maybe_suggest_accessor method afterwards.
3498 2017-05-16 Marek Polacek <polacek@redhat.com>
3502 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
3504 2017-05-16 Nathan Sidwell <nathan@acm.org>
3506 * name-lookup.c (check_local_shadow): New, broke out of ...
3507 (pushdecl_maybe_friend_1): ... here. Call it.
3509 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
3510 (ovl_first): Move inline definition to end of file.
3511 (ovl_make, lookup_add): Declare.
3512 (get_fns, get_first_fn): Make pure.
3513 * tree.c (ovl_cache): New.
3514 (ovl_make, lookup_add): New.
3515 * pt.c (do_class_deduction): Don't add candidates that will be
3518 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
3519 (print_error_for_call_failure): Use OVL_NAME.
3520 (build_op_call_1): Use ovl_iterator.
3521 (add_candidates): Use OVL_FIRST & lkp_iterator.
3522 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
3524 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
3525 (type_has_user_nondefault_constructor,
3526 in_class_defaulted_default_constructor,
3527 type_has_user_provided_constructor,
3528 type_has_user_provided_or_explicit_constructor,
3529 type_has_non_user_provided_default_constructor,
3530 vbase_has_user_provided_move_assign,
3531 type_has_move_constructor, type_has_move_assign,
3532 type_has_user_declared_move_constructor,
3533 type_has_user_declared_move_assign,
3534 type_build_ctor_call, type_build_dtor_call,
3535 type_requires_array_cookie, explain_non_literal_class): Likewise.
3536 (finish_struct): Use lkp_iterator.
3537 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
3538 (note_name_declared_in_class): Use OVL_NAME.
3539 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
3540 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
3541 cxx_pretty_printer::expression): Likewise.
3542 * decl2.c (check_classfn): Use ovl_iterator.
3543 * pt.c (retrieve_specialization): Use ovl_iterator.
3544 * tree.c (cp_tree_equal): Use lkp_iterator.
3545 (type_has_nontrivial_copy_init): Use ovl_iterator.
3547 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
3548 check is_overloaded_fn.
3550 2017-05-16 Martin Liska <mliska@suse.cz>
3552 * parser.c (cp_lexer_print_token): Add default value for flags
3553 argument of print_gimple_stmt, print_gimple_expr,
3554 print_generic_stmt and print_generic_expr.
3556 2017-05-16 Nathan Sidwell <nathan@acm.org>
3558 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
3560 (MAYBE_BASELINK_FUNCTIONS): New.
3561 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
3562 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
3563 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
3564 * method.c (inherited_ctor_binfo): Use ovl_iterator.
3565 (binfo_inherited_from): Likewise.
3566 * parser.c (lookup_literal_operator): Use lkp_iterator.
3567 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
3568 (print_candidates_1): Likewise.
3569 (determine_specialization): Likewise.
3570 (resolve_overloaded_unification): Likewise.
3571 (resolve_nondeduced_context): Likewise.
3572 (type_dependent_expression_p): Likewise.
3573 (dependent_template_p): Likewise.
3574 * ptree.c (cxx_print_xnode): Likewise.
3575 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
3576 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
3577 * typeck.c (check_template_keyword): Use lkp_iterator.
3579 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
3581 * constexpr.c (function_concept_check): Use OVL_FIRST.
3582 * cvt.c (build_expr_type_conversion): Likewise.
3583 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
3584 * decl2.c (mark_used): Use OVL_FIRST.
3585 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
3586 (dump_expr, location_of): Use OVL_FIRST.
3587 * friend.c (do_friend): Use OVL_NAME.
3588 * init.c (build_offset_ref): Use OVL_FIRST.
3589 * mangle.c (write_member_name): Likewise.
3590 (write_expression): Use OVL_NAME.
3591 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
3592 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
3593 * pt.c (check_explicit_specialization): Use OVL_FIRST.
3594 (check_template_shadow): Likewise.
3595 (tsubst_template_args): Use OVL_NAME.
3596 (tsubst_baselink): Use OVL_FIRST.
3597 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
3598 * tree.c (get_first_fn): Use OVL_FIRST.
3599 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
3600 (cp_build_addr_expr_1): Use OVL_FIRST.
3602 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
3604 * semantics.c (finish_id_expression): Directly init local var.
3605 (finish_omp_reduction_clause): Use really_overloaded_fn.
3606 * tree.c (get_fns): Document. Assert we got an overload.
3607 (get_first_fn) Document.
3608 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
3609 really_overloaded_fn.
3610 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
3612 * cp-tree.h (SCOPE_DEPTH): New.
3613 * name-lookup.h (is_nested_namespace): Declare.
3614 * name-lookup.c (is_nested_namespace): New.
3615 (is_ancestor): Use it.
3616 (set_decl_namespace): Likewise.
3617 (push_namespace): Set SCOPE_DEPTH.
3618 * pt.c (check_specialization_namespace): Use is_nested_namespace.
3619 (check_unqualigied_spec_or_inst): Likewise.
3621 2017-05-15 Nathan Sidwell <nathan@acm.org>
3624 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
3625 * name-lookup.h (push_namespace): Return int, add make_inline arg.
3626 * name-lookup.c (push_namespace): Deal with inline directly.
3627 Return pushed count.
3628 * parser.c (cp_parser_namespace_definition): Adjust for
3629 push_namespace change.
3631 2017-05-11 Nathan Sidwell <nathan@acm.org>
3633 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
3634 LANG_HOOKS_PUSHDECL): Move to ...
3635 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
3636 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
3637 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
3639 * name-lookup.h (pushdecl): Add default friend parm.
3640 (pushdecl_maybe_friend): Delete.
3641 (pushdecl_top_level): Add default friend parm.
3642 (pushdecl_top_level_maybe_friend): Delete.
3643 * name-lookup.c (pushdecl_maybe_friend): Delete.
3644 (pushdecl): Add is_friend parm.
3645 (pushdecl_top_level): Add is friend_parm.
3646 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
3647 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
3648 * friend.c (do_friend): Adjust.
3649 * pt.c (tsubst_friend_class): Adjust.
3651 Revert pushdecl_top_level_and_finish name change.
3652 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
3653 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
3654 * decl.c (cp_make_fname_decl): Adjust.
3655 * decl2.c (get_guard, handle_tls_init): Adjust.
3656 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
3658 * name-lookup.c (pushdecl_outermost_localscope): Always
3659 conditionally stop timer.
3661 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
3662 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
3664 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
3665 pushtag_top_level_maybe_friend,
3666 pushdecl_top_level_and_finish): Move declarations to ...
3667 * name-lookup.h: ... here. Group pushdecl variants.
3668 (pushdecl_top_level_and_finish): Rename to ...
3669 (pushdecl_top_level_with_init): ... here.
3670 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
3671 * decl2.c (get_guard, handle_tls_init): Likewise.
3672 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
3673 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
3674 * method.c (implicitly_declare_fn): Likewise.
3675 * searchc (node_debug_info_needed): Likewise.
3676 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
3677 (pushdecl_top_level_with_init): ... here.
3678 (pop_everything): Use namespace_bindings_p.
3680 * name-lookup.h (pop_binding): Rename to pop_local_binding.
3681 (getdecls): Rename to get_local_decls.
3682 * name-lookup.c (pop_binding): Rename to ...
3683 (pop_local_binding): ... here.
3684 (pop_bindings_and_leave_scope): Adjust.
3685 (getdecls): Rename to ...
3686 (get_local_decls): ... here. Assert local scope.
3687 * decl.c (poplevel): Assert not namespace. Adjust and simplify
3689 (store_parm_decls): Adjust get_local_decls call.
3690 (parser.c (synthesize_implicit_template_parm): Likewise.
3692 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
3695 * method.c (is_trivially_xible): Reject void types.
3697 2017-05-10 Nathan Sidwell <nathan@acm.org>
3699 * class.c (handle_using_decl): Always use OVL_CURRENT.
3700 (resolve_address_of_overloaded_function): Move iterator decl into
3701 for scope. Don't strip anticipated decls here.
3703 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
3705 (print_candidates): Adjust.
3707 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
3709 * call.c (build_new_function_call): Lose koenig_p arg. Remove
3710 koenig_p handling here.
3711 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
3712 (tsubst_omp_clauses): Likewise.
3713 (do_class_deduction): Adjust buld_new_function_call calls.
3714 * semantics.c (finish_call_expr): Likewise.
3716 2017-05-10 Jason Merrill <jason@redhat.com>
3718 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
3719 (unify_type_mismatch, unify_parameter_pack_mismatch)
3720 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
3721 (unify_parameter_pack_inconsistent, unify_inconsistency)
3722 (unify_vla_arg, unify_method_type_error, unify_arity)
3723 (unify_arg_conversion, unify_no_common_base)
3724 (unify_inconsistent_template_template_parameters)
3725 (unify_template_deduction_failure)
3726 (unify_template_argument_mismatch)
3727 (unify_overload_resolution_failure): Call unify_invalid.
3729 CWG 1847 - Clarifying compatibility during partial ordering
3730 * pt.c (more_specialized_fn): No order between two non-deducible
3733 * pt.c (dependent_type_p): Make sure we aren't called with
3736 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3737 * pt.c (convert_template_argument): Just return an argument pack.
3738 (coerce_template_parameter_pack, template_parm_to_arg)
3739 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
3740 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
3741 Don't set the type of a NONTYPE_ARGUMENT_PACK.
3742 * parser.c (make_char_string_pack, make_string_pack): Likewise.
3744 2017-05-10 Nathan Sidwell <nathan@acm.org>
3746 * cp-tree.h (add_method, clone_function_decl): Change last arg to
3748 * class.c (add_method): Change third arg to bool. Adjust.
3749 (one_inheriting_sig, one_inherited_ctor): Adjust.
3750 (clone_function_decl): Change 2nd arg to bool. Adjust.
3751 (clone_constructors_and_destructors): Adjust.
3752 * lambda.c (maybe_add_lambda_conv_op): Adjust.
3753 * method.c (lazily_declare_fn): Adjust.
3754 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
3755 * semantics.c (finish_member_declaration): Adjust.
3757 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
3760 * decl.c (finish_function): To improve error recovery, change the
3761 logic for calling apply_deduced_return_type.
3763 2017-05-09 Jason Merrill <jason@redhat.com>
3765 PR c++/80605 - __is_standard_layout and empty base
3766 * class.c (check_bases): Ignore empty bases.
3768 PR c++/70979 - literal class and closure types
3769 * class.c (finalize_literal_type_property): Handle closures
3771 (explain_non_literal_class): Likewise.
3773 PR c++/66297, DR 1684 - literal class and constexpr member fns
3774 * constexpr.c (is_valid_constexpr_fn): Only complain about
3775 non-literal enclosing class in C++11.
3776 * class.c (finalize_literal_type_property): Likewise.
3778 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
3781 * pt.c (tsubst_decl): Early return error_mark_node if
3782 grok_ctor_properties returns false.
3784 2017-05-09 Jason Merrill <jason@redhat.com>
3786 PR c++/70167 - array prvalue treated as lvalue
3787 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
3789 * semantics.c (finish_compound_literal): Add fcl_context parameter.
3790 Only make a static variable for C99 syntax.
3791 * parser.c (cp_parser_postfix_expression): Pass it.
3792 * pt.c (tsubst_copy_and_build): Likewise.
3793 * call.c (extend_ref_init_temps): Set
3794 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
3796 2017-05-09 Nathan Sidwell <nathan@acm.org>
3798 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
3799 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
3800 * name-lookup.h (pushdecl_top_level): Declare.
3802 2017-05-08 Jason Merrill <jason@redhat.com>
3804 PR c++/80178 - parameter passing for uncopyable classes
3805 * tree.c (type_has_nontrivial_copy_init): True for classes with only
3806 deleted copy/move ctors.
3807 (remember_deleted_copy, maybe_warn_parm_abi): New.
3808 * decl.c (require_complete_types_for_parms, check_function_type):
3809 Call maybe_warn_parm_abi.
3810 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
3812 2017-05-08 Nathan Sidwell <nathan@acm.org>
3814 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
3815 (start_preparsed_function): Do decl pushing before setting
3816 current_funciton_decl and announcing it.
3818 * name-lookup.h (pushdecl_with_scope): Replace with ...
3819 (pushdecl_outermost_localscope): ... this.
3820 * name-lookup.c (pushdecl_with_scope): Replace with ...
3821 (pushdecl_outermost_localscope): ... this.
3822 (pushdecl_namespace_level): Adjust.
3823 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
3824 * lambda.c (insert_capture_proxy): Likewise.
3826 * class.c (build_vtbl_initializer): Don't shadow outer variable
3829 Revert _binding -> _value change.
3830 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
3831 (get_namespace_binding, set_global_binding): ... these.
3832 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
3833 (get_namespace_binding, set_global_binding): ... these.
3834 (arg_assoc_namespace, pushdecl_maybe_friend_1,
3835 check_for_out_of_scope_variable, push_overloaded_decl_1,
3836 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
3837 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
3838 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
3839 * decl.c (poplevel): Adjust.
3840 * pt.c (make_constrained_auto): Likewise.
3842 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
3844 PR translation/80280
3845 * call.c (print_z_candidate): Fix quoting.
3847 2017-05-05 David Malcolm <dmalcolm@redhat.com>
3849 * error.c (pedwarn_cxx98): Replace report_diagnostic
3850 with diagnostic_report_diagnostic.
3852 2017-05-05 Nathan Sidwell <nathan@acm.org>
3854 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
3855 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
3856 (IDENTIFIER_NAMESPACE_VALUE): Delete.
3857 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
3859 (get_namespace_value, set_global_value): ... these.
3860 (get_global_value_if_present, is_typename_at_global_scope): Delete.
3861 * decl.c (poplevel): Use get_namespace_value.
3862 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
3863 * class.c (build_vtbl_initializer): Stash library decl in
3864 static var. Use IDENTIFIER_GLOBAL_VALUE.
3865 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
3866 do_allocate_exception, do_free_exception, build_throw): Likewise.
3867 * init.c (throw_bad_array_new_length): Likewise.
3868 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
3869 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
3870 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
3871 get_namespace_value.
3872 (set_namespace_binding_1): Rename to
3873 (set_namespace_binding): ... here.
3874 (set_global_value): New.
3875 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
3876 get_namespace_value.
3877 * pt.c (listify): Use get_namespace_value.
3879 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
3881 * lex.c (unqualified_name_lookup_error): Likewise.
3883 * class.c (alter_class): Use retrofit_lang_decl directly.
3884 * decl.c (push_local_name, dupliate_decls): Likewise.
3885 * semantics.c (omp_privatize_field): Likewise.
3887 Kill walk_namespaces.
3888 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
3889 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
3891 Kill per-namespace static_decls.
3892 * cp-tree.h (static_decls): Declare.
3893 (wrapup_globals_for_namespace,
3894 diagnose_inline_vars_for_namespace): Replace with ...
3895 (wrapup_namespace_globals): ... this.
3896 * decl.c (static_decls): Define.
3897 (wrapup_globals_for_namespace,
3898 diagnose_inline_vars_for_namespace): Replace with ...
3899 (wrapup_namespace_globals): ... this.
3900 (cxx_init_decl_processing): Initialize static_decls.
3901 * decl2.c (c_parse_final_cleanups): Adjust.
3902 * name-lookup.h (cp_binding_level): Remove static_decls member.
3903 * name-lookup.c (add_decl_to_level): Adjust.
3904 (begin_scope): Adjust.
3906 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
3909 * decl.c (reshape_init): Unconditionally return error_mark_node
3910 upon error about too many initializers.
3912 2017-05-04 Nathan Sidwell <nathan@acm.org>
3914 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
3916 2017-05-04 Martin Sebor <msebor@redhat.com>
3918 PR translation/80280
3919 * call.c (print_z_candidate): Add missing quoting to %D and other
3921 (build_op_call_1): Same.
3922 * constraint.cc (diagnose_check_constraint): Same.
3923 * mangle.c (mangle_decl): Same.
3924 * name-lookup.c (cp_binding_level_debug): Same.
3925 (set_decl_namespace): Same.
3926 * parser.c (cp_parser_tx_qualifier_opt): Same.
3927 * pt.c (print_candidates_1): Same.
3928 (check_template_variable): Same.
3929 (tsubst_default_argument): Same.
3930 (most_specialized_partial_spec): Same.
3931 * semantics.c (omp_reduction_lookup): Same.
3932 * tree.c (check_abi_tag_redeclaration): Same.
3933 * typeck.c (comptypes): Same.
3934 * typeck2.c (abstract_virtuals_error_sfinae): Same.
3936 2017-05-04 Nathan Sidwell <nathan@acm.org>
3939 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
3940 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
3941 CPTI_INIT_LIST_IDENTIFIER.
3942 (global_namespace, global_type_node, global_identifier,
3943 anon_identifier, init_list_identifier): New.
3944 * decl.c (global_type_node, global_scope_name): Delete.
3945 (initialize_predefined_identifiers): Add new identifiers.
3946 (cxx_init_decl_processing): Adjust.
3947 * name-lookup.h (global_namespace, global_type_node): Delete.
3948 * name-lookup.c (global_namespace, anonymous_namespace_name,
3949 get_anonymous_namespace_name): Delete.
3950 (namespace_scope_ht_size, begin_scope, pushtag_1,
3951 push_namespace): Adjust,
3952 * call.c (type_has_extended_temps): Use init_list_identifier.
3953 * pt.c (listify): Likewise.
3955 * name-lookup.c: Reorder functions to make merging from modules
3958 2017-05-03 Jason Merrill <jason@redhat.com>
3960 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
3962 2017-05-03 Nathan Sidwell <nathan@acm.org>
3964 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
3965 along with #defines, to before name-lookup include.
3967 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
3969 * pt.c (is_auto_or_concept): Remove.
3970 (type_uses_auto_or_concept): Remove, unused.
3971 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
3972 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
3973 * cp-tree.h (is_auto_or_concept): Remove.
3975 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
3978 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
3979 add pedigree operation and detach call here.
3980 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
3981 cilk_cp_gimplify_call_params_in_spawned_fn.
3982 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
3983 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
3985 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
3987 * parser.c (cp_parser_member_declaration): Add fix-it hints for
3988 stray comma and missing semicolon at end of member declaration.
3990 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
3992 * parser.c (cp_parser_cast_expression): Add target type of cast to
3994 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
3996 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
3998 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
3999 return type to bool.
4000 * cp-tree.h (grok_ctor_properties): Update.
4002 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
4004 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
4005 information to diagnostic of invalid colon in nested-name-specifier.
4007 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
4009 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
4010 diagnostic of invalid class/struct keyword after enum.
4012 2017-04-25 David Malcolm <dmalcolm@redhat.com>
4014 * parser.c (cp_parser_member_declaration): Add fix-it hint
4015 for removing stray semicolons.
4017 2017-04-25 David Malcolm <dmalcolm@redhat.com>
4019 * name-lookup.c (get_std_name_hint): New function.
4020 (maybe_suggest_missing_header): New function.
4021 (suggest_alternative_in_explicit_scope): Call
4022 maybe_suggest_missing_header.
4024 2017-04-25 David Malcolm <dmalcolm@redhat.com>
4027 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
4028 candidate type of bm from tree to const char *.
4029 (consider_binding_level): Likewise.
4030 (lookup_name_fuzzy): Likewise, using this to merge the best
4031 result from the preprocessor into bm, rather than immediately
4032 returning, so that better matches from reserved words can "win".
4033 Guard the rejection of keywords that don't start decl-specifiers
4034 so it only happens for FUZZY_LOOKUP_TYPENAME.
4036 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
4038 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
4039 (start_enum): Likewise.
4040 (build_enumerator): Likewise. Use %qE instead of plain %E.
4041 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
4042 %<%D%> in diagnostics.
4043 (cp_parser_elaborated_type_specifier): Likewise.
4044 * pt.c (make_pack_expansion): Use %qT and %qE instead of
4045 %<%T%> and %<%E%> in diagnostics.
4046 (tsubst_pack_expansion): Likewise.
4048 2017-04-24 David Malcolm <dmalcolm@redhat.com>
4051 * parser.c (cp_parser_unary_expression): Generate a location
4052 range for alignof and sizeof expressions.
4054 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
4056 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
4058 (cp_parser_virt_specifier_seq_opt): Likewise.
4059 (set_and_check_decl_spec_loc): Likewise twice.
4061 2017-04-21 Jason Merrill <jason@redhat.com>
4063 PR c++/80179 - ICE with initialized flexible array member.
4064 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
4066 2017-04-21 Richard Biener <rguenther@suse.de>
4068 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
4069 (copy_type): Likewise.
4070 * lex.c (copy_decl): Pass down mem-stat info.
4071 (copy_type): Likewise.
4073 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
4076 * init.c (build_new_1): Suppress notes about over-aligned new when
4077 the warning is suppressed.
4079 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
4081 * parser.c (cp_parser_member_declaration): Add warning with fixit
4082 information for extra semicolon after in-class function definition.
4084 2017-04-20 Jakub Jelinek <jakub@redhat.com>
4087 * tree.c (build_cplus_array_type): Call build_array_type
4088 with the intended TYPE_TYPELESS_STORAGE flag value, instead
4089 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
4092 2017-04-18 Marek Polacek <polacek@redhat.com>
4094 PR c++/80244 - ICE with attribute in template alias.
4095 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
4097 PR c++/80241 - ICE with alignas pack expansion.
4098 * error.c (dump_expr): Handle TREE_LIST.
4099 * parser.c (cp_parser_std_attribute_list): Return error_mark if
4100 make_pack_expansion returns an error.
4102 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
4105 * class.c (fixup_may_alias): Fix all type variants.
4107 2017-04-17 Jason Merrill <jason@redhat.com>
4109 PR c++/80415 - wrong error with default arg and array reference.
4110 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
4112 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
4114 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
4116 * decl.c (name_unnamed_type): Split out of...
4117 (grokdeclarator): ... this.
4118 * decl.h (name_unnamed_type): Declare.
4120 2017-04-12 Richard Biener <rguenther@suse.de>
4121 Bernd Edlinger <bernd.edlinger@hotmail.de>
4124 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
4125 for arrays of character or std::byte type.
4127 2017-04-11 Jason Merrill <jason@redhat.com>
4129 PR c++/80294 - ICE with constexpr and inheritance.
4130 * constexpr.c (reduced_constant_expression_p):
4131 A null constructor element is non-constant.
4132 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
4133 returning an empty base.
4135 2017-04-11 Jakub Jelinek <jakub@redhat.com>
4138 * decl.c (cp_finish_decomp): If processing_template_decl on
4139 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
4140 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
4141 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
4143 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
4144 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
4147 2017-04-11 Jakub Jelinek <jakub@redhat.com>
4150 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
4152 2017-04-10 Jakub Jelinek <jakub@redhat.com>
4155 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
4156 operand, if it is a static member function, recurse on the
4159 2017-04-10 Marek Polacek <polacek@redhat.com>
4162 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
4163 ORIG_TYPE earlier and not only when shortening.
4165 2017-04-07 Jason Merrill <jason@redhat.com>
4167 PR c++/80356 - ICE with reference to function template argument.
4169 * pt.c (convert_nontype_argument_function): Adjust type even with a
4170 value-dependent argument.
4172 PR c++/80267 - ICE with nested capture of reference
4174 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
4176 2017-04-07 Marek Polacek <polacek@redhat.com>
4179 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
4182 * call.c (build_over_call): Don't check cxx_dialect.
4183 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
4184 whether SUB is a CONSTRUCTOR.
4185 * init.c (build_new_1): Don't check cxx_dialect.
4186 * tree.c (replace_placeholders): Add a function comment. Return if
4187 not in C++14, or if the object isn't a (member of a) class.
4188 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
4189 TYPE is CLASS_TYPE_P.
4191 2017-04-05 Jakub Jelinek <jakub@redhat.com>
4194 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
4195 of a loop doing vec_safe_push of NULL. Formatting fixes.
4196 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
4197 to newidx before calling canonical_type_parameter on newtype.
4199 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
4202 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
4203 UNARY_PLUS_EXPR case.
4205 2017-04-03 Jason Merrill <jason@redhat.com>
4207 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
4209 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
4211 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
4212 * decl2.c (one_static_initialization_or_destruction): Likewise.
4213 * name-lookup.c (store_bindings): Likewise.
4214 * parser.c (make_call_declarator): Likewise.
4215 * pt.c (check_explicit_specialization): Likewise.
4217 2017-04-03 Jason Merrill <jason@redhat.com>
4219 PR sanitizer/79993 - ICE with VLA initialization from string
4220 PR c++/69487 - wrong VLA initialization from string
4221 * init.c (finish_length_check): Split out from build_vec_init.
4222 (build_vec_init): Handle STRING_CST.
4223 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
4224 (digest_init_r): Don't give a STRING_CST VLA type.
4226 2017-03-31 Jakub Jelinek <jakub@redhat.com>
4229 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
4230 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
4231 for NOP_EXPR to REFERENCE_TYPE.
4234 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
4235 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
4237 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
4238 Remove extraneous parens.
4239 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
4240 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
4241 (cp_parser_trait_expr): Likewise.
4243 2017-03-27 Jakub Jelinek <jakub@redhat.com>
4246 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
4247 * typeck.c (cxx_mark_addressable): Likewise. Look through
4248 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
4250 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
4252 2017-03-24 Jason Merrill <jason@redhat.com>
4254 PR c++/77339 - ICE with invalid use of alias template.
4255 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
4258 2017-03-24 Marek Polacek <polacek@redhat.com>
4261 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
4262 doesn't have side effects.
4264 2017-03-23 Jason Merrill <jason@redhat.com>
4266 PR c++/80150 - ICE with overloaded variadic deduction.
4267 * pt.c (try_one_overload): Remove asserts.
4269 PR c++/77563 - missing ambiguous conversion error.
4270 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
4272 2017-03-23 Marek Polacek <polacek@redhat.com>
4274 * cp-tree.h: Remove a C_RID_YYCODE reference.
4276 2017-03-22 Jakub Jelinek <jakub@redhat.com>
4279 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
4280 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
4281 processing_template_decl.
4283 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
4286 * name-lookup.c (pushtag_1): Add check for bogus, non template,
4287 std::initializer_list.
4289 2017-03-21 Jakub Jelinek <jakub@redhat.com>
4292 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
4294 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
4297 * init.c (std_placement_new_fn_p): New.
4298 (build_new_1): Call it.
4300 2017-03-20 Jason Merrill <jason@redhat.com>
4302 PR c++/80096 - ICE with C++17 non-type auto.
4303 * pt.c (tsubst): Delay tsubst of type of template non-type
4306 PR c++/79519 - ICE with deleted template friend.
4307 * decl.c (grokdeclarator): Complain about misplaced function
4308 definition using =, as well.
4310 PR c++/79640 - infinite recursion with generic lambda.
4311 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
4312 before substituting its initializer.
4314 2017-03-20 Marek Polacek <polacek@redhat.com>
4315 Paolo Carlini <paolo.carlini@oracle.com>
4317 PR c++/80059 - ICE with noexcept and __transaction_atomic
4318 * except.c (build_must_not_throw_expr): Call
4319 instantiate_non_dependent_expr.
4321 2017-03-19 Jason Merrill <jason@redhat.com>
4323 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
4324 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
4325 reference decomposition.
4327 PR c++/80077 - error with constexpr and -fno-elide-constructors.
4328 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
4329 expanding trivial constructor.
4331 2017-03-17 Jason Merrill <jason@redhat.com>
4333 PR c++/78345 - ICE initializing array from lambda.
4334 * init.c (build_aggr_init): Check array initializer.
4335 (build_vec_init): Check the type of a CONSTRUCTOR.
4337 PR c++/80073 - C++17 ICE with virtual base.
4338 * decl.c (xref_basetypes): Also check for indirect vbases.
4340 2017-03-16 Jason Merrill <jason@redhat.com>
4342 * decl.c (start_enum): std::byte aliases anything.
4345 * constexpr.c (lookup_placeholder): Tweak.
4347 2017-03-15 Jason Merrill <jason@redhat.com>
4349 PR c++/80043 - ICE with -fpermissive
4350 * typeck.c (convert_for_assignment): Handle instantiate_type
4351 not giving an error.
4353 2017-03-14 Nathan Sidwell <nathan@acm.org>
4355 PR c++/79393 DR 1658 workaround
4356 * method.c (synthesized_method_base_walk): Inihibit abstract class
4357 virtual base access check here.
4358 (synthesized_method_walk): Not here.
4360 2017-03-13 Nathan Sidwell <nathan@acm.org>
4362 PR c++/79393 DR 1658 workaround
4363 * method.c (synthesized_method_walk): Check vbases of abstract
4364 classes for dtor walk.
4366 2017-03-10 David Malcolm <dmalcolm@redhat.com>
4368 PR translation/79848
4369 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
4371 2017-03-10 Jason Merrill <jason@redhat.com>
4373 PR c++/79960 - alias templates and partial ordering
4374 * pt.c (comp_template_args): Add partial_order parm.
4375 (template_args_equal): Likewise.
4376 (comp_template_args_porder): New.
4377 (get_partial_spec_bindings): Use it.
4379 2017-03-10 Marek Polacek <polacek@redhat.com>
4382 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
4384 2017-03-10 Jakub Jelinek <jakub@redhat.com>
4387 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
4388 Use XALLOCAVEC macro.
4391 * decl.c (finish_enum_value_list): If value is error_mark_node,
4392 don't copy it and change its type.
4393 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
4394 of CONST_DECL is error_mark_node.
4396 2017-03-09 Marek Polacek <polacek@redhat.com>
4398 PR c++/79900 - ICE in strip_typedefs
4399 * tree.c (strip_typedefs): Skip the attribute handling if T is
4400 a variant type which hasn't been updated yet.
4402 PR c++/79687 - wrong code with pointer-to-member
4403 * init.c (constant_value_1): Break if the variable has a dynamic
4406 2017-03-08 Jason Merrill <jason@redhat.com>
4408 PR c++/79797 - ICE with self-reference in array DMI.
4409 * constexpr.c (lookup_placeholder): Split out...
4410 (cxx_eval_constant_expression): ...from here.
4412 2017-03-07 Jakub Jelinek <jakub@redhat.com>
4415 * parser.c (cp_parser_omp_cancellation_point,
4416 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
4417 cp_parser_omp_target_update): Change "may only be used in compound
4418 statements" diagnostics, such that the same translatable string is
4419 used for all pragmas.
4420 (cp_parser_pragma): Likewise. Use error_at instead of
4421 cp_parser_error for that diagnostics.
4423 2017-03-06 Marek Polacek <polacek@redhat.com>
4425 PR c++/79796 - ICE with NSDMI and this pointer
4426 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
4427 replace_placeholders.
4429 2017-03-06 Jakub Jelinek <jakub@redhat.com>
4432 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
4435 2017-03-06 Jason Merrill <jason@redhat.com>
4437 Revert "Allow deduction guides to look into primary template."
4438 * cp-tree.h, parser.c, pt.c, search.c: Revert.
4440 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
4443 * except.c (build_must_not_throw_expr): Perform the implicit
4444 conversions on the condition.
4446 2017-03-03 Jason Merrill <jason@redhat.com>
4448 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
4451 Core issues 2273 and 2277
4452 * call.c (joust): Adjust using-declaration tiebreaker to handle
4453 the intermediate base case.
4454 * method.c (strip_inheriting_ctors): Just return the argument if
4455 !flag_new_inheriting_ctors.
4457 2017-03-03 Richard Biener <rguenther@suse.de>
4460 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
4462 2017-03-03 Marek Polacek <polacek@redhat.com>
4465 * typeck.c (string_conv_p): In C++11, always call pedwarn with
4468 2017-03-02 Jason Merrill <jason@redhat.com>
4470 Update overload resolution with deduction guides.
4471 * pt.c (do_class_deduction): Always build the copy guide.
4472 (copy_guide_p, template_guide_p): New.
4473 (build_deduction_guide): Remember the original constructor.
4474 * call.c (joust): Prefer the copy guide and non-template guides.
4476 Allow deduction guides to look into primary template.
4477 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
4478 (struct cp_decl_specifier_seq): Add constructor_p.
4479 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
4480 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
4481 Clear deduction_guide_type. Don't handle deduction guide names.
4482 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
4483 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
4484 (cp_parser_member_declaration, cp_parser_cache_defarg)
4485 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
4486 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
4487 (build_deduction_guide): Set deduction_guide_type.
4488 (dependent_scope_p): Check deduction_guide_type.
4489 * search.c (lookup_member): Likewise.
4491 2017-03-02 Jakub Jelinek <jakub@redhat.com>
4494 * init.c (mark_exp_read_r): New function.
4495 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
4496 whole arguments instead of plain mark_exp_read on TREE_LIST values.
4498 2017-03-01 Jason Merrill <jason@redhat.com>
4500 Class template argument deduction in new-expression
4501 * init.c (build_new): Handle deduction from no initializer.
4502 * parser.c (cp_parser_new_expression): Don't require a single
4503 expression for class template deduction.
4504 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
4505 class template placeholder.
4506 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
4507 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
4508 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
4510 2017-03-01 Jakub Jelinek <jakub@redhat.com>
4513 * init.c (emit_mem_initializers): When not constructing vbases of
4514 abstract classes, mark arguments as read for
4515 -Wunused-but-set-parameter.
4517 2017-02-28 Jason Merrill <jason@redhat.com>
4519 Class template argument deduction refinements
4520 * call.c (joust): Move deduction guide tiebreaker down.
4521 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
4522 deduction with no initializer.
4523 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
4524 (do_class_deduction): Use that rather than special case.
4525 (do_auto_deduction): Handle null initializer.
4527 2017-02-28 Jakub Jelinek <jakub@redhat.com>
4529 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
4530 instead of just cond ? "..." : "...".
4531 (grokdeclarator): Likewise.
4532 (build_enumerator): Likewise.
4533 * init.c (build_new_1): Likewise.
4534 * call.c (build_new_method_call_1): Likewise.
4535 * parser.c: Include intl.h.
4536 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
4537 "enter"/"exit" keyword.
4538 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
4541 2017-02-27 Jason Merrill <jason@redhat.com>
4543 PR c++/71568 - SFINAE forming pointer to member function
4544 * init.c (build_offset_ref): Check the return value of
4545 perform_or_defer_access_check.
4547 2017-02-27 Marek Polacek <polacek@redhat.com>
4549 * decl.c (expand_static_init): Add missing } in a comment.
4551 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
4553 * init.c: Include intl.h.
4554 (build_new_1): Move message strings into pedwarn to make them
4555 -Wformat-security friendly. Mark string for translation.
4556 * pt.c (tsubst_copy_and_build): Mark string for translation.
4557 Make the pointer const.
4558 * semantics.c (finish_id_expression): Mark strings for translation.
4560 2017-02-25 Jakub Jelinek <jakub@redhat.com>
4562 * call.c (build_op_delete_call): Make msg1 and msg2 const.
4564 2017-02-24 Jakub Jelinek <jakub@redhat.com>
4567 * call.c (build_over_call): Call check_function_arguments even for
4568 -Wrestrict, adjust check_function_arguments caller.
4569 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
4571 * typeck.c (cp_build_function_call_vec): Adjust
4572 check_function_arguments caller.
4574 2017-02-24 Marek Polacek <polacek@redhat.com>
4576 PR translation/79705
4577 * decl.c (check_redeclaration_exception_specification): Mark a string
4578 for translation. Make the pointer const.
4580 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
4583 * pt.c (register_specialization): Check duplicate_decls return value
4584 for error_mark_node and pass it back.
4586 2017-02-22 Jason Merrill <jason@redhat.com>
4588 PR c++/79679 - missing destructor for argument
4589 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
4592 * pt.c (do_class_deduction): Handle 0 argument case.
4594 2017-02-22 Jakub Jelinek <jakub@redhat.com>
4597 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
4598 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
4599 * constexpr.c (potential_constant_expression_1): Handle
4600 OMP_*, OACC_* and CILK_* trees. Use error_at with
4601 EXPR_LOC_OR_LOC (t, input_location) computed early
4602 instead of error, or error_at with location_of (t).
4604 2017-02-22 Marek Polacek <polacek@redhat.com>
4607 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
4608 if the alignas expression is erroneous.
4609 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
4613 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
4615 2017-02-21 Jason Merrill <jason@redhat.com>
4617 PR c++/50308 - wrong deprecated warning with ADL
4618 PR c++/17729 - duplicate deprecated warning
4619 * semantics.c (finish_id_expression): Only call mark_used on a
4620 function if we aren't building a call.
4622 PR c++/41727 - ICE with partial spec of partial instantiation
4623 * pt.c (process_partial_specialization): For now, don't check more
4624 specialized if there is more than one level of args.
4626 2017-02-21 Marek Polacek <polacek@redhat.com>
4629 * cp-tree.h (maybe_reject_flexarray_init): Declare.
4630 * init.c (maybe_reject_flexarray_init): No longer static.
4631 Add check for current_function_decl.
4632 * parser.c (cp_parser_late_parse_one_default_arg): Reject
4633 a default mem-initializer for a flexible array.
4635 2017-02-21 Jakub Jelinek <jakub@redhat.com>
4636 Paolo Carlini <paolo.carlini@oracle.com>
4639 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
4641 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
4642 decl after the decomposition artificial decl has error_mark_node.
4643 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
4644 instead of just == error_mark_node comparison.
4646 2017-02-21 Jakub Jelinek <jakub@redhat.com>
4649 * decl.c: Include gimplify.h.
4650 (cp_finish_decomp): Make sure there is no sharing of trees
4651 in between DECL_VALUE_EXPR of decomposition decls.
4654 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
4657 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
4658 call cplus_expand_constant on it first.
4660 2017-02-19 Jason Merrill <jason@redhat.com>
4662 PR c++/78139 - destructor needed by new-expression
4663 * call.c (build_special_member_call): Use tf_no_cleanup.
4665 PR c++/78282 - auto template and pack expansion
4666 * pt.c (find_parameter_packs_r): Don't walk into the type of
4667 templates other than template template-parameters.
4669 PR c++/79606 - ICE with this->base_member in NSDMI
4670 * class.c (build_base_path): Check processing_template_decl.
4672 PR c++/79607 - ICE with T{} initializer
4673 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
4675 PR c++/79566 - elaborated-type-specifier in range for
4676 * parser.c (cp_parser_simple_declaration): Fix check for type
4679 PR c++/79400 - confusing suggestion of 'noexcept'
4680 * parser.c (cp_parser_exception_specification_opt): Remove
4681 suggestion for deprecated dynamic exception-specification.
4683 PR c++/79470 - partial ordering with reference parameters
4684 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
4686 PR c++/79500 - ICE with non-template deduction guide
4687 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
4688 DECL_TEMPLATE_RESULT.
4690 PR c++/79580 - ICE with compound literal
4691 * parser.c (cp_parser_class_head): If we're in the middle of an
4692 expression, use ts_within_enclosing_non_class.
4694 PR c++/79503 - inherited ctor taking base class
4695 * call.c (add_function_candidate): Also check that
4696 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
4698 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
4701 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
4704 2017-02-19 Eric Fiselier <eric@efcs.ca>
4705 Jonathan Wakely <jwakely@redhat.com>
4708 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
4709 control warning about literal suffix identifiers without a leading
4712 2017-02-17 Jason Merrill <jason@redhat.com>
4714 PR c++/79508 - lookup error with member template
4715 * parser.c (cp_parser_template_name): Clear
4716 parser->context->object_type if we aren't doing lookup.
4718 PR c++/78690 - ICE with using and global type with same name
4719 * pt.c (type_dependent_object_expression_p): True for
4722 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
4723 * pt.c (convert_template_argument): Just return an auto arg pack.
4724 (tsubst_template_args): Don't tsubst an auto pack type.
4726 PR c++/79556 - C++17 ICE with non-type auto
4727 * pt.c (do_auto_deduction): Don't try to deduce from null type.
4729 PR c++/79533 - C++17 ICE with temporary cast to reference
4730 * call.c (build_over_call): Conversion to a reference prevents copy
4733 2017-02-16 Jakub Jelinek <jakub@redhat.com>
4734 Jason Merrill <jason@redhat.com>
4736 PR c++/79502 - lost nodiscard attribute
4737 * pt.c (apply_late_template_attributes): Do apply non-dependent
4738 attributes to types.
4740 2017-02-16 Jason Merrill <jason@redhat.com>
4742 PR c++/78572 - ICE with self-modifying array initializer
4743 * constexpr.c (cxx_eval_store_expression): The object we're
4744 initializing is outside the constant-expression.
4745 (cxx_eval_call_expression): Set ctx->call.
4747 PR c++/79050 - ICE with undeduced auto and LTO
4748 * decl.c (poplevel): Remove undeduced auto decls.
4750 2017-02-16 Jakub Jelinek <jakub@redhat.com>
4753 * parser.c (cp_parser_omp_target): For -fopenmp-simd
4754 ignore #pragma omp target even when not followed by identifier.
4756 2017-02-15 Jason Merrill <jason@redhat.com>
4757 Jakub Jelinek <jakub@redhat.com>
4759 PR c++/79464 - ICE in IPA with omitted constructor parms
4760 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
4761 (adjust_clone_args): Adjust.
4762 (add_method): Remember omitted parms.
4763 * call.c (add_function_candidate): Likewise.
4764 * mangle.c (write_method_parms): Likewise.
4765 * method.c (ctor_omit_inherited_parms): Return false if there are no
4768 2017-02-15 Martin Sebor <msebor@redhat.com>
4771 * init.c (maybe_reject_flexarray_init): New function.
4772 (perform_member_init): Call it.
4774 2017-02-15 Jakub Jelinek <jakub@redhat.com>
4777 * parser.c (cp_parser_std_attribute): Don't pedwarn about
4778 [[deprecated]] with -std=c++11 and [[fallthrough]] with
4779 -std=c++11 and -std=c++14.
4782 * decl.c (grokdeclarator): For static data members, handle thread_p
4783 only after handling inline.
4785 2017-02-14 Marek Polacek <polacek@redhat.com>
4789 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
4790 clobbering if the postfix expression isn't an EXPR_P.
4792 2017-02-13 Jason Merrill <jason@redhat.com>
4794 PR c++/79461 - ICE with lambda in constexpr constructor
4795 * constexpr.c (build_data_member_initialization): Ignore
4796 initialization of a local variable.
4798 2017-02-13 Jakub Jelinek <jakub@redhat.com>
4800 * init.c (warn_placement_new_too_small): Add missing space in
4802 * parser.c (cp_parser_oacc_declare): Likewise.
4803 * mangle.c (maybe_check_abi_tags): Likewise.
4806 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
4807 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
4808 in the rightmost operand.
4810 2017-02-13 Nathan Sidwell <nathan@acm.org>
4812 PR c++/79296 - ICE mangling localized template instantiation
4813 * decl2.c (determine_visibility): Use template fn context for
4814 local class instantiations.
4816 2017-02-11 Jason Merrill <jason@redhat.com>
4818 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
4819 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
4820 (build_new_1): Use replace_placeholders.
4821 * tree.c (replace_placeholders_t): Also track whether we've seen a
4823 (replace_placeholders, replace_placeholders_r): Adjust.
4824 * cp-tree.h: Adjust.
4826 PR c++/77790 - ICE with auto function in C++11 mode
4827 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
4828 (require_deduced_type): Add complain parm, return bool.
4829 * cp-tree.h: Adjust.
4830 * decl2.c (mark_used): Use require_deduced_type.
4832 2017-02-10 Jason Merrill <jason@redhat.com>
4834 PR c++/78908 - template ops and bitfields
4835 * tree.c (build_min_non_dep): Use unlowered_expr_type.
4837 PR c++/78897 - constexpr union
4838 * constexpr.c (cxx_eval_store_expression): A store to a union member
4839 erases a previous store to another member.
4841 PR c++/71285 - member of fold-expression
4842 * semantics.c (finish_unary_fold_expr)
4843 (finish_binary_fold_expr): Use null type for fold-expressions.
4845 PR c++/79401 - protected inherited constructor
4846 * call.c (enforce_access): For inheriting constructor, find a base
4847 binfo in the path we already have.
4849 2017-02-10 Marek Polacek <polacek@redhat.com>
4852 * pt.c (type_dependent_expression_p): Check if the expression type
4856 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
4857 if warnings shouldn't be given.
4859 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
4862 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
4863 an error_mark_node as type.
4865 2017-02-09 Jakub Jelinek <jakub@redhat.com>
4866 Jason Merrill <jason@redhat.com>
4869 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
4870 from pattern to type.
4872 2017-02-09 Jason Merrill <jason@redhat.com>
4874 PR c++/79316 - default argument in deduction guide
4875 PR c++/79350 - explicit deduction guide
4876 * parser.c (cp_parser_constructor_declarator_p)
4877 (cp_parser_direct_declarator): Parse deduction guides more like
4879 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
4880 * tree.c (special_function_p): Return it.
4881 * decl.c (check_special_function_return_type): Handle it.
4882 (grokdeclarator, grokfndecl): Adjust.
4883 (cp_finish_decl): Pass flags to do_auto_deduction.
4884 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
4885 * pt.c (dguide_name_p): Take a const_tree.
4886 (do_class_deduction): Handle explicit.
4887 (do_auto_deduction): Pass flags through.
4888 (build_deduction_guide): Copy explicit flag.
4890 2017-02-09 Jakub Jelinek <jakub@redhat.com>
4893 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
4894 non-pragma_compound context here.
4895 (cp_parser_omp_target): Likewise.
4896 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
4897 parsing for ordered and target omp pragmas in non-pragma_stmt
4898 non-pragma_compound contexts.
4901 * parser.c (cp_parser_oacc_declare): Formatting fix.
4902 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
4903 automatic variables.
4905 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
4906 Chung-Lin Tang <cltang@codesourcery.com>
4908 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
4909 parsing. Parse constant expression. Remove semantic checking.
4910 (cp_parser_omp_clause_collapse): Disallow tile.
4911 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
4912 error about missing for after already emitting one. Use more
4913 conventional for idiom for unbounded loop.
4914 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
4915 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
4916 (finish_omp_for): Deal with tile clause.
4918 2017-02-07 Nathan Sidwell <nathan@acm.org>
4920 * method.c (synthesized_method_base_walk): New. Broken out of ...
4921 (synthesized_method_walk): ... here. Call it. Cleanup
4924 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
4927 * typeck2.c (process_init_constructor_union): Consider only
4928 FIELD_DECLs when looking for an NSDMI.
4930 2017-02-06 Jason Merrill <jason@redhat.com>
4932 PR c++/71193 - incomplete types in templates
4933 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
4934 handle incomplete type by pedwarning and then treating as dependent.
4936 2017-02-06 Jakub Jelinek <jakub@redhat.com>
4939 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
4940 (potential_constant_expression_1): Likewise.
4943 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
4944 allow one fewer than expected arguments if flag_permissive.
4947 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
4948 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
4949 with error_mark_node type.
4951 2017-02-03 Jason Merrill <jason@redhat.com>
4953 PR c++/78689 - ICE on constructor with label
4954 * optimize.c (maybe_clone_body): Replace omitted parameters with
4956 * class.c (build_clone): Fix logic for omitting inherited parms.
4958 PR c++/12245 - excessive memory use
4959 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
4960 back in. Don't cache constants.
4961 (maybe_constant_init): Don't cache constants.
4963 PR c++/79294 - ICE with invalid template argument
4964 * pt.c (convert_nontype_argument_function): Check value-dependence.
4965 (convert_nontype_argument): Don't check it here for function ptrs.
4967 2017-02-02 Richard Biener <rguenther@suse.de>
4970 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
4971 it lazily on the first changed element only and copy it
4972 fully upfront, only storing changed elements.
4974 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
4977 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
4980 2017-01-31 Jakub Jelinek <jakub@redhat.com>
4983 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
4986 2017-01-31 David Malcolm <dmalcolm@redhat.com>
4989 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
4990 any namespace aliases.
4992 2017-01-31 Nathan Sidwell <nathan@acm.org>
4995 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
4999 * pt.c: (instantiate_decl): Push to top level when current
5000 function scope doesn't match. Only push lmabda scope stack when
5003 * cp-tree.h (instantiate_decl): Make defer_ok bool.
5004 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
5005 (instantiate_decl): Simplify and reorder state saving and restoration.
5008 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
5009 * semantics.c (finish_member_declaration): Assert class is being
5012 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
5014 Introduce C++ support in libcc1.
5015 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
5016 (ansi_opname): Rename to...
5017 (cp_operator_id): ... this. Adjust all callers.
5018 (ansi_assopname): Rename to...
5019 (cp_assignment_operator_id): ... this. Adjust all callers.
5020 (cp_literal_operator_id): Declare.
5021 (set_global_friend): Declare.
5022 (is_global_friend): Declare.
5023 (enum cp_oracle_request): New type.
5024 (cp_binding_oracle_function): New type.
5025 (cp_binding_oracle): Declare.
5026 (cp_finish_injected_record_type): Declare.
5027 * friend.c (global_friend): New var.
5028 (set_global_friend): New fn.
5029 (is_global_friend): New fn.
5030 (is_friend): Call is_global_friend.
5031 * name-lookup.c (cp_binding_oracle): New var.
5032 (query_oracle): New fn.
5033 (qualified_lookup_using_namespace): Call query_oracle.
5034 (lookup_name_real_1): Likewise.
5035 * parser.c (cp_literal_operator_id): Drop static.
5036 * search.c (friend_accessible_p): Call is_global_friend.
5037 * semantics.c (is_this_parameter): Accept a variable if the
5038 binding oracle is enabled.
5040 2017-01-27 Jason Merrill <jason@redhat.com>
5042 PR c++/78771 - ICE with inherited constructor.
5043 * call.c (build_over_call): Call deduce_inheriting_ctor here.
5044 * pt.c (tsubst_decl): Not here.
5045 * class.c (add_method): Or here.
5046 * method.c (deduce_inheriting_ctor): Handle clones.
5047 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
5049 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
5052 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
5054 * cp/cp-tree.h: Declare it.
5055 * cp/semantics.c (finish_id_expression): Resolve names within a default
5056 capturing generic lambda defined within a template prior to
5057 instantiation to allow for captures to be added to the closure type.
5059 2017-01-26 Jakub Jelinek <jakub@redhat.com>
5062 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
5063 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
5064 * parser.c (cp_parser_builtin_offsetof): Pass result of
5065 build_static_cast of null_pointer_node to finish_offsetof.
5066 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
5067 it for -Winvalid-offsetof pedwarn instead of trying to guess
5068 original offsetof type from EXPR. Save OBJECT_PTR as a new
5069 second operand to OFFSETOF_EXPR.
5070 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
5071 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
5074 2017-01-26 Jason Merrill <jason@redhat.com>
5076 * name-lookup.c (parse_using_directive): Deprecate strong using.
5078 PR c++/79176 - lambda ICE with -flto -Os
5079 * decl2.c (vague_linkage_p): Handle decloned 'tors.
5080 * tree.c (decl_linkage): Likewise.
5082 2017-01-25 Martin Sebor <msebor@redhat.com>
5084 * decl.c (grokdeclarator): Fix a typo in a comment.
5086 2017-01-25 Jakub Jelinek <jakub@redhat.com>
5089 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
5093 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
5094 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
5096 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
5099 * decl.c (cxx_init_decl_processing): Pass main_input_filename
5100 to build_translation_unit_decl.
5102 2017-01-24 Jakub Jelinek <jakub@redhat.com>
5105 * cp-gimplify.c (cp_genericize_r): Add result of
5106 convert_from_reference on invisiref parm to p_set.
5108 2017-01-24 Nathan Sidwell <nathan@acm.org>
5110 PR c++/78469 - defaulted ctor and inaccessible dtor
5111 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
5112 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
5113 * tree.c (build_target_expr): Check tf_no_cleanup.
5115 PR c++/79118 - anon-members and constexpr
5116 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
5117 ctor decl. Recursively check anonymous members.
5118 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
5120 (explain_invalid_constexpr_fn): Likewise.
5122 2017-01-23 Nathan Sidwell <nathan@acm.org>
5124 PR c++/71710 - template using directive of field
5125 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
5128 PR c++/71406 - ICE with scope-ref'd template id exprs
5130 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
5131 before breaking up TEMPLATE_ID_EXPR.
5133 2017-01-20 Nathan Sidwell <nathan@acm.org>
5135 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
5136 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
5138 2017-01-20 David Malcolm <dmalcolm@redhat.com>
5142 * cp-tree.h (suggest_alternatives_for): Add bool param.
5143 (suggest_alternative_in_explicit_scope): New decl.
5144 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
5145 that isn't the global one, call new function
5146 suggest_alternative_in_explicit_scope, only calling
5147 suggest_alternatives_for if it fails, and disabling near match
5148 searches fort that case. When SCOPE is the global namespace,
5149 pass true for new param to suggest_alternatives_for to allow for
5151 * lex.c (unqualified_name_lookup_error): Pass true for new param
5152 to suggest_alternatives_for.
5153 * name-lookup.c (consider_binding_level): Add forward decl.
5154 (suggest_alternatives_for): Add "suggest_misspellings" param,
5155 using it to conditionalize the fuzzy name-lookup code.
5156 (suggest_alternative_in_explicit_scope): New function.
5157 * parser.c (cp_parser_primary_expression): When calling
5158 finish_id_expression, pass location of id_expression rather
5159 than that of id_expr_token.
5160 (cp_parser_id_expression): Convert local "unqualified_id" from
5161 tree to cp_expr to avoid implicitly dropping location information.
5163 2017-01-20 Marek Polacek <polacek@redhat.com>
5166 * call.c (build_conditional_expr_1): Warn about duplicated branches.
5167 * semantics.c (finish_expr_stmt): Build statement using the proper
5170 2017-01-19 Jason Merrill <jason@redhat.com>
5172 US 20 - forwarding references and class template argument deduction
5173 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
5174 * pt.c (push_template_decl_real): Set it.
5175 (maybe_adjust_types_for_deduction): Check it.
5176 (rewrite_template_parm): Copy it.
5178 US 19 - deduction guides and constructors
5179 * call.c (joust): Prefer deduction guides to constructors.
5180 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
5181 (deduction_guide_p): Check DECL_P.
5183 * decl.c (check_initializer): Always use build_aggr_init for array
5186 PR c++/79130 - decomposition and direct-initialization
5187 * init.c (build_aggr_init): Communicate direct-initialization to
5189 (build_vec_init): Check for array copy sooner.
5190 * parser.c (cp_parser_decomposition_declaration): Remove call to
5191 build_x_compound_expr_from_list.
5193 2017-01-18 Jason Merrill <jason@redhat.com>
5195 PR c++/68666 - member variable template-id
5196 * typeck.c (finish_class_member_access_expr): Handle variable
5198 * pt.c (lookup_and_finish_template_variable): No longer static.
5199 * cp-tree.h: Declare it.
5201 2017-01-18 Nathan Sidwell <nathan@acm.org>
5204 * call.c (build_over_call): When checking ellipsis conversions for
5205 an inherited ctor, make sure there is at least one conversion.
5207 2017-01-18 Jason Merrill <jason@redhat.com>
5209 PR c++/78894 - ICE with class deduction and default arg
5210 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
5212 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5215 * mangle.c (write_discriminator): Reorganize abi warning check.
5217 2017-01-18 Nathan Sidwell <nathan@acm.org>
5219 * cp-tree.h: Clarify exception spec node comment.
5220 * except.c (nothrow_spec_p): Simplify by checking node-equality.
5223 * mangle.c (write_exception_spec): Check nothrow explicitly.
5224 (write_encoding): Don't increment processing_template_decl around
5227 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5230 * mangle.c (write_template_args): Add "on" for operator names.
5232 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5235 * mangle.c (write_discriminator): Handle discriminator >= 10.
5237 2017-01-17 Nathan Sidwell <nathan@acm.org>
5240 * cp-tree.h (maybe_generic_this_capture): Declare.
5241 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
5242 (maybe_resolve_dummy): ... here. Call it.
5243 (maybe_generic_this_capture): New.
5244 * parser.c (cp_parser_postfix_expression): Speculatively capture
5245 this in generic lambda in unresolved member function call.
5246 * pt.c (tsubst_copy_and_build): Force hard error from failed
5247 member function lookup in generic lambda.
5249 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
5252 * cp-array-notation.c (expand_array_notation_exprs): Handle
5255 2017-01-11 Jason Merrill <jason@redhat.com>
5257 PR c++/78337 - ICE on invalid with generic lambda
5258 * semantics.c (process_outer_var_ref): Check if containing_function
5259 is null. Move inform call under complain test.
5261 2017-01-11 Nathan Sidwell <nathan@acm.org>
5264 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
5267 2017-01-11 Nathan Sidwell <nathan@acm.org>
5269 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
5271 2017-01-11 Jakub Jelinek <jakub@redhat.com>
5274 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
5275 assertion. Formatting fix.
5278 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
5281 2017-01-10 David Malcolm <dmalcolm@redhat.com>
5284 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
5285 a missing semicolon if we have a valid insertion location for
5288 2017-01-10 Jason Merrill <jason@redhat.com>
5290 FI 20, decomposition declaration with parenthesized initializer.
5291 * parser.c (cp_parser_decomposition_declaration): Use
5292 cp_parser_initializer.
5294 2017-01-09 Jason Merrill <jason@redhat.com>
5296 Implement P0195R2, C++17 variadic using.
5297 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
5298 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
5299 * error.c (dump_decl): Likewise.
5301 2017-01-09 Jakub Jelinek <jakub@redhat.com>
5303 PR translation/79019
5304 PR translation/79020
5305 * semantics.c (finish_omp_clauses): Add missing whitespace to
5306 translatable strings.
5307 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
5309 2017-01-07 Jason Merrill <jason@redhat.com>
5311 PR c++/78948 - instantiation from discarded statement
5312 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
5313 * cp-tree.h (in_discarded_stmt): Declare it.
5314 (struct saved_scope): Add discarded_stmt bitfield.
5315 (in_discarded_stmt): New macro.
5316 * decl2.c (mark_used): Check it.
5317 * parser.c (cp_parser_selection_statement): Adjust.
5318 (cp_parser_jump_statement): Adjust.
5320 2017-01-05 Jakub Jelinek <jakub@redhat.com>
5323 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
5324 REFERENCE_REF_P, set tt to its operand.
5327 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
5328 unions even for C++11 and later.
5330 2017-01-05 Nathan Sidwell <nathan@acm.org>
5333 * pt.c (convert_nontype_argument): Don't try and see if integral
5334 or enum expressions are constants prematurely.
5336 2017-01-04 Marek Polacek <polacek@redhat.com>
5339 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
5340 a zero character literal.
5342 2017-01-04 Jakub Jelinek <jakub@redhat.com>
5345 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
5349 * parser.c (cp_parser_simple_declaration): Only complain about
5350 inconsistent auto deduction if auto_result doesn't use auto.
5352 * parser.c (cp_parser_simple_declaration): Diagnose function
5353 declaration among more than one init-declarators with auto
5357 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
5358 assertion, as lexer->buffer may be NULL.
5360 2017-01-04 Marek Polacek <polacek@redhat.com>
5364 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
5366 2017-01-04 Nathan Sidwell <nathan@acm.org>
5369 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
5370 (lambda_capture_field_type): Update prototype.
5371 * lambda.c (lambda_capture_field_type): Add is_reference parm.
5372 Add referenceness here.
5373 (add_capture): Adjust lambda_capture_field_type call, refactor
5375 * pt.c (tsubst): Adjust lambda_capture_field_type call.
5377 2017-01-01 Jakub Jelinek <jakub@redhat.com>
5379 Update copyright years.
5381 Copyright (C) 2017 Free Software Foundation, Inc.
5383 Copying and distribution of this file, with or without modification,
5384 are permitted in any medium without royalty provided the copyright
5385 notice and this notice are preserved.