1 2017-12-05 Jason Merrill <jason@redhat.com>
3 PR c++/82331 - ICE with variadic partial specialization of auto
4 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Set processing_template_decl
7 2017-12-05 Nathan Sidwell <nathan@acm.org>
10 * tree.c (build_min): Check CAST_EXPR arg for OVERLOADs.
12 2017-12-05 Martin Liska <mliska@suse.cz>
13 Jakub Jelinek <jakub@redhat.com>
15 * typeck.c (pointer_diff): Add new argument and instrument
17 (cp_build_binary_op): Create compound expression if doing an
20 2017-12-05 Jakub Jelinek <jakub@redhat.com>
22 * cp-gimplify.c (cp_maybe_instrument_return): Don't add
23 __builtin_unreachable if -O0 or if -fsanitize=unreachable.
25 2017-12-04 Jason Merrill <jason@redhat.com>
27 PR c++/83273 - constexpr if allows non-constant condition
28 * semantics.c (finish_if_stmt_cond): Use require_constant_expression
29 rather than is_constant_expression.
30 * constexpr.c (potential_constant_expression_1) [LAMBDA_EXPR]: Allow
33 2017-12-01 Jason Merrill <jason@redhat.com>
35 Give #include hints for <complex>.
36 * name-lookup.c (get_std_name_hint): Add <complex>.
37 * parser.c (cp_parser_diagnose_invalid_type_name): Call
38 suggest_alternative_in_explicit_scope.
39 (cp_parser_namespace_name): Likewise.
41 PR c++/79228 - extensions hide C++14 complex literal operators
42 * parser.c (cp_parser_userdef_numeric_literal): Be helpful about
45 2017-12-01 Jakub Jelinek <jakub@redhat.com>
47 * parser.c (cp_parser_new): Don't clear cilk_simd_fn_info.
48 (parsing_nsdmi): Adjust comment.
49 (cp_parser_omp_for_loop_init): Likewise.
50 * parser.h (struct cp_omp_declare_simd_data): Adjust comment.
51 (struct cp_parser): Remove cilk_simd_fn_info field.
52 * cp-tree.h (cilk_valid_spawn): Remove.
55 * cp-gimplify.c (genericize_switch_stmt): Emit LABEL_EXPR for the
56 break label into SWITCH_BODY instead of after it and set
57 SWITCH_BREAK_LABEL_P on it.
58 * parser.c (cp_parser_objc_expression): Add FALLTHRU comment to avoid
59 -Wimplicit-fallthrough warning.
61 2017-11-30 Jason Merrill <jason@redhat.com>
63 PR c++/82219 - bogus -Wignored-qualifiers with template
64 * pt.c (tsubst_copy_and_build) [STATIC_CAST_EXPR]: Suppress
67 2017-11-29 David Malcolm <dmalcolm@redhat.com>
69 * parser.c (cp_parser_unary_expression): Generate a location for
71 (cp_parser_trait_expr): Generate and return a location_t,
72 converting the return type from tree to cp_expr.
73 (cp_parser_static_assert): Pass location of the condition to
74 finish_static_assert, rather than that of the "static_assert"
75 token, where available.
77 2017-11-29 Paolo Carlini <paolo.carlini@oracle.com>
80 * lambda.c (nonlambda_method_basetype): Don't use LAMBDA_TYPE_P
83 2017-11-29 Jason Merrill <jason@redhat.com>
85 PR c++/82760 - memory corruption with aligned new.
86 * call.c (build_operator_new_call): Update *args if we add the
89 2017-11-28 Jakub Jelinek <jakub@redhat.com>
92 * cp-tree.h (SWITCH_STMT_ALL_CASES_P): Define.
93 (SWITCH_STMT_NO_BREAK_P): Define.
94 (note_break_stmt, note_iteration_stmt_body_start,
95 note_iteration_stmt_body_end): Declare.
96 * decl.c (struct cp_switch): Add has_default_p, break_stmt_seen_p
97 and in_loop_body_p fields.
98 (push_switch): Clear them.
99 (pop_switch): Set SWITCH_STMT_CANNOT_FALLTHRU_P if has_default_p
100 and !break_stmt_seen_p. Assert in_loop_body_p is false.
101 (note_break_stmt, note_iteration_stmt_body_start,
102 note_iteration_stmt_body_end): New functions.
103 (finish_case_label): Set has_default_p when both low and high
105 * parser.c (cp_parser_iteration_statement): Use
106 note_iteration_stmt_body_start and note_iteration_stmt_body_end
107 around parsing iteration body.
108 * pt.c (tsubst_expr): Likewise.
109 * cp-objcp-common.c (cxx_block_may_fallthru): Return false for
110 SWITCH_STMT which contains no BREAK_STMTs, contains a default:
111 CASE_LABEL_EXPR and where SWITCH_STMT_BODY isn't empty and
113 * semantics.c (finish_break_stmt): Call note_break_stmt.
114 * cp-gimplify.c (genericize_switch_stmt): Copy SWITCH_STMT_ALL_CASES_P
115 bit to SWITCH_ALL_CASES_P. Assert that if SWITCH_STMT_NO_BREAK_P then
116 the break label is not TREE_USED.
118 2017-11-28 Julia Koval <julia.koval@intel.com>
119 Sebastian Peryt <sebastian.peryt@intel.com>
121 * Make-lang.in (cp/cp-array-notation.o, cp/cp-cilkplus.o): Delete.
122 * call.c (convert_for_arg_passing, build_cxx_call): Remove cilkplus.
123 * constexpr.c (potential_constant_expression_1): Ditto.
124 * cp-array-notation.c: Delete.
125 * cp-cilkplus.c: Ditto.
126 * cp-cilkplus.h: Ditto.
127 * cp-gimplify.c (cp_gimplify_expr, cp_fold_r, cp_genericize): Remove
129 * cp-objcp-common.c (ARRAY_NOTATION_REF): Delete.
130 * cp-tree.h (cilkplus_an_triplet_types_ok_p): Delete.
131 * decl.c (grokfndecl, finish_function): Remove cilkplus condition.
132 * error.c (dump_decl, dump_expr): Remove ARRAY_NOTATION_REF condition.
133 * lambda.c (cp-cilkplus.h): Remove.
134 * parser.c (cp_parser_cilk_simd, cp_parser_cilk_for,
135 cp_parser_cilk_simd_vectorlength): Delete.
136 (cp_debug_parser, cp_parser_ctor_initializer_opt_and_function_body,
137 cp_parser_postfix_expression,
138 cp_parser_postfix_open_square_expression,
139 cp_parser_statement, cp_parser_jump_statement,
140 cp_parser_direct_declarator,
141 cp_parser_late_return_type_opt, cp_parser_gnu_attribute_list,
142 cp_parser_omp_clause_name, cp_parser_omp_clause_aligned,
143 cp_parser_omp_clause_linear, cp_parser_omp_all_clauses,
145 cp_parser_omp_for_cond, cp_parser_omp_for_incr,
146 cp_parser_omp_for_loop_init,
147 cp_parser_omp_for_loop,
148 cp_parser_omp_declare_simd): Remove cilkplus support.
149 (CILK_SIMD_FN_CLAUSE_MASK, cp_parser_late_parsing_cilk_simd_fn_info,
150 cp_parser_cilk_grainsize): Remove.
151 (cp_parser_pragma, c_parse_file): Remove cilkplus support.
152 (cp_parser_cilk_simd_vectorlength, cp_parser_cilk_simd_linear,
153 cp_parser_cilk_simd_clause_name, cp_parser_cilk_simd_all_clauses,
154 cp_parser_cilk_simd, cp_parser_cilk_for): Remove.
155 * parser.h (IN_CILK_SIMD_FOR, IN_CILK_SPAWN): Remove.
156 * pt.c (tsubst_attribute, tsubst_expr, tsubst_copy_and_build): Remove
158 * semantics.c (finish_goto_stmt, begin_while_stmt, finish_do_body,
159 finish_init_stmt, finish_switch_cond, simplify_aggr_init_expr,
160 finish_omp_clauses, finish_omp_clauses, finish_omp_for): Remove
163 * tree.c (lvalue_kind): Remove ARRAY_NOTATION_REF conditon.
164 * typeck.c (cp_build_array_ref, cp_build_compound_expr,
165 check_return_expr): Remove cilkplus support.
167 2017-11-28 Jakub Jelinek <jakub@redhat.com>
169 * cp-gimplify.c (genericize_switch_stmt): Build SWITCH_EXPR using
170 build2_loc instead of build3_loc.
172 2017-11-27 Martin Sebor <msebor@redhat.com>
175 * init.c (warn_placement_new_too_small): Use offset_int instead of
178 2017-11-27 Jakub Jelinek <jakub@redhat.com>
181 * parser.c (cp_parser_decomposition_declaration): Reject just
182 BRACE_ENCLOSED_INITIALIZER_P initializers with nelts != 1 rather
183 than all such CONSTRUCTORs, and only if is_direct_init is true.
185 2017-11-27 Jason Merrill <jason@redhat.com>
187 * pt.c (primary_template_specialization_p): Rename from
188 primary_template_instantiation_p. Don't check
189 DECL_TEMPLATE_INSTANTIATION.
190 * call.c, cp-tree.h, decl2.c: Adjust.
192 2017-11-27 Jakub Jelinek <jakub@redhat.com>
195 * cp-gimplify.c (cp_fold) <case COND_EXPR>: Don't return immediately
196 for VOID_TYPE_P COND_EXPRs, instead fold the operands and if op0 is
197 INTEGER_CST, ensure that both op1 and op2 are non-NULL and fall
198 through into normal folding, otherwise just rebuild x if any op
201 * g++.dg/warn/pr81675.C: New test.
203 2017-11-14 Boris Kolpackov <boris@codesynthesis.com>
205 * Make-lang.in (c++.install-plugin): Install backend import library.
207 2017-11-23 Jakub Jelinek <jakub@redhat.com>
209 * parser.c (cp_parser_omp_declare): Change return type to bool from
210 void, return true for declare simd.
211 (cp_parser_pragma): Return cp_parser_omp_declare returned value
212 rather than always false.
214 2017-11-23 Mike Stump <mikestump@comcast.net>
215 Eric Botcazou <ebotcazou@adacore.com>
217 * pt.c (tsubst_expr) <ANNOTATE_EXPR>: Recurse on 3rd operand.
218 * semantics.c (finish_while_stmt_cond): Pass 3rd operand to
220 (finish_do_stmt): Likewise.
221 (finish_for_cond): Likewise.
223 2017-11-22 Jakub Jelinek <jakub@redhat.com>
226 * name-lookup.c (member_name_cmp): Return 0 if a == b.
228 2017-11-22 David Malcolm <dmalcolm@redhat.com>
231 * error.c (type_to_string): Add leading comment. Add params
232 "postprocessed", "quote", and "show_color", using them to fix
233 quoting of the "aka" for types involving typedefs.
234 (arg_to_string): Update for new params to type_to_string.
235 (cxx_format_postprocessor::handle): Likewise.
236 (cp_printer): Convert penultimate param from bool to bool *.
237 Update call to type_to_string and calls to
238 defer_phase_2_of_type_diff.
240 2017-11-22 Marek Polacek <polacek@redhat.com>
245 * class.c (layout_class_type): Set DECL_PADDING_P on padding.
246 * decl.c (cxx_init_decl_processing): Set TRANSLATION_UNIT_WARN_EMPTY_P.
247 (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.
249 2017-11-21 Martin Liska <mliska@suse.cz>
251 * class.c (finalize_literal_type_property): Add quotes for
253 (explain_non_literal_class): Likewise.
254 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
255 (is_valid_constexpr_fn): Likewise.
256 (check_constexpr_ctor_body): Likewise.
257 (register_constexpr_fundef): Likewise.
258 (explain_invalid_constexpr_fn): Likewise.
259 (cxx_eval_builtin_function_call): Likewise.
260 (cxx_eval_call_expression): Likewise.
261 (cxx_eval_loop_expr): Likewise.
262 (potential_constant_expression_1): Likewise.
263 * decl.c (check_previous_goto_1): Likewise.
264 (check_goto): Likewise.
265 (grokfndecl): Likewise.
266 (grokdeclarator): Likewise.
267 * error.c (maybe_print_constexpr_context): Likewise.
268 * method.c (process_subob_fn): Likewise.
269 (defaulted_late_check): Likewise.
270 * parser.c (cp_parser_compound_statement): Likewise.
272 2017-11-21 Marc Glisse <marc.glisse@inria.fr>
274 * constexpr.c (cxx_eval_constant_expression,
275 potential_constant_expression_1): Handle POINTER_DIFF_EXPR.
276 * cp-gimplify.c (cp_fold): Likewise.
277 * error.c (dump_expr): Likewise.
278 * typeck.c (pointer_diff): Use POINTER_DIFF_EXPR.
280 2017-11-21 Jakub Jelinek <jakub@redhat.com>
282 P0428R2 - familiar template syntax for generic lambdas
283 * parser.c (cp_parser_lambda_declarator_opt): Don't pedwarn
284 for cxx2a and above, reword pedwarn for C++14/C++17.
286 2017-11-20 David Malcolm <dmalcolm@redhat.com>
289 * name-lookup.c: Include "c-family/known-headers.h"
290 (lookup_name_fuzzy): Call get_cp_stdlib_header_for_name and
291 potentially return a new suggest_missing_header hint.
293 2017-11-20 David Malcolm <dmalcolm@redhat.com>
296 * name-lookup.c (class macro_use_before_def): New class.
297 (lookup_name_fuzzy): Detect macro that were used before being
298 defined, and report them as such.
300 2017-11-20 Jason Merrill <jason@redhat.com>
302 * decl2.c (constrain_class_visibility): Don't warn about artificial
305 2017-11-20 Jakub Jelinek <jakub@redhat.com>
307 P0329R4: Designated Initialization
308 * parser.c (cp_parser_initializer_clause): List in comment grammar
309 designated-initializer-list.
310 (cp_parser_initializer_list): Allow .identifier = without pedwarn for
311 C++2A, parse .identifier { ... }. Improve location_t argument to
312 pedwarn. Add pedwarn for [cst] = designators. Diagnose ... in
313 designated initializer list. Diagnose mixing designated and
314 non-designated initializer clauses for C++2A. Diagnose duplicated
315 identifiers in designators.
316 * name-lookup.h (search_anon_aggr): New declaration.
317 * name-lookup.c (fields_linear_search): Use search_anon_aggr.
318 (search_anon_aggr): New function.
319 * typeck2.c (process_init_constructor_record): Allow designator
320 to skip over some non-static data members. Handle anonymous
321 aggregates. Add diagnostics for designator order not matching
322 member declaration order.
324 2017-11-20 David Malcolm <dmalcolm@redhat.com>
326 * name-lookup.c: Define INCLUDE_UNIQUE_PTR before including system.h.
327 Include "c-family/name-hint.h"
328 (suggest_alternatives_for): Convert "fuzzy_name" from const char *
329 to name_hint, and rename to "hint". Pass location to
331 (lookup_name_fuzzy): Convert return type from const char *
332 to name_hint. Add location_t param.
333 * parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
334 Include "c-family/name-hint.h"
335 (cp_parser_diagnose_invalid_type_name): Convert
336 "suggestion" from const char * to name_hint, and rename to "hint".
337 Pass location to lookup_name_fuzzy.
339 2017-11-20 Nathan Sidwell <nathan@acm.org>
343 * call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited
345 * cp-gimplify.c (cp_genericize_r): Restore THUNK dereference
346 inhibibition check removed in previous c++/78495 change.
348 2017-11-20 Jakub Jelinek <jakub@redhat.com>
351 * constexpr.c (cxx_eval_vector_conditional_expression): New function.
352 (cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
353 of cxx_eval_conditional_expression.
355 2017-11-19 Jakub Jelinek <jakub@redhat.com>
359 * cp-gimplify.c (c_fully_fold): Add LVAL argument, call
360 cp_fold_maybe_rvalue instead of cp_fold_rvalue and pass it !LVAL.
362 2017-11-16 Jason Merrill <jason@redhat.com>
364 PR c++/79092 - non-type args of different types are different
365 * tree.c (cp_tree_equal): Check the type of constants.
366 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Handle UNIFY_ALLOW_INTEGER
367 when comparing to previously deduced argument.
368 (maybe_convert_nontype_argument): New.
369 (convert_nontype_argument): Call it.
370 (tsubst_copy_and_build): Handle partial instantiation of
372 (unify): Ignore type when deducing from array bound.
373 (dependent_type_p_r): Handle DEFERRED_NOEXCEPT.
374 (value_dependent_expression_p): Any type-dependent expression is
375 value-dependent. Handle IMPLICIT_CONV_EXPR.
376 * cp-tree.h (IMPLICIT_CONV_EXPR_NONTYPE_ARG): New.
377 * mangle.c (write_template_arg): Strip IMPLICIT_CONV_EXPR.
379 2017-11-16 Nathan Sidwell <nathan@acm.org>
383 * cp-objcp-common.h (LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME):
385 * cp-tree.h (overwrite_mangling): Declare.
386 * decl2.c (struct mangled_decl_hash): Entries are deletable.
387 (overwrite_mangling): New.
390 * decl.c (xref_tag_1): Push lambda into current scope.
391 * name-lookup.c (do_pushtag): Don't deal with ts_lambda here.
393 2017-11-15 Nathan Sidwell <nathan@acm.org>
396 * lambda.c (lambda_capture_field_type): Function references are
397 always catured by reference.
399 2017-11-15 Martin Liska <mliska@suse.cz>
401 * decl.c (begin_destructor_body): Use cp_build_fold_indirect_ref
402 instead of cp_build_indirect_ref.
404 2017-11-15 Martin Liska <mliska@suse.cz>
406 * decl.c (begin_destructor_body): In case of VPTR sanitization
407 (with disabled recovery), zero vptr in order to catch virtual calls
408 after lifetime of an object.
410 2017-11-14 Jason Merrill <jason@redhat.com>
412 Use GTY((cache)) on some hash tables.
413 * decl.c (decomp_type_table): Use tree_cache_map.
414 * init.c (nsdmi_inst): Likewise.
415 * pt.c (defarg_ints): Likewise.
416 * cp-objcp-common.c (cp_get_debug_type): Likewise.
418 2017-11-13 Jason Merrill <jason@redhat.com>
420 Capture adjustments for P0588R1.
421 * semantics.c (process_outer_var_ref): Capture variables when
422 they are named; complain about non-capture uses when odr-used.
423 * expr.c (mark_use): Rvalue use looks through capture proxy.
424 * constexpr.c (potential_constant_expression_1): Improve error about
425 use of captured variable.
426 * lambda.c (need_generic_capture, dependent_capture_r)
427 (do_dependent_capture, processing_nonlambda_template): Remove.
428 * call.c (build_this): Remove uses of the above.
429 * decl.c (cp_finish_decl): Likewise.
430 * semantics.c (maybe_cleanup_point_expr)
431 (maybe_cleanup_point_expr_void, finish_goto_stmt)
432 (maybe_convert_cond): Likewise.
433 * typeck.c (check_return_expr): Likewise.
436 * typeck.c (cp_build_fold_indirect_ref): New.
437 (cp_build_indirect_ref_1): Split out from cp_build_indirect_ref.
438 Add 'fold' parameter.
439 * cp-tree.h: Declare cp_build_fold_indirect_ref.
440 * call.c, class.c, cp-ubsan.c, decl.c, except.c, init.c, lambda.c,
441 parser.c, rtti.c, tree.c, typeck.c, typeck2.c: Use it.
442 * parser.c (do_range_for_auto_deduction): Use RO_UNARY_STAR.
443 (cp_convert_range_for): Likewise.
444 * typeck2.c (build_x_arrow): Use RO_ARROW.
446 * cp-ubsan.c (cp_ubsan_check_member_access_r): Fix handling of
447 INDIRECT_REF of ADDR_EXPR.
449 PR c++/82360 - ICE with static_cast in template.
450 * call.c (perform_direct_initialization_if_possible): Check
451 processing_template_decl.
452 * typeck.c (build_static_cast_1): Likewise.
454 2017-11-13 Ville Voutilainen <ville.voutilainen@gmail.com>
456 Remove the null check from placement new in all modes
457 * init.c (build_new_1): Don't do a null check for
458 a namespace-scope non-replaceable placement new
459 in any mode unless -fcheck-new is provided.
461 2017-11-07 Boris Kolpackov <boris@codesynthesis.com>
463 * Make-lang.in (CP_PLUGIN_HEADERS): Add operators.def since included
466 2017-11-07 Jakub Jelinek <jakub@redhat.com>
469 * cp-gimplify.c (cxx_omp_clause_apply_fn): For methods pass i - 1 to
470 convert_default_arg instead of i.
472 2017-11-06 Jason Merrill <jason@redhat.com>
474 P0704R1 - fixing const-qualified pointers to members
475 * typeck2.c (build_m_component_ref): Also accept in lower stds with
478 2017-11-06 Paolo Carlini <paolo.carlini@oracle.com>
481 * decl2.c (finish_static_data_member_decl): If there's an initializer,
482 complete the type and re-apply the quals.
484 2017-11-06 Martin Liska <mliska@suse.cz>
487 * constexpr.c (cxx_eval_builtin_function_call): Handle
488 __builtin_unreachable call.
489 (get_function_named_in_call): Declare function earlier.
490 (constexpr_fn_retval): Skip __builtin_unreachable.
491 * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Rename to
493 (cp_maybe_instrument_return): ... this.
494 (cp_genericize): Call the function unconditionally.
496 2017-11-03 Nathan Sidwell <nathan@acm.org>
499 * decl.c (grokdeclarator): Protect MAYBE_CLASS things from paren
502 2017-11-02 Paolo Carlini <paolo.carlini@oracle.com>
505 * pt.c (make_pack_expansion): Add tsubst_flags_t parameter.
506 (expand_integer_pack, convert_template_argument, coerce_template_parms,
507 gen_elem_of_pack_expansion_instantiation, tsubst_pack_expansion,
508 unify): Adjust calls.
509 * tree.c (cp_build_qualified_type_real): Likewise.
510 * cp-tree.h (make_pack_expansion): Adjust declaration.
512 2017-11-02 Nathan Sidwell <nathan@acm.org>
514 * cp-tree.h (IDENTIFIER_NEWDEL_OP_P): Restore, adjust.
515 (IDENTIFIER_NEW_OP_P): New.
516 * decl.c (grokdeclarator): Restore IDENTIFIER_NEWDEL_OP_P use.
517 * pt.c (push_template_decl_real): Likewise.
518 * typeck.c (check_return_expr): Use IDENTIFIER_NEW_OP_P.
521 * decl.c (grokdeclarator): Don't warn when parens protect a return
522 type from a qualified name.
524 2017-11-01 Nathan Sidwell <nathan@acm.org>
526 * cp-tree.h (enum cp_identifier_kind): Delete cik_newdel_op.
527 Renumber and reserve udlit value.
528 (IDENTIFIER_NEWDEL_OP_P): Delete.
529 (IDENTIFIER_OVL_OP_P): New.
530 (IDENTIFIER_ASSIGN_OP_P): Adjust.
531 (IDENTIFIER_CONV_OP_P): Adjust.
532 (IDENTIFIER_OVL_OP_INFO): Adjust.
533 (IDENTIFIER_OVL_OP_FLAGS): New.
534 * decl.c (grokdeclarator): Use IDENTIFIER_OVL_OP_FLAGS.
535 * lex.c (get_identifier_kind_name): Adjust.
536 (init_operators): Don't special case new/delete ops.
537 * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_P.
538 * pt.c (push_template_decl_real): Use IDENTIFIER_OVL_OP_FLAGS.
539 * typeck.c (check_return_expr): Likewise.
541 * cp-tree.h (assign_op_identifier, call_op_identifier): Use
543 (struct lang_decl_fn): Use compressed operator code.
544 (DECL_OVERLOADED_OPERATOR_CODE): Replace with ...
545 (DECL_OVERLOADED_OPERATOR_CODE_RAW): ... this.
546 (DECL_OVERLOADED_OPERATOR_CODE_IS): Use it.
547 * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE_RAW.
548 (build_library_fn): Likewise.
549 (grok_op_properties): Likewise.
550 * mangle.c (write_unqualified_name): Likewise.
551 * method.c (implicitly_declare_fn): Likewise.
552 * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_IS.
554 * cp-tree.h (IDENTIFIER_CP_INDEX): Define.
555 (enum ovl_op_flags): Add OVL_OP_FLAG_AMBIARY.
556 (enum ovl_op_code): New.
557 (struct ovl_op_info): Add ovl_op_code field.
558 (ovl_op_info): Size by OVL_OP_MAX.
559 (ovl_op_mapping, ovl_op_alternate): Declare.
560 (OVL_OP_INFO): Adjust for mapping array.
561 (IDENTIFIER_OVL_OP_INFO): New.
562 * decl.c (ambi_op_p, unary_op_p): Delete.
563 (grok_op_properties): Use IDENTIFIER_OVL_OP_INFO and
565 * lex.c (ovl_op_info): Adjust and static initialize.
566 (ovl_op_mappings, ovl_op_alternate): Define.
567 (init_operators): Iterate over ovl_op_info array and init mappings
569 * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_INFO.
570 * operators.def (DEF_OPERATOR): Remove KIND parm.
571 (DEF_SIMPLE_OPERATOR): Delete.
572 (OPERATOR_TRANSITION): Expand if defined.
574 2017-10-31 David Malcolm <dmalcolm@redhat.com>
576 * pt.c (listify): Use %< and %> for description of #include.
578 2017-10-31 David Malcolm <dmalcolm@redhat.com>
580 * class.c (explain_non_literal_class): Use UNKNOWN_LOCATION rather
582 * name-lookup.c (suggest_alternatives_for): Update for renaming of
584 (maybe_suggest_missing_header): Likewise.
585 (suggest_alternative_in_explicit_scope): Likewise.
586 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise for
587 renaming of error_at_rich_loc.
588 (cp_parser_string_literal): Likewise.
589 (cp_parser_nested_name_specifier_opt): Likewise.
590 (cp_parser_cast_expression): Likewise for renaming of
592 (cp_parser_decl_specifier_seq): Likewise for renaming of
593 error_at_rich_loc and warning_at_rich_loc.
594 (cp_parser_elaborated_type_specifier): Likewise for renaming of
596 (cp_parser_cv_qualifier_seq_opt): Likewise for renaming of
598 (cp_parser_virt_specifier_seq_opt): Likewise.
599 (cp_parser_class_specifier_1): Likewise.
600 (cp_parser_class_head): Likewise.
601 (cp_parser_member_declaration): Likewise for renaming of
602 pedwarn_at_rich_loc, warning_at_rich_loc, and error_at_rich_loc.
603 (cp_parser_enclosed_template_argument_list): Likewise for renaming
604 of error_at_rich_loc.
605 (set_and_check_decl_spec_loc): Likewise.
606 * pt.c (listify): Likewise.
607 * rtti.c (typeid_ok_p): Likewise.
608 * semantics.c (process_outer_var_ref): Use UNKNOWN_LOCATION rather
610 * typeck.c (access_failure_info::maybe_suggest_accessor): Update
611 for renaming of inform_at_rich_loc.
612 (finish_class_member_access_expr): Likewise for renaming of
615 2017-10-31 Nathan Sidwell <nathan@acm.org>
617 * cp-tree.h (struct operator_name_info_t): Rename to ...
618 (struct ovl_op_info_t): ... here. Add tree_code field.
619 (operator_name_info, assignment_operator_name_info): Delete.
620 (ovl_op_info): Declare.
621 (OVL_OP_INFO): Adjust.
622 * decl.c (grok_op_properties): Use ovl_op_flags.
623 * lex.c (operator_name_info, assignment_operator_name_info):
625 (ovl_op_info): Define.
626 (set_operator_ident): Adjust.
627 (init_operators): Set tree_code.
628 * mangle.c (write_unqualified_id): Adjust operator array scan.
630 * lex.c (init_operators): Allow NULL operator name. Don't add
632 * operators.def: Use NULL for mangling only operators. Move to
633 after regular operators but move assignment operators last.
635 * cp-tree.h (enum ovl_op_flags): New.
636 (struct operator_name_info_t): Rename arity to flags.
637 * lex.c (set_operator_ident): New.
638 (init_operators): Use it. Adjust for flags.
639 * mangle.c (write_unqualified_id): Adjust for flags.
640 * operators.def: Replace arity with flags.
642 * cp-tree.h (ovl_op_identifier): New.
643 (assign_op_identifier, call_op_identifier): Adjust.
644 (cp_operator_id, cp_assignment_operator_ide): Delete.
645 (SET_OVERLOADED_OPERATOR_CODE): Delete.
647 * call.c (op_error): Use OVL_OP_INFO.
648 (build_conditional_expr_1): Use ovl_op_identifier.
649 (build_new_op_1): Use OVL_OP_INFO & ovl_op_identifier.
650 (build_op_delete_call): Likewise.
651 * class.c (type_requires_array_cookie): Use ovl_op_identifier.
652 * decl.c (duplicate_decls): Directly copy operator code.
653 (builtin_function_1): Do not set operator code.
654 (build_library_fn): Directly set operator code.
655 (push_cp_library_fn): Use ovl_op_identifier.
656 (grok_op_properties): Directly set operator code.
657 * decl2.c (maybe_warn_sized_delete): Use ovl_op_identifier.
658 * error.c (dump_expr): Use OVL_OP_INFO.
659 (op_to_string): Add assop arg. Use OVL_OP_INFO.
660 (assop_to_string): Delete.
661 (args_to_string): Adjust.
662 * init.c (build_new_1): Use ovl_op_identifier.
663 * mangle.c (write_unqualified_name): Use OVL_OP_INFO.
664 (write_expression): Likewise.
665 * method.c (synthesized_method_walk): Use ovl_op_identifier.
666 (implicitly_declare_fn): Use assign_op_identifier. Directly set
668 * name-lookup.c (get_class_binding): Use assign_op_identifier.
669 * parser.c (cp_parser_operator): Use ovl_op_identifier.
670 (cp_parser_omp_clause_reduction): Likewise.
671 * semantics.c (omp_reduction_id): Likewise.
672 * typeck.c (cxx_sizeof_or_alignof_type): Use OVL_OP_INFO.
674 * cp-tree.h (assign_op_identifier, call_op_identifier): Define.
675 (LAMBDA_FUNCTION_P): Use DECL_OVERLOADED_OPERATOR_IS.
676 (DECL_OVERLOADED_OPERATOR_P): Just retuurn true/false.
677 (DECL_OVERLOADED_OPERATOR_CODE, DECL_OVERLOADED_OPERATOR_IS): Define.
678 * call.c (add_function_candidate): Use
679 DECL_OVERLOADED_OPERATOR_IS.
680 (build_op_call_1): Use call_op_identifier &
681 DECL_OVERLOADED_OPERATOR_IS.
682 (build_over_call): Likewise.
683 (has_trivial_copy_assign_p): Use assign_op_identifier.
684 (build_special_member_call): Likewise.
685 * class.c (dfs_declare_virt_assop_and_dtor): Likewise.
686 (vbase_has_user_provided_move_assign,
687 classtype_has_move_assign_or_move_ctor_p): Likewise.
688 * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE.
689 (grok_special_member_properties): Use assign_op_identifier.
690 (start_preparsed_function): Use DECL_OVERLOADED_OPERATOR_IS.
691 * decl2.c (mark_used): Use DECL_CONV_FN_P.
692 * dump.c (dump_access): Delete prototype.
694 (cp_dump_tree): Don't call it.
695 * lambda.c (lambda_function): Use call_op_identifier.
696 (maybe_add_lambda_conv_op): Not an overloaded operator. Remove
698 * mangle.c (write_unqualified_name): Use DECL_OVERLOADED_OPERTOR_CODE.
699 * method.c (do_build_copy_assign): Use assign_op_identifier.
700 (synthesize_method): Use DECL_OVERLOADED_OPERATOR_IS.
701 (get_copy_assign): Use assign_op_identifier.
702 (synthesized_method_walk): Likewise.
703 (defaultable_fn_check): Use DECL_OVERLOADED_OPERATOR_IS.
704 * parser.c (cp_parser_lambda_declarator_opt): Use
706 * semanitics.c (classtype_has_nothrow_assign_or_copy_p): Use
707 assign_op_identifier.
708 * tree.c (special_function_p): Use DECL_OVERLOADED_OPERATOR_IS.
709 * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_CODE.
710 (check_return_expr): Use assign_op_identifier.
712 2017-10-30 Paolo Carlini <paolo.carlini@oracle.com>
715 * pt.c (tsubst_copy_and_build, [INDIRECT_REF]): For a REFERENCE_REF_P,
716 unconditionally call convert_from_reference.
718 2017-10-30 Nathan Sidwell <nathan@acm.org>
720 * call.c (build_op_call_1): Test for FUNCTION_DECL in same manner
721 as a few lines earlier.
722 * cp-tree.h (PACK_EXPANSION_PATTERN): Fix white space.
723 * decl.c (grokfndecl): Fix indentation.
724 (compute_array_index_type): Use processing_template_decl_sentinel.
725 (grok_op_properties): Move warnings to end. Reorder other checks
726 to group similar entities. Tweak diagnostics.
727 * lex.c (unqualified_name_lookup_error): No need to check name is
728 not ERROR_MARK operator.
729 * parser.c (cp_parser_operator): Select operator code before
731 * typeck.c (check_return_expr): Fix indentation and line wrapping.
733 2017-10-27 Paolo Carlini <paolo.carlini@oracle.com>
735 * pt.c (invalid_nontype_parm_type_p): Return a bool instead of an int.
737 2017-10-26 Nathan Sidwell <nathan@acm.org>
739 * decl.c (sort_labels): Restore function.
740 (pop_labels): Sort labels
741 (identify_goto): Add translation markup.
743 2017-10-25 Nathan Sidwell <nathan@acm.org>
745 Kill IDENTIFIER_LABEL_VALUE.
746 * cp-tree.h (lang_identifier): Delete label_value slot.
747 (IDENTIFIER_LABEL_VALUE, SET_IDENTIFIER_LABEL_VALUE): Delete.
748 (struct named_label_hasher): Rename to ...
749 (struct named_label_hash): ... here. Reimplement.
750 (struct language_function): Adjust x_named_labels.
751 * name-lookup.h (struct cp_label_binding): Delete.
752 (struct cp_binding_level): Delete shadowed_labels slot.
753 * decl.c (struct named_label_entry): Add name and outer slots.
754 (pop_label): Rename to ...
755 (check_label_used): ... here. Don't pop.
756 (note_label, sort_labels): Delete.
757 (pop_labels, pop_local_label): Reimplement.
758 (poplevel): Pop local labels as any other decl. Remove
759 shadowed_labels handling.
760 (named_label_hash::hash, named_label_hash::equal): New.
761 (make_label_decl): Absorb into ...
762 (lookup_label_1): ... here. Add making_local_p arg, reimplement.
763 (lookup_label, declare_local_label): Adjust.
764 (check_goto, define_label): Adjust.
765 * lex.c (make_conv_op_name): Don't clear IDENTIFIER_LABEL_VALUE.
766 * ptree.c (cxx_print_identifier): Don't print identifier binding.
768 * decl.c (identifier_goto): Reduce duplication.
769 (check_previous_goto_1): Likewise.
770 (check_goto): Move var decls to initialization.
771 (check_omp_return, define_label_1, define_label): Likewise.
773 2017-10-25 Jakub Jelinek <jakub@redhat.com>
776 * decl.c (duplicate_decls): Copy "omp declare simd" attributes from
777 newdecl to corresponding __builtin_ if any.
779 2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
782 * decl.c (duplicate_decls): Warn for built-in functions declared as
783 non-function, use OPT_Wbuiltin_declaration_mismatch.
785 * decl.c (duplicate_decls): Avoid redundant '+' in warning_at.
787 2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
790 * pt.c (value_dependent_expression_p, [TRAIT_EXPR]): Handle
791 a TREE_LIST as TRAIT_EXPR_TYPE2.
793 2017-10-24 Mukesh Kapoor <mukesh.kapoor@oracle.com>
794 Paolo Carlini <paolo.carlini@oracle.com>
797 * cvt.c (type_promotes_to): Implement C++17, 7.6/4, about unscoped
798 enumeration type whose underlying type is fixed.
800 2017-10-23 Paolo Carlini <paolo.carlini@oracle.com>
803 * semantics.c (finish_compound_literal): Check do_auto_deduction
804 return value for error_mark_node.
806 2017-10-23 Jason Merrill <jason@redhat.com>
808 PR c++/77369 - wrong noexcept handling in C++14 and below
809 * tree.c (strip_typedefs): Canonicalize TYPE_RAISES_EXCEPTIONS.
811 2017-10-20 Nathan Sidwell <nathan@acm.org>
813 * class.c (layout_class_type): Cleanup as-base creation, determine
815 (finish_struct_1): ... not here.
817 2017-10-19 Jakub Jelinek <jakub@redhat.com>
820 * typeck.c (check_return_expr): Don't call
821 maybe_warn_about_returning_address_of_local in templates.
823 2017-10-17 Nathan Sidwell <nathan@acm.org>
826 * call.c (build_over_call): Don't pass tf_no_cleanup to nested
830 * cp-objcp-common.c (cp_tree_size): Reformat. Adjust returns size
833 2017-10-13 Jason Merrill <jason@redhat.com>
835 PR c++/82357 - bit-field in template
836 * tree.c (cp_stabilize_reference): Just return a NON_DEPENDENT_EXPR.
838 2017-10-13 David Malcolm <dmalcolm@redhat.com>
840 * cp-tree.h (maybe_show_extern_c_location): New decl.
841 * decl.c (grokfndecl): When complaining about literal operators
842 with C linkage, issue a note giving the location of the
844 * parser.c (cp_parser_new): Initialize new field
845 "innermost_linkage_specification_location".
846 (cp_parser_linkage_specification): Store the location
847 of the linkage specification within the cp_parser.
848 (cp_parser_explicit_specialization): When complaining about
849 template specializations with C linkage, issue a note giving the
850 location of the extern "C".
851 (cp_parser_explicit_template_declaration): Likewise for templates.
852 (maybe_show_extern_c_location): New function.
853 * parser.h (struct cp_parser): New field
854 "innermost_linkage_specification_location".
856 2017-10-12 Nathan Sidwell <nathan@acm.org>
858 * cp-tree.h (cp_expr): Add const operator * and operator->
860 (cp_tree_node_structure_enum): Delete TS_CP_BINDING,
861 TS_CP_WRAPPER, LAST_TS_CP_ENUM.
863 2017-10-12 David Malcolm <dmalcolm@redhat.com>
865 * parser.c (get_required_cpp_ttype): New function.
866 (cp_parser_error_1): Call it, using the result to call
867 maybe_suggest_missing_token_insertion.
869 2017-10-12 David Malcolm <dmalcolm@redhat.com>
871 * parser.c (get_matching_symbol): Move to before...
872 (cp_parser_error): Split out into...
873 (cp_parser_error_1): ...this new function, merging in content
875 (cp_parser_required_error): ...here. Eliminate partial duplicate
876 of body of cp_parser_error in favor of a call to the new
877 cp_parser_error_1 helper function.
879 2017-10-11 Nathan Sidwell <nathan@acm.org>
881 * decl2.c (struct mangled_decl_hash): Use DECL_ASSEMBLER_NAME_RAW.
882 (record_mangling): Likewise.
884 2017-10-10 Nathan Sidwell <nathan@acm.org>
886 * name-lookup.c (extern_c_fns): Rename to ...
887 (extern_c_decls): ... here.
888 (check_extern_c_conflict, extern_c_linkage_bindings): Update.
889 (do_pushdecl): Check extern-c fns and vars.
891 * cp-tree.h (default_hash_traits <lang_identifier *>): Delete
894 * decl2.c (struct mangled_decl_hash): New hash traits.
895 (mangled_decls): Make hash_table<mangled_decl_hash>.
896 (generate_mangling_alias, record_mangling): Adjust.
898 2017-10-10 Jason Merrill <jason@redhat.com>
900 More delayed lambda capture fixes.
901 * call.c (add_function_candidate): Use build_address.
902 (build_op_call_1): Call mark_lvalue_use early.
903 (build_over_call): Handle error from build_this.
904 * constexpr.c (cxx_bind_parameters_in_call): Use build_address.
905 (cxx_eval_increment_expression): Don't use rvalue().
906 * cvt.c (convert_to_void): Use mark_discarded_use.
907 * expr.c (mark_use): Handle PARM_DECL, NON_DEPENDENT_EXPR. Fix
908 reference handling. Don't copy the expression.
909 (mark_discarded_use): New.
910 * lambda.c (insert_capture_proxy): Add some sanity checking.
911 (maybe_add_lambda_conv_op): Set cp_unevaluated_operand.
912 * pt.c (register_local_specialization): Add sanity check.
913 * semantics.c (process_outer_var_ref): Fix check for existing proxy.
914 * typeck.c (cp_build_addr_expr_1): Handle error from
916 (cp_build_modify_expr): Call mark_lvalue_use_nonread, handle error
919 Handle generic lambda capture in dependent expressions.
920 * lambda.c (need_generic_capture, dependent_capture_r)
921 (do_dependent_capture): New.
922 * pt.c (processing_nonlambda_template): Use need_generic_capture.
923 * semantics.c (maybe_cleanup_point_expr)
924 (maybe_cleanup_point_expr_void, finish_goto_stmt)
925 (maybe_convert_cond): Call do_dependent_capture.
926 * typeck.c (build_static_cast): Remove dependent capture handling.
928 * typeck.c (condition_conversion): Assert !processing_template_decl.
929 * semantics.c (finish_omp_clauses): Don't
930 fold_build_cleanup_point_expr if processing_template_decl.
931 (outer_var_p): A temporary can't be from an outer scope.
932 * pt.c (type_dependent_expression_p): Fix dependency checking of
933 functions without DECL_TEMPLATE_INFO.
934 (instantiate_decl): Use lss_copy.
935 * constexpr.c (is_valid_constexpr_fn): Fix lambdas before C++17.
937 * typeck.c (check_return_expr): Check non-dependent conversion in
939 * constraint.cc (check_function_concept): Don't complain about an
940 empty concept if seen_error.
942 2017-10-10 Richard Sandiford <richard.sandiford@linaro.org>
944 * cvt.c (ignore_overflows): Use wi::to_wide when
945 operating on trees as wide_ints.
946 * decl.c (check_array_designated_initializer): Likewise.
947 * mangle.c (write_integer_cst): Likewise.
948 * semantics.c (cp_finish_omp_clause_depend_sink): Likewise.
950 2017-10-10 Nathan Sidwell <nathan@acm.org>
952 * name-lookup.c (set_global_binding): Don't deal with STAT_HACK.
954 2017-10-06 Paolo Carlini <paolo.carlini@oracle.com>
957 * decl.c (finish_function): Take a bool intead of an int; adjust.
958 * cp-tree.h (finish_function): Adjust declaration.
959 * decl2.c (generate_tls_wrapper, finish_objects,
960 finish_static_storage_duration_function): Adjust calls.
961 * lambda.c (maybe_add_lambda_conv_op, finish_lambda_function):
963 * method.c (synthesize_method): Likewise.
964 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
965 * pt.c (instantiate_decl): Likewise.
966 * parser.c (cp_parser_function_definition_after_declarator,
967 cp_parser_late_parsing_for_member, cp_parser_omp_declare_reduction):
969 (cp_parser_ctor_initializer_opt,
970 cp_parser_ctor_initializer_opt_and_function_body,
971 cp_parser_function_try_block,
972 cp_parser_function_definition_after_declarator,
973 cp_parser_function_transaction): Return void; adjust declarations.
975 2017-10-06 Nathan Sidwell <nathan@acm.org>
978 * name-lookup.c (check_local_shadow): Don't try and convert
981 2017-10-06 Jakub Jelinek <jakub@redhat.com>
984 * decl.c (reshape_init): Suppress warn_useless_cast for direct enum
986 * typeck.c (convert_for_assignment): Likewise.
988 P0704R1 - fixing const-qualified pointers to members
989 * typeck2.c (build_m_component_ref): For -std=c++2a allow
990 pointer to const & qualified method on rvalue.
992 2017-10-06 Nathan Sidwell <nathan@acm.org>
994 Use hash_table for extern "C" names
995 * name-lookup.c (extern_c_fns): Use hash_table.
996 (check_extern_c_conflict): Adjust.
997 (c_linkage_bindings): Adjust.
999 Use hash_table for namespace bindings
1000 * cp-tree.h (struct named_decl_hash): New.
1001 (lang_decl_ns): Change type of bindings field.
1002 * lex.c (maybe_add_lang_decl_raw): Adjust.
1003 * name-lookup.c (find_namespace_slot): Adjust.
1004 (do_pushdecl): Push NULL-named namespace.
1005 (do_push_nested_namespace): Adjust.
1006 (push_namespace): Push anonymous namespace as NULL name.
1008 2017-10-05 Jason Merrill <jason@redhat.com>
1010 Pass variadic class objects exactly like named by-value args.
1011 * call.c (convert_arg_to_ellipsis): Use the result of force_rvalue.
1013 2017-10-05 Nathan Sidwell <nathan@acm.org>
1015 Warn on MVP declarations
1016 * cp-tree.h (struct cp_declarator): Add parenthesized field.
1017 * decl.c (grokdeclarator): Warn about unnecessary parens.
1018 * parser.c (make_declarator): Init parenthesized field.
1019 (cp_parser_direct_declarator): Set parenthesized field.
1021 Kill IDENTIFIER_GLOBAL_VALUE, SET_IDENTIFIER_GLOBAL_VALUE
1022 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1023 SET_IDENTIFIER_GLOBAL_VALUE): Delete.
1024 * name-lookup.h (set_global_binding): Remove NAME parm.
1025 (get_global_binding): New inline fn.
1026 * name-lookup.c (set_global_binding): Remove NAME parm. Adjust.
1027 (identifier_global_value): Move to ...
1028 * cp-objcp-common.c (identifier_global_value): ... here.
1029 * class.c (build_ctor_vtbl_group, build_vtbl_initializer): Adjust.
1030 * decl.c (record_builtin_type, expand_static_init,
1031 grokdeclarator): Adjust.
1032 * decl2.c (get_guard, get_local_tls_init_fn, get_tls_init_fn,
1033 get_tls_wrapper_fn, maybe_warn_sized_delete): Adjust.
1034 * except.c (declare_library_fn, build_throw): Adjust.
1035 * init.c (throw_bad_array_length): Adjust.
1036 * rtti.c (throw_bad_cast, throw_bad_typeid, get_tinfo_decl): Adjust.
1038 * decl2.c (record_mangling): Fix spello and formatting from
1041 2017-10-04 Nathan Sidwell <nathan@acm.org>
1043 Give builtin types the correct name.
1044 * name-lookup.c (set_global_binding): Assert name is DECL_NAME.
1045 * decl.c (record_builtin_type): Reimplement, use new TYPE_DECL for
1048 2017-10-04 Paolo Carlini <paolo.carlini@oracle.com>
1049 Andrew Pinski <apinski@cavium.com>
1052 * parser.c (cp_parser_lambda_body): Set parser->in_function_body.
1054 2017-10-04 Nathan Sidwell <nathan@acm.org>
1056 Move mangling aliases out of global namespace.
1057 * cp-tree.h (record_mangling): New.
1058 (maybe_remove_implicit_alias): Delete.
1059 * decl2.c (mangled_decls): New hash map.
1060 (generate_mangling_alias): Reimplement using mangled_decls.
1061 (record_mangling): New.
1062 * mangle.c (decl_implicit_alias_p,
1063 maybe_remove_implicit_alias): Delete.
1064 (mangle_decl): Use record_mangling.
1065 * name-lookup.c (supplement_binding_1): Remove
1066 maybe_remove_implicit_alias check.
1068 2017-10-04 Jakub Jelinek <jakub@redhat.com>
1071 * error.c (dump_function_decl): If show_return, call dump_type_suffix
1072 on the same return type dump_type_prefix has been called on.
1074 2017-10-04 Jason Merrill <jason@redhat.com>
1076 PR c++/81525 - broken handling of auto in generic lambda.
1077 * pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.
1079 2017-10-04 Nathan Sidwell <nathan@acm.org>
1081 * call.c (convert_arg_to_ellipsis): Correct comment about passing
1084 2017-10-02 Richard Sandiford <richard.sandiford@linaro.org>
1086 * constexpr.c (cxx_eval_store_expression): Use wi::to_widest
1087 when comparing the array bounds with an ARRAY_REF index.
1089 2017-09-30 Paolo Carlini <paolo.carlini@oracle.com>
1092 * method.c (defaulted_late_check): Early return if the defaulted
1093 declaration does not match the expected signature.
1095 2017-09-29 Jakub Jelinek <jakub@redhat.com>
1097 P0683R1 - default member initializers for bit-fields
1098 * cp-tree.h (grokbitfield): Add INIT parameter.
1099 * parser.c (cp_parser_constant_expression): Add STRICT_P argument,
1100 if true, parse a conditional-expression rather than
1101 assignment-expression.
1102 (cp_parser_member_declaration): For C++11 and later pass true
1103 as STRICT_P to cp_parser_constant_expression. Parse C++2A bitfield
1104 NSDMIs. Adjust grokbitfield caller. Handle DECL_INITIAL also for
1106 (cp_parser_objc_class_ivars): Adjust grokbitfield caller.
1107 * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs.
1108 (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs.
1109 * decl2.c (grokbitfield): Add INIT parameter, pass it to
1111 * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not
1114 * class.c (check_bitfield_decl): Retrieve and clear width from
1115 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
1116 (check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than
1118 (remove_zero_width_bit_fields): Adjust comment.
1119 * decl2.c (grokbitfield): Stash width into
1120 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
1121 * pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr
1122 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width.
1124 * parser.c (cp_parser_member_declaration): Parse attributes before
1125 colon of a bitfield in addition to after colon.
1127 * Make-lang.in (check-c++-all): Test also c++2a.
1129 2017-09-28 Jason Merrill <jason@redhat.com>
1131 PR c++/56973, DR 696 - capture constant variables only as needed.
1132 * expr.c (mark_use): Split out from mark_rvalue_use and
1133 mark_lvalue_use. Handle lambda capture of constant variables.
1134 (mark_lvalue_use_nonread): New.
1135 * semantics.c (process_outer_var_ref): Don't capture a constant
1136 variable until forced.
1137 * pt.c (processing_nonlambda_template): New.
1138 * call.c (build_this): Check it.
1139 * decl2.c (grok_array_decl): Call mark_rvalue_use and
1140 mark_lvalue_use_nonread.
1141 * init.c (constant_value_1): Don't call mark_rvalue_use.
1142 * typeck.c (build_static_cast): Handle lambda capture.
1144 Use local_specializations to find capture proxies.
1145 * cp-tree.h (DECL_CAPTURED_VARIABLE): New.
1146 * lambda.c (build_capture_proxy): Set it.
1147 (add_capture): Pass initializer to build_capture_proxy.
1148 (start_lambda_function): Likewise.
1149 (insert_capture_proxy): Use register_local_specialization.
1150 (is_lambda_ignored_entity): Always ignore proxies.
1151 * name-lookup.c (qualify_lookup): Don't check
1152 is_lambda_ignored_entity if LOOKUP_HIDDEN is set.
1153 * semantics.c (process_outer_var_ref): Use
1154 retrieve_local_specialization.
1155 * parser.c (cp_parser_lambda_body): Push local_specializations.
1156 * pt.c (tsubst_expr): Pass LOOKUP_HIDDEN when looking for a proxy.
1157 (tsubst_lambda_expr): Push local_specializations sooner.
1158 (tsubst_copy_and_build): Don't register_local_specialization.
1160 * call.c (build_special_member_call): Use the return value of
1162 * decl.c (compute_array_index_type): Likewise.
1163 * parser.c (cp_parser_oacc_wait_list): Likewise.
1164 * lambda.c (is_normal_capture_proxy): Handle *this capture.
1165 (add_capture): Clarify internal_error message.
1167 2017-09-22 Eric Botcazou <ebotcazou@adacore.com>
1170 * cp-objcp-common.c (cp_get_debug_type): Do only one lookup.
1172 2017-09-22 Jakub Jelinek <jakub@redhat.com>
1175 * tree.c (struct replace_placeholders_t): Add pset field.
1176 (replace_placeholders_r): Call cp_walk_tree with d->pset as
1177 last argument instead of NULL. Formatting fix.
1178 (replace_placeholders): Add pset variable, add its address
1179 into data. Pass &pset instead of NULL to cp_walk_tree.
1181 2017-09-22 David Malcolm <dmalcolm@redhat.com>
1183 * call.c (get_fndecl_argument_location): New function.
1184 (convert_like_real): Use it when complaining about argument type
1186 * cp-tree.h (struct cp_parameter_declarator): Add "loc" field.
1187 * parser.c (make_parameter_declarator): Add "loc" param and use
1188 it to initialize the new field.
1189 (cp_parser_translation_unit): Add UNKNOWN_LOCATION for "loc" of
1190 the "no_parameters" parameter.
1191 (cp_parser_parameter_declaration_list): Set the location of the
1192 result of grokdeclarator to be the parameter's loc, assuming no
1194 (cp_parser_parameter_declaration): Generate a location for the
1195 parameter and pass to make_parameter_declarator.
1197 2017-09-20 Nathan Sidwell <nathan@acm.org>
1199 * name-lookup.c (member_name_cmp): Use DECL_UID for final
1202 2017-09-20 Jakub Jelinek <jakub@redhat.com>
1204 P0409R2 - allow lambda capture [=, this]
1205 * parser.c (cp_parser_lambda_introducer): For cxx2a don't pedwarn on
1206 redundant [=, this].
1208 2017-09-18 Jason Merrill <jason@redhat.com>
1210 PR c++/82069 - ICE with lambda in template
1211 * semantics.c (process_outer_var_ref): Check uses_template_parms
1212 instead of any_dependent_template_arguments_p.
1214 2017-09-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1215 Paolo Carlini <paolo.carlini@oracle.com>
1218 * decl2.c (finish_anon_union): Complain about "anonymous union with
1219 no members" with a pedwarn.
1221 2017-09-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
1223 * typeck.c (build_reinterpret_cast_1,
1224 build_const_cast_1): Implement -Wcast-align=strict.
1226 2017-09-15 Jakub Jelinek <jakub@redhat.com>
1228 * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
1229 adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
1230 to C++17 or -std=gnu++17 or -std=c++17. Adjust comments.
1231 (cxx_init_decl_processing, next_initializable_field,
1232 is_direct_enum_init, check_initializer, cp_finish_decl,
1233 mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
1234 finish_function): Likewise.
1235 * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
1236 * pt.c (mark_template_parm, convert_nontype_argument,
1237 instantiate_class_template_1, type_unification_real, unify,
1238 get_partial_spec_bindings, dependent_type_p_r): Likewise.
1239 * typeck.c (cp_build_unary_op): Likewise.
1240 * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
1241 * call.c (build_user_type_conversion_1, build_over_call,
1242 build_special_member_call): Likewise.
1243 * lambda.c (begin_lambda_type): Likewise.
1244 * typeck2.c (process_init_constructor_record): Likewise.
1245 * class.c (build_base_field, finalize_literal_type_property,
1246 explain_non_literal_class): Likewise.
1247 * parser.c (cp_parser_diagnose_invalid_type_name,
1248 cp_parser_primary_expression, cp_parser_lambda_introducer,
1249 cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
1250 cp_convert_range_for, cp_parser_perform_range_for_lookup,
1251 cp_parser_decomposition_declaration, cp_parser_linkage_specification,
1252 cp_parser_static_assert, cp_parser_simple_type_specifier,
1253 cp_parser_namespace_definition, cp_parser_using_declaration,
1254 cp_parser_init_declarator, cp_parser_type_parameter_key,
1255 cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
1256 cp_parser_constructor_declarator_p): Likewise.
1257 * mangle.c (struct globals): Rename need_cxx1z_warning to
1259 (write_exception_spec, start_mangling, mangle_decl): Likewise.
1260 * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
1262 (check-c++17): New goal. Use 17 instead of 1z.
1263 (check-c++-all): Use 17 instead of 1z.
1265 2017-09-14 Jakub Jelinek <jakub@redhat.com>
1268 * cp-gimplify.c (omp_var_to_track): Look through references.
1269 (omp_cxx_notice_variable): Likewise.
1271 2017-09-13 Nathan Sidwell <nathan@acm.org>
1273 Conv-op identifers not in identifier hash table
1274 * lex.c (conv_type_hasher): Make member fns inline.
1275 (make_conv_op_name): Directly clone conv_op_identifier.
1277 Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
1278 * cp-tree.h (struct lang_type): Rename methods to members.
1279 (CLASSTYPE_METHOD_VEC): Rename to ...
1280 (CLASSTYPE_MEMBER_VEC): ... this.
1281 * name-lookup.h (get_method_slot): Rename to ...
1282 (get_member_slot): ... this.
1283 (resort_type_method_vec): Rename to ...
1284 (resort_type_member_vec): ... this.
1285 * class.c (add_method, warn_hidden): Adjust.
1286 * search.c (dfs_locate_field_accessor_pre): Adjust.
1287 * name-lookup.c (method_vec_binary_search): Rename to ...
1288 (member_vec_binary_search): ... this and adjust.
1289 (method_vec_linear_search): Rename to ...
1290 (member_vec_linear_search): ... this and adjust.
1291 (fields_linear_search, get_class_binding_direct): Adjust.
1292 (get_method_slot): Rename to ...
1293 (get_member_slot): ... this and adjust.
1294 (method_name_slot): Rename to ...
1295 (member_name_slot): ... this and adjust.
1296 (resort_type_method_vec): Rename to ...
1297 (resort_type_member_vec): ... this and adjust.
1298 (method_vec_append_class_fields): Rename to ...
1299 (member_vec_append_class_fields): ... this and adjust.
1300 (method_vec_append_enum_values): Rename to ...
1301 (member_vec_append_enum_values): ... this and adjust.
1302 (method_vec_dedup): Rename to ...
1303 (member_vec_dedup): ... this and adjust.
1304 (set_class_bindings, insert_late_enum_def_bindings): Adjust.
1306 2017-09-12 Paolo Carlini <paolo.carlini@oracle.com>
1309 * decl.c (start_decl): Early return error_mark_node if duplicate_decls
1310 returns it; avoid misleading error message.
1312 2017-09-12 Nathan Sidwell <nathan@acm.org>
1314 Kill CLASSTYPE_SORTED_FIELDS.
1315 * cp-tree.h (struct lang_type): Lose sorted_fields member.
1316 (CLASSTYPE_SORTED_FIELDS): Delete.
1317 * name-lookup.h (set_class_bindings): Add EXTRA arg.
1318 * name-lookup.c (fields_linear_search): New, broken out of ...
1319 (lookup_field_1): ... here. Delete remainder of function.
1320 (get_class_binding_direct): Reimplement without sorted_fields.
1321 (get_class_binding): Rename TYPE arg to KLASS, for consistency.
1322 (get_method_slot): Call set_class_binding when creating method_vec
1324 (method_name_cmp): Order identically named slots.
1325 (sorted_fields_type_new): Delete.
1326 (field_vc_append_class_fields): Rename to ...
1327 (method_vec_append_class_fields): ... here. Adjust.
1328 (field_vec_append_enum_values): Renme to ...
1329 (method_vec_append_enum_values): ... here. Adjust.
1330 (method_vec_dedup): New.
1331 (set_class_bindings): Reimplement.
1332 (insert_late_enum_def_bindings): Reimplement.
1334 * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
1336 (restort_data): Move later.
1337 (method_name_cmp, resort_method_name_cmp): Simplify.
1338 (resort_type_method_vec): Reformat.
1340 2017-09-09 Jason Merrill <jason@redhat.com>
1342 * constexpr.c (reduced_constant_expression_p): If
1343 CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
1345 2017-09-09 Eric Botcazou <ebotcazou@adacore.com>
1348 * cp-objcp-common.c (struct debug_type_hasher): New class.
1349 (debug_type_hash): New variable.
1350 (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
1352 2017-09-08 Jason Merrill <jason@redhat.com>
1354 PR c++/70029 - ICE with ref-qualifier and -flto
1355 * tree.c (cxx_copy_lang_qualifiers): New.
1356 * cp-tree.h: Declare it.
1357 * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
1359 2017-09-06 Jason Merrill <jason@redhat.com>
1361 PR c++/82053 - ICE with default argument in lambda in template
1362 * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
1364 (retrieve_specialization): Use lambda_fn_in_template_p.
1365 * cp-tree.h: Declare it.
1367 PR c++/82070 - error with nested lambda capture
1368 * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
1369 register_local_specialization.
1371 2017-09-06 Nathan Sidwell <nathan@acm.org>
1373 * name-lookup.h (lookup_field_1): Delete.
1374 (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
1375 * name-lookup.c (lookup_field_1): make static
1376 (method_vec_binary_search, method_vec_linear_search): New. Broken
1378 (get_class_binding_direct): ... here. Add TYPE_OR_FNS argument.
1379 Do complete search of this level.
1380 (get_class_binding): Adjust.
1381 * decl.c (reshape_init_class): Call get_class_binding.
1382 * search.c (lookup_field_r): Move field searching into
1383 get_class_binding_direct.
1385 * class.c (warn_hidden): Don't barf on non-functions.
1386 * decl2.c (check_classfn): Likewise. Check template match earlier.
1388 * name-lookup.c (count_fields): Rename to ...
1389 (count_class_fields): ... here. Take a class, don't count
1391 (add_fields_to_record_type): Rename to ...
1392 (field_vec_append_class_fields): ... here. Take a class, don't
1393 add NULL-named fields.
1394 (add_enum_fields_to_record_type): Rename to ...
1395 (field_vec_append_enum_values): ... here.
1396 (set_class_bindings): Adjust, assert we added expected number.
1397 (insert_late_enum_def_bindings): Reimplement. Create vector if
1398 there are now sufficient entries.
1400 * name-lookup.h (lookup_fnfields_slot_nolazy,
1401 lookup_fnfields_slot): Rename to ...
1402 (get_class_binding_direct, get_class_binding): ... here.
1403 * name-lookup.c (lookup_fnfields_slot_nolazy,
1404 lookup_fnfields_slot): Rename to ...
1405 (get_class_binding_direct, get_class_binding): ... here.
1406 * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
1407 * call.c (build_user_type_conversion_1): Adjust.
1408 (has_trivial_copy_assign_p): Adjust.
1409 (has_trivial_copy_p): Adjust.
1410 * class.c (get_basefndecls) Adjust.
1411 (vbase_has_user_provided_move_assign) Adjust.
1412 (classtype_has_move_assign_or_move_ctor_p): Adjust.
1413 (type_build_ctor_call, type_build_dtor_call): Adjust.
1414 * decl.c (register_dtor_fn): Adjust.
1415 * decl2.c (check_classfn): Adjust.
1416 * pt.c (retrieve_specialization): Adjust.
1417 (check_explicit_specialization): Adjust.
1418 (do_class_deduction): Adjust.
1419 * search.c (lookup_field_r): Adjust.
1420 (look_for_overrides_here, lookup_conversions_r): Adjust.
1421 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
1422 * tree.c (type_has_nontrivial_copy_init): Adjust.
1423 * method.c (lazily_declare_fn): Adjust comment.
1425 2017-09-05 Nathan Sidwell <nathan@acm.org>
1427 * name-lookup.c (do_class_using_decl): Elide read-once temps.
1428 Move declarations to initializations.
1430 * class.c (add_method): Move slot search and insertion to ...
1431 * name-lookup.c (get_method_slot): ... this new function.
1432 (lookup_fnfields_slot_nolazy): Cope with NULL slot.
1433 * name-lookup.h (get_method_slot): Declare.
1434 * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
1436 (grok_special_member_properties): Set
1437 TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
1438 Improve TYPE_HAS_CONSTEXPR_CTOR setting.
1440 * cp-tree.h (lang_decl_base): Rename template_conv_p to
1442 (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
1443 (DECL_CONV_FN_TYPE): FN must be conv op.
1444 (DECL_TEMPLATE_CONV_FN_P): Delete.
1445 (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
1446 * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
1449 * class.c (unreverse_member_declarations): Remove extraneous if.
1450 * pt.c (push_template_decl_real): Use string concatenation, not
1451 \<newline>. Add %<..%>.
1453 2017-09-05 Paolo Carlini <paolo.carlini@oracle.com>
1456 * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
1457 * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
1458 creating cdtor_label.
1459 * constexpr.c (returns): Add the case of a constructor/destructor
1460 returning via a LABEL_DECL_CDTOR label.
1461 (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
1463 2017-09-01 Nathan Sidwell <nathan@acm.org>
1465 * cp-tree.h (resort_type_method_vec): Move declaration to ...
1466 * name-lookup.h (resort_type_method_vec): ... here.
1467 (set_class_bindings): Lose 2nd arg.
1468 * class.c (finish_struct_1, finish_struct): Adjust
1469 set_class_bindings call. Don't call finish_struct_methods.
1470 (resort_data, method_name_cmp, resort_method_name_cmp,
1471 resort_type_method_vec, finish_struct_methods): Move to ...
1472 * name-lookup.c (resort_data, method_name_cmp,
1473 resort_method_name_cmp, resort_type_method_vec): ... here.
1474 (set_class_bindings): Lose fields arg. Swallow finish_struct_methods.
1476 * class.c (finish_struct): Call set_class_bindings for the
1479 * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
1480 Don't call maybe_warn_about_overly_private_class here.
1481 (warn_hidden): Cleanup declarations and comments.
1482 (type_has_user_provided_constructor): No need to check
1483 CLASSTYPE_METHOD_VEC.
1484 (type_has_user_provided_or_explicit_constructor): Likewise.
1485 (classtype_has_move_assign_or_move_ctor_p): Likewise.
1486 (check_bases_and_members): Don't call finish_struct_methods here.
1487 (finish_struct_1): Call finish_struct_methods and
1488 set_class_bindings immediately after layout. Clear DECL_IN_AGGR_P
1490 (finish_struct): For templates process USING_DECLS and clear
1491 DECL_IN_AGGR_P before calling finish_struct_methods. Call
1492 maybe_warn_about_overly_private_class here.
1494 Revert 2017-08-28 Nathan Sidwell <nathan@acm.org>
1495 Restore sorted_fields vector.
1496 * cp-tree.h (lang_type): Restore sorted_fields vector.
1497 (CLASSTYPE_SORTED_FIELDS): Restore.
1498 (CLASSTYPE_BINDINGS): Delete.
1499 * name-lookup.c (lookup_field_1): Restore binary search.
1500 (sorted_fields_type_new, count_fields,
1501 add_fields_to_record_type, add_enum_fields_to_record_type): Restore
1502 (set_class_bindings): Revert.
1503 (insert_late_enum_def_binding): Restore field_vec insertion.
1505 2017-09-01 Jakub Jelinek <jakub@redhat.com>
1508 * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
1510 2017-09-01 Marek Polacek <polacek@redhat.com>
1513 * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
1515 2017-08-30 Jason Merrill <jason@redhat.com>
1517 PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
1518 * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
1519 (regenerated_lambda_fn_p): New.
1520 (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
1521 (tsubst_copy) [VAR_DECL]: Likewise.
1523 PR c++/82030 - ICE inheriting from multiple lambdas
1525 * call.c (compare_ics): Handle null candidate.
1527 2017-08-30 Ville Voutilainen <ville.voutilainen@gmail.com>
1529 Make taking the address of an overloaded function a non-deduced context
1531 * pt.c (unify_overload_resolution_failure): Remove.
1532 (unify_one_argument): Adjust.
1534 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1535 Alan Hayward <alan.hayward@arm.com>
1536 David Sherwood <david.sherwood@arm.com>
1538 * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
1540 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1541 Alan Hayward <alan.hayward@arm.com>
1542 David Sherwood <david.sherwood@arm.com>
1544 * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
1546 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1547 Alan Hayward <alan.hayward@arm.com>
1548 David Sherwood <david.sherwood@arm.com>
1550 * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
1551 instead of TYPE_MODE.
1553 2017-08-29 Jason Merrill <jason@redhat.com>
1555 PR c++/81236 - ICE with template-id in generic lambda
1556 * semantics.c (finish_id_expression): Remove special dependent case.
1557 Avoid some later pieces when dependent.
1558 (finish_qualified_id_expr): Do normal BASELINK handling in a
1559 template. Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
1560 (parsing_default_capturing_generic_lambda_in_template): Remove.
1561 * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
1562 error for types that will never be complete.
1563 * mangle.c (write_expression): Add sanity check.
1564 * tree.c (build_qualified_name): Add sanity check.
1565 (cp_walk_subtrees): Walk into the class context of a BASELINK.
1566 * lambda.c (add_capture): Improve diagnostic for generic lambda
1568 * call.c (build_new_method_call_1): Print the right constructor
1571 Reimplement handling of lambdas in templates.
1572 * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
1573 * decl.c (start_preparsed_function): Call start_lambda_scope.
1574 (finish_function): Call finish_lambda_scope.
1575 * init.c (get_nsdmi): Call start/finish_lambda_scope.
1576 * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
1577 * parser.c (cp_parser_function_definition_after_declarator): Don't
1578 call start/finish_lambda_scope.
1579 * pt.c (retrieve_specialization): Ignore lambda functions in
1581 (find_parameter_packs_r): Ignore capture proxies. Look into
1583 (check_for_bare_parameter_packs): Allow bare packs in lambdas.
1584 (tsubst_default_argument): Call start/finish_lambda_scope.
1585 (tsubst_function_decl): Handle lambda functions differently.
1586 (tsubst_template_decl): Likewise.
1587 (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
1589 (tsubst_lambda_expr): Create a new closure rather than instantiate
1590 the one from the template.
1591 (tsubst_copy_and_build): Don't register a specialization of a pack.
1592 (regenerate_decl_from_template): Call start/finish_lambda_scope.
1593 (instantiate_decl): Remove special lambda function handling.
1594 * semantics.c (process_outer_var_ref): Remove special generic lambda
1595 handling. Don't implicitly capture in a lambda in a template. Look
1596 for an existing proxy.
1597 * class.c (current_nonlambda_class_type): Use decl_type_context.
1599 * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
1600 (LAMBDA_EXPR_RETURN_TYPE): Remove.
1601 (struct tree_lambda_expr): Remove closure and return_type fields.
1602 * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
1603 * pt.c (tsubst_copy_and_build): Likewise.
1604 * parser.c (cp_parser_lambda_declarator_opt): Track return type.
1605 (cp_parser_lambda_body): Adjust unspecified return type check.
1606 * ptree.c (cxx_print_lambda_node): Don't print closure or
1609 PR c++/80935 - wrong C++17 error with lambda
1610 * decl.c (check_for_uninitialized_const_var): Check
1611 is_instantiation_of_constexpr.
1612 * constexpr.c (ensure_literal_type_for_constexpr_object): Check
1613 is_instantiation_of_constexpr.
1614 (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
1616 * lambda.c (build_lambda_object): Check for error_mark_node.
1617 * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
1619 (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
1620 (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
1622 PR c++/80767 - unnecessary instantiation of generic lambda
1623 * call.c (convert_like_real): Call build_user_type_conversion_1 if
1625 (add_conv_candidate): Build a ck_user conversion with no candidate.
1627 Fix lambdas in template default argument of inherited ctor.
1628 * method.c (synthesized_method_base_walk): Replace an inherited
1629 template with its specialization.
1630 (synthesized_method_walk): Make inheriting_ctor a pointer.
1631 (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
1632 (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
1634 * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
1635 template, not the function.
1636 (template_guide_p): Adjust.
1638 Support copying local_specializations.
1639 * cp-tree.h (enum lss_policy): New.
1640 (local_specialization_stack): Add policy parameter to default ctor.
1641 * pt.c (local_specialization_stack): Copy local_specializations if
1644 * constexpr.c (potential_constant_expression_1): Add "now" parm.
1645 (is_constant_expression, require_constant_expression): New.
1646 (is_static_init_expression, is_nondependent_constant_expression)
1647 (is_nondependent_static_init_expression): Drop "potential".
1648 * except.c (build_must_not_throw_expr): Do type conversion on
1649 value-dependent argument.
1650 * pt.c, semantics.c, typeck2.c: Use variants without "potential".
1652 Instantiate default arguments/member initializers once.
1653 * init.c (get_nsdmi): Remember NSDMI instantiations.
1654 * parser.c (inject_this_parameter): Be more picky about
1656 * pt.c (tsubst_copy): Simplify 'this' handling.
1657 (tsubst_default_argument): Remember default argument
1658 instantiations. Take parameter number.
1659 (tsubst_default_arguments): Pass it.
1660 * call.c (convert_default_arg): Likewise.
1662 Fix default argument conversion failure and SFINAE.
1663 * call.c (build_over_call): Check convert_default_arg result for
1665 * parser.c (cp_parser_late_parsing_default_args): Remember
1668 2017-08-28 Nathan Sidwell <nathan@acm.org>
1670 * cp-tree.h (lang_type): Replace sorted_fields vector with
1672 (CLASSTYPE_SORTED_FIELDS): Delete.
1673 (CLASSTYPE_BINDINGS): New.
1674 * decl.c (finish_enum_value_list): Swap args of
1675 insert_late_enum_def_bindings.
1676 * name-lookup.c (lookup_field_1): Replace binary search of sorted
1677 fields with map->get.
1678 (sorted_fields_type_new, count_fields,
1679 add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
1680 (add_class_member, add_class_members): New.
1681 (set_class_bindings): Create map and insert.
1682 (insert_late_enum_def_binding): Swap parms. Use add_clasS_member.
1683 * ptree.c (cxx_print_type): Delete sorted fields printing.
1685 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
1687 * name-lookup.h (set_class_bindings,
1688 insert_late_enum_def_bindings): Declare.
1689 * decl.c (finish_enum_value_list): Adjust for
1690 insert_late_enum_def_bindings name change.
1691 * class.c (finish_struct_1): Call set_class_bindings.
1692 (count_fields, add_fields_to_record_type,
1693 add_enum_fields_to_record_type, sorted_fields_type_new,
1694 insert_into_classtype_sorted_fields,
1695 insert_late_enum_def_into_classtype_sorted_fields): Move to ...
1696 * name-lookup.h (count_fields, add_fields_to_record_type,
1697 add_enum_fields_to_record_type, sorted_fields_type_new,
1698 set_class_bindings, insert_late_enum_def_bindings): ... here.
1700 2017-08-25 Nathan Sidwell <nathan@acm.org>
1702 * class.c (method_name_cmp, resort_method_name_cmp): Methods
1705 Conversion operators have a special name
1706 * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
1707 (conv_op_marker, conv_op_identifier): New.
1708 (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
1709 * decl.c (initialize_predefined_identifiers): Add
1711 (cxx_init_decl_processing): Create conv_op_marker.
1712 * decl2.c (check_classfn): Lookup conv-ops by name.
1713 * class.c (add_method): Use conv_op_identifier & conv_op_marker.
1714 (resort_type_method_vec): Don't skip conv-ops.
1715 (finish_struct_methods, warn_hidden): Likewise.
1716 * name-lookup.h (lookup_all_conversions): Delete.
1717 * name-lookup.c (lookup_conversion_operator): Replace with ...
1718 (extract_conversion_operator): ... this.
1719 (lookup_fnfields_slot_nolazy): Find conv-ops by name.
1720 (lookup_all_conversions): Delete.
1721 * pt.c (check_explicit_specialization): Find conv-ops by name.
1722 * search.c (lookup_conversions_r): Likewise.
1724 2017-08-24 Nathan Sidwell <nathan@acm.org>
1726 Conversion operators kept on single overload set
1727 * class.c (add_method): Keep all conv-ops on one slot.
1728 * name-lookup.c (lookup_conversion_operator): Pull the desired
1729 conv op out of overload set.
1730 * search.c (lookup_conversions_r): Lose template/non-template
1732 (lookup_conversions): Likewise.
1734 2017-08-23 Nathan Sidwell <nathan@acm.org>
1736 * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
1737 lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
1739 * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
1740 lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
1741 * search.c (lookup_conversion_operator,
1742 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1743 lookup_all_conversions): Move to ...
1744 * name-lookup.c (lookup_conversion_operator,
1745 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1746 lookup_all_conversions): ... here.
1748 * semantics.c (finish_member_declaration): Move USING_DECL check
1749 earlier. Always set C++ linkage. Commonize TYPE_FIELD and
1750 template decl list insertion.
1752 * cp-tree.h (maybe_version_functions): Declare.
1753 * decl.c (decls_match): Break function versioning check to
1754 separate function. Call it.
1755 (maybe_version_functions): Broken out of decls_match.
1756 * class.c (add_method): Use maybe_version_functions.
1758 * cp-tree.h (print_search_statistics,
1759 reinit_search_statistics): Don't declare.
1760 * search.c (n_fields_searched, n_calls_lookup_field,
1761 n_calls_lookup_field_1, n_calls_lookup_fnfields,
1762 n_calls_lookup_fnfields_1, n_calls_get_base_type,
1763 n_outer_fields_searched, n_contexts_saved): Delete.
1764 (lookup_field_1, lookup_member,
1765 lookup_fnfields_slot_nolazy): Remove stat gathering.
1766 (print_search_statistics, reinit_search_statistics): Delete.
1767 * tree.c (cxx_print_statistics): Don't print search stats.
1769 2017-08-21 Nathan Sidwell <nathan@acm.org>
1771 * search.c (lookup_field_r): Remove obsolete code for type-named
1774 * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
1776 (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
1777 (lookup_field_fuzzy_r): Adjust.
1779 2017-08-21 David Malcolm <dmalcolm@redhat.com>
1781 * call.c (build_over_call): Pass NULL for new parameter to
1782 check_function_arguments.
1783 * typeck.c (cp_build_function_call_vec): Likewise.
1785 2017-08-21 Nathan Sidwell <nathan@acm.org>
1788 * pt.c (instantiate_class_template_1):
1789 BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
1791 2017-08-18 David Malcolm <dmalcolm@redhat.com>
1794 * name-lookup.c (maybe_suggest_missing_header): Convert return
1795 type from void to bool; return true iff a suggestion was offered.
1796 (suggest_alternative_in_explicit_scope): Move call to
1797 maybe_suggest_missing_header to before use of best_match, and
1798 return true if the former offers a suggestion.
1800 2017-08-18 H.J. Lu <hongjiu.lu@intel.com>
1803 * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
1804 * decl2.c (grokbitfield): Don't allow bit-field with
1805 warn_if_not_aligned type.
1807 2017-08-17 Nathan Sidwell <nathan@acm.org>
1809 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
1810 * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
1811 (TYPE_TEMPLATE_INFO): Simplify.
1812 (SET_TYPE_TEMPLATE_INFO): Simplify.
1814 * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
1815 don't need lang_type.
1816 (cxx_make_type): Use maybe_add_lang_type_raw return value.
1817 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
1820 * cp-tree.h (struct lang_type): Remove template_info field.
1821 (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
1822 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
1824 2017-08-14 Martin Sebor <msebor@redhat.com>
1827 * error.c (cp_printer): Handle 'G'.
1829 2017-08-11 Martin Liska <mliska@suse.cz>
1831 * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
1832 TARGET_SUPPORTS_ALIASES.
1833 (handle_tls_init): Likewise.
1834 (note_mangling_alias): Likewise. Remove ATTRIBUTE_UNUSED for
1836 * optimize.c (can_alias_cdtor): Likewise.
1838 2017-08-11 Jason Merrill <jason@redhat.com>
1840 PR c++/81671 - nullptr_t template parameter
1841 * pt.c (convert_nontype_argument): Fix nullptr_t check.
1843 2017-08-10 Jason Merrill <jason@redhat.com>
1845 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1846 * method.c (synthesized_method_walk): Don't diagnose lack of
1849 PR c++/80452 - Core 1579, implicit move semantics on return/throw
1850 * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
1851 tentatively changed the lvalue to an rvalue.
1852 * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
1853 (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
1854 parameter is an rvalue reference.
1855 * except.c (build_throw): Do maybe-rvalue overload resolution twice.
1856 * typeck.c (check_return_expr): Likewise.
1858 2017-08-10 David Malcolm <dmalcolm@redhat.com>
1860 * parser.c (cp_parser_error): Update for new param to
1862 (class token_pair): New class.
1863 (struct matching_paren_traits): New struct.
1864 (matching_parens): New typedef.
1865 (struct matching_brace_traits): New struct.
1866 (matching_braces): New typedef.
1867 (cp_parser_statement_expr): Convert explicit parsing of
1868 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
1869 class matching_parens, so that the pertinent open parenthesis is
1870 highlighted when there are problems locating the close
1872 (cp_parser_primary_expression): Likewise.
1873 (cp_parser_compound_literal_p): Remove consumption of opening
1875 (cp_parser_postfix_expression): Convert explicit parsing of
1876 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
1877 above. Use it to consume the opening paren previously consumed by
1878 cp_parser_compound_literal_p.
1879 (cp_parser_parenthesized_expression_list): Likewise.
1880 (cp_parser_unary_expression): Likewise.
1881 (cp_parser_new_expression): Likewise.
1882 (cp_parser_cast_expression): Likewise.
1883 (cp_parser_builtin_offsetof): Likewise.
1884 (cp_parser_trait_expr): Likewise.
1885 (cp_parser_lambda_declarator_opt): Likewise.
1886 (cp_parser_lambda_body): Likewise, for matching_braces.
1887 (cp_parser_compound_statement): Likewise.
1888 (cp_parser_selection_statement): Likewise, for matching_parens.
1889 (cp_parser_iteration_statement): Likewise.
1890 (cp_parser_already_scoped_statement): Likewise, for
1892 (cp_parser_linkage_specification): Likewise.
1893 (cp_parser_static_assert): Likewise, for matching_parens.
1894 (cp_parser_decltype): Likewise.
1895 (cp_parser_operator): Likewise.
1896 (cp_parser_enum_specifier): Likewise.
1897 (cp_parser_namespace_definition): Likewise.
1898 (cp_parser_direct_declarator): Likewise.
1899 (cp_parser_braced_list): Likewise.
1900 (cp_parser_class_specifier_1): Likewise, for matching_braces.
1901 (cp_parser_constant_initializer): Likewise.
1902 (cp_parser_noexcept_specification_opt): Likewise, for
1904 (cp_parser_exception_specification_opt): Likewise.
1905 (cp_parser_handler): Likewise.
1906 (cp_parser_asm_specification_opt): Likewise.
1907 (cp_parser_asm_operand_list): Likewise.
1908 (cp_parser_gnu_attributes_opt): Likewise.
1909 (cp_parser_std_attribute_spec): Likewise.
1910 (cp_parser_requirement_parameter_list): Likewise.
1911 (cp_parser_requirement_body): Likewise, for matching_braces.
1912 (cp_parser_compound_requirement): Likewise.
1913 (cp_parser_template_introduction): Likewise.
1914 (cp_parser_sizeof_pack): Likewise, for matching_parens.
1915 (cp_parser_sizeof_operand): Likewise; use it to consume the
1916 opening paren previously consumed by cp_parser_compound_literal_p.
1917 (get_matching_symbol): New function.
1918 (cp_parser_required_error): Add param "matching_location". Remove
1919 calls to cp_parser_error, instead setting a non-NULL gmsgid, and
1920 handling it if set by calling c_parse_error, potentially with a
1921 secondary location if matching_location was set.
1922 (cp_parser_require): Add param "matching_location", with a default
1923 value of UNKNOWN_LOCATION.
1924 (cp_parser_require_keyword): Update for new param of
1925 cp_parser_required_error.
1926 (cp_parser_objc_encode_expression): Update to class matching_parens
1928 (cp_parser_objc_defs_expression): Likewise.
1929 (cp_parser_objc_protocol_expression): Likewise.
1930 (cp_parser_objc_selector_expression): Likewise.
1931 (cp_parser_objc_typename): Likewise.
1932 (cp_parser_objc_superclass_or_category): Likewise.
1933 (cp_parser_objc_try_catch_finally_statement): Likewise.
1934 (cp_parser_objc_synchronized_statement): Likewise.
1935 (cp_parser_objc_at_property_declaration): Likewise.
1936 (cp_parser_oacc_single_int_clause): Likewise.
1937 (cp_parser_oacc_shape_clause): Likewise.
1938 (cp_parser_omp_clause_collapse): Likewise.
1939 (cp_parser_omp_clause_default): Likewise.
1940 (cp_parser_omp_clause_final): Likewise.
1941 (cp_parser_omp_clause_if): Likewise.
1942 (cp_parser_omp_clause_num_threads): Likewise.
1943 (cp_parser_omp_clause_num_tasks): Likewise.
1944 (cp_parser_omp_clause_grainsize): Likewise.
1945 (cp_parser_omp_clause_priority): Likewise.
1946 (cp_parser_omp_clause_hint): Likewise.
1947 (cp_parser_omp_clause_defaultmap): Likewise.
1948 (cp_parser_omp_clause_ordered): Likewise.
1949 (cp_parser_omp_clause_schedule): Likewise.
1950 (cp_parser_omp_clause_num_teams): Likewise.
1951 (cp_parser_omp_clause_thread_limit): Likewise.
1952 (cp_parser_omp_clause_aligned): Likewise.
1953 (cp_parser_omp_clause_linear): Likewise.
1954 (cp_parser_omp_clause_safelen): Likewise.
1955 (cp_parser_omp_clause_simdlen): Likewise.
1956 (cp_parser_omp_clause_depend): Likewise.
1957 (cp_parser_omp_clause_device): Likewise.
1958 (cp_parser_omp_clause_dist_schedule): Likewise.
1959 (cp_parser_oacc_clause_async): Likewise.
1960 (cp_parser_omp_critical): Likewise.
1961 (cp_parser_omp_for_loop): Likewise.
1962 (cp_parser_omp_sections_scope): Likewise.
1963 (cp_parser_omp_declare_reduction_exprs): Likewise.
1964 Update for new param to cp_parser_required_error.
1965 (cp_parser_oacc_routine): Likewise.
1966 (cp_parser_transaction_expression): Likewise.
1967 (cp_parser_cilk_simd_vectorlength): Likewise.
1969 2017-08-09 Jason Merrill <jason@redhat.com>
1971 PR c++/81525 - wrong constant value with generic lambda
1972 * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
1973 (tsubst_copy) [VAR_DECL]: Handle auto.
1975 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1976 * init.c (get_nsdmi): Add complain parm.
1977 * typeck2.c (digest_nsdmi_init): Add complain parm.
1978 (process_init_constructor_record): Pass complain to get_nsdmi.
1979 * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
1980 * method.c (get_defaulted_eh_spec): Add complain parm. Pass it into
1981 synthesized_method_walk.
1982 (synthesized_method_walk): Adjust.
1983 (walk_field_subobs): Pass complain to get_nsdmi.
1984 (defaulted_late_check): Skip other checks if deleted.
1985 * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
1986 * call.c (build_aggr_conv): Pass complain to get_nsdmi.
1987 * parser.c (defarg_location): New.
1988 * error.c (location_of): Use it.
1990 2017-08-09 Marek Polacek <polacek@redhat.com>
1992 * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
1993 * typeck.c (build_binary_op): Change the type of a parameter to bool.
1994 (cp_truthvalue_conversion): Use true instead of 1.
1996 2017-08-08 Marek Polacek <polacek@redhat.com>
1999 * cp-gimplify.c (cp_fold): If folding exposed a branch of
2000 a COND_EXPR, convert it to the original type of the COND_EXPR, if
2003 2017-08-08 Martin Liska <mliska@suse.cz>
2005 * call.c: Include header files.
2006 * cp-gimplify.c: Likewise.
2007 * cp-ubsan.c: Likewise.
2010 * search.c: Likewise.
2011 * semantics.c: Likewise.
2012 * typeck.c: Likewise.
2014 2017-08-07 Martin Liska <mliska@suse.cz>
2016 * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
2018 (cp_parser_std_attribute): Likewise.
2019 * tree.c: Add new include.
2021 2017-08-04 Paolo Carlini <paolo.carlini@oracle.com>
2024 * pt.c (do_class_deduction): Handle the case of no viable implicit
2025 deduction guides; simplify the code generating implicit deduction
2028 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
2031 * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
2032 destructor as expressions.
2034 2017-08-02 Jakub Jelinek <jakub@redhat.com>
2037 * call.c (build_user_type_conversion_1): Only call
2038 lookup_fnfields_slot if totype is CLASS_TYPE_P.
2040 2017-07-31 Jason Merrill <jason@redhat.com>
2042 * decl.c (declare_global_var): Set DECL_CONTEXT.
2044 2017-07-31 Jan Hubicka <hubicka@ucw.cz>
2045 Martin Liska <mliska@suse.cz>
2047 * pt.c (tsubst_copy): Copy PREDICT_EXPR.
2048 * semantics.c (finish_goto_stmt): Build gimple predict
2050 * constexpr.c (potential_constant_expression_1): Handle
2053 2017-07-31 Martin Liska <mliska@suse.cz>
2056 * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
2057 also with current_function_decl non-null equality.
2058 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2059 * decl.c (compute_array_index_type): Likewise.
2060 * init.c (finish_length_check): Likewise.
2061 * typeck.c (cp_build_binary_op): Likewise.
2063 2017-07-29 Jakub Jelinek <jakub@redhat.com>
2065 * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
2066 DW_AT_export_symbols.
2067 * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
2068 argument, pass it through to the debug hook.
2069 (finish_namespace_using_directive): Adjust
2070 emit_debug_info_using_namespace caller.
2071 (push_namespace): Likewise. Call it after setting
2072 DECL_NAMESPACE_INLINE_P.
2073 (cp_emit_debug_info_for_using): Pass false as new argument to
2074 the imported_module_or_decl debug hook.
2076 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
2078 * lex.c (copy_decl): Adjust.
2079 (copy_type): Likewise.
2081 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
2084 * lambda.c (add_capture): Early return if we cannot capture by
2087 2017-07-26 Jason Merrill <jason@redhat.com>
2089 P0702R1 - List deduction of vector.
2090 * pt.c (do_class_deduction): Special-case deduction from a single
2091 element of related type.
2093 2017-07-26 Leonid Koppel <lkoppel@uwaterloo.ca>
2095 PR c++/67054 - Inherited ctor with non-default-constructible members
2096 * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
2097 when deducing an inheriting constructor.
2099 2017-07-21 Nathan Sidwell <nathan@acm.org>
2101 * search.c (lookup_conversion_operator): Return overloads.
2102 (lookup_fnfields_idx_nolazy): Absorb into ...
2103 (lookup_fnfields_slot_nolaxy): ... here.
2104 (lookup_fnfields_1): Absorb into ...
2105 (lookup_fnfields_slot): ... here.
2107 Remove special CDtor METHOD_VEC slots.
2108 * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
2109 CLASSTYPE_DESTRUCTOR_SLOT): Delete.
2110 (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
2111 (CLASSTYPE_DESTRUCTOR): Likewise.
2112 * class (add_method): Don't use special cdtor slots.
2113 * search.c (lookup_fnfields_idx_nolazy): Likewise.
2114 (look_for_overrides_here): Use lookup_fnfields_slot.
2115 * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
2117 * call.c (add_candidates): Move decls to initialization. Don't
2120 2017-07-20 Nathan Sidwell <nathan@acm.org>
2122 Remove TYPE_METHODS.
2123 * class.c (maybe_warn_about_overly_private_class,
2124 finish_struct_methods, one_inheriting_sig, count_fields,
2125 add_fields_to_record_type, check_field_decls, check_methods,
2126 clone_function_decl, set_method_tm_attributes,
2127 finalize_literal_type_property, check_bases_and_members,
2128 create_vtable_ptr, determine_key_method,
2129 unreverse_member_declarations, finish_struct,
2130 add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
2131 * decl.c (fixup_anonymous_aggr): Likewise.
2132 * decl2.c (reset_type_linkage_2): Likewise.
2133 * method.c (after_nsdmi_defaulted_late_checks,
2134 lazily_declare_fn): Likewise.
2135 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
2136 * pt.c (instantiate_class_template_1, tsubst_expr,
2137 do_type_instantiation, instantiate_pending_templates): Likewise.
2138 * search.c (lookup_field_1): Likewise.
2139 * semantics.c (finish_member_declaration,
2140 finish_omp_declare_simd_methods): Likewise.
2142 2017-07-19 Nathan Sidwell <nathan@acm.org>
2144 * class.c (add_implicitly_declared_members): Use
2145 classtype_has_move_assign_or_move_ctor_p.
2146 (classtype_has_move_assign_or_move_ctor,
2147 classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
2148 (classtype_has_move_assign_or_move_ctor_p): ... this new function.
2149 * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
2151 (classtype_has_move_assign_or_move_ctor_p): ... this.
2152 * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
2153 * tree.c (type_has_nontrivial_copy_init): Adjust.
2155 * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
2156 PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
2158 2017-07-18 Nathan Sidwell <nathan@acm.org>
2160 * cp-array-notation.c (build_array_notation_ref): Use
2161 TYPE_{MIN,MAX}_VALUE.
2163 * class.c (classtype_has_move_assign_or_move_ctor): Declare.
2164 (add_implicitly_declared_members): Use it.
2165 (type_has_move_constructor, type_has_move_assign): Merge into ...
2166 (classtype_has_move_assign_or_move_ctor): ... this new function.
2167 * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
2169 2017-07-17 Volker Reichelt <v.reichelt@netcologne.de>
2171 * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
2172 friend outside class and obsolete auto as storage-class-specifier.
2174 2017-07-17 Nathan Sidwell <nathan@acm.org>
2176 * class.c (maybe_warn_about_overly_private_class): Ignore public
2179 * class.c (type_has_user_declared_move_constructor,
2180 type_has_user_declared_move_assign): Combine into ...
2181 (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
2182 * cp-tree.h (type_has_user_declared_move_constructor,
2183 type_has_user_declared_move_assign): Combine into ...
2184 (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
2185 * method.c (maybe_explain_implicit_delete): Use it.
2186 (lazily_declare_fn): Use it.
2187 * tree.c (type_has_nontrivial_copy_init): Use it.
2189 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
2190 semantics, simplify implementation.
2192 2017-07-16 Volker Reichelt <v.reichelt@netcologne.de>
2194 * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
2195 in old-style cast diagnostic.
2196 * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
2197 in useless cast diagnostic.
2198 * error.c (type_to_string): Remove enum special handling.
2200 2017-07-14 David Malcolm <dmalcolm@redhat.com>
2202 * name-lookup.c (get_std_name_hint): Add '<' and '>' around
2204 (maybe_suggest_missing_header): Update for addition of '<' and '>'
2205 to above. Provide a fix-it hint.
2206 * pt.c: Include "gcc-rich-location.h"
2207 (listify): Attempt to add fix-it hint for missing
2208 #include <initializer_list>.
2209 * rtti.c: Include "gcc-rich-location.h".
2210 (typeid_ok_p): Attempt to add fix-it hint for missing
2211 #include <typeinfo>.
2213 2017-07-12 Jason Merrill <jason@redhat.com>
2215 P0512R0 - Deduction from an initializer list.
2216 * pt.c (do_class_deduction): Do list deduction in two phases.
2218 2017-07-12 Nathan Sidwell <nathan@acm.org>
2220 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
2221 DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
2223 * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
2224 DECL_CXX_DESTRUCTOR explicitly.
2225 * decl2.c (grokclassfn): Likewise.
2226 * friend.c (do_friend): Likewise.
2227 * method.c (make_thunk, make_alias_for,
2228 implicitly_declare_fn): Likewise.
2230 2017-07-11 Jason Merrill <jason@redhat.com>
2233 * decl.c (grokparms): Downgrade error about array of unknown bound
2234 to pedwarn and disable it for C++17.
2236 2017-07-11 Nathan Sidwell <nathan@acm.org>
2238 * decl2.c (reset_type_linkage_2): Dont't change ctor name.
2240 2017-07-10 Martin Sebor <msebor@redhat.com>
2242 * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
2244 2017-07-06 Jason Merrill <jason@redhat.com>
2246 PR c++/81204 - parse error with dependent template-name
2247 * parser.c (cp_parser_lookup_name): Revert previous change.
2249 2017-07-06 David Malcolm <dmalcolm@redhat.com>
2251 * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
2252 selftest::run_cp_tests.
2253 (selftest::run_cp_tests): New function.
2254 * cp-tree.h (selftest::run_cp_tests): New decl.
2256 2017-07-04 Jakub Jelinek <jakub@redhat.com>
2258 * parser.c (cp_parser_decomposition_declaration): Replace
2259 decomposition declaration with structured binding in diagnostics.
2260 * decl.c (cp_finish_decomp): Likewise.
2261 (grokdeclarator): Likewise.
2264 * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
2265 forms of structured binding initializers.
2267 2017-07-03 Paolo Carlini <paolo.carlini@oracle.com>
2270 * decl.c (grokdeclarator): Move checks on function return type after
2271 the splice_late_return_type call; if declspecs->locations[ds_type_spec]
2272 is UNKNOWN_LOCATION fall back to input_location.
2274 2017-07-03 David Malcolm <dmalcolm@redhat.com>
2276 * parser.c (enum required_token): Fix spelling of
2277 RT_INTERATION to RT_ITERATION.
2278 (cp_parser_iteration_statement): Likewise.
2279 (cp_parser_required_error): Likewise.
2281 2017-06-30 Jason Merrill <jason@redhat.com>
2283 PR c++/81257 - ICE with invalid ::template.
2284 PR c++/54769 - wrong lookup of dependent template-name.
2285 * parser.c (cp_parser_template_name): Revert part of last change.
2287 2017-06-30 Nathan Sidwell <nathan@acm.org>
2289 * config-lang.in (gtfiles): Add cp/lex.c.
2290 * cp-tree.h (mangle_convop_name_for_type): Rename ...
2291 (make_conv_op_name): ... here. Move to lex.
2292 * lambda.c (maybe_add_lambda_conv_op): Update.
2293 * parser.c (cp_parser_conversion_function_id): Update.
2294 * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
2295 tsubst_copy_and_build): Update.
2296 * semantics.c (apply_deduced_return_type): Update.
2297 * mangle.c (conv_type_hasher, conv_type_names,
2298 mangle_conv_op_name_for_type): Move to ...
2299 * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
2302 2017-06-30 David Malcolm <dmalcolm@redhat.com>
2305 * parser.c (cp_parser_postfix_expression): Construct a location
2306 for typeid expressions.
2308 2017-06-30 Nathan Sidwell <nathan@acm.org>
2310 * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
2312 (lookup_all_conversions): Declare.
2313 * class.c (get_basefndecls): Use lookup_fnfields_slot.
2314 * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
2315 * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
2317 * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
2318 (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
2319 lookup_all_conversions.
2320 * search.c (lookup_fnfields_1): Make static.
2321 (lookup_all_conversions): New.
2322 (class_method_index_for_fn): Delete.
2323 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
2324 lookup_fnfields_slot.
2326 * call.c (build_new_method_call_1): Use constructo_name to get
2327 ctor name. Move argument processing earlier to merge cdtor
2329 * decl.c (grokfndecl): Cdtors have special names.
2330 * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
2331 * pt.c (check_explicit_specialization): Cdtor name is already
2333 * search.c (class_method_index_for_fn): Likewise.
2336 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
2337 a matching TYPE_DECL.
2339 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
2341 * class.c (add_method): Change pair of errors to error + inform.
2342 (handle_using_decl): Likewise.
2344 2017-06-29 Jason Merrill <jason@redhat.com>
2346 * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
2348 PR c++/81180 - ICE with C++17 deduction of member class template.
2349 * pt.c (build_deduction_guide): Correct member template handling.
2351 PR c++/81188 - matching decltype of member function call.
2352 * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
2354 2017-06-29 Nathan Sidwell <nathan@acm.org>
2357 * parser.c (cp_parser_namespace_definition): Immediately close the
2358 namespace if there's no open-brace.
2359 * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
2362 2017-06-29 Jason Merrill <jason@redhat.com>
2364 PR c++/81164 - ICE with invalid inherited constructor.
2365 * search.c (binfo_direct_p): New.
2366 * name-lookup.c (do_class_using_decl): Use it.
2368 2017-06-29 Nathan Sidwell <nathan@acm.org>
2370 * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
2371 VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
2372 * decl.c (initialize_predefined_identifiers): Name cdtor special
2373 names consistently. Use literals for above deleted defines.
2374 (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
2376 * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
2379 * call.c (check_dtor_name): Use constructor_name for enums too.
2380 (build_new_method_call_1): Use constructor_name for cdtors and
2382 * class.c (build_self_reference): Use TYPE_NAME to get name of
2384 * name-lookup (constructor_name): Use DECL_NAME directly.
2385 (constructor_name_p): Reimplement.
2386 (push_class_level_binding_1): Use TYPE_NAME directly.
2388 * class.c (finish_struct): Use OVL_P.
2389 (get_vfield_name): Measure constructor_name length.
2390 * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
2391 (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
2392 * cxx-pretty-print.c (is_destructor_name): Delete.
2393 (pp_cxx_unqualified_id): Remove bogus destructor name checking.
2394 * decl.c (grokfndecl): Move cheap checks first when looking for
2395 implicit extern cness.
2397 * parser.c (cp_parser_direct_declarator): Reorder if to avoid
2398 indentation. Remove unnecessary assignment of constructor name.
2400 Whitespace cleanups.
2401 * call.c (name_as_c_string): Move CONST_CAST to return.
2402 (build_new_method_call_1): Remove unneeded bracing.
2403 * class.c (include_empty_classes): Unbreak line.
2404 * constraint.cc (tsubst_check_constraint): Add space.
2405 * cp-tree.h (lang_decl_ns): Add comment.
2406 (PTRMEM_CST_MEMBER): Break line.
2407 * decl.c (grokfndecl): Add blank lines. Unbreak some others.
2408 (grokdeclarator): Remove lines, move declaration to first use.
2409 * decl2.c (decl_needed_p): Fix indentation.
2410 (c_parse_final_cleanups): Remove blank line.
2411 * method.c (implicitly_declare_fn): Move declaration to first use.
2412 * search.c (current_scope): Add blank lines.
2414 2017-06-28 Jason Merrill <jason@redhat.com>
2416 PR c++/72764 - ICE with invalid template typename.
2417 * decl.c (build_typename_type): No longer static.
2418 * tree.c (strip_typedefs): Use it instead of make_typename_type.
2420 PR c++/69300 - ICE with self-referential noexcept
2421 * pt.c (maybe_instantiate_noexcept): Check for recursion.
2423 PR c++/61022 - error with variadic template template parm
2424 * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
2426 PR c++/72801 - ICE with variadic partial specialization
2427 * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
2429 PR c++/55639 - partial specialization with ::template
2430 * parser.c (cp_parser_class_head): Handle ::template.
2432 PR c++/45976 - error with ::template in declarator.
2433 * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
2435 PR c++/54769 - wrong lookup of dependent template-name.
2436 * parser.c (cp_parser_template_name): Handle dependent object type.
2437 (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
2439 (cp_parser_id_expression): Pass it.
2440 (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
2442 * parser.c (cp_parser_template_id): Use the range location on the
2445 PR c++/81204 - parse error with dependent template-name
2446 * parser.c (cp_parser_lookup_name): Disqualify function templates
2449 2017-06-27 Nathan Sidwell <nathan@acm.org>
2451 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
2452 initialization point. Don't unnecessarily check for ctor name.
2454 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
2455 (CLASSTYPE_DESTRUCTOR): ... this.
2456 * class.c (accessible_nvdtor_p,
2457 maybe_warn_about_overly_private_class,
2458 add_implicitly_declared_members,
2459 clone_constructors_and_destructors, type_has_virtual_destructor):
2460 Adjust for CLASSTYPE_DESTRUCTOR.
2461 (deduce_noexcept_on_destructors): Absorb into ...
2462 (check_bases_and_members): ... here.
2463 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
2464 * init.c (build_delete): Likewise.
2465 * parser.c (cp_parser_lookup_name): Likewise.
2466 * pt.c (check_explicit_specialization): Likewise.
2467 * rtti.c (emit_support_tinfos): Likewise.
2468 * search.c (lookup_fnfields_idx_nolazy): Likewise.
2470 Kill IDENTIFIER_TEMPLATE.
2471 * cp-tree.h (lang_identifier): Remove class_template_info field.
2472 (IDENTIFIER_TEMPLATE): Delete.
2473 * name-lookup.c (constructor_name_full): Subsume into ...
2474 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
2475 (constructor_name_p): Likewise.
2476 * mangle.c (write_source_name): Likewise.
2477 * ptree.c (cxx_print_identifier): Likewise.
2479 2017-06-27 Marek Polacek <polacek@redhat.com>
2482 * parser.c (cp_parser_already_scoped_statement): Initialize
2485 2017-06-26 Jason Merrill <jason@redhat.com>
2487 PR c++/81215 - deduction failure with variadic TTP.
2488 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
2490 2017-06-26 Martin Sebor <msebor@redhat.com>
2493 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
2494 to detect casting away cv-qualifiers.
2496 2017-06-26 Nathan Sidwell <nathan@acm.org>
2498 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
2499 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
2501 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
2502 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
2503 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
2504 * decl.c (grok_op_properties): Adjust identifier checking.
2505 * init.c (expand_default_init): Adjust identifier descision.
2506 * method.c (implicitly_declare_fn): Don't use
2507 DECL_ASSIGNMENT_OPERATOR_P.
2508 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
2510 * call.c (in_charge_arg_for_name): Reimplement.
2511 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
2514 2017-06-26 Marek Polacek <polacek@redhat.com>
2517 * parser.c (cp_parser_statement): Add a default argument. Save the
2518 location of the expression-statement after labels have been parsed.
2519 (cp_parser_implicitly_scoped_statement): Set the location of the
2520 body of the conditional after parsing all the labels. Call
2521 warn_for_multistatement_macros.
2522 (cp_parser_already_scoped_statement): Likewise.
2524 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
2527 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
2528 'typename' in error messages about missing 'typename'.
2530 2017-06-23 Jason Merrill <jason@redhat.com>
2532 PR c++/79056 - C++17 ICE with invalid template syntax.
2533 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
2535 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
2536 * pt.c (template_placeholder_p): New.
2537 * cp-tree.h: Declare it.
2539 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
2541 * decl.c (duplicate_decls): Use builtin_structptr_types.
2543 2017-06-22 Nathan Sidwell <nathan@acm.org>
2545 Reorder IDENTIFIER flags
2547 * cp-tree.h (enum cp_identifier_kind): New.
2548 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
2549 IDENTIFIER_KIND_BIT_2): New.
2550 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
2551 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
2552 (C_IS_RESERVED_WORD): Replace with ...
2553 (IDENTIFIER_KEYWORD_P): ... this.
2554 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
2555 (IDENTIFIER_CDTOR_P): ... this.
2556 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
2557 (IDENTIFIER_OPNAME_P): Replace with ...
2558 (IDENTIFIER_ANY_OP_P): ... this.
2559 (IDENTIFIER_ASSIGN_OP_P): New.
2560 (IDENTIFIER_TYPENAME_P): Replace with ...
2561 (IDENTIFIER_CONV_OP_P): ... this.
2562 (NEW_DELETE_OPNAME_P): Replace with ...
2563 (IDENTIFIER_NEWDEL_OP_P): ... this.
2564 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
2565 (get_identifier_kind_name, set_identifier_kind): Declare.
2566 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
2567 (init_operators): Adjust to avoid keywords, use
2568 set_identifier_kind. Copy TYPE_EXPR slot.
2569 (init_reswords): Call set_identifier_kind.
2570 (unqualified_name_lookup_error): Adjust.
2571 * operators.def (TYPE_EXPR): Remove.
2572 * decl.c (struct predefined_identifier): Move into ...
2573 (initialize_predefined_identifiers): ... here. Call
2574 set_identifier_kind.
2575 (grokfndecl, check_var_type, grokdeclarator): Adjust.
2576 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
2578 * call.c (name_as_c_string): Adjust.
2579 (build_new_method_call_1): Likewise.
2580 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
2581 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
2582 * dump.c (cp_dump_tree): Adjust.
2583 * error.c (dump_decl_name): Adjust.
2584 * mangle.c (write_unqualified_id, write_member_name,
2585 write_expression): Adjust.
2586 (mangle_conv_op_name_for_type): Use set_identifier_kind.
2587 * name-lookup.c (do_class_using_decl): Adjust.
2588 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
2589 * parser.c (cp_lexer_get_preprocessor_token,
2590 cp_parser_direct_declarator): Likewise.
2591 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
2592 tsubst_copy, tsubst_copy_and_build): Adjust.
2593 * ptree.c (cxx_print_identifier): Print identifier kind.
2594 * search.c (lookup_field_r, lookup_member,
2595 lookup_fnfields_idx_nolazy): Adjust.
2596 * semantics.c (finish_id_expression): Adjust..
2597 * typeck.c (cp_build_addr_expr_1): Adjust.
2599 2017-06-21 Jakub Jelinek <jakub@redhat.com>
2602 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
2603 Complain about t not being a variable if t is OVERLOAD even
2604 when processing_template_decl.
2606 2017-06-21 David Malcolm <dmalcolm@redhat.com>
2608 * parser.c (get_cast_suggestion): New function.
2609 (maybe_add_cast_fixit): New function.
2610 (cp_parser_cast_expression): Capture the location of the closing
2611 parenthesis. Call maybe_add_cast_fixit when emitting warnings
2612 about old-style casts.
2614 2017-06-20 Jason Merrill <jason@redhat.com>
2616 PR c++/80972 - C++17 ICE with attribute packed.
2617 * call.c (build_over_call): Allow a TARGET_EXPR from reference
2620 2017-06-20 Nathan Sidwell <nathan@acm.org>
2622 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
2623 (nelts_identifier): Delete.
2624 * decl.c (initialize_predefined_identifiers): Remove nelts.
2626 PR c++/67074 - namespace aliases
2627 * decl.c (duplicate_decls): Don't error here on mismatched
2629 * name-lookup.c (name_lookup::add_value): Matching namespaces are
2631 (diagnose_name_conflict): Namespaces are never redeclarations.
2632 (update_binding): An alias can match a real namespace.
2634 2017-06-19 Jason Merrill <jason@redhat.com>
2636 PR c++/80562 - ICE with constexpr if.
2637 * semantics.c (finish_if_stmt_cond): Call
2638 instantiate_non_dependent_expr.
2640 PR c++/80829 - ICE with constexpr copy of base subobject.
2641 * constexpr.c (clear_no_implicit_zero): New.
2642 (cxx_eval_call_expression): Call it.
2644 2017-06-19 Nathan Sidwell <nathan@acm.org>
2648 * name-lookup.c (set_decl_namespace): Don't follow using
2649 directives and ignore using decls. Only check overly-explicit
2650 scope after discovering decl.
2652 2017-06-19 Jason Merrill <jason@redhat.com>
2654 PR c++/81073 - constexpr and static var in statement-expression.
2655 * typeck2.c (store_init_value): Always call
2656 require_potential_constant_expression.
2657 * pt.c (convert_nontype_argument): Likewise.
2658 * constexpr.c (potential_constant_expression_1): Adjust message.
2659 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
2660 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
2662 2017-06-19 Nathan Sidwell <nathan@acm.org>
2664 * pt.c (coerce_template_parms): Fix indentation.
2665 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
2669 * name-lookup.c (update_binding): Only warn about constructors
2670 hidden by functions.
2672 2017-06-17 Jason Merrill <jason@redhat.com>
2674 PR c++/60063 - -Wunused-local-typedefs and templates.
2675 * decl2.c (is_late_template_attribute): Return false for "used".
2677 PR c++/70844 - -Wuseless-cast and inheriting constructor.
2678 * method.c (forward_parm): Suppress warn_useless_cast.
2680 2017-06-16 Jason Merrill <jason@redhat.com>
2682 PR c++/81045 - Wrong type-dependence with auto return type.
2683 * pt.c (type_dependent_expression_p): An undeduced auto outside the
2684 template isn't dependent.
2685 * call.c (build_over_call): Instantiate undeduced auto even in a
2688 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
2689 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
2690 set longer for a generic lambda.
2692 PR c++/80614 - Wrong mangling for C++17 noexcept type
2693 * mangle.c (write_type): Put the eh spec back on the function type.
2695 PR c++/81102 - Wrong error with partial specialization.
2696 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
2697 types. Do type deduction later.
2699 PR c++/81074 - ICE with partial specialization of member template.
2701 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
2703 PR c++/80831 - ICE with -fsyntax-only.
2704 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
2706 PR c++/80639 - ICE with invalid PMF initialization.
2707 PR c++/80043 - ICE with -fpermissive
2708 * typeck.c (convert_for_assignment): Recurse when instantiate_type
2709 returns without an error.
2711 2017-06-16 Nathan Sidwell <nathan@acm.org>
2713 * pt.c (tsubst_baselink): Fix & clarify formatting.
2715 * cp-tree.h (build_this_parm, cp_build_parm_decl,
2716 build_artificial_parm): Add FN parm.
2717 * decl.c (start_cleanup_fn): Adjust.
2718 (build_this_parm): Add FN parm, pass it through.
2719 (grokfndecl): Adjust parm building.
2720 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
2721 (build_artificial_parm): Add FN parm, pass through.
2722 (maybe_retrofit_in_chrg): Adjust parm building.
2723 (start_static_storage_duration_function): Likwise.
2724 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
2725 * method.c (implicitly_declare_fn): Likewise.
2726 * parser.c (inject_this_parameter): Likewise.
2728 Symbol tables are insert only.
2729 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
2730 derive from pointer_hash. Make undeletable.
2732 * class.c (resort_type_method_vec): Avoid potential unsigned
2735 Don't defer noexcept_deferred_spec.
2736 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
2737 * decl.c (cxx_init_decl_processing): Initialize
2738 noexcept_deferred_spec.
2739 * except.c (unevaluated_noexcept_spec): Delete.
2740 * class.c (deduce_noexcept_on_destructor): Use
2741 noexcept_deferred_spec directly.
2742 * method.c (implicitly_declare_fn): Likewise.
2744 Make keyed_classes a vector.
2745 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
2746 (keyed_classes): Declare as vector.
2747 * decl.c (keyed_classes): Define.
2748 (cxx_init_decl_processing): Allocate it.
2749 (record_key_method_defined): Use vec_safe_push.
2750 * class.c (finish_struct_1): Likewise.
2751 * pt.c (instantiate_class_template_1): Likewise.
2752 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
2755 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
2756 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
2758 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
2759 (get_tinfo_decl): Use get_tinfo_desc.
2760 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
2761 (create_pseudo_type_info): Delete.
2762 (get_pseudo_ti_index): Just determine the index.
2763 (get_tinfo_desc): New. Create all types lazily.
2764 (create_tinfo_types): Just allocate the descriptor array.
2765 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
2768 2017-06-15 Martin Sebor <msebor@redhat.com>
2771 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
2773 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
2774 (build_cxx_call): Call maybe_warn_class_memaccess.
2776 2017-06-14 Jakub Jelinek <jakub@redhat.com>
2778 * cp-gimplify.c (cp_genericize_r): Turn most of the function
2779 into a switch (TREE_CODE (stmt)) statement from long else if
2782 2017-06-13 Jakub Jelinek <jakub@redhat.com>
2785 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
2786 argument even if it has REFERENCE_TYPE.
2789 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
2790 BLOCK_VARS (outer) chain.
2791 (cxx_omp_const_qual_no_mutable): Likewise.
2793 2017-06-13 Martin Liska <mliska@suse.cz>
2796 * class.c (build_base_path): Use sanitize_flags_p.
2797 * cp-gimplify.c (cp_genericize_r): Likewise.
2798 (cp_genericize_tree): Likewise.
2799 (cp_genericize): Likewise.
2800 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2801 * decl.c (compute_array_index_type): Likewise.
2802 (start_preparsed_function): Likewise.
2803 * decl2.c (one_static_initialization_or_destruction): Likewise.
2804 * init.c (finish_length_check): Likewise.
2805 * lambda.c (maybe_add_lambda_conv_op): Likewise.
2806 * typeck.c (cp_build_binary_op): Likewise.
2807 (build_static_cast_1): Likewise.
2809 2017-06-11 Jason Merrill <jason@redhat.com>
2811 * error.c (dump_expr): Use is_this_parameter.
2813 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
2816 2017-06-09 Jason Merrill <jason@redhat.com>
2818 Missing bits from N4268, constant evaluation for all non-type args.
2819 * call.c (build_converted_constant_expr): Rename from
2820 build_integral_nontype_arg_conv, handle all types.
2821 * pt.c (convert_nontype_argument): In C++17 call it for all types.
2822 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
2823 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
2825 Overhaul pointer-to-member conversion and template argument handling.
2826 * call.c (standard_conversion): Avoid creating ck_pmem when the
2827 class type is the same.
2828 * cvt.c (can_convert_qual): Split from
2829 perform_qualification_conversions.
2830 * constexpr.c (cxx_eval_constant_expression): Check it.
2831 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
2832 adjustment is necessary.
2833 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
2834 (convert_nontype_argument): Avoid redundant error.
2836 * call.c (convert_like_real): Remove "inner" parameter.
2837 Don't replace a constant with its value.
2838 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
2840 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
2843 * parser.c (cp_parser_constant_expression): Check
2844 potential_rvalue_constant_expression after decay_conversion.
2845 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
2847 PR c++/80384 - ICE with dependent noexcept-specifier
2848 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
2851 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
2853 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
2855 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
2856 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
2857 (excpet.c): Mark terminate as cold.
2859 2017-06-08 Jakub Jelinek <jakub@redhat.com>
2862 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
2863 to sizetype before size_binop.
2866 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
2867 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
2868 and OMP_CLAUSE_SHARED_READONLY flags.
2870 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
2872 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
2874 2017-06-07 Nathan Sidwell <nathan@acm.org>
2876 * class.c (layout_class_type): Restructure overlong-bitfield tpe
2879 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
2882 * pt.c (do_class_deduction): Build qualified type.
2884 2017-06-06 Nathan Sidwell <nathan@acm.org>
2886 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
2887 sans using directives. Don't walk into inline namespaces.
2890 * name-lookup.c (adl_class_only): Don't add visible friends.
2892 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
2894 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
2896 2017-06-02 Nathan Sidwell <nathan@acm.org>
2898 Remove lang_type_ptrmem.
2899 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
2901 (lang_type_class): ... this. Reorder bitfields. Rename to ...
2902 (lang_type): ... this. Delete old definition.
2903 (lang_type_ptrmem): Delete.
2904 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
2905 (LANG_TYPE_PTRMEM_CHECK): Delete.
2906 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
2907 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
2908 * decl.c (build_ptrmemfunc_type): Adjust.
2909 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
2910 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
2912 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
2915 Remove cp_binding_level::namespaces
2916 * name-lookup.h (cp_binding_level): Lose namespaces field.
2917 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
2919 (suggest_alternatives_for): Adjust for namespace list. Do
2920 breadth-first search.
2921 * decl2.c (collect_source_refs): Namespaces are on the regulr
2923 (collect_ada_namespace): Likewise.
2925 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
2927 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
2930 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
2933 * method.c (constructible_expr): Strip array types before calling
2936 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
2939 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
2940 for case INDIRECT_REF too in the main switch.
2942 2017-05-31 Jason Merrill <jason@redhat.com>
2944 PR c++/80840 - ICE with constexpr and reference
2945 * pt.c (convert_nontype_argument): Don't test whether a decl is
2946 value-dependent when binding to a reference.
2948 2017-05-31 Nathan Sidwell <nathan@acm.org>
2950 * cp-tree.h (lang_decl_slector): New enum.
2951 (lang_decl_base): Make selector an enum. Drop decomposition_p
2953 (lang_decl): Use enum for discrimination.
2954 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
2955 LANG_DECL_DEOMP_CHECK): Use enum.
2956 (DECL_DECOMPOSITION_P): Use selector value.
2957 (SET_DECL_DECOMPOSITION_P): Delete.
2958 (retrofit_lang_decl): Lose SEL parm.
2959 (fit_decomposition_lang_decl): Declare.
2960 * decl.c (cp_finish_decomp, grokdeclarator): Use
2961 fit_decomposition_lang_decl.
2962 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
2964 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
2965 (fit_decomposition_lang_decl): Likewise.
2966 (retrofit_lang_decl): Use worker functions.
2967 (cxx_dup_lang_specific_decl): Use selector enum.
2968 (maybe_add_lang_type_raw): New. Broken out of ...
2969 (cxx_make_type_name): ... here. Call it.
2971 2017-05-30 Jason Merrill <jason@redhat.com>
2973 PR c++/80856 - ICE with local extern in template
2974 * semantics.c (finish_call_expr): Replace a local extern overload
2975 set in a template with the IDENTIFIER_NODE.
2977 2017-05-30 David Malcolm <dmalcolm@redhat.com>
2979 * call.c (perform_implicit_conversion_flags): Convert
2980 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
2981 (print_conversion_rejection): Replace pairs of %qT with
2982 %qH and %qI in various places.
2983 (build_user_type_conversion_1): Likewise.
2984 (build_integral_nontype_arg_conv): Likewise.
2985 (build_conditional_expr_1): Likewise.
2986 (convert_like_real): Likewise.
2987 (convert_arg_to_ellipsis): Likewise.
2989 (initialize_reference): Likewise.
2990 * cvt.c (cp_convert_to_pointer): Likewise.
2991 (cp_convert_to_pointer): Likewise.
2992 (convert_to_reference): Likewise.
2993 (ocp_convert): Likewise.
2994 * error.c (cp_printer): Gain bool and const char ** parameters.
2995 (struct deferred_printed_type): New struct.
2996 (class cxx_format_postprocessor): New class.
2997 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
2998 to pp->m_format_postprocessor.
2999 (comparable_template_types_p): New function.
3000 (newline_and_indent): New function.
3001 (arg_to_string): New function.
3002 (print_nonequal_arg): New function.
3003 (print_template_differences): New function.
3004 (type_to_string_with_compare): New function.
3005 (print_template_tree_comparison): New function.
3006 (append_formatted_chunk): New function.
3007 (add_quotes): New function.
3008 (cxx_format_postprocessor::handle): New function.
3009 (defer_phase_2_of_type_diff): New function.
3010 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
3012 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
3013 %qH and %qI in various places.
3014 (convert_member_func_to_ptr): Likewise.
3015 (build_reinterpret_cast_1): Likewise.
3016 (convert_for_assignment): Likewise.
3017 * typeck2.c (check_narrowing): Likewise.
3019 2017-05-30 Nathan Sidwell <nathan@acm.org>
3021 Kill IDENTIFIER_NAMESPACE_BINDINGS
3022 * cp-tree.h (lang_identifier): Delete namespace_bindings.
3023 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
3024 (lang_decl_ns): Add bindings.
3025 (DECL_NAMESPACE_BINDINGS): New.
3026 * lex.c (retrofit_lang_decl): Create namespace hash table.
3027 * name-lookup.c (find_namespace_slot): Change to use hash-map.
3028 * ptree.c (cxx_print_binding): Delete.
3029 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
3031 * cp-tree.def (OVERLOAD): Fix comment.
3032 * cp-tree.h: Fix comments and whitespace.
3033 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
3034 * name-lookup.c (add_decl_to_level): Assert not class.
3035 (check_local_shadow): Use OVL_P.
3036 (pushdecl_with_scope_1): Rename to ...
3037 (do_pushdecl_with_Scope): ... here.
3038 (do_nonmember_using_decl): Use qualified_namespace_lookup return
3040 (push_class_level_binding_1): Use OVL_P.
3041 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
3042 (pushtag_1): Rename to ...
3043 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
3045 (store_class_bindings): Do not time here.
3046 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
3047 * pt.c (listify): Declare argvec at point of initialization.
3050 * name-lookup.c (add_decl_to_level): Assert not making a circular
3052 (update_binding): Don't prematurely slide artificial decl.
3054 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
3056 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
3058 2017-05-29 Nathan Sidwell <nathan@acm.org>
3060 PR c++/80891 (#1,#5)
3061 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
3062 * name-lookup.c (name_lookup): Add deduping field.
3063 (name_lookup::preserve_state, name_lookup::restore_state): Deal
3065 (name_lookup::add_overload): New.
3066 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
3067 (name_lookup::search_adl): Set deduping. Don't unmark here.
3068 * pt.c (most_specialized_instantiation): Revert previous change,
3069 Assert not given duplicates.
3070 * tree.c (lookup_mark): Just mark the underlying decls.
3071 (lookup_maybe_add): Dedup using marked decls.
3074 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
3075 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
3077 Stat hack representation
3078 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
3079 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
3081 (find_namespace_binding): Replace with ...
3082 (find_namespace_slot): ... this.
3083 (find_namespace_value): New.
3084 (name_lookup::search_namespace_only,
3085 name_lookup::adl_namespace_only): Adjust.
3086 (update_binding): Add SLOT parameter, adjust.
3087 (check_local_shadow): Use find_namespace_value.
3088 (set_local_extern_decl_linkage): Likewise.
3089 (do_pushdecl): Adjust for namespace slot.
3090 (push_local_binding): Assert not a namespace binding.
3091 (check_for_out_of_scope_variable): Use find_namespace_value.
3092 (set_identifier_type_value_with_scope): Likewise.
3093 (get_namespace_binding): Likewise.
3094 (set_namespace_binding): Delete.
3095 (set_global_binding): Directly update the binding.
3096 (finish_namespace_using_decl): Likewise.
3097 (lookup_type_scope_1): Use find_namespace_slot and update.
3098 (do_push_nested_namespace): Use find_namespace_value.
3101 * pt.c (most_specialized_instantiation): Cope with duplicate
3105 * cp-tree.h (build_min_nt_call_vec): Declare.
3106 * decl.c (build_offset_ref_call_from_tree): Call it.
3107 * parser.c (cp_parser_postfix_expression): Likewise.
3108 * pt.c (tsubst_copy_and_build): Likewise.
3109 * semantics.c (finish_call_expr): Likewise.
3110 * tree.c (build_min_nt_loc): Keep unresolved lookups.
3111 (build_min): Likewise.
3112 (build_min_non_dep): Likewise.
3113 (build_min_non_dep_call_vec): Likewise.
3114 (build_min_nt_call_vec): New.
3117 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
3119 (lookup_keep): Call it.
3121 2017-05-26 Nathan Sidwell <nathan@acm.org>
3124 * name-lookup.c (push_inline_namespaces): New.
3125 (push_namespace): Look inside inline namespaces.
3127 Inline and using namespace representation change.
3128 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
3130 (DECL_NAMESPACE_USING): Adjust.
3131 (DECL_NAMESPACE_INLINEES): New.
3132 * name-lookup.h (struct cp_binding_level): Change usings
3134 * name-lookup.c (name_lookup::do_queue_usings,
3135 name_lookup::queue_usings): Adjust.
3136 (name_lookup::search_namespace, name_lookup::search_usings,
3137 name_lookup::queue_namespace): Adjust.
3138 (name_lookup::adl_namespace_only): Adjust.
3139 (add_using_namespace, push_namespace): Push onto vector.
3140 (pop_namespace): Add timing logic.
3142 * call.c (build_operator_new_call): Do namelookup and ADL here.
3143 (build_new_op_1): Likewise.
3144 * name-lookup.h (lookup_function_nonclass): Delete declaration.
3145 (do_using_directive): Likewise.
3146 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
3148 (struct scope_binding): Delete.
3149 (EMPTY_SCOPE_BINDING): Delete.
3150 (set_decl_namespace): Use OVL_P.
3151 (finish_local_using_decl): Lose unnecesary checks.
3152 (lookup_function_nonclass): Delete.
3153 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
3155 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
3156 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
3158 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
3159 (lkp_iterator): Add outer field. Adjust ctor.
3160 (lkp_iterator::operator++): New.
3161 (lookup_mark, lookup_maybe_add): Declare.
3162 * name-lookup.c (name_lookup): Delete fn_set member.
3163 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
3165 (name_lookup::add_value): Use lookup_add directly.
3166 (name_lookup::add_fns: Use lookup_maybe_add.
3167 (name_lookup::search_adl): Mark and unmark fns.
3169 * pt.c (check_explicit_specialization): Use lookup_add directly.
3170 * ptree.c (cxx_print_xnode): Show complete overload structure.
3171 * tree.c (lookup_mark, lookup_maybe_add): New.
3173 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
3175 2017-05-26 Jakub Jelinek <jakub@redhat.com>
3177 * cp-tree.h (struct lang_decl_decomp): New type.
3178 (struct lang_decl): Add u.decomp.
3179 (LANG_DECL_DECOMP_CHECK): Define.
3180 (DECL_DECOMPOSITION_P): Note it is set also on the vars
3181 for user identifiers.
3182 (DECL_DECOMP_BASE): Define.
3183 (retrofit_lang_decl): Add extra int = 0 argument.
3184 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
3185 use it to influence the selector choices and for selector
3186 0 to non-zero transition copy old content.
3187 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
3188 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
3189 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
3190 wording if decl is a structured binding.
3191 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
3192 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
3193 of individual variables for tuple structured bindings.
3194 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
3195 Clear DECL_DECOMP_BASE.
3196 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
3197 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
3199 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
3202 2017-05-25 Jason Merrill <jason@redhat.com>
3204 PR c++/80605 - __is_standard_layout and zero-length array
3205 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
3207 2017-05-25 Nathan Sidwell <nathan@acm.org>
3209 Kill OVL_CURRENT, OVL_NEXT.
3210 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
3211 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
3212 (consider_binding_level): Use OVL_FIRST.
3213 (cp_emit_debug_info_for_using): Use lkp_iterator.
3214 * pt.c (check_explicit_specialization): Use ovl_iterator.
3216 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
3217 * cp-tree.h (lang_decl_ns): Remove ns_users field.
3218 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
3219 (TREE_INDIRECT_USING): Delete.
3220 * name-lookup.h (is_associated_namespace): Delete.
3221 * name-lookup.c (name_lookup::search_usings,
3222 name_lookup::do_queue_usings): Usings are always direct.
3223 (is_associated_namespace): Delete.
3224 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
3225 (namespace_ancestor_1, namespace_ancestor): Delete.
3226 (push_using_directive_1, push_using_directive): Delete.
3227 (add_using_namespace_1): Delete.
3228 (add_using_namespace): Reimplement.
3229 (emit_debug_info_using_namespace): New.
3230 (finish_namespace_using_directive, finish_local_using_directive,
3231 push_namespace): Adjust.
3232 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
3234 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
3236 * semantics.c (finish_handler_parms): Warn about non-reference type
3239 2017-05-25 Nathan Sidwell <nathan@acm.org>
3241 Reimplement unqualified namespace lookup.
3242 * name-lookup.c (name_lookup::using_pair,
3243 name_lookup::using_queue): New typedefs.
3244 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
3245 name_lookup::queue_usings): New.
3246 (name_lookup::search_unqualified): New.
3247 (merge_functions, same_entity_p, ambiguous_decl,
3248 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
3249 lookup_using_namespace): Delete.
3250 (lookup_name_real_1): Adjust.
3252 Reimplement qualified namespace lookup.
3253 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
3254 (name_lookup::ambiguous, name_lookup::add_value,
3255 name_lookup::add_type, name_lookup::process_binding): New.
3256 (name_lookup::search_namespace_only,
3257 name_lookup::search_namespace, name_lookup::search_usings): New.
3258 (name_lookup::search_qualified): New.
3259 (do_nonmember_using_decl, suggest_alternatives_for,
3260 lookup_qualified_name): Adjust.
3261 (tree_vec_contains): Delete.
3262 (qualified_lookup_using_namespace): Rename to ...
3263 (qualified_namespace_lookup): ... here. Reimplement.
3266 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
3267 * name-lookup.h (lookup_arg_dependent): Return plain tree.
3268 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
3269 arg_assoc_args_vec, arg_assoc_type, add_function,
3270 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
3271 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
3272 lookup_arg_dependent_1): Delete.
3273 (name_lookup): New lookup object.
3274 (name_lookup::preserve_state, name_lookup::restore_state,
3275 name_lookup::mark_seen, name_lookup::find_and_mark,
3276 name_lookup::add_fns, name_lookup::adl_namespace_only,
3277 name_lookup::adl_namespace, name_lookup::adl_class_only,
3278 name_lookup::adl_bases, name_lookup::adl_class,
3279 name_lookup::adl_expr, name_lookup::adl_type,
3280 name_lookup::adl_template_arg, name_lookup::search_adl): New.
3281 (lookup_arg_dependent): Return a plain tree. Adjust.
3282 (is_associated_namespace): Move later.
3284 2017-05-24 Nathan Sidwell <nathan@acm.org>
3286 * friend.c (do_friend): Remove check for existing decl.
3287 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
3288 * name-lookup.c (push_local_binding): Directly look for binding.
3289 (lookup_name_innermost_nonclass_level_1): Delete.
3290 (lookup_name_innermost_nonclass_level): Delete.
3292 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
3294 * cp-tree.h (cp_free_lang_data): Add extern.
3295 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
3297 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
3298 * typeck.c (type_unknown_p): Delete.
3299 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
3300 overload management.
3301 (dependent_name): Likewise.
3302 (decl_anon_ns_mem_p): Simplify.
3304 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
3307 * tree.c (reshape_init): Use unqualified type for direct enum init.
3308 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
3309 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
3310 non-class destination types.
3311 (build_const_cast_1): Strip cv-quals from destination types.
3312 (build_static_cast, build_reinterpret_cast, build_const_cast)
3313 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
3315 2017-05-24 Martin Sebor <msebor@redhat.com>
3318 * call.c (fully_fold_internal): Adjust.
3320 2017-05-24 Nathan Sidwell <nathan@acm.org>
3322 * cp-tree.h (ovl_skip_hidden): Declare.
3323 * tree.c (ovl_skip_hidden): New.
3324 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
3325 (lookup_arg_dependent_1): Likewise.
3326 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
3327 (hidden_name_p, remove_hidden_names): Delete.
3328 (lookup_name_real_1): Do not strip hidden names.
3329 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
3331 * cp-tree.h (OVL_HIDDEN_P): New.
3332 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
3333 (ovl_iterator::reveal_node): Declare.
3334 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
3335 (ovl_insert): Order on hiddenness.
3336 (ovl_iterator::reveal_node): New.
3337 * name-lookup.c (anticipated_builtin_p): New.
3338 (supplement_binding_1): Use it.
3339 (set_local_extern_decl_linkage): Use hidden_p.
3340 (do_pushdecl): Deal with unhiding a hidden decl, use
3341 anticipated_builtin_p.
3342 (do_nonmember_using_decl): Use anticipated_decl_p.
3343 (lookup_name_real_1): Use DECL_HIDDEN_P.
3345 2017-05-23 Jason Merrill <jason@redhat.com>
3347 -Wunused and C++17 structured bindings
3348 * decl.c (poplevel): Don't warn about unused structured bindings,
3349 only real variables.
3350 * error.c (dump_simple_decl): Handle structured bindings.
3351 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
3353 2017-05-23 Nathan Sidwell <nathan@acm.org>
3355 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
3356 * name-lookup.c (create_local_binding): New.
3357 (update_binding): New.
3358 (pushdecl_maybe_friend_1): Rename to ...
3359 (do_pushdecl): ... this. Reimplement.
3361 (push_overloaded_decl_1, push_overloaded_decl): Delete.
3363 2017-05-23 Jason Merrill <jason@redhat.com>
3365 PR c++/80396 - built-in for make_integer_sequence.
3366 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
3367 (expand_integer_pack, expand_builtin_pack_call): New.
3368 (find_parameter_packs_r): Check builtin_pack_call_p.
3369 (check_for_bare_parameter_packs): Handle it.
3370 (tsubst_pack_expansion): Call expand_builtin_pack_call.
3371 (declare_integer_pack): New.
3372 (init_template_processing): Call it.
3373 * decl2.c (mark_used): Check builtin_pack_fn_p.
3375 2017-05-23 Nathan Sidwell <nathan@acm.org>
3377 * name-lookup.c (find_namespace_binding): New.
3378 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
3379 (set_identifier_type_value_with_scope): Use find_namespace_binding.
3380 (find_binding, cp_binding_level_find_binding_for_name,
3381 binding_for_name, namespace_binding_1): Delete.
3382 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
3383 (get_namespace_binding, set_namespace_binding,
3384 finish_namespace_using_decl, unqualified_namespace_lookup_1,
3385 qualified_lookup_using_namespace, lookup_type_scope_1,
3386 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
3389 * parser.c (cp_parser_template_id): Keep the lookup when stashing
3392 * cp-tree.h (DECL_HIDDEN_P): New.
3393 * name-lookup.c (set_decl_context,
3394 set_local_extern_decl_linkage): New, broken out of ...
3395 (pushdecl_maybe_friend_1): ... here. Call them.
3397 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
3399 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
3400 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
3403 2017-05-23 Nathan Sidwell <nathan@acm.org>
3405 * cp-tree.h (OVL_P): New.
3406 * name-lookup.h (push_local_binding): Delete.
3407 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3408 (finish_namespace_using_decl, finish_local_using_decl): ... here
3409 * name-lookup.c (add_decl_to_level): Swap args.
3410 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
3411 (diagnose_name_conflict): Check contexts are same for redecl.
3412 (update_local_overload): New.
3413 (compparms_for_decl_and_using): Rename to ...
3414 (matching_fn_p): ... here.
3415 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
3416 push_local_bindings call.
3417 (push_local_binding): Make static, replace FLAGS arg with
3419 (validate_nonmember_using_decl): Use OVL_FIRST.
3420 (do_nonmember_using_decl): Use in/out parameters. Use
3421 lkp_iterator and simplify.
3422 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3423 (finish_namespace_using_decl, finish_local_using_decl): ... here.
3425 (lookup_type_current_level): Delete.
3426 * parser.c (cp_parser_using_declaration): Adjust.
3427 * pt.c (tsubst_expr): Adjust.
3429 2017-05-22 Nathan Sidwell <nathan@acm.org>
3431 * name-lookup.h (parse_using_directive): Replace with ...
3432 (finish_namespace_using_directive): ... this and ...
3433 (finish_local_using_directive): ... this.
3434 * name-lookup.c (add_using_namespace_1): Move later.
3435 (add_using_namespace): Move later, add namespace_p arg, remove
3437 (push_using_directive_1): Directly recurse.
3438 (do_using_directive, parse_using_directive): Delete, split into ...
3439 (finish_namespace_using_directive): ... this and ...
3440 (finish_local_using_directive): ... this.
3441 (push_namespace): Use add_using_namespace.
3442 * parser.c (cp_parser_using_directive): Call
3443 finish_namespace_using_directive or finish_local_using_directive.
3444 * pt.c (tsubst_expr): Call finish_local_using_directive.
3446 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
3447 * cp-tree.h (raw_dump_id): Declare.
3448 * decl2.c (raw_dump_id): Define.
3449 (dump_tu): Use raw_dump_id.
3451 * config-lang.in (gtfiles): Sort list, break lines.
3453 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
3454 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
3455 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
3456 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
3457 CPTI_RETHROW_FN): New.
3458 (noexcept_deferred_spec): New.
3459 (terminate_node, call_unexpected_node): Rename to ...
3460 (terminate_fn, call_unexpected_fn): ... here.
3461 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
3462 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
3463 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
3464 (init_exception_processing): Adjust.
3465 (declare_library_fn): Create and push the fns here.
3466 (do_get_exception_ptr, do_begin_catch, do_end_catch,
3467 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
3468 declare_library_fn use.
3469 (unevaluated_noexcept_spec): Adjust.
3470 * cp-gimplify.c (genericize_eh_spec_block,
3471 gimplify_most_not_throw_expr): Adjust.
3473 * name-lookup.c (pushdecl_top_level,
3474 pushdecl_top_level_and_finish): Move after namespace pushing and
3476 (push_to_top_level): Rename to ...
3477 (do_push_to_top_level): ... here. Remove timing code.
3478 (pop_from_top_level_1): Rename to ...
3479 (do_pop_from_top_level): ... here.
3480 (do_push_nested_namespace, do_pop_nested_namespace)
3481 (push_to_top_level): New wrapper for do_push_to_top_level.
3482 (pop_from_top_level): Adjust.
3483 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
3485 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
3487 * config-lang.in (gtfiles): Add c-family/c-format.c,
3488 except.c, init.c, lambda.c and friend.c.
3489 * class.c (dvirt_fn): Move out of function scope,
3491 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
3492 * init.c (fn): Likewise.
3493 * lambda.c (ptr_id, max_id): Likewise.
3494 * friend.c (global_friend): Add GTY attribute.
3496 2017-05-19 Nathan Sidwell <nathan@acm.org>
3498 * call.c (add_list_candidates): Use OVL_FIRST.
3499 (build_new_method_call_1): Likewise.
3500 * cp-tree.h (OVL_SINGLE_P): New.
3501 (TYPE_HIDDEN_P): New.
3502 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
3503 * dump.c (cp_tump_tree): Adjust overload dumping.
3504 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
3506 * method.c (lazily_declare_fn): Assert we added it.
3507 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
3509 (cp_parser_template_name): Use lkp_iterator.
3510 * pt.c (begin_template_parm_list): Fixup comment.
3511 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
3512 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
3513 (ovl_scope): Use lkp_iterator.
3515 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
3517 * parser.c (cp_parser_omp_clause_default): Handle
3518 "OMP_CLAUSE_DEFAULT_PRESENT".
3520 * parser.c (cp_parser_omp_clause_default): Avoid printing more
3521 than one syntax error message.
3523 2017-05-19 Nathan Sidwell <nathan@acm.org>
3525 * class.c (class_dump_id): Define.
3526 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
3527 * cp-objcp-common.c (cp_register_dumps): New.
3528 * cp-objcp-common.h (cp_register_dumps): Declare.
3529 (LANG_HOOKS_REGISTER_DUMPS): Override.
3530 * cp-tree.h (class_dump_id): Declare.
3532 2017-05-18 Nathan Sidwell <nathan@acm.org>
3534 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
3536 (lookup_keep): Declare.
3537 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
3538 * pt.c (tsubst_copy): Assert lookup is persistent.
3539 * semantics.c (finish_call_expr): Use lkp_iterator, call
3541 * tree.c (ovl_copy): New.
3542 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
3545 * cp-tree.h (OVL_USED): Replace with ...
3546 (OVL_USING_P): ... this.
3547 (ovl_iterator::using_p): Adjust.
3548 * name-lookup.c (push_overloaded_decl_1,
3549 do_nonmember_using_decl): Adjust.
3550 * search.c (lookup_field_r): Adjust.
3551 * tree.c (ovl_insert, ovl_scope): Adjust.
3553 * cp-tree.h (lookup_add): Swap args.
3554 (ovl_cons, build_overload): Delete.
3555 * name-lookup.c (add_function, push_overloaded_decl_1,
3556 do_nonmember_using_decl, merge_functions, remove_hidden_names):
3557 Use lookup_add, ovl_insert.
3558 * pt.c (check_explicit_specialization): Use lookup_add.
3559 (do_class_deduction): Likewise. Refactor if.
3560 * tree.c (lookup_add): Swap args.
3561 (ovl_cons, build_overload): Delete.
3563 * name-lookup.c (find_local_binding): New, broken out of ...
3564 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
3565 (set_namespace_binding): Swap scope & name args.
3566 (namespace_binding_1): Likewise.
3567 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
3568 (push_overloaded_decl_1): Likewise.
3569 (set_global_binding): Likewise.
3570 (get_namespace_binding): Adjust namespace_binding_1 call.
3572 2017-05-17 Nathan Sidwell <nathan@acm.org>
3574 * cp-tree.h (default_hash_traits <lang_identifier *>): New
3576 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
3577 (extern_c_fns): New hash table.
3578 (check_extern_c_conflict): New, broken out of ...
3579 (pushdecl_maybe_friend_1): ... here. Call it.
3580 (c_linkage_bindings): Just look in hash table.
3582 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
3586 Implement new C++ intrinsics __is_assignable and __is_constructible.
3587 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
3589 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3590 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3591 * method.c (constructible_expr): Set cp_unevaluated.
3592 (is_xible_helper): New.
3593 (is_trivially_xible): Adjust.
3595 * parser.c (cp_parser_primary_expression): Handle
3596 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
3597 (cp_parser_trait_expr): Likewise.
3598 * semantics.c (trait_expr_value): Handle
3599 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3601 2017-05-17 Nathan Sidwell <nathan@acm.org>
3603 * cp-tree.h (ovl_iterator::using_p): New predicate.
3604 (ovl_iterator::remove_node): New worker.
3605 (ovl_insert): Declare.
3606 * tree.c (ovl_insert): New.
3607 (ovl_iterator::remove_node): New.
3608 * class.c (add_method): Use ovl_iterator, ovl_insert.
3609 (clone_function_decl): Fix description.
3610 (clone_constructors_and_destructors): Use ovl_iterator.
3612 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
3613 (maybe_warn_about_overly_private_class): Use ovl_iterator.
3614 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
3615 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
3616 (get_base_fndecls): Use ovl_iterator.
3617 (warn_hidden): Use OVL_NAME, ovl_iterator.
3618 (add_implicitly_declared_members): Use ovl_iterator.
3619 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
3621 (finish_shorthand_constraint): Simplify, use ovl_make.
3622 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
3623 * search.c (shared_member_p): Use ovl_iterator.
3624 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
3625 (lookup_conversion_operator): Use OVL_FIRST.
3626 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
3627 (look_for_overrides_here): Use ovl_iterator.
3628 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
3629 * typeck.c (build_x_unary_op): Use ovl_make.
3631 2017-05-17 Martin Liska <mliska@suse.cz>
3633 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
3634 use it instead of int type.
3635 (dump_vtable): Likewise.
3636 (dump_vtt): Likewise.
3637 * decl2.c (dump_tu): Likewise.
3639 2017-05-16 David Malcolm <dmalcolm@redhat.com>
3641 * call.c (enforce_access): Add access_failure_info * param and use
3642 it to record access failures.
3643 * cp-tree.h (class access_failure_info): New class.
3644 (enforce_access): Add access_failure_info * param, defaulting to
3646 (lookup_member): Likewise.
3647 (locate_field_accessor): New function decl.
3648 (perform_or_defer_access_check): Add access_failure_info * param,
3650 * search.c (lookup_member): Add access_failure_info * param and
3651 pass it on to call to perform_or_defer_access_check.
3652 (matches_code_and_type_p): New function.
3653 (field_access_p): New function.
3654 (direct_accessor_p): New function.
3655 (reference_accessor_p): New function.
3656 (field_accessor_p): New function.
3657 (struct locate_field_data): New struct.
3658 (dfs_locate_field_accessor_pre): New function.
3659 (locate_field_accessor): New function.
3660 * semantics.c (perform_or_defer_access_check): Add
3661 access_failure_info * param, and pass it on to call to
3663 * typeck.c (access_failure_info::record_access_failure): New method.
3664 (access_failure_info::maybe_suggest_accessor): New method.
3665 (finish_class_member_access_expr): Pass an access_failure_info
3666 instance to the lookup_member call, and call its
3667 maybe_suggest_accessor method afterwards.
3669 2017-05-16 Marek Polacek <polacek@redhat.com>
3673 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
3675 2017-05-16 Nathan Sidwell <nathan@acm.org>
3677 * name-lookup.c (check_local_shadow): New, broke out of ...
3678 (pushdecl_maybe_friend_1): ... here. Call it.
3680 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
3681 (ovl_first): Move inline definition to end of file.
3682 (ovl_make, lookup_add): Declare.
3683 (get_fns, get_first_fn): Make pure.
3684 * tree.c (ovl_cache): New.
3685 (ovl_make, lookup_add): New.
3686 * pt.c (do_class_deduction): Don't add candidates that will be
3689 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
3690 (print_error_for_call_failure): Use OVL_NAME.
3691 (build_op_call_1): Use ovl_iterator.
3692 (add_candidates): Use OVL_FIRST & lkp_iterator.
3693 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
3695 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
3696 (type_has_user_nondefault_constructor,
3697 in_class_defaulted_default_constructor,
3698 type_has_user_provided_constructor,
3699 type_has_user_provided_or_explicit_constructor,
3700 type_has_non_user_provided_default_constructor,
3701 vbase_has_user_provided_move_assign,
3702 type_has_move_constructor, type_has_move_assign,
3703 type_has_user_declared_move_constructor,
3704 type_has_user_declared_move_assign,
3705 type_build_ctor_call, type_build_dtor_call,
3706 type_requires_array_cookie, explain_non_literal_class): Likewise.
3707 (finish_struct): Use lkp_iterator.
3708 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
3709 (note_name_declared_in_class): Use OVL_NAME.
3710 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
3711 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
3712 cxx_pretty_printer::expression): Likewise.
3713 * decl2.c (check_classfn): Use ovl_iterator.
3714 * pt.c (retrieve_specialization): Use ovl_iterator.
3715 * tree.c (cp_tree_equal): Use lkp_iterator.
3716 (type_has_nontrivial_copy_init): Use ovl_iterator.
3718 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
3719 check is_overloaded_fn.
3721 2017-05-16 Martin Liska <mliska@suse.cz>
3723 * parser.c (cp_lexer_print_token): Add default value for flags
3724 argument of print_gimple_stmt, print_gimple_expr,
3725 print_generic_stmt and print_generic_expr.
3727 2017-05-16 Nathan Sidwell <nathan@acm.org>
3729 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
3731 (MAYBE_BASELINK_FUNCTIONS): New.
3732 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
3733 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
3734 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
3735 * method.c (inherited_ctor_binfo): Use ovl_iterator.
3736 (binfo_inherited_from): Likewise.
3737 * parser.c (lookup_literal_operator): Use lkp_iterator.
3738 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
3739 (print_candidates_1): Likewise.
3740 (determine_specialization): Likewise.
3741 (resolve_overloaded_unification): Likewise.
3742 (resolve_nondeduced_context): Likewise.
3743 (type_dependent_expression_p): Likewise.
3744 (dependent_template_p): Likewise.
3745 * ptree.c (cxx_print_xnode): Likewise.
3746 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
3747 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
3748 * typeck.c (check_template_keyword): Use lkp_iterator.
3750 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
3752 * constexpr.c (function_concept_check): Use OVL_FIRST.
3753 * cvt.c (build_expr_type_conversion): Likewise.
3754 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
3755 * decl2.c (mark_used): Use OVL_FIRST.
3756 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
3757 (dump_expr, location_of): Use OVL_FIRST.
3758 * friend.c (do_friend): Use OVL_NAME.
3759 * init.c (build_offset_ref): Use OVL_FIRST.
3760 * mangle.c (write_member_name): Likewise.
3761 (write_expression): Use OVL_NAME.
3762 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
3763 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
3764 * pt.c (check_explicit_specialization): Use OVL_FIRST.
3765 (check_template_shadow): Likewise.
3766 (tsubst_template_args): Use OVL_NAME.
3767 (tsubst_baselink): Use OVL_FIRST.
3768 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
3769 * tree.c (get_first_fn): Use OVL_FIRST.
3770 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
3771 (cp_build_addr_expr_1): Use OVL_FIRST.
3773 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
3775 * semantics.c (finish_id_expression): Directly init local var.
3776 (finish_omp_reduction_clause): Use really_overloaded_fn.
3777 * tree.c (get_fns): Document. Assert we got an overload.
3778 (get_first_fn) Document.
3779 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
3780 really_overloaded_fn.
3781 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
3783 * cp-tree.h (SCOPE_DEPTH): New.
3784 * name-lookup.h (is_nested_namespace): Declare.
3785 * name-lookup.c (is_nested_namespace): New.
3786 (is_ancestor): Use it.
3787 (set_decl_namespace): Likewise.
3788 (push_namespace): Set SCOPE_DEPTH.
3789 * pt.c (check_specialization_namespace): Use is_nested_namespace.
3790 (check_unqualigied_spec_or_inst): Likewise.
3792 2017-05-15 Nathan Sidwell <nathan@acm.org>
3795 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
3796 * name-lookup.h (push_namespace): Return int, add make_inline arg.
3797 * name-lookup.c (push_namespace): Deal with inline directly.
3798 Return pushed count.
3799 * parser.c (cp_parser_namespace_definition): Adjust for
3800 push_namespace change.
3802 2017-05-11 Nathan Sidwell <nathan@acm.org>
3804 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
3805 LANG_HOOKS_PUSHDECL): Move to ...
3806 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
3807 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
3808 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
3810 * name-lookup.h (pushdecl): Add default friend parm.
3811 (pushdecl_maybe_friend): Delete.
3812 (pushdecl_top_level): Add default friend parm.
3813 (pushdecl_top_level_maybe_friend): Delete.
3814 * name-lookup.c (pushdecl_maybe_friend): Delete.
3815 (pushdecl): Add is_friend parm.
3816 (pushdecl_top_level): Add is friend_parm.
3817 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
3818 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
3819 * friend.c (do_friend): Adjust.
3820 * pt.c (tsubst_friend_class): Adjust.
3822 Revert pushdecl_top_level_and_finish name change.
3823 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
3824 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
3825 * decl.c (cp_make_fname_decl): Adjust.
3826 * decl2.c (get_guard, handle_tls_init): Adjust.
3827 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
3829 * name-lookup.c (pushdecl_outermost_localscope): Always
3830 conditionally stop timer.
3832 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
3833 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
3835 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
3836 pushtag_top_level_maybe_friend,
3837 pushdecl_top_level_and_finish): Move declarations to ...
3838 * name-lookup.h: ... here. Group pushdecl variants.
3839 (pushdecl_top_level_and_finish): Rename to ...
3840 (pushdecl_top_level_with_init): ... here.
3841 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
3842 * decl2.c (get_guard, handle_tls_init): Likewise.
3843 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
3844 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
3845 * method.c (implicitly_declare_fn): Likewise.
3846 * searchc (node_debug_info_needed): Likewise.
3847 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
3848 (pushdecl_top_level_with_init): ... here.
3849 (pop_everything): Use namespace_bindings_p.
3851 * name-lookup.h (pop_binding): Rename to pop_local_binding.
3852 (getdecls): Rename to get_local_decls.
3853 * name-lookup.c (pop_binding): Rename to ...
3854 (pop_local_binding): ... here.
3855 (pop_bindings_and_leave_scope): Adjust.
3856 (getdecls): Rename to ...
3857 (get_local_decls): ... here. Assert local scope.
3858 * decl.c (poplevel): Assert not namespace. Adjust and simplify
3860 (store_parm_decls): Adjust get_local_decls call.
3861 (parser.c (synthesize_implicit_template_parm): Likewise.
3863 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
3866 * method.c (is_trivially_xible): Reject void types.
3868 2017-05-10 Nathan Sidwell <nathan@acm.org>
3870 * class.c (handle_using_decl): Always use OVL_CURRENT.
3871 (resolve_address_of_overloaded_function): Move iterator decl into
3872 for scope. Don't strip anticipated decls here.
3874 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
3876 (print_candidates): Adjust.
3878 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
3880 * call.c (build_new_function_call): Lose koenig_p arg. Remove
3881 koenig_p handling here.
3882 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
3883 (tsubst_omp_clauses): Likewise.
3884 (do_class_deduction): Adjust buld_new_function_call calls.
3885 * semantics.c (finish_call_expr): Likewise.
3887 2017-05-10 Jason Merrill <jason@redhat.com>
3889 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
3890 (unify_type_mismatch, unify_parameter_pack_mismatch)
3891 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
3892 (unify_parameter_pack_inconsistent, unify_inconsistency)
3893 (unify_vla_arg, unify_method_type_error, unify_arity)
3894 (unify_arg_conversion, unify_no_common_base)
3895 (unify_inconsistent_template_template_parameters)
3896 (unify_template_deduction_failure)
3897 (unify_template_argument_mismatch)
3898 (unify_overload_resolution_failure): Call unify_invalid.
3900 CWG 1847 - Clarifying compatibility during partial ordering
3901 * pt.c (more_specialized_fn): No order between two non-deducible
3904 * pt.c (dependent_type_p): Make sure we aren't called with
3907 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3908 * pt.c (convert_template_argument): Just return an argument pack.
3909 (coerce_template_parameter_pack, template_parm_to_arg)
3910 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
3911 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
3912 Don't set the type of a NONTYPE_ARGUMENT_PACK.
3913 * parser.c (make_char_string_pack, make_string_pack): Likewise.
3915 2017-05-10 Nathan Sidwell <nathan@acm.org>
3917 * cp-tree.h (add_method, clone_function_decl): Change last arg to
3919 * class.c (add_method): Change third arg to bool. Adjust.
3920 (one_inheriting_sig, one_inherited_ctor): Adjust.
3921 (clone_function_decl): Change 2nd arg to bool. Adjust.
3922 (clone_constructors_and_destructors): Adjust.
3923 * lambda.c (maybe_add_lambda_conv_op): Adjust.
3924 * method.c (lazily_declare_fn): Adjust.
3925 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
3926 * semantics.c (finish_member_declaration): Adjust.
3928 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
3931 * decl.c (finish_function): To improve error recovery, change the
3932 logic for calling apply_deduced_return_type.
3934 2017-05-09 Jason Merrill <jason@redhat.com>
3936 PR c++/80605 - __is_standard_layout and empty base
3937 * class.c (check_bases): Ignore empty bases.
3939 PR c++/70979 - literal class and closure types
3940 * class.c (finalize_literal_type_property): Handle closures
3942 (explain_non_literal_class): Likewise.
3944 PR c++/66297, DR 1684 - literal class and constexpr member fns
3945 * constexpr.c (is_valid_constexpr_fn): Only complain about
3946 non-literal enclosing class in C++11.
3947 * class.c (finalize_literal_type_property): Likewise.
3949 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
3952 * pt.c (tsubst_decl): Early return error_mark_node if
3953 grok_ctor_properties returns false.
3955 2017-05-09 Jason Merrill <jason@redhat.com>
3957 PR c++/70167 - array prvalue treated as lvalue
3958 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
3960 * semantics.c (finish_compound_literal): Add fcl_context parameter.
3961 Only make a static variable for C99 syntax.
3962 * parser.c (cp_parser_postfix_expression): Pass it.
3963 * pt.c (tsubst_copy_and_build): Likewise.
3964 * call.c (extend_ref_init_temps): Set
3965 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
3967 2017-05-09 Nathan Sidwell <nathan@acm.org>
3969 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
3970 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
3971 * name-lookup.h (pushdecl_top_level): Declare.
3973 2017-05-08 Jason Merrill <jason@redhat.com>
3975 PR c++/80178 - parameter passing for uncopyable classes
3976 * tree.c (type_has_nontrivial_copy_init): True for classes with only
3977 deleted copy/move ctors.
3978 (remember_deleted_copy, maybe_warn_parm_abi): New.
3979 * decl.c (require_complete_types_for_parms, check_function_type):
3980 Call maybe_warn_parm_abi.
3981 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
3983 2017-05-08 Nathan Sidwell <nathan@acm.org>
3985 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
3986 (start_preparsed_function): Do decl pushing before setting
3987 current_funciton_decl and announcing it.
3989 * name-lookup.h (pushdecl_with_scope): Replace with ...
3990 (pushdecl_outermost_localscope): ... this.
3991 * name-lookup.c (pushdecl_with_scope): Replace with ...
3992 (pushdecl_outermost_localscope): ... this.
3993 (pushdecl_namespace_level): Adjust.
3994 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
3995 * lambda.c (insert_capture_proxy): Likewise.
3997 * class.c (build_vtbl_initializer): Don't shadow outer variable
4000 Revert _binding -> _value change.
4001 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
4002 (get_namespace_binding, set_global_binding): ... these.
4003 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
4004 (get_namespace_binding, set_global_binding): ... these.
4005 (arg_assoc_namespace, pushdecl_maybe_friend_1,
4006 check_for_out_of_scope_variable, push_overloaded_decl_1,
4007 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
4008 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
4009 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
4010 * decl.c (poplevel): Adjust.
4011 * pt.c (make_constrained_auto): Likewise.
4013 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
4015 PR translation/80280
4016 * call.c (print_z_candidate): Fix quoting.
4018 2017-05-05 David Malcolm <dmalcolm@redhat.com>
4020 * error.c (pedwarn_cxx98): Replace report_diagnostic
4021 with diagnostic_report_diagnostic.
4023 2017-05-05 Nathan Sidwell <nathan@acm.org>
4025 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
4026 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
4027 (IDENTIFIER_NAMESPACE_VALUE): Delete.
4028 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
4030 (get_namespace_value, set_global_value): ... these.
4031 (get_global_value_if_present, is_typename_at_global_scope): Delete.
4032 * decl.c (poplevel): Use get_namespace_value.
4033 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
4034 * class.c (build_vtbl_initializer): Stash library decl in
4035 static var. Use IDENTIFIER_GLOBAL_VALUE.
4036 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
4037 do_allocate_exception, do_free_exception, build_throw): Likewise.
4038 * init.c (throw_bad_array_new_length): Likewise.
4039 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
4040 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
4041 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
4042 get_namespace_value.
4043 (set_namespace_binding_1): Rename to
4044 (set_namespace_binding): ... here.
4045 (set_global_value): New.
4046 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
4047 get_namespace_value.
4048 * pt.c (listify): Use get_namespace_value.
4050 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
4052 * lex.c (unqualified_name_lookup_error): Likewise.
4054 * class.c (alter_class): Use retrofit_lang_decl directly.
4055 * decl.c (push_local_name, dupliate_decls): Likewise.
4056 * semantics.c (omp_privatize_field): Likewise.
4058 Kill walk_namespaces.
4059 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
4060 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
4062 Kill per-namespace static_decls.
4063 * cp-tree.h (static_decls): Declare.
4064 (wrapup_globals_for_namespace,
4065 diagnose_inline_vars_for_namespace): Replace with ...
4066 (wrapup_namespace_globals): ... this.
4067 * decl.c (static_decls): Define.
4068 (wrapup_globals_for_namespace,
4069 diagnose_inline_vars_for_namespace): Replace with ...
4070 (wrapup_namespace_globals): ... this.
4071 (cxx_init_decl_processing): Initialize static_decls.
4072 * decl2.c (c_parse_final_cleanups): Adjust.
4073 * name-lookup.h (cp_binding_level): Remove static_decls member.
4074 * name-lookup.c (add_decl_to_level): Adjust.
4075 (begin_scope): Adjust.
4077 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
4080 * decl.c (reshape_init): Unconditionally return error_mark_node
4081 upon error about too many initializers.
4083 2017-05-04 Nathan Sidwell <nathan@acm.org>
4085 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
4087 2017-05-04 Martin Sebor <msebor@redhat.com>
4089 PR translation/80280
4090 * call.c (print_z_candidate): Add missing quoting to %D and other
4092 (build_op_call_1): Same.
4093 * constraint.cc (diagnose_check_constraint): Same.
4094 * mangle.c (mangle_decl): Same.
4095 * name-lookup.c (cp_binding_level_debug): Same.
4096 (set_decl_namespace): Same.
4097 * parser.c (cp_parser_tx_qualifier_opt): Same.
4098 * pt.c (print_candidates_1): Same.
4099 (check_template_variable): Same.
4100 (tsubst_default_argument): Same.
4101 (most_specialized_partial_spec): Same.
4102 * semantics.c (omp_reduction_lookup): Same.
4103 * tree.c (check_abi_tag_redeclaration): Same.
4104 * typeck.c (comptypes): Same.
4105 * typeck2.c (abstract_virtuals_error_sfinae): Same.
4107 2017-05-04 Nathan Sidwell <nathan@acm.org>
4110 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
4111 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
4112 CPTI_INIT_LIST_IDENTIFIER.
4113 (global_namespace, global_type_node, global_identifier,
4114 anon_identifier, init_list_identifier): New.
4115 * decl.c (global_type_node, global_scope_name): Delete.
4116 (initialize_predefined_identifiers): Add new identifiers.
4117 (cxx_init_decl_processing): Adjust.
4118 * name-lookup.h (global_namespace, global_type_node): Delete.
4119 * name-lookup.c (global_namespace, anonymous_namespace_name,
4120 get_anonymous_namespace_name): Delete.
4121 (namespace_scope_ht_size, begin_scope, pushtag_1,
4122 push_namespace): Adjust,
4123 * call.c (type_has_extended_temps): Use init_list_identifier.
4124 * pt.c (listify): Likewise.
4126 * name-lookup.c: Reorder functions to make merging from modules
4129 2017-05-03 Jason Merrill <jason@redhat.com>
4131 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
4133 2017-05-03 Nathan Sidwell <nathan@acm.org>
4135 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
4136 along with #defines, to before name-lookup include.
4138 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
4140 * pt.c (is_auto_or_concept): Remove.
4141 (type_uses_auto_or_concept): Remove, unused.
4142 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
4143 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
4144 * cp-tree.h (is_auto_or_concept): Remove.
4146 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
4149 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
4150 add pedigree operation and detach call here.
4151 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
4152 cilk_cp_gimplify_call_params_in_spawned_fn.
4153 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
4154 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
4156 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
4158 * parser.c (cp_parser_member_declaration): Add fix-it hints for
4159 stray comma and missing semicolon at end of member declaration.
4161 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
4163 * parser.c (cp_parser_cast_expression): Add target type of cast to
4165 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
4167 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
4169 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
4170 return type to bool.
4171 * cp-tree.h (grok_ctor_properties): Update.
4173 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
4175 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
4176 information to diagnostic of invalid colon in nested-name-specifier.
4178 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
4180 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
4181 diagnostic of invalid class/struct keyword after enum.
4183 2017-04-25 David Malcolm <dmalcolm@redhat.com>
4185 * parser.c (cp_parser_member_declaration): Add fix-it hint
4186 for removing stray semicolons.
4188 2017-04-25 David Malcolm <dmalcolm@redhat.com>
4190 * name-lookup.c (get_std_name_hint): New function.
4191 (maybe_suggest_missing_header): New function.
4192 (suggest_alternative_in_explicit_scope): Call
4193 maybe_suggest_missing_header.
4195 2017-04-25 David Malcolm <dmalcolm@redhat.com>
4198 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
4199 candidate type of bm from tree to const char *.
4200 (consider_binding_level): Likewise.
4201 (lookup_name_fuzzy): Likewise, using this to merge the best
4202 result from the preprocessor into bm, rather than immediately
4203 returning, so that better matches from reserved words can "win".
4204 Guard the rejection of keywords that don't start decl-specifiers
4205 so it only happens for FUZZY_LOOKUP_TYPENAME.
4207 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
4209 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
4210 (start_enum): Likewise.
4211 (build_enumerator): Likewise. Use %qE instead of plain %E.
4212 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
4213 %<%D%> in diagnostics.
4214 (cp_parser_elaborated_type_specifier): Likewise.
4215 * pt.c (make_pack_expansion): Use %qT and %qE instead of
4216 %<%T%> and %<%E%> in diagnostics.
4217 (tsubst_pack_expansion): Likewise.
4219 2017-04-24 David Malcolm <dmalcolm@redhat.com>
4222 * parser.c (cp_parser_unary_expression): Generate a location
4223 range for alignof and sizeof expressions.
4225 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
4227 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
4229 (cp_parser_virt_specifier_seq_opt): Likewise.
4230 (set_and_check_decl_spec_loc): Likewise twice.
4232 2017-04-21 Jason Merrill <jason@redhat.com>
4234 PR c++/80179 - ICE with initialized flexible array member.
4235 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
4237 2017-04-21 Richard Biener <rguenther@suse.de>
4239 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
4240 (copy_type): Likewise.
4241 * lex.c (copy_decl): Pass down mem-stat info.
4242 (copy_type): Likewise.
4244 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
4247 * init.c (build_new_1): Suppress notes about over-aligned new when
4248 the warning is suppressed.
4250 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
4252 * parser.c (cp_parser_member_declaration): Add warning with fixit
4253 information for extra semicolon after in-class function definition.
4255 2017-04-20 Jakub Jelinek <jakub@redhat.com>
4258 * tree.c (build_cplus_array_type): Call build_array_type
4259 with the intended TYPE_TYPELESS_STORAGE flag value, instead
4260 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
4263 2017-04-18 Marek Polacek <polacek@redhat.com>
4265 PR c++/80244 - ICE with attribute in template alias.
4266 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
4268 PR c++/80241 - ICE with alignas pack expansion.
4269 * error.c (dump_expr): Handle TREE_LIST.
4270 * parser.c (cp_parser_std_attribute_list): Return error_mark if
4271 make_pack_expansion returns an error.
4273 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
4276 * class.c (fixup_may_alias): Fix all type variants.
4278 2017-04-17 Jason Merrill <jason@redhat.com>
4280 PR c++/80415 - wrong error with default arg and array reference.
4281 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
4283 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
4285 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
4287 * decl.c (name_unnamed_type): Split out of...
4288 (grokdeclarator): ... this.
4289 * decl.h (name_unnamed_type): Declare.
4291 2017-04-12 Richard Biener <rguenther@suse.de>
4292 Bernd Edlinger <bernd.edlinger@hotmail.de>
4295 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
4296 for arrays of character or std::byte type.
4298 2017-04-11 Jason Merrill <jason@redhat.com>
4300 PR c++/80294 - ICE with constexpr and inheritance.
4301 * constexpr.c (reduced_constant_expression_p):
4302 A null constructor element is non-constant.
4303 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
4304 returning an empty base.
4306 2017-04-11 Jakub Jelinek <jakub@redhat.com>
4309 * decl.c (cp_finish_decomp): If processing_template_decl on
4310 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
4311 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
4312 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
4314 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
4315 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
4318 2017-04-11 Jakub Jelinek <jakub@redhat.com>
4321 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
4323 2017-04-10 Jakub Jelinek <jakub@redhat.com>
4326 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
4327 operand, if it is a static member function, recurse on the
4330 2017-04-10 Marek Polacek <polacek@redhat.com>
4333 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
4334 ORIG_TYPE earlier and not only when shortening.
4336 2017-04-07 Jason Merrill <jason@redhat.com>
4338 PR c++/80356 - ICE with reference to function template argument.
4340 * pt.c (convert_nontype_argument_function): Adjust type even with a
4341 value-dependent argument.
4343 PR c++/80267 - ICE with nested capture of reference
4345 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
4347 2017-04-07 Marek Polacek <polacek@redhat.com>
4350 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
4353 * call.c (build_over_call): Don't check cxx_dialect.
4354 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
4355 whether SUB is a CONSTRUCTOR.
4356 * init.c (build_new_1): Don't check cxx_dialect.
4357 * tree.c (replace_placeholders): Add a function comment. Return if
4358 not in C++14, or if the object isn't a (member of a) class.
4359 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
4360 TYPE is CLASS_TYPE_P.
4362 2017-04-05 Jakub Jelinek <jakub@redhat.com>
4365 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
4366 of a loop doing vec_safe_push of NULL. Formatting fixes.
4367 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
4368 to newidx before calling canonical_type_parameter on newtype.
4370 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
4373 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
4374 UNARY_PLUS_EXPR case.
4376 2017-04-03 Jason Merrill <jason@redhat.com>
4378 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
4380 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
4382 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
4383 * decl2.c (one_static_initialization_or_destruction): Likewise.
4384 * name-lookup.c (store_bindings): Likewise.
4385 * parser.c (make_call_declarator): Likewise.
4386 * pt.c (check_explicit_specialization): Likewise.
4388 2017-04-03 Jason Merrill <jason@redhat.com>
4390 PR sanitizer/79993 - ICE with VLA initialization from string
4391 PR c++/69487 - wrong VLA initialization from string
4392 * init.c (finish_length_check): Split out from build_vec_init.
4393 (build_vec_init): Handle STRING_CST.
4394 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
4395 (digest_init_r): Don't give a STRING_CST VLA type.
4397 2017-03-31 Jakub Jelinek <jakub@redhat.com>
4400 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
4401 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
4402 for NOP_EXPR to REFERENCE_TYPE.
4405 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
4406 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
4408 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
4409 Remove extraneous parens.
4410 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
4411 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
4412 (cp_parser_trait_expr): Likewise.
4414 2017-03-27 Jakub Jelinek <jakub@redhat.com>
4417 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
4418 * typeck.c (cxx_mark_addressable): Likewise. Look through
4419 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
4421 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
4423 2017-03-24 Jason Merrill <jason@redhat.com>
4425 PR c++/77339 - ICE with invalid use of alias template.
4426 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
4429 2017-03-24 Marek Polacek <polacek@redhat.com>
4432 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
4433 doesn't have side effects.
4435 2017-03-23 Jason Merrill <jason@redhat.com>
4437 PR c++/80150 - ICE with overloaded variadic deduction.
4438 * pt.c (try_one_overload): Remove asserts.
4440 PR c++/77563 - missing ambiguous conversion error.
4441 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
4443 2017-03-23 Marek Polacek <polacek@redhat.com>
4445 * cp-tree.h: Remove a C_RID_YYCODE reference.
4447 2017-03-22 Jakub Jelinek <jakub@redhat.com>
4450 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
4451 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
4452 processing_template_decl.
4454 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
4457 * name-lookup.c (pushtag_1): Add check for bogus, non template,
4458 std::initializer_list.
4460 2017-03-21 Jakub Jelinek <jakub@redhat.com>
4463 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
4465 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
4468 * init.c (std_placement_new_fn_p): New.
4469 (build_new_1): Call it.
4471 2017-03-20 Jason Merrill <jason@redhat.com>
4473 PR c++/80096 - ICE with C++17 non-type auto.
4474 * pt.c (tsubst): Delay tsubst of type of template non-type
4477 PR c++/79519 - ICE with deleted template friend.
4478 * decl.c (grokdeclarator): Complain about misplaced function
4479 definition using =, as well.
4481 PR c++/79640 - infinite recursion with generic lambda.
4482 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
4483 before substituting its initializer.
4485 2017-03-20 Marek Polacek <polacek@redhat.com>
4486 Paolo Carlini <paolo.carlini@oracle.com>
4488 PR c++/80059 - ICE with noexcept and __transaction_atomic
4489 * except.c (build_must_not_throw_expr): Call
4490 instantiate_non_dependent_expr.
4492 2017-03-19 Jason Merrill <jason@redhat.com>
4494 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
4495 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
4496 reference decomposition.
4498 PR c++/80077 - error with constexpr and -fno-elide-constructors.
4499 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
4500 expanding trivial constructor.
4502 2017-03-17 Jason Merrill <jason@redhat.com>
4504 PR c++/78345 - ICE initializing array from lambda.
4505 * init.c (build_aggr_init): Check array initializer.
4506 (build_vec_init): Check the type of a CONSTRUCTOR.
4508 PR c++/80073 - C++17 ICE with virtual base.
4509 * decl.c (xref_basetypes): Also check for indirect vbases.
4511 2017-03-16 Jason Merrill <jason@redhat.com>
4513 * decl.c (start_enum): std::byte aliases anything.
4516 * constexpr.c (lookup_placeholder): Tweak.
4518 2017-03-15 Jason Merrill <jason@redhat.com>
4520 PR c++/80043 - ICE with -fpermissive
4521 * typeck.c (convert_for_assignment): Handle instantiate_type
4522 not giving an error.
4524 2017-03-14 Nathan Sidwell <nathan@acm.org>
4526 PR c++/79393 DR 1658 workaround
4527 * method.c (synthesized_method_base_walk): Inihibit abstract class
4528 virtual base access check here.
4529 (synthesized_method_walk): Not here.
4531 2017-03-13 Nathan Sidwell <nathan@acm.org>
4533 PR c++/79393 DR 1658 workaround
4534 * method.c (synthesized_method_walk): Check vbases of abstract
4535 classes for dtor walk.
4537 2017-03-10 David Malcolm <dmalcolm@redhat.com>
4539 PR translation/79848
4540 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
4542 2017-03-10 Jason Merrill <jason@redhat.com>
4544 PR c++/79960 - alias templates and partial ordering
4545 * pt.c (comp_template_args): Add partial_order parm.
4546 (template_args_equal): Likewise.
4547 (comp_template_args_porder): New.
4548 (get_partial_spec_bindings): Use it.
4550 2017-03-10 Marek Polacek <polacek@redhat.com>
4553 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
4555 2017-03-10 Jakub Jelinek <jakub@redhat.com>
4558 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
4559 Use XALLOCAVEC macro.
4562 * decl.c (finish_enum_value_list): If value is error_mark_node,
4563 don't copy it and change its type.
4564 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
4565 of CONST_DECL is error_mark_node.
4567 2017-03-09 Marek Polacek <polacek@redhat.com>
4569 PR c++/79900 - ICE in strip_typedefs
4570 * tree.c (strip_typedefs): Skip the attribute handling if T is
4571 a variant type which hasn't been updated yet.
4573 PR c++/79687 - wrong code with pointer-to-member
4574 * init.c (constant_value_1): Break if the variable has a dynamic
4577 2017-03-08 Jason Merrill <jason@redhat.com>
4579 PR c++/79797 - ICE with self-reference in array DMI.
4580 * constexpr.c (lookup_placeholder): Split out...
4581 (cxx_eval_constant_expression): ...from here.
4583 2017-03-07 Jakub Jelinek <jakub@redhat.com>
4586 * parser.c (cp_parser_omp_cancellation_point,
4587 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
4588 cp_parser_omp_target_update): Change "may only be used in compound
4589 statements" diagnostics, such that the same translatable string is
4590 used for all pragmas.
4591 (cp_parser_pragma): Likewise. Use error_at instead of
4592 cp_parser_error for that diagnostics.
4594 2017-03-06 Marek Polacek <polacek@redhat.com>
4596 PR c++/79796 - ICE with NSDMI and this pointer
4597 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
4598 replace_placeholders.
4600 2017-03-06 Jakub Jelinek <jakub@redhat.com>
4603 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
4606 2017-03-06 Jason Merrill <jason@redhat.com>
4608 Revert "Allow deduction guides to look into primary template."
4609 * cp-tree.h, parser.c, pt.c, search.c: Revert.
4611 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
4614 * except.c (build_must_not_throw_expr): Perform the implicit
4615 conversions on the condition.
4617 2017-03-03 Jason Merrill <jason@redhat.com>
4619 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
4622 Core issues 2273 and 2277
4623 * call.c (joust): Adjust using-declaration tiebreaker to handle
4624 the intermediate base case.
4625 * method.c (strip_inheriting_ctors): Just return the argument if
4626 !flag_new_inheriting_ctors.
4628 2017-03-03 Richard Biener <rguenther@suse.de>
4631 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
4633 2017-03-03 Marek Polacek <polacek@redhat.com>
4636 * typeck.c (string_conv_p): In C++11, always call pedwarn with
4639 2017-03-02 Jason Merrill <jason@redhat.com>
4641 Update overload resolution with deduction guides.
4642 * pt.c (do_class_deduction): Always build the copy guide.
4643 (copy_guide_p, template_guide_p): New.
4644 (build_deduction_guide): Remember the original constructor.
4645 * call.c (joust): Prefer the copy guide and non-template guides.
4647 Allow deduction guides to look into primary template.
4648 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
4649 (struct cp_decl_specifier_seq): Add constructor_p.
4650 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
4651 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
4652 Clear deduction_guide_type. Don't handle deduction guide names.
4653 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
4654 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
4655 (cp_parser_member_declaration, cp_parser_cache_defarg)
4656 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
4657 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
4658 (build_deduction_guide): Set deduction_guide_type.
4659 (dependent_scope_p): Check deduction_guide_type.
4660 * search.c (lookup_member): Likewise.
4662 2017-03-02 Jakub Jelinek <jakub@redhat.com>
4665 * init.c (mark_exp_read_r): New function.
4666 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
4667 whole arguments instead of plain mark_exp_read on TREE_LIST values.
4669 2017-03-01 Jason Merrill <jason@redhat.com>
4671 Class template argument deduction in new-expression
4672 * init.c (build_new): Handle deduction from no initializer.
4673 * parser.c (cp_parser_new_expression): Don't require a single
4674 expression for class template deduction.
4675 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
4676 class template placeholder.
4677 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
4678 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
4679 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
4681 2017-03-01 Jakub Jelinek <jakub@redhat.com>
4684 * init.c (emit_mem_initializers): When not constructing vbases of
4685 abstract classes, mark arguments as read for
4686 -Wunused-but-set-parameter.
4688 2017-02-28 Jason Merrill <jason@redhat.com>
4690 Class template argument deduction refinements
4691 * call.c (joust): Move deduction guide tiebreaker down.
4692 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
4693 deduction with no initializer.
4694 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
4695 (do_class_deduction): Use that rather than special case.
4696 (do_auto_deduction): Handle null initializer.
4698 2017-02-28 Jakub Jelinek <jakub@redhat.com>
4700 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
4701 instead of just cond ? "..." : "...".
4702 (grokdeclarator): Likewise.
4703 (build_enumerator): Likewise.
4704 * init.c (build_new_1): Likewise.
4705 * call.c (build_new_method_call_1): Likewise.
4706 * parser.c: Include intl.h.
4707 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
4708 "enter"/"exit" keyword.
4709 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
4712 2017-02-27 Jason Merrill <jason@redhat.com>
4714 PR c++/71568 - SFINAE forming pointer to member function
4715 * init.c (build_offset_ref): Check the return value of
4716 perform_or_defer_access_check.
4718 2017-02-27 Marek Polacek <polacek@redhat.com>
4720 * decl.c (expand_static_init): Add missing } in a comment.
4722 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
4724 * init.c: Include intl.h.
4725 (build_new_1): Move message strings into pedwarn to make them
4726 -Wformat-security friendly. Mark string for translation.
4727 * pt.c (tsubst_copy_and_build): Mark string for translation.
4728 Make the pointer const.
4729 * semantics.c (finish_id_expression): Mark strings for translation.
4731 2017-02-25 Jakub Jelinek <jakub@redhat.com>
4733 * call.c (build_op_delete_call): Make msg1 and msg2 const.
4735 2017-02-24 Jakub Jelinek <jakub@redhat.com>
4738 * call.c (build_over_call): Call check_function_arguments even for
4739 -Wrestrict, adjust check_function_arguments caller.
4740 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
4742 * typeck.c (cp_build_function_call_vec): Adjust
4743 check_function_arguments caller.
4745 2017-02-24 Marek Polacek <polacek@redhat.com>
4747 PR translation/79705
4748 * decl.c (check_redeclaration_exception_specification): Mark a string
4749 for translation. Make the pointer const.
4751 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
4754 * pt.c (register_specialization): Check duplicate_decls return value
4755 for error_mark_node and pass it back.
4757 2017-02-22 Jason Merrill <jason@redhat.com>
4759 PR c++/79679 - missing destructor for argument
4760 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
4763 * pt.c (do_class_deduction): Handle 0 argument case.
4765 2017-02-22 Jakub Jelinek <jakub@redhat.com>
4768 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
4769 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
4770 * constexpr.c (potential_constant_expression_1): Handle
4771 OMP_*, OACC_* and CILK_* trees. Use error_at with
4772 EXPR_LOC_OR_LOC (t, input_location) computed early
4773 instead of error, or error_at with location_of (t).
4775 2017-02-22 Marek Polacek <polacek@redhat.com>
4778 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
4779 if the alignas expression is erroneous.
4780 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
4784 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
4786 2017-02-21 Jason Merrill <jason@redhat.com>
4788 PR c++/50308 - wrong deprecated warning with ADL
4789 PR c++/17729 - duplicate deprecated warning
4790 * semantics.c (finish_id_expression): Only call mark_used on a
4791 function if we aren't building a call.
4793 PR c++/41727 - ICE with partial spec of partial instantiation
4794 * pt.c (process_partial_specialization): For now, don't check more
4795 specialized if there is more than one level of args.
4797 2017-02-21 Marek Polacek <polacek@redhat.com>
4800 * cp-tree.h (maybe_reject_flexarray_init): Declare.
4801 * init.c (maybe_reject_flexarray_init): No longer static.
4802 Add check for current_function_decl.
4803 * parser.c (cp_parser_late_parse_one_default_arg): Reject
4804 a default mem-initializer for a flexible array.
4806 2017-02-21 Jakub Jelinek <jakub@redhat.com>
4807 Paolo Carlini <paolo.carlini@oracle.com>
4810 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
4812 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
4813 decl after the decomposition artificial decl has error_mark_node.
4814 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
4815 instead of just == error_mark_node comparison.
4817 2017-02-21 Jakub Jelinek <jakub@redhat.com>
4820 * decl.c: Include gimplify.h.
4821 (cp_finish_decomp): Make sure there is no sharing of trees
4822 in between DECL_VALUE_EXPR of decomposition decls.
4825 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
4828 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
4829 call cplus_expand_constant on it first.
4831 2017-02-19 Jason Merrill <jason@redhat.com>
4833 PR c++/78139 - destructor needed by new-expression
4834 * call.c (build_special_member_call): Use tf_no_cleanup.
4836 PR c++/78282 - auto template and pack expansion
4837 * pt.c (find_parameter_packs_r): Don't walk into the type of
4838 templates other than template template-parameters.
4840 PR c++/79606 - ICE with this->base_member in NSDMI
4841 * class.c (build_base_path): Check processing_template_decl.
4843 PR c++/79607 - ICE with T{} initializer
4844 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
4846 PR c++/79566 - elaborated-type-specifier in range for
4847 * parser.c (cp_parser_simple_declaration): Fix check for type
4850 PR c++/79400 - confusing suggestion of 'noexcept'
4851 * parser.c (cp_parser_exception_specification_opt): Remove
4852 suggestion for deprecated dynamic exception-specification.
4854 PR c++/79470 - partial ordering with reference parameters
4855 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
4857 PR c++/79500 - ICE with non-template deduction guide
4858 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
4859 DECL_TEMPLATE_RESULT.
4861 PR c++/79580 - ICE with compound literal
4862 * parser.c (cp_parser_class_head): If we're in the middle of an
4863 expression, use ts_within_enclosing_non_class.
4865 PR c++/79503 - inherited ctor taking base class
4866 * call.c (add_function_candidate): Also check that
4867 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
4869 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
4872 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
4875 2017-02-19 Eric Fiselier <eric@efcs.ca>
4876 Jonathan Wakely <jwakely@redhat.com>
4879 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
4880 control warning about literal suffix identifiers without a leading
4883 2017-02-17 Jason Merrill <jason@redhat.com>
4885 PR c++/79508 - lookup error with member template
4886 * parser.c (cp_parser_template_name): Clear
4887 parser->context->object_type if we aren't doing lookup.
4889 PR c++/78690 - ICE with using and global type with same name
4890 * pt.c (type_dependent_object_expression_p): True for
4893 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
4894 * pt.c (convert_template_argument): Just return an auto arg pack.
4895 (tsubst_template_args): Don't tsubst an auto pack type.
4897 PR c++/79556 - C++17 ICE with non-type auto
4898 * pt.c (do_auto_deduction): Don't try to deduce from null type.
4900 PR c++/79533 - C++17 ICE with temporary cast to reference
4901 * call.c (build_over_call): Conversion to a reference prevents copy
4904 2017-02-16 Jakub Jelinek <jakub@redhat.com>
4905 Jason Merrill <jason@redhat.com>
4907 PR c++/79502 - lost nodiscard attribute
4908 * pt.c (apply_late_template_attributes): Do apply non-dependent
4909 attributes to types.
4911 2017-02-16 Jason Merrill <jason@redhat.com>
4913 PR c++/78572 - ICE with self-modifying array initializer
4914 * constexpr.c (cxx_eval_store_expression): The object we're
4915 initializing is outside the constant-expression.
4916 (cxx_eval_call_expression): Set ctx->call.
4918 PR c++/79050 - ICE with undeduced auto and LTO
4919 * decl.c (poplevel): Remove undeduced auto decls.
4921 2017-02-16 Jakub Jelinek <jakub@redhat.com>
4924 * parser.c (cp_parser_omp_target): For -fopenmp-simd
4925 ignore #pragma omp target even when not followed by identifier.
4927 2017-02-15 Jason Merrill <jason@redhat.com>
4928 Jakub Jelinek <jakub@redhat.com>
4930 PR c++/79464 - ICE in IPA with omitted constructor parms
4931 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
4932 (adjust_clone_args): Adjust.
4933 (add_method): Remember omitted parms.
4934 * call.c (add_function_candidate): Likewise.
4935 * mangle.c (write_method_parms): Likewise.
4936 * method.c (ctor_omit_inherited_parms): Return false if there are no
4939 2017-02-15 Martin Sebor <msebor@redhat.com>
4942 * init.c (maybe_reject_flexarray_init): New function.
4943 (perform_member_init): Call it.
4945 2017-02-15 Jakub Jelinek <jakub@redhat.com>
4948 * parser.c (cp_parser_std_attribute): Don't pedwarn about
4949 [[deprecated]] with -std=c++11 and [[fallthrough]] with
4950 -std=c++11 and -std=c++14.
4953 * decl.c (grokdeclarator): For static data members, handle thread_p
4954 only after handling inline.
4956 2017-02-14 Marek Polacek <polacek@redhat.com>
4960 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
4961 clobbering if the postfix expression isn't an EXPR_P.
4963 2017-02-13 Jason Merrill <jason@redhat.com>
4965 PR c++/79461 - ICE with lambda in constexpr constructor
4966 * constexpr.c (build_data_member_initialization): Ignore
4967 initialization of a local variable.
4969 2017-02-13 Jakub Jelinek <jakub@redhat.com>
4971 * init.c (warn_placement_new_too_small): Add missing space in
4973 * parser.c (cp_parser_oacc_declare): Likewise.
4974 * mangle.c (maybe_check_abi_tags): Likewise.
4977 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
4978 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
4979 in the rightmost operand.
4981 2017-02-13 Nathan Sidwell <nathan@acm.org>
4983 PR c++/79296 - ICE mangling localized template instantiation
4984 * decl2.c (determine_visibility): Use template fn context for
4985 local class instantiations.
4987 2017-02-11 Jason Merrill <jason@redhat.com>
4989 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
4990 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
4991 (build_new_1): Use replace_placeholders.
4992 * tree.c (replace_placeholders_t): Also track whether we've seen a
4994 (replace_placeholders, replace_placeholders_r): Adjust.
4995 * cp-tree.h: Adjust.
4997 PR c++/77790 - ICE with auto function in C++11 mode
4998 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
4999 (require_deduced_type): Add complain parm, return bool.
5000 * cp-tree.h: Adjust.
5001 * decl2.c (mark_used): Use require_deduced_type.
5003 2017-02-10 Jason Merrill <jason@redhat.com>
5005 PR c++/78908 - template ops and bitfields
5006 * tree.c (build_min_non_dep): Use unlowered_expr_type.
5008 PR c++/78897 - constexpr union
5009 * constexpr.c (cxx_eval_store_expression): A store to a union member
5010 erases a previous store to another member.
5012 PR c++/71285 - member of fold-expression
5013 * semantics.c (finish_unary_fold_expr)
5014 (finish_binary_fold_expr): Use null type for fold-expressions.
5016 PR c++/79401 - protected inherited constructor
5017 * call.c (enforce_access): For inheriting constructor, find a base
5018 binfo in the path we already have.
5020 2017-02-10 Marek Polacek <polacek@redhat.com>
5023 * pt.c (type_dependent_expression_p): Check if the expression type
5027 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
5028 if warnings shouldn't be given.
5030 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
5033 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
5034 an error_mark_node as type.
5036 2017-02-09 Jakub Jelinek <jakub@redhat.com>
5037 Jason Merrill <jason@redhat.com>
5040 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
5041 from pattern to type.
5043 2017-02-09 Jason Merrill <jason@redhat.com>
5045 PR c++/79316 - default argument in deduction guide
5046 PR c++/79350 - explicit deduction guide
5047 * parser.c (cp_parser_constructor_declarator_p)
5048 (cp_parser_direct_declarator): Parse deduction guides more like
5050 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
5051 * tree.c (special_function_p): Return it.
5052 * decl.c (check_special_function_return_type): Handle it.
5053 (grokdeclarator, grokfndecl): Adjust.
5054 (cp_finish_decl): Pass flags to do_auto_deduction.
5055 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
5056 * pt.c (dguide_name_p): Take a const_tree.
5057 (do_class_deduction): Handle explicit.
5058 (do_auto_deduction): Pass flags through.
5059 (build_deduction_guide): Copy explicit flag.
5061 2017-02-09 Jakub Jelinek <jakub@redhat.com>
5064 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
5065 non-pragma_compound context here.
5066 (cp_parser_omp_target): Likewise.
5067 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
5068 parsing for ordered and target omp pragmas in non-pragma_stmt
5069 non-pragma_compound contexts.
5072 * parser.c (cp_parser_oacc_declare): Formatting fix.
5073 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
5074 automatic variables.
5076 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
5077 Chung-Lin Tang <cltang@codesourcery.com>
5079 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
5080 parsing. Parse constant expression. Remove semantic checking.
5081 (cp_parser_omp_clause_collapse): Disallow tile.
5082 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
5083 error about missing for after already emitting one. Use more
5084 conventional for idiom for unbounded loop.
5085 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
5086 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
5087 (finish_omp_for): Deal with tile clause.
5089 2017-02-07 Nathan Sidwell <nathan@acm.org>
5091 * method.c (synthesized_method_base_walk): New. Broken out of ...
5092 (synthesized_method_walk): ... here. Call it. Cleanup
5095 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
5098 * typeck2.c (process_init_constructor_union): Consider only
5099 FIELD_DECLs when looking for an NSDMI.
5101 2017-02-06 Jason Merrill <jason@redhat.com>
5103 PR c++/71193 - incomplete types in templates
5104 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
5105 handle incomplete type by pedwarning and then treating as dependent.
5107 2017-02-06 Jakub Jelinek <jakub@redhat.com>
5110 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
5111 (potential_constant_expression_1): Likewise.
5114 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
5115 allow one fewer than expected arguments if flag_permissive.
5118 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
5119 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
5120 with error_mark_node type.
5122 2017-02-03 Jason Merrill <jason@redhat.com>
5124 PR c++/78689 - ICE on constructor with label
5125 * optimize.c (maybe_clone_body): Replace omitted parameters with
5127 * class.c (build_clone): Fix logic for omitting inherited parms.
5129 PR c++/12245 - excessive memory use
5130 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
5131 back in. Don't cache constants.
5132 (maybe_constant_init): Don't cache constants.
5134 PR c++/79294 - ICE with invalid template argument
5135 * pt.c (convert_nontype_argument_function): Check value-dependence.
5136 (convert_nontype_argument): Don't check it here for function ptrs.
5138 2017-02-02 Richard Biener <rguenther@suse.de>
5141 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
5142 it lazily on the first changed element only and copy it
5143 fully upfront, only storing changed elements.
5145 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
5148 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
5151 2017-01-31 Jakub Jelinek <jakub@redhat.com>
5154 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
5157 2017-01-31 David Malcolm <dmalcolm@redhat.com>
5160 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
5161 any namespace aliases.
5163 2017-01-31 Nathan Sidwell <nathan@acm.org>
5166 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
5170 * pt.c: (instantiate_decl): Push to top level when current
5171 function scope doesn't match. Only push lmabda scope stack when
5174 * cp-tree.h (instantiate_decl): Make defer_ok bool.
5175 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
5176 (instantiate_decl): Simplify and reorder state saving and restoration.
5179 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
5180 * semantics.c (finish_member_declaration): Assert class is being
5183 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
5185 Introduce C++ support in libcc1.
5186 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
5187 (ansi_opname): Rename to...
5188 (cp_operator_id): ... this. Adjust all callers.
5189 (ansi_assopname): Rename to...
5190 (cp_assignment_operator_id): ... this. Adjust all callers.
5191 (cp_literal_operator_id): Declare.
5192 (set_global_friend): Declare.
5193 (is_global_friend): Declare.
5194 (enum cp_oracle_request): New type.
5195 (cp_binding_oracle_function): New type.
5196 (cp_binding_oracle): Declare.
5197 (cp_finish_injected_record_type): Declare.
5198 * friend.c (global_friend): New var.
5199 (set_global_friend): New fn.
5200 (is_global_friend): New fn.
5201 (is_friend): Call is_global_friend.
5202 * name-lookup.c (cp_binding_oracle): New var.
5203 (query_oracle): New fn.
5204 (qualified_lookup_using_namespace): Call query_oracle.
5205 (lookup_name_real_1): Likewise.
5206 * parser.c (cp_literal_operator_id): Drop static.
5207 * search.c (friend_accessible_p): Call is_global_friend.
5208 * semantics.c (is_this_parameter): Accept a variable if the
5209 binding oracle is enabled.
5211 2017-01-27 Jason Merrill <jason@redhat.com>
5213 PR c++/78771 - ICE with inherited constructor.
5214 * call.c (build_over_call): Call deduce_inheriting_ctor here.
5215 * pt.c (tsubst_decl): Not here.
5216 * class.c (add_method): Or here.
5217 * method.c (deduce_inheriting_ctor): Handle clones.
5218 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
5220 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
5223 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
5225 * cp/cp-tree.h: Declare it.
5226 * cp/semantics.c (finish_id_expression): Resolve names within a default
5227 capturing generic lambda defined within a template prior to
5228 instantiation to allow for captures to be added to the closure type.
5230 2017-01-26 Jakub Jelinek <jakub@redhat.com>
5233 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
5234 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
5235 * parser.c (cp_parser_builtin_offsetof): Pass result of
5236 build_static_cast of null_pointer_node to finish_offsetof.
5237 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
5238 it for -Winvalid-offsetof pedwarn instead of trying to guess
5239 original offsetof type from EXPR. Save OBJECT_PTR as a new
5240 second operand to OFFSETOF_EXPR.
5241 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
5242 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
5245 2017-01-26 Jason Merrill <jason@redhat.com>
5247 * name-lookup.c (parse_using_directive): Deprecate strong using.
5249 PR c++/79176 - lambda ICE with -flto -Os
5250 * decl2.c (vague_linkage_p): Handle decloned 'tors.
5251 * tree.c (decl_linkage): Likewise.
5253 2017-01-25 Martin Sebor <msebor@redhat.com>
5255 * decl.c (grokdeclarator): Fix a typo in a comment.
5257 2017-01-25 Jakub Jelinek <jakub@redhat.com>
5260 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
5264 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
5265 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
5267 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
5270 * decl.c (cxx_init_decl_processing): Pass main_input_filename
5271 to build_translation_unit_decl.
5273 2017-01-24 Jakub Jelinek <jakub@redhat.com>
5276 * cp-gimplify.c (cp_genericize_r): Add result of
5277 convert_from_reference on invisiref parm to p_set.
5279 2017-01-24 Nathan Sidwell <nathan@acm.org>
5281 PR c++/78469 - defaulted ctor and inaccessible dtor
5282 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
5283 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
5284 * tree.c (build_target_expr): Check tf_no_cleanup.
5286 PR c++/79118 - anon-members and constexpr
5287 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
5288 ctor decl. Recursively check anonymous members.
5289 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
5291 (explain_invalid_constexpr_fn): Likewise.
5293 2017-01-23 Nathan Sidwell <nathan@acm.org>
5295 PR c++/71710 - template using directive of field
5296 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
5299 PR c++/71406 - ICE with scope-ref'd template id exprs
5301 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
5302 before breaking up TEMPLATE_ID_EXPR.
5304 2017-01-20 Nathan Sidwell <nathan@acm.org>
5306 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
5307 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
5309 2017-01-20 David Malcolm <dmalcolm@redhat.com>
5313 * cp-tree.h (suggest_alternatives_for): Add bool param.
5314 (suggest_alternative_in_explicit_scope): New decl.
5315 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
5316 that isn't the global one, call new function
5317 suggest_alternative_in_explicit_scope, only calling
5318 suggest_alternatives_for if it fails, and disabling near match
5319 searches fort that case. When SCOPE is the global namespace,
5320 pass true for new param to suggest_alternatives_for to allow for
5322 * lex.c (unqualified_name_lookup_error): Pass true for new param
5323 to suggest_alternatives_for.
5324 * name-lookup.c (consider_binding_level): Add forward decl.
5325 (suggest_alternatives_for): Add "suggest_misspellings" param,
5326 using it to conditionalize the fuzzy name-lookup code.
5327 (suggest_alternative_in_explicit_scope): New function.
5328 * parser.c (cp_parser_primary_expression): When calling
5329 finish_id_expression, pass location of id_expression rather
5330 than that of id_expr_token.
5331 (cp_parser_id_expression): Convert local "unqualified_id" from
5332 tree to cp_expr to avoid implicitly dropping location information.
5334 2017-01-20 Marek Polacek <polacek@redhat.com>
5337 * call.c (build_conditional_expr_1): Warn about duplicated branches.
5338 * semantics.c (finish_expr_stmt): Build statement using the proper
5341 2017-01-19 Jason Merrill <jason@redhat.com>
5343 US 20 - forwarding references and class template argument deduction
5344 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
5345 * pt.c (push_template_decl_real): Set it.
5346 (maybe_adjust_types_for_deduction): Check it.
5347 (rewrite_template_parm): Copy it.
5349 US 19 - deduction guides and constructors
5350 * call.c (joust): Prefer deduction guides to constructors.
5351 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
5352 (deduction_guide_p): Check DECL_P.
5354 * decl.c (check_initializer): Always use build_aggr_init for array
5357 PR c++/79130 - decomposition and direct-initialization
5358 * init.c (build_aggr_init): Communicate direct-initialization to
5360 (build_vec_init): Check for array copy sooner.
5361 * parser.c (cp_parser_decomposition_declaration): Remove call to
5362 build_x_compound_expr_from_list.
5364 2017-01-18 Jason Merrill <jason@redhat.com>
5366 PR c++/68666 - member variable template-id
5367 * typeck.c (finish_class_member_access_expr): Handle variable
5369 * pt.c (lookup_and_finish_template_variable): No longer static.
5370 * cp-tree.h: Declare it.
5372 2017-01-18 Nathan Sidwell <nathan@acm.org>
5375 * call.c (build_over_call): When checking ellipsis conversions for
5376 an inherited ctor, make sure there is at least one conversion.
5378 2017-01-18 Jason Merrill <jason@redhat.com>
5380 PR c++/78894 - ICE with class deduction and default arg
5381 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
5383 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5386 * mangle.c (write_discriminator): Reorganize abi warning check.
5388 2017-01-18 Nathan Sidwell <nathan@acm.org>
5390 * cp-tree.h: Clarify exception spec node comment.
5391 * except.c (nothrow_spec_p): Simplify by checking node-equality.
5394 * mangle.c (write_exception_spec): Check nothrow explicitly.
5395 (write_encoding): Don't increment processing_template_decl around
5398 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5401 * mangle.c (write_template_args): Add "on" for operator names.
5403 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5406 * mangle.c (write_discriminator): Handle discriminator >= 10.
5408 2017-01-17 Nathan Sidwell <nathan@acm.org>
5411 * cp-tree.h (maybe_generic_this_capture): Declare.
5412 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
5413 (maybe_resolve_dummy): ... here. Call it.
5414 (maybe_generic_this_capture): New.
5415 * parser.c (cp_parser_postfix_expression): Speculatively capture
5416 this in generic lambda in unresolved member function call.
5417 * pt.c (tsubst_copy_and_build): Force hard error from failed
5418 member function lookup in generic lambda.
5420 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
5423 * cp-array-notation.c (expand_array_notation_exprs): Handle
5426 2017-01-11 Jason Merrill <jason@redhat.com>
5428 PR c++/78337 - ICE on invalid with generic lambda
5429 * semantics.c (process_outer_var_ref): Check if containing_function
5430 is null. Move inform call under complain test.
5432 2017-01-11 Nathan Sidwell <nathan@acm.org>
5435 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
5438 2017-01-11 Nathan Sidwell <nathan@acm.org>
5440 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
5442 2017-01-11 Jakub Jelinek <jakub@redhat.com>
5445 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
5446 assertion. Formatting fix.
5449 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
5452 2017-01-10 David Malcolm <dmalcolm@redhat.com>
5455 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
5456 a missing semicolon if we have a valid insertion location for
5459 2017-01-10 Jason Merrill <jason@redhat.com>
5461 FI 20, decomposition declaration with parenthesized initializer.
5462 * parser.c (cp_parser_decomposition_declaration): Use
5463 cp_parser_initializer.
5465 2017-01-09 Jason Merrill <jason@redhat.com>
5467 Implement P0195R2, C++17 variadic using.
5468 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
5469 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
5470 * error.c (dump_decl): Likewise.
5472 2017-01-09 Jakub Jelinek <jakub@redhat.com>
5474 PR translation/79019
5475 PR translation/79020
5476 * semantics.c (finish_omp_clauses): Add missing whitespace to
5477 translatable strings.
5478 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
5480 2017-01-07 Jason Merrill <jason@redhat.com>
5482 PR c++/78948 - instantiation from discarded statement
5483 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
5484 * cp-tree.h (in_discarded_stmt): Declare it.
5485 (struct saved_scope): Add discarded_stmt bitfield.
5486 (in_discarded_stmt): New macro.
5487 * decl2.c (mark_used): Check it.
5488 * parser.c (cp_parser_selection_statement): Adjust.
5489 (cp_parser_jump_statement): Adjust.
5491 2017-01-05 Jakub Jelinek <jakub@redhat.com>
5494 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
5495 REFERENCE_REF_P, set tt to its operand.
5498 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
5499 unions even for C++11 and later.
5501 2017-01-05 Nathan Sidwell <nathan@acm.org>
5504 * pt.c (convert_nontype_argument): Don't try and see if integral
5505 or enum expressions are constants prematurely.
5507 2017-01-04 Marek Polacek <polacek@redhat.com>
5510 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
5511 a zero character literal.
5513 2017-01-04 Jakub Jelinek <jakub@redhat.com>
5516 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
5520 * parser.c (cp_parser_simple_declaration): Only complain about
5521 inconsistent auto deduction if auto_result doesn't use auto.
5523 * parser.c (cp_parser_simple_declaration): Diagnose function
5524 declaration among more than one init-declarators with auto
5528 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
5529 assertion, as lexer->buffer may be NULL.
5531 2017-01-04 Marek Polacek <polacek@redhat.com>
5535 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
5537 2017-01-04 Nathan Sidwell <nathan@acm.org>
5540 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
5541 (lambda_capture_field_type): Update prototype.
5542 * lambda.c (lambda_capture_field_type): Add is_reference parm.
5543 Add referenceness here.
5544 (add_capture): Adjust lambda_capture_field_type call, refactor
5546 * pt.c (tsubst): Adjust lambda_capture_field_type call.
5548 2017-01-01 Jakub Jelinek <jakub@redhat.com>
5550 Update copyright years.
5552 Copyright (C) 2017 Free Software Foundation, Inc.
5554 Copying and distribution of this file, with or without modification,
5555 are permitted in any medium without royalty provided the copyright
5556 notice and this notice are preserved.