1 2017-12-01 Jakub Jelinek <jakub@redhat.com>
4 * cp-gimplify.c (genericize_switch_stmt): Emit LABEL_EXPR for the
5 break label into SWITCH_BODY instead of after it and set
6 SWITCH_BREAK_LABEL_P on it.
7 * parser.c (cp_parser_objc_expression): Add FALLTHRU comment to avoid
8 -Wimplicit-fallthrough warning.
10 2017-11-30 Jason Merrill <jason@redhat.com>
12 PR c++/82219 - bogus -Wignored-qualifiers with template
13 * pt.c (tsubst_copy_and_build) [STATIC_CAST_EXPR]: Suppress
16 2017-11-29 David Malcolm <dmalcolm@redhat.com>
18 * parser.c (cp_parser_unary_expression): Generate a location for
20 (cp_parser_trait_expr): Generate and return a location_t,
21 converting the return type from tree to cp_expr.
22 (cp_parser_static_assert): Pass location of the condition to
23 finish_static_assert, rather than that of the "static_assert"
24 token, where available.
26 2017-11-29 Paolo Carlini <paolo.carlini@oracle.com>
29 * lambda.c (nonlambda_method_basetype): Don't use LAMBDA_TYPE_P
32 2017-11-29 Jason Merrill <jason@redhat.com>
34 PR c++/82760 - memory corruption with aligned new.
35 * call.c (build_operator_new_call): Update *args if we add the
38 2017-11-28 Jakub Jelinek <jakub@redhat.com>
41 * cp-tree.h (SWITCH_STMT_ALL_CASES_P): Define.
42 (SWITCH_STMT_NO_BREAK_P): Define.
43 (note_break_stmt, note_iteration_stmt_body_start,
44 note_iteration_stmt_body_end): Declare.
45 * decl.c (struct cp_switch): Add has_default_p, break_stmt_seen_p
46 and in_loop_body_p fields.
47 (push_switch): Clear them.
48 (pop_switch): Set SWITCH_STMT_CANNOT_FALLTHRU_P if has_default_p
49 and !break_stmt_seen_p. Assert in_loop_body_p is false.
50 (note_break_stmt, note_iteration_stmt_body_start,
51 note_iteration_stmt_body_end): New functions.
52 (finish_case_label): Set has_default_p when both low and high
54 * parser.c (cp_parser_iteration_statement): Use
55 note_iteration_stmt_body_start and note_iteration_stmt_body_end
56 around parsing iteration body.
57 * pt.c (tsubst_expr): Likewise.
58 * cp-objcp-common.c (cxx_block_may_fallthru): Return false for
59 SWITCH_STMT which contains no BREAK_STMTs, contains a default:
60 CASE_LABEL_EXPR and where SWITCH_STMT_BODY isn't empty and
62 * semantics.c (finish_break_stmt): Call note_break_stmt.
63 * cp-gimplify.c (genericize_switch_stmt): Copy SWITCH_STMT_ALL_CASES_P
64 bit to SWITCH_ALL_CASES_P. Assert that if SWITCH_STMT_NO_BREAK_P then
65 the break label is not TREE_USED.
67 2017-11-28 Julia Koval <julia.koval@intel.com>
68 Sebastian Peryt <sebastian.peryt@intel.com>
70 * Make-lang.in (cp/cp-array-notation.o, cp/cp-cilkplus.o): Delete.
71 * call.c (convert_for_arg_passing, build_cxx_call): Remove cilkplus.
72 * constexpr.c (potential_constant_expression_1): Ditto.
73 * cp-array-notation.c: Delete.
74 * cp-cilkplus.c: Ditto.
75 * cp-cilkplus.h: Ditto.
76 * cp-gimplify.c (cp_gimplify_expr, cp_fold_r, cp_genericize): Remove
78 * cp-objcp-common.c (ARRAY_NOTATION_REF): Delete.
79 * cp-tree.h (cilkplus_an_triplet_types_ok_p): Delete.
80 * decl.c (grokfndecl, finish_function): Remove cilkplus condition.
81 * error.c (dump_decl, dump_expr): Remove ARRAY_NOTATION_REF condition.
82 * lambda.c (cp-cilkplus.h): Remove.
83 * parser.c (cp_parser_cilk_simd, cp_parser_cilk_for,
84 cp_parser_cilk_simd_vectorlength): Delete.
85 (cp_debug_parser, cp_parser_ctor_initializer_opt_and_function_body,
86 cp_parser_postfix_expression,
87 cp_parser_postfix_open_square_expression,
88 cp_parser_statement, cp_parser_jump_statement,
89 cp_parser_direct_declarator,
90 cp_parser_late_return_type_opt, cp_parser_gnu_attribute_list,
91 cp_parser_omp_clause_name, cp_parser_omp_clause_aligned,
92 cp_parser_omp_clause_linear, cp_parser_omp_all_clauses,
94 cp_parser_omp_for_cond, cp_parser_omp_for_incr,
95 cp_parser_omp_for_loop_init,
96 cp_parser_omp_for_loop,
97 cp_parser_omp_declare_simd): Remove cilkplus support.
98 (CILK_SIMD_FN_CLAUSE_MASK, cp_parser_late_parsing_cilk_simd_fn_info,
99 cp_parser_cilk_grainsize): Remove.
100 (cp_parser_pragma, c_parse_file): Remove cilkplus support.
101 (cp_parser_cilk_simd_vectorlength, cp_parser_cilk_simd_linear,
102 cp_parser_cilk_simd_clause_name, cp_parser_cilk_simd_all_clauses,
103 cp_parser_cilk_simd, cp_parser_cilk_for): Remove.
104 * parser.h (IN_CILK_SIMD_FOR, IN_CILK_SPAWN): Remove.
105 * pt.c (tsubst_attribute, tsubst_expr, tsubst_copy_and_build): Remove
107 * semantics.c (finish_goto_stmt, begin_while_stmt, finish_do_body,
108 finish_init_stmt, finish_switch_cond, simplify_aggr_init_expr,
109 finish_omp_clauses, finish_omp_clauses, finish_omp_for): Remove
112 * tree.c (lvalue_kind): Remove ARRAY_NOTATION_REF conditon.
113 * typeck.c (cp_build_array_ref, cp_build_compound_expr,
114 check_return_expr): Remove cilkplus support.
116 2017-11-28 Jakub Jelinek <jakub@redhat.com>
118 * cp-gimplify.c (genericize_switch_stmt): Build SWITCH_EXPR using
119 build2_loc instead of build3_loc.
121 2017-11-27 Martin Sebor <msebor@redhat.com>
124 * init.c (warn_placement_new_too_small): Use offset_int instead of
127 2017-11-27 Jakub Jelinek <jakub@redhat.com>
130 * parser.c (cp_parser_decomposition_declaration): Reject just
131 BRACE_ENCLOSED_INITIALIZER_P initializers with nelts != 1 rather
132 than all such CONSTRUCTORs, and only if is_direct_init is true.
134 2017-11-27 Jason Merrill <jason@redhat.com>
136 * pt.c (primary_template_specialization_p): Rename from
137 primary_template_instantiation_p. Don't check
138 DECL_TEMPLATE_INSTANTIATION.
139 * call.c, cp-tree.h, decl2.c: Adjust.
141 2017-11-27 Jakub Jelinek <jakub@redhat.com>
144 * cp-gimplify.c (cp_fold) <case COND_EXPR>: Don't return immediately
145 for VOID_TYPE_P COND_EXPRs, instead fold the operands and if op0 is
146 INTEGER_CST, ensure that both op1 and op2 are non-NULL and fall
147 through into normal folding, otherwise just rebuild x if any op
150 * g++.dg/warn/pr81675.C: New test.
152 2017-11-14 Boris Kolpackov <boris@codesynthesis.com>
154 * Make-lang.in (c++.install-plugin): Install backend import library.
156 2017-11-23 Jakub Jelinek <jakub@redhat.com>
158 * parser.c (cp_parser_omp_declare): Change return type to bool from
159 void, return true for declare simd.
160 (cp_parser_pragma): Return cp_parser_omp_declare returned value
161 rather than always false.
163 2017-11-23 Mike Stump <mikestump@comcast.net>
164 Eric Botcazou <ebotcazou@adacore.com>
166 * pt.c (tsubst_expr) <ANNOTATE_EXPR>: Recurse on 3rd operand.
167 * semantics.c (finish_while_stmt_cond): Pass 3rd operand to
169 (finish_do_stmt): Likewise.
170 (finish_for_cond): Likewise.
172 2017-11-22 Jakub Jelinek <jakub@redhat.com>
175 * name-lookup.c (member_name_cmp): Return 0 if a == b.
177 2017-11-22 David Malcolm <dmalcolm@redhat.com>
180 * error.c (type_to_string): Add leading comment. Add params
181 "postprocessed", "quote", and "show_color", using them to fix
182 quoting of the "aka" for types involving typedefs.
183 (arg_to_string): Update for new params to type_to_string.
184 (cxx_format_postprocessor::handle): Likewise.
185 (cp_printer): Convert penultimate param from bool to bool *.
186 Update call to type_to_string and calls to
187 defer_phase_2_of_type_diff.
189 2017-11-22 Marek Polacek <polacek@redhat.com>
194 * class.c (layout_class_type): Set DECL_PADDING_P on padding.
195 * decl.c (cxx_init_decl_processing): Set TRANSLATION_UNIT_WARN_EMPTY_P.
196 (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.
198 2017-11-21 Martin Liska <mliska@suse.cz>
200 * class.c (finalize_literal_type_property): Add quotes for
202 (explain_non_literal_class): Likewise.
203 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
204 (is_valid_constexpr_fn): Likewise.
205 (check_constexpr_ctor_body): Likewise.
206 (register_constexpr_fundef): Likewise.
207 (explain_invalid_constexpr_fn): Likewise.
208 (cxx_eval_builtin_function_call): Likewise.
209 (cxx_eval_call_expression): Likewise.
210 (cxx_eval_loop_expr): Likewise.
211 (potential_constant_expression_1): Likewise.
212 * decl.c (check_previous_goto_1): Likewise.
213 (check_goto): Likewise.
214 (grokfndecl): Likewise.
215 (grokdeclarator): Likewise.
216 * error.c (maybe_print_constexpr_context): Likewise.
217 * method.c (process_subob_fn): Likewise.
218 (defaulted_late_check): Likewise.
219 * parser.c (cp_parser_compound_statement): Likewise.
221 2017-11-21 Marc Glisse <marc.glisse@inria.fr>
223 * constexpr.c (cxx_eval_constant_expression,
224 potential_constant_expression_1): Handle POINTER_DIFF_EXPR.
225 * cp-gimplify.c (cp_fold): Likewise.
226 * error.c (dump_expr): Likewise.
227 * typeck.c (pointer_diff): Use POINTER_DIFF_EXPR.
229 2017-11-21 Jakub Jelinek <jakub@redhat.com>
231 P0428R2 - familiar template syntax for generic lambdas
232 * parser.c (cp_parser_lambda_declarator_opt): Don't pedwarn
233 for cxx2a and above, reword pedwarn for C++14/C++17.
235 2017-11-20 David Malcolm <dmalcolm@redhat.com>
238 * name-lookup.c: Include "c-family/known-headers.h"
239 (lookup_name_fuzzy): Call get_cp_stdlib_header_for_name and
240 potentially return a new suggest_missing_header hint.
242 2017-11-20 David Malcolm <dmalcolm@redhat.com>
245 * name-lookup.c (class macro_use_before_def): New class.
246 (lookup_name_fuzzy): Detect macro that were used before being
247 defined, and report them as such.
249 2017-11-20 Jason Merrill <jason@redhat.com>
251 * decl2.c (constrain_class_visibility): Don't warn about artificial
254 2017-11-20 Jakub Jelinek <jakub@redhat.com>
256 P0329R4: Designated Initialization
257 * parser.c (cp_parser_initializer_clause): List in comment grammar
258 designated-initializer-list.
259 (cp_parser_initializer_list): Allow .identifier = without pedwarn for
260 C++2A, parse .identifier { ... }. Improve location_t argument to
261 pedwarn. Add pedwarn for [cst] = designators. Diagnose ... in
262 designated initializer list. Diagnose mixing designated and
263 non-designated initializer clauses for C++2A. Diagnose duplicated
264 identifiers in designators.
265 * name-lookup.h (search_anon_aggr): New declaration.
266 * name-lookup.c (fields_linear_search): Use search_anon_aggr.
267 (search_anon_aggr): New function.
268 * typeck2.c (process_init_constructor_record): Allow designator
269 to skip over some non-static data members. Handle anonymous
270 aggregates. Add diagnostics for designator order not matching
271 member declaration order.
273 2017-11-20 David Malcolm <dmalcolm@redhat.com>
275 * name-lookup.c: Define INCLUDE_UNIQUE_PTR before including system.h.
276 Include "c-family/name-hint.h"
277 (suggest_alternatives_for): Convert "fuzzy_name" from const char *
278 to name_hint, and rename to "hint". Pass location to
280 (lookup_name_fuzzy): Convert return type from const char *
281 to name_hint. Add location_t param.
282 * parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
283 Include "c-family/name-hint.h"
284 (cp_parser_diagnose_invalid_type_name): Convert
285 "suggestion" from const char * to name_hint, and rename to "hint".
286 Pass location to lookup_name_fuzzy.
288 2017-11-20 Nathan Sidwell <nathan@acm.org>
292 * call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited
294 * cp-gimplify.c (cp_genericize_r): Restore THUNK dereference
295 inhibibition check removed in previous c++/78495 change.
297 2017-11-20 Jakub Jelinek <jakub@redhat.com>
300 * constexpr.c (cxx_eval_vector_conditional_expression): New function.
301 (cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
302 of cxx_eval_conditional_expression.
304 2017-11-19 Jakub Jelinek <jakub@redhat.com>
308 * cp-gimplify.c (c_fully_fold): Add LVAL argument, call
309 cp_fold_maybe_rvalue instead of cp_fold_rvalue and pass it !LVAL.
311 2017-11-16 Jason Merrill <jason@redhat.com>
313 PR c++/79092 - non-type args of different types are different
314 * tree.c (cp_tree_equal): Check the type of constants.
315 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Handle UNIFY_ALLOW_INTEGER
316 when comparing to previously deduced argument.
317 (maybe_convert_nontype_argument): New.
318 (convert_nontype_argument): Call it.
319 (tsubst_copy_and_build): Handle partial instantiation of
321 (unify): Ignore type when deducing from array bound.
322 (dependent_type_p_r): Handle DEFERRED_NOEXCEPT.
323 (value_dependent_expression_p): Any type-dependent expression is
324 value-dependent. Handle IMPLICIT_CONV_EXPR.
325 * cp-tree.h (IMPLICIT_CONV_EXPR_NONTYPE_ARG): New.
326 * mangle.c (write_template_arg): Strip IMPLICIT_CONV_EXPR.
328 2017-11-16 Nathan Sidwell <nathan@acm.org>
332 * cp-objcp-common.h (LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME):
334 * cp-tree.h (overwrite_mangling): Declare.
335 * decl2.c (struct mangled_decl_hash): Entries are deletable.
336 (overwrite_mangling): New.
339 * decl.c (xref_tag_1): Push lambda into current scope.
340 * name-lookup.c (do_pushtag): Don't deal with ts_lambda here.
342 2017-11-15 Nathan Sidwell <nathan@acm.org>
345 * lambda.c (lambda_capture_field_type): Function references are
346 always catured by reference.
348 2017-11-15 Martin Liska <mliska@suse.cz>
350 * decl.c (begin_destructor_body): Use cp_build_fold_indirect_ref
351 instead of cp_build_indirect_ref.
353 2017-11-15 Martin Liska <mliska@suse.cz>
355 * decl.c (begin_destructor_body): In case of VPTR sanitization
356 (with disabled recovery), zero vptr in order to catch virtual calls
357 after lifetime of an object.
359 2017-11-14 Jason Merrill <jason@redhat.com>
361 Use GTY((cache)) on some hash tables.
362 * decl.c (decomp_type_table): Use tree_cache_map.
363 * init.c (nsdmi_inst): Likewise.
364 * pt.c (defarg_ints): Likewise.
365 * cp-objcp-common.c (cp_get_debug_type): Likewise.
367 2017-11-13 Jason Merrill <jason@redhat.com>
369 Capture adjustments for P0588R1.
370 * semantics.c (process_outer_var_ref): Capture variables when
371 they are named; complain about non-capture uses when odr-used.
372 * expr.c (mark_use): Rvalue use looks through capture proxy.
373 * constexpr.c (potential_constant_expression_1): Improve error about
374 use of captured variable.
375 * lambda.c (need_generic_capture, dependent_capture_r)
376 (do_dependent_capture, processing_nonlambda_template): Remove.
377 * call.c (build_this): Remove uses of the above.
378 * decl.c (cp_finish_decl): Likewise.
379 * semantics.c (maybe_cleanup_point_expr)
380 (maybe_cleanup_point_expr_void, finish_goto_stmt)
381 (maybe_convert_cond): Likewise.
382 * typeck.c (check_return_expr): Likewise.
385 * typeck.c (cp_build_fold_indirect_ref): New.
386 (cp_build_indirect_ref_1): Split out from cp_build_indirect_ref.
387 Add 'fold' parameter.
388 * cp-tree.h: Declare cp_build_fold_indirect_ref.
389 * call.c, class.c, cp-ubsan.c, decl.c, except.c, init.c, lambda.c,
390 parser.c, rtti.c, tree.c, typeck.c, typeck2.c: Use it.
391 * parser.c (do_range_for_auto_deduction): Use RO_UNARY_STAR.
392 (cp_convert_range_for): Likewise.
393 * typeck2.c (build_x_arrow): Use RO_ARROW.
395 * cp-ubsan.c (cp_ubsan_check_member_access_r): Fix handling of
396 INDIRECT_REF of ADDR_EXPR.
398 PR c++/82360 - ICE with static_cast in template.
399 * call.c (perform_direct_initialization_if_possible): Check
400 processing_template_decl.
401 * typeck.c (build_static_cast_1): Likewise.
403 2017-11-13 Ville Voutilainen <ville.voutilainen@gmail.com>
405 Remove the null check from placement new in all modes
406 * init.c (build_new_1): Don't do a null check for
407 a namespace-scope non-replaceable placement new
408 in any mode unless -fcheck-new is provided.
410 2017-11-07 Boris Kolpackov <boris@codesynthesis.com>
412 * Make-lang.in (CP_PLUGIN_HEADERS): Add operators.def since included
415 2017-11-07 Jakub Jelinek <jakub@redhat.com>
418 * cp-gimplify.c (cxx_omp_clause_apply_fn): For methods pass i - 1 to
419 convert_default_arg instead of i.
421 2017-11-06 Jason Merrill <jason@redhat.com>
423 P0704R1 - fixing const-qualified pointers to members
424 * typeck2.c (build_m_component_ref): Also accept in lower stds with
427 2017-11-06 Paolo Carlini <paolo.carlini@oracle.com>
430 * decl2.c (finish_static_data_member_decl): If there's an initializer,
431 complete the type and re-apply the quals.
433 2017-11-06 Martin Liska <mliska@suse.cz>
436 * constexpr.c (cxx_eval_builtin_function_call): Handle
437 __builtin_unreachable call.
438 (get_function_named_in_call): Declare function earlier.
439 (constexpr_fn_retval): Skip __builtin_unreachable.
440 * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Rename to
442 (cp_maybe_instrument_return): ... this.
443 (cp_genericize): Call the function unconditionally.
445 2017-11-03 Nathan Sidwell <nathan@acm.org>
448 * decl.c (grokdeclarator): Protect MAYBE_CLASS things from paren
451 2017-11-02 Paolo Carlini <paolo.carlini@oracle.com>
454 * pt.c (make_pack_expansion): Add tsubst_flags_t parameter.
455 (expand_integer_pack, convert_template_argument, coerce_template_parms,
456 gen_elem_of_pack_expansion_instantiation, tsubst_pack_expansion,
457 unify): Adjust calls.
458 * tree.c (cp_build_qualified_type_real): Likewise.
459 * cp-tree.h (make_pack_expansion): Adjust declaration.
461 2017-11-02 Nathan Sidwell <nathan@acm.org>
463 * cp-tree.h (IDENTIFIER_NEWDEL_OP_P): Restore, adjust.
464 (IDENTIFIER_NEW_OP_P): New.
465 * decl.c (grokdeclarator): Restore IDENTIFIER_NEWDEL_OP_P use.
466 * pt.c (push_template_decl_real): Likewise.
467 * typeck.c (check_return_expr): Use IDENTIFIER_NEW_OP_P.
470 * decl.c (grokdeclarator): Don't warn when parens protect a return
471 type from a qualified name.
473 2017-11-01 Nathan Sidwell <nathan@acm.org>
475 * cp-tree.h (enum cp_identifier_kind): Delete cik_newdel_op.
476 Renumber and reserve udlit value.
477 (IDENTIFIER_NEWDEL_OP_P): Delete.
478 (IDENTIFIER_OVL_OP_P): New.
479 (IDENTIFIER_ASSIGN_OP_P): Adjust.
480 (IDENTIFIER_CONV_OP_P): Adjust.
481 (IDENTIFIER_OVL_OP_INFO): Adjust.
482 (IDENTIFIER_OVL_OP_FLAGS): New.
483 * decl.c (grokdeclarator): Use IDENTIFIER_OVL_OP_FLAGS.
484 * lex.c (get_identifier_kind_name): Adjust.
485 (init_operators): Don't special case new/delete ops.
486 * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_P.
487 * pt.c (push_template_decl_real): Use IDENTIFIER_OVL_OP_FLAGS.
488 * typeck.c (check_return_expr): Likewise.
490 * cp-tree.h (assign_op_identifier, call_op_identifier): Use
492 (struct lang_decl_fn): Use compressed operator code.
493 (DECL_OVERLOADED_OPERATOR_CODE): Replace with ...
494 (DECL_OVERLOADED_OPERATOR_CODE_RAW): ... this.
495 (DECL_OVERLOADED_OPERATOR_CODE_IS): Use it.
496 * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE_RAW.
497 (build_library_fn): Likewise.
498 (grok_op_properties): Likewise.
499 * mangle.c (write_unqualified_name): Likewise.
500 * method.c (implicitly_declare_fn): Likewise.
501 * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_IS.
503 * cp-tree.h (IDENTIFIER_CP_INDEX): Define.
504 (enum ovl_op_flags): Add OVL_OP_FLAG_AMBIARY.
505 (enum ovl_op_code): New.
506 (struct ovl_op_info): Add ovl_op_code field.
507 (ovl_op_info): Size by OVL_OP_MAX.
508 (ovl_op_mapping, ovl_op_alternate): Declare.
509 (OVL_OP_INFO): Adjust for mapping array.
510 (IDENTIFIER_OVL_OP_INFO): New.
511 * decl.c (ambi_op_p, unary_op_p): Delete.
512 (grok_op_properties): Use IDENTIFIER_OVL_OP_INFO and
514 * lex.c (ovl_op_info): Adjust and static initialize.
515 (ovl_op_mappings, ovl_op_alternate): Define.
516 (init_operators): Iterate over ovl_op_info array and init mappings
518 * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_INFO.
519 * operators.def (DEF_OPERATOR): Remove KIND parm.
520 (DEF_SIMPLE_OPERATOR): Delete.
521 (OPERATOR_TRANSITION): Expand if defined.
523 2017-10-31 David Malcolm <dmalcolm@redhat.com>
525 * pt.c (listify): Use %< and %> for description of #include.
527 2017-10-31 David Malcolm <dmalcolm@redhat.com>
529 * class.c (explain_non_literal_class): Use UNKNOWN_LOCATION rather
531 * name-lookup.c (suggest_alternatives_for): Update for renaming of
533 (maybe_suggest_missing_header): Likewise.
534 (suggest_alternative_in_explicit_scope): Likewise.
535 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise for
536 renaming of error_at_rich_loc.
537 (cp_parser_string_literal): Likewise.
538 (cp_parser_nested_name_specifier_opt): Likewise.
539 (cp_parser_cast_expression): Likewise for renaming of
541 (cp_parser_decl_specifier_seq): Likewise for renaming of
542 error_at_rich_loc and warning_at_rich_loc.
543 (cp_parser_elaborated_type_specifier): Likewise for renaming of
545 (cp_parser_cv_qualifier_seq_opt): Likewise for renaming of
547 (cp_parser_virt_specifier_seq_opt): Likewise.
548 (cp_parser_class_specifier_1): Likewise.
549 (cp_parser_class_head): Likewise.
550 (cp_parser_member_declaration): Likewise for renaming of
551 pedwarn_at_rich_loc, warning_at_rich_loc, and error_at_rich_loc.
552 (cp_parser_enclosed_template_argument_list): Likewise for renaming
553 of error_at_rich_loc.
554 (set_and_check_decl_spec_loc): Likewise.
555 * pt.c (listify): Likewise.
556 * rtti.c (typeid_ok_p): Likewise.
557 * semantics.c (process_outer_var_ref): Use UNKNOWN_LOCATION rather
559 * typeck.c (access_failure_info::maybe_suggest_accessor): Update
560 for renaming of inform_at_rich_loc.
561 (finish_class_member_access_expr): Likewise for renaming of
564 2017-10-31 Nathan Sidwell <nathan@acm.org>
566 * cp-tree.h (struct operator_name_info_t): Rename to ...
567 (struct ovl_op_info_t): ... here. Add tree_code field.
568 (operator_name_info, assignment_operator_name_info): Delete.
569 (ovl_op_info): Declare.
570 (OVL_OP_INFO): Adjust.
571 * decl.c (grok_op_properties): Use ovl_op_flags.
572 * lex.c (operator_name_info, assignment_operator_name_info):
574 (ovl_op_info): Define.
575 (set_operator_ident): Adjust.
576 (init_operators): Set tree_code.
577 * mangle.c (write_unqualified_id): Adjust operator array scan.
579 * lex.c (init_operators): Allow NULL operator name. Don't add
581 * operators.def: Use NULL for mangling only operators. Move to
582 after regular operators but move assignment operators last.
584 * cp-tree.h (enum ovl_op_flags): New.
585 (struct operator_name_info_t): Rename arity to flags.
586 * lex.c (set_operator_ident): New.
587 (init_operators): Use it. Adjust for flags.
588 * mangle.c (write_unqualified_id): Adjust for flags.
589 * operators.def: Replace arity with flags.
591 * cp-tree.h (ovl_op_identifier): New.
592 (assign_op_identifier, call_op_identifier): Adjust.
593 (cp_operator_id, cp_assignment_operator_ide): Delete.
594 (SET_OVERLOADED_OPERATOR_CODE): Delete.
596 * call.c (op_error): Use OVL_OP_INFO.
597 (build_conditional_expr_1): Use ovl_op_identifier.
598 (build_new_op_1): Use OVL_OP_INFO & ovl_op_identifier.
599 (build_op_delete_call): Likewise.
600 * class.c (type_requires_array_cookie): Use ovl_op_identifier.
601 * decl.c (duplicate_decls): Directly copy operator code.
602 (builtin_function_1): Do not set operator code.
603 (build_library_fn): Directly set operator code.
604 (push_cp_library_fn): Use ovl_op_identifier.
605 (grok_op_properties): Directly set operator code.
606 * decl2.c (maybe_warn_sized_delete): Use ovl_op_identifier.
607 * error.c (dump_expr): Use OVL_OP_INFO.
608 (op_to_string): Add assop arg. Use OVL_OP_INFO.
609 (assop_to_string): Delete.
610 (args_to_string): Adjust.
611 * init.c (build_new_1): Use ovl_op_identifier.
612 * mangle.c (write_unqualified_name): Use OVL_OP_INFO.
613 (write_expression): Likewise.
614 * method.c (synthesized_method_walk): Use ovl_op_identifier.
615 (implicitly_declare_fn): Use assign_op_identifier. Directly set
617 * name-lookup.c (get_class_binding): Use assign_op_identifier.
618 * parser.c (cp_parser_operator): Use ovl_op_identifier.
619 (cp_parser_omp_clause_reduction): Likewise.
620 * semantics.c (omp_reduction_id): Likewise.
621 * typeck.c (cxx_sizeof_or_alignof_type): Use OVL_OP_INFO.
623 * cp-tree.h (assign_op_identifier, call_op_identifier): Define.
624 (LAMBDA_FUNCTION_P): Use DECL_OVERLOADED_OPERATOR_IS.
625 (DECL_OVERLOADED_OPERATOR_P): Just retuurn true/false.
626 (DECL_OVERLOADED_OPERATOR_CODE, DECL_OVERLOADED_OPERATOR_IS): Define.
627 * call.c (add_function_candidate): Use
628 DECL_OVERLOADED_OPERATOR_IS.
629 (build_op_call_1): Use call_op_identifier &
630 DECL_OVERLOADED_OPERATOR_IS.
631 (build_over_call): Likewise.
632 (has_trivial_copy_assign_p): Use assign_op_identifier.
633 (build_special_member_call): Likewise.
634 * class.c (dfs_declare_virt_assop_and_dtor): Likewise.
635 (vbase_has_user_provided_move_assign,
636 classtype_has_move_assign_or_move_ctor_p): Likewise.
637 * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE.
638 (grok_special_member_properties): Use assign_op_identifier.
639 (start_preparsed_function): Use DECL_OVERLOADED_OPERATOR_IS.
640 * decl2.c (mark_used): Use DECL_CONV_FN_P.
641 * dump.c (dump_access): Delete prototype.
643 (cp_dump_tree): Don't call it.
644 * lambda.c (lambda_function): Use call_op_identifier.
645 (maybe_add_lambda_conv_op): Not an overloaded operator. Remove
647 * mangle.c (write_unqualified_name): Use DECL_OVERLOADED_OPERTOR_CODE.
648 * method.c (do_build_copy_assign): Use assign_op_identifier.
649 (synthesize_method): Use DECL_OVERLOADED_OPERATOR_IS.
650 (get_copy_assign): Use assign_op_identifier.
651 (synthesized_method_walk): Likewise.
652 (defaultable_fn_check): Use DECL_OVERLOADED_OPERATOR_IS.
653 * parser.c (cp_parser_lambda_declarator_opt): Use
655 * semanitics.c (classtype_has_nothrow_assign_or_copy_p): Use
656 assign_op_identifier.
657 * tree.c (special_function_p): Use DECL_OVERLOADED_OPERATOR_IS.
658 * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_CODE.
659 (check_return_expr): Use assign_op_identifier.
661 2017-10-30 Paolo Carlini <paolo.carlini@oracle.com>
664 * pt.c (tsubst_copy_and_build, [INDIRECT_REF]): For a REFERENCE_REF_P,
665 unconditionally call convert_from_reference.
667 2017-10-30 Nathan Sidwell <nathan@acm.org>
669 * call.c (build_op_call_1): Test for FUNCTION_DECL in same manner
670 as a few lines earlier.
671 * cp-tree.h (PACK_EXPANSION_PATTERN): Fix white space.
672 * decl.c (grokfndecl): Fix indentation.
673 (compute_array_index_type): Use processing_template_decl_sentinel.
674 (grok_op_properties): Move warnings to end. Reorder other checks
675 to group similar entities. Tweak diagnostics.
676 * lex.c (unqualified_name_lookup_error): No need to check name is
677 not ERROR_MARK operator.
678 * parser.c (cp_parser_operator): Select operator code before
680 * typeck.c (check_return_expr): Fix indentation and line wrapping.
682 2017-10-27 Paolo Carlini <paolo.carlini@oracle.com>
684 * pt.c (invalid_nontype_parm_type_p): Return a bool instead of an int.
686 2017-10-26 Nathan Sidwell <nathan@acm.org>
688 * decl.c (sort_labels): Restore function.
689 (pop_labels): Sort labels
690 (identify_goto): Add translation markup.
692 2017-10-25 Nathan Sidwell <nathan@acm.org>
694 Kill IDENTIFIER_LABEL_VALUE.
695 * cp-tree.h (lang_identifier): Delete label_value slot.
696 (IDENTIFIER_LABEL_VALUE, SET_IDENTIFIER_LABEL_VALUE): Delete.
697 (struct named_label_hasher): Rename to ...
698 (struct named_label_hash): ... here. Reimplement.
699 (struct language_function): Adjust x_named_labels.
700 * name-lookup.h (struct cp_label_binding): Delete.
701 (struct cp_binding_level): Delete shadowed_labels slot.
702 * decl.c (struct named_label_entry): Add name and outer slots.
703 (pop_label): Rename to ...
704 (check_label_used): ... here. Don't pop.
705 (note_label, sort_labels): Delete.
706 (pop_labels, pop_local_label): Reimplement.
707 (poplevel): Pop local labels as any other decl. Remove
708 shadowed_labels handling.
709 (named_label_hash::hash, named_label_hash::equal): New.
710 (make_label_decl): Absorb into ...
711 (lookup_label_1): ... here. Add making_local_p arg, reimplement.
712 (lookup_label, declare_local_label): Adjust.
713 (check_goto, define_label): Adjust.
714 * lex.c (make_conv_op_name): Don't clear IDENTIFIER_LABEL_VALUE.
715 * ptree.c (cxx_print_identifier): Don't print identifier binding.
717 * decl.c (identifier_goto): Reduce duplication.
718 (check_previous_goto_1): Likewise.
719 (check_goto): Move var decls to initialization.
720 (check_omp_return, define_label_1, define_label): Likewise.
722 2017-10-25 Jakub Jelinek <jakub@redhat.com>
725 * decl.c (duplicate_decls): Copy "omp declare simd" attributes from
726 newdecl to corresponding __builtin_ if any.
728 2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
731 * decl.c (duplicate_decls): Warn for built-in functions declared as
732 non-function, use OPT_Wbuiltin_declaration_mismatch.
734 * decl.c (duplicate_decls): Avoid redundant '+' in warning_at.
736 2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
739 * pt.c (value_dependent_expression_p, [TRAIT_EXPR]): Handle
740 a TREE_LIST as TRAIT_EXPR_TYPE2.
742 2017-10-24 Mukesh Kapoor <mukesh.kapoor@oracle.com>
743 Paolo Carlini <paolo.carlini@oracle.com>
746 * cvt.c (type_promotes_to): Implement C++17, 7.6/4, about unscoped
747 enumeration type whose underlying type is fixed.
749 2017-10-23 Paolo Carlini <paolo.carlini@oracle.com>
752 * semantics.c (finish_compound_literal): Check do_auto_deduction
753 return value for error_mark_node.
755 2017-10-23 Jason Merrill <jason@redhat.com>
757 PR c++/77369 - wrong noexcept handling in C++14 and below
758 * tree.c (strip_typedefs): Canonicalize TYPE_RAISES_EXCEPTIONS.
760 2017-10-20 Nathan Sidwell <nathan@acm.org>
762 * class.c (layout_class_type): Cleanup as-base creation, determine
764 (finish_struct_1): ... not here.
766 2017-10-19 Jakub Jelinek <jakub@redhat.com>
769 * typeck.c (check_return_expr): Don't call
770 maybe_warn_about_returning_address_of_local in templates.
772 2017-10-17 Nathan Sidwell <nathan@acm.org>
775 * call.c (build_over_call): Don't pass tf_no_cleanup to nested
779 * cp-objcp-common.c (cp_tree_size): Reformat. Adjust returns size
782 2017-10-13 Jason Merrill <jason@redhat.com>
784 PR c++/82357 - bit-field in template
785 * tree.c (cp_stabilize_reference): Just return a NON_DEPENDENT_EXPR.
787 2017-10-13 David Malcolm <dmalcolm@redhat.com>
789 * cp-tree.h (maybe_show_extern_c_location): New decl.
790 * decl.c (grokfndecl): When complaining about literal operators
791 with C linkage, issue a note giving the location of the
793 * parser.c (cp_parser_new): Initialize new field
794 "innermost_linkage_specification_location".
795 (cp_parser_linkage_specification): Store the location
796 of the linkage specification within the cp_parser.
797 (cp_parser_explicit_specialization): When complaining about
798 template specializations with C linkage, issue a note giving the
799 location of the extern "C".
800 (cp_parser_explicit_template_declaration): Likewise for templates.
801 (maybe_show_extern_c_location): New function.
802 * parser.h (struct cp_parser): New field
803 "innermost_linkage_specification_location".
805 2017-10-12 Nathan Sidwell <nathan@acm.org>
807 * cp-tree.h (cp_expr): Add const operator * and operator->
809 (cp_tree_node_structure_enum): Delete TS_CP_BINDING,
810 TS_CP_WRAPPER, LAST_TS_CP_ENUM.
812 2017-10-12 David Malcolm <dmalcolm@redhat.com>
814 * parser.c (get_required_cpp_ttype): New function.
815 (cp_parser_error_1): Call it, using the result to call
816 maybe_suggest_missing_token_insertion.
818 2017-10-12 David Malcolm <dmalcolm@redhat.com>
820 * parser.c (get_matching_symbol): Move to before...
821 (cp_parser_error): Split out into...
822 (cp_parser_error_1): ...this new function, merging in content
824 (cp_parser_required_error): ...here. Eliminate partial duplicate
825 of body of cp_parser_error in favor of a call to the new
826 cp_parser_error_1 helper function.
828 2017-10-11 Nathan Sidwell <nathan@acm.org>
830 * decl2.c (struct mangled_decl_hash): Use DECL_ASSEMBLER_NAME_RAW.
831 (record_mangling): Likewise.
833 2017-10-10 Nathan Sidwell <nathan@acm.org>
835 * name-lookup.c (extern_c_fns): Rename to ...
836 (extern_c_decls): ... here.
837 (check_extern_c_conflict, extern_c_linkage_bindings): Update.
838 (do_pushdecl): Check extern-c fns and vars.
840 * cp-tree.h (default_hash_traits <lang_identifier *>): Delete
843 * decl2.c (struct mangled_decl_hash): New hash traits.
844 (mangled_decls): Make hash_table<mangled_decl_hash>.
845 (generate_mangling_alias, record_mangling): Adjust.
847 2017-10-10 Jason Merrill <jason@redhat.com>
849 More delayed lambda capture fixes.
850 * call.c (add_function_candidate): Use build_address.
851 (build_op_call_1): Call mark_lvalue_use early.
852 (build_over_call): Handle error from build_this.
853 * constexpr.c (cxx_bind_parameters_in_call): Use build_address.
854 (cxx_eval_increment_expression): Don't use rvalue().
855 * cvt.c (convert_to_void): Use mark_discarded_use.
856 * expr.c (mark_use): Handle PARM_DECL, NON_DEPENDENT_EXPR. Fix
857 reference handling. Don't copy the expression.
858 (mark_discarded_use): New.
859 * lambda.c (insert_capture_proxy): Add some sanity checking.
860 (maybe_add_lambda_conv_op): Set cp_unevaluated_operand.
861 * pt.c (register_local_specialization): Add sanity check.
862 * semantics.c (process_outer_var_ref): Fix check for existing proxy.
863 * typeck.c (cp_build_addr_expr_1): Handle error from
865 (cp_build_modify_expr): Call mark_lvalue_use_nonread, handle error
868 Handle generic lambda capture in dependent expressions.
869 * lambda.c (need_generic_capture, dependent_capture_r)
870 (do_dependent_capture): New.
871 * pt.c (processing_nonlambda_template): Use need_generic_capture.
872 * semantics.c (maybe_cleanup_point_expr)
873 (maybe_cleanup_point_expr_void, finish_goto_stmt)
874 (maybe_convert_cond): Call do_dependent_capture.
875 * typeck.c (build_static_cast): Remove dependent capture handling.
877 * typeck.c (condition_conversion): Assert !processing_template_decl.
878 * semantics.c (finish_omp_clauses): Don't
879 fold_build_cleanup_point_expr if processing_template_decl.
880 (outer_var_p): A temporary can't be from an outer scope.
881 * pt.c (type_dependent_expression_p): Fix dependency checking of
882 functions without DECL_TEMPLATE_INFO.
883 (instantiate_decl): Use lss_copy.
884 * constexpr.c (is_valid_constexpr_fn): Fix lambdas before C++17.
886 * typeck.c (check_return_expr): Check non-dependent conversion in
888 * constraint.cc (check_function_concept): Don't complain about an
889 empty concept if seen_error.
891 2017-10-10 Richard Sandiford <richard.sandiford@linaro.org>
893 * cvt.c (ignore_overflows): Use wi::to_wide when
894 operating on trees as wide_ints.
895 * decl.c (check_array_designated_initializer): Likewise.
896 * mangle.c (write_integer_cst): Likewise.
897 * semantics.c (cp_finish_omp_clause_depend_sink): Likewise.
899 2017-10-10 Nathan Sidwell <nathan@acm.org>
901 * name-lookup.c (set_global_binding): Don't deal with STAT_HACK.
903 2017-10-06 Paolo Carlini <paolo.carlini@oracle.com>
906 * decl.c (finish_function): Take a bool intead of an int; adjust.
907 * cp-tree.h (finish_function): Adjust declaration.
908 * decl2.c (generate_tls_wrapper, finish_objects,
909 finish_static_storage_duration_function): Adjust calls.
910 * lambda.c (maybe_add_lambda_conv_op, finish_lambda_function):
912 * method.c (synthesize_method): Likewise.
913 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
914 * pt.c (instantiate_decl): Likewise.
915 * parser.c (cp_parser_function_definition_after_declarator,
916 cp_parser_late_parsing_for_member, cp_parser_omp_declare_reduction):
918 (cp_parser_ctor_initializer_opt,
919 cp_parser_ctor_initializer_opt_and_function_body,
920 cp_parser_function_try_block,
921 cp_parser_function_definition_after_declarator,
922 cp_parser_function_transaction): Return void; adjust declarations.
924 2017-10-06 Nathan Sidwell <nathan@acm.org>
927 * name-lookup.c (check_local_shadow): Don't try and convert
930 2017-10-06 Jakub Jelinek <jakub@redhat.com>
933 * decl.c (reshape_init): Suppress warn_useless_cast for direct enum
935 * typeck.c (convert_for_assignment): Likewise.
937 P0704R1 - fixing const-qualified pointers to members
938 * typeck2.c (build_m_component_ref): For -std=c++2a allow
939 pointer to const & qualified method on rvalue.
941 2017-10-06 Nathan Sidwell <nathan@acm.org>
943 Use hash_table for extern "C" names
944 * name-lookup.c (extern_c_fns): Use hash_table.
945 (check_extern_c_conflict): Adjust.
946 (c_linkage_bindings): Adjust.
948 Use hash_table for namespace bindings
949 * cp-tree.h (struct named_decl_hash): New.
950 (lang_decl_ns): Change type of bindings field.
951 * lex.c (maybe_add_lang_decl_raw): Adjust.
952 * name-lookup.c (find_namespace_slot): Adjust.
953 (do_pushdecl): Push NULL-named namespace.
954 (do_push_nested_namespace): Adjust.
955 (push_namespace): Push anonymous namespace as NULL name.
957 2017-10-05 Jason Merrill <jason@redhat.com>
959 Pass variadic class objects exactly like named by-value args.
960 * call.c (convert_arg_to_ellipsis): Use the result of force_rvalue.
962 2017-10-05 Nathan Sidwell <nathan@acm.org>
964 Warn on MVP declarations
965 * cp-tree.h (struct cp_declarator): Add parenthesized field.
966 * decl.c (grokdeclarator): Warn about unnecessary parens.
967 * parser.c (make_declarator): Init parenthesized field.
968 (cp_parser_direct_declarator): Set parenthesized field.
970 Kill IDENTIFIER_GLOBAL_VALUE, SET_IDENTIFIER_GLOBAL_VALUE
971 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
972 SET_IDENTIFIER_GLOBAL_VALUE): Delete.
973 * name-lookup.h (set_global_binding): Remove NAME parm.
974 (get_global_binding): New inline fn.
975 * name-lookup.c (set_global_binding): Remove NAME parm. Adjust.
976 (identifier_global_value): Move to ...
977 * cp-objcp-common.c (identifier_global_value): ... here.
978 * class.c (build_ctor_vtbl_group, build_vtbl_initializer): Adjust.
979 * decl.c (record_builtin_type, expand_static_init,
980 grokdeclarator): Adjust.
981 * decl2.c (get_guard, get_local_tls_init_fn, get_tls_init_fn,
982 get_tls_wrapper_fn, maybe_warn_sized_delete): Adjust.
983 * except.c (declare_library_fn, build_throw): Adjust.
984 * init.c (throw_bad_array_length): Adjust.
985 * rtti.c (throw_bad_cast, throw_bad_typeid, get_tinfo_decl): Adjust.
987 * decl2.c (record_mangling): Fix spello and formatting from
990 2017-10-04 Nathan Sidwell <nathan@acm.org>
992 Give builtin types the correct name.
993 * name-lookup.c (set_global_binding): Assert name is DECL_NAME.
994 * decl.c (record_builtin_type): Reimplement, use new TYPE_DECL for
997 2017-10-04 Paolo Carlini <paolo.carlini@oracle.com>
998 Andrew Pinski <apinski@cavium.com>
1001 * parser.c (cp_parser_lambda_body): Set parser->in_function_body.
1003 2017-10-04 Nathan Sidwell <nathan@acm.org>
1005 Move mangling aliases out of global namespace.
1006 * cp-tree.h (record_mangling): New.
1007 (maybe_remove_implicit_alias): Delete.
1008 * decl2.c (mangled_decls): New hash map.
1009 (generate_mangling_alias): Reimplement using mangled_decls.
1010 (record_mangling): New.
1011 * mangle.c (decl_implicit_alias_p,
1012 maybe_remove_implicit_alias): Delete.
1013 (mangle_decl): Use record_mangling.
1014 * name-lookup.c (supplement_binding_1): Remove
1015 maybe_remove_implicit_alias check.
1017 2017-10-04 Jakub Jelinek <jakub@redhat.com>
1020 * error.c (dump_function_decl): If show_return, call dump_type_suffix
1021 on the same return type dump_type_prefix has been called on.
1023 2017-10-04 Jason Merrill <jason@redhat.com>
1025 PR c++/81525 - broken handling of auto in generic lambda.
1026 * pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.
1028 2017-10-04 Nathan Sidwell <nathan@acm.org>
1030 * call.c (convert_arg_to_ellipsis): Correct comment about passing
1033 2017-10-02 Richard Sandiford <richard.sandiford@linaro.org>
1035 * constexpr.c (cxx_eval_store_expression): Use wi::to_widest
1036 when comparing the array bounds with an ARRAY_REF index.
1038 2017-09-30 Paolo Carlini <paolo.carlini@oracle.com>
1041 * method.c (defaulted_late_check): Early return if the defaulted
1042 declaration does not match the expected signature.
1044 2017-09-29 Jakub Jelinek <jakub@redhat.com>
1046 P0683R1 - default member initializers for bit-fields
1047 * cp-tree.h (grokbitfield): Add INIT parameter.
1048 * parser.c (cp_parser_constant_expression): Add STRICT_P argument,
1049 if true, parse a conditional-expression rather than
1050 assignment-expression.
1051 (cp_parser_member_declaration): For C++11 and later pass true
1052 as STRICT_P to cp_parser_constant_expression. Parse C++2A bitfield
1053 NSDMIs. Adjust grokbitfield caller. Handle DECL_INITIAL also for
1055 (cp_parser_objc_class_ivars): Adjust grokbitfield caller.
1056 * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs.
1057 (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs.
1058 * decl2.c (grokbitfield): Add INIT parameter, pass it to
1060 * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not
1063 * class.c (check_bitfield_decl): Retrieve and clear width from
1064 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
1065 (check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than
1067 (remove_zero_width_bit_fields): Adjust comment.
1068 * decl2.c (grokbitfield): Stash width into
1069 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
1070 * pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr
1071 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width.
1073 * parser.c (cp_parser_member_declaration): Parse attributes before
1074 colon of a bitfield in addition to after colon.
1076 * Make-lang.in (check-c++-all): Test also c++2a.
1078 2017-09-28 Jason Merrill <jason@redhat.com>
1080 PR c++/56973, DR 696 - capture constant variables only as needed.
1081 * expr.c (mark_use): Split out from mark_rvalue_use and
1082 mark_lvalue_use. Handle lambda capture of constant variables.
1083 (mark_lvalue_use_nonread): New.
1084 * semantics.c (process_outer_var_ref): Don't capture a constant
1085 variable until forced.
1086 * pt.c (processing_nonlambda_template): New.
1087 * call.c (build_this): Check it.
1088 * decl2.c (grok_array_decl): Call mark_rvalue_use and
1089 mark_lvalue_use_nonread.
1090 * init.c (constant_value_1): Don't call mark_rvalue_use.
1091 * typeck.c (build_static_cast): Handle lambda capture.
1093 Use local_specializations to find capture proxies.
1094 * cp-tree.h (DECL_CAPTURED_VARIABLE): New.
1095 * lambda.c (build_capture_proxy): Set it.
1096 (add_capture): Pass initializer to build_capture_proxy.
1097 (start_lambda_function): Likewise.
1098 (insert_capture_proxy): Use register_local_specialization.
1099 (is_lambda_ignored_entity): Always ignore proxies.
1100 * name-lookup.c (qualify_lookup): Don't check
1101 is_lambda_ignored_entity if LOOKUP_HIDDEN is set.
1102 * semantics.c (process_outer_var_ref): Use
1103 retrieve_local_specialization.
1104 * parser.c (cp_parser_lambda_body): Push local_specializations.
1105 * pt.c (tsubst_expr): Pass LOOKUP_HIDDEN when looking for a proxy.
1106 (tsubst_lambda_expr): Push local_specializations sooner.
1107 (tsubst_copy_and_build): Don't register_local_specialization.
1109 * call.c (build_special_member_call): Use the return value of
1111 * decl.c (compute_array_index_type): Likewise.
1112 * parser.c (cp_parser_oacc_wait_list): Likewise.
1113 * lambda.c (is_normal_capture_proxy): Handle *this capture.
1114 (add_capture): Clarify internal_error message.
1116 2017-09-22 Eric Botcazou <ebotcazou@adacore.com>
1119 * cp-objcp-common.c (cp_get_debug_type): Do only one lookup.
1121 2017-09-22 Jakub Jelinek <jakub@redhat.com>
1124 * tree.c (struct replace_placeholders_t): Add pset field.
1125 (replace_placeholders_r): Call cp_walk_tree with d->pset as
1126 last argument instead of NULL. Formatting fix.
1127 (replace_placeholders): Add pset variable, add its address
1128 into data. Pass &pset instead of NULL to cp_walk_tree.
1130 2017-09-22 David Malcolm <dmalcolm@redhat.com>
1132 * call.c (get_fndecl_argument_location): New function.
1133 (convert_like_real): Use it when complaining about argument type
1135 * cp-tree.h (struct cp_parameter_declarator): Add "loc" field.
1136 * parser.c (make_parameter_declarator): Add "loc" param and use
1137 it to initialize the new field.
1138 (cp_parser_translation_unit): Add UNKNOWN_LOCATION for "loc" of
1139 the "no_parameters" parameter.
1140 (cp_parser_parameter_declaration_list): Set the location of the
1141 result of grokdeclarator to be the parameter's loc, assuming no
1143 (cp_parser_parameter_declaration): Generate a location for the
1144 parameter and pass to make_parameter_declarator.
1146 2017-09-20 Nathan Sidwell <nathan@acm.org>
1148 * name-lookup.c (member_name_cmp): Use DECL_UID for final
1151 2017-09-20 Jakub Jelinek <jakub@redhat.com>
1153 P0409R2 - allow lambda capture [=, this]
1154 * parser.c (cp_parser_lambda_introducer): For cxx2a don't pedwarn on
1155 redundant [=, this].
1157 2017-09-18 Jason Merrill <jason@redhat.com>
1159 PR c++/82069 - ICE with lambda in template
1160 * semantics.c (process_outer_var_ref): Check uses_template_parms
1161 instead of any_dependent_template_arguments_p.
1163 2017-09-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1164 Paolo Carlini <paolo.carlini@oracle.com>
1167 * decl2.c (finish_anon_union): Complain about "anonymous union with
1168 no members" with a pedwarn.
1170 2017-09-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
1172 * typeck.c (build_reinterpret_cast_1,
1173 build_const_cast_1): Implement -Wcast-align=strict.
1175 2017-09-15 Jakub Jelinek <jakub@redhat.com>
1177 * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
1178 adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
1179 to C++17 or -std=gnu++17 or -std=c++17. Adjust comments.
1180 (cxx_init_decl_processing, next_initializable_field,
1181 is_direct_enum_init, check_initializer, cp_finish_decl,
1182 mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
1183 finish_function): Likewise.
1184 * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
1185 * pt.c (mark_template_parm, convert_nontype_argument,
1186 instantiate_class_template_1, type_unification_real, unify,
1187 get_partial_spec_bindings, dependent_type_p_r): Likewise.
1188 * typeck.c (cp_build_unary_op): Likewise.
1189 * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
1190 * call.c (build_user_type_conversion_1, build_over_call,
1191 build_special_member_call): Likewise.
1192 * lambda.c (begin_lambda_type): Likewise.
1193 * typeck2.c (process_init_constructor_record): Likewise.
1194 * class.c (build_base_field, finalize_literal_type_property,
1195 explain_non_literal_class): Likewise.
1196 * parser.c (cp_parser_diagnose_invalid_type_name,
1197 cp_parser_primary_expression, cp_parser_lambda_introducer,
1198 cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
1199 cp_convert_range_for, cp_parser_perform_range_for_lookup,
1200 cp_parser_decomposition_declaration, cp_parser_linkage_specification,
1201 cp_parser_static_assert, cp_parser_simple_type_specifier,
1202 cp_parser_namespace_definition, cp_parser_using_declaration,
1203 cp_parser_init_declarator, cp_parser_type_parameter_key,
1204 cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
1205 cp_parser_constructor_declarator_p): Likewise.
1206 * mangle.c (struct globals): Rename need_cxx1z_warning to
1208 (write_exception_spec, start_mangling, mangle_decl): Likewise.
1209 * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
1211 (check-c++17): New goal. Use 17 instead of 1z.
1212 (check-c++-all): Use 17 instead of 1z.
1214 2017-09-14 Jakub Jelinek <jakub@redhat.com>
1217 * cp-gimplify.c (omp_var_to_track): Look through references.
1218 (omp_cxx_notice_variable): Likewise.
1220 2017-09-13 Nathan Sidwell <nathan@acm.org>
1222 Conv-op identifers not in identifier hash table
1223 * lex.c (conv_type_hasher): Make member fns inline.
1224 (make_conv_op_name): Directly clone conv_op_identifier.
1226 Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
1227 * cp-tree.h (struct lang_type): Rename methods to members.
1228 (CLASSTYPE_METHOD_VEC): Rename to ...
1229 (CLASSTYPE_MEMBER_VEC): ... this.
1230 * name-lookup.h (get_method_slot): Rename to ...
1231 (get_member_slot): ... this.
1232 (resort_type_method_vec): Rename to ...
1233 (resort_type_member_vec): ... this.
1234 * class.c (add_method, warn_hidden): Adjust.
1235 * search.c (dfs_locate_field_accessor_pre): Adjust.
1236 * name-lookup.c (method_vec_binary_search): Rename to ...
1237 (member_vec_binary_search): ... this and adjust.
1238 (method_vec_linear_search): Rename to ...
1239 (member_vec_linear_search): ... this and adjust.
1240 (fields_linear_search, get_class_binding_direct): Adjust.
1241 (get_method_slot): Rename to ...
1242 (get_member_slot): ... this and adjust.
1243 (method_name_slot): Rename to ...
1244 (member_name_slot): ... this and adjust.
1245 (resort_type_method_vec): Rename to ...
1246 (resort_type_member_vec): ... this and adjust.
1247 (method_vec_append_class_fields): Rename to ...
1248 (member_vec_append_class_fields): ... this and adjust.
1249 (method_vec_append_enum_values): Rename to ...
1250 (member_vec_append_enum_values): ... this and adjust.
1251 (method_vec_dedup): Rename to ...
1252 (member_vec_dedup): ... this and adjust.
1253 (set_class_bindings, insert_late_enum_def_bindings): Adjust.
1255 2017-09-12 Paolo Carlini <paolo.carlini@oracle.com>
1258 * decl.c (start_decl): Early return error_mark_node if duplicate_decls
1259 returns it; avoid misleading error message.
1261 2017-09-12 Nathan Sidwell <nathan@acm.org>
1263 Kill CLASSTYPE_SORTED_FIELDS.
1264 * cp-tree.h (struct lang_type): Lose sorted_fields member.
1265 (CLASSTYPE_SORTED_FIELDS): Delete.
1266 * name-lookup.h (set_class_bindings): Add EXTRA arg.
1267 * name-lookup.c (fields_linear_search): New, broken out of ...
1268 (lookup_field_1): ... here. Delete remainder of function.
1269 (get_class_binding_direct): Reimplement without sorted_fields.
1270 (get_class_binding): Rename TYPE arg to KLASS, for consistency.
1271 (get_method_slot): Call set_class_binding when creating method_vec
1273 (method_name_cmp): Order identically named slots.
1274 (sorted_fields_type_new): Delete.
1275 (field_vc_append_class_fields): Rename to ...
1276 (method_vec_append_class_fields): ... here. Adjust.
1277 (field_vec_append_enum_values): Renme to ...
1278 (method_vec_append_enum_values): ... here. Adjust.
1279 (method_vec_dedup): New.
1280 (set_class_bindings): Reimplement.
1281 (insert_late_enum_def_bindings): Reimplement.
1283 * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
1285 (restort_data): Move later.
1286 (method_name_cmp, resort_method_name_cmp): Simplify.
1287 (resort_type_method_vec): Reformat.
1289 2017-09-09 Jason Merrill <jason@redhat.com>
1291 * constexpr.c (reduced_constant_expression_p): If
1292 CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
1294 2017-09-09 Eric Botcazou <ebotcazou@adacore.com>
1297 * cp-objcp-common.c (struct debug_type_hasher): New class.
1298 (debug_type_hash): New variable.
1299 (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
1301 2017-09-08 Jason Merrill <jason@redhat.com>
1303 PR c++/70029 - ICE with ref-qualifier and -flto
1304 * tree.c (cxx_copy_lang_qualifiers): New.
1305 * cp-tree.h: Declare it.
1306 * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
1308 2017-09-06 Jason Merrill <jason@redhat.com>
1310 PR c++/82053 - ICE with default argument in lambda in template
1311 * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
1313 (retrieve_specialization): Use lambda_fn_in_template_p.
1314 * cp-tree.h: Declare it.
1316 PR c++/82070 - error with nested lambda capture
1317 * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
1318 register_local_specialization.
1320 2017-09-06 Nathan Sidwell <nathan@acm.org>
1322 * name-lookup.h (lookup_field_1): Delete.
1323 (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
1324 * name-lookup.c (lookup_field_1): make static
1325 (method_vec_binary_search, method_vec_linear_search): New. Broken
1327 (get_class_binding_direct): ... here. Add TYPE_OR_FNS argument.
1328 Do complete search of this level.
1329 (get_class_binding): Adjust.
1330 * decl.c (reshape_init_class): Call get_class_binding.
1331 * search.c (lookup_field_r): Move field searching into
1332 get_class_binding_direct.
1334 * class.c (warn_hidden): Don't barf on non-functions.
1335 * decl2.c (check_classfn): Likewise. Check template match earlier.
1337 * name-lookup.c (count_fields): Rename to ...
1338 (count_class_fields): ... here. Take a class, don't count
1340 (add_fields_to_record_type): Rename to ...
1341 (field_vec_append_class_fields): ... here. Take a class, don't
1342 add NULL-named fields.
1343 (add_enum_fields_to_record_type): Rename to ...
1344 (field_vec_append_enum_values): ... here.
1345 (set_class_bindings): Adjust, assert we added expected number.
1346 (insert_late_enum_def_bindings): Reimplement. Create vector if
1347 there are now sufficient entries.
1349 * name-lookup.h (lookup_fnfields_slot_nolazy,
1350 lookup_fnfields_slot): Rename to ...
1351 (get_class_binding_direct, get_class_binding): ... here.
1352 * name-lookup.c (lookup_fnfields_slot_nolazy,
1353 lookup_fnfields_slot): Rename to ...
1354 (get_class_binding_direct, get_class_binding): ... here.
1355 * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
1356 * call.c (build_user_type_conversion_1): Adjust.
1357 (has_trivial_copy_assign_p): Adjust.
1358 (has_trivial_copy_p): Adjust.
1359 * class.c (get_basefndecls) Adjust.
1360 (vbase_has_user_provided_move_assign) Adjust.
1361 (classtype_has_move_assign_or_move_ctor_p): Adjust.
1362 (type_build_ctor_call, type_build_dtor_call): Adjust.
1363 * decl.c (register_dtor_fn): Adjust.
1364 * decl2.c (check_classfn): Adjust.
1365 * pt.c (retrieve_specialization): Adjust.
1366 (check_explicit_specialization): Adjust.
1367 (do_class_deduction): Adjust.
1368 * search.c (lookup_field_r): Adjust.
1369 (look_for_overrides_here, lookup_conversions_r): Adjust.
1370 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
1371 * tree.c (type_has_nontrivial_copy_init): Adjust.
1372 * method.c (lazily_declare_fn): Adjust comment.
1374 2017-09-05 Nathan Sidwell <nathan@acm.org>
1376 * name-lookup.c (do_class_using_decl): Elide read-once temps.
1377 Move declarations to initializations.
1379 * class.c (add_method): Move slot search and insertion to ...
1380 * name-lookup.c (get_method_slot): ... this new function.
1381 (lookup_fnfields_slot_nolazy): Cope with NULL slot.
1382 * name-lookup.h (get_method_slot): Declare.
1383 * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
1385 (grok_special_member_properties): Set
1386 TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
1387 Improve TYPE_HAS_CONSTEXPR_CTOR setting.
1389 * cp-tree.h (lang_decl_base): Rename template_conv_p to
1391 (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
1392 (DECL_CONV_FN_TYPE): FN must be conv op.
1393 (DECL_TEMPLATE_CONV_FN_P): Delete.
1394 (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
1395 * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
1398 * class.c (unreverse_member_declarations): Remove extraneous if.
1399 * pt.c (push_template_decl_real): Use string concatenation, not
1400 \<newline>. Add %<..%>.
1402 2017-09-05 Paolo Carlini <paolo.carlini@oracle.com>
1405 * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
1406 * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
1407 creating cdtor_label.
1408 * constexpr.c (returns): Add the case of a constructor/destructor
1409 returning via a LABEL_DECL_CDTOR label.
1410 (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
1412 2017-09-01 Nathan Sidwell <nathan@acm.org>
1414 * cp-tree.h (resort_type_method_vec): Move declaration to ...
1415 * name-lookup.h (resort_type_method_vec): ... here.
1416 (set_class_bindings): Lose 2nd arg.
1417 * class.c (finish_struct_1, finish_struct): Adjust
1418 set_class_bindings call. Don't call finish_struct_methods.
1419 (resort_data, method_name_cmp, resort_method_name_cmp,
1420 resort_type_method_vec, finish_struct_methods): Move to ...
1421 * name-lookup.c (resort_data, method_name_cmp,
1422 resort_method_name_cmp, resort_type_method_vec): ... here.
1423 (set_class_bindings): Lose fields arg. Swallow finish_struct_methods.
1425 * class.c (finish_struct): Call set_class_bindings for the
1428 * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
1429 Don't call maybe_warn_about_overly_private_class here.
1430 (warn_hidden): Cleanup declarations and comments.
1431 (type_has_user_provided_constructor): No need to check
1432 CLASSTYPE_METHOD_VEC.
1433 (type_has_user_provided_or_explicit_constructor): Likewise.
1434 (classtype_has_move_assign_or_move_ctor_p): Likewise.
1435 (check_bases_and_members): Don't call finish_struct_methods here.
1436 (finish_struct_1): Call finish_struct_methods and
1437 set_class_bindings immediately after layout. Clear DECL_IN_AGGR_P
1439 (finish_struct): For templates process USING_DECLS and clear
1440 DECL_IN_AGGR_P before calling finish_struct_methods. Call
1441 maybe_warn_about_overly_private_class here.
1443 Revert 2017-08-28 Nathan Sidwell <nathan@acm.org>
1444 Restore sorted_fields vector.
1445 * cp-tree.h (lang_type): Restore sorted_fields vector.
1446 (CLASSTYPE_SORTED_FIELDS): Restore.
1447 (CLASSTYPE_BINDINGS): Delete.
1448 * name-lookup.c (lookup_field_1): Restore binary search.
1449 (sorted_fields_type_new, count_fields,
1450 add_fields_to_record_type, add_enum_fields_to_record_type): Restore
1451 (set_class_bindings): Revert.
1452 (insert_late_enum_def_binding): Restore field_vec insertion.
1454 2017-09-01 Jakub Jelinek <jakub@redhat.com>
1457 * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
1459 2017-09-01 Marek Polacek <polacek@redhat.com>
1462 * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
1464 2017-08-30 Jason Merrill <jason@redhat.com>
1466 PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
1467 * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
1468 (regenerated_lambda_fn_p): New.
1469 (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
1470 (tsubst_copy) [VAR_DECL]: Likewise.
1472 PR c++/82030 - ICE inheriting from multiple lambdas
1474 * call.c (compare_ics): Handle null candidate.
1476 2017-08-30 Ville Voutilainen <ville.voutilainen@gmail.com>
1478 Make taking the address of an overloaded function a non-deduced context
1480 * pt.c (unify_overload_resolution_failure): Remove.
1481 (unify_one_argument): Adjust.
1483 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1484 Alan Hayward <alan.hayward@arm.com>
1485 David Sherwood <david.sherwood@arm.com>
1487 * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
1489 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1490 Alan Hayward <alan.hayward@arm.com>
1491 David Sherwood <david.sherwood@arm.com>
1493 * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
1495 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1496 Alan Hayward <alan.hayward@arm.com>
1497 David Sherwood <david.sherwood@arm.com>
1499 * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
1500 instead of TYPE_MODE.
1502 2017-08-29 Jason Merrill <jason@redhat.com>
1504 PR c++/81236 - ICE with template-id in generic lambda
1505 * semantics.c (finish_id_expression): Remove special dependent case.
1506 Avoid some later pieces when dependent.
1507 (finish_qualified_id_expr): Do normal BASELINK handling in a
1508 template. Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
1509 (parsing_default_capturing_generic_lambda_in_template): Remove.
1510 * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
1511 error for types that will never be complete.
1512 * mangle.c (write_expression): Add sanity check.
1513 * tree.c (build_qualified_name): Add sanity check.
1514 (cp_walk_subtrees): Walk into the class context of a BASELINK.
1515 * lambda.c (add_capture): Improve diagnostic for generic lambda
1517 * call.c (build_new_method_call_1): Print the right constructor
1520 Reimplement handling of lambdas in templates.
1521 * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
1522 * decl.c (start_preparsed_function): Call start_lambda_scope.
1523 (finish_function): Call finish_lambda_scope.
1524 * init.c (get_nsdmi): Call start/finish_lambda_scope.
1525 * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
1526 * parser.c (cp_parser_function_definition_after_declarator): Don't
1527 call start/finish_lambda_scope.
1528 * pt.c (retrieve_specialization): Ignore lambda functions in
1530 (find_parameter_packs_r): Ignore capture proxies. Look into
1532 (check_for_bare_parameter_packs): Allow bare packs in lambdas.
1533 (tsubst_default_argument): Call start/finish_lambda_scope.
1534 (tsubst_function_decl): Handle lambda functions differently.
1535 (tsubst_template_decl): Likewise.
1536 (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
1538 (tsubst_lambda_expr): Create a new closure rather than instantiate
1539 the one from the template.
1540 (tsubst_copy_and_build): Don't register a specialization of a pack.
1541 (regenerate_decl_from_template): Call start/finish_lambda_scope.
1542 (instantiate_decl): Remove special lambda function handling.
1543 * semantics.c (process_outer_var_ref): Remove special generic lambda
1544 handling. Don't implicitly capture in a lambda in a template. Look
1545 for an existing proxy.
1546 * class.c (current_nonlambda_class_type): Use decl_type_context.
1548 * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
1549 (LAMBDA_EXPR_RETURN_TYPE): Remove.
1550 (struct tree_lambda_expr): Remove closure and return_type fields.
1551 * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
1552 * pt.c (tsubst_copy_and_build): Likewise.
1553 * parser.c (cp_parser_lambda_declarator_opt): Track return type.
1554 (cp_parser_lambda_body): Adjust unspecified return type check.
1555 * ptree.c (cxx_print_lambda_node): Don't print closure or
1558 PR c++/80935 - wrong C++17 error with lambda
1559 * decl.c (check_for_uninitialized_const_var): Check
1560 is_instantiation_of_constexpr.
1561 * constexpr.c (ensure_literal_type_for_constexpr_object): Check
1562 is_instantiation_of_constexpr.
1563 (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
1565 * lambda.c (build_lambda_object): Check for error_mark_node.
1566 * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
1568 (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
1569 (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
1571 PR c++/80767 - unnecessary instantiation of generic lambda
1572 * call.c (convert_like_real): Call build_user_type_conversion_1 if
1574 (add_conv_candidate): Build a ck_user conversion with no candidate.
1576 Fix lambdas in template default argument of inherited ctor.
1577 * method.c (synthesized_method_base_walk): Replace an inherited
1578 template with its specialization.
1579 (synthesized_method_walk): Make inheriting_ctor a pointer.
1580 (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
1581 (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
1583 * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
1584 template, not the function.
1585 (template_guide_p): Adjust.
1587 Support copying local_specializations.
1588 * cp-tree.h (enum lss_policy): New.
1589 (local_specialization_stack): Add policy parameter to default ctor.
1590 * pt.c (local_specialization_stack): Copy local_specializations if
1593 * constexpr.c (potential_constant_expression_1): Add "now" parm.
1594 (is_constant_expression, require_constant_expression): New.
1595 (is_static_init_expression, is_nondependent_constant_expression)
1596 (is_nondependent_static_init_expression): Drop "potential".
1597 * except.c (build_must_not_throw_expr): Do type conversion on
1598 value-dependent argument.
1599 * pt.c, semantics.c, typeck2.c: Use variants without "potential".
1601 Instantiate default arguments/member initializers once.
1602 * init.c (get_nsdmi): Remember NSDMI instantiations.
1603 * parser.c (inject_this_parameter): Be more picky about
1605 * pt.c (tsubst_copy): Simplify 'this' handling.
1606 (tsubst_default_argument): Remember default argument
1607 instantiations. Take parameter number.
1608 (tsubst_default_arguments): Pass it.
1609 * call.c (convert_default_arg): Likewise.
1611 Fix default argument conversion failure and SFINAE.
1612 * call.c (build_over_call): Check convert_default_arg result for
1614 * parser.c (cp_parser_late_parsing_default_args): Remember
1617 2017-08-28 Nathan Sidwell <nathan@acm.org>
1619 * cp-tree.h (lang_type): Replace sorted_fields vector with
1621 (CLASSTYPE_SORTED_FIELDS): Delete.
1622 (CLASSTYPE_BINDINGS): New.
1623 * decl.c (finish_enum_value_list): Swap args of
1624 insert_late_enum_def_bindings.
1625 * name-lookup.c (lookup_field_1): Replace binary search of sorted
1626 fields with map->get.
1627 (sorted_fields_type_new, count_fields,
1628 add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
1629 (add_class_member, add_class_members): New.
1630 (set_class_bindings): Create map and insert.
1631 (insert_late_enum_def_binding): Swap parms. Use add_clasS_member.
1632 * ptree.c (cxx_print_type): Delete sorted fields printing.
1634 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
1636 * name-lookup.h (set_class_bindings,
1637 insert_late_enum_def_bindings): Declare.
1638 * decl.c (finish_enum_value_list): Adjust for
1639 insert_late_enum_def_bindings name change.
1640 * class.c (finish_struct_1): Call set_class_bindings.
1641 (count_fields, add_fields_to_record_type,
1642 add_enum_fields_to_record_type, sorted_fields_type_new,
1643 insert_into_classtype_sorted_fields,
1644 insert_late_enum_def_into_classtype_sorted_fields): Move to ...
1645 * name-lookup.h (count_fields, add_fields_to_record_type,
1646 add_enum_fields_to_record_type, sorted_fields_type_new,
1647 set_class_bindings, insert_late_enum_def_bindings): ... here.
1649 2017-08-25 Nathan Sidwell <nathan@acm.org>
1651 * class.c (method_name_cmp, resort_method_name_cmp): Methods
1654 Conversion operators have a special name
1655 * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
1656 (conv_op_marker, conv_op_identifier): New.
1657 (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
1658 * decl.c (initialize_predefined_identifiers): Add
1660 (cxx_init_decl_processing): Create conv_op_marker.
1661 * decl2.c (check_classfn): Lookup conv-ops by name.
1662 * class.c (add_method): Use conv_op_identifier & conv_op_marker.
1663 (resort_type_method_vec): Don't skip conv-ops.
1664 (finish_struct_methods, warn_hidden): Likewise.
1665 * name-lookup.h (lookup_all_conversions): Delete.
1666 * name-lookup.c (lookup_conversion_operator): Replace with ...
1667 (extract_conversion_operator): ... this.
1668 (lookup_fnfields_slot_nolazy): Find conv-ops by name.
1669 (lookup_all_conversions): Delete.
1670 * pt.c (check_explicit_specialization): Find conv-ops by name.
1671 * search.c (lookup_conversions_r): Likewise.
1673 2017-08-24 Nathan Sidwell <nathan@acm.org>
1675 Conversion operators kept on single overload set
1676 * class.c (add_method): Keep all conv-ops on one slot.
1677 * name-lookup.c (lookup_conversion_operator): Pull the desired
1678 conv op out of overload set.
1679 * search.c (lookup_conversions_r): Lose template/non-template
1681 (lookup_conversions): Likewise.
1683 2017-08-23 Nathan Sidwell <nathan@acm.org>
1685 * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
1686 lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
1688 * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
1689 lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
1690 * search.c (lookup_conversion_operator,
1691 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1692 lookup_all_conversions): Move to ...
1693 * name-lookup.c (lookup_conversion_operator,
1694 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1695 lookup_all_conversions): ... here.
1697 * semantics.c (finish_member_declaration): Move USING_DECL check
1698 earlier. Always set C++ linkage. Commonize TYPE_FIELD and
1699 template decl list insertion.
1701 * cp-tree.h (maybe_version_functions): Declare.
1702 * decl.c (decls_match): Break function versioning check to
1703 separate function. Call it.
1704 (maybe_version_functions): Broken out of decls_match.
1705 * class.c (add_method): Use maybe_version_functions.
1707 * cp-tree.h (print_search_statistics,
1708 reinit_search_statistics): Don't declare.
1709 * search.c (n_fields_searched, n_calls_lookup_field,
1710 n_calls_lookup_field_1, n_calls_lookup_fnfields,
1711 n_calls_lookup_fnfields_1, n_calls_get_base_type,
1712 n_outer_fields_searched, n_contexts_saved): Delete.
1713 (lookup_field_1, lookup_member,
1714 lookup_fnfields_slot_nolazy): Remove stat gathering.
1715 (print_search_statistics, reinit_search_statistics): Delete.
1716 * tree.c (cxx_print_statistics): Don't print search stats.
1718 2017-08-21 Nathan Sidwell <nathan@acm.org>
1720 * search.c (lookup_field_r): Remove obsolete code for type-named
1723 * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
1725 (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
1726 (lookup_field_fuzzy_r): Adjust.
1728 2017-08-21 David Malcolm <dmalcolm@redhat.com>
1730 * call.c (build_over_call): Pass NULL for new parameter to
1731 check_function_arguments.
1732 * typeck.c (cp_build_function_call_vec): Likewise.
1734 2017-08-21 Nathan Sidwell <nathan@acm.org>
1737 * pt.c (instantiate_class_template_1):
1738 BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
1740 2017-08-18 David Malcolm <dmalcolm@redhat.com>
1743 * name-lookup.c (maybe_suggest_missing_header): Convert return
1744 type from void to bool; return true iff a suggestion was offered.
1745 (suggest_alternative_in_explicit_scope): Move call to
1746 maybe_suggest_missing_header to before use of best_match, and
1747 return true if the former offers a suggestion.
1749 2017-08-18 H.J. Lu <hongjiu.lu@intel.com>
1752 * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
1753 * decl2.c (grokbitfield): Don't allow bit-field with
1754 warn_if_not_aligned type.
1756 2017-08-17 Nathan Sidwell <nathan@acm.org>
1758 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
1759 * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
1760 (TYPE_TEMPLATE_INFO): Simplify.
1761 (SET_TYPE_TEMPLATE_INFO): Simplify.
1763 * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
1764 don't need lang_type.
1765 (cxx_make_type): Use maybe_add_lang_type_raw return value.
1766 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
1769 * cp-tree.h (struct lang_type): Remove template_info field.
1770 (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
1771 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
1773 2017-08-14 Martin Sebor <msebor@redhat.com>
1776 * error.c (cp_printer): Handle 'G'.
1778 2017-08-11 Martin Liska <mliska@suse.cz>
1780 * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
1781 TARGET_SUPPORTS_ALIASES.
1782 (handle_tls_init): Likewise.
1783 (note_mangling_alias): Likewise. Remove ATTRIBUTE_UNUSED for
1785 * optimize.c (can_alias_cdtor): Likewise.
1787 2017-08-11 Jason Merrill <jason@redhat.com>
1789 PR c++/81671 - nullptr_t template parameter
1790 * pt.c (convert_nontype_argument): Fix nullptr_t check.
1792 2017-08-10 Jason Merrill <jason@redhat.com>
1794 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1795 * method.c (synthesized_method_walk): Don't diagnose lack of
1798 PR c++/80452 - Core 1579, implicit move semantics on return/throw
1799 * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
1800 tentatively changed the lvalue to an rvalue.
1801 * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
1802 (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
1803 parameter is an rvalue reference.
1804 * except.c (build_throw): Do maybe-rvalue overload resolution twice.
1805 * typeck.c (check_return_expr): Likewise.
1807 2017-08-10 David Malcolm <dmalcolm@redhat.com>
1809 * parser.c (cp_parser_error): Update for new param to
1811 (class token_pair): New class.
1812 (struct matching_paren_traits): New struct.
1813 (matching_parens): New typedef.
1814 (struct matching_brace_traits): New struct.
1815 (matching_braces): New typedef.
1816 (cp_parser_statement_expr): Convert explicit parsing of
1817 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
1818 class matching_parens, so that the pertinent open parenthesis is
1819 highlighted when there are problems locating the close
1821 (cp_parser_primary_expression): Likewise.
1822 (cp_parser_compound_literal_p): Remove consumption of opening
1824 (cp_parser_postfix_expression): Convert explicit parsing of
1825 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
1826 above. Use it to consume the opening paren previously consumed by
1827 cp_parser_compound_literal_p.
1828 (cp_parser_parenthesized_expression_list): Likewise.
1829 (cp_parser_unary_expression): Likewise.
1830 (cp_parser_new_expression): Likewise.
1831 (cp_parser_cast_expression): Likewise.
1832 (cp_parser_builtin_offsetof): Likewise.
1833 (cp_parser_trait_expr): Likewise.
1834 (cp_parser_lambda_declarator_opt): Likewise.
1835 (cp_parser_lambda_body): Likewise, for matching_braces.
1836 (cp_parser_compound_statement): Likewise.
1837 (cp_parser_selection_statement): Likewise, for matching_parens.
1838 (cp_parser_iteration_statement): Likewise.
1839 (cp_parser_already_scoped_statement): Likewise, for
1841 (cp_parser_linkage_specification): Likewise.
1842 (cp_parser_static_assert): Likewise, for matching_parens.
1843 (cp_parser_decltype): Likewise.
1844 (cp_parser_operator): Likewise.
1845 (cp_parser_enum_specifier): Likewise.
1846 (cp_parser_namespace_definition): Likewise.
1847 (cp_parser_direct_declarator): Likewise.
1848 (cp_parser_braced_list): Likewise.
1849 (cp_parser_class_specifier_1): Likewise, for matching_braces.
1850 (cp_parser_constant_initializer): Likewise.
1851 (cp_parser_noexcept_specification_opt): Likewise, for
1853 (cp_parser_exception_specification_opt): Likewise.
1854 (cp_parser_handler): Likewise.
1855 (cp_parser_asm_specification_opt): Likewise.
1856 (cp_parser_asm_operand_list): Likewise.
1857 (cp_parser_gnu_attributes_opt): Likewise.
1858 (cp_parser_std_attribute_spec): Likewise.
1859 (cp_parser_requirement_parameter_list): Likewise.
1860 (cp_parser_requirement_body): Likewise, for matching_braces.
1861 (cp_parser_compound_requirement): Likewise.
1862 (cp_parser_template_introduction): Likewise.
1863 (cp_parser_sizeof_pack): Likewise, for matching_parens.
1864 (cp_parser_sizeof_operand): Likewise; use it to consume the
1865 opening paren previously consumed by cp_parser_compound_literal_p.
1866 (get_matching_symbol): New function.
1867 (cp_parser_required_error): Add param "matching_location". Remove
1868 calls to cp_parser_error, instead setting a non-NULL gmsgid, and
1869 handling it if set by calling c_parse_error, potentially with a
1870 secondary location if matching_location was set.
1871 (cp_parser_require): Add param "matching_location", with a default
1872 value of UNKNOWN_LOCATION.
1873 (cp_parser_require_keyword): Update for new param of
1874 cp_parser_required_error.
1875 (cp_parser_objc_encode_expression): Update to class matching_parens
1877 (cp_parser_objc_defs_expression): Likewise.
1878 (cp_parser_objc_protocol_expression): Likewise.
1879 (cp_parser_objc_selector_expression): Likewise.
1880 (cp_parser_objc_typename): Likewise.
1881 (cp_parser_objc_superclass_or_category): Likewise.
1882 (cp_parser_objc_try_catch_finally_statement): Likewise.
1883 (cp_parser_objc_synchronized_statement): Likewise.
1884 (cp_parser_objc_at_property_declaration): Likewise.
1885 (cp_parser_oacc_single_int_clause): Likewise.
1886 (cp_parser_oacc_shape_clause): Likewise.
1887 (cp_parser_omp_clause_collapse): Likewise.
1888 (cp_parser_omp_clause_default): Likewise.
1889 (cp_parser_omp_clause_final): Likewise.
1890 (cp_parser_omp_clause_if): Likewise.
1891 (cp_parser_omp_clause_num_threads): Likewise.
1892 (cp_parser_omp_clause_num_tasks): Likewise.
1893 (cp_parser_omp_clause_grainsize): Likewise.
1894 (cp_parser_omp_clause_priority): Likewise.
1895 (cp_parser_omp_clause_hint): Likewise.
1896 (cp_parser_omp_clause_defaultmap): Likewise.
1897 (cp_parser_omp_clause_ordered): Likewise.
1898 (cp_parser_omp_clause_schedule): Likewise.
1899 (cp_parser_omp_clause_num_teams): Likewise.
1900 (cp_parser_omp_clause_thread_limit): Likewise.
1901 (cp_parser_omp_clause_aligned): Likewise.
1902 (cp_parser_omp_clause_linear): Likewise.
1903 (cp_parser_omp_clause_safelen): Likewise.
1904 (cp_parser_omp_clause_simdlen): Likewise.
1905 (cp_parser_omp_clause_depend): Likewise.
1906 (cp_parser_omp_clause_device): Likewise.
1907 (cp_parser_omp_clause_dist_schedule): Likewise.
1908 (cp_parser_oacc_clause_async): Likewise.
1909 (cp_parser_omp_critical): Likewise.
1910 (cp_parser_omp_for_loop): Likewise.
1911 (cp_parser_omp_sections_scope): Likewise.
1912 (cp_parser_omp_declare_reduction_exprs): Likewise.
1913 Update for new param to cp_parser_required_error.
1914 (cp_parser_oacc_routine): Likewise.
1915 (cp_parser_transaction_expression): Likewise.
1916 (cp_parser_cilk_simd_vectorlength): Likewise.
1918 2017-08-09 Jason Merrill <jason@redhat.com>
1920 PR c++/81525 - wrong constant value with generic lambda
1921 * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
1922 (tsubst_copy) [VAR_DECL]: Handle auto.
1924 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1925 * init.c (get_nsdmi): Add complain parm.
1926 * typeck2.c (digest_nsdmi_init): Add complain parm.
1927 (process_init_constructor_record): Pass complain to get_nsdmi.
1928 * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
1929 * method.c (get_defaulted_eh_spec): Add complain parm. Pass it into
1930 synthesized_method_walk.
1931 (synthesized_method_walk): Adjust.
1932 (walk_field_subobs): Pass complain to get_nsdmi.
1933 (defaulted_late_check): Skip other checks if deleted.
1934 * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
1935 * call.c (build_aggr_conv): Pass complain to get_nsdmi.
1936 * parser.c (defarg_location): New.
1937 * error.c (location_of): Use it.
1939 2017-08-09 Marek Polacek <polacek@redhat.com>
1941 * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
1942 * typeck.c (build_binary_op): Change the type of a parameter to bool.
1943 (cp_truthvalue_conversion): Use true instead of 1.
1945 2017-08-08 Marek Polacek <polacek@redhat.com>
1948 * cp-gimplify.c (cp_fold): If folding exposed a branch of
1949 a COND_EXPR, convert it to the original type of the COND_EXPR, if
1952 2017-08-08 Martin Liska <mliska@suse.cz>
1954 * call.c: Include header files.
1955 * cp-gimplify.c: Likewise.
1956 * cp-ubsan.c: Likewise.
1959 * search.c: Likewise.
1960 * semantics.c: Likewise.
1961 * typeck.c: Likewise.
1963 2017-08-07 Martin Liska <mliska@suse.cz>
1965 * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
1967 (cp_parser_std_attribute): Likewise.
1968 * tree.c: Add new include.
1970 2017-08-04 Paolo Carlini <paolo.carlini@oracle.com>
1973 * pt.c (do_class_deduction): Handle the case of no viable implicit
1974 deduction guides; simplify the code generating implicit deduction
1977 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
1980 * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
1981 destructor as expressions.
1983 2017-08-02 Jakub Jelinek <jakub@redhat.com>
1986 * call.c (build_user_type_conversion_1): Only call
1987 lookup_fnfields_slot if totype is CLASS_TYPE_P.
1989 2017-07-31 Jason Merrill <jason@redhat.com>
1991 * decl.c (declare_global_var): Set DECL_CONTEXT.
1993 2017-07-31 Jan Hubicka <hubicka@ucw.cz>
1994 Martin Liska <mliska@suse.cz>
1996 * pt.c (tsubst_copy): Copy PREDICT_EXPR.
1997 * semantics.c (finish_goto_stmt): Build gimple predict
1999 * constexpr.c (potential_constant_expression_1): Handle
2002 2017-07-31 Martin Liska <mliska@suse.cz>
2005 * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
2006 also with current_function_decl non-null equality.
2007 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2008 * decl.c (compute_array_index_type): Likewise.
2009 * init.c (finish_length_check): Likewise.
2010 * typeck.c (cp_build_binary_op): Likewise.
2012 2017-07-29 Jakub Jelinek <jakub@redhat.com>
2014 * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
2015 DW_AT_export_symbols.
2016 * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
2017 argument, pass it through to the debug hook.
2018 (finish_namespace_using_directive): Adjust
2019 emit_debug_info_using_namespace caller.
2020 (push_namespace): Likewise. Call it after setting
2021 DECL_NAMESPACE_INLINE_P.
2022 (cp_emit_debug_info_for_using): Pass false as new argument to
2023 the imported_module_or_decl debug hook.
2025 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
2027 * lex.c (copy_decl): Adjust.
2028 (copy_type): Likewise.
2030 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
2033 * lambda.c (add_capture): Early return if we cannot capture by
2036 2017-07-26 Jason Merrill <jason@redhat.com>
2038 P0702R1 - List deduction of vector.
2039 * pt.c (do_class_deduction): Special-case deduction from a single
2040 element of related type.
2042 2017-07-26 Leonid Koppel <lkoppel@uwaterloo.ca>
2044 PR c++/67054 - Inherited ctor with non-default-constructible members
2045 * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
2046 when deducing an inheriting constructor.
2048 2017-07-21 Nathan Sidwell <nathan@acm.org>
2050 * search.c (lookup_conversion_operator): Return overloads.
2051 (lookup_fnfields_idx_nolazy): Absorb into ...
2052 (lookup_fnfields_slot_nolaxy): ... here.
2053 (lookup_fnfields_1): Absorb into ...
2054 (lookup_fnfields_slot): ... here.
2056 Remove special CDtor METHOD_VEC slots.
2057 * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
2058 CLASSTYPE_DESTRUCTOR_SLOT): Delete.
2059 (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
2060 (CLASSTYPE_DESTRUCTOR): Likewise.
2061 * class (add_method): Don't use special cdtor slots.
2062 * search.c (lookup_fnfields_idx_nolazy): Likewise.
2063 (look_for_overrides_here): Use lookup_fnfields_slot.
2064 * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
2066 * call.c (add_candidates): Move decls to initialization. Don't
2069 2017-07-20 Nathan Sidwell <nathan@acm.org>
2071 Remove TYPE_METHODS.
2072 * class.c (maybe_warn_about_overly_private_class,
2073 finish_struct_methods, one_inheriting_sig, count_fields,
2074 add_fields_to_record_type, check_field_decls, check_methods,
2075 clone_function_decl, set_method_tm_attributes,
2076 finalize_literal_type_property, check_bases_and_members,
2077 create_vtable_ptr, determine_key_method,
2078 unreverse_member_declarations, finish_struct,
2079 add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
2080 * decl.c (fixup_anonymous_aggr): Likewise.
2081 * decl2.c (reset_type_linkage_2): Likewise.
2082 * method.c (after_nsdmi_defaulted_late_checks,
2083 lazily_declare_fn): Likewise.
2084 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
2085 * pt.c (instantiate_class_template_1, tsubst_expr,
2086 do_type_instantiation, instantiate_pending_templates): Likewise.
2087 * search.c (lookup_field_1): Likewise.
2088 * semantics.c (finish_member_declaration,
2089 finish_omp_declare_simd_methods): Likewise.
2091 2017-07-19 Nathan Sidwell <nathan@acm.org>
2093 * class.c (add_implicitly_declared_members): Use
2094 classtype_has_move_assign_or_move_ctor_p.
2095 (classtype_has_move_assign_or_move_ctor,
2096 classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
2097 (classtype_has_move_assign_or_move_ctor_p): ... this new function.
2098 * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
2100 (classtype_has_move_assign_or_move_ctor_p): ... this.
2101 * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
2102 * tree.c (type_has_nontrivial_copy_init): Adjust.
2104 * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
2105 PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
2107 2017-07-18 Nathan Sidwell <nathan@acm.org>
2109 * cp-array-notation.c (build_array_notation_ref): Use
2110 TYPE_{MIN,MAX}_VALUE.
2112 * class.c (classtype_has_move_assign_or_move_ctor): Declare.
2113 (add_implicitly_declared_members): Use it.
2114 (type_has_move_constructor, type_has_move_assign): Merge into ...
2115 (classtype_has_move_assign_or_move_ctor): ... this new function.
2116 * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
2118 2017-07-17 Volker Reichelt <v.reichelt@netcologne.de>
2120 * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
2121 friend outside class and obsolete auto as storage-class-specifier.
2123 2017-07-17 Nathan Sidwell <nathan@acm.org>
2125 * class.c (maybe_warn_about_overly_private_class): Ignore public
2128 * class.c (type_has_user_declared_move_constructor,
2129 type_has_user_declared_move_assign): Combine into ...
2130 (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
2131 * cp-tree.h (type_has_user_declared_move_constructor,
2132 type_has_user_declared_move_assign): Combine into ...
2133 (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
2134 * method.c (maybe_explain_implicit_delete): Use it.
2135 (lazily_declare_fn): Use it.
2136 * tree.c (type_has_nontrivial_copy_init): Use it.
2138 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
2139 semantics, simplify implementation.
2141 2017-07-16 Volker Reichelt <v.reichelt@netcologne.de>
2143 * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
2144 in old-style cast diagnostic.
2145 * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
2146 in useless cast diagnostic.
2147 * error.c (type_to_string): Remove enum special handling.
2149 2017-07-14 David Malcolm <dmalcolm@redhat.com>
2151 * name-lookup.c (get_std_name_hint): Add '<' and '>' around
2153 (maybe_suggest_missing_header): Update for addition of '<' and '>'
2154 to above. Provide a fix-it hint.
2155 * pt.c: Include "gcc-rich-location.h"
2156 (listify): Attempt to add fix-it hint for missing
2157 #include <initializer_list>.
2158 * rtti.c: Include "gcc-rich-location.h".
2159 (typeid_ok_p): Attempt to add fix-it hint for missing
2160 #include <typeinfo>.
2162 2017-07-12 Jason Merrill <jason@redhat.com>
2164 P0512R0 - Deduction from an initializer list.
2165 * pt.c (do_class_deduction): Do list deduction in two phases.
2167 2017-07-12 Nathan Sidwell <nathan@acm.org>
2169 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
2170 DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
2172 * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
2173 DECL_CXX_DESTRUCTOR explicitly.
2174 * decl2.c (grokclassfn): Likewise.
2175 * friend.c (do_friend): Likewise.
2176 * method.c (make_thunk, make_alias_for,
2177 implicitly_declare_fn): Likewise.
2179 2017-07-11 Jason Merrill <jason@redhat.com>
2182 * decl.c (grokparms): Downgrade error about array of unknown bound
2183 to pedwarn and disable it for C++17.
2185 2017-07-11 Nathan Sidwell <nathan@acm.org>
2187 * decl2.c (reset_type_linkage_2): Dont't change ctor name.
2189 2017-07-10 Martin Sebor <msebor@redhat.com>
2191 * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
2193 2017-07-06 Jason Merrill <jason@redhat.com>
2195 PR c++/81204 - parse error with dependent template-name
2196 * parser.c (cp_parser_lookup_name): Revert previous change.
2198 2017-07-06 David Malcolm <dmalcolm@redhat.com>
2200 * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
2201 selftest::run_cp_tests.
2202 (selftest::run_cp_tests): New function.
2203 * cp-tree.h (selftest::run_cp_tests): New decl.
2205 2017-07-04 Jakub Jelinek <jakub@redhat.com>
2207 * parser.c (cp_parser_decomposition_declaration): Replace
2208 decomposition declaration with structured binding in diagnostics.
2209 * decl.c (cp_finish_decomp): Likewise.
2210 (grokdeclarator): Likewise.
2213 * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
2214 forms of structured binding initializers.
2216 2017-07-03 Paolo Carlini <paolo.carlini@oracle.com>
2219 * decl.c (grokdeclarator): Move checks on function return type after
2220 the splice_late_return_type call; if declspecs->locations[ds_type_spec]
2221 is UNKNOWN_LOCATION fall back to input_location.
2223 2017-07-03 David Malcolm <dmalcolm@redhat.com>
2225 * parser.c (enum required_token): Fix spelling of
2226 RT_INTERATION to RT_ITERATION.
2227 (cp_parser_iteration_statement): Likewise.
2228 (cp_parser_required_error): Likewise.
2230 2017-06-30 Jason Merrill <jason@redhat.com>
2232 PR c++/81257 - ICE with invalid ::template.
2233 PR c++/54769 - wrong lookup of dependent template-name.
2234 * parser.c (cp_parser_template_name): Revert part of last change.
2236 2017-06-30 Nathan Sidwell <nathan@acm.org>
2238 * config-lang.in (gtfiles): Add cp/lex.c.
2239 * cp-tree.h (mangle_convop_name_for_type): Rename ...
2240 (make_conv_op_name): ... here. Move to lex.
2241 * lambda.c (maybe_add_lambda_conv_op): Update.
2242 * parser.c (cp_parser_conversion_function_id): Update.
2243 * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
2244 tsubst_copy_and_build): Update.
2245 * semantics.c (apply_deduced_return_type): Update.
2246 * mangle.c (conv_type_hasher, conv_type_names,
2247 mangle_conv_op_name_for_type): Move to ...
2248 * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
2251 2017-06-30 David Malcolm <dmalcolm@redhat.com>
2254 * parser.c (cp_parser_postfix_expression): Construct a location
2255 for typeid expressions.
2257 2017-06-30 Nathan Sidwell <nathan@acm.org>
2259 * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
2261 (lookup_all_conversions): Declare.
2262 * class.c (get_basefndecls): Use lookup_fnfields_slot.
2263 * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
2264 * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
2266 * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
2267 (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
2268 lookup_all_conversions.
2269 * search.c (lookup_fnfields_1): Make static.
2270 (lookup_all_conversions): New.
2271 (class_method_index_for_fn): Delete.
2272 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
2273 lookup_fnfields_slot.
2275 * call.c (build_new_method_call_1): Use constructo_name to get
2276 ctor name. Move argument processing earlier to merge cdtor
2278 * decl.c (grokfndecl): Cdtors have special names.
2279 * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
2280 * pt.c (check_explicit_specialization): Cdtor name is already
2282 * search.c (class_method_index_for_fn): Likewise.
2285 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
2286 a matching TYPE_DECL.
2288 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
2290 * class.c (add_method): Change pair of errors to error + inform.
2291 (handle_using_decl): Likewise.
2293 2017-06-29 Jason Merrill <jason@redhat.com>
2295 * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
2297 PR c++/81180 - ICE with C++17 deduction of member class template.
2298 * pt.c (build_deduction_guide): Correct member template handling.
2300 PR c++/81188 - matching decltype of member function call.
2301 * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
2303 2017-06-29 Nathan Sidwell <nathan@acm.org>
2306 * parser.c (cp_parser_namespace_definition): Immediately close the
2307 namespace if there's no open-brace.
2308 * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
2311 2017-06-29 Jason Merrill <jason@redhat.com>
2313 PR c++/81164 - ICE with invalid inherited constructor.
2314 * search.c (binfo_direct_p): New.
2315 * name-lookup.c (do_class_using_decl): Use it.
2317 2017-06-29 Nathan Sidwell <nathan@acm.org>
2319 * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
2320 VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
2321 * decl.c (initialize_predefined_identifiers): Name cdtor special
2322 names consistently. Use literals for above deleted defines.
2323 (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
2325 * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
2328 * call.c (check_dtor_name): Use constructor_name for enums too.
2329 (build_new_method_call_1): Use constructor_name for cdtors and
2331 * class.c (build_self_reference): Use TYPE_NAME to get name of
2333 * name-lookup (constructor_name): Use DECL_NAME directly.
2334 (constructor_name_p): Reimplement.
2335 (push_class_level_binding_1): Use TYPE_NAME directly.
2337 * class.c (finish_struct): Use OVL_P.
2338 (get_vfield_name): Measure constructor_name length.
2339 * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
2340 (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
2341 * cxx-pretty-print.c (is_destructor_name): Delete.
2342 (pp_cxx_unqualified_id): Remove bogus destructor name checking.
2343 * decl.c (grokfndecl): Move cheap checks first when looking for
2344 implicit extern cness.
2346 * parser.c (cp_parser_direct_declarator): Reorder if to avoid
2347 indentation. Remove unnecessary assignment of constructor name.
2349 Whitespace cleanups.
2350 * call.c (name_as_c_string): Move CONST_CAST to return.
2351 (build_new_method_call_1): Remove unneeded bracing.
2352 * class.c (include_empty_classes): Unbreak line.
2353 * constraint.cc (tsubst_check_constraint): Add space.
2354 * cp-tree.h (lang_decl_ns): Add comment.
2355 (PTRMEM_CST_MEMBER): Break line.
2356 * decl.c (grokfndecl): Add blank lines. Unbreak some others.
2357 (grokdeclarator): Remove lines, move declaration to first use.
2358 * decl2.c (decl_needed_p): Fix indentation.
2359 (c_parse_final_cleanups): Remove blank line.
2360 * method.c (implicitly_declare_fn): Move declaration to first use.
2361 * search.c (current_scope): Add blank lines.
2363 2017-06-28 Jason Merrill <jason@redhat.com>
2365 PR c++/72764 - ICE with invalid template typename.
2366 * decl.c (build_typename_type): No longer static.
2367 * tree.c (strip_typedefs): Use it instead of make_typename_type.
2369 PR c++/69300 - ICE with self-referential noexcept
2370 * pt.c (maybe_instantiate_noexcept): Check for recursion.
2372 PR c++/61022 - error with variadic template template parm
2373 * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
2375 PR c++/72801 - ICE with variadic partial specialization
2376 * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
2378 PR c++/55639 - partial specialization with ::template
2379 * parser.c (cp_parser_class_head): Handle ::template.
2381 PR c++/45976 - error with ::template in declarator.
2382 * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
2384 PR c++/54769 - wrong lookup of dependent template-name.
2385 * parser.c (cp_parser_template_name): Handle dependent object type.
2386 (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
2388 (cp_parser_id_expression): Pass it.
2389 (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
2391 * parser.c (cp_parser_template_id): Use the range location on the
2394 PR c++/81204 - parse error with dependent template-name
2395 * parser.c (cp_parser_lookup_name): Disqualify function templates
2398 2017-06-27 Nathan Sidwell <nathan@acm.org>
2400 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
2401 initialization point. Don't unnecessarily check for ctor name.
2403 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
2404 (CLASSTYPE_DESTRUCTOR): ... this.
2405 * class.c (accessible_nvdtor_p,
2406 maybe_warn_about_overly_private_class,
2407 add_implicitly_declared_members,
2408 clone_constructors_and_destructors, type_has_virtual_destructor):
2409 Adjust for CLASSTYPE_DESTRUCTOR.
2410 (deduce_noexcept_on_destructors): Absorb into ...
2411 (check_bases_and_members): ... here.
2412 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
2413 * init.c (build_delete): Likewise.
2414 * parser.c (cp_parser_lookup_name): Likewise.
2415 * pt.c (check_explicit_specialization): Likewise.
2416 * rtti.c (emit_support_tinfos): Likewise.
2417 * search.c (lookup_fnfields_idx_nolazy): Likewise.
2419 Kill IDENTIFIER_TEMPLATE.
2420 * cp-tree.h (lang_identifier): Remove class_template_info field.
2421 (IDENTIFIER_TEMPLATE): Delete.
2422 * name-lookup.c (constructor_name_full): Subsume into ...
2423 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
2424 (constructor_name_p): Likewise.
2425 * mangle.c (write_source_name): Likewise.
2426 * ptree.c (cxx_print_identifier): Likewise.
2428 2017-06-27 Marek Polacek <polacek@redhat.com>
2431 * parser.c (cp_parser_already_scoped_statement): Initialize
2434 2017-06-26 Jason Merrill <jason@redhat.com>
2436 PR c++/81215 - deduction failure with variadic TTP.
2437 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
2439 2017-06-26 Martin Sebor <msebor@redhat.com>
2442 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
2443 to detect casting away cv-qualifiers.
2445 2017-06-26 Nathan Sidwell <nathan@acm.org>
2447 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
2448 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
2450 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
2451 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
2452 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
2453 * decl.c (grok_op_properties): Adjust identifier checking.
2454 * init.c (expand_default_init): Adjust identifier descision.
2455 * method.c (implicitly_declare_fn): Don't use
2456 DECL_ASSIGNMENT_OPERATOR_P.
2457 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
2459 * call.c (in_charge_arg_for_name): Reimplement.
2460 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
2463 2017-06-26 Marek Polacek <polacek@redhat.com>
2466 * parser.c (cp_parser_statement): Add a default argument. Save the
2467 location of the expression-statement after labels have been parsed.
2468 (cp_parser_implicitly_scoped_statement): Set the location of the
2469 body of the conditional after parsing all the labels. Call
2470 warn_for_multistatement_macros.
2471 (cp_parser_already_scoped_statement): Likewise.
2473 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
2476 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
2477 'typename' in error messages about missing 'typename'.
2479 2017-06-23 Jason Merrill <jason@redhat.com>
2481 PR c++/79056 - C++17 ICE with invalid template syntax.
2482 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
2484 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
2485 * pt.c (template_placeholder_p): New.
2486 * cp-tree.h: Declare it.
2488 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
2490 * decl.c (duplicate_decls): Use builtin_structptr_types.
2492 2017-06-22 Nathan Sidwell <nathan@acm.org>
2494 Reorder IDENTIFIER flags
2496 * cp-tree.h (enum cp_identifier_kind): New.
2497 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
2498 IDENTIFIER_KIND_BIT_2): New.
2499 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
2500 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
2501 (C_IS_RESERVED_WORD): Replace with ...
2502 (IDENTIFIER_KEYWORD_P): ... this.
2503 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
2504 (IDENTIFIER_CDTOR_P): ... this.
2505 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
2506 (IDENTIFIER_OPNAME_P): Replace with ...
2507 (IDENTIFIER_ANY_OP_P): ... this.
2508 (IDENTIFIER_ASSIGN_OP_P): New.
2509 (IDENTIFIER_TYPENAME_P): Replace with ...
2510 (IDENTIFIER_CONV_OP_P): ... this.
2511 (NEW_DELETE_OPNAME_P): Replace with ...
2512 (IDENTIFIER_NEWDEL_OP_P): ... this.
2513 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
2514 (get_identifier_kind_name, set_identifier_kind): Declare.
2515 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
2516 (init_operators): Adjust to avoid keywords, use
2517 set_identifier_kind. Copy TYPE_EXPR slot.
2518 (init_reswords): Call set_identifier_kind.
2519 (unqualified_name_lookup_error): Adjust.
2520 * operators.def (TYPE_EXPR): Remove.
2521 * decl.c (struct predefined_identifier): Move into ...
2522 (initialize_predefined_identifiers): ... here. Call
2523 set_identifier_kind.
2524 (grokfndecl, check_var_type, grokdeclarator): Adjust.
2525 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
2527 * call.c (name_as_c_string): Adjust.
2528 (build_new_method_call_1): Likewise.
2529 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
2530 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
2531 * dump.c (cp_dump_tree): Adjust.
2532 * error.c (dump_decl_name): Adjust.
2533 * mangle.c (write_unqualified_id, write_member_name,
2534 write_expression): Adjust.
2535 (mangle_conv_op_name_for_type): Use set_identifier_kind.
2536 * name-lookup.c (do_class_using_decl): Adjust.
2537 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
2538 * parser.c (cp_lexer_get_preprocessor_token,
2539 cp_parser_direct_declarator): Likewise.
2540 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
2541 tsubst_copy, tsubst_copy_and_build): Adjust.
2542 * ptree.c (cxx_print_identifier): Print identifier kind.
2543 * search.c (lookup_field_r, lookup_member,
2544 lookup_fnfields_idx_nolazy): Adjust.
2545 * semantics.c (finish_id_expression): Adjust..
2546 * typeck.c (cp_build_addr_expr_1): Adjust.
2548 2017-06-21 Jakub Jelinek <jakub@redhat.com>
2551 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
2552 Complain about t not being a variable if t is OVERLOAD even
2553 when processing_template_decl.
2555 2017-06-21 David Malcolm <dmalcolm@redhat.com>
2557 * parser.c (get_cast_suggestion): New function.
2558 (maybe_add_cast_fixit): New function.
2559 (cp_parser_cast_expression): Capture the location of the closing
2560 parenthesis. Call maybe_add_cast_fixit when emitting warnings
2561 about old-style casts.
2563 2017-06-20 Jason Merrill <jason@redhat.com>
2565 PR c++/80972 - C++17 ICE with attribute packed.
2566 * call.c (build_over_call): Allow a TARGET_EXPR from reference
2569 2017-06-20 Nathan Sidwell <nathan@acm.org>
2571 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
2572 (nelts_identifier): Delete.
2573 * decl.c (initialize_predefined_identifiers): Remove nelts.
2575 PR c++/67074 - namespace aliases
2576 * decl.c (duplicate_decls): Don't error here on mismatched
2578 * name-lookup.c (name_lookup::add_value): Matching namespaces are
2580 (diagnose_name_conflict): Namespaces are never redeclarations.
2581 (update_binding): An alias can match a real namespace.
2583 2017-06-19 Jason Merrill <jason@redhat.com>
2585 PR c++/80562 - ICE with constexpr if.
2586 * semantics.c (finish_if_stmt_cond): Call
2587 instantiate_non_dependent_expr.
2589 PR c++/80829 - ICE with constexpr copy of base subobject.
2590 * constexpr.c (clear_no_implicit_zero): New.
2591 (cxx_eval_call_expression): Call it.
2593 2017-06-19 Nathan Sidwell <nathan@acm.org>
2597 * name-lookup.c (set_decl_namespace): Don't follow using
2598 directives and ignore using decls. Only check overly-explicit
2599 scope after discovering decl.
2601 2017-06-19 Jason Merrill <jason@redhat.com>
2603 PR c++/81073 - constexpr and static var in statement-expression.
2604 * typeck2.c (store_init_value): Always call
2605 require_potential_constant_expression.
2606 * pt.c (convert_nontype_argument): Likewise.
2607 * constexpr.c (potential_constant_expression_1): Adjust message.
2608 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
2609 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
2611 2017-06-19 Nathan Sidwell <nathan@acm.org>
2613 * pt.c (coerce_template_parms): Fix indentation.
2614 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
2618 * name-lookup.c (update_binding): Only warn about constructors
2619 hidden by functions.
2621 2017-06-17 Jason Merrill <jason@redhat.com>
2623 PR c++/60063 - -Wunused-local-typedefs and templates.
2624 * decl2.c (is_late_template_attribute): Return false for "used".
2626 PR c++/70844 - -Wuseless-cast and inheriting constructor.
2627 * method.c (forward_parm): Suppress warn_useless_cast.
2629 2017-06-16 Jason Merrill <jason@redhat.com>
2631 PR c++/81045 - Wrong type-dependence with auto return type.
2632 * pt.c (type_dependent_expression_p): An undeduced auto outside the
2633 template isn't dependent.
2634 * call.c (build_over_call): Instantiate undeduced auto even in a
2637 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
2638 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
2639 set longer for a generic lambda.
2641 PR c++/80614 - Wrong mangling for C++17 noexcept type
2642 * mangle.c (write_type): Put the eh spec back on the function type.
2644 PR c++/81102 - Wrong error with partial specialization.
2645 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
2646 types. Do type deduction later.
2648 PR c++/81074 - ICE with partial specialization of member template.
2650 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
2652 PR c++/80831 - ICE with -fsyntax-only.
2653 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
2655 PR c++/80639 - ICE with invalid PMF initialization.
2656 PR c++/80043 - ICE with -fpermissive
2657 * typeck.c (convert_for_assignment): Recurse when instantiate_type
2658 returns without an error.
2660 2017-06-16 Nathan Sidwell <nathan@acm.org>
2662 * pt.c (tsubst_baselink): Fix & clarify formatting.
2664 * cp-tree.h (build_this_parm, cp_build_parm_decl,
2665 build_artificial_parm): Add FN parm.
2666 * decl.c (start_cleanup_fn): Adjust.
2667 (build_this_parm): Add FN parm, pass it through.
2668 (grokfndecl): Adjust parm building.
2669 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
2670 (build_artificial_parm): Add FN parm, pass through.
2671 (maybe_retrofit_in_chrg): Adjust parm building.
2672 (start_static_storage_duration_function): Likwise.
2673 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
2674 * method.c (implicitly_declare_fn): Likewise.
2675 * parser.c (inject_this_parameter): Likewise.
2677 Symbol tables are insert only.
2678 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
2679 derive from pointer_hash. Make undeletable.
2681 * class.c (resort_type_method_vec): Avoid potential unsigned
2684 Don't defer noexcept_deferred_spec.
2685 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
2686 * decl.c (cxx_init_decl_processing): Initialize
2687 noexcept_deferred_spec.
2688 * except.c (unevaluated_noexcept_spec): Delete.
2689 * class.c (deduce_noexcept_on_destructor): Use
2690 noexcept_deferred_spec directly.
2691 * method.c (implicitly_declare_fn): Likewise.
2693 Make keyed_classes a vector.
2694 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
2695 (keyed_classes): Declare as vector.
2696 * decl.c (keyed_classes): Define.
2697 (cxx_init_decl_processing): Allocate it.
2698 (record_key_method_defined): Use vec_safe_push.
2699 * class.c (finish_struct_1): Likewise.
2700 * pt.c (instantiate_class_template_1): Likewise.
2701 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
2704 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
2705 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
2707 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
2708 (get_tinfo_decl): Use get_tinfo_desc.
2709 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
2710 (create_pseudo_type_info): Delete.
2711 (get_pseudo_ti_index): Just determine the index.
2712 (get_tinfo_desc): New. Create all types lazily.
2713 (create_tinfo_types): Just allocate the descriptor array.
2714 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
2717 2017-06-15 Martin Sebor <msebor@redhat.com>
2720 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
2722 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
2723 (build_cxx_call): Call maybe_warn_class_memaccess.
2725 2017-06-14 Jakub Jelinek <jakub@redhat.com>
2727 * cp-gimplify.c (cp_genericize_r): Turn most of the function
2728 into a switch (TREE_CODE (stmt)) statement from long else if
2731 2017-06-13 Jakub Jelinek <jakub@redhat.com>
2734 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
2735 argument even if it has REFERENCE_TYPE.
2738 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
2739 BLOCK_VARS (outer) chain.
2740 (cxx_omp_const_qual_no_mutable): Likewise.
2742 2017-06-13 Martin Liska <mliska@suse.cz>
2745 * class.c (build_base_path): Use sanitize_flags_p.
2746 * cp-gimplify.c (cp_genericize_r): Likewise.
2747 (cp_genericize_tree): Likewise.
2748 (cp_genericize): Likewise.
2749 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2750 * decl.c (compute_array_index_type): Likewise.
2751 (start_preparsed_function): Likewise.
2752 * decl2.c (one_static_initialization_or_destruction): Likewise.
2753 * init.c (finish_length_check): Likewise.
2754 * lambda.c (maybe_add_lambda_conv_op): Likewise.
2755 * typeck.c (cp_build_binary_op): Likewise.
2756 (build_static_cast_1): Likewise.
2758 2017-06-11 Jason Merrill <jason@redhat.com>
2760 * error.c (dump_expr): Use is_this_parameter.
2762 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
2765 2017-06-09 Jason Merrill <jason@redhat.com>
2767 Missing bits from N4268, constant evaluation for all non-type args.
2768 * call.c (build_converted_constant_expr): Rename from
2769 build_integral_nontype_arg_conv, handle all types.
2770 * pt.c (convert_nontype_argument): In C++17 call it for all types.
2771 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
2772 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
2774 Overhaul pointer-to-member conversion and template argument handling.
2775 * call.c (standard_conversion): Avoid creating ck_pmem when the
2776 class type is the same.
2777 * cvt.c (can_convert_qual): Split from
2778 perform_qualification_conversions.
2779 * constexpr.c (cxx_eval_constant_expression): Check it.
2780 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
2781 adjustment is necessary.
2782 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
2783 (convert_nontype_argument): Avoid redundant error.
2785 * call.c (convert_like_real): Remove "inner" parameter.
2786 Don't replace a constant with its value.
2787 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
2789 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
2792 * parser.c (cp_parser_constant_expression): Check
2793 potential_rvalue_constant_expression after decay_conversion.
2794 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
2796 PR c++/80384 - ICE with dependent noexcept-specifier
2797 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
2800 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
2802 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
2804 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
2805 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
2806 (excpet.c): Mark terminate as cold.
2808 2017-06-08 Jakub Jelinek <jakub@redhat.com>
2811 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
2812 to sizetype before size_binop.
2815 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
2816 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
2817 and OMP_CLAUSE_SHARED_READONLY flags.
2819 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
2821 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
2823 2017-06-07 Nathan Sidwell <nathan@acm.org>
2825 * class.c (layout_class_type): Restructure overlong-bitfield tpe
2828 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
2831 * pt.c (do_class_deduction): Build qualified type.
2833 2017-06-06 Nathan Sidwell <nathan@acm.org>
2835 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
2836 sans using directives. Don't walk into inline namespaces.
2839 * name-lookup.c (adl_class_only): Don't add visible friends.
2841 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
2843 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
2845 2017-06-02 Nathan Sidwell <nathan@acm.org>
2847 Remove lang_type_ptrmem.
2848 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
2850 (lang_type_class): ... this. Reorder bitfields. Rename to ...
2851 (lang_type): ... this. Delete old definition.
2852 (lang_type_ptrmem): Delete.
2853 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
2854 (LANG_TYPE_PTRMEM_CHECK): Delete.
2855 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
2856 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
2857 * decl.c (build_ptrmemfunc_type): Adjust.
2858 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
2859 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
2861 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
2864 Remove cp_binding_level::namespaces
2865 * name-lookup.h (cp_binding_level): Lose namespaces field.
2866 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
2868 (suggest_alternatives_for): Adjust for namespace list. Do
2869 breadth-first search.
2870 * decl2.c (collect_source_refs): Namespaces are on the regulr
2872 (collect_ada_namespace): Likewise.
2874 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
2876 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
2879 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
2882 * method.c (constructible_expr): Strip array types before calling
2885 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
2888 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
2889 for case INDIRECT_REF too in the main switch.
2891 2017-05-31 Jason Merrill <jason@redhat.com>
2893 PR c++/80840 - ICE with constexpr and reference
2894 * pt.c (convert_nontype_argument): Don't test whether a decl is
2895 value-dependent when binding to a reference.
2897 2017-05-31 Nathan Sidwell <nathan@acm.org>
2899 * cp-tree.h (lang_decl_slector): New enum.
2900 (lang_decl_base): Make selector an enum. Drop decomposition_p
2902 (lang_decl): Use enum for discrimination.
2903 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
2904 LANG_DECL_DEOMP_CHECK): Use enum.
2905 (DECL_DECOMPOSITION_P): Use selector value.
2906 (SET_DECL_DECOMPOSITION_P): Delete.
2907 (retrofit_lang_decl): Lose SEL parm.
2908 (fit_decomposition_lang_decl): Declare.
2909 * decl.c (cp_finish_decomp, grokdeclarator): Use
2910 fit_decomposition_lang_decl.
2911 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
2913 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
2914 (fit_decomposition_lang_decl): Likewise.
2915 (retrofit_lang_decl): Use worker functions.
2916 (cxx_dup_lang_specific_decl): Use selector enum.
2917 (maybe_add_lang_type_raw): New. Broken out of ...
2918 (cxx_make_type_name): ... here. Call it.
2920 2017-05-30 Jason Merrill <jason@redhat.com>
2922 PR c++/80856 - ICE with local extern in template
2923 * semantics.c (finish_call_expr): Replace a local extern overload
2924 set in a template with the IDENTIFIER_NODE.
2926 2017-05-30 David Malcolm <dmalcolm@redhat.com>
2928 * call.c (perform_implicit_conversion_flags): Convert
2929 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
2930 (print_conversion_rejection): Replace pairs of %qT with
2931 %qH and %qI in various places.
2932 (build_user_type_conversion_1): Likewise.
2933 (build_integral_nontype_arg_conv): Likewise.
2934 (build_conditional_expr_1): Likewise.
2935 (convert_like_real): Likewise.
2936 (convert_arg_to_ellipsis): Likewise.
2938 (initialize_reference): Likewise.
2939 * cvt.c (cp_convert_to_pointer): Likewise.
2940 (cp_convert_to_pointer): Likewise.
2941 (convert_to_reference): Likewise.
2942 (ocp_convert): Likewise.
2943 * error.c (cp_printer): Gain bool and const char ** parameters.
2944 (struct deferred_printed_type): New struct.
2945 (class cxx_format_postprocessor): New class.
2946 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
2947 to pp->m_format_postprocessor.
2948 (comparable_template_types_p): New function.
2949 (newline_and_indent): New function.
2950 (arg_to_string): New function.
2951 (print_nonequal_arg): New function.
2952 (print_template_differences): New function.
2953 (type_to_string_with_compare): New function.
2954 (print_template_tree_comparison): New function.
2955 (append_formatted_chunk): New function.
2956 (add_quotes): New function.
2957 (cxx_format_postprocessor::handle): New function.
2958 (defer_phase_2_of_type_diff): New function.
2959 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
2961 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
2962 %qH and %qI in various places.
2963 (convert_member_func_to_ptr): Likewise.
2964 (build_reinterpret_cast_1): Likewise.
2965 (convert_for_assignment): Likewise.
2966 * typeck2.c (check_narrowing): Likewise.
2968 2017-05-30 Nathan Sidwell <nathan@acm.org>
2970 Kill IDENTIFIER_NAMESPACE_BINDINGS
2971 * cp-tree.h (lang_identifier): Delete namespace_bindings.
2972 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
2973 (lang_decl_ns): Add bindings.
2974 (DECL_NAMESPACE_BINDINGS): New.
2975 * lex.c (retrofit_lang_decl): Create namespace hash table.
2976 * name-lookup.c (find_namespace_slot): Change to use hash-map.
2977 * ptree.c (cxx_print_binding): Delete.
2978 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
2980 * cp-tree.def (OVERLOAD): Fix comment.
2981 * cp-tree.h: Fix comments and whitespace.
2982 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
2983 * name-lookup.c (add_decl_to_level): Assert not class.
2984 (check_local_shadow): Use OVL_P.
2985 (pushdecl_with_scope_1): Rename to ...
2986 (do_pushdecl_with_Scope): ... here.
2987 (do_nonmember_using_decl): Use qualified_namespace_lookup return
2989 (push_class_level_binding_1): Use OVL_P.
2990 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
2991 (pushtag_1): Rename to ...
2992 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
2994 (store_class_bindings): Do not time here.
2995 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
2996 * pt.c (listify): Declare argvec at point of initialization.
2999 * name-lookup.c (add_decl_to_level): Assert not making a circular
3001 (update_binding): Don't prematurely slide artificial decl.
3003 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
3005 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
3007 2017-05-29 Nathan Sidwell <nathan@acm.org>
3009 PR c++/80891 (#1,#5)
3010 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
3011 * name-lookup.c (name_lookup): Add deduping field.
3012 (name_lookup::preserve_state, name_lookup::restore_state): Deal
3014 (name_lookup::add_overload): New.
3015 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
3016 (name_lookup::search_adl): Set deduping. Don't unmark here.
3017 * pt.c (most_specialized_instantiation): Revert previous change,
3018 Assert not given duplicates.
3019 * tree.c (lookup_mark): Just mark the underlying decls.
3020 (lookup_maybe_add): Dedup using marked decls.
3023 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
3024 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
3026 Stat hack representation
3027 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
3028 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
3030 (find_namespace_binding): Replace with ...
3031 (find_namespace_slot): ... this.
3032 (find_namespace_value): New.
3033 (name_lookup::search_namespace_only,
3034 name_lookup::adl_namespace_only): Adjust.
3035 (update_binding): Add SLOT parameter, adjust.
3036 (check_local_shadow): Use find_namespace_value.
3037 (set_local_extern_decl_linkage): Likewise.
3038 (do_pushdecl): Adjust for namespace slot.
3039 (push_local_binding): Assert not a namespace binding.
3040 (check_for_out_of_scope_variable): Use find_namespace_value.
3041 (set_identifier_type_value_with_scope): Likewise.
3042 (get_namespace_binding): Likewise.
3043 (set_namespace_binding): Delete.
3044 (set_global_binding): Directly update the binding.
3045 (finish_namespace_using_decl): Likewise.
3046 (lookup_type_scope_1): Use find_namespace_slot and update.
3047 (do_push_nested_namespace): Use find_namespace_value.
3050 * pt.c (most_specialized_instantiation): Cope with duplicate
3054 * cp-tree.h (build_min_nt_call_vec): Declare.
3055 * decl.c (build_offset_ref_call_from_tree): Call it.
3056 * parser.c (cp_parser_postfix_expression): Likewise.
3057 * pt.c (tsubst_copy_and_build): Likewise.
3058 * semantics.c (finish_call_expr): Likewise.
3059 * tree.c (build_min_nt_loc): Keep unresolved lookups.
3060 (build_min): Likewise.
3061 (build_min_non_dep): Likewise.
3062 (build_min_non_dep_call_vec): Likewise.
3063 (build_min_nt_call_vec): New.
3066 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
3068 (lookup_keep): Call it.
3070 2017-05-26 Nathan Sidwell <nathan@acm.org>
3073 * name-lookup.c (push_inline_namespaces): New.
3074 (push_namespace): Look inside inline namespaces.
3076 Inline and using namespace representation change.
3077 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
3079 (DECL_NAMESPACE_USING): Adjust.
3080 (DECL_NAMESPACE_INLINEES): New.
3081 * name-lookup.h (struct cp_binding_level): Change usings
3083 * name-lookup.c (name_lookup::do_queue_usings,
3084 name_lookup::queue_usings): Adjust.
3085 (name_lookup::search_namespace, name_lookup::search_usings,
3086 name_lookup::queue_namespace): Adjust.
3087 (name_lookup::adl_namespace_only): Adjust.
3088 (add_using_namespace, push_namespace): Push onto vector.
3089 (pop_namespace): Add timing logic.
3091 * call.c (build_operator_new_call): Do namelookup and ADL here.
3092 (build_new_op_1): Likewise.
3093 * name-lookup.h (lookup_function_nonclass): Delete declaration.
3094 (do_using_directive): Likewise.
3095 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
3097 (struct scope_binding): Delete.
3098 (EMPTY_SCOPE_BINDING): Delete.
3099 (set_decl_namespace): Use OVL_P.
3100 (finish_local_using_decl): Lose unnecesary checks.
3101 (lookup_function_nonclass): Delete.
3102 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
3104 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
3105 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
3107 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
3108 (lkp_iterator): Add outer field. Adjust ctor.
3109 (lkp_iterator::operator++): New.
3110 (lookup_mark, lookup_maybe_add): Declare.
3111 * name-lookup.c (name_lookup): Delete fn_set member.
3112 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
3114 (name_lookup::add_value): Use lookup_add directly.
3115 (name_lookup::add_fns: Use lookup_maybe_add.
3116 (name_lookup::search_adl): Mark and unmark fns.
3118 * pt.c (check_explicit_specialization): Use lookup_add directly.
3119 * ptree.c (cxx_print_xnode): Show complete overload structure.
3120 * tree.c (lookup_mark, lookup_maybe_add): New.
3122 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
3124 2017-05-26 Jakub Jelinek <jakub@redhat.com>
3126 * cp-tree.h (struct lang_decl_decomp): New type.
3127 (struct lang_decl): Add u.decomp.
3128 (LANG_DECL_DECOMP_CHECK): Define.
3129 (DECL_DECOMPOSITION_P): Note it is set also on the vars
3130 for user identifiers.
3131 (DECL_DECOMP_BASE): Define.
3132 (retrofit_lang_decl): Add extra int = 0 argument.
3133 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
3134 use it to influence the selector choices and for selector
3135 0 to non-zero transition copy old content.
3136 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
3137 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
3138 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
3139 wording if decl is a structured binding.
3140 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
3141 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
3142 of individual variables for tuple structured bindings.
3143 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
3144 Clear DECL_DECOMP_BASE.
3145 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
3146 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
3148 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
3151 2017-05-25 Jason Merrill <jason@redhat.com>
3153 PR c++/80605 - __is_standard_layout and zero-length array
3154 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
3156 2017-05-25 Nathan Sidwell <nathan@acm.org>
3158 Kill OVL_CURRENT, OVL_NEXT.
3159 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
3160 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
3161 (consider_binding_level): Use OVL_FIRST.
3162 (cp_emit_debug_info_for_using): Use lkp_iterator.
3163 * pt.c (check_explicit_specialization): Use ovl_iterator.
3165 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
3166 * cp-tree.h (lang_decl_ns): Remove ns_users field.
3167 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
3168 (TREE_INDIRECT_USING): Delete.
3169 * name-lookup.h (is_associated_namespace): Delete.
3170 * name-lookup.c (name_lookup::search_usings,
3171 name_lookup::do_queue_usings): Usings are always direct.
3172 (is_associated_namespace): Delete.
3173 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
3174 (namespace_ancestor_1, namespace_ancestor): Delete.
3175 (push_using_directive_1, push_using_directive): Delete.
3176 (add_using_namespace_1): Delete.
3177 (add_using_namespace): Reimplement.
3178 (emit_debug_info_using_namespace): New.
3179 (finish_namespace_using_directive, finish_local_using_directive,
3180 push_namespace): Adjust.
3181 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
3183 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
3185 * semantics.c (finish_handler_parms): Warn about non-reference type
3188 2017-05-25 Nathan Sidwell <nathan@acm.org>
3190 Reimplement unqualified namespace lookup.
3191 * name-lookup.c (name_lookup::using_pair,
3192 name_lookup::using_queue): New typedefs.
3193 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
3194 name_lookup::queue_usings): New.
3195 (name_lookup::search_unqualified): New.
3196 (merge_functions, same_entity_p, ambiguous_decl,
3197 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
3198 lookup_using_namespace): Delete.
3199 (lookup_name_real_1): Adjust.
3201 Reimplement qualified namespace lookup.
3202 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
3203 (name_lookup::ambiguous, name_lookup::add_value,
3204 name_lookup::add_type, name_lookup::process_binding): New.
3205 (name_lookup::search_namespace_only,
3206 name_lookup::search_namespace, name_lookup::search_usings): New.
3207 (name_lookup::search_qualified): New.
3208 (do_nonmember_using_decl, suggest_alternatives_for,
3209 lookup_qualified_name): Adjust.
3210 (tree_vec_contains): Delete.
3211 (qualified_lookup_using_namespace): Rename to ...
3212 (qualified_namespace_lookup): ... here. Reimplement.
3215 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
3216 * name-lookup.h (lookup_arg_dependent): Return plain tree.
3217 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
3218 arg_assoc_args_vec, arg_assoc_type, add_function,
3219 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
3220 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
3221 lookup_arg_dependent_1): Delete.
3222 (name_lookup): New lookup object.
3223 (name_lookup::preserve_state, name_lookup::restore_state,
3224 name_lookup::mark_seen, name_lookup::find_and_mark,
3225 name_lookup::add_fns, name_lookup::adl_namespace_only,
3226 name_lookup::adl_namespace, name_lookup::adl_class_only,
3227 name_lookup::adl_bases, name_lookup::adl_class,
3228 name_lookup::adl_expr, name_lookup::adl_type,
3229 name_lookup::adl_template_arg, name_lookup::search_adl): New.
3230 (lookup_arg_dependent): Return a plain tree. Adjust.
3231 (is_associated_namespace): Move later.
3233 2017-05-24 Nathan Sidwell <nathan@acm.org>
3235 * friend.c (do_friend): Remove check for existing decl.
3236 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
3237 * name-lookup.c (push_local_binding): Directly look for binding.
3238 (lookup_name_innermost_nonclass_level_1): Delete.
3239 (lookup_name_innermost_nonclass_level): Delete.
3241 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
3243 * cp-tree.h (cp_free_lang_data): Add extern.
3244 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
3246 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
3247 * typeck.c (type_unknown_p): Delete.
3248 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
3249 overload management.
3250 (dependent_name): Likewise.
3251 (decl_anon_ns_mem_p): Simplify.
3253 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
3256 * tree.c (reshape_init): Use unqualified type for direct enum init.
3257 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
3258 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
3259 non-class destination types.
3260 (build_const_cast_1): Strip cv-quals from destination types.
3261 (build_static_cast, build_reinterpret_cast, build_const_cast)
3262 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
3264 2017-05-24 Martin Sebor <msebor@redhat.com>
3267 * call.c (fully_fold_internal): Adjust.
3269 2017-05-24 Nathan Sidwell <nathan@acm.org>
3271 * cp-tree.h (ovl_skip_hidden): Declare.
3272 * tree.c (ovl_skip_hidden): New.
3273 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
3274 (lookup_arg_dependent_1): Likewise.
3275 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
3276 (hidden_name_p, remove_hidden_names): Delete.
3277 (lookup_name_real_1): Do not strip hidden names.
3278 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
3280 * cp-tree.h (OVL_HIDDEN_P): New.
3281 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
3282 (ovl_iterator::reveal_node): Declare.
3283 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
3284 (ovl_insert): Order on hiddenness.
3285 (ovl_iterator::reveal_node): New.
3286 * name-lookup.c (anticipated_builtin_p): New.
3287 (supplement_binding_1): Use it.
3288 (set_local_extern_decl_linkage): Use hidden_p.
3289 (do_pushdecl): Deal with unhiding a hidden decl, use
3290 anticipated_builtin_p.
3291 (do_nonmember_using_decl): Use anticipated_decl_p.
3292 (lookup_name_real_1): Use DECL_HIDDEN_P.
3294 2017-05-23 Jason Merrill <jason@redhat.com>
3296 -Wunused and C++17 structured bindings
3297 * decl.c (poplevel): Don't warn about unused structured bindings,
3298 only real variables.
3299 * error.c (dump_simple_decl): Handle structured bindings.
3300 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
3302 2017-05-23 Nathan Sidwell <nathan@acm.org>
3304 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
3305 * name-lookup.c (create_local_binding): New.
3306 (update_binding): New.
3307 (pushdecl_maybe_friend_1): Rename to ...
3308 (do_pushdecl): ... this. Reimplement.
3310 (push_overloaded_decl_1, push_overloaded_decl): Delete.
3312 2017-05-23 Jason Merrill <jason@redhat.com>
3314 PR c++/80396 - built-in for make_integer_sequence.
3315 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
3316 (expand_integer_pack, expand_builtin_pack_call): New.
3317 (find_parameter_packs_r): Check builtin_pack_call_p.
3318 (check_for_bare_parameter_packs): Handle it.
3319 (tsubst_pack_expansion): Call expand_builtin_pack_call.
3320 (declare_integer_pack): New.
3321 (init_template_processing): Call it.
3322 * decl2.c (mark_used): Check builtin_pack_fn_p.
3324 2017-05-23 Nathan Sidwell <nathan@acm.org>
3326 * name-lookup.c (find_namespace_binding): New.
3327 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
3328 (set_identifier_type_value_with_scope): Use find_namespace_binding.
3329 (find_binding, cp_binding_level_find_binding_for_name,
3330 binding_for_name, namespace_binding_1): Delete.
3331 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
3332 (get_namespace_binding, set_namespace_binding,
3333 finish_namespace_using_decl, unqualified_namespace_lookup_1,
3334 qualified_lookup_using_namespace, lookup_type_scope_1,
3335 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
3338 * parser.c (cp_parser_template_id): Keep the lookup when stashing
3341 * cp-tree.h (DECL_HIDDEN_P): New.
3342 * name-lookup.c (set_decl_context,
3343 set_local_extern_decl_linkage): New, broken out of ...
3344 (pushdecl_maybe_friend_1): ... here. Call them.
3346 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
3348 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
3349 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
3352 2017-05-23 Nathan Sidwell <nathan@acm.org>
3354 * cp-tree.h (OVL_P): New.
3355 * name-lookup.h (push_local_binding): Delete.
3356 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3357 (finish_namespace_using_decl, finish_local_using_decl): ... here
3358 * name-lookup.c (add_decl_to_level): Swap args.
3359 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
3360 (diagnose_name_conflict): Check contexts are same for redecl.
3361 (update_local_overload): New.
3362 (compparms_for_decl_and_using): Rename to ...
3363 (matching_fn_p): ... here.
3364 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
3365 push_local_bindings call.
3366 (push_local_binding): Make static, replace FLAGS arg with
3368 (validate_nonmember_using_decl): Use OVL_FIRST.
3369 (do_nonmember_using_decl): Use in/out parameters. Use
3370 lkp_iterator and simplify.
3371 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3372 (finish_namespace_using_decl, finish_local_using_decl): ... here.
3374 (lookup_type_current_level): Delete.
3375 * parser.c (cp_parser_using_declaration): Adjust.
3376 * pt.c (tsubst_expr): Adjust.
3378 2017-05-22 Nathan Sidwell <nathan@acm.org>
3380 * name-lookup.h (parse_using_directive): Replace with ...
3381 (finish_namespace_using_directive): ... this and ...
3382 (finish_local_using_directive): ... this.
3383 * name-lookup.c (add_using_namespace_1): Move later.
3384 (add_using_namespace): Move later, add namespace_p arg, remove
3386 (push_using_directive_1): Directly recurse.
3387 (do_using_directive, parse_using_directive): Delete, split into ...
3388 (finish_namespace_using_directive): ... this and ...
3389 (finish_local_using_directive): ... this.
3390 (push_namespace): Use add_using_namespace.
3391 * parser.c (cp_parser_using_directive): Call
3392 finish_namespace_using_directive or finish_local_using_directive.
3393 * pt.c (tsubst_expr): Call finish_local_using_directive.
3395 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
3396 * cp-tree.h (raw_dump_id): Declare.
3397 * decl2.c (raw_dump_id): Define.
3398 (dump_tu): Use raw_dump_id.
3400 * config-lang.in (gtfiles): Sort list, break lines.
3402 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
3403 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
3404 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
3405 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
3406 CPTI_RETHROW_FN): New.
3407 (noexcept_deferred_spec): New.
3408 (terminate_node, call_unexpected_node): Rename to ...
3409 (terminate_fn, call_unexpected_fn): ... here.
3410 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
3411 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
3412 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
3413 (init_exception_processing): Adjust.
3414 (declare_library_fn): Create and push the fns here.
3415 (do_get_exception_ptr, do_begin_catch, do_end_catch,
3416 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
3417 declare_library_fn use.
3418 (unevaluated_noexcept_spec): Adjust.
3419 * cp-gimplify.c (genericize_eh_spec_block,
3420 gimplify_most_not_throw_expr): Adjust.
3422 * name-lookup.c (pushdecl_top_level,
3423 pushdecl_top_level_and_finish): Move after namespace pushing and
3425 (push_to_top_level): Rename to ...
3426 (do_push_to_top_level): ... here. Remove timing code.
3427 (pop_from_top_level_1): Rename to ...
3428 (do_pop_from_top_level): ... here.
3429 (do_push_nested_namespace, do_pop_nested_namespace)
3430 (push_to_top_level): New wrapper for do_push_to_top_level.
3431 (pop_from_top_level): Adjust.
3432 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
3434 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
3436 * config-lang.in (gtfiles): Add c-family/c-format.c,
3437 except.c, init.c, lambda.c and friend.c.
3438 * class.c (dvirt_fn): Move out of function scope,
3440 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
3441 * init.c (fn): Likewise.
3442 * lambda.c (ptr_id, max_id): Likewise.
3443 * friend.c (global_friend): Add GTY attribute.
3445 2017-05-19 Nathan Sidwell <nathan@acm.org>
3447 * call.c (add_list_candidates): Use OVL_FIRST.
3448 (build_new_method_call_1): Likewise.
3449 * cp-tree.h (OVL_SINGLE_P): New.
3450 (TYPE_HIDDEN_P): New.
3451 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
3452 * dump.c (cp_tump_tree): Adjust overload dumping.
3453 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
3455 * method.c (lazily_declare_fn): Assert we added it.
3456 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
3458 (cp_parser_template_name): Use lkp_iterator.
3459 * pt.c (begin_template_parm_list): Fixup comment.
3460 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
3461 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
3462 (ovl_scope): Use lkp_iterator.
3464 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
3466 * parser.c (cp_parser_omp_clause_default): Handle
3467 "OMP_CLAUSE_DEFAULT_PRESENT".
3469 * parser.c (cp_parser_omp_clause_default): Avoid printing more
3470 than one syntax error message.
3472 2017-05-19 Nathan Sidwell <nathan@acm.org>
3474 * class.c (class_dump_id): Define.
3475 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
3476 * cp-objcp-common.c (cp_register_dumps): New.
3477 * cp-objcp-common.h (cp_register_dumps): Declare.
3478 (LANG_HOOKS_REGISTER_DUMPS): Override.
3479 * cp-tree.h (class_dump_id): Declare.
3481 2017-05-18 Nathan Sidwell <nathan@acm.org>
3483 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
3485 (lookup_keep): Declare.
3486 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
3487 * pt.c (tsubst_copy): Assert lookup is persistent.
3488 * semantics.c (finish_call_expr): Use lkp_iterator, call
3490 * tree.c (ovl_copy): New.
3491 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
3494 * cp-tree.h (OVL_USED): Replace with ...
3495 (OVL_USING_P): ... this.
3496 (ovl_iterator::using_p): Adjust.
3497 * name-lookup.c (push_overloaded_decl_1,
3498 do_nonmember_using_decl): Adjust.
3499 * search.c (lookup_field_r): Adjust.
3500 * tree.c (ovl_insert, ovl_scope): Adjust.
3502 * cp-tree.h (lookup_add): Swap args.
3503 (ovl_cons, build_overload): Delete.
3504 * name-lookup.c (add_function, push_overloaded_decl_1,
3505 do_nonmember_using_decl, merge_functions, remove_hidden_names):
3506 Use lookup_add, ovl_insert.
3507 * pt.c (check_explicit_specialization): Use lookup_add.
3508 (do_class_deduction): Likewise. Refactor if.
3509 * tree.c (lookup_add): Swap args.
3510 (ovl_cons, build_overload): Delete.
3512 * name-lookup.c (find_local_binding): New, broken out of ...
3513 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
3514 (set_namespace_binding): Swap scope & name args.
3515 (namespace_binding_1): Likewise.
3516 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
3517 (push_overloaded_decl_1): Likewise.
3518 (set_global_binding): Likewise.
3519 (get_namespace_binding): Adjust namespace_binding_1 call.
3521 2017-05-17 Nathan Sidwell <nathan@acm.org>
3523 * cp-tree.h (default_hash_traits <lang_identifier *>): New
3525 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
3526 (extern_c_fns): New hash table.
3527 (check_extern_c_conflict): New, broken out of ...
3528 (pushdecl_maybe_friend_1): ... here. Call it.
3529 (c_linkage_bindings): Just look in hash table.
3531 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
3535 Implement new C++ intrinsics __is_assignable and __is_constructible.
3536 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
3538 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3539 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3540 * method.c (constructible_expr): Set cp_unevaluated.
3541 (is_xible_helper): New.
3542 (is_trivially_xible): Adjust.
3544 * parser.c (cp_parser_primary_expression): Handle
3545 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
3546 (cp_parser_trait_expr): Likewise.
3547 * semantics.c (trait_expr_value): Handle
3548 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3550 2017-05-17 Nathan Sidwell <nathan@acm.org>
3552 * cp-tree.h (ovl_iterator::using_p): New predicate.
3553 (ovl_iterator::remove_node): New worker.
3554 (ovl_insert): Declare.
3555 * tree.c (ovl_insert): New.
3556 (ovl_iterator::remove_node): New.
3557 * class.c (add_method): Use ovl_iterator, ovl_insert.
3558 (clone_function_decl): Fix description.
3559 (clone_constructors_and_destructors): Use ovl_iterator.
3561 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
3562 (maybe_warn_about_overly_private_class): Use ovl_iterator.
3563 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
3564 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
3565 (get_base_fndecls): Use ovl_iterator.
3566 (warn_hidden): Use OVL_NAME, ovl_iterator.
3567 (add_implicitly_declared_members): Use ovl_iterator.
3568 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
3570 (finish_shorthand_constraint): Simplify, use ovl_make.
3571 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
3572 * search.c (shared_member_p): Use ovl_iterator.
3573 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
3574 (lookup_conversion_operator): Use OVL_FIRST.
3575 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
3576 (look_for_overrides_here): Use ovl_iterator.
3577 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
3578 * typeck.c (build_x_unary_op): Use ovl_make.
3580 2017-05-17 Martin Liska <mliska@suse.cz>
3582 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
3583 use it instead of int type.
3584 (dump_vtable): Likewise.
3585 (dump_vtt): Likewise.
3586 * decl2.c (dump_tu): Likewise.
3588 2017-05-16 David Malcolm <dmalcolm@redhat.com>
3590 * call.c (enforce_access): Add access_failure_info * param and use
3591 it to record access failures.
3592 * cp-tree.h (class access_failure_info): New class.
3593 (enforce_access): Add access_failure_info * param, defaulting to
3595 (lookup_member): Likewise.
3596 (locate_field_accessor): New function decl.
3597 (perform_or_defer_access_check): Add access_failure_info * param,
3599 * search.c (lookup_member): Add access_failure_info * param and
3600 pass it on to call to perform_or_defer_access_check.
3601 (matches_code_and_type_p): New function.
3602 (field_access_p): New function.
3603 (direct_accessor_p): New function.
3604 (reference_accessor_p): New function.
3605 (field_accessor_p): New function.
3606 (struct locate_field_data): New struct.
3607 (dfs_locate_field_accessor_pre): New function.
3608 (locate_field_accessor): New function.
3609 * semantics.c (perform_or_defer_access_check): Add
3610 access_failure_info * param, and pass it on to call to
3612 * typeck.c (access_failure_info::record_access_failure): New method.
3613 (access_failure_info::maybe_suggest_accessor): New method.
3614 (finish_class_member_access_expr): Pass an access_failure_info
3615 instance to the lookup_member call, and call its
3616 maybe_suggest_accessor method afterwards.
3618 2017-05-16 Marek Polacek <polacek@redhat.com>
3622 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
3624 2017-05-16 Nathan Sidwell <nathan@acm.org>
3626 * name-lookup.c (check_local_shadow): New, broke out of ...
3627 (pushdecl_maybe_friend_1): ... here. Call it.
3629 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
3630 (ovl_first): Move inline definition to end of file.
3631 (ovl_make, lookup_add): Declare.
3632 (get_fns, get_first_fn): Make pure.
3633 * tree.c (ovl_cache): New.
3634 (ovl_make, lookup_add): New.
3635 * pt.c (do_class_deduction): Don't add candidates that will be
3638 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
3639 (print_error_for_call_failure): Use OVL_NAME.
3640 (build_op_call_1): Use ovl_iterator.
3641 (add_candidates): Use OVL_FIRST & lkp_iterator.
3642 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
3644 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
3645 (type_has_user_nondefault_constructor,
3646 in_class_defaulted_default_constructor,
3647 type_has_user_provided_constructor,
3648 type_has_user_provided_or_explicit_constructor,
3649 type_has_non_user_provided_default_constructor,
3650 vbase_has_user_provided_move_assign,
3651 type_has_move_constructor, type_has_move_assign,
3652 type_has_user_declared_move_constructor,
3653 type_has_user_declared_move_assign,
3654 type_build_ctor_call, type_build_dtor_call,
3655 type_requires_array_cookie, explain_non_literal_class): Likewise.
3656 (finish_struct): Use lkp_iterator.
3657 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
3658 (note_name_declared_in_class): Use OVL_NAME.
3659 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
3660 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
3661 cxx_pretty_printer::expression): Likewise.
3662 * decl2.c (check_classfn): Use ovl_iterator.
3663 * pt.c (retrieve_specialization): Use ovl_iterator.
3664 * tree.c (cp_tree_equal): Use lkp_iterator.
3665 (type_has_nontrivial_copy_init): Use ovl_iterator.
3667 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
3668 check is_overloaded_fn.
3670 2017-05-16 Martin Liska <mliska@suse.cz>
3672 * parser.c (cp_lexer_print_token): Add default value for flags
3673 argument of print_gimple_stmt, print_gimple_expr,
3674 print_generic_stmt and print_generic_expr.
3676 2017-05-16 Nathan Sidwell <nathan@acm.org>
3678 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
3680 (MAYBE_BASELINK_FUNCTIONS): New.
3681 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
3682 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
3683 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
3684 * method.c (inherited_ctor_binfo): Use ovl_iterator.
3685 (binfo_inherited_from): Likewise.
3686 * parser.c (lookup_literal_operator): Use lkp_iterator.
3687 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
3688 (print_candidates_1): Likewise.
3689 (determine_specialization): Likewise.
3690 (resolve_overloaded_unification): Likewise.
3691 (resolve_nondeduced_context): Likewise.
3692 (type_dependent_expression_p): Likewise.
3693 (dependent_template_p): Likewise.
3694 * ptree.c (cxx_print_xnode): Likewise.
3695 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
3696 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
3697 * typeck.c (check_template_keyword): Use lkp_iterator.
3699 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
3701 * constexpr.c (function_concept_check): Use OVL_FIRST.
3702 * cvt.c (build_expr_type_conversion): Likewise.
3703 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
3704 * decl2.c (mark_used): Use OVL_FIRST.
3705 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
3706 (dump_expr, location_of): Use OVL_FIRST.
3707 * friend.c (do_friend): Use OVL_NAME.
3708 * init.c (build_offset_ref): Use OVL_FIRST.
3709 * mangle.c (write_member_name): Likewise.
3710 (write_expression): Use OVL_NAME.
3711 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
3712 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
3713 * pt.c (check_explicit_specialization): Use OVL_FIRST.
3714 (check_template_shadow): Likewise.
3715 (tsubst_template_args): Use OVL_NAME.
3716 (tsubst_baselink): Use OVL_FIRST.
3717 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
3718 * tree.c (get_first_fn): Use OVL_FIRST.
3719 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
3720 (cp_build_addr_expr_1): Use OVL_FIRST.
3722 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
3724 * semantics.c (finish_id_expression): Directly init local var.
3725 (finish_omp_reduction_clause): Use really_overloaded_fn.
3726 * tree.c (get_fns): Document. Assert we got an overload.
3727 (get_first_fn) Document.
3728 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
3729 really_overloaded_fn.
3730 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
3732 * cp-tree.h (SCOPE_DEPTH): New.
3733 * name-lookup.h (is_nested_namespace): Declare.
3734 * name-lookup.c (is_nested_namespace): New.
3735 (is_ancestor): Use it.
3736 (set_decl_namespace): Likewise.
3737 (push_namespace): Set SCOPE_DEPTH.
3738 * pt.c (check_specialization_namespace): Use is_nested_namespace.
3739 (check_unqualigied_spec_or_inst): Likewise.
3741 2017-05-15 Nathan Sidwell <nathan@acm.org>
3744 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
3745 * name-lookup.h (push_namespace): Return int, add make_inline arg.
3746 * name-lookup.c (push_namespace): Deal with inline directly.
3747 Return pushed count.
3748 * parser.c (cp_parser_namespace_definition): Adjust for
3749 push_namespace change.
3751 2017-05-11 Nathan Sidwell <nathan@acm.org>
3753 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
3754 LANG_HOOKS_PUSHDECL): Move to ...
3755 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
3756 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
3757 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
3759 * name-lookup.h (pushdecl): Add default friend parm.
3760 (pushdecl_maybe_friend): Delete.
3761 (pushdecl_top_level): Add default friend parm.
3762 (pushdecl_top_level_maybe_friend): Delete.
3763 * name-lookup.c (pushdecl_maybe_friend): Delete.
3764 (pushdecl): Add is_friend parm.
3765 (pushdecl_top_level): Add is friend_parm.
3766 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
3767 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
3768 * friend.c (do_friend): Adjust.
3769 * pt.c (tsubst_friend_class): Adjust.
3771 Revert pushdecl_top_level_and_finish name change.
3772 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
3773 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
3774 * decl.c (cp_make_fname_decl): Adjust.
3775 * decl2.c (get_guard, handle_tls_init): Adjust.
3776 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
3778 * name-lookup.c (pushdecl_outermost_localscope): Always
3779 conditionally stop timer.
3781 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
3782 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
3784 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
3785 pushtag_top_level_maybe_friend,
3786 pushdecl_top_level_and_finish): Move declarations to ...
3787 * name-lookup.h: ... here. Group pushdecl variants.
3788 (pushdecl_top_level_and_finish): Rename to ...
3789 (pushdecl_top_level_with_init): ... here.
3790 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
3791 * decl2.c (get_guard, handle_tls_init): Likewise.
3792 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
3793 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
3794 * method.c (implicitly_declare_fn): Likewise.
3795 * searchc (node_debug_info_needed): Likewise.
3796 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
3797 (pushdecl_top_level_with_init): ... here.
3798 (pop_everything): Use namespace_bindings_p.
3800 * name-lookup.h (pop_binding): Rename to pop_local_binding.
3801 (getdecls): Rename to get_local_decls.
3802 * name-lookup.c (pop_binding): Rename to ...
3803 (pop_local_binding): ... here.
3804 (pop_bindings_and_leave_scope): Adjust.
3805 (getdecls): Rename to ...
3806 (get_local_decls): ... here. Assert local scope.
3807 * decl.c (poplevel): Assert not namespace. Adjust and simplify
3809 (store_parm_decls): Adjust get_local_decls call.
3810 (parser.c (synthesize_implicit_template_parm): Likewise.
3812 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
3815 * method.c (is_trivially_xible): Reject void types.
3817 2017-05-10 Nathan Sidwell <nathan@acm.org>
3819 * class.c (handle_using_decl): Always use OVL_CURRENT.
3820 (resolve_address_of_overloaded_function): Move iterator decl into
3821 for scope. Don't strip anticipated decls here.
3823 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
3825 (print_candidates): Adjust.
3827 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
3829 * call.c (build_new_function_call): Lose koenig_p arg. Remove
3830 koenig_p handling here.
3831 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
3832 (tsubst_omp_clauses): Likewise.
3833 (do_class_deduction): Adjust buld_new_function_call calls.
3834 * semantics.c (finish_call_expr): Likewise.
3836 2017-05-10 Jason Merrill <jason@redhat.com>
3838 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
3839 (unify_type_mismatch, unify_parameter_pack_mismatch)
3840 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
3841 (unify_parameter_pack_inconsistent, unify_inconsistency)
3842 (unify_vla_arg, unify_method_type_error, unify_arity)
3843 (unify_arg_conversion, unify_no_common_base)
3844 (unify_inconsistent_template_template_parameters)
3845 (unify_template_deduction_failure)
3846 (unify_template_argument_mismatch)
3847 (unify_overload_resolution_failure): Call unify_invalid.
3849 CWG 1847 - Clarifying compatibility during partial ordering
3850 * pt.c (more_specialized_fn): No order between two non-deducible
3853 * pt.c (dependent_type_p): Make sure we aren't called with
3856 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3857 * pt.c (convert_template_argument): Just return an argument pack.
3858 (coerce_template_parameter_pack, template_parm_to_arg)
3859 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
3860 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
3861 Don't set the type of a NONTYPE_ARGUMENT_PACK.
3862 * parser.c (make_char_string_pack, make_string_pack): Likewise.
3864 2017-05-10 Nathan Sidwell <nathan@acm.org>
3866 * cp-tree.h (add_method, clone_function_decl): Change last arg to
3868 * class.c (add_method): Change third arg to bool. Adjust.
3869 (one_inheriting_sig, one_inherited_ctor): Adjust.
3870 (clone_function_decl): Change 2nd arg to bool. Adjust.
3871 (clone_constructors_and_destructors): Adjust.
3872 * lambda.c (maybe_add_lambda_conv_op): Adjust.
3873 * method.c (lazily_declare_fn): Adjust.
3874 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
3875 * semantics.c (finish_member_declaration): Adjust.
3877 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
3880 * decl.c (finish_function): To improve error recovery, change the
3881 logic for calling apply_deduced_return_type.
3883 2017-05-09 Jason Merrill <jason@redhat.com>
3885 PR c++/80605 - __is_standard_layout and empty base
3886 * class.c (check_bases): Ignore empty bases.
3888 PR c++/70979 - literal class and closure types
3889 * class.c (finalize_literal_type_property): Handle closures
3891 (explain_non_literal_class): Likewise.
3893 PR c++/66297, DR 1684 - literal class and constexpr member fns
3894 * constexpr.c (is_valid_constexpr_fn): Only complain about
3895 non-literal enclosing class in C++11.
3896 * class.c (finalize_literal_type_property): Likewise.
3898 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
3901 * pt.c (tsubst_decl): Early return error_mark_node if
3902 grok_ctor_properties returns false.
3904 2017-05-09 Jason Merrill <jason@redhat.com>
3906 PR c++/70167 - array prvalue treated as lvalue
3907 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
3909 * semantics.c (finish_compound_literal): Add fcl_context parameter.
3910 Only make a static variable for C99 syntax.
3911 * parser.c (cp_parser_postfix_expression): Pass it.
3912 * pt.c (tsubst_copy_and_build): Likewise.
3913 * call.c (extend_ref_init_temps): Set
3914 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
3916 2017-05-09 Nathan Sidwell <nathan@acm.org>
3918 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
3919 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
3920 * name-lookup.h (pushdecl_top_level): Declare.
3922 2017-05-08 Jason Merrill <jason@redhat.com>
3924 PR c++/80178 - parameter passing for uncopyable classes
3925 * tree.c (type_has_nontrivial_copy_init): True for classes with only
3926 deleted copy/move ctors.
3927 (remember_deleted_copy, maybe_warn_parm_abi): New.
3928 * decl.c (require_complete_types_for_parms, check_function_type):
3929 Call maybe_warn_parm_abi.
3930 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
3932 2017-05-08 Nathan Sidwell <nathan@acm.org>
3934 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
3935 (start_preparsed_function): Do decl pushing before setting
3936 current_funciton_decl and announcing it.
3938 * name-lookup.h (pushdecl_with_scope): Replace with ...
3939 (pushdecl_outermost_localscope): ... this.
3940 * name-lookup.c (pushdecl_with_scope): Replace with ...
3941 (pushdecl_outermost_localscope): ... this.
3942 (pushdecl_namespace_level): Adjust.
3943 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
3944 * lambda.c (insert_capture_proxy): Likewise.
3946 * class.c (build_vtbl_initializer): Don't shadow outer variable
3949 Revert _binding -> _value change.
3950 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
3951 (get_namespace_binding, set_global_binding): ... these.
3952 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
3953 (get_namespace_binding, set_global_binding): ... these.
3954 (arg_assoc_namespace, pushdecl_maybe_friend_1,
3955 check_for_out_of_scope_variable, push_overloaded_decl_1,
3956 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
3957 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
3958 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
3959 * decl.c (poplevel): Adjust.
3960 * pt.c (make_constrained_auto): Likewise.
3962 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
3964 PR translation/80280
3965 * call.c (print_z_candidate): Fix quoting.
3967 2017-05-05 David Malcolm <dmalcolm@redhat.com>
3969 * error.c (pedwarn_cxx98): Replace report_diagnostic
3970 with diagnostic_report_diagnostic.
3972 2017-05-05 Nathan Sidwell <nathan@acm.org>
3974 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
3975 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
3976 (IDENTIFIER_NAMESPACE_VALUE): Delete.
3977 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
3979 (get_namespace_value, set_global_value): ... these.
3980 (get_global_value_if_present, is_typename_at_global_scope): Delete.
3981 * decl.c (poplevel): Use get_namespace_value.
3982 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
3983 * class.c (build_vtbl_initializer): Stash library decl in
3984 static var. Use IDENTIFIER_GLOBAL_VALUE.
3985 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
3986 do_allocate_exception, do_free_exception, build_throw): Likewise.
3987 * init.c (throw_bad_array_new_length): Likewise.
3988 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
3989 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
3990 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
3991 get_namespace_value.
3992 (set_namespace_binding_1): Rename to
3993 (set_namespace_binding): ... here.
3994 (set_global_value): New.
3995 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
3996 get_namespace_value.
3997 * pt.c (listify): Use get_namespace_value.
3999 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
4001 * lex.c (unqualified_name_lookup_error): Likewise.
4003 * class.c (alter_class): Use retrofit_lang_decl directly.
4004 * decl.c (push_local_name, dupliate_decls): Likewise.
4005 * semantics.c (omp_privatize_field): Likewise.
4007 Kill walk_namespaces.
4008 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
4009 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
4011 Kill per-namespace static_decls.
4012 * cp-tree.h (static_decls): Declare.
4013 (wrapup_globals_for_namespace,
4014 diagnose_inline_vars_for_namespace): Replace with ...
4015 (wrapup_namespace_globals): ... this.
4016 * decl.c (static_decls): Define.
4017 (wrapup_globals_for_namespace,
4018 diagnose_inline_vars_for_namespace): Replace with ...
4019 (wrapup_namespace_globals): ... this.
4020 (cxx_init_decl_processing): Initialize static_decls.
4021 * decl2.c (c_parse_final_cleanups): Adjust.
4022 * name-lookup.h (cp_binding_level): Remove static_decls member.
4023 * name-lookup.c (add_decl_to_level): Adjust.
4024 (begin_scope): Adjust.
4026 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
4029 * decl.c (reshape_init): Unconditionally return error_mark_node
4030 upon error about too many initializers.
4032 2017-05-04 Nathan Sidwell <nathan@acm.org>
4034 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
4036 2017-05-04 Martin Sebor <msebor@redhat.com>
4038 PR translation/80280
4039 * call.c (print_z_candidate): Add missing quoting to %D and other
4041 (build_op_call_1): Same.
4042 * constraint.cc (diagnose_check_constraint): Same.
4043 * mangle.c (mangle_decl): Same.
4044 * name-lookup.c (cp_binding_level_debug): Same.
4045 (set_decl_namespace): Same.
4046 * parser.c (cp_parser_tx_qualifier_opt): Same.
4047 * pt.c (print_candidates_1): Same.
4048 (check_template_variable): Same.
4049 (tsubst_default_argument): Same.
4050 (most_specialized_partial_spec): Same.
4051 * semantics.c (omp_reduction_lookup): Same.
4052 * tree.c (check_abi_tag_redeclaration): Same.
4053 * typeck.c (comptypes): Same.
4054 * typeck2.c (abstract_virtuals_error_sfinae): Same.
4056 2017-05-04 Nathan Sidwell <nathan@acm.org>
4059 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
4060 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
4061 CPTI_INIT_LIST_IDENTIFIER.
4062 (global_namespace, global_type_node, global_identifier,
4063 anon_identifier, init_list_identifier): New.
4064 * decl.c (global_type_node, global_scope_name): Delete.
4065 (initialize_predefined_identifiers): Add new identifiers.
4066 (cxx_init_decl_processing): Adjust.
4067 * name-lookup.h (global_namespace, global_type_node): Delete.
4068 * name-lookup.c (global_namespace, anonymous_namespace_name,
4069 get_anonymous_namespace_name): Delete.
4070 (namespace_scope_ht_size, begin_scope, pushtag_1,
4071 push_namespace): Adjust,
4072 * call.c (type_has_extended_temps): Use init_list_identifier.
4073 * pt.c (listify): Likewise.
4075 * name-lookup.c: Reorder functions to make merging from modules
4078 2017-05-03 Jason Merrill <jason@redhat.com>
4080 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
4082 2017-05-03 Nathan Sidwell <nathan@acm.org>
4084 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
4085 along with #defines, to before name-lookup include.
4087 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
4089 * pt.c (is_auto_or_concept): Remove.
4090 (type_uses_auto_or_concept): Remove, unused.
4091 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
4092 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
4093 * cp-tree.h (is_auto_or_concept): Remove.
4095 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
4098 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
4099 add pedigree operation and detach call here.
4100 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
4101 cilk_cp_gimplify_call_params_in_spawned_fn.
4102 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
4103 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
4105 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
4107 * parser.c (cp_parser_member_declaration): Add fix-it hints for
4108 stray comma and missing semicolon at end of member declaration.
4110 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
4112 * parser.c (cp_parser_cast_expression): Add target type of cast to
4114 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
4116 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
4118 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
4119 return type to bool.
4120 * cp-tree.h (grok_ctor_properties): Update.
4122 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
4124 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
4125 information to diagnostic of invalid colon in nested-name-specifier.
4127 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
4129 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
4130 diagnostic of invalid class/struct keyword after enum.
4132 2017-04-25 David Malcolm <dmalcolm@redhat.com>
4134 * parser.c (cp_parser_member_declaration): Add fix-it hint
4135 for removing stray semicolons.
4137 2017-04-25 David Malcolm <dmalcolm@redhat.com>
4139 * name-lookup.c (get_std_name_hint): New function.
4140 (maybe_suggest_missing_header): New function.
4141 (suggest_alternative_in_explicit_scope): Call
4142 maybe_suggest_missing_header.
4144 2017-04-25 David Malcolm <dmalcolm@redhat.com>
4147 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
4148 candidate type of bm from tree to const char *.
4149 (consider_binding_level): Likewise.
4150 (lookup_name_fuzzy): Likewise, using this to merge the best
4151 result from the preprocessor into bm, rather than immediately
4152 returning, so that better matches from reserved words can "win".
4153 Guard the rejection of keywords that don't start decl-specifiers
4154 so it only happens for FUZZY_LOOKUP_TYPENAME.
4156 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
4158 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
4159 (start_enum): Likewise.
4160 (build_enumerator): Likewise. Use %qE instead of plain %E.
4161 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
4162 %<%D%> in diagnostics.
4163 (cp_parser_elaborated_type_specifier): Likewise.
4164 * pt.c (make_pack_expansion): Use %qT and %qE instead of
4165 %<%T%> and %<%E%> in diagnostics.
4166 (tsubst_pack_expansion): Likewise.
4168 2017-04-24 David Malcolm <dmalcolm@redhat.com>
4171 * parser.c (cp_parser_unary_expression): Generate a location
4172 range for alignof and sizeof expressions.
4174 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
4176 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
4178 (cp_parser_virt_specifier_seq_opt): Likewise.
4179 (set_and_check_decl_spec_loc): Likewise twice.
4181 2017-04-21 Jason Merrill <jason@redhat.com>
4183 PR c++/80179 - ICE with initialized flexible array member.
4184 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
4186 2017-04-21 Richard Biener <rguenther@suse.de>
4188 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
4189 (copy_type): Likewise.
4190 * lex.c (copy_decl): Pass down mem-stat info.
4191 (copy_type): Likewise.
4193 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
4196 * init.c (build_new_1): Suppress notes about over-aligned new when
4197 the warning is suppressed.
4199 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
4201 * parser.c (cp_parser_member_declaration): Add warning with fixit
4202 information for extra semicolon after in-class function definition.
4204 2017-04-20 Jakub Jelinek <jakub@redhat.com>
4207 * tree.c (build_cplus_array_type): Call build_array_type
4208 with the intended TYPE_TYPELESS_STORAGE flag value, instead
4209 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
4212 2017-04-18 Marek Polacek <polacek@redhat.com>
4214 PR c++/80244 - ICE with attribute in template alias.
4215 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
4217 PR c++/80241 - ICE with alignas pack expansion.
4218 * error.c (dump_expr): Handle TREE_LIST.
4219 * parser.c (cp_parser_std_attribute_list): Return error_mark if
4220 make_pack_expansion returns an error.
4222 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
4225 * class.c (fixup_may_alias): Fix all type variants.
4227 2017-04-17 Jason Merrill <jason@redhat.com>
4229 PR c++/80415 - wrong error with default arg and array reference.
4230 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
4232 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
4234 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
4236 * decl.c (name_unnamed_type): Split out of...
4237 (grokdeclarator): ... this.
4238 * decl.h (name_unnamed_type): Declare.
4240 2017-04-12 Richard Biener <rguenther@suse.de>
4241 Bernd Edlinger <bernd.edlinger@hotmail.de>
4244 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
4245 for arrays of character or std::byte type.
4247 2017-04-11 Jason Merrill <jason@redhat.com>
4249 PR c++/80294 - ICE with constexpr and inheritance.
4250 * constexpr.c (reduced_constant_expression_p):
4251 A null constructor element is non-constant.
4252 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
4253 returning an empty base.
4255 2017-04-11 Jakub Jelinek <jakub@redhat.com>
4258 * decl.c (cp_finish_decomp): If processing_template_decl on
4259 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
4260 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
4261 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
4263 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
4264 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
4267 2017-04-11 Jakub Jelinek <jakub@redhat.com>
4270 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
4272 2017-04-10 Jakub Jelinek <jakub@redhat.com>
4275 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
4276 operand, if it is a static member function, recurse on the
4279 2017-04-10 Marek Polacek <polacek@redhat.com>
4282 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
4283 ORIG_TYPE earlier and not only when shortening.
4285 2017-04-07 Jason Merrill <jason@redhat.com>
4287 PR c++/80356 - ICE with reference to function template argument.
4289 * pt.c (convert_nontype_argument_function): Adjust type even with a
4290 value-dependent argument.
4292 PR c++/80267 - ICE with nested capture of reference
4294 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
4296 2017-04-07 Marek Polacek <polacek@redhat.com>
4299 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
4302 * call.c (build_over_call): Don't check cxx_dialect.
4303 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
4304 whether SUB is a CONSTRUCTOR.
4305 * init.c (build_new_1): Don't check cxx_dialect.
4306 * tree.c (replace_placeholders): Add a function comment. Return if
4307 not in C++14, or if the object isn't a (member of a) class.
4308 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
4309 TYPE is CLASS_TYPE_P.
4311 2017-04-05 Jakub Jelinek <jakub@redhat.com>
4314 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
4315 of a loop doing vec_safe_push of NULL. Formatting fixes.
4316 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
4317 to newidx before calling canonical_type_parameter on newtype.
4319 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
4322 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
4323 UNARY_PLUS_EXPR case.
4325 2017-04-03 Jason Merrill <jason@redhat.com>
4327 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
4329 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
4331 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
4332 * decl2.c (one_static_initialization_or_destruction): Likewise.
4333 * name-lookup.c (store_bindings): Likewise.
4334 * parser.c (make_call_declarator): Likewise.
4335 * pt.c (check_explicit_specialization): Likewise.
4337 2017-04-03 Jason Merrill <jason@redhat.com>
4339 PR sanitizer/79993 - ICE with VLA initialization from string
4340 PR c++/69487 - wrong VLA initialization from string
4341 * init.c (finish_length_check): Split out from build_vec_init.
4342 (build_vec_init): Handle STRING_CST.
4343 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
4344 (digest_init_r): Don't give a STRING_CST VLA type.
4346 2017-03-31 Jakub Jelinek <jakub@redhat.com>
4349 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
4350 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
4351 for NOP_EXPR to REFERENCE_TYPE.
4354 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
4355 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
4357 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
4358 Remove extraneous parens.
4359 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
4360 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
4361 (cp_parser_trait_expr): Likewise.
4363 2017-03-27 Jakub Jelinek <jakub@redhat.com>
4366 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
4367 * typeck.c (cxx_mark_addressable): Likewise. Look through
4368 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
4370 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
4372 2017-03-24 Jason Merrill <jason@redhat.com>
4374 PR c++/77339 - ICE with invalid use of alias template.
4375 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
4378 2017-03-24 Marek Polacek <polacek@redhat.com>
4381 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
4382 doesn't have side effects.
4384 2017-03-23 Jason Merrill <jason@redhat.com>
4386 PR c++/80150 - ICE with overloaded variadic deduction.
4387 * pt.c (try_one_overload): Remove asserts.
4389 PR c++/77563 - missing ambiguous conversion error.
4390 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
4392 2017-03-23 Marek Polacek <polacek@redhat.com>
4394 * cp-tree.h: Remove a C_RID_YYCODE reference.
4396 2017-03-22 Jakub Jelinek <jakub@redhat.com>
4399 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
4400 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
4401 processing_template_decl.
4403 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
4406 * name-lookup.c (pushtag_1): Add check for bogus, non template,
4407 std::initializer_list.
4409 2017-03-21 Jakub Jelinek <jakub@redhat.com>
4412 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
4414 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
4417 * init.c (std_placement_new_fn_p): New.
4418 (build_new_1): Call it.
4420 2017-03-20 Jason Merrill <jason@redhat.com>
4422 PR c++/80096 - ICE with C++17 non-type auto.
4423 * pt.c (tsubst): Delay tsubst of type of template non-type
4426 PR c++/79519 - ICE with deleted template friend.
4427 * decl.c (grokdeclarator): Complain about misplaced function
4428 definition using =, as well.
4430 PR c++/79640 - infinite recursion with generic lambda.
4431 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
4432 before substituting its initializer.
4434 2017-03-20 Marek Polacek <polacek@redhat.com>
4435 Paolo Carlini <paolo.carlini@oracle.com>
4437 PR c++/80059 - ICE with noexcept and __transaction_atomic
4438 * except.c (build_must_not_throw_expr): Call
4439 instantiate_non_dependent_expr.
4441 2017-03-19 Jason Merrill <jason@redhat.com>
4443 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
4444 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
4445 reference decomposition.
4447 PR c++/80077 - error with constexpr and -fno-elide-constructors.
4448 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
4449 expanding trivial constructor.
4451 2017-03-17 Jason Merrill <jason@redhat.com>
4453 PR c++/78345 - ICE initializing array from lambda.
4454 * init.c (build_aggr_init): Check array initializer.
4455 (build_vec_init): Check the type of a CONSTRUCTOR.
4457 PR c++/80073 - C++17 ICE with virtual base.
4458 * decl.c (xref_basetypes): Also check for indirect vbases.
4460 2017-03-16 Jason Merrill <jason@redhat.com>
4462 * decl.c (start_enum): std::byte aliases anything.
4465 * constexpr.c (lookup_placeholder): Tweak.
4467 2017-03-15 Jason Merrill <jason@redhat.com>
4469 PR c++/80043 - ICE with -fpermissive
4470 * typeck.c (convert_for_assignment): Handle instantiate_type
4471 not giving an error.
4473 2017-03-14 Nathan Sidwell <nathan@acm.org>
4475 PR c++/79393 DR 1658 workaround
4476 * method.c (synthesized_method_base_walk): Inihibit abstract class
4477 virtual base access check here.
4478 (synthesized_method_walk): Not here.
4480 2017-03-13 Nathan Sidwell <nathan@acm.org>
4482 PR c++/79393 DR 1658 workaround
4483 * method.c (synthesized_method_walk): Check vbases of abstract
4484 classes for dtor walk.
4486 2017-03-10 David Malcolm <dmalcolm@redhat.com>
4488 PR translation/79848
4489 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
4491 2017-03-10 Jason Merrill <jason@redhat.com>
4493 PR c++/79960 - alias templates and partial ordering
4494 * pt.c (comp_template_args): Add partial_order parm.
4495 (template_args_equal): Likewise.
4496 (comp_template_args_porder): New.
4497 (get_partial_spec_bindings): Use it.
4499 2017-03-10 Marek Polacek <polacek@redhat.com>
4502 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
4504 2017-03-10 Jakub Jelinek <jakub@redhat.com>
4507 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
4508 Use XALLOCAVEC macro.
4511 * decl.c (finish_enum_value_list): If value is error_mark_node,
4512 don't copy it and change its type.
4513 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
4514 of CONST_DECL is error_mark_node.
4516 2017-03-09 Marek Polacek <polacek@redhat.com>
4518 PR c++/79900 - ICE in strip_typedefs
4519 * tree.c (strip_typedefs): Skip the attribute handling if T is
4520 a variant type which hasn't been updated yet.
4522 PR c++/79687 - wrong code with pointer-to-member
4523 * init.c (constant_value_1): Break if the variable has a dynamic
4526 2017-03-08 Jason Merrill <jason@redhat.com>
4528 PR c++/79797 - ICE with self-reference in array DMI.
4529 * constexpr.c (lookup_placeholder): Split out...
4530 (cxx_eval_constant_expression): ...from here.
4532 2017-03-07 Jakub Jelinek <jakub@redhat.com>
4535 * parser.c (cp_parser_omp_cancellation_point,
4536 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
4537 cp_parser_omp_target_update): Change "may only be used in compound
4538 statements" diagnostics, such that the same translatable string is
4539 used for all pragmas.
4540 (cp_parser_pragma): Likewise. Use error_at instead of
4541 cp_parser_error for that diagnostics.
4543 2017-03-06 Marek Polacek <polacek@redhat.com>
4545 PR c++/79796 - ICE with NSDMI and this pointer
4546 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
4547 replace_placeholders.
4549 2017-03-06 Jakub Jelinek <jakub@redhat.com>
4552 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
4555 2017-03-06 Jason Merrill <jason@redhat.com>
4557 Revert "Allow deduction guides to look into primary template."
4558 * cp-tree.h, parser.c, pt.c, search.c: Revert.
4560 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
4563 * except.c (build_must_not_throw_expr): Perform the implicit
4564 conversions on the condition.
4566 2017-03-03 Jason Merrill <jason@redhat.com>
4568 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
4571 Core issues 2273 and 2277
4572 * call.c (joust): Adjust using-declaration tiebreaker to handle
4573 the intermediate base case.
4574 * method.c (strip_inheriting_ctors): Just return the argument if
4575 !flag_new_inheriting_ctors.
4577 2017-03-03 Richard Biener <rguenther@suse.de>
4580 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
4582 2017-03-03 Marek Polacek <polacek@redhat.com>
4585 * typeck.c (string_conv_p): In C++11, always call pedwarn with
4588 2017-03-02 Jason Merrill <jason@redhat.com>
4590 Update overload resolution with deduction guides.
4591 * pt.c (do_class_deduction): Always build the copy guide.
4592 (copy_guide_p, template_guide_p): New.
4593 (build_deduction_guide): Remember the original constructor.
4594 * call.c (joust): Prefer the copy guide and non-template guides.
4596 Allow deduction guides to look into primary template.
4597 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
4598 (struct cp_decl_specifier_seq): Add constructor_p.
4599 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
4600 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
4601 Clear deduction_guide_type. Don't handle deduction guide names.
4602 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
4603 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
4604 (cp_parser_member_declaration, cp_parser_cache_defarg)
4605 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
4606 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
4607 (build_deduction_guide): Set deduction_guide_type.
4608 (dependent_scope_p): Check deduction_guide_type.
4609 * search.c (lookup_member): Likewise.
4611 2017-03-02 Jakub Jelinek <jakub@redhat.com>
4614 * init.c (mark_exp_read_r): New function.
4615 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
4616 whole arguments instead of plain mark_exp_read on TREE_LIST values.
4618 2017-03-01 Jason Merrill <jason@redhat.com>
4620 Class template argument deduction in new-expression
4621 * init.c (build_new): Handle deduction from no initializer.
4622 * parser.c (cp_parser_new_expression): Don't require a single
4623 expression for class template deduction.
4624 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
4625 class template placeholder.
4626 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
4627 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
4628 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
4630 2017-03-01 Jakub Jelinek <jakub@redhat.com>
4633 * init.c (emit_mem_initializers): When not constructing vbases of
4634 abstract classes, mark arguments as read for
4635 -Wunused-but-set-parameter.
4637 2017-02-28 Jason Merrill <jason@redhat.com>
4639 Class template argument deduction refinements
4640 * call.c (joust): Move deduction guide tiebreaker down.
4641 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
4642 deduction with no initializer.
4643 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
4644 (do_class_deduction): Use that rather than special case.
4645 (do_auto_deduction): Handle null initializer.
4647 2017-02-28 Jakub Jelinek <jakub@redhat.com>
4649 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
4650 instead of just cond ? "..." : "...".
4651 (grokdeclarator): Likewise.
4652 (build_enumerator): Likewise.
4653 * init.c (build_new_1): Likewise.
4654 * call.c (build_new_method_call_1): Likewise.
4655 * parser.c: Include intl.h.
4656 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
4657 "enter"/"exit" keyword.
4658 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
4661 2017-02-27 Jason Merrill <jason@redhat.com>
4663 PR c++/71568 - SFINAE forming pointer to member function
4664 * init.c (build_offset_ref): Check the return value of
4665 perform_or_defer_access_check.
4667 2017-02-27 Marek Polacek <polacek@redhat.com>
4669 * decl.c (expand_static_init): Add missing } in a comment.
4671 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
4673 * init.c: Include intl.h.
4674 (build_new_1): Move message strings into pedwarn to make them
4675 -Wformat-security friendly. Mark string for translation.
4676 * pt.c (tsubst_copy_and_build): Mark string for translation.
4677 Make the pointer const.
4678 * semantics.c (finish_id_expression): Mark strings for translation.
4680 2017-02-25 Jakub Jelinek <jakub@redhat.com>
4682 * call.c (build_op_delete_call): Make msg1 and msg2 const.
4684 2017-02-24 Jakub Jelinek <jakub@redhat.com>
4687 * call.c (build_over_call): Call check_function_arguments even for
4688 -Wrestrict, adjust check_function_arguments caller.
4689 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
4691 * typeck.c (cp_build_function_call_vec): Adjust
4692 check_function_arguments caller.
4694 2017-02-24 Marek Polacek <polacek@redhat.com>
4696 PR translation/79705
4697 * decl.c (check_redeclaration_exception_specification): Mark a string
4698 for translation. Make the pointer const.
4700 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
4703 * pt.c (register_specialization): Check duplicate_decls return value
4704 for error_mark_node and pass it back.
4706 2017-02-22 Jason Merrill <jason@redhat.com>
4708 PR c++/79679 - missing destructor for argument
4709 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
4712 * pt.c (do_class_deduction): Handle 0 argument case.
4714 2017-02-22 Jakub Jelinek <jakub@redhat.com>
4717 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
4718 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
4719 * constexpr.c (potential_constant_expression_1): Handle
4720 OMP_*, OACC_* and CILK_* trees. Use error_at with
4721 EXPR_LOC_OR_LOC (t, input_location) computed early
4722 instead of error, or error_at with location_of (t).
4724 2017-02-22 Marek Polacek <polacek@redhat.com>
4727 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
4728 if the alignas expression is erroneous.
4729 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
4733 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
4735 2017-02-21 Jason Merrill <jason@redhat.com>
4737 PR c++/50308 - wrong deprecated warning with ADL
4738 PR c++/17729 - duplicate deprecated warning
4739 * semantics.c (finish_id_expression): Only call mark_used on a
4740 function if we aren't building a call.
4742 PR c++/41727 - ICE with partial spec of partial instantiation
4743 * pt.c (process_partial_specialization): For now, don't check more
4744 specialized if there is more than one level of args.
4746 2017-02-21 Marek Polacek <polacek@redhat.com>
4749 * cp-tree.h (maybe_reject_flexarray_init): Declare.
4750 * init.c (maybe_reject_flexarray_init): No longer static.
4751 Add check for current_function_decl.
4752 * parser.c (cp_parser_late_parse_one_default_arg): Reject
4753 a default mem-initializer for a flexible array.
4755 2017-02-21 Jakub Jelinek <jakub@redhat.com>
4756 Paolo Carlini <paolo.carlini@oracle.com>
4759 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
4761 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
4762 decl after the decomposition artificial decl has error_mark_node.
4763 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
4764 instead of just == error_mark_node comparison.
4766 2017-02-21 Jakub Jelinek <jakub@redhat.com>
4769 * decl.c: Include gimplify.h.
4770 (cp_finish_decomp): Make sure there is no sharing of trees
4771 in between DECL_VALUE_EXPR of decomposition decls.
4774 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
4777 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
4778 call cplus_expand_constant on it first.
4780 2017-02-19 Jason Merrill <jason@redhat.com>
4782 PR c++/78139 - destructor needed by new-expression
4783 * call.c (build_special_member_call): Use tf_no_cleanup.
4785 PR c++/78282 - auto template and pack expansion
4786 * pt.c (find_parameter_packs_r): Don't walk into the type of
4787 templates other than template template-parameters.
4789 PR c++/79606 - ICE with this->base_member in NSDMI
4790 * class.c (build_base_path): Check processing_template_decl.
4792 PR c++/79607 - ICE with T{} initializer
4793 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
4795 PR c++/79566 - elaborated-type-specifier in range for
4796 * parser.c (cp_parser_simple_declaration): Fix check for type
4799 PR c++/79400 - confusing suggestion of 'noexcept'
4800 * parser.c (cp_parser_exception_specification_opt): Remove
4801 suggestion for deprecated dynamic exception-specification.
4803 PR c++/79470 - partial ordering with reference parameters
4804 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
4806 PR c++/79500 - ICE with non-template deduction guide
4807 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
4808 DECL_TEMPLATE_RESULT.
4810 PR c++/79580 - ICE with compound literal
4811 * parser.c (cp_parser_class_head): If we're in the middle of an
4812 expression, use ts_within_enclosing_non_class.
4814 PR c++/79503 - inherited ctor taking base class
4815 * call.c (add_function_candidate): Also check that
4816 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
4818 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
4821 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
4824 2017-02-19 Eric Fiselier <eric@efcs.ca>
4825 Jonathan Wakely <jwakely@redhat.com>
4828 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
4829 control warning about literal suffix identifiers without a leading
4832 2017-02-17 Jason Merrill <jason@redhat.com>
4834 PR c++/79508 - lookup error with member template
4835 * parser.c (cp_parser_template_name): Clear
4836 parser->context->object_type if we aren't doing lookup.
4838 PR c++/78690 - ICE with using and global type with same name
4839 * pt.c (type_dependent_object_expression_p): True for
4842 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
4843 * pt.c (convert_template_argument): Just return an auto arg pack.
4844 (tsubst_template_args): Don't tsubst an auto pack type.
4846 PR c++/79556 - C++17 ICE with non-type auto
4847 * pt.c (do_auto_deduction): Don't try to deduce from null type.
4849 PR c++/79533 - C++17 ICE with temporary cast to reference
4850 * call.c (build_over_call): Conversion to a reference prevents copy
4853 2017-02-16 Jakub Jelinek <jakub@redhat.com>
4854 Jason Merrill <jason@redhat.com>
4856 PR c++/79502 - lost nodiscard attribute
4857 * pt.c (apply_late_template_attributes): Do apply non-dependent
4858 attributes to types.
4860 2017-02-16 Jason Merrill <jason@redhat.com>
4862 PR c++/78572 - ICE with self-modifying array initializer
4863 * constexpr.c (cxx_eval_store_expression): The object we're
4864 initializing is outside the constant-expression.
4865 (cxx_eval_call_expression): Set ctx->call.
4867 PR c++/79050 - ICE with undeduced auto and LTO
4868 * decl.c (poplevel): Remove undeduced auto decls.
4870 2017-02-16 Jakub Jelinek <jakub@redhat.com>
4873 * parser.c (cp_parser_omp_target): For -fopenmp-simd
4874 ignore #pragma omp target even when not followed by identifier.
4876 2017-02-15 Jason Merrill <jason@redhat.com>
4877 Jakub Jelinek <jakub@redhat.com>
4879 PR c++/79464 - ICE in IPA with omitted constructor parms
4880 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
4881 (adjust_clone_args): Adjust.
4882 (add_method): Remember omitted parms.
4883 * call.c (add_function_candidate): Likewise.
4884 * mangle.c (write_method_parms): Likewise.
4885 * method.c (ctor_omit_inherited_parms): Return false if there are no
4888 2017-02-15 Martin Sebor <msebor@redhat.com>
4891 * init.c (maybe_reject_flexarray_init): New function.
4892 (perform_member_init): Call it.
4894 2017-02-15 Jakub Jelinek <jakub@redhat.com>
4897 * parser.c (cp_parser_std_attribute): Don't pedwarn about
4898 [[deprecated]] with -std=c++11 and [[fallthrough]] with
4899 -std=c++11 and -std=c++14.
4902 * decl.c (grokdeclarator): For static data members, handle thread_p
4903 only after handling inline.
4905 2017-02-14 Marek Polacek <polacek@redhat.com>
4909 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
4910 clobbering if the postfix expression isn't an EXPR_P.
4912 2017-02-13 Jason Merrill <jason@redhat.com>
4914 PR c++/79461 - ICE with lambda in constexpr constructor
4915 * constexpr.c (build_data_member_initialization): Ignore
4916 initialization of a local variable.
4918 2017-02-13 Jakub Jelinek <jakub@redhat.com>
4920 * init.c (warn_placement_new_too_small): Add missing space in
4922 * parser.c (cp_parser_oacc_declare): Likewise.
4923 * mangle.c (maybe_check_abi_tags): Likewise.
4926 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
4927 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
4928 in the rightmost operand.
4930 2017-02-13 Nathan Sidwell <nathan@acm.org>
4932 PR c++/79296 - ICE mangling localized template instantiation
4933 * decl2.c (determine_visibility): Use template fn context for
4934 local class instantiations.
4936 2017-02-11 Jason Merrill <jason@redhat.com>
4938 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
4939 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
4940 (build_new_1): Use replace_placeholders.
4941 * tree.c (replace_placeholders_t): Also track whether we've seen a
4943 (replace_placeholders, replace_placeholders_r): Adjust.
4944 * cp-tree.h: Adjust.
4946 PR c++/77790 - ICE with auto function in C++11 mode
4947 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
4948 (require_deduced_type): Add complain parm, return bool.
4949 * cp-tree.h: Adjust.
4950 * decl2.c (mark_used): Use require_deduced_type.
4952 2017-02-10 Jason Merrill <jason@redhat.com>
4954 PR c++/78908 - template ops and bitfields
4955 * tree.c (build_min_non_dep): Use unlowered_expr_type.
4957 PR c++/78897 - constexpr union
4958 * constexpr.c (cxx_eval_store_expression): A store to a union member
4959 erases a previous store to another member.
4961 PR c++/71285 - member of fold-expression
4962 * semantics.c (finish_unary_fold_expr)
4963 (finish_binary_fold_expr): Use null type for fold-expressions.
4965 PR c++/79401 - protected inherited constructor
4966 * call.c (enforce_access): For inheriting constructor, find a base
4967 binfo in the path we already have.
4969 2017-02-10 Marek Polacek <polacek@redhat.com>
4972 * pt.c (type_dependent_expression_p): Check if the expression type
4976 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
4977 if warnings shouldn't be given.
4979 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
4982 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
4983 an error_mark_node as type.
4985 2017-02-09 Jakub Jelinek <jakub@redhat.com>
4986 Jason Merrill <jason@redhat.com>
4989 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
4990 from pattern to type.
4992 2017-02-09 Jason Merrill <jason@redhat.com>
4994 PR c++/79316 - default argument in deduction guide
4995 PR c++/79350 - explicit deduction guide
4996 * parser.c (cp_parser_constructor_declarator_p)
4997 (cp_parser_direct_declarator): Parse deduction guides more like
4999 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
5000 * tree.c (special_function_p): Return it.
5001 * decl.c (check_special_function_return_type): Handle it.
5002 (grokdeclarator, grokfndecl): Adjust.
5003 (cp_finish_decl): Pass flags to do_auto_deduction.
5004 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
5005 * pt.c (dguide_name_p): Take a const_tree.
5006 (do_class_deduction): Handle explicit.
5007 (do_auto_deduction): Pass flags through.
5008 (build_deduction_guide): Copy explicit flag.
5010 2017-02-09 Jakub Jelinek <jakub@redhat.com>
5013 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
5014 non-pragma_compound context here.
5015 (cp_parser_omp_target): Likewise.
5016 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
5017 parsing for ordered and target omp pragmas in non-pragma_stmt
5018 non-pragma_compound contexts.
5021 * parser.c (cp_parser_oacc_declare): Formatting fix.
5022 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
5023 automatic variables.
5025 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
5026 Chung-Lin Tang <cltang@codesourcery.com>
5028 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
5029 parsing. Parse constant expression. Remove semantic checking.
5030 (cp_parser_omp_clause_collapse): Disallow tile.
5031 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
5032 error about missing for after already emitting one. Use more
5033 conventional for idiom for unbounded loop.
5034 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
5035 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
5036 (finish_omp_for): Deal with tile clause.
5038 2017-02-07 Nathan Sidwell <nathan@acm.org>
5040 * method.c (synthesized_method_base_walk): New. Broken out of ...
5041 (synthesized_method_walk): ... here. Call it. Cleanup
5044 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
5047 * typeck2.c (process_init_constructor_union): Consider only
5048 FIELD_DECLs when looking for an NSDMI.
5050 2017-02-06 Jason Merrill <jason@redhat.com>
5052 PR c++/71193 - incomplete types in templates
5053 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
5054 handle incomplete type by pedwarning and then treating as dependent.
5056 2017-02-06 Jakub Jelinek <jakub@redhat.com>
5059 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
5060 (potential_constant_expression_1): Likewise.
5063 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
5064 allow one fewer than expected arguments if flag_permissive.
5067 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
5068 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
5069 with error_mark_node type.
5071 2017-02-03 Jason Merrill <jason@redhat.com>
5073 PR c++/78689 - ICE on constructor with label
5074 * optimize.c (maybe_clone_body): Replace omitted parameters with
5076 * class.c (build_clone): Fix logic for omitting inherited parms.
5078 PR c++/12245 - excessive memory use
5079 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
5080 back in. Don't cache constants.
5081 (maybe_constant_init): Don't cache constants.
5083 PR c++/79294 - ICE with invalid template argument
5084 * pt.c (convert_nontype_argument_function): Check value-dependence.
5085 (convert_nontype_argument): Don't check it here for function ptrs.
5087 2017-02-02 Richard Biener <rguenther@suse.de>
5090 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
5091 it lazily on the first changed element only and copy it
5092 fully upfront, only storing changed elements.
5094 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
5097 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
5100 2017-01-31 Jakub Jelinek <jakub@redhat.com>
5103 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
5106 2017-01-31 David Malcolm <dmalcolm@redhat.com>
5109 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
5110 any namespace aliases.
5112 2017-01-31 Nathan Sidwell <nathan@acm.org>
5115 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
5119 * pt.c: (instantiate_decl): Push to top level when current
5120 function scope doesn't match. Only push lmabda scope stack when
5123 * cp-tree.h (instantiate_decl): Make defer_ok bool.
5124 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
5125 (instantiate_decl): Simplify and reorder state saving and restoration.
5128 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
5129 * semantics.c (finish_member_declaration): Assert class is being
5132 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
5134 Introduce C++ support in libcc1.
5135 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
5136 (ansi_opname): Rename to...
5137 (cp_operator_id): ... this. Adjust all callers.
5138 (ansi_assopname): Rename to...
5139 (cp_assignment_operator_id): ... this. Adjust all callers.
5140 (cp_literal_operator_id): Declare.
5141 (set_global_friend): Declare.
5142 (is_global_friend): Declare.
5143 (enum cp_oracle_request): New type.
5144 (cp_binding_oracle_function): New type.
5145 (cp_binding_oracle): Declare.
5146 (cp_finish_injected_record_type): Declare.
5147 * friend.c (global_friend): New var.
5148 (set_global_friend): New fn.
5149 (is_global_friend): New fn.
5150 (is_friend): Call is_global_friend.
5151 * name-lookup.c (cp_binding_oracle): New var.
5152 (query_oracle): New fn.
5153 (qualified_lookup_using_namespace): Call query_oracle.
5154 (lookup_name_real_1): Likewise.
5155 * parser.c (cp_literal_operator_id): Drop static.
5156 * search.c (friend_accessible_p): Call is_global_friend.
5157 * semantics.c (is_this_parameter): Accept a variable if the
5158 binding oracle is enabled.
5160 2017-01-27 Jason Merrill <jason@redhat.com>
5162 PR c++/78771 - ICE with inherited constructor.
5163 * call.c (build_over_call): Call deduce_inheriting_ctor here.
5164 * pt.c (tsubst_decl): Not here.
5165 * class.c (add_method): Or here.
5166 * method.c (deduce_inheriting_ctor): Handle clones.
5167 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
5169 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
5172 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
5174 * cp/cp-tree.h: Declare it.
5175 * cp/semantics.c (finish_id_expression): Resolve names within a default
5176 capturing generic lambda defined within a template prior to
5177 instantiation to allow for captures to be added to the closure type.
5179 2017-01-26 Jakub Jelinek <jakub@redhat.com>
5182 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
5183 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
5184 * parser.c (cp_parser_builtin_offsetof): Pass result of
5185 build_static_cast of null_pointer_node to finish_offsetof.
5186 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
5187 it for -Winvalid-offsetof pedwarn instead of trying to guess
5188 original offsetof type from EXPR. Save OBJECT_PTR as a new
5189 second operand to OFFSETOF_EXPR.
5190 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
5191 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
5194 2017-01-26 Jason Merrill <jason@redhat.com>
5196 * name-lookup.c (parse_using_directive): Deprecate strong using.
5198 PR c++/79176 - lambda ICE with -flto -Os
5199 * decl2.c (vague_linkage_p): Handle decloned 'tors.
5200 * tree.c (decl_linkage): Likewise.
5202 2017-01-25 Martin Sebor <msebor@redhat.com>
5204 * decl.c (grokdeclarator): Fix a typo in a comment.
5206 2017-01-25 Jakub Jelinek <jakub@redhat.com>
5209 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
5213 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
5214 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
5216 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
5219 * decl.c (cxx_init_decl_processing): Pass main_input_filename
5220 to build_translation_unit_decl.
5222 2017-01-24 Jakub Jelinek <jakub@redhat.com>
5225 * cp-gimplify.c (cp_genericize_r): Add result of
5226 convert_from_reference on invisiref parm to p_set.
5228 2017-01-24 Nathan Sidwell <nathan@acm.org>
5230 PR c++/78469 - defaulted ctor and inaccessible dtor
5231 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
5232 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
5233 * tree.c (build_target_expr): Check tf_no_cleanup.
5235 PR c++/79118 - anon-members and constexpr
5236 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
5237 ctor decl. Recursively check anonymous members.
5238 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
5240 (explain_invalid_constexpr_fn): Likewise.
5242 2017-01-23 Nathan Sidwell <nathan@acm.org>
5244 PR c++/71710 - template using directive of field
5245 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
5248 PR c++/71406 - ICE with scope-ref'd template id exprs
5250 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
5251 before breaking up TEMPLATE_ID_EXPR.
5253 2017-01-20 Nathan Sidwell <nathan@acm.org>
5255 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
5256 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
5258 2017-01-20 David Malcolm <dmalcolm@redhat.com>
5262 * cp-tree.h (suggest_alternatives_for): Add bool param.
5263 (suggest_alternative_in_explicit_scope): New decl.
5264 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
5265 that isn't the global one, call new function
5266 suggest_alternative_in_explicit_scope, only calling
5267 suggest_alternatives_for if it fails, and disabling near match
5268 searches fort that case. When SCOPE is the global namespace,
5269 pass true for new param to suggest_alternatives_for to allow for
5271 * lex.c (unqualified_name_lookup_error): Pass true for new param
5272 to suggest_alternatives_for.
5273 * name-lookup.c (consider_binding_level): Add forward decl.
5274 (suggest_alternatives_for): Add "suggest_misspellings" param,
5275 using it to conditionalize the fuzzy name-lookup code.
5276 (suggest_alternative_in_explicit_scope): New function.
5277 * parser.c (cp_parser_primary_expression): When calling
5278 finish_id_expression, pass location of id_expression rather
5279 than that of id_expr_token.
5280 (cp_parser_id_expression): Convert local "unqualified_id" from
5281 tree to cp_expr to avoid implicitly dropping location information.
5283 2017-01-20 Marek Polacek <polacek@redhat.com>
5286 * call.c (build_conditional_expr_1): Warn about duplicated branches.
5287 * semantics.c (finish_expr_stmt): Build statement using the proper
5290 2017-01-19 Jason Merrill <jason@redhat.com>
5292 US 20 - forwarding references and class template argument deduction
5293 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
5294 * pt.c (push_template_decl_real): Set it.
5295 (maybe_adjust_types_for_deduction): Check it.
5296 (rewrite_template_parm): Copy it.
5298 US 19 - deduction guides and constructors
5299 * call.c (joust): Prefer deduction guides to constructors.
5300 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
5301 (deduction_guide_p): Check DECL_P.
5303 * decl.c (check_initializer): Always use build_aggr_init for array
5306 PR c++/79130 - decomposition and direct-initialization
5307 * init.c (build_aggr_init): Communicate direct-initialization to
5309 (build_vec_init): Check for array copy sooner.
5310 * parser.c (cp_parser_decomposition_declaration): Remove call to
5311 build_x_compound_expr_from_list.
5313 2017-01-18 Jason Merrill <jason@redhat.com>
5315 PR c++/68666 - member variable template-id
5316 * typeck.c (finish_class_member_access_expr): Handle variable
5318 * pt.c (lookup_and_finish_template_variable): No longer static.
5319 * cp-tree.h: Declare it.
5321 2017-01-18 Nathan Sidwell <nathan@acm.org>
5324 * call.c (build_over_call): When checking ellipsis conversions for
5325 an inherited ctor, make sure there is at least one conversion.
5327 2017-01-18 Jason Merrill <jason@redhat.com>
5329 PR c++/78894 - ICE with class deduction and default arg
5330 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
5332 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5335 * mangle.c (write_discriminator): Reorganize abi warning check.
5337 2017-01-18 Nathan Sidwell <nathan@acm.org>
5339 * cp-tree.h: Clarify exception spec node comment.
5340 * except.c (nothrow_spec_p): Simplify by checking node-equality.
5343 * mangle.c (write_exception_spec): Check nothrow explicitly.
5344 (write_encoding): Don't increment processing_template_decl around
5347 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5350 * mangle.c (write_template_args): Add "on" for operator names.
5352 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5355 * mangle.c (write_discriminator): Handle discriminator >= 10.
5357 2017-01-17 Nathan Sidwell <nathan@acm.org>
5360 * cp-tree.h (maybe_generic_this_capture): Declare.
5361 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
5362 (maybe_resolve_dummy): ... here. Call it.
5363 (maybe_generic_this_capture): New.
5364 * parser.c (cp_parser_postfix_expression): Speculatively capture
5365 this in generic lambda in unresolved member function call.
5366 * pt.c (tsubst_copy_and_build): Force hard error from failed
5367 member function lookup in generic lambda.
5369 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
5372 * cp-array-notation.c (expand_array_notation_exprs): Handle
5375 2017-01-11 Jason Merrill <jason@redhat.com>
5377 PR c++/78337 - ICE on invalid with generic lambda
5378 * semantics.c (process_outer_var_ref): Check if containing_function
5379 is null. Move inform call under complain test.
5381 2017-01-11 Nathan Sidwell <nathan@acm.org>
5384 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
5387 2017-01-11 Nathan Sidwell <nathan@acm.org>
5389 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
5391 2017-01-11 Jakub Jelinek <jakub@redhat.com>
5394 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
5395 assertion. Formatting fix.
5398 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
5401 2017-01-10 David Malcolm <dmalcolm@redhat.com>
5404 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
5405 a missing semicolon if we have a valid insertion location for
5408 2017-01-10 Jason Merrill <jason@redhat.com>
5410 FI 20, decomposition declaration with parenthesized initializer.
5411 * parser.c (cp_parser_decomposition_declaration): Use
5412 cp_parser_initializer.
5414 2017-01-09 Jason Merrill <jason@redhat.com>
5416 Implement P0195R2, C++17 variadic using.
5417 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
5418 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
5419 * error.c (dump_decl): Likewise.
5421 2017-01-09 Jakub Jelinek <jakub@redhat.com>
5423 PR translation/79019
5424 PR translation/79020
5425 * semantics.c (finish_omp_clauses): Add missing whitespace to
5426 translatable strings.
5427 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
5429 2017-01-07 Jason Merrill <jason@redhat.com>
5431 PR c++/78948 - instantiation from discarded statement
5432 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
5433 * cp-tree.h (in_discarded_stmt): Declare it.
5434 (struct saved_scope): Add discarded_stmt bitfield.
5435 (in_discarded_stmt): New macro.
5436 * decl2.c (mark_used): Check it.
5437 * parser.c (cp_parser_selection_statement): Adjust.
5438 (cp_parser_jump_statement): Adjust.
5440 2017-01-05 Jakub Jelinek <jakub@redhat.com>
5443 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
5444 REFERENCE_REF_P, set tt to its operand.
5447 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
5448 unions even for C++11 and later.
5450 2017-01-05 Nathan Sidwell <nathan@acm.org>
5453 * pt.c (convert_nontype_argument): Don't try and see if integral
5454 or enum expressions are constants prematurely.
5456 2017-01-04 Marek Polacek <polacek@redhat.com>
5459 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
5460 a zero character literal.
5462 2017-01-04 Jakub Jelinek <jakub@redhat.com>
5465 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
5469 * parser.c (cp_parser_simple_declaration): Only complain about
5470 inconsistent auto deduction if auto_result doesn't use auto.
5472 * parser.c (cp_parser_simple_declaration): Diagnose function
5473 declaration among more than one init-declarators with auto
5477 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
5478 assertion, as lexer->buffer may be NULL.
5480 2017-01-04 Marek Polacek <polacek@redhat.com>
5484 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
5486 2017-01-04 Nathan Sidwell <nathan@acm.org>
5489 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
5490 (lambda_capture_field_type): Update prototype.
5491 * lambda.c (lambda_capture_field_type): Add is_reference parm.
5492 Add referenceness here.
5493 (add_capture): Adjust lambda_capture_field_type call, refactor
5495 * pt.c (tsubst): Adjust lambda_capture_field_type call.
5497 2017-01-01 Jakub Jelinek <jakub@redhat.com>
5499 Update copyright years.
5501 Copyright (C) 2017 Free Software Foundation, Inc.
5503 Copying and distribution of this file, with or without modification,
5504 are permitted in any medium without royalty provided the copyright
5505 notice and this notice are preserved.