1 2017-05-04 Martin Sebor <msebor@redhat.com>
4 * call.c (print_z_candidate): Add missing quoting to %D and other
6 (build_op_call_1): Same.
7 * constraint.cc (diagnose_check_constraint): Same.
8 * mangle.c (mangle_decl): Same.
9 * name-lookup.c (cp_binding_level_debug): Same.
10 (set_decl_namespace): Same.
11 * parser.c (cp_parser_tx_qualifier_opt): Same.
12 * pt.c (print_candidates_1): Same.
13 (check_template_variable): Same.
14 (tsubst_default_argument): Same.
15 (most_specialized_partial_spec): Same.
16 * semantics.c (omp_reduction_lookup): Same.
17 * tree.c (check_abi_tag_redeclaration): Same.
18 * typeck.c (comptypes): Same.
19 * typeck2.c (abstract_virtuals_error_sfinae): Same.
21 2017-05-04 Nathan Sidwell <nathan@acm.org>
24 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
25 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
26 CPTI_INIT_LIST_IDENTIFIER.
27 (global_namespace, global_type_node, global_identifier,
28 anon_identifier, init_list_identifier): New.
29 * decl.c (global_type_node, global_scope_name): Delete.
30 (initialize_predefined_identifiers): Add new identifiers.
31 (cxx_init_decl_processing): Adjust.
32 * name-lookup.h (global_namespace, global_type_node): Delete.
33 * name-lookup.c (global_namespace, anonymous_namespace_name,
34 get_anonymous_namespace_name): Delete.
35 (namespace_scope_ht_size, begin_scope, pushtag_1,
36 push_namespace): Adjust,
37 * call.c (type_has_extended_temps): Use init_list_identifier.
38 * pt.c (listify): Likewise.
40 * name-lookup.c: Reorder functions to make merging from modules
43 2017-05-03 Jason Merrill <jason@redhat.com>
45 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
47 2017-05-03 Nathan Sidwell <nathan@acm.org>
49 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
50 along with #defines, to before name-lookup include.
52 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
54 * pt.c (is_auto_or_concept): Remove.
55 (type_uses_auto_or_concept): Remove, unused.
56 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
57 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
58 * cp-tree.h (is_auto_or_concept): Remove.
60 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
63 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
64 add pedigree operation and detach call here.
65 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
66 cilk_cp_gimplify_call_params_in_spawned_fn.
67 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
68 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
70 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
72 * parser.c (cp_parser_member_declaration): Add fix-it hints for
73 stray comma and missing semicolon at end of member declaration.
75 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
77 * parser.c (cp_parser_cast_expression): Add target type of cast to
79 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
81 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
83 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
85 * cp-tree.h (grok_ctor_properties): Update.
87 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
89 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
90 information to diagnostic of invalid colon in nested-name-specifier.
92 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
94 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
95 diagnostic of invalid class/struct keyword after enum.
97 2017-04-25 David Malcolm <dmalcolm@redhat.com>
99 * parser.c (cp_parser_member_declaration): Add fix-it hint
100 for removing stray semicolons.
102 2017-04-25 David Malcolm <dmalcolm@redhat.com>
104 * name-lookup.c (get_std_name_hint): New function.
105 (maybe_suggest_missing_header): New function.
106 (suggest_alternative_in_explicit_scope): Call
107 maybe_suggest_missing_header.
109 2017-04-25 David Malcolm <dmalcolm@redhat.com>
112 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
113 candidate type of bm from tree to const char *.
114 (consider_binding_level): Likewise.
115 (lookup_name_fuzzy): Likewise, using this to merge the best
116 result from the preprocessor into bm, rather than immediately
117 returning, so that better matches from reserved words can "win".
118 Guard the rejection of keywords that don't start decl-specifiers
119 so it only happens for FUZZY_LOOKUP_TYPENAME.
121 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
123 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
124 (start_enum): Likewise.
125 (build_enumerator): Likewise. Use %qE instead of plain %E.
126 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
127 %<%D%> in diagnostics.
128 (cp_parser_elaborated_type_specifier): Likewise.
129 * pt.c (make_pack_expansion): Use %qT and %qE instead of
130 %<%T%> and %<%E%> in diagnostics.
131 (tsubst_pack_expansion): Likewise.
133 2017-04-24 David Malcolm <dmalcolm@redhat.com>
136 * parser.c (cp_parser_unary_expression): Generate a location
137 range for alignof and sizeof expressions.
139 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
141 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
143 (cp_parser_virt_specifier_seq_opt): Likewise.
144 (set_and_check_decl_spec_loc): Likewise twice.
146 2017-04-21 Jason Merrill <jason@redhat.com>
148 PR c++/80179 - ICE with initialized flexible array member.
149 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
151 2017-04-21 Richard Biener <rguenther@suse.de>
153 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
154 (copy_type): Likewise.
155 * lex.c (copy_decl): Pass down mem-stat info.
156 (copy_type): Likewise.
158 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
161 * init.c (build_new_1): Suppress notes about over-aligned new when
162 the warning is suppressed.
164 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
166 * parser.c (cp_parser_member_declaration): Add warning with fixit
167 information for extra semicolon after in-class function definition.
169 2017-04-20 Jakub Jelinek <jakub@redhat.com>
172 * tree.c (build_cplus_array_type): Call build_array_type
173 with the intended TYPE_TYPELESS_STORAGE flag value, instead
174 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
177 2017-04-18 Marek Polacek <polacek@redhat.com>
179 PR c++/80244 - ICE with attribute in template alias.
180 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
182 PR c++/80241 - ICE with alignas pack expansion.
183 * error.c (dump_expr): Handle TREE_LIST.
184 * parser.c (cp_parser_std_attribute_list): Return error_mark if
185 make_pack_expansion returns an error.
187 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
190 * class.c (fixup_may_alias): Fix all type variants.
192 2017-04-17 Jason Merrill <jason@redhat.com>
194 PR c++/80415 - wrong error with default arg and array reference.
195 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
197 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
199 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
201 * decl.c (name_unnamed_type): Split out of...
202 (grokdeclarator): ... this.
203 * decl.h (name_unnamed_type): Declare.
205 2017-04-12 Richard Biener <rguenther@suse.de>
206 Bernd Edlinger <bernd.edlinger@hotmail.de>
209 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
210 for arrays of character or std::byte type.
212 2017-04-11 Jason Merrill <jason@redhat.com>
214 PR c++/80294 - ICE with constexpr and inheritance.
215 * constexpr.c (reduced_constant_expression_p):
216 A null constructor element is non-constant.
217 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
218 returning an empty base.
220 2017-04-11 Jakub Jelinek <jakub@redhat.com>
223 * decl.c (cp_finish_decomp): If processing_template_decl on
224 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
225 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
226 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
228 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
229 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
232 2017-04-11 Jakub Jelinek <jakub@redhat.com>
235 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
237 2017-04-10 Jakub Jelinek <jakub@redhat.com>
240 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
241 operand, if it is a static member function, recurse on the
244 2017-04-10 Marek Polacek <polacek@redhat.com>
247 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
248 ORIG_TYPE earlier and not only when shortening.
250 2017-04-07 Jason Merrill <jason@redhat.com>
252 PR c++/80356 - ICE with reference to function template argument.
254 * pt.c (convert_nontype_argument_function): Adjust type even with a
255 value-dependent argument.
257 PR c++/80267 - ICE with nested capture of reference
259 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
261 2017-04-07 Marek Polacek <polacek@redhat.com>
264 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
267 * call.c (build_over_call): Don't check cxx_dialect.
268 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
269 whether SUB is a CONSTRUCTOR.
270 * init.c (build_new_1): Don't check cxx_dialect.
271 * tree.c (replace_placeholders): Add a function comment. Return if
272 not in C++14, or if the object isn't a (member of a) class.
273 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
274 TYPE is CLASS_TYPE_P.
276 2017-04-05 Jakub Jelinek <jakub@redhat.com>
279 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
280 of a loop doing vec_safe_push of NULL. Formatting fixes.
281 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
282 to newidx before calling canonical_type_parameter on newtype.
284 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
287 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
288 UNARY_PLUS_EXPR case.
290 2017-04-03 Jason Merrill <jason@redhat.com>
292 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
294 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
296 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
297 * decl2.c (one_static_initialization_or_destruction): Likewise.
298 * name-lookup.c (store_bindings): Likewise.
299 * parser.c (make_call_declarator): Likewise.
300 * pt.c (check_explicit_specialization): Likewise.
302 2017-04-03 Jason Merrill <jason@redhat.com>
304 PR sanitizer/79993 - ICE with VLA initialization from string
305 PR c++/69487 - wrong VLA initialization from string
306 * init.c (finish_length_check): Split out from build_vec_init.
307 (build_vec_init): Handle STRING_CST.
308 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
309 (digest_init_r): Don't give a STRING_CST VLA type.
311 2017-03-31 Jakub Jelinek <jakub@redhat.com>
314 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
315 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
316 for NOP_EXPR to REFERENCE_TYPE.
319 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
320 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
322 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
323 Remove extraneous parens.
324 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
325 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
326 (cp_parser_trait_expr): Likewise.
328 2017-03-27 Jakub Jelinek <jakub@redhat.com>
331 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
332 * typeck.c (cxx_mark_addressable): Likewise. Look through
333 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
335 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
337 2017-03-24 Jason Merrill <jason@redhat.com>
339 PR c++/77339 - ICE with invalid use of alias template.
340 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
343 2017-03-24 Marek Polacek <polacek@redhat.com>
346 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
347 doesn't have side effects.
349 2017-03-23 Jason Merrill <jason@redhat.com>
351 PR c++/80150 - ICE with overloaded variadic deduction.
352 * pt.c (try_one_overload): Remove asserts.
354 PR c++/77563 - missing ambiguous conversion error.
355 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
357 2017-03-23 Marek Polacek <polacek@redhat.com>
359 * cp-tree.h: Remove a C_RID_YYCODE reference.
361 2017-03-22 Jakub Jelinek <jakub@redhat.com>
364 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
365 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
366 processing_template_decl.
368 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
371 * name-lookup.c (pushtag_1): Add check for bogus, non template,
372 std::initializer_list.
374 2017-03-21 Jakub Jelinek <jakub@redhat.com>
377 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
379 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
382 * init.c (std_placement_new_fn_p): New.
383 (build_new_1): Call it.
385 2017-03-20 Jason Merrill <jason@redhat.com>
387 PR c++/80096 - ICE with C++17 non-type auto.
388 * pt.c (tsubst): Delay tsubst of type of template non-type
391 PR c++/79519 - ICE with deleted template friend.
392 * decl.c (grokdeclarator): Complain about misplaced function
393 definition using =, as well.
395 PR c++/79640 - infinite recursion with generic lambda.
396 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
397 before substituting its initializer.
399 2017-03-20 Marek Polacek <polacek@redhat.com>
400 Paolo Carlini <paolo.carlini@oracle.com>
402 PR c++/80059 - ICE with noexcept and __transaction_atomic
403 * except.c (build_must_not_throw_expr): Call
404 instantiate_non_dependent_expr.
406 2017-03-19 Jason Merrill <jason@redhat.com>
408 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
409 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
410 reference decomposition.
412 PR c++/80077 - error with constexpr and -fno-elide-constructors.
413 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
414 expanding trivial constructor.
416 2017-03-17 Jason Merrill <jason@redhat.com>
418 PR c++/78345 - ICE initializing array from lambda.
419 * init.c (build_aggr_init): Check array initializer.
420 (build_vec_init): Check the type of a CONSTRUCTOR.
422 PR c++/80073 - C++17 ICE with virtual base.
423 * decl.c (xref_basetypes): Also check for indirect vbases.
425 2017-03-16 Jason Merrill <jason@redhat.com>
427 * decl.c (start_enum): std::byte aliases anything.
430 * constexpr.c (lookup_placeholder): Tweak.
432 2017-03-15 Jason Merrill <jason@redhat.com>
434 PR c++/80043 - ICE with -fpermissive
435 * typeck.c (convert_for_assignment): Handle instantiate_type
438 2017-03-14 Nathan Sidwell <nathan@acm.org>
440 PR c++/79393 DR 1658 workaround
441 * method.c (synthesized_method_base_walk): Inihibit abstract class
442 virtual base access check here.
443 (synthesized_method_walk): Not here.
445 2017-03-13 Nathan Sidwell <nathan@acm.org>
447 PR c++/79393 DR 1658 workaround
448 * method.c (synthesized_method_walk): Check vbases of abstract
449 classes for dtor walk.
451 2017-03-10 David Malcolm <dmalcolm@redhat.com>
454 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
456 2017-03-10 Jason Merrill <jason@redhat.com>
458 PR c++/79960 - alias templates and partial ordering
459 * pt.c (comp_template_args): Add partial_order parm.
460 (template_args_equal): Likewise.
461 (comp_template_args_porder): New.
462 (get_partial_spec_bindings): Use it.
464 2017-03-10 Marek Polacek <polacek@redhat.com>
467 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
469 2017-03-10 Jakub Jelinek <jakub@redhat.com>
472 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
473 Use XALLOCAVEC macro.
476 * decl.c (finish_enum_value_list): If value is error_mark_node,
477 don't copy it and change its type.
478 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
479 of CONST_DECL is error_mark_node.
481 2017-03-09 Marek Polacek <polacek@redhat.com>
483 PR c++/79900 - ICE in strip_typedefs
484 * tree.c (strip_typedefs): Skip the attribute handling if T is
485 a variant type which hasn't been updated yet.
487 PR c++/79687 - wrong code with pointer-to-member
488 * init.c (constant_value_1): Break if the variable has a dynamic
491 2017-03-08 Jason Merrill <jason@redhat.com>
493 PR c++/79797 - ICE with self-reference in array DMI.
494 * constexpr.c (lookup_placeholder): Split out...
495 (cxx_eval_constant_expression): ...from here.
497 2017-03-07 Jakub Jelinek <jakub@redhat.com>
500 * parser.c (cp_parser_omp_cancellation_point,
501 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
502 cp_parser_omp_target_update): Change "may only be used in compound
503 statements" diagnostics, such that the same translatable string is
504 used for all pragmas.
505 (cp_parser_pragma): Likewise. Use error_at instead of
506 cp_parser_error for that diagnostics.
508 2017-03-06 Marek Polacek <polacek@redhat.com>
510 PR c++/79796 - ICE with NSDMI and this pointer
511 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
512 replace_placeholders.
514 2017-03-06 Jakub Jelinek <jakub@redhat.com>
517 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
520 2017-03-06 Jason Merrill <jason@redhat.com>
522 Revert "Allow deduction guides to look into primary template."
523 * cp-tree.h, parser.c, pt.c, search.c: Revert.
525 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
528 * except.c (build_must_not_throw_expr): Perform the implicit
529 conversions on the condition.
531 2017-03-03 Jason Merrill <jason@redhat.com>
533 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
536 Core issues 2273 and 2277
537 * call.c (joust): Adjust using-declaration tiebreaker to handle
538 the intermediate base case.
539 * method.c (strip_inheriting_ctors): Just return the argument if
540 !flag_new_inheriting_ctors.
542 2017-03-03 Richard Biener <rguenther@suse.de>
545 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
547 2017-03-03 Marek Polacek <polacek@redhat.com>
550 * typeck.c (string_conv_p): In C++11, always call pedwarn with
553 2017-03-02 Jason Merrill <jason@redhat.com>
555 Update overload resolution with deduction guides.
556 * pt.c (do_class_deduction): Always build the copy guide.
557 (copy_guide_p, template_guide_p): New.
558 (build_deduction_guide): Remember the original constructor.
559 * call.c (joust): Prefer the copy guide and non-template guides.
561 Allow deduction guides to look into primary template.
562 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
563 (struct cp_decl_specifier_seq): Add constructor_p.
564 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
565 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
566 Clear deduction_guide_type. Don't handle deduction guide names.
567 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
568 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
569 (cp_parser_member_declaration, cp_parser_cache_defarg)
570 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
571 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
572 (build_deduction_guide): Set deduction_guide_type.
573 (dependent_scope_p): Check deduction_guide_type.
574 * search.c (lookup_member): Likewise.
576 2017-03-02 Jakub Jelinek <jakub@redhat.com>
579 * init.c (mark_exp_read_r): New function.
580 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
581 whole arguments instead of plain mark_exp_read on TREE_LIST values.
583 2017-03-01 Jason Merrill <jason@redhat.com>
585 Class template argument deduction in new-expression
586 * init.c (build_new): Handle deduction from no initializer.
587 * parser.c (cp_parser_new_expression): Don't require a single
588 expression for class template deduction.
589 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
590 class template placeholder.
591 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
592 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
593 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
595 2017-03-01 Jakub Jelinek <jakub@redhat.com>
598 * init.c (emit_mem_initializers): When not constructing vbases of
599 abstract classes, mark arguments as read for
600 -Wunused-but-set-parameter.
602 2017-02-28 Jason Merrill <jason@redhat.com>
604 Class template argument deduction refinements
605 * call.c (joust): Move deduction guide tiebreaker down.
606 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
607 deduction with no initializer.
608 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
609 (do_class_deduction): Use that rather than special case.
610 (do_auto_deduction): Handle null initializer.
612 2017-02-28 Jakub Jelinek <jakub@redhat.com>
614 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
615 instead of just cond ? "..." : "...".
616 (grokdeclarator): Likewise.
617 (build_enumerator): Likewise.
618 * init.c (build_new_1): Likewise.
619 * call.c (build_new_method_call_1): Likewise.
620 * parser.c: Include intl.h.
621 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
622 "enter"/"exit" keyword.
623 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
626 2017-02-27 Jason Merrill <jason@redhat.com>
628 PR c++/71568 - SFINAE forming pointer to member function
629 * init.c (build_offset_ref): Check the return value of
630 perform_or_defer_access_check.
632 2017-02-27 Marek Polacek <polacek@redhat.com>
634 * decl.c (expand_static_init): Add missing } in a comment.
636 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
638 * init.c: Include intl.h.
639 (build_new_1): Move message strings into pedwarn to make them
640 -Wformat-security friendly. Mark string for translation.
641 * pt.c (tsubst_copy_and_build): Mark string for translation.
642 Make the pointer const.
643 * semantics.c (finish_id_expression): Mark strings for translation.
645 2017-02-25 Jakub Jelinek <jakub@redhat.com>
647 * call.c (build_op_delete_call): Make msg1 and msg2 const.
649 2017-02-24 Jakub Jelinek <jakub@redhat.com>
652 * call.c (build_over_call): Call check_function_arguments even for
653 -Wrestrict, adjust check_function_arguments caller.
654 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
656 * typeck.c (cp_build_function_call_vec): Adjust
657 check_function_arguments caller.
659 2017-02-24 Marek Polacek <polacek@redhat.com>
662 * decl.c (check_redeclaration_exception_specification): Mark a string
663 for translation. Make the pointer const.
665 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
668 * pt.c (register_specialization): Check duplicate_decls return value
669 for error_mark_node and pass it back.
671 2017-02-22 Jason Merrill <jason@redhat.com>
673 PR c++/79679 - missing destructor for argument
674 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
677 * pt.c (do_class_deduction): Handle 0 argument case.
679 2017-02-22 Jakub Jelinek <jakub@redhat.com>
682 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
683 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
684 * constexpr.c (potential_constant_expression_1): Handle
685 OMP_*, OACC_* and CILK_* trees. Use error_at with
686 EXPR_LOC_OR_LOC (t, input_location) computed early
687 instead of error, or error_at with location_of (t).
689 2017-02-22 Marek Polacek <polacek@redhat.com>
692 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
693 if the alignas expression is erroneous.
694 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
698 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
700 2017-02-21 Jason Merrill <jason@redhat.com>
702 PR c++/50308 - wrong deprecated warning with ADL
703 PR c++/17729 - duplicate deprecated warning
704 * semantics.c (finish_id_expression): Only call mark_used on a
705 function if we aren't building a call.
707 PR c++/41727 - ICE with partial spec of partial instantiation
708 * pt.c (process_partial_specialization): For now, don't check more
709 specialized if there is more than one level of args.
711 2017-02-21 Marek Polacek <polacek@redhat.com>
714 * cp-tree.h (maybe_reject_flexarray_init): Declare.
715 * init.c (maybe_reject_flexarray_init): No longer static.
716 Add check for current_function_decl.
717 * parser.c (cp_parser_late_parse_one_default_arg): Reject
718 a default mem-initializer for a flexible array.
720 2017-02-21 Jakub Jelinek <jakub@redhat.com>
721 Paolo Carlini <paolo.carlini@oracle.com>
724 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
726 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
727 decl after the decomposition artificial decl has error_mark_node.
728 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
729 instead of just == error_mark_node comparison.
731 2017-02-21 Jakub Jelinek <jakub@redhat.com>
734 * decl.c: Include gimplify.h.
735 (cp_finish_decomp): Make sure there is no sharing of trees
736 in between DECL_VALUE_EXPR of decomposition decls.
739 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
742 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
743 call cplus_expand_constant on it first.
745 2017-02-19 Jason Merrill <jason@redhat.com>
747 PR c++/78139 - destructor needed by new-expression
748 * call.c (build_special_member_call): Use tf_no_cleanup.
750 PR c++/78282 - auto template and pack expansion
751 * pt.c (find_parameter_packs_r): Don't walk into the type of
752 templates other than template template-parameters.
754 PR c++/79606 - ICE with this->base_member in NSDMI
755 * class.c (build_base_path): Check processing_template_decl.
757 PR c++/79607 - ICE with T{} initializer
758 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
760 PR c++/79566 - elaborated-type-specifier in range for
761 * parser.c (cp_parser_simple_declaration): Fix check for type
764 PR c++/79400 - confusing suggestion of 'noexcept'
765 * parser.c (cp_parser_exception_specification_opt): Remove
766 suggestion for deprecated dynamic exception-specification.
768 PR c++/79470 - partial ordering with reference parameters
769 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
771 PR c++/79500 - ICE with non-template deduction guide
772 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
773 DECL_TEMPLATE_RESULT.
775 PR c++/79580 - ICE with compound literal
776 * parser.c (cp_parser_class_head): If we're in the middle of an
777 expression, use ts_within_enclosing_non_class.
779 PR c++/79503 - inherited ctor taking base class
780 * call.c (add_function_candidate): Also check that
781 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
783 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
786 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
789 2017-02-19 Eric Fiselier <eric@efcs.ca>
790 Jonathan Wakely <jwakely@redhat.com>
793 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
794 control warning about literal suffix identifiers without a leading
797 2017-02-17 Jason Merrill <jason@redhat.com>
799 PR c++/79508 - lookup error with member template
800 * parser.c (cp_parser_template_name): Clear
801 parser->context->object_type if we aren't doing lookup.
803 PR c++/78690 - ICE with using and global type with same name
804 * pt.c (type_dependent_object_expression_p): True for
807 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
808 * pt.c (convert_template_argument): Just return an auto arg pack.
809 (tsubst_template_args): Don't tsubst an auto pack type.
811 PR c++/79556 - C++17 ICE with non-type auto
812 * pt.c (do_auto_deduction): Don't try to deduce from null type.
814 PR c++/79533 - C++17 ICE with temporary cast to reference
815 * call.c (build_over_call): Conversion to a reference prevents copy
818 2017-02-16 Jakub Jelinek <jakub@redhat.com>
819 Jason Merrill <jason@redhat.com>
821 PR c++/79502 - lost nodiscard attribute
822 * pt.c (apply_late_template_attributes): Do apply non-dependent
825 2017-02-16 Jason Merrill <jason@redhat.com>
827 PR c++/78572 - ICE with self-modifying array initializer
828 * constexpr.c (cxx_eval_store_expression): The object we're
829 initializing is outside the constant-expression.
830 (cxx_eval_call_expression): Set ctx->call.
832 PR c++/79050 - ICE with undeduced auto and LTO
833 * decl.c (poplevel): Remove undeduced auto decls.
835 2017-02-16 Jakub Jelinek <jakub@redhat.com>
838 * parser.c (cp_parser_omp_target): For -fopenmp-simd
839 ignore #pragma omp target even when not followed by identifier.
841 2017-02-15 Jason Merrill <jason@redhat.com>
842 Jakub Jelinek <jakub@redhat.com>
844 PR c++/79464 - ICE in IPA with omitted constructor parms
845 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
846 (adjust_clone_args): Adjust.
847 (add_method): Remember omitted parms.
848 * call.c (add_function_candidate): Likewise.
849 * mangle.c (write_method_parms): Likewise.
850 * method.c (ctor_omit_inherited_parms): Return false if there are no
853 2017-02-15 Martin Sebor <msebor@redhat.com>
856 * init.c (maybe_reject_flexarray_init): New function.
857 (perform_member_init): Call it.
859 2017-02-15 Jakub Jelinek <jakub@redhat.com>
862 * parser.c (cp_parser_std_attribute): Don't pedwarn about
863 [[deprecated]] with -std=c++11 and [[fallthrough]] with
864 -std=c++11 and -std=c++14.
867 * decl.c (grokdeclarator): For static data members, handle thread_p
868 only after handling inline.
870 2017-02-14 Marek Polacek <polacek@redhat.com>
874 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
875 clobbering if the postfix expression isn't an EXPR_P.
877 2017-02-13 Jason Merrill <jason@redhat.com>
879 PR c++/79461 - ICE with lambda in constexpr constructor
880 * constexpr.c (build_data_member_initialization): Ignore
881 initialization of a local variable.
883 2017-02-13 Jakub Jelinek <jakub@redhat.com>
885 * init.c (warn_placement_new_too_small): Add missing space in
887 * parser.c (cp_parser_oacc_declare): Likewise.
888 * mangle.c (maybe_check_abi_tags): Likewise.
891 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
892 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
893 in the rightmost operand.
895 2017-02-13 Nathan Sidwell <nathan@acm.org>
897 PR c++/79296 - ICE mangling localized template instantiation
898 * decl2.c (determine_visibility): Use template fn context for
899 local class instantiations.
901 2017-02-11 Jason Merrill <jason@redhat.com>
903 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
904 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
905 (build_new_1): Use replace_placeholders.
906 * tree.c (replace_placeholders_t): Also track whether we've seen a
908 (replace_placeholders, replace_placeholders_r): Adjust.
911 PR c++/77790 - ICE with auto function in C++11 mode
912 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
913 (require_deduced_type): Add complain parm, return bool.
915 * decl2.c (mark_used): Use require_deduced_type.
917 2017-02-10 Jason Merrill <jason@redhat.com>
919 PR c++/78908 - template ops and bitfields
920 * tree.c (build_min_non_dep): Use unlowered_expr_type.
922 PR c++/78897 - constexpr union
923 * constexpr.c (cxx_eval_store_expression): A store to a union member
924 erases a previous store to another member.
926 PR c++/71285 - member of fold-expression
927 * semantics.c (finish_unary_fold_expr)
928 (finish_binary_fold_expr): Use null type for fold-expressions.
930 PR c++/79401 - protected inherited constructor
931 * call.c (enforce_access): For inheriting constructor, find a base
932 binfo in the path we already have.
934 2017-02-10 Marek Polacek <polacek@redhat.com>
937 * pt.c (type_dependent_expression_p): Check if the expression type
941 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
942 if warnings shouldn't be given.
944 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
947 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
948 an error_mark_node as type.
950 2017-02-09 Jakub Jelinek <jakub@redhat.com>
951 Jason Merrill <jason@redhat.com>
954 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
955 from pattern to type.
957 2017-02-09 Jason Merrill <jason@redhat.com>
959 PR c++/79316 - default argument in deduction guide
960 PR c++/79350 - explicit deduction guide
961 * parser.c (cp_parser_constructor_declarator_p)
962 (cp_parser_direct_declarator): Parse deduction guides more like
964 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
965 * tree.c (special_function_p): Return it.
966 * decl.c (check_special_function_return_type): Handle it.
967 (grokdeclarator, grokfndecl): Adjust.
968 (cp_finish_decl): Pass flags to do_auto_deduction.
969 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
970 * pt.c (dguide_name_p): Take a const_tree.
971 (do_class_deduction): Handle explicit.
972 (do_auto_deduction): Pass flags through.
973 (build_deduction_guide): Copy explicit flag.
975 2017-02-09 Jakub Jelinek <jakub@redhat.com>
978 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
979 non-pragma_compound context here.
980 (cp_parser_omp_target): Likewise.
981 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
982 parsing for ordered and target omp pragmas in non-pragma_stmt
983 non-pragma_compound contexts.
986 * parser.c (cp_parser_oacc_declare): Formatting fix.
987 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
990 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
991 Chung-Lin Tang <cltang@codesourcery.com>
993 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
994 parsing. Parse constant expression. Remove semantic checking.
995 (cp_parser_omp_clause_collapse): Disallow tile.
996 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
997 error about missing for after already emitting one. Use more
998 conventional for idiom for unbounded loop.
999 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
1000 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
1001 (finish_omp_for): Deal with tile clause.
1003 2017-02-07 Nathan Sidwell <nathan@acm.org>
1005 * method.c (synthesized_method_base_walk): New. Broken out of ...
1006 (synthesized_method_walk): ... here. Call it. Cleanup
1009 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
1012 * typeck2.c (process_init_constructor_union): Consider only
1013 FIELD_DECLs when looking for an NSDMI.
1015 2017-02-06 Jason Merrill <jason@redhat.com>
1017 PR c++/71193 - incomplete types in templates
1018 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
1019 handle incomplete type by pedwarning and then treating as dependent.
1021 2017-02-06 Jakub Jelinek <jakub@redhat.com>
1024 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
1025 (potential_constant_expression_1): Likewise.
1028 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
1029 allow one fewer than expected arguments if flag_permissive.
1032 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
1033 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
1034 with error_mark_node type.
1036 2017-02-03 Jason Merrill <jason@redhat.com>
1038 PR c++/78689 - ICE on constructor with label
1039 * optimize.c (maybe_clone_body): Replace omitted parameters with
1041 * class.c (build_clone): Fix logic for omitting inherited parms.
1043 PR c++/12245 - excessive memory use
1044 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
1045 back in. Don't cache constants.
1046 (maybe_constant_init): Don't cache constants.
1048 PR c++/79294 - ICE with invalid template argument
1049 * pt.c (convert_nontype_argument_function): Check value-dependence.
1050 (convert_nontype_argument): Don't check it here for function ptrs.
1052 2017-02-02 Richard Biener <rguenther@suse.de>
1055 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
1056 it lazily on the first changed element only and copy it
1057 fully upfront, only storing changed elements.
1059 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
1062 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
1065 2017-01-31 Jakub Jelinek <jakub@redhat.com>
1068 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
1071 2017-01-31 David Malcolm <dmalcolm@redhat.com>
1074 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
1075 any namespace aliases.
1077 2017-01-31 Nathan Sidwell <nathan@acm.org>
1080 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
1084 * pt.c: (instantiate_decl): Push to top level when current
1085 function scope doesn't match. Only push lmabda scope stack when
1088 * cp-tree.h (instantiate_decl): Make defer_ok bool.
1089 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
1090 (instantiate_decl): Simplify and reorder state saving and restoration.
1093 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
1094 * semantics.c (finish_member_declaration): Assert class is being
1097 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
1099 Introduce C++ support in libcc1.
1100 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
1101 (ansi_opname): Rename to...
1102 (cp_operator_id): ... this. Adjust all callers.
1103 (ansi_assopname): Rename to...
1104 (cp_assignment_operator_id): ... this. Adjust all callers.
1105 (cp_literal_operator_id): Declare.
1106 (set_global_friend): Declare.
1107 (is_global_friend): Declare.
1108 (enum cp_oracle_request): New type.
1109 (cp_binding_oracle_function): New type.
1110 (cp_binding_oracle): Declare.
1111 (cp_finish_injected_record_type): Declare.
1112 * friend.c (global_friend): New var.
1113 (set_global_friend): New fn.
1114 (is_global_friend): New fn.
1115 (is_friend): Call is_global_friend.
1116 * name-lookup.c (cp_binding_oracle): New var.
1117 (query_oracle): New fn.
1118 (qualified_lookup_using_namespace): Call query_oracle.
1119 (lookup_name_real_1): Likewise.
1120 * parser.c (cp_literal_operator_id): Drop static.
1121 * search.c (friend_accessible_p): Call is_global_friend.
1122 * semantics.c (is_this_parameter): Accept a variable if the
1123 binding oracle is enabled.
1125 2017-01-27 Jason Merrill <jason@redhat.com>
1127 PR c++/78771 - ICE with inherited constructor.
1128 * call.c (build_over_call): Call deduce_inheriting_ctor here.
1129 * pt.c (tsubst_decl): Not here.
1130 * class.c (add_method): Or here.
1131 * method.c (deduce_inheriting_ctor): Handle clones.
1132 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
1134 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
1137 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
1139 * cp/cp-tree.h: Declare it.
1140 * cp/semantics.c (finish_id_expression): Resolve names within a default
1141 capturing generic lambda defined within a template prior to
1142 instantiation to allow for captures to be added to the closure type.
1144 2017-01-26 Jakub Jelinek <jakub@redhat.com>
1147 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
1148 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
1149 * parser.c (cp_parser_builtin_offsetof): Pass result of
1150 build_static_cast of null_pointer_node to finish_offsetof.
1151 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
1152 it for -Winvalid-offsetof pedwarn instead of trying to guess
1153 original offsetof type from EXPR. Save OBJECT_PTR as a new
1154 second operand to OFFSETOF_EXPR.
1155 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
1156 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
1159 2017-01-26 Jason Merrill <jason@redhat.com>
1161 * name-lookup.c (parse_using_directive): Deprecate strong using.
1163 PR c++/79176 - lambda ICE with -flto -Os
1164 * decl2.c (vague_linkage_p): Handle decloned 'tors.
1165 * tree.c (decl_linkage): Likewise.
1167 2017-01-25 Martin Sebor <msebor@redhat.com>
1169 * decl.c (grokdeclarator): Fix a typo in a comment.
1171 2017-01-25 Jakub Jelinek <jakub@redhat.com>
1174 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
1178 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
1179 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
1181 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
1184 * decl.c (cxx_init_decl_processing): Pass main_input_filename
1185 to build_translation_unit_decl.
1187 2017-01-24 Jakub Jelinek <jakub@redhat.com>
1190 * cp-gimplify.c (cp_genericize_r): Add result of
1191 convert_from_reference on invisiref parm to p_set.
1193 2017-01-24 Nathan Sidwell <nathan@acm.org>
1195 PR c++/78469 - defaulted ctor and inaccessible dtor
1196 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
1197 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
1198 * tree.c (build_target_expr): Check tf_no_cleanup.
1200 PR c++/79118 - anon-members and constexpr
1201 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
1202 ctor decl. Recursively check anonymous members.
1203 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
1205 (explain_invalid_constexpr_fn): Likewise.
1207 2017-01-23 Nathan Sidwell <nathan@acm.org>
1209 PR c++/71710 - template using directive of field
1210 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
1213 PR c++/71406 - ICE with scope-ref'd template id exprs
1215 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
1216 before breaking up TEMPLATE_ID_EXPR.
1218 2017-01-20 Nathan Sidwell <nathan@acm.org>
1220 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
1221 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
1223 2017-01-20 David Malcolm <dmalcolm@redhat.com>
1227 * cp-tree.h (suggest_alternatives_for): Add bool param.
1228 (suggest_alternative_in_explicit_scope): New decl.
1229 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
1230 that isn't the global one, call new function
1231 suggest_alternative_in_explicit_scope, only calling
1232 suggest_alternatives_for if it fails, and disabling near match
1233 searches fort that case. When SCOPE is the global namespace,
1234 pass true for new param to suggest_alternatives_for to allow for
1236 * lex.c (unqualified_name_lookup_error): Pass true for new param
1237 to suggest_alternatives_for.
1238 * name-lookup.c (consider_binding_level): Add forward decl.
1239 (suggest_alternatives_for): Add "suggest_misspellings" param,
1240 using it to conditionalize the fuzzy name-lookup code.
1241 (suggest_alternative_in_explicit_scope): New function.
1242 * parser.c (cp_parser_primary_expression): When calling
1243 finish_id_expression, pass location of id_expression rather
1244 than that of id_expr_token.
1245 (cp_parser_id_expression): Convert local "unqualified_id" from
1246 tree to cp_expr to avoid implicitly dropping location information.
1248 2017-01-20 Marek Polacek <polacek@redhat.com>
1251 * call.c (build_conditional_expr_1): Warn about duplicated branches.
1252 * semantics.c (finish_expr_stmt): Build statement using the proper
1255 2017-01-19 Jason Merrill <jason@redhat.com>
1257 US 20 - forwarding references and class template argument deduction
1258 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
1259 * pt.c (push_template_decl_real): Set it.
1260 (maybe_adjust_types_for_deduction): Check it.
1261 (rewrite_template_parm): Copy it.
1263 US 19 - deduction guides and constructors
1264 * call.c (joust): Prefer deduction guides to constructors.
1265 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
1266 (deduction_guide_p): Check DECL_P.
1268 * decl.c (check_initializer): Always use build_aggr_init for array
1271 PR c++/79130 - decomposition and direct-initialization
1272 * init.c (build_aggr_init): Communicate direct-initialization to
1274 (build_vec_init): Check for array copy sooner.
1275 * parser.c (cp_parser_decomposition_declaration): Remove call to
1276 build_x_compound_expr_from_list.
1278 2017-01-18 Jason Merrill <jason@redhat.com>
1280 PR c++/68666 - member variable template-id
1281 * typeck.c (finish_class_member_access_expr): Handle variable
1283 * pt.c (lookup_and_finish_template_variable): No longer static.
1284 * cp-tree.h: Declare it.
1286 2017-01-18 Nathan Sidwell <nathan@acm.org>
1289 * call.c (build_over_call): When checking ellipsis conversions for
1290 an inherited ctor, make sure there is at least one conversion.
1292 2017-01-18 Jason Merrill <jason@redhat.com>
1294 PR c++/78894 - ICE with class deduction and default arg
1295 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
1297 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
1300 * mangle.c (write_discriminator): Reorganize abi warning check.
1302 2017-01-18 Nathan Sidwell <nathan@acm.org>
1304 * cp-tree.h: Clarify exception spec node comment.
1305 * except.c (nothrow_spec_p): Simplify by checking node-equality.
1308 * mangle.c (write_exception_spec): Check nothrow explicitly.
1309 (write_encoding): Don't increment processing_template_decl around
1312 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
1315 * mangle.c (write_template_args): Add "on" for operator names.
1317 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
1320 * mangle.c (write_discriminator): Handle discriminator >= 10.
1322 2017-01-17 Nathan Sidwell <nathan@acm.org>
1325 * cp-tree.h (maybe_generic_this_capture): Declare.
1326 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
1327 (maybe_resolve_dummy): ... here. Call it.
1328 (maybe_generic_this_capture): New.
1329 * parser.c (cp_parser_postfix_expression): Speculatively capture
1330 this in generic lambda in unresolved member function call.
1331 * pt.c (tsubst_copy_and_build): Force hard error from failed
1332 member function lookup in generic lambda.
1334 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
1337 * cp-array-notation.c (expand_array_notation_exprs): Handle
1340 2017-01-11 Jason Merrill <jason@redhat.com>
1342 PR c++/78337 - ICE on invalid with generic lambda
1343 * semantics.c (process_outer_var_ref): Check if containing_function
1344 is null. Move inform call under complain test.
1346 2017-01-11 Nathan Sidwell <nathan@acm.org>
1349 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
1352 2017-01-11 Nathan Sidwell <nathan@acm.org>
1354 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
1356 2017-01-11 Jakub Jelinek <jakub@redhat.com>
1359 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
1360 assertion. Formatting fix.
1363 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
1366 2017-01-10 David Malcolm <dmalcolm@redhat.com>
1369 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
1370 a missing semicolon if we have a valid insertion location for
1373 2017-01-10 Jason Merrill <jason@redhat.com>
1375 FI 20, decomposition declaration with parenthesized initializer.
1376 * parser.c (cp_parser_decomposition_declaration): Use
1377 cp_parser_initializer.
1379 2017-01-09 Jason Merrill <jason@redhat.com>
1381 Implement P0195R2, C++17 variadic using.
1382 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
1383 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
1384 * error.c (dump_decl): Likewise.
1386 2017-01-09 Jakub Jelinek <jakub@redhat.com>
1388 PR translation/79019
1389 PR translation/79020
1390 * semantics.c (finish_omp_clauses): Add missing whitespace to
1391 translatable strings.
1392 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
1394 2017-01-07 Jason Merrill <jason@redhat.com>
1396 PR c++/78948 - instantiation from discarded statement
1397 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
1398 * cp-tree.h (in_discarded_stmt): Declare it.
1399 (struct saved_scope): Add discarded_stmt bitfield.
1400 (in_discarded_stmt): New macro.
1401 * decl2.c (mark_used): Check it.
1402 * parser.c (cp_parser_selection_statement): Adjust.
1403 (cp_parser_jump_statement): Adjust.
1405 2017-01-05 Jakub Jelinek <jakub@redhat.com>
1408 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
1409 REFERENCE_REF_P, set tt to its operand.
1412 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
1413 unions even for C++11 and later.
1415 2017-01-05 Nathan Sidwell <nathan@acm.org>
1418 * pt.c (convert_nontype_argument): Don't try and see if integral
1419 or enum expressions are constants prematurely.
1421 2017-01-04 Marek Polacek <polacek@redhat.com>
1424 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
1425 a zero character literal.
1427 2017-01-04 Jakub Jelinek <jakub@redhat.com>
1430 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
1434 * parser.c (cp_parser_simple_declaration): Only complain about
1435 inconsistent auto deduction if auto_result doesn't use auto.
1437 * parser.c (cp_parser_simple_declaration): Diagnose function
1438 declaration among more than one init-declarators with auto
1442 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
1443 assertion, as lexer->buffer may be NULL.
1445 2017-01-04 Marek Polacek <polacek@redhat.com>
1449 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
1451 2017-01-04 Nathan Sidwell <nathan@acm.org>
1454 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
1455 (lambda_capture_field_type): Update prototype.
1456 * lambda.c (lambda_capture_field_type): Add is_reference parm.
1457 Add referenceness here.
1458 (add_capture): Adjust lambda_capture_field_type call, refactor
1460 * pt.c (tsubst): Adjust lambda_capture_field_type call.
1462 2017-01-01 Jakub Jelinek <jakub@redhat.com>
1464 Update copyright years.
1466 Copyright (C) 2017 Free Software Foundation, Inc.
1468 Copying and distribution of this file, with or without modification,
1469 are permitted in any medium without royalty provided the copyright
1470 notice and this notice are preserved.