1 2017-04-03 Jason Merrill <jason@redhat.com>
3 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
5 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
7 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
8 * decl2.c (one_static_initialization_or_destruction): Likewise.
9 * name-lookup.c (store_bindings): Likewise.
10 * parser.c (make_call_declarator): Likewise.
11 * pt.c (check_explicit_specialization): Likewise.
13 2017-04-03 Jason Merrill <jason@redhat.com>
15 PR sanitizer/79993 - ICE with VLA initialization from string
16 PR c++/69487 - wrong VLA initialization from string
17 * init.c (finish_length_check): Split out from build_vec_init.
18 (build_vec_init): Handle STRING_CST.
19 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
20 (digest_init_r): Don't give a STRING_CST VLA type.
22 2017-03-31 Jakub Jelinek <jakub@redhat.com>
25 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
26 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
27 for NOP_EXPR to REFERENCE_TYPE.
30 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
31 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
33 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
34 Remove extraneous parens.
35 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
36 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
37 (cp_parser_trait_expr): Likewise.
39 2017-03-27 Jakub Jelinek <jakub@redhat.com>
42 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
43 * typeck.c (cxx_mark_addressable): Likewise. Look through
44 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
46 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
48 2017-03-24 Jason Merrill <jason@redhat.com>
50 PR c++/77339 - ICE with invalid use of alias template.
51 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
54 2017-03-24 Marek Polacek <polacek@redhat.com>
57 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
58 doesn't have side effects.
60 2017-03-23 Jason Merrill <jason@redhat.com>
62 PR c++/80150 - ICE with overloaded variadic deduction.
63 * pt.c (try_one_overload): Remove asserts.
65 PR c++/77563 - missing ambiguous conversion error.
66 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
68 2017-03-23 Marek Polacek <polacek@redhat.com>
70 * cp-tree.h: Remove a C_RID_YYCODE reference.
72 2017-03-22 Jakub Jelinek <jakub@redhat.com>
75 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
76 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
77 processing_template_decl.
79 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
82 * name-lookup.c (pushtag_1): Add check for bogus, non template,
83 std::initializer_list.
85 2017-03-21 Jakub Jelinek <jakub@redhat.com>
88 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
90 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
93 * init.c (std_placement_new_fn_p): New.
94 (build_new_1): Call it.
96 2017-03-20 Jason Merrill <jason@redhat.com>
98 PR c++/80096 - ICE with C++17 non-type auto.
99 * pt.c (tsubst): Delay tsubst of type of template non-type
102 PR c++/79519 - ICE with deleted template friend.
103 * decl.c (grokdeclarator): Complain about misplaced function
104 definition using =, as well.
106 PR c++/79640 - infinite recursion with generic lambda.
107 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
108 before substituting its initializer.
110 2017-03-20 Marek Polacek <polacek@redhat.com>
111 Paolo Carlini <paolo.carlini@oracle.com>
113 PR c++/80059 - ICE with noexcept and __transaction_atomic
114 * except.c (build_must_not_throw_expr): Call
115 instantiate_non_dependent_expr.
117 2017-03-19 Jason Merrill <jason@redhat.com>
119 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
120 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
121 reference decomposition.
123 PR c++/80077 - error with constexpr and -fno-elide-constructors.
124 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
125 expanding trivial constructor.
127 2017-03-17 Jason Merrill <jason@redhat.com>
129 PR c++/78345 - ICE initializing array from lambda.
130 * init.c (build_aggr_init): Check array initializer.
131 (build_vec_init): Check the type of a CONSTRUCTOR.
133 PR c++/80073 - C++17 ICE with virtual base.
134 * decl.c (xref_basetypes): Also check for indirect vbases.
136 2017-03-16 Jason Merrill <jason@redhat.com>
138 * decl.c (start_enum): std::byte aliases anything.
141 * constexpr.c (lookup_placeholder): Tweak.
143 2017-03-15 Jason Merrill <jason@redhat.com>
145 PR c++/80043 - ICE with -fpermissive
146 * typeck.c (convert_for_assignment): Handle instantiate_type
149 2017-03-14 Nathan Sidwell <nathan@acm.org>
151 PR c++/79393 DR 1658 workaround
152 * method.c (synthesized_method_base_walk): Inihibit abstract class
153 virtual base access check here.
154 (synthesized_method_walk): Not here.
156 2017-03-13 Nathan Sidwell <nathan@acm.org>
158 PR c++/79393 DR 1658 workaround
159 * method.c (synthesized_method_walk): Check vbases of abstract
160 classes for dtor walk.
162 2017-03-10 David Malcolm <dmalcolm@redhat.com>
165 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
167 2017-03-10 Jason Merrill <jason@redhat.com>
169 PR c++/79960 - alias templates and partial ordering
170 * pt.c (comp_template_args): Add partial_order parm.
171 (template_args_equal): Likewise.
172 (comp_template_args_porder): New.
173 (get_partial_spec_bindings): Use it.
175 2017-03-10 Marek Polacek <polacek@redhat.com>
178 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
180 2017-03-10 Jakub Jelinek <jakub@redhat.com>
183 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
184 Use XALLOCAVEC macro.
187 * decl.c (finish_enum_value_list): If value is error_mark_node,
188 don't copy it and change its type.
189 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
190 of CONST_DECL is error_mark_node.
192 2017-03-09 Marek Polacek <polacek@redhat.com>
194 PR c++/79900 - ICE in strip_typedefs
195 * tree.c (strip_typedefs): Skip the attribute handling if T is
196 a variant type which hasn't been updated yet.
198 PR c++/79687 - wrong code with pointer-to-member
199 * init.c (constant_value_1): Break if the variable has a dynamic
202 2017-03-08 Jason Merrill <jason@redhat.com>
204 PR c++/79797 - ICE with self-reference in array DMI.
205 * constexpr.c (lookup_placeholder): Split out...
206 (cxx_eval_constant_expression): ...from here.
208 2017-03-07 Jakub Jelinek <jakub@redhat.com>
211 * parser.c (cp_parser_omp_cancellation_point,
212 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
213 cp_parser_omp_target_update): Change "may only be used in compound
214 statements" diagnostics, such that the same translatable string is
215 used for all pragmas.
216 (cp_parser_pragma): Likewise. Use error_at instead of
217 cp_parser_error for that diagnostics.
219 2017-03-06 Marek Polacek <polacek@redhat.com>
221 PR c++/79796 - ICE with NSDMI and this pointer
222 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
223 replace_placeholders.
225 2017-03-06 Jakub Jelinek <jakub@redhat.com>
228 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
231 2017-03-06 Jason Merrill <jason@redhat.com>
233 Revert "Allow deduction guides to look into primary template."
234 * cp-tree.h, parser.c, pt.c, search.c: Revert.
236 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
239 * except.c (build_must_not_throw_expr): Perform the implicit
240 conversions on the condition.
242 2017-03-03 Jason Merrill <jason@redhat.com>
244 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
247 Core issues 2273 and 2277
248 * call.c (joust): Adjust using-declaration tiebreaker to handle
249 the intermediate base case.
250 * method.c (strip_inheriting_ctors): Just return the argument if
251 !flag_new_inheriting_ctors.
253 2017-03-03 Richard Biener <rguenther@suse.de>
256 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
258 2017-03-03 Marek Polacek <polacek@redhat.com>
261 * typeck.c (string_conv_p): In C++11, always call pedwarn with
264 2017-03-02 Jason Merrill <jason@redhat.com>
266 Update overload resolution with deduction guides.
267 * pt.c (do_class_deduction): Always build the copy guide.
268 (copy_guide_p, template_guide_p): New.
269 (build_deduction_guide): Remember the original constructor.
270 * call.c (joust): Prefer the copy guide and non-template guides.
272 Allow deduction guides to look into primary template.
273 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
274 (struct cp_decl_specifier_seq): Add constructor_p.
275 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
276 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
277 Clear deduction_guide_type. Don't handle deduction guide names.
278 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
279 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
280 (cp_parser_member_declaration, cp_parser_cache_defarg)
281 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
282 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
283 (build_deduction_guide): Set deduction_guide_type.
284 (dependent_scope_p): Check deduction_guide_type.
285 * search.c (lookup_member): Likewise.
287 2017-03-02 Jakub Jelinek <jakub@redhat.com>
290 * init.c (mark_exp_read_r): New function.
291 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
292 whole arguments instead of plain mark_exp_read on TREE_LIST values.
294 2017-03-01 Jason Merrill <jason@redhat.com>
296 Class template argument deduction in new-expression
297 * init.c (build_new): Handle deduction from no initializer.
298 * parser.c (cp_parser_new_expression): Don't require a single
299 expression for class template deduction.
300 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
301 class template placeholder.
302 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
303 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
304 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
306 2017-03-01 Jakub Jelinek <jakub@redhat.com>
309 * init.c (emit_mem_initializers): When not constructing vbases of
310 abstract classes, mark arguments as read for
311 -Wunused-but-set-parameter.
313 2017-02-28 Jason Merrill <jason@redhat.com>
315 Class template argument deduction refinements
316 * call.c (joust): Move deduction guide tiebreaker down.
317 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
318 deduction with no initializer.
319 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
320 (do_class_deduction): Use that rather than special case.
321 (do_auto_deduction): Handle null initializer.
323 2017-02-28 Jakub Jelinek <jakub@redhat.com>
325 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
326 instead of just cond ? "..." : "...".
327 (grokdeclarator): Likewise.
328 (build_enumerator): Likewise.
329 * init.c (build_new_1): Likewise.
330 * call.c (build_new_method_call_1): Likewise.
331 * parser.c: Include intl.h.
332 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
333 "enter"/"exit" keyword.
334 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
337 2017-02-27 Jason Merrill <jason@redhat.com>
339 PR c++/71568 - SFINAE forming pointer to member function
340 * init.c (build_offset_ref): Check the return value of
341 perform_or_defer_access_check.
343 2017-02-27 Marek Polacek <polacek@redhat.com>
345 * decl.c (expand_static_init): Add missing } in a comment.
347 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
349 * init.c: Include intl.h.
350 (build_new_1): Move message strings into pedwarn to make them
351 -Wformat-security friendly. Mark string for translation.
352 * pt.c (tsubst_copy_and_build): Mark string for translation.
353 Make the pointer const.
354 * semantics.c (finish_id_expression): Mark strings for translation.
356 2017-02-25 Jakub Jelinek <jakub@redhat.com>
358 * call.c (build_op_delete_call): Make msg1 and msg2 const.
360 2017-02-24 Jakub Jelinek <jakub@redhat.com>
363 * call.c (build_over_call): Call check_function_arguments even for
364 -Wrestrict, adjust check_function_arguments caller.
365 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
367 * typeck.c (cp_build_function_call_vec): Adjust
368 check_function_arguments caller.
370 2017-02-24 Marek Polacek <polacek@redhat.com>
373 * decl.c (check_redeclaration_exception_specification): Mark a string
374 for translation. Make the pointer const.
376 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
379 * pt.c (register_specialization): Check duplicate_decls return value
380 for error_mark_node and pass it back.
382 2017-02-22 Jason Merrill <jason@redhat.com>
384 PR c++/79679 - missing destructor for argument
385 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
388 * pt.c (do_class_deduction): Handle 0 argument case.
390 2017-02-22 Jakub Jelinek <jakub@redhat.com>
393 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
394 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
395 * constexpr.c (potential_constant_expression_1): Handle
396 OMP_*, OACC_* and CILK_* trees. Use error_at with
397 EXPR_LOC_OR_LOC (t, input_location) computed early
398 instead of error, or error_at with location_of (t).
400 2017-02-22 Marek Polacek <polacek@redhat.com>
403 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
404 if the alignas expression is erroneous.
405 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
409 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
411 2017-02-21 Jason Merrill <jason@redhat.com>
413 PR c++/50308 - wrong deprecated warning with ADL
414 PR c++/17729 - duplicate deprecated warning
415 * semantics.c (finish_id_expression): Only call mark_used on a
416 function if we aren't building a call.
418 PR c++/41727 - ICE with partial spec of partial instantiation
419 * pt.c (process_partial_specialization): For now, don't check more
420 specialized if there is more than one level of args.
422 2017-02-21 Marek Polacek <polacek@redhat.com>
425 * cp-tree.h (maybe_reject_flexarray_init): Declare.
426 * init.c (maybe_reject_flexarray_init): No longer static.
427 Add check for current_function_decl.
428 * parser.c (cp_parser_late_parse_one_default_arg): Reject
429 a default mem-initializer for a flexible array.
431 2017-02-21 Jakub Jelinek <jakub@redhat.com>
432 Paolo Carlini <paolo.carlini@oracle.com>
435 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
437 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
438 decl after the decomposition artificial decl has error_mark_node.
439 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
440 instead of just == error_mark_node comparison.
442 2017-02-21 Jakub Jelinek <jakub@redhat.com>
445 * decl.c: Include gimplify.h.
446 (cp_finish_decomp): Make sure there is no sharing of trees
447 in between DECL_VALUE_EXPR of decomposition decls.
450 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
453 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
454 call cplus_expand_constant on it first.
456 2017-02-19 Jason Merrill <jason@redhat.com>
458 PR c++/78139 - destructor needed by new-expression
459 * call.c (build_special_member_call): Use tf_no_cleanup.
461 PR c++/78282 - auto template and pack expansion
462 * pt.c (find_parameter_packs_r): Don't walk into the type of
463 templates other than template template-parameters.
465 PR c++/79606 - ICE with this->base_member in NSDMI
466 * class.c (build_base_path): Check processing_template_decl.
468 PR c++/79607 - ICE with T{} initializer
469 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
471 PR c++/79566 - elaborated-type-specifier in range for
472 * parser.c (cp_parser_simple_declaration): Fix check for type
475 PR c++/79400 - confusing suggestion of 'noexcept'
476 * parser.c (cp_parser_exception_specification_opt): Remove
477 suggestion for deprecated dynamic exception-specification.
479 PR c++/79470 - partial ordering with reference parameters
480 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
482 PR c++/79500 - ICE with non-template deduction guide
483 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
484 DECL_TEMPLATE_RESULT.
486 PR c++/79580 - ICE with compound literal
487 * parser.c (cp_parser_class_head): If we're in the middle of an
488 expression, use ts_within_enclosing_non_class.
490 PR c++/79503 - inherited ctor taking base class
491 * call.c (add_function_candidate): Also check that
492 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
494 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
497 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
500 2017-02-19 Eric Fiselier <eric@efcs.ca>
501 Jonathan Wakely <jwakely@redhat.com>
504 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
505 control warning about literal suffix identifiers without a leading
508 2017-02-17 Jason Merrill <jason@redhat.com>
510 PR c++/79508 - lookup error with member template
511 * parser.c (cp_parser_template_name): Clear
512 parser->context->object_type if we aren't doing lookup.
514 PR c++/78690 - ICE with using and global type with same name
515 * pt.c (type_dependent_object_expression_p): True for
518 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
519 * pt.c (convert_template_argument): Just return an auto arg pack.
520 (tsubst_template_args): Don't tsubst an auto pack type.
522 PR c++/79556 - C++17 ICE with non-type auto
523 * pt.c (do_auto_deduction): Don't try to deduce from null type.
525 PR c++/79533 - C++17 ICE with temporary cast to reference
526 * call.c (build_over_call): Conversion to a reference prevents copy
529 2017-02-16 Jakub Jelinek <jakub@redhat.com>
530 Jason Merrill <jason@redhat.com>
532 PR c++/79502 - lost nodiscard attribute
533 * pt.c (apply_late_template_attributes): Do apply non-dependent
536 2017-02-16 Jason Merrill <jason@redhat.com>
538 PR c++/78572 - ICE with self-modifying array initializer
539 * constexpr.c (cxx_eval_store_expression): The object we're
540 initializing is outside the constant-expression.
541 (cxx_eval_call_expression): Set ctx->call.
543 PR c++/79050 - ICE with undeduced auto and LTO
544 * decl.c (poplevel): Remove undeduced auto decls.
546 2017-02-16 Jakub Jelinek <jakub@redhat.com>
549 * parser.c (cp_parser_omp_target): For -fopenmp-simd
550 ignore #pragma omp target even when not followed by identifier.
552 2017-02-15 Jason Merrill <jason@redhat.com>
553 Jakub Jelinek <jakub@redhat.com>
555 PR c++/79464 - ICE in IPA with omitted constructor parms
556 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
557 (adjust_clone_args): Adjust.
558 (add_method): Remember omitted parms.
559 * call.c (add_function_candidate): Likewise.
560 * mangle.c (write_method_parms): Likewise.
561 * method.c (ctor_omit_inherited_parms): Return false if there are no
564 2017-02-15 Martin Sebor <msebor@redhat.com>
567 * init.c (maybe_reject_flexarray_init): New function.
568 (perform_member_init): Call it.
570 2017-02-15 Jakub Jelinek <jakub@redhat.com>
573 * parser.c (cp_parser_std_attribute): Don't pedwarn about
574 [[deprecated]] with -std=c++11 and [[fallthrough]] with
575 -std=c++11 and -std=c++14.
578 * decl.c (grokdeclarator): For static data members, handle thread_p
579 only after handling inline.
581 2017-02-14 Marek Polacek <polacek@redhat.com>
585 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
586 clobbering if the postfix expression isn't an EXPR_P.
588 2017-02-13 Jason Merrill <jason@redhat.com>
590 PR c++/79461 - ICE with lambda in constexpr constructor
591 * constexpr.c (build_data_member_initialization): Ignore
592 initialization of a local variable.
594 2017-02-13 Jakub Jelinek <jakub@redhat.com>
596 * init.c (warn_placement_new_too_small): Add missing space in
598 * parser.c (cp_parser_oacc_declare): Likewise.
599 * mangle.c (maybe_check_abi_tags): Likewise.
602 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
603 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
604 in the rightmost operand.
606 2017-02-13 Nathan Sidwell <nathan@acm.org>
608 PR c++/79296 - ICE mangling localized template instantiation
609 * decl2.c (determine_visibility): Use template fn context for
610 local class instantiations.
612 2017-02-11 Jason Merrill <jason@redhat.com>
614 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
615 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
616 (build_new_1): Use replace_placeholders.
617 * tree.c (replace_placeholders_t): Also track whether we've seen a
619 (replace_placeholders, replace_placeholders_r): Adjust.
622 PR c++/77790 - ICE with auto function in C++11 mode
623 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
624 (require_deduced_type): Add complain parm, return bool.
626 * decl2.c (mark_used): Use require_deduced_type.
628 2017-02-10 Jason Merrill <jason@redhat.com>
630 PR c++/78908 - template ops and bitfields
631 * tree.c (build_min_non_dep): Use unlowered_expr_type.
633 PR c++/78897 - constexpr union
634 * constexpr.c (cxx_eval_store_expression): A store to a union member
635 erases a previous store to another member.
637 PR c++/71285 - member of fold-expression
638 * semantics.c (finish_unary_fold_expr)
639 (finish_binary_fold_expr): Use null type for fold-expressions.
641 PR c++/79401 - protected inherited constructor
642 * call.c (enforce_access): For inheriting constructor, find a base
643 binfo in the path we already have.
645 2017-02-10 Marek Polacek <polacek@redhat.com>
648 * pt.c (type_dependent_expression_p): Check if the expression type
652 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
653 if warnings shouldn't be given.
655 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
658 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
659 an error_mark_node as type.
661 2017-02-09 Jakub Jelinek <jakub@redhat.com>
662 Jason Merrill <jason@redhat.com>
665 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
666 from pattern to type.
668 2017-02-09 Jason Merrill <jason@redhat.com>
670 PR c++/79316 - default argument in deduction guide
671 PR c++/79350 - explicit deduction guide
672 * parser.c (cp_parser_constructor_declarator_p)
673 (cp_parser_direct_declarator): Parse deduction guides more like
675 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
676 * tree.c (special_function_p): Return it.
677 * decl.c (check_special_function_return_type): Handle it.
678 (grokdeclarator, grokfndecl): Adjust.
679 (cp_finish_decl): Pass flags to do_auto_deduction.
680 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
681 * pt.c (dguide_name_p): Take a const_tree.
682 (do_class_deduction): Handle explicit.
683 (do_auto_deduction): Pass flags through.
684 (build_deduction_guide): Copy explicit flag.
686 2017-02-09 Jakub Jelinek <jakub@redhat.com>
689 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
690 non-pragma_compound context here.
691 (cp_parser_omp_target): Likewise.
692 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
693 parsing for ordered and target omp pragmas in non-pragma_stmt
694 non-pragma_compound contexts.
697 * parser.c (cp_parser_oacc_declare): Formatting fix.
698 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
701 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
702 Chung-Lin Tang <cltang@codesourcery.com>
704 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
705 parsing. Parse constant expression. Remove semantic checking.
706 (cp_parser_omp_clause_collapse): Disallow tile.
707 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
708 error about missing for after already emitting one. Use more
709 conventional for idiom for unbounded loop.
710 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
711 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
712 (finish_omp_for): Deal with tile clause.
714 2017-02-07 Nathan Sidwell <nathan@acm.org>
716 * method.c (synthesized_method_base_walk): New. Broken out of ...
717 (synthesized_method_walk): ... here. Call it. Cleanup
720 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
723 * typeck2.c (process_init_constructor_union): Consider only
724 FIELD_DECLs when looking for an NSDMI.
726 2017-02-06 Jason Merrill <jason@redhat.com>
728 PR c++/71193 - incomplete types in templates
729 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
730 handle incomplete type by pedwarning and then treating as dependent.
732 2017-02-06 Jakub Jelinek <jakub@redhat.com>
735 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
736 (potential_constant_expression_1): Likewise.
739 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
740 allow one fewer than expected arguments if flag_permissive.
743 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
744 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
745 with error_mark_node type.
747 2017-02-03 Jason Merrill <jason@redhat.com>
749 PR c++/78689 - ICE on constructor with label
750 * optimize.c (maybe_clone_body): Replace omitted parameters with
752 * class.c (build_clone): Fix logic for omitting inherited parms.
754 PR c++/12245 - excessive memory use
755 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
756 back in. Don't cache constants.
757 (maybe_constant_init): Don't cache constants.
759 PR c++/79294 - ICE with invalid template argument
760 * pt.c (convert_nontype_argument_function): Check value-dependence.
761 (convert_nontype_argument): Don't check it here for function ptrs.
763 2017-02-02 Richard Biener <rguenther@suse.de>
766 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
767 it lazily on the first changed element only and copy it
768 fully upfront, only storing changed elements.
770 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
773 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
776 2017-01-31 Jakub Jelinek <jakub@redhat.com>
779 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
782 2017-01-31 David Malcolm <dmalcolm@redhat.com>
785 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
786 any namespace aliases.
788 2017-01-31 Nathan Sidwell <nathan@acm.org>
791 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
795 * pt.c: (instantiate_decl): Push to top level when current
796 function scope doesn't match. Only push lmabda scope stack when
799 * cp-tree.h (instantiate_decl): Make defer_ok bool.
800 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
801 (instantiate_decl): Simplify and reorder state saving and restoration.
804 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
805 * semantics.c (finish_member_declaration): Assert class is being
808 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
810 Introduce C++ support in libcc1.
811 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
812 (ansi_opname): Rename to...
813 (cp_operator_id): ... this. Adjust all callers.
814 (ansi_assopname): Rename to...
815 (cp_assignment_operator_id): ... this. Adjust all callers.
816 (cp_literal_operator_id): Declare.
817 (set_global_friend): Declare.
818 (is_global_friend): Declare.
819 (enum cp_oracle_request): New type.
820 (cp_binding_oracle_function): New type.
821 (cp_binding_oracle): Declare.
822 (cp_finish_injected_record_type): Declare.
823 * friend.c (global_friend): New var.
824 (set_global_friend): New fn.
825 (is_global_friend): New fn.
826 (is_friend): Call is_global_friend.
827 * name-lookup.c (cp_binding_oracle): New var.
828 (query_oracle): New fn.
829 (qualified_lookup_using_namespace): Call query_oracle.
830 (lookup_name_real_1): Likewise.
831 * parser.c (cp_literal_operator_id): Drop static.
832 * search.c (friend_accessible_p): Call is_global_friend.
833 * semantics.c (is_this_parameter): Accept a variable if the
834 binding oracle is enabled.
836 2017-01-27 Jason Merrill <jason@redhat.com>
838 PR c++/78771 - ICE with inherited constructor.
839 * call.c (build_over_call): Call deduce_inheriting_ctor here.
840 * pt.c (tsubst_decl): Not here.
841 * class.c (add_method): Or here.
842 * method.c (deduce_inheriting_ctor): Handle clones.
843 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
845 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
848 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
850 * cp/cp-tree.h: Declare it.
851 * cp/semantics.c (finish_id_expression): Resolve names within a default
852 capturing generic lambda defined within a template prior to
853 instantiation to allow for captures to be added to the closure type.
855 2017-01-26 Jakub Jelinek <jakub@redhat.com>
858 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
859 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
860 * parser.c (cp_parser_builtin_offsetof): Pass result of
861 build_static_cast of null_pointer_node to finish_offsetof.
862 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
863 it for -Winvalid-offsetof pedwarn instead of trying to guess
864 original offsetof type from EXPR. Save OBJECT_PTR as a new
865 second operand to OFFSETOF_EXPR.
866 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
867 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
870 2017-01-26 Jason Merrill <jason@redhat.com>
872 * name-lookup.c (parse_using_directive): Deprecate strong using.
874 PR c++/79176 - lambda ICE with -flto -Os
875 * decl2.c (vague_linkage_p): Handle decloned 'tors.
876 * tree.c (decl_linkage): Likewise.
878 2017-01-25 Martin Sebor <msebor@redhat.com>
880 * decl.c (grokdeclarator): Fix a typo in a comment.
882 2017-01-25 Jakub Jelinek <jakub@redhat.com>
885 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
889 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
890 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
892 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
895 * decl.c (cxx_init_decl_processing): Pass main_input_filename
896 to build_translation_unit_decl.
898 2017-01-24 Jakub Jelinek <jakub@redhat.com>
901 * cp-gimplify.c (cp_genericize_r): Add result of
902 convert_from_reference on invisiref parm to p_set.
904 2017-01-24 Nathan Sidwell <nathan@acm.org>
906 PR c++/78469 - defaulted ctor and inaccessible dtor
907 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
908 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
909 * tree.c (build_target_expr): Check tf_no_cleanup.
911 PR c++/79118 - anon-members and constexpr
912 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
913 ctor decl. Recursively check anonymous members.
914 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
916 (explain_invalid_constexpr_fn): Likewise.
918 2017-01-23 Nathan Sidwell <nathan@acm.org>
920 PR c++/71710 - template using directive of field
921 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
924 PR c++/71406 - ICE with scope-ref'd template id exprs
926 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
927 before breaking up TEMPLATE_ID_EXPR.
929 2017-01-20 Nathan Sidwell <nathan@acm.org>
931 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
932 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
934 2017-01-20 David Malcolm <dmalcolm@redhat.com>
938 * cp-tree.h (suggest_alternatives_for): Add bool param.
939 (suggest_alternative_in_explicit_scope): New decl.
940 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
941 that isn't the global one, call new function
942 suggest_alternative_in_explicit_scope, only calling
943 suggest_alternatives_for if it fails, and disabling near match
944 searches fort that case. When SCOPE is the global namespace,
945 pass true for new param to suggest_alternatives_for to allow for
947 * lex.c (unqualified_name_lookup_error): Pass true for new param
948 to suggest_alternatives_for.
949 * name-lookup.c (consider_binding_level): Add forward decl.
950 (suggest_alternatives_for): Add "suggest_misspellings" param,
951 using it to conditionalize the fuzzy name-lookup code.
952 (suggest_alternative_in_explicit_scope): New function.
953 * parser.c (cp_parser_primary_expression): When calling
954 finish_id_expression, pass location of id_expression rather
955 than that of id_expr_token.
956 (cp_parser_id_expression): Convert local "unqualified_id" from
957 tree to cp_expr to avoid implicitly dropping location information.
959 2017-01-20 Marek Polacek <polacek@redhat.com>
962 * call.c (build_conditional_expr_1): Warn about duplicated branches.
963 * semantics.c (finish_expr_stmt): Build statement using the proper
966 2017-01-19 Jason Merrill <jason@redhat.com>
968 US 20 - forwarding references and class template argument deduction
969 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
970 * pt.c (push_template_decl_real): Set it.
971 (maybe_adjust_types_for_deduction): Check it.
972 (rewrite_template_parm): Copy it.
974 US 19 - deduction guides and constructors
975 * call.c (joust): Prefer deduction guides to constructors.
976 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
977 (deduction_guide_p): Check DECL_P.
979 * decl.c (check_initializer): Always use build_aggr_init for array
982 PR c++/79130 - decomposition and direct-initialization
983 * init.c (build_aggr_init): Communicate direct-initialization to
985 (build_vec_init): Check for array copy sooner.
986 * parser.c (cp_parser_decomposition_declaration): Remove call to
987 build_x_compound_expr_from_list.
989 2017-01-18 Jason Merrill <jason@redhat.com>
991 PR c++/68666 - member variable template-id
992 * typeck.c (finish_class_member_access_expr): Handle variable
994 * pt.c (lookup_and_finish_template_variable): No longer static.
995 * cp-tree.h: Declare it.
997 2017-01-18 Nathan Sidwell <nathan@acm.org>
1000 * call.c (build_over_call): When checking ellipsis conversions for
1001 an inherited ctor, make sure there is at least one conversion.
1003 2017-01-18 Jason Merrill <jason@redhat.com>
1005 PR c++/78894 - ICE with class deduction and default arg
1006 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
1008 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
1011 * mangle.c (write_discriminator): Reorganize abi warning check.
1013 2017-01-18 Nathan Sidwell <nathan@acm.org>
1015 * cp-tree.h: Clarify exception spec node comment.
1016 * except.c (nothrow_spec_p): Simplify by checking node-equality.
1019 * mangle.c (write_exception_spec): Check nothrow explicitly.
1020 (write_encoding): Don't increment processing_template_decl around
1023 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
1026 * mangle.c (write_template_args): Add "on" for operator names.
1028 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
1031 * mangle.c (write_discriminator): Handle discriminator >= 10.
1033 2017-01-17 Nathan Sidwell <nathan@acm.org>
1036 * cp-tree.h (maybe_generic_this_capture): Declare.
1037 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
1038 (maybe_resolve_dummy): ... here. Call it.
1039 (maybe_generic_this_capture): New.
1040 * parser.c (cp_parser_postfix_expression): Speculatively capture
1041 this in generic lambda in unresolved member function call.
1042 * pt.c (tsubst_copy_and_build): Force hard error from failed
1043 member function lookup in generic lambda.
1045 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
1048 * cp-array-notation.c (expand_array_notation_exprs): Handle
1051 2017-01-11 Jason Merrill <jason@redhat.com>
1053 PR c++/78337 - ICE on invalid with generic lambda
1054 * semantics.c (process_outer_var_ref): Check if containing_function
1055 is null. Move inform call under complain test.
1057 2017-01-11 Nathan Sidwell <nathan@acm.org>
1060 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
1063 2017-01-11 Nathan Sidwell <nathan@acm.org>
1065 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
1067 2017-01-11 Jakub Jelinek <jakub@redhat.com>
1070 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
1071 assertion. Formatting fix.
1074 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
1077 2017-01-10 David Malcolm <dmalcolm@redhat.com>
1080 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
1081 a missing semicolon if we have a valid insertion location for
1084 2017-01-10 Jason Merrill <jason@redhat.com>
1086 FI 20, decomposition declaration with parenthesized initializer.
1087 * parser.c (cp_parser_decomposition_declaration): Use
1088 cp_parser_initializer.
1090 2017-01-09 Jason Merrill <jason@redhat.com>
1092 Implement P0195R2, C++17 variadic using.
1093 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
1094 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
1095 * error.c (dump_decl): Likewise.
1097 2017-01-09 Jakub Jelinek <jakub@redhat.com>
1099 PR translation/79019
1100 PR translation/79020
1101 * semantics.c (finish_omp_clauses): Add missing whitespace to
1102 translatable strings.
1103 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
1105 2017-01-07 Jason Merrill <jason@redhat.com>
1107 PR c++/78948 - instantiation from discarded statement
1108 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
1109 * cp-tree.h (in_discarded_stmt): Declare it.
1110 (struct saved_scope): Add discarded_stmt bitfield.
1111 (in_discarded_stmt): New macro.
1112 * decl2.c (mark_used): Check it.
1113 * parser.c (cp_parser_selection_statement): Adjust.
1114 (cp_parser_jump_statement): Adjust.
1116 2017-01-05 Jakub Jelinek <jakub@redhat.com>
1119 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
1120 REFERENCE_REF_P, set tt to its operand.
1123 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
1124 unions even for C++11 and later.
1126 2017-01-05 Nathan Sidwell <nathan@acm.org>
1129 * pt.c (convert_nontype_argument): Don't try and see if integral
1130 or enum expressions are constants prematurely.
1132 2017-01-04 Marek Polacek <polacek@redhat.com>
1135 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
1136 a zero character literal.
1138 2017-01-04 Jakub Jelinek <jakub@redhat.com>
1141 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
1145 * parser.c (cp_parser_simple_declaration): Only complain about
1146 inconsistent auto deduction if auto_result doesn't use auto.
1148 * parser.c (cp_parser_simple_declaration): Diagnose function
1149 declaration among more than one init-declarators with auto
1153 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
1154 assertion, as lexer->buffer may be NULL.
1156 2017-01-04 Marek Polacek <polacek@redhat.com>
1160 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
1162 2017-01-04 Nathan Sidwell <nathan@acm.org>
1165 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
1166 (lambda_capture_field_type): Update prototype.
1167 * lambda.c (lambda_capture_field_type): Add is_reference parm.
1168 Add referenceness here.
1169 (add_capture): Adjust lambda_capture_field_type call, refactor
1171 * pt.c (tsubst): Adjust lambda_capture_field_type call.
1173 2017-01-01 Jakub Jelinek <jakub@redhat.com>
1175 Update copyright years.
1177 Copyright (C) 2017 Free Software Foundation, Inc.
1179 Copying and distribution of this file, with or without modification,
1180 are permitted in any medium without royalty provided the copyright
1181 notice and this notice are preserved.