1 2017-07-17 Nathan Sidwell <nathan@acm.org>
3 * class.c (maybe_warn_about_overly_private_class): Ignore public
6 * class.c (type_has_user_declared_move_constructor,
7 type_has_user_declared_move_assign): Combine into ...
8 (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
9 * cp-tree.h (type_has_user_declared_move_constructor,
10 type_has_user_declared_move_assign): Combine into ...
11 (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
12 * method.c (maybe_explain_implicit_delete): Use it.
13 (lazily_declare_fn): Use it.
14 * tree.c (type_has_nontrivial_copy_init): Use it.
16 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
17 semantics, simplify implementation.
19 2017-07-16 Volker Reichelt <v.reichelt@netcologne.de>
21 * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
22 in old-style cast diagnostic.
23 * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
24 in useless cast diagnostic.
25 * error.c (type_to_string): Remove enum special handling.
27 2017-07-14 David Malcolm <dmalcolm@redhat.com>
29 * name-lookup.c (get_std_name_hint): Add '<' and '>' around
31 (maybe_suggest_missing_header): Update for addition of '<' and '>'
32 to above. Provide a fix-it hint.
33 * pt.c: Include "gcc-rich-location.h"
34 (listify): Attempt to add fix-it hint for missing
35 #include <initializer_list>.
36 * rtti.c: Include "gcc-rich-location.h".
37 (typeid_ok_p): Attempt to add fix-it hint for missing
40 2017-07-12 Jason Merrill <jason@redhat.com>
42 P0512R0 - Deduction from an initializer list.
43 * pt.c (do_class_deduction): Do list deduction in two phases.
45 2017-07-12 Nathan Sidwell <nathan@acm.org>
47 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
48 DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
50 * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
51 DECL_CXX_DESTRUCTOR explicitly.
52 * decl2.c (grokclassfn): Likewise.
53 * friend.c (do_friend): Likewise.
54 * method.c (make_thunk, make_alias_for,
55 implicitly_declare_fn): Likewise.
57 2017-07-11 Jason Merrill <jason@redhat.com>
60 * decl.c (grokparms): Downgrade error about array of unknown bound
61 to pedwarn and disable it for C++17.
63 2017-07-11 Nathan Sidwell <nathan@acm.org>
65 * decl2.c (reset_type_linkage_2): Dont't change ctor name.
67 2017-07-10 Martin Sebor <msebor@redhat.com>
69 * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
71 2017-07-06 Jason Merrill <jason@redhat.com>
73 PR c++/81204 - parse error with dependent template-name
74 * parser.c (cp_parser_lookup_name): Revert previous change.
76 2017-07-06 David Malcolm <dmalcolm@redhat.com>
78 * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
79 selftest::run_cp_tests.
80 (selftest::run_cp_tests): New function.
81 * cp-tree.h (selftest::run_cp_tests): New decl.
83 2017-07-04 Jakub Jelinek <jakub@redhat.com>
85 * parser.c (cp_parser_decomposition_declaration): Replace
86 decomposition declaration with structured binding in diagnostics.
87 * decl.c (cp_finish_decomp): Likewise.
88 (grokdeclarator): Likewise.
91 * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
92 forms of structured binding initializers.
94 2017-07-03 Paolo Carlini <paolo.carlini@oracle.com>
97 * decl.c (grokdeclarator): Move checks on function return type after
98 the splice_late_return_type call; if declspecs->locations[ds_type_spec]
99 is UNKNOWN_LOCATION fall back to input_location.
101 2017-07-03 David Malcolm <dmalcolm@redhat.com>
103 * parser.c (enum required_token): Fix spelling of
104 RT_INTERATION to RT_ITERATION.
105 (cp_parser_iteration_statement): Likewise.
106 (cp_parser_required_error): Likewise.
108 2017-06-30 Jason Merrill <jason@redhat.com>
110 PR c++/81257 - ICE with invalid ::template.
111 PR c++/54769 - wrong lookup of dependent template-name.
112 * parser.c (cp_parser_template_name): Revert part of last change.
114 2017-06-30 Nathan Sidwell <nathan@acm.org>
116 * config-lang.in (gtfiles): Add cp/lex.c.
117 * cp-tree.h (mangle_convop_name_for_type): Rename ...
118 (make_conv_op_name): ... here. Move to lex.
119 * lambda.c (maybe_add_lambda_conv_op): Update.
120 * parser.c (cp_parser_conversion_function_id): Update.
121 * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
122 tsubst_copy_and_build): Update.
123 * semantics.c (apply_deduced_return_type): Update.
124 * mangle.c (conv_type_hasher, conv_type_names,
125 mangle_conv_op_name_for_type): Move to ...
126 * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
129 2017-06-30 David Malcolm <dmalcolm@redhat.com>
132 * parser.c (cp_parser_postfix_expression): Construct a location
133 for typeid expressions.
135 2017-06-30 Nathan Sidwell <nathan@acm.org>
137 * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
139 (lookup_all_conversions): Declare.
140 * class.c (get_basefndecls): Use lookup_fnfields_slot.
141 * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
142 * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
144 * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
145 (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
146 lookup_all_conversions.
147 * search.c (lookup_fnfields_1): Make static.
148 (lookup_all_conversions): New.
149 (class_method_index_for_fn): Delete.
150 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
151 lookup_fnfields_slot.
153 * call.c (build_new_method_call_1): Use constructo_name to get
154 ctor name. Move argument processing earlier to merge cdtor
156 * decl.c (grokfndecl): Cdtors have special names.
157 * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
158 * pt.c (check_explicit_specialization): Cdtor name is already
160 * search.c (class_method_index_for_fn): Likewise.
163 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
164 a matching TYPE_DECL.
166 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
168 * class.c (add_method): Change pair of errors to error + inform.
169 (handle_using_decl): Likewise.
171 2017-06-29 Jason Merrill <jason@redhat.com>
173 * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
175 PR c++/81180 - ICE with C++17 deduction of member class template.
176 * pt.c (build_deduction_guide): Correct member template handling.
178 PR c++/81188 - matching decltype of member function call.
179 * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
181 2017-06-29 Nathan Sidwell <nathan@acm.org>
184 * parser.c (cp_parser_namespace_definition): Immediately close the
185 namespace if there's no open-brace.
186 * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
189 2017-06-29 Jason Merrill <jason@redhat.com>
191 PR c++/81164 - ICE with invalid inherited constructor.
192 * search.c (binfo_direct_p): New.
193 * name-lookup.c (do_class_using_decl): Use it.
195 2017-06-29 Nathan Sidwell <nathan@acm.org>
197 * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
198 VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
199 * decl.c (initialize_predefined_identifiers): Name cdtor special
200 names consistently. Use literals for above deleted defines.
201 (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
203 * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
206 * call.c (check_dtor_name): Use constructor_name for enums too.
207 (build_new_method_call_1): Use constructor_name for cdtors and
209 * class.c (build_self_reference): Use TYPE_NAME to get name of
211 * name-lookup (constructor_name): Use DECL_NAME directly.
212 (constructor_name_p): Reimplement.
213 (push_class_level_binding_1): Use TYPE_NAME directly.
215 * class.c (finish_struct): Use OVL_P.
216 (get_vfield_name): Measure constructor_name length.
217 * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
218 (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
219 * cxx-pretty-print.c (is_destructor_name): Delete.
220 (pp_cxx_unqualified_id): Remove bogus destructor name checking.
221 * decl.c (grokfndecl): Move cheap checks first when looking for
222 implicit extern cness.
224 * parser.c (cp_parser_direct_declarator): Reorder if to avoid
225 indentation. Remove unnecessary assignment of constructor name.
228 * call.c (name_as_c_string): Move CONST_CAST to return.
229 (build_new_method_call_1): Remove unneeded bracing.
230 * class.c (include_empty_classes): Unbreak line.
231 * constraint.cc (tsubst_check_constraint): Add space.
232 * cp-tree.h (lang_decl_ns): Add comment.
233 (PTRMEM_CST_MEMBER): Break line.
234 * decl.c (grokfndecl): Add blank lines. Unbreak some others.
235 (grokdeclarator): Remove lines, move declaration to first use.
236 * decl2.c (decl_needed_p): Fix indentation.
237 (c_parse_final_cleanups): Remove blank line.
238 * method.c (implicitly_declare_fn): Move declaration to first use.
239 * search.c (current_scope): Add blank lines.
241 2017-06-28 Jason Merrill <jason@redhat.com>
243 PR c++/72764 - ICE with invalid template typename.
244 * decl.c (build_typename_type): No longer static.
245 * tree.c (strip_typedefs): Use it instead of make_typename_type.
247 PR c++/69300 - ICE with self-referential noexcept
248 * pt.c (maybe_instantiate_noexcept): Check for recursion.
250 PR c++/61022 - error with variadic template template parm
251 * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
253 PR c++/72801 - ICE with variadic partial specialization
254 * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
256 PR c++/55639 - partial specialization with ::template
257 * parser.c (cp_parser_class_head): Handle ::template.
259 PR c++/45976 - error with ::template in declarator.
260 * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
262 PR c++/54769 - wrong lookup of dependent template-name.
263 * parser.c (cp_parser_template_name): Handle dependent object type.
264 (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
266 (cp_parser_id_expression): Pass it.
267 (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
269 * parser.c (cp_parser_template_id): Use the range location on the
272 PR c++/81204 - parse error with dependent template-name
273 * parser.c (cp_parser_lookup_name): Disqualify function templates
276 2017-06-27 Nathan Sidwell <nathan@acm.org>
278 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
279 initialization point. Don't unnecessarily check for ctor name.
281 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
282 (CLASSTYPE_DESTRUCTOR): ... this.
283 * class.c (accessible_nvdtor_p,
284 maybe_warn_about_overly_private_class,
285 add_implicitly_declared_members,
286 clone_constructors_and_destructors, type_has_virtual_destructor):
287 Adjust for CLASSTYPE_DESTRUCTOR.
288 (deduce_noexcept_on_destructors): Absorb into ...
289 (check_bases_and_members): ... here.
290 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
291 * init.c (build_delete): Likewise.
292 * parser.c (cp_parser_lookup_name): Likewise.
293 * pt.c (check_explicit_specialization): Likewise.
294 * rtti.c (emit_support_tinfos): Likewise.
295 * search.c (lookup_fnfields_idx_nolazy): Likewise.
297 Kill IDENTIFIER_TEMPLATE.
298 * cp-tree.h (lang_identifier): Remove class_template_info field.
299 (IDENTIFIER_TEMPLATE): Delete.
300 * name-lookup.c (constructor_name_full): Subsume into ...
301 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
302 (constructor_name_p): Likewise.
303 * mangle.c (write_source_name): Likewise.
304 * ptree.c (cxx_print_identifier): Likewise.
306 2017-06-27 Marek Polacek <polacek@redhat.com>
309 * parser.c (cp_parser_already_scoped_statement): Initialize
312 2017-06-26 Jason Merrill <jason@redhat.com>
314 PR c++/81215 - deduction failure with variadic TTP.
315 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
317 2017-06-26 Martin Sebor <msebor@redhat.com>
320 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
321 to detect casting away cv-qualifiers.
323 2017-06-26 Nathan Sidwell <nathan@acm.org>
325 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
326 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
328 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
329 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
330 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
331 * decl.c (grok_op_properties): Adjust identifier checking.
332 * init.c (expand_default_init): Adjust identifier descision.
333 * method.c (implicitly_declare_fn): Don't use
334 DECL_ASSIGNMENT_OPERATOR_P.
335 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
337 * call.c (in_charge_arg_for_name): Reimplement.
338 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
341 2017-06-26 Marek Polacek <polacek@redhat.com>
344 * parser.c (cp_parser_statement): Add a default argument. Save the
345 location of the expression-statement after labels have been parsed.
346 (cp_parser_implicitly_scoped_statement): Set the location of the
347 body of the conditional after parsing all the labels. Call
348 warn_for_multistatement_macros.
349 (cp_parser_already_scoped_statement): Likewise.
351 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
354 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
355 'typename' in error messages about missing 'typename'.
357 2017-06-23 Jason Merrill <jason@redhat.com>
359 PR c++/79056 - C++17 ICE with invalid template syntax.
360 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
362 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
363 * pt.c (template_placeholder_p): New.
364 * cp-tree.h: Declare it.
366 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
368 * decl.c (duplicate_decls): Use builtin_structptr_types.
370 2017-06-22 Nathan Sidwell <nathan@acm.org>
372 Reorder IDENTIFIER flags
374 * cp-tree.h (enum cp_identifier_kind): New.
375 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
376 IDENTIFIER_KIND_BIT_2): New.
377 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
378 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
379 (C_IS_RESERVED_WORD): Replace with ...
380 (IDENTIFIER_KEYWORD_P): ... this.
381 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
382 (IDENTIFIER_CDTOR_P): ... this.
383 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
384 (IDENTIFIER_OPNAME_P): Replace with ...
385 (IDENTIFIER_ANY_OP_P): ... this.
386 (IDENTIFIER_ASSIGN_OP_P): New.
387 (IDENTIFIER_TYPENAME_P): Replace with ...
388 (IDENTIFIER_CONV_OP_P): ... this.
389 (NEW_DELETE_OPNAME_P): Replace with ...
390 (IDENTIFIER_NEWDEL_OP_P): ... this.
391 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
392 (get_identifier_kind_name, set_identifier_kind): Declare.
393 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
394 (init_operators): Adjust to avoid keywords, use
395 set_identifier_kind. Copy TYPE_EXPR slot.
396 (init_reswords): Call set_identifier_kind.
397 (unqualified_name_lookup_error): Adjust.
398 * operators.def (TYPE_EXPR): Remove.
399 * decl.c (struct predefined_identifier): Move into ...
400 (initialize_predefined_identifiers): ... here. Call
402 (grokfndecl, check_var_type, grokdeclarator): Adjust.
403 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
405 * call.c (name_as_c_string): Adjust.
406 (build_new_method_call_1): Likewise.
407 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
408 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
409 * dump.c (cp_dump_tree): Adjust.
410 * error.c (dump_decl_name): Adjust.
411 * mangle.c (write_unqualified_id, write_member_name,
412 write_expression): Adjust.
413 (mangle_conv_op_name_for_type): Use set_identifier_kind.
414 * name-lookup.c (do_class_using_decl): Adjust.
415 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
416 * parser.c (cp_lexer_get_preprocessor_token,
417 cp_parser_direct_declarator): Likewise.
418 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
419 tsubst_copy, tsubst_copy_and_build): Adjust.
420 * ptree.c (cxx_print_identifier): Print identifier kind.
421 * search.c (lookup_field_r, lookup_member,
422 lookup_fnfields_idx_nolazy): Adjust.
423 * semantics.c (finish_id_expression): Adjust..
424 * typeck.c (cp_build_addr_expr_1): Adjust.
426 2017-06-21 Jakub Jelinek <jakub@redhat.com>
429 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
430 Complain about t not being a variable if t is OVERLOAD even
431 when processing_template_decl.
433 2017-06-21 David Malcolm <dmalcolm@redhat.com>
435 * parser.c (get_cast_suggestion): New function.
436 (maybe_add_cast_fixit): New function.
437 (cp_parser_cast_expression): Capture the location of the closing
438 parenthesis. Call maybe_add_cast_fixit when emitting warnings
439 about old-style casts.
441 2017-06-20 Jason Merrill <jason@redhat.com>
443 PR c++/80972 - C++17 ICE with attribute packed.
444 * call.c (build_over_call): Allow a TARGET_EXPR from reference
447 2017-06-20 Nathan Sidwell <nathan@acm.org>
449 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
450 (nelts_identifier): Delete.
451 * decl.c (initialize_predefined_identifiers): Remove nelts.
453 PR c++/67074 - namespace aliases
454 * decl.c (duplicate_decls): Don't error here on mismatched
456 * name-lookup.c (name_lookup::add_value): Matching namespaces are
458 (diagnose_name_conflict): Namespaces are never redeclarations.
459 (update_binding): An alias can match a real namespace.
461 2017-06-19 Jason Merrill <jason@redhat.com>
463 PR c++/80562 - ICE with constexpr if.
464 * semantics.c (finish_if_stmt_cond): Call
465 instantiate_non_dependent_expr.
467 PR c++/80829 - ICE with constexpr copy of base subobject.
468 * constexpr.c (clear_no_implicit_zero): New.
469 (cxx_eval_call_expression): Call it.
471 2017-06-19 Nathan Sidwell <nathan@acm.org>
475 * name-lookup.c (set_decl_namespace): Don't follow using
476 directives and ignore using decls. Only check overly-explicit
477 scope after discovering decl.
479 2017-06-19 Jason Merrill <jason@redhat.com>
481 PR c++/81073 - constexpr and static var in statement-expression.
482 * typeck2.c (store_init_value): Always call
483 require_potential_constant_expression.
484 * pt.c (convert_nontype_argument): Likewise.
485 * constexpr.c (potential_constant_expression_1): Adjust message.
486 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
487 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
489 2017-06-19 Nathan Sidwell <nathan@acm.org>
491 * pt.c (coerce_template_parms): Fix indentation.
492 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
496 * name-lookup.c (update_binding): Only warn about constructors
499 2017-06-17 Jason Merrill <jason@redhat.com>
501 PR c++/60063 - -Wunused-local-typedefs and templates.
502 * decl2.c (is_late_template_attribute): Return false for "used".
504 PR c++/70844 - -Wuseless-cast and inheriting constructor.
505 * method.c (forward_parm): Suppress warn_useless_cast.
507 2017-06-16 Jason Merrill <jason@redhat.com>
509 PR c++/81045 - Wrong type-dependence with auto return type.
510 * pt.c (type_dependent_expression_p): An undeduced auto outside the
511 template isn't dependent.
512 * call.c (build_over_call): Instantiate undeduced auto even in a
515 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
516 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
517 set longer for a generic lambda.
519 PR c++/80614 - Wrong mangling for C++17 noexcept type
520 * mangle.c (write_type): Put the eh spec back on the function type.
522 PR c++/81102 - Wrong error with partial specialization.
523 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
524 types. Do type deduction later.
526 PR c++/81074 - ICE with partial specialization of member template.
528 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
530 PR c++/80831 - ICE with -fsyntax-only.
531 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
533 PR c++/80639 - ICE with invalid PMF initialization.
534 PR c++/80043 - ICE with -fpermissive
535 * typeck.c (convert_for_assignment): Recurse when instantiate_type
536 returns without an error.
538 2017-06-16 Nathan Sidwell <nathan@acm.org>
540 * pt.c (tsubst_baselink): Fix & clarify formatting.
542 * cp-tree.h (build_this_parm, cp_build_parm_decl,
543 build_artificial_parm): Add FN parm.
544 * decl.c (start_cleanup_fn): Adjust.
545 (build_this_parm): Add FN parm, pass it through.
546 (grokfndecl): Adjust parm building.
547 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
548 (build_artificial_parm): Add FN parm, pass through.
549 (maybe_retrofit_in_chrg): Adjust parm building.
550 (start_static_storage_duration_function): Likwise.
551 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
552 * method.c (implicitly_declare_fn): Likewise.
553 * parser.c (inject_this_parameter): Likewise.
555 Symbol tables are insert only.
556 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
557 derive from pointer_hash. Make undeletable.
559 * class.c (resort_type_method_vec): Avoid potential unsigned
562 Don't defer noexcept_deferred_spec.
563 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
564 * decl.c (cxx_init_decl_processing): Initialize
565 noexcept_deferred_spec.
566 * except.c (unevaluated_noexcept_spec): Delete.
567 * class.c (deduce_noexcept_on_destructor): Use
568 noexcept_deferred_spec directly.
569 * method.c (implicitly_declare_fn): Likewise.
571 Make keyed_classes a vector.
572 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
573 (keyed_classes): Declare as vector.
574 * decl.c (keyed_classes): Define.
575 (cxx_init_decl_processing): Allocate it.
576 (record_key_method_defined): Use vec_safe_push.
577 * class.c (finish_struct_1): Likewise.
578 * pt.c (instantiate_class_template_1): Likewise.
579 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
582 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
583 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
585 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
586 (get_tinfo_decl): Use get_tinfo_desc.
587 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
588 (create_pseudo_type_info): Delete.
589 (get_pseudo_ti_index): Just determine the index.
590 (get_tinfo_desc): New. Create all types lazily.
591 (create_tinfo_types): Just allocate the descriptor array.
592 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
595 2017-06-15 Martin Sebor <msebor@redhat.com>
598 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
600 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
601 (build_cxx_call): Call maybe_warn_class_memaccess.
603 2017-06-14 Jakub Jelinek <jakub@redhat.com>
605 * cp-gimplify.c (cp_genericize_r): Turn most of the function
606 into a switch (TREE_CODE (stmt)) statement from long else if
609 2017-06-13 Jakub Jelinek <jakub@redhat.com>
612 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
613 argument even if it has REFERENCE_TYPE.
616 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
617 BLOCK_VARS (outer) chain.
618 (cxx_omp_const_qual_no_mutable): Likewise.
620 2017-06-13 Martin Liska <mliska@suse.cz>
623 * class.c (build_base_path): Use sanitize_flags_p.
624 * cp-gimplify.c (cp_genericize_r): Likewise.
625 (cp_genericize_tree): Likewise.
626 (cp_genericize): Likewise.
627 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
628 * decl.c (compute_array_index_type): Likewise.
629 (start_preparsed_function): Likewise.
630 * decl2.c (one_static_initialization_or_destruction): Likewise.
631 * init.c (finish_length_check): Likewise.
632 * lambda.c (maybe_add_lambda_conv_op): Likewise.
633 * typeck.c (cp_build_binary_op): Likewise.
634 (build_static_cast_1): Likewise.
636 2017-06-11 Jason Merrill <jason@redhat.com>
638 * error.c (dump_expr): Use is_this_parameter.
640 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
643 2017-06-09 Jason Merrill <jason@redhat.com>
645 Missing bits from N4268, constant evaluation for all non-type args.
646 * call.c (build_converted_constant_expr): Rename from
647 build_integral_nontype_arg_conv, handle all types.
648 * pt.c (convert_nontype_argument): In C++17 call it for all types.
649 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
650 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
652 Overhaul pointer-to-member conversion and template argument handling.
653 * call.c (standard_conversion): Avoid creating ck_pmem when the
654 class type is the same.
655 * cvt.c (can_convert_qual): Split from
656 perform_qualification_conversions.
657 * constexpr.c (cxx_eval_constant_expression): Check it.
658 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
659 adjustment is necessary.
660 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
661 (convert_nontype_argument): Avoid redundant error.
663 * call.c (convert_like_real): Remove "inner" parameter.
664 Don't replace a constant with its value.
665 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
667 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
670 * parser.c (cp_parser_constant_expression): Check
671 potential_rvalue_constant_expression after decay_conversion.
672 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
674 PR c++/80384 - ICE with dependent noexcept-specifier
675 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
678 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
680 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
682 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
683 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
684 (excpet.c): Mark terminate as cold.
686 2017-06-08 Jakub Jelinek <jakub@redhat.com>
689 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
690 to sizetype before size_binop.
693 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
694 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
695 and OMP_CLAUSE_SHARED_READONLY flags.
697 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
699 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
701 2017-06-07 Nathan Sidwell <nathan@acm.org>
703 * class.c (layout_class_type): Restructure overlong-bitfield tpe
706 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
709 * pt.c (do_class_deduction): Build qualified type.
711 2017-06-06 Nathan Sidwell <nathan@acm.org>
713 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
714 sans using directives. Don't walk into inline namespaces.
717 * name-lookup.c (adl_class_only): Don't add visible friends.
719 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
721 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
723 2017-06-02 Nathan Sidwell <nathan@acm.org>
725 Remove lang_type_ptrmem.
726 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
728 (lang_type_class): ... this. Reorder bitfields. Rename to ...
729 (lang_type): ... this. Delete old definition.
730 (lang_type_ptrmem): Delete.
731 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
732 (LANG_TYPE_PTRMEM_CHECK): Delete.
733 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
734 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
735 * decl.c (build_ptrmemfunc_type): Adjust.
736 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
737 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
739 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
742 Remove cp_binding_level::namespaces
743 * name-lookup.h (cp_binding_level): Lose namespaces field.
744 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
746 (suggest_alternatives_for): Adjust for namespace list. Do
747 breadth-first search.
748 * decl2.c (collect_source_refs): Namespaces are on the regulr
750 (collect_ada_namespace): Likewise.
752 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
754 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
757 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
760 * method.c (constructible_expr): Strip array types before calling
763 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
766 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
767 for case INDIRECT_REF too in the main switch.
769 2017-05-31 Jason Merrill <jason@redhat.com>
771 PR c++/80840 - ICE with constexpr and reference
772 * pt.c (convert_nontype_argument): Don't test whether a decl is
773 value-dependent when binding to a reference.
775 2017-05-31 Nathan Sidwell <nathan@acm.org>
777 * cp-tree.h (lang_decl_slector): New enum.
778 (lang_decl_base): Make selector an enum. Drop decomposition_p
780 (lang_decl): Use enum for discrimination.
781 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
782 LANG_DECL_DEOMP_CHECK): Use enum.
783 (DECL_DECOMPOSITION_P): Use selector value.
784 (SET_DECL_DECOMPOSITION_P): Delete.
785 (retrofit_lang_decl): Lose SEL parm.
786 (fit_decomposition_lang_decl): Declare.
787 * decl.c (cp_finish_decomp, grokdeclarator): Use
788 fit_decomposition_lang_decl.
789 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
791 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
792 (fit_decomposition_lang_decl): Likewise.
793 (retrofit_lang_decl): Use worker functions.
794 (cxx_dup_lang_specific_decl): Use selector enum.
795 (maybe_add_lang_type_raw): New. Broken out of ...
796 (cxx_make_type_name): ... here. Call it.
798 2017-05-30 Jason Merrill <jason@redhat.com>
800 PR c++/80856 - ICE with local extern in template
801 * semantics.c (finish_call_expr): Replace a local extern overload
802 set in a template with the IDENTIFIER_NODE.
804 2017-05-30 David Malcolm <dmalcolm@redhat.com>
806 * call.c (perform_implicit_conversion_flags): Convert
807 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
808 (print_conversion_rejection): Replace pairs of %qT with
809 %qH and %qI in various places.
810 (build_user_type_conversion_1): Likewise.
811 (build_integral_nontype_arg_conv): Likewise.
812 (build_conditional_expr_1): Likewise.
813 (convert_like_real): Likewise.
814 (convert_arg_to_ellipsis): Likewise.
816 (initialize_reference): Likewise.
817 * cvt.c (cp_convert_to_pointer): Likewise.
818 (cp_convert_to_pointer): Likewise.
819 (convert_to_reference): Likewise.
820 (ocp_convert): Likewise.
821 * error.c (cp_printer): Gain bool and const char ** parameters.
822 (struct deferred_printed_type): New struct.
823 (class cxx_format_postprocessor): New class.
824 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
825 to pp->m_format_postprocessor.
826 (comparable_template_types_p): New function.
827 (newline_and_indent): New function.
828 (arg_to_string): New function.
829 (print_nonequal_arg): New function.
830 (print_template_differences): New function.
831 (type_to_string_with_compare): New function.
832 (print_template_tree_comparison): New function.
833 (append_formatted_chunk): New function.
834 (add_quotes): New function.
835 (cxx_format_postprocessor::handle): New function.
836 (defer_phase_2_of_type_diff): New function.
837 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
839 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
840 %qH and %qI in various places.
841 (convert_member_func_to_ptr): Likewise.
842 (build_reinterpret_cast_1): Likewise.
843 (convert_for_assignment): Likewise.
844 * typeck2.c (check_narrowing): Likewise.
846 2017-05-30 Nathan Sidwell <nathan@acm.org>
848 Kill IDENTIFIER_NAMESPACE_BINDINGS
849 * cp-tree.h (lang_identifier): Delete namespace_bindings.
850 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
851 (lang_decl_ns): Add bindings.
852 (DECL_NAMESPACE_BINDINGS): New.
853 * lex.c (retrofit_lang_decl): Create namespace hash table.
854 * name-lookup.c (find_namespace_slot): Change to use hash-map.
855 * ptree.c (cxx_print_binding): Delete.
856 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
858 * cp-tree.def (OVERLOAD): Fix comment.
859 * cp-tree.h: Fix comments and whitespace.
860 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
861 * name-lookup.c (add_decl_to_level): Assert not class.
862 (check_local_shadow): Use OVL_P.
863 (pushdecl_with_scope_1): Rename to ...
864 (do_pushdecl_with_Scope): ... here.
865 (do_nonmember_using_decl): Use qualified_namespace_lookup return
867 (push_class_level_binding_1): Use OVL_P.
868 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
869 (pushtag_1): Rename to ...
870 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
872 (store_class_bindings): Do not time here.
873 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
874 * pt.c (listify): Declare argvec at point of initialization.
877 * name-lookup.c (add_decl_to_level): Assert not making a circular
879 (update_binding): Don't prematurely slide artificial decl.
881 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
883 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
885 2017-05-29 Nathan Sidwell <nathan@acm.org>
888 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
889 * name-lookup.c (name_lookup): Add deduping field.
890 (name_lookup::preserve_state, name_lookup::restore_state): Deal
892 (name_lookup::add_overload): New.
893 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
894 (name_lookup::search_adl): Set deduping. Don't unmark here.
895 * pt.c (most_specialized_instantiation): Revert previous change,
896 Assert not given duplicates.
897 * tree.c (lookup_mark): Just mark the underlying decls.
898 (lookup_maybe_add): Dedup using marked decls.
901 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
902 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
904 Stat hack representation
905 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
906 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
908 (find_namespace_binding): Replace with ...
909 (find_namespace_slot): ... this.
910 (find_namespace_value): New.
911 (name_lookup::search_namespace_only,
912 name_lookup::adl_namespace_only): Adjust.
913 (update_binding): Add SLOT parameter, adjust.
914 (check_local_shadow): Use find_namespace_value.
915 (set_local_extern_decl_linkage): Likewise.
916 (do_pushdecl): Adjust for namespace slot.
917 (push_local_binding): Assert not a namespace binding.
918 (check_for_out_of_scope_variable): Use find_namespace_value.
919 (set_identifier_type_value_with_scope): Likewise.
920 (get_namespace_binding): Likewise.
921 (set_namespace_binding): Delete.
922 (set_global_binding): Directly update the binding.
923 (finish_namespace_using_decl): Likewise.
924 (lookup_type_scope_1): Use find_namespace_slot and update.
925 (do_push_nested_namespace): Use find_namespace_value.
928 * pt.c (most_specialized_instantiation): Cope with duplicate
932 * cp-tree.h (build_min_nt_call_vec): Declare.
933 * decl.c (build_offset_ref_call_from_tree): Call it.
934 * parser.c (cp_parser_postfix_expression): Likewise.
935 * pt.c (tsubst_copy_and_build): Likewise.
936 * semantics.c (finish_call_expr): Likewise.
937 * tree.c (build_min_nt_loc): Keep unresolved lookups.
938 (build_min): Likewise.
939 (build_min_non_dep): Likewise.
940 (build_min_non_dep_call_vec): Likewise.
941 (build_min_nt_call_vec): New.
944 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
946 (lookup_keep): Call it.
948 2017-05-26 Nathan Sidwell <nathan@acm.org>
951 * name-lookup.c (push_inline_namespaces): New.
952 (push_namespace): Look inside inline namespaces.
954 Inline and using namespace representation change.
955 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
957 (DECL_NAMESPACE_USING): Adjust.
958 (DECL_NAMESPACE_INLINEES): New.
959 * name-lookup.h (struct cp_binding_level): Change usings
961 * name-lookup.c (name_lookup::do_queue_usings,
962 name_lookup::queue_usings): Adjust.
963 (name_lookup::search_namespace, name_lookup::search_usings,
964 name_lookup::queue_namespace): Adjust.
965 (name_lookup::adl_namespace_only): Adjust.
966 (add_using_namespace, push_namespace): Push onto vector.
967 (pop_namespace): Add timing logic.
969 * call.c (build_operator_new_call): Do namelookup and ADL here.
970 (build_new_op_1): Likewise.
971 * name-lookup.h (lookup_function_nonclass): Delete declaration.
972 (do_using_directive): Likewise.
973 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
975 (struct scope_binding): Delete.
976 (EMPTY_SCOPE_BINDING): Delete.
977 (set_decl_namespace): Use OVL_P.
978 (finish_local_using_decl): Lose unnecesary checks.
979 (lookup_function_nonclass): Delete.
980 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
982 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
983 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
985 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
986 (lkp_iterator): Add outer field. Adjust ctor.
987 (lkp_iterator::operator++): New.
988 (lookup_mark, lookup_maybe_add): Declare.
989 * name-lookup.c (name_lookup): Delete fn_set member.
990 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
992 (name_lookup::add_value): Use lookup_add directly.
993 (name_lookup::add_fns: Use lookup_maybe_add.
994 (name_lookup::search_adl): Mark and unmark fns.
996 * pt.c (check_explicit_specialization): Use lookup_add directly.
997 * ptree.c (cxx_print_xnode): Show complete overload structure.
998 * tree.c (lookup_mark, lookup_maybe_add): New.
1000 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
1002 2017-05-26 Jakub Jelinek <jakub@redhat.com>
1004 * cp-tree.h (struct lang_decl_decomp): New type.
1005 (struct lang_decl): Add u.decomp.
1006 (LANG_DECL_DECOMP_CHECK): Define.
1007 (DECL_DECOMPOSITION_P): Note it is set also on the vars
1008 for user identifiers.
1009 (DECL_DECOMP_BASE): Define.
1010 (retrofit_lang_decl): Add extra int = 0 argument.
1011 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
1012 use it to influence the selector choices and for selector
1013 0 to non-zero transition copy old content.
1014 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
1015 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
1016 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
1017 wording if decl is a structured binding.
1018 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
1019 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
1020 of individual variables for tuple structured bindings.
1021 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
1022 Clear DECL_DECOMP_BASE.
1023 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
1024 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
1026 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
1029 2017-05-25 Jason Merrill <jason@redhat.com>
1031 PR c++/80605 - __is_standard_layout and zero-length array
1032 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
1034 2017-05-25 Nathan Sidwell <nathan@acm.org>
1036 Kill OVL_CURRENT, OVL_NEXT.
1037 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
1038 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
1039 (consider_binding_level): Use OVL_FIRST.
1040 (cp_emit_debug_info_for_using): Use lkp_iterator.
1041 * pt.c (check_explicit_specialization): Use ovl_iterator.
1043 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
1044 * cp-tree.h (lang_decl_ns): Remove ns_users field.
1045 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
1046 (TREE_INDIRECT_USING): Delete.
1047 * name-lookup.h (is_associated_namespace): Delete.
1048 * name-lookup.c (name_lookup::search_usings,
1049 name_lookup::do_queue_usings): Usings are always direct.
1050 (is_associated_namespace): Delete.
1051 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
1052 (namespace_ancestor_1, namespace_ancestor): Delete.
1053 (push_using_directive_1, push_using_directive): Delete.
1054 (add_using_namespace_1): Delete.
1055 (add_using_namespace): Reimplement.
1056 (emit_debug_info_using_namespace): New.
1057 (finish_namespace_using_directive, finish_local_using_directive,
1058 push_namespace): Adjust.
1059 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
1061 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
1063 * semantics.c (finish_handler_parms): Warn about non-reference type
1066 2017-05-25 Nathan Sidwell <nathan@acm.org>
1068 Reimplement unqualified namespace lookup.
1069 * name-lookup.c (name_lookup::using_pair,
1070 name_lookup::using_queue): New typedefs.
1071 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
1072 name_lookup::queue_usings): New.
1073 (name_lookup::search_unqualified): New.
1074 (merge_functions, same_entity_p, ambiguous_decl,
1075 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
1076 lookup_using_namespace): Delete.
1077 (lookup_name_real_1): Adjust.
1079 Reimplement qualified namespace lookup.
1080 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
1081 (name_lookup::ambiguous, name_lookup::add_value,
1082 name_lookup::add_type, name_lookup::process_binding): New.
1083 (name_lookup::search_namespace_only,
1084 name_lookup::search_namespace, name_lookup::search_usings): New.
1085 (name_lookup::search_qualified): New.
1086 (do_nonmember_using_decl, suggest_alternatives_for,
1087 lookup_qualified_name): Adjust.
1088 (tree_vec_contains): Delete.
1089 (qualified_lookup_using_namespace): Rename to ...
1090 (qualified_namespace_lookup): ... here. Reimplement.
1093 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
1094 * name-lookup.h (lookup_arg_dependent): Return plain tree.
1095 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
1096 arg_assoc_args_vec, arg_assoc_type, add_function,
1097 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
1098 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
1099 lookup_arg_dependent_1): Delete.
1100 (name_lookup): New lookup object.
1101 (name_lookup::preserve_state, name_lookup::restore_state,
1102 name_lookup::mark_seen, name_lookup::find_and_mark,
1103 name_lookup::add_fns, name_lookup::adl_namespace_only,
1104 name_lookup::adl_namespace, name_lookup::adl_class_only,
1105 name_lookup::adl_bases, name_lookup::adl_class,
1106 name_lookup::adl_expr, name_lookup::adl_type,
1107 name_lookup::adl_template_arg, name_lookup::search_adl): New.
1108 (lookup_arg_dependent): Return a plain tree. Adjust.
1109 (is_associated_namespace): Move later.
1111 2017-05-24 Nathan Sidwell <nathan@acm.org>
1113 * friend.c (do_friend): Remove check for existing decl.
1114 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
1115 * name-lookup.c (push_local_binding): Directly look for binding.
1116 (lookup_name_innermost_nonclass_level_1): Delete.
1117 (lookup_name_innermost_nonclass_level): Delete.
1119 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
1121 * cp-tree.h (cp_free_lang_data): Add extern.
1122 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
1124 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
1125 * typeck.c (type_unknown_p): Delete.
1126 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
1127 overload management.
1128 (dependent_name): Likewise.
1129 (decl_anon_ns_mem_p): Simplify.
1131 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
1134 * tree.c (reshape_init): Use unqualified type for direct enum init.
1135 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
1136 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
1137 non-class destination types.
1138 (build_const_cast_1): Strip cv-quals from destination types.
1139 (build_static_cast, build_reinterpret_cast, build_const_cast)
1140 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
1142 2017-05-24 Martin Sebor <msebor@redhat.com>
1145 * call.c (fully_fold_internal): Adjust.
1147 2017-05-24 Nathan Sidwell <nathan@acm.org>
1149 * cp-tree.h (ovl_skip_hidden): Declare.
1150 * tree.c (ovl_skip_hidden): New.
1151 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
1152 (lookup_arg_dependent_1): Likewise.
1153 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
1154 (hidden_name_p, remove_hidden_names): Delete.
1155 (lookup_name_real_1): Do not strip hidden names.
1156 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
1158 * cp-tree.h (OVL_HIDDEN_P): New.
1159 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
1160 (ovl_iterator::reveal_node): Declare.
1161 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
1162 (ovl_insert): Order on hiddenness.
1163 (ovl_iterator::reveal_node): New.
1164 * name-lookup.c (anticipated_builtin_p): New.
1165 (supplement_binding_1): Use it.
1166 (set_local_extern_decl_linkage): Use hidden_p.
1167 (do_pushdecl): Deal with unhiding a hidden decl, use
1168 anticipated_builtin_p.
1169 (do_nonmember_using_decl): Use anticipated_decl_p.
1170 (lookup_name_real_1): Use DECL_HIDDEN_P.
1172 2017-05-23 Jason Merrill <jason@redhat.com>
1174 -Wunused and C++17 structured bindings
1175 * decl.c (poplevel): Don't warn about unused structured bindings,
1176 only real variables.
1177 * error.c (dump_simple_decl): Handle structured bindings.
1178 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
1180 2017-05-23 Nathan Sidwell <nathan@acm.org>
1182 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
1183 * name-lookup.c (create_local_binding): New.
1184 (update_binding): New.
1185 (pushdecl_maybe_friend_1): Rename to ...
1186 (do_pushdecl): ... this. Reimplement.
1188 (push_overloaded_decl_1, push_overloaded_decl): Delete.
1190 2017-05-23 Jason Merrill <jason@redhat.com>
1192 PR c++/80396 - built-in for make_integer_sequence.
1193 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
1194 (expand_integer_pack, expand_builtin_pack_call): New.
1195 (find_parameter_packs_r): Check builtin_pack_call_p.
1196 (check_for_bare_parameter_packs): Handle it.
1197 (tsubst_pack_expansion): Call expand_builtin_pack_call.
1198 (declare_integer_pack): New.
1199 (init_template_processing): Call it.
1200 * decl2.c (mark_used): Check builtin_pack_fn_p.
1202 2017-05-23 Nathan Sidwell <nathan@acm.org>
1204 * name-lookup.c (find_namespace_binding): New.
1205 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
1206 (set_identifier_type_value_with_scope): Use find_namespace_binding.
1207 (find_binding, cp_binding_level_find_binding_for_name,
1208 binding_for_name, namespace_binding_1): Delete.
1209 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
1210 (get_namespace_binding, set_namespace_binding,
1211 finish_namespace_using_decl, unqualified_namespace_lookup_1,
1212 qualified_lookup_using_namespace, lookup_type_scope_1,
1213 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
1216 * parser.c (cp_parser_template_id): Keep the lookup when stashing
1219 * cp-tree.h (DECL_HIDDEN_P): New.
1220 * name-lookup.c (set_decl_context,
1221 set_local_extern_decl_linkage): New, broken out of ...
1222 (pushdecl_maybe_friend_1): ... here. Call them.
1224 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
1226 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
1227 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
1230 2017-05-23 Nathan Sidwell <nathan@acm.org>
1232 * cp-tree.h (OVL_P): New.
1233 * name-lookup.h (push_local_binding): Delete.
1234 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
1235 (finish_namespace_using_decl, finish_local_using_decl): ... here
1236 * name-lookup.c (add_decl_to_level): Swap args.
1237 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
1238 (diagnose_name_conflict): Check contexts are same for redecl.
1239 (update_local_overload): New.
1240 (compparms_for_decl_and_using): Rename to ...
1241 (matching_fn_p): ... here.
1242 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
1243 push_local_bindings call.
1244 (push_local_binding): Make static, replace FLAGS arg with
1246 (validate_nonmember_using_decl): Use OVL_FIRST.
1247 (do_nonmember_using_decl): Use in/out parameters. Use
1248 lkp_iterator and simplify.
1249 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
1250 (finish_namespace_using_decl, finish_local_using_decl): ... here.
1252 (lookup_type_current_level): Delete.
1253 * parser.c (cp_parser_using_declaration): Adjust.
1254 * pt.c (tsubst_expr): Adjust.
1256 2017-05-22 Nathan Sidwell <nathan@acm.org>
1258 * name-lookup.h (parse_using_directive): Replace with ...
1259 (finish_namespace_using_directive): ... this and ...
1260 (finish_local_using_directive): ... this.
1261 * name-lookup.c (add_using_namespace_1): Move later.
1262 (add_using_namespace): Move later, add namespace_p arg, remove
1264 (push_using_directive_1): Directly recurse.
1265 (do_using_directive, parse_using_directive): Delete, split into ...
1266 (finish_namespace_using_directive): ... this and ...
1267 (finish_local_using_directive): ... this.
1268 (push_namespace): Use add_using_namespace.
1269 * parser.c (cp_parser_using_directive): Call
1270 finish_namespace_using_directive or finish_local_using_directive.
1271 * pt.c (tsubst_expr): Call finish_local_using_directive.
1273 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
1274 * cp-tree.h (raw_dump_id): Declare.
1275 * decl2.c (raw_dump_id): Define.
1276 (dump_tu): Use raw_dump_id.
1278 * config-lang.in (gtfiles): Sort list, break lines.
1280 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
1281 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
1282 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
1283 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
1284 CPTI_RETHROW_FN): New.
1285 (noexcept_deferred_spec): New.
1286 (terminate_node, call_unexpected_node): Rename to ...
1287 (terminate_fn, call_unexpected_fn): ... here.
1288 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
1289 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
1290 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
1291 (init_exception_processing): Adjust.
1292 (declare_library_fn): Create and push the fns here.
1293 (do_get_exception_ptr, do_begin_catch, do_end_catch,
1294 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
1295 declare_library_fn use.
1296 (unevaluated_noexcept_spec): Adjust.
1297 * cp-gimplify.c (genericize_eh_spec_block,
1298 gimplify_most_not_throw_expr): Adjust.
1300 * name-lookup.c (pushdecl_top_level,
1301 pushdecl_top_level_and_finish): Move after namespace pushing and
1303 (push_to_top_level): Rename to ...
1304 (do_push_to_top_level): ... here. Remove timing code.
1305 (pop_from_top_level_1): Rename to ...
1306 (do_pop_from_top_level): ... here.
1307 (do_push_nested_namespace, do_pop_nested_namespace)
1308 (push_to_top_level): New wrapper for do_push_to_top_level.
1309 (pop_from_top_level): Adjust.
1310 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
1312 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
1314 * config-lang.in (gtfiles): Add c-family/c-format.c,
1315 except.c, init.c, lambda.c and friend.c.
1316 * class.c (dvirt_fn): Move out of function scope,
1318 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
1319 * init.c (fn): Likewise.
1320 * lambda.c (ptr_id, max_id): Likewise.
1321 * friend.c (global_friend): Add GTY attribute.
1323 2017-05-19 Nathan Sidwell <nathan@acm.org>
1325 * call.c (add_list_candidates): Use OVL_FIRST.
1326 (build_new_method_call_1): Likewise.
1327 * cp-tree.h (OVL_SINGLE_P): New.
1328 (TYPE_HIDDEN_P): New.
1329 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
1330 * dump.c (cp_tump_tree): Adjust overload dumping.
1331 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
1333 * method.c (lazily_declare_fn): Assert we added it.
1334 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
1336 (cp_parser_template_name): Use lkp_iterator.
1337 * pt.c (begin_template_parm_list): Fixup comment.
1338 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
1339 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
1340 (ovl_scope): Use lkp_iterator.
1342 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
1344 * parser.c (cp_parser_omp_clause_default): Handle
1345 "OMP_CLAUSE_DEFAULT_PRESENT".
1347 * parser.c (cp_parser_omp_clause_default): Avoid printing more
1348 than one syntax error message.
1350 2017-05-19 Nathan Sidwell <nathan@acm.org>
1352 * class.c (class_dump_id): Define.
1353 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
1354 * cp-objcp-common.c (cp_register_dumps): New.
1355 * cp-objcp-common.h (cp_register_dumps): Declare.
1356 (LANG_HOOKS_REGISTER_DUMPS): Override.
1357 * cp-tree.h (class_dump_id): Declare.
1359 2017-05-18 Nathan Sidwell <nathan@acm.org>
1361 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
1363 (lookup_keep): Declare.
1364 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
1365 * pt.c (tsubst_copy): Assert lookup is persistent.
1366 * semantics.c (finish_call_expr): Use lkp_iterator, call
1368 * tree.c (ovl_copy): New.
1369 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
1372 * cp-tree.h (OVL_USED): Replace with ...
1373 (OVL_USING_P): ... this.
1374 (ovl_iterator::using_p): Adjust.
1375 * name-lookup.c (push_overloaded_decl_1,
1376 do_nonmember_using_decl): Adjust.
1377 * search.c (lookup_field_r): Adjust.
1378 * tree.c (ovl_insert, ovl_scope): Adjust.
1380 * cp-tree.h (lookup_add): Swap args.
1381 (ovl_cons, build_overload): Delete.
1382 * name-lookup.c (add_function, push_overloaded_decl_1,
1383 do_nonmember_using_decl, merge_functions, remove_hidden_names):
1384 Use lookup_add, ovl_insert.
1385 * pt.c (check_explicit_specialization): Use lookup_add.
1386 (do_class_deduction): Likewise. Refactor if.
1387 * tree.c (lookup_add): Swap args.
1388 (ovl_cons, build_overload): Delete.
1390 * name-lookup.c (find_local_binding): New, broken out of ...
1391 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
1392 (set_namespace_binding): Swap scope & name args.
1393 (namespace_binding_1): Likewise.
1394 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
1395 (push_overloaded_decl_1): Likewise.
1396 (set_global_binding): Likewise.
1397 (get_namespace_binding): Adjust namespace_binding_1 call.
1399 2017-05-17 Nathan Sidwell <nathan@acm.org>
1401 * cp-tree.h (default_hash_traits <lang_identifier *>): New
1403 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
1404 (extern_c_fns): New hash table.
1405 (check_extern_c_conflict): New, broken out of ...
1406 (pushdecl_maybe_friend_1): ... here. Call it.
1407 (c_linkage_bindings): Just look in hash table.
1409 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
1413 Implement new C++ intrinsics __is_assignable and __is_constructible.
1414 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
1416 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1417 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
1418 * method.c (constructible_expr): Set cp_unevaluated.
1419 (is_xible_helper): New.
1420 (is_trivially_xible): Adjust.
1422 * parser.c (cp_parser_primary_expression): Handle
1423 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
1424 (cp_parser_trait_expr): Likewise.
1425 * semantics.c (trait_expr_value): Handle
1426 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
1428 2017-05-17 Nathan Sidwell <nathan@acm.org>
1430 * cp-tree.h (ovl_iterator::using_p): New predicate.
1431 (ovl_iterator::remove_node): New worker.
1432 (ovl_insert): Declare.
1433 * tree.c (ovl_insert): New.
1434 (ovl_iterator::remove_node): New.
1435 * class.c (add_method): Use ovl_iterator, ovl_insert.
1436 (clone_function_decl): Fix description.
1437 (clone_constructors_and_destructors): Use ovl_iterator.
1439 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
1440 (maybe_warn_about_overly_private_class): Use ovl_iterator.
1441 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
1442 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
1443 (get_base_fndecls): Use ovl_iterator.
1444 (warn_hidden): Use OVL_NAME, ovl_iterator.
1445 (add_implicitly_declared_members): Use ovl_iterator.
1446 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
1448 (finish_shorthand_constraint): Simplify, use ovl_make.
1449 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
1450 * search.c (shared_member_p): Use ovl_iterator.
1451 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
1452 (lookup_conversion_operator): Use OVL_FIRST.
1453 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
1454 (look_for_overrides_here): Use ovl_iterator.
1455 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
1456 * typeck.c (build_x_unary_op): Use ovl_make.
1458 2017-05-17 Martin Liska <mliska@suse.cz>
1460 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
1461 use it instead of int type.
1462 (dump_vtable): Likewise.
1463 (dump_vtt): Likewise.
1464 * decl2.c (dump_tu): Likewise.
1466 2017-05-16 David Malcolm <dmalcolm@redhat.com>
1468 * call.c (enforce_access): Add access_failure_info * param and use
1469 it to record access failures.
1470 * cp-tree.h (class access_failure_info): New class.
1471 (enforce_access): Add access_failure_info * param, defaulting to
1473 (lookup_member): Likewise.
1474 (locate_field_accessor): New function decl.
1475 (perform_or_defer_access_check): Add access_failure_info * param,
1477 * search.c (lookup_member): Add access_failure_info * param and
1478 pass it on to call to perform_or_defer_access_check.
1479 (matches_code_and_type_p): New function.
1480 (field_access_p): New function.
1481 (direct_accessor_p): New function.
1482 (reference_accessor_p): New function.
1483 (field_accessor_p): New function.
1484 (struct locate_field_data): New struct.
1485 (dfs_locate_field_accessor_pre): New function.
1486 (locate_field_accessor): New function.
1487 * semantics.c (perform_or_defer_access_check): Add
1488 access_failure_info * param, and pass it on to call to
1490 * typeck.c (access_failure_info::record_access_failure): New method.
1491 (access_failure_info::maybe_suggest_accessor): New method.
1492 (finish_class_member_access_expr): Pass an access_failure_info
1493 instance to the lookup_member call, and call its
1494 maybe_suggest_accessor method afterwards.
1496 2017-05-16 Marek Polacek <polacek@redhat.com>
1500 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
1502 2017-05-16 Nathan Sidwell <nathan@acm.org>
1504 * name-lookup.c (check_local_shadow): New, broke out of ...
1505 (pushdecl_maybe_friend_1): ... here. Call it.
1507 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
1508 (ovl_first): Move inline definition to end of file.
1509 (ovl_make, lookup_add): Declare.
1510 (get_fns, get_first_fn): Make pure.
1511 * tree.c (ovl_cache): New.
1512 (ovl_make, lookup_add): New.
1513 * pt.c (do_class_deduction): Don't add candidates that will be
1516 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
1517 (print_error_for_call_failure): Use OVL_NAME.
1518 (build_op_call_1): Use ovl_iterator.
1519 (add_candidates): Use OVL_FIRST & lkp_iterator.
1520 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
1522 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
1523 (type_has_user_nondefault_constructor,
1524 in_class_defaulted_default_constructor,
1525 type_has_user_provided_constructor,
1526 type_has_user_provided_or_explicit_constructor,
1527 type_has_non_user_provided_default_constructor,
1528 vbase_has_user_provided_move_assign,
1529 type_has_move_constructor, type_has_move_assign,
1530 type_has_user_declared_move_constructor,
1531 type_has_user_declared_move_assign,
1532 type_build_ctor_call, type_build_dtor_call,
1533 type_requires_array_cookie, explain_non_literal_class): Likewise.
1534 (finish_struct): Use lkp_iterator.
1535 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
1536 (note_name_declared_in_class): Use OVL_NAME.
1537 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
1538 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
1539 cxx_pretty_printer::expression): Likewise.
1540 * decl2.c (check_classfn): Use ovl_iterator.
1541 * pt.c (retrieve_specialization): Use ovl_iterator.
1542 * tree.c (cp_tree_equal): Use lkp_iterator.
1543 (type_has_nontrivial_copy_init): Use ovl_iterator.
1545 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
1546 check is_overloaded_fn.
1548 2017-05-16 Martin Liska <mliska@suse.cz>
1550 * parser.c (cp_lexer_print_token): Add default value for flags
1551 argument of print_gimple_stmt, print_gimple_expr,
1552 print_generic_stmt and print_generic_expr.
1554 2017-05-16 Nathan Sidwell <nathan@acm.org>
1556 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
1558 (MAYBE_BASELINK_FUNCTIONS): New.
1559 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
1560 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
1561 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
1562 * method.c (inherited_ctor_binfo): Use ovl_iterator.
1563 (binfo_inherited_from): Likewise.
1564 * parser.c (lookup_literal_operator): Use lkp_iterator.
1565 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
1566 (print_candidates_1): Likewise.
1567 (determine_specialization): Likewise.
1568 (resolve_overloaded_unification): Likewise.
1569 (resolve_nondeduced_context): Likewise.
1570 (type_dependent_expression_p): Likewise.
1571 (dependent_template_p): Likewise.
1572 * ptree.c (cxx_print_xnode): Likewise.
1573 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
1574 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
1575 * typeck.c (check_template_keyword): Use lkp_iterator.
1577 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
1579 * constexpr.c (function_concept_check): Use OVL_FIRST.
1580 * cvt.c (build_expr_type_conversion): Likewise.
1581 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
1582 * decl2.c (mark_used): Use OVL_FIRST.
1583 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
1584 (dump_expr, location_of): Use OVL_FIRST.
1585 * friend.c (do_friend): Use OVL_NAME.
1586 * init.c (build_offset_ref): Use OVL_FIRST.
1587 * mangle.c (write_member_name): Likewise.
1588 (write_expression): Use OVL_NAME.
1589 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
1590 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
1591 * pt.c (check_explicit_specialization): Use OVL_FIRST.
1592 (check_template_shadow): Likewise.
1593 (tsubst_template_args): Use OVL_NAME.
1594 (tsubst_baselink): Use OVL_FIRST.
1595 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
1596 * tree.c (get_first_fn): Use OVL_FIRST.
1597 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
1598 (cp_build_addr_expr_1): Use OVL_FIRST.
1600 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
1602 * semantics.c (finish_id_expression): Directly init local var.
1603 (finish_omp_reduction_clause): Use really_overloaded_fn.
1604 * tree.c (get_fns): Document. Assert we got an overload.
1605 (get_first_fn) Document.
1606 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
1607 really_overloaded_fn.
1608 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
1610 * cp-tree.h (SCOPE_DEPTH): New.
1611 * name-lookup.h (is_nested_namespace): Declare.
1612 * name-lookup.c (is_nested_namespace): New.
1613 (is_ancestor): Use it.
1614 (set_decl_namespace): Likewise.
1615 (push_namespace): Set SCOPE_DEPTH.
1616 * pt.c (check_specialization_namespace): Use is_nested_namespace.
1617 (check_unqualigied_spec_or_inst): Likewise.
1619 2017-05-15 Nathan Sidwell <nathan@acm.org>
1622 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
1623 * name-lookup.h (push_namespace): Return int, add make_inline arg.
1624 * name-lookup.c (push_namespace): Deal with inline directly.
1625 Return pushed count.
1626 * parser.c (cp_parser_namespace_definition): Adjust for
1627 push_namespace change.
1629 2017-05-11 Nathan Sidwell <nathan@acm.org>
1631 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
1632 LANG_HOOKS_PUSHDECL): Move to ...
1633 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
1634 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
1635 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
1637 * name-lookup.h (pushdecl): Add default friend parm.
1638 (pushdecl_maybe_friend): Delete.
1639 (pushdecl_top_level): Add default friend parm.
1640 (pushdecl_top_level_maybe_friend): Delete.
1641 * name-lookup.c (pushdecl_maybe_friend): Delete.
1642 (pushdecl): Add is_friend parm.
1643 (pushdecl_top_level): Add is friend_parm.
1644 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
1645 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
1646 * friend.c (do_friend): Adjust.
1647 * pt.c (tsubst_friend_class): Adjust.
1649 Revert pushdecl_top_level_and_finish name change.
1650 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
1651 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
1652 * decl.c (cp_make_fname_decl): Adjust.
1653 * decl2.c (get_guard, handle_tls_init): Adjust.
1654 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
1656 * name-lookup.c (pushdecl_outermost_localscope): Always
1657 conditionally stop timer.
1659 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
1660 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
1662 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
1663 pushtag_top_level_maybe_friend,
1664 pushdecl_top_level_and_finish): Move declarations to ...
1665 * name-lookup.h: ... here. Group pushdecl variants.
1666 (pushdecl_top_level_and_finish): Rename to ...
1667 (pushdecl_top_level_with_init): ... here.
1668 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
1669 * decl2.c (get_guard, handle_tls_init): Likewise.
1670 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
1671 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
1672 * method.c (implicitly_declare_fn): Likewise.
1673 * searchc (node_debug_info_needed): Likewise.
1674 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
1675 (pushdecl_top_level_with_init): ... here.
1676 (pop_everything): Use namespace_bindings_p.
1678 * name-lookup.h (pop_binding): Rename to pop_local_binding.
1679 (getdecls): Rename to get_local_decls.
1680 * name-lookup.c (pop_binding): Rename to ...
1681 (pop_local_binding): ... here.
1682 (pop_bindings_and_leave_scope): Adjust.
1683 (getdecls): Rename to ...
1684 (get_local_decls): ... here. Assert local scope.
1685 * decl.c (poplevel): Assert not namespace. Adjust and simplify
1687 (store_parm_decls): Adjust get_local_decls call.
1688 (parser.c (synthesize_implicit_template_parm): Likewise.
1690 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
1693 * method.c (is_trivially_xible): Reject void types.
1695 2017-05-10 Nathan Sidwell <nathan@acm.org>
1697 * class.c (handle_using_decl): Always use OVL_CURRENT.
1698 (resolve_address_of_overloaded_function): Move iterator decl into
1699 for scope. Don't strip anticipated decls here.
1701 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
1703 (print_candidates): Adjust.
1705 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
1707 * call.c (build_new_function_call): Lose koenig_p arg. Remove
1708 koenig_p handling here.
1709 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
1710 (tsubst_omp_clauses): Likewise.
1711 (do_class_deduction): Adjust buld_new_function_call calls.
1712 * semantics.c (finish_call_expr): Likewise.
1714 2017-05-10 Jason Merrill <jason@redhat.com>
1716 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
1717 (unify_type_mismatch, unify_parameter_pack_mismatch)
1718 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
1719 (unify_parameter_pack_inconsistent, unify_inconsistency)
1720 (unify_vla_arg, unify_method_type_error, unify_arity)
1721 (unify_arg_conversion, unify_no_common_base)
1722 (unify_inconsistent_template_template_parameters)
1723 (unify_template_deduction_failure)
1724 (unify_template_argument_mismatch)
1725 (unify_overload_resolution_failure): Call unify_invalid.
1727 CWG 1847 - Clarifying compatibility during partial ordering
1728 * pt.c (more_specialized_fn): No order between two non-deducible
1731 * pt.c (dependent_type_p): Make sure we aren't called with
1734 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1735 * pt.c (convert_template_argument): Just return an argument pack.
1736 (coerce_template_parameter_pack, template_parm_to_arg)
1737 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
1738 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
1739 Don't set the type of a NONTYPE_ARGUMENT_PACK.
1740 * parser.c (make_char_string_pack, make_string_pack): Likewise.
1742 2017-05-10 Nathan Sidwell <nathan@acm.org>
1744 * cp-tree.h (add_method, clone_function_decl): Change last arg to
1746 * class.c (add_method): Change third arg to bool. Adjust.
1747 (one_inheriting_sig, one_inherited_ctor): Adjust.
1748 (clone_function_decl): Change 2nd arg to bool. Adjust.
1749 (clone_constructors_and_destructors): Adjust.
1750 * lambda.c (maybe_add_lambda_conv_op): Adjust.
1751 * method.c (lazily_declare_fn): Adjust.
1752 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
1753 * semantics.c (finish_member_declaration): Adjust.
1755 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1758 * decl.c (finish_function): To improve error recovery, change the
1759 logic for calling apply_deduced_return_type.
1761 2017-05-09 Jason Merrill <jason@redhat.com>
1763 PR c++/80605 - __is_standard_layout and empty base
1764 * class.c (check_bases): Ignore empty bases.
1766 PR c++/70979 - literal class and closure types
1767 * class.c (finalize_literal_type_property): Handle closures
1769 (explain_non_literal_class): Likewise.
1771 PR c++/66297, DR 1684 - literal class and constexpr member fns
1772 * constexpr.c (is_valid_constexpr_fn): Only complain about
1773 non-literal enclosing class in C++11.
1774 * class.c (finalize_literal_type_property): Likewise.
1776 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
1779 * pt.c (tsubst_decl): Early return error_mark_node if
1780 grok_ctor_properties returns false.
1782 2017-05-09 Jason Merrill <jason@redhat.com>
1784 PR c++/70167 - array prvalue treated as lvalue
1785 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
1787 * semantics.c (finish_compound_literal): Add fcl_context parameter.
1788 Only make a static variable for C99 syntax.
1789 * parser.c (cp_parser_postfix_expression): Pass it.
1790 * pt.c (tsubst_copy_and_build): Likewise.
1791 * call.c (extend_ref_init_temps): Set
1792 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1794 2017-05-09 Nathan Sidwell <nathan@acm.org>
1796 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
1797 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
1798 * name-lookup.h (pushdecl_top_level): Declare.
1800 2017-05-08 Jason Merrill <jason@redhat.com>
1802 PR c++/80178 - parameter passing for uncopyable classes
1803 * tree.c (type_has_nontrivial_copy_init): True for classes with only
1804 deleted copy/move ctors.
1805 (remember_deleted_copy, maybe_warn_parm_abi): New.
1806 * decl.c (require_complete_types_for_parms, check_function_type):
1807 Call maybe_warn_parm_abi.
1808 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
1810 2017-05-08 Nathan Sidwell <nathan@acm.org>
1812 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
1813 (start_preparsed_function): Do decl pushing before setting
1814 current_funciton_decl and announcing it.
1816 * name-lookup.h (pushdecl_with_scope): Replace with ...
1817 (pushdecl_outermost_localscope): ... this.
1818 * name-lookup.c (pushdecl_with_scope): Replace with ...
1819 (pushdecl_outermost_localscope): ... this.
1820 (pushdecl_namespace_level): Adjust.
1821 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
1822 * lambda.c (insert_capture_proxy): Likewise.
1824 * class.c (build_vtbl_initializer): Don't shadow outer variable
1827 Revert _binding -> _value change.
1828 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
1829 (get_namespace_binding, set_global_binding): ... these.
1830 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
1831 (get_namespace_binding, set_global_binding): ... these.
1832 (arg_assoc_namespace, pushdecl_maybe_friend_1,
1833 check_for_out_of_scope_variable, push_overloaded_decl_1,
1834 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
1835 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1836 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
1837 * decl.c (poplevel): Adjust.
1838 * pt.c (make_constrained_auto): Likewise.
1840 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
1842 PR translation/80280
1843 * call.c (print_z_candidate): Fix quoting.
1845 2017-05-05 David Malcolm <dmalcolm@redhat.com>
1847 * error.c (pedwarn_cxx98): Replace report_diagnostic
1848 with diagnostic_report_diagnostic.
1850 2017-05-05 Nathan Sidwell <nathan@acm.org>
1852 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
1853 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
1854 (IDENTIFIER_NAMESPACE_VALUE): Delete.
1855 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
1857 (get_namespace_value, set_global_value): ... these.
1858 (get_global_value_if_present, is_typename_at_global_scope): Delete.
1859 * decl.c (poplevel): Use get_namespace_value.
1860 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
1861 * class.c (build_vtbl_initializer): Stash library decl in
1862 static var. Use IDENTIFIER_GLOBAL_VALUE.
1863 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
1864 do_allocate_exception, do_free_exception, build_throw): Likewise.
1865 * init.c (throw_bad_array_new_length): Likewise.
1866 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
1867 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
1868 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
1869 get_namespace_value.
1870 (set_namespace_binding_1): Rename to
1871 (set_namespace_binding): ... here.
1872 (set_global_value): New.
1873 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
1874 get_namespace_value.
1875 * pt.c (listify): Use get_namespace_value.
1877 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
1879 * lex.c (unqualified_name_lookup_error): Likewise.
1881 * class.c (alter_class): Use retrofit_lang_decl directly.
1882 * decl.c (push_local_name, dupliate_decls): Likewise.
1883 * semantics.c (omp_privatize_field): Likewise.
1885 Kill walk_namespaces.
1886 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
1887 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
1889 Kill per-namespace static_decls.
1890 * cp-tree.h (static_decls): Declare.
1891 (wrapup_globals_for_namespace,
1892 diagnose_inline_vars_for_namespace): Replace with ...
1893 (wrapup_namespace_globals): ... this.
1894 * decl.c (static_decls): Define.
1895 (wrapup_globals_for_namespace,
1896 diagnose_inline_vars_for_namespace): Replace with ...
1897 (wrapup_namespace_globals): ... this.
1898 (cxx_init_decl_processing): Initialize static_decls.
1899 * decl2.c (c_parse_final_cleanups): Adjust.
1900 * name-lookup.h (cp_binding_level): Remove static_decls member.
1901 * name-lookup.c (add_decl_to_level): Adjust.
1902 (begin_scope): Adjust.
1904 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
1907 * decl.c (reshape_init): Unconditionally return error_mark_node
1908 upon error about too many initializers.
1910 2017-05-04 Nathan Sidwell <nathan@acm.org>
1912 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
1914 2017-05-04 Martin Sebor <msebor@redhat.com>
1916 PR translation/80280
1917 * call.c (print_z_candidate): Add missing quoting to %D and other
1919 (build_op_call_1): Same.
1920 * constraint.cc (diagnose_check_constraint): Same.
1921 * mangle.c (mangle_decl): Same.
1922 * name-lookup.c (cp_binding_level_debug): Same.
1923 (set_decl_namespace): Same.
1924 * parser.c (cp_parser_tx_qualifier_opt): Same.
1925 * pt.c (print_candidates_1): Same.
1926 (check_template_variable): Same.
1927 (tsubst_default_argument): Same.
1928 (most_specialized_partial_spec): Same.
1929 * semantics.c (omp_reduction_lookup): Same.
1930 * tree.c (check_abi_tag_redeclaration): Same.
1931 * typeck.c (comptypes): Same.
1932 * typeck2.c (abstract_virtuals_error_sfinae): Same.
1934 2017-05-04 Nathan Sidwell <nathan@acm.org>
1937 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
1938 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
1939 CPTI_INIT_LIST_IDENTIFIER.
1940 (global_namespace, global_type_node, global_identifier,
1941 anon_identifier, init_list_identifier): New.
1942 * decl.c (global_type_node, global_scope_name): Delete.
1943 (initialize_predefined_identifiers): Add new identifiers.
1944 (cxx_init_decl_processing): Adjust.
1945 * name-lookup.h (global_namespace, global_type_node): Delete.
1946 * name-lookup.c (global_namespace, anonymous_namespace_name,
1947 get_anonymous_namespace_name): Delete.
1948 (namespace_scope_ht_size, begin_scope, pushtag_1,
1949 push_namespace): Adjust,
1950 * call.c (type_has_extended_temps): Use init_list_identifier.
1951 * pt.c (listify): Likewise.
1953 * name-lookup.c: Reorder functions to make merging from modules
1956 2017-05-03 Jason Merrill <jason@redhat.com>
1958 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
1960 2017-05-03 Nathan Sidwell <nathan@acm.org>
1962 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
1963 along with #defines, to before name-lookup include.
1965 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
1967 * pt.c (is_auto_or_concept): Remove.
1968 (type_uses_auto_or_concept): Remove, unused.
1969 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
1970 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
1971 * cp-tree.h (is_auto_or_concept): Remove.
1973 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
1976 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
1977 add pedigree operation and detach call here.
1978 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
1979 cilk_cp_gimplify_call_params_in_spawned_fn.
1980 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
1981 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
1983 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
1985 * parser.c (cp_parser_member_declaration): Add fix-it hints for
1986 stray comma and missing semicolon at end of member declaration.
1988 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
1990 * parser.c (cp_parser_cast_expression): Add target type of cast to
1992 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
1994 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1996 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
1997 return type to bool.
1998 * cp-tree.h (grok_ctor_properties): Update.
2000 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
2002 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
2003 information to diagnostic of invalid colon in nested-name-specifier.
2005 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
2007 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
2008 diagnostic of invalid class/struct keyword after enum.
2010 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2012 * parser.c (cp_parser_member_declaration): Add fix-it hint
2013 for removing stray semicolons.
2015 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2017 * name-lookup.c (get_std_name_hint): New function.
2018 (maybe_suggest_missing_header): New function.
2019 (suggest_alternative_in_explicit_scope): Call
2020 maybe_suggest_missing_header.
2022 2017-04-25 David Malcolm <dmalcolm@redhat.com>
2025 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
2026 candidate type of bm from tree to const char *.
2027 (consider_binding_level): Likewise.
2028 (lookup_name_fuzzy): Likewise, using this to merge the best
2029 result from the preprocessor into bm, rather than immediately
2030 returning, so that better matches from reserved words can "win".
2031 Guard the rejection of keywords that don't start decl-specifiers
2032 so it only happens for FUZZY_LOOKUP_TYPENAME.
2034 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
2036 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
2037 (start_enum): Likewise.
2038 (build_enumerator): Likewise. Use %qE instead of plain %E.
2039 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
2040 %<%D%> in diagnostics.
2041 (cp_parser_elaborated_type_specifier): Likewise.
2042 * pt.c (make_pack_expansion): Use %qT and %qE instead of
2043 %<%T%> and %<%E%> in diagnostics.
2044 (tsubst_pack_expansion): Likewise.
2046 2017-04-24 David Malcolm <dmalcolm@redhat.com>
2049 * parser.c (cp_parser_unary_expression): Generate a location
2050 range for alignof and sizeof expressions.
2052 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
2054 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
2056 (cp_parser_virt_specifier_seq_opt): Likewise.
2057 (set_and_check_decl_spec_loc): Likewise twice.
2059 2017-04-21 Jason Merrill <jason@redhat.com>
2061 PR c++/80179 - ICE with initialized flexible array member.
2062 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
2064 2017-04-21 Richard Biener <rguenther@suse.de>
2066 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
2067 (copy_type): Likewise.
2068 * lex.c (copy_decl): Pass down mem-stat info.
2069 (copy_type): Likewise.
2071 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
2074 * init.c (build_new_1): Suppress notes about over-aligned new when
2075 the warning is suppressed.
2077 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
2079 * parser.c (cp_parser_member_declaration): Add warning with fixit
2080 information for extra semicolon after in-class function definition.
2082 2017-04-20 Jakub Jelinek <jakub@redhat.com>
2085 * tree.c (build_cplus_array_type): Call build_array_type
2086 with the intended TYPE_TYPELESS_STORAGE flag value, instead
2087 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
2090 2017-04-18 Marek Polacek <polacek@redhat.com>
2092 PR c++/80244 - ICE with attribute in template alias.
2093 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
2095 PR c++/80241 - ICE with alignas pack expansion.
2096 * error.c (dump_expr): Handle TREE_LIST.
2097 * parser.c (cp_parser_std_attribute_list): Return error_mark if
2098 make_pack_expansion returns an error.
2100 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
2103 * class.c (fixup_may_alias): Fix all type variants.
2105 2017-04-17 Jason Merrill <jason@redhat.com>
2107 PR c++/80415 - wrong error with default arg and array reference.
2108 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
2110 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
2112 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
2114 * decl.c (name_unnamed_type): Split out of...
2115 (grokdeclarator): ... this.
2116 * decl.h (name_unnamed_type): Declare.
2118 2017-04-12 Richard Biener <rguenther@suse.de>
2119 Bernd Edlinger <bernd.edlinger@hotmail.de>
2122 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
2123 for arrays of character or std::byte type.
2125 2017-04-11 Jason Merrill <jason@redhat.com>
2127 PR c++/80294 - ICE with constexpr and inheritance.
2128 * constexpr.c (reduced_constant_expression_p):
2129 A null constructor element is non-constant.
2130 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
2131 returning an empty base.
2133 2017-04-11 Jakub Jelinek <jakub@redhat.com>
2136 * decl.c (cp_finish_decomp): If processing_template_decl on
2137 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
2138 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
2139 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
2141 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
2142 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
2145 2017-04-11 Jakub Jelinek <jakub@redhat.com>
2148 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
2150 2017-04-10 Jakub Jelinek <jakub@redhat.com>
2153 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
2154 operand, if it is a static member function, recurse on the
2157 2017-04-10 Marek Polacek <polacek@redhat.com>
2160 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
2161 ORIG_TYPE earlier and not only when shortening.
2163 2017-04-07 Jason Merrill <jason@redhat.com>
2165 PR c++/80356 - ICE with reference to function template argument.
2167 * pt.c (convert_nontype_argument_function): Adjust type even with a
2168 value-dependent argument.
2170 PR c++/80267 - ICE with nested capture of reference
2172 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
2174 2017-04-07 Marek Polacek <polacek@redhat.com>
2177 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
2180 * call.c (build_over_call): Don't check cxx_dialect.
2181 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
2182 whether SUB is a CONSTRUCTOR.
2183 * init.c (build_new_1): Don't check cxx_dialect.
2184 * tree.c (replace_placeholders): Add a function comment. Return if
2185 not in C++14, or if the object isn't a (member of a) class.
2186 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
2187 TYPE is CLASS_TYPE_P.
2189 2017-04-05 Jakub Jelinek <jakub@redhat.com>
2192 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
2193 of a loop doing vec_safe_push of NULL. Formatting fixes.
2194 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
2195 to newidx before calling canonical_type_parameter on newtype.
2197 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
2200 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
2201 UNARY_PLUS_EXPR case.
2203 2017-04-03 Jason Merrill <jason@redhat.com>
2205 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
2207 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
2209 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
2210 * decl2.c (one_static_initialization_or_destruction): Likewise.
2211 * name-lookup.c (store_bindings): Likewise.
2212 * parser.c (make_call_declarator): Likewise.
2213 * pt.c (check_explicit_specialization): Likewise.
2215 2017-04-03 Jason Merrill <jason@redhat.com>
2217 PR sanitizer/79993 - ICE with VLA initialization from string
2218 PR c++/69487 - wrong VLA initialization from string
2219 * init.c (finish_length_check): Split out from build_vec_init.
2220 (build_vec_init): Handle STRING_CST.
2221 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
2222 (digest_init_r): Don't give a STRING_CST VLA type.
2224 2017-03-31 Jakub Jelinek <jakub@redhat.com>
2227 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
2228 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
2229 for NOP_EXPR to REFERENCE_TYPE.
2232 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
2233 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
2235 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
2236 Remove extraneous parens.
2237 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
2238 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
2239 (cp_parser_trait_expr): Likewise.
2241 2017-03-27 Jakub Jelinek <jakub@redhat.com>
2244 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
2245 * typeck.c (cxx_mark_addressable): Likewise. Look through
2246 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
2248 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
2250 2017-03-24 Jason Merrill <jason@redhat.com>
2252 PR c++/77339 - ICE with invalid use of alias template.
2253 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
2256 2017-03-24 Marek Polacek <polacek@redhat.com>
2259 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
2260 doesn't have side effects.
2262 2017-03-23 Jason Merrill <jason@redhat.com>
2264 PR c++/80150 - ICE with overloaded variadic deduction.
2265 * pt.c (try_one_overload): Remove asserts.
2267 PR c++/77563 - missing ambiguous conversion error.
2268 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
2270 2017-03-23 Marek Polacek <polacek@redhat.com>
2272 * cp-tree.h: Remove a C_RID_YYCODE reference.
2274 2017-03-22 Jakub Jelinek <jakub@redhat.com>
2277 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
2278 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
2279 processing_template_decl.
2281 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
2284 * name-lookup.c (pushtag_1): Add check for bogus, non template,
2285 std::initializer_list.
2287 2017-03-21 Jakub Jelinek <jakub@redhat.com>
2290 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
2292 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
2295 * init.c (std_placement_new_fn_p): New.
2296 (build_new_1): Call it.
2298 2017-03-20 Jason Merrill <jason@redhat.com>
2300 PR c++/80096 - ICE with C++17 non-type auto.
2301 * pt.c (tsubst): Delay tsubst of type of template non-type
2304 PR c++/79519 - ICE with deleted template friend.
2305 * decl.c (grokdeclarator): Complain about misplaced function
2306 definition using =, as well.
2308 PR c++/79640 - infinite recursion with generic lambda.
2309 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
2310 before substituting its initializer.
2312 2017-03-20 Marek Polacek <polacek@redhat.com>
2313 Paolo Carlini <paolo.carlini@oracle.com>
2315 PR c++/80059 - ICE with noexcept and __transaction_atomic
2316 * except.c (build_must_not_throw_expr): Call
2317 instantiate_non_dependent_expr.
2319 2017-03-19 Jason Merrill <jason@redhat.com>
2321 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
2322 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
2323 reference decomposition.
2325 PR c++/80077 - error with constexpr and -fno-elide-constructors.
2326 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
2327 expanding trivial constructor.
2329 2017-03-17 Jason Merrill <jason@redhat.com>
2331 PR c++/78345 - ICE initializing array from lambda.
2332 * init.c (build_aggr_init): Check array initializer.
2333 (build_vec_init): Check the type of a CONSTRUCTOR.
2335 PR c++/80073 - C++17 ICE with virtual base.
2336 * decl.c (xref_basetypes): Also check for indirect vbases.
2338 2017-03-16 Jason Merrill <jason@redhat.com>
2340 * decl.c (start_enum): std::byte aliases anything.
2343 * constexpr.c (lookup_placeholder): Tweak.
2345 2017-03-15 Jason Merrill <jason@redhat.com>
2347 PR c++/80043 - ICE with -fpermissive
2348 * typeck.c (convert_for_assignment): Handle instantiate_type
2349 not giving an error.
2351 2017-03-14 Nathan Sidwell <nathan@acm.org>
2353 PR c++/79393 DR 1658 workaround
2354 * method.c (synthesized_method_base_walk): Inihibit abstract class
2355 virtual base access check here.
2356 (synthesized_method_walk): Not here.
2358 2017-03-13 Nathan Sidwell <nathan@acm.org>
2360 PR c++/79393 DR 1658 workaround
2361 * method.c (synthesized_method_walk): Check vbases of abstract
2362 classes for dtor walk.
2364 2017-03-10 David Malcolm <dmalcolm@redhat.com>
2366 PR translation/79848
2367 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
2369 2017-03-10 Jason Merrill <jason@redhat.com>
2371 PR c++/79960 - alias templates and partial ordering
2372 * pt.c (comp_template_args): Add partial_order parm.
2373 (template_args_equal): Likewise.
2374 (comp_template_args_porder): New.
2375 (get_partial_spec_bindings): Use it.
2377 2017-03-10 Marek Polacek <polacek@redhat.com>
2380 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
2382 2017-03-10 Jakub Jelinek <jakub@redhat.com>
2385 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
2386 Use XALLOCAVEC macro.
2389 * decl.c (finish_enum_value_list): If value is error_mark_node,
2390 don't copy it and change its type.
2391 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
2392 of CONST_DECL is error_mark_node.
2394 2017-03-09 Marek Polacek <polacek@redhat.com>
2396 PR c++/79900 - ICE in strip_typedefs
2397 * tree.c (strip_typedefs): Skip the attribute handling if T is
2398 a variant type which hasn't been updated yet.
2400 PR c++/79687 - wrong code with pointer-to-member
2401 * init.c (constant_value_1): Break if the variable has a dynamic
2404 2017-03-08 Jason Merrill <jason@redhat.com>
2406 PR c++/79797 - ICE with self-reference in array DMI.
2407 * constexpr.c (lookup_placeholder): Split out...
2408 (cxx_eval_constant_expression): ...from here.
2410 2017-03-07 Jakub Jelinek <jakub@redhat.com>
2413 * parser.c (cp_parser_omp_cancellation_point,
2414 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
2415 cp_parser_omp_target_update): Change "may only be used in compound
2416 statements" diagnostics, such that the same translatable string is
2417 used for all pragmas.
2418 (cp_parser_pragma): Likewise. Use error_at instead of
2419 cp_parser_error for that diagnostics.
2421 2017-03-06 Marek Polacek <polacek@redhat.com>
2423 PR c++/79796 - ICE with NSDMI and this pointer
2424 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
2425 replace_placeholders.
2427 2017-03-06 Jakub Jelinek <jakub@redhat.com>
2430 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
2433 2017-03-06 Jason Merrill <jason@redhat.com>
2435 Revert "Allow deduction guides to look into primary template."
2436 * cp-tree.h, parser.c, pt.c, search.c: Revert.
2438 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
2441 * except.c (build_must_not_throw_expr): Perform the implicit
2442 conversions on the condition.
2444 2017-03-03 Jason Merrill <jason@redhat.com>
2446 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
2449 Core issues 2273 and 2277
2450 * call.c (joust): Adjust using-declaration tiebreaker to handle
2451 the intermediate base case.
2452 * method.c (strip_inheriting_ctors): Just return the argument if
2453 !flag_new_inheriting_ctors.
2455 2017-03-03 Richard Biener <rguenther@suse.de>
2458 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
2460 2017-03-03 Marek Polacek <polacek@redhat.com>
2463 * typeck.c (string_conv_p): In C++11, always call pedwarn with
2466 2017-03-02 Jason Merrill <jason@redhat.com>
2468 Update overload resolution with deduction guides.
2469 * pt.c (do_class_deduction): Always build the copy guide.
2470 (copy_guide_p, template_guide_p): New.
2471 (build_deduction_guide): Remember the original constructor.
2472 * call.c (joust): Prefer the copy guide and non-template guides.
2474 Allow deduction guides to look into primary template.
2475 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
2476 (struct cp_decl_specifier_seq): Add constructor_p.
2477 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
2478 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
2479 Clear deduction_guide_type. Don't handle deduction guide names.
2480 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
2481 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
2482 (cp_parser_member_declaration, cp_parser_cache_defarg)
2483 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
2484 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
2485 (build_deduction_guide): Set deduction_guide_type.
2486 (dependent_scope_p): Check deduction_guide_type.
2487 * search.c (lookup_member): Likewise.
2489 2017-03-02 Jakub Jelinek <jakub@redhat.com>
2492 * init.c (mark_exp_read_r): New function.
2493 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
2494 whole arguments instead of plain mark_exp_read on TREE_LIST values.
2496 2017-03-01 Jason Merrill <jason@redhat.com>
2498 Class template argument deduction in new-expression
2499 * init.c (build_new): Handle deduction from no initializer.
2500 * parser.c (cp_parser_new_expression): Don't require a single
2501 expression for class template deduction.
2502 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
2503 class template placeholder.
2504 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
2505 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
2506 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
2508 2017-03-01 Jakub Jelinek <jakub@redhat.com>
2511 * init.c (emit_mem_initializers): When not constructing vbases of
2512 abstract classes, mark arguments as read for
2513 -Wunused-but-set-parameter.
2515 2017-02-28 Jason Merrill <jason@redhat.com>
2517 Class template argument deduction refinements
2518 * call.c (joust): Move deduction guide tiebreaker down.
2519 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
2520 deduction with no initializer.
2521 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
2522 (do_class_deduction): Use that rather than special case.
2523 (do_auto_deduction): Handle null initializer.
2525 2017-02-28 Jakub Jelinek <jakub@redhat.com>
2527 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
2528 instead of just cond ? "..." : "...".
2529 (grokdeclarator): Likewise.
2530 (build_enumerator): Likewise.
2531 * init.c (build_new_1): Likewise.
2532 * call.c (build_new_method_call_1): Likewise.
2533 * parser.c: Include intl.h.
2534 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
2535 "enter"/"exit" keyword.
2536 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
2539 2017-02-27 Jason Merrill <jason@redhat.com>
2541 PR c++/71568 - SFINAE forming pointer to member function
2542 * init.c (build_offset_ref): Check the return value of
2543 perform_or_defer_access_check.
2545 2017-02-27 Marek Polacek <polacek@redhat.com>
2547 * decl.c (expand_static_init): Add missing } in a comment.
2549 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
2551 * init.c: Include intl.h.
2552 (build_new_1): Move message strings into pedwarn to make them
2553 -Wformat-security friendly. Mark string for translation.
2554 * pt.c (tsubst_copy_and_build): Mark string for translation.
2555 Make the pointer const.
2556 * semantics.c (finish_id_expression): Mark strings for translation.
2558 2017-02-25 Jakub Jelinek <jakub@redhat.com>
2560 * call.c (build_op_delete_call): Make msg1 and msg2 const.
2562 2017-02-24 Jakub Jelinek <jakub@redhat.com>
2565 * call.c (build_over_call): Call check_function_arguments even for
2566 -Wrestrict, adjust check_function_arguments caller.
2567 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
2569 * typeck.c (cp_build_function_call_vec): Adjust
2570 check_function_arguments caller.
2572 2017-02-24 Marek Polacek <polacek@redhat.com>
2574 PR translation/79705
2575 * decl.c (check_redeclaration_exception_specification): Mark a string
2576 for translation. Make the pointer const.
2578 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
2581 * pt.c (register_specialization): Check duplicate_decls return value
2582 for error_mark_node and pass it back.
2584 2017-02-22 Jason Merrill <jason@redhat.com>
2586 PR c++/79679 - missing destructor for argument
2587 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
2590 * pt.c (do_class_deduction): Handle 0 argument case.
2592 2017-02-22 Jakub Jelinek <jakub@redhat.com>
2595 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
2596 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
2597 * constexpr.c (potential_constant_expression_1): Handle
2598 OMP_*, OACC_* and CILK_* trees. Use error_at with
2599 EXPR_LOC_OR_LOC (t, input_location) computed early
2600 instead of error, or error_at with location_of (t).
2602 2017-02-22 Marek Polacek <polacek@redhat.com>
2605 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
2606 if the alignas expression is erroneous.
2607 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
2611 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
2613 2017-02-21 Jason Merrill <jason@redhat.com>
2615 PR c++/50308 - wrong deprecated warning with ADL
2616 PR c++/17729 - duplicate deprecated warning
2617 * semantics.c (finish_id_expression): Only call mark_used on a
2618 function if we aren't building a call.
2620 PR c++/41727 - ICE with partial spec of partial instantiation
2621 * pt.c (process_partial_specialization): For now, don't check more
2622 specialized if there is more than one level of args.
2624 2017-02-21 Marek Polacek <polacek@redhat.com>
2627 * cp-tree.h (maybe_reject_flexarray_init): Declare.
2628 * init.c (maybe_reject_flexarray_init): No longer static.
2629 Add check for current_function_decl.
2630 * parser.c (cp_parser_late_parse_one_default_arg): Reject
2631 a default mem-initializer for a flexible array.
2633 2017-02-21 Jakub Jelinek <jakub@redhat.com>
2634 Paolo Carlini <paolo.carlini@oracle.com>
2637 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
2639 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
2640 decl after the decomposition artificial decl has error_mark_node.
2641 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
2642 instead of just == error_mark_node comparison.
2644 2017-02-21 Jakub Jelinek <jakub@redhat.com>
2647 * decl.c: Include gimplify.h.
2648 (cp_finish_decomp): Make sure there is no sharing of trees
2649 in between DECL_VALUE_EXPR of decomposition decls.
2652 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
2655 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
2656 call cplus_expand_constant on it first.
2658 2017-02-19 Jason Merrill <jason@redhat.com>
2660 PR c++/78139 - destructor needed by new-expression
2661 * call.c (build_special_member_call): Use tf_no_cleanup.
2663 PR c++/78282 - auto template and pack expansion
2664 * pt.c (find_parameter_packs_r): Don't walk into the type of
2665 templates other than template template-parameters.
2667 PR c++/79606 - ICE with this->base_member in NSDMI
2668 * class.c (build_base_path): Check processing_template_decl.
2670 PR c++/79607 - ICE with T{} initializer
2671 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
2673 PR c++/79566 - elaborated-type-specifier in range for
2674 * parser.c (cp_parser_simple_declaration): Fix check for type
2677 PR c++/79400 - confusing suggestion of 'noexcept'
2678 * parser.c (cp_parser_exception_specification_opt): Remove
2679 suggestion for deprecated dynamic exception-specification.
2681 PR c++/79470 - partial ordering with reference parameters
2682 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
2684 PR c++/79500 - ICE with non-template deduction guide
2685 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
2686 DECL_TEMPLATE_RESULT.
2688 PR c++/79580 - ICE with compound literal
2689 * parser.c (cp_parser_class_head): If we're in the middle of an
2690 expression, use ts_within_enclosing_non_class.
2692 PR c++/79503 - inherited ctor taking base class
2693 * call.c (add_function_candidate): Also check that
2694 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
2696 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
2699 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
2702 2017-02-19 Eric Fiselier <eric@efcs.ca>
2703 Jonathan Wakely <jwakely@redhat.com>
2706 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
2707 control warning about literal suffix identifiers without a leading
2710 2017-02-17 Jason Merrill <jason@redhat.com>
2712 PR c++/79508 - lookup error with member template
2713 * parser.c (cp_parser_template_name): Clear
2714 parser->context->object_type if we aren't doing lookup.
2716 PR c++/78690 - ICE with using and global type with same name
2717 * pt.c (type_dependent_object_expression_p): True for
2720 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2721 * pt.c (convert_template_argument): Just return an auto arg pack.
2722 (tsubst_template_args): Don't tsubst an auto pack type.
2724 PR c++/79556 - C++17 ICE with non-type auto
2725 * pt.c (do_auto_deduction): Don't try to deduce from null type.
2727 PR c++/79533 - C++17 ICE with temporary cast to reference
2728 * call.c (build_over_call): Conversion to a reference prevents copy
2731 2017-02-16 Jakub Jelinek <jakub@redhat.com>
2732 Jason Merrill <jason@redhat.com>
2734 PR c++/79502 - lost nodiscard attribute
2735 * pt.c (apply_late_template_attributes): Do apply non-dependent
2736 attributes to types.
2738 2017-02-16 Jason Merrill <jason@redhat.com>
2740 PR c++/78572 - ICE with self-modifying array initializer
2741 * constexpr.c (cxx_eval_store_expression): The object we're
2742 initializing is outside the constant-expression.
2743 (cxx_eval_call_expression): Set ctx->call.
2745 PR c++/79050 - ICE with undeduced auto and LTO
2746 * decl.c (poplevel): Remove undeduced auto decls.
2748 2017-02-16 Jakub Jelinek <jakub@redhat.com>
2751 * parser.c (cp_parser_omp_target): For -fopenmp-simd
2752 ignore #pragma omp target even when not followed by identifier.
2754 2017-02-15 Jason Merrill <jason@redhat.com>
2755 Jakub Jelinek <jakub@redhat.com>
2757 PR c++/79464 - ICE in IPA with omitted constructor parms
2758 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
2759 (adjust_clone_args): Adjust.
2760 (add_method): Remember omitted parms.
2761 * call.c (add_function_candidate): Likewise.
2762 * mangle.c (write_method_parms): Likewise.
2763 * method.c (ctor_omit_inherited_parms): Return false if there are no
2766 2017-02-15 Martin Sebor <msebor@redhat.com>
2769 * init.c (maybe_reject_flexarray_init): New function.
2770 (perform_member_init): Call it.
2772 2017-02-15 Jakub Jelinek <jakub@redhat.com>
2775 * parser.c (cp_parser_std_attribute): Don't pedwarn about
2776 [[deprecated]] with -std=c++11 and [[fallthrough]] with
2777 -std=c++11 and -std=c++14.
2780 * decl.c (grokdeclarator): For static data members, handle thread_p
2781 only after handling inline.
2783 2017-02-14 Marek Polacek <polacek@redhat.com>
2787 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
2788 clobbering if the postfix expression isn't an EXPR_P.
2790 2017-02-13 Jason Merrill <jason@redhat.com>
2792 PR c++/79461 - ICE with lambda in constexpr constructor
2793 * constexpr.c (build_data_member_initialization): Ignore
2794 initialization of a local variable.
2796 2017-02-13 Jakub Jelinek <jakub@redhat.com>
2798 * init.c (warn_placement_new_too_small): Add missing space in
2800 * parser.c (cp_parser_oacc_declare): Likewise.
2801 * mangle.c (maybe_check_abi_tags): Likewise.
2804 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
2805 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
2806 in the rightmost operand.
2808 2017-02-13 Nathan Sidwell <nathan@acm.org>
2810 PR c++/79296 - ICE mangling localized template instantiation
2811 * decl2.c (determine_visibility): Use template fn context for
2812 local class instantiations.
2814 2017-02-11 Jason Merrill <jason@redhat.com>
2816 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
2817 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
2818 (build_new_1): Use replace_placeholders.
2819 * tree.c (replace_placeholders_t): Also track whether we've seen a
2821 (replace_placeholders, replace_placeholders_r): Adjust.
2822 * cp-tree.h: Adjust.
2824 PR c++/77790 - ICE with auto function in C++11 mode
2825 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
2826 (require_deduced_type): Add complain parm, return bool.
2827 * cp-tree.h: Adjust.
2828 * decl2.c (mark_used): Use require_deduced_type.
2830 2017-02-10 Jason Merrill <jason@redhat.com>
2832 PR c++/78908 - template ops and bitfields
2833 * tree.c (build_min_non_dep): Use unlowered_expr_type.
2835 PR c++/78897 - constexpr union
2836 * constexpr.c (cxx_eval_store_expression): A store to a union member
2837 erases a previous store to another member.
2839 PR c++/71285 - member of fold-expression
2840 * semantics.c (finish_unary_fold_expr)
2841 (finish_binary_fold_expr): Use null type for fold-expressions.
2843 PR c++/79401 - protected inherited constructor
2844 * call.c (enforce_access): For inheriting constructor, find a base
2845 binfo in the path we already have.
2847 2017-02-10 Marek Polacek <polacek@redhat.com>
2850 * pt.c (type_dependent_expression_p): Check if the expression type
2854 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
2855 if warnings shouldn't be given.
2857 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
2860 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
2861 an error_mark_node as type.
2863 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2864 Jason Merrill <jason@redhat.com>
2867 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
2868 from pattern to type.
2870 2017-02-09 Jason Merrill <jason@redhat.com>
2872 PR c++/79316 - default argument in deduction guide
2873 PR c++/79350 - explicit deduction guide
2874 * parser.c (cp_parser_constructor_declarator_p)
2875 (cp_parser_direct_declarator): Parse deduction guides more like
2877 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
2878 * tree.c (special_function_p): Return it.
2879 * decl.c (check_special_function_return_type): Handle it.
2880 (grokdeclarator, grokfndecl): Adjust.
2881 (cp_finish_decl): Pass flags to do_auto_deduction.
2882 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
2883 * pt.c (dguide_name_p): Take a const_tree.
2884 (do_class_deduction): Handle explicit.
2885 (do_auto_deduction): Pass flags through.
2886 (build_deduction_guide): Copy explicit flag.
2888 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2891 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
2892 non-pragma_compound context here.
2893 (cp_parser_omp_target): Likewise.
2894 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
2895 parsing for ordered and target omp pragmas in non-pragma_stmt
2896 non-pragma_compound contexts.
2899 * parser.c (cp_parser_oacc_declare): Formatting fix.
2900 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
2901 automatic variables.
2903 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
2904 Chung-Lin Tang <cltang@codesourcery.com>
2906 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
2907 parsing. Parse constant expression. Remove semantic checking.
2908 (cp_parser_omp_clause_collapse): Disallow tile.
2909 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
2910 error about missing for after already emitting one. Use more
2911 conventional for idiom for unbounded loop.
2912 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
2913 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
2914 (finish_omp_for): Deal with tile clause.
2916 2017-02-07 Nathan Sidwell <nathan@acm.org>
2918 * method.c (synthesized_method_base_walk): New. Broken out of ...
2919 (synthesized_method_walk): ... here. Call it. Cleanup
2922 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
2925 * typeck2.c (process_init_constructor_union): Consider only
2926 FIELD_DECLs when looking for an NSDMI.
2928 2017-02-06 Jason Merrill <jason@redhat.com>
2930 PR c++/71193 - incomplete types in templates
2931 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
2932 handle incomplete type by pedwarning and then treating as dependent.
2934 2017-02-06 Jakub Jelinek <jakub@redhat.com>
2937 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
2938 (potential_constant_expression_1): Likewise.
2941 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
2942 allow one fewer than expected arguments if flag_permissive.
2945 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
2946 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
2947 with error_mark_node type.
2949 2017-02-03 Jason Merrill <jason@redhat.com>
2951 PR c++/78689 - ICE on constructor with label
2952 * optimize.c (maybe_clone_body): Replace omitted parameters with
2954 * class.c (build_clone): Fix logic for omitting inherited parms.
2956 PR c++/12245 - excessive memory use
2957 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
2958 back in. Don't cache constants.
2959 (maybe_constant_init): Don't cache constants.
2961 PR c++/79294 - ICE with invalid template argument
2962 * pt.c (convert_nontype_argument_function): Check value-dependence.
2963 (convert_nontype_argument): Don't check it here for function ptrs.
2965 2017-02-02 Richard Biener <rguenther@suse.de>
2968 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
2969 it lazily on the first changed element only and copy it
2970 fully upfront, only storing changed elements.
2972 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
2975 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
2978 2017-01-31 Jakub Jelinek <jakub@redhat.com>
2981 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
2984 2017-01-31 David Malcolm <dmalcolm@redhat.com>
2987 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
2988 any namespace aliases.
2990 2017-01-31 Nathan Sidwell <nathan@acm.org>
2993 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
2997 * pt.c: (instantiate_decl): Push to top level when current
2998 function scope doesn't match. Only push lmabda scope stack when
3001 * cp-tree.h (instantiate_decl): Make defer_ok bool.
3002 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
3003 (instantiate_decl): Simplify and reorder state saving and restoration.
3006 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
3007 * semantics.c (finish_member_declaration): Assert class is being
3010 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
3012 Introduce C++ support in libcc1.
3013 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
3014 (ansi_opname): Rename to...
3015 (cp_operator_id): ... this. Adjust all callers.
3016 (ansi_assopname): Rename to...
3017 (cp_assignment_operator_id): ... this. Adjust all callers.
3018 (cp_literal_operator_id): Declare.
3019 (set_global_friend): Declare.
3020 (is_global_friend): Declare.
3021 (enum cp_oracle_request): New type.
3022 (cp_binding_oracle_function): New type.
3023 (cp_binding_oracle): Declare.
3024 (cp_finish_injected_record_type): Declare.
3025 * friend.c (global_friend): New var.
3026 (set_global_friend): New fn.
3027 (is_global_friend): New fn.
3028 (is_friend): Call is_global_friend.
3029 * name-lookup.c (cp_binding_oracle): New var.
3030 (query_oracle): New fn.
3031 (qualified_lookup_using_namespace): Call query_oracle.
3032 (lookup_name_real_1): Likewise.
3033 * parser.c (cp_literal_operator_id): Drop static.
3034 * search.c (friend_accessible_p): Call is_global_friend.
3035 * semantics.c (is_this_parameter): Accept a variable if the
3036 binding oracle is enabled.
3038 2017-01-27 Jason Merrill <jason@redhat.com>
3040 PR c++/78771 - ICE with inherited constructor.
3041 * call.c (build_over_call): Call deduce_inheriting_ctor here.
3042 * pt.c (tsubst_decl): Not here.
3043 * class.c (add_method): Or here.
3044 * method.c (deduce_inheriting_ctor): Handle clones.
3045 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
3047 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
3050 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
3052 * cp/cp-tree.h: Declare it.
3053 * cp/semantics.c (finish_id_expression): Resolve names within a default
3054 capturing generic lambda defined within a template prior to
3055 instantiation to allow for captures to be added to the closure type.
3057 2017-01-26 Jakub Jelinek <jakub@redhat.com>
3060 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
3061 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
3062 * parser.c (cp_parser_builtin_offsetof): Pass result of
3063 build_static_cast of null_pointer_node to finish_offsetof.
3064 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
3065 it for -Winvalid-offsetof pedwarn instead of trying to guess
3066 original offsetof type from EXPR. Save OBJECT_PTR as a new
3067 second operand to OFFSETOF_EXPR.
3068 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
3069 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
3072 2017-01-26 Jason Merrill <jason@redhat.com>
3074 * name-lookup.c (parse_using_directive): Deprecate strong using.
3076 PR c++/79176 - lambda ICE with -flto -Os
3077 * decl2.c (vague_linkage_p): Handle decloned 'tors.
3078 * tree.c (decl_linkage): Likewise.
3080 2017-01-25 Martin Sebor <msebor@redhat.com>
3082 * decl.c (grokdeclarator): Fix a typo in a comment.
3084 2017-01-25 Jakub Jelinek <jakub@redhat.com>
3087 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
3091 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
3092 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
3094 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
3097 * decl.c (cxx_init_decl_processing): Pass main_input_filename
3098 to build_translation_unit_decl.
3100 2017-01-24 Jakub Jelinek <jakub@redhat.com>
3103 * cp-gimplify.c (cp_genericize_r): Add result of
3104 convert_from_reference on invisiref parm to p_set.
3106 2017-01-24 Nathan Sidwell <nathan@acm.org>
3108 PR c++/78469 - defaulted ctor and inaccessible dtor
3109 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
3110 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
3111 * tree.c (build_target_expr): Check tf_no_cleanup.
3113 PR c++/79118 - anon-members and constexpr
3114 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
3115 ctor decl. Recursively check anonymous members.
3116 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
3118 (explain_invalid_constexpr_fn): Likewise.
3120 2017-01-23 Nathan Sidwell <nathan@acm.org>
3122 PR c++/71710 - template using directive of field
3123 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
3126 PR c++/71406 - ICE with scope-ref'd template id exprs
3128 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
3129 before breaking up TEMPLATE_ID_EXPR.
3131 2017-01-20 Nathan Sidwell <nathan@acm.org>
3133 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
3134 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
3136 2017-01-20 David Malcolm <dmalcolm@redhat.com>
3140 * cp-tree.h (suggest_alternatives_for): Add bool param.
3141 (suggest_alternative_in_explicit_scope): New decl.
3142 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
3143 that isn't the global one, call new function
3144 suggest_alternative_in_explicit_scope, only calling
3145 suggest_alternatives_for if it fails, and disabling near match
3146 searches fort that case. When SCOPE is the global namespace,
3147 pass true for new param to suggest_alternatives_for to allow for
3149 * lex.c (unqualified_name_lookup_error): Pass true for new param
3150 to suggest_alternatives_for.
3151 * name-lookup.c (consider_binding_level): Add forward decl.
3152 (suggest_alternatives_for): Add "suggest_misspellings" param,
3153 using it to conditionalize the fuzzy name-lookup code.
3154 (suggest_alternative_in_explicit_scope): New function.
3155 * parser.c (cp_parser_primary_expression): When calling
3156 finish_id_expression, pass location of id_expression rather
3157 than that of id_expr_token.
3158 (cp_parser_id_expression): Convert local "unqualified_id" from
3159 tree to cp_expr to avoid implicitly dropping location information.
3161 2017-01-20 Marek Polacek <polacek@redhat.com>
3164 * call.c (build_conditional_expr_1): Warn about duplicated branches.
3165 * semantics.c (finish_expr_stmt): Build statement using the proper
3168 2017-01-19 Jason Merrill <jason@redhat.com>
3170 US 20 - forwarding references and class template argument deduction
3171 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
3172 * pt.c (push_template_decl_real): Set it.
3173 (maybe_adjust_types_for_deduction): Check it.
3174 (rewrite_template_parm): Copy it.
3176 US 19 - deduction guides and constructors
3177 * call.c (joust): Prefer deduction guides to constructors.
3178 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
3179 (deduction_guide_p): Check DECL_P.
3181 * decl.c (check_initializer): Always use build_aggr_init for array
3184 PR c++/79130 - decomposition and direct-initialization
3185 * init.c (build_aggr_init): Communicate direct-initialization to
3187 (build_vec_init): Check for array copy sooner.
3188 * parser.c (cp_parser_decomposition_declaration): Remove call to
3189 build_x_compound_expr_from_list.
3191 2017-01-18 Jason Merrill <jason@redhat.com>
3193 PR c++/68666 - member variable template-id
3194 * typeck.c (finish_class_member_access_expr): Handle variable
3196 * pt.c (lookup_and_finish_template_variable): No longer static.
3197 * cp-tree.h: Declare it.
3199 2017-01-18 Nathan Sidwell <nathan@acm.org>
3202 * call.c (build_over_call): When checking ellipsis conversions for
3203 an inherited ctor, make sure there is at least one conversion.
3205 2017-01-18 Jason Merrill <jason@redhat.com>
3207 PR c++/78894 - ICE with class deduction and default arg
3208 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
3210 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
3213 * mangle.c (write_discriminator): Reorganize abi warning check.
3215 2017-01-18 Nathan Sidwell <nathan@acm.org>
3217 * cp-tree.h: Clarify exception spec node comment.
3218 * except.c (nothrow_spec_p): Simplify by checking node-equality.
3221 * mangle.c (write_exception_spec): Check nothrow explicitly.
3222 (write_encoding): Don't increment processing_template_decl around
3225 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
3228 * mangle.c (write_template_args): Add "on" for operator names.
3230 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
3233 * mangle.c (write_discriminator): Handle discriminator >= 10.
3235 2017-01-17 Nathan Sidwell <nathan@acm.org>
3238 * cp-tree.h (maybe_generic_this_capture): Declare.
3239 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
3240 (maybe_resolve_dummy): ... here. Call it.
3241 (maybe_generic_this_capture): New.
3242 * parser.c (cp_parser_postfix_expression): Speculatively capture
3243 this in generic lambda in unresolved member function call.
3244 * pt.c (tsubst_copy_and_build): Force hard error from failed
3245 member function lookup in generic lambda.
3247 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
3250 * cp-array-notation.c (expand_array_notation_exprs): Handle
3253 2017-01-11 Jason Merrill <jason@redhat.com>
3255 PR c++/78337 - ICE on invalid with generic lambda
3256 * semantics.c (process_outer_var_ref): Check if containing_function
3257 is null. Move inform call under complain test.
3259 2017-01-11 Nathan Sidwell <nathan@acm.org>
3262 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
3265 2017-01-11 Nathan Sidwell <nathan@acm.org>
3267 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
3269 2017-01-11 Jakub Jelinek <jakub@redhat.com>
3272 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
3273 assertion. Formatting fix.
3276 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
3279 2017-01-10 David Malcolm <dmalcolm@redhat.com>
3282 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
3283 a missing semicolon if we have a valid insertion location for
3286 2017-01-10 Jason Merrill <jason@redhat.com>
3288 FI 20, decomposition declaration with parenthesized initializer.
3289 * parser.c (cp_parser_decomposition_declaration): Use
3290 cp_parser_initializer.
3292 2017-01-09 Jason Merrill <jason@redhat.com>
3294 Implement P0195R2, C++17 variadic using.
3295 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
3296 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
3297 * error.c (dump_decl): Likewise.
3299 2017-01-09 Jakub Jelinek <jakub@redhat.com>
3301 PR translation/79019
3302 PR translation/79020
3303 * semantics.c (finish_omp_clauses): Add missing whitespace to
3304 translatable strings.
3305 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
3307 2017-01-07 Jason Merrill <jason@redhat.com>
3309 PR c++/78948 - instantiation from discarded statement
3310 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
3311 * cp-tree.h (in_discarded_stmt): Declare it.
3312 (struct saved_scope): Add discarded_stmt bitfield.
3313 (in_discarded_stmt): New macro.
3314 * decl2.c (mark_used): Check it.
3315 * parser.c (cp_parser_selection_statement): Adjust.
3316 (cp_parser_jump_statement): Adjust.
3318 2017-01-05 Jakub Jelinek <jakub@redhat.com>
3321 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
3322 REFERENCE_REF_P, set tt to its operand.
3325 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
3326 unions even for C++11 and later.
3328 2017-01-05 Nathan Sidwell <nathan@acm.org>
3331 * pt.c (convert_nontype_argument): Don't try and see if integral
3332 or enum expressions are constants prematurely.
3334 2017-01-04 Marek Polacek <polacek@redhat.com>
3337 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
3338 a zero character literal.
3340 2017-01-04 Jakub Jelinek <jakub@redhat.com>
3343 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
3347 * parser.c (cp_parser_simple_declaration): Only complain about
3348 inconsistent auto deduction if auto_result doesn't use auto.
3350 * parser.c (cp_parser_simple_declaration): Diagnose function
3351 declaration among more than one init-declarators with auto
3355 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
3356 assertion, as lexer->buffer may be NULL.
3358 2017-01-04 Marek Polacek <polacek@redhat.com>
3362 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
3364 2017-01-04 Nathan Sidwell <nathan@acm.org>
3367 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
3368 (lambda_capture_field_type): Update prototype.
3369 * lambda.c (lambda_capture_field_type): Add is_reference parm.
3370 Add referenceness here.
3371 (add_capture): Adjust lambda_capture_field_type call, refactor
3373 * pt.c (tsubst): Adjust lambda_capture_field_type call.
3375 2017-01-01 Jakub Jelinek <jakub@redhat.com>
3377 Update copyright years.
3379 Copyright (C) 2017 Free Software Foundation, Inc.
3381 Copying and distribution of this file, with or without modification,
3382 are permitted in any medium without royalty provided the copyright
3383 notice and this notice are preserved.