1 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2 Alan Hayward <alan.hayward@arm.com>
3 David Sherwood <david.sherwood@arm.com>
5 * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
7 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
8 Alan Hayward <alan.hayward@arm.com>
9 David Sherwood <david.sherwood@arm.com>
11 * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
14 2017-08-29 Jason Merrill <jason@redhat.com>
16 PR c++/81236 - ICE with template-id in generic lambda
17 * semantics.c (finish_id_expression): Remove special dependent case.
18 Avoid some later pieces when dependent.
19 (finish_qualified_id_expr): Do normal BASELINK handling in a
20 template. Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
21 (parsing_default_capturing_generic_lambda_in_template): Remove.
22 * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
23 error for types that will never be complete.
24 * mangle.c (write_expression): Add sanity check.
25 * tree.c (build_qualified_name): Add sanity check.
26 (cp_walk_subtrees): Walk into the class context of a BASELINK.
27 * lambda.c (add_capture): Improve diagnostic for generic lambda
29 * call.c (build_new_method_call_1): Print the right constructor
32 Reimplement handling of lambdas in templates.
33 * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
34 * decl.c (start_preparsed_function): Call start_lambda_scope.
35 (finish_function): Call finish_lambda_scope.
36 * init.c (get_nsdmi): Call start/finish_lambda_scope.
37 * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
38 * parser.c (cp_parser_function_definition_after_declarator): Don't
39 call start/finish_lambda_scope.
40 * pt.c (retrieve_specialization): Ignore lambda functions in
42 (find_parameter_packs_r): Ignore capture proxies. Look into
44 (check_for_bare_parameter_packs): Allow bare packs in lambdas.
45 (tsubst_default_argument): Call start/finish_lambda_scope.
46 (tsubst_function_decl): Handle lambda functions differently.
47 (tsubst_template_decl): Likewise.
48 (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
50 (tsubst_lambda_expr): Create a new closure rather than instantiate
51 the one from the template.
52 (tsubst_copy_and_build): Don't register a specialization of a pack.
53 (regenerate_decl_from_template): Call start/finish_lambda_scope.
54 (instantiate_decl): Remove special lambda function handling.
55 * semantics.c (process_outer_var_ref): Remove special generic lambda
56 handling. Don't implicitly capture in a lambda in a template. Look
57 for an existing proxy.
58 * class.c (current_nonlambda_class_type): Use decl_type_context.
60 * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
61 (LAMBDA_EXPR_RETURN_TYPE): Remove.
62 (struct tree_lambda_expr): Remove closure and return_type fields.
63 * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
64 * pt.c (tsubst_copy_and_build): Likewise.
65 * parser.c (cp_parser_lambda_declarator_opt): Track return type.
66 (cp_parser_lambda_body): Adjust unspecified return type check.
67 * ptree.c (cxx_print_lambda_node): Don't print closure or
70 PR c++/80935 - wrong C++17 error with lambda
71 * decl.c (check_for_uninitialized_const_var): Check
72 is_instantiation_of_constexpr.
73 * constexpr.c (ensure_literal_type_for_constexpr_object): Check
74 is_instantiation_of_constexpr.
75 (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
77 * lambda.c (build_lambda_object): Check for error_mark_node.
78 * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
80 (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
81 (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
83 PR c++/80767 - unnecessary instantiation of generic lambda
84 * call.c (convert_like_real): Call build_user_type_conversion_1 if
86 (add_conv_candidate): Build a ck_user conversion with no candidate.
88 Fix lambdas in template default argument of inherited ctor.
89 * method.c (synthesized_method_base_walk): Replace an inherited
90 template with its specialization.
91 (synthesized_method_walk): Make inheriting_ctor a pointer.
92 (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
93 (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
95 * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
96 template, not the function.
97 (template_guide_p): Adjust.
99 Support copying local_specializations.
100 * cp-tree.h (enum lss_policy): New.
101 (local_specialization_stack): Add policy parameter to default ctor.
102 * pt.c (local_specialization_stack): Copy local_specializations if
105 * constexpr.c (potential_constant_expression_1): Add "now" parm.
106 (is_constant_expression, require_constant_expression): New.
107 (is_static_init_expression, is_nondependent_constant_expression)
108 (is_nondependent_static_init_expression): Drop "potential".
109 * except.c (build_must_not_throw_expr): Do type conversion on
110 value-dependent argument.
111 * pt.c, semantics.c, typeck2.c: Use variants without "potential".
113 Instantiate default arguments/member initializers once.
114 * init.c (get_nsdmi): Remember NSDMI instantiations.
115 * parser.c (inject_this_parameter): Be more picky about
117 * pt.c (tsubst_copy): Simplify 'this' handling.
118 (tsubst_default_argument): Remember default argument
119 instantiations. Take parameter number.
120 (tsubst_default_arguments): Pass it.
121 * call.c (convert_default_arg): Likewise.
123 Fix default argument conversion failure and SFINAE.
124 * call.c (build_over_call): Check convert_default_arg result for
126 * parser.c (cp_parser_late_parsing_default_args): Remember
129 2017-08-28 Nathan Sidwell <nathan@acm.org>
131 * cp-tree.h (lang_type): Replace sorted_fields vector with
133 (CLASSTYPE_SORTED_FIELDS): Delete.
134 (CLASSTYPE_BINDINGS): New.
135 * decl.c (finish_enum_value_list): Swap args of
136 insert_late_enum_def_bindings.
137 * name-lookup.c (lookup_field_1): Replace binary search of sorted
138 fields with map->get.
139 (sorted_fields_type_new, count_fields,
140 add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
141 (add_class_member, add_class_members): New.
142 (set_class_bindings): Create map and insert.
143 (insert_late_enum_def_binding): Swap parms. Use add_clasS_member.
144 * ptree.c (cxx_print_type): Delete sorted fields printing.
146 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
148 * name-lookup.h (set_class_bindings,
149 insert_late_enum_def_bindings): Declare.
150 * decl.c (finish_enum_value_list): Adjust for
151 insert_late_enum_def_bindings name change.
152 * class.c (finish_struct_1): Call set_class_bindings.
153 (count_fields, add_fields_to_record_type,
154 add_enum_fields_to_record_type, sorted_fields_type_new,
155 insert_into_classtype_sorted_fields,
156 insert_late_enum_def_into_classtype_sorted_fields): Move to ...
157 * name-lookup.h (count_fields, add_fields_to_record_type,
158 add_enum_fields_to_record_type, sorted_fields_type_new,
159 set_class_bindings, insert_late_enum_def_bindings): ... here.
161 2017-08-25 Nathan Sidwell <nathan@acm.org>
163 * class.c (method_name_cmp, resort_method_name_cmp): Methods
166 Conversion operators have a special name
167 * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
168 (conv_op_marker, conv_op_identifier): New.
169 (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
170 * decl.c (initialize_predefined_identifiers): Add
172 (cxx_init_decl_processing): Create conv_op_marker.
173 * decl2.c (check_classfn): Lookup conv-ops by name.
174 * class.c (add_method): Use conv_op_identifier & conv_op_marker.
175 (resort_type_method_vec): Don't skip conv-ops.
176 (finish_struct_methods, warn_hidden): Likewise.
177 * name-lookup.h (lookup_all_conversions): Delete.
178 * name-lookup.c (lookup_conversion_operator): Replace with ...
179 (extract_conversion_operator): ... this.
180 (lookup_fnfields_slot_nolazy): Find conv-ops by name.
181 (lookup_all_conversions): Delete.
182 * pt.c (check_explicit_specialization): Find conv-ops by name.
183 * search.c (lookup_conversions_r): Likewise.
185 2017-08-24 Nathan Sidwell <nathan@acm.org>
187 Conversion operators kept on single overload set
188 * class.c (add_method): Keep all conv-ops on one slot.
189 * name-lookup.c (lookup_conversion_operator): Pull the desired
190 conv op out of overload set.
191 * search.c (lookup_conversions_r): Lose template/non-template
193 (lookup_conversions): Likewise.
195 2017-08-23 Nathan Sidwell <nathan@acm.org>
197 * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
198 lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
200 * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
201 lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
202 * search.c (lookup_conversion_operator,
203 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
204 lookup_all_conversions): Move to ...
205 * name-lookup.c (lookup_conversion_operator,
206 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
207 lookup_all_conversions): ... here.
209 * semantics.c (finish_member_declaration): Move USING_DECL check
210 earlier. Always set C++ linkage. Commonize TYPE_FIELD and
211 template decl list insertion.
213 * cp-tree.h (maybe_version_functions): Declare.
214 * decl.c (decls_match): Break function versioning check to
215 separate function. Call it.
216 (maybe_version_functions): Broken out of decls_match.
217 * class.c (add_method): Use maybe_version_functions.
219 * cp-tree.h (print_search_statistics,
220 reinit_search_statistics): Don't declare.
221 * search.c (n_fields_searched, n_calls_lookup_field,
222 n_calls_lookup_field_1, n_calls_lookup_fnfields,
223 n_calls_lookup_fnfields_1, n_calls_get_base_type,
224 n_outer_fields_searched, n_contexts_saved): Delete.
225 (lookup_field_1, lookup_member,
226 lookup_fnfields_slot_nolazy): Remove stat gathering.
227 (print_search_statistics, reinit_search_statistics): Delete.
228 * tree.c (cxx_print_statistics): Don't print search stats.
230 2017-08-21 Nathan Sidwell <nathan@acm.org>
232 * search.c (lookup_field_r): Remove obsolete code for type-named
235 * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
237 (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
238 (lookup_field_fuzzy_r): Adjust.
240 2017-08-21 David Malcolm <dmalcolm@redhat.com>
242 * call.c (build_over_call): Pass NULL for new parameter to
243 check_function_arguments.
244 * typeck.c (cp_build_function_call_vec): Likewise.
246 2017-08-21 Nathan Sidwell <nathan@acm.org>
249 * pt.c (instantiate_class_template_1):
250 BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
252 2017-08-18 David Malcolm <dmalcolm@redhat.com>
255 * name-lookup.c (maybe_suggest_missing_header): Convert return
256 type from void to bool; return true iff a suggestion was offered.
257 (suggest_alternative_in_explicit_scope): Move call to
258 maybe_suggest_missing_header to before use of best_match, and
259 return true if the former offers a suggestion.
261 2017-08-18 H.J. Lu <hongjiu.lu@intel.com>
264 * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
265 * decl2.c (grokbitfield): Don't allow bit-field with
266 warn_if_not_aligned type.
268 2017-08-17 Nathan Sidwell <nathan@acm.org>
270 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
271 * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
272 (TYPE_TEMPLATE_INFO): Simplify.
273 (SET_TYPE_TEMPLATE_INFO): Simplify.
275 * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
276 don't need lang_type.
277 (cxx_make_type): Use maybe_add_lang_type_raw return value.
278 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
281 * cp-tree.h (struct lang_type): Remove template_info field.
282 (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
283 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
285 2017-08-14 Martin Sebor <msebor@redhat.com>
288 * error.c (cp_printer): Handle 'G'.
290 2017-08-11 Martin Liska <mliska@suse.cz>
292 * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
293 TARGET_SUPPORTS_ALIASES.
294 (handle_tls_init): Likewise.
295 (note_mangling_alias): Likewise. Remove ATTRIBUTE_UNUSED for
297 * optimize.c (can_alias_cdtor): Likewise.
299 2017-08-11 Jason Merrill <jason@redhat.com>
301 PR c++/81671 - nullptr_t template parameter
302 * pt.c (convert_nontype_argument): Fix nullptr_t check.
304 2017-08-10 Jason Merrill <jason@redhat.com>
306 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
307 * method.c (synthesized_method_walk): Don't diagnose lack of
310 PR c++/80452 - Core 1579, implicit move semantics on return/throw
311 * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
312 tentatively changed the lvalue to an rvalue.
313 * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
314 (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
315 parameter is an rvalue reference.
316 * except.c (build_throw): Do maybe-rvalue overload resolution twice.
317 * typeck.c (check_return_expr): Likewise.
319 2017-08-10 David Malcolm <dmalcolm@redhat.com>
321 * parser.c (cp_parser_error): Update for new param to
323 (class token_pair): New class.
324 (struct matching_paren_traits): New struct.
325 (matching_parens): New typedef.
326 (struct matching_brace_traits): New struct.
327 (matching_braces): New typedef.
328 (cp_parser_statement_expr): Convert explicit parsing of
329 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
330 class matching_parens, so that the pertinent open parenthesis is
331 highlighted when there are problems locating the close
333 (cp_parser_primary_expression): Likewise.
334 (cp_parser_compound_literal_p): Remove consumption of opening
336 (cp_parser_postfix_expression): Convert explicit parsing of
337 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
338 above. Use it to consume the opening paren previously consumed by
339 cp_parser_compound_literal_p.
340 (cp_parser_parenthesized_expression_list): Likewise.
341 (cp_parser_unary_expression): Likewise.
342 (cp_parser_new_expression): Likewise.
343 (cp_parser_cast_expression): Likewise.
344 (cp_parser_builtin_offsetof): Likewise.
345 (cp_parser_trait_expr): Likewise.
346 (cp_parser_lambda_declarator_opt): Likewise.
347 (cp_parser_lambda_body): Likewise, for matching_braces.
348 (cp_parser_compound_statement): Likewise.
349 (cp_parser_selection_statement): Likewise, for matching_parens.
350 (cp_parser_iteration_statement): Likewise.
351 (cp_parser_already_scoped_statement): Likewise, for
353 (cp_parser_linkage_specification): Likewise.
354 (cp_parser_static_assert): Likewise, for matching_parens.
355 (cp_parser_decltype): Likewise.
356 (cp_parser_operator): Likewise.
357 (cp_parser_enum_specifier): Likewise.
358 (cp_parser_namespace_definition): Likewise.
359 (cp_parser_direct_declarator): Likewise.
360 (cp_parser_braced_list): Likewise.
361 (cp_parser_class_specifier_1): Likewise, for matching_braces.
362 (cp_parser_constant_initializer): Likewise.
363 (cp_parser_noexcept_specification_opt): Likewise, for
365 (cp_parser_exception_specification_opt): Likewise.
366 (cp_parser_handler): Likewise.
367 (cp_parser_asm_specification_opt): Likewise.
368 (cp_parser_asm_operand_list): Likewise.
369 (cp_parser_gnu_attributes_opt): Likewise.
370 (cp_parser_std_attribute_spec): Likewise.
371 (cp_parser_requirement_parameter_list): Likewise.
372 (cp_parser_requirement_body): Likewise, for matching_braces.
373 (cp_parser_compound_requirement): Likewise.
374 (cp_parser_template_introduction): Likewise.
375 (cp_parser_sizeof_pack): Likewise, for matching_parens.
376 (cp_parser_sizeof_operand): Likewise; use it to consume the
377 opening paren previously consumed by cp_parser_compound_literal_p.
378 (get_matching_symbol): New function.
379 (cp_parser_required_error): Add param "matching_location". Remove
380 calls to cp_parser_error, instead setting a non-NULL gmsgid, and
381 handling it if set by calling c_parse_error, potentially with a
382 secondary location if matching_location was set.
383 (cp_parser_require): Add param "matching_location", with a default
384 value of UNKNOWN_LOCATION.
385 (cp_parser_require_keyword): Update for new param of
386 cp_parser_required_error.
387 (cp_parser_objc_encode_expression): Update to class matching_parens
389 (cp_parser_objc_defs_expression): Likewise.
390 (cp_parser_objc_protocol_expression): Likewise.
391 (cp_parser_objc_selector_expression): Likewise.
392 (cp_parser_objc_typename): Likewise.
393 (cp_parser_objc_superclass_or_category): Likewise.
394 (cp_parser_objc_try_catch_finally_statement): Likewise.
395 (cp_parser_objc_synchronized_statement): Likewise.
396 (cp_parser_objc_at_property_declaration): Likewise.
397 (cp_parser_oacc_single_int_clause): Likewise.
398 (cp_parser_oacc_shape_clause): Likewise.
399 (cp_parser_omp_clause_collapse): Likewise.
400 (cp_parser_omp_clause_default): Likewise.
401 (cp_parser_omp_clause_final): Likewise.
402 (cp_parser_omp_clause_if): Likewise.
403 (cp_parser_omp_clause_num_threads): Likewise.
404 (cp_parser_omp_clause_num_tasks): Likewise.
405 (cp_parser_omp_clause_grainsize): Likewise.
406 (cp_parser_omp_clause_priority): Likewise.
407 (cp_parser_omp_clause_hint): Likewise.
408 (cp_parser_omp_clause_defaultmap): Likewise.
409 (cp_parser_omp_clause_ordered): Likewise.
410 (cp_parser_omp_clause_schedule): Likewise.
411 (cp_parser_omp_clause_num_teams): Likewise.
412 (cp_parser_omp_clause_thread_limit): Likewise.
413 (cp_parser_omp_clause_aligned): Likewise.
414 (cp_parser_omp_clause_linear): Likewise.
415 (cp_parser_omp_clause_safelen): Likewise.
416 (cp_parser_omp_clause_simdlen): Likewise.
417 (cp_parser_omp_clause_depend): Likewise.
418 (cp_parser_omp_clause_device): Likewise.
419 (cp_parser_omp_clause_dist_schedule): Likewise.
420 (cp_parser_oacc_clause_async): Likewise.
421 (cp_parser_omp_critical): Likewise.
422 (cp_parser_omp_for_loop): Likewise.
423 (cp_parser_omp_sections_scope): Likewise.
424 (cp_parser_omp_declare_reduction_exprs): Likewise.
425 Update for new param to cp_parser_required_error.
426 (cp_parser_oacc_routine): Likewise.
427 (cp_parser_transaction_expression): Likewise.
428 (cp_parser_cilk_simd_vectorlength): Likewise.
430 2017-08-09 Jason Merrill <jason@redhat.com>
432 PR c++/81525 - wrong constant value with generic lambda
433 * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
434 (tsubst_copy) [VAR_DECL]: Handle auto.
436 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
437 * init.c (get_nsdmi): Add complain parm.
438 * typeck2.c (digest_nsdmi_init): Add complain parm.
439 (process_init_constructor_record): Pass complain to get_nsdmi.
440 * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
441 * method.c (get_defaulted_eh_spec): Add complain parm. Pass it into
442 synthesized_method_walk.
443 (synthesized_method_walk): Adjust.
444 (walk_field_subobs): Pass complain to get_nsdmi.
445 (defaulted_late_check): Skip other checks if deleted.
446 * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
447 * call.c (build_aggr_conv): Pass complain to get_nsdmi.
448 * parser.c (defarg_location): New.
449 * error.c (location_of): Use it.
451 2017-08-09 Marek Polacek <polacek@redhat.com>
453 * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
454 * typeck.c (build_binary_op): Change the type of a parameter to bool.
455 (cp_truthvalue_conversion): Use true instead of 1.
457 2017-08-08 Marek Polacek <polacek@redhat.com>
460 * cp-gimplify.c (cp_fold): If folding exposed a branch of
461 a COND_EXPR, convert it to the original type of the COND_EXPR, if
464 2017-08-08 Martin Liska <mliska@suse.cz>
466 * call.c: Include header files.
467 * cp-gimplify.c: Likewise.
468 * cp-ubsan.c: Likewise.
471 * search.c: Likewise.
472 * semantics.c: Likewise.
473 * typeck.c: Likewise.
475 2017-08-07 Martin Liska <mliska@suse.cz>
477 * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
479 (cp_parser_std_attribute): Likewise.
480 * tree.c: Add new include.
482 2017-08-04 Paolo Carlini <paolo.carlini@oracle.com>
485 * pt.c (do_class_deduction): Handle the case of no viable implicit
486 deduction guides; simplify the code generating implicit deduction
489 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
492 * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
493 destructor as expressions.
495 2017-08-02 Jakub Jelinek <jakub@redhat.com>
498 * call.c (build_user_type_conversion_1): Only call
499 lookup_fnfields_slot if totype is CLASS_TYPE_P.
501 2017-07-31 Jason Merrill <jason@redhat.com>
503 * decl.c (declare_global_var): Set DECL_CONTEXT.
505 2017-07-31 Jan Hubicka <hubicka@ucw.cz>
506 Martin Liska <mliska@suse.cz>
508 * pt.c (tsubst_copy): Copy PREDICT_EXPR.
509 * semantics.c (finish_goto_stmt): Build gimple predict
511 * constexpr.c (potential_constant_expression_1): Handle
514 2017-07-31 Martin Liska <mliska@suse.cz>
517 * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
518 also with current_function_decl non-null equality.
519 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
520 * decl.c (compute_array_index_type): Likewise.
521 * init.c (finish_length_check): Likewise.
522 * typeck.c (cp_build_binary_op): Likewise.
524 2017-07-29 Jakub Jelinek <jakub@redhat.com>
526 * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
527 DW_AT_export_symbols.
528 * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
529 argument, pass it through to the debug hook.
530 (finish_namespace_using_directive): Adjust
531 emit_debug_info_using_namespace caller.
532 (push_namespace): Likewise. Call it after setting
533 DECL_NAMESPACE_INLINE_P.
534 (cp_emit_debug_info_for_using): Pass false as new argument to
535 the imported_module_or_decl debug hook.
537 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
539 * lex.c (copy_decl): Adjust.
540 (copy_type): Likewise.
542 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
545 * lambda.c (add_capture): Early return if we cannot capture by
548 2017-07-26 Jason Merrill <jason@redhat.com>
550 P0702R1 - List deduction of vector.
551 * pt.c (do_class_deduction): Special-case deduction from a single
552 element of related type.
554 2017-07-26 Leonid Koppel <lkoppel@uwaterloo.ca>
556 PR c++/67054 - Inherited ctor with non-default-constructible members
557 * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
558 when deducing an inheriting constructor.
560 2017-07-21 Nathan Sidwell <nathan@acm.org>
562 * search.c (lookup_conversion_operator): Return overloads.
563 (lookup_fnfields_idx_nolazy): Absorb into ...
564 (lookup_fnfields_slot_nolaxy): ... here.
565 (lookup_fnfields_1): Absorb into ...
566 (lookup_fnfields_slot): ... here.
568 Remove special CDtor METHOD_VEC slots.
569 * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
570 CLASSTYPE_DESTRUCTOR_SLOT): Delete.
571 (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
572 (CLASSTYPE_DESTRUCTOR): Likewise.
573 * class (add_method): Don't use special cdtor slots.
574 * search.c (lookup_fnfields_idx_nolazy): Likewise.
575 (look_for_overrides_here): Use lookup_fnfields_slot.
576 * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
578 * call.c (add_candidates): Move decls to initialization. Don't
581 2017-07-20 Nathan Sidwell <nathan@acm.org>
584 * class.c (maybe_warn_about_overly_private_class,
585 finish_struct_methods, one_inheriting_sig, count_fields,
586 add_fields_to_record_type, check_field_decls, check_methods,
587 clone_function_decl, set_method_tm_attributes,
588 finalize_literal_type_property, check_bases_and_members,
589 create_vtable_ptr, determine_key_method,
590 unreverse_member_declarations, finish_struct,
591 add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
592 * decl.c (fixup_anonymous_aggr): Likewise.
593 * decl2.c (reset_type_linkage_2): Likewise.
594 * method.c (after_nsdmi_defaulted_late_checks,
595 lazily_declare_fn): Likewise.
596 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
597 * pt.c (instantiate_class_template_1, tsubst_expr,
598 do_type_instantiation, instantiate_pending_templates): Likewise.
599 * search.c (lookup_field_1): Likewise.
600 * semantics.c (finish_member_declaration,
601 finish_omp_declare_simd_methods): Likewise.
603 2017-07-19 Nathan Sidwell <nathan@acm.org>
605 * class.c (add_implicitly_declared_members): Use
606 classtype_has_move_assign_or_move_ctor_p.
607 (classtype_has_move_assign_or_move_ctor,
608 classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
609 (classtype_has_move_assign_or_move_ctor_p): ... this new function.
610 * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
612 (classtype_has_move_assign_or_move_ctor_p): ... this.
613 * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
614 * tree.c (type_has_nontrivial_copy_init): Adjust.
616 * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
617 PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
619 2017-07-18 Nathan Sidwell <nathan@acm.org>
621 * cp-array-notation.c (build_array_notation_ref): Use
622 TYPE_{MIN,MAX}_VALUE.
624 * class.c (classtype_has_move_assign_or_move_ctor): Declare.
625 (add_implicitly_declared_members): Use it.
626 (type_has_move_constructor, type_has_move_assign): Merge into ...
627 (classtype_has_move_assign_or_move_ctor): ... this new function.
628 * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
630 2017-07-17 Volker Reichelt <v.reichelt@netcologne.de>
632 * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
633 friend outside class and obsolete auto as storage-class-specifier.
635 2017-07-17 Nathan Sidwell <nathan@acm.org>
637 * class.c (maybe_warn_about_overly_private_class): Ignore public
640 * class.c (type_has_user_declared_move_constructor,
641 type_has_user_declared_move_assign): Combine into ...
642 (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
643 * cp-tree.h (type_has_user_declared_move_constructor,
644 type_has_user_declared_move_assign): Combine into ...
645 (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
646 * method.c (maybe_explain_implicit_delete): Use it.
647 (lazily_declare_fn): Use it.
648 * tree.c (type_has_nontrivial_copy_init): Use it.
650 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
651 semantics, simplify implementation.
653 2017-07-16 Volker Reichelt <v.reichelt@netcologne.de>
655 * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
656 in old-style cast diagnostic.
657 * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
658 in useless cast diagnostic.
659 * error.c (type_to_string): Remove enum special handling.
661 2017-07-14 David Malcolm <dmalcolm@redhat.com>
663 * name-lookup.c (get_std_name_hint): Add '<' and '>' around
665 (maybe_suggest_missing_header): Update for addition of '<' and '>'
666 to above. Provide a fix-it hint.
667 * pt.c: Include "gcc-rich-location.h"
668 (listify): Attempt to add fix-it hint for missing
669 #include <initializer_list>.
670 * rtti.c: Include "gcc-rich-location.h".
671 (typeid_ok_p): Attempt to add fix-it hint for missing
674 2017-07-12 Jason Merrill <jason@redhat.com>
676 P0512R0 - Deduction from an initializer list.
677 * pt.c (do_class_deduction): Do list deduction in two phases.
679 2017-07-12 Nathan Sidwell <nathan@acm.org>
681 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
682 DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
684 * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
685 DECL_CXX_DESTRUCTOR explicitly.
686 * decl2.c (grokclassfn): Likewise.
687 * friend.c (do_friend): Likewise.
688 * method.c (make_thunk, make_alias_for,
689 implicitly_declare_fn): Likewise.
691 2017-07-11 Jason Merrill <jason@redhat.com>
694 * decl.c (grokparms): Downgrade error about array of unknown bound
695 to pedwarn and disable it for C++17.
697 2017-07-11 Nathan Sidwell <nathan@acm.org>
699 * decl2.c (reset_type_linkage_2): Dont't change ctor name.
701 2017-07-10 Martin Sebor <msebor@redhat.com>
703 * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
705 2017-07-06 Jason Merrill <jason@redhat.com>
707 PR c++/81204 - parse error with dependent template-name
708 * parser.c (cp_parser_lookup_name): Revert previous change.
710 2017-07-06 David Malcolm <dmalcolm@redhat.com>
712 * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
713 selftest::run_cp_tests.
714 (selftest::run_cp_tests): New function.
715 * cp-tree.h (selftest::run_cp_tests): New decl.
717 2017-07-04 Jakub Jelinek <jakub@redhat.com>
719 * parser.c (cp_parser_decomposition_declaration): Replace
720 decomposition declaration with structured binding in diagnostics.
721 * decl.c (cp_finish_decomp): Likewise.
722 (grokdeclarator): Likewise.
725 * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
726 forms of structured binding initializers.
728 2017-07-03 Paolo Carlini <paolo.carlini@oracle.com>
731 * decl.c (grokdeclarator): Move checks on function return type after
732 the splice_late_return_type call; if declspecs->locations[ds_type_spec]
733 is UNKNOWN_LOCATION fall back to input_location.
735 2017-07-03 David Malcolm <dmalcolm@redhat.com>
737 * parser.c (enum required_token): Fix spelling of
738 RT_INTERATION to RT_ITERATION.
739 (cp_parser_iteration_statement): Likewise.
740 (cp_parser_required_error): Likewise.
742 2017-06-30 Jason Merrill <jason@redhat.com>
744 PR c++/81257 - ICE with invalid ::template.
745 PR c++/54769 - wrong lookup of dependent template-name.
746 * parser.c (cp_parser_template_name): Revert part of last change.
748 2017-06-30 Nathan Sidwell <nathan@acm.org>
750 * config-lang.in (gtfiles): Add cp/lex.c.
751 * cp-tree.h (mangle_convop_name_for_type): Rename ...
752 (make_conv_op_name): ... here. Move to lex.
753 * lambda.c (maybe_add_lambda_conv_op): Update.
754 * parser.c (cp_parser_conversion_function_id): Update.
755 * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
756 tsubst_copy_and_build): Update.
757 * semantics.c (apply_deduced_return_type): Update.
758 * mangle.c (conv_type_hasher, conv_type_names,
759 mangle_conv_op_name_for_type): Move to ...
760 * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
763 2017-06-30 David Malcolm <dmalcolm@redhat.com>
766 * parser.c (cp_parser_postfix_expression): Construct a location
767 for typeid expressions.
769 2017-06-30 Nathan Sidwell <nathan@acm.org>
771 * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
773 (lookup_all_conversions): Declare.
774 * class.c (get_basefndecls): Use lookup_fnfields_slot.
775 * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
776 * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
778 * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
779 (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
780 lookup_all_conversions.
781 * search.c (lookup_fnfields_1): Make static.
782 (lookup_all_conversions): New.
783 (class_method_index_for_fn): Delete.
784 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
785 lookup_fnfields_slot.
787 * call.c (build_new_method_call_1): Use constructo_name to get
788 ctor name. Move argument processing earlier to merge cdtor
790 * decl.c (grokfndecl): Cdtors have special names.
791 * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
792 * pt.c (check_explicit_specialization): Cdtor name is already
794 * search.c (class_method_index_for_fn): Likewise.
797 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
798 a matching TYPE_DECL.
800 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
802 * class.c (add_method): Change pair of errors to error + inform.
803 (handle_using_decl): Likewise.
805 2017-06-29 Jason Merrill <jason@redhat.com>
807 * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
809 PR c++/81180 - ICE with C++17 deduction of member class template.
810 * pt.c (build_deduction_guide): Correct member template handling.
812 PR c++/81188 - matching decltype of member function call.
813 * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
815 2017-06-29 Nathan Sidwell <nathan@acm.org>
818 * parser.c (cp_parser_namespace_definition): Immediately close the
819 namespace if there's no open-brace.
820 * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
823 2017-06-29 Jason Merrill <jason@redhat.com>
825 PR c++/81164 - ICE with invalid inherited constructor.
826 * search.c (binfo_direct_p): New.
827 * name-lookup.c (do_class_using_decl): Use it.
829 2017-06-29 Nathan Sidwell <nathan@acm.org>
831 * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
832 VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
833 * decl.c (initialize_predefined_identifiers): Name cdtor special
834 names consistently. Use literals for above deleted defines.
835 (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
837 * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
840 * call.c (check_dtor_name): Use constructor_name for enums too.
841 (build_new_method_call_1): Use constructor_name for cdtors and
843 * class.c (build_self_reference): Use TYPE_NAME to get name of
845 * name-lookup (constructor_name): Use DECL_NAME directly.
846 (constructor_name_p): Reimplement.
847 (push_class_level_binding_1): Use TYPE_NAME directly.
849 * class.c (finish_struct): Use OVL_P.
850 (get_vfield_name): Measure constructor_name length.
851 * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
852 (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
853 * cxx-pretty-print.c (is_destructor_name): Delete.
854 (pp_cxx_unqualified_id): Remove bogus destructor name checking.
855 * decl.c (grokfndecl): Move cheap checks first when looking for
856 implicit extern cness.
858 * parser.c (cp_parser_direct_declarator): Reorder if to avoid
859 indentation. Remove unnecessary assignment of constructor name.
862 * call.c (name_as_c_string): Move CONST_CAST to return.
863 (build_new_method_call_1): Remove unneeded bracing.
864 * class.c (include_empty_classes): Unbreak line.
865 * constraint.cc (tsubst_check_constraint): Add space.
866 * cp-tree.h (lang_decl_ns): Add comment.
867 (PTRMEM_CST_MEMBER): Break line.
868 * decl.c (grokfndecl): Add blank lines. Unbreak some others.
869 (grokdeclarator): Remove lines, move declaration to first use.
870 * decl2.c (decl_needed_p): Fix indentation.
871 (c_parse_final_cleanups): Remove blank line.
872 * method.c (implicitly_declare_fn): Move declaration to first use.
873 * search.c (current_scope): Add blank lines.
875 2017-06-28 Jason Merrill <jason@redhat.com>
877 PR c++/72764 - ICE with invalid template typename.
878 * decl.c (build_typename_type): No longer static.
879 * tree.c (strip_typedefs): Use it instead of make_typename_type.
881 PR c++/69300 - ICE with self-referential noexcept
882 * pt.c (maybe_instantiate_noexcept): Check for recursion.
884 PR c++/61022 - error with variadic template template parm
885 * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
887 PR c++/72801 - ICE with variadic partial specialization
888 * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
890 PR c++/55639 - partial specialization with ::template
891 * parser.c (cp_parser_class_head): Handle ::template.
893 PR c++/45976 - error with ::template in declarator.
894 * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
896 PR c++/54769 - wrong lookup of dependent template-name.
897 * parser.c (cp_parser_template_name): Handle dependent object type.
898 (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
900 (cp_parser_id_expression): Pass it.
901 (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
903 * parser.c (cp_parser_template_id): Use the range location on the
906 PR c++/81204 - parse error with dependent template-name
907 * parser.c (cp_parser_lookup_name): Disqualify function templates
910 2017-06-27 Nathan Sidwell <nathan@acm.org>
912 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
913 initialization point. Don't unnecessarily check for ctor name.
915 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
916 (CLASSTYPE_DESTRUCTOR): ... this.
917 * class.c (accessible_nvdtor_p,
918 maybe_warn_about_overly_private_class,
919 add_implicitly_declared_members,
920 clone_constructors_and_destructors, type_has_virtual_destructor):
921 Adjust for CLASSTYPE_DESTRUCTOR.
922 (deduce_noexcept_on_destructors): Absorb into ...
923 (check_bases_and_members): ... here.
924 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
925 * init.c (build_delete): Likewise.
926 * parser.c (cp_parser_lookup_name): Likewise.
927 * pt.c (check_explicit_specialization): Likewise.
928 * rtti.c (emit_support_tinfos): Likewise.
929 * search.c (lookup_fnfields_idx_nolazy): Likewise.
931 Kill IDENTIFIER_TEMPLATE.
932 * cp-tree.h (lang_identifier): Remove class_template_info field.
933 (IDENTIFIER_TEMPLATE): Delete.
934 * name-lookup.c (constructor_name_full): Subsume into ...
935 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
936 (constructor_name_p): Likewise.
937 * mangle.c (write_source_name): Likewise.
938 * ptree.c (cxx_print_identifier): Likewise.
940 2017-06-27 Marek Polacek <polacek@redhat.com>
943 * parser.c (cp_parser_already_scoped_statement): Initialize
946 2017-06-26 Jason Merrill <jason@redhat.com>
948 PR c++/81215 - deduction failure with variadic TTP.
949 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
951 2017-06-26 Martin Sebor <msebor@redhat.com>
954 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
955 to detect casting away cv-qualifiers.
957 2017-06-26 Nathan Sidwell <nathan@acm.org>
959 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
960 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
962 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
963 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
964 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
965 * decl.c (grok_op_properties): Adjust identifier checking.
966 * init.c (expand_default_init): Adjust identifier descision.
967 * method.c (implicitly_declare_fn): Don't use
968 DECL_ASSIGNMENT_OPERATOR_P.
969 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
971 * call.c (in_charge_arg_for_name): Reimplement.
972 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
975 2017-06-26 Marek Polacek <polacek@redhat.com>
978 * parser.c (cp_parser_statement): Add a default argument. Save the
979 location of the expression-statement after labels have been parsed.
980 (cp_parser_implicitly_scoped_statement): Set the location of the
981 body of the conditional after parsing all the labels. Call
982 warn_for_multistatement_macros.
983 (cp_parser_already_scoped_statement): Likewise.
985 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
988 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
989 'typename' in error messages about missing 'typename'.
991 2017-06-23 Jason Merrill <jason@redhat.com>
993 PR c++/79056 - C++17 ICE with invalid template syntax.
994 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
996 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
997 * pt.c (template_placeholder_p): New.
998 * cp-tree.h: Declare it.
1000 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
1002 * decl.c (duplicate_decls): Use builtin_structptr_types.
1004 2017-06-22 Nathan Sidwell <nathan@acm.org>
1006 Reorder IDENTIFIER flags
1008 * cp-tree.h (enum cp_identifier_kind): New.
1009 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
1010 IDENTIFIER_KIND_BIT_2): New.
1011 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
1012 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
1013 (C_IS_RESERVED_WORD): Replace with ...
1014 (IDENTIFIER_KEYWORD_P): ... this.
1015 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
1016 (IDENTIFIER_CDTOR_P): ... this.
1017 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
1018 (IDENTIFIER_OPNAME_P): Replace with ...
1019 (IDENTIFIER_ANY_OP_P): ... this.
1020 (IDENTIFIER_ASSIGN_OP_P): New.
1021 (IDENTIFIER_TYPENAME_P): Replace with ...
1022 (IDENTIFIER_CONV_OP_P): ... this.
1023 (NEW_DELETE_OPNAME_P): Replace with ...
1024 (IDENTIFIER_NEWDEL_OP_P): ... this.
1025 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
1026 (get_identifier_kind_name, set_identifier_kind): Declare.
1027 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
1028 (init_operators): Adjust to avoid keywords, use
1029 set_identifier_kind. Copy TYPE_EXPR slot.
1030 (init_reswords): Call set_identifier_kind.
1031 (unqualified_name_lookup_error): Adjust.
1032 * operators.def (TYPE_EXPR): Remove.
1033 * decl.c (struct predefined_identifier): Move into ...
1034 (initialize_predefined_identifiers): ... here. Call
1035 set_identifier_kind.
1036 (grokfndecl, check_var_type, grokdeclarator): Adjust.
1037 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
1039 * call.c (name_as_c_string): Adjust.
1040 (build_new_method_call_1): Likewise.
1041 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
1042 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
1043 * dump.c (cp_dump_tree): Adjust.
1044 * error.c (dump_decl_name): Adjust.
1045 * mangle.c (write_unqualified_id, write_member_name,
1046 write_expression): Adjust.
1047 (mangle_conv_op_name_for_type): Use set_identifier_kind.
1048 * name-lookup.c (do_class_using_decl): Adjust.
1049 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
1050 * parser.c (cp_lexer_get_preprocessor_token,
1051 cp_parser_direct_declarator): Likewise.
1052 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
1053 tsubst_copy, tsubst_copy_and_build): Adjust.
1054 * ptree.c (cxx_print_identifier): Print identifier kind.
1055 * search.c (lookup_field_r, lookup_member,
1056 lookup_fnfields_idx_nolazy): Adjust.
1057 * semantics.c (finish_id_expression): Adjust..
1058 * typeck.c (cp_build_addr_expr_1): Adjust.
1060 2017-06-21 Jakub Jelinek <jakub@redhat.com>
1063 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
1064 Complain about t not being a variable if t is OVERLOAD even
1065 when processing_template_decl.
1067 2017-06-21 David Malcolm <dmalcolm@redhat.com>
1069 * parser.c (get_cast_suggestion): New function.
1070 (maybe_add_cast_fixit): New function.
1071 (cp_parser_cast_expression): Capture the location of the closing
1072 parenthesis. Call maybe_add_cast_fixit when emitting warnings
1073 about old-style casts.
1075 2017-06-20 Jason Merrill <jason@redhat.com>
1077 PR c++/80972 - C++17 ICE with attribute packed.
1078 * call.c (build_over_call): Allow a TARGET_EXPR from reference
1081 2017-06-20 Nathan Sidwell <nathan@acm.org>
1083 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
1084 (nelts_identifier): Delete.
1085 * decl.c (initialize_predefined_identifiers): Remove nelts.
1087 PR c++/67074 - namespace aliases
1088 * decl.c (duplicate_decls): Don't error here on mismatched
1090 * name-lookup.c (name_lookup::add_value): Matching namespaces are
1092 (diagnose_name_conflict): Namespaces are never redeclarations.
1093 (update_binding): An alias can match a real namespace.
1095 2017-06-19 Jason Merrill <jason@redhat.com>
1097 PR c++/80562 - ICE with constexpr if.
1098 * semantics.c (finish_if_stmt_cond): Call
1099 instantiate_non_dependent_expr.
1101 PR c++/80829 - ICE with constexpr copy of base subobject.
1102 * constexpr.c (clear_no_implicit_zero): New.
1103 (cxx_eval_call_expression): Call it.
1105 2017-06-19 Nathan Sidwell <nathan@acm.org>
1109 * name-lookup.c (set_decl_namespace): Don't follow using
1110 directives and ignore using decls. Only check overly-explicit
1111 scope after discovering decl.
1113 2017-06-19 Jason Merrill <jason@redhat.com>
1115 PR c++/81073 - constexpr and static var in statement-expression.
1116 * typeck2.c (store_init_value): Always call
1117 require_potential_constant_expression.
1118 * pt.c (convert_nontype_argument): Likewise.
1119 * constexpr.c (potential_constant_expression_1): Adjust message.
1120 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
1121 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
1123 2017-06-19 Nathan Sidwell <nathan@acm.org>
1125 * pt.c (coerce_template_parms): Fix indentation.
1126 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
1130 * name-lookup.c (update_binding): Only warn about constructors
1131 hidden by functions.
1133 2017-06-17 Jason Merrill <jason@redhat.com>
1135 PR c++/60063 - -Wunused-local-typedefs and templates.
1136 * decl2.c (is_late_template_attribute): Return false for "used".
1138 PR c++/70844 - -Wuseless-cast and inheriting constructor.
1139 * method.c (forward_parm): Suppress warn_useless_cast.
1141 2017-06-16 Jason Merrill <jason@redhat.com>
1143 PR c++/81045 - Wrong type-dependence with auto return type.
1144 * pt.c (type_dependent_expression_p): An undeduced auto outside the
1145 template isn't dependent.
1146 * call.c (build_over_call): Instantiate undeduced auto even in a
1149 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
1150 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
1151 set longer for a generic lambda.
1153 PR c++/80614 - Wrong mangling for C++17 noexcept type
1154 * mangle.c (write_type): Put the eh spec back on the function type.
1156 PR c++/81102 - Wrong error with partial specialization.
1157 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
1158 types. Do type deduction later.
1160 PR c++/81074 - ICE with partial specialization of member template.
1162 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
1164 PR c++/80831 - ICE with -fsyntax-only.
1165 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
1167 PR c++/80639 - ICE with invalid PMF initialization.
1168 PR c++/80043 - ICE with -fpermissive
1169 * typeck.c (convert_for_assignment): Recurse when instantiate_type
1170 returns without an error.
1172 2017-06-16 Nathan Sidwell <nathan@acm.org>
1174 * pt.c (tsubst_baselink): Fix & clarify formatting.
1176 * cp-tree.h (build_this_parm, cp_build_parm_decl,
1177 build_artificial_parm): Add FN parm.
1178 * decl.c (start_cleanup_fn): Adjust.
1179 (build_this_parm): Add FN parm, pass it through.
1180 (grokfndecl): Adjust parm building.
1181 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
1182 (build_artificial_parm): Add FN parm, pass through.
1183 (maybe_retrofit_in_chrg): Adjust parm building.
1184 (start_static_storage_duration_function): Likwise.
1185 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
1186 * method.c (implicitly_declare_fn): Likewise.
1187 * parser.c (inject_this_parameter): Likewise.
1189 Symbol tables are insert only.
1190 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
1191 derive from pointer_hash. Make undeletable.
1193 * class.c (resort_type_method_vec): Avoid potential unsigned
1196 Don't defer noexcept_deferred_spec.
1197 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
1198 * decl.c (cxx_init_decl_processing): Initialize
1199 noexcept_deferred_spec.
1200 * except.c (unevaluated_noexcept_spec): Delete.
1201 * class.c (deduce_noexcept_on_destructor): Use
1202 noexcept_deferred_spec directly.
1203 * method.c (implicitly_declare_fn): Likewise.
1205 Make keyed_classes a vector.
1206 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
1207 (keyed_classes): Declare as vector.
1208 * decl.c (keyed_classes): Define.
1209 (cxx_init_decl_processing): Allocate it.
1210 (record_key_method_defined): Use vec_safe_push.
1211 * class.c (finish_struct_1): Likewise.
1212 * pt.c (instantiate_class_template_1): Likewise.
1213 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
1216 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
1217 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
1219 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
1220 (get_tinfo_decl): Use get_tinfo_desc.
1221 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
1222 (create_pseudo_type_info): Delete.
1223 (get_pseudo_ti_index): Just determine the index.
1224 (get_tinfo_desc): New. Create all types lazily.
1225 (create_tinfo_types): Just allocate the descriptor array.
1226 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
1229 2017-06-15 Martin Sebor <msebor@redhat.com>
1232 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
1234 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
1235 (build_cxx_call): Call maybe_warn_class_memaccess.
1237 2017-06-14 Jakub Jelinek <jakub@redhat.com>
1239 * cp-gimplify.c (cp_genericize_r): Turn most of the function
1240 into a switch (TREE_CODE (stmt)) statement from long else if
1243 2017-06-13 Jakub Jelinek <jakub@redhat.com>
1246 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
1247 argument even if it has REFERENCE_TYPE.
1250 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
1251 BLOCK_VARS (outer) chain.
1252 (cxx_omp_const_qual_no_mutable): Likewise.
1254 2017-06-13 Martin Liska <mliska@suse.cz>
1257 * class.c (build_base_path): Use sanitize_flags_p.
1258 * cp-gimplify.c (cp_genericize_r): Likewise.
1259 (cp_genericize_tree): Likewise.
1260 (cp_genericize): Likewise.
1261 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1262 * decl.c (compute_array_index_type): Likewise.
1263 (start_preparsed_function): Likewise.
1264 * decl2.c (one_static_initialization_or_destruction): Likewise.
1265 * init.c (finish_length_check): Likewise.
1266 * lambda.c (maybe_add_lambda_conv_op): Likewise.
1267 * typeck.c (cp_build_binary_op): Likewise.
1268 (build_static_cast_1): Likewise.
1270 2017-06-11 Jason Merrill <jason@redhat.com>
1272 * error.c (dump_expr): Use is_this_parameter.
1274 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
1277 2017-06-09 Jason Merrill <jason@redhat.com>
1279 Missing bits from N4268, constant evaluation for all non-type args.
1280 * call.c (build_converted_constant_expr): Rename from
1281 build_integral_nontype_arg_conv, handle all types.
1282 * pt.c (convert_nontype_argument): In C++17 call it for all types.
1283 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
1284 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
1286 Overhaul pointer-to-member conversion and template argument handling.
1287 * call.c (standard_conversion): Avoid creating ck_pmem when the
1288 class type is the same.
1289 * cvt.c (can_convert_qual): Split from
1290 perform_qualification_conversions.
1291 * constexpr.c (cxx_eval_constant_expression): Check it.
1292 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
1293 adjustment is necessary.
1294 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
1295 (convert_nontype_argument): Avoid redundant error.
1297 * call.c (convert_like_real): Remove "inner" parameter.
1298 Don't replace a constant with its value.
1299 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
1301 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
1304 * parser.c (cp_parser_constant_expression): Check
1305 potential_rvalue_constant_expression after decay_conversion.
1306 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
1308 PR c++/80384 - ICE with dependent noexcept-specifier
1309 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
1312 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
1314 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
1316 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
1317 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
1318 (excpet.c): Mark terminate as cold.
1320 2017-06-08 Jakub Jelinek <jakub@redhat.com>
1323 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
1324 to sizetype before size_binop.
1327 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
1328 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
1329 and OMP_CLAUSE_SHARED_READONLY flags.
1331 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
1333 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
1335 2017-06-07 Nathan Sidwell <nathan@acm.org>
1337 * class.c (layout_class_type): Restructure overlong-bitfield tpe
1340 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
1343 * pt.c (do_class_deduction): Build qualified type.
1345 2017-06-06 Nathan Sidwell <nathan@acm.org>
1347 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
1348 sans using directives. Don't walk into inline namespaces.
1351 * name-lookup.c (adl_class_only): Don't add visible friends.
1353 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
1355 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
1357 2017-06-02 Nathan Sidwell <nathan@acm.org>
1359 Remove lang_type_ptrmem.
1360 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
1362 (lang_type_class): ... this. Reorder bitfields. Rename to ...
1363 (lang_type): ... this. Delete old definition.
1364 (lang_type_ptrmem): Delete.
1365 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
1366 (LANG_TYPE_PTRMEM_CHECK): Delete.
1367 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
1368 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
1369 * decl.c (build_ptrmemfunc_type): Adjust.
1370 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
1371 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
1373 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
1376 Remove cp_binding_level::namespaces
1377 * name-lookup.h (cp_binding_level): Lose namespaces field.
1378 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
1380 (suggest_alternatives_for): Adjust for namespace list. Do
1381 breadth-first search.
1382 * decl2.c (collect_source_refs): Namespaces are on the regulr
1384 (collect_ada_namespace): Likewise.
1386 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
1388 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
1391 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
1394 * method.c (constructible_expr): Strip array types before calling
1397 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
1400 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
1401 for case INDIRECT_REF too in the main switch.
1403 2017-05-31 Jason Merrill <jason@redhat.com>
1405 PR c++/80840 - ICE with constexpr and reference
1406 * pt.c (convert_nontype_argument): Don't test whether a decl is
1407 value-dependent when binding to a reference.
1409 2017-05-31 Nathan Sidwell <nathan@acm.org>
1411 * cp-tree.h (lang_decl_slector): New enum.
1412 (lang_decl_base): Make selector an enum. Drop decomposition_p
1414 (lang_decl): Use enum for discrimination.
1415 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
1416 LANG_DECL_DEOMP_CHECK): Use enum.
1417 (DECL_DECOMPOSITION_P): Use selector value.
1418 (SET_DECL_DECOMPOSITION_P): Delete.
1419 (retrofit_lang_decl): Lose SEL parm.
1420 (fit_decomposition_lang_decl): Declare.
1421 * decl.c (cp_finish_decomp, grokdeclarator): Use
1422 fit_decomposition_lang_decl.
1423 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
1425 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
1426 (fit_decomposition_lang_decl): Likewise.
1427 (retrofit_lang_decl): Use worker functions.
1428 (cxx_dup_lang_specific_decl): Use selector enum.
1429 (maybe_add_lang_type_raw): New. Broken out of ...
1430 (cxx_make_type_name): ... here. Call it.
1432 2017-05-30 Jason Merrill <jason@redhat.com>
1434 PR c++/80856 - ICE with local extern in template
1435 * semantics.c (finish_call_expr): Replace a local extern overload
1436 set in a template with the IDENTIFIER_NODE.
1438 2017-05-30 David Malcolm <dmalcolm@redhat.com>
1440 * call.c (perform_implicit_conversion_flags): Convert
1441 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
1442 (print_conversion_rejection): Replace pairs of %qT with
1443 %qH and %qI in various places.
1444 (build_user_type_conversion_1): Likewise.
1445 (build_integral_nontype_arg_conv): Likewise.
1446 (build_conditional_expr_1): Likewise.
1447 (convert_like_real): Likewise.
1448 (convert_arg_to_ellipsis): Likewise.
1450 (initialize_reference): Likewise.
1451 * cvt.c (cp_convert_to_pointer): Likewise.
1452 (cp_convert_to_pointer): Likewise.
1453 (convert_to_reference): Likewise.
1454 (ocp_convert): Likewise.
1455 * error.c (cp_printer): Gain bool and const char ** parameters.
1456 (struct deferred_printed_type): New struct.
1457 (class cxx_format_postprocessor): New class.
1458 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
1459 to pp->m_format_postprocessor.
1460 (comparable_template_types_p): New function.
1461 (newline_and_indent): New function.
1462 (arg_to_string): New function.
1463 (print_nonequal_arg): New function.
1464 (print_template_differences): New function.
1465 (type_to_string_with_compare): New function.
1466 (print_template_tree_comparison): New function.
1467 (append_formatted_chunk): New function.
1468 (add_quotes): New function.
1469 (cxx_format_postprocessor::handle): New function.
1470 (defer_phase_2_of_type_diff): New function.
1471 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
1473 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
1474 %qH and %qI in various places.
1475 (convert_member_func_to_ptr): Likewise.
1476 (build_reinterpret_cast_1): Likewise.
1477 (convert_for_assignment): Likewise.
1478 * typeck2.c (check_narrowing): Likewise.
1480 2017-05-30 Nathan Sidwell <nathan@acm.org>
1482 Kill IDENTIFIER_NAMESPACE_BINDINGS
1483 * cp-tree.h (lang_identifier): Delete namespace_bindings.
1484 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
1485 (lang_decl_ns): Add bindings.
1486 (DECL_NAMESPACE_BINDINGS): New.
1487 * lex.c (retrofit_lang_decl): Create namespace hash table.
1488 * name-lookup.c (find_namespace_slot): Change to use hash-map.
1489 * ptree.c (cxx_print_binding): Delete.
1490 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
1492 * cp-tree.def (OVERLOAD): Fix comment.
1493 * cp-tree.h: Fix comments and whitespace.
1494 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
1495 * name-lookup.c (add_decl_to_level): Assert not class.
1496 (check_local_shadow): Use OVL_P.
1497 (pushdecl_with_scope_1): Rename to ...
1498 (do_pushdecl_with_Scope): ... here.
1499 (do_nonmember_using_decl): Use qualified_namespace_lookup return
1501 (push_class_level_binding_1): Use OVL_P.
1502 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
1503 (pushtag_1): Rename to ...
1504 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
1506 (store_class_bindings): Do not time here.
1507 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
1508 * pt.c (listify): Declare argvec at point of initialization.
1511 * name-lookup.c (add_decl_to_level): Assert not making a circular
1513 (update_binding): Don't prematurely slide artificial decl.
1515 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
1517 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
1519 2017-05-29 Nathan Sidwell <nathan@acm.org>
1521 PR c++/80891 (#1,#5)
1522 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
1523 * name-lookup.c (name_lookup): Add deduping field.
1524 (name_lookup::preserve_state, name_lookup::restore_state): Deal
1526 (name_lookup::add_overload): New.
1527 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
1528 (name_lookup::search_adl): Set deduping. Don't unmark here.
1529 * pt.c (most_specialized_instantiation): Revert previous change,
1530 Assert not given duplicates.
1531 * tree.c (lookup_mark): Just mark the underlying decls.
1532 (lookup_maybe_add): Dedup using marked decls.
1535 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
1536 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
1538 Stat hack representation
1539 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
1540 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
1542 (find_namespace_binding): Replace with ...
1543 (find_namespace_slot): ... this.
1544 (find_namespace_value): New.
1545 (name_lookup::search_namespace_only,
1546 name_lookup::adl_namespace_only): Adjust.
1547 (update_binding): Add SLOT parameter, adjust.
1548 (check_local_shadow): Use find_namespace_value.
1549 (set_local_extern_decl_linkage): Likewise.
1550 (do_pushdecl): Adjust for namespace slot.
1551 (push_local_binding): Assert not a namespace binding.
1552 (check_for_out_of_scope_variable): Use find_namespace_value.
1553 (set_identifier_type_value_with_scope): Likewise.
1554 (get_namespace_binding): Likewise.
1555 (set_namespace_binding): Delete.
1556 (set_global_binding): Directly update the binding.
1557 (finish_namespace_using_decl): Likewise.
1558 (lookup_type_scope_1): Use find_namespace_slot and update.
1559 (do_push_nested_namespace): Use find_namespace_value.
1562 * pt.c (most_specialized_instantiation): Cope with duplicate
1566 * cp-tree.h (build_min_nt_call_vec): Declare.
1567 * decl.c (build_offset_ref_call_from_tree): Call it.
1568 * parser.c (cp_parser_postfix_expression): Likewise.
1569 * pt.c (tsubst_copy_and_build): Likewise.
1570 * semantics.c (finish_call_expr): Likewise.
1571 * tree.c (build_min_nt_loc): Keep unresolved lookups.
1572 (build_min): Likewise.
1573 (build_min_non_dep): Likewise.
1574 (build_min_non_dep_call_vec): Likewise.
1575 (build_min_nt_call_vec): New.
1578 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
1580 (lookup_keep): Call it.
1582 2017-05-26 Nathan Sidwell <nathan@acm.org>
1585 * name-lookup.c (push_inline_namespaces): New.
1586 (push_namespace): Look inside inline namespaces.
1588 Inline and using namespace representation change.
1589 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
1591 (DECL_NAMESPACE_USING): Adjust.
1592 (DECL_NAMESPACE_INLINEES): New.
1593 * name-lookup.h (struct cp_binding_level): Change usings
1595 * name-lookup.c (name_lookup::do_queue_usings,
1596 name_lookup::queue_usings): Adjust.
1597 (name_lookup::search_namespace, name_lookup::search_usings,
1598 name_lookup::queue_namespace): Adjust.
1599 (name_lookup::adl_namespace_only): Adjust.
1600 (add_using_namespace, push_namespace): Push onto vector.
1601 (pop_namespace): Add timing logic.
1603 * call.c (build_operator_new_call): Do namelookup and ADL here.
1604 (build_new_op_1): Likewise.
1605 * name-lookup.h (lookup_function_nonclass): Delete declaration.
1606 (do_using_directive): Likewise.
1607 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
1609 (struct scope_binding): Delete.
1610 (EMPTY_SCOPE_BINDING): Delete.
1611 (set_decl_namespace): Use OVL_P.
1612 (finish_local_using_decl): Lose unnecesary checks.
1613 (lookup_function_nonclass): Delete.
1614 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
1616 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
1617 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
1619 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
1620 (lkp_iterator): Add outer field. Adjust ctor.
1621 (lkp_iterator::operator++): New.
1622 (lookup_mark, lookup_maybe_add): Declare.
1623 * name-lookup.c (name_lookup): Delete fn_set member.
1624 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
1626 (name_lookup::add_value): Use lookup_add directly.
1627 (name_lookup::add_fns: Use lookup_maybe_add.
1628 (name_lookup::search_adl): Mark and unmark fns.
1630 * pt.c (check_explicit_specialization): Use lookup_add directly.
1631 * ptree.c (cxx_print_xnode): Show complete overload structure.
1632 * tree.c (lookup_mark, lookup_maybe_add): New.
1634 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
1636 2017-05-26 Jakub Jelinek <jakub@redhat.com>
1638 * cp-tree.h (struct lang_decl_decomp): New type.
1639 (struct lang_decl): Add u.decomp.
1640 (LANG_DECL_DECOMP_CHECK): Define.
1641 (DECL_DECOMPOSITION_P): Note it is set also on the vars
1642 for user identifiers.
1643 (DECL_DECOMP_BASE): Define.
1644 (retrofit_lang_decl): Add extra int = 0 argument.
1645 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
1646 use it to influence the selector choices and for selector
1647 0 to non-zero transition copy old content.
1648 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
1649 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
1650 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
1651 wording if decl is a structured binding.
1652 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
1653 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
1654 of individual variables for tuple structured bindings.
1655 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
1656 Clear DECL_DECOMP_BASE.
1657 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
1658 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
1660 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
1663 2017-05-25 Jason Merrill <jason@redhat.com>
1665 PR c++/80605 - __is_standard_layout and zero-length array
1666 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
1668 2017-05-25 Nathan Sidwell <nathan@acm.org>
1670 Kill OVL_CURRENT, OVL_NEXT.
1671 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
1672 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
1673 (consider_binding_level): Use OVL_FIRST.
1674 (cp_emit_debug_info_for_using): Use lkp_iterator.
1675 * pt.c (check_explicit_specialization): Use ovl_iterator.
1677 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
1678 * cp-tree.h (lang_decl_ns): Remove ns_users field.
1679 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
1680 (TREE_INDIRECT_USING): Delete.
1681 * name-lookup.h (is_associated_namespace): Delete.
1682 * name-lookup.c (name_lookup::search_usings,
1683 name_lookup::do_queue_usings): Usings are always direct.
1684 (is_associated_namespace): Delete.
1685 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
1686 (namespace_ancestor_1, namespace_ancestor): Delete.
1687 (push_using_directive_1, push_using_directive): Delete.
1688 (add_using_namespace_1): Delete.
1689 (add_using_namespace): Reimplement.
1690 (emit_debug_info_using_namespace): New.
1691 (finish_namespace_using_directive, finish_local_using_directive,
1692 push_namespace): Adjust.
1693 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
1695 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
1697 * semantics.c (finish_handler_parms): Warn about non-reference type
1700 2017-05-25 Nathan Sidwell <nathan@acm.org>
1702 Reimplement unqualified namespace lookup.
1703 * name-lookup.c (name_lookup::using_pair,
1704 name_lookup::using_queue): New typedefs.
1705 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
1706 name_lookup::queue_usings): New.
1707 (name_lookup::search_unqualified): New.
1708 (merge_functions, same_entity_p, ambiguous_decl,
1709 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
1710 lookup_using_namespace): Delete.
1711 (lookup_name_real_1): Adjust.
1713 Reimplement qualified namespace lookup.
1714 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
1715 (name_lookup::ambiguous, name_lookup::add_value,
1716 name_lookup::add_type, name_lookup::process_binding): New.
1717 (name_lookup::search_namespace_only,
1718 name_lookup::search_namespace, name_lookup::search_usings): New.
1719 (name_lookup::search_qualified): New.
1720 (do_nonmember_using_decl, suggest_alternatives_for,
1721 lookup_qualified_name): Adjust.
1722 (tree_vec_contains): Delete.
1723 (qualified_lookup_using_namespace): Rename to ...
1724 (qualified_namespace_lookup): ... here. Reimplement.
1727 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
1728 * name-lookup.h (lookup_arg_dependent): Return plain tree.
1729 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
1730 arg_assoc_args_vec, arg_assoc_type, add_function,
1731 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
1732 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
1733 lookup_arg_dependent_1): Delete.
1734 (name_lookup): New lookup object.
1735 (name_lookup::preserve_state, name_lookup::restore_state,
1736 name_lookup::mark_seen, name_lookup::find_and_mark,
1737 name_lookup::add_fns, name_lookup::adl_namespace_only,
1738 name_lookup::adl_namespace, name_lookup::adl_class_only,
1739 name_lookup::adl_bases, name_lookup::adl_class,
1740 name_lookup::adl_expr, name_lookup::adl_type,
1741 name_lookup::adl_template_arg, name_lookup::search_adl): New.
1742 (lookup_arg_dependent): Return a plain tree. Adjust.
1743 (is_associated_namespace): Move later.
1745 2017-05-24 Nathan Sidwell <nathan@acm.org>
1747 * friend.c (do_friend): Remove check for existing decl.
1748 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
1749 * name-lookup.c (push_local_binding): Directly look for binding.
1750 (lookup_name_innermost_nonclass_level_1): Delete.
1751 (lookup_name_innermost_nonclass_level): Delete.
1753 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
1755 * cp-tree.h (cp_free_lang_data): Add extern.
1756 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
1758 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
1759 * typeck.c (type_unknown_p): Delete.
1760 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
1761 overload management.
1762 (dependent_name): Likewise.
1763 (decl_anon_ns_mem_p): Simplify.
1765 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
1768 * tree.c (reshape_init): Use unqualified type for direct enum init.
1769 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
1770 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
1771 non-class destination types.
1772 (build_const_cast_1): Strip cv-quals from destination types.
1773 (build_static_cast, build_reinterpret_cast, build_const_cast)
1774 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
1776 2017-05-24 Martin Sebor <msebor@redhat.com>
1779 * call.c (fully_fold_internal): Adjust.
1781 2017-05-24 Nathan Sidwell <nathan@acm.org>
1783 * cp-tree.h (ovl_skip_hidden): Declare.
1784 * tree.c (ovl_skip_hidden): New.
1785 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
1786 (lookup_arg_dependent_1): Likewise.
1787 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
1788 (hidden_name_p, remove_hidden_names): Delete.
1789 (lookup_name_real_1): Do not strip hidden names.
1790 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
1792 * cp-tree.h (OVL_HIDDEN_P): New.
1793 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
1794 (ovl_iterator::reveal_node): Declare.
1795 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
1796 (ovl_insert): Order on hiddenness.
1797 (ovl_iterator::reveal_node): New.
1798 * name-lookup.c (anticipated_builtin_p): New.
1799 (supplement_binding_1): Use it.
1800 (set_local_extern_decl_linkage): Use hidden_p.
1801 (do_pushdecl): Deal with unhiding a hidden decl, use
1802 anticipated_builtin_p.
1803 (do_nonmember_using_decl): Use anticipated_decl_p.
1804 (lookup_name_real_1): Use DECL_HIDDEN_P.
1806 2017-05-23 Jason Merrill <jason@redhat.com>
1808 -Wunused and C++17 structured bindings
1809 * decl.c (poplevel): Don't warn about unused structured bindings,
1810 only real variables.
1811 * error.c (dump_simple_decl): Handle structured bindings.
1812 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
1814 2017-05-23 Nathan Sidwell <nathan@acm.org>
1816 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
1817 * name-lookup.c (create_local_binding): New.
1818 (update_binding): New.
1819 (pushdecl_maybe_friend_1): Rename to ...
1820 (do_pushdecl): ... this. Reimplement.
1822 (push_overloaded_decl_1, push_overloaded_decl): Delete.
1824 2017-05-23 Jason Merrill <jason@redhat.com>
1826 PR c++/80396 - built-in for make_integer_sequence.
1827 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
1828 (expand_integer_pack, expand_builtin_pack_call): New.
1829 (find_parameter_packs_r): Check builtin_pack_call_p.
1830 (check_for_bare_parameter_packs): Handle it.
1831 (tsubst_pack_expansion): Call expand_builtin_pack_call.
1832 (declare_integer_pack): New.
1833 (init_template_processing): Call it.
1834 * decl2.c (mark_used): Check builtin_pack_fn_p.
1836 2017-05-23 Nathan Sidwell <nathan@acm.org>
1838 * name-lookup.c (find_namespace_binding): New.
1839 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
1840 (set_identifier_type_value_with_scope): Use find_namespace_binding.
1841 (find_binding, cp_binding_level_find_binding_for_name,
1842 binding_for_name, namespace_binding_1): Delete.
1843 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
1844 (get_namespace_binding, set_namespace_binding,
1845 finish_namespace_using_decl, unqualified_namespace_lookup_1,
1846 qualified_lookup_using_namespace, lookup_type_scope_1,
1847 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
1850 * parser.c (cp_parser_template_id): Keep the lookup when stashing
1853 * cp-tree.h (DECL_HIDDEN_P): New.
1854 * name-lookup.c (set_decl_context,
1855 set_local_extern_decl_linkage): New, broken out of ...
1856 (pushdecl_maybe_friend_1): ... here. Call them.
1858 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
1860 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
1861 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
1864 2017-05-23 Nathan Sidwell <nathan@acm.org>
1866 * cp-tree.h (OVL_P): New.
1867 * name-lookup.h (push_local_binding): Delete.
1868 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
1869 (finish_namespace_using_decl, finish_local_using_decl): ... here
1870 * name-lookup.c (add_decl_to_level): Swap args.
1871 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
1872 (diagnose_name_conflict): Check contexts are same for redecl.
1873 (update_local_overload): New.
1874 (compparms_for_decl_and_using): Rename to ...
1875 (matching_fn_p): ... here.
1876 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
1877 push_local_bindings call.
1878 (push_local_binding): Make static, replace FLAGS arg with
1880 (validate_nonmember_using_decl): Use OVL_FIRST.
1881 (do_nonmember_using_decl): Use in/out parameters. Use
1882 lkp_iterator and simplify.
1883 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
1884 (finish_namespace_using_decl, finish_local_using_decl): ... here.
1886 (lookup_type_current_level): Delete.
1887 * parser.c (cp_parser_using_declaration): Adjust.
1888 * pt.c (tsubst_expr): Adjust.
1890 2017-05-22 Nathan Sidwell <nathan@acm.org>
1892 * name-lookup.h (parse_using_directive): Replace with ...
1893 (finish_namespace_using_directive): ... this and ...
1894 (finish_local_using_directive): ... this.
1895 * name-lookup.c (add_using_namespace_1): Move later.
1896 (add_using_namespace): Move later, add namespace_p arg, remove
1898 (push_using_directive_1): Directly recurse.
1899 (do_using_directive, parse_using_directive): Delete, split into ...
1900 (finish_namespace_using_directive): ... this and ...
1901 (finish_local_using_directive): ... this.
1902 (push_namespace): Use add_using_namespace.
1903 * parser.c (cp_parser_using_directive): Call
1904 finish_namespace_using_directive or finish_local_using_directive.
1905 * pt.c (tsubst_expr): Call finish_local_using_directive.
1907 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
1908 * cp-tree.h (raw_dump_id): Declare.
1909 * decl2.c (raw_dump_id): Define.
1910 (dump_tu): Use raw_dump_id.
1912 * config-lang.in (gtfiles): Sort list, break lines.
1914 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
1915 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
1916 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
1917 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
1918 CPTI_RETHROW_FN): New.
1919 (noexcept_deferred_spec): New.
1920 (terminate_node, call_unexpected_node): Rename to ...
1921 (terminate_fn, call_unexpected_fn): ... here.
1922 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
1923 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
1924 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
1925 (init_exception_processing): Adjust.
1926 (declare_library_fn): Create and push the fns here.
1927 (do_get_exception_ptr, do_begin_catch, do_end_catch,
1928 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
1929 declare_library_fn use.
1930 (unevaluated_noexcept_spec): Adjust.
1931 * cp-gimplify.c (genericize_eh_spec_block,
1932 gimplify_most_not_throw_expr): Adjust.
1934 * name-lookup.c (pushdecl_top_level,
1935 pushdecl_top_level_and_finish): Move after namespace pushing and
1937 (push_to_top_level): Rename to ...
1938 (do_push_to_top_level): ... here. Remove timing code.
1939 (pop_from_top_level_1): Rename to ...
1940 (do_pop_from_top_level): ... here.
1941 (do_push_nested_namespace, do_pop_nested_namespace)
1942 (push_to_top_level): New wrapper for do_push_to_top_level.
1943 (pop_from_top_level): Adjust.
1944 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
1946 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
1948 * config-lang.in (gtfiles): Add c-family/c-format.c,
1949 except.c, init.c, lambda.c and friend.c.
1950 * class.c (dvirt_fn): Move out of function scope,
1952 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
1953 * init.c (fn): Likewise.
1954 * lambda.c (ptr_id, max_id): Likewise.
1955 * friend.c (global_friend): Add GTY attribute.
1957 2017-05-19 Nathan Sidwell <nathan@acm.org>
1959 * call.c (add_list_candidates): Use OVL_FIRST.
1960 (build_new_method_call_1): Likewise.
1961 * cp-tree.h (OVL_SINGLE_P): New.
1962 (TYPE_HIDDEN_P): New.
1963 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
1964 * dump.c (cp_tump_tree): Adjust overload dumping.
1965 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
1967 * method.c (lazily_declare_fn): Assert we added it.
1968 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
1970 (cp_parser_template_name): Use lkp_iterator.
1971 * pt.c (begin_template_parm_list): Fixup comment.
1972 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
1973 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
1974 (ovl_scope): Use lkp_iterator.
1976 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
1978 * parser.c (cp_parser_omp_clause_default): Handle
1979 "OMP_CLAUSE_DEFAULT_PRESENT".
1981 * parser.c (cp_parser_omp_clause_default): Avoid printing more
1982 than one syntax error message.
1984 2017-05-19 Nathan Sidwell <nathan@acm.org>
1986 * class.c (class_dump_id): Define.
1987 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
1988 * cp-objcp-common.c (cp_register_dumps): New.
1989 * cp-objcp-common.h (cp_register_dumps): Declare.
1990 (LANG_HOOKS_REGISTER_DUMPS): Override.
1991 * cp-tree.h (class_dump_id): Declare.
1993 2017-05-18 Nathan Sidwell <nathan@acm.org>
1995 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
1997 (lookup_keep): Declare.
1998 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
1999 * pt.c (tsubst_copy): Assert lookup is persistent.
2000 * semantics.c (finish_call_expr): Use lkp_iterator, call
2002 * tree.c (ovl_copy): New.
2003 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
2006 * cp-tree.h (OVL_USED): Replace with ...
2007 (OVL_USING_P): ... this.
2008 (ovl_iterator::using_p): Adjust.
2009 * name-lookup.c (push_overloaded_decl_1,
2010 do_nonmember_using_decl): Adjust.
2011 * search.c (lookup_field_r): Adjust.
2012 * tree.c (ovl_insert, ovl_scope): Adjust.
2014 * cp-tree.h (lookup_add): Swap args.
2015 (ovl_cons, build_overload): Delete.
2016 * name-lookup.c (add_function, push_overloaded_decl_1,
2017 do_nonmember_using_decl, merge_functions, remove_hidden_names):
2018 Use lookup_add, ovl_insert.
2019 * pt.c (check_explicit_specialization): Use lookup_add.
2020 (do_class_deduction): Likewise. Refactor if.
2021 * tree.c (lookup_add): Swap args.
2022 (ovl_cons, build_overload): Delete.
2024 * name-lookup.c (find_local_binding): New, broken out of ...
2025 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
2026 (set_namespace_binding): Swap scope & name args.
2027 (namespace_binding_1): Likewise.
2028 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
2029 (push_overloaded_decl_1): Likewise.
2030 (set_global_binding): Likewise.
2031 (get_namespace_binding): Adjust namespace_binding_1 call.
2033 2017-05-17 Nathan Sidwell <nathan@acm.org>
2035 * cp-tree.h (default_hash_traits <lang_identifier *>): New
2037 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
2038 (extern_c_fns): New hash table.
2039 (check_extern_c_conflict): New, broken out of ...
2040 (pushdecl_maybe_friend_1): ... here. Call it.
2041 (c_linkage_bindings): Just look in hash table.
2043 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
2047 Implement new C++ intrinsics __is_assignable and __is_constructible.
2048 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
2050 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
2051 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2052 * method.c (constructible_expr): Set cp_unevaluated.
2053 (is_xible_helper): New.
2054 (is_trivially_xible): Adjust.
2056 * parser.c (cp_parser_primary_expression): Handle
2057 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
2058 (cp_parser_trait_expr): Likewise.
2059 * semantics.c (trait_expr_value): Handle
2060 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2062 2017-05-17 Nathan Sidwell <nathan@acm.org>
2064 * cp-tree.h (ovl_iterator::using_p): New predicate.
2065 (ovl_iterator::remove_node): New worker.
2066 (ovl_insert): Declare.
2067 * tree.c (ovl_insert): New.
2068 (ovl_iterator::remove_node): New.
2069 * class.c (add_method): Use ovl_iterator, ovl_insert.
2070 (clone_function_decl): Fix description.
2071 (clone_constructors_and_destructors): Use ovl_iterator.
2073 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
2074 (maybe_warn_about_overly_private_class): Use ovl_iterator.
2075 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
2076 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
2077 (get_base_fndecls): Use ovl_iterator.
2078 (warn_hidden): Use OVL_NAME, ovl_iterator.
2079 (add_implicitly_declared_members): Use ovl_iterator.
2080 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
2082 (finish_shorthand_constraint): Simplify, use ovl_make.
2083 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
2084 * search.c (shared_member_p): Use ovl_iterator.
2085 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
2086 (lookup_conversion_operator): Use OVL_FIRST.
2087 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
2088 (look_for_overrides_here): Use ovl_iterator.
2089 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
2090 * typeck.c (build_x_unary_op): Use ovl_make.
2092 2017-05-17 Martin Liska <mliska@suse.cz>
2094 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
2095 use it instead of int type.
2096 (dump_vtable): Likewise.
2097 (dump_vtt): Likewise.
2098 * decl2.c (dump_tu): Likewise.
2100 2017-05-16 David Malcolm <dmalcolm@redhat.com>
2102 * call.c (enforce_access): Add access_failure_info * param and use
2103 it to record access failures.
2104 * cp-tree.h (class access_failure_info): New class.
2105 (enforce_access): Add access_failure_info * param, defaulting to
2107 (lookup_member): Likewise.
2108 (locate_field_accessor): New function decl.
2109 (perform_or_defer_access_check): Add access_failure_info * param,
2111 * search.c (lookup_member): Add access_failure_info * param and
2112 pass it on to call to perform_or_defer_access_check.
2113 (matches_code_and_type_p): New function.
2114 (field_access_p): New function.
2115 (direct_accessor_p): New function.
2116 (reference_accessor_p): New function.
2117 (field_accessor_p): New function.
2118 (struct locate_field_data): New struct.
2119 (dfs_locate_field_accessor_pre): New function.
2120 (locate_field_accessor): New function.
2121 * semantics.c (perform_or_defer_access_check): Add
2122 access_failure_info * param, and pass it on to call to
2124 * typeck.c (access_failure_info::record_access_failure): New method.
2125 (access_failure_info::maybe_suggest_accessor): New method.
2126 (finish_class_member_access_expr): Pass an access_failure_info
2127 instance to the lookup_member call, and call its
2128 maybe_suggest_accessor method afterwards.
2130 2017-05-16 Marek Polacek <polacek@redhat.com>
2134 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
2136 2017-05-16 Nathan Sidwell <nathan@acm.org>
2138 * name-lookup.c (check_local_shadow): New, broke out of ...
2139 (pushdecl_maybe_friend_1): ... here. Call it.
2141 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
2142 (ovl_first): Move inline definition to end of file.
2143 (ovl_make, lookup_add): Declare.
2144 (get_fns, get_first_fn): Make pure.
2145 * tree.c (ovl_cache): New.
2146 (ovl_make, lookup_add): New.
2147 * pt.c (do_class_deduction): Don't add candidates that will be
2150 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
2151 (print_error_for_call_failure): Use OVL_NAME.
2152 (build_op_call_1): Use ovl_iterator.
2153 (add_candidates): Use OVL_FIRST & lkp_iterator.
2154 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
2156 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
2157 (type_has_user_nondefault_constructor,
2158 in_class_defaulted_default_constructor,
2159 type_has_user_provided_constructor,
2160 type_has_user_provided_or_explicit_constructor,
2161 type_has_non_user_provided_default_constructor,
2162 vbase_has_user_provided_move_assign,
2163 type_has_move_constructor, type_has_move_assign,
2164 type_has_user_declared_move_constructor,
2165 type_has_user_declared_move_assign,
2166 type_build_ctor_call, type_build_dtor_call,
2167 type_requires_array_cookie, explain_non_literal_class): Likewise.
2168 (finish_struct): Use lkp_iterator.
2169 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
2170 (note_name_declared_in_class): Use OVL_NAME.
2171 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
2172 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
2173 cxx_pretty_printer::expression): Likewise.
2174 * decl2.c (check_classfn): Use ovl_iterator.
2175 * pt.c (retrieve_specialization): Use ovl_iterator.
2176 * tree.c (cp_tree_equal): Use lkp_iterator.
2177 (type_has_nontrivial_copy_init): Use ovl_iterator.
2179 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
2180 check is_overloaded_fn.
2182 2017-05-16 Martin Liska <mliska@suse.cz>
2184 * parser.c (cp_lexer_print_token): Add default value for flags
2185 argument of print_gimple_stmt, print_gimple_expr,
2186 print_generic_stmt and print_generic_expr.
2188 2017-05-16 Nathan Sidwell <nathan@acm.org>
2190 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
2192 (MAYBE_BASELINK_FUNCTIONS): New.
2193 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
2194 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
2195 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
2196 * method.c (inherited_ctor_binfo): Use ovl_iterator.
2197 (binfo_inherited_from): Likewise.
2198 * parser.c (lookup_literal_operator): Use lkp_iterator.
2199 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
2200 (print_candidates_1): Likewise.
2201 (determine_specialization): Likewise.
2202 (resolve_overloaded_unification): Likewise.
2203 (resolve_nondeduced_context): Likewise.
2204 (type_dependent_expression_p): Likewise.
2205 (dependent_template_p): Likewise.
2206 * ptree.c (cxx_print_xnode): Likewise.
2207 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
2208 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
2209 * typeck.c (check_template_keyword): Use lkp_iterator.
2211 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
2213 * constexpr.c (function_concept_check): Use OVL_FIRST.
2214 * cvt.c (build_expr_type_conversion): Likewise.
2215 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
2216 * decl2.c (mark_used): Use OVL_FIRST.
2217 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
2218 (dump_expr, location_of): Use OVL_FIRST.
2219 * friend.c (do_friend): Use OVL_NAME.
2220 * init.c (build_offset_ref): Use OVL_FIRST.
2221 * mangle.c (write_member_name): Likewise.
2222 (write_expression): Use OVL_NAME.
2223 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
2224 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
2225 * pt.c (check_explicit_specialization): Use OVL_FIRST.
2226 (check_template_shadow): Likewise.
2227 (tsubst_template_args): Use OVL_NAME.
2228 (tsubst_baselink): Use OVL_FIRST.
2229 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
2230 * tree.c (get_first_fn): Use OVL_FIRST.
2231 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
2232 (cp_build_addr_expr_1): Use OVL_FIRST.
2234 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
2236 * semantics.c (finish_id_expression): Directly init local var.
2237 (finish_omp_reduction_clause): Use really_overloaded_fn.
2238 * tree.c (get_fns): Document. Assert we got an overload.
2239 (get_first_fn) Document.
2240 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
2241 really_overloaded_fn.
2242 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
2244 * cp-tree.h (SCOPE_DEPTH): New.
2245 * name-lookup.h (is_nested_namespace): Declare.
2246 * name-lookup.c (is_nested_namespace): New.
2247 (is_ancestor): Use it.
2248 (set_decl_namespace): Likewise.
2249 (push_namespace): Set SCOPE_DEPTH.
2250 * pt.c (check_specialization_namespace): Use is_nested_namespace.
2251 (check_unqualigied_spec_or_inst): Likewise.
2253 2017-05-15 Nathan Sidwell <nathan@acm.org>
2256 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
2257 * name-lookup.h (push_namespace): Return int, add make_inline arg.
2258 * name-lookup.c (push_namespace): Deal with inline directly.
2259 Return pushed count.
2260 * parser.c (cp_parser_namespace_definition): Adjust for
2261 push_namespace change.
2263 2017-05-11 Nathan Sidwell <nathan@acm.org>
2265 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
2266 LANG_HOOKS_PUSHDECL): Move to ...
2267 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
2268 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
2269 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
2271 * name-lookup.h (pushdecl): Add default friend parm.
2272 (pushdecl_maybe_friend): Delete.
2273 (pushdecl_top_level): Add default friend parm.
2274 (pushdecl_top_level_maybe_friend): Delete.
2275 * name-lookup.c (pushdecl_maybe_friend): Delete.
2276 (pushdecl): Add is_friend parm.
2277 (pushdecl_top_level): Add is friend_parm.
2278 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
2279 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
2280 * friend.c (do_friend): Adjust.
2281 * pt.c (tsubst_friend_class): Adjust.
2283 Revert pushdecl_top_level_and_finish name change.
2284 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
2285 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
2286 * decl.c (cp_make_fname_decl): Adjust.
2287 * decl2.c (get_guard, handle_tls_init): Adjust.
2288 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
2290 * name-lookup.c (pushdecl_outermost_localscope): Always
2291 conditionally stop timer.
2293 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
2294 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
2296 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
2297 pushtag_top_level_maybe_friend,
2298 pushdecl_top_level_and_finish): Move declarations to ...
2299 * name-lookup.h: ... here. Group pushdecl variants.
2300 (pushdecl_top_level_and_finish): Rename to ...
2301 (pushdecl_top_level_with_init): ... here.
2302 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
2303 * decl2.c (get_guard, handle_tls_init): Likewise.
2304 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
2305 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
2306 * method.c (implicitly_declare_fn): Likewise.
2307 * searchc (node_debug_info_needed): Likewise.
2308 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
2309 (pushdecl_top_level_with_init): ... here.
2310 (pop_everything): Use namespace_bindings_p.
2312 * name-lookup.h (pop_binding): Rename to pop_local_binding.
2313 (getdecls): Rename to get_local_decls.
2314 * name-lookup.c (pop_binding): Rename to ...
2315 (pop_local_binding): ... here.
2316 (pop_bindings_and_leave_scope): Adjust.
2317 (getdecls): Rename to ...
2318 (get_local_decls): ... here. Assert local scope.
2319 * decl.c (poplevel): Assert not namespace. Adjust and simplify
2321 (store_parm_decls): Adjust get_local_decls call.
2322 (parser.c (synthesize_implicit_template_parm): Likewise.
2324 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
2327 * method.c (is_trivially_xible): Reject void types.
2329 2017-05-10 Nathan Sidwell <nathan@acm.org>
2331 * class.c (handle_using_decl): Always use OVL_CURRENT.
2332 (resolve_address_of_overloaded_function): Move iterator decl into
2333 for scope. Don't strip anticipated decls here.
2335 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
2337 (print_candidates): Adjust.
2339 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
2341 * call.c (build_new_function_call): Lose koenig_p arg. Remove
2342 koenig_p handling here.
2343 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
2344 (tsubst_omp_clauses): Likewise.
2345 (do_class_deduction): Adjust buld_new_function_call calls.
2346 * semantics.c (finish_call_expr): Likewise.
2348 2017-05-10 Jason Merrill <jason@redhat.com>
2350 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
2351 (unify_type_mismatch, unify_parameter_pack_mismatch)
2352 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
2353 (unify_parameter_pack_inconsistent, unify_inconsistency)
2354 (unify_vla_arg, unify_method_type_error, unify_arity)
2355 (unify_arg_conversion, unify_no_common_base)
2356 (unify_inconsistent_template_template_parameters)
2357 (unify_template_deduction_failure)
2358 (unify_template_argument_mismatch)
2359 (unify_overload_resolution_failure): Call unify_invalid.
2361 CWG 1847 - Clarifying compatibility during partial ordering
2362 * pt.c (more_specialized_fn): No order between two non-deducible
2365 * pt.c (dependent_type_p): Make sure we aren't called with
2368 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2369 * pt.c (convert_template_argument): Just return an argument pack.
2370 (coerce_template_parameter_pack, template_parm_to_arg)
2371 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
2372 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
2373 Don't set the type of a NONTYPE_ARGUMENT_PACK.
2374 * parser.c (make_char_string_pack, make_string_pack): Likewise.
2376 2017-05-10 Nathan Sidwell <nathan@acm.org>
2378 * cp-tree.h (add_method, clone_function_decl): Change last arg to
2380 * class.c (add_method): Change third arg to bool. Adjust.
2381 (one_inheriting_sig, one_inherited_ctor): Adjust.
2382 (clone_function_decl): Change 2nd arg to bool. Adjust.
2383 (clone_constructors_and_destructors): Adjust.
2384 * lambda.c (maybe_add_lambda_conv_op): Adjust.
2385 * method.c (lazily_declare_fn): Adjust.
2386 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
2387 * semantics.c (finish_member_declaration): Adjust.
2389 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
2392 * decl.c (finish_function): To improve error recovery, change the
2393 logic for calling apply_deduced_return_type.
2395 2017-05-09 Jason Merrill <jason@redhat.com>
2397 PR c++/80605 - __is_standard_layout and empty base
2398 * class.c (check_bases): Ignore empty bases.
2400 PR c++/70979 - literal class and closure types
2401 * class.c (finalize_literal_type_property): Handle closures
2403 (explain_non_literal_class): Likewise.
2405 PR c++/66297, DR 1684 - literal class and constexpr member fns
2406 * constexpr.c (is_valid_constexpr_fn): Only complain about
2407 non-literal enclosing class in C++11.
2408 * class.c (finalize_literal_type_property): Likewise.
2410 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
2413 * pt.c (tsubst_decl): Early return error_mark_node if
2414 grok_ctor_properties returns false.
2416 2017-05-09 Jason Merrill <jason@redhat.com>
2418 PR c++/70167 - array prvalue treated as lvalue
2419 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
2421 * semantics.c (finish_compound_literal): Add fcl_context parameter.
2422 Only make a static variable for C99 syntax.
2423 * parser.c (cp_parser_postfix_expression): Pass it.
2424 * pt.c (tsubst_copy_and_build): Likewise.
2425 * call.c (extend_ref_init_temps): Set
2426 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2428 2017-05-09 Nathan Sidwell <nathan@acm.org>
2430 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
2431 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
2432 * name-lookup.h (pushdecl_top_level): Declare.
2434 2017-05-08 Jason Merrill <jason@redhat.com>
2436 PR c++/80178 - parameter passing for uncopyable classes
2437 * tree.c (type_has_nontrivial_copy_init): True for classes with only
2438 deleted copy/move ctors.
2439 (remember_deleted_copy, maybe_warn_parm_abi): New.
2440 * decl.c (require_complete_types_for_parms, check_function_type):
2441 Call maybe_warn_parm_abi.
2442 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
2444 2017-05-08 Nathan Sidwell <nathan@acm.org>
2446 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
2447 (start_preparsed_function): Do decl pushing before setting
2448 current_funciton_decl and announcing it.
2450 * name-lookup.h (pushdecl_with_scope): Replace with ...
2451 (pushdecl_outermost_localscope): ... this.
2452 * name-lookup.c (pushdecl_with_scope): Replace with ...
2453 (pushdecl_outermost_localscope): ... this.
2454 (pushdecl_namespace_level): Adjust.
2455 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
2456 * lambda.c (insert_capture_proxy): Likewise.
2458 * class.c (build_vtbl_initializer): Don't shadow outer variable
2461 Revert _binding -> _value change.
2462 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
2463 (get_namespace_binding, set_global_binding): ... these.
2464 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
2465 (get_namespace_binding, set_global_binding): ... these.
2466 (arg_assoc_namespace, pushdecl_maybe_friend_1,
2467 check_for_out_of_scope_variable, push_overloaded_decl_1,
2468 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
2469 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
2470 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
2471 * decl.c (poplevel): Adjust.
2472 * pt.c (make_constrained_auto): Likewise.
2474 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
2476 PR translation/80280
2477 * call.c (print_z_candidate): Fix quoting.
2479 2017-05-05 David Malcolm <dmalcolm@redhat.com>
2481 * error.c (pedwarn_cxx98): Replace report_diagnostic
2482 with diagnostic_report_diagnostic.
2484 2017-05-05 Nathan Sidwell <nathan@acm.org>
2486 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
2487 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
2488 (IDENTIFIER_NAMESPACE_VALUE): Delete.
2489 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
2491 (get_namespace_value, set_global_value): ... these.
2492 (get_global_value_if_present, is_typename_at_global_scope): Delete.
2493 * decl.c (poplevel): Use get_namespace_value.
2494 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
2495 * class.c (build_vtbl_initializer): Stash library decl in
2496 static var. Use IDENTIFIER_GLOBAL_VALUE.
2497 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
2498 do_allocate_exception, do_free_exception, build_throw): Likewise.
2499 * init.c (throw_bad_array_new_length): Likewise.
2500 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
2501 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
2502 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
2503 get_namespace_value.
2504 (set_namespace_binding_1): Rename to
2505 (set_namespace_binding): ... here.
2506 (set_global_value): New.
2507 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
2508 get_namespace_value.
2509 * pt.c (listify): Use get_namespace_value.
2511 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
2513 * lex.c (unqualified_name_lookup_error): Likewise.
2515 * class.c (alter_class): Use retrofit_lang_decl directly.
2516 * decl.c (push_local_name, dupliate_decls): Likewise.
2517 * semantics.c (omp_privatize_field): Likewise.
2519 Kill walk_namespaces.
2520 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
2521 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
2523 Kill per-namespace static_decls.
2524 * cp-tree.h (static_decls): Declare.
2525 (wrapup_globals_for_namespace,
2526 diagnose_inline_vars_for_namespace): Replace with ...
2527 (wrapup_namespace_globals): ... this.
2528 * decl.c (static_decls): Define.
2529 (wrapup_globals_for_namespace,
2530 diagnose_inline_vars_for_namespace): Replace with ...
2531 (wrapup_namespace_globals): ... this.
2532 (cxx_init_decl_processing): Initialize static_decls.
2533 * decl2.c (c_parse_final_cleanups): Adjust.
2534 * name-lookup.h (cp_binding_level): Remove static_decls member.
2535 * name-lookup.c (add_decl_to_level): Adjust.
2536 (begin_scope): Adjust.
2538 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
2541 * decl.c (reshape_init): Unconditionally return error_mark_node
2542 upon error about too many initializers.
2544 2017-05-04 Nathan Sidwell <nathan@acm.org>
2546 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
2548 2017-05-04 Martin Sebor <msebor@redhat.com>
2550 PR translation/80280
2551 * call.c (print_z_candidate): Add missing quoting to %D and other
2553 (build_op_call_1): Same.
2554 * constraint.cc (diagnose_check_constraint): Same.
2555 * mangle.c (mangle_decl): Same.
2556 * name-lookup.c (cp_binding_level_debug): Same.
2557 (set_decl_namespace): Same.
2558 * parser.c (cp_parser_tx_qualifier_opt): Same.
2559 * pt.c (print_candidates_1): Same.
2560 (check_template_variable): Same.
2561 (tsubst_default_argument): Same.
2562 (most_specialized_partial_spec): Same.
2563 * semantics.c (omp_reduction_lookup): Same.
2564 * tree.c (check_abi_tag_redeclaration): Same.
2565 * typeck.c (comptypes): Same.
2566 * typeck2.c (abstract_virtuals_error_sfinae): Same.
2568 2017-05-04 Nathan Sidwell <nathan@acm.org>
2571 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
2572 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
2573 CPTI_INIT_LIST_IDENTIFIER.
2574 (global_namespace, global_type_node, global_identifier,
2575 anon_identifier, init_list_identifier): New.
2576 * decl.c (global_type_node, global_scope_name): Delete.
2577 (initialize_predefined_identifiers): Add new identifiers.
2578 (cxx_init_decl_processing): Adjust.
2579 * name-lookup.h (global_namespace, global_type_node): Delete.
2580 * name-lookup.c (global_namespace, anonymous_namespace_name,
2581 get_anonymous_namespace_name): Delete.
2582 (namespace_scope_ht_size, begin_scope, pushtag_1,
2583 push_namespace): Adjust,
2584 * call.c (type_has_extended_temps): Use init_list_identifier.
2585 * pt.c (listify): Likewise.
2587 * name-lookup.c: Reorder functions to make merging from modules
2590 2017-05-03 Jason Merrill <jason@redhat.com>
2592 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
2594 2017-05-03 Nathan Sidwell <nathan@acm.org>
2596 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
2597 along with #defines, to before name-lookup include.
2599 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
2601 * pt.c (is_auto_or_concept): Remove.
2602 (type_uses_auto_or_concept): Remove, unused.
2603 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
2604 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
2605 * cp-tree.h (is_auto_or_concept): Remove.
2607 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
2610 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
2611 add pedigree operation and detach call here.
2612 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
2613 cilk_cp_gimplify_call_params_in_spawned_fn.
2614 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
2615 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
2617 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
2619 * parser.c (cp_parser_member_declaration): Add fix-it hints for
2620 stray comma and missing semicolon at end of member declaration.
2622 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
2624 * parser.c (cp_parser_cast_expression): Add target type of cast to
2626 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
2628 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
2630 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
2631 return type to bool.
2632 * cp-tree.h (grok_ctor_properties): Update.
2634 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
2636 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
2637 information to diagnostic of invalid colon in nested-name-specifier.
2639 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
2641 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
2642 diagnostic of invalid class/struct keyword after enum.
2644 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2646 * parser.c (cp_parser_member_declaration): Add fix-it hint
2647 for removing stray semicolons.
2649 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2651 * name-lookup.c (get_std_name_hint): New function.
2652 (maybe_suggest_missing_header): New function.
2653 (suggest_alternative_in_explicit_scope): Call
2654 maybe_suggest_missing_header.
2656 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2659 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
2660 candidate type of bm from tree to const char *.
2661 (consider_binding_level): Likewise.
2662 (lookup_name_fuzzy): Likewise, using this to merge the best
2663 result from the preprocessor into bm, rather than immediately
2664 returning, so that better matches from reserved words can "win".
2665 Guard the rejection of keywords that don't start decl-specifiers
2666 so it only happens for FUZZY_LOOKUP_TYPENAME.
2668 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
2670 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
2671 (start_enum): Likewise.
2672 (build_enumerator): Likewise. Use %qE instead of plain %E.
2673 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
2674 %<%D%> in diagnostics.
2675 (cp_parser_elaborated_type_specifier): Likewise.
2676 * pt.c (make_pack_expansion): Use %qT and %qE instead of
2677 %<%T%> and %<%E%> in diagnostics.
2678 (tsubst_pack_expansion): Likewise.
2680 2017-04-24 David Malcolm <dmalcolm@redhat.com>
2683 * parser.c (cp_parser_unary_expression): Generate a location
2684 range for alignof and sizeof expressions.
2686 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
2688 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
2690 (cp_parser_virt_specifier_seq_opt): Likewise.
2691 (set_and_check_decl_spec_loc): Likewise twice.
2693 2017-04-21 Jason Merrill <jason@redhat.com>
2695 PR c++/80179 - ICE with initialized flexible array member.
2696 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
2698 2017-04-21 Richard Biener <rguenther@suse.de>
2700 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
2701 (copy_type): Likewise.
2702 * lex.c (copy_decl): Pass down mem-stat info.
2703 (copy_type): Likewise.
2705 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
2708 * init.c (build_new_1): Suppress notes about over-aligned new when
2709 the warning is suppressed.
2711 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
2713 * parser.c (cp_parser_member_declaration): Add warning with fixit
2714 information for extra semicolon after in-class function definition.
2716 2017-04-20 Jakub Jelinek <jakub@redhat.com>
2719 * tree.c (build_cplus_array_type): Call build_array_type
2720 with the intended TYPE_TYPELESS_STORAGE flag value, instead
2721 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
2724 2017-04-18 Marek Polacek <polacek@redhat.com>
2726 PR c++/80244 - ICE with attribute in template alias.
2727 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
2729 PR c++/80241 - ICE with alignas pack expansion.
2730 * error.c (dump_expr): Handle TREE_LIST.
2731 * parser.c (cp_parser_std_attribute_list): Return error_mark if
2732 make_pack_expansion returns an error.
2734 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
2737 * class.c (fixup_may_alias): Fix all type variants.
2739 2017-04-17 Jason Merrill <jason@redhat.com>
2741 PR c++/80415 - wrong error with default arg and array reference.
2742 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
2744 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
2746 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
2748 * decl.c (name_unnamed_type): Split out of...
2749 (grokdeclarator): ... this.
2750 * decl.h (name_unnamed_type): Declare.
2752 2017-04-12 Richard Biener <rguenther@suse.de>
2753 Bernd Edlinger <bernd.edlinger@hotmail.de>
2756 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
2757 for arrays of character or std::byte type.
2759 2017-04-11 Jason Merrill <jason@redhat.com>
2761 PR c++/80294 - ICE with constexpr and inheritance.
2762 * constexpr.c (reduced_constant_expression_p):
2763 A null constructor element is non-constant.
2764 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
2765 returning an empty base.
2767 2017-04-11 Jakub Jelinek <jakub@redhat.com>
2770 * decl.c (cp_finish_decomp): If processing_template_decl on
2771 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
2772 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
2773 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
2775 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
2776 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
2779 2017-04-11 Jakub Jelinek <jakub@redhat.com>
2782 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
2784 2017-04-10 Jakub Jelinek <jakub@redhat.com>
2787 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
2788 operand, if it is a static member function, recurse on the
2791 2017-04-10 Marek Polacek <polacek@redhat.com>
2794 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
2795 ORIG_TYPE earlier and not only when shortening.
2797 2017-04-07 Jason Merrill <jason@redhat.com>
2799 PR c++/80356 - ICE with reference to function template argument.
2801 * pt.c (convert_nontype_argument_function): Adjust type even with a
2802 value-dependent argument.
2804 PR c++/80267 - ICE with nested capture of reference
2806 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
2808 2017-04-07 Marek Polacek <polacek@redhat.com>
2811 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
2814 * call.c (build_over_call): Don't check cxx_dialect.
2815 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
2816 whether SUB is a CONSTRUCTOR.
2817 * init.c (build_new_1): Don't check cxx_dialect.
2818 * tree.c (replace_placeholders): Add a function comment. Return if
2819 not in C++14, or if the object isn't a (member of a) class.
2820 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
2821 TYPE is CLASS_TYPE_P.
2823 2017-04-05 Jakub Jelinek <jakub@redhat.com>
2826 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
2827 of a loop doing vec_safe_push of NULL. Formatting fixes.
2828 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
2829 to newidx before calling canonical_type_parameter on newtype.
2831 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
2834 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
2835 UNARY_PLUS_EXPR case.
2837 2017-04-03 Jason Merrill <jason@redhat.com>
2839 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
2841 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
2843 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
2844 * decl2.c (one_static_initialization_or_destruction): Likewise.
2845 * name-lookup.c (store_bindings): Likewise.
2846 * parser.c (make_call_declarator): Likewise.
2847 * pt.c (check_explicit_specialization): Likewise.
2849 2017-04-03 Jason Merrill <jason@redhat.com>
2851 PR sanitizer/79993 - ICE with VLA initialization from string
2852 PR c++/69487 - wrong VLA initialization from string
2853 * init.c (finish_length_check): Split out from build_vec_init.
2854 (build_vec_init): Handle STRING_CST.
2855 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
2856 (digest_init_r): Don't give a STRING_CST VLA type.
2858 2017-03-31 Jakub Jelinek <jakub@redhat.com>
2861 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
2862 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
2863 for NOP_EXPR to REFERENCE_TYPE.
2866 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
2867 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
2869 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
2870 Remove extraneous parens.
2871 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
2872 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
2873 (cp_parser_trait_expr): Likewise.
2875 2017-03-27 Jakub Jelinek <jakub@redhat.com>
2878 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
2879 * typeck.c (cxx_mark_addressable): Likewise. Look through
2880 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
2882 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
2884 2017-03-24 Jason Merrill <jason@redhat.com>
2886 PR c++/77339 - ICE with invalid use of alias template.
2887 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
2890 2017-03-24 Marek Polacek <polacek@redhat.com>
2893 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
2894 doesn't have side effects.
2896 2017-03-23 Jason Merrill <jason@redhat.com>
2898 PR c++/80150 - ICE with overloaded variadic deduction.
2899 * pt.c (try_one_overload): Remove asserts.
2901 PR c++/77563 - missing ambiguous conversion error.
2902 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
2904 2017-03-23 Marek Polacek <polacek@redhat.com>
2906 * cp-tree.h: Remove a C_RID_YYCODE reference.
2908 2017-03-22 Jakub Jelinek <jakub@redhat.com>
2911 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
2912 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
2913 processing_template_decl.
2915 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
2918 * name-lookup.c (pushtag_1): Add check for bogus, non template,
2919 std::initializer_list.
2921 2017-03-21 Jakub Jelinek <jakub@redhat.com>
2924 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
2926 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
2929 * init.c (std_placement_new_fn_p): New.
2930 (build_new_1): Call it.
2932 2017-03-20 Jason Merrill <jason@redhat.com>
2934 PR c++/80096 - ICE with C++17 non-type auto.
2935 * pt.c (tsubst): Delay tsubst of type of template non-type
2938 PR c++/79519 - ICE with deleted template friend.
2939 * decl.c (grokdeclarator): Complain about misplaced function
2940 definition using =, as well.
2942 PR c++/79640 - infinite recursion with generic lambda.
2943 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
2944 before substituting its initializer.
2946 2017-03-20 Marek Polacek <polacek@redhat.com>
2947 Paolo Carlini <paolo.carlini@oracle.com>
2949 PR c++/80059 - ICE with noexcept and __transaction_atomic
2950 * except.c (build_must_not_throw_expr): Call
2951 instantiate_non_dependent_expr.
2953 2017-03-19 Jason Merrill <jason@redhat.com>
2955 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
2956 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
2957 reference decomposition.
2959 PR c++/80077 - error with constexpr and -fno-elide-constructors.
2960 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
2961 expanding trivial constructor.
2963 2017-03-17 Jason Merrill <jason@redhat.com>
2965 PR c++/78345 - ICE initializing array from lambda.
2966 * init.c (build_aggr_init): Check array initializer.
2967 (build_vec_init): Check the type of a CONSTRUCTOR.
2969 PR c++/80073 - C++17 ICE with virtual base.
2970 * decl.c (xref_basetypes): Also check for indirect vbases.
2972 2017-03-16 Jason Merrill <jason@redhat.com>
2974 * decl.c (start_enum): std::byte aliases anything.
2977 * constexpr.c (lookup_placeholder): Tweak.
2979 2017-03-15 Jason Merrill <jason@redhat.com>
2981 PR c++/80043 - ICE with -fpermissive
2982 * typeck.c (convert_for_assignment): Handle instantiate_type
2983 not giving an error.
2985 2017-03-14 Nathan Sidwell <nathan@acm.org>
2987 PR c++/79393 DR 1658 workaround
2988 * method.c (synthesized_method_base_walk): Inihibit abstract class
2989 virtual base access check here.
2990 (synthesized_method_walk): Not here.
2992 2017-03-13 Nathan Sidwell <nathan@acm.org>
2994 PR c++/79393 DR 1658 workaround
2995 * method.c (synthesized_method_walk): Check vbases of abstract
2996 classes for dtor walk.
2998 2017-03-10 David Malcolm <dmalcolm@redhat.com>
3000 PR translation/79848
3001 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
3003 2017-03-10 Jason Merrill <jason@redhat.com>
3005 PR c++/79960 - alias templates and partial ordering
3006 * pt.c (comp_template_args): Add partial_order parm.
3007 (template_args_equal): Likewise.
3008 (comp_template_args_porder): New.
3009 (get_partial_spec_bindings): Use it.
3011 2017-03-10 Marek Polacek <polacek@redhat.com>
3014 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
3016 2017-03-10 Jakub Jelinek <jakub@redhat.com>
3019 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
3020 Use XALLOCAVEC macro.
3023 * decl.c (finish_enum_value_list): If value is error_mark_node,
3024 don't copy it and change its type.
3025 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
3026 of CONST_DECL is error_mark_node.
3028 2017-03-09 Marek Polacek <polacek@redhat.com>
3030 PR c++/79900 - ICE in strip_typedefs
3031 * tree.c (strip_typedefs): Skip the attribute handling if T is
3032 a variant type which hasn't been updated yet.
3034 PR c++/79687 - wrong code with pointer-to-member
3035 * init.c (constant_value_1): Break if the variable has a dynamic
3038 2017-03-08 Jason Merrill <jason@redhat.com>
3040 PR c++/79797 - ICE with self-reference in array DMI.
3041 * constexpr.c (lookup_placeholder): Split out...
3042 (cxx_eval_constant_expression): ...from here.
3044 2017-03-07 Jakub Jelinek <jakub@redhat.com>
3047 * parser.c (cp_parser_omp_cancellation_point,
3048 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
3049 cp_parser_omp_target_update): Change "may only be used in compound
3050 statements" diagnostics, such that the same translatable string is
3051 used for all pragmas.
3052 (cp_parser_pragma): Likewise. Use error_at instead of
3053 cp_parser_error for that diagnostics.
3055 2017-03-06 Marek Polacek <polacek@redhat.com>
3057 PR c++/79796 - ICE with NSDMI and this pointer
3058 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
3059 replace_placeholders.
3061 2017-03-06 Jakub Jelinek <jakub@redhat.com>
3064 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
3067 2017-03-06 Jason Merrill <jason@redhat.com>
3069 Revert "Allow deduction guides to look into primary template."
3070 * cp-tree.h, parser.c, pt.c, search.c: Revert.
3072 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
3075 * except.c (build_must_not_throw_expr): Perform the implicit
3076 conversions on the condition.
3078 2017-03-03 Jason Merrill <jason@redhat.com>
3080 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
3083 Core issues 2273 and 2277
3084 * call.c (joust): Adjust using-declaration tiebreaker to handle
3085 the intermediate base case.
3086 * method.c (strip_inheriting_ctors): Just return the argument if
3087 !flag_new_inheriting_ctors.
3089 2017-03-03 Richard Biener <rguenther@suse.de>
3092 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
3094 2017-03-03 Marek Polacek <polacek@redhat.com>
3097 * typeck.c (string_conv_p): In C++11, always call pedwarn with
3100 2017-03-02 Jason Merrill <jason@redhat.com>
3102 Update overload resolution with deduction guides.
3103 * pt.c (do_class_deduction): Always build the copy guide.
3104 (copy_guide_p, template_guide_p): New.
3105 (build_deduction_guide): Remember the original constructor.
3106 * call.c (joust): Prefer the copy guide and non-template guides.
3108 Allow deduction guides to look into primary template.
3109 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
3110 (struct cp_decl_specifier_seq): Add constructor_p.
3111 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
3112 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
3113 Clear deduction_guide_type. Don't handle deduction guide names.
3114 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
3115 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
3116 (cp_parser_member_declaration, cp_parser_cache_defarg)
3117 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
3118 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
3119 (build_deduction_guide): Set deduction_guide_type.
3120 (dependent_scope_p): Check deduction_guide_type.
3121 * search.c (lookup_member): Likewise.
3123 2017-03-02 Jakub Jelinek <jakub@redhat.com>
3126 * init.c (mark_exp_read_r): New function.
3127 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
3128 whole arguments instead of plain mark_exp_read on TREE_LIST values.
3130 2017-03-01 Jason Merrill <jason@redhat.com>
3132 Class template argument deduction in new-expression
3133 * init.c (build_new): Handle deduction from no initializer.
3134 * parser.c (cp_parser_new_expression): Don't require a single
3135 expression for class template deduction.
3136 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
3137 class template placeholder.
3138 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
3139 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
3140 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
3142 2017-03-01 Jakub Jelinek <jakub@redhat.com>
3145 * init.c (emit_mem_initializers): When not constructing vbases of
3146 abstract classes, mark arguments as read for
3147 -Wunused-but-set-parameter.
3149 2017-02-28 Jason Merrill <jason@redhat.com>
3151 Class template argument deduction refinements
3152 * call.c (joust): Move deduction guide tiebreaker down.
3153 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
3154 deduction with no initializer.
3155 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
3156 (do_class_deduction): Use that rather than special case.
3157 (do_auto_deduction): Handle null initializer.
3159 2017-02-28 Jakub Jelinek <jakub@redhat.com>
3161 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
3162 instead of just cond ? "..." : "...".
3163 (grokdeclarator): Likewise.
3164 (build_enumerator): Likewise.
3165 * init.c (build_new_1): Likewise.
3166 * call.c (build_new_method_call_1): Likewise.
3167 * parser.c: Include intl.h.
3168 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
3169 "enter"/"exit" keyword.
3170 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
3173 2017-02-27 Jason Merrill <jason@redhat.com>
3175 PR c++/71568 - SFINAE forming pointer to member function
3176 * init.c (build_offset_ref): Check the return value of
3177 perform_or_defer_access_check.
3179 2017-02-27 Marek Polacek <polacek@redhat.com>
3181 * decl.c (expand_static_init): Add missing } in a comment.
3183 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
3185 * init.c: Include intl.h.
3186 (build_new_1): Move message strings into pedwarn to make them
3187 -Wformat-security friendly. Mark string for translation.
3188 * pt.c (tsubst_copy_and_build): Mark string for translation.
3189 Make the pointer const.
3190 * semantics.c (finish_id_expression): Mark strings for translation.
3192 2017-02-25 Jakub Jelinek <jakub@redhat.com>
3194 * call.c (build_op_delete_call): Make msg1 and msg2 const.
3196 2017-02-24 Jakub Jelinek <jakub@redhat.com>
3199 * call.c (build_over_call): Call check_function_arguments even for
3200 -Wrestrict, adjust check_function_arguments caller.
3201 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
3203 * typeck.c (cp_build_function_call_vec): Adjust
3204 check_function_arguments caller.
3206 2017-02-24 Marek Polacek <polacek@redhat.com>
3208 PR translation/79705
3209 * decl.c (check_redeclaration_exception_specification): Mark a string
3210 for translation. Make the pointer const.
3212 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
3215 * pt.c (register_specialization): Check duplicate_decls return value
3216 for error_mark_node and pass it back.
3218 2017-02-22 Jason Merrill <jason@redhat.com>
3220 PR c++/79679 - missing destructor for argument
3221 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
3224 * pt.c (do_class_deduction): Handle 0 argument case.
3226 2017-02-22 Jakub Jelinek <jakub@redhat.com>
3229 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
3230 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
3231 * constexpr.c (potential_constant_expression_1): Handle
3232 OMP_*, OACC_* and CILK_* trees. Use error_at with
3233 EXPR_LOC_OR_LOC (t, input_location) computed early
3234 instead of error, or error_at with location_of (t).
3236 2017-02-22 Marek Polacek <polacek@redhat.com>
3239 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
3240 if the alignas expression is erroneous.
3241 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
3245 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
3247 2017-02-21 Jason Merrill <jason@redhat.com>
3249 PR c++/50308 - wrong deprecated warning with ADL
3250 PR c++/17729 - duplicate deprecated warning
3251 * semantics.c (finish_id_expression): Only call mark_used on a
3252 function if we aren't building a call.
3254 PR c++/41727 - ICE with partial spec of partial instantiation
3255 * pt.c (process_partial_specialization): For now, don't check more
3256 specialized if there is more than one level of args.
3258 2017-02-21 Marek Polacek <polacek@redhat.com>
3261 * cp-tree.h (maybe_reject_flexarray_init): Declare.
3262 * init.c (maybe_reject_flexarray_init): No longer static.
3263 Add check for current_function_decl.
3264 * parser.c (cp_parser_late_parse_one_default_arg): Reject
3265 a default mem-initializer for a flexible array.
3267 2017-02-21 Jakub Jelinek <jakub@redhat.com>
3268 Paolo Carlini <paolo.carlini@oracle.com>
3271 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
3273 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
3274 decl after the decomposition artificial decl has error_mark_node.
3275 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
3276 instead of just == error_mark_node comparison.
3278 2017-02-21 Jakub Jelinek <jakub@redhat.com>
3281 * decl.c: Include gimplify.h.
3282 (cp_finish_decomp): Make sure there is no sharing of trees
3283 in between DECL_VALUE_EXPR of decomposition decls.
3286 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
3289 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
3290 call cplus_expand_constant on it first.
3292 2017-02-19 Jason Merrill <jason@redhat.com>
3294 PR c++/78139 - destructor needed by new-expression
3295 * call.c (build_special_member_call): Use tf_no_cleanup.
3297 PR c++/78282 - auto template and pack expansion
3298 * pt.c (find_parameter_packs_r): Don't walk into the type of
3299 templates other than template template-parameters.
3301 PR c++/79606 - ICE with this->base_member in NSDMI
3302 * class.c (build_base_path): Check processing_template_decl.
3304 PR c++/79607 - ICE with T{} initializer
3305 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
3307 PR c++/79566 - elaborated-type-specifier in range for
3308 * parser.c (cp_parser_simple_declaration): Fix check for type
3311 PR c++/79400 - confusing suggestion of 'noexcept'
3312 * parser.c (cp_parser_exception_specification_opt): Remove
3313 suggestion for deprecated dynamic exception-specification.
3315 PR c++/79470 - partial ordering with reference parameters
3316 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
3318 PR c++/79500 - ICE with non-template deduction guide
3319 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
3320 DECL_TEMPLATE_RESULT.
3322 PR c++/79580 - ICE with compound literal
3323 * parser.c (cp_parser_class_head): If we're in the middle of an
3324 expression, use ts_within_enclosing_non_class.
3326 PR c++/79503 - inherited ctor taking base class
3327 * call.c (add_function_candidate): Also check that
3328 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
3330 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
3333 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
3336 2017-02-19 Eric Fiselier <eric@efcs.ca>
3337 Jonathan Wakely <jwakely@redhat.com>
3340 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
3341 control warning about literal suffix identifiers without a leading
3344 2017-02-17 Jason Merrill <jason@redhat.com>
3346 PR c++/79508 - lookup error with member template
3347 * parser.c (cp_parser_template_name): Clear
3348 parser->context->object_type if we aren't doing lookup.
3350 PR c++/78690 - ICE with using and global type with same name
3351 * pt.c (type_dependent_object_expression_p): True for
3354 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3355 * pt.c (convert_template_argument): Just return an auto arg pack.
3356 (tsubst_template_args): Don't tsubst an auto pack type.
3358 PR c++/79556 - C++17 ICE with non-type auto
3359 * pt.c (do_auto_deduction): Don't try to deduce from null type.
3361 PR c++/79533 - C++17 ICE with temporary cast to reference
3362 * call.c (build_over_call): Conversion to a reference prevents copy
3365 2017-02-16 Jakub Jelinek <jakub@redhat.com>
3366 Jason Merrill <jason@redhat.com>
3368 PR c++/79502 - lost nodiscard attribute
3369 * pt.c (apply_late_template_attributes): Do apply non-dependent
3370 attributes to types.
3372 2017-02-16 Jason Merrill <jason@redhat.com>
3374 PR c++/78572 - ICE with self-modifying array initializer
3375 * constexpr.c (cxx_eval_store_expression): The object we're
3376 initializing is outside the constant-expression.
3377 (cxx_eval_call_expression): Set ctx->call.
3379 PR c++/79050 - ICE with undeduced auto and LTO
3380 * decl.c (poplevel): Remove undeduced auto decls.
3382 2017-02-16 Jakub Jelinek <jakub@redhat.com>
3385 * parser.c (cp_parser_omp_target): For -fopenmp-simd
3386 ignore #pragma omp target even when not followed by identifier.
3388 2017-02-15 Jason Merrill <jason@redhat.com>
3389 Jakub Jelinek <jakub@redhat.com>
3391 PR c++/79464 - ICE in IPA with omitted constructor parms
3392 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
3393 (adjust_clone_args): Adjust.
3394 (add_method): Remember omitted parms.
3395 * call.c (add_function_candidate): Likewise.
3396 * mangle.c (write_method_parms): Likewise.
3397 * method.c (ctor_omit_inherited_parms): Return false if there are no
3400 2017-02-15 Martin Sebor <msebor@redhat.com>
3403 * init.c (maybe_reject_flexarray_init): New function.
3404 (perform_member_init): Call it.
3406 2017-02-15 Jakub Jelinek <jakub@redhat.com>
3409 * parser.c (cp_parser_std_attribute): Don't pedwarn about
3410 [[deprecated]] with -std=c++11 and [[fallthrough]] with
3411 -std=c++11 and -std=c++14.
3414 * decl.c (grokdeclarator): For static data members, handle thread_p
3415 only after handling inline.
3417 2017-02-14 Marek Polacek <polacek@redhat.com>
3421 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
3422 clobbering if the postfix expression isn't an EXPR_P.
3424 2017-02-13 Jason Merrill <jason@redhat.com>
3426 PR c++/79461 - ICE with lambda in constexpr constructor
3427 * constexpr.c (build_data_member_initialization): Ignore
3428 initialization of a local variable.
3430 2017-02-13 Jakub Jelinek <jakub@redhat.com>
3432 * init.c (warn_placement_new_too_small): Add missing space in
3434 * parser.c (cp_parser_oacc_declare): Likewise.
3435 * mangle.c (maybe_check_abi_tags): Likewise.
3438 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
3439 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
3440 in the rightmost operand.
3442 2017-02-13 Nathan Sidwell <nathan@acm.org>
3444 PR c++/79296 - ICE mangling localized template instantiation
3445 * decl2.c (determine_visibility): Use template fn context for
3446 local class instantiations.
3448 2017-02-11 Jason Merrill <jason@redhat.com>
3450 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
3451 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
3452 (build_new_1): Use replace_placeholders.
3453 * tree.c (replace_placeholders_t): Also track whether we've seen a
3455 (replace_placeholders, replace_placeholders_r): Adjust.
3456 * cp-tree.h: Adjust.
3458 PR c++/77790 - ICE with auto function in C++11 mode
3459 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
3460 (require_deduced_type): Add complain parm, return bool.
3461 * cp-tree.h: Adjust.
3462 * decl2.c (mark_used): Use require_deduced_type.
3464 2017-02-10 Jason Merrill <jason@redhat.com>
3466 PR c++/78908 - template ops and bitfields
3467 * tree.c (build_min_non_dep): Use unlowered_expr_type.
3469 PR c++/78897 - constexpr union
3470 * constexpr.c (cxx_eval_store_expression): A store to a union member
3471 erases a previous store to another member.
3473 PR c++/71285 - member of fold-expression
3474 * semantics.c (finish_unary_fold_expr)
3475 (finish_binary_fold_expr): Use null type for fold-expressions.
3477 PR c++/79401 - protected inherited constructor
3478 * call.c (enforce_access): For inheriting constructor, find a base
3479 binfo in the path we already have.
3481 2017-02-10 Marek Polacek <polacek@redhat.com>
3484 * pt.c (type_dependent_expression_p): Check if the expression type
3488 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
3489 if warnings shouldn't be given.
3491 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
3494 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
3495 an error_mark_node as type.
3497 2017-02-09 Jakub Jelinek <jakub@redhat.com>
3498 Jason Merrill <jason@redhat.com>
3501 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
3502 from pattern to type.
3504 2017-02-09 Jason Merrill <jason@redhat.com>
3506 PR c++/79316 - default argument in deduction guide
3507 PR c++/79350 - explicit deduction guide
3508 * parser.c (cp_parser_constructor_declarator_p)
3509 (cp_parser_direct_declarator): Parse deduction guides more like
3511 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
3512 * tree.c (special_function_p): Return it.
3513 * decl.c (check_special_function_return_type): Handle it.
3514 (grokdeclarator, grokfndecl): Adjust.
3515 (cp_finish_decl): Pass flags to do_auto_deduction.
3516 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
3517 * pt.c (dguide_name_p): Take a const_tree.
3518 (do_class_deduction): Handle explicit.
3519 (do_auto_deduction): Pass flags through.
3520 (build_deduction_guide): Copy explicit flag.
3522 2017-02-09 Jakub Jelinek <jakub@redhat.com>
3525 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
3526 non-pragma_compound context here.
3527 (cp_parser_omp_target): Likewise.
3528 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
3529 parsing for ordered and target omp pragmas in non-pragma_stmt
3530 non-pragma_compound contexts.
3533 * parser.c (cp_parser_oacc_declare): Formatting fix.
3534 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
3535 automatic variables.
3537 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
3538 Chung-Lin Tang <cltang@codesourcery.com>
3540 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
3541 parsing. Parse constant expression. Remove semantic checking.
3542 (cp_parser_omp_clause_collapse): Disallow tile.
3543 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
3544 error about missing for after already emitting one. Use more
3545 conventional for idiom for unbounded loop.
3546 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
3547 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
3548 (finish_omp_for): Deal with tile clause.
3550 2017-02-07 Nathan Sidwell <nathan@acm.org>
3552 * method.c (synthesized_method_base_walk): New. Broken out of ...
3553 (synthesized_method_walk): ... here. Call it. Cleanup
3556 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
3559 * typeck2.c (process_init_constructor_union): Consider only
3560 FIELD_DECLs when looking for an NSDMI.
3562 2017-02-06 Jason Merrill <jason@redhat.com>
3564 PR c++/71193 - incomplete types in templates
3565 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
3566 handle incomplete type by pedwarning and then treating as dependent.
3568 2017-02-06 Jakub Jelinek <jakub@redhat.com>
3571 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
3572 (potential_constant_expression_1): Likewise.
3575 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
3576 allow one fewer than expected arguments if flag_permissive.
3579 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
3580 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
3581 with error_mark_node type.
3583 2017-02-03 Jason Merrill <jason@redhat.com>
3585 PR c++/78689 - ICE on constructor with label
3586 * optimize.c (maybe_clone_body): Replace omitted parameters with
3588 * class.c (build_clone): Fix logic for omitting inherited parms.
3590 PR c++/12245 - excessive memory use
3591 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
3592 back in. Don't cache constants.
3593 (maybe_constant_init): Don't cache constants.
3595 PR c++/79294 - ICE with invalid template argument
3596 * pt.c (convert_nontype_argument_function): Check value-dependence.
3597 (convert_nontype_argument): Don't check it here for function ptrs.
3599 2017-02-02 Richard Biener <rguenther@suse.de>
3602 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
3603 it lazily on the first changed element only and copy it
3604 fully upfront, only storing changed elements.
3606 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
3609 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
3612 2017-01-31 Jakub Jelinek <jakub@redhat.com>
3615 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
3618 2017-01-31 David Malcolm <dmalcolm@redhat.com>
3621 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
3622 any namespace aliases.
3624 2017-01-31 Nathan Sidwell <nathan@acm.org>
3627 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
3631 * pt.c: (instantiate_decl): Push to top level when current
3632 function scope doesn't match. Only push lmabda scope stack when
3635 * cp-tree.h (instantiate_decl): Make defer_ok bool.
3636 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
3637 (instantiate_decl): Simplify and reorder state saving and restoration.
3640 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
3641 * semantics.c (finish_member_declaration): Assert class is being
3644 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
3646 Introduce C++ support in libcc1.
3647 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
3648 (ansi_opname): Rename to...
3649 (cp_operator_id): ... this. Adjust all callers.
3650 (ansi_assopname): Rename to...
3651 (cp_assignment_operator_id): ... this. Adjust all callers.
3652 (cp_literal_operator_id): Declare.
3653 (set_global_friend): Declare.
3654 (is_global_friend): Declare.
3655 (enum cp_oracle_request): New type.
3656 (cp_binding_oracle_function): New type.
3657 (cp_binding_oracle): Declare.
3658 (cp_finish_injected_record_type): Declare.
3659 * friend.c (global_friend): New var.
3660 (set_global_friend): New fn.
3661 (is_global_friend): New fn.
3662 (is_friend): Call is_global_friend.
3663 * name-lookup.c (cp_binding_oracle): New var.
3664 (query_oracle): New fn.
3665 (qualified_lookup_using_namespace): Call query_oracle.
3666 (lookup_name_real_1): Likewise.
3667 * parser.c (cp_literal_operator_id): Drop static.
3668 * search.c (friend_accessible_p): Call is_global_friend.
3669 * semantics.c (is_this_parameter): Accept a variable if the
3670 binding oracle is enabled.
3672 2017-01-27 Jason Merrill <jason@redhat.com>
3674 PR c++/78771 - ICE with inherited constructor.
3675 * call.c (build_over_call): Call deduce_inheriting_ctor here.
3676 * pt.c (tsubst_decl): Not here.
3677 * class.c (add_method): Or here.
3678 * method.c (deduce_inheriting_ctor): Handle clones.
3679 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
3681 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
3684 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
3686 * cp/cp-tree.h: Declare it.
3687 * cp/semantics.c (finish_id_expression): Resolve names within a default
3688 capturing generic lambda defined within a template prior to
3689 instantiation to allow for captures to be added to the closure type.
3691 2017-01-26 Jakub Jelinek <jakub@redhat.com>
3694 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
3695 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
3696 * parser.c (cp_parser_builtin_offsetof): Pass result of
3697 build_static_cast of null_pointer_node to finish_offsetof.
3698 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
3699 it for -Winvalid-offsetof pedwarn instead of trying to guess
3700 original offsetof type from EXPR. Save OBJECT_PTR as a new
3701 second operand to OFFSETOF_EXPR.
3702 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
3703 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
3706 2017-01-26 Jason Merrill <jason@redhat.com>
3708 * name-lookup.c (parse_using_directive): Deprecate strong using.
3710 PR c++/79176 - lambda ICE with -flto -Os
3711 * decl2.c (vague_linkage_p): Handle decloned 'tors.
3712 * tree.c (decl_linkage): Likewise.
3714 2017-01-25 Martin Sebor <msebor@redhat.com>
3716 * decl.c (grokdeclarator): Fix a typo in a comment.
3718 2017-01-25 Jakub Jelinek <jakub@redhat.com>
3721 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
3725 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
3726 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
3728 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
3731 * decl.c (cxx_init_decl_processing): Pass main_input_filename
3732 to build_translation_unit_decl.
3734 2017-01-24 Jakub Jelinek <jakub@redhat.com>
3737 * cp-gimplify.c (cp_genericize_r): Add result of
3738 convert_from_reference on invisiref parm to p_set.
3740 2017-01-24 Nathan Sidwell <nathan@acm.org>
3742 PR c++/78469 - defaulted ctor and inaccessible dtor
3743 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
3744 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
3745 * tree.c (build_target_expr): Check tf_no_cleanup.
3747 PR c++/79118 - anon-members and constexpr
3748 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
3749 ctor decl. Recursively check anonymous members.
3750 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
3752 (explain_invalid_constexpr_fn): Likewise.
3754 2017-01-23 Nathan Sidwell <nathan@acm.org>
3756 PR c++/71710 - template using directive of field
3757 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
3760 PR c++/71406 - ICE with scope-ref'd template id exprs
3762 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
3763 before breaking up TEMPLATE_ID_EXPR.
3765 2017-01-20 Nathan Sidwell <nathan@acm.org>
3767 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
3768 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
3770 2017-01-20 David Malcolm <dmalcolm@redhat.com>
3774 * cp-tree.h (suggest_alternatives_for): Add bool param.
3775 (suggest_alternative_in_explicit_scope): New decl.
3776 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
3777 that isn't the global one, call new function
3778 suggest_alternative_in_explicit_scope, only calling
3779 suggest_alternatives_for if it fails, and disabling near match
3780 searches fort that case. When SCOPE is the global namespace,
3781 pass true for new param to suggest_alternatives_for to allow for
3783 * lex.c (unqualified_name_lookup_error): Pass true for new param
3784 to suggest_alternatives_for.
3785 * name-lookup.c (consider_binding_level): Add forward decl.
3786 (suggest_alternatives_for): Add "suggest_misspellings" param,
3787 using it to conditionalize the fuzzy name-lookup code.
3788 (suggest_alternative_in_explicit_scope): New function.
3789 * parser.c (cp_parser_primary_expression): When calling
3790 finish_id_expression, pass location of id_expression rather
3791 than that of id_expr_token.
3792 (cp_parser_id_expression): Convert local "unqualified_id" from
3793 tree to cp_expr to avoid implicitly dropping location information.
3795 2017-01-20 Marek Polacek <polacek@redhat.com>
3798 * call.c (build_conditional_expr_1): Warn about duplicated branches.
3799 * semantics.c (finish_expr_stmt): Build statement using the proper
3802 2017-01-19 Jason Merrill <jason@redhat.com>
3804 US 20 - forwarding references and class template argument deduction
3805 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
3806 * pt.c (push_template_decl_real): Set it.
3807 (maybe_adjust_types_for_deduction): Check it.
3808 (rewrite_template_parm): Copy it.
3810 US 19 - deduction guides and constructors
3811 * call.c (joust): Prefer deduction guides to constructors.
3812 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
3813 (deduction_guide_p): Check DECL_P.
3815 * decl.c (check_initializer): Always use build_aggr_init for array
3818 PR c++/79130 - decomposition and direct-initialization
3819 * init.c (build_aggr_init): Communicate direct-initialization to
3821 (build_vec_init): Check for array copy sooner.
3822 * parser.c (cp_parser_decomposition_declaration): Remove call to
3823 build_x_compound_expr_from_list.
3825 2017-01-18 Jason Merrill <jason@redhat.com>
3827 PR c++/68666 - member variable template-id
3828 * typeck.c (finish_class_member_access_expr): Handle variable
3830 * pt.c (lookup_and_finish_template_variable): No longer static.
3831 * cp-tree.h: Declare it.
3833 2017-01-18 Nathan Sidwell <nathan@acm.org>
3836 * call.c (build_over_call): When checking ellipsis conversions for
3837 an inherited ctor, make sure there is at least one conversion.
3839 2017-01-18 Jason Merrill <jason@redhat.com>
3841 PR c++/78894 - ICE with class deduction and default arg
3842 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
3844 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
3847 * mangle.c (write_discriminator): Reorganize abi warning check.
3849 2017-01-18 Nathan Sidwell <nathan@acm.org>
3851 * cp-tree.h: Clarify exception spec node comment.
3852 * except.c (nothrow_spec_p): Simplify by checking node-equality.
3855 * mangle.c (write_exception_spec): Check nothrow explicitly.
3856 (write_encoding): Don't increment processing_template_decl around
3859 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
3862 * mangle.c (write_template_args): Add "on" for operator names.
3864 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
3867 * mangle.c (write_discriminator): Handle discriminator >= 10.
3869 2017-01-17 Nathan Sidwell <nathan@acm.org>
3872 * cp-tree.h (maybe_generic_this_capture): Declare.
3873 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
3874 (maybe_resolve_dummy): ... here. Call it.
3875 (maybe_generic_this_capture): New.
3876 * parser.c (cp_parser_postfix_expression): Speculatively capture
3877 this in generic lambda in unresolved member function call.
3878 * pt.c (tsubst_copy_and_build): Force hard error from failed
3879 member function lookup in generic lambda.
3881 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
3884 * cp-array-notation.c (expand_array_notation_exprs): Handle
3887 2017-01-11 Jason Merrill <jason@redhat.com>
3889 PR c++/78337 - ICE on invalid with generic lambda
3890 * semantics.c (process_outer_var_ref): Check if containing_function
3891 is null. Move inform call under complain test.
3893 2017-01-11 Nathan Sidwell <nathan@acm.org>
3896 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
3899 2017-01-11 Nathan Sidwell <nathan@acm.org>
3901 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
3903 2017-01-11 Jakub Jelinek <jakub@redhat.com>
3906 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
3907 assertion. Formatting fix.
3910 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
3913 2017-01-10 David Malcolm <dmalcolm@redhat.com>
3916 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
3917 a missing semicolon if we have a valid insertion location for
3920 2017-01-10 Jason Merrill <jason@redhat.com>
3922 FI 20, decomposition declaration with parenthesized initializer.
3923 * parser.c (cp_parser_decomposition_declaration): Use
3924 cp_parser_initializer.
3926 2017-01-09 Jason Merrill <jason@redhat.com>
3928 Implement P0195R2, C++17 variadic using.
3929 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
3930 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
3931 * error.c (dump_decl): Likewise.
3933 2017-01-09 Jakub Jelinek <jakub@redhat.com>
3935 PR translation/79019
3936 PR translation/79020
3937 * semantics.c (finish_omp_clauses): Add missing whitespace to
3938 translatable strings.
3939 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
3941 2017-01-07 Jason Merrill <jason@redhat.com>
3943 PR c++/78948 - instantiation from discarded statement
3944 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
3945 * cp-tree.h (in_discarded_stmt): Declare it.
3946 (struct saved_scope): Add discarded_stmt bitfield.
3947 (in_discarded_stmt): New macro.
3948 * decl2.c (mark_used): Check it.
3949 * parser.c (cp_parser_selection_statement): Adjust.
3950 (cp_parser_jump_statement): Adjust.
3952 2017-01-05 Jakub Jelinek <jakub@redhat.com>
3955 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
3956 REFERENCE_REF_P, set tt to its operand.
3959 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
3960 unions even for C++11 and later.
3962 2017-01-05 Nathan Sidwell <nathan@acm.org>
3965 * pt.c (convert_nontype_argument): Don't try and see if integral
3966 or enum expressions are constants prematurely.
3968 2017-01-04 Marek Polacek <polacek@redhat.com>
3971 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
3972 a zero character literal.
3974 2017-01-04 Jakub Jelinek <jakub@redhat.com>
3977 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
3981 * parser.c (cp_parser_simple_declaration): Only complain about
3982 inconsistent auto deduction if auto_result doesn't use auto.
3984 * parser.c (cp_parser_simple_declaration): Diagnose function
3985 declaration among more than one init-declarators with auto
3989 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
3990 assertion, as lexer->buffer may be NULL.
3992 2017-01-04 Marek Polacek <polacek@redhat.com>
3996 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
3998 2017-01-04 Nathan Sidwell <nathan@acm.org>
4001 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
4002 (lambda_capture_field_type): Update prototype.
4003 * lambda.c (lambda_capture_field_type): Add is_reference parm.
4004 Add referenceness here.
4005 (add_capture): Adjust lambda_capture_field_type call, refactor
4007 * pt.c (tsubst): Adjust lambda_capture_field_type call.
4009 2017-01-01 Jakub Jelinek <jakub@redhat.com>
4011 Update copyright years.
4013 Copyright (C) 2017 Free Software Foundation, Inc.
4015 Copying and distribution of this file, with or without modification,
4016 are permitted in any medium without royalty provided the copyright
4017 notice and this notice are preserved.