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