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