PR c/81544 - attribute noreturn and warn_unused_result on the same function accepted
[official-gcc.git] / gcc / cp / ChangeLog
blobe492f0a9867588d959cae9ce4789c32ceaec3d6c
1 2017-12-07  Martin Sebor  <msebor@redhat.com>
3         PR c/81544
4         * cp-tree.h (decls_match): Add default argument.
5         * decl.c (decls_match): Avoid calling into the target back end
6         and triggering an error.
7         * decl2.c (cplus_decl_attributes): Look up existing declaration and
8         pass it to decl_attributes.
9         * tree.c (cxx_attribute_table): Initialize new member of struct
10         attribute_spec.
12 2017-12-06  Jakub Jelinek  <jakub@redhat.com>
14         PR c++/80259
15         * decl2.c (grokfield): Diagnose = delete redefinition of a friend.
17 2017-12-06  Jason Merrill  <jason@redhat.com>
19         * call.c (convert_for_arg_passing): Pass NULL_TREE to
20         targetm.calls.promote_prototypes.
21         (type_passed_as): Likewise.
23         PR c++/82115 - ICE with variable initialized with its own address.
24         * pt.c (value_dependent_expression_p): Add lval parameter.  Don't
25         consider DECL_INITIAL if it's true.
27 2017-12-06  David Malcolm  <dmalcolm@redhat.com>
29         PR c/83236
30         * name-lookup.c (consider_binding_level): Don't suggest names that
31         are reserved for use by the implementation.
33 2017-12-06  David Malcolm  <dmalcolm@redhat.com>
35         * name-lookup.c: Include "c-family/c-spellcheck.h".
37 2017-12-05  Jason Merrill  <jason@redhat.com>
39         PR c++/82331 - ICE with variadic partial specialization of auto
40         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Set processing_template_decl
41         around call to tsubst.
43 2017-12-05  Nathan Sidwell  <nathan@acm.org>
45         PR c++/83287
46         * tree.c (build_min): Check CAST_EXPR arg for OVERLOADs.
48 2017-12-05  Martin Liska  <mliska@suse.cz>
49             Jakub Jelinek  <jakub@redhat.com>
51         * typeck.c (pointer_diff): Add new argument and instrument
52         pointer subtraction.
53         (cp_build_binary_op): Create compound expression if doing an
54         instrumentation.
56 2017-12-05  Jakub Jelinek  <jakub@redhat.com>
58         * cp-gimplify.c (cp_maybe_instrument_return): Don't add
59         __builtin_unreachable if -O0 or if -fsanitize=unreachable.
61 2017-12-04  Jason Merrill  <jason@redhat.com>
63         PR c++/83273 - constexpr if allows non-constant condition
64         * semantics.c (finish_if_stmt_cond): Use require_constant_expression
65         rather than is_constant_expression.
66         * constexpr.c (potential_constant_expression_1) [LAMBDA_EXPR]: Allow
67         in C++17.
69 2017-12-01  Jason Merrill  <jason@redhat.com>
71         Give #include hints for <complex>.
72         * name-lookup.c (get_std_name_hint): Add <complex>.
73         * parser.c (cp_parser_diagnose_invalid_type_name): Call
74         suggest_alternative_in_explicit_scope.
75         (cp_parser_namespace_name): Likewise.
77         PR c++/79228 - extensions hide C++14 complex literal operators
78         * parser.c (cp_parser_userdef_numeric_literal): Be helpful about
79         'i' in C++14 and up.
81 2017-12-01  Jakub Jelinek  <jakub@redhat.com>
83         * parser.c (cp_parser_new): Don't clear cilk_simd_fn_info.
84         (parsing_nsdmi): Adjust comment.
85         (cp_parser_omp_for_loop_init): Likewise.
86         * parser.h (struct cp_omp_declare_simd_data): Adjust comment.
87         (struct cp_parser): Remove cilk_simd_fn_info field.
88         * cp-tree.h (cilk_valid_spawn): Remove.
90         PR c/79153
91         * cp-gimplify.c (genericize_switch_stmt): Emit LABEL_EXPR for the
92         break label into SWITCH_BODY instead of after it and set
93         SWITCH_BREAK_LABEL_P on it.
94         * parser.c (cp_parser_objc_expression): Add FALLTHRU comment to avoid
95         -Wimplicit-fallthrough warning.
97 2017-11-30  Jason Merrill  <jason@redhat.com>
99         PR c++/82219 - bogus -Wignored-qualifiers with template
100         * pt.c (tsubst_copy_and_build) [STATIC_CAST_EXPR]: Suppress
101         -Wignored-qualifiers.
103 2017-11-29  David Malcolm  <dmalcolm@redhat.com>
105         * parser.c (cp_parser_unary_expression): Generate a location for
106         "noexcept".
107         (cp_parser_trait_expr): Generate and return a location_t,
108         converting the return type from tree to cp_expr.
109         (cp_parser_static_assert): Pass location of the condition to
110         finish_static_assert, rather than that of the "static_assert"
111         token, where available.
113 2017-11-29  Paolo Carlini  <paolo.carlini@oracle.com>
115         PR c++/82293
116         * lambda.c (nonlambda_method_basetype): Don't use LAMBDA_TYPE_P
117         on a null type.
119 2017-11-29  Jason Merrill  <jason@redhat.com>
121         PR c++/82760 - memory corruption with aligned new.
122         * call.c (build_operator_new_call): Update *args if we add the
123         align_arg.
125 2017-11-28  Jakub Jelinek  <jakub@redhat.com>
127         PR sanitizer/81275
128         * cp-tree.h (SWITCH_STMT_ALL_CASES_P): Define.
129         (SWITCH_STMT_NO_BREAK_P): Define.
130         (note_break_stmt, note_iteration_stmt_body_start,
131         note_iteration_stmt_body_end): Declare.
132         * decl.c (struct cp_switch): Add has_default_p, break_stmt_seen_p
133         and in_loop_body_p fields.
134         (push_switch): Clear them.
135         (pop_switch): Set SWITCH_STMT_CANNOT_FALLTHRU_P if has_default_p
136         and !break_stmt_seen_p.  Assert in_loop_body_p is false.
137         (note_break_stmt, note_iteration_stmt_body_start,
138         note_iteration_stmt_body_end): New functions.
139         (finish_case_label): Set has_default_p when both low and high
140         are NULL_TREE.
141         * parser.c (cp_parser_iteration_statement): Use
142         note_iteration_stmt_body_start and note_iteration_stmt_body_end
143         around parsing iteration body.
144         * pt.c (tsubst_expr): Likewise.
145         * cp-objcp-common.c (cxx_block_may_fallthru): Return false for
146         SWITCH_STMT which contains no BREAK_STMTs, contains a default:
147         CASE_LABEL_EXPR and where SWITCH_STMT_BODY isn't empty and
148         can't fallthru.
149         * semantics.c (finish_break_stmt): Call note_break_stmt.
150         * cp-gimplify.c (genericize_switch_stmt): Copy SWITCH_STMT_ALL_CASES_P
151         bit to SWITCH_ALL_CASES_P.  Assert that if SWITCH_STMT_NO_BREAK_P then
152         the break label is not TREE_USED.
154 2017-11-28  Julia Koval  <julia.koval@intel.com>
155             Sebastian Peryt  <sebastian.peryt@intel.com>
157         * Make-lang.in (cp/cp-array-notation.o, cp/cp-cilkplus.o): Delete.
158         * call.c (convert_for_arg_passing, build_cxx_call): Remove cilkplus.
159         * constexpr.c (potential_constant_expression_1): Ditto.
160         * cp-array-notation.c: Delete.
161         * cp-cilkplus.c: Ditto.
162         * cp-cilkplus.h: Ditto.
163         * cp-gimplify.c (cp_gimplify_expr, cp_fold_r, cp_genericize): Remove
164         cilkplus condition.
165         * cp-objcp-common.c (ARRAY_NOTATION_REF): Delete.
166         * cp-tree.h (cilkplus_an_triplet_types_ok_p): Delete.
167         * decl.c (grokfndecl, finish_function): Remove cilkplus condition.
168         * error.c (dump_decl, dump_expr): Remove ARRAY_NOTATION_REF condition.
169         * lambda.c (cp-cilkplus.h): Remove.
170         * parser.c (cp_parser_cilk_simd, cp_parser_cilk_for,
171         cp_parser_cilk_simd_vectorlength): Delete.
172         (cp_debug_parser, cp_parser_ctor_initializer_opt_and_function_body,
173         cp_parser_postfix_expression,
174         cp_parser_postfix_open_square_expression,
175         cp_parser_statement, cp_parser_jump_statement,
176         cp_parser_direct_declarator,
177         cp_parser_late_return_type_opt, cp_parser_gnu_attribute_list,
178         cp_parser_omp_clause_name, cp_parser_omp_clause_aligned,
179         cp_parser_omp_clause_linear, cp_parser_omp_all_clauses,
180         cp_parser_omp_flush,
181         cp_parser_omp_for_cond, cp_parser_omp_for_incr,
182         cp_parser_omp_for_loop_init,
183         cp_parser_omp_for_loop,
184         cp_parser_omp_declare_simd): Remove cilkplus support.
185         (CILK_SIMD_FN_CLAUSE_MASK, cp_parser_late_parsing_cilk_simd_fn_info,
186         cp_parser_cilk_grainsize): Remove.
187         (cp_parser_pragma, c_parse_file): Remove cilkplus support.
188         (cp_parser_cilk_simd_vectorlength, cp_parser_cilk_simd_linear,
189         cp_parser_cilk_simd_clause_name, cp_parser_cilk_simd_all_clauses,
190         cp_parser_cilk_simd, cp_parser_cilk_for): Remove.
191         * parser.h (IN_CILK_SIMD_FOR, IN_CILK_SPAWN): Remove.
192         * pt.c (tsubst_attribute, tsubst_expr, tsubst_copy_and_build): Remove
193         cilkplus support.
194         * semantics.c (finish_goto_stmt, begin_while_stmt, finish_do_body,
195         finish_init_stmt, finish_switch_cond, simplify_aggr_init_expr,
196         finish_omp_clauses, finish_omp_clauses, finish_omp_for): Remove
197         cilkplus
198         support.
199         * tree.c (lvalue_kind): Remove ARRAY_NOTATION_REF conditon.
200         * typeck.c (cp_build_array_ref, cp_build_compound_expr,
201         check_return_expr): Remove cilkplus support.
203 2017-11-28  Jakub Jelinek  <jakub@redhat.com>
205         * cp-gimplify.c (genericize_switch_stmt): Build SWITCH_EXPR using
206         build2_loc instead of build3_loc.
208 2017-11-27  Martin Sebor  <msebor@redhat.com>
210         PR c++/83058
211         * init.c (warn_placement_new_too_small): Use offset_int instead of
212         HOST_WIDE_INT.
214 2017-11-27  Jakub Jelinek  <jakub@redhat.com>
216         PR c++/81888
217         * parser.c (cp_parser_decomposition_declaration): Reject just
218         BRACE_ENCLOSED_INITIALIZER_P initializers with nelts != 1 rather
219         than all such CONSTRUCTORs, and only if is_direct_init is true.
221 2017-11-27  Jason Merrill  <jason@redhat.com>
223         * pt.c (primary_template_specialization_p): Rename from
224         primary_template_instantiation_p.  Don't check
225         DECL_TEMPLATE_INSTANTIATION.
226         * call.c, cp-tree.h, decl2.c: Adjust.
228 2017-11-27  Jakub Jelinek  <jakub@redhat.com>
230         PR c++/81675
231         * cp-gimplify.c (cp_fold) <case COND_EXPR>: Don't return immediately
232         for VOID_TYPE_P COND_EXPRs, instead fold the operands and if op0 is
233         INTEGER_CST, ensure that both op1 and op2 are non-NULL and fall
234         through into normal folding, otherwise just rebuild x if any op
235         changed.
237         * g++.dg/warn/pr81675.C: New test.
239 2017-11-14  Boris Kolpackov  <boris@codesynthesis.com>
241         * Make-lang.in (c++.install-plugin): Install backend import library.
243 2017-11-23  Jakub Jelinek  <jakub@redhat.com>
245         * parser.c (cp_parser_omp_declare): Change return type to bool from
246         void, return true for declare simd.
247         (cp_parser_pragma): Return cp_parser_omp_declare returned value
248         rather than always false.
250 2017-11-23  Mike Stump  <mikestump@comcast.net>
251             Eric Botcazou  <ebotcazou@adacore.com>
253         * pt.c (tsubst_expr) <ANNOTATE_EXPR>: Recurse on 3rd operand.
254         * semantics.c (finish_while_stmt_cond): Pass 3rd operand to
255         ANNOTATE_EXPR.
256         (finish_do_stmt): Likewise.
257         (finish_for_cond): Likewise.
259 2017-11-22  Jakub Jelinek  <jakub@redhat.com>
261         PR c++/82401
262         * name-lookup.c (member_name_cmp): Return 0 if a == b.
264 2017-11-22  David Malcolm  <dmalcolm@redhat.com>
266         PR c++/62170
267         * error.c (type_to_string): Add leading comment.  Add params
268         "postprocessed", "quote", and "show_color", using them to fix
269         quoting of the "aka" for types involving typedefs.
270         (arg_to_string): Update for new params to type_to_string.
271         (cxx_format_postprocessor::handle): Likewise.
272         (cp_printer): Convert penultimate param from bool to bool *.
273         Update call to type_to_string and calls to
274         defer_phase_2_of_type_diff.
276 2017-11-22  Marek Polacek  <polacek@redhat.com>
278         PR c++/60336
279         PR middle-end/67239
280         PR target/68355
281         * class.c (layout_class_type): Set DECL_PADDING_P on padding.
282         * decl.c (cxx_init_decl_processing): Set TRANSLATION_UNIT_WARN_EMPTY_P.
283         (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.
285 2017-11-21  Martin Liska  <mliska@suse.cz>
287         * class.c (finalize_literal_type_property): Add quotes for
288         constexpr keyword.
289         (explain_non_literal_class): Likewise.
290         * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
291         (is_valid_constexpr_fn): Likewise.
292         (check_constexpr_ctor_body): Likewise.
293         (register_constexpr_fundef): Likewise.
294         (explain_invalid_constexpr_fn): Likewise.
295         (cxx_eval_builtin_function_call): Likewise.
296         (cxx_eval_call_expression): Likewise.
297         (cxx_eval_loop_expr): Likewise.
298         (potential_constant_expression_1): Likewise.
299         * decl.c (check_previous_goto_1): Likewise.
300         (check_goto): Likewise.
301         (grokfndecl): Likewise.
302         (grokdeclarator): Likewise.
303         * error.c (maybe_print_constexpr_context): Likewise.
304         * method.c (process_subob_fn): Likewise.
305         (defaulted_late_check): Likewise.
306         * parser.c (cp_parser_compound_statement): Likewise.
308 2017-11-21  Marc Glisse  <marc.glisse@inria.fr>
310         * constexpr.c (cxx_eval_constant_expression,
311         potential_constant_expression_1): Handle POINTER_DIFF_EXPR.
312         * cp-gimplify.c (cp_fold): Likewise.
313         * error.c (dump_expr): Likewise.
314         * typeck.c (pointer_diff): Use POINTER_DIFF_EXPR.
316 2017-11-21  Jakub Jelinek  <jakub@redhat.com>
318         P0428R2 - familiar template syntax for generic lambdas
319         * parser.c (cp_parser_lambda_declarator_opt): Don't pedwarn
320         for cxx2a and above, reword pedwarn for C++14/C++17.
322 2017-11-20  David Malcolm  <dmalcolm@redhat.com>
324         PR c/81404
325         * name-lookup.c: Include "c-family/known-headers.h"
326         (lookup_name_fuzzy): Call get_cp_stdlib_header_for_name and
327         potentially return a new suggest_missing_header hint.
329 2017-11-20  David Malcolm  <dmalcolm@redhat.com>
331         PR c++/72786
332         * name-lookup.c (class macro_use_before_def): New class.
333         (lookup_name_fuzzy): Detect macro that were used before being
334         defined, and report them as such.
336 2017-11-20  Jason Merrill  <jason@redhat.com>
338         * decl2.c (constrain_class_visibility): Don't warn about artificial
339         fields.
341 2017-11-20  Jakub Jelinek  <jakub@redhat.com>
343         P0329R4: Designated Initialization
344         * parser.c (cp_parser_initializer_clause): List in comment grammar
345         designated-initializer-list.
346         (cp_parser_initializer_list): Allow .identifier = without pedwarn for
347         C++2A, parse .identifier { ... }.  Improve location_t argument to
348         pedwarn.  Add pedwarn for [cst] = designators.  Diagnose ... in
349         designated initializer list.  Diagnose mixing designated and
350         non-designated initializer clauses for C++2A.  Diagnose duplicated
351         identifiers in designators.
352         * name-lookup.h (search_anon_aggr): New declaration.
353         * name-lookup.c (fields_linear_search): Use search_anon_aggr.
354         (search_anon_aggr): New function.
355         * typeck2.c (process_init_constructor_record): Allow designator
356         to skip over some non-static data members.  Handle anonymous
357         aggregates.  Add diagnostics for designator order not matching
358         member declaration order.
360 2017-11-20  David Malcolm  <dmalcolm@redhat.com>
362         * name-lookup.c: Define INCLUDE_UNIQUE_PTR before including system.h.
363         Include "c-family/name-hint.h"
364         (suggest_alternatives_for): Convert "fuzzy_name" from const char *
365         to name_hint, and rename to "hint".  Pass location to
366         lookup_name_fuzzy.
367         (lookup_name_fuzzy): Convert return type from const char *
368         to name_hint.  Add location_t param.
369         * parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
370         Include "c-family/name-hint.h"
371         (cp_parser_diagnose_invalid_type_name): Convert
372         "suggestion" from const char * to name_hint, and rename to "hint".
373         Pass location to lookup_name_fuzzy.
375 2017-11-20  Nathan Sidwell  <nathan@acm.org>
377         PR c++/82878
378         PR c++/78495
379         * call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited
380         ctor.
381         * cp-gimplify.c (cp_genericize_r): Restore THUNK dereference
382         inhibibition check removed in previous c++/78495 change.
384 2017-11-20   Jakub Jelinek  <jakub@redhat.com>
386         PR c++/82781
387         * constexpr.c (cxx_eval_vector_conditional_expression): New function.
388         (cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
389         of cxx_eval_conditional_expression.
391 2017-11-19  Jakub Jelinek  <jakub@redhat.com>
393         PR c/66618
394         PR c/69960
395         * cp-gimplify.c (c_fully_fold): Add LVAL argument, call
396         cp_fold_maybe_rvalue instead of cp_fold_rvalue and pass it !LVAL.
398 2017-11-16  Jason Merrill  <jason@redhat.com>
400         PR c++/79092 - non-type args of different types are different
401         * tree.c (cp_tree_equal): Check the type of constants.
402         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Handle UNIFY_ALLOW_INTEGER
403         when comparing to previously deduced argument.
404         (maybe_convert_nontype_argument): New.
405         (convert_nontype_argument): Call it.
406         (tsubst_copy_and_build): Handle partial instantiation of
407         IMPLICIT_CONV_EXPR.
408         (unify): Ignore type when deducing from array bound.
409         (dependent_type_p_r): Handle DEFERRED_NOEXCEPT.
410         (value_dependent_expression_p): Any type-dependent expression is
411         value-dependent.  Handle IMPLICIT_CONV_EXPR.
412         * cp-tree.h (IMPLICIT_CONV_EXPR_NONTYPE_ARG): New.
413         * mangle.c (write_template_arg): Strip IMPLICIT_CONV_EXPR.
415 2017-11-16  Nathan Sidwell  <nathan@acm.org>
417         PR c++/82836
418         PR c++/82737
419         * cp-objcp-common.h (LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME):
420         Override.
421         * cp-tree.h (overwrite_mangling): Declare.
422         * decl2.c (struct mangled_decl_hash): Entries are deletable.
423         (overwrite_mangling): New.
425         PR c++/81060
426         * decl.c (xref_tag_1): Push lambda into current scope.
427         * name-lookup.c (do_pushtag): Don't deal with ts_lambda here.
429 2017-11-15  Nathan Sidwell  <nathan@acm.org>
431         PR c++/81574
432         * lambda.c (lambda_capture_field_type): Function references are
433         always catured by reference.
435 2017-11-15  Martin Liska  <mliska@suse.cz>
437         * decl.c (begin_destructor_body): Use cp_build_fold_indirect_ref
438         instead of cp_build_indirect_ref.
440 2017-11-15  Martin Liska  <mliska@suse.cz>
442         * decl.c (begin_destructor_body): In case of VPTR sanitization
443         (with disabled recovery), zero vptr in order to catch virtual calls
444         after lifetime of an object.
446 2017-11-14  Jason Merrill  <jason@redhat.com>
448         Use GTY((cache)) on some hash tables.
449         * decl.c (decomp_type_table): Use tree_cache_map.
450         * init.c (nsdmi_inst): Likewise.
451         * pt.c (defarg_ints): Likewise.
452         * cp-objcp-common.c (cp_get_debug_type): Likewise.
454 2017-11-13  Jason Merrill  <jason@redhat.com>
456         Capture adjustments for P0588R1.
457         * semantics.c (process_outer_var_ref): Capture variables when
458         they are named; complain about non-capture uses when odr-used.
459         * expr.c (mark_use): Rvalue use looks through capture proxy.
460         * constexpr.c (potential_constant_expression_1): Improve error about
461         use of captured variable.
462         * lambda.c (need_generic_capture, dependent_capture_r)
463         (do_dependent_capture, processing_nonlambda_template): Remove.
464         * call.c (build_this): Remove uses of the above.
465         * decl.c (cp_finish_decl): Likewise.
466         * semantics.c (maybe_cleanup_point_expr)
467         (maybe_cleanup_point_expr_void, finish_goto_stmt)
468         (maybe_convert_cond): Likewise.
469         * typeck.c (check_return_expr): Likewise.
471         Defer folding of *&.
472         * typeck.c (cp_build_fold_indirect_ref): New.
473         (cp_build_indirect_ref_1): Split out from cp_build_indirect_ref.
474         Add 'fold' parameter.
475         * cp-tree.h: Declare cp_build_fold_indirect_ref.
476         * call.c, class.c, cp-ubsan.c, decl.c, except.c, init.c, lambda.c,
477         parser.c, rtti.c, tree.c, typeck.c, typeck2.c: Use it.
478         * parser.c (do_range_for_auto_deduction): Use RO_UNARY_STAR.
479         (cp_convert_range_for): Likewise.
480         * typeck2.c (build_x_arrow): Use RO_ARROW.
482         * cp-ubsan.c (cp_ubsan_check_member_access_r): Fix handling of
483         INDIRECT_REF of ADDR_EXPR.
485         PR c++/82360 - ICE with static_cast in template.
486         * call.c (perform_direct_initialization_if_possible): Check
487         processing_template_decl.
488         * typeck.c (build_static_cast_1): Likewise.
490 2017-11-13  Ville Voutilainen  <ville.voutilainen@gmail.com>
492         Remove the null check from placement new in all modes
493         * init.c (build_new_1): Don't do a null check for
494         a namespace-scope non-replaceable placement new
495         in any mode unless -fcheck-new is provided.
497 2017-11-07 Boris Kolpackov  <boris@codesynthesis.com>
499         * Make-lang.in (CP_PLUGIN_HEADERS): Add operators.def since included
500         in cp-tree.h.
502 2017-11-07  Jakub Jelinek  <jakub@redhat.com>
504         PR c++/82835
505         * cp-gimplify.c (cxx_omp_clause_apply_fn): For methods pass i - 1 to
506         convert_default_arg instead of i.
508 2017-11-06  Jason Merrill  <jason@redhat.com>
510         P0704R1 - fixing const-qualified pointers to members
511         * typeck2.c (build_m_component_ref): Also accept in lower stds with
512         a pedwarn.
514 2017-11-06  Paolo Carlini  <paolo.carlini@oracle.com>
516         PR c++/65579
517         * decl2.c (finish_static_data_member_decl): If there's an initializer,
518         complete the type and re-apply the quals.
520 2017-11-06  Martin Liska  <mliska@suse.cz>
522         PR middle-end/82404
523         * constexpr.c (cxx_eval_builtin_function_call): Handle
524         __builtin_unreachable call.
525         (get_function_named_in_call): Declare function earlier.
526         (constexpr_fn_retval): Skip __builtin_unreachable.
527         * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Rename to
528         ...
529         (cp_maybe_instrument_return): ... this.
530         (cp_genericize): Call the function unconditionally.
532 2017-11-03  Nathan Sidwell  <nathan@acm.org>
534         PR c++/82710
535         * decl.c (grokdeclarator): Protect MAYBE_CLASS things from paren
536         warning too.
538 2017-11-02  Paolo Carlini  <paolo.carlini@oracle.com>
540         PR c++/81957
541         * pt.c (make_pack_expansion): Add tsubst_flags_t parameter.
542         (expand_integer_pack, convert_template_argument, coerce_template_parms,
543         gen_elem_of_pack_expansion_instantiation, tsubst_pack_expansion,
544         unify): Adjust calls.
545         * tree.c (cp_build_qualified_type_real): Likewise.
546         * cp-tree.h (make_pack_expansion): Adjust declaration.
548 2017-11-02  Nathan Sidwell  <nathan@acm.org>
550         * cp-tree.h (IDENTIFIER_NEWDEL_OP_P): Restore, adjust.
551         (IDENTIFIER_NEW_OP_P): New.
552         * decl.c (grokdeclarator): Restore IDENTIFIER_NEWDEL_OP_P use.
553         * pt.c (push_template_decl_real): Likewise.
554         * typeck.c (check_return_expr): Use IDENTIFIER_NEW_OP_P.
556         PR c++/82710
557         * decl.c (grokdeclarator): Don't warn when parens protect a return
558         type from a qualified name.
560 2017-11-01  Nathan Sidwell  <nathan@acm.org>
562         * cp-tree.h (enum cp_identifier_kind): Delete cik_newdel_op.
563         Renumber and reserve udlit value.
564         (IDENTIFIER_NEWDEL_OP_P): Delete.
565         (IDENTIFIER_OVL_OP_P): New.
566         (IDENTIFIER_ASSIGN_OP_P): Adjust.
567         (IDENTIFIER_CONV_OP_P): Adjust.
568         (IDENTIFIER_OVL_OP_INFO): Adjust.
569         (IDENTIFIER_OVL_OP_FLAGS): New.
570         * decl.c (grokdeclarator): Use IDENTIFIER_OVL_OP_FLAGS.
571         * lex.c (get_identifier_kind_name): Adjust.
572         (init_operators): Don't special case new/delete ops.
573         * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_P.
574         * pt.c (push_template_decl_real): Use IDENTIFIER_OVL_OP_FLAGS.
575         * typeck.c (check_return_expr): Likewise.
577         * cp-tree.h (assign_op_identifier, call_op_identifier): Use
578         compressed code.
579         (struct lang_decl_fn): Use compressed operator code.
580         (DECL_OVERLOADED_OPERATOR_CODE): Replace with ...
581         (DECL_OVERLOADED_OPERATOR_CODE_RAW): ... this.
582         (DECL_OVERLOADED_OPERATOR_CODE_IS): Use it.
583         * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE_RAW.
584         (build_library_fn): Likewise.
585         (grok_op_properties): Likewise.
586         * mangle.c (write_unqualified_name): Likewise.
587         * method.c (implicitly_declare_fn): Likewise.
588         * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_IS.
590         * cp-tree.h (IDENTIFIER_CP_INDEX): Define.
591         (enum ovl_op_flags): Add OVL_OP_FLAG_AMBIARY.
592         (enum ovl_op_code): New.
593         (struct ovl_op_info): Add ovl_op_code field.
594         (ovl_op_info): Size by OVL_OP_MAX.
595         (ovl_op_mapping, ovl_op_alternate): Declare.
596         (OVL_OP_INFO): Adjust for mapping array.
597         (IDENTIFIER_OVL_OP_INFO): New.
598         * decl.c (ambi_op_p, unary_op_p): Delete.
599         (grok_op_properties): Use IDENTIFIER_OVL_OP_INFO and
600         ovl_op_alternate.
601         * lex.c (ovl_op_info): Adjust and static initialize.
602         (ovl_op_mappings, ovl_op_alternate): Define.
603         (init_operators): Iterate over ovl_op_info array and init mappings
604         & alternate arrays.
605         * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_INFO.
606         * operators.def (DEF_OPERATOR): Remove KIND parm.
607         (DEF_SIMPLE_OPERATOR): Delete.
608         (OPERATOR_TRANSITION): Expand if defined.
610 2017-10-31  David Malcolm  <dmalcolm@redhat.com>
612         * pt.c (listify): Use %< and %> for description of #include.
614 2017-10-31  David Malcolm  <dmalcolm@redhat.com>
616         * class.c (explain_non_literal_class): Use UNKNOWN_LOCATION rather
617         than 0.
618         * name-lookup.c (suggest_alternatives_for): Update for renaming of
619         inform_at_rich_loc.
620         (maybe_suggest_missing_header): Likewise.
621         (suggest_alternative_in_explicit_scope): Likewise.
622         * parser.c (cp_parser_diagnose_invalid_type_name): Likewise for
623         renaming of error_at_rich_loc.
624         (cp_parser_string_literal): Likewise.
625         (cp_parser_nested_name_specifier_opt): Likewise.
626         (cp_parser_cast_expression): Likewise for renaming of
627         warning_at_rich_loc.
628         (cp_parser_decl_specifier_seq): Likewise for renaming of
629         error_at_rich_loc and warning_at_rich_loc.
630         (cp_parser_elaborated_type_specifier): Likewise for renaming of
631         pedwarn_at_rich_loc.
632         (cp_parser_cv_qualifier_seq_opt): Likewise for renaming of
633         error_at_rich_loc.
634         (cp_parser_virt_specifier_seq_opt): Likewise.
635         (cp_parser_class_specifier_1): Likewise.
636         (cp_parser_class_head): Likewise.
637         (cp_parser_member_declaration): Likewise for renaming of
638         pedwarn_at_rich_loc, warning_at_rich_loc, and error_at_rich_loc.
639         (cp_parser_enclosed_template_argument_list): Likewise for renaming
640         of error_at_rich_loc.
641         (set_and_check_decl_spec_loc): Likewise.
642         * pt.c (listify): Likewise.
643         * rtti.c (typeid_ok_p): Likewise.
644         * semantics.c (process_outer_var_ref): Use UNKNOWN_LOCATION rather
645         than 0.
646         * typeck.c (access_failure_info::maybe_suggest_accessor): Update
647         for renaming of inform_at_rich_loc.
648         (finish_class_member_access_expr): Likewise for renaming of
649         error_at_rich_loc.
651 2017-10-31  Nathan Sidwell  <nathan@acm.org>
653         * cp-tree.h (struct operator_name_info_t): Rename to ...
654         (struct ovl_op_info_t): ... here.  Add tree_code field.
655         (operator_name_info, assignment_operator_name_info): Delete.
656         (ovl_op_info): Declare.
657         (OVL_OP_INFO): Adjust.
658         * decl.c (grok_op_properties): Use ovl_op_flags.
659         * lex.c (operator_name_info, assignment_operator_name_info):
660         Delete.
661         (ovl_op_info): Define.
662         (set_operator_ident): Adjust.
663         (init_operators): Set tree_code.
664         * mangle.c (write_unqualified_id): Adjust operator array scan.
666         * lex.c (init_operators): Allow NULL operator name.  Don't add
667         special cases.
668         * operators.def: Use NULL for mangling only operators.  Move to
669         after regular operators but move assignment operators last.
671         * cp-tree.h (enum ovl_op_flags): New.
672         (struct operator_name_info_t): Rename arity to flags.
673         * lex.c (set_operator_ident): New.
674         (init_operators): Use it.  Adjust for flags.
675         * mangle.c (write_unqualified_id): Adjust for flags.
676         * operators.def: Replace arity with flags.
678         * cp-tree.h (ovl_op_identifier): New.
679         (assign_op_identifier, call_op_identifier): Adjust.
680         (cp_operator_id, cp_assignment_operator_ide): Delete.
681         (SET_OVERLOADED_OPERATOR_CODE): Delete.
682         (OVL_OP_INFO): New.
683         * call.c (op_error): Use OVL_OP_INFO.
684         (build_conditional_expr_1): Use ovl_op_identifier.
685         (build_new_op_1): Use OVL_OP_INFO & ovl_op_identifier.
686         (build_op_delete_call): Likewise.
687         * class.c (type_requires_array_cookie): Use ovl_op_identifier.
688         * decl.c (duplicate_decls): Directly copy operator code.
689         (builtin_function_1): Do not set operator code.
690         (build_library_fn): Directly set operator code.
691         (push_cp_library_fn): Use ovl_op_identifier.
692         (grok_op_properties): Directly set operator code.
693         * decl2.c (maybe_warn_sized_delete): Use ovl_op_identifier.
694         * error.c (dump_expr): Use OVL_OP_INFO.
695         (op_to_string): Add assop arg. Use OVL_OP_INFO.
696         (assop_to_string): Delete.
697         (args_to_string): Adjust.
698         * init.c (build_new_1): Use ovl_op_identifier.
699         * mangle.c (write_unqualified_name): Use OVL_OP_INFO.
700         (write_expression): Likewise.
701         * method.c (synthesized_method_walk): Use ovl_op_identifier.
702         (implicitly_declare_fn): Use assign_op_identifier. Directly set
703         operator code.
704         * name-lookup.c (get_class_binding): Use assign_op_identifier.
705         * parser.c (cp_parser_operator): Use ovl_op_identifier.
706         (cp_parser_omp_clause_reduction): Likewise.
707         * semantics.c (omp_reduction_id): Likewise.
708         * typeck.c (cxx_sizeof_or_alignof_type): Use OVL_OP_INFO.
710         * cp-tree.h (assign_op_identifier, call_op_identifier): Define.
711         (LAMBDA_FUNCTION_P): Use DECL_OVERLOADED_OPERATOR_IS.
712         (DECL_OVERLOADED_OPERATOR_P): Just retuurn true/false.
713         (DECL_OVERLOADED_OPERATOR_CODE, DECL_OVERLOADED_OPERATOR_IS): Define.
714         * call.c (add_function_candidate): Use
715         DECL_OVERLOADED_OPERATOR_IS.
716         (build_op_call_1): Use call_op_identifier &
717         DECL_OVERLOADED_OPERATOR_IS.
718         (build_over_call): Likewise.
719         (has_trivial_copy_assign_p): Use assign_op_identifier.
720         (build_special_member_call): Likewise.
721         * class.c (dfs_declare_virt_assop_and_dtor): Likewise.
722         (vbase_has_user_provided_move_assign,
723         classtype_has_move_assign_or_move_ctor_p): Likewise.
724         * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE.
725         (grok_special_member_properties): Use assign_op_identifier.
726         (start_preparsed_function): Use DECL_OVERLOADED_OPERATOR_IS.
727         * decl2.c (mark_used): Use DECL_CONV_FN_P.
728         * dump.c (dump_access): Delete prototype.
729         (dump_op): Delete.
730         (cp_dump_tree): Don't call it.
731         * lambda.c (lambda_function): Use call_op_identifier.
732         (maybe_add_lambda_conv_op): Not an overloaded operator.  Remove
733         unneeded braces.
734         * mangle.c (write_unqualified_name): Use DECL_OVERLOADED_OPERTOR_CODE.
735         * method.c (do_build_copy_assign): Use assign_op_identifier.
736         (synthesize_method): Use DECL_OVERLOADED_OPERATOR_IS.
737         (get_copy_assign): Use assign_op_identifier.
738         (synthesized_method_walk): Likewise.
739         (defaultable_fn_check): Use DECL_OVERLOADED_OPERATOR_IS.
740         * parser.c (cp_parser_lambda_declarator_opt): Use
741         call_op_identifier.
742         * semanitics.c (classtype_has_nothrow_assign_or_copy_p): Use
743         assign_op_identifier.
744         * tree.c (special_function_p):  Use DECL_OVERLOADED_OPERATOR_IS.
745         * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_CODE.
746         (check_return_expr): Use assign_op_identifier.
748 2017-10-30  Paolo Carlini  <paolo.carlini@oracle.com>
750         PR c++/82085
751         * pt.c (tsubst_copy_and_build, [INDIRECT_REF]): For a REFERENCE_REF_P,
752         unconditionally call convert_from_reference.
754 2017-10-30  Nathan Sidwell  <nathan@acm.org>
756         * call.c (build_op_call_1): Test for FUNCTION_DECL in same manner
757         as a few lines earlier.
758         * cp-tree.h (PACK_EXPANSION_PATTERN): Fix white space.
759         * decl.c (grokfndecl): Fix indentation.
760         (compute_array_index_type): Use processing_template_decl_sentinel.
761         (grok_op_properties): Move warnings to end.  Reorder other checks
762         to group similar entities.  Tweak diagnostics.
763         * lex.c (unqualified_name_lookup_error): No need to check name is
764         not ERROR_MARK operator.
765         * parser.c (cp_parser_operator): Select operator code before
766         looking it up.
767         * typeck.c (check_return_expr): Fix indentation and line wrapping.
769 2017-10-27  Paolo Carlini  <paolo.carlini@oracle.com>
771         * pt.c (invalid_nontype_parm_type_p): Return a bool instead of an int.
773 2017-10-26  Nathan Sidwell  <nathan@acm.org>
775         * decl.c (sort_labels): Restore function.
776         (pop_labels): Sort labels
777         (identify_goto): Add translation markup.
779 2017-10-25  Nathan Sidwell  <nathan@acm.org>
781         Kill IDENTIFIER_LABEL_VALUE.
782         * cp-tree.h (lang_identifier): Delete label_value slot.
783         (IDENTIFIER_LABEL_VALUE, SET_IDENTIFIER_LABEL_VALUE): Delete.
784         (struct named_label_hasher): Rename to ...
785         (struct named_label_hash): ... here.  Reimplement.
786         (struct language_function): Adjust x_named_labels.
787         * name-lookup.h (struct cp_label_binding): Delete.
788         (struct cp_binding_level): Delete shadowed_labels slot.
789         * decl.c (struct named_label_entry): Add name and outer slots.
790         (pop_label): Rename to ...
791         (check_label_used): ... here.  Don't pop.
792         (note_label, sort_labels): Delete.
793         (pop_labels, pop_local_label): Reimplement.
794         (poplevel): Pop local labels as any other decl. Remove
795         shadowed_labels handling.
796         (named_label_hash::hash, named_label_hash::equal): New.
797         (make_label_decl): Absorb into ...
798         (lookup_label_1): ... here.  Add making_local_p arg, reimplement.
799         (lookup_label, declare_local_label): Adjust.
800         (check_goto, define_label): Adjust.
801         * lex.c (make_conv_op_name): Don't clear IDENTIFIER_LABEL_VALUE.
802         * ptree.c (cxx_print_identifier): Don't print identifier binding.
804         * decl.c (identifier_goto): Reduce duplication.
805         (check_previous_goto_1): Likewise.
806         (check_goto): Move var decls to initialization.
807         (check_omp_return, define_label_1, define_label): Likewise.
809 2017-10-25  Jakub Jelinek  <jakub@redhat.com>
811         PR libstdc++/81706
812         * decl.c (duplicate_decls): Copy "omp declare simd" attributes from
813         newdecl to corresponding __builtin_ if any.
815 2017-10-24  Paolo Carlini  <paolo.carlini@oracle.com>
817         PR c++/82466
818         * decl.c (duplicate_decls): Warn for built-in functions declared as
819         non-function, use OPT_Wbuiltin_declaration_mismatch.
821         * decl.c (duplicate_decls): Avoid redundant '+' in warning_at.
823 2017-10-24  Paolo Carlini  <paolo.carlini@oracle.com>
825         PR c++/80991
826         * pt.c (value_dependent_expression_p, [TRAIT_EXPR]): Handle
827         a TREE_LIST as TRAIT_EXPR_TYPE2.
829 2017-10-24  Mukesh Kapoor  <mukesh.kapoor@oracle.com>
830             Paolo Carlini  <paolo.carlini@oracle.com>
832         PR c++/82307
833         * cvt.c (type_promotes_to): Implement C++17, 7.6/4, about unscoped
834         enumeration type whose underlying type is fixed.
836 2017-10-23  Paolo Carlini  <paolo.carlini@oracle.com>
838         PR c++/80449
839         * semantics.c (finish_compound_literal): Check do_auto_deduction
840         return value for error_mark_node.
842 2017-10-23  Jason Merrill  <jason@redhat.com>
844         PR c++/77369 - wrong noexcept handling in C++14 and below
845         * tree.c (strip_typedefs): Canonicalize TYPE_RAISES_EXCEPTIONS.
847 2017-10-20  Nathan Sidwell  <nathan@acm.org>
849         * class.c (layout_class_type): Cleanup as-base creation, determine
850         mode here.
851         (finish_struct_1): ... not here.
853 2017-10-19  Jakub Jelinek  <jakub@redhat.com>
855         PR c++/82600
856         * typeck.c (check_return_expr): Don't call
857         maybe_warn_about_returning_address_of_local in templates.
859 2017-10-17  Nathan Sidwell  <nathan@acm.org>
861         PR c++/82560
862         * call.c (build_over_call): Don't pass tf_no_cleanup to nested
863         calls.
865         PR middle-end/82546
866         * cp-objcp-common.c (cp_tree_size): Reformat.  Adjust returns size
867         of TYPE nodes.
869 2017-10-13  Jason Merrill  <jason@redhat.com>
871         PR c++/82357 - bit-field in template
872         * tree.c (cp_stabilize_reference): Just return a NON_DEPENDENT_EXPR.
874 2017-10-13  David Malcolm  <dmalcolm@redhat.com>
876         * cp-tree.h (maybe_show_extern_c_location): New decl.
877         * decl.c (grokfndecl): When complaining about literal operators
878         with C linkage, issue a note giving the location of the
879         extern "C".
880         * parser.c (cp_parser_new): Initialize new field
881         "innermost_linkage_specification_location".
882         (cp_parser_linkage_specification): Store the location
883         of the linkage specification within the cp_parser.
884         (cp_parser_explicit_specialization): When complaining about
885         template specializations with C linkage, issue a note giving the
886         location of the extern "C".
887         (cp_parser_explicit_template_declaration): Likewise for templates.
888         (maybe_show_extern_c_location): New function.
889         * parser.h (struct cp_parser): New field
890         "innermost_linkage_specification_location".
892 2017-10-12  Nathan Sidwell  <nathan@acm.org>
894         * cp-tree.h (cp_expr): Add const operator * and operator->
895         accessors.
896         (cp_tree_node_structure_enum): Delete TS_CP_BINDING,
897         TS_CP_WRAPPER, LAST_TS_CP_ENUM.
899 2017-10-12  David Malcolm  <dmalcolm@redhat.com>
901         * parser.c (get_required_cpp_ttype): New function.
902         (cp_parser_error_1): Call it, using the result to call
903         maybe_suggest_missing_token_insertion.
905 2017-10-12  David Malcolm  <dmalcolm@redhat.com>
907         * parser.c (get_matching_symbol): Move to before...
908         (cp_parser_error): Split out into...
909         (cp_parser_error_1): ...this new function, merging in content
910         from...
911         (cp_parser_required_error): ...here.  Eliminate partial duplicate
912         of body of cp_parser_error in favor of a call to the new
913         cp_parser_error_1 helper function.
915 2017-10-11  Nathan Sidwell  <nathan@acm.org>
917         * decl2.c (struct mangled_decl_hash): Use DECL_ASSEMBLER_NAME_RAW.
918         (record_mangling): Likewise.
920 2017-10-10  Nathan Sidwell  <nathan@acm.org>
922         * name-lookup.c (extern_c_fns): Rename to ...
923         (extern_c_decls): ... here.
924         (check_extern_c_conflict, extern_c_linkage_bindings): Update.
925         (do_pushdecl): Check extern-c fns and vars.
927         * cp-tree.h (default_hash_traits <lang_identifier *>): Delete
928         specialization.
930         * decl2.c (struct mangled_decl_hash): New hash traits.
931         (mangled_decls): Make hash_table<mangled_decl_hash>.
932         (generate_mangling_alias, record_mangling): Adjust.
934 2017-10-10  Jason Merrill  <jason@redhat.com>
936         More delayed lambda capture fixes.
937         * call.c (add_function_candidate): Use build_address.
938         (build_op_call_1): Call mark_lvalue_use early.
939         (build_over_call): Handle error from build_this.
940         * constexpr.c (cxx_bind_parameters_in_call): Use build_address.
941         (cxx_eval_increment_expression): Don't use rvalue().
942         * cvt.c (convert_to_void): Use mark_discarded_use.
943         * expr.c (mark_use): Handle PARM_DECL, NON_DEPENDENT_EXPR.  Fix
944         reference handling.  Don't copy the expression.
945         (mark_discarded_use): New.
946         * lambda.c (insert_capture_proxy): Add some sanity checking.
947         (maybe_add_lambda_conv_op): Set cp_unevaluated_operand.
948         * pt.c (register_local_specialization): Add sanity check.
949         * semantics.c (process_outer_var_ref): Fix check for existing proxy.
950         * typeck.c (cp_build_addr_expr_1): Handle error from
951         mark_lvalue_use.
952         (cp_build_modify_expr): Call mark_lvalue_use_nonread, handle error
953         from rvalue.
955         Handle generic lambda capture in dependent expressions.
956         * lambda.c (need_generic_capture, dependent_capture_r)
957         (do_dependent_capture): New.
958         * pt.c (processing_nonlambda_template): Use need_generic_capture.
959         * semantics.c (maybe_cleanup_point_expr)
960         (maybe_cleanup_point_expr_void, finish_goto_stmt)
961         (maybe_convert_cond): Call do_dependent_capture.
962         * typeck.c (build_static_cast): Remove dependent capture handling.
964         * typeck.c (condition_conversion): Assert !processing_template_decl.
965         * semantics.c (finish_omp_clauses): Don't
966         fold_build_cleanup_point_expr if processing_template_decl.
967         (outer_var_p): A temporary can't be from an outer scope.
968         * pt.c (type_dependent_expression_p): Fix dependency checking of
969         functions without DECL_TEMPLATE_INFO.
970         (instantiate_decl): Use lss_copy.
971         * constexpr.c (is_valid_constexpr_fn): Fix lambdas before C++17.
973         * typeck.c (check_return_expr): Check non-dependent conversion in
974         templates.
975         * constraint.cc (check_function_concept): Don't complain about an
976         empty concept if seen_error.
978 2017-10-10  Richard Sandiford  <richard.sandiford@linaro.org>
980         * cvt.c (ignore_overflows): Use wi::to_wide when
981         operating on trees as wide_ints.
982         * decl.c (check_array_designated_initializer): Likewise.
983         * mangle.c (write_integer_cst): Likewise.
984         * semantics.c (cp_finish_omp_clause_depend_sink): Likewise.
986 2017-10-10  Nathan Sidwell  <nathan@acm.org>
988         * name-lookup.c (set_global_binding): Don't deal with STAT_HACK.
990 2017-10-06  Paolo Carlini  <paolo.carlini@oracle.com>
992         PR c++/47791
993         * decl.c (finish_function): Take a bool intead of an int; adjust.
994         * cp-tree.h (finish_function): Adjust declaration.
995         * decl2.c (generate_tls_wrapper, finish_objects,
996         finish_static_storage_duration_function): Adjust calls.
997         * lambda.c (maybe_add_lambda_conv_op, finish_lambda_function):
998         Likewise.
999         * method.c (synthesize_method): Likewise.
1000         * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
1001         * pt.c (instantiate_decl): Likewise.
1002         * parser.c (cp_parser_function_definition_after_declarator,
1003         cp_parser_late_parsing_for_member, cp_parser_omp_declare_reduction):
1004         Likewise.
1005         (cp_parser_ctor_initializer_opt,
1006         cp_parser_ctor_initializer_opt_and_function_body,
1007         cp_parser_function_try_block,
1008         cp_parser_function_definition_after_declarator,
1009         cp_parser_function_transaction): Return void; adjust declarations.
1011 2017-10-06  Nathan Sidwell  <nathan@acm.org>
1013         PR c++/82424
1014         * name-lookup.c (check_local_shadow): Don't try and convert
1015         dependent types.
1017 2017-10-06  Jakub Jelinek  <jakub@redhat.com>
1019         PR c++/82299
1020         * decl.c (reshape_init): Suppress warn_useless_cast for direct enum
1021         init.
1022         * typeck.c (convert_for_assignment): Likewise.
1024         P0704R1 - fixing const-qualified pointers to members
1025         * typeck2.c (build_m_component_ref): For -std=c++2a allow
1026         pointer to const & qualified method on rvalue.
1028 2017-10-06  Nathan Sidwell  <nathan@acm.org>
1030         Use hash_table for extern "C" names
1031         * name-lookup.c (extern_c_fns): Use hash_table.
1032         (check_extern_c_conflict): Adjust.
1033         (c_linkage_bindings): Adjust.
1035         Use hash_table for namespace bindings
1036         * cp-tree.h (struct named_decl_hash): New.
1037         (lang_decl_ns): Change type of bindings field.
1038         * lex.c (maybe_add_lang_decl_raw): Adjust.
1039         * name-lookup.c (find_namespace_slot): Adjust.
1040         (do_pushdecl): Push NULL-named namespace.
1041         (do_push_nested_namespace): Adjust.
1042         (push_namespace): Push anonymous namespace as NULL name.
1044 2017-10-05  Jason Merrill  <jason@redhat.com>
1046         Pass variadic class objects exactly like named by-value args.
1047         * call.c (convert_arg_to_ellipsis): Use the result of force_rvalue.
1049 2017-10-05  Nathan Sidwell  <nathan@acm.org>
1051         Warn on MVP declarations
1052         * cp-tree.h (struct cp_declarator): Add parenthesized field.
1053         * decl.c (grokdeclarator): Warn about unnecessary parens.
1054         * parser.c (make_declarator): Init parenthesized field.
1055         (cp_parser_direct_declarator): Set parenthesized field.
1057         Kill IDENTIFIER_GLOBAL_VALUE, SET_IDENTIFIER_GLOBAL_VALUE
1058         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1059         SET_IDENTIFIER_GLOBAL_VALUE): Delete.
1060         * name-lookup.h (set_global_binding): Remove NAME parm.
1061         (get_global_binding): New inline fn.
1062         * name-lookup.c (set_global_binding): Remove NAME parm. Adjust.
1063         (identifier_global_value): Move to ...
1064         * cp-objcp-common.c (identifier_global_value): ... here.
1065         * class.c (build_ctor_vtbl_group, build_vtbl_initializer): Adjust.
1066         * decl.c (record_builtin_type, expand_static_init,
1067         grokdeclarator): Adjust.
1068         * decl2.c (get_guard, get_local_tls_init_fn, get_tls_init_fn,
1069         get_tls_wrapper_fn, maybe_warn_sized_delete): Adjust.
1070         * except.c (declare_library_fn, build_throw): Adjust.
1071         * init.c (throw_bad_array_length): Adjust.
1072         * rtti.c (throw_bad_cast, throw_bad_typeid, get_tinfo_decl): Adjust.
1074         * decl2.c (record_mangling): Fix spello and formatting from
1075         previous patch.
1077 2017-10-04  Nathan Sidwell  <nathan@acm.org>
1079         Give builtin types the correct name.
1080         * name-lookup.c (set_global_binding): Assert name is DECL_NAME.
1081         * decl.c (record_builtin_type): Reimplement, use new TYPE_DECL for
1082         rname.
1084 2017-10-04  Paolo Carlini  <paolo.carlini@oracle.com>
1085             Andrew Pinski  <apinski@cavium.com>
1087         PR c++/71946
1088         * parser.c (cp_parser_lambda_body): Set parser->in_function_body.
1090 2017-10-04  Nathan Sidwell  <nathan@acm.org>
1092         Move mangling aliases out of global namespace.
1093         * cp-tree.h (record_mangling): New.
1094         (maybe_remove_implicit_alias): Delete.
1095         * decl2.c (mangled_decls): New hash map.
1096         (generate_mangling_alias): Reimplement using mangled_decls.
1097         (record_mangling): New.
1098         * mangle.c (decl_implicit_alias_p,
1099         maybe_remove_implicit_alias): Delete.
1100         (mangle_decl): Use record_mangling.
1101         * name-lookup.c (supplement_binding_1): Remove
1102         maybe_remove_implicit_alias check.
1104 2017-10-04  Jakub Jelinek  <jakub@redhat.com>
1106         PR c++/82373
1107         * error.c (dump_function_decl): If show_return, call dump_type_suffix
1108         on the same return type dump_type_prefix has been called on.
1110 2017-10-04  Jason Merrill  <jason@redhat.com>
1112         PR c++/81525 - broken handling of auto in generic lambda.
1113         * pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.
1115 2017-10-04  Nathan Sidwell  <nathan@acm.org>
1117         * call.c (convert_arg_to_ellipsis): Correct comment about passing
1118         by reference.
1120 2017-10-02  Richard Sandiford  <richard.sandiford@linaro.org>
1122         * constexpr.c (cxx_eval_store_expression): Use wi::to_widest
1123         when comparing the array bounds with an ARRAY_REF index.
1125 2017-09-30  Paolo Carlini  <paolo.carlini@oracle.com>
1127         PR c++/68754
1128         * method.c (defaulted_late_check): Early return if the defaulted
1129         declaration does not match the expected signature.
1131 2017-09-29  Jakub Jelinek  <jakub@redhat.com>
1133         P0683R1 - default member initializers for bit-fields
1134         * cp-tree.h (grokbitfield): Add INIT parameter.
1135         * parser.c (cp_parser_constant_expression): Add STRICT_P argument,
1136         if true, parse a conditional-expression rather than
1137         assignment-expression.
1138         (cp_parser_member_declaration): For C++11 and later pass true
1139         as STRICT_P to cp_parser_constant_expression.  Parse C++2A bitfield
1140         NSDMIs.  Adjust grokbitfield caller.  Handle DECL_INITIAL also for
1141         DECL_C_BIT_FIELDs.
1142         (cp_parser_objc_class_ivars): Adjust grokbitfield caller.
1143         * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs.
1144         (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs.
1145         * decl2.c (grokbitfield): Add INIT parameter, pass it to
1146         cp_finish_decl.
1147         * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not
1148         just non-bitfields.
1150         * class.c (check_bitfield_decl): Retrieve and clear width from
1151         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
1152         (check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than
1153         DECL_INITIAL.
1154         (remove_zero_width_bit_fields): Adjust comment.
1155         * decl2.c (grokbitfield): Stash width into
1156         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
1157         * pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr
1158         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width.
1160         * parser.c (cp_parser_member_declaration): Parse attributes before
1161         colon of a bitfield in addition to after colon.
1163         * Make-lang.in (check-c++-all): Test also c++2a.
1165 2017-09-28  Jason Merrill  <jason@redhat.com>
1167         PR c++/56973, DR 696 - capture constant variables only as needed.
1168         * expr.c (mark_use): Split out from mark_rvalue_use and
1169         mark_lvalue_use.  Handle lambda capture of constant variables.
1170         (mark_lvalue_use_nonread): New.
1171         * semantics.c (process_outer_var_ref): Don't capture a constant
1172         variable until forced.
1173         * pt.c (processing_nonlambda_template): New.
1174         * call.c (build_this): Check it.
1175         * decl2.c (grok_array_decl): Call mark_rvalue_use and
1176         mark_lvalue_use_nonread.
1177         * init.c (constant_value_1): Don't call mark_rvalue_use.
1178         * typeck.c (build_static_cast): Handle lambda capture.
1180         Use local_specializations to find capture proxies.
1181         * cp-tree.h (DECL_CAPTURED_VARIABLE): New.
1182         * lambda.c (build_capture_proxy): Set it.
1183         (add_capture): Pass initializer to build_capture_proxy.
1184         (start_lambda_function): Likewise.
1185         (insert_capture_proxy): Use register_local_specialization.
1186         (is_lambda_ignored_entity): Always ignore proxies.
1187         * name-lookup.c (qualify_lookup): Don't check
1188         is_lambda_ignored_entity if LOOKUP_HIDDEN is set.
1189         * semantics.c (process_outer_var_ref): Use
1190         retrieve_local_specialization.
1191         * parser.c (cp_parser_lambda_body): Push local_specializations.
1192         * pt.c (tsubst_expr): Pass LOOKUP_HIDDEN when looking for a proxy.
1193         (tsubst_lambda_expr): Push local_specializations sooner.
1194         (tsubst_copy_and_build): Don't register_local_specialization.
1196         * call.c (build_special_member_call): Use the return value of
1197         mark_lvalue_use.
1198         * decl.c (compute_array_index_type): Likewise.
1199         * parser.c (cp_parser_oacc_wait_list): Likewise.
1200         * lambda.c (is_normal_capture_proxy): Handle *this capture.
1201         (add_capture): Clarify internal_error message.
1203 2017-09-22  Eric Botcazou  <ebotcazou@adacore.com>
1205         PR bootstrap/81926
1206         * cp-objcp-common.c (cp_get_debug_type): Do only one lookup.
1208 2017-09-22  Jakub Jelinek  <jakub@redhat.com>
1210         PR sanitizer/81929
1211         * tree.c (struct replace_placeholders_t): Add pset field.
1212         (replace_placeholders_r): Call cp_walk_tree with d->pset as
1213         last argument instead of NULL.  Formatting fix.
1214         (replace_placeholders): Add pset variable, add its address
1215         into data.  Pass &pset instead of NULL to cp_walk_tree.
1217 2017-09-22  David Malcolm  <dmalcolm@redhat.com>
1219         * call.c (get_fndecl_argument_location): New function.
1220         (convert_like_real): Use it  when complaining about argument type
1221         mismatches.
1222         * cp-tree.h (struct cp_parameter_declarator): Add "loc" field.
1223         * parser.c (make_parameter_declarator): Add "loc" param and use
1224         it to initialize the new field.
1225         (cp_parser_translation_unit): Add UNKNOWN_LOCATION for "loc" of
1226         the "no_parameters" parameter.
1227         (cp_parser_parameter_declaration_list): Set the location of the
1228         result of grokdeclarator to be the parameter's loc, assuming no
1229         errors.
1230         (cp_parser_parameter_declaration): Generate a location for the
1231         parameter and pass to make_parameter_declarator.
1233 2017-09-20  Nathan Sidwell  <nathan@acm.org>
1235         * name-lookup.c (member_name_cmp): Use DECL_UID for final
1236         ordering.
1238 2017-09-20  Jakub Jelinek  <jakub@redhat.com>
1240         P0409R2 - allow lambda capture [=, this]
1241         * parser.c (cp_parser_lambda_introducer): For cxx2a don't pedwarn on
1242         redundant [=, this].
1244 2017-09-18  Jason Merrill  <jason@redhat.com>
1246         PR c++/82069 - ICE with lambda in template
1247         * semantics.c (process_outer_var_ref): Check uses_template_parms
1248         instead of any_dependent_template_arguments_p.
1250 2017-09-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1251             Paolo Carlini  <paolo.carlini@oracle.com>
1253         PR c++/64644
1254         * decl2.c (finish_anon_union): Complain about "anonymous union with
1255         no members" with a pedwarn.
1257 2017-09-15  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1259         * typeck.c (build_reinterpret_cast_1,
1260         build_const_cast_1): Implement -Wcast-align=strict.
1262 2017-09-15  Jakub Jelinek  <jakub@redhat.com>
1264         * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
1265         adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
1266         to C++17 or -std=gnu++17 or -std=c++17.  Adjust comments.
1267         (cxx_init_decl_processing, next_initializable_field,
1268         is_direct_enum_init, check_initializer, cp_finish_decl,
1269         mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
1270         finish_function): Likewise.
1271         * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
1272         * pt.c (mark_template_parm, convert_nontype_argument,
1273         instantiate_class_template_1, type_unification_real, unify,
1274         get_partial_spec_bindings, dependent_type_p_r): Likewise.
1275         * typeck.c (cp_build_unary_op): Likewise.
1276         * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
1277         * call.c (build_user_type_conversion_1, build_over_call,
1278         build_special_member_call): Likewise.
1279         * lambda.c (begin_lambda_type): Likewise.
1280         * typeck2.c (process_init_constructor_record): Likewise.
1281         * class.c (build_base_field, finalize_literal_type_property,
1282         explain_non_literal_class): Likewise.
1283         * parser.c (cp_parser_diagnose_invalid_type_name,
1284         cp_parser_primary_expression, cp_parser_lambda_introducer,
1285         cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
1286         cp_convert_range_for, cp_parser_perform_range_for_lookup,
1287         cp_parser_decomposition_declaration, cp_parser_linkage_specification,
1288         cp_parser_static_assert, cp_parser_simple_type_specifier,
1289         cp_parser_namespace_definition, cp_parser_using_declaration,
1290         cp_parser_init_declarator, cp_parser_type_parameter_key,
1291         cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
1292         cp_parser_constructor_declarator_p): Likewise.
1293         * mangle.c (struct globals): Rename need_cxx1z_warning to
1294         need_cxx17_warning.
1295         (write_exception_spec, start_mangling, mangle_decl): Likewise.
1296         * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
1297         it.
1298         (check-c++17): New goal.  Use 17 instead of 1z.
1299         (check-c++-all): Use 17 instead of 1z.
1301 2017-09-14  Jakub Jelinek  <jakub@redhat.com>
1303         PR c++/81314
1304         * cp-gimplify.c (omp_var_to_track): Look through references.
1305         (omp_cxx_notice_variable): Likewise.
1307 2017-09-13  Nathan Sidwell  <nathan@acm.org>
1309         Conv-op identifers not in identifier hash table
1310         * lex.c (conv_type_hasher): Make member fns inline.
1311         (make_conv_op_name): Directly clone conv_op_identifier.
1313         Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
1314         * cp-tree.h (struct lang_type): Rename methods to members.
1315         (CLASSTYPE_METHOD_VEC): Rename to ...
1316         (CLASSTYPE_MEMBER_VEC): ... this.
1317         * name-lookup.h (get_method_slot): Rename to ...
1318         (get_member_slot): ... this.
1319         (resort_type_method_vec): Rename to ...
1320         (resort_type_member_vec): ... this.
1321         * class.c (add_method, warn_hidden): Adjust.
1322         * search.c (dfs_locate_field_accessor_pre): Adjust.
1323         * name-lookup.c (method_vec_binary_search): Rename to ...
1324         (member_vec_binary_search): ... this and adjust.
1325         (method_vec_linear_search): Rename to ...
1326         (member_vec_linear_search): ... this and adjust.
1327         (fields_linear_search, get_class_binding_direct): Adjust.
1328         (get_method_slot): Rename to ...
1329         (get_member_slot): ... this and adjust.
1330         (method_name_slot): Rename to ...
1331         (member_name_slot): ... this and adjust.
1332         (resort_type_method_vec): Rename to ...
1333         (resort_type_member_vec): ... this and adjust.
1334         (method_vec_append_class_fields): Rename to ...
1335         (member_vec_append_class_fields): ... this and adjust.
1336         (method_vec_append_enum_values): Rename to ...
1337         (member_vec_append_enum_values): ... this and adjust.
1338         (method_vec_dedup): Rename to ...
1339         (member_vec_dedup): ... this and adjust.
1340         (set_class_bindings, insert_late_enum_def_bindings): Adjust.
1341         
1342 2017-09-12  Paolo Carlini  <paolo.carlini@oracle.com>
1344         PR c++/70621
1345         * decl.c (start_decl): Early return error_mark_node if duplicate_decls
1346         returns it; avoid misleading error message.
1348 2017-09-12  Nathan Sidwell  <nathan@acm.org>
1350         Kill CLASSTYPE_SORTED_FIELDS.
1351         * cp-tree.h (struct lang_type): Lose sorted_fields member.
1352         (CLASSTYPE_SORTED_FIELDS): Delete.
1353         * name-lookup.h (set_class_bindings): Add EXTRA arg.
1354         * name-lookup.c (fields_linear_search): New, broken out of ...
1355         (lookup_field_1): ... here.  Delete remainder of function.
1356         (get_class_binding_direct): Reimplement without sorted_fields.
1357         (get_class_binding): Rename TYPE arg to KLASS, for consistency.
1358         (get_method_slot): Call set_class_binding when creating method_vec
1359         on complete type.
1360         (method_name_cmp): Order identically named slots.
1361         (sorted_fields_type_new): Delete.
1362         (field_vc_append_class_fields): Rename to ...
1363         (method_vec_append_class_fields): ... here.  Adjust.
1364         (field_vec_append_enum_values): Renme to ...
1365         (method_vec_append_enum_values): ... here. Adjust.
1366         (method_vec_dedup): New.
1367         (set_class_bindings): Reimplement.
1368         (insert_late_enum_def_bindings): Reimplement.
1370         * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
1371         consistency.
1372         (restort_data): Move later.
1373         (method_name_cmp, resort_method_name_cmp): Simplify.
1374         (resort_type_method_vec): Reformat.
1376 2017-09-09  Jason Merrill  <jason@redhat.com>
1378         * constexpr.c (reduced_constant_expression_p): If
1379         CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
1381 2017-09-09  Eric Botcazou  <ebotcazou@adacore.com>
1383         PR bootstrap/81926
1384         * cp-objcp-common.c (struct debug_type_hasher): New class.
1385         (debug_type_hash): New variable.
1386         (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
1388 2017-09-08  Jason Merrill  <jason@redhat.com>
1390         PR c++/70029 - ICE with ref-qualifier and -flto
1391         * tree.c (cxx_copy_lang_qualifiers): New.
1392         * cp-tree.h: Declare it.
1393         * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
1395 2017-09-06  Jason Merrill  <jason@redhat.com>
1397         PR c++/82053 - ICE with default argument in lambda in template
1398         * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
1399         in templates.
1400         (retrieve_specialization): Use lambda_fn_in_template_p.
1401         * cp-tree.h: Declare it.
1403         PR c++/82070 - error with nested lambda capture
1404         * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
1405         register_local_specialization.
1407 2017-09-06  Nathan Sidwell  <nathan@acm.org>
1409         * name-lookup.h (lookup_field_1): Delete.
1410         (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
1411         * name-lookup.c (lookup_field_1): make static
1412         (method_vec_binary_search, method_vec_linear_search): New.  Broken
1413         out of ...
1414         (get_class_binding_direct): ... here.  Add TYPE_OR_FNS argument.
1415         Do complete search of this level.
1416         (get_class_binding): Adjust.
1417         * decl.c (reshape_init_class): Call get_class_binding.
1418         * search.c (lookup_field_r): Move field searching into
1419         get_class_binding_direct.
1421         * class.c (warn_hidden): Don't barf on non-functions.
1422         * decl2.c (check_classfn): Likewise.  Check template match earlier.
1424         * name-lookup.c (count_fields): Rename to ...
1425         (count_class_fields): ... here.  Take a class, don't count
1426         NULL-named fields.
1427         (add_fields_to_record_type): Rename to ...
1428         (field_vec_append_class_fields): ... here.  Take a class, don't
1429         add NULL-named fields.
1430         (add_enum_fields_to_record_type): Rename to ...
1431         (field_vec_append_enum_values): ... here.
1432         (set_class_bindings): Adjust, assert we added expected number.
1433         (insert_late_enum_def_bindings): Reimplement.  Create vector if
1434         there are now sufficient entries.
1436         * name-lookup.h (lookup_fnfields_slot_nolazy,
1437         lookup_fnfields_slot): Rename to ...
1438         (get_class_binding_direct, get_class_binding): ... here.
1439         * name-lookup.c (lookup_fnfields_slot_nolazy,
1440         lookup_fnfields_slot): Rename to ...
1441         (get_class_binding_direct, get_class_binding): ... here.
1442         * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
1443         * call.c (build_user_type_conversion_1): Adjust.
1444         (has_trivial_copy_assign_p): Adjust.
1445         (has_trivial_copy_p): Adjust.
1446         * class.c (get_basefndecls) Adjust.
1447         (vbase_has_user_provided_move_assign) Adjust.
1448         (classtype_has_move_assign_or_move_ctor_p): Adjust.
1449         (type_build_ctor_call, type_build_dtor_call): Adjust.
1450         * decl.c (register_dtor_fn): Adjust.
1451         * decl2.c (check_classfn): Adjust.
1452         * pt.c (retrieve_specialization): Adjust.
1453         (check_explicit_specialization): Adjust.
1454         (do_class_deduction): Adjust.
1455         * search.c (lookup_field_r): Adjust.
1456         (look_for_overrides_here, lookup_conversions_r): Adjust.
1457         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
1458         * tree.c (type_has_nontrivial_copy_init): Adjust.
1459         * method.c (lazily_declare_fn): Adjust comment.
1461 2017-09-05  Nathan Sidwell  <nathan@acm.org>
1463         * name-lookup.c (do_class_using_decl): Elide read-once temps.
1464         Move declarations to initializations.
1466         * class.c (add_method): Move slot search and insertion to ...
1467         * name-lookup.c (get_method_slot): ... this new function.
1468         (lookup_fnfields_slot_nolazy): Cope with NULL slot.
1469         * name-lookup.h (get_method_slot): Declare.
1470         * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
1471         realistic type.
1472         (grok_special_member_properties): Set
1473         TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
1474         Improve TYPE_HAS_CONSTEXPR_CTOR setting.        
1476         * cp-tree.h (lang_decl_base): Rename template_conv_p to
1477         unknown_bound_p.
1478         (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
1479         (DECL_CONV_FN_TYPE): FN must be conv op.
1480         (DECL_TEMPLATE_CONV_FN_P): Delete.
1481         (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
1482         * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
1483         setting.
1485         * class.c (unreverse_member_declarations): Remove extraneous if.
1486         * pt.c (push_template_decl_real): Use string concatenation, not
1487         \<newline>.  Add %<..%>.
1489 2017-09-05  Paolo Carlini  <paolo.carlini@oracle.com>
1491         PR c++/81942
1492         * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
1493         * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
1494         creating cdtor_label.
1495         * constexpr.c (returns): Add the case of a constructor/destructor
1496         returning via a LABEL_DECL_CDTOR label.
1497         (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
1499 2017-09-01  Nathan Sidwell  <nathan@acm.org>
1501         * cp-tree.h (resort_type_method_vec): Move declaration to ...
1502         * name-lookup.h (resort_type_method_vec): ... here.
1503         (set_class_bindings): Lose 2nd arg.
1504         * class.c (finish_struct_1, finish_struct): Adjust
1505         set_class_bindings call.  Don't call finish_struct_methods.
1506         (resort_data, method_name_cmp, resort_method_name_cmp,
1507         resort_type_method_vec, finish_struct_methods): Move to ...
1508         * name-lookup.c (resort_data, method_name_cmp,
1509         resort_method_name_cmp, resort_type_method_vec): ... here.
1510         (set_class_bindings): Lose fields arg.  Swallow finish_struct_methods.
1512         * class.c (finish_struct): Call set_class_bindings for the
1513         template case too.
1515         * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
1516         Don't call maybe_warn_about_overly_private_class here.
1517         (warn_hidden): Cleanup declarations and comments.
1518         (type_has_user_provided_constructor): No need to check
1519         CLASSTYPE_METHOD_VEC.
1520         (type_has_user_provided_or_explicit_constructor): Likewise.
1521         (classtype_has_move_assign_or_move_ctor_p): Likewise.
1522         (check_bases_and_members): Don't call finish_struct_methods here.
1523         (finish_struct_1): Call finish_struct_methods and
1524         set_class_bindings immediately after layout.  Clear DECL_IN_AGGR_P
1525         here.
1526         (finish_struct): For templates process USING_DECLS and clear
1527         DECL_IN_AGGR_P before calling finish_struct_methods. Call
1528         maybe_warn_about_overly_private_class here.
1530         Revert 2017-08-28  Nathan Sidwell  <nathan@acm.org>
1531         Restore sorted_fields vector.
1532         * cp-tree.h (lang_type): Restore sorted_fields vector.
1533         (CLASSTYPE_SORTED_FIELDS): Restore.
1534         (CLASSTYPE_BINDINGS): Delete.
1535         * name-lookup.c (lookup_field_1): Restore binary search.
1536         (sorted_fields_type_new, count_fields,
1537         add_fields_to_record_type, add_enum_fields_to_record_type): Restore
1538         (set_class_bindings): Revert.
1539         (insert_late_enum_def_binding): Restore field_vec insertion.
1541 2017-09-01  Jakub Jelinek  <jakub@redhat.com>
1543         PR c/81887
1544         * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
1546 2017-09-01  Marek Polacek  <polacek@redhat.com>
1548         PR c++/82040
1549         * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
1551 2017-08-30  Jason Merrill  <jason@redhat.com>
1553         PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
1554         * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
1555         (regenerated_lambda_fn_p): New.
1556         (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
1557         (tsubst_copy) [VAR_DECL]: Likewise.
1559         PR c++/82030 - ICE inheriting from multiple lambdas
1560         PR c++/80767
1561         * call.c (compare_ics): Handle null candidate.
1563 2017-08-30  Ville Voutilainen  <ville.voutilainen@gmail.com>
1565         Make taking the address of an overloaded function a non-deduced context
1567         * pt.c (unify_overload_resolution_failure): Remove.
1568         (unify_one_argument): Adjust.
1570 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1571             Alan Hayward  <alan.hayward@arm.com>
1572             David Sherwood  <david.sherwood@arm.com>
1574         * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
1576 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1577             Alan Hayward  <alan.hayward@arm.com>
1578             David Sherwood  <david.sherwood@arm.com>
1580         * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
1582 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1583             Alan Hayward  <alan.hayward@arm.com>
1584             David Sherwood  <david.sherwood@arm.com>
1586         * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
1587         instead of TYPE_MODE.
1589 2017-08-29  Jason Merrill  <jason@redhat.com>
1591         PR c++/81236 - ICE with template-id in generic lambda
1592         * semantics.c (finish_id_expression): Remove special dependent case.
1593         Avoid some later pieces when dependent.
1594         (finish_qualified_id_expr): Do normal BASELINK handling in a
1595         template.  Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
1596         (parsing_default_capturing_generic_lambda_in_template): Remove.
1597         * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
1598         error for types that will never be complete.
1599         * mangle.c (write_expression): Add sanity check.
1600         * tree.c (build_qualified_name): Add sanity check.
1601         (cp_walk_subtrees): Walk into the class context of a BASELINK.
1602         * lambda.c (add_capture): Improve diagnostic for generic lambda
1603         capture failure.
1604         * call.c (build_new_method_call_1): Print the right constructor
1605         name.
1607         Reimplement handling of lambdas in templates.
1608         * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
1609         * decl.c (start_preparsed_function): Call start_lambda_scope.
1610         (finish_function): Call finish_lambda_scope.
1611         * init.c (get_nsdmi): Call start/finish_lambda_scope.
1612         * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
1613         * parser.c (cp_parser_function_definition_after_declarator): Don't
1614         call start/finish_lambda_scope.
1615         * pt.c (retrieve_specialization): Ignore lambda functions in
1616         templates.
1617         (find_parameter_packs_r): Ignore capture proxies.  Look into
1618         lambdas.
1619         (check_for_bare_parameter_packs): Allow bare packs in lambdas.
1620         (tsubst_default_argument): Call start/finish_lambda_scope.
1621         (tsubst_function_decl): Handle lambda functions differently.
1622         (tsubst_template_decl): Likewise.
1623         (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
1624         proxies.
1625         (tsubst_lambda_expr): Create a new closure rather than instantiate
1626         the one from the template.
1627         (tsubst_copy_and_build): Don't register a specialization of a pack.
1628         (regenerate_decl_from_template): Call start/finish_lambda_scope.
1629         (instantiate_decl): Remove special lambda function handling.
1630         * semantics.c (process_outer_var_ref): Remove special generic lambda
1631         handling.  Don't implicitly capture in a lambda in a template.  Look
1632         for an existing proxy.
1633         * class.c (current_nonlambda_class_type): Use decl_type_context.
1635         * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
1636         (LAMBDA_EXPR_RETURN_TYPE): Remove.
1637         (struct tree_lambda_expr): Remove closure and return_type fields.
1638         * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
1639         * pt.c (tsubst_copy_and_build): Likewise.
1640         * parser.c (cp_parser_lambda_declarator_opt): Track return type.
1641         (cp_parser_lambda_body): Adjust unspecified return type check.
1642         * ptree.c (cxx_print_lambda_node): Don't print closure or
1643         return type.
1645         PR c++/80935 - wrong C++17 error with lambda
1646         * decl.c (check_for_uninitialized_const_var): Check
1647         is_instantiation_of_constexpr.
1648         * constexpr.c (ensure_literal_type_for_constexpr_object): Check
1649         is_instantiation_of_constexpr.
1650         (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
1652         * lambda.c (build_lambda_object): Check for error_mark_node.
1653         * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
1654         pack as well.
1655         (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
1656         (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
1658         PR c++/80767 - unnecessary instantiation of generic lambda
1659         * call.c (convert_like_real): Call build_user_type_conversion_1 if
1660         cand is null.
1661         (add_conv_candidate): Build a ck_user conversion with no candidate.
1663         Fix lambdas in template default argument of inherited ctor.
1664         * method.c (synthesized_method_base_walk): Replace an inherited
1665         template with its specialization.
1666         (synthesized_method_walk): Make inheriting_ctor a pointer.
1667         (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
1668         (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
1670         * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
1671         template, not the function.
1672         (template_guide_p): Adjust.
1674         Support copying local_specializations.
1675         * cp-tree.h (enum lss_policy): New.
1676         (local_specialization_stack): Add policy parameter to default ctor.
1677         * pt.c (local_specialization_stack): Copy local_specializations if
1678         lss_copy.
1680         * constexpr.c (potential_constant_expression_1): Add "now" parm.
1681         (is_constant_expression, require_constant_expression): New.
1682         (is_static_init_expression, is_nondependent_constant_expression)
1683         (is_nondependent_static_init_expression): Drop "potential".
1684         * except.c (build_must_not_throw_expr): Do type conversion on
1685         value-dependent argument.
1686         * pt.c, semantics.c, typeck2.c: Use variants without "potential".
1688         Instantiate default arguments/member initializers once.
1689         * init.c (get_nsdmi): Remember NSDMI instantiations.
1690         * parser.c (inject_this_parameter): Be more picky about
1691         current_class_ptr.
1692         * pt.c (tsubst_copy): Simplify 'this' handling.
1693         (tsubst_default_argument): Remember default argument
1694         instantiations.  Take parameter number.
1695         (tsubst_default_arguments): Pass it.
1696         * call.c (convert_default_arg): Likewise.
1698         Fix default argument conversion failure and SFINAE.
1699         * call.c (build_over_call): Check convert_default_arg result for
1700         error_mark_node.
1701         * parser.c (cp_parser_late_parsing_default_args): Remember
1702         error_mark_node.
1704 2017-08-28  Nathan Sidwell  <nathan@acm.org>
1706         * cp-tree.h (lang_type): Replace sorted_fields vector with
1707         bindings map.
1708         (CLASSTYPE_SORTED_FIELDS): Delete.
1709         (CLASSTYPE_BINDINGS): New.
1710         * decl.c (finish_enum_value_list): Swap args of
1711         insert_late_enum_def_bindings.
1712         * name-lookup.c (lookup_field_1): Replace binary search of sorted
1713         fields with map->get.
1714         (sorted_fields_type_new, count_fields,
1715         add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
1716         (add_class_member, add_class_members): New.
1717         (set_class_bindings): Create map and insert.
1718         (insert_late_enum_def_binding): Swap parms.  Use add_clasS_member.
1719         * ptree.c (cxx_print_type): Delete sorted fields printing.
1721         * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
1722         Delete.
1723         * name-lookup.h (set_class_bindings,
1724         insert_late_enum_def_bindings): Declare.
1725         * decl.c (finish_enum_value_list): Adjust for
1726         insert_late_enum_def_bindings name change.
1727         * class.c (finish_struct_1): Call set_class_bindings.
1728         (count_fields, add_fields_to_record_type,
1729         add_enum_fields_to_record_type, sorted_fields_type_new,
1730         insert_into_classtype_sorted_fields,
1731         insert_late_enum_def_into_classtype_sorted_fields): Move to ...
1732         * name-lookup.h (count_fields, add_fields_to_record_type,
1733         add_enum_fields_to_record_type, sorted_fields_type_new,
1734         set_class_bindings, insert_late_enum_def_bindings): ... here.
1736 2017-08-25  Nathan Sidwell  <nathan@acm.org>
1738         * class.c (method_name_cmp, resort_method_name_cmp): Methods
1739         can never be NULL.
1741         Conversion operators have a special name
1742         * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
1743         (conv_op_marker, conv_op_identifier): New.
1744         (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
1745         * decl.c (initialize_predefined_identifiers): Add
1746         conv_op_identifier.
1747         (cxx_init_decl_processing): Create conv_op_marker.
1748         * decl2.c (check_classfn): Lookup conv-ops by name.
1749         * class.c (add_method): Use conv_op_identifier & conv_op_marker.
1750         (resort_type_method_vec): Don't skip conv-ops.
1751         (finish_struct_methods, warn_hidden): Likewise.
1752         * name-lookup.h (lookup_all_conversions): Delete.
1753         * name-lookup.c (lookup_conversion_operator): Replace with ...
1754         (extract_conversion_operator): ... this.
1755         (lookup_fnfields_slot_nolazy): Find conv-ops by name.
1756         (lookup_all_conversions): Delete.
1757         * pt.c (check_explicit_specialization): Find conv-ops by name.
1758         * search.c (lookup_conversions_r): Likewise.
1760 2017-08-24  Nathan Sidwell  <nathan@acm.org>
1762         Conversion operators kept on single overload set
1763         * class.c (add_method): Keep all conv-ops on one slot.
1764         * name-lookup.c (lookup_conversion_operator): Pull the desired
1765         conv op out of overload set.
1766         * search.c (lookup_conversions_r): Lose template/non-template
1767         distinction.
1768         (lookup_conversions): Likewise.
1770 2017-08-23  Nathan Sidwell  <nathan@acm.org>
1772         * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
1773         lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
1774         declatations to ...
1775         * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
1776         lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
1777         * search.c (lookup_conversion_operator,
1778         lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1779         lookup_all_conversions): Move to ...
1780         * name-lookup.c (lookup_conversion_operator,
1781         lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1782         lookup_all_conversions): ... here.
1784         * semantics.c (finish_member_declaration): Move USING_DECL check
1785         earlier.  Always set C++ linkage.  Commonize TYPE_FIELD and
1786         template decl list insertion.
1788         * cp-tree.h (maybe_version_functions): Declare.
1789         * decl.c (decls_match): Break function versioning check to
1790         separate function.  Call it.
1791         (maybe_version_functions): Broken out of decls_match.
1792         * class.c (add_method): Use maybe_version_functions.
1794         * cp-tree.h (print_search_statistics,
1795         reinit_search_statistics): Don't declare.
1796         * search.c (n_fields_searched, n_calls_lookup_field,
1797         n_calls_lookup_field_1, n_calls_lookup_fnfields,
1798         n_calls_lookup_fnfields_1, n_calls_get_base_type,
1799         n_outer_fields_searched, n_contexts_saved): Delete.
1800         (lookup_field_1, lookup_member,
1801         lookup_fnfields_slot_nolazy): Remove stat gathering.
1802         (print_search_statistics, reinit_search_statistics): Delete.
1803         * tree.c (cxx_print_statistics): Don't print search stats.
1805 2017-08-21  Nathan Sidwell  <nathan@acm.org>
1807         * search.c (lookup_field_r): Remove obsolete code for type-named
1808         field in PoD.
1810         * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
1811         isn't special.
1812         (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
1813         (lookup_field_fuzzy_r): Adjust.
1815 2017-08-21  David Malcolm  <dmalcolm@redhat.com>
1817         * call.c (build_over_call): Pass NULL for new parameter to
1818         check_function_arguments.
1819         * typeck.c (cp_build_function_call_vec): Likewise.
1821 2017-08-21  Nathan Sidwell  <nathan@acm.org>
1823         PR c++/81899
1824         * pt.c (instantiate_class_template_1):
1825         BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
1827 2017-08-18  David Malcolm  <dmalcolm@redhat.com>
1829         PR c++/81514
1830         * name-lookup.c (maybe_suggest_missing_header): Convert return
1831         type from void to bool; return true iff a suggestion was offered.
1832         (suggest_alternative_in_explicit_scope): Move call to
1833         maybe_suggest_missing_header to before use of best_match, and
1834         return true if the former offers a suggestion.
1836 2017-08-18  H.J. Lu  <hongjiu.lu@intel.com>
1838         PR c/53037
1839         * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
1840         * decl2.c (grokbitfield): Don't allow bit-field with
1841         warn_if_not_aligned type.
1843 2017-08-17  Nathan Sidwell  <nathan@acm.org>
1845         * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
1846         * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
1847         (TYPE_TEMPLATE_INFO): Simplify.
1848         (SET_TYPE_TEMPLATE_INFO): Simplify.
1850         * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
1851         don't need lang_type.
1852         (cxx_make_type): Use maybe_add_lang_type_raw return value.
1853         * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
1854         TYPE_LANG_SPECIFIC.
1856         * cp-tree.h (struct lang_type): Remove template_info field.
1857         (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
1858         (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
1860 2017-08-14  Martin Sebor  <msebor@redhat.com>
1862         PR c/81117
1863         * error.c (cp_printer): Handle 'G'.
1865 2017-08-11  Martin Liska  <mliska@suse.cz>
1867         * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
1868         TARGET_SUPPORTS_ALIASES.
1869         (handle_tls_init): Likewise.
1870         (note_mangling_alias): Likewise.  Remove ATTRIBUTE_UNUSED for
1871         both arguments.
1872         * optimize.c (can_alias_cdtor): Likewise.
1874 2017-08-11  Jason Merrill  <jason@redhat.com>
1876         PR c++/81671 - nullptr_t template parameter
1877         * pt.c (convert_nontype_argument): Fix nullptr_t check.
1879 2017-08-10  Jason Merrill  <jason@redhat.com>
1881         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1882         * method.c (synthesized_method_walk): Don't diagnose lack of
1883         operator delete.
1885         PR c++/80452 - Core 1579, implicit move semantics on return/throw
1886         * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
1887         tentatively changed the lvalue to an rvalue.
1888         * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
1889         (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
1890         parameter is an rvalue reference.
1891         * except.c (build_throw): Do maybe-rvalue overload resolution twice.
1892         * typeck.c (check_return_expr): Likewise.
1894 2017-08-10  David Malcolm  <dmalcolm@redhat.com>
1896         * parser.c (cp_parser_error): Update for new param to
1897         c_parse_error.
1898         (class token_pair): New class.
1899         (struct matching_paren_traits): New struct.
1900         (matching_parens): New typedef.
1901         (struct matching_brace_traits): New struct.
1902         (matching_braces): New typedef.
1903         (cp_parser_statement_expr): Convert explicit parsing of
1904         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
1905         class matching_parens, so that the pertinent open parenthesis is
1906         highlighted when there are problems locating the close
1907         parenthesis.
1908         (cp_parser_primary_expression): Likewise.
1909         (cp_parser_compound_literal_p): Remove consumption of opening
1910         paren.
1911         (cp_parser_postfix_expression): Convert explicit parsing of
1912         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
1913         above.  Use it to consume the opening paren previously consumed by
1914         cp_parser_compound_literal_p.
1915         (cp_parser_parenthesized_expression_list): Likewise.
1916         (cp_parser_unary_expression): Likewise.
1917         (cp_parser_new_expression): Likewise.
1918         (cp_parser_cast_expression): Likewise.
1919         (cp_parser_builtin_offsetof): Likewise.
1920         (cp_parser_trait_expr): Likewise.
1921         (cp_parser_lambda_declarator_opt): Likewise.
1922         (cp_parser_lambda_body): Likewise, for matching_braces.
1923         (cp_parser_compound_statement): Likewise.
1924         (cp_parser_selection_statement): Likewise, for matching_parens.
1925         (cp_parser_iteration_statement): Likewise.
1926         (cp_parser_already_scoped_statement): Likewise, for
1927         matching_braces.
1928         (cp_parser_linkage_specification): Likewise.
1929         (cp_parser_static_assert): Likewise, for matching_parens.
1930         (cp_parser_decltype): Likewise.
1931         (cp_parser_operator): Likewise.
1932         (cp_parser_enum_specifier): Likewise.
1933         (cp_parser_namespace_definition): Likewise.
1934         (cp_parser_direct_declarator): Likewise.
1935         (cp_parser_braced_list): Likewise.
1936         (cp_parser_class_specifier_1): Likewise, for matching_braces.
1937         (cp_parser_constant_initializer): Likewise.
1938         (cp_parser_noexcept_specification_opt): Likewise, for
1939         matching_parens.
1940         (cp_parser_exception_specification_opt): Likewise.
1941         (cp_parser_handler): Likewise.
1942         (cp_parser_asm_specification_opt): Likewise.
1943         (cp_parser_asm_operand_list): Likewise.
1944         (cp_parser_gnu_attributes_opt): Likewise.
1945         (cp_parser_std_attribute_spec): Likewise.
1946         (cp_parser_requirement_parameter_list): Likewise.
1947         (cp_parser_requirement_body): Likewise, for matching_braces.
1948         (cp_parser_compound_requirement): Likewise.
1949         (cp_parser_template_introduction): Likewise.
1950         (cp_parser_sizeof_pack): Likewise, for matching_parens.
1951         (cp_parser_sizeof_operand): Likewise; use it to consume the
1952         opening paren previously consumed by cp_parser_compound_literal_p.
1953         (get_matching_symbol): New function.
1954         (cp_parser_required_error): Add param "matching_location".  Remove
1955         calls to cp_parser_error, instead setting a non-NULL gmsgid, and
1956         handling it if set by calling c_parse_error, potentially with a
1957         secondary location if matching_location was set.
1958         (cp_parser_require): Add param "matching_location", with a default
1959         value of UNKNOWN_LOCATION.
1960         (cp_parser_require_keyword): Update for new param of
1961         cp_parser_required_error.
1962         (cp_parser_objc_encode_expression): Update to class matching_parens
1963         as above.
1964         (cp_parser_objc_defs_expression): Likewise.
1965         (cp_parser_objc_protocol_expression): Likewise.
1966         (cp_parser_objc_selector_expression): Likewise.
1967         (cp_parser_objc_typename): Likewise.
1968         (cp_parser_objc_superclass_or_category): Likewise.
1969         (cp_parser_objc_try_catch_finally_statement): Likewise.
1970         (cp_parser_objc_synchronized_statement): Likewise.
1971         (cp_parser_objc_at_property_declaration): Likewise.
1972         (cp_parser_oacc_single_int_clause): Likewise.
1973         (cp_parser_oacc_shape_clause): Likewise.
1974         (cp_parser_omp_clause_collapse): Likewise.
1975         (cp_parser_omp_clause_default): Likewise.
1976         (cp_parser_omp_clause_final): Likewise.
1977         (cp_parser_omp_clause_if): Likewise.
1978         (cp_parser_omp_clause_num_threads): Likewise.
1979         (cp_parser_omp_clause_num_tasks): Likewise.
1980         (cp_parser_omp_clause_grainsize): Likewise.
1981         (cp_parser_omp_clause_priority): Likewise.
1982         (cp_parser_omp_clause_hint): Likewise.
1983         (cp_parser_omp_clause_defaultmap): Likewise.
1984         (cp_parser_omp_clause_ordered): Likewise.
1985         (cp_parser_omp_clause_schedule): Likewise.
1986         (cp_parser_omp_clause_num_teams): Likewise.
1987         (cp_parser_omp_clause_thread_limit): Likewise.
1988         (cp_parser_omp_clause_aligned): Likewise.
1989         (cp_parser_omp_clause_linear): Likewise.
1990         (cp_parser_omp_clause_safelen): Likewise.
1991         (cp_parser_omp_clause_simdlen): Likewise.
1992         (cp_parser_omp_clause_depend): Likewise.
1993         (cp_parser_omp_clause_device): Likewise.
1994         (cp_parser_omp_clause_dist_schedule): Likewise.
1995         (cp_parser_oacc_clause_async): Likewise.
1996         (cp_parser_omp_critical): Likewise.
1997         (cp_parser_omp_for_loop): Likewise.
1998         (cp_parser_omp_sections_scope): Likewise.
1999         (cp_parser_omp_declare_reduction_exprs): Likewise.
2000         Update for new param to cp_parser_required_error.
2001         (cp_parser_oacc_routine): Likewise.
2002         (cp_parser_transaction_expression): Likewise.
2003         (cp_parser_cilk_simd_vectorlength): Likewise.
2005 2017-08-09  Jason Merrill  <jason@redhat.com>
2007         PR c++/81525 - wrong constant value with generic lambda
2008         * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
2009         (tsubst_copy) [VAR_DECL]: Handle auto.
2011         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
2012         * init.c (get_nsdmi): Add complain parm.
2013         * typeck2.c (digest_nsdmi_init): Add complain parm.
2014         (process_init_constructor_record): Pass complain to get_nsdmi.
2015         * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
2016         * method.c (get_defaulted_eh_spec): Add complain parm.  Pass it into
2017         synthesized_method_walk.
2018         (synthesized_method_walk): Adjust.
2019         (walk_field_subobs): Pass complain to get_nsdmi.
2020         (defaulted_late_check): Skip other checks if deleted.
2021         * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
2022         * call.c (build_aggr_conv): Pass complain to get_nsdmi.
2023         * parser.c (defarg_location): New.
2024         * error.c (location_of): Use it.
2026 2017-08-09  Marek Polacek  <polacek@redhat.com>
2028         * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
2029         * typeck.c (build_binary_op): Change the type of a parameter to bool.
2030         (cp_truthvalue_conversion): Use true instead of 1.
2032 2017-08-08  Marek Polacek  <polacek@redhat.com>
2034         PR c++/81607
2035         * cp-gimplify.c (cp_fold): If folding exposed a branch of
2036         a COND_EXPR, convert it to the original type of the COND_EXPR, if
2037         they differ.               
2039 2017-08-08  Martin Liska  <mliska@suse.cz>
2041         * call.c: Include header files.
2042         * cp-gimplify.c: Likewise.
2043         * cp-ubsan.c: Likewise.
2044         * cvt.c: Likewise.
2045         * init.c: Likewise.
2046         * search.c: Likewise.
2047         * semantics.c: Likewise.
2048         * typeck.c: Likewise.
2050 2017-08-07  Martin Liska  <mliska@suse.cz>
2052         * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
2053         attribute.
2054         (cp_parser_std_attribute): Likewise.
2055         * tree.c: Add new include.
2057 2017-08-04  Paolo Carlini  <paolo.carlini@oracle.com>
2059         PR c++/79790
2060         * pt.c (do_class_deduction): Handle the case of no viable implicit
2061         deduction guides; simplify the code generating implicit deduction
2062         guides.
2064 2017-08-03  Paolo Carlini  <paolo.carlini@oracle.com>
2066         PR c++/71440
2067         * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
2068         destructor as expressions.
2070 2017-08-02  Jakub Jelinek  <jakub@redhat.com>
2072         PR c++/81640
2073         * call.c (build_user_type_conversion_1): Only call
2074         lookup_fnfields_slot if totype is CLASS_TYPE_P.
2076 2017-07-31  Jason Merrill  <jason@redhat.com>
2078         * decl.c (declare_global_var): Set DECL_CONTEXT.
2080 2017-07-31  Jan Hubicka <hubicka@ucw.cz>
2081             Martin Liska  <mliska@suse.cz>
2083         * pt.c (tsubst_copy): Copy PREDICT_EXPR.
2084         * semantics.c (finish_goto_stmt): Build gimple predict
2085         stament.
2086         * constexpr.c (potential_constant_expression_1): Handle
2087         PREDICT_EXPR.
2089 2017-07-31  Martin Liska  <mliska@suse.cz>
2091         PR sanitize/81530
2092         * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
2093         also with current_function_decl non-null equality.
2094         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2095         * decl.c (compute_array_index_type): Likewise.
2096         * init.c (finish_length_check): Likewise.
2097         * typeck.c (cp_build_binary_op): Likewise.
2099 2017-07-29  Jakub Jelinek  <jakub@redhat.com>
2101         * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
2102         DW_AT_export_symbols.
2103         * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
2104         argument, pass it through to the debug hook.
2105         (finish_namespace_using_directive): Adjust
2106         emit_debug_info_using_namespace caller.
2107         (push_namespace): Likewise.  Call it after setting
2108         DECL_NAMESPACE_INLINE_P.
2109         (cp_emit_debug_info_for_using): Pass false as new argument to
2110         the imported_module_or_decl debug hook.
2112 2017-07-28  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
2114         * lex.c (copy_decl): Adjust.
2115         (copy_type): Likewise.
2117 2017-07-26  Paolo Carlini  <paolo.carlini@oracle.com>
2119         PR c++/71570
2120         * lambda.c (add_capture): Early return if we cannot capture by
2121         reference.
2123 2017-07-26  Jason Merrill  <jason@redhat.com>
2125         P0702R1 - List deduction of vector.
2126         * pt.c (do_class_deduction): Special-case deduction from a single
2127         element of related type.
2129 2017-07-26  Leonid Koppel  <lkoppel@uwaterloo.ca>
2131         PR c++/67054 - Inherited ctor with non-default-constructible members
2132         * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
2133         when deducing an inheriting constructor.
2135 2017-07-21  Nathan Sidwell  <nathan@acm.org>
2137         * search.c (lookup_conversion_operator): Return overloads.
2138         (lookup_fnfields_idx_nolazy): Absorb into ...
2139         (lookup_fnfields_slot_nolaxy): ... here.
2140         (lookup_fnfields_1): Absorb into ...
2141         (lookup_fnfields_slot): ... here.
2143         Remove special CDtor METHOD_VEC slots.
2144         * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
2145         CLASSTYPE_DESTRUCTOR_SLOT): Delete.
2146         (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
2147         (CLASSTYPE_DESTRUCTOR): Likewise.
2148         * class (add_method): Don't use special cdtor slots.
2149         * search.c (lookup_fnfields_idx_nolazy): Likewise.
2150         (look_for_overrides_here): Use lookup_fnfields_slot.
2151         * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
2153         * call.c (add_candidates): Move decls to initialization.  Don't
2154         use !!.
2156 2017-07-20  Nathan Sidwell  <nathan@acm.org>
2158         Remove TYPE_METHODS.
2159         * class.c (maybe_warn_about_overly_private_class,
2160         finish_struct_methods, one_inheriting_sig, count_fields,
2161         add_fields_to_record_type, check_field_decls, check_methods,
2162         clone_function_decl, set_method_tm_attributes,
2163         finalize_literal_type_property, check_bases_and_members,
2164         create_vtable_ptr, determine_key_method,
2165         unreverse_member_declarations, finish_struct,
2166         add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
2167         * decl.c (fixup_anonymous_aggr): Likewise.
2168         * decl2.c (reset_type_linkage_2): Likewise.
2169         * method.c (after_nsdmi_defaulted_late_checks,
2170         lazily_declare_fn): Likewise.
2171         * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
2172         * pt.c (instantiate_class_template_1, tsubst_expr,
2173         do_type_instantiation, instantiate_pending_templates): Likewise.
2174         * search.c (lookup_field_1): Likewise.
2175         * semantics.c (finish_member_declaration,
2176         finish_omp_declare_simd_methods): Likewise.
2178 2017-07-19  Nathan Sidwell  <nathan@acm.org>
2180         * class.c (add_implicitly_declared_members): Use
2181         classtype_has_move_assign_or_move_ctor_p.
2182         (classtype_has_move_assign_or_move_ctor,
2183         classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
2184         (classtype_has_move_assign_or_move_ctor_p): ... this new function.
2185         * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
2186         Replace with ...
2187         (classtype_has_move_assign_or_move_ctor_p): ... this.
2188         * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
2189         * tree.c (type_has_nontrivial_copy_init): Adjust.
2191         * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
2192         PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
2194 2017-07-18  Nathan Sidwell  <nathan@acm.org>
2196         * cp-array-notation.c (build_array_notation_ref): Use
2197         TYPE_{MIN,MAX}_VALUE.
2199         * class.c (classtype_has_move_assign_or_move_ctor): Declare.
2200         (add_implicitly_declared_members): Use it.
2201         (type_has_move_constructor, type_has_move_assign): Merge into ...
2202         (classtype_has_move_assign_or_move_ctor): ... this new function.
2203         * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
2205 2017-07-17  Volker Reichelt  <v.reichelt@netcologne.de>
2207         * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
2208         friend outside class and obsolete auto as storage-class-specifier.
2210 2017-07-17  Nathan Sidwell  <nathan@acm.org>
2212         * class.c (maybe_warn_about_overly_private_class): Ignore public
2213         copy ctors.
2215         * class.c (type_has_user_declared_move_constructor,
2216         type_has_user_declared_move_assign): Combine into ...
2217         (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
2218         * cp-tree.h (type_has_user_declared_move_constructor,
2219         type_has_user_declared_move_assign): Combine into ...
2220         (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
2221         * method.c (maybe_explain_implicit_delete): Use it.
2222         (lazily_declare_fn): Use it.
2223         * tree.c (type_has_nontrivial_copy_init): Use it.
2225         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
2226         semantics, simplify implementation.
2228 2017-07-16  Volker Reichelt  <v.reichelt@netcologne.de>
2230         * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
2231         in old-style cast diagnostic.
2232         * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
2233         in useless cast diagnostic.
2234         * error.c (type_to_string): Remove enum special handling.
2236 2017-07-14  David Malcolm  <dmalcolm@redhat.com>
2238         * name-lookup.c (get_std_name_hint): Add '<' and '>' around
2239         the header names.
2240         (maybe_suggest_missing_header): Update for addition of '<' and '>'
2241         to above.  Provide a fix-it hint.
2242         * pt.c: Include "gcc-rich-location.h"
2243         (listify): Attempt to add fix-it hint for missing
2244         #include <initializer_list>.
2245         * rtti.c: Include "gcc-rich-location.h".
2246         (typeid_ok_p): Attempt to add fix-it hint for missing
2247         #include <typeinfo>.
2249 2017-07-12  Jason Merrill  <jason@redhat.com>
2251         P0512R0 - Deduction from an initializer list.
2252         * pt.c (do_class_deduction): Do list deduction in two phases.
2254 2017-07-12  Nathan Sidwell  <nathan@acm.org>
2256         * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
2257         DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
2258         identifier flags.
2259         * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
2260         DECL_CXX_DESTRUCTOR explicitly.
2261         * decl2.c (grokclassfn): Likewise.
2262         * friend.c (do_friend): Likewise.
2263         * method.c (make_thunk, make_alias_for,
2264         implicitly_declare_fn): Likewise.
2266 2017-07-11  Jason Merrill  <jason@redhat.com>
2268         Core DR 393
2269         * decl.c (grokparms): Downgrade error about array of unknown bound
2270         to pedwarn and disable it for C++17.
2272 2017-07-11  Nathan Sidwell  <nathan@acm.org>
2274         * decl2.c (reset_type_linkage_2): Dont't change ctor name.
2276 2017-07-10  Martin Sebor  <msebor@redhat.com>
2278         * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
2280 2017-07-06  Jason Merrill  <jason@redhat.com>
2282         PR c++/81204 - parse error with dependent template-name
2283         * parser.c (cp_parser_lookup_name): Revert previous change.
2285 2017-07-06  David Malcolm  <dmalcolm@redhat.com>
2287         * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
2288         selftest::run_cp_tests.
2289         (selftest::run_cp_tests): New function.
2290         * cp-tree.h (selftest::run_cp_tests): New decl.
2292 2017-07-04  Jakub Jelinek  <jakub@redhat.com>
2294         * parser.c (cp_parser_decomposition_declaration): Replace
2295         decomposition declaration with structured binding in diagnostics.
2296         * decl.c (cp_finish_decomp): Likewise.
2297         (grokdeclarator): Likewise.
2299         PR c++/81258
2300         * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
2301         forms of structured binding initializers.
2303 2017-07-03  Paolo Carlini  <paolo.carlini@oracle.com>
2305         PR c++/65775
2306         * decl.c (grokdeclarator): Move checks on function return type after
2307         the splice_late_return_type call; if declspecs->locations[ds_type_spec]
2308         is UNKNOWN_LOCATION fall back to input_location.
2310 2017-07-03  David Malcolm  <dmalcolm@redhat.com>
2312         * parser.c (enum required_token): Fix spelling of
2313         RT_INTERATION to RT_ITERATION.
2314         (cp_parser_iteration_statement): Likewise.
2315         (cp_parser_required_error): Likewise.
2317 2017-06-30  Jason Merrill  <jason@redhat.com>
2319         PR c++/81257 - ICE with invalid ::template.
2320         PR c++/54769 - wrong lookup of dependent template-name.
2321         * parser.c (cp_parser_template_name): Revert part of last change.
2323 2017-06-30  Nathan Sidwell  <nathan@acm.org>
2325         * config-lang.in (gtfiles): Add cp/lex.c.
2326         * cp-tree.h (mangle_convop_name_for_type): Rename ...
2327         (make_conv_op_name): ... here.  Move to lex.
2328         * lambda.c (maybe_add_lambda_conv_op): Update.
2329         * parser.c (cp_parser_conversion_function_id): Update.
2330         * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
2331         tsubst_copy_and_build): Update.
2332         * semantics.c (apply_deduced_return_type): Update.
2333         * mangle.c (conv_type_hasher, conv_type_names,
2334         mangle_conv_op_name_for_type): Move to ...
2335         * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
2336         ... here.  Rename.
2338 2017-06-30  David Malcolm  <dmalcolm@redhat.com>
2340         PR c++/80014
2341         * parser.c (cp_parser_postfix_expression): Construct a location
2342         for typeid expressions.
2344 2017-06-30  Nathan Sidwell  <nathan@acm.org>
2346         * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
2347         declare.
2348         (lookup_all_conversions): Declare.
2349         * class.c (get_basefndecls): Use lookup_fnfields_slot.
2350         * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
2351         * decl2.c (check_class_fn): Use lookup_fnfields_slot.  Rework
2352         diagnostics.
2353         * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
2354         (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
2355         lookup_all_conversions.
2356         * search.c (lookup_fnfields_1): Make static.
2357         (lookup_all_conversions): New.
2358         (class_method_index_for_fn): Delete.
2359         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
2360         lookup_fnfields_slot.
2362         * call.c (build_new_method_call_1): Use constructo_name to get
2363         ctor name.  Move argument processing earlier to merge cdtor
2364         handling blocks.
2365         * decl.c (grokfndecl): Cdtors have special names.
2366         * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
2367         * pt.c (check_explicit_specialization): Cdtor name is already
2368         special.
2369         * search.c (class_method_index_for_fn): Likewise.
2371         PR c++/81229
2372         * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
2373         a matching TYPE_DECL.
2375 2017-06-29  Paolo Carlini  <paolo.carlini@oracle.com>
2377         * class.c (add_method): Change pair of errors to error + inform.
2378         (handle_using_decl): Likewise.
2380 2017-06-29  Jason Merrill  <jason@redhat.com>
2382         * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
2384         PR c++/81180 - ICE with C++17 deduction of member class template.
2385         * pt.c (build_deduction_guide): Correct member template handling.
2387         PR c++/81188 - matching decltype of member function call.
2388         * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
2390 2017-06-29  Nathan Sidwell  <nathan@acm.org>
2392         PR c++/81247
2393         * parser.c (cp_parser_namespace_definition): Immediately close the
2394         namespace if there's no open-brace.
2395         * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
2396         namespace.
2398 2017-06-29  Jason Merrill  <jason@redhat.com>
2400         PR c++/81164 - ICE with invalid inherited constructor.
2401         * search.c (binfo_direct_p): New.
2402         * name-lookup.c (do_class_using_decl): Use it.
2404 2017-06-29  Nathan Sidwell  <nathan@acm.org>
2406         * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
2407         VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
2408         * decl.c (initialize_predefined_identifiers): Name cdtor special
2409         names consistently.  Use literals for above deleted defines.
2410         (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
2412         * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
2413         flag.
2415         * call.c (check_dtor_name): Use constructor_name for enums too.
2416         (build_new_method_call_1): Use constructor_name for cdtors and
2417         show ~ for dtor.
2418         * class.c (build_self_reference): Use TYPE_NAME to get name of
2419         self reference.
2420         * name-lookup (constructor_name): Use DECL_NAME directly.
2421         (constructor_name_p): Reimplement.
2422         (push_class_level_binding_1): Use TYPE_NAME directly.
2424         * class.c (finish_struct): Use OVL_P.
2425         (get_vfield_name): Measure constructor_name length.
2426         * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
2427         (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
2428         * cxx-pretty-print.c (is_destructor_name): Delete.
2429         (pp_cxx_unqualified_id): Remove bogus destructor name checking.
2430         * decl.c (grokfndecl): Move cheap checks first when looking for
2431         implicit extern cness.
2433         * parser.c (cp_parser_direct_declarator): Reorder if to avoid
2434         indentation. Remove unnecessary assignment of constructor name.
2436         Whitespace cleanups.
2437         * call.c (name_as_c_string): Move CONST_CAST to return.
2438         (build_new_method_call_1): Remove unneeded bracing.
2439         * class.c (include_empty_classes): Unbreak line.
2440         * constraint.cc (tsubst_check_constraint): Add space.
2441         * cp-tree.h (lang_decl_ns): Add comment.
2442         (PTRMEM_CST_MEMBER): Break line.
2443         * decl.c (grokfndecl): Add blank lines. Unbreak some others.
2444         (grokdeclarator): Remove lines, move declaration to first use.
2445         * decl2.c (decl_needed_p): Fix indentation.
2446         (c_parse_final_cleanups): Remove blank line.
2447         * method.c (implicitly_declare_fn): Move declaration to first use.
2448         * search.c (current_scope): Add blank lines.
2450 2017-06-28  Jason Merrill  <jason@redhat.com>
2452         PR c++/72764 - ICE with invalid template typename.
2453         * decl.c (build_typename_type): No longer static.
2454         * tree.c (strip_typedefs): Use it instead of make_typename_type.
2456         PR c++/69300 - ICE with self-referential noexcept
2457         * pt.c (maybe_instantiate_noexcept): Check for recursion.
2459         PR c++/61022 - error with variadic template template parm
2460         * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
2462         PR c++/72801 - ICE with variadic partial specialization
2463         * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
2465         PR c++/55639 - partial specialization with ::template
2466         * parser.c (cp_parser_class_head): Handle ::template.
2468         PR c++/45976 - error with ::template in declarator.
2469         * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
2471         PR c++/54769 - wrong lookup of dependent template-name.
2472         * parser.c (cp_parser_template_name): Handle dependent object type.
2473         (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
2474         parameter.
2475         (cp_parser_id_expression): Pass it.
2476         (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
2478         * parser.c (cp_parser_template_id): Use the range location on the
2479         TEMPLATE_ID_EXPR.
2481         PR c++/81204 - parse error with dependent template-name
2482         * parser.c (cp_parser_lookup_name): Disqualify function templates
2483         after lookup.
2485 2017-06-27  Nathan Sidwell  <nathan@acm.org>
2487         * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
2488         initialization point.  Don't unnecessarily check for ctor name.
2490         * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
2491         (CLASSTYPE_DESTRUCTOR): ... this.
2492         * class.c (accessible_nvdtor_p,
2493         maybe_warn_about_overly_private_class,
2494         add_implicitly_declared_members,
2495         clone_constructors_and_destructors, type_has_virtual_destructor):
2496         Adjust for CLASSTYPE_DESTRUCTOR.
2497         (deduce_noexcept_on_destructors): Absorb into ...
2498         (check_bases_and_members): ... here.
2499         * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
2500         * init.c (build_delete): Likewise.
2501         * parser.c (cp_parser_lookup_name): Likewise.
2502         * pt.c (check_explicit_specialization): Likewise.
2503         * rtti.c (emit_support_tinfos): Likewise.
2504         * search.c (lookup_fnfields_idx_nolazy): Likewise.
2506         Kill IDENTIFIER_TEMPLATE.
2507         * cp-tree.h (lang_identifier): Remove class_template_info field.
2508         (IDENTIFIER_TEMPLATE): Delete.
2509         * name-lookup.c (constructor_name_full): Subsume into ...
2510         (constructor_name): ... here.  Don't check IDENTIFIER_TEMPLATE.
2511         (constructor_name_p): Likewise.
2512         * mangle.c (write_source_name): Likewise.
2513         * ptree.c (cxx_print_identifier): Likewise.
2515 2017-06-27  Marek Polacek  <polacek@redhat.com>
2517         PR bootstrap/81216
2518         * parser.c (cp_parser_already_scoped_statement): Initialize
2519         LOC_AFTER_LABELS.
2521 2017-06-26  Jason Merrill  <jason@redhat.com>
2523         PR c++/81215 - deduction failure with variadic TTP.
2524         * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
2526 2017-06-26  Martin Sebor  <msebor@redhat.com>
2528         PR c++/81169
2529         * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
2530         to detect casting away cv-qualifiers.
2532 2017-06-26  Nathan Sidwell  <nathan@acm.org>
2534         * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
2535         (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
2536         identifier.
2537         (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
2538         DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
2539         (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
2540         * decl.c (grok_op_properties): Adjust identifier checking.
2541         * init.c (expand_default_init): Adjust identifier descision.
2542         * method.c (implicitly_declare_fn): Don't use
2543         DECL_ASSIGNMENT_OPERATOR_P.
2544         * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
2545         IDENTIFIER_DTOR_P.
2546         * call.c (in_charge_arg_for_name): Reimplement.
2547         (build_special_member_call): Use IDENTIFIER_CDTOR_P,
2548         IDENTIFIER_DTOR_P.
2550 2017-06-26  Marek Polacek  <polacek@redhat.com>
2552         PR c/80116
2553         * parser.c (cp_parser_statement): Add a default argument.  Save the
2554         location of the expression-statement after labels have been parsed.
2555         (cp_parser_implicitly_scoped_statement): Set the location of the
2556         body of the conditional after parsing all the labels.  Call
2557         warn_for_multistatement_macros.
2558         (cp_parser_already_scoped_statement): Likewise.
2560 2017-06-24  Paolo Carlini  <paolo.carlini@oracle.com>
2562         PR c++/62315
2563         * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
2564         'typename' in error messages about missing 'typename'.
2566 2017-06-23  Jason Merrill  <jason@redhat.com>
2568         PR c++/79056 - C++17 ICE with invalid template syntax.
2569         * parser.c (cp_parser_simple_type_specifier): Don't assume that type
2570         is a TYPE_DECL.
2571         (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
2572         * pt.c (template_placeholder_p): New.
2573         * cp-tree.h: Declare it.
2575 2017-06-23  Marc Glisse  <marc.glisse@inria.fr>
2577         * decl.c (duplicate_decls): Use builtin_structptr_types.
2579 2017-06-22  Nathan Sidwell  <nathan@acm.org>
2581         Reorder IDENTIFIER flags
2582         gcc/cp/
2583         * cp-tree.h (enum cp_identifier_kind): New.
2584         (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
2585         IDENTIFIER_KIND_BIT_2): New.
2586         (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
2587         (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
2588         (C_IS_RESERVED_WORD): Replace with ...
2589         (IDENTIFIER_KEYWORD_P): ... this.
2590         (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
2591         (IDENTIFIER_CDTOR_P): ... this.
2592         (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
2593         (IDENTIFIER_OPNAME_P): Replace with ...
2594         (IDENTIFIER_ANY_OP_P): ... this.
2595         (IDENTIFIER_ASSIGN_OP_P): New.
2596         (IDENTIFIER_TYPENAME_P): Replace with ...
2597         (IDENTIFIER_CONV_OP_P): ... this.
2598         (NEW_DELETE_OPNAME_P): Replace with ...
2599         (IDENTIFIER_NEWDEL_OP_P): ... this.
2600         (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
2601         (get_identifier_kind_name, set_identifier_kind): Declare.
2602         * lex.c (get_identifier_kind_name, set_identifier_kind): New.
2603         (init_operators): Adjust to avoid keywords, use
2604         set_identifier_kind. Copy TYPE_EXPR slot.
2605         (init_reswords): Call set_identifier_kind.
2606         (unqualified_name_lookup_error): Adjust.
2607         * operators.def (TYPE_EXPR): Remove.
2608         * decl.c (struct predefined_identifier): Move into ...
2609         (initialize_predefined_identifiers): ... here.  Call
2610         set_identifier_kind.
2611         (grokfndecl, check_var_type, grokdeclarator): Adjust.
2612         (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
2613         space.  Adjust.
2614         * call.c (name_as_c_string): Adjust.
2615         (build_new_method_call_1): Likewise.
2616         * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
2617         * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
2618         * dump.c (cp_dump_tree): Adjust.
2619         * error.c (dump_decl_name): Adjust.
2620         * mangle.c (write_unqualified_id, write_member_name,
2621         write_expression): Adjust.
2622         (mangle_conv_op_name_for_type): Use set_identifier_kind.
2623         * name-lookup.c (do_class_using_decl): Adjust.
2624         (lookup_name_fuzzy, lookup_name_real_1): Likewise.
2625         * parser.c (cp_lexer_get_preprocessor_token,
2626         cp_parser_direct_declarator): Likewise.
2627         * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
2628         tsubst_copy, tsubst_copy_and_build): Adjust.
2629         * ptree.c (cxx_print_identifier): Print identifier kind.
2630         * search.c (lookup_field_r, lookup_member,
2631         lookup_fnfields_idx_nolazy): Adjust.
2632         * semantics.c (finish_id_expression): Adjust..
2633         * typeck.c (cp_build_addr_expr_1): Adjust.
2635 2017-06-21  Jakub Jelinek  <jakub@redhat.com>
2637         PR c++/81154
2638         * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
2639         Complain about t not being a variable if t is OVERLOAD even
2640         when processing_template_decl.
2642 2017-06-21  David Malcolm  <dmalcolm@redhat.com>
2644         * parser.c (get_cast_suggestion): New function.
2645         (maybe_add_cast_fixit): New function.
2646         (cp_parser_cast_expression): Capture the location of the closing
2647         parenthesis.  Call maybe_add_cast_fixit when emitting warnings
2648         about old-style casts.
2650 2017-06-20  Jason Merrill  <jason@redhat.com>
2652         PR c++/80972 - C++17 ICE with attribute packed.
2653         * call.c (build_over_call): Allow a TARGET_EXPR from reference
2654         binding.
2656 2017-06-20  Nathan Sidwell  <nathan@acm.org>
2658         * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
2659         (nelts_identifier): Delete.
2660         * decl.c (initialize_predefined_identifiers): Remove nelts.
2662         PR c++/67074 - namespace aliases
2663         * decl.c (duplicate_decls): Don't error here on mismatched
2664         namespace alias.
2665         * name-lookup.c (name_lookup::add_value): Matching namespaces are
2666         not ambiguous.
2667         (diagnose_name_conflict): Namespaces are never redeclarations.
2668         (update_binding): An alias can match a real namespace.
2670 2017-06-19  Jason Merrill  <jason@redhat.com>
2672         PR c++/80562 - ICE with constexpr if.
2673         * semantics.c (finish_if_stmt_cond): Call
2674         instantiate_non_dependent_expr.
2676         PR c++/80829 - ICE with constexpr copy of base subobject.
2677         * constexpr.c (clear_no_implicit_zero): New.
2678         (cxx_eval_call_expression): Call it.
2680 2017-06-19  Nathan Sidwell  <nathan@acm.org>
2682         PR c++/81124
2683         PR c++/79766
2684         * name-lookup.c (set_decl_namespace): Don't follow using
2685         directives and ignore using decls.  Only check overly-explicit
2686         scope after discovering decl.
2688 2017-06-19  Jason Merrill  <jason@redhat.com>
2690         PR c++/81073 - constexpr and static var in statement-expression.
2691         * typeck2.c (store_init_value): Always call
2692         require_potential_constant_expression.
2693         * pt.c (convert_nontype_argument): Likewise.
2694         * constexpr.c (potential_constant_expression_1): Adjust message.
2695         Use decl_maybe_constant_var_p instead of decl_constant_var_p.
2696         * decl2.c (decl_maybe_constant_var_p): Consider initializer.
2698 2017-06-19  Nathan Sidwell  <nathan@acm.org>
2700         * pt.c (coerce_template_parms): Fix indentation.
2701         (tsubst_decl): Remove repeated SET_DECL_RTL.  Move VAR_P handling
2702         in to single block.
2704         PR c++/81119
2705         * name-lookup.c (update_binding): Only warn about constructors
2706         hidden by functions.
2708 2017-06-17  Jason Merrill  <jason@redhat.com>
2710         PR c++/60063 - -Wunused-local-typedefs and templates.
2711         * decl2.c (is_late_template_attribute): Return false for "used".
2713         PR c++/70844 - -Wuseless-cast and inheriting constructor.
2714         * method.c (forward_parm): Suppress warn_useless_cast.
2716 2017-06-16  Jason Merrill  <jason@redhat.com>
2718         PR c++/81045 - Wrong type-dependence with auto return type.
2719         * pt.c (type_dependent_expression_p): An undeduced auto outside the
2720         template isn't dependent.
2721         * call.c (build_over_call): Instantiate undeduced auto even in a
2722         template.
2724         PR c++/80465 - ICE with generic lambda with noexcept-specifier.
2725         * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
2726         set longer for a generic lambda.
2728         PR c++/80614 - Wrong mangling for C++17 noexcept type
2729         * mangle.c (write_type): Put the eh spec back on the function type.
2731         PR c++/81102 - Wrong error with partial specialization.
2732         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
2733         types.  Do type deduction later.
2735         PR c++/81074 - ICE with partial specialization of member template.
2736         PR c++/71747
2737         * pt.c (get_partial_spec_bindings): Only coerce innermost args.
2739         PR c++/80831 - ICE with -fsyntax-only.
2740         * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
2742         PR c++/80639 - ICE with invalid PMF initialization.
2743         PR c++/80043 - ICE with -fpermissive
2744         * typeck.c (convert_for_assignment): Recurse when instantiate_type
2745         returns without an error.
2747 2017-06-16  Nathan Sidwell  <nathan@acm.org>
2749         * pt.c (tsubst_baselink): Fix & clarify formatting.
2751         * cp-tree.h (build_this_parm, cp_build_parm_decl,
2752         build_artificial_parm): Add FN parm.
2753         * decl.c (start_cleanup_fn): Adjust.
2754         (build_this_parm): Add FN parm, pass it through.
2755         (grokfndecl): Adjust parm building.
2756         * decl2.c (cp_build_parm_decl): Add FN parm, set context.
2757         (build_artificial_parm): Add FN parm, pass through.
2758         (maybe_retrofit_in_chrg): Adjust parm building.
2759         (start_static_storage_duration_function): Likwise.
2760         * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
2761         * method.c (implicitly_declare_fn): Likewise.
2762         * parser.c (inject_this_parameter): Likewise.
2764         Symbol tables are insert only.
2765         * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
2766         derive from pointer_hash.  Make undeletable.
2768         * class.c (resort_type_method_vec): Avoid potential unsigned
2769         overflow.
2771         Don't defer noexcept_deferred_spec.
2772         * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
2773         * decl.c (cxx_init_decl_processing): Initialize
2774         noexcept_deferred_spec.
2775         * except.c (unevaluated_noexcept_spec): Delete.
2776         * class.c (deduce_noexcept_on_destructor): Use
2777         noexcept_deferred_spec directly.
2778         * method.c (implicitly_declare_fn): Likewise.
2780         Make keyed_classes a vector.
2781         * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
2782         (keyed_classes): Declare as vector.
2783         * decl.c (keyed_classes): Define.
2784         (cxx_init_decl_processing): Allocate it.
2785         (record_key_method_defined): Use vec_safe_push.
2786         * class.c (finish_struct_1): Likewise.
2787         * pt.c (instantiate_class_template_1): Likewise.
2788         * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
2790         Make rtti lazier
2791         * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
2792         TK_VMI_CLASS_TYPES, TK_MAX.  Delete TK_FIXED.
2793         (tinfo_names): New.
2794         (typeid_ok_p): Add quotes to error messages.  Use get_tinfo_desc.
2795         (get_tinfo_decl): Use get_tinfo_desc.
2796         (get_pseudo_ti_init): Likewise. Adjust VMI construction.
2797         (create_pseudo_type_info): Delete.
2798         (get_pseudo_ti_index): Just determine the index.
2799         (get_tinfo_desc): New.  Create all types lazily.
2800         (create_tinfo_types): Just allocate the descriptor array.
2801         (emit_support_tinfos): Use non-inserting type lookup.  Set builtin
2802         location.
2804 2017-06-15  Martin Sebor  <msebor@redhat.com>
2806         PR c++/80560
2807         * call.c (first_non_public_field, maybe_warn_class_memaccess): New
2808         functions.
2809         (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
2810         (build_cxx_call): Call maybe_warn_class_memaccess.
2812 2017-06-14  Jakub Jelinek  <jakub@redhat.com>
2814         * cp-gimplify.c (cp_genericize_r): Turn most of the function
2815         into a switch (TREE_CODE (stmt)) statement from long else if
2816         sequence.
2818 2017-06-13  Jakub Jelinek  <jakub@redhat.com>
2820         PR c++/80973
2821         * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
2822         argument even if it has REFERENCE_TYPE.
2824         PR c++/80984
2825         * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
2826         BLOCK_VARS (outer) chain.
2827         (cxx_omp_const_qual_no_mutable): Likewise.
2829 2017-06-13  Martin Liska  <mliska@suse.cz>
2831         PR sanitize/78204
2832         * class.c (build_base_path): Use sanitize_flags_p.
2833         * cp-gimplify.c (cp_genericize_r): Likewise.
2834         (cp_genericize_tree): Likewise.
2835         (cp_genericize): Likewise.
2836         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2837         * decl.c (compute_array_index_type): Likewise.
2838         (start_preparsed_function): Likewise.
2839         * decl2.c (one_static_initialization_or_destruction): Likewise.
2840         * init.c (finish_length_check): Likewise.
2841         * lambda.c (maybe_add_lambda_conv_op): Likewise.
2842         * typeck.c (cp_build_binary_op): Likewise.
2843         (build_static_cast_1): Likewise.
2845 2017-06-11  Jason Merrill  <jason@redhat.com>
2847         * error.c (dump_expr): Use is_this_parameter.
2849         * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
2850         id_equal.
2852 2017-06-09  Jason Merrill  <jason@redhat.com>
2854         Missing bits from N4268, constant evaluation for all non-type args.
2855         * call.c (build_converted_constant_expr): Rename from
2856         build_integral_nontype_arg_conv, handle all types.
2857         * pt.c (convert_nontype_argument): In C++17 call it for all types.
2858         Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
2859         * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
2861         Overhaul pointer-to-member conversion and template argument handling.
2862         * call.c (standard_conversion): Avoid creating ck_pmem when the
2863         class type is the same.
2864         * cvt.c (can_convert_qual): Split from
2865         perform_qualification_conversions.
2866         * constexpr.c (cxx_eval_constant_expression): Check it.
2867         * typeck.c (convert_ptrmem): Only cplus_expand_constant if
2868         adjustment is necessary.
2869         * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
2870         (convert_nontype_argument): Avoid redundant error.
2872         * call.c (convert_like_real): Remove "inner" parameter.
2873         Don't replace a constant with its value.
2874         * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
2876         * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
2877         nullptr_node.
2879         * parser.c (cp_parser_constant_expression): Check
2880         potential_rvalue_constant_expression after decay_conversion.
2881         * pt.c (convert_nontype_argument): Don't require linkage in C++17.
2883         PR c++/80384 - ICE with dependent noexcept-specifier
2884         * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
2885         noexcept-specifier.
2887         * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
2889 2017-06-09  Jan Hubicka  <hubicka@ucw.cz>
2891         * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
2892         * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
2893         (excpet.c): Mark terminate as cold.
2895 2017-06-08  Jakub Jelinek  <jakub@redhat.com>
2897         PR c/81006
2898         * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
2899         to sizetype before size_binop.
2901         PR c++/81011
2902         * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
2903         to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
2904         and OMP_CLAUSE_SHARED_READONLY flags.
2906 2017-06-08  Jan Hubicka  <hubicka@ucw.cz>
2908         * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
2910 2017-06-07  Nathan Sidwell  <nathan@acm.org>
2912         * class.c (layout_class_type): Restructure overlong-bitfield tpe
2913         search.
2915 2017-06-07  Jonathan Wakely  <jwakely@redhat.com>
2917         PR c++/80990
2918         * pt.c (do_class_deduction): Build qualified type.
2920 2017-06-06  Nathan Sidwell  <nathan@acm.org>
2922         * name-lookup.c (suggest_alternatives_for): Use qualified lookup
2923         sans using directives.  Don't walk into inline namespaces.
2925         PR c++/80979
2926         * name-lookup.c (adl_class_only): Don't add visible friends.
2928 2017-06-05  Volker Reichelt  <v.reichelt@netcologne.de>
2930         * parser.c (cp_parser_base_specifier): Fix typos in error messages.
2932 2017-06-02  Nathan Sidwell  <nathan@acm.org>
2934         Remove lang_type_ptrmem.
2935         * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
2936         into ...
2937         (lang_type_class): ... this.  Reorder bitfields.  Rename to ...
2938         (lang_type): ... this.  Delete old definition.
2939         (lang_type_ptrmem): Delete.
2940         (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC.  Adjust uses.
2941         (LANG_TYPE_PTRMEM_CHECK): Delete.
2942         (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
2943         (TYPE_PTRMEMFUNC_TYPE): New.  Use TYPE_LANG_SLOT_1.
2944         * decl.c (build_ptrmemfunc_type): Adjust.
2945         * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
2946         (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
2947         
2948         * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
2949         setting.
2950         
2951         Remove cp_binding_level::namespaces
2952         * name-lookup.h (cp_binding_level): Lose namespaces field.
2953         * name-lookup.c (add_decl_to_level): Chain namespaces on the names
2954         list.
2955         (suggest_alternatives_for): Adjust for namespace list.  Do
2956         breadth-first search.
2957         * decl2.c (collect_source_refs): Namespaces are on the regulr
2958         list.
2959         (collect_ada_namespace): Likewise.
2961 2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
2963         * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
2964         warning.
2966 2017-06-01  Ville Voutilainen  <ville.voutilainen@gmail.com>
2968         PR c++/80812
2969         * method.c (constructible_expr): Strip array types before calling
2970         build_value_init.
2972 2017-06-01  Paolo Carlini  <paolo.carlini@oracle.com>
2974         PR c++/80896
2975         * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
2976         for case INDIRECT_REF too in the main switch.
2978 2017-05-31  Jason Merrill  <jason@redhat.com>
2980         PR c++/80840 - ICE with constexpr and reference
2981         * pt.c (convert_nontype_argument): Don't test whether a decl is
2982         value-dependent when binding to a reference.
2984 2017-05-31  Nathan Sidwell  <nathan@acm.org>
2986         * cp-tree.h (lang_decl_slector): New enum.
2987         (lang_decl_base): Make selector an enum.  Drop decomposition_p
2988         field.
2989         (lang_decl): Use enum for discrimination.
2990         (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
2991         LANG_DECL_DEOMP_CHECK): Use enum.
2992         (DECL_DECOMPOSITION_P): Use selector value.
2993         (SET_DECL_DECOMPOSITION_P): Delete.
2994         (retrofit_lang_decl): Lose SEL parm.
2995         (fit_decomposition_lang_decl): Declare.
2996         * decl.c (cp_finish_decomp, grokdeclarator): Use
2997         fit_decomposition_lang_decl.
2998         * lex.c (maybe_add_lang_decl_raw): New. Broken out of
2999         retrofit_lang_decl.
3000         (set_decl_linkage): New.  Broken out of retrofit_lang_decl.  Use enum.
3001         (fit_decomposition_lang_decl): Likewise.
3002         (retrofit_lang_decl): Use worker functions.
3003         (cxx_dup_lang_specific_decl): Use selector enum.
3004         (maybe_add_lang_type_raw): New.  Broken out of ...
3005         (cxx_make_type_name): ... here.  Call it.
3007 2017-05-30  Jason Merrill  <jason@redhat.com>
3009         PR c++/80856 - ICE with local extern in template
3010         * semantics.c (finish_call_expr): Replace a local extern overload
3011         set in a template with the IDENTIFIER_NODE.
3013 2017-05-30  David Malcolm  <dmalcolm@redhat.com>
3015         * call.c (perform_implicit_conversion_flags): Convert
3016         "from %qT to %qT" to "from %qH to %qI" in diagnostic.
3017         (print_conversion_rejection): Replace pairs of %qT with
3018         %qH and %qI in various places.
3019         (build_user_type_conversion_1): Likewise.
3020         (build_integral_nontype_arg_conv): Likewise.
3021         (build_conditional_expr_1): Likewise.
3022         (convert_like_real): Likewise.
3023         (convert_arg_to_ellipsis): Likewise.
3024         (joust): Likewise.
3025         (initialize_reference): Likewise.
3026         * cvt.c (cp_convert_to_pointer): Likewise.
3027         (cp_convert_to_pointer): Likewise.
3028         (convert_to_reference): Likewise.
3029         (ocp_convert): Likewise.
3030         * error.c (cp_printer): Gain bool and const char ** parameters.
3031         (struct deferred_printed_type): New struct.
3032         (class cxx_format_postprocessor): New class.
3033         (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
3034         to pp->m_format_postprocessor.
3035         (comparable_template_types_p): New function.
3036         (newline_and_indent): New function.
3037         (arg_to_string): New function.
3038         (print_nonequal_arg): New function.
3039         (print_template_differences): New function.
3040         (type_to_string_with_compare): New function.
3041         (print_template_tree_comparison): New function.
3042         (append_formatted_chunk): New function.
3043         (add_quotes): New function.
3044         (cxx_format_postprocessor::handle): New function.
3045         (defer_phase_2_of_type_diff): New function.
3046         (cp_printer): Add "quoted" and "buffer_ptr" params.  Implement
3047         %H and %I.
3048         * typeck.c (cp_build_binary_op): Replace pairs of %qT with
3049         %qH and %qI in various places.
3050         (convert_member_func_to_ptr): Likewise.
3051         (build_reinterpret_cast_1): Likewise.
3052         (convert_for_assignment): Likewise.
3053         * typeck2.c (check_narrowing): Likewise.
3055 2017-05-30  Nathan Sidwell  <nathan@acm.org>
3057         Kill IDENTIFIER_NAMESPACE_BINDINGS
3058         * cp-tree.h (lang_identifier): Delete namespace_bindings.
3059         (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
3060         (lang_decl_ns): Add bindings.
3061         (DECL_NAMESPACE_BINDINGS): New.
3062         * lex.c (retrofit_lang_decl): Create namespace hash table.
3063         * name-lookup.c (find_namespace_slot): Change to use hash-map.
3064         * ptree.c (cxx_print_binding): Delete.
3065         (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
3067         * cp-tree.def (OVERLOAD): Fix comment.
3068         * cp-tree.h: Fix comments and whitespace.
3069         * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
3070         * name-lookup.c (add_decl_to_level): Assert not class.
3071         (check_local_shadow): Use OVL_P.
3072         (pushdecl_with_scope_1): Rename to ...
3073         (do_pushdecl_with_Scope): ... here.
3074         (do_nonmember_using_decl): Use qualified_namespace_lookup return
3075         value.
3076         (push_class_level_binding_1): Use OVL_P.
3077         (pushdecl_namespace_level): Use do_pushdecl_with_scope.
3078         (pushtag_1): Rename to ...
3079         (do_pushtag): ... here.  Adjust do_pushdecl_with_scope call.
3080         (pushtag): Adjust.
3081         (store_class_bindings): Do not time here.
3082         * name-lookup.h (pushdecl_outermost_localscope): Reorder.
3083         * pt.c (listify): Declare argvec at point of initialization.
3085         PR c++/80913
3086         * name-lookup.c (add_decl_to_level): Assert not making a circular
3087         chain.
3088         (update_binding): Don't prematurely slide artificial decl.
3090 2017-05-29  Alexandre Oliva <aoliva@redhat.com>
3092         * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
3094 2017-05-29  Nathan Sidwell  <nathan@acm.org>
3096         PR c++/80891 (#1,#5)
3097         * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
3098         * name-lookup.c (name_lookup): Add deduping field.
3099         (name_lookup::preserve_state, name_lookup::restore_state): Deal
3100         with deduping.
3101         (name_lookup::add_overload): New.
3102         (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
3103         (name_lookup::search_adl): Set deduping.  Don't unmark here.
3104         * pt.c (most_specialized_instantiation): Revert previous change,
3105         Assert not given duplicates.
3106         * tree.c (lookup_mark): Just mark the underlying decls.
3107         (lookup_maybe_add): Dedup using marked decls.
3109         PR c++/80891 (#4)
3110         * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
3111         * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
3113         Stat hack representation
3114         * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
3115         MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
3116         (stat_hack): New.
3117         (find_namespace_binding): Replace with ...
3118         (find_namespace_slot): ... this.
3119         (find_namespace_value): New.
3120         (name_lookup::search_namespace_only,
3121         name_lookup::adl_namespace_only): Adjust.
3122         (update_binding): Add SLOT parameter, adjust.
3123         (check_local_shadow): Use find_namespace_value.
3124         (set_local_extern_decl_linkage): Likewise.
3125         (do_pushdecl): Adjust for namespace slot.
3126         (push_local_binding): Assert not a namespace binding.
3127         (check_for_out_of_scope_variable): Use find_namespace_value.
3128         (set_identifier_type_value_with_scope): Likewise.
3129         (get_namespace_binding): Likewise.
3130         (set_namespace_binding): Delete.
3131         (set_global_binding): Directly update the binding.
3132         (finish_namespace_using_decl): Likewise.
3133         (lookup_type_scope_1): Use find_namespace_slot and update.
3134         (do_push_nested_namespace): Use find_namespace_value.
3136         PR c++/80891 (#1)
3137         * pt.c (most_specialized_instantiation): Cope with duplicate
3138         instantiations.
3140         PR c++/80891 (#3)
3141         * cp-tree.h (build_min_nt_call_vec): Declare.
3142         * decl.c (build_offset_ref_call_from_tree): Call it.
3143         * parser.c (cp_parser_postfix_expression): Likewise.
3144         * pt.c (tsubst_copy_and_build): Likewise.
3145         * semantics.c (finish_call_expr): Likewise.
3146         * tree.c (build_min_nt_loc): Keep unresolved lookups.
3147         (build_min): Likewise.
3148         (build_min_non_dep): Likewise.
3149         (build_min_non_dep_call_vec): Likewise.
3150         (build_min_nt_call_vec): New.
3152         PR c++/80891 (#2)
3153         * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
3154         (ovl_used): New.
3155         (lookup_keep): Call it.
3157 2017-05-26  Nathan Sidwell  <nathan@acm.org>
3159         Implement DR2061
3160         * name-lookup.c (push_inline_namespaces): New.
3161         (push_namespace): Look inside inline namespaces.
3163         Inline and using namespace representation change.
3164         * cp-tree.h (struct lang_decl_ns): Delete ns_using.  Add usings,
3165         inlinees as vector.
3166         (DECL_NAMESPACE_USING): Adjust.
3167         (DECL_NAMESPACE_INLINEES): New.
3168         * name-lookup.h (struct cp_binding_level): Change usings
3169         representation.
3170         * name-lookup.c (name_lookup::do_queue_usings,
3171         name_lookup::queue_usings): Adjust.
3172         (name_lookup::search_namespace, name_lookup::search_usings,
3173         name_lookup::queue_namespace): Adjust.
3174         (name_lookup::adl_namespace_only): Adjust.
3175         (add_using_namespace, push_namespace): Push onto vector.
3176         (pop_namespace): Add timing logic.
3178         * call.c (build_operator_new_call): Do namelookup and ADL here.
3179         (build_new_op_1): Likewise.
3180         * name-lookup.h (lookup_function_nonclass): Delete declaration.
3181         (do_using_directive): Likewise.
3182         * name-lookup.c (set_namespace_binding, push_local_binding): Don't
3183         declare early.
3184         (struct scope_binding): Delete.
3185         (EMPTY_SCOPE_BINDING): Delete.
3186         (set_decl_namespace): Use OVL_P.
3187         (finish_local_using_decl): Lose unnecesary checks.
3188         (lookup_function_nonclass): Delete.
3189         (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
3191         * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
3192         (ovl_iterator): Add allow_inner field.  Adjust ctor.  Make
3193         unduplicatable.
3194         (ovl_iterator::maybe_push, ovl_iterator::pop): New.
3195         (lkp_iterator): Add outer field.  Adjust ctor.
3196         (lkp_iterator::operator++): New.
3197         (lookup_mark, lookup_maybe_add): Declare.
3198         * name-lookup.c (name_lookup): Delete fn_set member.
3199         (name_lookup::preserve_state, name_lookup::restore_state): Unmark
3200         and mark lookup.
3201         (name_lookup::add_value): Use lookup_add directly.
3202         (name_lookup::add_fns: Use lookup_maybe_add.
3203         (name_lookup::search_adl): Mark and unmark fns.
3204         (pushdecl): Adjust.
3205         * pt.c (check_explicit_specialization): Use lookup_add directly.
3206         * ptree.c (cxx_print_xnode): Show complete overload structure.
3207         * tree.c (lookup_mark, lookup_maybe_add): New.
3209         * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
3211 2017-05-26  Jakub Jelinek  <jakub@redhat.com>
3213         * cp-tree.h (struct lang_decl_decomp): New type.
3214         (struct lang_decl): Add u.decomp.
3215         (LANG_DECL_DECOMP_CHECK): Define.
3216         (DECL_DECOMPOSITION_P): Note it is set also on the vars
3217         for user identifiers.
3218         (DECL_DECOMP_BASE): Define.
3219         (retrofit_lang_decl): Add extra int = 0 argument.
3220         * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
3221         use it to influence the selector choices and for selector
3222         0 to non-zero transition copy old content.
3223         (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
3224         * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
3225         !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR.  Adjust warning
3226         wording if decl is a structured binding.
3227         (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
3228         Set DECL_DECOMP_BASE.  Ignore DECL_READ_P sets from initialization
3229         of individual variables for tuple structured bindings.
3230         (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
3231         Clear DECL_DECOMP_BASE.
3232         * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
3233         * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
3234         is expected.
3235         * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
3236         DECL_VALUE_EXPR.
3238 2017-05-25  Jason Merrill  <jason@redhat.com>
3240         PR c++/80605 - __is_standard_layout and zero-length array
3241         * class.c (check_bases): Use DECL_FIELD_IS_BASE.
3243 2017-05-25  Nathan Sidwell  <nathan@acm.org>
3245         Kill OVL_CURRENT, OVL_NEXT.
3246         * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
3247         * name-lookup.c (set_decl_namespace): Use ovl_iterator.
3248         (consider_binding_level): Use OVL_FIRST.
3249         (cp_emit_debug_info_for_using): Use lkp_iterator.
3250         * pt.c (check_explicit_specialization): Use ovl_iterator.       
3252         Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
3253         * cp-tree.h (lang_decl_ns): Remove ns_users field.
3254         (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
3255         (TREE_INDIRECT_USING): Delete.
3256         * name-lookup.h (is_associated_namespace): Delete.
3257         * name-lookup.c (name_lookup::search_usings,
3258         name_lookup::do_queue_usings): Usings are always direct.
3259         (is_associated_namespace): Delete.
3260         (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
3261         (namespace_ancestor_1, namespace_ancestor): Delete.
3262         (push_using_directive_1, push_using_directive): Delete.
3263         (add_using_namespace_1): Delete.
3264         (add_using_namespace): Reimplement.
3265         (emit_debug_info_using_namespace): New.
3266         (finish_namespace_using_directive, finish_local_using_directive,
3267         push_namespace): Adjust.
3268         * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
3270 2017-05-25  Volker Reichelt  <v.reichelt@netcologne.de>
3272         * semantics.c (finish_handler_parms): Warn about non-reference type
3273         catch handlers.
3275 2017-05-25  Nathan Sidwell  <nathan@acm.org>
3277         Reimplement unqualified namespace lookup.
3278         * name-lookup.c (name_lookup::using_pair,
3279         name_lookup::using_queue): New typedefs.
3280         (name_lookup::queue_namespace, name_lookup::do_queue_usings,
3281         name_lookup::queue_usings): New.
3282         (name_lookup::search_unqualified): New.
3283         (merge_functions, same_entity_p, ambiguous_decl,
3284         unqualified_namespace_lookup_1, unqualified_namespace_lookup,
3285         lookup_using_namespace): Delete.
3286         (lookup_name_real_1): Adjust.
3288         Reimplement qualified namespace lookup.
3289         * name-lookup.c (name_lookup::flags): New member.  Adjust ctor.
3290         (name_lookup::ambiguous, name_lookup::add_value,
3291         name_lookup::add_type, name_lookup::process_binding): New.
3292         (name_lookup::search_namespace_only,
3293         name_lookup::search_namespace, name_lookup::search_usings): New.
3294         (name_lookup::search_qualified): New.
3295         (do_nonmember_using_decl, suggest_alternatives_for,
3296         lookup_qualified_name): Adjust.
3297         (tree_vec_contains): Delete.
3298         (qualified_lookup_using_namespace): Rename to ...
3299         (qualified_namespace_lookup): ... here.  Reimplement.
3301         Reimplement ADL.
3302         * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
3303         * name-lookup.h (lookup_arg_dependent): Return plain tree.
3304         * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
3305         arg_assoc_args_vec, arg_assoc_type, add_function,
3306         arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
3307         arg_assoc_class, arg_assoc_template_arg, arg_assoc,
3308         lookup_arg_dependent_1): Delete.
3309         (name_lookup): New lookup object.
3310         (name_lookup::preserve_state, name_lookup::restore_state,
3311         name_lookup::mark_seen, name_lookup::find_and_mark,
3312         name_lookup::add_fns, name_lookup::adl_namespace_only,
3313         name_lookup::adl_namespace, name_lookup::adl_class_only,
3314         name_lookup::adl_bases, name_lookup::adl_class,
3315         name_lookup::adl_expr, name_lookup::adl_type,
3316         name_lookup::adl_template_arg, name_lookup::search_adl): New.
3317         (lookup_arg_dependent): Return a plain tree.  Adjust.
3318         (is_associated_namespace): Move later.
3319         
3320 2017-05-24  Nathan Sidwell  <nathan@acm.org>
3322         * friend.c (do_friend): Remove check for existing decl.
3323         * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
3324         * name-lookup.c (push_local_binding): Directly look for binding.
3325         (lookup_name_innermost_nonclass_level_1): Delete.
3326         (lookup_name_innermost_nonclass_level): Delete.
3328         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
3330         * cp-tree.h (cp_free_lang_data): Add extern.
3331         (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
3332         ATTRIBUTE_PURE.
3333         (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
3334         * typeck.c (type_unknown_p): Delete.
3335         * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
3336         overload management.
3337         (dependent_name): Likewise.
3338         (decl_anon_ns_mem_p): Simplify.
3340 2017-05-24  Jonathan Wakely  <jwakely@redhat.com>
3342         PR c++/80544
3343         * tree.c (reshape_init): Use unqualified type for direct enum init.
3344         * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
3345         (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
3346         non-class destination types.
3347         (build_const_cast_1): Strip cv-quals from destination types.
3348         (build_static_cast, build_reinterpret_cast, build_const_cast)
3349         (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
3351 2017-05-24  Martin Sebor  <msebor@redhat.com>
3353         PR c/80731
3354         * call.c (fully_fold_internal): Adjust.
3356 2017-05-24  Nathan Sidwell  <nathan@acm.org>
3358         * cp-tree.h (ovl_skip_hidden): Declare.
3359         * tree.c (ovl_skip_hidden): New.
3360         * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
3361         (lookup_arg_dependent_1): Likewise.
3362         (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
3363         (hidden_name_p, remove_hidden_names): Delete.
3364         (lookup_name_real_1): Do not strip hidden names.
3365         * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
3367         * cp-tree.h (OVL_HIDDEN_P): New.
3368         (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
3369         (ovl_iterator::reveal_node): Declare.
3370         * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
3371         (ovl_insert): Order on hiddenness.
3372         (ovl_iterator::reveal_node): New.
3373         * name-lookup.c (anticipated_builtin_p): New.
3374         (supplement_binding_1): Use it.
3375         (set_local_extern_decl_linkage): Use hidden_p.
3376         (do_pushdecl): Deal with unhiding a hidden decl, use
3377         anticipated_builtin_p.
3378         (do_nonmember_using_decl): Use anticipated_decl_p.
3379         (lookup_name_real_1): Use DECL_HIDDEN_P.
3381 2017-05-23  Jason Merrill  <jason@redhat.com>
3383         -Wunused and C++17 structured bindings
3384         * decl.c (poplevel): Don't warn about unused structured bindings,
3385         only real variables.
3386         * error.c (dump_simple_decl): Handle structured bindings.
3387         * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
3389 2017-05-23  Nathan Sidwell  <nathan@acm.org>
3391         * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
3392         * name-lookup.c (create_local_binding): New.
3393         (update_binding): New.
3394         (pushdecl_maybe_friend_1): Rename to ...
3395         (do_pushdecl): ... this.  Reimplement.
3396         (pushdecl): Adjust.
3397         (push_overloaded_decl_1, push_overloaded_decl): Delete.
3399 2017-05-23  Jason Merrill  <jason@redhat.com>
3401         PR c++/80396 - built-in for make_integer_sequence.
3402         * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
3403         (expand_integer_pack, expand_builtin_pack_call): New.
3404         (find_parameter_packs_r): Check builtin_pack_call_p.
3405         (check_for_bare_parameter_packs): Handle it.
3406         (tsubst_pack_expansion): Call expand_builtin_pack_call.
3407         (declare_integer_pack): New.
3408         (init_template_processing): Call it.
3409         * decl2.c (mark_used): Check builtin_pack_fn_p.
3411 2017-05-23  Nathan Sidwell  <nathan@acm.org>
3413         * name-lookup.c (find_namespace_binding): New.
3414         (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
3415         (set_identifier_type_value_with_scope): Use find_namespace_binding.
3416         (find_binding, cp_binding_level_find_binding_for_name,
3417         binding_for_name, namespace_binding_1): Delete.
3418         (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
3419         (get_namespace_binding, set_namespace_binding,
3420         finish_namespace_using_decl, unqualified_namespace_lookup_1,
3421         qualified_lookup_using_namespace, lookup_type_scope_1,
3422         lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
3424         PR c++/80866
3425         * parser.c (cp_parser_template_id): Keep the lookup when stashing
3426         the template_id.
3428         * cp-tree.h (DECL_HIDDEN_P): New.
3429         * name-lookup.c (set_decl_context,
3430         set_local_extern_decl_linkage): New, broken out of ...
3431         (pushdecl_maybe_friend_1): ... here.  Call them.
3433 2017-05-23  Thomas Schwinge  <thomas@codesourcery.com>
3435         * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
3436         "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
3437         "VECTOR_LENGTH".
3439 2017-05-23  Nathan Sidwell  <nathan@acm.org>
3441         * cp-tree.h (OVL_P): New.
3442         * name-lookup.h (push_local_binding): Delete.
3443         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3444         (finish_namespace_using_decl, finish_local_using_decl): ... here
3445         * name-lookup.c (add_decl_to_level): Swap args.
3446         (pop_bindings_and_leave_scope): Look inside TREE_LIST.
3447         (diagnose_name_conflict): Check contexts are same for redecl.
3448         (update_local_overload): New.
3449         (compparms_for_decl_and_using): Rename to ...
3450         (matching_fn_p): ... here.
3451         (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
3452         push_local_bindings call.
3453         (push_local_binding): Make static, replace FLAGS arg with
3454         IS_USING.
3455         (validate_nonmember_using_decl): Use OVL_FIRST.
3456         (do_nonmember_using_decl): Use in/out parameters.  Use
3457         lkp_iterator and simplify.
3458         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3459         (finish_namespace_using_decl, finish_local_using_decl): ... here.
3460         Adjust.
3461         (lookup_type_current_level): Delete.
3462         * parser.c (cp_parser_using_declaration): Adjust.
3463         * pt.c (tsubst_expr): Adjust.
3465 2017-05-22  Nathan Sidwell  <nathan@acm.org>
3467         * name-lookup.h (parse_using_directive): Replace with ...
3468         (finish_namespace_using_directive): ... this and ...
3469         (finish_local_using_directive): ... this.
3470         * name-lookup.c (add_using_namespace_1): Move later.
3471         (add_using_namespace): Move later, add namespace_p arg, remove
3472         indirect arg.
3473         (push_using_directive_1): Directly recurse.
3474         (do_using_directive, parse_using_directive): Delete, split into ...
3475         (finish_namespace_using_directive): ... this and ...
3476         (finish_local_using_directive): ... this.
3477         (push_namespace): Use add_using_namespace.
3478         * parser.c (cp_parser_using_directive): Call
3479         finish_namespace_using_directive or finish_local_using_directive.
3480         * pt.c (tsubst_expr): Call finish_local_using_directive.
3482         * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
3483         * cp-tree.h (raw_dump_id): Declare.
3484         * decl2.c (raw_dump_id): Define.
3485         (dump_tu): Use raw_dump_id.
3487         * config-lang.in (gtfiles): Sort list, break lines.
3489         * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
3490         (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
3491         ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
3492         CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
3493         CPTI_RETHROW_FN): New.
3494         (noexcept_deferred_spec): New.
3495         (terminate_node, call_unexpected_node): Rename to ...
3496         (terminate_fn, call_unexpected_fn): ... here.
3497         (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
3498         allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
3499         * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
3500         (init_exception_processing): Adjust.
3501         (declare_library_fn): Create and push the fns here.
3502         (do_get_exception_ptr, do_begin_catch, do_end_catch,
3503         do_allocate_exception_ptr, do_free_exception_ptr): Adjust
3504         declare_library_fn use.
3505         (unevaluated_noexcept_spec): Adjust.
3506         * cp-gimplify.c (genericize_eh_spec_block,
3507         gimplify_most_not_throw_expr): Adjust.
3509         * name-lookup.c (pushdecl_top_level,
3510         pushdecl_top_level_and_finish): Move after namespace pushing and
3511         popping functions.
3512         (push_to_top_level): Rename to ...
3513         (do_push_to_top_level): ... here.  Remove timing code.
3514         (pop_from_top_level_1): Rename to ...
3515         (do_pop_from_top_level): ... here.
3516         (do_push_nested_namespace, do_pop_nested_namespace)
3517         (push_to_top_level): New wrapper for do_push_to_top_level.
3518         (pop_from_top_level): Adjust.
3519         (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
3521 2017-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
3523         * config-lang.in (gtfiles): Add c-family/c-format.c,
3524         except.c, init.c, lambda.c and friend.c.
3525         * class.c (dvirt_fn): Move out of function scope,
3526         add GTY attribute.
3527         * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
3528         * init.c (fn): Likewise.
3529         * lambda.c (ptr_id, max_id): Likewise.
3530         * friend.c (global_friend): Add GTY attribute.
3532 2017-05-19  Nathan Sidwell  <nathan@acm.org>
3534         * call.c (add_list_candidates): Use OVL_FIRST.
3535         (build_new_method_call_1): Likewise.
3536         * cp-tree.h (OVL_SINGLE_P): New.
3537         (TYPE_HIDDEN_P): New.
3538         * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
3539         * dump.c (cp_tump_tree): Adjust overload dumping.
3540         * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
3541         printing.
3542         * method.c (lazily_declare_fn): Assert we added it.
3543         * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
3544         OVL_FIRST.
3545         (cp_parser_template_name): Use lkp_iterator.
3546         * pt.c (begin_template_parm_list): Fixup comment.
3547         (instantiate_class_template_1): Use TYPE_HIDDEN_P.
3548         * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
3549         (ovl_scope): Use lkp_iterator.
3551 2017-05-19  Thomas Schwinge  <thomas@codesourcery.com>
3553         * parser.c (cp_parser_omp_clause_default): Handle
3554         "OMP_CLAUSE_DEFAULT_PRESENT".
3556         * parser.c (cp_parser_omp_clause_default): Avoid printing more
3557         than one syntax error message.
3559 2017-05-19  Nathan Sidwell  <nathan@acm.org>
3561         * class.c (class_dump_id): Define.
3562         (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
3563         * cp-objcp-common.c (cp_register_dumps): New.
3564         * cp-objcp-common.h (cp_register_dumps): Declare.
3565         (LANG_HOOKS_REGISTER_DUMPS): Override.
3566         * cp-tree.h (class_dump_id): Declare.
3568 2017-05-18  Nathan Sidwell  <nathan@acm.org>
3570         * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
3571         (OVL_USED_P): New.
3572         (lookup_keep): Declare.
3573         * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
3574         * pt.c (tsubst_copy): Assert lookup is persistent.
3575         * semantics.c (finish_call_expr): Use lkp_iterator, call
3576         lookup_keep.
3577         * tree.c (ovl_copy): New.
3578         (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
3579         (lookup_keep): New.
3581         * cp-tree.h (OVL_USED): Replace with ...
3582         (OVL_USING_P): ... this.
3583         (ovl_iterator::using_p): Adjust.
3584         * name-lookup.c (push_overloaded_decl_1,
3585         do_nonmember_using_decl): Adjust.
3586         * search.c (lookup_field_r): Adjust.
3587         * tree.c (ovl_insert, ovl_scope): Adjust.
3589         * cp-tree.h (lookup_add): Swap args.
3590         (ovl_cons, build_overload): Delete.
3591         * name-lookup.c (add_function, push_overloaded_decl_1,
3592         do_nonmember_using_decl, merge_functions, remove_hidden_names):
3593         Use lookup_add, ovl_insert.
3594         * pt.c (check_explicit_specialization): Use lookup_add.
3595         (do_class_deduction): Likewise. Refactor if.
3596         * tree.c (lookup_add): Swap args.
3597         (ovl_cons, build_overload): Delete.
3599         * name-lookup.c (find_local_binding): New, broken out of ...
3600         (lookup_name_innermost_nonclass_level_1): ... here.  Call it.
3601         (set_namespace_binding): Swap scope & name args.
3602         (namespace_binding_1): Likewise.
3603         (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
3604         (push_overloaded_decl_1): Likewise.
3605         (set_global_binding): Likewise.
3606         (get_namespace_binding): Adjust namespace_binding_1 call.
3608 2017-05-17  Nathan Sidwell  <nathan@acm.org>
3610         * cp-tree.h (default_hash_traits <lang_identifier *>): New
3611         specialization.
3612         * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
3613         (extern_c_fns): New hash table.
3614         (check_extern_c_conflict): New, broken out of ...
3615         (pushdecl_maybe_friend_1): ... here.  Call it.
3616         (c_linkage_bindings): Just look in hash table.
3618 2017-05-17  Ville Voutilainen  <ville.voutilainen@gmail.com>
3620         PR c++/80654
3621         PR c++/80682
3622         Implement new C++ intrinsics __is_assignable and __is_constructible.
3623         * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
3624         (is_xible): New.
3625         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3626         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3627         * method.c (constructible_expr): Set cp_unevaluated.
3628         (is_xible_helper): New.
3629         (is_trivially_xible): Adjust.
3630         (is_xible): New.
3631         * parser.c (cp_parser_primary_expression): Handle
3632         RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
3633         (cp_parser_trait_expr): Likewise.
3634         * semantics.c (trait_expr_value): Handle
3635         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3637 2017-05-17  Nathan Sidwell  <nathan@acm.org>
3639         * cp-tree.h (ovl_iterator::using_p): New predicate.
3640         (ovl_iterator::remove_node): New worker.
3641         (ovl_insert): Declare.
3642         * tree.c (ovl_insert): New.
3643         (ovl_iterator::remove_node): New.
3644         * class.c (add_method): Use ovl_iterator, ovl_insert.
3645         (clone_function_decl): Fix description.
3646         (clone_constructors_and_destructors): Use ovl_iterator.
3648         * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
3649         (maybe_warn_about_overly_private_class): Use ovl_iterator.
3650         (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
3651         (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
3652         (get_base_fndecls): Use ovl_iterator.
3653         (warn_hidden): Use OVL_NAME, ovl_iterator.
3654         (add_implicitly_declared_members): Use ovl_iterator.
3655         * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
3656         flatten nested if.
3657         (finish_shorthand_constraint): Simplify, use ovl_make.
3658         * pt.c (make_constrained_auto): Simplify.  Use ovl_make.
3659         * search.c (shared_member_p): Use ovl_iterator.
3660         (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
3661         (lookup_conversion_operator): Use OVL_FIRST.
3662         (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
3663         (look_for_overrides_here): Use ovl_iterator.
3664         (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
3665         * typeck.c (build_x_unary_op): Use ovl_make.
3667 2017-05-17  Martin Liska  <mliska@suse.cz>
3669         * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
3670         use it instead of int type.
3671         (dump_vtable): Likewise.
3672         (dump_vtt): Likewise.
3673         * decl2.c (dump_tu): Likewise.
3675 2017-05-16  David Malcolm  <dmalcolm@redhat.com>
3677         * call.c (enforce_access): Add access_failure_info * param and use
3678         it to record access failures.
3679         * cp-tree.h (class access_failure_info): New class.
3680         (enforce_access): Add access_failure_info * param, defaulting to
3681         NULL.
3682         (lookup_member): Likewise.
3683         (locate_field_accessor): New function decl.
3684         (perform_or_defer_access_check): Add access_failure_info * param,
3685         defaulting to NULL.
3686         * search.c (lookup_member): Add access_failure_info * param and
3687         pass it on to call to perform_or_defer_access_check.
3688         (matches_code_and_type_p): New function.
3689         (field_access_p): New function.
3690         (direct_accessor_p): New function.
3691         (reference_accessor_p): New function.
3692         (field_accessor_p): New function.
3693         (struct locate_field_data): New struct.
3694         (dfs_locate_field_accessor_pre): New function.
3695         (locate_field_accessor): New function.
3696         * semantics.c (perform_or_defer_access_check): Add
3697         access_failure_info * param, and pass it on to call to
3698         enforce_access.
3699         * typeck.c (access_failure_info::record_access_failure): New method.
3700         (access_failure_info::maybe_suggest_accessor): New method.
3701         (finish_class_member_access_expr): Pass an access_failure_info
3702         instance to the lookup_member call, and call its
3703         maybe_suggest_accessor method afterwards.
3705 2017-05-16  Marek Polacek  <polacek@redhat.com>
3707         PR sanitizer/80536
3708         PR sanitizer/80386
3709         * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
3711 2017-05-16  Nathan Sidwell  <nathan@acm.org>
3713         * name-lookup.c (check_local_shadow): New, broke out of ...
3714         (pushdecl_maybe_friend_1): ... here.  Call it.
3716         * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
3717         (ovl_first): Move inline definition to end of file.
3718         (ovl_make, lookup_add): Declare.
3719         (get_fns, get_first_fn): Make pure.
3720         * tree.c (ovl_cache): New.
3721         (ovl_make, lookup_add): New.
3722         * pt.c (do_class_deduction): Don't add candidates that will be
3723         elided.
3725         * call.c (build_user_type_conversion_1): Use OVL_FIRST.
3726         (print_error_for_call_failure): Use OVL_NAME.
3727         (build_op_call_1): Use ovl_iterator.
3728         (add_candidates): Use OVL_FIRST & lkp_iterator.
3729         (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
3730         lkp_iterator.
3731         * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
3732         (type_has_user_nondefault_constructor,
3733         in_class_defaulted_default_constructor,
3734         type_has_user_provided_constructor,
3735         type_has_user_provided_or_explicit_constructor,
3736         type_has_non_user_provided_default_constructor,
3737         vbase_has_user_provided_move_assign,
3738         type_has_move_constructor, type_has_move_assign,
3739         type_has_user_declared_move_constructor,
3740         type_has_user_declared_move_assign,
3741         type_build_ctor_call, type_build_dtor_call,
3742         type_requires_array_cookie, explain_non_literal_class): Likewise.
3743         (finish_struct): Use lkp_iterator.
3744         (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
3745         (note_name_declared_in_class): Use OVL_NAME.
3746         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
3747         (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
3748         cxx_pretty_printer::expression): Likewise.
3749         * decl2.c (check_classfn): Use ovl_iterator.
3750         * pt.c (retrieve_specialization): Use ovl_iterator.
3751         * tree.c (cp_tree_equal): Use lkp_iterator.
3752         (type_has_nontrivial_copy_init): Use ovl_iterator.
3754         * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
3755         check is_overloaded_fn.
3757 2017-05-16  Martin Liska  <mliska@suse.cz>
3759         * parser.c (cp_lexer_print_token): Add default value for flags
3760         argument of print_gimple_stmt, print_gimple_expr,
3761         print_generic_stmt and print_generic_expr.
3763 2017-05-16  Nathan Sidwell  <nathan@acm.org>
3765         * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
3766         iterators.
3767         (MAYBE_BASELINK_FUNCTIONS): New.
3768         * constraint.cc (resolve_constraint_check): Use lkp_iterator.
3769         * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
3770         * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
3771         * method.c (inherited_ctor_binfo): Use ovl_iterator.
3772         (binfo_inherited_from): Likewise.
3773         * parser.c (lookup_literal_operator): Use lkp_iterator.
3774         * pt.c (iterative_hash_template_arg): Use lkp_iterator.
3775         (print_candidates_1): Likewise.
3776         (determine_specialization): Likewise.
3777         (resolve_overloaded_unification): Likewise.
3778         (resolve_nondeduced_context): Likewise.
3779         (type_dependent_expression_p): Likewise.
3780         (dependent_template_p): Likewise.
3781         * ptree.c (cxx_print_xnode): Likewise.
3782         * semantics.c (omp_reduction_lookup): Use lkp_iterator.
3783         (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
3784         * typeck.c (check_template_keyword): Use lkp_iterator.
3786         * cp-tree.h (OVL_FIRST, OVL_NAME): New.
3787         (ovl_first): New.
3788         * constexpr.c (function_concept_check): Use OVL_FIRST.
3789         * cvt.c (build_expr_type_conversion): Likewise.
3790         * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
3791         * decl2.c (mark_used): Use OVL_FIRST.
3792         * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
3793         (dump_expr, location_of): Use OVL_FIRST.
3794         * friend.c (do_friend): Use OVL_NAME.
3795         * init.c (build_offset_ref): Use OVL_FIRST.
3796         * mangle.c (write_member_name): Likewise.
3797         (write_expression): Use OVL_NAME.
3798         * method.c (strip_inheriting_ctors): Use OVL_FIRST.
3799         * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
3800         * pt.c (check_explicit_specialization): Use OVL_FIRST.
3801         (check_template_shadow): Likewise.
3802         (tsubst_template_args): Use OVL_NAME.
3803         (tsubst_baselink): Use OVL_FIRST.
3804         * semantics.c (perform_koenig_lookup): Use OVL_NAME.
3805         * tree.c (get_first_fn): Use OVL_FIRST.
3806         * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
3807         (cp_build_addr_expr_1): Use OVL_FIRST.
3809         * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
3810         peeking.
3811         * semantics.c (finish_id_expression): Directly init local var.
3812         (finish_omp_reduction_clause): Use really_overloaded_fn.
3813         * tree.c (get_fns): Document.  Assert we got an overload.
3814         (get_first_fn) Document.
3815         * typeck.c (cp_build_addr_expr_1): Pass arg directly to
3816         really_overloaded_fn.
3817         * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
3819         * cp-tree.h (SCOPE_DEPTH): New.
3820         * name-lookup.h (is_nested_namespace): Declare.
3821         * name-lookup.c (is_nested_namespace): New.
3822         (is_ancestor): Use it.
3823         (set_decl_namespace): Likewise.
3824         (push_namespace): Set SCOPE_DEPTH.
3825         * pt.c (check_specialization_namespace): Use is_nested_namespace.
3826         (check_unqualigied_spec_or_inst): Likewise.
3828 2017-05-15  Nathan Sidwell  <nathan@acm.org>
3830         PR c++/79369
3831         * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
3832         * name-lookup.h (push_namespace): Return int, add make_inline arg.
3833         * name-lookup.c (push_namespace): Deal with inline directly.
3834         Return pushed count.
3835         * parser.c (cp_parser_namespace_definition): Adjust for
3836         push_namespace change.
3838 2017-05-11  Nathan Sidwell  <nathan@acm.org>
3840         * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
3841         LANG_HOOKS_PUSHDECL): Move to ...
3842         * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
3843         LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
3844         * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
3846         * name-lookup.h (pushdecl): Add default friend parm.
3847         (pushdecl_maybe_friend): Delete.
3848         (pushdecl_top_level): Add default friend parm.
3849         (pushdecl_top_level_maybe_friend): Delete.
3850         * name-lookup.c (pushdecl_maybe_friend): Delete.
3851         (pushdecl): Add is_friend parm.
3852         (pushdecl_top_level): Add is friend_parm.
3853         (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
3854         (pushdecl_top_level_and_finish): Do pushing and finishing directly.
3855         * friend.c (do_friend): Adjust.
3856         * pt.c (tsubst_friend_class): Adjust.
3858         Revert pushdecl_top_level_and_finish name change.
3859         * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
3860         * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
3861         * decl.c (cp_make_fname_decl): Adjust.
3862         * decl2.c (get_guard, handle_tls_init):  Adjust.
3863         * rtti.c (get_tinfo_decl, tinfo_base_init):  Adjust.
3865         * name-lookup.c (pushdecl_outermost_localscope): Always
3866         conditionally stop timer.
3868         * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
3869         * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
3871         * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
3872         pushtag_top_level_maybe_friend,
3873         pushdecl_top_level_and_finish): Move declarations to ...
3874         * name-lookup.h: ... here.  Group pushdecl variants.
3875         (pushdecl_top_level_and_finish): Rename to ...
3876         (pushdecl_top_level_with_init): ... here.
3877         * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
3878         * decl2.c (get_guard, handle_tls_init): Likewise.
3879         * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
3880         * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
3881         * method.c (implicitly_declare_fn): Likewise.
3882         * searchc (node_debug_info_needed): Likewise.
3883         * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
3884         (pushdecl_top_level_with_init): ... here.
3885         (pop_everything): Use namespace_bindings_p.
3887         * name-lookup.h (pop_binding): Rename to pop_local_binding.
3888         (getdecls): Rename to get_local_decls.
3889         * name-lookup.c (pop_binding): Rename to ...
3890         (pop_local_binding): ... here.
3891         (pop_bindings_and_leave_scope): Adjust.
3892         (getdecls): Rename to ...
3893         (get_local_decls): ... here.  Assert local scope.
3894         * decl.c (poplevel): Assert not namespace.  Adjust and simplify
3895         logic.
3896         (store_parm_decls): Adjust get_local_decls call.
3897         (parser.c (synthesize_implicit_template_parm): Likewise.
3899 2017-05-11  Ville Voutilainen  <ville.voutilainen@gmail.com>
3901         PR c++/80682
3902         * method.c (is_trivially_xible): Reject void types.
3904 2017-05-10  Nathan Sidwell  <nathan@acm.org>
3906         * class.c (handle_using_decl): Always use OVL_CURRENT.
3907         (resolve_address_of_overloaded_function): Move iterator decl into
3908         for scope.  Don't strip anticipated decls here.
3910         * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
3911         printing.
3912         (print_candidates): Adjust.
3914         * cp-tree.h (build_new_function_call): Lose koenig_p arg.  Fix
3915         line breaking.
3916         * call.c (build_new_function_call): Lose koenig_p arg.  Remove
3917         koenig_p handling here.
3918         * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
3919         (tsubst_omp_clauses): Likewise.
3920         (do_class_deduction): Adjust buld_new_function_call calls.
3921         * semantics.c (finish_call_expr): Likewise.
3923 2017-05-10  Jason Merrill  <jason@redhat.com>
3925         * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
3926         (unify_type_mismatch, unify_parameter_pack_mismatch)
3927         (unify_ptrmem_cst_mismatch, unify_expression_unequal)
3928         (unify_parameter_pack_inconsistent, unify_inconsistency)
3929         (unify_vla_arg, unify_method_type_error, unify_arity)
3930         (unify_arg_conversion, unify_no_common_base)
3931         (unify_inconsistent_template_template_parameters)
3932         (unify_template_deduction_failure)
3933         (unify_template_argument_mismatch)
3934         (unify_overload_resolution_failure): Call unify_invalid.
3936         CWG 1847 - Clarifying compatibility during partial ordering
3937         * pt.c (more_specialized_fn): No order between two non-deducible
3938         parameters.
3940         * pt.c (dependent_type_p): Make sure we aren't called with
3941         global_type_node.
3943         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3944         * pt.c (convert_template_argument): Just return an argument pack.
3945         (coerce_template_parameter_pack, template_parm_to_arg)
3946         (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
3947         (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
3948         Don't set the type of a NONTYPE_ARGUMENT_PACK.
3949         * parser.c (make_char_string_pack, make_string_pack): Likewise.
3951 2017-05-10  Nathan Sidwell  <nathan@acm.org>
3953         * cp-tree.h (add_method, clone_function_decl): Change last arg to
3954         bool.
3955         * class.c (add_method): Change third arg to bool.  Adjust.
3956         (one_inheriting_sig, one_inherited_ctor): Adjust.
3957         (clone_function_decl): Change 2nd arg to bool.  Adjust.
3958         (clone_constructors_and_destructors): Adjust.
3959         * lambda.c (maybe_add_lambda_conv_op): Adjust.
3960         * method.c (lazily_declare_fn): Adjust.
3961         * pt.c (tsubst_decl, instantiate_template_1): Adjust.
3962         * semantics.c (finish_member_declaration): Adjust.
3964 2017-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
3966         PR c++/80145
3967         * decl.c (finish_function): To improve error recovery, change the
3968         logic for calling apply_deduced_return_type.
3970 2017-05-09  Jason Merrill  <jason@redhat.com>
3972         PR c++/80605 - __is_standard_layout and empty base
3973         * class.c (check_bases): Ignore empty bases.
3975         PR c++/70979 - literal class and closure types
3976         * class.c (finalize_literal_type_property): Handle closures
3977         specifically.
3978         (explain_non_literal_class): Likewise.
3980         PR c++/66297, DR 1684 - literal class and constexpr member fns
3981         * constexpr.c (is_valid_constexpr_fn): Only complain about
3982         non-literal enclosing class in C++11.
3983         * class.c (finalize_literal_type_property): Likewise.
3985 2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
3987         PR c++/80186
3988         * pt.c (tsubst_decl): Early return error_mark_node if
3989         grok_ctor_properties returns false.
3991 2017-05-09  Jason Merrill  <jason@redhat.com>
3993         PR c++/70167 - array prvalue treated as lvalue
3994         * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
3995         (enum fcl_t): New.
3996         * semantics.c (finish_compound_literal): Add fcl_context parameter.
3997         Only make a static variable for C99 syntax.
3998         * parser.c (cp_parser_postfix_expression): Pass it.
3999         * pt.c (tsubst_copy_and_build): Likewise.
4000         * call.c (extend_ref_init_temps): Set
4001         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
4003 2017-05-09  Nathan Sidwell  <nathan@acm.org>
4005         * cp-lang.c (get_global_decls, cxx_pushdecl): New.
4006         (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
4007         * name-lookup.h (pushdecl_top_level): Declare.
4009 2017-05-08  Jason Merrill  <jason@redhat.com>
4011         PR c++/80178 - parameter passing for uncopyable classes
4012         * tree.c (type_has_nontrivial_copy_init): True for classes with only
4013         deleted copy/move ctors.
4014         (remember_deleted_copy, maybe_warn_parm_abi): New.
4015         * decl.c (require_complete_types_for_parms, check_function_type):
4016         Call maybe_warn_parm_abi.
4017         * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
4019 2017-05-08  Nathan Sidwell  <nathan@acm.org>
4021         * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
4022         (start_preparsed_function): Do decl pushing before setting
4023         current_funciton_decl and announcing it.
4025         * name-lookup.h (pushdecl_with_scope): Replace with ...
4026         (pushdecl_outermost_localscope): ... this.
4027         * name-lookup.c (pushdecl_with_scope): Replace with ...
4028         (pushdecl_outermost_localscope): ... this.
4029         (pushdecl_namespace_level): Adjust.
4030         * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
4031         * lambda.c (insert_capture_proxy): Likewise.
4033         * class.c (build_vtbl_initializer): Don't shadow outer variable
4034         with static var.
4036         Revert _binding -> _value change.
4037         * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
4038         (get_namespace_binding, set_global_binding): ... these.
4039         * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
4040         (get_namespace_binding, set_global_binding): ... these.
4041         (arg_assoc_namespace, pushdecl_maybe_friend_1,
4042         check_for_out_of_scope_variable, push_overloaded_decl_1,
4043         lookup_name_innermost_nonclass_level, push_namespace): Adjust.
4044         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
4045         SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
4046         * decl.c (poplevel): Adjust.
4047         * pt.c (make_constrained_auto): Likewise.
4049 2017-05-07  Volker Reichelt  <v.reichelt@netcologne.de>
4051         PR translation/80280
4052         * call.c (print_z_candidate): Fix quoting.
4054 2017-05-05  David Malcolm  <dmalcolm@redhat.com>
4056         * error.c (pedwarn_cxx98): Replace report_diagnostic
4057         with diagnostic_report_diagnostic.
4059 2017-05-05  Nathan Sidwell  <nathan@acm.org>
4061         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
4062         (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
4063         (IDENTIFIER_NAMESPACE_VALUE): Delete.
4064         * name-lookup.h (namespace_binding, set_namespace_binding): Replace
4065         with ...
4066         (get_namespace_value, set_global_value): ... these.
4067         (get_global_value_if_present, is_typename_at_global_scope): Delete.
4068         * decl.c (poplevel): Use get_namespace_value.
4069         (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
4070         * class.c (build_vtbl_initializer): Stash library decl in
4071         static var. Use IDENTIFIER_GLOBAL_VALUE.
4072         * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
4073         do_allocate_exception, do_free_exception, build_throw): Likewise.
4074         * init.c (throw_bad_array_new_length): Likewise.
4075         * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
4076         * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
4077         check_for_our_of_scope_variable, push_overloaded_decl_1): Use
4078         get_namespace_value.
4079         (set_namespace_binding_1): Rename to
4080         (set_namespace_binding): ... here.
4081         (set_global_value): New.
4082         (lookup_name_innermost_nonclass_level_1, push_namespace): Use
4083         get_namespace_value.
4084         * pt.c (listify): Use get_namespace_value.
4086         * call.c (make_temporary_var_for_ref_to_temp): Push decl into
4087         current scope.
4088         * lex.c (unqualified_name_lookup_error): Likewise.
4090         * class.c (alter_class): Use retrofit_lang_decl directly.
4091         * decl.c (push_local_name, dupliate_decls): Likewise.
4092         * semantics.c (omp_privatize_field): Likewise.
4094         Kill walk_namespaces.
4095         * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
4096         * decl.c (walk_namespaces_r, walk_namespaces): Delete.
4098         Kill per-namespace static_decls.
4099         * cp-tree.h (static_decls): Declare.
4100         (wrapup_globals_for_namespace,
4101         diagnose_inline_vars_for_namespace): Replace with ...
4102         (wrapup_namespace_globals): ... this.
4103         * decl.c (static_decls): Define.
4104         (wrapup_globals_for_namespace,
4105         diagnose_inline_vars_for_namespace): Replace with ...
4106         (wrapup_namespace_globals): ... this.
4107         (cxx_init_decl_processing): Initialize static_decls.
4108         * decl2.c (c_parse_final_cleanups): Adjust.
4109         * name-lookup.h (cp_binding_level): Remove static_decls member.
4110         * name-lookup.c (add_decl_to_level): Adjust.
4111         (begin_scope): Adjust.
4113 2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
4115         PR c++/71577
4116         * decl.c (reshape_init): Unconditionally return error_mark_node
4117         upon error about too many initializers.
4119 2017-05-04  Nathan Sidwell  <nathan@acm.org>
4121         * constraint.cc (diagnose_check_constraint): Fix %E thinko.
4123 2017-05-04  Martin Sebor  <msebor@redhat.com>
4125         PR translation/80280
4126         * call.c (print_z_candidate): Add missing quoting to %D and other
4127         like directives.
4128         (build_op_call_1): Same.
4129         * constraint.cc (diagnose_check_constraint): Same.
4130         * mangle.c (mangle_decl): Same.
4131         * name-lookup.c (cp_binding_level_debug): Same.
4132         (set_decl_namespace): Same.
4133         * parser.c (cp_parser_tx_qualifier_opt): Same.
4134         * pt.c (print_candidates_1): Same.
4135         (check_template_variable): Same.
4136         (tsubst_default_argument): Same.
4137         (most_specialized_partial_spec): Same.
4138         * semantics.c (omp_reduction_lookup): Same.
4139         * tree.c (check_abi_tag_redeclaration): Same.
4140         * typeck.c (comptypes): Same.
4141         * typeck2.c (abstract_virtuals_error_sfinae): Same.
4143 2017-05-04  Nathan Sidwell  <nathan@acm.org>
4145         More global trees.
4146         * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
4147         CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
4148         CPTI_INIT_LIST_IDENTIFIER.
4149         (global_namespace, global_type_node, global_identifier,
4150         anon_identifier, init_list_identifier): New.
4151         * decl.c (global_type_node, global_scope_name): Delete.
4152         (initialize_predefined_identifiers): Add new identifiers.
4153         (cxx_init_decl_processing): Adjust.
4154         * name-lookup.h (global_namespace, global_type_node): Delete.
4155         * name-lookup.c (global_namespace, anonymous_namespace_name,
4156         get_anonymous_namespace_name): Delete.
4157         (namespace_scope_ht_size, begin_scope, pushtag_1,
4158         push_namespace): Adjust,
4159         * call.c (type_has_extended_temps): Use init_list_identifier.
4160         * pt.c (listify): Likewise.
4162         * name-lookup.c: Reorder functions to make merging from modules
4163         branch simpler.
4165 2017-05-03  Jason Merrill  <jason@redhat.com>
4167         * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
4169 2017-05-03  Nathan Sidwell  <nathan@acm.org>
4171         * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
4172         along with #defines, to before name-lookup include.
4174 2017-05-02  Paolo Carlini  <paolo.carlini@oracle.com>
4176         * pt.c (is_auto_or_concept): Remove.
4177         (type_uses_auto_or_concept): Remove, unused.
4178         (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
4179         * parser.c (tree_type_is_auto_or_concept): Remove, unused.
4180         * cp-tree.h (is_auto_or_concept): Remove.
4182 2017-05-01  Xi Ruoyao  <ryxi@stu.xidian.edu.cn>
4184         PR c++/80038
4185         * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
4186         add pedigree operation and detach call here.
4187         * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
4188         cilk_cp_gimplify_call_params_in_spawned_fn.
4189         (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
4190         * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
4192 2017-04-29  Volker Reichelt  <v.reichelt@netcologne.de>
4194         * parser.c (cp_parser_member_declaration): Add fix-it hints for
4195         stray comma and missing semicolon at end of member declaration.
4197 2017-04-27  Volker Reichelt  <v.reichelt@netcologne.de>
4199         * parser.c (cp_parser_cast_expression): Add target type of cast to
4200         diagnostic.
4201         * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
4203 2017-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
4205         * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
4206         return type to bool.
4207         * cp-tree.h (grok_ctor_properties): Update.
4209 2017-04-26  Volker Reichelt  <v.reichelt@netcologne.de>
4211         * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
4212         information to diagnostic of invalid colon in nested-name-specifier.
4214 2017-04-25  Volker Reichelt  <v.reichelt@netcologne.de>
4216         * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
4217         diagnostic of invalid class/struct keyword after enum.
4219 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
4221         * parser.c (cp_parser_member_declaration): Add fix-it hint
4222         for removing stray semicolons.
4224 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
4226         * name-lookup.c (get_std_name_hint): New function.
4227         (maybe_suggest_missing_header): New function.
4228         (suggest_alternative_in_explicit_scope): Call
4229         maybe_suggest_missing_header.
4231 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
4233         PR c++/80177
4234         * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
4235         candidate type of bm from tree to const char *.
4236         (consider_binding_level): Likewise.
4237         (lookup_name_fuzzy): Likewise, using this to merge the best
4238         result from the preprocessor into bm, rather than immediately
4239         returning, so that better matches from reserved words can "win".
4240         Guard the rejection of keywords that don't start decl-specifiers
4241         so it only happens for FUZZY_LOOKUP_TYPENAME.
4243 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
4245         * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
4246         (start_enum): Likewise.
4247         (build_enumerator): Likewise. Use %qE instead of plain %E.
4248         * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
4249         %<%D%> in diagnostics.
4250         (cp_parser_elaborated_type_specifier): Likewise.
4251         * pt.c (make_pack_expansion): Use %qT and %qE instead of
4252         %<%T%> and %<%E%> in diagnostics.
4253         (tsubst_pack_expansion): Likewise.
4255 2017-04-24  David Malcolm  <dmalcolm@redhat.com>
4257         PR c++/80016
4258         * parser.c (cp_parser_unary_expression):  Generate a location
4259         range for alignof and sizeof expressions.
4261 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
4263         * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
4264         error message.
4265         (cp_parser_virt_specifier_seq_opt): Likewise.
4266         (set_and_check_decl_spec_loc): Likewise twice.
4268 2017-04-21  Jason Merrill  <jason@redhat.com>
4270         PR c++/80179 - ICE with initialized flexible array member.
4271         * constexpr.c (verify_ctor_sanity): Handle flexible array members.
4273 2017-04-21  Richard Biener  <rguenther@suse.de>
4275         * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
4276         (copy_type): Likewise.
4277         * lex.c (copy_decl): Pass down mem-stat info.
4278         (copy_type): Likewise.
4280 2017-04-20  Jonathan Wakely  <jwakely@redhat.com>
4282         PR c++/80473
4283         * init.c (build_new_1): Suppress notes about over-aligned new when
4284         the warning is suppressed.
4286 2017-04-20  Volker Reichelt  <v.reichelt@netcologne.de>
4288         * parser.c (cp_parser_member_declaration): Add warning with fixit
4289         information for extra semicolon after in-class function definition.
4291 2017-04-20  Jakub Jelinek  <jakub@redhat.com>
4293         PR middle-end/80423
4294         * tree.c (build_cplus_array_type): Call build_array_type
4295         with the intended TYPE_TYPELESS_STORAGE flag value, instead
4296         of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
4297         on the shared type.
4299 2017-04-18  Marek Polacek  <polacek@redhat.com>
4301         PR c++/80244 - ICE with attribute in template alias.
4302         * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
4304         PR c++/80241 - ICE with alignas pack expansion.
4305         * error.c (dump_expr): Handle TREE_LIST.
4306         * parser.c (cp_parser_std_attribute_list): Return error_mark if
4307         make_pack_expansion returns an error.
4309 2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>
4311         PR c++/80287
4312         * class.c (fixup_may_alias): Fix all type variants.
4314 2017-04-17  Jason Merrill  <jason@redhat.com>
4316         PR c++/80415 - wrong error with default arg and array reference.
4317         * tree.c (lvalue_kind): Return clk_class for an array prvalue.
4319         * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
4321 2017-04-15  Alexandre Oliva <aoliva@redhat.com>
4323         * decl.c (name_unnamed_type): Split out of...
4324         (grokdeclarator): ... this.
4325         * decl.h (name_unnamed_type): Declare.
4327 2017-04-12  Richard Biener  <rguenther@suse.de>
4328         Bernd Edlinger  <bernd.edlinger@hotmail.de>
4330         PR middle-end/79671
4331         * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
4332         for arrays of character or std::byte type.
4334 2017-04-11  Jason Merrill  <jason@redhat.com>
4336         PR c++/80294 - ICE with constexpr and inheritance.
4337         * constexpr.c (reduced_constant_expression_p):
4338         A null constructor element is non-constant.
4339         (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
4340         returning an empty base.
4342 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
4344         PR c++/80370
4345         * decl.c (cp_finish_decomp): If processing_template_decl on
4346         non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
4347         change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
4348         sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
4349         processing.
4350         * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
4351         with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
4352         dependent.
4354 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
4356         PR c++/80363
4357         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
4359 2017-04-10  Jakub Jelinek  <jakub@redhat.com>
4361         PR c++/80176
4362         * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
4363         operand, if it is a static member function, recurse on the
4364         BASELINK.
4366 2017-04-10  Marek Polacek  <polacek@redhat.com>
4368         PR sanitizer/80348
4369         * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
4370         ORIG_TYPE earlier and not only when shortening.
4372 2017-04-07  Jason Merrill  <jason@redhat.com>
4374         PR c++/80356 - ICE with reference to function template argument.
4375         PR c++/79294
4376         * pt.c (convert_nontype_argument_function): Adjust type even with a
4377         value-dependent argument.
4379         PR c++/80267 - ICE with nested capture of reference
4380         PR c++/60992
4381         * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
4383 2017-04-07  Marek Polacek  <polacek@redhat.com>
4385         PR sanitizer/80348
4386         * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
4388         PR c++/80095
4389         * call.c (build_over_call): Don't check cxx_dialect.
4390         * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
4391         whether SUB is a CONSTRUCTOR.
4392         * init.c (build_new_1): Don't check cxx_dialect.
4393         * tree.c (replace_placeholders): Add a function comment.  Return if
4394         not in C++14, or if the object isn't a (member of a) class.
4395         * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
4396         TYPE is CLASS_TYPE_P.
4398 2017-04-05  Jakub Jelinek  <jakub@redhat.com>
4400         PR c++/80309
4401         * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
4402         of a loop doing vec_safe_push of NULL.  Formatting fixes.
4403         (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
4404         to newidx before calling canonical_type_parameter on newtype.
4406 2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
4408         PR c++/80296
4409         * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
4410         UNARY_PLUS_EXPR case.
4412 2017-04-03  Jason Merrill  <jason@redhat.com>
4414         * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
4416 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
4418         * class.c (update_vtable_entry_for_fn): Fix typo in comment.
4419         * decl2.c (one_static_initialization_or_destruction): Likewise.
4420         * name-lookup.c (store_bindings): Likewise.
4421         * parser.c (make_call_declarator): Likewise.
4422         * pt.c (check_explicit_specialization): Likewise.
4424 2017-04-03  Jason Merrill  <jason@redhat.com>
4426         PR sanitizer/79993 - ICE with VLA initialization from string
4427         PR c++/69487 - wrong VLA initialization from string
4428         * init.c (finish_length_check): Split out from build_vec_init.
4429         (build_vec_init): Handle STRING_CST.
4430         * typeck2.c (split_nonconstant_init): Handle STRING_CST.
4431         (digest_init_r): Don't give a STRING_CST VLA type.
4433 2017-03-31  Jakub Jelinek  <jakub@redhat.com>
4435         PR c++/79572
4436         * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
4437         REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
4438         for NOP_EXPR to REFERENCE_TYPE.
4440         PR libstdc++/80251
4441         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
4442         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
4443         CPTK_IS_AGGREGATE.
4444         * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
4445         Remove extraneous parens.
4446         (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
4447         * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
4448         (cp_parser_trait_expr): Likewise.
4450 2017-03-27  Jakub Jelinek  <jakub@redhat.com>
4452         PR middle-end/80162
4453         * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
4454         * typeck.c (cxx_mark_addressable): Likewise.  Look through
4455         VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
4456         to ARRAY_TYPE.
4457         (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
4459 2017-03-24  Jason Merrill  <jason@redhat.com>
4461         PR c++/77339 - ICE with invalid use of alias template.
4462         * pt.c (lookup_template_class_1): Don't try to enter the scope of an
4463         alias template.
4465 2017-03-24  Marek Polacek  <polacek@redhat.com>
4467         PR c++/80119
4468         * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
4469         doesn't have side effects.
4471 2017-03-23  Jason Merrill  <jason@redhat.com>
4473         PR c++/80150 - ICE with overloaded variadic deduction.
4474         * pt.c (try_one_overload): Remove asserts.
4476         PR c++/77563 - missing ambiguous conversion error.
4477         * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
4479 2017-03-23  Marek Polacek  <polacek@redhat.com>
4481         * cp-tree.h: Remove a C_RID_YYCODE reference.
4483 2017-03-22  Jakub Jelinek  <jakub@redhat.com>
4485         PR c++/80141
4486         * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
4487         case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
4488         processing_template_decl.
4490 2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
4492         PR c++/77752
4493         * name-lookup.c (pushtag_1): Add check for bogus, non template,
4494         std::initializer_list.
4496 2017-03-21  Jakub Jelinek  <jakub@redhat.com>
4498         PR c++/35878
4499         * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
4501 2017-03-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
4503         PR c++/35878
4504         * init.c (std_placement_new_fn_p): New.
4505         (build_new_1): Call it.
4507 2017-03-20  Jason Merrill  <jason@redhat.com>
4509         PR c++/80096 - ICE with C++17 non-type auto.
4510         * pt.c (tsubst): Delay tsubst of type of template non-type
4511         parameter.
4513         PR c++/79519 - ICE with deleted template friend.
4514         * decl.c (grokdeclarator): Complain about misplaced function
4515         definition using =, as well.
4517         PR c++/79640 - infinite recursion with generic lambda.
4518         * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
4519         before substituting its initializer.
4521 2017-03-20  Marek Polacek  <polacek@redhat.com>
4522             Paolo Carlini  <paolo.carlini@oracle.com>
4524         PR c++/80059 - ICE with noexcept and __transaction_atomic
4525         * except.c (build_must_not_throw_expr): Call
4526         instantiate_non_dependent_expr.
4528 2017-03-19  Jason Merrill  <jason@redhat.com>
4530         PR c++/80084 - wrong C++17 decomposition by reference of parameter.
4531         * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
4532         reference decomposition.
4534         PR c++/80077 - error with constexpr and -fno-elide-constructors.
4535         * constexpr.c (cxx_eval_call_expression): Set ctx->call while
4536         expanding trivial constructor.
4538 2017-03-17  Jason Merrill  <jason@redhat.com>
4540         PR c++/78345 - ICE initializing array from lambda.
4541         * init.c (build_aggr_init): Check array initializer.
4542         (build_vec_init): Check the type of a CONSTRUCTOR.
4544         PR c++/80073 - C++17 ICE with virtual base.
4545         * decl.c (xref_basetypes): Also check for indirect vbases.
4547 2017-03-16  Jason Merrill  <jason@redhat.com>
4549         * decl.c (start_enum): std::byte aliases anything.
4551         PR c++/79797
4552         * constexpr.c (lookup_placeholder): Tweak.
4554 2017-03-15  Jason Merrill  <jason@redhat.com>
4556         PR c++/80043 - ICE with -fpermissive
4557         * typeck.c (convert_for_assignment): Handle instantiate_type
4558         not giving an error.
4560 2017-03-14  Nathan Sidwell  <nathan@acm.org>
4562         PR c++/79393 DR 1658 workaround
4563         * method.c (synthesized_method_base_walk): Inihibit abstract class
4564         virtual base access check here.
4565         (synthesized_method_walk): Not here.
4567 2017-03-13  Nathan Sidwell  <nathan@acm.org>
4569         PR c++/79393 DR 1658 workaround
4570         * method.c (synthesized_method_walk): Check vbases of abstract
4571         classes for dtor walk.
4573 2017-03-10  David Malcolm  <dmalcolm@redhat.com>
4575         PR translation/79848
4576         * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
4578 2017-03-10  Jason Merrill  <jason@redhat.com>
4580         PR c++/79960 - alias templates and partial ordering
4581         * pt.c (comp_template_args): Add partial_order parm.
4582         (template_args_equal): Likewise.
4583         (comp_template_args_porder): New.
4584         (get_partial_spec_bindings): Use it.
4586 2017-03-10  Marek Polacek  <polacek@redhat.com>
4588         PR c++/79967
4589         * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
4591 2017-03-10  Jakub Jelinek  <jakub@redhat.com>
4593         PR c++/79899
4594         * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
4595         Use XALLOCAVEC macro.
4597         PR c++/79896
4598         * decl.c (finish_enum_value_list): If value is error_mark_node,
4599         don't copy it and change its type.
4600         * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
4601         of CONST_DECL is error_mark_node.
4603 2017-03-09  Marek Polacek  <polacek@redhat.com>
4605         PR c++/79900 - ICE in strip_typedefs
4606         * tree.c (strip_typedefs): Skip the attribute handling if T is
4607         a variant type which hasn't been updated yet.
4609         PR c++/79687 - wrong code with pointer-to-member
4610         * init.c (constant_value_1): Break if the variable has a dynamic
4611         initializer.
4613 2017-03-08  Jason Merrill  <jason@redhat.com>
4615         PR c++/79797 - ICE with self-reference in array DMI.
4616         * constexpr.c (lookup_placeholder): Split out...
4617         (cxx_eval_constant_expression): ...from here.
4619 2017-03-07  Jakub Jelinek  <jakub@redhat.com>
4621         PR c/79834
4622         * parser.c (cp_parser_omp_cancellation_point,
4623         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
4624         cp_parser_omp_target_update): Change "may only be used in compound
4625         statements" diagnostics, such that the same translatable string is
4626         used for all pragmas.
4627         (cp_parser_pragma): Likewise.  Use error_at instead of
4628         cp_parser_error for that diagnostics.
4630 2017-03-06  Marek Polacek  <polacek@redhat.com>
4632         PR c++/79796 - ICE with NSDMI and this pointer
4633         * call.c (build_over_call): Handle NSDMI with a 'this' by calling
4634         replace_placeholders.
4636 2017-03-06  Jakub Jelinek  <jakub@redhat.com>
4638         PR c++/79822
4639         * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
4640         ({ (void) 0; }).
4642 2017-03-06  Jason Merrill  <jason@redhat.com>
4644         Revert "Allow deduction guides to look into primary template."
4645         * cp-tree.h, parser.c, pt.c, search.c: Revert.
4647 2017-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
4649         PR c++/70266
4650         * except.c (build_must_not_throw_expr): Perform the implicit
4651         conversions on the condition.
4653 2017-03-03  Jason Merrill  <jason@redhat.com>
4655         * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
4656         -Wc++1z-compat.
4658         Core issues 2273 and 2277
4659         * call.c (joust): Adjust using-declaration tiebreaker to handle
4660         the intermediate base case.
4661         * method.c (strip_inheriting_ctors): Just return the argument if
4662         !flag_new_inheriting_ctors.
4664 2017-03-03  Richard Biener  <rguenther@suse.de>
4666         PR c++/79825
4667         * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
4669 2017-03-03  Marek Polacek  <polacek@redhat.com>
4671         PR c++/79791
4672         * typeck.c (string_conv_p): In C++11, always call pedwarn with
4673         OPT_Wwrite_strings.
4675 2017-03-02  Jason Merrill  <jason@redhat.com>
4677         Update overload resolution with deduction guides.
4678         * pt.c (do_class_deduction): Always build the copy guide.
4679         (copy_guide_p, template_guide_p): New.
4680         (build_deduction_guide): Remember the original constructor.
4681         * call.c (joust): Prefer the copy guide and non-template guides.
4683         Allow deduction guides to look into primary template.
4684         * cp-tree.h (struct saved_scope): Add deduction_guide_type.
4685         (struct cp_decl_specifier_seq): Add constructor_p.
4686         * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
4687         (cp_parser_init_declarator): Check it.  Set ctor_dtor_or_conv_p.
4688         Clear deduction_guide_type.  Don't handle deduction guide names.
4689         (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
4690         (cp_parser_direct_declarator): Likewise.  Handle deduction guides.
4691         (cp_parser_member_declaration, cp_parser_cache_defarg)
4692         (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
4693         * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
4694         (build_deduction_guide): Set deduction_guide_type.
4695         (dependent_scope_p): Check deduction_guide_type.
4696         * search.c (lookup_member): Likewise.
4698 2017-03-02  Jakub Jelinek  <jakub@redhat.com>
4700         PR c++/79782
4701         * init.c (mark_exp_read_r): New function.
4702         (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
4703         whole arguments instead of plain mark_exp_read on TREE_LIST values.
4705 2017-03-01  Jason Merrill  <jason@redhat.com>
4707         Class template argument deduction in new-expression
4708         * init.c (build_new): Handle deduction from no initializer.
4709         * parser.c (cp_parser_new_expression): Don't require a single
4710         expression for class template deduction.
4711         * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
4712         class template placeholder.
4713         * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
4714         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
4715         (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
4717 2017-03-01  Jakub Jelinek  <jakub@redhat.com>
4719         PR c++/79746
4720         * init.c (emit_mem_initializers): When not constructing vbases of
4721         abstract classes, mark arguments as read for
4722         -Wunused-but-set-parameter.
4724 2017-02-28  Jason Merrill  <jason@redhat.com>
4726         Class template argument deduction refinements
4727         * call.c (joust): Move deduction guide tiebreaker down.
4728         * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
4729         deduction with no initializer.
4730         * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
4731         (do_class_deduction): Use that rather than special case.
4732         (do_auto_deduction): Handle null initializer.
4734 2017-02-28  Jakub Jelinek  <jakub@redhat.com>
4736         * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
4737         instead of just cond ? "..." : "...".
4738         (grokdeclarator): Likewise.
4739         (build_enumerator): Likewise.
4740         * init.c (build_new_1): Likewise.
4741         * call.c (build_new_method_call_1): Likewise.
4742         * parser.c: Include intl.h.
4743         (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
4744         "enter"/"exit" keyword.
4745         (cp_finalize_oacc_routine): Don't use %s to supply portions of the
4746         message.
4748 2017-02-27  Jason Merrill  <jason@redhat.com>
4750         PR c++/71568 - SFINAE forming pointer to member function
4751         * init.c (build_offset_ref): Check the return value of
4752         perform_or_defer_access_check.
4754 2017-02-27  Marek Polacek  <polacek@redhat.com>
4756         * decl.c (expand_static_init): Add missing } in a comment.
4758 2017-02-27  Volker Reichelt  <v.reichelt@netcologne.de>
4760         * init.c: Include intl.h.
4761         (build_new_1): Move message strings into pedwarn to make them
4762         -Wformat-security friendly. Mark string for translation.
4763         * pt.c (tsubst_copy_and_build): Mark string for translation.
4764         Make the pointer const.
4765         * semantics.c (finish_id_expression): Mark strings for translation.
4767 2017-02-25  Jakub Jelinek  <jakub@redhat.com>
4769         * call.c (build_op_delete_call): Make msg1 and msg2 const.
4771 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
4773         PR c++/79588
4774         * call.c (build_over_call): Call check_function_arguments even for
4775         -Wrestrict, adjust check_function_arguments caller.
4776         * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
4777         here.
4778         * typeck.c (cp_build_function_call_vec): Adjust
4779         check_function_arguments caller.
4781 2017-02-24  Marek Polacek  <polacek@redhat.com>
4783         PR translation/79705
4784         * decl.c (check_redeclaration_exception_specification): Mark a string
4785         for translation.  Make the pointer const.
4787 2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>
4789         PR c++/79361
4790         * pt.c (register_specialization): Check duplicate_decls return value
4791         for error_mark_node and pass it back.
4793 2017-02-22  Jason Merrill  <jason@redhat.com>
4795         PR c++/79679 - missing destructor for argument
4796         * call.c (build_over_call): Don't pass tf_no_cleanup to argument
4797         conversions.
4799         * pt.c (do_class_deduction): Handle 0 argument case.
4801 2017-02-22  Jakub Jelinek  <jakub@redhat.com>
4803         PR c++/79664
4804         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
4805         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
4806         * constexpr.c (potential_constant_expression_1): Handle
4807         OMP_*, OACC_* and CILK_* trees.  Use error_at with
4808         EXPR_LOC_OR_LOC (t, input_location) computed early
4809         instead of error, or error_at with location_of (t).
4811 2017-02-22  Marek Polacek  <polacek@redhat.com>
4813         PR c++/79653
4814         * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
4815         if the alignas expression is erroneous.
4816         * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
4817         error_mark_node.
4819         PR c++/79657
4820         * semantics.c (finish_underlying_type): Bail out for incomplete enums.
4822 2017-02-21  Jason Merrill  <jason@redhat.com>
4824         PR c++/50308 - wrong deprecated warning with ADL
4825         PR c++/17729 - duplicate deprecated warning
4826         * semantics.c (finish_id_expression): Only call mark_used on a
4827         function if we aren't building a call.
4829         PR c++/41727 - ICE with partial spec of partial instantiation
4830         * pt.c (process_partial_specialization): For now, don't check more
4831         specialized if there is more than one level of args.
4833 2017-02-21  Marek Polacek  <polacek@redhat.com>
4835         PR c++/79535
4836         * cp-tree.h (maybe_reject_flexarray_init): Declare.
4837         * init.c (maybe_reject_flexarray_init): No longer static.
4838         Add check for current_function_decl.
4839         * parser.c (cp_parser_late_parse_one_default_arg): Reject
4840         a default mem-initializer for a flexible array.
4842 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
4843             Paolo Carlini  <paolo.carlini@oracle.com>
4845         PR c++/79654
4846         * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
4847         on error.
4848         * pt.c (tsubst_decomp_names): Return error_mark_node if the first
4849         decl after the decomposition artificial decl has error_mark_node.
4850         * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
4851         instead of just == error_mark_node comparison.
4853 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
4855         PR sanitizer/79589
4856         * decl.c: Include gimplify.h.
4857         (cp_finish_decomp): Make sure there is no sharing of trees
4858         in between DECL_VALUE_EXPR of decomposition decls.
4860         PR c++/79655
4861         * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
4863         PR c++/79639
4864         * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
4865         call cplus_expand_constant on it first.
4867 2017-02-19  Jason Merrill  <jason@redhat.com>
4869         PR c++/78139 - destructor needed by new-expression
4870         * call.c (build_special_member_call): Use tf_no_cleanup.
4872         PR c++/78282 - auto template and pack expansion
4873         * pt.c (find_parameter_packs_r): Don't walk into the type of
4874         templates other than template template-parameters.
4876         PR c++/79606 - ICE with this->base_member in NSDMI
4877         * class.c (build_base_path): Check processing_template_decl.
4879         PR c++/79607 - ICE with T{} initializer
4880         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
4882         PR c++/79566 - elaborated-type-specifier in range for
4883         * parser.c (cp_parser_simple_declaration): Fix check for type
4884         definition.
4886         PR c++/79400 - confusing suggestion of 'noexcept'
4887         * parser.c (cp_parser_exception_specification_opt): Remove
4888         suggestion for deprecated dynamic exception-specification.
4890         PR c++/79470 - partial ordering with reference parameters
4891         * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
4893         PR c++/79500 - ICE with non-template deduction guide
4894         * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
4895         DECL_TEMPLATE_RESULT.
4897         PR c++/79580 - ICE with compound literal
4898         * parser.c (cp_parser_class_head): If we're in the middle of an
4899         expression, use ts_within_enclosing_non_class.
4901         PR c++/79503 - inherited ctor taking base class
4902         * call.c (add_function_candidate): Also check that
4903         DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
4905 2017-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
4907         PR c++/79380
4908         * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
4909         argument.
4911 2017-02-19  Eric Fiselier  <eric@efcs.ca>
4912             Jonathan Wakely  <jwakely@redhat.com>
4914         PR c++/69523
4915         * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
4916         control warning about literal suffix identifiers without a leading
4917         underscore.
4919 2017-02-17  Jason Merrill  <jason@redhat.com>
4921         PR c++/79508 - lookup error with member template
4922         * parser.c (cp_parser_template_name): Clear
4923         parser->context->object_type if we aren't doing lookup.
4925         PR c++/78690 - ICE with using and global type with same name
4926         * pt.c (type_dependent_object_expression_p): True for
4927         IDENTIFIER_NODE.
4929         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
4930         * pt.c (convert_template_argument): Just return an auto arg pack.
4931         (tsubst_template_args): Don't tsubst an auto pack type.
4933         PR c++/79556 - C++17 ICE with non-type auto
4934         * pt.c (do_auto_deduction): Don't try to deduce from null type.
4936         PR c++/79533 - C++17 ICE with temporary cast to reference
4937         * call.c (build_over_call): Conversion to a reference prevents copy
4938         elision.
4940 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
4941             Jason Merrill  <jason@redhat.com>
4943         PR c++/79502 - lost nodiscard attribute
4944         * pt.c (apply_late_template_attributes): Do apply non-dependent
4945         attributes to types.
4947 2017-02-16  Jason Merrill  <jason@redhat.com>
4949         PR c++/78572 - ICE with self-modifying array initializer
4950         * constexpr.c (cxx_eval_store_expression): The object we're
4951         initializing is outside the constant-expression.
4952         (cxx_eval_call_expression): Set ctx->call.
4954         PR c++/79050 - ICE with undeduced auto and LTO
4955         * decl.c (poplevel): Remove undeduced auto decls.
4957 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
4959         PR c++/79512
4960         * parser.c (cp_parser_omp_target): For -fopenmp-simd
4961         ignore #pragma omp target even when not followed by identifier.
4963 2017-02-15  Jason Merrill  <jason@redhat.com>
4964             Jakub Jelinek  <jakub@redhat.com>
4966         PR c++/79464 - ICE in IPA with omitted constructor parms
4967         * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
4968         (adjust_clone_args): Adjust.
4969         (add_method): Remember omitted parms.
4970         * call.c (add_function_candidate): Likewise.
4971         * mangle.c (write_method_parms): Likewise.
4972         * method.c (ctor_omit_inherited_parms): Return false if there are no
4973         parms to omit.
4975 2017-02-15  Martin Sebor  <msebor@redhat.com>
4977         PR c++/79363
4978         * init.c (maybe_reject_flexarray_init): New function.
4979         (perform_member_init): Call it.
4981 2017-02-15  Jakub Jelinek  <jakub@redhat.com>
4983         PR c++/79301
4984         * parser.c (cp_parser_std_attribute): Don't pedwarn about
4985         [[deprecated]] with -std=c++11 and [[fallthrough]] with
4986         -std=c++11 and -std=c++14.
4988         PR c++/79288
4989         * decl.c (grokdeclarator): For static data members, handle thread_p
4990         only after handling inline.
4992 2017-02-14  Marek Polacek  <polacek@redhat.com>
4994         PR c++/79420
4995         PR c++/79463
4996         * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
4997         clobbering if the postfix expression isn't an EXPR_P.
4999 2017-02-13  Jason Merrill  <jason@redhat.com>
5001         PR c++/79461 - ICE with lambda in constexpr constructor
5002         * constexpr.c (build_data_member_initialization): Ignore
5003         initialization of a local variable.
5005 2017-02-13  Jakub Jelinek  <jakub@redhat.com>
5007         * init.c (warn_placement_new_too_small): Add missing space in
5008         diagnostics.
5009         * parser.c (cp_parser_oacc_declare): Likewise.
5010         * mangle.c (maybe_check_abi_tags): Likewise.
5012         PR c++/79232
5013         * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
5014         on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
5015         in the rightmost operand.
5017 2017-02-13  Nathan Sidwell  <nathan@acm.org>
5019         PR c++/79296 - ICE mangling localized template instantiation
5020         * decl2.c (determine_visibility): Use template fn context for
5021         local class instantiations.
5023 2017-02-11  Jason Merrill  <jason@redhat.com>
5025         PR c++/77659 - ICE with new and C++14 aggregate NSDMI
5026         * init.c (build_new): Make backups of any CONSTRUCTORs in init.
5027         (build_new_1): Use replace_placeholders.
5028         * tree.c (replace_placeholders_t): Also track whether we've seen a
5029         placeholder.
5030         (replace_placeholders, replace_placeholders_r): Adjust.
5031         * cp-tree.h: Adjust.
5033         PR c++/77790 - ICE with auto function in C++11 mode
5034         * decl.c (undeduced_auto_decl): Remove C++14 limitation.
5035         (require_deduced_type): Add complain parm, return bool.
5036         * cp-tree.h: Adjust.
5037         * decl2.c (mark_used): Use require_deduced_type.
5039 2017-02-10  Jason Merrill  <jason@redhat.com>
5041         PR c++/78908 - template ops and bitfields
5042         * tree.c (build_min_non_dep): Use unlowered_expr_type.
5044         PR c++/78897 - constexpr union
5045         * constexpr.c (cxx_eval_store_expression): A store to a union member
5046         erases a previous store to another member.
5048         PR c++/71285 - member of fold-expression
5049         * semantics.c (finish_unary_fold_expr)
5050         (finish_binary_fold_expr): Use null type for fold-expressions.
5052         PR c++/79401 - protected inherited constructor
5053         * call.c (enforce_access): For inheriting constructor, find a base
5054         binfo in the path we already have.
5056 2017-02-10  Marek Polacek  <polacek@redhat.com>
5058         PR c++/79435
5059         * pt.c (type_dependent_expression_p): Check if the expression type
5060         is null.
5062         PR c++/79184
5063         * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
5064         if warnings shouldn't be given.
5066 2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
5068         PR c++/71737
5069         * pt.c (tsubst_decl): Don't try to preserve a typedef that names
5070         an error_mark_node as type.
5072 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
5073             Jason Merrill  <jason@redhat.com>
5075         PR c++/79143
5076         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
5077         from pattern to type.
5079 2017-02-09  Jason Merrill  <jason@redhat.com>
5081         PR c++/79316 - default argument in deduction guide
5082         PR c++/79350 - explicit deduction guide
5083         * parser.c (cp_parser_constructor_declarator_p)
5084         (cp_parser_direct_declarator): Parse deduction guides more like
5085         constructors.
5086         * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
5087         * tree.c (special_function_p): Return it.
5088         * decl.c (check_special_function_return_type): Handle it.
5089         (grokdeclarator, grokfndecl): Adjust.
5090         (cp_finish_decl): Pass flags to do_auto_deduction.
5091         * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
5092         * pt.c (dguide_name_p): Take a const_tree.
5093         (do_class_deduction): Handle explicit.
5094         (do_auto_deduction): Pass flags through.
5095         (build_deduction_guide): Copy explicit flag.
5097 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
5099         PR c++/79429
5100         * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
5101         non-pragma_compound context here.
5102         (cp_parser_omp_target): Likewise.
5103         (cp_parser_pragma): Don't call push_omp_privatization_clauses and
5104         parsing for ordered and target omp pragmas in non-pragma_stmt
5105         non-pragma_compound contexts.
5107         PR c/79431
5108         * parser.c (cp_parser_oacc_declare): Formatting fix.
5109         (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
5110         automatic variables.
5112 2016-02-09  Nathan Sidwell  <nathan@codesourcery.com>
5113             Chung-Lin Tang  <cltang@codesourcery.com>
5115         * parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
5116         parsing.  Parse constant expression. Remove semantic checking.
5117         (cp_parser_omp_clause_collapse): Disallow tile.
5118         (cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
5119         error about missing for after already emitting one.  Use more
5120         conventional for idiom for unbounded loop.
5121         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
5122         * semantics.c (finish_omp_clauses): Correct TILE semantic check.
5123         (finish_omp_for): Deal with tile clause.
5125 2017-02-07  Nathan Sidwell  <nathan@acm.org>
5127         * method.c (synthesized_method_base_walk): New.  Broken out of ...
5128         (synthesized_method_walk): ... here.  Call it.  Cleanup
5129         initializations.
5131 2017-02-07  Patrick Palka  <ppalka@gcc.gnu.org>
5133         PR c++/79360
5134         * typeck2.c (process_init_constructor_union): Consider only
5135         FIELD_DECLs when looking for an NSDMI.
5137 2017-02-06  Jason Merrill  <jason@redhat.com>
5139         PR c++/71193 - incomplete types in templates
5140         * parser.c (cp_parser_postfix_dot_deref_expression): In a template
5141         handle incomplete type by pedwarning and then treating as dependent.
5143 2017-02-06  Jakub Jelinek  <jakub@redhat.com>
5145         PR c++/79379
5146         * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
5147         (potential_constant_expression_1): Likewise.
5149         PR c++/79377
5150         * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
5151         allow one fewer than expected arguments if flag_permissive.
5153         PR c++/79372
5154         * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
5155         * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
5156         with error_mark_node type.
5158 2017-02-03  Jason Merrill  <jason@redhat.com>
5160         PR c++/78689 - ICE on constructor with label
5161         * optimize.c (maybe_clone_body): Replace omitted parameters with
5162         null lvalues.
5163         * class.c (build_clone): Fix logic for omitting inherited parms.
5165         PR c++/12245 - excessive memory use
5166         * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
5167         back in.  Don't cache constants.
5168         (maybe_constant_init): Don't cache constants.
5170         PR c++/79294 - ICE with invalid template argument
5171         * pt.c (convert_nontype_argument_function): Check value-dependence.
5172         (convert_nontype_argument): Don't check it here for function ptrs.
5174 2017-02-02  Richard Biener  <rguenther@suse.de>
5176         PR cp/14179
5177         * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
5178         it lazily on the first changed element only and copy it
5179         fully upfront, only storing changed elements.
5181 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
5183         PR c++/69637
5184         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
5185         to the width.
5187 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
5189         PR c++/79304
5190         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
5191         after ARROW_EXPR.
5193 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
5195         PR c++/79298
5196         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
5197         any namespace aliases.
5199 2017-01-31  Nathan Sidwell  <nathan@acm.org>
5201         PR c++/79290
5202         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
5204         PR c++/67273
5205         PR c++/79253
5206         * pt.c: (instantiate_decl): Push to top level when current
5207         function scope doesn't match.  Only push lmabda scope stack when
5208         pushing to top.
5210         * cp-tree.h (instantiate_decl): Make defer_ok bool.
5211         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
5212         (instantiate_decl): Simplify and reorder state saving and restoration.
5214         PR c++/79264
5215         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
5216         * semantics.c (finish_member_declaration): Assert class is being
5217         defined.
5219 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
5221         Introduce C++ support in libcc1.
5222         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
5223         (ansi_opname): Rename to...
5224         (cp_operator_id): ... this.  Adjust all callers.
5225         (ansi_assopname): Rename to...
5226         (cp_assignment_operator_id): ... this.  Adjust all callers.
5227         (cp_literal_operator_id): Declare.
5228         (set_global_friend): Declare.
5229         (is_global_friend): Declare.
5230         (enum cp_oracle_request): New type.
5231         (cp_binding_oracle_function): New type.
5232         (cp_binding_oracle): Declare.
5233         (cp_finish_injected_record_type): Declare.
5234         * friend.c (global_friend): New var.
5235         (set_global_friend): New fn.
5236         (is_global_friend): New fn.
5237         (is_friend): Call is_global_friend.
5238         * name-lookup.c (cp_binding_oracle): New var.
5239         (query_oracle): New fn.
5240         (qualified_lookup_using_namespace): Call query_oracle.
5241         (lookup_name_real_1): Likewise.
5242         * parser.c (cp_literal_operator_id): Drop static.
5243         * search.c (friend_accessible_p): Call is_global_friend.
5244         * semantics.c (is_this_parameter): Accept a variable if the
5245         binding oracle is enabled.
5247 2017-01-27  Jason Merrill  <jason@redhat.com>
5249         PR c++/78771 - ICE with inherited constructor.
5250         * call.c (build_over_call): Call deduce_inheriting_ctor here.
5251         * pt.c (tsubst_decl): Not here.
5252         * class.c (add_method): Or here.
5253         * method.c (deduce_inheriting_ctor): Handle clones.
5254         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
5256 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
5258         PR c++/64382
5259         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
5260         New function.
5261         * cp/cp-tree.h: Declare it.
5262         * cp/semantics.c (finish_id_expression): Resolve names within a default
5263         capturing generic lambda defined within a template prior to
5264         instantiation to allow for captures to be added to the closure type.
5266 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
5268         PR c++/68727
5269         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
5270         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
5271         * parser.c (cp_parser_builtin_offsetof): Pass result of
5272         build_static_cast of null_pointer_node to finish_offsetof.
5273         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
5274         it for -Winvalid-offsetof pedwarn instead of trying to guess
5275         original offsetof type from EXPR.  Save OBJECT_PTR as a new
5276         second operand to OFFSETOF_EXPR.
5277         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
5278         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
5279         as OBJECT_PTR.
5281 2017-01-26  Jason Merrill  <jason@redhat.com>
5283         * name-lookup.c (parse_using_directive): Deprecate strong using.
5285         PR c++/79176 - lambda ICE with -flto -Os
5286         * decl2.c (vague_linkage_p): Handle decloned 'tors.
5287         * tree.c (decl_linkage): Likewise.
5289 2017-01-25  Martin Sebor  <msebor@redhat.com>
5291         * decl.c (grokdeclarator): Fix a typo in a comment.
5293 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
5295         PR c++/78896
5296         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
5297         lambda expressions.
5299         PR c++/77914
5300         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
5301         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
5303 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
5305         PR lto/79061
5306         * decl.c (cxx_init_decl_processing): Pass main_input_filename
5307         to build_translation_unit_decl.
5309 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
5311         PR c++/79205
5312         * cp-gimplify.c (cp_genericize_r): Add result of
5313         convert_from_reference on invisiref parm to p_set.
5315 2017-01-24  Nathan Sidwell  <nathan@acm.org>
5317         PR c++/78469 - defaulted ctor and inaccessible dtor
5318         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
5319         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
5320         * tree.c (build_target_expr): Check tf_no_cleanup.
5322         PR c++/79118 - anon-members and constexpr
5323         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
5324         ctor decl.  Recursively check anonymous members.
5325         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
5326         call.
5327         (explain_invalid_constexpr_fn): Likewise.
5329 2017-01-23  Nathan Sidwell  <nathan@acm.org>
5331         PR c++/71710 - template using directive of field
5332         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
5333         check earlier.
5335         PR c++/71406 - ICE with scope-ref'd template id exprs
5336         PR c++/77508
5337         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
5338         before breaking up TEMPLATE_ID_EXPR.
5340 2017-01-20  Nathan Sidwell  <nathan@acm.org>
5342         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
5343         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
5345 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
5347         PR c++/77829
5348         PR c++/78656
5349         * cp-tree.h (suggest_alternatives_for): Add bool param.
5350         (suggest_alternative_in_explicit_scope): New decl.
5351         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
5352         that isn't the global one, call new function
5353         suggest_alternative_in_explicit_scope, only calling
5354         suggest_alternatives_for if it fails, and disabling near match
5355         searches fort that case.  When SCOPE is the global namespace,
5356         pass true for new param to suggest_alternatives_for to allow for
5357         fuzzy name lookups.
5358         * lex.c (unqualified_name_lookup_error): Pass true for new param
5359         to suggest_alternatives_for.
5360         * name-lookup.c (consider_binding_level): Add forward decl.
5361         (suggest_alternatives_for): Add "suggest_misspellings" param,
5362         using it to conditionalize the fuzzy name-lookup code.
5363         (suggest_alternative_in_explicit_scope): New function.
5364         * parser.c (cp_parser_primary_expression): When calling
5365         finish_id_expression, pass location of id_expression rather
5366         than that of id_expr_token.
5367         (cp_parser_id_expression): Convert local "unqualified_id" from
5368         tree to cp_expr to avoid implicitly dropping location information.
5370 2017-01-20  Marek Polacek  <polacek@redhat.com>
5372         PR c/64279
5373         * call.c (build_conditional_expr_1): Warn about duplicated branches.
5374         * semantics.c (finish_expr_stmt): Build statement using the proper
5375         location.
5377 2017-01-19  Jason Merrill  <jason@redhat.com>
5379         US 20 - forwarding references and class template argument deduction
5380         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
5381         * pt.c (push_template_decl_real): Set it.
5382         (maybe_adjust_types_for_deduction): Check it.
5383         (rewrite_template_parm): Copy it.
5385         US 19 - deduction guides and constructors
5386         * call.c (joust): Prefer deduction guides to constructors.
5387         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
5388         (deduction_guide_p): Check DECL_P.
5390         * decl.c (check_initializer): Always use build_aggr_init for array
5391         decomposition.
5393         PR c++/79130 - decomposition and direct-initialization
5394         * init.c (build_aggr_init): Communicate direct-initialization to
5395         build_vec_init.
5396         (build_vec_init): Check for array copy sooner.
5397         * parser.c (cp_parser_decomposition_declaration): Remove call to
5398         build_x_compound_expr_from_list.
5400 2017-01-18  Jason Merrill  <jason@redhat.com>
5402         PR c++/68666 - member variable template-id
5403         * typeck.c (finish_class_member_access_expr): Handle variable
5404         template-id.
5405         * pt.c (lookup_and_finish_template_variable): No longer static.
5406         * cp-tree.h: Declare it.
5408 2017-01-18  Nathan Sidwell  <nathan@acm.org>
5410         PR c++/78488
5411         * call.c (build_over_call): When checking ellipsis conversions for
5412         an inherited ctor, make sure there is at least one conversion.
5414 2017-01-18  Jason Merrill  <jason@redhat.com>
5416         PR c++/78894 - ICE with class deduction and default arg
5417         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
5419 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
5421         PR c++/77489
5422         * mangle.c (write_discriminator): Reorganize abi warning check.
5424 2017-01-18  Nathan Sidwell  <nathan@acm.org>
5426         * cp-tree.h: Clarify exception spec node comment.
5427         * except.c (nothrow_spec_p): Simplify by checking node-equality.
5429         PR c++/79091
5430         * mangle.c (write_exception_spec): Check nothrow explicitly.
5431         (write_encoding): Don't increment processing_template_decl around
5432         encoding.
5434 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
5436         PR c++/70182
5437         * mangle.c (write_template_args): Add "on" for operator names.
5439 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
5441         PR c++/77489
5442         * mangle.c (write_discriminator): Handle discriminator >= 10.
5444 2017-01-17  Nathan Sidwell  <nathan@acm.org>
5446         PR c++/61636
5447         * cp-tree.h (maybe_generic_this_capture): Declare.
5448         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
5449         (maybe_resolve_dummy): ... here.  Call it.
5450         (maybe_generic_this_capture): New.
5451         * parser.c (cp_parser_postfix_expression): Speculatively capture
5452         this in generic lambda in unresolved member function call.
5453         * pt.c (tsubst_copy_and_build): Force hard error from failed
5454         member function lookup in generic lambda.
5456 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
5458         PR c++/70565
5459         * cp-array-notation.c (expand_array_notation_exprs): Handle
5460         OMP_PARALLEL.
5462 2017-01-11  Jason Merrill  <jason@redhat.com>
5464         PR c++/78337 - ICE on invalid with generic lambda
5465         * semantics.c (process_outer_var_ref): Check if containing_function
5466         is null.  Move inform call under complain test.
5468 2017-01-11  Nathan Sidwell  <nathan@acm.org>
5470         PR c++/77812
5471         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
5472         is a new overload.
5474 2017-01-11  Nathan Sidwell  <nathan@acm.org>
5476         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
5478 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
5480         PR c++/78341
5481         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
5482         assertion.  Formatting fix.
5484         PR c++/72813
5485         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
5486         writing PCH file.
5488 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
5490         PR c++/77949
5491         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
5492         a missing semicolon if we have a valid insertion location for
5493         the fix-it hint.
5495 2017-01-10  Jason Merrill  <jason@redhat.com>
5497         FI 20, decomposition declaration with parenthesized initializer.
5498         * parser.c (cp_parser_decomposition_declaration): Use
5499         cp_parser_initializer.
5501 2017-01-09  Jason Merrill  <jason@redhat.com>
5503         Implement P0195R2, C++17 variadic using.
5504         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
5505         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
5506         * error.c (dump_decl): Likewise.
5508 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
5510         PR translation/79019
5511         PR translation/79020
5512         * semantics.c (finish_omp_clauses): Add missing whitespace to
5513         translatable strings.
5514         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
5516 2017-01-07  Jason Merrill  <jason@redhat.com>
5518         PR c++/78948 - instantiation from discarded statement
5519         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
5520         * cp-tree.h (in_discarded_stmt): Declare it.
5521         (struct saved_scope): Add discarded_stmt bitfield.
5522         (in_discarded_stmt): New macro.
5523         * decl2.c (mark_used): Check it.
5524         * parser.c (cp_parser_selection_statement): Adjust.
5525         (cp_parser_jump_statement): Adjust.
5527 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
5529         PR c++/78931
5530         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
5531         REFERENCE_REF_P, set tt to its operand.
5533         PR c++/78890
5534         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
5535         unions even for C++11 and later.
5537 2017-01-05  Nathan Sidwell  <nathan@acm.org>
5539         PR c++/78765
5540         * pt.c (convert_nontype_argument): Don't try and see if integral
5541         or enum expressions are constants prematurely.
5543 2017-01-04  Marek Polacek  <polacek@redhat.com>
5545         PR c++/64767
5546         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
5547         a zero character literal.
5549 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
5551         PR c++/78949
5552         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
5553         vector type.
5555         PR c++/78693
5556         * parser.c (cp_parser_simple_declaration): Only complain about
5557         inconsistent auto deduction if auto_result doesn't use auto.
5559         * parser.c (cp_parser_simple_declaration): Diagnose function
5560         declaration among more than one init-declarators with auto
5561         specifier.
5563         PR c++/71182
5564         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
5565         assertion, as lexer->buffer may be NULL.
5567 2017-01-04  Marek Polacek  <polacek@redhat.com>
5569         PR c++/77545
5570         PR c++/77284
5571         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
5573 2017-01-04  Nathan Sidwell  <nathan@acm.org>
5575         PR c++/66735
5576         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
5577         (lambda_capture_field_type): Update prototype.
5578         * lambda.c (lambda_capture_field_type): Add is_reference parm.
5579         Add referenceness here.
5580         (add_capture): Adjust lambda_capture_field_type call, refactor
5581         error checking.
5582         * pt.c (tsubst): Adjust lambda_capture_field_type call.
5584 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
5586         Update copyright years.
5588 Copyright (C) 2017 Free Software Foundation, Inc.
5590 Copying and distribution of this file, with or without modification,
5591 are permitted in any medium without royalty provided the copyright
5592 notice and this notice are preserved.