1 2017-03-06 Marek Polacek <polacek@redhat.com>
3 PR c++/79796 - ICE with NSDMI and this pointer
4 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
7 2017-03-06 Jakub Jelinek <jakub@redhat.com>
10 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
13 2017-03-06 Jason Merrill <jason@redhat.com>
15 Revert "Allow deduction guides to look into primary template."
16 * cp-tree.h, parser.c, pt.c, search.c: Revert.
18 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
21 * except.c (build_must_not_throw_expr): Perform the implicit
22 conversions on the condition.
24 2017-03-03 Jason Merrill <jason@redhat.com>
26 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
29 Core issues 2273 and 2277
30 * call.c (joust): Adjust using-declaration tiebreaker to handle
31 the intermediate base case.
32 * method.c (strip_inheriting_ctors): Just return the argument if
33 !flag_new_inheriting_ctors.
35 2017-03-03 Richard Biener <rguenther@suse.de>
38 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
40 2017-03-03 Marek Polacek <polacek@redhat.com>
43 * typeck.c (string_conv_p): In C++11, always call pedwarn with
46 2017-03-02 Jason Merrill <jason@redhat.com>
48 Update overload resolution with deduction guides.
49 * pt.c (do_class_deduction): Always build the copy guide.
50 (copy_guide_p, template_guide_p): New.
51 (build_deduction_guide): Remember the original constructor.
52 * call.c (joust): Prefer the copy guide and non-template guides.
54 Allow deduction guides to look into primary template.
55 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
56 (struct cp_decl_specifier_seq): Add constructor_p.
57 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
58 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
59 Clear deduction_guide_type. Don't handle deduction guide names.
60 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
61 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
62 (cp_parser_member_declaration, cp_parser_cache_defarg)
63 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
64 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
65 (build_deduction_guide): Set deduction_guide_type.
66 (dependent_scope_p): Check deduction_guide_type.
67 * search.c (lookup_member): Likewise.
69 2017-03-02 Jakub Jelinek <jakub@redhat.com>
72 * init.c (mark_exp_read_r): New function.
73 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
74 whole arguments instead of plain mark_exp_read on TREE_LIST values.
76 2017-03-01 Jason Merrill <jason@redhat.com>
78 Class template argument deduction in new-expression
79 * init.c (build_new): Handle deduction from no initializer.
80 * parser.c (cp_parser_new_expression): Don't require a single
81 expression for class template deduction.
82 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
83 class template placeholder.
84 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
85 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
86 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
88 2017-03-01 Jakub Jelinek <jakub@redhat.com>
91 * init.c (emit_mem_initializers): When not constructing vbases of
92 abstract classes, mark arguments as read for
93 -Wunused-but-set-parameter.
95 2017-02-28 Jason Merrill <jason@redhat.com>
97 Class template argument deduction refinements
98 * call.c (joust): Move deduction guide tiebreaker down.
99 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
100 deduction with no initializer.
101 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
102 (do_class_deduction): Use that rather than special case.
103 (do_auto_deduction): Handle null initializer.
105 2017-02-28 Jakub Jelinek <jakub@redhat.com>
107 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
108 instead of just cond ? "..." : "...".
109 (grokdeclarator): Likewise.
110 (build_enumerator): Likewise.
111 * init.c (build_new_1): Likewise.
112 * call.c (build_new_method_call_1): Likewise.
113 * parser.c: Include intl.h.
114 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
115 "enter"/"exit" keyword.
116 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
119 2017-02-27 Jason Merrill <jason@redhat.com>
121 PR c++/71568 - SFINAE forming pointer to member function
122 * init.c (build_offset_ref): Check the return value of
123 perform_or_defer_access_check.
125 2017-02-27 Marek Polacek <polacek@redhat.com>
127 * decl.c (expand_static_init): Add missing } in a comment.
129 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
131 * init.c: Include intl.h.
132 (build_new_1): Move message strings into pedwarn to make them
133 -Wformat-security friendly. Mark string for translation.
134 * pt.c (tsubst_copy_and_build): Mark string for translation.
135 Make the pointer const.
136 * semantics.c (finish_id_expression): Mark strings for translation.
138 2017-02-25 Jakub Jelinek <jakub@redhat.com>
140 * call.c (build_op_delete_call): Make msg1 and msg2 const.
142 2017-02-24 Jakub Jelinek <jakub@redhat.com>
145 * call.c (build_over_call): Call check_function_arguments even for
146 -Wrestrict, adjust check_function_arguments caller.
147 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
149 * typeck.c (cp_build_function_call_vec): Adjust
150 check_function_arguments caller.
152 2017-02-24 Marek Polacek <polacek@redhat.com>
155 * decl.c (check_redeclaration_exception_specification): Mark a string
156 for translation. Make the pointer const.
158 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
161 * pt.c (register_specialization): Check duplicate_decls return value
162 for error_mark_node and pass it back.
164 2017-02-22 Jason Merrill <jason@redhat.com>
166 PR c++/79679 - missing destructor for argument
167 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
170 * pt.c (do_class_deduction): Handle 0 argument case.
172 2017-02-22 Jakub Jelinek <jakub@redhat.com>
175 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
176 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
177 * constexpr.c (potential_constant_expression_1): Handle
178 OMP_*, OACC_* and CILK_* trees. Use error_at with
179 EXPR_LOC_OR_LOC (t, input_location) computed early
180 instead of error, or error_at with location_of (t).
182 2017-02-22 Marek Polacek <polacek@redhat.com>
185 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
186 if the alignas expression is erroneous.
187 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
191 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
193 2017-02-21 Jason Merrill <jason@redhat.com>
195 PR c++/50308 - wrong deprecated warning with ADL
196 PR c++/17729 - duplicate deprecated warning
197 * semantics.c (finish_id_expression): Only call mark_used on a
198 function if we aren't building a call.
200 PR c++/41727 - ICE with partial spec of partial instantiation
201 * pt.c (process_partial_specialization): For now, don't check more
202 specialized if there is more than one level of args.
204 2017-02-21 Marek Polacek <polacek@redhat.com>
207 * cp-tree.h (maybe_reject_flexarray_init): Declare.
208 * init.c (maybe_reject_flexarray_init): No longer static.
209 Add check for current_function_decl.
210 * parser.c (cp_parser_late_parse_one_default_arg): Reject
211 a default mem-initializer for a flexible array.
213 2017-02-21 Jakub Jelinek <jakub@redhat.com>
214 Paolo Carlini <paolo.carlini@oracle.com>
217 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
219 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
220 decl after the decomposition artificial decl has error_mark_node.
221 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
222 instead of just == error_mark_node comparison.
224 2017-02-21 Jakub Jelinek <jakub@redhat.com>
227 * decl.c: Include gimplify.h.
228 (cp_finish_decomp): Make sure there is no sharing of trees
229 in between DECL_VALUE_EXPR of decomposition decls.
232 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
235 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
236 call cplus_expand_constant on it first.
238 2017-02-19 Jason Merrill <jason@redhat.com>
240 PR c++/78139 - destructor needed by new-expression
241 * call.c (build_special_member_call): Use tf_no_cleanup.
243 PR c++/78282 - auto template and pack expansion
244 * pt.c (find_parameter_packs_r): Don't walk into the type of
245 templates other than template template-parameters.
247 PR c++/79606 - ICE with this->base_member in NSDMI
248 * class.c (build_base_path): Check processing_template_decl.
250 PR c++/79607 - ICE with T{} initializer
251 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
253 PR c++/79566 - elaborated-type-specifier in range for
254 * parser.c (cp_parser_simple_declaration): Fix check for type
257 PR c++/79400 - confusing suggestion of 'noexcept'
258 * parser.c (cp_parser_exception_specification_opt): Remove
259 suggestion for deprecated dynamic exception-specification.
261 PR c++/79470 - partial ordering with reference parameters
262 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
264 PR c++/79500 - ICE with non-template deduction guide
265 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
266 DECL_TEMPLATE_RESULT.
268 PR c++/79580 - ICE with compound literal
269 * parser.c (cp_parser_class_head): If we're in the middle of an
270 expression, use ts_within_enclosing_non_class.
272 PR c++/79503 - inherited ctor taking base class
273 * call.c (add_function_candidate): Also check that
274 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
276 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
279 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
282 2017-02-19 Eric Fiselier <eric@efcs.ca>
283 Jonathan Wakely <jwakely@redhat.com>
286 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
287 control warning about literal suffix identifiers without a leading
290 2017-02-17 Jason Merrill <jason@redhat.com>
292 PR c++/79508 - lookup error with member template
293 * parser.c (cp_parser_template_name): Clear
294 parser->context->object_type if we aren't doing lookup.
296 PR c++/78690 - ICE with using and global type with same name
297 * pt.c (type_dependent_object_expression_p): True for
300 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
301 * pt.c (convert_template_argument): Just return an auto arg pack.
302 (tsubst_template_args): Don't tsubst an auto pack type.
304 PR c++/79556 - C++17 ICE with non-type auto
305 * pt.c (do_auto_deduction): Don't try to deduce from null type.
307 PR c++/79533 - C++17 ICE with temporary cast to reference
308 * call.c (build_over_call): Conversion to a reference prevents copy
311 2017-02-16 Jakub Jelinek <jakub@redhat.com>
312 Jason Merrill <jason@redhat.com>
314 PR c++/79502 - lost nodiscard attribute
315 * pt.c (apply_late_template_attributes): Do apply non-dependent
318 2017-02-16 Jason Merrill <jason@redhat.com>
320 PR c++/78572 - ICE with self-modifying array initializer
321 * constexpr.c (cxx_eval_store_expression): The object we're
322 initializing is outside the constant-expression.
323 (cxx_eval_call_expression): Set ctx->call.
325 PR c++/79050 - ICE with undeduced auto and LTO
326 * decl.c (poplevel): Remove undeduced auto decls.
328 2017-02-16 Jakub Jelinek <jakub@redhat.com>
331 * parser.c (cp_parser_omp_target): For -fopenmp-simd
332 ignore #pragma omp target even when not followed by identifier.
334 2017-02-15 Jason Merrill <jason@redhat.com>
335 Jakub Jelinek <jakub@redhat.com>
337 PR c++/79464 - ICE in IPA with omitted constructor parms
338 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
339 (adjust_clone_args): Adjust.
340 (add_method): Remember omitted parms.
341 * call.c (add_function_candidate): Likewise.
342 * mangle.c (write_method_parms): Likewise.
343 * method.c (ctor_omit_inherited_parms): Return false if there are no
346 2017-02-15 Martin Sebor <msebor@redhat.com>
349 * init.c (maybe_reject_flexarray_init): New function.
350 (perform_member_init): Call it.
352 2017-02-15 Jakub Jelinek <jakub@redhat.com>
355 * parser.c (cp_parser_std_attribute): Don't pedwarn about
356 [[deprecated]] with -std=c++11 and [[fallthrough]] with
357 -std=c++11 and -std=c++14.
360 * decl.c (grokdeclarator): For static data members, handle thread_p
361 only after handling inline.
363 2017-02-14 Marek Polacek <polacek@redhat.com>
367 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
368 clobbering if the postfix expression isn't an EXPR_P.
370 2017-02-13 Jason Merrill <jason@redhat.com>
372 PR c++/79461 - ICE with lambda in constexpr constructor
373 * constexpr.c (build_data_member_initialization): Ignore
374 initialization of a local variable.
376 2017-02-13 Jakub Jelinek <jakub@redhat.com>
378 * init.c (warn_placement_new_too_small): Add missing space in
380 * parser.c (cp_parser_oacc_declare): Likewise.
381 * mangle.c (maybe_check_abi_tags): Likewise.
384 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
385 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
386 in the rightmost operand.
388 2017-02-13 Nathan Sidwell <nathan@acm.org>
390 PR c++/79296 - ICE mangling localized template instantiation
391 * decl2.c (determine_visibility): Use template fn context for
392 local class instantiations.
394 2017-02-11 Jason Merrill <jason@redhat.com>
396 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
397 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
398 (build_new_1): Use replace_placeholders.
399 * tree.c (replace_placeholders_t): Also track whether we've seen a
401 (replace_placeholders, replace_placeholders_r): Adjust.
404 PR c++/77790 - ICE with auto function in C++11 mode
405 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
406 (require_deduced_type): Add complain parm, return bool.
408 * decl2.c (mark_used): Use require_deduced_type.
410 2017-02-10 Jason Merrill <jason@redhat.com>
412 PR c++/78908 - template ops and bitfields
413 * tree.c (build_min_non_dep): Use unlowered_expr_type.
415 PR c++/78897 - constexpr union
416 * constexpr.c (cxx_eval_store_expression): A store to a union member
417 erases a previous store to another member.
419 PR c++/71285 - member of fold-expression
420 * semantics.c (finish_unary_fold_expr)
421 (finish_binary_fold_expr): Use null type for fold-expressions.
423 PR c++/79401 - protected inherited constructor
424 * call.c (enforce_access): For inheriting constructor, find a base
425 binfo in the path we already have.
427 2017-02-10 Marek Polacek <polacek@redhat.com>
430 * pt.c (type_dependent_expression_p): Check if the expression type
434 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
435 if warnings shouldn't be given.
437 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
440 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
441 an error_mark_node as type.
443 2017-02-09 Jakub Jelinek <jakub@redhat.com>
444 Jason Merrill <jason@redhat.com>
447 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
448 from pattern to type.
450 2017-02-09 Jason Merrill <jason@redhat.com>
452 PR c++/79316 - default argument in deduction guide
453 PR c++/79350 - explicit deduction guide
454 * parser.c (cp_parser_constructor_declarator_p)
455 (cp_parser_direct_declarator): Parse deduction guides more like
457 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
458 * tree.c (special_function_p): Return it.
459 * decl.c (check_special_function_return_type): Handle it.
460 (grokdeclarator, grokfndecl): Adjust.
461 (cp_finish_decl): Pass flags to do_auto_deduction.
462 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
463 * pt.c (dguide_name_p): Take a const_tree.
464 (do_class_deduction): Handle explicit.
465 (do_auto_deduction): Pass flags through.
466 (build_deduction_guide): Copy explicit flag.
468 2017-02-09 Jakub Jelinek <jakub@redhat.com>
471 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
472 non-pragma_compound context here.
473 (cp_parser_omp_target): Likewise.
474 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
475 parsing for ordered and target omp pragmas in non-pragma_stmt
476 non-pragma_compound contexts.
479 * parser.c (cp_parser_oacc_declare): Formatting fix.
480 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
483 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
484 Chung-Lin Tang <cltang@codesourcery.com>
486 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
487 parsing. Parse constant expression. Remove semantic checking.
488 (cp_parser_omp_clause_collapse): Disallow tile.
489 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
490 error about missing for after already emitting one. Use more
491 conventional for idiom for unbounded loop.
492 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
493 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
494 (finish_omp_for): Deal with tile clause.
496 2017-02-07 Nathan Sidwell <nathan@acm.org>
498 * method.c (synthesized_method_base_walk): New. Broken out of ...
499 (synthesized_method_walk): ... here. Call it. Cleanup
502 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
505 * typeck2.c (process_init_constructor_union): Consider only
506 FIELD_DECLs when looking for an NSDMI.
508 2017-02-06 Jason Merrill <jason@redhat.com>
510 PR c++/71193 - incomplete types in templates
511 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
512 handle incomplete type by pedwarning and then treating as dependent.
514 2017-02-06 Jakub Jelinek <jakub@redhat.com>
517 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
518 (potential_constant_expression_1): Likewise.
521 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
522 allow one fewer than expected arguments if flag_permissive.
525 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
526 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
527 with error_mark_node type.
529 2017-02-03 Jason Merrill <jason@redhat.com>
531 PR c++/78689 - ICE on constructor with label
532 * optimize.c (maybe_clone_body): Replace omitted parameters with
534 * class.c (build_clone): Fix logic for omitting inherited parms.
536 PR c++/12245 - excessive memory use
537 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
538 back in. Don't cache constants.
539 (maybe_constant_init): Don't cache constants.
541 PR c++/79294 - ICE with invalid template argument
542 * pt.c (convert_nontype_argument_function): Check value-dependence.
543 (convert_nontype_argument): Don't check it here for function ptrs.
545 2017-02-02 Richard Biener <rguenther@suse.de>
548 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
549 it lazily on the first changed element only and copy it
550 fully upfront, only storing changed elements.
552 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
555 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
558 2017-01-31 Jakub Jelinek <jakub@redhat.com>
561 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
564 2017-01-31 David Malcolm <dmalcolm@redhat.com>
567 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
568 any namespace aliases.
570 2017-01-31 Nathan Sidwell <nathan@acm.org>
573 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
577 * pt.c: (instantiate_decl): Push to top level when current
578 function scope doesn't match. Only push lmabda scope stack when
581 * cp-tree.h (instantiate_decl): Make defer_ok bool.
582 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
583 (instantiate_decl): Simplify and reorder state saving and restoration.
586 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
587 * semantics.c (finish_member_declaration): Assert class is being
590 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
592 Introduce C++ support in libcc1.
593 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
594 (ansi_opname): Rename to...
595 (cp_operator_id): ... this. Adjust all callers.
596 (ansi_assopname): Rename to...
597 (cp_assignment_operator_id): ... this. Adjust all callers.
598 (cp_literal_operator_id): Declare.
599 (set_global_friend): Declare.
600 (is_global_friend): Declare.
601 (enum cp_oracle_request): New type.
602 (cp_binding_oracle_function): New type.
603 (cp_binding_oracle): Declare.
604 (cp_finish_injected_record_type): Declare.
605 * friend.c (global_friend): New var.
606 (set_global_friend): New fn.
607 (is_global_friend): New fn.
608 (is_friend): Call is_global_friend.
609 * name-lookup.c (cp_binding_oracle): New var.
610 (query_oracle): New fn.
611 (qualified_lookup_using_namespace): Call query_oracle.
612 (lookup_name_real_1): Likewise.
613 * parser.c (cp_literal_operator_id): Drop static.
614 * search.c (friend_accessible_p): Call is_global_friend.
615 * semantics.c (is_this_parameter): Accept a variable if the
616 binding oracle is enabled.
618 2017-01-27 Jason Merrill <jason@redhat.com>
620 PR c++/78771 - ICE with inherited constructor.
621 * call.c (build_over_call): Call deduce_inheriting_ctor here.
622 * pt.c (tsubst_decl): Not here.
623 * class.c (add_method): Or here.
624 * method.c (deduce_inheriting_ctor): Handle clones.
625 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
627 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
630 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
632 * cp/cp-tree.h: Declare it.
633 * cp/semantics.c (finish_id_expression): Resolve names within a default
634 capturing generic lambda defined within a template prior to
635 instantiation to allow for captures to be added to the closure type.
637 2017-01-26 Jakub Jelinek <jakub@redhat.com>
640 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
641 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
642 * parser.c (cp_parser_builtin_offsetof): Pass result of
643 build_static_cast of null_pointer_node to finish_offsetof.
644 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
645 it for -Winvalid-offsetof pedwarn instead of trying to guess
646 original offsetof type from EXPR. Save OBJECT_PTR as a new
647 second operand to OFFSETOF_EXPR.
648 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
649 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
652 2017-01-26 Jason Merrill <jason@redhat.com>
654 * name-lookup.c (parse_using_directive): Deprecate strong using.
656 PR c++/79176 - lambda ICE with -flto -Os
657 * decl2.c (vague_linkage_p): Handle decloned 'tors.
658 * tree.c (decl_linkage): Likewise.
660 2017-01-25 Martin Sebor <msebor@redhat.com>
662 * decl.c (grokdeclarator): Fix a typo in a comment.
664 2017-01-25 Jakub Jelinek <jakub@redhat.com>
667 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
671 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
672 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
674 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
677 * decl.c (cxx_init_decl_processing): Pass main_input_filename
678 to build_translation_unit_decl.
680 2017-01-24 Jakub Jelinek <jakub@redhat.com>
683 * cp-gimplify.c (cp_genericize_r): Add result of
684 convert_from_reference on invisiref parm to p_set.
686 2017-01-24 Nathan Sidwell <nathan@acm.org>
688 PR c++/78469 - defaulted ctor and inaccessible dtor
689 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
690 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
691 * tree.c (build_target_expr): Check tf_no_cleanup.
693 PR c++/79118 - anon-members and constexpr
694 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
695 ctor decl. Recursively check anonymous members.
696 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
698 (explain_invalid_constexpr_fn): Likewise.
700 2017-01-23 Nathan Sidwell <nathan@acm.org>
702 PR c++/71710 - template using directive of field
703 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
706 PR c++/71406 - ICE with scope-ref'd template id exprs
708 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
709 before breaking up TEMPLATE_ID_EXPR.
711 2017-01-20 Nathan Sidwell <nathan@acm.org>
713 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
714 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
716 2017-01-20 David Malcolm <dmalcolm@redhat.com>
720 * cp-tree.h (suggest_alternatives_for): Add bool param.
721 (suggest_alternative_in_explicit_scope): New decl.
722 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
723 that isn't the global one, call new function
724 suggest_alternative_in_explicit_scope, only calling
725 suggest_alternatives_for if it fails, and disabling near match
726 searches fort that case. When SCOPE is the global namespace,
727 pass true for new param to suggest_alternatives_for to allow for
729 * lex.c (unqualified_name_lookup_error): Pass true for new param
730 to suggest_alternatives_for.
731 * name-lookup.c (consider_binding_level): Add forward decl.
732 (suggest_alternatives_for): Add "suggest_misspellings" param,
733 using it to conditionalize the fuzzy name-lookup code.
734 (suggest_alternative_in_explicit_scope): New function.
735 * parser.c (cp_parser_primary_expression): When calling
736 finish_id_expression, pass location of id_expression rather
737 than that of id_expr_token.
738 (cp_parser_id_expression): Convert local "unqualified_id" from
739 tree to cp_expr to avoid implicitly dropping location information.
741 2017-01-20 Marek Polacek <polacek@redhat.com>
744 * call.c (build_conditional_expr_1): Warn about duplicated branches.
745 * semantics.c (finish_expr_stmt): Build statement using the proper
748 2017-01-19 Jason Merrill <jason@redhat.com>
750 US 20 - forwarding references and class template argument deduction
751 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
752 * pt.c (push_template_decl_real): Set it.
753 (maybe_adjust_types_for_deduction): Check it.
754 (rewrite_template_parm): Copy it.
756 US 19 - deduction guides and constructors
757 * call.c (joust): Prefer deduction guides to constructors.
758 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
759 (deduction_guide_p): Check DECL_P.
761 * decl.c (check_initializer): Always use build_aggr_init for array
764 PR c++/79130 - decomposition and direct-initialization
765 * init.c (build_aggr_init): Communicate direct-initialization to
767 (build_vec_init): Check for array copy sooner.
768 * parser.c (cp_parser_decomposition_declaration): Remove call to
769 build_x_compound_expr_from_list.
771 2017-01-18 Jason Merrill <jason@redhat.com>
773 PR c++/68666 - member variable template-id
774 * typeck.c (finish_class_member_access_expr): Handle variable
776 * pt.c (lookup_and_finish_template_variable): No longer static.
777 * cp-tree.h: Declare it.
779 2017-01-18 Nathan Sidwell <nathan@acm.org>
782 * call.c (build_over_call): When checking ellipsis conversions for
783 an inherited ctor, make sure there is at least one conversion.
785 2017-01-18 Jason Merrill <jason@redhat.com>
787 PR c++/78894 - ICE with class deduction and default arg
788 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
790 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
793 * mangle.c (write_discriminator): Reorganize abi warning check.
795 2017-01-18 Nathan Sidwell <nathan@acm.org>
797 * cp-tree.h: Clarify exception spec node comment.
798 * except.c (nothrow_spec_p): Simplify by checking node-equality.
801 * mangle.c (write_exception_spec): Check nothrow explicitly.
802 (write_encoding): Don't increment processing_template_decl around
805 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
808 * mangle.c (write_template_args): Add "on" for operator names.
810 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
813 * mangle.c (write_discriminator): Handle discriminator >= 10.
815 2017-01-17 Nathan Sidwell <nathan@acm.org>
818 * cp-tree.h (maybe_generic_this_capture): Declare.
819 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
820 (maybe_resolve_dummy): ... here. Call it.
821 (maybe_generic_this_capture): New.
822 * parser.c (cp_parser_postfix_expression): Speculatively capture
823 this in generic lambda in unresolved member function call.
824 * pt.c (tsubst_copy_and_build): Force hard error from failed
825 member function lookup in generic lambda.
827 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
830 * cp-array-notation.c (expand_array_notation_exprs): Handle
833 2017-01-11 Jason Merrill <jason@redhat.com>
835 PR c++/78337 - ICE on invalid with generic lambda
836 * semantics.c (process_outer_var_ref): Check if containing_function
837 is null. Move inform call under complain test.
839 2017-01-11 Nathan Sidwell <nathan@acm.org>
842 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
845 2017-01-11 Nathan Sidwell <nathan@acm.org>
847 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
849 2017-01-11 Jakub Jelinek <jakub@redhat.com>
852 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
853 assertion. Formatting fix.
856 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
859 2017-01-10 David Malcolm <dmalcolm@redhat.com>
862 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
863 a missing semicolon if we have a valid insertion location for
866 2017-01-10 Jason Merrill <jason@redhat.com>
868 FI 20, decomposition declaration with parenthesized initializer.
869 * parser.c (cp_parser_decomposition_declaration): Use
870 cp_parser_initializer.
872 2017-01-09 Jason Merrill <jason@redhat.com>
874 Implement P0195R2, C++17 variadic using.
875 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
876 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
877 * error.c (dump_decl): Likewise.
879 2017-01-09 Jakub Jelinek <jakub@redhat.com>
883 * semantics.c (finish_omp_clauses): Add missing whitespace to
884 translatable strings.
885 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
887 2017-01-07 Jason Merrill <jason@redhat.com>
889 PR c++/78948 - instantiation from discarded statement
890 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
891 * cp-tree.h (in_discarded_stmt): Declare it.
892 (struct saved_scope): Add discarded_stmt bitfield.
893 (in_discarded_stmt): New macro.
894 * decl2.c (mark_used): Check it.
895 * parser.c (cp_parser_selection_statement): Adjust.
896 (cp_parser_jump_statement): Adjust.
898 2017-01-05 Jakub Jelinek <jakub@redhat.com>
901 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
902 REFERENCE_REF_P, set tt to its operand.
905 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
906 unions even for C++11 and later.
908 2017-01-05 Nathan Sidwell <nathan@acm.org>
911 * pt.c (convert_nontype_argument): Don't try and see if integral
912 or enum expressions are constants prematurely.
914 2017-01-04 Marek Polacek <polacek@redhat.com>
917 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
918 a zero character literal.
920 2017-01-04 Jakub Jelinek <jakub@redhat.com>
923 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
927 * parser.c (cp_parser_simple_declaration): Only complain about
928 inconsistent auto deduction if auto_result doesn't use auto.
930 * parser.c (cp_parser_simple_declaration): Diagnose function
931 declaration among more than one init-declarators with auto
935 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
936 assertion, as lexer->buffer may be NULL.
938 2017-01-04 Marek Polacek <polacek@redhat.com>
942 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
944 2017-01-04 Nathan Sidwell <nathan@acm.org>
947 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
948 (lambda_capture_field_type): Update prototype.
949 * lambda.c (lambda_capture_field_type): Add is_reference parm.
950 Add referenceness here.
951 (add_capture): Adjust lambda_capture_field_type call, refactor
953 * pt.c (tsubst): Adjust lambda_capture_field_type call.
955 2017-01-01 Jakub Jelinek <jakub@redhat.com>
957 Update copyright years.
959 Copyright (C) 2017 Free Software Foundation, Inc.
961 Copying and distribution of this file, with or without modification,
962 are permitted in any medium without royalty provided the copyright
963 notice and this notice are preserved.