1 2017-03-31 Jakub Jelinek <jakub@redhat.com>
4 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
5 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
6 for NOP_EXPR to REFERENCE_TYPE.
9 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
10 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
12 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
13 Remove extraneous parens.
14 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
15 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
16 (cp_parser_trait_expr): Likewise.
18 2017-03-27 Jakub Jelinek <jakub@redhat.com>
21 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
22 * typeck.c (cxx_mark_addressable): Likewise. Look through
23 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
25 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
27 2017-03-24 Jason Merrill <jason@redhat.com>
29 PR c++/77339 - ICE with invalid use of alias template.
30 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
33 2017-03-24 Marek Polacek <polacek@redhat.com>
36 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
37 doesn't have side effects.
39 2017-03-23 Jason Merrill <jason@redhat.com>
41 PR c++/80150 - ICE with overloaded variadic deduction.
42 * pt.c (try_one_overload): Remove asserts.
44 PR c++/77563 - missing ambiguous conversion error.
45 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
47 2017-03-23 Marek Polacek <polacek@redhat.com>
49 * cp-tree.h: Remove a C_RID_YYCODE reference.
51 2017-03-22 Jakub Jelinek <jakub@redhat.com>
54 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
55 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
56 processing_template_decl.
58 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
61 * name-lookup.c (pushtag_1): Add check for bogus, non template,
62 std::initializer_list.
64 2017-03-21 Jakub Jelinek <jakub@redhat.com>
67 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
69 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
72 * init.c (std_placement_new_fn_p): New.
73 (build_new_1): Call it.
75 2017-03-20 Jason Merrill <jason@redhat.com>
77 PR c++/80096 - ICE with C++17 non-type auto.
78 * pt.c (tsubst): Delay tsubst of type of template non-type
81 PR c++/79519 - ICE with deleted template friend.
82 * decl.c (grokdeclarator): Complain about misplaced function
83 definition using =, as well.
85 PR c++/79640 - infinite recursion with generic lambda.
86 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
87 before substituting its initializer.
89 2017-03-20 Marek Polacek <polacek@redhat.com>
90 Paolo Carlini <paolo.carlini@oracle.com>
92 PR c++/80059 - ICE with noexcept and __transaction_atomic
93 * except.c (build_must_not_throw_expr): Call
94 instantiate_non_dependent_expr.
96 2017-03-19 Jason Merrill <jason@redhat.com>
98 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
99 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
100 reference decomposition.
102 PR c++/80077 - error with constexpr and -fno-elide-constructors.
103 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
104 expanding trivial constructor.
106 2017-03-17 Jason Merrill <jason@redhat.com>
108 PR c++/78345 - ICE initializing array from lambda.
109 * init.c (build_aggr_init): Check array initializer.
110 (build_vec_init): Check the type of a CONSTRUCTOR.
112 PR c++/80073 - C++17 ICE with virtual base.
113 * decl.c (xref_basetypes): Also check for indirect vbases.
115 2017-03-16 Jason Merrill <jason@redhat.com>
117 * decl.c (start_enum): std::byte aliases anything.
120 * constexpr.c (lookup_placeholder): Tweak.
122 2017-03-15 Jason Merrill <jason@redhat.com>
124 PR c++/80043 - ICE with -fpermissive
125 * typeck.c (convert_for_assignment): Handle instantiate_type
128 2017-03-14 Nathan Sidwell <nathan@acm.org>
130 PR c++/79393 DR 1658 workaround
131 * method.c (synthesized_method_base_walk): Inihibit abstract class
132 virtual base access check here.
133 (synthesized_method_walk): Not here.
135 2017-03-13 Nathan Sidwell <nathan@acm.org>
137 PR c++/79393 DR 1658 workaround
138 * method.c (synthesized_method_walk): Check vbases of abstract
139 classes for dtor walk.
141 2017-03-10 David Malcolm <dmalcolm@redhat.com>
144 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
146 2017-03-10 Jason Merrill <jason@redhat.com>
148 PR c++/79960 - alias templates and partial ordering
149 * pt.c (comp_template_args): Add partial_order parm.
150 (template_args_equal): Likewise.
151 (comp_template_args_porder): New.
152 (get_partial_spec_bindings): Use it.
154 2017-03-10 Marek Polacek <polacek@redhat.com>
157 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
159 2017-03-10 Jakub Jelinek <jakub@redhat.com>
162 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
163 Use XALLOCAVEC macro.
166 * decl.c (finish_enum_value_list): If value is error_mark_node,
167 don't copy it and change its type.
168 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
169 of CONST_DECL is error_mark_node.
171 2017-03-09 Marek Polacek <polacek@redhat.com>
173 PR c++/79900 - ICE in strip_typedefs
174 * tree.c (strip_typedefs): Skip the attribute handling if T is
175 a variant type which hasn't been updated yet.
177 PR c++/79687 - wrong code with pointer-to-member
178 * init.c (constant_value_1): Break if the variable has a dynamic
181 2017-03-08 Jason Merrill <jason@redhat.com>
183 PR c++/79797 - ICE with self-reference in array DMI.
184 * constexpr.c (lookup_placeholder): Split out...
185 (cxx_eval_constant_expression): ...from here.
187 2017-03-07 Jakub Jelinek <jakub@redhat.com>
190 * parser.c (cp_parser_omp_cancellation_point,
191 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
192 cp_parser_omp_target_update): Change "may only be used in compound
193 statements" diagnostics, such that the same translatable string is
194 used for all pragmas.
195 (cp_parser_pragma): Likewise. Use error_at instead of
196 cp_parser_error for that diagnostics.
198 2017-03-06 Marek Polacek <polacek@redhat.com>
200 PR c++/79796 - ICE with NSDMI and this pointer
201 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
202 replace_placeholders.
204 2017-03-06 Jakub Jelinek <jakub@redhat.com>
207 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
210 2017-03-06 Jason Merrill <jason@redhat.com>
212 Revert "Allow deduction guides to look into primary template."
213 * cp-tree.h, parser.c, pt.c, search.c: Revert.
215 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
218 * except.c (build_must_not_throw_expr): Perform the implicit
219 conversions on the condition.
221 2017-03-03 Jason Merrill <jason@redhat.com>
223 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
226 Core issues 2273 and 2277
227 * call.c (joust): Adjust using-declaration tiebreaker to handle
228 the intermediate base case.
229 * method.c (strip_inheriting_ctors): Just return the argument if
230 !flag_new_inheriting_ctors.
232 2017-03-03 Richard Biener <rguenther@suse.de>
235 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
237 2017-03-03 Marek Polacek <polacek@redhat.com>
240 * typeck.c (string_conv_p): In C++11, always call pedwarn with
243 2017-03-02 Jason Merrill <jason@redhat.com>
245 Update overload resolution with deduction guides.
246 * pt.c (do_class_deduction): Always build the copy guide.
247 (copy_guide_p, template_guide_p): New.
248 (build_deduction_guide): Remember the original constructor.
249 * call.c (joust): Prefer the copy guide and non-template guides.
251 Allow deduction guides to look into primary template.
252 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
253 (struct cp_decl_specifier_seq): Add constructor_p.
254 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
255 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
256 Clear deduction_guide_type. Don't handle deduction guide names.
257 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
258 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
259 (cp_parser_member_declaration, cp_parser_cache_defarg)
260 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
261 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
262 (build_deduction_guide): Set deduction_guide_type.
263 (dependent_scope_p): Check deduction_guide_type.
264 * search.c (lookup_member): Likewise.
266 2017-03-02 Jakub Jelinek <jakub@redhat.com>
269 * init.c (mark_exp_read_r): New function.
270 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
271 whole arguments instead of plain mark_exp_read on TREE_LIST values.
273 2017-03-01 Jason Merrill <jason@redhat.com>
275 Class template argument deduction in new-expression
276 * init.c (build_new): Handle deduction from no initializer.
277 * parser.c (cp_parser_new_expression): Don't require a single
278 expression for class template deduction.
279 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
280 class template placeholder.
281 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
282 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
283 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
285 2017-03-01 Jakub Jelinek <jakub@redhat.com>
288 * init.c (emit_mem_initializers): When not constructing vbases of
289 abstract classes, mark arguments as read for
290 -Wunused-but-set-parameter.
292 2017-02-28 Jason Merrill <jason@redhat.com>
294 Class template argument deduction refinements
295 * call.c (joust): Move deduction guide tiebreaker down.
296 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
297 deduction with no initializer.
298 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
299 (do_class_deduction): Use that rather than special case.
300 (do_auto_deduction): Handle null initializer.
302 2017-02-28 Jakub Jelinek <jakub@redhat.com>
304 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
305 instead of just cond ? "..." : "...".
306 (grokdeclarator): Likewise.
307 (build_enumerator): Likewise.
308 * init.c (build_new_1): Likewise.
309 * call.c (build_new_method_call_1): Likewise.
310 * parser.c: Include intl.h.
311 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
312 "enter"/"exit" keyword.
313 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
316 2017-02-27 Jason Merrill <jason@redhat.com>
318 PR c++/71568 - SFINAE forming pointer to member function
319 * init.c (build_offset_ref): Check the return value of
320 perform_or_defer_access_check.
322 2017-02-27 Marek Polacek <polacek@redhat.com>
324 * decl.c (expand_static_init): Add missing } in a comment.
326 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
328 * init.c: Include intl.h.
329 (build_new_1): Move message strings into pedwarn to make them
330 -Wformat-security friendly. Mark string for translation.
331 * pt.c (tsubst_copy_and_build): Mark string for translation.
332 Make the pointer const.
333 * semantics.c (finish_id_expression): Mark strings for translation.
335 2017-02-25 Jakub Jelinek <jakub@redhat.com>
337 * call.c (build_op_delete_call): Make msg1 and msg2 const.
339 2017-02-24 Jakub Jelinek <jakub@redhat.com>
342 * call.c (build_over_call): Call check_function_arguments even for
343 -Wrestrict, adjust check_function_arguments caller.
344 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
346 * typeck.c (cp_build_function_call_vec): Adjust
347 check_function_arguments caller.
349 2017-02-24 Marek Polacek <polacek@redhat.com>
352 * decl.c (check_redeclaration_exception_specification): Mark a string
353 for translation. Make the pointer const.
355 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
358 * pt.c (register_specialization): Check duplicate_decls return value
359 for error_mark_node and pass it back.
361 2017-02-22 Jason Merrill <jason@redhat.com>
363 PR c++/79679 - missing destructor for argument
364 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
367 * pt.c (do_class_deduction): Handle 0 argument case.
369 2017-02-22 Jakub Jelinek <jakub@redhat.com>
372 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
373 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
374 * constexpr.c (potential_constant_expression_1): Handle
375 OMP_*, OACC_* and CILK_* trees. Use error_at with
376 EXPR_LOC_OR_LOC (t, input_location) computed early
377 instead of error, or error_at with location_of (t).
379 2017-02-22 Marek Polacek <polacek@redhat.com>
382 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
383 if the alignas expression is erroneous.
384 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
388 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
390 2017-02-21 Jason Merrill <jason@redhat.com>
392 PR c++/50308 - wrong deprecated warning with ADL
393 PR c++/17729 - duplicate deprecated warning
394 * semantics.c (finish_id_expression): Only call mark_used on a
395 function if we aren't building a call.
397 PR c++/41727 - ICE with partial spec of partial instantiation
398 * pt.c (process_partial_specialization): For now, don't check more
399 specialized if there is more than one level of args.
401 2017-02-21 Marek Polacek <polacek@redhat.com>
404 * cp-tree.h (maybe_reject_flexarray_init): Declare.
405 * init.c (maybe_reject_flexarray_init): No longer static.
406 Add check for current_function_decl.
407 * parser.c (cp_parser_late_parse_one_default_arg): Reject
408 a default mem-initializer for a flexible array.
410 2017-02-21 Jakub Jelinek <jakub@redhat.com>
411 Paolo Carlini <paolo.carlini@oracle.com>
414 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
416 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
417 decl after the decomposition artificial decl has error_mark_node.
418 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
419 instead of just == error_mark_node comparison.
421 2017-02-21 Jakub Jelinek <jakub@redhat.com>
424 * decl.c: Include gimplify.h.
425 (cp_finish_decomp): Make sure there is no sharing of trees
426 in between DECL_VALUE_EXPR of decomposition decls.
429 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
432 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
433 call cplus_expand_constant on it first.
435 2017-02-19 Jason Merrill <jason@redhat.com>
437 PR c++/78139 - destructor needed by new-expression
438 * call.c (build_special_member_call): Use tf_no_cleanup.
440 PR c++/78282 - auto template and pack expansion
441 * pt.c (find_parameter_packs_r): Don't walk into the type of
442 templates other than template template-parameters.
444 PR c++/79606 - ICE with this->base_member in NSDMI
445 * class.c (build_base_path): Check processing_template_decl.
447 PR c++/79607 - ICE with T{} initializer
448 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
450 PR c++/79566 - elaborated-type-specifier in range for
451 * parser.c (cp_parser_simple_declaration): Fix check for type
454 PR c++/79400 - confusing suggestion of 'noexcept'
455 * parser.c (cp_parser_exception_specification_opt): Remove
456 suggestion for deprecated dynamic exception-specification.
458 PR c++/79470 - partial ordering with reference parameters
459 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
461 PR c++/79500 - ICE with non-template deduction guide
462 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
463 DECL_TEMPLATE_RESULT.
465 PR c++/79580 - ICE with compound literal
466 * parser.c (cp_parser_class_head): If we're in the middle of an
467 expression, use ts_within_enclosing_non_class.
469 PR c++/79503 - inherited ctor taking base class
470 * call.c (add_function_candidate): Also check that
471 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
473 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
476 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
479 2017-02-19 Eric Fiselier <eric@efcs.ca>
480 Jonathan Wakely <jwakely@redhat.com>
483 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
484 control warning about literal suffix identifiers without a leading
487 2017-02-17 Jason Merrill <jason@redhat.com>
489 PR c++/79508 - lookup error with member template
490 * parser.c (cp_parser_template_name): Clear
491 parser->context->object_type if we aren't doing lookup.
493 PR c++/78690 - ICE with using and global type with same name
494 * pt.c (type_dependent_object_expression_p): True for
497 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
498 * pt.c (convert_template_argument): Just return an auto arg pack.
499 (tsubst_template_args): Don't tsubst an auto pack type.
501 PR c++/79556 - C++17 ICE with non-type auto
502 * pt.c (do_auto_deduction): Don't try to deduce from null type.
504 PR c++/79533 - C++17 ICE with temporary cast to reference
505 * call.c (build_over_call): Conversion to a reference prevents copy
508 2017-02-16 Jakub Jelinek <jakub@redhat.com>
509 Jason Merrill <jason@redhat.com>
511 PR c++/79502 - lost nodiscard attribute
512 * pt.c (apply_late_template_attributes): Do apply non-dependent
515 2017-02-16 Jason Merrill <jason@redhat.com>
517 PR c++/78572 - ICE with self-modifying array initializer
518 * constexpr.c (cxx_eval_store_expression): The object we're
519 initializing is outside the constant-expression.
520 (cxx_eval_call_expression): Set ctx->call.
522 PR c++/79050 - ICE with undeduced auto and LTO
523 * decl.c (poplevel): Remove undeduced auto decls.
525 2017-02-16 Jakub Jelinek <jakub@redhat.com>
528 * parser.c (cp_parser_omp_target): For -fopenmp-simd
529 ignore #pragma omp target even when not followed by identifier.
531 2017-02-15 Jason Merrill <jason@redhat.com>
532 Jakub Jelinek <jakub@redhat.com>
534 PR c++/79464 - ICE in IPA with omitted constructor parms
535 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
536 (adjust_clone_args): Adjust.
537 (add_method): Remember omitted parms.
538 * call.c (add_function_candidate): Likewise.
539 * mangle.c (write_method_parms): Likewise.
540 * method.c (ctor_omit_inherited_parms): Return false if there are no
543 2017-02-15 Martin Sebor <msebor@redhat.com>
546 * init.c (maybe_reject_flexarray_init): New function.
547 (perform_member_init): Call it.
549 2017-02-15 Jakub Jelinek <jakub@redhat.com>
552 * parser.c (cp_parser_std_attribute): Don't pedwarn about
553 [[deprecated]] with -std=c++11 and [[fallthrough]] with
554 -std=c++11 and -std=c++14.
557 * decl.c (grokdeclarator): For static data members, handle thread_p
558 only after handling inline.
560 2017-02-14 Marek Polacek <polacek@redhat.com>
564 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
565 clobbering if the postfix expression isn't an EXPR_P.
567 2017-02-13 Jason Merrill <jason@redhat.com>
569 PR c++/79461 - ICE with lambda in constexpr constructor
570 * constexpr.c (build_data_member_initialization): Ignore
571 initialization of a local variable.
573 2017-02-13 Jakub Jelinek <jakub@redhat.com>
575 * init.c (warn_placement_new_too_small): Add missing space in
577 * parser.c (cp_parser_oacc_declare): Likewise.
578 * mangle.c (maybe_check_abi_tags): Likewise.
581 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
582 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
583 in the rightmost operand.
585 2017-02-13 Nathan Sidwell <nathan@acm.org>
587 PR c++/79296 - ICE mangling localized template instantiation
588 * decl2.c (determine_visibility): Use template fn context for
589 local class instantiations.
591 2017-02-11 Jason Merrill <jason@redhat.com>
593 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
594 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
595 (build_new_1): Use replace_placeholders.
596 * tree.c (replace_placeholders_t): Also track whether we've seen a
598 (replace_placeholders, replace_placeholders_r): Adjust.
601 PR c++/77790 - ICE with auto function in C++11 mode
602 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
603 (require_deduced_type): Add complain parm, return bool.
605 * decl2.c (mark_used): Use require_deduced_type.
607 2017-02-10 Jason Merrill <jason@redhat.com>
609 PR c++/78908 - template ops and bitfields
610 * tree.c (build_min_non_dep): Use unlowered_expr_type.
612 PR c++/78897 - constexpr union
613 * constexpr.c (cxx_eval_store_expression): A store to a union member
614 erases a previous store to another member.
616 PR c++/71285 - member of fold-expression
617 * semantics.c (finish_unary_fold_expr)
618 (finish_binary_fold_expr): Use null type for fold-expressions.
620 PR c++/79401 - protected inherited constructor
621 * call.c (enforce_access): For inheriting constructor, find a base
622 binfo in the path we already have.
624 2017-02-10 Marek Polacek <polacek@redhat.com>
627 * pt.c (type_dependent_expression_p): Check if the expression type
631 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
632 if warnings shouldn't be given.
634 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
637 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
638 an error_mark_node as type.
640 2017-02-09 Jakub Jelinek <jakub@redhat.com>
641 Jason Merrill <jason@redhat.com>
644 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
645 from pattern to type.
647 2017-02-09 Jason Merrill <jason@redhat.com>
649 PR c++/79316 - default argument in deduction guide
650 PR c++/79350 - explicit deduction guide
651 * parser.c (cp_parser_constructor_declarator_p)
652 (cp_parser_direct_declarator): Parse deduction guides more like
654 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
655 * tree.c (special_function_p): Return it.
656 * decl.c (check_special_function_return_type): Handle it.
657 (grokdeclarator, grokfndecl): Adjust.
658 (cp_finish_decl): Pass flags to do_auto_deduction.
659 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
660 * pt.c (dguide_name_p): Take a const_tree.
661 (do_class_deduction): Handle explicit.
662 (do_auto_deduction): Pass flags through.
663 (build_deduction_guide): Copy explicit flag.
665 2017-02-09 Jakub Jelinek <jakub@redhat.com>
668 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
669 non-pragma_compound context here.
670 (cp_parser_omp_target): Likewise.
671 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
672 parsing for ordered and target omp pragmas in non-pragma_stmt
673 non-pragma_compound contexts.
676 * parser.c (cp_parser_oacc_declare): Formatting fix.
677 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
680 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
681 Chung-Lin Tang <cltang@codesourcery.com>
683 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
684 parsing. Parse constant expression. Remove semantic checking.
685 (cp_parser_omp_clause_collapse): Disallow tile.
686 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
687 error about missing for after already emitting one. Use more
688 conventional for idiom for unbounded loop.
689 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
690 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
691 (finish_omp_for): Deal with tile clause.
693 2017-02-07 Nathan Sidwell <nathan@acm.org>
695 * method.c (synthesized_method_base_walk): New. Broken out of ...
696 (synthesized_method_walk): ... here. Call it. Cleanup
699 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
702 * typeck2.c (process_init_constructor_union): Consider only
703 FIELD_DECLs when looking for an NSDMI.
705 2017-02-06 Jason Merrill <jason@redhat.com>
707 PR c++/71193 - incomplete types in templates
708 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
709 handle incomplete type by pedwarning and then treating as dependent.
711 2017-02-06 Jakub Jelinek <jakub@redhat.com>
714 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
715 (potential_constant_expression_1): Likewise.
718 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
719 allow one fewer than expected arguments if flag_permissive.
722 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
723 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
724 with error_mark_node type.
726 2017-02-03 Jason Merrill <jason@redhat.com>
728 PR c++/78689 - ICE on constructor with label
729 * optimize.c (maybe_clone_body): Replace omitted parameters with
731 * class.c (build_clone): Fix logic for omitting inherited parms.
733 PR c++/12245 - excessive memory use
734 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
735 back in. Don't cache constants.
736 (maybe_constant_init): Don't cache constants.
738 PR c++/79294 - ICE with invalid template argument
739 * pt.c (convert_nontype_argument_function): Check value-dependence.
740 (convert_nontype_argument): Don't check it here for function ptrs.
742 2017-02-02 Richard Biener <rguenther@suse.de>
745 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
746 it lazily on the first changed element only and copy it
747 fully upfront, only storing changed elements.
749 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
752 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
755 2017-01-31 Jakub Jelinek <jakub@redhat.com>
758 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
761 2017-01-31 David Malcolm <dmalcolm@redhat.com>
764 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
765 any namespace aliases.
767 2017-01-31 Nathan Sidwell <nathan@acm.org>
770 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
774 * pt.c: (instantiate_decl): Push to top level when current
775 function scope doesn't match. Only push lmabda scope stack when
778 * cp-tree.h (instantiate_decl): Make defer_ok bool.
779 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
780 (instantiate_decl): Simplify and reorder state saving and restoration.
783 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
784 * semantics.c (finish_member_declaration): Assert class is being
787 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
789 Introduce C++ support in libcc1.
790 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
791 (ansi_opname): Rename to...
792 (cp_operator_id): ... this. Adjust all callers.
793 (ansi_assopname): Rename to...
794 (cp_assignment_operator_id): ... this. Adjust all callers.
795 (cp_literal_operator_id): Declare.
796 (set_global_friend): Declare.
797 (is_global_friend): Declare.
798 (enum cp_oracle_request): New type.
799 (cp_binding_oracle_function): New type.
800 (cp_binding_oracle): Declare.
801 (cp_finish_injected_record_type): Declare.
802 * friend.c (global_friend): New var.
803 (set_global_friend): New fn.
804 (is_global_friend): New fn.
805 (is_friend): Call is_global_friend.
806 * name-lookup.c (cp_binding_oracle): New var.
807 (query_oracle): New fn.
808 (qualified_lookup_using_namespace): Call query_oracle.
809 (lookup_name_real_1): Likewise.
810 * parser.c (cp_literal_operator_id): Drop static.
811 * search.c (friend_accessible_p): Call is_global_friend.
812 * semantics.c (is_this_parameter): Accept a variable if the
813 binding oracle is enabled.
815 2017-01-27 Jason Merrill <jason@redhat.com>
817 PR c++/78771 - ICE with inherited constructor.
818 * call.c (build_over_call): Call deduce_inheriting_ctor here.
819 * pt.c (tsubst_decl): Not here.
820 * class.c (add_method): Or here.
821 * method.c (deduce_inheriting_ctor): Handle clones.
822 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
824 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
827 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
829 * cp/cp-tree.h: Declare it.
830 * cp/semantics.c (finish_id_expression): Resolve names within a default
831 capturing generic lambda defined within a template prior to
832 instantiation to allow for captures to be added to the closure type.
834 2017-01-26 Jakub Jelinek <jakub@redhat.com>
837 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
838 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
839 * parser.c (cp_parser_builtin_offsetof): Pass result of
840 build_static_cast of null_pointer_node to finish_offsetof.
841 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
842 it for -Winvalid-offsetof pedwarn instead of trying to guess
843 original offsetof type from EXPR. Save OBJECT_PTR as a new
844 second operand to OFFSETOF_EXPR.
845 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
846 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
849 2017-01-26 Jason Merrill <jason@redhat.com>
851 * name-lookup.c (parse_using_directive): Deprecate strong using.
853 PR c++/79176 - lambda ICE with -flto -Os
854 * decl2.c (vague_linkage_p): Handle decloned 'tors.
855 * tree.c (decl_linkage): Likewise.
857 2017-01-25 Martin Sebor <msebor@redhat.com>
859 * decl.c (grokdeclarator): Fix a typo in a comment.
861 2017-01-25 Jakub Jelinek <jakub@redhat.com>
864 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
868 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
869 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
871 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
874 * decl.c (cxx_init_decl_processing): Pass main_input_filename
875 to build_translation_unit_decl.
877 2017-01-24 Jakub Jelinek <jakub@redhat.com>
880 * cp-gimplify.c (cp_genericize_r): Add result of
881 convert_from_reference on invisiref parm to p_set.
883 2017-01-24 Nathan Sidwell <nathan@acm.org>
885 PR c++/78469 - defaulted ctor and inaccessible dtor
886 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
887 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
888 * tree.c (build_target_expr): Check tf_no_cleanup.
890 PR c++/79118 - anon-members and constexpr
891 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
892 ctor decl. Recursively check anonymous members.
893 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
895 (explain_invalid_constexpr_fn): Likewise.
897 2017-01-23 Nathan Sidwell <nathan@acm.org>
899 PR c++/71710 - template using directive of field
900 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
903 PR c++/71406 - ICE with scope-ref'd template id exprs
905 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
906 before breaking up TEMPLATE_ID_EXPR.
908 2017-01-20 Nathan Sidwell <nathan@acm.org>
910 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
911 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
913 2017-01-20 David Malcolm <dmalcolm@redhat.com>
917 * cp-tree.h (suggest_alternatives_for): Add bool param.
918 (suggest_alternative_in_explicit_scope): New decl.
919 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
920 that isn't the global one, call new function
921 suggest_alternative_in_explicit_scope, only calling
922 suggest_alternatives_for if it fails, and disabling near match
923 searches fort that case. When SCOPE is the global namespace,
924 pass true for new param to suggest_alternatives_for to allow for
926 * lex.c (unqualified_name_lookup_error): Pass true for new param
927 to suggest_alternatives_for.
928 * name-lookup.c (consider_binding_level): Add forward decl.
929 (suggest_alternatives_for): Add "suggest_misspellings" param,
930 using it to conditionalize the fuzzy name-lookup code.
931 (suggest_alternative_in_explicit_scope): New function.
932 * parser.c (cp_parser_primary_expression): When calling
933 finish_id_expression, pass location of id_expression rather
934 than that of id_expr_token.
935 (cp_parser_id_expression): Convert local "unqualified_id" from
936 tree to cp_expr to avoid implicitly dropping location information.
938 2017-01-20 Marek Polacek <polacek@redhat.com>
941 * call.c (build_conditional_expr_1): Warn about duplicated branches.
942 * semantics.c (finish_expr_stmt): Build statement using the proper
945 2017-01-19 Jason Merrill <jason@redhat.com>
947 US 20 - forwarding references and class template argument deduction
948 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
949 * pt.c (push_template_decl_real): Set it.
950 (maybe_adjust_types_for_deduction): Check it.
951 (rewrite_template_parm): Copy it.
953 US 19 - deduction guides and constructors
954 * call.c (joust): Prefer deduction guides to constructors.
955 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
956 (deduction_guide_p): Check DECL_P.
958 * decl.c (check_initializer): Always use build_aggr_init for array
961 PR c++/79130 - decomposition and direct-initialization
962 * init.c (build_aggr_init): Communicate direct-initialization to
964 (build_vec_init): Check for array copy sooner.
965 * parser.c (cp_parser_decomposition_declaration): Remove call to
966 build_x_compound_expr_from_list.
968 2017-01-18 Jason Merrill <jason@redhat.com>
970 PR c++/68666 - member variable template-id
971 * typeck.c (finish_class_member_access_expr): Handle variable
973 * pt.c (lookup_and_finish_template_variable): No longer static.
974 * cp-tree.h: Declare it.
976 2017-01-18 Nathan Sidwell <nathan@acm.org>
979 * call.c (build_over_call): When checking ellipsis conversions for
980 an inherited ctor, make sure there is at least one conversion.
982 2017-01-18 Jason Merrill <jason@redhat.com>
984 PR c++/78894 - ICE with class deduction and default arg
985 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
987 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
990 * mangle.c (write_discriminator): Reorganize abi warning check.
992 2017-01-18 Nathan Sidwell <nathan@acm.org>
994 * cp-tree.h: Clarify exception spec node comment.
995 * except.c (nothrow_spec_p): Simplify by checking node-equality.
998 * mangle.c (write_exception_spec): Check nothrow explicitly.
999 (write_encoding): Don't increment processing_template_decl around
1002 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
1005 * mangle.c (write_template_args): Add "on" for operator names.
1007 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
1010 * mangle.c (write_discriminator): Handle discriminator >= 10.
1012 2017-01-17 Nathan Sidwell <nathan@acm.org>
1015 * cp-tree.h (maybe_generic_this_capture): Declare.
1016 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
1017 (maybe_resolve_dummy): ... here. Call it.
1018 (maybe_generic_this_capture): New.
1019 * parser.c (cp_parser_postfix_expression): Speculatively capture
1020 this in generic lambda in unresolved member function call.
1021 * pt.c (tsubst_copy_and_build): Force hard error from failed
1022 member function lookup in generic lambda.
1024 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
1027 * cp-array-notation.c (expand_array_notation_exprs): Handle
1030 2017-01-11 Jason Merrill <jason@redhat.com>
1032 PR c++/78337 - ICE on invalid with generic lambda
1033 * semantics.c (process_outer_var_ref): Check if containing_function
1034 is null. Move inform call under complain test.
1036 2017-01-11 Nathan Sidwell <nathan@acm.org>
1039 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
1042 2017-01-11 Nathan Sidwell <nathan@acm.org>
1044 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
1046 2017-01-11 Jakub Jelinek <jakub@redhat.com>
1049 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
1050 assertion. Formatting fix.
1053 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
1056 2017-01-10 David Malcolm <dmalcolm@redhat.com>
1059 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
1060 a missing semicolon if we have a valid insertion location for
1063 2017-01-10 Jason Merrill <jason@redhat.com>
1065 FI 20, decomposition declaration with parenthesized initializer.
1066 * parser.c (cp_parser_decomposition_declaration): Use
1067 cp_parser_initializer.
1069 2017-01-09 Jason Merrill <jason@redhat.com>
1071 Implement P0195R2, C++17 variadic using.
1072 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
1073 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
1074 * error.c (dump_decl): Likewise.
1076 2017-01-09 Jakub Jelinek <jakub@redhat.com>
1078 PR translation/79019
1079 PR translation/79020
1080 * semantics.c (finish_omp_clauses): Add missing whitespace to
1081 translatable strings.
1082 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
1084 2017-01-07 Jason Merrill <jason@redhat.com>
1086 PR c++/78948 - instantiation from discarded statement
1087 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
1088 * cp-tree.h (in_discarded_stmt): Declare it.
1089 (struct saved_scope): Add discarded_stmt bitfield.
1090 (in_discarded_stmt): New macro.
1091 * decl2.c (mark_used): Check it.
1092 * parser.c (cp_parser_selection_statement): Adjust.
1093 (cp_parser_jump_statement): Adjust.
1095 2017-01-05 Jakub Jelinek <jakub@redhat.com>
1098 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
1099 REFERENCE_REF_P, set tt to its operand.
1102 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
1103 unions even for C++11 and later.
1105 2017-01-05 Nathan Sidwell <nathan@acm.org>
1108 * pt.c (convert_nontype_argument): Don't try and see if integral
1109 or enum expressions are constants prematurely.
1111 2017-01-04 Marek Polacek <polacek@redhat.com>
1114 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
1115 a zero character literal.
1117 2017-01-04 Jakub Jelinek <jakub@redhat.com>
1120 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
1124 * parser.c (cp_parser_simple_declaration): Only complain about
1125 inconsistent auto deduction if auto_result doesn't use auto.
1127 * parser.c (cp_parser_simple_declaration): Diagnose function
1128 declaration among more than one init-declarators with auto
1132 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
1133 assertion, as lexer->buffer may be NULL.
1135 2017-01-04 Marek Polacek <polacek@redhat.com>
1139 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
1141 2017-01-04 Nathan Sidwell <nathan@acm.org>
1144 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
1145 (lambda_capture_field_type): Update prototype.
1146 * lambda.c (lambda_capture_field_type): Add is_reference parm.
1147 Add referenceness here.
1148 (add_capture): Adjust lambda_capture_field_type call, refactor
1150 * pt.c (tsubst): Adjust lambda_capture_field_type call.
1152 2017-01-01 Jakub Jelinek <jakub@redhat.com>
1154 Update copyright years.
1156 Copyright (C) 2017 Free Software Foundation, Inc.
1158 Copying and distribution of this file, with or without modification,
1159 are permitted in any medium without royalty provided the copyright
1160 notice and this notice are preserved.