1 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
3 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
4 * decl2.c (one_static_initialization_or_destruction): Likewise.
5 * name-lookup.c (store_bindings): Likewise.
6 * parser.c (make_call_declarator): Likewise.
7 * pt.c (check_explicit_specialization): Likewise.
9 2017-04-03 Jason Merrill <jason@redhat.com>
11 PR sanitizer/79993 - ICE with VLA initialization from string
12 PR c++/69487 - wrong VLA initialization from string
13 * init.c (finish_length_check): Split out from build_vec_init.
14 (build_vec_init): Handle STRING_CST.
15 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
16 (digest_init_r): Don't give a STRING_CST VLA type.
18 2017-03-31 Jakub Jelinek <jakub@redhat.com>
21 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
22 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
23 for NOP_EXPR to REFERENCE_TYPE.
26 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
27 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
29 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
30 Remove extraneous parens.
31 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
32 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
33 (cp_parser_trait_expr): Likewise.
35 2017-03-27 Jakub Jelinek <jakub@redhat.com>
38 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
39 * typeck.c (cxx_mark_addressable): Likewise. Look through
40 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
42 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
44 2017-03-24 Jason Merrill <jason@redhat.com>
46 PR c++/77339 - ICE with invalid use of alias template.
47 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
50 2017-03-24 Marek Polacek <polacek@redhat.com>
53 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
54 doesn't have side effects.
56 2017-03-23 Jason Merrill <jason@redhat.com>
58 PR c++/80150 - ICE with overloaded variadic deduction.
59 * pt.c (try_one_overload): Remove asserts.
61 PR c++/77563 - missing ambiguous conversion error.
62 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
64 2017-03-23 Marek Polacek <polacek@redhat.com>
66 * cp-tree.h: Remove a C_RID_YYCODE reference.
68 2017-03-22 Jakub Jelinek <jakub@redhat.com>
71 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
72 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
73 processing_template_decl.
75 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
78 * name-lookup.c (pushtag_1): Add check for bogus, non template,
79 std::initializer_list.
81 2017-03-21 Jakub Jelinek <jakub@redhat.com>
84 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
86 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
89 * init.c (std_placement_new_fn_p): New.
90 (build_new_1): Call it.
92 2017-03-20 Jason Merrill <jason@redhat.com>
94 PR c++/80096 - ICE with C++17 non-type auto.
95 * pt.c (tsubst): Delay tsubst of type of template non-type
98 PR c++/79519 - ICE with deleted template friend.
99 * decl.c (grokdeclarator): Complain about misplaced function
100 definition using =, as well.
102 PR c++/79640 - infinite recursion with generic lambda.
103 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
104 before substituting its initializer.
106 2017-03-20 Marek Polacek <polacek@redhat.com>
107 Paolo Carlini <paolo.carlini@oracle.com>
109 PR c++/80059 - ICE with noexcept and __transaction_atomic
110 * except.c (build_must_not_throw_expr): Call
111 instantiate_non_dependent_expr.
113 2017-03-19 Jason Merrill <jason@redhat.com>
115 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
116 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
117 reference decomposition.
119 PR c++/80077 - error with constexpr and -fno-elide-constructors.
120 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
121 expanding trivial constructor.
123 2017-03-17 Jason Merrill <jason@redhat.com>
125 PR c++/78345 - ICE initializing array from lambda.
126 * init.c (build_aggr_init): Check array initializer.
127 (build_vec_init): Check the type of a CONSTRUCTOR.
129 PR c++/80073 - C++17 ICE with virtual base.
130 * decl.c (xref_basetypes): Also check for indirect vbases.
132 2017-03-16 Jason Merrill <jason@redhat.com>
134 * decl.c (start_enum): std::byte aliases anything.
137 * constexpr.c (lookup_placeholder): Tweak.
139 2017-03-15 Jason Merrill <jason@redhat.com>
141 PR c++/80043 - ICE with -fpermissive
142 * typeck.c (convert_for_assignment): Handle instantiate_type
145 2017-03-14 Nathan Sidwell <nathan@acm.org>
147 PR c++/79393 DR 1658 workaround
148 * method.c (synthesized_method_base_walk): Inihibit abstract class
149 virtual base access check here.
150 (synthesized_method_walk): Not here.
152 2017-03-13 Nathan Sidwell <nathan@acm.org>
154 PR c++/79393 DR 1658 workaround
155 * method.c (synthesized_method_walk): Check vbases of abstract
156 classes for dtor walk.
158 2017-03-10 David Malcolm <dmalcolm@redhat.com>
161 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
163 2017-03-10 Jason Merrill <jason@redhat.com>
165 PR c++/79960 - alias templates and partial ordering
166 * pt.c (comp_template_args): Add partial_order parm.
167 (template_args_equal): Likewise.
168 (comp_template_args_porder): New.
169 (get_partial_spec_bindings): Use it.
171 2017-03-10 Marek Polacek <polacek@redhat.com>
174 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
176 2017-03-10 Jakub Jelinek <jakub@redhat.com>
179 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
180 Use XALLOCAVEC macro.
183 * decl.c (finish_enum_value_list): If value is error_mark_node,
184 don't copy it and change its type.
185 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
186 of CONST_DECL is error_mark_node.
188 2017-03-09 Marek Polacek <polacek@redhat.com>
190 PR c++/79900 - ICE in strip_typedefs
191 * tree.c (strip_typedefs): Skip the attribute handling if T is
192 a variant type which hasn't been updated yet.
194 PR c++/79687 - wrong code with pointer-to-member
195 * init.c (constant_value_1): Break if the variable has a dynamic
198 2017-03-08 Jason Merrill <jason@redhat.com>
200 PR c++/79797 - ICE with self-reference in array DMI.
201 * constexpr.c (lookup_placeholder): Split out...
202 (cxx_eval_constant_expression): ...from here.
204 2017-03-07 Jakub Jelinek <jakub@redhat.com>
207 * parser.c (cp_parser_omp_cancellation_point,
208 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
209 cp_parser_omp_target_update): Change "may only be used in compound
210 statements" diagnostics, such that the same translatable string is
211 used for all pragmas.
212 (cp_parser_pragma): Likewise. Use error_at instead of
213 cp_parser_error for that diagnostics.
215 2017-03-06 Marek Polacek <polacek@redhat.com>
217 PR c++/79796 - ICE with NSDMI and this pointer
218 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
219 replace_placeholders.
221 2017-03-06 Jakub Jelinek <jakub@redhat.com>
224 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
227 2017-03-06 Jason Merrill <jason@redhat.com>
229 Revert "Allow deduction guides to look into primary template."
230 * cp-tree.h, parser.c, pt.c, search.c: Revert.
232 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
235 * except.c (build_must_not_throw_expr): Perform the implicit
236 conversions on the condition.
238 2017-03-03 Jason Merrill <jason@redhat.com>
240 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
243 Core issues 2273 and 2277
244 * call.c (joust): Adjust using-declaration tiebreaker to handle
245 the intermediate base case.
246 * method.c (strip_inheriting_ctors): Just return the argument if
247 !flag_new_inheriting_ctors.
249 2017-03-03 Richard Biener <rguenther@suse.de>
252 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
254 2017-03-03 Marek Polacek <polacek@redhat.com>
257 * typeck.c (string_conv_p): In C++11, always call pedwarn with
260 2017-03-02 Jason Merrill <jason@redhat.com>
262 Update overload resolution with deduction guides.
263 * pt.c (do_class_deduction): Always build the copy guide.
264 (copy_guide_p, template_guide_p): New.
265 (build_deduction_guide): Remember the original constructor.
266 * call.c (joust): Prefer the copy guide and non-template guides.
268 Allow deduction guides to look into primary template.
269 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
270 (struct cp_decl_specifier_seq): Add constructor_p.
271 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
272 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
273 Clear deduction_guide_type. Don't handle deduction guide names.
274 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
275 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
276 (cp_parser_member_declaration, cp_parser_cache_defarg)
277 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
278 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
279 (build_deduction_guide): Set deduction_guide_type.
280 (dependent_scope_p): Check deduction_guide_type.
281 * search.c (lookup_member): Likewise.
283 2017-03-02 Jakub Jelinek <jakub@redhat.com>
286 * init.c (mark_exp_read_r): New function.
287 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
288 whole arguments instead of plain mark_exp_read on TREE_LIST values.
290 2017-03-01 Jason Merrill <jason@redhat.com>
292 Class template argument deduction in new-expression
293 * init.c (build_new): Handle deduction from no initializer.
294 * parser.c (cp_parser_new_expression): Don't require a single
295 expression for class template deduction.
296 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
297 class template placeholder.
298 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
299 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
300 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
302 2017-03-01 Jakub Jelinek <jakub@redhat.com>
305 * init.c (emit_mem_initializers): When not constructing vbases of
306 abstract classes, mark arguments as read for
307 -Wunused-but-set-parameter.
309 2017-02-28 Jason Merrill <jason@redhat.com>
311 Class template argument deduction refinements
312 * call.c (joust): Move deduction guide tiebreaker down.
313 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
314 deduction with no initializer.
315 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
316 (do_class_deduction): Use that rather than special case.
317 (do_auto_deduction): Handle null initializer.
319 2017-02-28 Jakub Jelinek <jakub@redhat.com>
321 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
322 instead of just cond ? "..." : "...".
323 (grokdeclarator): Likewise.
324 (build_enumerator): Likewise.
325 * init.c (build_new_1): Likewise.
326 * call.c (build_new_method_call_1): Likewise.
327 * parser.c: Include intl.h.
328 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
329 "enter"/"exit" keyword.
330 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
333 2017-02-27 Jason Merrill <jason@redhat.com>
335 PR c++/71568 - SFINAE forming pointer to member function
336 * init.c (build_offset_ref): Check the return value of
337 perform_or_defer_access_check.
339 2017-02-27 Marek Polacek <polacek@redhat.com>
341 * decl.c (expand_static_init): Add missing } in a comment.
343 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
345 * init.c: Include intl.h.
346 (build_new_1): Move message strings into pedwarn to make them
347 -Wformat-security friendly. Mark string for translation.
348 * pt.c (tsubst_copy_and_build): Mark string for translation.
349 Make the pointer const.
350 * semantics.c (finish_id_expression): Mark strings for translation.
352 2017-02-25 Jakub Jelinek <jakub@redhat.com>
354 * call.c (build_op_delete_call): Make msg1 and msg2 const.
356 2017-02-24 Jakub Jelinek <jakub@redhat.com>
359 * call.c (build_over_call): Call check_function_arguments even for
360 -Wrestrict, adjust check_function_arguments caller.
361 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
363 * typeck.c (cp_build_function_call_vec): Adjust
364 check_function_arguments caller.
366 2017-02-24 Marek Polacek <polacek@redhat.com>
369 * decl.c (check_redeclaration_exception_specification): Mark a string
370 for translation. Make the pointer const.
372 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
375 * pt.c (register_specialization): Check duplicate_decls return value
376 for error_mark_node and pass it back.
378 2017-02-22 Jason Merrill <jason@redhat.com>
380 PR c++/79679 - missing destructor for argument
381 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
384 * pt.c (do_class_deduction): Handle 0 argument case.
386 2017-02-22 Jakub Jelinek <jakub@redhat.com>
389 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
390 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
391 * constexpr.c (potential_constant_expression_1): Handle
392 OMP_*, OACC_* and CILK_* trees. Use error_at with
393 EXPR_LOC_OR_LOC (t, input_location) computed early
394 instead of error, or error_at with location_of (t).
396 2017-02-22 Marek Polacek <polacek@redhat.com>
399 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
400 if the alignas expression is erroneous.
401 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
405 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
407 2017-02-21 Jason Merrill <jason@redhat.com>
409 PR c++/50308 - wrong deprecated warning with ADL
410 PR c++/17729 - duplicate deprecated warning
411 * semantics.c (finish_id_expression): Only call mark_used on a
412 function if we aren't building a call.
414 PR c++/41727 - ICE with partial spec of partial instantiation
415 * pt.c (process_partial_specialization): For now, don't check more
416 specialized if there is more than one level of args.
418 2017-02-21 Marek Polacek <polacek@redhat.com>
421 * cp-tree.h (maybe_reject_flexarray_init): Declare.
422 * init.c (maybe_reject_flexarray_init): No longer static.
423 Add check for current_function_decl.
424 * parser.c (cp_parser_late_parse_one_default_arg): Reject
425 a default mem-initializer for a flexible array.
427 2017-02-21 Jakub Jelinek <jakub@redhat.com>
428 Paolo Carlini <paolo.carlini@oracle.com>
431 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
433 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
434 decl after the decomposition artificial decl has error_mark_node.
435 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
436 instead of just == error_mark_node comparison.
438 2017-02-21 Jakub Jelinek <jakub@redhat.com>
441 * decl.c: Include gimplify.h.
442 (cp_finish_decomp): Make sure there is no sharing of trees
443 in between DECL_VALUE_EXPR of decomposition decls.
446 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
449 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
450 call cplus_expand_constant on it first.
452 2017-02-19 Jason Merrill <jason@redhat.com>
454 PR c++/78139 - destructor needed by new-expression
455 * call.c (build_special_member_call): Use tf_no_cleanup.
457 PR c++/78282 - auto template and pack expansion
458 * pt.c (find_parameter_packs_r): Don't walk into the type of
459 templates other than template template-parameters.
461 PR c++/79606 - ICE with this->base_member in NSDMI
462 * class.c (build_base_path): Check processing_template_decl.
464 PR c++/79607 - ICE with T{} initializer
465 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
467 PR c++/79566 - elaborated-type-specifier in range for
468 * parser.c (cp_parser_simple_declaration): Fix check for type
471 PR c++/79400 - confusing suggestion of 'noexcept'
472 * parser.c (cp_parser_exception_specification_opt): Remove
473 suggestion for deprecated dynamic exception-specification.
475 PR c++/79470 - partial ordering with reference parameters
476 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
478 PR c++/79500 - ICE with non-template deduction guide
479 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
480 DECL_TEMPLATE_RESULT.
482 PR c++/79580 - ICE with compound literal
483 * parser.c (cp_parser_class_head): If we're in the middle of an
484 expression, use ts_within_enclosing_non_class.
486 PR c++/79503 - inherited ctor taking base class
487 * call.c (add_function_candidate): Also check that
488 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
490 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
493 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
496 2017-02-19 Eric Fiselier <eric@efcs.ca>
497 Jonathan Wakely <jwakely@redhat.com>
500 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
501 control warning about literal suffix identifiers without a leading
504 2017-02-17 Jason Merrill <jason@redhat.com>
506 PR c++/79508 - lookup error with member template
507 * parser.c (cp_parser_template_name): Clear
508 parser->context->object_type if we aren't doing lookup.
510 PR c++/78690 - ICE with using and global type with same name
511 * pt.c (type_dependent_object_expression_p): True for
514 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
515 * pt.c (convert_template_argument): Just return an auto arg pack.
516 (tsubst_template_args): Don't tsubst an auto pack type.
518 PR c++/79556 - C++17 ICE with non-type auto
519 * pt.c (do_auto_deduction): Don't try to deduce from null type.
521 PR c++/79533 - C++17 ICE with temporary cast to reference
522 * call.c (build_over_call): Conversion to a reference prevents copy
525 2017-02-16 Jakub Jelinek <jakub@redhat.com>
526 Jason Merrill <jason@redhat.com>
528 PR c++/79502 - lost nodiscard attribute
529 * pt.c (apply_late_template_attributes): Do apply non-dependent
532 2017-02-16 Jason Merrill <jason@redhat.com>
534 PR c++/78572 - ICE with self-modifying array initializer
535 * constexpr.c (cxx_eval_store_expression): The object we're
536 initializing is outside the constant-expression.
537 (cxx_eval_call_expression): Set ctx->call.
539 PR c++/79050 - ICE with undeduced auto and LTO
540 * decl.c (poplevel): Remove undeduced auto decls.
542 2017-02-16 Jakub Jelinek <jakub@redhat.com>
545 * parser.c (cp_parser_omp_target): For -fopenmp-simd
546 ignore #pragma omp target even when not followed by identifier.
548 2017-02-15 Jason Merrill <jason@redhat.com>
549 Jakub Jelinek <jakub@redhat.com>
551 PR c++/79464 - ICE in IPA with omitted constructor parms
552 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
553 (adjust_clone_args): Adjust.
554 (add_method): Remember omitted parms.
555 * call.c (add_function_candidate): Likewise.
556 * mangle.c (write_method_parms): Likewise.
557 * method.c (ctor_omit_inherited_parms): Return false if there are no
560 2017-02-15 Martin Sebor <msebor@redhat.com>
563 * init.c (maybe_reject_flexarray_init): New function.
564 (perform_member_init): Call it.
566 2017-02-15 Jakub Jelinek <jakub@redhat.com>
569 * parser.c (cp_parser_std_attribute): Don't pedwarn about
570 [[deprecated]] with -std=c++11 and [[fallthrough]] with
571 -std=c++11 and -std=c++14.
574 * decl.c (grokdeclarator): For static data members, handle thread_p
575 only after handling inline.
577 2017-02-14 Marek Polacek <polacek@redhat.com>
581 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
582 clobbering if the postfix expression isn't an EXPR_P.
584 2017-02-13 Jason Merrill <jason@redhat.com>
586 PR c++/79461 - ICE with lambda in constexpr constructor
587 * constexpr.c (build_data_member_initialization): Ignore
588 initialization of a local variable.
590 2017-02-13 Jakub Jelinek <jakub@redhat.com>
592 * init.c (warn_placement_new_too_small): Add missing space in
594 * parser.c (cp_parser_oacc_declare): Likewise.
595 * mangle.c (maybe_check_abi_tags): Likewise.
598 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
599 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
600 in the rightmost operand.
602 2017-02-13 Nathan Sidwell <nathan@acm.org>
604 PR c++/79296 - ICE mangling localized template instantiation
605 * decl2.c (determine_visibility): Use template fn context for
606 local class instantiations.
608 2017-02-11 Jason Merrill <jason@redhat.com>
610 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
611 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
612 (build_new_1): Use replace_placeholders.
613 * tree.c (replace_placeholders_t): Also track whether we've seen a
615 (replace_placeholders, replace_placeholders_r): Adjust.
618 PR c++/77790 - ICE with auto function in C++11 mode
619 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
620 (require_deduced_type): Add complain parm, return bool.
622 * decl2.c (mark_used): Use require_deduced_type.
624 2017-02-10 Jason Merrill <jason@redhat.com>
626 PR c++/78908 - template ops and bitfields
627 * tree.c (build_min_non_dep): Use unlowered_expr_type.
629 PR c++/78897 - constexpr union
630 * constexpr.c (cxx_eval_store_expression): A store to a union member
631 erases a previous store to another member.
633 PR c++/71285 - member of fold-expression
634 * semantics.c (finish_unary_fold_expr)
635 (finish_binary_fold_expr): Use null type for fold-expressions.
637 PR c++/79401 - protected inherited constructor
638 * call.c (enforce_access): For inheriting constructor, find a base
639 binfo in the path we already have.
641 2017-02-10 Marek Polacek <polacek@redhat.com>
644 * pt.c (type_dependent_expression_p): Check if the expression type
648 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
649 if warnings shouldn't be given.
651 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
654 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
655 an error_mark_node as type.
657 2017-02-09 Jakub Jelinek <jakub@redhat.com>
658 Jason Merrill <jason@redhat.com>
661 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
662 from pattern to type.
664 2017-02-09 Jason Merrill <jason@redhat.com>
666 PR c++/79316 - default argument in deduction guide
667 PR c++/79350 - explicit deduction guide
668 * parser.c (cp_parser_constructor_declarator_p)
669 (cp_parser_direct_declarator): Parse deduction guides more like
671 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
672 * tree.c (special_function_p): Return it.
673 * decl.c (check_special_function_return_type): Handle it.
674 (grokdeclarator, grokfndecl): Adjust.
675 (cp_finish_decl): Pass flags to do_auto_deduction.
676 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
677 * pt.c (dguide_name_p): Take a const_tree.
678 (do_class_deduction): Handle explicit.
679 (do_auto_deduction): Pass flags through.
680 (build_deduction_guide): Copy explicit flag.
682 2017-02-09 Jakub Jelinek <jakub@redhat.com>
685 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
686 non-pragma_compound context here.
687 (cp_parser_omp_target): Likewise.
688 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
689 parsing for ordered and target omp pragmas in non-pragma_stmt
690 non-pragma_compound contexts.
693 * parser.c (cp_parser_oacc_declare): Formatting fix.
694 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
697 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
698 Chung-Lin Tang <cltang@codesourcery.com>
700 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
701 parsing. Parse constant expression. Remove semantic checking.
702 (cp_parser_omp_clause_collapse): Disallow tile.
703 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
704 error about missing for after already emitting one. Use more
705 conventional for idiom for unbounded loop.
706 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
707 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
708 (finish_omp_for): Deal with tile clause.
710 2017-02-07 Nathan Sidwell <nathan@acm.org>
712 * method.c (synthesized_method_base_walk): New. Broken out of ...
713 (synthesized_method_walk): ... here. Call it. Cleanup
716 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
719 * typeck2.c (process_init_constructor_union): Consider only
720 FIELD_DECLs when looking for an NSDMI.
722 2017-02-06 Jason Merrill <jason@redhat.com>
724 PR c++/71193 - incomplete types in templates
725 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
726 handle incomplete type by pedwarning and then treating as dependent.
728 2017-02-06 Jakub Jelinek <jakub@redhat.com>
731 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
732 (potential_constant_expression_1): Likewise.
735 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
736 allow one fewer than expected arguments if flag_permissive.
739 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
740 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
741 with error_mark_node type.
743 2017-02-03 Jason Merrill <jason@redhat.com>
745 PR c++/78689 - ICE on constructor with label
746 * optimize.c (maybe_clone_body): Replace omitted parameters with
748 * class.c (build_clone): Fix logic for omitting inherited parms.
750 PR c++/12245 - excessive memory use
751 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
752 back in. Don't cache constants.
753 (maybe_constant_init): Don't cache constants.
755 PR c++/79294 - ICE with invalid template argument
756 * pt.c (convert_nontype_argument_function): Check value-dependence.
757 (convert_nontype_argument): Don't check it here for function ptrs.
759 2017-02-02 Richard Biener <rguenther@suse.de>
762 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
763 it lazily on the first changed element only and copy it
764 fully upfront, only storing changed elements.
766 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
769 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
772 2017-01-31 Jakub Jelinek <jakub@redhat.com>
775 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
778 2017-01-31 David Malcolm <dmalcolm@redhat.com>
781 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
782 any namespace aliases.
784 2017-01-31 Nathan Sidwell <nathan@acm.org>
787 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
791 * pt.c: (instantiate_decl): Push to top level when current
792 function scope doesn't match. Only push lmabda scope stack when
795 * cp-tree.h (instantiate_decl): Make defer_ok bool.
796 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
797 (instantiate_decl): Simplify and reorder state saving and restoration.
800 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
801 * semantics.c (finish_member_declaration): Assert class is being
804 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
806 Introduce C++ support in libcc1.
807 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
808 (ansi_opname): Rename to...
809 (cp_operator_id): ... this. Adjust all callers.
810 (ansi_assopname): Rename to...
811 (cp_assignment_operator_id): ... this. Adjust all callers.
812 (cp_literal_operator_id): Declare.
813 (set_global_friend): Declare.
814 (is_global_friend): Declare.
815 (enum cp_oracle_request): New type.
816 (cp_binding_oracle_function): New type.
817 (cp_binding_oracle): Declare.
818 (cp_finish_injected_record_type): Declare.
819 * friend.c (global_friend): New var.
820 (set_global_friend): New fn.
821 (is_global_friend): New fn.
822 (is_friend): Call is_global_friend.
823 * name-lookup.c (cp_binding_oracle): New var.
824 (query_oracle): New fn.
825 (qualified_lookup_using_namespace): Call query_oracle.
826 (lookup_name_real_1): Likewise.
827 * parser.c (cp_literal_operator_id): Drop static.
828 * search.c (friend_accessible_p): Call is_global_friend.
829 * semantics.c (is_this_parameter): Accept a variable if the
830 binding oracle is enabled.
832 2017-01-27 Jason Merrill <jason@redhat.com>
834 PR c++/78771 - ICE with inherited constructor.
835 * call.c (build_over_call): Call deduce_inheriting_ctor here.
836 * pt.c (tsubst_decl): Not here.
837 * class.c (add_method): Or here.
838 * method.c (deduce_inheriting_ctor): Handle clones.
839 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
841 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
844 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
846 * cp/cp-tree.h: Declare it.
847 * cp/semantics.c (finish_id_expression): Resolve names within a default
848 capturing generic lambda defined within a template prior to
849 instantiation to allow for captures to be added to the closure type.
851 2017-01-26 Jakub Jelinek <jakub@redhat.com>
854 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
855 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
856 * parser.c (cp_parser_builtin_offsetof): Pass result of
857 build_static_cast of null_pointer_node to finish_offsetof.
858 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
859 it for -Winvalid-offsetof pedwarn instead of trying to guess
860 original offsetof type from EXPR. Save OBJECT_PTR as a new
861 second operand to OFFSETOF_EXPR.
862 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
863 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
866 2017-01-26 Jason Merrill <jason@redhat.com>
868 * name-lookup.c (parse_using_directive): Deprecate strong using.
870 PR c++/79176 - lambda ICE with -flto -Os
871 * decl2.c (vague_linkage_p): Handle decloned 'tors.
872 * tree.c (decl_linkage): Likewise.
874 2017-01-25 Martin Sebor <msebor@redhat.com>
876 * decl.c (grokdeclarator): Fix a typo in a comment.
878 2017-01-25 Jakub Jelinek <jakub@redhat.com>
881 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
885 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
886 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
888 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
891 * decl.c (cxx_init_decl_processing): Pass main_input_filename
892 to build_translation_unit_decl.
894 2017-01-24 Jakub Jelinek <jakub@redhat.com>
897 * cp-gimplify.c (cp_genericize_r): Add result of
898 convert_from_reference on invisiref parm to p_set.
900 2017-01-24 Nathan Sidwell <nathan@acm.org>
902 PR c++/78469 - defaulted ctor and inaccessible dtor
903 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
904 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
905 * tree.c (build_target_expr): Check tf_no_cleanup.
907 PR c++/79118 - anon-members and constexpr
908 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
909 ctor decl. Recursively check anonymous members.
910 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
912 (explain_invalid_constexpr_fn): Likewise.
914 2017-01-23 Nathan Sidwell <nathan@acm.org>
916 PR c++/71710 - template using directive of field
917 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
920 PR c++/71406 - ICE with scope-ref'd template id exprs
922 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
923 before breaking up TEMPLATE_ID_EXPR.
925 2017-01-20 Nathan Sidwell <nathan@acm.org>
927 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
928 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
930 2017-01-20 David Malcolm <dmalcolm@redhat.com>
934 * cp-tree.h (suggest_alternatives_for): Add bool param.
935 (suggest_alternative_in_explicit_scope): New decl.
936 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
937 that isn't the global one, call new function
938 suggest_alternative_in_explicit_scope, only calling
939 suggest_alternatives_for if it fails, and disabling near match
940 searches fort that case. When SCOPE is the global namespace,
941 pass true for new param to suggest_alternatives_for to allow for
943 * lex.c (unqualified_name_lookup_error): Pass true for new param
944 to suggest_alternatives_for.
945 * name-lookup.c (consider_binding_level): Add forward decl.
946 (suggest_alternatives_for): Add "suggest_misspellings" param,
947 using it to conditionalize the fuzzy name-lookup code.
948 (suggest_alternative_in_explicit_scope): New function.
949 * parser.c (cp_parser_primary_expression): When calling
950 finish_id_expression, pass location of id_expression rather
951 than that of id_expr_token.
952 (cp_parser_id_expression): Convert local "unqualified_id" from
953 tree to cp_expr to avoid implicitly dropping location information.
955 2017-01-20 Marek Polacek <polacek@redhat.com>
958 * call.c (build_conditional_expr_1): Warn about duplicated branches.
959 * semantics.c (finish_expr_stmt): Build statement using the proper
962 2017-01-19 Jason Merrill <jason@redhat.com>
964 US 20 - forwarding references and class template argument deduction
965 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
966 * pt.c (push_template_decl_real): Set it.
967 (maybe_adjust_types_for_deduction): Check it.
968 (rewrite_template_parm): Copy it.
970 US 19 - deduction guides and constructors
971 * call.c (joust): Prefer deduction guides to constructors.
972 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
973 (deduction_guide_p): Check DECL_P.
975 * decl.c (check_initializer): Always use build_aggr_init for array
978 PR c++/79130 - decomposition and direct-initialization
979 * init.c (build_aggr_init): Communicate direct-initialization to
981 (build_vec_init): Check for array copy sooner.
982 * parser.c (cp_parser_decomposition_declaration): Remove call to
983 build_x_compound_expr_from_list.
985 2017-01-18 Jason Merrill <jason@redhat.com>
987 PR c++/68666 - member variable template-id
988 * typeck.c (finish_class_member_access_expr): Handle variable
990 * pt.c (lookup_and_finish_template_variable): No longer static.
991 * cp-tree.h: Declare it.
993 2017-01-18 Nathan Sidwell <nathan@acm.org>
996 * call.c (build_over_call): When checking ellipsis conversions for
997 an inherited ctor, make sure there is at least one conversion.
999 2017-01-18 Jason Merrill <jason@redhat.com>
1001 PR c++/78894 - ICE with class deduction and default arg
1002 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
1004 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
1007 * mangle.c (write_discriminator): Reorganize abi warning check.
1009 2017-01-18 Nathan Sidwell <nathan@acm.org>
1011 * cp-tree.h: Clarify exception spec node comment.
1012 * except.c (nothrow_spec_p): Simplify by checking node-equality.
1015 * mangle.c (write_exception_spec): Check nothrow explicitly.
1016 (write_encoding): Don't increment processing_template_decl around
1019 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
1022 * mangle.c (write_template_args): Add "on" for operator names.
1024 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
1027 * mangle.c (write_discriminator): Handle discriminator >= 10.
1029 2017-01-17 Nathan Sidwell <nathan@acm.org>
1032 * cp-tree.h (maybe_generic_this_capture): Declare.
1033 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
1034 (maybe_resolve_dummy): ... here. Call it.
1035 (maybe_generic_this_capture): New.
1036 * parser.c (cp_parser_postfix_expression): Speculatively capture
1037 this in generic lambda in unresolved member function call.
1038 * pt.c (tsubst_copy_and_build): Force hard error from failed
1039 member function lookup in generic lambda.
1041 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
1044 * cp-array-notation.c (expand_array_notation_exprs): Handle
1047 2017-01-11 Jason Merrill <jason@redhat.com>
1049 PR c++/78337 - ICE on invalid with generic lambda
1050 * semantics.c (process_outer_var_ref): Check if containing_function
1051 is null. Move inform call under complain test.
1053 2017-01-11 Nathan Sidwell <nathan@acm.org>
1056 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
1059 2017-01-11 Nathan Sidwell <nathan@acm.org>
1061 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
1063 2017-01-11 Jakub Jelinek <jakub@redhat.com>
1066 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
1067 assertion. Formatting fix.
1070 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
1073 2017-01-10 David Malcolm <dmalcolm@redhat.com>
1076 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
1077 a missing semicolon if we have a valid insertion location for
1080 2017-01-10 Jason Merrill <jason@redhat.com>
1082 FI 20, decomposition declaration with parenthesized initializer.
1083 * parser.c (cp_parser_decomposition_declaration): Use
1084 cp_parser_initializer.
1086 2017-01-09 Jason Merrill <jason@redhat.com>
1088 Implement P0195R2, C++17 variadic using.
1089 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
1090 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
1091 * error.c (dump_decl): Likewise.
1093 2017-01-09 Jakub Jelinek <jakub@redhat.com>
1095 PR translation/79019
1096 PR translation/79020
1097 * semantics.c (finish_omp_clauses): Add missing whitespace to
1098 translatable strings.
1099 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
1101 2017-01-07 Jason Merrill <jason@redhat.com>
1103 PR c++/78948 - instantiation from discarded statement
1104 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
1105 * cp-tree.h (in_discarded_stmt): Declare it.
1106 (struct saved_scope): Add discarded_stmt bitfield.
1107 (in_discarded_stmt): New macro.
1108 * decl2.c (mark_used): Check it.
1109 * parser.c (cp_parser_selection_statement): Adjust.
1110 (cp_parser_jump_statement): Adjust.
1112 2017-01-05 Jakub Jelinek <jakub@redhat.com>
1115 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
1116 REFERENCE_REF_P, set tt to its operand.
1119 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
1120 unions even for C++11 and later.
1122 2017-01-05 Nathan Sidwell <nathan@acm.org>
1125 * pt.c (convert_nontype_argument): Don't try and see if integral
1126 or enum expressions are constants prematurely.
1128 2017-01-04 Marek Polacek <polacek@redhat.com>
1131 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
1132 a zero character literal.
1134 2017-01-04 Jakub Jelinek <jakub@redhat.com>
1137 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
1141 * parser.c (cp_parser_simple_declaration): Only complain about
1142 inconsistent auto deduction if auto_result doesn't use auto.
1144 * parser.c (cp_parser_simple_declaration): Diagnose function
1145 declaration among more than one init-declarators with auto
1149 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
1150 assertion, as lexer->buffer may be NULL.
1152 2017-01-04 Marek Polacek <polacek@redhat.com>
1156 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
1158 2017-01-04 Nathan Sidwell <nathan@acm.org>
1161 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
1162 (lambda_capture_field_type): Update prototype.
1163 * lambda.c (lambda_capture_field_type): Add is_reference parm.
1164 Add referenceness here.
1165 (add_capture): Adjust lambda_capture_field_type call, refactor
1167 * pt.c (tsubst): Adjust lambda_capture_field_type call.
1169 2017-01-01 Jakub Jelinek <jakub@redhat.com>
1171 Update copyright years.
1173 Copyright (C) 2017 Free Software Foundation, Inc.
1175 Copying and distribution of this file, with or without modification,
1176 are permitted in any medium without royalty provided the copyright
1177 notice and this notice are preserved.