1 2017-12-15 Jakub Jelinek <jakub@redhat.com>
4 * decl.c (cp_finish_decomp): If decl's type is REFERENCE_TYPE,
5 call complete_type (TREE_TYPE (type)).
7 * tree.c (cxx_attribute_table, std_attribute_table): Swap
8 affects_type_identity and handler fields, adjust comments.
10 2017-12-15 Nathan Sidwell <nathan@acm.org>
13 * decl.c (xref_tag_1): Correct comments about template friends and
15 * friend.c (make_friend_class): Move comments concerning
16 self-friendliness to code dealing with such.
17 * pt.c (check_default_tmpl_args): Deal with template friend
19 (push_template_decl_real): Check default args for non-function
22 2017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
24 * decl2.c (start_static_storage_duration_function): Avoid warning.
25 * typeck.c (cxx_safe_arg_type_equiv_p,
26 cxx_safe_function_type_cast_p): New function.
27 (build_reinterpret_cast_1): Implement -Wcast-function-type.
29 2017-12-14 Jakub Jelinek <jakub@redhat.com>
32 * pt.c (convert_nontype_argument): Diagnose
33 reduced_constant_expression_p expressions that aren't INTEGER_CST.
35 2017-12-13 Paolo Carlini <paolo.carlini@oracle.com>
38 * typeck.c (cp_build_modify_expr): Upon cxx_readonly_error
39 immediately return error_mark_node.
41 2017-12-13 Nathan Sidwell <nathan@acm.org>
44 * pt.c (tsubst_baselink): Don't repeat the lookup for
45 non-dependent baselinks.
47 2017-12-12 Jason Merrill <jason@redhat.com>
49 * decl.c (value_dependent_init_p): Check the type of a CONSTRUCTOR.
50 (type_dependent_init_p): Remove.
52 PR c++/82115 - ICE with variable initialized with its own address.
53 * cp-tree.h (struct lang_decl_base): Add dependent_init_p.
54 (DECL_DEPENDENT_INIT_P, SET_DECL_DEPENDENT_INIT_P): New.
55 * decl.c (cp_finish_decl): Set it.
56 (duplicate_decls): Copy it.
57 * pt.c (tsubst_decl): Clear it.
58 (value_dependent_expression_p): Revert earlier change. Check it.
60 2017-12-12 Alexandre Oliva <aoliva@redhat.com>
62 * constexpr.c (check_constexpr_ctor_body_1): Skip begin stmt
64 (constexpr_fn_retval): Likewise.
65 (potential_constant_expression_1): Likewise.
66 (cxx_eval_statement_list): Check that a begin stmt marker is
67 not used as the value of a statement list.
68 (cxx_eval_constant_expression): Return begin stmt markers
70 * cp-array-notation.c (stmt_location): New.
71 (cp_expand_cond_array_notations): Use it.
72 * cp-objcp-common.h (LANG_HOOKS_EMITS_BEGIN_STMT): Redefine as true.
73 * parser.c (add_debug_begin_stmt): New.
74 (cp_parser_statement): Call it.
75 * pt.c (tsubst_copy): Handle begin stmt markers.
77 2017-12-07 Martin Sebor <msebor@redhat.com>
80 * cp-tree.h (decls_match): Add default argument.
81 * decl.c (decls_match): Avoid calling into the target back end
82 and triggering an error.
83 * decl2.c (cplus_decl_attributes): Look up existing declaration and
84 pass it to decl_attributes.
85 * tree.c (cxx_attribute_table): Initialize new member of struct
88 2017-12-06 Jakub Jelinek <jakub@redhat.com>
91 * decl2.c (grokfield): Diagnose = delete redefinition of a friend.
93 2017-12-06 Jason Merrill <jason@redhat.com>
95 * call.c (convert_for_arg_passing): Pass NULL_TREE to
96 targetm.calls.promote_prototypes.
97 (type_passed_as): Likewise.
99 PR c++/82115 - ICE with variable initialized with its own address.
100 * pt.c (value_dependent_expression_p): Add lval parameter. Don't
101 consider DECL_INITIAL if it's true.
103 2017-12-06 David Malcolm <dmalcolm@redhat.com>
106 * name-lookup.c (consider_binding_level): Don't suggest names that
107 are reserved for use by the implementation.
109 2017-12-06 David Malcolm <dmalcolm@redhat.com>
111 * name-lookup.c: Include "c-family/c-spellcheck.h".
113 2017-12-05 Jason Merrill <jason@redhat.com>
115 PR c++/82331 - ICE with variadic partial specialization of auto
116 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Set processing_template_decl
117 around call to tsubst.
119 2017-12-05 Nathan Sidwell <nathan@acm.org>
122 * tree.c (build_min): Check CAST_EXPR arg for OVERLOADs.
124 2017-12-05 Martin Liska <mliska@suse.cz>
125 Jakub Jelinek <jakub@redhat.com>
127 * typeck.c (pointer_diff): Add new argument and instrument
129 (cp_build_binary_op): Create compound expression if doing an
132 2017-12-05 Jakub Jelinek <jakub@redhat.com>
134 * cp-gimplify.c (cp_maybe_instrument_return): Don't add
135 __builtin_unreachable if -O0 or if -fsanitize=unreachable.
137 2017-12-04 Jason Merrill <jason@redhat.com>
139 PR c++/83273 - constexpr if allows non-constant condition
140 * semantics.c (finish_if_stmt_cond): Use require_constant_expression
141 rather than is_constant_expression.
142 * constexpr.c (potential_constant_expression_1) [LAMBDA_EXPR]: Allow
145 2017-12-01 Jason Merrill <jason@redhat.com>
147 Give #include hints for <complex>.
148 * name-lookup.c (get_std_name_hint): Add <complex>.
149 * parser.c (cp_parser_diagnose_invalid_type_name): Call
150 suggest_alternative_in_explicit_scope.
151 (cp_parser_namespace_name): Likewise.
153 PR c++/79228 - extensions hide C++14 complex literal operators
154 * parser.c (cp_parser_userdef_numeric_literal): Be helpful about
157 2017-12-01 Jakub Jelinek <jakub@redhat.com>
159 * parser.c (cp_parser_new): Don't clear cilk_simd_fn_info.
160 (parsing_nsdmi): Adjust comment.
161 (cp_parser_omp_for_loop_init): Likewise.
162 * parser.h (struct cp_omp_declare_simd_data): Adjust comment.
163 (struct cp_parser): Remove cilk_simd_fn_info field.
164 * cp-tree.h (cilk_valid_spawn): Remove.
167 * cp-gimplify.c (genericize_switch_stmt): Emit LABEL_EXPR for the
168 break label into SWITCH_BODY instead of after it and set
169 SWITCH_BREAK_LABEL_P on it.
170 * parser.c (cp_parser_objc_expression): Add FALLTHRU comment to avoid
171 -Wimplicit-fallthrough warning.
173 2017-11-30 Jason Merrill <jason@redhat.com>
175 PR c++/82219 - bogus -Wignored-qualifiers with template
176 * pt.c (tsubst_copy_and_build) [STATIC_CAST_EXPR]: Suppress
177 -Wignored-qualifiers.
179 2017-11-29 David Malcolm <dmalcolm@redhat.com>
181 * parser.c (cp_parser_unary_expression): Generate a location for
183 (cp_parser_trait_expr): Generate and return a location_t,
184 converting the return type from tree to cp_expr.
185 (cp_parser_static_assert): Pass location of the condition to
186 finish_static_assert, rather than that of the "static_assert"
187 token, where available.
189 2017-11-29 Paolo Carlini <paolo.carlini@oracle.com>
192 * lambda.c (nonlambda_method_basetype): Don't use LAMBDA_TYPE_P
195 2017-11-29 Jason Merrill <jason@redhat.com>
197 PR c++/82760 - memory corruption with aligned new.
198 * call.c (build_operator_new_call): Update *args if we add the
201 2017-11-28 Jakub Jelinek <jakub@redhat.com>
204 * cp-tree.h (SWITCH_STMT_ALL_CASES_P): Define.
205 (SWITCH_STMT_NO_BREAK_P): Define.
206 (note_break_stmt, note_iteration_stmt_body_start,
207 note_iteration_stmt_body_end): Declare.
208 * decl.c (struct cp_switch): Add has_default_p, break_stmt_seen_p
209 and in_loop_body_p fields.
210 (push_switch): Clear them.
211 (pop_switch): Set SWITCH_STMT_CANNOT_FALLTHRU_P if has_default_p
212 and !break_stmt_seen_p. Assert in_loop_body_p is false.
213 (note_break_stmt, note_iteration_stmt_body_start,
214 note_iteration_stmt_body_end): New functions.
215 (finish_case_label): Set has_default_p when both low and high
217 * parser.c (cp_parser_iteration_statement): Use
218 note_iteration_stmt_body_start and note_iteration_stmt_body_end
219 around parsing iteration body.
220 * pt.c (tsubst_expr): Likewise.
221 * cp-objcp-common.c (cxx_block_may_fallthru): Return false for
222 SWITCH_STMT which contains no BREAK_STMTs, contains a default:
223 CASE_LABEL_EXPR and where SWITCH_STMT_BODY isn't empty and
225 * semantics.c (finish_break_stmt): Call note_break_stmt.
226 * cp-gimplify.c (genericize_switch_stmt): Copy SWITCH_STMT_ALL_CASES_P
227 bit to SWITCH_ALL_CASES_P. Assert that if SWITCH_STMT_NO_BREAK_P then
228 the break label is not TREE_USED.
230 2017-11-28 Julia Koval <julia.koval@intel.com>
231 Sebastian Peryt <sebastian.peryt@intel.com>
233 * Make-lang.in (cp/cp-array-notation.o, cp/cp-cilkplus.o): Delete.
234 * call.c (convert_for_arg_passing, build_cxx_call): Remove cilkplus.
235 * constexpr.c (potential_constant_expression_1): Ditto.
236 * cp-array-notation.c: Delete.
237 * cp-cilkplus.c: Ditto.
238 * cp-cilkplus.h: Ditto.
239 * cp-gimplify.c (cp_gimplify_expr, cp_fold_r, cp_genericize): Remove
241 * cp-objcp-common.c (ARRAY_NOTATION_REF): Delete.
242 * cp-tree.h (cilkplus_an_triplet_types_ok_p): Delete.
243 * decl.c (grokfndecl, finish_function): Remove cilkplus condition.
244 * error.c (dump_decl, dump_expr): Remove ARRAY_NOTATION_REF condition.
245 * lambda.c (cp-cilkplus.h): Remove.
246 * parser.c (cp_parser_cilk_simd, cp_parser_cilk_for,
247 cp_parser_cilk_simd_vectorlength): Delete.
248 (cp_debug_parser, cp_parser_ctor_initializer_opt_and_function_body,
249 cp_parser_postfix_expression,
250 cp_parser_postfix_open_square_expression,
251 cp_parser_statement, cp_parser_jump_statement,
252 cp_parser_direct_declarator,
253 cp_parser_late_return_type_opt, cp_parser_gnu_attribute_list,
254 cp_parser_omp_clause_name, cp_parser_omp_clause_aligned,
255 cp_parser_omp_clause_linear, cp_parser_omp_all_clauses,
257 cp_parser_omp_for_cond, cp_parser_omp_for_incr,
258 cp_parser_omp_for_loop_init,
259 cp_parser_omp_for_loop,
260 cp_parser_omp_declare_simd): Remove cilkplus support.
261 (CILK_SIMD_FN_CLAUSE_MASK, cp_parser_late_parsing_cilk_simd_fn_info,
262 cp_parser_cilk_grainsize): Remove.
263 (cp_parser_pragma, c_parse_file): Remove cilkplus support.
264 (cp_parser_cilk_simd_vectorlength, cp_parser_cilk_simd_linear,
265 cp_parser_cilk_simd_clause_name, cp_parser_cilk_simd_all_clauses,
266 cp_parser_cilk_simd, cp_parser_cilk_for): Remove.
267 * parser.h (IN_CILK_SIMD_FOR, IN_CILK_SPAWN): Remove.
268 * pt.c (tsubst_attribute, tsubst_expr, tsubst_copy_and_build): Remove
270 * semantics.c (finish_goto_stmt, begin_while_stmt, finish_do_body,
271 finish_init_stmt, finish_switch_cond, simplify_aggr_init_expr,
272 finish_omp_clauses, finish_omp_clauses, finish_omp_for): Remove
275 * tree.c (lvalue_kind): Remove ARRAY_NOTATION_REF conditon.
276 * typeck.c (cp_build_array_ref, cp_build_compound_expr,
277 check_return_expr): Remove cilkplus support.
279 2017-11-28 Jakub Jelinek <jakub@redhat.com>
281 * cp-gimplify.c (genericize_switch_stmt): Build SWITCH_EXPR using
282 build2_loc instead of build3_loc.
284 2017-11-27 Martin Sebor <msebor@redhat.com>
287 * init.c (warn_placement_new_too_small): Use offset_int instead of
290 2017-11-27 Jakub Jelinek <jakub@redhat.com>
293 * parser.c (cp_parser_decomposition_declaration): Reject just
294 BRACE_ENCLOSED_INITIALIZER_P initializers with nelts != 1 rather
295 than all such CONSTRUCTORs, and only if is_direct_init is true.
297 2017-11-27 Jason Merrill <jason@redhat.com>
299 * pt.c (primary_template_specialization_p): Rename from
300 primary_template_instantiation_p. Don't check
301 DECL_TEMPLATE_INSTANTIATION.
302 * call.c, cp-tree.h, decl2.c: Adjust.
304 2017-11-27 Jakub Jelinek <jakub@redhat.com>
307 * cp-gimplify.c (cp_fold) <case COND_EXPR>: Don't return immediately
308 for VOID_TYPE_P COND_EXPRs, instead fold the operands and if op0 is
309 INTEGER_CST, ensure that both op1 and op2 are non-NULL and fall
310 through into normal folding, otherwise just rebuild x if any op
313 2017-11-14 Boris Kolpackov <boris@codesynthesis.com>
315 * Make-lang.in (c++.install-plugin): Install backend import library.
317 2017-11-23 Jakub Jelinek <jakub@redhat.com>
319 * parser.c (cp_parser_omp_declare): Change return type to bool from
320 void, return true for declare simd.
321 (cp_parser_pragma): Return cp_parser_omp_declare returned value
322 rather than always false.
324 2017-11-23 Mike Stump <mikestump@comcast.net>
325 Eric Botcazou <ebotcazou@adacore.com>
327 * pt.c (tsubst_expr) <ANNOTATE_EXPR>: Recurse on 3rd operand.
328 * semantics.c (finish_while_stmt_cond): Pass 3rd operand to
330 (finish_do_stmt): Likewise.
331 (finish_for_cond): Likewise.
333 2017-11-22 Jakub Jelinek <jakub@redhat.com>
336 * name-lookup.c (member_name_cmp): Return 0 if a == b.
338 2017-11-22 David Malcolm <dmalcolm@redhat.com>
341 * error.c (type_to_string): Add leading comment. Add params
342 "postprocessed", "quote", and "show_color", using them to fix
343 quoting of the "aka" for types involving typedefs.
344 (arg_to_string): Update for new params to type_to_string.
345 (cxx_format_postprocessor::handle): Likewise.
346 (cp_printer): Convert penultimate param from bool to bool *.
347 Update call to type_to_string and calls to
348 defer_phase_2_of_type_diff.
350 2017-11-22 Marek Polacek <polacek@redhat.com>
355 * class.c (layout_class_type): Set DECL_PADDING_P on padding.
356 * decl.c (cxx_init_decl_processing): Set TRANSLATION_UNIT_WARN_EMPTY_P.
357 (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.
359 2017-11-21 Martin Liska <mliska@suse.cz>
361 * class.c (finalize_literal_type_property): Add quotes for
363 (explain_non_literal_class): Likewise.
364 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
365 (is_valid_constexpr_fn): Likewise.
366 (check_constexpr_ctor_body): Likewise.
367 (register_constexpr_fundef): Likewise.
368 (explain_invalid_constexpr_fn): Likewise.
369 (cxx_eval_builtin_function_call): Likewise.
370 (cxx_eval_call_expression): Likewise.
371 (cxx_eval_loop_expr): Likewise.
372 (potential_constant_expression_1): Likewise.
373 * decl.c (check_previous_goto_1): Likewise.
374 (check_goto): Likewise.
375 (grokfndecl): Likewise.
376 (grokdeclarator): Likewise.
377 * error.c (maybe_print_constexpr_context): Likewise.
378 * method.c (process_subob_fn): Likewise.
379 (defaulted_late_check): Likewise.
380 * parser.c (cp_parser_compound_statement): Likewise.
382 2017-11-21 Marc Glisse <marc.glisse@inria.fr>
384 * constexpr.c (cxx_eval_constant_expression,
385 potential_constant_expression_1): Handle POINTER_DIFF_EXPR.
386 * cp-gimplify.c (cp_fold): Likewise.
387 * error.c (dump_expr): Likewise.
388 * typeck.c (pointer_diff): Use POINTER_DIFF_EXPR.
390 2017-11-21 Jakub Jelinek <jakub@redhat.com>
392 P0428R2 - familiar template syntax for generic lambdas
393 * parser.c (cp_parser_lambda_declarator_opt): Don't pedwarn
394 for cxx2a and above, reword pedwarn for C++14/C++17.
396 2017-11-20 David Malcolm <dmalcolm@redhat.com>
399 * name-lookup.c: Include "c-family/known-headers.h"
400 (lookup_name_fuzzy): Call get_cp_stdlib_header_for_name and
401 potentially return a new suggest_missing_header hint.
403 2017-11-20 David Malcolm <dmalcolm@redhat.com>
406 * name-lookup.c (class macro_use_before_def): New class.
407 (lookup_name_fuzzy): Detect macro that were used before being
408 defined, and report them as such.
410 2017-11-20 Jason Merrill <jason@redhat.com>
412 * decl2.c (constrain_class_visibility): Don't warn about artificial
415 2017-11-20 Jakub Jelinek <jakub@redhat.com>
417 P0329R4: Designated Initialization
418 * parser.c (cp_parser_initializer_clause): List in comment grammar
419 designated-initializer-list.
420 (cp_parser_initializer_list): Allow .identifier = without pedwarn for
421 C++2A, parse .identifier { ... }. Improve location_t argument to
422 pedwarn. Add pedwarn for [cst] = designators. Diagnose ... in
423 designated initializer list. Diagnose mixing designated and
424 non-designated initializer clauses for C++2A. Diagnose duplicated
425 identifiers in designators.
426 * name-lookup.h (search_anon_aggr): New declaration.
427 * name-lookup.c (fields_linear_search): Use search_anon_aggr.
428 (search_anon_aggr): New function.
429 * typeck2.c (process_init_constructor_record): Allow designator
430 to skip over some non-static data members. Handle anonymous
431 aggregates. Add diagnostics for designator order not matching
432 member declaration order.
434 2017-11-20 David Malcolm <dmalcolm@redhat.com>
436 * name-lookup.c: Define INCLUDE_UNIQUE_PTR before including system.h.
437 Include "c-family/name-hint.h"
438 (suggest_alternatives_for): Convert "fuzzy_name" from const char *
439 to name_hint, and rename to "hint". Pass location to
441 (lookup_name_fuzzy): Convert return type from const char *
442 to name_hint. Add location_t param.
443 * parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
444 Include "c-family/name-hint.h"
445 (cp_parser_diagnose_invalid_type_name): Convert
446 "suggestion" from const char * to name_hint, and rename to "hint".
447 Pass location to lookup_name_fuzzy.
449 2017-11-20 Nathan Sidwell <nathan@acm.org>
453 * call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited
455 * cp-gimplify.c (cp_genericize_r): Restore THUNK dereference
456 inhibibition check removed in previous c++/78495 change.
458 2017-11-20 Jakub Jelinek <jakub@redhat.com>
461 * constexpr.c (cxx_eval_vector_conditional_expression): New function.
462 (cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
463 of cxx_eval_conditional_expression.
465 2017-11-19 Jakub Jelinek <jakub@redhat.com>
469 * cp-gimplify.c (c_fully_fold): Add LVAL argument, call
470 cp_fold_maybe_rvalue instead of cp_fold_rvalue and pass it !LVAL.
472 2017-11-16 Jason Merrill <jason@redhat.com>
474 PR c++/79092 - non-type args of different types are different
475 * tree.c (cp_tree_equal): Check the type of constants.
476 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Handle UNIFY_ALLOW_INTEGER
477 when comparing to previously deduced argument.
478 (maybe_convert_nontype_argument): New.
479 (convert_nontype_argument): Call it.
480 (tsubst_copy_and_build): Handle partial instantiation of
482 (unify): Ignore type when deducing from array bound.
483 (dependent_type_p_r): Handle DEFERRED_NOEXCEPT.
484 (value_dependent_expression_p): Any type-dependent expression is
485 value-dependent. Handle IMPLICIT_CONV_EXPR.
486 * cp-tree.h (IMPLICIT_CONV_EXPR_NONTYPE_ARG): New.
487 * mangle.c (write_template_arg): Strip IMPLICIT_CONV_EXPR.
489 2017-11-16 Nathan Sidwell <nathan@acm.org>
493 * cp-objcp-common.h (LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME):
495 * cp-tree.h (overwrite_mangling): Declare.
496 * decl2.c (struct mangled_decl_hash): Entries are deletable.
497 (overwrite_mangling): New.
500 * decl.c (xref_tag_1): Push lambda into current scope.
501 * name-lookup.c (do_pushtag): Don't deal with ts_lambda here.
503 2017-11-15 Nathan Sidwell <nathan@acm.org>
506 * lambda.c (lambda_capture_field_type): Function references are
507 always catured by reference.
509 2017-11-15 Martin Liska <mliska@suse.cz>
511 * decl.c (begin_destructor_body): Use cp_build_fold_indirect_ref
512 instead of cp_build_indirect_ref.
514 2017-11-15 Martin Liska <mliska@suse.cz>
516 * decl.c (begin_destructor_body): In case of VPTR sanitization
517 (with disabled recovery), zero vptr in order to catch virtual calls
518 after lifetime of an object.
520 2017-11-14 Jason Merrill <jason@redhat.com>
522 Use GTY((cache)) on some hash tables.
523 * decl.c (decomp_type_table): Use tree_cache_map.
524 * init.c (nsdmi_inst): Likewise.
525 * pt.c (defarg_ints): Likewise.
526 * cp-objcp-common.c (cp_get_debug_type): Likewise.
528 2017-11-13 Jason Merrill <jason@redhat.com>
530 Capture adjustments for P0588R1.
531 * semantics.c (process_outer_var_ref): Capture variables when
532 they are named; complain about non-capture uses when odr-used.
533 * expr.c (mark_use): Rvalue use looks through capture proxy.
534 * constexpr.c (potential_constant_expression_1): Improve error about
535 use of captured variable.
536 * lambda.c (need_generic_capture, dependent_capture_r)
537 (do_dependent_capture, processing_nonlambda_template): Remove.
538 * call.c (build_this): Remove uses of the above.
539 * decl.c (cp_finish_decl): Likewise.
540 * semantics.c (maybe_cleanup_point_expr)
541 (maybe_cleanup_point_expr_void, finish_goto_stmt)
542 (maybe_convert_cond): Likewise.
543 * typeck.c (check_return_expr): Likewise.
546 * typeck.c (cp_build_fold_indirect_ref): New.
547 (cp_build_indirect_ref_1): Split out from cp_build_indirect_ref.
548 Add 'fold' parameter.
549 * cp-tree.h: Declare cp_build_fold_indirect_ref.
550 * call.c, class.c, cp-ubsan.c, decl.c, except.c, init.c, lambda.c,
551 parser.c, rtti.c, tree.c, typeck.c, typeck2.c: Use it.
552 * parser.c (do_range_for_auto_deduction): Use RO_UNARY_STAR.
553 (cp_convert_range_for): Likewise.
554 * typeck2.c (build_x_arrow): Use RO_ARROW.
556 * cp-ubsan.c (cp_ubsan_check_member_access_r): Fix handling of
557 INDIRECT_REF of ADDR_EXPR.
559 PR c++/82360 - ICE with static_cast in template.
560 * call.c (perform_direct_initialization_if_possible): Check
561 processing_template_decl.
562 * typeck.c (build_static_cast_1): Likewise.
564 2017-11-13 Ville Voutilainen <ville.voutilainen@gmail.com>
566 Remove the null check from placement new in all modes
567 * init.c (build_new_1): Don't do a null check for
568 a namespace-scope non-replaceable placement new
569 in any mode unless -fcheck-new is provided.
571 2017-11-07 Boris Kolpackov <boris@codesynthesis.com>
573 * Make-lang.in (CP_PLUGIN_HEADERS): Add operators.def since included
576 2017-11-07 Jakub Jelinek <jakub@redhat.com>
579 * cp-gimplify.c (cxx_omp_clause_apply_fn): For methods pass i - 1 to
580 convert_default_arg instead of i.
582 2017-11-06 Jason Merrill <jason@redhat.com>
584 P0704R1 - fixing const-qualified pointers to members
585 * typeck2.c (build_m_component_ref): Also accept in lower stds with
588 2017-11-06 Paolo Carlini <paolo.carlini@oracle.com>
591 * decl2.c (finish_static_data_member_decl): If there's an initializer,
592 complete the type and re-apply the quals.
594 2017-11-06 Martin Liska <mliska@suse.cz>
597 * constexpr.c (cxx_eval_builtin_function_call): Handle
598 __builtin_unreachable call.
599 (get_function_named_in_call): Declare function earlier.
600 (constexpr_fn_retval): Skip __builtin_unreachable.
601 * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Rename to
603 (cp_maybe_instrument_return): ... this.
604 (cp_genericize): Call the function unconditionally.
606 2017-11-03 Nathan Sidwell <nathan@acm.org>
609 * decl.c (grokdeclarator): Protect MAYBE_CLASS things from paren
612 2017-11-02 Paolo Carlini <paolo.carlini@oracle.com>
615 * pt.c (make_pack_expansion): Add tsubst_flags_t parameter.
616 (expand_integer_pack, convert_template_argument, coerce_template_parms,
617 gen_elem_of_pack_expansion_instantiation, tsubst_pack_expansion,
618 unify): Adjust calls.
619 * tree.c (cp_build_qualified_type_real): Likewise.
620 * cp-tree.h (make_pack_expansion): Adjust declaration.
622 2017-11-02 Nathan Sidwell <nathan@acm.org>
624 * cp-tree.h (IDENTIFIER_NEWDEL_OP_P): Restore, adjust.
625 (IDENTIFIER_NEW_OP_P): New.
626 * decl.c (grokdeclarator): Restore IDENTIFIER_NEWDEL_OP_P use.
627 * pt.c (push_template_decl_real): Likewise.
628 * typeck.c (check_return_expr): Use IDENTIFIER_NEW_OP_P.
631 * decl.c (grokdeclarator): Don't warn when parens protect a return
632 type from a qualified name.
634 2017-11-01 Nathan Sidwell <nathan@acm.org>
636 * cp-tree.h (enum cp_identifier_kind): Delete cik_newdel_op.
637 Renumber and reserve udlit value.
638 (IDENTIFIER_NEWDEL_OP_P): Delete.
639 (IDENTIFIER_OVL_OP_P): New.
640 (IDENTIFIER_ASSIGN_OP_P): Adjust.
641 (IDENTIFIER_CONV_OP_P): Adjust.
642 (IDENTIFIER_OVL_OP_INFO): Adjust.
643 (IDENTIFIER_OVL_OP_FLAGS): New.
644 * decl.c (grokdeclarator): Use IDENTIFIER_OVL_OP_FLAGS.
645 * lex.c (get_identifier_kind_name): Adjust.
646 (init_operators): Don't special case new/delete ops.
647 * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_P.
648 * pt.c (push_template_decl_real): Use IDENTIFIER_OVL_OP_FLAGS.
649 * typeck.c (check_return_expr): Likewise.
651 * cp-tree.h (assign_op_identifier, call_op_identifier): Use
653 (struct lang_decl_fn): Use compressed operator code.
654 (DECL_OVERLOADED_OPERATOR_CODE): Replace with ...
655 (DECL_OVERLOADED_OPERATOR_CODE_RAW): ... this.
656 (DECL_OVERLOADED_OPERATOR_CODE_IS): Use it.
657 * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE_RAW.
658 (build_library_fn): Likewise.
659 (grok_op_properties): Likewise.
660 * mangle.c (write_unqualified_name): Likewise.
661 * method.c (implicitly_declare_fn): Likewise.
662 * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_IS.
664 * cp-tree.h (IDENTIFIER_CP_INDEX): Define.
665 (enum ovl_op_flags): Add OVL_OP_FLAG_AMBIARY.
666 (enum ovl_op_code): New.
667 (struct ovl_op_info): Add ovl_op_code field.
668 (ovl_op_info): Size by OVL_OP_MAX.
669 (ovl_op_mapping, ovl_op_alternate): Declare.
670 (OVL_OP_INFO): Adjust for mapping array.
671 (IDENTIFIER_OVL_OP_INFO): New.
672 * decl.c (ambi_op_p, unary_op_p): Delete.
673 (grok_op_properties): Use IDENTIFIER_OVL_OP_INFO and
675 * lex.c (ovl_op_info): Adjust and static initialize.
676 (ovl_op_mappings, ovl_op_alternate): Define.
677 (init_operators): Iterate over ovl_op_info array and init mappings
679 * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_INFO.
680 * operators.def (DEF_OPERATOR): Remove KIND parm.
681 (DEF_SIMPLE_OPERATOR): Delete.
682 (OPERATOR_TRANSITION): Expand if defined.
684 2017-10-31 David Malcolm <dmalcolm@redhat.com>
686 * pt.c (listify): Use %< and %> for description of #include.
688 2017-10-31 David Malcolm <dmalcolm@redhat.com>
690 * class.c (explain_non_literal_class): Use UNKNOWN_LOCATION rather
692 * name-lookup.c (suggest_alternatives_for): Update for renaming of
694 (maybe_suggest_missing_header): Likewise.
695 (suggest_alternative_in_explicit_scope): Likewise.
696 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise for
697 renaming of error_at_rich_loc.
698 (cp_parser_string_literal): Likewise.
699 (cp_parser_nested_name_specifier_opt): Likewise.
700 (cp_parser_cast_expression): Likewise for renaming of
702 (cp_parser_decl_specifier_seq): Likewise for renaming of
703 error_at_rich_loc and warning_at_rich_loc.
704 (cp_parser_elaborated_type_specifier): Likewise for renaming of
706 (cp_parser_cv_qualifier_seq_opt): Likewise for renaming of
708 (cp_parser_virt_specifier_seq_opt): Likewise.
709 (cp_parser_class_specifier_1): Likewise.
710 (cp_parser_class_head): Likewise.
711 (cp_parser_member_declaration): Likewise for renaming of
712 pedwarn_at_rich_loc, warning_at_rich_loc, and error_at_rich_loc.
713 (cp_parser_enclosed_template_argument_list): Likewise for renaming
714 of error_at_rich_loc.
715 (set_and_check_decl_spec_loc): Likewise.
716 * pt.c (listify): Likewise.
717 * rtti.c (typeid_ok_p): Likewise.
718 * semantics.c (process_outer_var_ref): Use UNKNOWN_LOCATION rather
720 * typeck.c (access_failure_info::maybe_suggest_accessor): Update
721 for renaming of inform_at_rich_loc.
722 (finish_class_member_access_expr): Likewise for renaming of
725 2017-10-31 Nathan Sidwell <nathan@acm.org>
727 * cp-tree.h (struct operator_name_info_t): Rename to ...
728 (struct ovl_op_info_t): ... here. Add tree_code field.
729 (operator_name_info, assignment_operator_name_info): Delete.
730 (ovl_op_info): Declare.
731 (OVL_OP_INFO): Adjust.
732 * decl.c (grok_op_properties): Use ovl_op_flags.
733 * lex.c (operator_name_info, assignment_operator_name_info):
735 (ovl_op_info): Define.
736 (set_operator_ident): Adjust.
737 (init_operators): Set tree_code.
738 * mangle.c (write_unqualified_id): Adjust operator array scan.
740 * lex.c (init_operators): Allow NULL operator name. Don't add
742 * operators.def: Use NULL for mangling only operators. Move to
743 after regular operators but move assignment operators last.
745 * cp-tree.h (enum ovl_op_flags): New.
746 (struct operator_name_info_t): Rename arity to flags.
747 * lex.c (set_operator_ident): New.
748 (init_operators): Use it. Adjust for flags.
749 * mangle.c (write_unqualified_id): Adjust for flags.
750 * operators.def: Replace arity with flags.
752 * cp-tree.h (ovl_op_identifier): New.
753 (assign_op_identifier, call_op_identifier): Adjust.
754 (cp_operator_id, cp_assignment_operator_ide): Delete.
755 (SET_OVERLOADED_OPERATOR_CODE): Delete.
757 * call.c (op_error): Use OVL_OP_INFO.
758 (build_conditional_expr_1): Use ovl_op_identifier.
759 (build_new_op_1): Use OVL_OP_INFO & ovl_op_identifier.
760 (build_op_delete_call): Likewise.
761 * class.c (type_requires_array_cookie): Use ovl_op_identifier.
762 * decl.c (duplicate_decls): Directly copy operator code.
763 (builtin_function_1): Do not set operator code.
764 (build_library_fn): Directly set operator code.
765 (push_cp_library_fn): Use ovl_op_identifier.
766 (grok_op_properties): Directly set operator code.
767 * decl2.c (maybe_warn_sized_delete): Use ovl_op_identifier.
768 * error.c (dump_expr): Use OVL_OP_INFO.
769 (op_to_string): Add assop arg. Use OVL_OP_INFO.
770 (assop_to_string): Delete.
771 (args_to_string): Adjust.
772 * init.c (build_new_1): Use ovl_op_identifier.
773 * mangle.c (write_unqualified_name): Use OVL_OP_INFO.
774 (write_expression): Likewise.
775 * method.c (synthesized_method_walk): Use ovl_op_identifier.
776 (implicitly_declare_fn): Use assign_op_identifier. Directly set
778 * name-lookup.c (get_class_binding): Use assign_op_identifier.
779 * parser.c (cp_parser_operator): Use ovl_op_identifier.
780 (cp_parser_omp_clause_reduction): Likewise.
781 * semantics.c (omp_reduction_id): Likewise.
782 * typeck.c (cxx_sizeof_or_alignof_type): Use OVL_OP_INFO.
784 * cp-tree.h (assign_op_identifier, call_op_identifier): Define.
785 (LAMBDA_FUNCTION_P): Use DECL_OVERLOADED_OPERATOR_IS.
786 (DECL_OVERLOADED_OPERATOR_P): Just retuurn true/false.
787 (DECL_OVERLOADED_OPERATOR_CODE, DECL_OVERLOADED_OPERATOR_IS): Define.
788 * call.c (add_function_candidate): Use
789 DECL_OVERLOADED_OPERATOR_IS.
790 (build_op_call_1): Use call_op_identifier &
791 DECL_OVERLOADED_OPERATOR_IS.
792 (build_over_call): Likewise.
793 (has_trivial_copy_assign_p): Use assign_op_identifier.
794 (build_special_member_call): Likewise.
795 * class.c (dfs_declare_virt_assop_and_dtor): Likewise.
796 (vbase_has_user_provided_move_assign,
797 classtype_has_move_assign_or_move_ctor_p): Likewise.
798 * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE.
799 (grok_special_member_properties): Use assign_op_identifier.
800 (start_preparsed_function): Use DECL_OVERLOADED_OPERATOR_IS.
801 * decl2.c (mark_used): Use DECL_CONV_FN_P.
802 * dump.c (dump_access): Delete prototype.
804 (cp_dump_tree): Don't call it.
805 * lambda.c (lambda_function): Use call_op_identifier.
806 (maybe_add_lambda_conv_op): Not an overloaded operator. Remove
808 * mangle.c (write_unqualified_name): Use DECL_OVERLOADED_OPERTOR_CODE.
809 * method.c (do_build_copy_assign): Use assign_op_identifier.
810 (synthesize_method): Use DECL_OVERLOADED_OPERATOR_IS.
811 (get_copy_assign): Use assign_op_identifier.
812 (synthesized_method_walk): Likewise.
813 (defaultable_fn_check): Use DECL_OVERLOADED_OPERATOR_IS.
814 * parser.c (cp_parser_lambda_declarator_opt): Use
816 * semanitics.c (classtype_has_nothrow_assign_or_copy_p): Use
817 assign_op_identifier.
818 * tree.c (special_function_p): Use DECL_OVERLOADED_OPERATOR_IS.
819 * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_CODE.
820 (check_return_expr): Use assign_op_identifier.
822 2017-10-30 Paolo Carlini <paolo.carlini@oracle.com>
825 * pt.c (tsubst_copy_and_build, [INDIRECT_REF]): For a REFERENCE_REF_P,
826 unconditionally call convert_from_reference.
828 2017-10-30 Nathan Sidwell <nathan@acm.org>
830 * call.c (build_op_call_1): Test for FUNCTION_DECL in same manner
831 as a few lines earlier.
832 * cp-tree.h (PACK_EXPANSION_PATTERN): Fix white space.
833 * decl.c (grokfndecl): Fix indentation.
834 (compute_array_index_type): Use processing_template_decl_sentinel.
835 (grok_op_properties): Move warnings to end. Reorder other checks
836 to group similar entities. Tweak diagnostics.
837 * lex.c (unqualified_name_lookup_error): No need to check name is
838 not ERROR_MARK operator.
839 * parser.c (cp_parser_operator): Select operator code before
841 * typeck.c (check_return_expr): Fix indentation and line wrapping.
843 2017-10-27 Paolo Carlini <paolo.carlini@oracle.com>
845 * pt.c (invalid_nontype_parm_type_p): Return a bool instead of an int.
847 2017-10-26 Nathan Sidwell <nathan@acm.org>
849 * decl.c (sort_labels): Restore function.
850 (pop_labels): Sort labels
851 (identify_goto): Add translation markup.
853 2017-10-25 Nathan Sidwell <nathan@acm.org>
855 Kill IDENTIFIER_LABEL_VALUE.
856 * cp-tree.h (lang_identifier): Delete label_value slot.
857 (IDENTIFIER_LABEL_VALUE, SET_IDENTIFIER_LABEL_VALUE): Delete.
858 (struct named_label_hasher): Rename to ...
859 (struct named_label_hash): ... here. Reimplement.
860 (struct language_function): Adjust x_named_labels.
861 * name-lookup.h (struct cp_label_binding): Delete.
862 (struct cp_binding_level): Delete shadowed_labels slot.
863 * decl.c (struct named_label_entry): Add name and outer slots.
864 (pop_label): Rename to ...
865 (check_label_used): ... here. Don't pop.
866 (note_label, sort_labels): Delete.
867 (pop_labels, pop_local_label): Reimplement.
868 (poplevel): Pop local labels as any other decl. Remove
869 shadowed_labels handling.
870 (named_label_hash::hash, named_label_hash::equal): New.
871 (make_label_decl): Absorb into ...
872 (lookup_label_1): ... here. Add making_local_p arg, reimplement.
873 (lookup_label, declare_local_label): Adjust.
874 (check_goto, define_label): Adjust.
875 * lex.c (make_conv_op_name): Don't clear IDENTIFIER_LABEL_VALUE.
876 * ptree.c (cxx_print_identifier): Don't print identifier binding.
878 * decl.c (identifier_goto): Reduce duplication.
879 (check_previous_goto_1): Likewise.
880 (check_goto): Move var decls to initialization.
881 (check_omp_return, define_label_1, define_label): Likewise.
883 2017-10-25 Jakub Jelinek <jakub@redhat.com>
886 * decl.c (duplicate_decls): Copy "omp declare simd" attributes from
887 newdecl to corresponding __builtin_ if any.
889 2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
892 * decl.c (duplicate_decls): Warn for built-in functions declared as
893 non-function, use OPT_Wbuiltin_declaration_mismatch.
895 * decl.c (duplicate_decls): Avoid redundant '+' in warning_at.
897 2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
900 * pt.c (value_dependent_expression_p, [TRAIT_EXPR]): Handle
901 a TREE_LIST as TRAIT_EXPR_TYPE2.
903 2017-10-24 Mukesh Kapoor <mukesh.kapoor@oracle.com>
904 Paolo Carlini <paolo.carlini@oracle.com>
907 * cvt.c (type_promotes_to): Implement C++17, 7.6/4, about unscoped
908 enumeration type whose underlying type is fixed.
910 2017-10-23 Paolo Carlini <paolo.carlini@oracle.com>
913 * semantics.c (finish_compound_literal): Check do_auto_deduction
914 return value for error_mark_node.
916 2017-10-23 Jason Merrill <jason@redhat.com>
918 PR c++/77369 - wrong noexcept handling in C++14 and below
919 * tree.c (strip_typedefs): Canonicalize TYPE_RAISES_EXCEPTIONS.
921 2017-10-20 Nathan Sidwell <nathan@acm.org>
923 * class.c (layout_class_type): Cleanup as-base creation, determine
925 (finish_struct_1): ... not here.
927 2017-10-19 Jakub Jelinek <jakub@redhat.com>
930 * typeck.c (check_return_expr): Don't call
931 maybe_warn_about_returning_address_of_local in templates.
933 2017-10-17 Nathan Sidwell <nathan@acm.org>
936 * call.c (build_over_call): Don't pass tf_no_cleanup to nested
940 * cp-objcp-common.c (cp_tree_size): Reformat. Adjust returns size
943 2017-10-13 Jason Merrill <jason@redhat.com>
945 PR c++/82357 - bit-field in template
946 * tree.c (cp_stabilize_reference): Just return a NON_DEPENDENT_EXPR.
948 2017-10-13 David Malcolm <dmalcolm@redhat.com>
950 * cp-tree.h (maybe_show_extern_c_location): New decl.
951 * decl.c (grokfndecl): When complaining about literal operators
952 with C linkage, issue a note giving the location of the
954 * parser.c (cp_parser_new): Initialize new field
955 "innermost_linkage_specification_location".
956 (cp_parser_linkage_specification): Store the location
957 of the linkage specification within the cp_parser.
958 (cp_parser_explicit_specialization): When complaining about
959 template specializations with C linkage, issue a note giving the
960 location of the extern "C".
961 (cp_parser_explicit_template_declaration): Likewise for templates.
962 (maybe_show_extern_c_location): New function.
963 * parser.h (struct cp_parser): New field
964 "innermost_linkage_specification_location".
966 2017-10-12 Nathan Sidwell <nathan@acm.org>
968 * cp-tree.h (cp_expr): Add const operator * and operator->
970 (cp_tree_node_structure_enum): Delete TS_CP_BINDING,
971 TS_CP_WRAPPER, LAST_TS_CP_ENUM.
973 2017-10-12 David Malcolm <dmalcolm@redhat.com>
975 * parser.c (get_required_cpp_ttype): New function.
976 (cp_parser_error_1): Call it, using the result to call
977 maybe_suggest_missing_token_insertion.
979 2017-10-12 David Malcolm <dmalcolm@redhat.com>
981 * parser.c (get_matching_symbol): Move to before...
982 (cp_parser_error): Split out into...
983 (cp_parser_error_1): ...this new function, merging in content
985 (cp_parser_required_error): ...here. Eliminate partial duplicate
986 of body of cp_parser_error in favor of a call to the new
987 cp_parser_error_1 helper function.
989 2017-10-11 Nathan Sidwell <nathan@acm.org>
991 * decl2.c (struct mangled_decl_hash): Use DECL_ASSEMBLER_NAME_RAW.
992 (record_mangling): Likewise.
994 2017-10-10 Nathan Sidwell <nathan@acm.org>
996 * name-lookup.c (extern_c_fns): Rename to ...
997 (extern_c_decls): ... here.
998 (check_extern_c_conflict, extern_c_linkage_bindings): Update.
999 (do_pushdecl): Check extern-c fns and vars.
1001 * cp-tree.h (default_hash_traits <lang_identifier *>): Delete
1004 * decl2.c (struct mangled_decl_hash): New hash traits.
1005 (mangled_decls): Make hash_table<mangled_decl_hash>.
1006 (generate_mangling_alias, record_mangling): Adjust.
1008 2017-10-10 Jason Merrill <jason@redhat.com>
1010 More delayed lambda capture fixes.
1011 * call.c (add_function_candidate): Use build_address.
1012 (build_op_call_1): Call mark_lvalue_use early.
1013 (build_over_call): Handle error from build_this.
1014 * constexpr.c (cxx_bind_parameters_in_call): Use build_address.
1015 (cxx_eval_increment_expression): Don't use rvalue().
1016 * cvt.c (convert_to_void): Use mark_discarded_use.
1017 * expr.c (mark_use): Handle PARM_DECL, NON_DEPENDENT_EXPR. Fix
1018 reference handling. Don't copy the expression.
1019 (mark_discarded_use): New.
1020 * lambda.c (insert_capture_proxy): Add some sanity checking.
1021 (maybe_add_lambda_conv_op): Set cp_unevaluated_operand.
1022 * pt.c (register_local_specialization): Add sanity check.
1023 * semantics.c (process_outer_var_ref): Fix check for existing proxy.
1024 * typeck.c (cp_build_addr_expr_1): Handle error from
1026 (cp_build_modify_expr): Call mark_lvalue_use_nonread, handle error
1029 Handle generic lambda capture in dependent expressions.
1030 * lambda.c (need_generic_capture, dependent_capture_r)
1031 (do_dependent_capture): New.
1032 * pt.c (processing_nonlambda_template): Use need_generic_capture.
1033 * semantics.c (maybe_cleanup_point_expr)
1034 (maybe_cleanup_point_expr_void, finish_goto_stmt)
1035 (maybe_convert_cond): Call do_dependent_capture.
1036 * typeck.c (build_static_cast): Remove dependent capture handling.
1038 * typeck.c (condition_conversion): Assert !processing_template_decl.
1039 * semantics.c (finish_omp_clauses): Don't
1040 fold_build_cleanup_point_expr if processing_template_decl.
1041 (outer_var_p): A temporary can't be from an outer scope.
1042 * pt.c (type_dependent_expression_p): Fix dependency checking of
1043 functions without DECL_TEMPLATE_INFO.
1044 (instantiate_decl): Use lss_copy.
1045 * constexpr.c (is_valid_constexpr_fn): Fix lambdas before C++17.
1047 * typeck.c (check_return_expr): Check non-dependent conversion in
1049 * constraint.cc (check_function_concept): Don't complain about an
1050 empty concept if seen_error.
1052 2017-10-10 Richard Sandiford <richard.sandiford@linaro.org>
1054 * cvt.c (ignore_overflows): Use wi::to_wide when
1055 operating on trees as wide_ints.
1056 * decl.c (check_array_designated_initializer): Likewise.
1057 * mangle.c (write_integer_cst): Likewise.
1058 * semantics.c (cp_finish_omp_clause_depend_sink): Likewise.
1060 2017-10-10 Nathan Sidwell <nathan@acm.org>
1062 * name-lookup.c (set_global_binding): Don't deal with STAT_HACK.
1064 2017-10-06 Paolo Carlini <paolo.carlini@oracle.com>
1067 * decl.c (finish_function): Take a bool intead of an int; adjust.
1068 * cp-tree.h (finish_function): Adjust declaration.
1069 * decl2.c (generate_tls_wrapper, finish_objects,
1070 finish_static_storage_duration_function): Adjust calls.
1071 * lambda.c (maybe_add_lambda_conv_op, finish_lambda_function):
1073 * method.c (synthesize_method): Likewise.
1074 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
1075 * pt.c (instantiate_decl): Likewise.
1076 * parser.c (cp_parser_function_definition_after_declarator,
1077 cp_parser_late_parsing_for_member, cp_parser_omp_declare_reduction):
1079 (cp_parser_ctor_initializer_opt,
1080 cp_parser_ctor_initializer_opt_and_function_body,
1081 cp_parser_function_try_block,
1082 cp_parser_function_definition_after_declarator,
1083 cp_parser_function_transaction): Return void; adjust declarations.
1085 2017-10-06 Nathan Sidwell <nathan@acm.org>
1088 * name-lookup.c (check_local_shadow): Don't try and convert
1091 2017-10-06 Jakub Jelinek <jakub@redhat.com>
1094 * decl.c (reshape_init): Suppress warn_useless_cast for direct enum
1096 * typeck.c (convert_for_assignment): Likewise.
1098 P0704R1 - fixing const-qualified pointers to members
1099 * typeck2.c (build_m_component_ref): For -std=c++2a allow
1100 pointer to const & qualified method on rvalue.
1102 2017-10-06 Nathan Sidwell <nathan@acm.org>
1104 Use hash_table for extern "C" names
1105 * name-lookup.c (extern_c_fns): Use hash_table.
1106 (check_extern_c_conflict): Adjust.
1107 (c_linkage_bindings): Adjust.
1109 Use hash_table for namespace bindings
1110 * cp-tree.h (struct named_decl_hash): New.
1111 (lang_decl_ns): Change type of bindings field.
1112 * lex.c (maybe_add_lang_decl_raw): Adjust.
1113 * name-lookup.c (find_namespace_slot): Adjust.
1114 (do_pushdecl): Push NULL-named namespace.
1115 (do_push_nested_namespace): Adjust.
1116 (push_namespace): Push anonymous namespace as NULL name.
1118 2017-10-05 Jason Merrill <jason@redhat.com>
1120 Pass variadic class objects exactly like named by-value args.
1121 * call.c (convert_arg_to_ellipsis): Use the result of force_rvalue.
1123 2017-10-05 Nathan Sidwell <nathan@acm.org>
1125 Warn on MVP declarations
1126 * cp-tree.h (struct cp_declarator): Add parenthesized field.
1127 * decl.c (grokdeclarator): Warn about unnecessary parens.
1128 * parser.c (make_declarator): Init parenthesized field.
1129 (cp_parser_direct_declarator): Set parenthesized field.
1131 Kill IDENTIFIER_GLOBAL_VALUE, SET_IDENTIFIER_GLOBAL_VALUE
1132 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1133 SET_IDENTIFIER_GLOBAL_VALUE): Delete.
1134 * name-lookup.h (set_global_binding): Remove NAME parm.
1135 (get_global_binding): New inline fn.
1136 * name-lookup.c (set_global_binding): Remove NAME parm. Adjust.
1137 (identifier_global_value): Move to ...
1138 * cp-objcp-common.c (identifier_global_value): ... here.
1139 * class.c (build_ctor_vtbl_group, build_vtbl_initializer): Adjust.
1140 * decl.c (record_builtin_type, expand_static_init,
1141 grokdeclarator): Adjust.
1142 * decl2.c (get_guard, get_local_tls_init_fn, get_tls_init_fn,
1143 get_tls_wrapper_fn, maybe_warn_sized_delete): Adjust.
1144 * except.c (declare_library_fn, build_throw): Adjust.
1145 * init.c (throw_bad_array_length): Adjust.
1146 * rtti.c (throw_bad_cast, throw_bad_typeid, get_tinfo_decl): Adjust.
1148 * decl2.c (record_mangling): Fix spello and formatting from
1151 2017-10-04 Nathan Sidwell <nathan@acm.org>
1153 Give builtin types the correct name.
1154 * name-lookup.c (set_global_binding): Assert name is DECL_NAME.
1155 * decl.c (record_builtin_type): Reimplement, use new TYPE_DECL for
1158 2017-10-04 Paolo Carlini <paolo.carlini@oracle.com>
1159 Andrew Pinski <apinski@cavium.com>
1162 * parser.c (cp_parser_lambda_body): Set parser->in_function_body.
1164 2017-10-04 Nathan Sidwell <nathan@acm.org>
1166 Move mangling aliases out of global namespace.
1167 * cp-tree.h (record_mangling): New.
1168 (maybe_remove_implicit_alias): Delete.
1169 * decl2.c (mangled_decls): New hash map.
1170 (generate_mangling_alias): Reimplement using mangled_decls.
1171 (record_mangling): New.
1172 * mangle.c (decl_implicit_alias_p,
1173 maybe_remove_implicit_alias): Delete.
1174 (mangle_decl): Use record_mangling.
1175 * name-lookup.c (supplement_binding_1): Remove
1176 maybe_remove_implicit_alias check.
1178 2017-10-04 Jakub Jelinek <jakub@redhat.com>
1181 * error.c (dump_function_decl): If show_return, call dump_type_suffix
1182 on the same return type dump_type_prefix has been called on.
1184 2017-10-04 Jason Merrill <jason@redhat.com>
1186 PR c++/81525 - broken handling of auto in generic lambda.
1187 * pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.
1189 2017-10-04 Nathan Sidwell <nathan@acm.org>
1191 * call.c (convert_arg_to_ellipsis): Correct comment about passing
1194 2017-10-02 Richard Sandiford <richard.sandiford@linaro.org>
1196 * constexpr.c (cxx_eval_store_expression): Use wi::to_widest
1197 when comparing the array bounds with an ARRAY_REF index.
1199 2017-09-30 Paolo Carlini <paolo.carlini@oracle.com>
1202 * method.c (defaulted_late_check): Early return if the defaulted
1203 declaration does not match the expected signature.
1205 2017-09-29 Jakub Jelinek <jakub@redhat.com>
1207 P0683R1 - default member initializers for bit-fields
1208 * cp-tree.h (grokbitfield): Add INIT parameter.
1209 * parser.c (cp_parser_constant_expression): Add STRICT_P argument,
1210 if true, parse a conditional-expression rather than
1211 assignment-expression.
1212 (cp_parser_member_declaration): For C++11 and later pass true
1213 as STRICT_P to cp_parser_constant_expression. Parse C++2A bitfield
1214 NSDMIs. Adjust grokbitfield caller. Handle DECL_INITIAL also for
1216 (cp_parser_objc_class_ivars): Adjust grokbitfield caller.
1217 * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs.
1218 (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs.
1219 * decl2.c (grokbitfield): Add INIT parameter, pass it to
1221 * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not
1224 * class.c (check_bitfield_decl): Retrieve and clear width from
1225 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
1226 (check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than
1228 (remove_zero_width_bit_fields): Adjust comment.
1229 * decl2.c (grokbitfield): Stash width into
1230 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
1231 * pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr
1232 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width.
1234 * parser.c (cp_parser_member_declaration): Parse attributes before
1235 colon of a bitfield in addition to after colon.
1237 * Make-lang.in (check-c++-all): Test also c++2a.
1239 2017-09-28 Jason Merrill <jason@redhat.com>
1241 PR c++/56973, DR 696 - capture constant variables only as needed.
1242 * expr.c (mark_use): Split out from mark_rvalue_use and
1243 mark_lvalue_use. Handle lambda capture of constant variables.
1244 (mark_lvalue_use_nonread): New.
1245 * semantics.c (process_outer_var_ref): Don't capture a constant
1246 variable until forced.
1247 * pt.c (processing_nonlambda_template): New.
1248 * call.c (build_this): Check it.
1249 * decl2.c (grok_array_decl): Call mark_rvalue_use and
1250 mark_lvalue_use_nonread.
1251 * init.c (constant_value_1): Don't call mark_rvalue_use.
1252 * typeck.c (build_static_cast): Handle lambda capture.
1254 Use local_specializations to find capture proxies.
1255 * cp-tree.h (DECL_CAPTURED_VARIABLE): New.
1256 * lambda.c (build_capture_proxy): Set it.
1257 (add_capture): Pass initializer to build_capture_proxy.
1258 (start_lambda_function): Likewise.
1259 (insert_capture_proxy): Use register_local_specialization.
1260 (is_lambda_ignored_entity): Always ignore proxies.
1261 * name-lookup.c (qualify_lookup): Don't check
1262 is_lambda_ignored_entity if LOOKUP_HIDDEN is set.
1263 * semantics.c (process_outer_var_ref): Use
1264 retrieve_local_specialization.
1265 * parser.c (cp_parser_lambda_body): Push local_specializations.
1266 * pt.c (tsubst_expr): Pass LOOKUP_HIDDEN when looking for a proxy.
1267 (tsubst_lambda_expr): Push local_specializations sooner.
1268 (tsubst_copy_and_build): Don't register_local_specialization.
1270 * call.c (build_special_member_call): Use the return value of
1272 * decl.c (compute_array_index_type): Likewise.
1273 * parser.c (cp_parser_oacc_wait_list): Likewise.
1274 * lambda.c (is_normal_capture_proxy): Handle *this capture.
1275 (add_capture): Clarify internal_error message.
1277 2017-09-22 Eric Botcazou <ebotcazou@adacore.com>
1280 * cp-objcp-common.c (cp_get_debug_type): Do only one lookup.
1282 2017-09-22 Jakub Jelinek <jakub@redhat.com>
1285 * tree.c (struct replace_placeholders_t): Add pset field.
1286 (replace_placeholders_r): Call cp_walk_tree with d->pset as
1287 last argument instead of NULL. Formatting fix.
1288 (replace_placeholders): Add pset variable, add its address
1289 into data. Pass &pset instead of NULL to cp_walk_tree.
1291 2017-09-22 David Malcolm <dmalcolm@redhat.com>
1293 * call.c (get_fndecl_argument_location): New function.
1294 (convert_like_real): Use it when complaining about argument type
1296 * cp-tree.h (struct cp_parameter_declarator): Add "loc" field.
1297 * parser.c (make_parameter_declarator): Add "loc" param and use
1298 it to initialize the new field.
1299 (cp_parser_translation_unit): Add UNKNOWN_LOCATION for "loc" of
1300 the "no_parameters" parameter.
1301 (cp_parser_parameter_declaration_list): Set the location of the
1302 result of grokdeclarator to be the parameter's loc, assuming no
1304 (cp_parser_parameter_declaration): Generate a location for the
1305 parameter and pass to make_parameter_declarator.
1307 2017-09-20 Nathan Sidwell <nathan@acm.org>
1309 * name-lookup.c (member_name_cmp): Use DECL_UID for final
1312 2017-09-20 Jakub Jelinek <jakub@redhat.com>
1314 P0409R2 - allow lambda capture [=, this]
1315 * parser.c (cp_parser_lambda_introducer): For cxx2a don't pedwarn on
1316 redundant [=, this].
1318 2017-09-18 Jason Merrill <jason@redhat.com>
1320 PR c++/82069 - ICE with lambda in template
1321 * semantics.c (process_outer_var_ref): Check uses_template_parms
1322 instead of any_dependent_template_arguments_p.
1324 2017-09-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1325 Paolo Carlini <paolo.carlini@oracle.com>
1328 * decl2.c (finish_anon_union): Complain about "anonymous union with
1329 no members" with a pedwarn.
1331 2017-09-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
1333 * typeck.c (build_reinterpret_cast_1,
1334 build_const_cast_1): Implement -Wcast-align=strict.
1336 2017-09-15 Jakub Jelinek <jakub@redhat.com>
1338 * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
1339 adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
1340 to C++17 or -std=gnu++17 or -std=c++17. Adjust comments.
1341 (cxx_init_decl_processing, next_initializable_field,
1342 is_direct_enum_init, check_initializer, cp_finish_decl,
1343 mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
1344 finish_function): Likewise.
1345 * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
1346 * pt.c (mark_template_parm, convert_nontype_argument,
1347 instantiate_class_template_1, type_unification_real, unify,
1348 get_partial_spec_bindings, dependent_type_p_r): Likewise.
1349 * typeck.c (cp_build_unary_op): Likewise.
1350 * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
1351 * call.c (build_user_type_conversion_1, build_over_call,
1352 build_special_member_call): Likewise.
1353 * lambda.c (begin_lambda_type): Likewise.
1354 * typeck2.c (process_init_constructor_record): Likewise.
1355 * class.c (build_base_field, finalize_literal_type_property,
1356 explain_non_literal_class): Likewise.
1357 * parser.c (cp_parser_diagnose_invalid_type_name,
1358 cp_parser_primary_expression, cp_parser_lambda_introducer,
1359 cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
1360 cp_convert_range_for, cp_parser_perform_range_for_lookup,
1361 cp_parser_decomposition_declaration, cp_parser_linkage_specification,
1362 cp_parser_static_assert, cp_parser_simple_type_specifier,
1363 cp_parser_namespace_definition, cp_parser_using_declaration,
1364 cp_parser_init_declarator, cp_parser_type_parameter_key,
1365 cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
1366 cp_parser_constructor_declarator_p): Likewise.
1367 * mangle.c (struct globals): Rename need_cxx1z_warning to
1369 (write_exception_spec, start_mangling, mangle_decl): Likewise.
1370 * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
1372 (check-c++17): New goal. Use 17 instead of 1z.
1373 (check-c++-all): Use 17 instead of 1z.
1375 2017-09-14 Jakub Jelinek <jakub@redhat.com>
1378 * cp-gimplify.c (omp_var_to_track): Look through references.
1379 (omp_cxx_notice_variable): Likewise.
1381 2017-09-13 Nathan Sidwell <nathan@acm.org>
1383 Conv-op identifers not in identifier hash table
1384 * lex.c (conv_type_hasher): Make member fns inline.
1385 (make_conv_op_name): Directly clone conv_op_identifier.
1387 Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
1388 * cp-tree.h (struct lang_type): Rename methods to members.
1389 (CLASSTYPE_METHOD_VEC): Rename to ...
1390 (CLASSTYPE_MEMBER_VEC): ... this.
1391 * name-lookup.h (get_method_slot): Rename to ...
1392 (get_member_slot): ... this.
1393 (resort_type_method_vec): Rename to ...
1394 (resort_type_member_vec): ... this.
1395 * class.c (add_method, warn_hidden): Adjust.
1396 * search.c (dfs_locate_field_accessor_pre): Adjust.
1397 * name-lookup.c (method_vec_binary_search): Rename to ...
1398 (member_vec_binary_search): ... this and adjust.
1399 (method_vec_linear_search): Rename to ...
1400 (member_vec_linear_search): ... this and adjust.
1401 (fields_linear_search, get_class_binding_direct): Adjust.
1402 (get_method_slot): Rename to ...
1403 (get_member_slot): ... this and adjust.
1404 (method_name_slot): Rename to ...
1405 (member_name_slot): ... this and adjust.
1406 (resort_type_method_vec): Rename to ...
1407 (resort_type_member_vec): ... this and adjust.
1408 (method_vec_append_class_fields): Rename to ...
1409 (member_vec_append_class_fields): ... this and adjust.
1410 (method_vec_append_enum_values): Rename to ...
1411 (member_vec_append_enum_values): ... this and adjust.
1412 (method_vec_dedup): Rename to ...
1413 (member_vec_dedup): ... this and adjust.
1414 (set_class_bindings, insert_late_enum_def_bindings): Adjust.
1416 2017-09-12 Paolo Carlini <paolo.carlini@oracle.com>
1419 * decl.c (start_decl): Early return error_mark_node if duplicate_decls
1420 returns it; avoid misleading error message.
1422 2017-09-12 Nathan Sidwell <nathan@acm.org>
1424 Kill CLASSTYPE_SORTED_FIELDS.
1425 * cp-tree.h (struct lang_type): Lose sorted_fields member.
1426 (CLASSTYPE_SORTED_FIELDS): Delete.
1427 * name-lookup.h (set_class_bindings): Add EXTRA arg.
1428 * name-lookup.c (fields_linear_search): New, broken out of ...
1429 (lookup_field_1): ... here. Delete remainder of function.
1430 (get_class_binding_direct): Reimplement without sorted_fields.
1431 (get_class_binding): Rename TYPE arg to KLASS, for consistency.
1432 (get_method_slot): Call set_class_binding when creating method_vec
1434 (method_name_cmp): Order identically named slots.
1435 (sorted_fields_type_new): Delete.
1436 (field_vc_append_class_fields): Rename to ...
1437 (method_vec_append_class_fields): ... here. Adjust.
1438 (field_vec_append_enum_values): Renme to ...
1439 (method_vec_append_enum_values): ... here. Adjust.
1440 (method_vec_dedup): New.
1441 (set_class_bindings): Reimplement.
1442 (insert_late_enum_def_bindings): Reimplement.
1444 * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
1446 (restort_data): Move later.
1447 (method_name_cmp, resort_method_name_cmp): Simplify.
1448 (resort_type_method_vec): Reformat.
1450 2017-09-09 Jason Merrill <jason@redhat.com>
1452 * constexpr.c (reduced_constant_expression_p): If
1453 CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
1455 2017-09-09 Eric Botcazou <ebotcazou@adacore.com>
1458 * cp-objcp-common.c (struct debug_type_hasher): New class.
1459 (debug_type_hash): New variable.
1460 (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
1462 2017-09-08 Jason Merrill <jason@redhat.com>
1464 PR c++/70029 - ICE with ref-qualifier and -flto
1465 * tree.c (cxx_copy_lang_qualifiers): New.
1466 * cp-tree.h: Declare it.
1467 * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
1469 2017-09-06 Jason Merrill <jason@redhat.com>
1471 PR c++/82053 - ICE with default argument in lambda in template
1472 * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
1474 (retrieve_specialization): Use lambda_fn_in_template_p.
1475 * cp-tree.h: Declare it.
1477 PR c++/82070 - error with nested lambda capture
1478 * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
1479 register_local_specialization.
1481 2017-09-06 Nathan Sidwell <nathan@acm.org>
1483 * name-lookup.h (lookup_field_1): Delete.
1484 (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
1485 * name-lookup.c (lookup_field_1): make static
1486 (method_vec_binary_search, method_vec_linear_search): New. Broken
1488 (get_class_binding_direct): ... here. Add TYPE_OR_FNS argument.
1489 Do complete search of this level.
1490 (get_class_binding): Adjust.
1491 * decl.c (reshape_init_class): Call get_class_binding.
1492 * search.c (lookup_field_r): Move field searching into
1493 get_class_binding_direct.
1495 * class.c (warn_hidden): Don't barf on non-functions.
1496 * decl2.c (check_classfn): Likewise. Check template match earlier.
1498 * name-lookup.c (count_fields): Rename to ...
1499 (count_class_fields): ... here. Take a class, don't count
1501 (add_fields_to_record_type): Rename to ...
1502 (field_vec_append_class_fields): ... here. Take a class, don't
1503 add NULL-named fields.
1504 (add_enum_fields_to_record_type): Rename to ...
1505 (field_vec_append_enum_values): ... here.
1506 (set_class_bindings): Adjust, assert we added expected number.
1507 (insert_late_enum_def_bindings): Reimplement. Create vector if
1508 there are now sufficient entries.
1510 * name-lookup.h (lookup_fnfields_slot_nolazy,
1511 lookup_fnfields_slot): Rename to ...
1512 (get_class_binding_direct, get_class_binding): ... here.
1513 * name-lookup.c (lookup_fnfields_slot_nolazy,
1514 lookup_fnfields_slot): Rename to ...
1515 (get_class_binding_direct, get_class_binding): ... here.
1516 * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
1517 * call.c (build_user_type_conversion_1): Adjust.
1518 (has_trivial_copy_assign_p): Adjust.
1519 (has_trivial_copy_p): Adjust.
1520 * class.c (get_basefndecls) Adjust.
1521 (vbase_has_user_provided_move_assign) Adjust.
1522 (classtype_has_move_assign_or_move_ctor_p): Adjust.
1523 (type_build_ctor_call, type_build_dtor_call): Adjust.
1524 * decl.c (register_dtor_fn): Adjust.
1525 * decl2.c (check_classfn): Adjust.
1526 * pt.c (retrieve_specialization): Adjust.
1527 (check_explicit_specialization): Adjust.
1528 (do_class_deduction): Adjust.
1529 * search.c (lookup_field_r): Adjust.
1530 (look_for_overrides_here, lookup_conversions_r): Adjust.
1531 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
1532 * tree.c (type_has_nontrivial_copy_init): Adjust.
1533 * method.c (lazily_declare_fn): Adjust comment.
1535 2017-09-05 Nathan Sidwell <nathan@acm.org>
1537 * name-lookup.c (do_class_using_decl): Elide read-once temps.
1538 Move declarations to initializations.
1540 * class.c (add_method): Move slot search and insertion to ...
1541 * name-lookup.c (get_method_slot): ... this new function.
1542 (lookup_fnfields_slot_nolazy): Cope with NULL slot.
1543 * name-lookup.h (get_method_slot): Declare.
1544 * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
1546 (grok_special_member_properties): Set
1547 TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
1548 Improve TYPE_HAS_CONSTEXPR_CTOR setting.
1550 * cp-tree.h (lang_decl_base): Rename template_conv_p to
1552 (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
1553 (DECL_CONV_FN_TYPE): FN must be conv op.
1554 (DECL_TEMPLATE_CONV_FN_P): Delete.
1555 (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
1556 * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
1559 * class.c (unreverse_member_declarations): Remove extraneous if.
1560 * pt.c (push_template_decl_real): Use string concatenation, not
1561 \<newline>. Add %<..%>.
1563 2017-09-05 Paolo Carlini <paolo.carlini@oracle.com>
1566 * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
1567 * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
1568 creating cdtor_label.
1569 * constexpr.c (returns): Add the case of a constructor/destructor
1570 returning via a LABEL_DECL_CDTOR label.
1571 (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
1573 2017-09-01 Nathan Sidwell <nathan@acm.org>
1575 * cp-tree.h (resort_type_method_vec): Move declaration to ...
1576 * name-lookup.h (resort_type_method_vec): ... here.
1577 (set_class_bindings): Lose 2nd arg.
1578 * class.c (finish_struct_1, finish_struct): Adjust
1579 set_class_bindings call. Don't call finish_struct_methods.
1580 (resort_data, method_name_cmp, resort_method_name_cmp,
1581 resort_type_method_vec, finish_struct_methods): Move to ...
1582 * name-lookup.c (resort_data, method_name_cmp,
1583 resort_method_name_cmp, resort_type_method_vec): ... here.
1584 (set_class_bindings): Lose fields arg. Swallow finish_struct_methods.
1586 * class.c (finish_struct): Call set_class_bindings for the
1589 * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
1590 Don't call maybe_warn_about_overly_private_class here.
1591 (warn_hidden): Cleanup declarations and comments.
1592 (type_has_user_provided_constructor): No need to check
1593 CLASSTYPE_METHOD_VEC.
1594 (type_has_user_provided_or_explicit_constructor): Likewise.
1595 (classtype_has_move_assign_or_move_ctor_p): Likewise.
1596 (check_bases_and_members): Don't call finish_struct_methods here.
1597 (finish_struct_1): Call finish_struct_methods and
1598 set_class_bindings immediately after layout. Clear DECL_IN_AGGR_P
1600 (finish_struct): For templates process USING_DECLS and clear
1601 DECL_IN_AGGR_P before calling finish_struct_methods. Call
1602 maybe_warn_about_overly_private_class here.
1604 Revert 2017-08-28 Nathan Sidwell <nathan@acm.org>
1605 Restore sorted_fields vector.
1606 * cp-tree.h (lang_type): Restore sorted_fields vector.
1607 (CLASSTYPE_SORTED_FIELDS): Restore.
1608 (CLASSTYPE_BINDINGS): Delete.
1609 * name-lookup.c (lookup_field_1): Restore binary search.
1610 (sorted_fields_type_new, count_fields,
1611 add_fields_to_record_type, add_enum_fields_to_record_type): Restore
1612 (set_class_bindings): Revert.
1613 (insert_late_enum_def_binding): Restore field_vec insertion.
1615 2017-09-01 Jakub Jelinek <jakub@redhat.com>
1618 * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
1620 2017-09-01 Marek Polacek <polacek@redhat.com>
1623 * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
1625 2017-08-30 Jason Merrill <jason@redhat.com>
1627 PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
1628 * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
1629 (regenerated_lambda_fn_p): New.
1630 (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
1631 (tsubst_copy) [VAR_DECL]: Likewise.
1633 PR c++/82030 - ICE inheriting from multiple lambdas
1635 * call.c (compare_ics): Handle null candidate.
1637 2017-08-30 Ville Voutilainen <ville.voutilainen@gmail.com>
1639 Make taking the address of an overloaded function a non-deduced context
1641 * pt.c (unify_overload_resolution_failure): Remove.
1642 (unify_one_argument): Adjust.
1644 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1645 Alan Hayward <alan.hayward@arm.com>
1646 David Sherwood <david.sherwood@arm.com>
1648 * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
1650 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1651 Alan Hayward <alan.hayward@arm.com>
1652 David Sherwood <david.sherwood@arm.com>
1654 * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
1656 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1657 Alan Hayward <alan.hayward@arm.com>
1658 David Sherwood <david.sherwood@arm.com>
1660 * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
1661 instead of TYPE_MODE.
1663 2017-08-29 Jason Merrill <jason@redhat.com>
1665 PR c++/81236 - ICE with template-id in generic lambda
1666 * semantics.c (finish_id_expression): Remove special dependent case.
1667 Avoid some later pieces when dependent.
1668 (finish_qualified_id_expr): Do normal BASELINK handling in a
1669 template. Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
1670 (parsing_default_capturing_generic_lambda_in_template): Remove.
1671 * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
1672 error for types that will never be complete.
1673 * mangle.c (write_expression): Add sanity check.
1674 * tree.c (build_qualified_name): Add sanity check.
1675 (cp_walk_subtrees): Walk into the class context of a BASELINK.
1676 * lambda.c (add_capture): Improve diagnostic for generic lambda
1678 * call.c (build_new_method_call_1): Print the right constructor
1681 Reimplement handling of lambdas in templates.
1682 * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
1683 * decl.c (start_preparsed_function): Call start_lambda_scope.
1684 (finish_function): Call finish_lambda_scope.
1685 * init.c (get_nsdmi): Call start/finish_lambda_scope.
1686 * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
1687 * parser.c (cp_parser_function_definition_after_declarator): Don't
1688 call start/finish_lambda_scope.
1689 * pt.c (retrieve_specialization): Ignore lambda functions in
1691 (find_parameter_packs_r): Ignore capture proxies. Look into
1693 (check_for_bare_parameter_packs): Allow bare packs in lambdas.
1694 (tsubst_default_argument): Call start/finish_lambda_scope.
1695 (tsubst_function_decl): Handle lambda functions differently.
1696 (tsubst_template_decl): Likewise.
1697 (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
1699 (tsubst_lambda_expr): Create a new closure rather than instantiate
1700 the one from the template.
1701 (tsubst_copy_and_build): Don't register a specialization of a pack.
1702 (regenerate_decl_from_template): Call start/finish_lambda_scope.
1703 (instantiate_decl): Remove special lambda function handling.
1704 * semantics.c (process_outer_var_ref): Remove special generic lambda
1705 handling. Don't implicitly capture in a lambda in a template. Look
1706 for an existing proxy.
1707 * class.c (current_nonlambda_class_type): Use decl_type_context.
1709 * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
1710 (LAMBDA_EXPR_RETURN_TYPE): Remove.
1711 (struct tree_lambda_expr): Remove closure and return_type fields.
1712 * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
1713 * pt.c (tsubst_copy_and_build): Likewise.
1714 * parser.c (cp_parser_lambda_declarator_opt): Track return type.
1715 (cp_parser_lambda_body): Adjust unspecified return type check.
1716 * ptree.c (cxx_print_lambda_node): Don't print closure or
1719 PR c++/80935 - wrong C++17 error with lambda
1720 * decl.c (check_for_uninitialized_const_var): Check
1721 is_instantiation_of_constexpr.
1722 * constexpr.c (ensure_literal_type_for_constexpr_object): Check
1723 is_instantiation_of_constexpr.
1724 (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
1726 * lambda.c (build_lambda_object): Check for error_mark_node.
1727 * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
1729 (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
1730 (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
1732 PR c++/80767 - unnecessary instantiation of generic lambda
1733 * call.c (convert_like_real): Call build_user_type_conversion_1 if
1735 (add_conv_candidate): Build a ck_user conversion with no candidate.
1737 Fix lambdas in template default argument of inherited ctor.
1738 * method.c (synthesized_method_base_walk): Replace an inherited
1739 template with its specialization.
1740 (synthesized_method_walk): Make inheriting_ctor a pointer.
1741 (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
1742 (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
1744 * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
1745 template, not the function.
1746 (template_guide_p): Adjust.
1748 Support copying local_specializations.
1749 * cp-tree.h (enum lss_policy): New.
1750 (local_specialization_stack): Add policy parameter to default ctor.
1751 * pt.c (local_specialization_stack): Copy local_specializations if
1754 * constexpr.c (potential_constant_expression_1): Add "now" parm.
1755 (is_constant_expression, require_constant_expression): New.
1756 (is_static_init_expression, is_nondependent_constant_expression)
1757 (is_nondependent_static_init_expression): Drop "potential".
1758 * except.c (build_must_not_throw_expr): Do type conversion on
1759 value-dependent argument.
1760 * pt.c, semantics.c, typeck2.c: Use variants without "potential".
1762 Instantiate default arguments/member initializers once.
1763 * init.c (get_nsdmi): Remember NSDMI instantiations.
1764 * parser.c (inject_this_parameter): Be more picky about
1766 * pt.c (tsubst_copy): Simplify 'this' handling.
1767 (tsubst_default_argument): Remember default argument
1768 instantiations. Take parameter number.
1769 (tsubst_default_arguments): Pass it.
1770 * call.c (convert_default_arg): Likewise.
1772 Fix default argument conversion failure and SFINAE.
1773 * call.c (build_over_call): Check convert_default_arg result for
1775 * parser.c (cp_parser_late_parsing_default_args): Remember
1778 2017-08-28 Nathan Sidwell <nathan@acm.org>
1780 * cp-tree.h (lang_type): Replace sorted_fields vector with
1782 (CLASSTYPE_SORTED_FIELDS): Delete.
1783 (CLASSTYPE_BINDINGS): New.
1784 * decl.c (finish_enum_value_list): Swap args of
1785 insert_late_enum_def_bindings.
1786 * name-lookup.c (lookup_field_1): Replace binary search of sorted
1787 fields with map->get.
1788 (sorted_fields_type_new, count_fields,
1789 add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
1790 (add_class_member, add_class_members): New.
1791 (set_class_bindings): Create map and insert.
1792 (insert_late_enum_def_binding): Swap parms. Use add_clasS_member.
1793 * ptree.c (cxx_print_type): Delete sorted fields printing.
1795 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
1797 * name-lookup.h (set_class_bindings,
1798 insert_late_enum_def_bindings): Declare.
1799 * decl.c (finish_enum_value_list): Adjust for
1800 insert_late_enum_def_bindings name change.
1801 * class.c (finish_struct_1): Call set_class_bindings.
1802 (count_fields, add_fields_to_record_type,
1803 add_enum_fields_to_record_type, sorted_fields_type_new,
1804 insert_into_classtype_sorted_fields,
1805 insert_late_enum_def_into_classtype_sorted_fields): Move to ...
1806 * name-lookup.h (count_fields, add_fields_to_record_type,
1807 add_enum_fields_to_record_type, sorted_fields_type_new,
1808 set_class_bindings, insert_late_enum_def_bindings): ... here.
1810 2017-08-25 Nathan Sidwell <nathan@acm.org>
1812 * class.c (method_name_cmp, resort_method_name_cmp): Methods
1815 Conversion operators have a special name
1816 * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
1817 (conv_op_marker, conv_op_identifier): New.
1818 (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
1819 * decl.c (initialize_predefined_identifiers): Add
1821 (cxx_init_decl_processing): Create conv_op_marker.
1822 * decl2.c (check_classfn): Lookup conv-ops by name.
1823 * class.c (add_method): Use conv_op_identifier & conv_op_marker.
1824 (resort_type_method_vec): Don't skip conv-ops.
1825 (finish_struct_methods, warn_hidden): Likewise.
1826 * name-lookup.h (lookup_all_conversions): Delete.
1827 * name-lookup.c (lookup_conversion_operator): Replace with ...
1828 (extract_conversion_operator): ... this.
1829 (lookup_fnfields_slot_nolazy): Find conv-ops by name.
1830 (lookup_all_conversions): Delete.
1831 * pt.c (check_explicit_specialization): Find conv-ops by name.
1832 * search.c (lookup_conversions_r): Likewise.
1834 2017-08-24 Nathan Sidwell <nathan@acm.org>
1836 Conversion operators kept on single overload set
1837 * class.c (add_method): Keep all conv-ops on one slot.
1838 * name-lookup.c (lookup_conversion_operator): Pull the desired
1839 conv op out of overload set.
1840 * search.c (lookup_conversions_r): Lose template/non-template
1842 (lookup_conversions): Likewise.
1844 2017-08-23 Nathan Sidwell <nathan@acm.org>
1846 * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
1847 lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
1849 * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
1850 lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
1851 * search.c (lookup_conversion_operator,
1852 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1853 lookup_all_conversions): Move to ...
1854 * name-lookup.c (lookup_conversion_operator,
1855 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1856 lookup_all_conversions): ... here.
1858 * semantics.c (finish_member_declaration): Move USING_DECL check
1859 earlier. Always set C++ linkage. Commonize TYPE_FIELD and
1860 template decl list insertion.
1862 * cp-tree.h (maybe_version_functions): Declare.
1863 * decl.c (decls_match): Break function versioning check to
1864 separate function. Call it.
1865 (maybe_version_functions): Broken out of decls_match.
1866 * class.c (add_method): Use maybe_version_functions.
1868 * cp-tree.h (print_search_statistics,
1869 reinit_search_statistics): Don't declare.
1870 * search.c (n_fields_searched, n_calls_lookup_field,
1871 n_calls_lookup_field_1, n_calls_lookup_fnfields,
1872 n_calls_lookup_fnfields_1, n_calls_get_base_type,
1873 n_outer_fields_searched, n_contexts_saved): Delete.
1874 (lookup_field_1, lookup_member,
1875 lookup_fnfields_slot_nolazy): Remove stat gathering.
1876 (print_search_statistics, reinit_search_statistics): Delete.
1877 * tree.c (cxx_print_statistics): Don't print search stats.
1879 2017-08-21 Nathan Sidwell <nathan@acm.org>
1881 * search.c (lookup_field_r): Remove obsolete code for type-named
1884 * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
1886 (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
1887 (lookup_field_fuzzy_r): Adjust.
1889 2017-08-21 David Malcolm <dmalcolm@redhat.com>
1891 * call.c (build_over_call): Pass NULL for new parameter to
1892 check_function_arguments.
1893 * typeck.c (cp_build_function_call_vec): Likewise.
1895 2017-08-21 Nathan Sidwell <nathan@acm.org>
1898 * pt.c (instantiate_class_template_1):
1899 BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
1901 2017-08-18 David Malcolm <dmalcolm@redhat.com>
1904 * name-lookup.c (maybe_suggest_missing_header): Convert return
1905 type from void to bool; return true iff a suggestion was offered.
1906 (suggest_alternative_in_explicit_scope): Move call to
1907 maybe_suggest_missing_header to before use of best_match, and
1908 return true if the former offers a suggestion.
1910 2017-08-18 H.J. Lu <hongjiu.lu@intel.com>
1913 * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
1914 * decl2.c (grokbitfield): Don't allow bit-field with
1915 warn_if_not_aligned type.
1917 2017-08-17 Nathan Sidwell <nathan@acm.org>
1919 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
1920 * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
1921 (TYPE_TEMPLATE_INFO): Simplify.
1922 (SET_TYPE_TEMPLATE_INFO): Simplify.
1924 * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
1925 don't need lang_type.
1926 (cxx_make_type): Use maybe_add_lang_type_raw return value.
1927 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
1930 * cp-tree.h (struct lang_type): Remove template_info field.
1931 (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
1932 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
1934 2017-08-14 Martin Sebor <msebor@redhat.com>
1937 * error.c (cp_printer): Handle 'G'.
1939 2017-08-11 Martin Liska <mliska@suse.cz>
1941 * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
1942 TARGET_SUPPORTS_ALIASES.
1943 (handle_tls_init): Likewise.
1944 (note_mangling_alias): Likewise. Remove ATTRIBUTE_UNUSED for
1946 * optimize.c (can_alias_cdtor): Likewise.
1948 2017-08-11 Jason Merrill <jason@redhat.com>
1950 PR c++/81671 - nullptr_t template parameter
1951 * pt.c (convert_nontype_argument): Fix nullptr_t check.
1953 2017-08-10 Jason Merrill <jason@redhat.com>
1955 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1956 * method.c (synthesized_method_walk): Don't diagnose lack of
1959 PR c++/80452 - Core 1579, implicit move semantics on return/throw
1960 * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
1961 tentatively changed the lvalue to an rvalue.
1962 * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
1963 (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
1964 parameter is an rvalue reference.
1965 * except.c (build_throw): Do maybe-rvalue overload resolution twice.
1966 * typeck.c (check_return_expr): Likewise.
1968 2017-08-10 David Malcolm <dmalcolm@redhat.com>
1970 * parser.c (cp_parser_error): Update for new param to
1972 (class token_pair): New class.
1973 (struct matching_paren_traits): New struct.
1974 (matching_parens): New typedef.
1975 (struct matching_brace_traits): New struct.
1976 (matching_braces): New typedef.
1977 (cp_parser_statement_expr): Convert explicit parsing of
1978 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
1979 class matching_parens, so that the pertinent open parenthesis is
1980 highlighted when there are problems locating the close
1982 (cp_parser_primary_expression): Likewise.
1983 (cp_parser_compound_literal_p): Remove consumption of opening
1985 (cp_parser_postfix_expression): Convert explicit parsing of
1986 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
1987 above. Use it to consume the opening paren previously consumed by
1988 cp_parser_compound_literal_p.
1989 (cp_parser_parenthesized_expression_list): Likewise.
1990 (cp_parser_unary_expression): Likewise.
1991 (cp_parser_new_expression): Likewise.
1992 (cp_parser_cast_expression): Likewise.
1993 (cp_parser_builtin_offsetof): Likewise.
1994 (cp_parser_trait_expr): Likewise.
1995 (cp_parser_lambda_declarator_opt): Likewise.
1996 (cp_parser_lambda_body): Likewise, for matching_braces.
1997 (cp_parser_compound_statement): Likewise.
1998 (cp_parser_selection_statement): Likewise, for matching_parens.
1999 (cp_parser_iteration_statement): Likewise.
2000 (cp_parser_already_scoped_statement): Likewise, for
2002 (cp_parser_linkage_specification): Likewise.
2003 (cp_parser_static_assert): Likewise, for matching_parens.
2004 (cp_parser_decltype): Likewise.
2005 (cp_parser_operator): Likewise.
2006 (cp_parser_enum_specifier): Likewise.
2007 (cp_parser_namespace_definition): Likewise.
2008 (cp_parser_direct_declarator): Likewise.
2009 (cp_parser_braced_list): Likewise.
2010 (cp_parser_class_specifier_1): Likewise, for matching_braces.
2011 (cp_parser_constant_initializer): Likewise.
2012 (cp_parser_noexcept_specification_opt): Likewise, for
2014 (cp_parser_exception_specification_opt): Likewise.
2015 (cp_parser_handler): Likewise.
2016 (cp_parser_asm_specification_opt): Likewise.
2017 (cp_parser_asm_operand_list): Likewise.
2018 (cp_parser_gnu_attributes_opt): Likewise.
2019 (cp_parser_std_attribute_spec): Likewise.
2020 (cp_parser_requirement_parameter_list): Likewise.
2021 (cp_parser_requirement_body): Likewise, for matching_braces.
2022 (cp_parser_compound_requirement): Likewise.
2023 (cp_parser_template_introduction): Likewise.
2024 (cp_parser_sizeof_pack): Likewise, for matching_parens.
2025 (cp_parser_sizeof_operand): Likewise; use it to consume the
2026 opening paren previously consumed by cp_parser_compound_literal_p.
2027 (get_matching_symbol): New function.
2028 (cp_parser_required_error): Add param "matching_location". Remove
2029 calls to cp_parser_error, instead setting a non-NULL gmsgid, and
2030 handling it if set by calling c_parse_error, potentially with a
2031 secondary location if matching_location was set.
2032 (cp_parser_require): Add param "matching_location", with a default
2033 value of UNKNOWN_LOCATION.
2034 (cp_parser_require_keyword): Update for new param of
2035 cp_parser_required_error.
2036 (cp_parser_objc_encode_expression): Update to class matching_parens
2038 (cp_parser_objc_defs_expression): Likewise.
2039 (cp_parser_objc_protocol_expression): Likewise.
2040 (cp_parser_objc_selector_expression): Likewise.
2041 (cp_parser_objc_typename): Likewise.
2042 (cp_parser_objc_superclass_or_category): Likewise.
2043 (cp_parser_objc_try_catch_finally_statement): Likewise.
2044 (cp_parser_objc_synchronized_statement): Likewise.
2045 (cp_parser_objc_at_property_declaration): Likewise.
2046 (cp_parser_oacc_single_int_clause): Likewise.
2047 (cp_parser_oacc_shape_clause): Likewise.
2048 (cp_parser_omp_clause_collapse): Likewise.
2049 (cp_parser_omp_clause_default): Likewise.
2050 (cp_parser_omp_clause_final): Likewise.
2051 (cp_parser_omp_clause_if): Likewise.
2052 (cp_parser_omp_clause_num_threads): Likewise.
2053 (cp_parser_omp_clause_num_tasks): Likewise.
2054 (cp_parser_omp_clause_grainsize): Likewise.
2055 (cp_parser_omp_clause_priority): Likewise.
2056 (cp_parser_omp_clause_hint): Likewise.
2057 (cp_parser_omp_clause_defaultmap): Likewise.
2058 (cp_parser_omp_clause_ordered): Likewise.
2059 (cp_parser_omp_clause_schedule): Likewise.
2060 (cp_parser_omp_clause_num_teams): Likewise.
2061 (cp_parser_omp_clause_thread_limit): Likewise.
2062 (cp_parser_omp_clause_aligned): Likewise.
2063 (cp_parser_omp_clause_linear): Likewise.
2064 (cp_parser_omp_clause_safelen): Likewise.
2065 (cp_parser_omp_clause_simdlen): Likewise.
2066 (cp_parser_omp_clause_depend): Likewise.
2067 (cp_parser_omp_clause_device): Likewise.
2068 (cp_parser_omp_clause_dist_schedule): Likewise.
2069 (cp_parser_oacc_clause_async): Likewise.
2070 (cp_parser_omp_critical): Likewise.
2071 (cp_parser_omp_for_loop): Likewise.
2072 (cp_parser_omp_sections_scope): Likewise.
2073 (cp_parser_omp_declare_reduction_exprs): Likewise.
2074 Update for new param to cp_parser_required_error.
2075 (cp_parser_oacc_routine): Likewise.
2076 (cp_parser_transaction_expression): Likewise.
2077 (cp_parser_cilk_simd_vectorlength): Likewise.
2079 2017-08-09 Jason Merrill <jason@redhat.com>
2081 PR c++/81525 - wrong constant value with generic lambda
2082 * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
2083 (tsubst_copy) [VAR_DECL]: Handle auto.
2085 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
2086 * init.c (get_nsdmi): Add complain parm.
2087 * typeck2.c (digest_nsdmi_init): Add complain parm.
2088 (process_init_constructor_record): Pass complain to get_nsdmi.
2089 * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
2090 * method.c (get_defaulted_eh_spec): Add complain parm. Pass it into
2091 synthesized_method_walk.
2092 (synthesized_method_walk): Adjust.
2093 (walk_field_subobs): Pass complain to get_nsdmi.
2094 (defaulted_late_check): Skip other checks if deleted.
2095 * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
2096 * call.c (build_aggr_conv): Pass complain to get_nsdmi.
2097 * parser.c (defarg_location): New.
2098 * error.c (location_of): Use it.
2100 2017-08-09 Marek Polacek <polacek@redhat.com>
2102 * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
2103 * typeck.c (build_binary_op): Change the type of a parameter to bool.
2104 (cp_truthvalue_conversion): Use true instead of 1.
2106 2017-08-08 Marek Polacek <polacek@redhat.com>
2109 * cp-gimplify.c (cp_fold): If folding exposed a branch of
2110 a COND_EXPR, convert it to the original type of the COND_EXPR, if
2113 2017-08-08 Martin Liska <mliska@suse.cz>
2115 * call.c: Include header files.
2116 * cp-gimplify.c: Likewise.
2117 * cp-ubsan.c: Likewise.
2120 * search.c: Likewise.
2121 * semantics.c: Likewise.
2122 * typeck.c: Likewise.
2124 2017-08-07 Martin Liska <mliska@suse.cz>
2126 * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
2128 (cp_parser_std_attribute): Likewise.
2129 * tree.c: Add new include.
2131 2017-08-04 Paolo Carlini <paolo.carlini@oracle.com>
2134 * pt.c (do_class_deduction): Handle the case of no viable implicit
2135 deduction guides; simplify the code generating implicit deduction
2138 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
2141 * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
2142 destructor as expressions.
2144 2017-08-02 Jakub Jelinek <jakub@redhat.com>
2147 * call.c (build_user_type_conversion_1): Only call
2148 lookup_fnfields_slot if totype is CLASS_TYPE_P.
2150 2017-07-31 Jason Merrill <jason@redhat.com>
2152 * decl.c (declare_global_var): Set DECL_CONTEXT.
2154 2017-07-31 Jan Hubicka <hubicka@ucw.cz>
2155 Martin Liska <mliska@suse.cz>
2157 * pt.c (tsubst_copy): Copy PREDICT_EXPR.
2158 * semantics.c (finish_goto_stmt): Build gimple predict
2160 * constexpr.c (potential_constant_expression_1): Handle
2163 2017-07-31 Martin Liska <mliska@suse.cz>
2166 * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
2167 also with current_function_decl non-null equality.
2168 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2169 * decl.c (compute_array_index_type): Likewise.
2170 * init.c (finish_length_check): Likewise.
2171 * typeck.c (cp_build_binary_op): Likewise.
2173 2017-07-29 Jakub Jelinek <jakub@redhat.com>
2175 * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
2176 DW_AT_export_symbols.
2177 * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
2178 argument, pass it through to the debug hook.
2179 (finish_namespace_using_directive): Adjust
2180 emit_debug_info_using_namespace caller.
2181 (push_namespace): Likewise. Call it after setting
2182 DECL_NAMESPACE_INLINE_P.
2183 (cp_emit_debug_info_for_using): Pass false as new argument to
2184 the imported_module_or_decl debug hook.
2186 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
2188 * lex.c (copy_decl): Adjust.
2189 (copy_type): Likewise.
2191 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
2194 * lambda.c (add_capture): Early return if we cannot capture by
2197 2017-07-26 Jason Merrill <jason@redhat.com>
2199 P0702R1 - List deduction of vector.
2200 * pt.c (do_class_deduction): Special-case deduction from a single
2201 element of related type.
2203 2017-07-26 Leonid Koppel <lkoppel@uwaterloo.ca>
2205 PR c++/67054 - Inherited ctor with non-default-constructible members
2206 * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
2207 when deducing an inheriting constructor.
2209 2017-07-21 Nathan Sidwell <nathan@acm.org>
2211 * search.c (lookup_conversion_operator): Return overloads.
2212 (lookup_fnfields_idx_nolazy): Absorb into ...
2213 (lookup_fnfields_slot_nolaxy): ... here.
2214 (lookup_fnfields_1): Absorb into ...
2215 (lookup_fnfields_slot): ... here.
2217 Remove special CDtor METHOD_VEC slots.
2218 * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
2219 CLASSTYPE_DESTRUCTOR_SLOT): Delete.
2220 (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
2221 (CLASSTYPE_DESTRUCTOR): Likewise.
2222 * class (add_method): Don't use special cdtor slots.
2223 * search.c (lookup_fnfields_idx_nolazy): Likewise.
2224 (look_for_overrides_here): Use lookup_fnfields_slot.
2225 * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
2227 * call.c (add_candidates): Move decls to initialization. Don't
2230 2017-07-20 Nathan Sidwell <nathan@acm.org>
2232 Remove TYPE_METHODS.
2233 * class.c (maybe_warn_about_overly_private_class,
2234 finish_struct_methods, one_inheriting_sig, count_fields,
2235 add_fields_to_record_type, check_field_decls, check_methods,
2236 clone_function_decl, set_method_tm_attributes,
2237 finalize_literal_type_property, check_bases_and_members,
2238 create_vtable_ptr, determine_key_method,
2239 unreverse_member_declarations, finish_struct,
2240 add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
2241 * decl.c (fixup_anonymous_aggr): Likewise.
2242 * decl2.c (reset_type_linkage_2): Likewise.
2243 * method.c (after_nsdmi_defaulted_late_checks,
2244 lazily_declare_fn): Likewise.
2245 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
2246 * pt.c (instantiate_class_template_1, tsubst_expr,
2247 do_type_instantiation, instantiate_pending_templates): Likewise.
2248 * search.c (lookup_field_1): Likewise.
2249 * semantics.c (finish_member_declaration,
2250 finish_omp_declare_simd_methods): Likewise.
2252 2017-07-19 Nathan Sidwell <nathan@acm.org>
2254 * class.c (add_implicitly_declared_members): Use
2255 classtype_has_move_assign_or_move_ctor_p.
2256 (classtype_has_move_assign_or_move_ctor,
2257 classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
2258 (classtype_has_move_assign_or_move_ctor_p): ... this new function.
2259 * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
2261 (classtype_has_move_assign_or_move_ctor_p): ... this.
2262 * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
2263 * tree.c (type_has_nontrivial_copy_init): Adjust.
2265 * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
2266 PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
2268 2017-07-18 Nathan Sidwell <nathan@acm.org>
2270 * cp-array-notation.c (build_array_notation_ref): Use
2271 TYPE_{MIN,MAX}_VALUE.
2273 * class.c (classtype_has_move_assign_or_move_ctor): Declare.
2274 (add_implicitly_declared_members): Use it.
2275 (type_has_move_constructor, type_has_move_assign): Merge into ...
2276 (classtype_has_move_assign_or_move_ctor): ... this new function.
2277 * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
2279 2017-07-17 Volker Reichelt <v.reichelt@netcologne.de>
2281 * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
2282 friend outside class and obsolete auto as storage-class-specifier.
2284 2017-07-17 Nathan Sidwell <nathan@acm.org>
2286 * class.c (maybe_warn_about_overly_private_class): Ignore public
2289 * class.c (type_has_user_declared_move_constructor,
2290 type_has_user_declared_move_assign): Combine into ...
2291 (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
2292 * cp-tree.h (type_has_user_declared_move_constructor,
2293 type_has_user_declared_move_assign): Combine into ...
2294 (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
2295 * method.c (maybe_explain_implicit_delete): Use it.
2296 (lazily_declare_fn): Use it.
2297 * tree.c (type_has_nontrivial_copy_init): Use it.
2299 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
2300 semantics, simplify implementation.
2302 2017-07-16 Volker Reichelt <v.reichelt@netcologne.de>
2304 * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
2305 in old-style cast diagnostic.
2306 * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
2307 in useless cast diagnostic.
2308 * error.c (type_to_string): Remove enum special handling.
2310 2017-07-14 David Malcolm <dmalcolm@redhat.com>
2312 * name-lookup.c (get_std_name_hint): Add '<' and '>' around
2314 (maybe_suggest_missing_header): Update for addition of '<' and '>'
2315 to above. Provide a fix-it hint.
2316 * pt.c: Include "gcc-rich-location.h"
2317 (listify): Attempt to add fix-it hint for missing
2318 #include <initializer_list>.
2319 * rtti.c: Include "gcc-rich-location.h".
2320 (typeid_ok_p): Attempt to add fix-it hint for missing
2321 #include <typeinfo>.
2323 2017-07-12 Jason Merrill <jason@redhat.com>
2325 P0512R0 - Deduction from an initializer list.
2326 * pt.c (do_class_deduction): Do list deduction in two phases.
2328 2017-07-12 Nathan Sidwell <nathan@acm.org>
2330 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
2331 DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
2333 * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
2334 DECL_CXX_DESTRUCTOR explicitly.
2335 * decl2.c (grokclassfn): Likewise.
2336 * friend.c (do_friend): Likewise.
2337 * method.c (make_thunk, make_alias_for,
2338 implicitly_declare_fn): Likewise.
2340 2017-07-11 Jason Merrill <jason@redhat.com>
2343 * decl.c (grokparms): Downgrade error about array of unknown bound
2344 to pedwarn and disable it for C++17.
2346 2017-07-11 Nathan Sidwell <nathan@acm.org>
2348 * decl2.c (reset_type_linkage_2): Dont't change ctor name.
2350 2017-07-10 Martin Sebor <msebor@redhat.com>
2352 * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
2354 2017-07-06 Jason Merrill <jason@redhat.com>
2356 PR c++/81204 - parse error with dependent template-name
2357 * parser.c (cp_parser_lookup_name): Revert previous change.
2359 2017-07-06 David Malcolm <dmalcolm@redhat.com>
2361 * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
2362 selftest::run_cp_tests.
2363 (selftest::run_cp_tests): New function.
2364 * cp-tree.h (selftest::run_cp_tests): New decl.
2366 2017-07-04 Jakub Jelinek <jakub@redhat.com>
2368 * parser.c (cp_parser_decomposition_declaration): Replace
2369 decomposition declaration with structured binding in diagnostics.
2370 * decl.c (cp_finish_decomp): Likewise.
2371 (grokdeclarator): Likewise.
2374 * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
2375 forms of structured binding initializers.
2377 2017-07-03 Paolo Carlini <paolo.carlini@oracle.com>
2380 * decl.c (grokdeclarator): Move checks on function return type after
2381 the splice_late_return_type call; if declspecs->locations[ds_type_spec]
2382 is UNKNOWN_LOCATION fall back to input_location.
2384 2017-07-03 David Malcolm <dmalcolm@redhat.com>
2386 * parser.c (enum required_token): Fix spelling of
2387 RT_INTERATION to RT_ITERATION.
2388 (cp_parser_iteration_statement): Likewise.
2389 (cp_parser_required_error): Likewise.
2391 2017-06-30 Jason Merrill <jason@redhat.com>
2393 PR c++/81257 - ICE with invalid ::template.
2394 PR c++/54769 - wrong lookup of dependent template-name.
2395 * parser.c (cp_parser_template_name): Revert part of last change.
2397 2017-06-30 Nathan Sidwell <nathan@acm.org>
2399 * config-lang.in (gtfiles): Add cp/lex.c.
2400 * cp-tree.h (mangle_convop_name_for_type): Rename ...
2401 (make_conv_op_name): ... here. Move to lex.
2402 * lambda.c (maybe_add_lambda_conv_op): Update.
2403 * parser.c (cp_parser_conversion_function_id): Update.
2404 * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
2405 tsubst_copy_and_build): Update.
2406 * semantics.c (apply_deduced_return_type): Update.
2407 * mangle.c (conv_type_hasher, conv_type_names,
2408 mangle_conv_op_name_for_type): Move to ...
2409 * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
2412 2017-06-30 David Malcolm <dmalcolm@redhat.com>
2415 * parser.c (cp_parser_postfix_expression): Construct a location
2416 for typeid expressions.
2418 2017-06-30 Nathan Sidwell <nathan@acm.org>
2420 * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
2422 (lookup_all_conversions): Declare.
2423 * class.c (get_basefndecls): Use lookup_fnfields_slot.
2424 * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
2425 * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
2427 * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
2428 (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
2429 lookup_all_conversions.
2430 * search.c (lookup_fnfields_1): Make static.
2431 (lookup_all_conversions): New.
2432 (class_method_index_for_fn): Delete.
2433 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
2434 lookup_fnfields_slot.
2436 * call.c (build_new_method_call_1): Use constructo_name to get
2437 ctor name. Move argument processing earlier to merge cdtor
2439 * decl.c (grokfndecl): Cdtors have special names.
2440 * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
2441 * pt.c (check_explicit_specialization): Cdtor name is already
2443 * search.c (class_method_index_for_fn): Likewise.
2446 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
2447 a matching TYPE_DECL.
2449 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
2451 * class.c (add_method): Change pair of errors to error + inform.
2452 (handle_using_decl): Likewise.
2454 2017-06-29 Jason Merrill <jason@redhat.com>
2456 * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
2458 PR c++/81180 - ICE with C++17 deduction of member class template.
2459 * pt.c (build_deduction_guide): Correct member template handling.
2461 PR c++/81188 - matching decltype of member function call.
2462 * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
2464 2017-06-29 Nathan Sidwell <nathan@acm.org>
2467 * parser.c (cp_parser_namespace_definition): Immediately close the
2468 namespace if there's no open-brace.
2469 * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
2472 2017-06-29 Jason Merrill <jason@redhat.com>
2474 PR c++/81164 - ICE with invalid inherited constructor.
2475 * search.c (binfo_direct_p): New.
2476 * name-lookup.c (do_class_using_decl): Use it.
2478 2017-06-29 Nathan Sidwell <nathan@acm.org>
2480 * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
2481 VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
2482 * decl.c (initialize_predefined_identifiers): Name cdtor special
2483 names consistently. Use literals for above deleted defines.
2484 (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
2486 * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
2489 * call.c (check_dtor_name): Use constructor_name for enums too.
2490 (build_new_method_call_1): Use constructor_name for cdtors and
2492 * class.c (build_self_reference): Use TYPE_NAME to get name of
2494 * name-lookup (constructor_name): Use DECL_NAME directly.
2495 (constructor_name_p): Reimplement.
2496 (push_class_level_binding_1): Use TYPE_NAME directly.
2498 * class.c (finish_struct): Use OVL_P.
2499 (get_vfield_name): Measure constructor_name length.
2500 * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
2501 (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
2502 * cxx-pretty-print.c (is_destructor_name): Delete.
2503 (pp_cxx_unqualified_id): Remove bogus destructor name checking.
2504 * decl.c (grokfndecl): Move cheap checks first when looking for
2505 implicit extern cness.
2507 * parser.c (cp_parser_direct_declarator): Reorder if to avoid
2508 indentation. Remove unnecessary assignment of constructor name.
2510 Whitespace cleanups.
2511 * call.c (name_as_c_string): Move CONST_CAST to return.
2512 (build_new_method_call_1): Remove unneeded bracing.
2513 * class.c (include_empty_classes): Unbreak line.
2514 * constraint.cc (tsubst_check_constraint): Add space.
2515 * cp-tree.h (lang_decl_ns): Add comment.
2516 (PTRMEM_CST_MEMBER): Break line.
2517 * decl.c (grokfndecl): Add blank lines. Unbreak some others.
2518 (grokdeclarator): Remove lines, move declaration to first use.
2519 * decl2.c (decl_needed_p): Fix indentation.
2520 (c_parse_final_cleanups): Remove blank line.
2521 * method.c (implicitly_declare_fn): Move declaration to first use.
2522 * search.c (current_scope): Add blank lines.
2524 2017-06-28 Jason Merrill <jason@redhat.com>
2526 PR c++/72764 - ICE with invalid template typename.
2527 * decl.c (build_typename_type): No longer static.
2528 * tree.c (strip_typedefs): Use it instead of make_typename_type.
2530 PR c++/69300 - ICE with self-referential noexcept
2531 * pt.c (maybe_instantiate_noexcept): Check for recursion.
2533 PR c++/61022 - error with variadic template template parm
2534 * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
2536 PR c++/72801 - ICE with variadic partial specialization
2537 * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
2539 PR c++/55639 - partial specialization with ::template
2540 * parser.c (cp_parser_class_head): Handle ::template.
2542 PR c++/45976 - error with ::template in declarator.
2543 * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
2545 PR c++/54769 - wrong lookup of dependent template-name.
2546 * parser.c (cp_parser_template_name): Handle dependent object type.
2547 (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
2549 (cp_parser_id_expression): Pass it.
2550 (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
2552 * parser.c (cp_parser_template_id): Use the range location on the
2555 PR c++/81204 - parse error with dependent template-name
2556 * parser.c (cp_parser_lookup_name): Disqualify function templates
2559 2017-06-27 Nathan Sidwell <nathan@acm.org>
2561 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
2562 initialization point. Don't unnecessarily check for ctor name.
2564 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
2565 (CLASSTYPE_DESTRUCTOR): ... this.
2566 * class.c (accessible_nvdtor_p,
2567 maybe_warn_about_overly_private_class,
2568 add_implicitly_declared_members,
2569 clone_constructors_and_destructors, type_has_virtual_destructor):
2570 Adjust for CLASSTYPE_DESTRUCTOR.
2571 (deduce_noexcept_on_destructors): Absorb into ...
2572 (check_bases_and_members): ... here.
2573 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
2574 * init.c (build_delete): Likewise.
2575 * parser.c (cp_parser_lookup_name): Likewise.
2576 * pt.c (check_explicit_specialization): Likewise.
2577 * rtti.c (emit_support_tinfos): Likewise.
2578 * search.c (lookup_fnfields_idx_nolazy): Likewise.
2580 Kill IDENTIFIER_TEMPLATE.
2581 * cp-tree.h (lang_identifier): Remove class_template_info field.
2582 (IDENTIFIER_TEMPLATE): Delete.
2583 * name-lookup.c (constructor_name_full): Subsume into ...
2584 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
2585 (constructor_name_p): Likewise.
2586 * mangle.c (write_source_name): Likewise.
2587 * ptree.c (cxx_print_identifier): Likewise.
2589 2017-06-27 Marek Polacek <polacek@redhat.com>
2592 * parser.c (cp_parser_already_scoped_statement): Initialize
2595 2017-06-26 Jason Merrill <jason@redhat.com>
2597 PR c++/81215 - deduction failure with variadic TTP.
2598 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
2600 2017-06-26 Martin Sebor <msebor@redhat.com>
2603 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
2604 to detect casting away cv-qualifiers.
2606 2017-06-26 Nathan Sidwell <nathan@acm.org>
2608 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
2609 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
2611 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
2612 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
2613 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
2614 * decl.c (grok_op_properties): Adjust identifier checking.
2615 * init.c (expand_default_init): Adjust identifier descision.
2616 * method.c (implicitly_declare_fn): Don't use
2617 DECL_ASSIGNMENT_OPERATOR_P.
2618 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
2620 * call.c (in_charge_arg_for_name): Reimplement.
2621 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
2624 2017-06-26 Marek Polacek <polacek@redhat.com>
2627 * parser.c (cp_parser_statement): Add a default argument. Save the
2628 location of the expression-statement after labels have been parsed.
2629 (cp_parser_implicitly_scoped_statement): Set the location of the
2630 body of the conditional after parsing all the labels. Call
2631 warn_for_multistatement_macros.
2632 (cp_parser_already_scoped_statement): Likewise.
2634 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
2637 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
2638 'typename' in error messages about missing 'typename'.
2640 2017-06-23 Jason Merrill <jason@redhat.com>
2642 PR c++/79056 - C++17 ICE with invalid template syntax.
2643 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
2645 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
2646 * pt.c (template_placeholder_p): New.
2647 * cp-tree.h: Declare it.
2649 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
2651 * decl.c (duplicate_decls): Use builtin_structptr_types.
2653 2017-06-22 Nathan Sidwell <nathan@acm.org>
2655 Reorder IDENTIFIER flags
2657 * cp-tree.h (enum cp_identifier_kind): New.
2658 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
2659 IDENTIFIER_KIND_BIT_2): New.
2660 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
2661 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
2662 (C_IS_RESERVED_WORD): Replace with ...
2663 (IDENTIFIER_KEYWORD_P): ... this.
2664 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
2665 (IDENTIFIER_CDTOR_P): ... this.
2666 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
2667 (IDENTIFIER_OPNAME_P): Replace with ...
2668 (IDENTIFIER_ANY_OP_P): ... this.
2669 (IDENTIFIER_ASSIGN_OP_P): New.
2670 (IDENTIFIER_TYPENAME_P): Replace with ...
2671 (IDENTIFIER_CONV_OP_P): ... this.
2672 (NEW_DELETE_OPNAME_P): Replace with ...
2673 (IDENTIFIER_NEWDEL_OP_P): ... this.
2674 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
2675 (get_identifier_kind_name, set_identifier_kind): Declare.
2676 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
2677 (init_operators): Adjust to avoid keywords, use
2678 set_identifier_kind. Copy TYPE_EXPR slot.
2679 (init_reswords): Call set_identifier_kind.
2680 (unqualified_name_lookup_error): Adjust.
2681 * operators.def (TYPE_EXPR): Remove.
2682 * decl.c (struct predefined_identifier): Move into ...
2683 (initialize_predefined_identifiers): ... here. Call
2684 set_identifier_kind.
2685 (grokfndecl, check_var_type, grokdeclarator): Adjust.
2686 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
2688 * call.c (name_as_c_string): Adjust.
2689 (build_new_method_call_1): Likewise.
2690 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
2691 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
2692 * dump.c (cp_dump_tree): Adjust.
2693 * error.c (dump_decl_name): Adjust.
2694 * mangle.c (write_unqualified_id, write_member_name,
2695 write_expression): Adjust.
2696 (mangle_conv_op_name_for_type): Use set_identifier_kind.
2697 * name-lookup.c (do_class_using_decl): Adjust.
2698 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
2699 * parser.c (cp_lexer_get_preprocessor_token,
2700 cp_parser_direct_declarator): Likewise.
2701 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
2702 tsubst_copy, tsubst_copy_and_build): Adjust.
2703 * ptree.c (cxx_print_identifier): Print identifier kind.
2704 * search.c (lookup_field_r, lookup_member,
2705 lookup_fnfields_idx_nolazy): Adjust.
2706 * semantics.c (finish_id_expression): Adjust..
2707 * typeck.c (cp_build_addr_expr_1): Adjust.
2709 2017-06-21 Jakub Jelinek <jakub@redhat.com>
2712 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
2713 Complain about t not being a variable if t is OVERLOAD even
2714 when processing_template_decl.
2716 2017-06-21 David Malcolm <dmalcolm@redhat.com>
2718 * parser.c (get_cast_suggestion): New function.
2719 (maybe_add_cast_fixit): New function.
2720 (cp_parser_cast_expression): Capture the location of the closing
2721 parenthesis. Call maybe_add_cast_fixit when emitting warnings
2722 about old-style casts.
2724 2017-06-20 Jason Merrill <jason@redhat.com>
2726 PR c++/80972 - C++17 ICE with attribute packed.
2727 * call.c (build_over_call): Allow a TARGET_EXPR from reference
2730 2017-06-20 Nathan Sidwell <nathan@acm.org>
2732 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
2733 (nelts_identifier): Delete.
2734 * decl.c (initialize_predefined_identifiers): Remove nelts.
2736 PR c++/67074 - namespace aliases
2737 * decl.c (duplicate_decls): Don't error here on mismatched
2739 * name-lookup.c (name_lookup::add_value): Matching namespaces are
2741 (diagnose_name_conflict): Namespaces are never redeclarations.
2742 (update_binding): An alias can match a real namespace.
2744 2017-06-19 Jason Merrill <jason@redhat.com>
2746 PR c++/80562 - ICE with constexpr if.
2747 * semantics.c (finish_if_stmt_cond): Call
2748 instantiate_non_dependent_expr.
2750 PR c++/80829 - ICE with constexpr copy of base subobject.
2751 * constexpr.c (clear_no_implicit_zero): New.
2752 (cxx_eval_call_expression): Call it.
2754 2017-06-19 Nathan Sidwell <nathan@acm.org>
2758 * name-lookup.c (set_decl_namespace): Don't follow using
2759 directives and ignore using decls. Only check overly-explicit
2760 scope after discovering decl.
2762 2017-06-19 Jason Merrill <jason@redhat.com>
2764 PR c++/81073 - constexpr and static var in statement-expression.
2765 * typeck2.c (store_init_value): Always call
2766 require_potential_constant_expression.
2767 * pt.c (convert_nontype_argument): Likewise.
2768 * constexpr.c (potential_constant_expression_1): Adjust message.
2769 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
2770 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
2772 2017-06-19 Nathan Sidwell <nathan@acm.org>
2774 * pt.c (coerce_template_parms): Fix indentation.
2775 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
2779 * name-lookup.c (update_binding): Only warn about constructors
2780 hidden by functions.
2782 2017-06-17 Jason Merrill <jason@redhat.com>
2784 PR c++/60063 - -Wunused-local-typedefs and templates.
2785 * decl2.c (is_late_template_attribute): Return false for "used".
2787 PR c++/70844 - -Wuseless-cast and inheriting constructor.
2788 * method.c (forward_parm): Suppress warn_useless_cast.
2790 2017-06-16 Jason Merrill <jason@redhat.com>
2792 PR c++/81045 - Wrong type-dependence with auto return type.
2793 * pt.c (type_dependent_expression_p): An undeduced auto outside the
2794 template isn't dependent.
2795 * call.c (build_over_call): Instantiate undeduced auto even in a
2798 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
2799 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
2800 set longer for a generic lambda.
2802 PR c++/80614 - Wrong mangling for C++17 noexcept type
2803 * mangle.c (write_type): Put the eh spec back on the function type.
2805 PR c++/81102 - Wrong error with partial specialization.
2806 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
2807 types. Do type deduction later.
2809 PR c++/81074 - ICE with partial specialization of member template.
2811 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
2813 PR c++/80831 - ICE with -fsyntax-only.
2814 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
2816 PR c++/80639 - ICE with invalid PMF initialization.
2817 PR c++/80043 - ICE with -fpermissive
2818 * typeck.c (convert_for_assignment): Recurse when instantiate_type
2819 returns without an error.
2821 2017-06-16 Nathan Sidwell <nathan@acm.org>
2823 * pt.c (tsubst_baselink): Fix & clarify formatting.
2825 * cp-tree.h (build_this_parm, cp_build_parm_decl,
2826 build_artificial_parm): Add FN parm.
2827 * decl.c (start_cleanup_fn): Adjust.
2828 (build_this_parm): Add FN parm, pass it through.
2829 (grokfndecl): Adjust parm building.
2830 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
2831 (build_artificial_parm): Add FN parm, pass through.
2832 (maybe_retrofit_in_chrg): Adjust parm building.
2833 (start_static_storage_duration_function): Likwise.
2834 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
2835 * method.c (implicitly_declare_fn): Likewise.
2836 * parser.c (inject_this_parameter): Likewise.
2838 Symbol tables are insert only.
2839 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
2840 derive from pointer_hash. Make undeletable.
2842 * class.c (resort_type_method_vec): Avoid potential unsigned
2845 Don't defer noexcept_deferred_spec.
2846 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
2847 * decl.c (cxx_init_decl_processing): Initialize
2848 noexcept_deferred_spec.
2849 * except.c (unevaluated_noexcept_spec): Delete.
2850 * class.c (deduce_noexcept_on_destructor): Use
2851 noexcept_deferred_spec directly.
2852 * method.c (implicitly_declare_fn): Likewise.
2854 Make keyed_classes a vector.
2855 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
2856 (keyed_classes): Declare as vector.
2857 * decl.c (keyed_classes): Define.
2858 (cxx_init_decl_processing): Allocate it.
2859 (record_key_method_defined): Use vec_safe_push.
2860 * class.c (finish_struct_1): Likewise.
2861 * pt.c (instantiate_class_template_1): Likewise.
2862 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
2865 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
2866 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
2868 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
2869 (get_tinfo_decl): Use get_tinfo_desc.
2870 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
2871 (create_pseudo_type_info): Delete.
2872 (get_pseudo_ti_index): Just determine the index.
2873 (get_tinfo_desc): New. Create all types lazily.
2874 (create_tinfo_types): Just allocate the descriptor array.
2875 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
2878 2017-06-15 Martin Sebor <msebor@redhat.com>
2881 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
2883 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
2884 (build_cxx_call): Call maybe_warn_class_memaccess.
2886 2017-06-14 Jakub Jelinek <jakub@redhat.com>
2888 * cp-gimplify.c (cp_genericize_r): Turn most of the function
2889 into a switch (TREE_CODE (stmt)) statement from long else if
2892 2017-06-13 Jakub Jelinek <jakub@redhat.com>
2895 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
2896 argument even if it has REFERENCE_TYPE.
2899 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
2900 BLOCK_VARS (outer) chain.
2901 (cxx_omp_const_qual_no_mutable): Likewise.
2903 2017-06-13 Martin Liska <mliska@suse.cz>
2906 * class.c (build_base_path): Use sanitize_flags_p.
2907 * cp-gimplify.c (cp_genericize_r): Likewise.
2908 (cp_genericize_tree): Likewise.
2909 (cp_genericize): Likewise.
2910 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2911 * decl.c (compute_array_index_type): Likewise.
2912 (start_preparsed_function): Likewise.
2913 * decl2.c (one_static_initialization_or_destruction): Likewise.
2914 * init.c (finish_length_check): Likewise.
2915 * lambda.c (maybe_add_lambda_conv_op): Likewise.
2916 * typeck.c (cp_build_binary_op): Likewise.
2917 (build_static_cast_1): Likewise.
2919 2017-06-11 Jason Merrill <jason@redhat.com>
2921 * error.c (dump_expr): Use is_this_parameter.
2923 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
2926 2017-06-09 Jason Merrill <jason@redhat.com>
2928 Missing bits from N4268, constant evaluation for all non-type args.
2929 * call.c (build_converted_constant_expr): Rename from
2930 build_integral_nontype_arg_conv, handle all types.
2931 * pt.c (convert_nontype_argument): In C++17 call it for all types.
2932 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
2933 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
2935 Overhaul pointer-to-member conversion and template argument handling.
2936 * call.c (standard_conversion): Avoid creating ck_pmem when the
2937 class type is the same.
2938 * cvt.c (can_convert_qual): Split from
2939 perform_qualification_conversions.
2940 * constexpr.c (cxx_eval_constant_expression): Check it.
2941 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
2942 adjustment is necessary.
2943 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
2944 (convert_nontype_argument): Avoid redundant error.
2946 * call.c (convert_like_real): Remove "inner" parameter.
2947 Don't replace a constant with its value.
2948 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
2950 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
2953 * parser.c (cp_parser_constant_expression): Check
2954 potential_rvalue_constant_expression after decay_conversion.
2955 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
2957 PR c++/80384 - ICE with dependent noexcept-specifier
2958 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
2961 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
2963 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
2965 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
2966 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
2967 (excpet.c): Mark terminate as cold.
2969 2017-06-08 Jakub Jelinek <jakub@redhat.com>
2972 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
2973 to sizetype before size_binop.
2976 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
2977 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
2978 and OMP_CLAUSE_SHARED_READONLY flags.
2980 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
2982 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
2984 2017-06-07 Nathan Sidwell <nathan@acm.org>
2986 * class.c (layout_class_type): Restructure overlong-bitfield tpe
2989 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
2992 * pt.c (do_class_deduction): Build qualified type.
2994 2017-06-06 Nathan Sidwell <nathan@acm.org>
2996 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
2997 sans using directives. Don't walk into inline namespaces.
3000 * name-lookup.c (adl_class_only): Don't add visible friends.
3002 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
3004 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
3006 2017-06-02 Nathan Sidwell <nathan@acm.org>
3008 Remove lang_type_ptrmem.
3009 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
3011 (lang_type_class): ... this. Reorder bitfields. Rename to ...
3012 (lang_type): ... this. Delete old definition.
3013 (lang_type_ptrmem): Delete.
3014 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
3015 (LANG_TYPE_PTRMEM_CHECK): Delete.
3016 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
3017 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
3018 * decl.c (build_ptrmemfunc_type): Adjust.
3019 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
3020 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
3022 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
3025 Remove cp_binding_level::namespaces
3026 * name-lookup.h (cp_binding_level): Lose namespaces field.
3027 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
3029 (suggest_alternatives_for): Adjust for namespace list. Do
3030 breadth-first search.
3031 * decl2.c (collect_source_refs): Namespaces are on the regulr
3033 (collect_ada_namespace): Likewise.
3035 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
3037 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
3040 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
3043 * method.c (constructible_expr): Strip array types before calling
3046 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
3049 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
3050 for case INDIRECT_REF too in the main switch.
3052 2017-05-31 Jason Merrill <jason@redhat.com>
3054 PR c++/80840 - ICE with constexpr and reference
3055 * pt.c (convert_nontype_argument): Don't test whether a decl is
3056 value-dependent when binding to a reference.
3058 2017-05-31 Nathan Sidwell <nathan@acm.org>
3060 * cp-tree.h (lang_decl_slector): New enum.
3061 (lang_decl_base): Make selector an enum. Drop decomposition_p
3063 (lang_decl): Use enum for discrimination.
3064 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
3065 LANG_DECL_DEOMP_CHECK): Use enum.
3066 (DECL_DECOMPOSITION_P): Use selector value.
3067 (SET_DECL_DECOMPOSITION_P): Delete.
3068 (retrofit_lang_decl): Lose SEL parm.
3069 (fit_decomposition_lang_decl): Declare.
3070 * decl.c (cp_finish_decomp, grokdeclarator): Use
3071 fit_decomposition_lang_decl.
3072 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
3074 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
3075 (fit_decomposition_lang_decl): Likewise.
3076 (retrofit_lang_decl): Use worker functions.
3077 (cxx_dup_lang_specific_decl): Use selector enum.
3078 (maybe_add_lang_type_raw): New. Broken out of ...
3079 (cxx_make_type_name): ... here. Call it.
3081 2017-05-30 Jason Merrill <jason@redhat.com>
3083 PR c++/80856 - ICE with local extern in template
3084 * semantics.c (finish_call_expr): Replace a local extern overload
3085 set in a template with the IDENTIFIER_NODE.
3087 2017-05-30 David Malcolm <dmalcolm@redhat.com>
3089 * call.c (perform_implicit_conversion_flags): Convert
3090 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
3091 (print_conversion_rejection): Replace pairs of %qT with
3092 %qH and %qI in various places.
3093 (build_user_type_conversion_1): Likewise.
3094 (build_integral_nontype_arg_conv): Likewise.
3095 (build_conditional_expr_1): Likewise.
3096 (convert_like_real): Likewise.
3097 (convert_arg_to_ellipsis): Likewise.
3099 (initialize_reference): Likewise.
3100 * cvt.c (cp_convert_to_pointer): Likewise.
3101 (cp_convert_to_pointer): Likewise.
3102 (convert_to_reference): Likewise.
3103 (ocp_convert): Likewise.
3104 * error.c (cp_printer): Gain bool and const char ** parameters.
3105 (struct deferred_printed_type): New struct.
3106 (class cxx_format_postprocessor): New class.
3107 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
3108 to pp->m_format_postprocessor.
3109 (comparable_template_types_p): New function.
3110 (newline_and_indent): New function.
3111 (arg_to_string): New function.
3112 (print_nonequal_arg): New function.
3113 (print_template_differences): New function.
3114 (type_to_string_with_compare): New function.
3115 (print_template_tree_comparison): New function.
3116 (append_formatted_chunk): New function.
3117 (add_quotes): New function.
3118 (cxx_format_postprocessor::handle): New function.
3119 (defer_phase_2_of_type_diff): New function.
3120 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
3122 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
3123 %qH and %qI in various places.
3124 (convert_member_func_to_ptr): Likewise.
3125 (build_reinterpret_cast_1): Likewise.
3126 (convert_for_assignment): Likewise.
3127 * typeck2.c (check_narrowing): Likewise.
3129 2017-05-30 Nathan Sidwell <nathan@acm.org>
3131 Kill IDENTIFIER_NAMESPACE_BINDINGS
3132 * cp-tree.h (lang_identifier): Delete namespace_bindings.
3133 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
3134 (lang_decl_ns): Add bindings.
3135 (DECL_NAMESPACE_BINDINGS): New.
3136 * lex.c (retrofit_lang_decl): Create namespace hash table.
3137 * name-lookup.c (find_namespace_slot): Change to use hash-map.
3138 * ptree.c (cxx_print_binding): Delete.
3139 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
3141 * cp-tree.def (OVERLOAD): Fix comment.
3142 * cp-tree.h: Fix comments and whitespace.
3143 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
3144 * name-lookup.c (add_decl_to_level): Assert not class.
3145 (check_local_shadow): Use OVL_P.
3146 (pushdecl_with_scope_1): Rename to ...
3147 (do_pushdecl_with_Scope): ... here.
3148 (do_nonmember_using_decl): Use qualified_namespace_lookup return
3150 (push_class_level_binding_1): Use OVL_P.
3151 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
3152 (pushtag_1): Rename to ...
3153 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
3155 (store_class_bindings): Do not time here.
3156 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
3157 * pt.c (listify): Declare argvec at point of initialization.
3160 * name-lookup.c (add_decl_to_level): Assert not making a circular
3162 (update_binding): Don't prematurely slide artificial decl.
3164 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
3166 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
3168 2017-05-29 Nathan Sidwell <nathan@acm.org>
3170 PR c++/80891 (#1,#5)
3171 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
3172 * name-lookup.c (name_lookup): Add deduping field.
3173 (name_lookup::preserve_state, name_lookup::restore_state): Deal
3175 (name_lookup::add_overload): New.
3176 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
3177 (name_lookup::search_adl): Set deduping. Don't unmark here.
3178 * pt.c (most_specialized_instantiation): Revert previous change,
3179 Assert not given duplicates.
3180 * tree.c (lookup_mark): Just mark the underlying decls.
3181 (lookup_maybe_add): Dedup using marked decls.
3184 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
3185 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
3187 Stat hack representation
3188 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
3189 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
3191 (find_namespace_binding): Replace with ...
3192 (find_namespace_slot): ... this.
3193 (find_namespace_value): New.
3194 (name_lookup::search_namespace_only,
3195 name_lookup::adl_namespace_only): Adjust.
3196 (update_binding): Add SLOT parameter, adjust.
3197 (check_local_shadow): Use find_namespace_value.
3198 (set_local_extern_decl_linkage): Likewise.
3199 (do_pushdecl): Adjust for namespace slot.
3200 (push_local_binding): Assert not a namespace binding.
3201 (check_for_out_of_scope_variable): Use find_namespace_value.
3202 (set_identifier_type_value_with_scope): Likewise.
3203 (get_namespace_binding): Likewise.
3204 (set_namespace_binding): Delete.
3205 (set_global_binding): Directly update the binding.
3206 (finish_namespace_using_decl): Likewise.
3207 (lookup_type_scope_1): Use find_namespace_slot and update.
3208 (do_push_nested_namespace): Use find_namespace_value.
3211 * pt.c (most_specialized_instantiation): Cope with duplicate
3215 * cp-tree.h (build_min_nt_call_vec): Declare.
3216 * decl.c (build_offset_ref_call_from_tree): Call it.
3217 * parser.c (cp_parser_postfix_expression): Likewise.
3218 * pt.c (tsubst_copy_and_build): Likewise.
3219 * semantics.c (finish_call_expr): Likewise.
3220 * tree.c (build_min_nt_loc): Keep unresolved lookups.
3221 (build_min): Likewise.
3222 (build_min_non_dep): Likewise.
3223 (build_min_non_dep_call_vec): Likewise.
3224 (build_min_nt_call_vec): New.
3227 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
3229 (lookup_keep): Call it.
3231 2017-05-26 Nathan Sidwell <nathan@acm.org>
3234 * name-lookup.c (push_inline_namespaces): New.
3235 (push_namespace): Look inside inline namespaces.
3237 Inline and using namespace representation change.
3238 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
3240 (DECL_NAMESPACE_USING): Adjust.
3241 (DECL_NAMESPACE_INLINEES): New.
3242 * name-lookup.h (struct cp_binding_level): Change usings
3244 * name-lookup.c (name_lookup::do_queue_usings,
3245 name_lookup::queue_usings): Adjust.
3246 (name_lookup::search_namespace, name_lookup::search_usings,
3247 name_lookup::queue_namespace): Adjust.
3248 (name_lookup::adl_namespace_only): Adjust.
3249 (add_using_namespace, push_namespace): Push onto vector.
3250 (pop_namespace): Add timing logic.
3252 * call.c (build_operator_new_call): Do namelookup and ADL here.
3253 (build_new_op_1): Likewise.
3254 * name-lookup.h (lookup_function_nonclass): Delete declaration.
3255 (do_using_directive): Likewise.
3256 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
3258 (struct scope_binding): Delete.
3259 (EMPTY_SCOPE_BINDING): Delete.
3260 (set_decl_namespace): Use OVL_P.
3261 (finish_local_using_decl): Lose unnecesary checks.
3262 (lookup_function_nonclass): Delete.
3263 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
3265 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
3266 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
3268 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
3269 (lkp_iterator): Add outer field. Adjust ctor.
3270 (lkp_iterator::operator++): New.
3271 (lookup_mark, lookup_maybe_add): Declare.
3272 * name-lookup.c (name_lookup): Delete fn_set member.
3273 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
3275 (name_lookup::add_value): Use lookup_add directly.
3276 (name_lookup::add_fns: Use lookup_maybe_add.
3277 (name_lookup::search_adl): Mark and unmark fns.
3279 * pt.c (check_explicit_specialization): Use lookup_add directly.
3280 * ptree.c (cxx_print_xnode): Show complete overload structure.
3281 * tree.c (lookup_mark, lookup_maybe_add): New.
3283 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
3285 2017-05-26 Jakub Jelinek <jakub@redhat.com>
3287 * cp-tree.h (struct lang_decl_decomp): New type.
3288 (struct lang_decl): Add u.decomp.
3289 (LANG_DECL_DECOMP_CHECK): Define.
3290 (DECL_DECOMPOSITION_P): Note it is set also on the vars
3291 for user identifiers.
3292 (DECL_DECOMP_BASE): Define.
3293 (retrofit_lang_decl): Add extra int = 0 argument.
3294 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
3295 use it to influence the selector choices and for selector
3296 0 to non-zero transition copy old content.
3297 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
3298 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
3299 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
3300 wording if decl is a structured binding.
3301 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
3302 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
3303 of individual variables for tuple structured bindings.
3304 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
3305 Clear DECL_DECOMP_BASE.
3306 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
3307 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
3309 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
3312 2017-05-25 Jason Merrill <jason@redhat.com>
3314 PR c++/80605 - __is_standard_layout and zero-length array
3315 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
3317 2017-05-25 Nathan Sidwell <nathan@acm.org>
3319 Kill OVL_CURRENT, OVL_NEXT.
3320 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
3321 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
3322 (consider_binding_level): Use OVL_FIRST.
3323 (cp_emit_debug_info_for_using): Use lkp_iterator.
3324 * pt.c (check_explicit_specialization): Use ovl_iterator.
3326 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
3327 * cp-tree.h (lang_decl_ns): Remove ns_users field.
3328 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
3329 (TREE_INDIRECT_USING): Delete.
3330 * name-lookup.h (is_associated_namespace): Delete.
3331 * name-lookup.c (name_lookup::search_usings,
3332 name_lookup::do_queue_usings): Usings are always direct.
3333 (is_associated_namespace): Delete.
3334 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
3335 (namespace_ancestor_1, namespace_ancestor): Delete.
3336 (push_using_directive_1, push_using_directive): Delete.
3337 (add_using_namespace_1): Delete.
3338 (add_using_namespace): Reimplement.
3339 (emit_debug_info_using_namespace): New.
3340 (finish_namespace_using_directive, finish_local_using_directive,
3341 push_namespace): Adjust.
3342 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
3344 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
3346 * semantics.c (finish_handler_parms): Warn about non-reference type
3349 2017-05-25 Nathan Sidwell <nathan@acm.org>
3351 Reimplement unqualified namespace lookup.
3352 * name-lookup.c (name_lookup::using_pair,
3353 name_lookup::using_queue): New typedefs.
3354 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
3355 name_lookup::queue_usings): New.
3356 (name_lookup::search_unqualified): New.
3357 (merge_functions, same_entity_p, ambiguous_decl,
3358 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
3359 lookup_using_namespace): Delete.
3360 (lookup_name_real_1): Adjust.
3362 Reimplement qualified namespace lookup.
3363 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
3364 (name_lookup::ambiguous, name_lookup::add_value,
3365 name_lookup::add_type, name_lookup::process_binding): New.
3366 (name_lookup::search_namespace_only,
3367 name_lookup::search_namespace, name_lookup::search_usings): New.
3368 (name_lookup::search_qualified): New.
3369 (do_nonmember_using_decl, suggest_alternatives_for,
3370 lookup_qualified_name): Adjust.
3371 (tree_vec_contains): Delete.
3372 (qualified_lookup_using_namespace): Rename to ...
3373 (qualified_namespace_lookup): ... here. Reimplement.
3376 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
3377 * name-lookup.h (lookup_arg_dependent): Return plain tree.
3378 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
3379 arg_assoc_args_vec, arg_assoc_type, add_function,
3380 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
3381 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
3382 lookup_arg_dependent_1): Delete.
3383 (name_lookup): New lookup object.
3384 (name_lookup::preserve_state, name_lookup::restore_state,
3385 name_lookup::mark_seen, name_lookup::find_and_mark,
3386 name_lookup::add_fns, name_lookup::adl_namespace_only,
3387 name_lookup::adl_namespace, name_lookup::adl_class_only,
3388 name_lookup::adl_bases, name_lookup::adl_class,
3389 name_lookup::adl_expr, name_lookup::adl_type,
3390 name_lookup::adl_template_arg, name_lookup::search_adl): New.
3391 (lookup_arg_dependent): Return a plain tree. Adjust.
3392 (is_associated_namespace): Move later.
3394 2017-05-24 Nathan Sidwell <nathan@acm.org>
3396 * friend.c (do_friend): Remove check for existing decl.
3397 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
3398 * name-lookup.c (push_local_binding): Directly look for binding.
3399 (lookup_name_innermost_nonclass_level_1): Delete.
3400 (lookup_name_innermost_nonclass_level): Delete.
3402 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
3404 * cp-tree.h (cp_free_lang_data): Add extern.
3405 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
3407 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
3408 * typeck.c (type_unknown_p): Delete.
3409 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
3410 overload management.
3411 (dependent_name): Likewise.
3412 (decl_anon_ns_mem_p): Simplify.
3414 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
3417 * tree.c (reshape_init): Use unqualified type for direct enum init.
3418 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
3419 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
3420 non-class destination types.
3421 (build_const_cast_1): Strip cv-quals from destination types.
3422 (build_static_cast, build_reinterpret_cast, build_const_cast)
3423 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
3425 2017-05-24 Martin Sebor <msebor@redhat.com>
3428 * call.c (fully_fold_internal): Adjust.
3430 2017-05-24 Nathan Sidwell <nathan@acm.org>
3432 * cp-tree.h (ovl_skip_hidden): Declare.
3433 * tree.c (ovl_skip_hidden): New.
3434 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
3435 (lookup_arg_dependent_1): Likewise.
3436 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
3437 (hidden_name_p, remove_hidden_names): Delete.
3438 (lookup_name_real_1): Do not strip hidden names.
3439 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
3441 * cp-tree.h (OVL_HIDDEN_P): New.
3442 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
3443 (ovl_iterator::reveal_node): Declare.
3444 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
3445 (ovl_insert): Order on hiddenness.
3446 (ovl_iterator::reveal_node): New.
3447 * name-lookup.c (anticipated_builtin_p): New.
3448 (supplement_binding_1): Use it.
3449 (set_local_extern_decl_linkage): Use hidden_p.
3450 (do_pushdecl): Deal with unhiding a hidden decl, use
3451 anticipated_builtin_p.
3452 (do_nonmember_using_decl): Use anticipated_decl_p.
3453 (lookup_name_real_1): Use DECL_HIDDEN_P.
3455 2017-05-23 Jason Merrill <jason@redhat.com>
3457 -Wunused and C++17 structured bindings
3458 * decl.c (poplevel): Don't warn about unused structured bindings,
3459 only real variables.
3460 * error.c (dump_simple_decl): Handle structured bindings.
3461 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
3463 2017-05-23 Nathan Sidwell <nathan@acm.org>
3465 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
3466 * name-lookup.c (create_local_binding): New.
3467 (update_binding): New.
3468 (pushdecl_maybe_friend_1): Rename to ...
3469 (do_pushdecl): ... this. Reimplement.
3471 (push_overloaded_decl_1, push_overloaded_decl): Delete.
3473 2017-05-23 Jason Merrill <jason@redhat.com>
3475 PR c++/80396 - built-in for make_integer_sequence.
3476 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
3477 (expand_integer_pack, expand_builtin_pack_call): New.
3478 (find_parameter_packs_r): Check builtin_pack_call_p.
3479 (check_for_bare_parameter_packs): Handle it.
3480 (tsubst_pack_expansion): Call expand_builtin_pack_call.
3481 (declare_integer_pack): New.
3482 (init_template_processing): Call it.
3483 * decl2.c (mark_used): Check builtin_pack_fn_p.
3485 2017-05-23 Nathan Sidwell <nathan@acm.org>
3487 * name-lookup.c (find_namespace_binding): New.
3488 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
3489 (set_identifier_type_value_with_scope): Use find_namespace_binding.
3490 (find_binding, cp_binding_level_find_binding_for_name,
3491 binding_for_name, namespace_binding_1): Delete.
3492 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
3493 (get_namespace_binding, set_namespace_binding,
3494 finish_namespace_using_decl, unqualified_namespace_lookup_1,
3495 qualified_lookup_using_namespace, lookup_type_scope_1,
3496 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
3499 * parser.c (cp_parser_template_id): Keep the lookup when stashing
3502 * cp-tree.h (DECL_HIDDEN_P): New.
3503 * name-lookup.c (set_decl_context,
3504 set_local_extern_decl_linkage): New, broken out of ...
3505 (pushdecl_maybe_friend_1): ... here. Call them.
3507 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
3509 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
3510 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
3513 2017-05-23 Nathan Sidwell <nathan@acm.org>
3515 * cp-tree.h (OVL_P): New.
3516 * name-lookup.h (push_local_binding): Delete.
3517 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3518 (finish_namespace_using_decl, finish_local_using_decl): ... here
3519 * name-lookup.c (add_decl_to_level): Swap args.
3520 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
3521 (diagnose_name_conflict): Check contexts are same for redecl.
3522 (update_local_overload): New.
3523 (compparms_for_decl_and_using): Rename to ...
3524 (matching_fn_p): ... here.
3525 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
3526 push_local_bindings call.
3527 (push_local_binding): Make static, replace FLAGS arg with
3529 (validate_nonmember_using_decl): Use OVL_FIRST.
3530 (do_nonmember_using_decl): Use in/out parameters. Use
3531 lkp_iterator and simplify.
3532 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3533 (finish_namespace_using_decl, finish_local_using_decl): ... here.
3535 (lookup_type_current_level): Delete.
3536 * parser.c (cp_parser_using_declaration): Adjust.
3537 * pt.c (tsubst_expr): Adjust.
3539 2017-05-22 Nathan Sidwell <nathan@acm.org>
3541 * name-lookup.h (parse_using_directive): Replace with ...
3542 (finish_namespace_using_directive): ... this and ...
3543 (finish_local_using_directive): ... this.
3544 * name-lookup.c (add_using_namespace_1): Move later.
3545 (add_using_namespace): Move later, add namespace_p arg, remove
3547 (push_using_directive_1): Directly recurse.
3548 (do_using_directive, parse_using_directive): Delete, split into ...
3549 (finish_namespace_using_directive): ... this and ...
3550 (finish_local_using_directive): ... this.
3551 (push_namespace): Use add_using_namespace.
3552 * parser.c (cp_parser_using_directive): Call
3553 finish_namespace_using_directive or finish_local_using_directive.
3554 * pt.c (tsubst_expr): Call finish_local_using_directive.
3556 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
3557 * cp-tree.h (raw_dump_id): Declare.
3558 * decl2.c (raw_dump_id): Define.
3559 (dump_tu): Use raw_dump_id.
3561 * config-lang.in (gtfiles): Sort list, break lines.
3563 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
3564 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
3565 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
3566 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
3567 CPTI_RETHROW_FN): New.
3568 (noexcept_deferred_spec): New.
3569 (terminate_node, call_unexpected_node): Rename to ...
3570 (terminate_fn, call_unexpected_fn): ... here.
3571 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
3572 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
3573 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
3574 (init_exception_processing): Adjust.
3575 (declare_library_fn): Create and push the fns here.
3576 (do_get_exception_ptr, do_begin_catch, do_end_catch,
3577 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
3578 declare_library_fn use.
3579 (unevaluated_noexcept_spec): Adjust.
3580 * cp-gimplify.c (genericize_eh_spec_block,
3581 gimplify_most_not_throw_expr): Adjust.
3583 * name-lookup.c (pushdecl_top_level,
3584 pushdecl_top_level_and_finish): Move after namespace pushing and
3586 (push_to_top_level): Rename to ...
3587 (do_push_to_top_level): ... here. Remove timing code.
3588 (pop_from_top_level_1): Rename to ...
3589 (do_pop_from_top_level): ... here.
3590 (do_push_nested_namespace, do_pop_nested_namespace)
3591 (push_to_top_level): New wrapper for do_push_to_top_level.
3592 (pop_from_top_level): Adjust.
3593 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
3595 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
3597 * config-lang.in (gtfiles): Add c-family/c-format.c,
3598 except.c, init.c, lambda.c and friend.c.
3599 * class.c (dvirt_fn): Move out of function scope,
3601 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
3602 * init.c (fn): Likewise.
3603 * lambda.c (ptr_id, max_id): Likewise.
3604 * friend.c (global_friend): Add GTY attribute.
3606 2017-05-19 Nathan Sidwell <nathan@acm.org>
3608 * call.c (add_list_candidates): Use OVL_FIRST.
3609 (build_new_method_call_1): Likewise.
3610 * cp-tree.h (OVL_SINGLE_P): New.
3611 (TYPE_HIDDEN_P): New.
3612 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
3613 * dump.c (cp_tump_tree): Adjust overload dumping.
3614 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
3616 * method.c (lazily_declare_fn): Assert we added it.
3617 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
3619 (cp_parser_template_name): Use lkp_iterator.
3620 * pt.c (begin_template_parm_list): Fixup comment.
3621 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
3622 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
3623 (ovl_scope): Use lkp_iterator.
3625 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
3627 * parser.c (cp_parser_omp_clause_default): Handle
3628 "OMP_CLAUSE_DEFAULT_PRESENT".
3630 * parser.c (cp_parser_omp_clause_default): Avoid printing more
3631 than one syntax error message.
3633 2017-05-19 Nathan Sidwell <nathan@acm.org>
3635 * class.c (class_dump_id): Define.
3636 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
3637 * cp-objcp-common.c (cp_register_dumps): New.
3638 * cp-objcp-common.h (cp_register_dumps): Declare.
3639 (LANG_HOOKS_REGISTER_DUMPS): Override.
3640 * cp-tree.h (class_dump_id): Declare.
3642 2017-05-18 Nathan Sidwell <nathan@acm.org>
3644 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
3646 (lookup_keep): Declare.
3647 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
3648 * pt.c (tsubst_copy): Assert lookup is persistent.
3649 * semantics.c (finish_call_expr): Use lkp_iterator, call
3651 * tree.c (ovl_copy): New.
3652 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
3655 * cp-tree.h (OVL_USED): Replace with ...
3656 (OVL_USING_P): ... this.
3657 (ovl_iterator::using_p): Adjust.
3658 * name-lookup.c (push_overloaded_decl_1,
3659 do_nonmember_using_decl): Adjust.
3660 * search.c (lookup_field_r): Adjust.
3661 * tree.c (ovl_insert, ovl_scope): Adjust.
3663 * cp-tree.h (lookup_add): Swap args.
3664 (ovl_cons, build_overload): Delete.
3665 * name-lookup.c (add_function, push_overloaded_decl_1,
3666 do_nonmember_using_decl, merge_functions, remove_hidden_names):
3667 Use lookup_add, ovl_insert.
3668 * pt.c (check_explicit_specialization): Use lookup_add.
3669 (do_class_deduction): Likewise. Refactor if.
3670 * tree.c (lookup_add): Swap args.
3671 (ovl_cons, build_overload): Delete.
3673 * name-lookup.c (find_local_binding): New, broken out of ...
3674 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
3675 (set_namespace_binding): Swap scope & name args.
3676 (namespace_binding_1): Likewise.
3677 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
3678 (push_overloaded_decl_1): Likewise.
3679 (set_global_binding): Likewise.
3680 (get_namespace_binding): Adjust namespace_binding_1 call.
3682 2017-05-17 Nathan Sidwell <nathan@acm.org>
3684 * cp-tree.h (default_hash_traits <lang_identifier *>): New
3686 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
3687 (extern_c_fns): New hash table.
3688 (check_extern_c_conflict): New, broken out of ...
3689 (pushdecl_maybe_friend_1): ... here. Call it.
3690 (c_linkage_bindings): Just look in hash table.
3692 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
3696 Implement new C++ intrinsics __is_assignable and __is_constructible.
3697 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
3699 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3700 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3701 * method.c (constructible_expr): Set cp_unevaluated.
3702 (is_xible_helper): New.
3703 (is_trivially_xible): Adjust.
3705 * parser.c (cp_parser_primary_expression): Handle
3706 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
3707 (cp_parser_trait_expr): Likewise.
3708 * semantics.c (trait_expr_value): Handle
3709 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3711 2017-05-17 Nathan Sidwell <nathan@acm.org>
3713 * cp-tree.h (ovl_iterator::using_p): New predicate.
3714 (ovl_iterator::remove_node): New worker.
3715 (ovl_insert): Declare.
3716 * tree.c (ovl_insert): New.
3717 (ovl_iterator::remove_node): New.
3718 * class.c (add_method): Use ovl_iterator, ovl_insert.
3719 (clone_function_decl): Fix description.
3720 (clone_constructors_and_destructors): Use ovl_iterator.
3722 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
3723 (maybe_warn_about_overly_private_class): Use ovl_iterator.
3724 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
3725 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
3726 (get_base_fndecls): Use ovl_iterator.
3727 (warn_hidden): Use OVL_NAME, ovl_iterator.
3728 (add_implicitly_declared_members): Use ovl_iterator.
3729 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
3731 (finish_shorthand_constraint): Simplify, use ovl_make.
3732 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
3733 * search.c (shared_member_p): Use ovl_iterator.
3734 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
3735 (lookup_conversion_operator): Use OVL_FIRST.
3736 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
3737 (look_for_overrides_here): Use ovl_iterator.
3738 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
3739 * typeck.c (build_x_unary_op): Use ovl_make.
3741 2017-05-17 Martin Liska <mliska@suse.cz>
3743 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
3744 use it instead of int type.
3745 (dump_vtable): Likewise.
3746 (dump_vtt): Likewise.
3747 * decl2.c (dump_tu): Likewise.
3749 2017-05-16 David Malcolm <dmalcolm@redhat.com>
3751 * call.c (enforce_access): Add access_failure_info * param and use
3752 it to record access failures.
3753 * cp-tree.h (class access_failure_info): New class.
3754 (enforce_access): Add access_failure_info * param, defaulting to
3756 (lookup_member): Likewise.
3757 (locate_field_accessor): New function decl.
3758 (perform_or_defer_access_check): Add access_failure_info * param,
3760 * search.c (lookup_member): Add access_failure_info * param and
3761 pass it on to call to perform_or_defer_access_check.
3762 (matches_code_and_type_p): New function.
3763 (field_access_p): New function.
3764 (direct_accessor_p): New function.
3765 (reference_accessor_p): New function.
3766 (field_accessor_p): New function.
3767 (struct locate_field_data): New struct.
3768 (dfs_locate_field_accessor_pre): New function.
3769 (locate_field_accessor): New function.
3770 * semantics.c (perform_or_defer_access_check): Add
3771 access_failure_info * param, and pass it on to call to
3773 * typeck.c (access_failure_info::record_access_failure): New method.
3774 (access_failure_info::maybe_suggest_accessor): New method.
3775 (finish_class_member_access_expr): Pass an access_failure_info
3776 instance to the lookup_member call, and call its
3777 maybe_suggest_accessor method afterwards.
3779 2017-05-16 Marek Polacek <polacek@redhat.com>
3783 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
3785 2017-05-16 Nathan Sidwell <nathan@acm.org>
3787 * name-lookup.c (check_local_shadow): New, broke out of ...
3788 (pushdecl_maybe_friend_1): ... here. Call it.
3790 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
3791 (ovl_first): Move inline definition to end of file.
3792 (ovl_make, lookup_add): Declare.
3793 (get_fns, get_first_fn): Make pure.
3794 * tree.c (ovl_cache): New.
3795 (ovl_make, lookup_add): New.
3796 * pt.c (do_class_deduction): Don't add candidates that will be
3799 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
3800 (print_error_for_call_failure): Use OVL_NAME.
3801 (build_op_call_1): Use ovl_iterator.
3802 (add_candidates): Use OVL_FIRST & lkp_iterator.
3803 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
3805 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
3806 (type_has_user_nondefault_constructor,
3807 in_class_defaulted_default_constructor,
3808 type_has_user_provided_constructor,
3809 type_has_user_provided_or_explicit_constructor,
3810 type_has_non_user_provided_default_constructor,
3811 vbase_has_user_provided_move_assign,
3812 type_has_move_constructor, type_has_move_assign,
3813 type_has_user_declared_move_constructor,
3814 type_has_user_declared_move_assign,
3815 type_build_ctor_call, type_build_dtor_call,
3816 type_requires_array_cookie, explain_non_literal_class): Likewise.
3817 (finish_struct): Use lkp_iterator.
3818 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
3819 (note_name_declared_in_class): Use OVL_NAME.
3820 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
3821 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
3822 cxx_pretty_printer::expression): Likewise.
3823 * decl2.c (check_classfn): Use ovl_iterator.
3824 * pt.c (retrieve_specialization): Use ovl_iterator.
3825 * tree.c (cp_tree_equal): Use lkp_iterator.
3826 (type_has_nontrivial_copy_init): Use ovl_iterator.
3828 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
3829 check is_overloaded_fn.
3831 2017-05-16 Martin Liska <mliska@suse.cz>
3833 * parser.c (cp_lexer_print_token): Add default value for flags
3834 argument of print_gimple_stmt, print_gimple_expr,
3835 print_generic_stmt and print_generic_expr.
3837 2017-05-16 Nathan Sidwell <nathan@acm.org>
3839 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
3841 (MAYBE_BASELINK_FUNCTIONS): New.
3842 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
3843 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
3844 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
3845 * method.c (inherited_ctor_binfo): Use ovl_iterator.
3846 (binfo_inherited_from): Likewise.
3847 * parser.c (lookup_literal_operator): Use lkp_iterator.
3848 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
3849 (print_candidates_1): Likewise.
3850 (determine_specialization): Likewise.
3851 (resolve_overloaded_unification): Likewise.
3852 (resolve_nondeduced_context): Likewise.
3853 (type_dependent_expression_p): Likewise.
3854 (dependent_template_p): Likewise.
3855 * ptree.c (cxx_print_xnode): Likewise.
3856 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
3857 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
3858 * typeck.c (check_template_keyword): Use lkp_iterator.
3860 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
3862 * constexpr.c (function_concept_check): Use OVL_FIRST.
3863 * cvt.c (build_expr_type_conversion): Likewise.
3864 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
3865 * decl2.c (mark_used): Use OVL_FIRST.
3866 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
3867 (dump_expr, location_of): Use OVL_FIRST.
3868 * friend.c (do_friend): Use OVL_NAME.
3869 * init.c (build_offset_ref): Use OVL_FIRST.
3870 * mangle.c (write_member_name): Likewise.
3871 (write_expression): Use OVL_NAME.
3872 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
3873 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
3874 * pt.c (check_explicit_specialization): Use OVL_FIRST.
3875 (check_template_shadow): Likewise.
3876 (tsubst_template_args): Use OVL_NAME.
3877 (tsubst_baselink): Use OVL_FIRST.
3878 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
3879 * tree.c (get_first_fn): Use OVL_FIRST.
3880 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
3881 (cp_build_addr_expr_1): Use OVL_FIRST.
3883 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
3885 * semantics.c (finish_id_expression): Directly init local var.
3886 (finish_omp_reduction_clause): Use really_overloaded_fn.
3887 * tree.c (get_fns): Document. Assert we got an overload.
3888 (get_first_fn) Document.
3889 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
3890 really_overloaded_fn.
3891 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
3893 * cp-tree.h (SCOPE_DEPTH): New.
3894 * name-lookup.h (is_nested_namespace): Declare.
3895 * name-lookup.c (is_nested_namespace): New.
3896 (is_ancestor): Use it.
3897 (set_decl_namespace): Likewise.
3898 (push_namespace): Set SCOPE_DEPTH.
3899 * pt.c (check_specialization_namespace): Use is_nested_namespace.
3900 (check_unqualigied_spec_or_inst): Likewise.
3902 2017-05-15 Nathan Sidwell <nathan@acm.org>
3905 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
3906 * name-lookup.h (push_namespace): Return int, add make_inline arg.
3907 * name-lookup.c (push_namespace): Deal with inline directly.
3908 Return pushed count.
3909 * parser.c (cp_parser_namespace_definition): Adjust for
3910 push_namespace change.
3912 2017-05-11 Nathan Sidwell <nathan@acm.org>
3914 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
3915 LANG_HOOKS_PUSHDECL): Move to ...
3916 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
3917 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
3918 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
3920 * name-lookup.h (pushdecl): Add default friend parm.
3921 (pushdecl_maybe_friend): Delete.
3922 (pushdecl_top_level): Add default friend parm.
3923 (pushdecl_top_level_maybe_friend): Delete.
3924 * name-lookup.c (pushdecl_maybe_friend): Delete.
3925 (pushdecl): Add is_friend parm.
3926 (pushdecl_top_level): Add is friend_parm.
3927 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
3928 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
3929 * friend.c (do_friend): Adjust.
3930 * pt.c (tsubst_friend_class): Adjust.
3932 Revert pushdecl_top_level_and_finish name change.
3933 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
3934 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
3935 * decl.c (cp_make_fname_decl): Adjust.
3936 * decl2.c (get_guard, handle_tls_init): Adjust.
3937 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
3939 * name-lookup.c (pushdecl_outermost_localscope): Always
3940 conditionally stop timer.
3942 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
3943 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
3945 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
3946 pushtag_top_level_maybe_friend,
3947 pushdecl_top_level_and_finish): Move declarations to ...
3948 * name-lookup.h: ... here. Group pushdecl variants.
3949 (pushdecl_top_level_and_finish): Rename to ...
3950 (pushdecl_top_level_with_init): ... here.
3951 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
3952 * decl2.c (get_guard, handle_tls_init): Likewise.
3953 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
3954 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
3955 * method.c (implicitly_declare_fn): Likewise.
3956 * searchc (node_debug_info_needed): Likewise.
3957 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
3958 (pushdecl_top_level_with_init): ... here.
3959 (pop_everything): Use namespace_bindings_p.
3961 * name-lookup.h (pop_binding): Rename to pop_local_binding.
3962 (getdecls): Rename to get_local_decls.
3963 * name-lookup.c (pop_binding): Rename to ...
3964 (pop_local_binding): ... here.
3965 (pop_bindings_and_leave_scope): Adjust.
3966 (getdecls): Rename to ...
3967 (get_local_decls): ... here. Assert local scope.
3968 * decl.c (poplevel): Assert not namespace. Adjust and simplify
3970 (store_parm_decls): Adjust get_local_decls call.
3971 (parser.c (synthesize_implicit_template_parm): Likewise.
3973 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
3976 * method.c (is_trivially_xible): Reject void types.
3978 2017-05-10 Nathan Sidwell <nathan@acm.org>
3980 * class.c (handle_using_decl): Always use OVL_CURRENT.
3981 (resolve_address_of_overloaded_function): Move iterator decl into
3982 for scope. Don't strip anticipated decls here.
3984 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
3986 (print_candidates): Adjust.
3988 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
3990 * call.c (build_new_function_call): Lose koenig_p arg. Remove
3991 koenig_p handling here.
3992 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
3993 (tsubst_omp_clauses): Likewise.
3994 (do_class_deduction): Adjust buld_new_function_call calls.
3995 * semantics.c (finish_call_expr): Likewise.
3997 2017-05-10 Jason Merrill <jason@redhat.com>
3999 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
4000 (unify_type_mismatch, unify_parameter_pack_mismatch)
4001 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
4002 (unify_parameter_pack_inconsistent, unify_inconsistency)
4003 (unify_vla_arg, unify_method_type_error, unify_arity)
4004 (unify_arg_conversion, unify_no_common_base)
4005 (unify_inconsistent_template_template_parameters)
4006 (unify_template_deduction_failure)
4007 (unify_template_argument_mismatch)
4008 (unify_overload_resolution_failure): Call unify_invalid.
4010 CWG 1847 - Clarifying compatibility during partial ordering
4011 * pt.c (more_specialized_fn): No order between two non-deducible
4014 * pt.c (dependent_type_p): Make sure we aren't called with
4017 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
4018 * pt.c (convert_template_argument): Just return an argument pack.
4019 (coerce_template_parameter_pack, template_parm_to_arg)
4020 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
4021 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
4022 Don't set the type of a NONTYPE_ARGUMENT_PACK.
4023 * parser.c (make_char_string_pack, make_string_pack): Likewise.
4025 2017-05-10 Nathan Sidwell <nathan@acm.org>
4027 * cp-tree.h (add_method, clone_function_decl): Change last arg to
4029 * class.c (add_method): Change third arg to bool. Adjust.
4030 (one_inheriting_sig, one_inherited_ctor): Adjust.
4031 (clone_function_decl): Change 2nd arg to bool. Adjust.
4032 (clone_constructors_and_destructors): Adjust.
4033 * lambda.c (maybe_add_lambda_conv_op): Adjust.
4034 * method.c (lazily_declare_fn): Adjust.
4035 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
4036 * semantics.c (finish_member_declaration): Adjust.
4038 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
4041 * decl.c (finish_function): To improve error recovery, change the
4042 logic for calling apply_deduced_return_type.
4044 2017-05-09 Jason Merrill <jason@redhat.com>
4046 PR c++/80605 - __is_standard_layout and empty base
4047 * class.c (check_bases): Ignore empty bases.
4049 PR c++/70979 - literal class and closure types
4050 * class.c (finalize_literal_type_property): Handle closures
4052 (explain_non_literal_class): Likewise.
4054 PR c++/66297, DR 1684 - literal class and constexpr member fns
4055 * constexpr.c (is_valid_constexpr_fn): Only complain about
4056 non-literal enclosing class in C++11.
4057 * class.c (finalize_literal_type_property): Likewise.
4059 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
4062 * pt.c (tsubst_decl): Early return error_mark_node if
4063 grok_ctor_properties returns false.
4065 2017-05-09 Jason Merrill <jason@redhat.com>
4067 PR c++/70167 - array prvalue treated as lvalue
4068 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
4070 * semantics.c (finish_compound_literal): Add fcl_context parameter.
4071 Only make a static variable for C99 syntax.
4072 * parser.c (cp_parser_postfix_expression): Pass it.
4073 * pt.c (tsubst_copy_and_build): Likewise.
4074 * call.c (extend_ref_init_temps): Set
4075 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
4077 2017-05-09 Nathan Sidwell <nathan@acm.org>
4079 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
4080 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
4081 * name-lookup.h (pushdecl_top_level): Declare.
4083 2017-05-08 Jason Merrill <jason@redhat.com>
4085 PR c++/80178 - parameter passing for uncopyable classes
4086 * tree.c (type_has_nontrivial_copy_init): True for classes with only
4087 deleted copy/move ctors.
4088 (remember_deleted_copy, maybe_warn_parm_abi): New.
4089 * decl.c (require_complete_types_for_parms, check_function_type):
4090 Call maybe_warn_parm_abi.
4091 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
4093 2017-05-08 Nathan Sidwell <nathan@acm.org>
4095 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
4096 (start_preparsed_function): Do decl pushing before setting
4097 current_funciton_decl and announcing it.
4099 * name-lookup.h (pushdecl_with_scope): Replace with ...
4100 (pushdecl_outermost_localscope): ... this.
4101 * name-lookup.c (pushdecl_with_scope): Replace with ...
4102 (pushdecl_outermost_localscope): ... this.
4103 (pushdecl_namespace_level): Adjust.
4104 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
4105 * lambda.c (insert_capture_proxy): Likewise.
4107 * class.c (build_vtbl_initializer): Don't shadow outer variable
4110 Revert _binding -> _value change.
4111 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
4112 (get_namespace_binding, set_global_binding): ... these.
4113 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
4114 (get_namespace_binding, set_global_binding): ... these.
4115 (arg_assoc_namespace, pushdecl_maybe_friend_1,
4116 check_for_out_of_scope_variable, push_overloaded_decl_1,
4117 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
4118 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
4119 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
4120 * decl.c (poplevel): Adjust.
4121 * pt.c (make_constrained_auto): Likewise.
4123 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
4125 PR translation/80280
4126 * call.c (print_z_candidate): Fix quoting.
4128 2017-05-05 David Malcolm <dmalcolm@redhat.com>
4130 * error.c (pedwarn_cxx98): Replace report_diagnostic
4131 with diagnostic_report_diagnostic.
4133 2017-05-05 Nathan Sidwell <nathan@acm.org>
4135 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
4136 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
4137 (IDENTIFIER_NAMESPACE_VALUE): Delete.
4138 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
4140 (get_namespace_value, set_global_value): ... these.
4141 (get_global_value_if_present, is_typename_at_global_scope): Delete.
4142 * decl.c (poplevel): Use get_namespace_value.
4143 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
4144 * class.c (build_vtbl_initializer): Stash library decl in
4145 static var. Use IDENTIFIER_GLOBAL_VALUE.
4146 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
4147 do_allocate_exception, do_free_exception, build_throw): Likewise.
4148 * init.c (throw_bad_array_new_length): Likewise.
4149 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
4150 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
4151 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
4152 get_namespace_value.
4153 (set_namespace_binding_1): Rename to
4154 (set_namespace_binding): ... here.
4155 (set_global_value): New.
4156 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
4157 get_namespace_value.
4158 * pt.c (listify): Use get_namespace_value.
4160 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
4162 * lex.c (unqualified_name_lookup_error): Likewise.
4164 * class.c (alter_class): Use retrofit_lang_decl directly.
4165 * decl.c (push_local_name, dupliate_decls): Likewise.
4166 * semantics.c (omp_privatize_field): Likewise.
4168 Kill walk_namespaces.
4169 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
4170 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
4172 Kill per-namespace static_decls.
4173 * cp-tree.h (static_decls): Declare.
4174 (wrapup_globals_for_namespace,
4175 diagnose_inline_vars_for_namespace): Replace with ...
4176 (wrapup_namespace_globals): ... this.
4177 * decl.c (static_decls): Define.
4178 (wrapup_globals_for_namespace,
4179 diagnose_inline_vars_for_namespace): Replace with ...
4180 (wrapup_namespace_globals): ... this.
4181 (cxx_init_decl_processing): Initialize static_decls.
4182 * decl2.c (c_parse_final_cleanups): Adjust.
4183 * name-lookup.h (cp_binding_level): Remove static_decls member.
4184 * name-lookup.c (add_decl_to_level): Adjust.
4185 (begin_scope): Adjust.
4187 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
4190 * decl.c (reshape_init): Unconditionally return error_mark_node
4191 upon error about too many initializers.
4193 2017-05-04 Nathan Sidwell <nathan@acm.org>
4195 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
4197 2017-05-04 Martin Sebor <msebor@redhat.com>
4199 PR translation/80280
4200 * call.c (print_z_candidate): Add missing quoting to %D and other
4202 (build_op_call_1): Same.
4203 * constraint.cc (diagnose_check_constraint): Same.
4204 * mangle.c (mangle_decl): Same.
4205 * name-lookup.c (cp_binding_level_debug): Same.
4206 (set_decl_namespace): Same.
4207 * parser.c (cp_parser_tx_qualifier_opt): Same.
4208 * pt.c (print_candidates_1): Same.
4209 (check_template_variable): Same.
4210 (tsubst_default_argument): Same.
4211 (most_specialized_partial_spec): Same.
4212 * semantics.c (omp_reduction_lookup): Same.
4213 * tree.c (check_abi_tag_redeclaration): Same.
4214 * typeck.c (comptypes): Same.
4215 * typeck2.c (abstract_virtuals_error_sfinae): Same.
4217 2017-05-04 Nathan Sidwell <nathan@acm.org>
4220 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
4221 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
4222 CPTI_INIT_LIST_IDENTIFIER.
4223 (global_namespace, global_type_node, global_identifier,
4224 anon_identifier, init_list_identifier): New.
4225 * decl.c (global_type_node, global_scope_name): Delete.
4226 (initialize_predefined_identifiers): Add new identifiers.
4227 (cxx_init_decl_processing): Adjust.
4228 * name-lookup.h (global_namespace, global_type_node): Delete.
4229 * name-lookup.c (global_namespace, anonymous_namespace_name,
4230 get_anonymous_namespace_name): Delete.
4231 (namespace_scope_ht_size, begin_scope, pushtag_1,
4232 push_namespace): Adjust,
4233 * call.c (type_has_extended_temps): Use init_list_identifier.
4234 * pt.c (listify): Likewise.
4236 * name-lookup.c: Reorder functions to make merging from modules
4239 2017-05-03 Jason Merrill <jason@redhat.com>
4241 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
4243 2017-05-03 Nathan Sidwell <nathan@acm.org>
4245 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
4246 along with #defines, to before name-lookup include.
4248 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
4250 * pt.c (is_auto_or_concept): Remove.
4251 (type_uses_auto_or_concept): Remove, unused.
4252 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
4253 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
4254 * cp-tree.h (is_auto_or_concept): Remove.
4256 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
4259 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
4260 add pedigree operation and detach call here.
4261 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
4262 cilk_cp_gimplify_call_params_in_spawned_fn.
4263 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
4264 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
4266 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
4268 * parser.c (cp_parser_member_declaration): Add fix-it hints for
4269 stray comma and missing semicolon at end of member declaration.
4271 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
4273 * parser.c (cp_parser_cast_expression): Add target type of cast to
4275 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
4277 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
4279 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
4280 return type to bool.
4281 * cp-tree.h (grok_ctor_properties): Update.
4283 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
4285 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
4286 information to diagnostic of invalid colon in nested-name-specifier.
4288 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
4290 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
4291 diagnostic of invalid class/struct keyword after enum.
4293 2017-04-25 David Malcolm <dmalcolm@redhat.com>
4295 * parser.c (cp_parser_member_declaration): Add fix-it hint
4296 for removing stray semicolons.
4298 2017-04-25 David Malcolm <dmalcolm@redhat.com>
4300 * name-lookup.c (get_std_name_hint): New function.
4301 (maybe_suggest_missing_header): New function.
4302 (suggest_alternative_in_explicit_scope): Call
4303 maybe_suggest_missing_header.
4305 2017-04-25 David Malcolm <dmalcolm@redhat.com>
4308 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
4309 candidate type of bm from tree to const char *.
4310 (consider_binding_level): Likewise.
4311 (lookup_name_fuzzy): Likewise, using this to merge the best
4312 result from the preprocessor into bm, rather than immediately
4313 returning, so that better matches from reserved words can "win".
4314 Guard the rejection of keywords that don't start decl-specifiers
4315 so it only happens for FUZZY_LOOKUP_TYPENAME.
4317 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
4319 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
4320 (start_enum): Likewise.
4321 (build_enumerator): Likewise. Use %qE instead of plain %E.
4322 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
4323 %<%D%> in diagnostics.
4324 (cp_parser_elaborated_type_specifier): Likewise.
4325 * pt.c (make_pack_expansion): Use %qT and %qE instead of
4326 %<%T%> and %<%E%> in diagnostics.
4327 (tsubst_pack_expansion): Likewise.
4329 2017-04-24 David Malcolm <dmalcolm@redhat.com>
4332 * parser.c (cp_parser_unary_expression): Generate a location
4333 range for alignof and sizeof expressions.
4335 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
4337 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
4339 (cp_parser_virt_specifier_seq_opt): Likewise.
4340 (set_and_check_decl_spec_loc): Likewise twice.
4342 2017-04-21 Jason Merrill <jason@redhat.com>
4344 PR c++/80179 - ICE with initialized flexible array member.
4345 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
4347 2017-04-21 Richard Biener <rguenther@suse.de>
4349 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
4350 (copy_type): Likewise.
4351 * lex.c (copy_decl): Pass down mem-stat info.
4352 (copy_type): Likewise.
4354 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
4357 * init.c (build_new_1): Suppress notes about over-aligned new when
4358 the warning is suppressed.
4360 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
4362 * parser.c (cp_parser_member_declaration): Add warning with fixit
4363 information for extra semicolon after in-class function definition.
4365 2017-04-20 Jakub Jelinek <jakub@redhat.com>
4368 * tree.c (build_cplus_array_type): Call build_array_type
4369 with the intended TYPE_TYPELESS_STORAGE flag value, instead
4370 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
4373 2017-04-18 Marek Polacek <polacek@redhat.com>
4375 PR c++/80244 - ICE with attribute in template alias.
4376 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
4378 PR c++/80241 - ICE with alignas pack expansion.
4379 * error.c (dump_expr): Handle TREE_LIST.
4380 * parser.c (cp_parser_std_attribute_list): Return error_mark if
4381 make_pack_expansion returns an error.
4383 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
4386 * class.c (fixup_may_alias): Fix all type variants.
4388 2017-04-17 Jason Merrill <jason@redhat.com>
4390 PR c++/80415 - wrong error with default arg and array reference.
4391 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
4393 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
4395 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
4397 * decl.c (name_unnamed_type): Split out of...
4398 (grokdeclarator): ... this.
4399 * decl.h (name_unnamed_type): Declare.
4401 2017-04-12 Richard Biener <rguenther@suse.de>
4402 Bernd Edlinger <bernd.edlinger@hotmail.de>
4405 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
4406 for arrays of character or std::byte type.
4408 2017-04-11 Jason Merrill <jason@redhat.com>
4410 PR c++/80294 - ICE with constexpr and inheritance.
4411 * constexpr.c (reduced_constant_expression_p):
4412 A null constructor element is non-constant.
4413 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
4414 returning an empty base.
4416 2017-04-11 Jakub Jelinek <jakub@redhat.com>
4419 * decl.c (cp_finish_decomp): If processing_template_decl on
4420 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
4421 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
4422 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
4424 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
4425 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
4428 2017-04-11 Jakub Jelinek <jakub@redhat.com>
4431 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
4433 2017-04-10 Jakub Jelinek <jakub@redhat.com>
4436 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
4437 operand, if it is a static member function, recurse on the
4440 2017-04-10 Marek Polacek <polacek@redhat.com>
4443 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
4444 ORIG_TYPE earlier and not only when shortening.
4446 2017-04-07 Jason Merrill <jason@redhat.com>
4448 PR c++/80356 - ICE with reference to function template argument.
4450 * pt.c (convert_nontype_argument_function): Adjust type even with a
4451 value-dependent argument.
4453 PR c++/80267 - ICE with nested capture of reference
4455 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
4457 2017-04-07 Marek Polacek <polacek@redhat.com>
4460 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
4463 * call.c (build_over_call): Don't check cxx_dialect.
4464 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
4465 whether SUB is a CONSTRUCTOR.
4466 * init.c (build_new_1): Don't check cxx_dialect.
4467 * tree.c (replace_placeholders): Add a function comment. Return if
4468 not in C++14, or if the object isn't a (member of a) class.
4469 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
4470 TYPE is CLASS_TYPE_P.
4472 2017-04-05 Jakub Jelinek <jakub@redhat.com>
4475 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
4476 of a loop doing vec_safe_push of NULL. Formatting fixes.
4477 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
4478 to newidx before calling canonical_type_parameter on newtype.
4480 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
4483 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
4484 UNARY_PLUS_EXPR case.
4486 2017-04-03 Jason Merrill <jason@redhat.com>
4488 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
4490 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
4492 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
4493 * decl2.c (one_static_initialization_or_destruction): Likewise.
4494 * name-lookup.c (store_bindings): Likewise.
4495 * parser.c (make_call_declarator): Likewise.
4496 * pt.c (check_explicit_specialization): Likewise.
4498 2017-04-03 Jason Merrill <jason@redhat.com>
4500 PR sanitizer/79993 - ICE with VLA initialization from string
4501 PR c++/69487 - wrong VLA initialization from string
4502 * init.c (finish_length_check): Split out from build_vec_init.
4503 (build_vec_init): Handle STRING_CST.
4504 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
4505 (digest_init_r): Don't give a STRING_CST VLA type.
4507 2017-03-31 Jakub Jelinek <jakub@redhat.com>
4510 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
4511 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
4512 for NOP_EXPR to REFERENCE_TYPE.
4515 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
4516 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
4518 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
4519 Remove extraneous parens.
4520 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
4521 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
4522 (cp_parser_trait_expr): Likewise.
4524 2017-03-27 Jakub Jelinek <jakub@redhat.com>
4527 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
4528 * typeck.c (cxx_mark_addressable): Likewise. Look through
4529 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
4531 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
4533 2017-03-24 Jason Merrill <jason@redhat.com>
4535 PR c++/77339 - ICE with invalid use of alias template.
4536 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
4539 2017-03-24 Marek Polacek <polacek@redhat.com>
4542 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
4543 doesn't have side effects.
4545 2017-03-23 Jason Merrill <jason@redhat.com>
4547 PR c++/80150 - ICE with overloaded variadic deduction.
4548 * pt.c (try_one_overload): Remove asserts.
4550 PR c++/77563 - missing ambiguous conversion error.
4551 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
4553 2017-03-23 Marek Polacek <polacek@redhat.com>
4555 * cp-tree.h: Remove a C_RID_YYCODE reference.
4557 2017-03-22 Jakub Jelinek <jakub@redhat.com>
4560 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
4561 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
4562 processing_template_decl.
4564 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
4567 * name-lookup.c (pushtag_1): Add check for bogus, non template,
4568 std::initializer_list.
4570 2017-03-21 Jakub Jelinek <jakub@redhat.com>
4573 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
4575 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
4578 * init.c (std_placement_new_fn_p): New.
4579 (build_new_1): Call it.
4581 2017-03-20 Jason Merrill <jason@redhat.com>
4583 PR c++/80096 - ICE with C++17 non-type auto.
4584 * pt.c (tsubst): Delay tsubst of type of template non-type
4587 PR c++/79519 - ICE with deleted template friend.
4588 * decl.c (grokdeclarator): Complain about misplaced function
4589 definition using =, as well.
4591 PR c++/79640 - infinite recursion with generic lambda.
4592 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
4593 before substituting its initializer.
4595 2017-03-20 Marek Polacek <polacek@redhat.com>
4596 Paolo Carlini <paolo.carlini@oracle.com>
4598 PR c++/80059 - ICE with noexcept and __transaction_atomic
4599 * except.c (build_must_not_throw_expr): Call
4600 instantiate_non_dependent_expr.
4602 2017-03-19 Jason Merrill <jason@redhat.com>
4604 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
4605 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
4606 reference decomposition.
4608 PR c++/80077 - error with constexpr and -fno-elide-constructors.
4609 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
4610 expanding trivial constructor.
4612 2017-03-17 Jason Merrill <jason@redhat.com>
4614 PR c++/78345 - ICE initializing array from lambda.
4615 * init.c (build_aggr_init): Check array initializer.
4616 (build_vec_init): Check the type of a CONSTRUCTOR.
4618 PR c++/80073 - C++17 ICE with virtual base.
4619 * decl.c (xref_basetypes): Also check for indirect vbases.
4621 2017-03-16 Jason Merrill <jason@redhat.com>
4623 * decl.c (start_enum): std::byte aliases anything.
4626 * constexpr.c (lookup_placeholder): Tweak.
4628 2017-03-15 Jason Merrill <jason@redhat.com>
4630 PR c++/80043 - ICE with -fpermissive
4631 * typeck.c (convert_for_assignment): Handle instantiate_type
4632 not giving an error.
4634 2017-03-14 Nathan Sidwell <nathan@acm.org>
4636 PR c++/79393 DR 1658 workaround
4637 * method.c (synthesized_method_base_walk): Inihibit abstract class
4638 virtual base access check here.
4639 (synthesized_method_walk): Not here.
4641 2017-03-13 Nathan Sidwell <nathan@acm.org>
4643 PR c++/79393 DR 1658 workaround
4644 * method.c (synthesized_method_walk): Check vbases of abstract
4645 classes for dtor walk.
4647 2017-03-10 David Malcolm <dmalcolm@redhat.com>
4649 PR translation/79848
4650 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
4652 2017-03-10 Jason Merrill <jason@redhat.com>
4654 PR c++/79960 - alias templates and partial ordering
4655 * pt.c (comp_template_args): Add partial_order parm.
4656 (template_args_equal): Likewise.
4657 (comp_template_args_porder): New.
4658 (get_partial_spec_bindings): Use it.
4660 2017-03-10 Marek Polacek <polacek@redhat.com>
4663 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
4665 2017-03-10 Jakub Jelinek <jakub@redhat.com>
4668 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
4669 Use XALLOCAVEC macro.
4672 * decl.c (finish_enum_value_list): If value is error_mark_node,
4673 don't copy it and change its type.
4674 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
4675 of CONST_DECL is error_mark_node.
4677 2017-03-09 Marek Polacek <polacek@redhat.com>
4679 PR c++/79900 - ICE in strip_typedefs
4680 * tree.c (strip_typedefs): Skip the attribute handling if T is
4681 a variant type which hasn't been updated yet.
4683 PR c++/79687 - wrong code with pointer-to-member
4684 * init.c (constant_value_1): Break if the variable has a dynamic
4687 2017-03-08 Jason Merrill <jason@redhat.com>
4689 PR c++/79797 - ICE with self-reference in array DMI.
4690 * constexpr.c (lookup_placeholder): Split out...
4691 (cxx_eval_constant_expression): ...from here.
4693 2017-03-07 Jakub Jelinek <jakub@redhat.com>
4696 * parser.c (cp_parser_omp_cancellation_point,
4697 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
4698 cp_parser_omp_target_update): Change "may only be used in compound
4699 statements" diagnostics, such that the same translatable string is
4700 used for all pragmas.
4701 (cp_parser_pragma): Likewise. Use error_at instead of
4702 cp_parser_error for that diagnostics.
4704 2017-03-06 Marek Polacek <polacek@redhat.com>
4706 PR c++/79796 - ICE with NSDMI and this pointer
4707 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
4708 replace_placeholders.
4710 2017-03-06 Jakub Jelinek <jakub@redhat.com>
4713 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
4716 2017-03-06 Jason Merrill <jason@redhat.com>
4718 Revert "Allow deduction guides to look into primary template."
4719 * cp-tree.h, parser.c, pt.c, search.c: Revert.
4721 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
4724 * except.c (build_must_not_throw_expr): Perform the implicit
4725 conversions on the condition.
4727 2017-03-03 Jason Merrill <jason@redhat.com>
4729 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
4732 Core issues 2273 and 2277
4733 * call.c (joust): Adjust using-declaration tiebreaker to handle
4734 the intermediate base case.
4735 * method.c (strip_inheriting_ctors): Just return the argument if
4736 !flag_new_inheriting_ctors.
4738 2017-03-03 Richard Biener <rguenther@suse.de>
4741 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
4743 2017-03-03 Marek Polacek <polacek@redhat.com>
4746 * typeck.c (string_conv_p): In C++11, always call pedwarn with
4749 2017-03-02 Jason Merrill <jason@redhat.com>
4751 Update overload resolution with deduction guides.
4752 * pt.c (do_class_deduction): Always build the copy guide.
4753 (copy_guide_p, template_guide_p): New.
4754 (build_deduction_guide): Remember the original constructor.
4755 * call.c (joust): Prefer the copy guide and non-template guides.
4757 Allow deduction guides to look into primary template.
4758 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
4759 (struct cp_decl_specifier_seq): Add constructor_p.
4760 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
4761 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
4762 Clear deduction_guide_type. Don't handle deduction guide names.
4763 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
4764 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
4765 (cp_parser_member_declaration, cp_parser_cache_defarg)
4766 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
4767 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
4768 (build_deduction_guide): Set deduction_guide_type.
4769 (dependent_scope_p): Check deduction_guide_type.
4770 * search.c (lookup_member): Likewise.
4772 2017-03-02 Jakub Jelinek <jakub@redhat.com>
4775 * init.c (mark_exp_read_r): New function.
4776 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
4777 whole arguments instead of plain mark_exp_read on TREE_LIST values.
4779 2017-03-01 Jason Merrill <jason@redhat.com>
4781 Class template argument deduction in new-expression
4782 * init.c (build_new): Handle deduction from no initializer.
4783 * parser.c (cp_parser_new_expression): Don't require a single
4784 expression for class template deduction.
4785 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
4786 class template placeholder.
4787 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
4788 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
4789 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
4791 2017-03-01 Jakub Jelinek <jakub@redhat.com>
4794 * init.c (emit_mem_initializers): When not constructing vbases of
4795 abstract classes, mark arguments as read for
4796 -Wunused-but-set-parameter.
4798 2017-02-28 Jason Merrill <jason@redhat.com>
4800 Class template argument deduction refinements
4801 * call.c (joust): Move deduction guide tiebreaker down.
4802 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
4803 deduction with no initializer.
4804 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
4805 (do_class_deduction): Use that rather than special case.
4806 (do_auto_deduction): Handle null initializer.
4808 2017-02-28 Jakub Jelinek <jakub@redhat.com>
4810 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
4811 instead of just cond ? "..." : "...".
4812 (grokdeclarator): Likewise.
4813 (build_enumerator): Likewise.
4814 * init.c (build_new_1): Likewise.
4815 * call.c (build_new_method_call_1): Likewise.
4816 * parser.c: Include intl.h.
4817 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
4818 "enter"/"exit" keyword.
4819 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
4822 2017-02-27 Jason Merrill <jason@redhat.com>
4824 PR c++/71568 - SFINAE forming pointer to member function
4825 * init.c (build_offset_ref): Check the return value of
4826 perform_or_defer_access_check.
4828 2017-02-27 Marek Polacek <polacek@redhat.com>
4830 * decl.c (expand_static_init): Add missing } in a comment.
4832 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
4834 * init.c: Include intl.h.
4835 (build_new_1): Move message strings into pedwarn to make them
4836 -Wformat-security friendly. Mark string for translation.
4837 * pt.c (tsubst_copy_and_build): Mark string for translation.
4838 Make the pointer const.
4839 * semantics.c (finish_id_expression): Mark strings for translation.
4841 2017-02-25 Jakub Jelinek <jakub@redhat.com>
4843 * call.c (build_op_delete_call): Make msg1 and msg2 const.
4845 2017-02-24 Jakub Jelinek <jakub@redhat.com>
4848 * call.c (build_over_call): Call check_function_arguments even for
4849 -Wrestrict, adjust check_function_arguments caller.
4850 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
4852 * typeck.c (cp_build_function_call_vec): Adjust
4853 check_function_arguments caller.
4855 2017-02-24 Marek Polacek <polacek@redhat.com>
4857 PR translation/79705
4858 * decl.c (check_redeclaration_exception_specification): Mark a string
4859 for translation. Make the pointer const.
4861 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
4864 * pt.c (register_specialization): Check duplicate_decls return value
4865 for error_mark_node and pass it back.
4867 2017-02-22 Jason Merrill <jason@redhat.com>
4869 PR c++/79679 - missing destructor for argument
4870 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
4873 * pt.c (do_class_deduction): Handle 0 argument case.
4875 2017-02-22 Jakub Jelinek <jakub@redhat.com>
4878 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
4879 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
4880 * constexpr.c (potential_constant_expression_1): Handle
4881 OMP_*, OACC_* and CILK_* trees. Use error_at with
4882 EXPR_LOC_OR_LOC (t, input_location) computed early
4883 instead of error, or error_at with location_of (t).
4885 2017-02-22 Marek Polacek <polacek@redhat.com>
4888 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
4889 if the alignas expression is erroneous.
4890 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
4894 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
4896 2017-02-21 Jason Merrill <jason@redhat.com>
4898 PR c++/50308 - wrong deprecated warning with ADL
4899 PR c++/17729 - duplicate deprecated warning
4900 * semantics.c (finish_id_expression): Only call mark_used on a
4901 function if we aren't building a call.
4903 PR c++/41727 - ICE with partial spec of partial instantiation
4904 * pt.c (process_partial_specialization): For now, don't check more
4905 specialized if there is more than one level of args.
4907 2017-02-21 Marek Polacek <polacek@redhat.com>
4910 * cp-tree.h (maybe_reject_flexarray_init): Declare.
4911 * init.c (maybe_reject_flexarray_init): No longer static.
4912 Add check for current_function_decl.
4913 * parser.c (cp_parser_late_parse_one_default_arg): Reject
4914 a default mem-initializer for a flexible array.
4916 2017-02-21 Jakub Jelinek <jakub@redhat.com>
4917 Paolo Carlini <paolo.carlini@oracle.com>
4920 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
4922 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
4923 decl after the decomposition artificial decl has error_mark_node.
4924 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
4925 instead of just == error_mark_node comparison.
4927 2017-02-21 Jakub Jelinek <jakub@redhat.com>
4930 * decl.c: Include gimplify.h.
4931 (cp_finish_decomp): Make sure there is no sharing of trees
4932 in between DECL_VALUE_EXPR of decomposition decls.
4935 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
4938 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
4939 call cplus_expand_constant on it first.
4941 2017-02-19 Jason Merrill <jason@redhat.com>
4943 PR c++/78139 - destructor needed by new-expression
4944 * call.c (build_special_member_call): Use tf_no_cleanup.
4946 PR c++/78282 - auto template and pack expansion
4947 * pt.c (find_parameter_packs_r): Don't walk into the type of
4948 templates other than template template-parameters.
4950 PR c++/79606 - ICE with this->base_member in NSDMI
4951 * class.c (build_base_path): Check processing_template_decl.
4953 PR c++/79607 - ICE with T{} initializer
4954 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
4956 PR c++/79566 - elaborated-type-specifier in range for
4957 * parser.c (cp_parser_simple_declaration): Fix check for type
4960 PR c++/79400 - confusing suggestion of 'noexcept'
4961 * parser.c (cp_parser_exception_specification_opt): Remove
4962 suggestion for deprecated dynamic exception-specification.
4964 PR c++/79470 - partial ordering with reference parameters
4965 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
4967 PR c++/79500 - ICE with non-template deduction guide
4968 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
4969 DECL_TEMPLATE_RESULT.
4971 PR c++/79580 - ICE with compound literal
4972 * parser.c (cp_parser_class_head): If we're in the middle of an
4973 expression, use ts_within_enclosing_non_class.
4975 PR c++/79503 - inherited ctor taking base class
4976 * call.c (add_function_candidate): Also check that
4977 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
4979 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
4982 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
4985 2017-02-19 Eric Fiselier <eric@efcs.ca>
4986 Jonathan Wakely <jwakely@redhat.com>
4989 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
4990 control warning about literal suffix identifiers without a leading
4993 2017-02-17 Jason Merrill <jason@redhat.com>
4995 PR c++/79508 - lookup error with member template
4996 * parser.c (cp_parser_template_name): Clear
4997 parser->context->object_type if we aren't doing lookup.
4999 PR c++/78690 - ICE with using and global type with same name
5000 * pt.c (type_dependent_object_expression_p): True for
5003 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
5004 * pt.c (convert_template_argument): Just return an auto arg pack.
5005 (tsubst_template_args): Don't tsubst an auto pack type.
5007 PR c++/79556 - C++17 ICE with non-type auto
5008 * pt.c (do_auto_deduction): Don't try to deduce from null type.
5010 PR c++/79533 - C++17 ICE with temporary cast to reference
5011 * call.c (build_over_call): Conversion to a reference prevents copy
5014 2017-02-16 Jakub Jelinek <jakub@redhat.com>
5015 Jason Merrill <jason@redhat.com>
5017 PR c++/79502 - lost nodiscard attribute
5018 * pt.c (apply_late_template_attributes): Do apply non-dependent
5019 attributes to types.
5021 2017-02-16 Jason Merrill <jason@redhat.com>
5023 PR c++/78572 - ICE with self-modifying array initializer
5024 * constexpr.c (cxx_eval_store_expression): The object we're
5025 initializing is outside the constant-expression.
5026 (cxx_eval_call_expression): Set ctx->call.
5028 PR c++/79050 - ICE with undeduced auto and LTO
5029 * decl.c (poplevel): Remove undeduced auto decls.
5031 2017-02-16 Jakub Jelinek <jakub@redhat.com>
5034 * parser.c (cp_parser_omp_target): For -fopenmp-simd
5035 ignore #pragma omp target even when not followed by identifier.
5037 2017-02-15 Jason Merrill <jason@redhat.com>
5038 Jakub Jelinek <jakub@redhat.com>
5040 PR c++/79464 - ICE in IPA with omitted constructor parms
5041 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
5042 (adjust_clone_args): Adjust.
5043 (add_method): Remember omitted parms.
5044 * call.c (add_function_candidate): Likewise.
5045 * mangle.c (write_method_parms): Likewise.
5046 * method.c (ctor_omit_inherited_parms): Return false if there are no
5049 2017-02-15 Martin Sebor <msebor@redhat.com>
5052 * init.c (maybe_reject_flexarray_init): New function.
5053 (perform_member_init): Call it.
5055 2017-02-15 Jakub Jelinek <jakub@redhat.com>
5058 * parser.c (cp_parser_std_attribute): Don't pedwarn about
5059 [[deprecated]] with -std=c++11 and [[fallthrough]] with
5060 -std=c++11 and -std=c++14.
5063 * decl.c (grokdeclarator): For static data members, handle thread_p
5064 only after handling inline.
5066 2017-02-14 Marek Polacek <polacek@redhat.com>
5070 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
5071 clobbering if the postfix expression isn't an EXPR_P.
5073 2017-02-13 Jason Merrill <jason@redhat.com>
5075 PR c++/79461 - ICE with lambda in constexpr constructor
5076 * constexpr.c (build_data_member_initialization): Ignore
5077 initialization of a local variable.
5079 2017-02-13 Jakub Jelinek <jakub@redhat.com>
5081 * init.c (warn_placement_new_too_small): Add missing space in
5083 * parser.c (cp_parser_oacc_declare): Likewise.
5084 * mangle.c (maybe_check_abi_tags): Likewise.
5087 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
5088 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
5089 in the rightmost operand.
5091 2017-02-13 Nathan Sidwell <nathan@acm.org>
5093 PR c++/79296 - ICE mangling localized template instantiation
5094 * decl2.c (determine_visibility): Use template fn context for
5095 local class instantiations.
5097 2017-02-11 Jason Merrill <jason@redhat.com>
5099 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
5100 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
5101 (build_new_1): Use replace_placeholders.
5102 * tree.c (replace_placeholders_t): Also track whether we've seen a
5104 (replace_placeholders, replace_placeholders_r): Adjust.
5105 * cp-tree.h: Adjust.
5107 PR c++/77790 - ICE with auto function in C++11 mode
5108 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
5109 (require_deduced_type): Add complain parm, return bool.
5110 * cp-tree.h: Adjust.
5111 * decl2.c (mark_used): Use require_deduced_type.
5113 2017-02-10 Jason Merrill <jason@redhat.com>
5115 PR c++/78908 - template ops and bitfields
5116 * tree.c (build_min_non_dep): Use unlowered_expr_type.
5118 PR c++/78897 - constexpr union
5119 * constexpr.c (cxx_eval_store_expression): A store to a union member
5120 erases a previous store to another member.
5122 PR c++/71285 - member of fold-expression
5123 * semantics.c (finish_unary_fold_expr)
5124 (finish_binary_fold_expr): Use null type for fold-expressions.
5126 PR c++/79401 - protected inherited constructor
5127 * call.c (enforce_access): For inheriting constructor, find a base
5128 binfo in the path we already have.
5130 2017-02-10 Marek Polacek <polacek@redhat.com>
5133 * pt.c (type_dependent_expression_p): Check if the expression type
5137 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
5138 if warnings shouldn't be given.
5140 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
5143 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
5144 an error_mark_node as type.
5146 2017-02-09 Jakub Jelinek <jakub@redhat.com>
5147 Jason Merrill <jason@redhat.com>
5150 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
5151 from pattern to type.
5153 2017-02-09 Jason Merrill <jason@redhat.com>
5155 PR c++/79316 - default argument in deduction guide
5156 PR c++/79350 - explicit deduction guide
5157 * parser.c (cp_parser_constructor_declarator_p)
5158 (cp_parser_direct_declarator): Parse deduction guides more like
5160 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
5161 * tree.c (special_function_p): Return it.
5162 * decl.c (check_special_function_return_type): Handle it.
5163 (grokdeclarator, grokfndecl): Adjust.
5164 (cp_finish_decl): Pass flags to do_auto_deduction.
5165 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
5166 * pt.c (dguide_name_p): Take a const_tree.
5167 (do_class_deduction): Handle explicit.
5168 (do_auto_deduction): Pass flags through.
5169 (build_deduction_guide): Copy explicit flag.
5171 2017-02-09 Jakub Jelinek <jakub@redhat.com>
5174 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
5175 non-pragma_compound context here.
5176 (cp_parser_omp_target): Likewise.
5177 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
5178 parsing for ordered and target omp pragmas in non-pragma_stmt
5179 non-pragma_compound contexts.
5182 * parser.c (cp_parser_oacc_declare): Formatting fix.
5183 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
5184 automatic variables.
5186 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
5187 Chung-Lin Tang <cltang@codesourcery.com>
5189 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
5190 parsing. Parse constant expression. Remove semantic checking.
5191 (cp_parser_omp_clause_collapse): Disallow tile.
5192 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
5193 error about missing for after already emitting one. Use more
5194 conventional for idiom for unbounded loop.
5195 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
5196 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
5197 (finish_omp_for): Deal with tile clause.
5199 2017-02-07 Nathan Sidwell <nathan@acm.org>
5201 * method.c (synthesized_method_base_walk): New. Broken out of ...
5202 (synthesized_method_walk): ... here. Call it. Cleanup
5205 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
5208 * typeck2.c (process_init_constructor_union): Consider only
5209 FIELD_DECLs when looking for an NSDMI.
5211 2017-02-06 Jason Merrill <jason@redhat.com>
5213 PR c++/71193 - incomplete types in templates
5214 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
5215 handle incomplete type by pedwarning and then treating as dependent.
5217 2017-02-06 Jakub Jelinek <jakub@redhat.com>
5220 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
5221 (potential_constant_expression_1): Likewise.
5224 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
5225 allow one fewer than expected arguments if flag_permissive.
5228 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
5229 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
5230 with error_mark_node type.
5232 2017-02-03 Jason Merrill <jason@redhat.com>
5234 PR c++/78689 - ICE on constructor with label
5235 * optimize.c (maybe_clone_body): Replace omitted parameters with
5237 * class.c (build_clone): Fix logic for omitting inherited parms.
5239 PR c++/12245 - excessive memory use
5240 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
5241 back in. Don't cache constants.
5242 (maybe_constant_init): Don't cache constants.
5244 PR c++/79294 - ICE with invalid template argument
5245 * pt.c (convert_nontype_argument_function): Check value-dependence.
5246 (convert_nontype_argument): Don't check it here for function ptrs.
5248 2017-02-02 Richard Biener <rguenther@suse.de>
5251 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
5252 it lazily on the first changed element only and copy it
5253 fully upfront, only storing changed elements.
5255 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
5258 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
5261 2017-01-31 Jakub Jelinek <jakub@redhat.com>
5264 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
5267 2017-01-31 David Malcolm <dmalcolm@redhat.com>
5270 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
5271 any namespace aliases.
5273 2017-01-31 Nathan Sidwell <nathan@acm.org>
5276 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
5280 * pt.c: (instantiate_decl): Push to top level when current
5281 function scope doesn't match. Only push lmabda scope stack when
5284 * cp-tree.h (instantiate_decl): Make defer_ok bool.
5285 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
5286 (instantiate_decl): Simplify and reorder state saving and restoration.
5289 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
5290 * semantics.c (finish_member_declaration): Assert class is being
5293 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
5295 Introduce C++ support in libcc1.
5296 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
5297 (ansi_opname): Rename to...
5298 (cp_operator_id): ... this. Adjust all callers.
5299 (ansi_assopname): Rename to...
5300 (cp_assignment_operator_id): ... this. Adjust all callers.
5301 (cp_literal_operator_id): Declare.
5302 (set_global_friend): Declare.
5303 (is_global_friend): Declare.
5304 (enum cp_oracle_request): New type.
5305 (cp_binding_oracle_function): New type.
5306 (cp_binding_oracle): Declare.
5307 (cp_finish_injected_record_type): Declare.
5308 * friend.c (global_friend): New var.
5309 (set_global_friend): New fn.
5310 (is_global_friend): New fn.
5311 (is_friend): Call is_global_friend.
5312 * name-lookup.c (cp_binding_oracle): New var.
5313 (query_oracle): New fn.
5314 (qualified_lookup_using_namespace): Call query_oracle.
5315 (lookup_name_real_1): Likewise.
5316 * parser.c (cp_literal_operator_id): Drop static.
5317 * search.c (friend_accessible_p): Call is_global_friend.
5318 * semantics.c (is_this_parameter): Accept a variable if the
5319 binding oracle is enabled.
5321 2017-01-27 Jason Merrill <jason@redhat.com>
5323 PR c++/78771 - ICE with inherited constructor.
5324 * call.c (build_over_call): Call deduce_inheriting_ctor here.
5325 * pt.c (tsubst_decl): Not here.
5326 * class.c (add_method): Or here.
5327 * method.c (deduce_inheriting_ctor): Handle clones.
5328 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
5330 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
5333 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
5335 * cp/cp-tree.h: Declare it.
5336 * cp/semantics.c (finish_id_expression): Resolve names within a default
5337 capturing generic lambda defined within a template prior to
5338 instantiation to allow for captures to be added to the closure type.
5340 2017-01-26 Jakub Jelinek <jakub@redhat.com>
5343 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
5344 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
5345 * parser.c (cp_parser_builtin_offsetof): Pass result of
5346 build_static_cast of null_pointer_node to finish_offsetof.
5347 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
5348 it for -Winvalid-offsetof pedwarn instead of trying to guess
5349 original offsetof type from EXPR. Save OBJECT_PTR as a new
5350 second operand to OFFSETOF_EXPR.
5351 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
5352 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
5355 2017-01-26 Jason Merrill <jason@redhat.com>
5357 * name-lookup.c (parse_using_directive): Deprecate strong using.
5359 PR c++/79176 - lambda ICE with -flto -Os
5360 * decl2.c (vague_linkage_p): Handle decloned 'tors.
5361 * tree.c (decl_linkage): Likewise.
5363 2017-01-25 Martin Sebor <msebor@redhat.com>
5365 * decl.c (grokdeclarator): Fix a typo in a comment.
5367 2017-01-25 Jakub Jelinek <jakub@redhat.com>
5370 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
5374 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
5375 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
5377 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
5380 * decl.c (cxx_init_decl_processing): Pass main_input_filename
5381 to build_translation_unit_decl.
5383 2017-01-24 Jakub Jelinek <jakub@redhat.com>
5386 * cp-gimplify.c (cp_genericize_r): Add result of
5387 convert_from_reference on invisiref parm to p_set.
5389 2017-01-24 Nathan Sidwell <nathan@acm.org>
5391 PR c++/78469 - defaulted ctor and inaccessible dtor
5392 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
5393 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
5394 * tree.c (build_target_expr): Check tf_no_cleanup.
5396 PR c++/79118 - anon-members and constexpr
5397 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
5398 ctor decl. Recursively check anonymous members.
5399 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
5401 (explain_invalid_constexpr_fn): Likewise.
5403 2017-01-23 Nathan Sidwell <nathan@acm.org>
5405 PR c++/71710 - template using directive of field
5406 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
5409 PR c++/71406 - ICE with scope-ref'd template id exprs
5411 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
5412 before breaking up TEMPLATE_ID_EXPR.
5414 2017-01-20 Nathan Sidwell <nathan@acm.org>
5416 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
5417 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
5419 2017-01-20 David Malcolm <dmalcolm@redhat.com>
5423 * cp-tree.h (suggest_alternatives_for): Add bool param.
5424 (suggest_alternative_in_explicit_scope): New decl.
5425 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
5426 that isn't the global one, call new function
5427 suggest_alternative_in_explicit_scope, only calling
5428 suggest_alternatives_for if it fails, and disabling near match
5429 searches fort that case. When SCOPE is the global namespace,
5430 pass true for new param to suggest_alternatives_for to allow for
5432 * lex.c (unqualified_name_lookup_error): Pass true for new param
5433 to suggest_alternatives_for.
5434 * name-lookup.c (consider_binding_level): Add forward decl.
5435 (suggest_alternatives_for): Add "suggest_misspellings" param,
5436 using it to conditionalize the fuzzy name-lookup code.
5437 (suggest_alternative_in_explicit_scope): New function.
5438 * parser.c (cp_parser_primary_expression): When calling
5439 finish_id_expression, pass location of id_expression rather
5440 than that of id_expr_token.
5441 (cp_parser_id_expression): Convert local "unqualified_id" from
5442 tree to cp_expr to avoid implicitly dropping location information.
5444 2017-01-20 Marek Polacek <polacek@redhat.com>
5447 * call.c (build_conditional_expr_1): Warn about duplicated branches.
5448 * semantics.c (finish_expr_stmt): Build statement using the proper
5451 2017-01-19 Jason Merrill <jason@redhat.com>
5453 US 20 - forwarding references and class template argument deduction
5454 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
5455 * pt.c (push_template_decl_real): Set it.
5456 (maybe_adjust_types_for_deduction): Check it.
5457 (rewrite_template_parm): Copy it.
5459 US 19 - deduction guides and constructors
5460 * call.c (joust): Prefer deduction guides to constructors.
5461 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
5462 (deduction_guide_p): Check DECL_P.
5464 * decl.c (check_initializer): Always use build_aggr_init for array
5467 PR c++/79130 - decomposition and direct-initialization
5468 * init.c (build_aggr_init): Communicate direct-initialization to
5470 (build_vec_init): Check for array copy sooner.
5471 * parser.c (cp_parser_decomposition_declaration): Remove call to
5472 build_x_compound_expr_from_list.
5474 2017-01-18 Jason Merrill <jason@redhat.com>
5476 PR c++/68666 - member variable template-id
5477 * typeck.c (finish_class_member_access_expr): Handle variable
5479 * pt.c (lookup_and_finish_template_variable): No longer static.
5480 * cp-tree.h: Declare it.
5482 2017-01-18 Nathan Sidwell <nathan@acm.org>
5485 * call.c (build_over_call): When checking ellipsis conversions for
5486 an inherited ctor, make sure there is at least one conversion.
5488 2017-01-18 Jason Merrill <jason@redhat.com>
5490 PR c++/78894 - ICE with class deduction and default arg
5491 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
5493 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5496 * mangle.c (write_discriminator): Reorganize abi warning check.
5498 2017-01-18 Nathan Sidwell <nathan@acm.org>
5500 * cp-tree.h: Clarify exception spec node comment.
5501 * except.c (nothrow_spec_p): Simplify by checking node-equality.
5504 * mangle.c (write_exception_spec): Check nothrow explicitly.
5505 (write_encoding): Don't increment processing_template_decl around
5508 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5511 * mangle.c (write_template_args): Add "on" for operator names.
5513 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5516 * mangle.c (write_discriminator): Handle discriminator >= 10.
5518 2017-01-17 Nathan Sidwell <nathan@acm.org>
5521 * cp-tree.h (maybe_generic_this_capture): Declare.
5522 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
5523 (maybe_resolve_dummy): ... here. Call it.
5524 (maybe_generic_this_capture): New.
5525 * parser.c (cp_parser_postfix_expression): Speculatively capture
5526 this in generic lambda in unresolved member function call.
5527 * pt.c (tsubst_copy_and_build): Force hard error from failed
5528 member function lookup in generic lambda.
5530 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
5533 * cp-array-notation.c (expand_array_notation_exprs): Handle
5536 2017-01-11 Jason Merrill <jason@redhat.com>
5538 PR c++/78337 - ICE on invalid with generic lambda
5539 * semantics.c (process_outer_var_ref): Check if containing_function
5540 is null. Move inform call under complain test.
5542 2017-01-11 Nathan Sidwell <nathan@acm.org>
5545 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
5548 2017-01-11 Nathan Sidwell <nathan@acm.org>
5550 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
5552 2017-01-11 Jakub Jelinek <jakub@redhat.com>
5555 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
5556 assertion. Formatting fix.
5559 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
5562 2017-01-10 David Malcolm <dmalcolm@redhat.com>
5565 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
5566 a missing semicolon if we have a valid insertion location for
5569 2017-01-10 Jason Merrill <jason@redhat.com>
5571 FI 20, decomposition declaration with parenthesized initializer.
5572 * parser.c (cp_parser_decomposition_declaration): Use
5573 cp_parser_initializer.
5575 2017-01-09 Jason Merrill <jason@redhat.com>
5577 Implement P0195R2, C++17 variadic using.
5578 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
5579 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
5580 * error.c (dump_decl): Likewise.
5582 2017-01-09 Jakub Jelinek <jakub@redhat.com>
5584 PR translation/79019
5585 PR translation/79020
5586 * semantics.c (finish_omp_clauses): Add missing whitespace to
5587 translatable strings.
5588 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
5590 2017-01-07 Jason Merrill <jason@redhat.com>
5592 PR c++/78948 - instantiation from discarded statement
5593 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
5594 * cp-tree.h (in_discarded_stmt): Declare it.
5595 (struct saved_scope): Add discarded_stmt bitfield.
5596 (in_discarded_stmt): New macro.
5597 * decl2.c (mark_used): Check it.
5598 * parser.c (cp_parser_selection_statement): Adjust.
5599 (cp_parser_jump_statement): Adjust.
5601 2017-01-05 Jakub Jelinek <jakub@redhat.com>
5604 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
5605 REFERENCE_REF_P, set tt to its operand.
5608 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
5609 unions even for C++11 and later.
5611 2017-01-05 Nathan Sidwell <nathan@acm.org>
5614 * pt.c (convert_nontype_argument): Don't try and see if integral
5615 or enum expressions are constants prematurely.
5617 2017-01-04 Marek Polacek <polacek@redhat.com>
5620 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
5621 a zero character literal.
5623 2017-01-04 Jakub Jelinek <jakub@redhat.com>
5626 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
5630 * parser.c (cp_parser_simple_declaration): Only complain about
5631 inconsistent auto deduction if auto_result doesn't use auto.
5633 * parser.c (cp_parser_simple_declaration): Diagnose function
5634 declaration among more than one init-declarators with auto
5638 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
5639 assertion, as lexer->buffer may be NULL.
5641 2017-01-04 Marek Polacek <polacek@redhat.com>
5645 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
5647 2017-01-04 Nathan Sidwell <nathan@acm.org>
5650 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
5651 (lambda_capture_field_type): Update prototype.
5652 * lambda.c (lambda_capture_field_type): Add is_reference parm.
5653 Add referenceness here.
5654 (add_capture): Adjust lambda_capture_field_type call, refactor
5656 * pt.c (tsubst): Adjust lambda_capture_field_type call.
5658 2017-01-01 Jakub Jelinek <jakub@redhat.com>
5660 Update copyright years.
5662 Copyright (C) 2017 Free Software Foundation, Inc.
5664 Copying and distribution of this file, with or without modification,
5665 are permitted in any medium without royalty provided the copyright
5666 notice and this notice are preserved.