Update ChangeLog and version files for release
[official-gcc.git] / gcc / cp / ChangeLog
blobb5d15c7b615297b429fb0408cdf78c5084e6f50f
1 2018-01-25  Release Manager
3         * GCC 7.3.0 released.
5 2018-01-17  Jason Merrill  <jason@redhat.com>
7         PR c++/81843 - ICE with variadic member template.
8         PR c++/72801
9         * pt.c (unify_pack_expansion): Don't try to deduce enclosing
10         template args.
12         PR c++/82331 - ICE with variadic partial specialization of auto
13         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Set processing_template_decl
14         around call to tsubst.
16         PR c++/82760 - memory corruption with aligned new.
17         * call.c (build_operator_new_call): Update *args if we add the
18         align_arg.
20 2018-01-02  Jakub Jelinek  <jakub@redhat.com>
22         PR c++/83556
23         * tree.c (replace_placeholders_r): Pass NULL as last argument to
24         cp_walk_tree instead of d->pset.  If non-TREE_CONSTANT and
25         non-PLACEHOLDER_EXPR tree has been seen already, set *walk_subtrees
26         to false and return.
27         (replace_placeholders): Pass NULL instead of &pset as last argument
28         to cp_walk_tree.
30 2017-12-19  Marek Polacek  <polacek@redhat.com>
32         Backported from mainline
33         2017-12-18  Marek Polacek  <polacek@redhat.com>
35         PR c++/83116
36         * constexpr.c (cxx_eval_call_expression): Only look into
37         constexpr_call_table if ctx->strict.
39 2017-12-16  Jakub Jelinek  <jakub@redhat.com>
41         Backported from mainline
42         2017-12-15  Jakub Jelinek  <jakub@redhat.com>
44         PR c++/83205
45         * decl.c (cp_finish_decomp): Handle the case when tsize is not
46         error_mark_node, but doesn't fit into uhwi.  Split up count != eltscnt
47         and !tree_fits_uhwi_p (tsize) error_at calls into error_n and inform_n
48         to handle plural forms properly.
50         PR c++/81197
51         * cp-tree.h (cp_maybe_mangle_decomp): Declare.
52         * decl.c (cp_maybe_mangle_decomp): New function.
53         (cp_finish_decomp): Don't SET_DECL_ASSEMBLER_NAME here.
54         * parser.c (cp_convert_range_for,
55         cp_parser_decomposition_declaration): Call cp_maybe_mangle_decomp.
56         * pt.c (tsubst_expr): Likewise.
57         * mangle.c (find_decomp_unqualified_name): New function.
58         (write_unqualified_name): Handle DECL_DECOMPOSITION_P
59         where DECL_ASSEMBLER_NAME is already set.
61 2017-12-15  Jakub Jelinek  <jakub@redhat.com>
63         PR c++/83217
64         * decl.c (cp_finish_decomp): If decl's type is REFERENCE_TYPE,
65         call complete_type (TREE_TYPE (type)).
67         Backported from mainline
68         2017-12-14  Jakub Jelinek  <jakub@redhat.com>
70         PR c++/79650
71         * pt.c (convert_nontype_argument): Diagnose
72         reduced_constant_expression_p expressions that aren't INTEGER_CST.
74         2017-12-06  Jakub Jelinek  <jakub@redhat.com>
76         PR c++/80259
77         * decl2.c (grokfield): Diagnose = delete redefinition of a friend.
79         2017-11-27  Jakub Jelinek  <jakub@redhat.com>
81         PR c++/81888
82         * parser.c (cp_parser_decomposition_declaration): Reject just
83         BRACE_ENCLOSED_INITIALIZER_P initializers with nelts != 1 rather
84         than all such CONSTRUCTORs, and only if is_direct_init is true.
86         PR c++/81675
87         * cp-gimplify.c (cp_fold) <case COND_EXPR>: Don't return immediately
88         for VOID_TYPE_P COND_EXPRs, instead fold the operands and if op0 is
89         INTEGER_CST, ensure that both op1 and op2 are non-NULL and fall
90         through into normal folding, otherwise just rebuild x if any op
91         changed.
93         2017-11-23  Jakub Jelinek  <jakub@redhat.com>
95         * parser.c (cp_parser_omp_declare): Change return type to bool from
96         void, return true for declare simd.
97         (cp_parser_pragma): Return cp_parser_omp_declare returned value
98         rather than always false.
100         2017-11-20  Jakub Jelinek  <jakub@redhat.com>
102         PR c++/82781
103         * constexpr.c (cxx_eval_vector_conditional_expression): New function.
104         (cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
105         of cxx_eval_conditional_expression.
107 2017-10-30  Paolo Carlini  <paolo.carlini@oracle.com>
109         PR c++/82085
110         * pt.c (tsubst_copy_and_build, [INDIRECT_REF]): For a REFERENCE_REF_P,
111         unconditionally call convert_from_reference.
113 2017-10-27  Jakub Jelinek  <jakub@redhat.com>
115         Backported from mainline
116         2017-10-04  Jakub Jelinek  <jakub@redhat.com>
118         PR c++/82373
119         * error.c (dump_function_decl): If show_return, call dump_type_suffix
120         on the same return type dump_type_prefix has been called on.
122 2017-10-17  Nathan Sidwell  <nathan@acm.org>
124         PR c++/82560
125         * call.c (build_over_call): Don't pass tf_no_cleanup to nested
126         calls.
128 2017-10-06  Jakub Jelinek  <jakub@redhat.com>
130         PR c++/82299
131         * decl.c (reshape_init): Suppress warn_useless_cast for direct enum
132         init.
133         * typeck.c (convert_for_assignment): Likewise.
135 2017-10-05  Jason Merrill  <jason@redhat.com>
137         * call.c (convert_arg_to_ellipsis): Use the result of force_rvalue.
139 2017-10-04  Jason Merrill  <jason@redhat.com>
141         PR c++/82406 - C++ error with noexcept function type
142         PR c++/70029 - ICE with ref-qualifier and -flto
143         * tree.c (cxx_copy_lang_qualifiers): New.
144         * cp-tree.h: Declare it.
145         * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
147         PR c++/81525 - broken handling of auto in generic lambda.
148         * pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.
150 2017-09-22  Eric Botcazou  <ebotcazou@adacore.com>
152         PR bootstrap/81926
153         * cp-objcp-common.c (cp_get_debug_type): Do only one lookup
155 2017-09-22  Jakub Jelinek  <jakub@redhat.com>
157         PR sanitizer/81929
158         * tree.c (struct replace_placeholders_t): Add pset field.
159         (replace_placeholders_r): Call cp_walk_tree with d->pset as
160         last argument instead of NULL.  Formatting fix.
161         (replace_placeholders): Add pset variable, add its address
162         into data.  Pass &pset instead of NULL to cp_walk_tree.
164 2017-09-18  Jason Merrill  <jason@redhat.com>
166         PR c++/81236 - ICE with template-id in generic lambda
167         * parser.c (parsing_default_capturing_generic_lambda): Don't check
168         for enclosing template.
169         * semantics.c (finish_qualified_id_expr): Call it.
170         * cp-tree.h: Adjust.
172         PR c++/80767 - unnecessary instantiation of generic lambda
173         PR c++/82030 - ICE inheriting from multiple lambdas
174         * call.c (convert_like_real): Call build_user_type_conversion_1 if
175         cand is null.
176         (add_conv_candidate): Build a ck_user conversion with no candidate.
178         PR c++/80935 - wrong C++17 error with lambda
179         * decl.c (check_for_uninitialized_const_var): Check
180         is_instantiation_of_constexpr.
182         PR c++/81671 - nullptr_t template parameter
183         * pt.c (convert_nontype_argument): Fix nullptr_t check.
185         PR c++/81525 - wrong constant value with generic lambda
186         * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
187         (tsubst_copy) [VAR_DECL]: Handle auto.
189 2017-09-15  Jakub Jelinek  <jakub@redhat.com>
191         Backported from mainline
192         2017-09-14  Jakub Jelinek  <jakub@redhat.com>
194         PR c++/81314
195         * cp-gimplify.c (omp_var_to_track): Look through references.
196         (omp_cxx_notice_variable): Likewise.
198 2017-09-09  Eric Botcazou  <ebotcazou@adacore.com>
200         PR bootstrap/81926
201         * cp-objcp-common.c (struct debug_type_hasher): New class.
202         (debug_type_hash): New variable.
203         (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
205 2017-09-01  Marek Polacek  <polacek@redhat.com>
207         Backported from mainline
208         2017-09-01  Marek Polacek  <polacek@redhat.com>
210         PR c++/82040
211         * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
213 2017-08-25  Marek Polacek  <polacek@redhat.com>
215         Backported from mainline
216         2017-08-08  Marek Polacek  <polacek@redhat.com>
218         PR c++/81607
219         * cp-gimplify.c (cp_fold): If folding exposed a branch of
220         a COND_EXPR, convert it to the original type of the COND_EXPR, if
221         they differ.               
223 2017-08-14  Release Manager
225         * GCC 7.2.0 released.
227 2017-08-09  Leonid Koppel  <lkoppel@uwaterloo.ca>
229         PR c++/67054 - Inherited ctor with non-default-constructible members
230         * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
231         when deducing an inheriting constructor.
233 2017-07-27  Paolo Carlini  <paolo.carlini@oracle.com>
235         PR c++/71570
236         * lambda.c (add_capture): Early return if we cannot capture by
237         reference.
239 2017-07-17  Jakub Jelinek  <jakub@redhat.com>
241         Backported from mainline
242         2017-07-04  Jakub Jelinek  <jakub@redhat.com>
244         PR c++/81258
245         * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
246         forms of structured binding initializers.
248 2017-07-06  Jason Merrill  <jason@redhat.com>
250         PR c++/81204 - parse error with dependent template-name
251         * parser.c (cp_parser_lookup_name): Revert previous change.
253 2017-06-30  Jason Merrill  <jason@redhat.com>
255         PR c++/54769 - wrong lookup of dependent template-name.
256         PR c++/81257 - ICE with invalid ::template.
257         * parser.c (cp_parser_template_name): Handle dependent object type.
258         (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
259         parameter.
260         (cp_parser_id_expression): Pass it.
262 2017-06-29  Jason Merrill  <jason@redhat.com>
264         PR c++/81180 - ICE with C++17 deduction of member class template.
265         * pt.c (build_deduction_guide): Correct member template handling.
267         PR c++/81188 - matching decltype of member function call.
268         * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
270         PR c++/81164 - ICE with invalid inherited constructor.
271         * search.c (binfo_direct_p): New.
272         * name-lookup.c (do_class_using_decl): Use it.
274 2017-06-28  Jason Merrill  <jason@redhat.com>
276         PR c++/61022 - error with variadic template template parm
277         * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
279         PR c++/72801 - ICE with variadic partial specialization
280         * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
282         PR c++/81204 - parse error with dependent template-name
283         * parser.c (cp_parser_lookup_name): Disqualify function templates
284         after lookup.
286 2017-06-26  Jason Merrill  <jason@redhat.com>
288         PR c++/81215
289         * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
291 2017-06-23  Jason Merrill  <jason@redhat.com>
293         PR c++/79056 - C++17 ICE with invalid template syntax.
294         * parser.c (cp_parser_simple_type_specifier): Don't assume that type
295         is a TYPE_DECL.
296         (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
297         * pt.c (template_placeholder_p): New.
298         * cp-tree.h: Declare it.
300 2017-06-21  Jakub Jelinek  <jakub@redhat.com>
302         PR c++/81154
303         * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
304         Complain about t not being a variable if t is OVERLOAD even
305         when processing_template_decl.
307         Backported from mainline
308         2017-06-13  Jakub Jelinek  <jakub@redhat.com>
310         PR c++/80973
311         * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
312         argument even if it has REFERENCE_TYPE.
314         PR c++/80984
315         * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
316         BLOCK_VARS (outer) chain.
317         (cxx_omp_const_qual_no_mutable): Likewise.
319 2017-06-20  Jason Merrill  <jason@redhat.com>
321         PR c++/80972 - C++17 ICE with attribute packed.
322         * call.c (build_over_call): Allow a TARGET_EXPR from reference
323         binding.
325 2017-06-19  Jason Merrill  <jason@redhat.com>
327         PR c++/80562 - ICE with constexpr if.
328         * semantics.c (finish_if_stmt_cond): Call
329         instantiate_non_dependent_expr.
331         PR c++/80829 - ICE with constexpr copy of base subobject.
332         * constexpr.c (clear_no_implicit_zero): New.
333         (cxx_eval_call_expression): Call it.
335         PR c++/81073 - constexpr and static var in statement-expression.
336         * constexpr.c (cxx_eval_constant_expression) [DECL_EXPR]: Check
337         potential_constant_expression.
339 2017-06-17  Jason Merrill  <jason@redhat.com>
341         PR c++/60063 - -Wunused-local-typedefs and templates.
342         * decl2.c (is_late_template_attribute): Return false for "used".
344         PR c++/70844 - -Wuseless-cast and inheriting constructor.
345         * method.c (forward_parm): Suppress warn_useless_cast.
347 2017-06-16  Jason Merrill  <jason@redhat.com>
349         PR c++/81045 - Wrong type-dependence with auto return type.
350         * pt.c (type_dependent_expression_p): An undeduced auto outside the
351         template isn't dependent.
352         * call.c (build_over_call): Instantiate undeduced auto even in a
353         template.
355         PR c++/81102 - Wrong error with partial specialization.
356         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
357         types.  Do type deduction later.
359         PR c++/81074 - ICE with partial specialization of member template.
360         PR c++/71747
361         * pt.c (get_partial_spec_bindings): Only coerce innermost args.
363         PR c++/80831 - ICE with -fsyntax-only.
364         * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
366         PR c++/80639 - ICE with invalid PMF initialization.
367         PR c++/80043 - ICE with -fpermissive
368         * typeck.c (convert_for_assignment): Recurse when instantiate_type
369         returns without an error.
371         PR c++/80465 - ICE with generic lambda with noexcept-specifier.
372         * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
373         set longer for a generic lambda.
375         PR c++/80614 - Wrong mangling for C++17 noexcept type
376         * mangle.c (write_type): Put the eh spec back on the function type.
378         PR c++/80384 - ICE with dependent noexcept-specifier
379         * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
380         noexcept-specifier.
382         * parser.c (cp_parser_constant_expression): Check
383         potential_rvalue_constant_expression after decay_conversion.
384         * pt.c (convert_nontype_argument): Don't require linkage in C++17.
386         * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
388 2017-06-08  Jakub Jelinek  <jakub@redhat.com>
390         PR c/81006
391         * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
392         to sizetype before size_binop.
394         PR c++/81011
395         * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
396         to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
397         and OMP_CLAUSE_SHARED_READONLY flags.
399 2017-06-05  Volker Reichelt  <v.reichelt@netcologne.de>
401         * parser.c (cp_parser_base_specifier): Fix typos in error messages.
403 2017-05-31  Jason Merrill  <jason@redhat.com>
405         PR c++/80840 - ICE with constexpr and reference
406         * pt.c (convert_nontype_argument): Don't test whether a decl is
407         value-dependent when binding to a reference.
409         PR c++/80856 - ICE with local extern in template
410         * semantics.c (finish_call_expr): Replace a local extern overload
411         set in a template with the IDENTIFIER_NODE.
413         PR c++/80605 - __is_standard_layout and zero-length array
414         * class.c (check_bases): Use DECL_FIELD_IS_BASE.
416         PR c++/80605 - __is_standard_layout and empty base
417         * class.c (check_bases): Ignore empty bases.
419         PR c++/66297, DR 1684 - literal class and constexpr member fns
420         * constexpr.c (is_valid_constexpr_fn): Only complain about
421         non-literal enclosing class in C++11.
422         * class.c (finalize_literal_type_property): Likewise.
424         PR c++/80179 - ICE with initialized flexible array member.
425         * constexpr.c (verify_ctor_sanity): Handle flexible array members.
427 2017-05-29  Alexandre Oliva <aoliva@redhat.com>
429         * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
431 2017-05-02  Release Manager
433         * GCC 7.1.0 released.
435 2017-04-20  Jonathan Wakely  <jwakely@redhat.com>
437         PR c++/80473
438         * init.c (build_new_1): Suppress notes about over-aligned new when
439         the warning is suppressed.
441 2017-04-20  Jakub Jelinek  <jakub@redhat.com>
443         PR middle-end/80423
444         * tree.c (build_cplus_array_type): Call build_array_type
445         with the intended TYPE_TYPELESS_STORAGE flag value, instead
446         of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
447         on the shared type.
449 2017-04-18  Marek Polacek  <polacek@redhat.com>
451         PR c++/80244 - ICE with attribute in template alias.
452         * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
454         PR c++/80241 - ICE with alignas pack expansion.
455         * error.c (dump_expr): Handle TREE_LIST.
456         * parser.c (cp_parser_std_attribute_list): Return error_mark if
457         make_pack_expansion returns an error.
459 2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>
461         PR c++/80287
462         * class.c (fixup_may_alias): Fix all type variants.
464 2017-04-17  Jason Merrill  <jason@redhat.com>
466         PR c++/80415 - wrong error with default arg and array reference.
467         * tree.c (lvalue_kind): Return clk_class for an array prvalue.
469         * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
471 2017-04-15  Alexandre Oliva <aoliva@redhat.com>
473         * decl.c (name_unnamed_type): Split out of...
474         (grokdeclarator): ... this.
475         * decl.h (name_unnamed_type): Declare.
477 2017-04-12  Richard Biener  <rguenther@suse.de>
478         Bernd Edlinger  <bernd.edlinger@hotmail.de>
480         PR middle-end/79671
481         * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
482         for arrays of character or std::byte type.
484 2017-04-11  Jason Merrill  <jason@redhat.com>
486         PR c++/80294 - ICE with constexpr and inheritance.
487         * constexpr.c (reduced_constant_expression_p):
488         A null constructor element is non-constant.
489         (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
490         returning an empty base.
492 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
494         PR c++/80370
495         * decl.c (cp_finish_decomp): If processing_template_decl on
496         non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
497         change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
498         sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
499         processing.
500         * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
501         with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
502         dependent.
504 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
506         PR c++/80363
507         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
509 2017-04-10  Jakub Jelinek  <jakub@redhat.com>
511         PR c++/80176
512         * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
513         operand, if it is a static member function, recurse on the
514         BASELINK.
516 2017-04-10  Marek Polacek  <polacek@redhat.com>
518         PR sanitizer/80348
519         * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
520         ORIG_TYPE earlier and not only when shortening.
522 2017-04-07  Jason Merrill  <jason@redhat.com>
524         PR c++/80356 - ICE with reference to function template argument.
525         PR c++/79294
526         * pt.c (convert_nontype_argument_function): Adjust type even with a
527         value-dependent argument.
529         PR c++/80267 - ICE with nested capture of reference
530         PR c++/60992
531         * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
533 2017-04-07  Marek Polacek  <polacek@redhat.com>
535         PR sanitizer/80348
536         * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
538         PR c++/80095
539         * call.c (build_over_call): Don't check cxx_dialect.
540         * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
541         whether SUB is a CONSTRUCTOR.
542         * init.c (build_new_1): Don't check cxx_dialect.
543         * tree.c (replace_placeholders): Add a function comment.  Return if
544         not in C++14, or if the object isn't a (member of a) class.
545         * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
546         TYPE is CLASS_TYPE_P.
548 2017-04-05  Jakub Jelinek  <jakub@redhat.com>
550         PR c++/80309
551         * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
552         of a loop doing vec_safe_push of NULL.  Formatting fixes.
553         (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
554         to newidx before calling canonical_type_parameter on newtype.
556 2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
558         PR c++/80296
559         * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
560         UNARY_PLUS_EXPR case.
562 2017-04-03  Jason Merrill  <jason@redhat.com>
564         * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
566 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
568         * class.c (update_vtable_entry_for_fn): Fix typo in comment.
569         * decl2.c (one_static_initialization_or_destruction): Likewise.
570         * name-lookup.c (store_bindings): Likewise.
571         * parser.c (make_call_declarator): Likewise.
572         * pt.c (check_explicit_specialization): Likewise.
574 2017-04-03  Jason Merrill  <jason@redhat.com>
576         PR sanitizer/79993 - ICE with VLA initialization from string
577         PR c++/69487 - wrong VLA initialization from string
578         * init.c (finish_length_check): Split out from build_vec_init.
579         (build_vec_init): Handle STRING_CST.
580         * typeck2.c (split_nonconstant_init): Handle STRING_CST.
581         (digest_init_r): Don't give a STRING_CST VLA type.
583 2017-03-31  Jakub Jelinek  <jakub@redhat.com>
585         PR c++/79572
586         * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
587         REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
588         for NOP_EXPR to REFERENCE_TYPE.
590         PR libstdc++/80251
591         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
592         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
593         CPTK_IS_AGGREGATE.
594         * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
595         Remove extraneous parens.
596         (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
597         * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
598         (cp_parser_trait_expr): Likewise.
600 2017-03-27  Jakub Jelinek  <jakub@redhat.com>
602         PR middle-end/80162
603         * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
604         * typeck.c (cxx_mark_addressable): Likewise.  Look through
605         VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
606         to ARRAY_TYPE.
607         (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
609 2017-03-24  Jason Merrill  <jason@redhat.com>
611         PR c++/77339 - ICE with invalid use of alias template.
612         * pt.c (lookup_template_class_1): Don't try to enter the scope of an
613         alias template.
615 2017-03-24  Marek Polacek  <polacek@redhat.com>
617         PR c++/80119
618         * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
619         doesn't have side effects.
621 2017-03-23  Jason Merrill  <jason@redhat.com>
623         PR c++/80150 - ICE with overloaded variadic deduction.
624         * pt.c (try_one_overload): Remove asserts.
626         PR c++/77563 - missing ambiguous conversion error.
627         * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
629 2017-03-23  Marek Polacek  <polacek@redhat.com>
631         * cp-tree.h: Remove a C_RID_YYCODE reference.
633 2017-03-22  Jakub Jelinek  <jakub@redhat.com>
635         PR c++/80141
636         * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
637         case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
638         processing_template_decl.
640 2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
642         PR c++/77752
643         * name-lookup.c (pushtag_1): Add check for bogus, non template,
644         std::initializer_list.
646 2017-03-21  Jakub Jelinek  <jakub@redhat.com>
648         PR c++/35878
649         * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
651 2017-03-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
653         PR c++/35878
654         * init.c (std_placement_new_fn_p): New.
655         (build_new_1): Call it.
657 2017-03-20  Jason Merrill  <jason@redhat.com>
659         PR c++/80096 - ICE with C++17 non-type auto.
660         * pt.c (tsubst): Delay tsubst of type of template non-type
661         parameter.
663         PR c++/79519 - ICE with deleted template friend.
664         * decl.c (grokdeclarator): Complain about misplaced function
665         definition using =, as well.
667         PR c++/79640 - infinite recursion with generic lambda.
668         * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
669         before substituting its initializer.
671 2017-03-20  Marek Polacek  <polacek@redhat.com>
672             Paolo Carlini  <paolo.carlini@oracle.com>
674         PR c++/80059 - ICE with noexcept and __transaction_atomic
675         * except.c (build_must_not_throw_expr): Call
676         instantiate_non_dependent_expr.
678 2017-03-19  Jason Merrill  <jason@redhat.com>
680         PR c++/80084 - wrong C++17 decomposition by reference of parameter.
681         * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
682         reference decomposition.
684         PR c++/80077 - error with constexpr and -fno-elide-constructors.
685         * constexpr.c (cxx_eval_call_expression): Set ctx->call while
686         expanding trivial constructor.
688 2017-03-17  Jason Merrill  <jason@redhat.com>
690         PR c++/78345 - ICE initializing array from lambda.
691         * init.c (build_aggr_init): Check array initializer.
692         (build_vec_init): Check the type of a CONSTRUCTOR.
694         PR c++/80073 - C++17 ICE with virtual base.
695         * decl.c (xref_basetypes): Also check for indirect vbases.
697 2017-03-16  Jason Merrill  <jason@redhat.com>
699         * decl.c (start_enum): std::byte aliases anything.
701         PR c++/79797
702         * constexpr.c (lookup_placeholder): Tweak.
704 2017-03-15  Jason Merrill  <jason@redhat.com>
706         PR c++/80043 - ICE with -fpermissive
707         * typeck.c (convert_for_assignment): Handle instantiate_type
708         not giving an error.
710 2017-03-14  Nathan Sidwell  <nathan@acm.org>
712         PR c++/79393 DR 1658 workaround
713         * method.c (synthesized_method_base_walk): Inihibit abstract class
714         virtual base access check here.
715         (synthesized_method_walk): Not here.
717 2017-03-13  Nathan Sidwell  <nathan@acm.org>
719         PR c++/79393 DR 1658 workaround
720         * method.c (synthesized_method_walk): Check vbases of abstract
721         classes for dtor walk.
723 2017-03-10  David Malcolm  <dmalcolm@redhat.com>
725         PR translation/79848
726         * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
728 2017-03-10  Jason Merrill  <jason@redhat.com>
730         PR c++/79960 - alias templates and partial ordering
731         * pt.c (comp_template_args): Add partial_order parm.
732         (template_args_equal): Likewise.
733         (comp_template_args_porder): New.
734         (get_partial_spec_bindings): Use it.
736 2017-03-10  Marek Polacek  <polacek@redhat.com>
738         PR c++/79967
739         * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
741 2017-03-10  Jakub Jelinek  <jakub@redhat.com>
743         PR c++/79899
744         * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
745         Use XALLOCAVEC macro.
747         PR c++/79896
748         * decl.c (finish_enum_value_list): If value is error_mark_node,
749         don't copy it and change its type.
750         * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
751         of CONST_DECL is error_mark_node.
753 2017-03-09  Marek Polacek  <polacek@redhat.com>
755         PR c++/79900 - ICE in strip_typedefs
756         * tree.c (strip_typedefs): Skip the attribute handling if T is
757         a variant type which hasn't been updated yet.
759         PR c++/79687 - wrong code with pointer-to-member
760         * init.c (constant_value_1): Break if the variable has a dynamic
761         initializer.
763 2017-03-08  Jason Merrill  <jason@redhat.com>
765         PR c++/79797 - ICE with self-reference in array DMI.
766         * constexpr.c (lookup_placeholder): Split out...
767         (cxx_eval_constant_expression): ...from here.
769 2017-03-07  Jakub Jelinek  <jakub@redhat.com>
771         PR c/79834
772         * parser.c (cp_parser_omp_cancellation_point,
773         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
774         cp_parser_omp_target_update): Change "may only be used in compound
775         statements" diagnostics, such that the same translatable string is
776         used for all pragmas.
777         (cp_parser_pragma): Likewise.  Use error_at instead of
778         cp_parser_error for that diagnostics.
780 2017-03-06  Marek Polacek  <polacek@redhat.com>
782         PR c++/79796 - ICE with NSDMI and this pointer
783         * call.c (build_over_call): Handle NSDMI with a 'this' by calling
784         replace_placeholders.
786 2017-03-06  Jakub Jelinek  <jakub@redhat.com>
788         PR c++/79822
789         * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
790         ({ (void) 0; }).
792 2017-03-06  Jason Merrill  <jason@redhat.com>
794         Revert "Allow deduction guides to look into primary template."
795         * cp-tree.h, parser.c, pt.c, search.c: Revert.
797 2017-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
799         PR c++/70266
800         * except.c (build_must_not_throw_expr): Perform the implicit
801         conversions on the condition.
803 2017-03-03  Jason Merrill  <jason@redhat.com>
805         * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
806         -Wc++1z-compat.
808         Core issues 2273 and 2277
809         * call.c (joust): Adjust using-declaration tiebreaker to handle
810         the intermediate base case.
811         * method.c (strip_inheriting_ctors): Just return the argument if
812         !flag_new_inheriting_ctors.
814 2017-03-03  Richard Biener  <rguenther@suse.de>
816         PR c++/79825
817         * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
819 2017-03-03  Marek Polacek  <polacek@redhat.com>
821         PR c++/79791
822         * typeck.c (string_conv_p): In C++11, always call pedwarn with
823         OPT_Wwrite_strings.
825 2017-03-02  Jason Merrill  <jason@redhat.com>
827         Update overload resolution with deduction guides.
828         * pt.c (do_class_deduction): Always build the copy guide.
829         (copy_guide_p, template_guide_p): New.
830         (build_deduction_guide): Remember the original constructor.
831         * call.c (joust): Prefer the copy guide and non-template guides.
833         Allow deduction guides to look into primary template.
834         * cp-tree.h (struct saved_scope): Add deduction_guide_type.
835         (struct cp_decl_specifier_seq): Add constructor_p.
836         * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
837         (cp_parser_init_declarator): Check it.  Set ctor_dtor_or_conv_p.
838         Clear deduction_guide_type.  Don't handle deduction guide names.
839         (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
840         (cp_parser_direct_declarator): Likewise.  Handle deduction guides.
841         (cp_parser_member_declaration, cp_parser_cache_defarg)
842         (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
843         * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
844         (build_deduction_guide): Set deduction_guide_type.
845         (dependent_scope_p): Check deduction_guide_type.
846         * search.c (lookup_member): Likewise.
848 2017-03-02  Jakub Jelinek  <jakub@redhat.com>
850         PR c++/79782
851         * init.c (mark_exp_read_r): New function.
852         (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
853         whole arguments instead of plain mark_exp_read on TREE_LIST values.
855 2017-03-01  Jason Merrill  <jason@redhat.com>
857         Class template argument deduction in new-expression
858         * init.c (build_new): Handle deduction from no initializer.
859         * parser.c (cp_parser_new_expression): Don't require a single
860         expression for class template deduction.
861         * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
862         class template placeholder.
863         * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
864         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
865         (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
867 2017-03-01  Jakub Jelinek  <jakub@redhat.com>
869         PR c++/79746
870         * init.c (emit_mem_initializers): When not constructing vbases of
871         abstract classes, mark arguments as read for
872         -Wunused-but-set-parameter.
874 2017-02-28  Jason Merrill  <jason@redhat.com>
876         Class template argument deduction refinements
877         * call.c (joust): Move deduction guide tiebreaker down.
878         * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
879         deduction with no initializer.
880         * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
881         (do_class_deduction): Use that rather than special case.
882         (do_auto_deduction): Handle null initializer.
884 2017-02-28  Jakub Jelinek  <jakub@redhat.com>
886         * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
887         instead of just cond ? "..." : "...".
888         (grokdeclarator): Likewise.
889         (build_enumerator): Likewise.
890         * init.c (build_new_1): Likewise.
891         * call.c (build_new_method_call_1): Likewise.
892         * parser.c: Include intl.h.
893         (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
894         "enter"/"exit" keyword.
895         (cp_finalize_oacc_routine): Don't use %s to supply portions of the
896         message.
898 2017-02-27  Jason Merrill  <jason@redhat.com>
900         PR c++/71568 - SFINAE forming pointer to member function
901         * init.c (build_offset_ref): Check the return value of
902         perform_or_defer_access_check.
904 2017-02-27  Marek Polacek  <polacek@redhat.com>
906         * decl.c (expand_static_init): Add missing } in a comment.
908 2017-02-27  Volker Reichelt  <v.reichelt@netcologne.de>
910         * init.c: Include intl.h.
911         (build_new_1): Move message strings into pedwarn to make them
912         -Wformat-security friendly. Mark string for translation.
913         * pt.c (tsubst_copy_and_build): Mark string for translation.
914         Make the pointer const.
915         * semantics.c (finish_id_expression): Mark strings for translation.
917 2017-02-25  Jakub Jelinek  <jakub@redhat.com>
919         * call.c (build_op_delete_call): Make msg1 and msg2 const.
921 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
923         PR c++/79588
924         * call.c (build_over_call): Call check_function_arguments even for
925         -Wrestrict, adjust check_function_arguments caller.
926         * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
927         here.
928         * typeck.c (cp_build_function_call_vec): Adjust
929         check_function_arguments caller.
931 2017-02-24  Marek Polacek  <polacek@redhat.com>
933         PR translation/79705
934         * decl.c (check_redeclaration_exception_specification): Mark a string
935         for translation.  Make the pointer const.
937 2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>
939         PR c++/79361
940         * pt.c (register_specialization): Check duplicate_decls return value
941         for error_mark_node and pass it back.
943 2017-02-22  Jason Merrill  <jason@redhat.com>
945         PR c++/79679 - missing destructor for argument
946         * call.c (build_over_call): Don't pass tf_no_cleanup to argument
947         conversions.
949         * pt.c (do_class_deduction): Handle 0 argument case.
951 2017-02-22  Jakub Jelinek  <jakub@redhat.com>
953         PR c++/79664
954         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
955         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
956         * constexpr.c (potential_constant_expression_1): Handle
957         OMP_*, OACC_* and CILK_* trees.  Use error_at with
958         EXPR_LOC_OR_LOC (t, input_location) computed early
959         instead of error, or error_at with location_of (t).
961 2017-02-22  Marek Polacek  <polacek@redhat.com>
963         PR c++/79653
964         * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
965         if the alignas expression is erroneous.
966         * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
967         error_mark_node.
969         PR c++/79657
970         * semantics.c (finish_underlying_type): Bail out for incomplete enums.
972 2017-02-21  Jason Merrill  <jason@redhat.com>
974         PR c++/50308 - wrong deprecated warning with ADL
975         PR c++/17729 - duplicate deprecated warning
976         * semantics.c (finish_id_expression): Only call mark_used on a
977         function if we aren't building a call.
979         PR c++/41727 - ICE with partial spec of partial instantiation
980         * pt.c (process_partial_specialization): For now, don't check more
981         specialized if there is more than one level of args.
983 2017-02-21  Marek Polacek  <polacek@redhat.com>
985         PR c++/79535
986         * cp-tree.h (maybe_reject_flexarray_init): Declare.
987         * init.c (maybe_reject_flexarray_init): No longer static.
988         Add check for current_function_decl.
989         * parser.c (cp_parser_late_parse_one_default_arg): Reject
990         a default mem-initializer for a flexible array.
992 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
993             Paolo Carlini  <paolo.carlini@oracle.com>
995         PR c++/79654
996         * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
997         on error.
998         * pt.c (tsubst_decomp_names): Return error_mark_node if the first
999         decl after the decomposition artificial decl has error_mark_node.
1000         * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
1001         instead of just == error_mark_node comparison.
1003 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
1005         PR sanitizer/79589
1006         * decl.c: Include gimplify.h.
1007         (cp_finish_decomp): Make sure there is no sharing of trees
1008         in between DECL_VALUE_EXPR of decomposition decls.
1010         PR c++/79655
1011         * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
1013         PR c++/79639
1014         * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
1015         call cplus_expand_constant on it first.
1017 2017-02-19  Jason Merrill  <jason@redhat.com>
1019         PR c++/78139 - destructor needed by new-expression
1020         * call.c (build_special_member_call): Use tf_no_cleanup.
1022         PR c++/78282 - auto template and pack expansion
1023         * pt.c (find_parameter_packs_r): Don't walk into the type of
1024         templates other than template template-parameters.
1026         PR c++/79606 - ICE with this->base_member in NSDMI
1027         * class.c (build_base_path): Check processing_template_decl.
1029         PR c++/79607 - ICE with T{} initializer
1030         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
1032         PR c++/79566 - elaborated-type-specifier in range for
1033         * parser.c (cp_parser_simple_declaration): Fix check for type
1034         definition.
1036         PR c++/79400 - confusing suggestion of 'noexcept'
1037         * parser.c (cp_parser_exception_specification_opt): Remove
1038         suggestion for deprecated dynamic exception-specification.
1040         PR c++/79470 - partial ordering with reference parameters
1041         * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
1043         PR c++/79500 - ICE with non-template deduction guide
1044         * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
1045         DECL_TEMPLATE_RESULT.
1047         PR c++/79580 - ICE with compound literal
1048         * parser.c (cp_parser_class_head): If we're in the middle of an
1049         expression, use ts_within_enclosing_non_class.
1051         PR c++/79503 - inherited ctor taking base class
1052         * call.c (add_function_candidate): Also check that
1053         DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
1055 2017-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
1057         PR c++/79380
1058         * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
1059         argument.
1061 2017-02-19  Eric Fiselier  <eric@efcs.ca>
1062             Jonathan Wakely  <jwakely@redhat.com>
1064         PR c++/69523
1065         * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
1066         control warning about literal suffix identifiers without a leading
1067         underscore.
1069 2017-02-17  Jason Merrill  <jason@redhat.com>
1071         PR c++/79508 - lookup error with member template
1072         * parser.c (cp_parser_template_name): Clear
1073         parser->context->object_type if we aren't doing lookup.
1075         PR c++/78690 - ICE with using and global type with same name
1076         * pt.c (type_dependent_object_expression_p): True for
1077         IDENTIFIER_NODE.
1079         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1080         * pt.c (convert_template_argument): Just return an auto arg pack.
1081         (tsubst_template_args): Don't tsubst an auto pack type.
1083         PR c++/79556 - C++17 ICE with non-type auto
1084         * pt.c (do_auto_deduction): Don't try to deduce from null type.
1086         PR c++/79533 - C++17 ICE with temporary cast to reference
1087         * call.c (build_over_call): Conversion to a reference prevents copy
1088         elision.
1090 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
1091             Jason Merrill  <jason@redhat.com>
1093         PR c++/79502 - lost nodiscard attribute
1094         * pt.c (apply_late_template_attributes): Do apply non-dependent
1095         attributes to types.
1097 2017-02-16  Jason Merrill  <jason@redhat.com>
1099         PR c++/78572 - ICE with self-modifying array initializer
1100         * constexpr.c (cxx_eval_store_expression): The object we're
1101         initializing is outside the constant-expression.
1102         (cxx_eval_call_expression): Set ctx->call.
1104         PR c++/79050 - ICE with undeduced auto and LTO
1105         * decl.c (poplevel): Remove undeduced auto decls.
1107 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
1109         PR c++/79512
1110         * parser.c (cp_parser_omp_target): For -fopenmp-simd
1111         ignore #pragma omp target even when not followed by identifier.
1113 2017-02-15  Jason Merrill  <jason@redhat.com>
1114             Jakub Jelinek  <jakub@redhat.com>
1116         PR c++/79464 - ICE in IPA with omitted constructor parms
1117         * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
1118         (adjust_clone_args): Adjust.
1119         (add_method): Remember omitted parms.
1120         * call.c (add_function_candidate): Likewise.
1121         * mangle.c (write_method_parms): Likewise.
1122         * method.c (ctor_omit_inherited_parms): Return false if there are no
1123         parms to omit.
1125 2017-02-15  Martin Sebor  <msebor@redhat.com>
1127         PR c++/79363
1128         * init.c (maybe_reject_flexarray_init): New function.
1129         (perform_member_init): Call it.
1131 2017-02-15  Jakub Jelinek  <jakub@redhat.com>
1133         PR c++/79301
1134         * parser.c (cp_parser_std_attribute): Don't pedwarn about
1135         [[deprecated]] with -std=c++11 and [[fallthrough]] with
1136         -std=c++11 and -std=c++14.
1138         PR c++/79288
1139         * decl.c (grokdeclarator): For static data members, handle thread_p
1140         only after handling inline.
1142 2017-02-14  Marek Polacek  <polacek@redhat.com>
1144         PR c++/79420
1145         PR c++/79463
1146         * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
1147         clobbering if the postfix expression isn't an EXPR_P.
1149 2017-02-13  Jason Merrill  <jason@redhat.com>
1151         PR c++/79461 - ICE with lambda in constexpr constructor
1152         * constexpr.c (build_data_member_initialization): Ignore
1153         initialization of a local variable.
1155 2017-02-13  Jakub Jelinek  <jakub@redhat.com>
1157         * init.c (warn_placement_new_too_small): Add missing space in
1158         diagnostics.
1159         * parser.c (cp_parser_oacc_declare): Likewise.
1160         * mangle.c (maybe_check_abi_tags): Likewise.
1162         PR c++/79232
1163         * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
1164         on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
1165         in the rightmost operand.
1167 2017-02-13  Nathan Sidwell  <nathan@acm.org>
1169         PR c++/79296 - ICE mangling localized template instantiation
1170         * decl2.c (determine_visibility): Use template fn context for
1171         local class instantiations.
1173 2017-02-11  Jason Merrill  <jason@redhat.com>
1175         PR c++/77659 - ICE with new and C++14 aggregate NSDMI
1176         * init.c (build_new): Make backups of any CONSTRUCTORs in init.
1177         (build_new_1): Use replace_placeholders.
1178         * tree.c (replace_placeholders_t): Also track whether we've seen a
1179         placeholder.
1180         (replace_placeholders, replace_placeholders_r): Adjust.
1181         * cp-tree.h: Adjust.
1183         PR c++/77790 - ICE with auto function in C++11 mode
1184         * decl.c (undeduced_auto_decl): Remove C++14 limitation.
1185         (require_deduced_type): Add complain parm, return bool.
1186         * cp-tree.h: Adjust.
1187         * decl2.c (mark_used): Use require_deduced_type.
1189 2017-02-10  Jason Merrill  <jason@redhat.com>
1191         PR c++/78908 - template ops and bitfields
1192         * tree.c (build_min_non_dep): Use unlowered_expr_type.
1194         PR c++/78897 - constexpr union
1195         * constexpr.c (cxx_eval_store_expression): A store to a union member
1196         erases a previous store to another member.
1198         PR c++/71285 - member of fold-expression
1199         * semantics.c (finish_unary_fold_expr)
1200         (finish_binary_fold_expr): Use null type for fold-expressions.
1202         PR c++/79401 - protected inherited constructor
1203         * call.c (enforce_access): For inheriting constructor, find a base
1204         binfo in the path we already have.
1206 2017-02-10  Marek Polacek  <polacek@redhat.com>
1208         PR c++/79435
1209         * pt.c (type_dependent_expression_p): Check if the expression type
1210         is null.
1212         PR c++/79184
1213         * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
1214         if warnings shouldn't be given.
1216 2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
1218         PR c++/71737
1219         * pt.c (tsubst_decl): Don't try to preserve a typedef that names
1220         an error_mark_node as type.
1222 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
1223             Jason Merrill  <jason@redhat.com>
1225         PR c++/79143
1226         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
1227         from pattern to type.
1229 2017-02-09  Jason Merrill  <jason@redhat.com>
1231         PR c++/79316 - default argument in deduction guide
1232         PR c++/79350 - explicit deduction guide
1233         * parser.c (cp_parser_constructor_declarator_p)
1234         (cp_parser_direct_declarator): Parse deduction guides more like
1235         constructors.
1236         * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
1237         * tree.c (special_function_p): Return it.
1238         * decl.c (check_special_function_return_type): Handle it.
1239         (grokdeclarator, grokfndecl): Adjust.
1240         (cp_finish_decl): Pass flags to do_auto_deduction.
1241         * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
1242         * pt.c (dguide_name_p): Take a const_tree.
1243         (do_class_deduction): Handle explicit.
1244         (do_auto_deduction): Pass flags through.
1245         (build_deduction_guide): Copy explicit flag.
1247 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
1249         PR c++/79429
1250         * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
1251         non-pragma_compound context here.
1252         (cp_parser_omp_target): Likewise.
1253         (cp_parser_pragma): Don't call push_omp_privatization_clauses and
1254         parsing for ordered and target omp pragmas in non-pragma_stmt
1255         non-pragma_compound contexts.
1257         PR c/79431
1258         * parser.c (cp_parser_oacc_declare): Formatting fix.
1259         (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
1260         automatic variables.
1262 2016-02-09  Nathan Sidwell  <nathan@codesourcery.com>
1263             Chung-Lin Tang  <cltang@codesourcery.com>
1265         * parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
1266         parsing.  Parse constant expression. Remove semantic checking.
1267         (cp_parser_omp_clause_collapse): Disallow tile.
1268         (cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
1269         error about missing for after already emitting one.  Use more
1270         conventional for idiom for unbounded loop.
1271         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
1272         * semantics.c (finish_omp_clauses): Correct TILE semantic check.
1273         (finish_omp_for): Deal with tile clause.
1275 2017-02-07  Nathan Sidwell  <nathan@acm.org>
1277         * method.c (synthesized_method_base_walk): New.  Broken out of ...
1278         (synthesized_method_walk): ... here.  Call it.  Cleanup
1279         initializations.
1281 2017-02-07  Patrick Palka  <ppalka@gcc.gnu.org>
1283         PR c++/79360
1284         * typeck2.c (process_init_constructor_union): Consider only
1285         FIELD_DECLs when looking for an NSDMI.
1287 2017-02-06  Jason Merrill  <jason@redhat.com>
1289         PR c++/71193 - incomplete types in templates
1290         * parser.c (cp_parser_postfix_dot_deref_expression): In a template
1291         handle incomplete type by pedwarning and then treating as dependent.
1293 2017-02-06  Jakub Jelinek  <jakub@redhat.com>
1295         PR c++/79379
1296         * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
1297         (potential_constant_expression_1): Likewise.
1299         PR c++/79377
1300         * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
1301         allow one fewer than expected arguments if flag_permissive.
1303         PR c++/79372
1304         * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
1305         * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
1306         with error_mark_node type.
1308 2017-02-03  Jason Merrill  <jason@redhat.com>
1310         PR c++/78689 - ICE on constructor with label
1311         * optimize.c (maybe_clone_body): Replace omitted parameters with
1312         null lvalues.
1313         * class.c (build_clone): Fix logic for omitting inherited parms.
1315         PR c++/12245 - excessive memory use
1316         * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
1317         back in.  Don't cache constants.
1318         (maybe_constant_init): Don't cache constants.
1320         PR c++/79294 - ICE with invalid template argument
1321         * pt.c (convert_nontype_argument_function): Check value-dependence.
1322         (convert_nontype_argument): Don't check it here for function ptrs.
1324 2017-02-02  Richard Biener  <rguenther@suse.de>
1326         PR cp/14179
1327         * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
1328         it lazily on the first changed element only and copy it
1329         fully upfront, only storing changed elements.
1331 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
1333         PR c++/69637
1334         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
1335         to the width.
1337 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
1339         PR c++/79304
1340         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
1341         after ARROW_EXPR.
1343 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
1345         PR c++/79298
1346         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
1347         any namespace aliases.
1349 2017-01-31  Nathan Sidwell  <nathan@acm.org>
1351         PR c++/79290
1352         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
1354         PR c++/67273
1355         PR c++/79253
1356         * pt.c: (instantiate_decl): Push to top level when current
1357         function scope doesn't match.  Only push lmabda scope stack when
1358         pushing to top.
1360         * cp-tree.h (instantiate_decl): Make defer_ok bool.
1361         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
1362         (instantiate_decl): Simplify and reorder state saving and restoration.
1364         PR c++/79264
1365         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
1366         * semantics.c (finish_member_declaration): Assert class is being
1367         defined.
1369 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
1371         Introduce C++ support in libcc1.
1372         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
1373         (ansi_opname): Rename to...
1374         (cp_operator_id): ... this.  Adjust all callers.
1375         (ansi_assopname): Rename to...
1376         (cp_assignment_operator_id): ... this.  Adjust all callers.
1377         (cp_literal_operator_id): Declare.
1378         (set_global_friend): Declare.
1379         (is_global_friend): Declare.
1380         (enum cp_oracle_request): New type.
1381         (cp_binding_oracle_function): New type.
1382         (cp_binding_oracle): Declare.
1383         (cp_finish_injected_record_type): Declare.
1384         * friend.c (global_friend): New var.
1385         (set_global_friend): New fn.
1386         (is_global_friend): New fn.
1387         (is_friend): Call is_global_friend.
1388         * name-lookup.c (cp_binding_oracle): New var.
1389         (query_oracle): New fn.
1390         (qualified_lookup_using_namespace): Call query_oracle.
1391         (lookup_name_real_1): Likewise.
1392         * parser.c (cp_literal_operator_id): Drop static.
1393         * search.c (friend_accessible_p): Call is_global_friend.
1394         * semantics.c (is_this_parameter): Accept a variable if the
1395         binding oracle is enabled.
1397 2017-01-27  Jason Merrill  <jason@redhat.com>
1399         PR c++/78771 - ICE with inherited constructor.
1400         * call.c (build_over_call): Call deduce_inheriting_ctor here.
1401         * pt.c (tsubst_decl): Not here.
1402         * class.c (add_method): Or here.
1403         * method.c (deduce_inheriting_ctor): Handle clones.
1404         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
1406 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
1408         PR c++/64382
1409         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
1410         New function.
1411         * cp/cp-tree.h: Declare it.
1412         * cp/semantics.c (finish_id_expression): Resolve names within a default
1413         capturing generic lambda defined within a template prior to
1414         instantiation to allow for captures to be added to the closure type.
1416 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
1418         PR c++/68727
1419         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
1420         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
1421         * parser.c (cp_parser_builtin_offsetof): Pass result of
1422         build_static_cast of null_pointer_node to finish_offsetof.
1423         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
1424         it for -Winvalid-offsetof pedwarn instead of trying to guess
1425         original offsetof type from EXPR.  Save OBJECT_PTR as a new
1426         second operand to OFFSETOF_EXPR.
1427         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
1428         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
1429         as OBJECT_PTR.
1431 2017-01-26  Jason Merrill  <jason@redhat.com>
1433         * name-lookup.c (parse_using_directive): Deprecate strong using.
1435         PR c++/79176 - lambda ICE with -flto -Os
1436         * decl2.c (vague_linkage_p): Handle decloned 'tors.
1437         * tree.c (decl_linkage): Likewise.
1439 2017-01-25  Martin Sebor  <msebor@redhat.com>
1441         * decl.c (grokdeclarator): Fix a typo in a comment.
1443 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
1445         PR c++/78896
1446         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
1447         lambda expressions.
1449         PR c++/77914
1450         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
1451         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
1453 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
1455         PR lto/79061
1456         * decl.c (cxx_init_decl_processing): Pass main_input_filename
1457         to build_translation_unit_decl.
1459 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
1461         PR c++/79205
1462         * cp-gimplify.c (cp_genericize_r): Add result of
1463         convert_from_reference on invisiref parm to p_set.
1465 2017-01-24  Nathan Sidwell  <nathan@acm.org>
1467         PR c++/78469 - defaulted ctor and inaccessible dtor
1468         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
1469         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
1470         * tree.c (build_target_expr): Check tf_no_cleanup.
1472         PR c++/79118 - anon-members and constexpr
1473         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
1474         ctor decl.  Recursively check anonymous members.
1475         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
1476         call.
1477         (explain_invalid_constexpr_fn): Likewise.
1479 2017-01-23  Nathan Sidwell  <nathan@acm.org>
1481         PR c++/71710 - template using directive of field
1482         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
1483         check earlier.
1485         PR c++/71406 - ICE with scope-ref'd template id exprs
1486         PR c++/77508
1487         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
1488         before breaking up TEMPLATE_ID_EXPR.
1490 2017-01-20  Nathan Sidwell  <nathan@acm.org>
1492         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
1493         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
1495 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
1497         PR c++/77829
1498         PR c++/78656
1499         * cp-tree.h (suggest_alternatives_for): Add bool param.
1500         (suggest_alternative_in_explicit_scope): New decl.
1501         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
1502         that isn't the global one, call new function
1503         suggest_alternative_in_explicit_scope, only calling
1504         suggest_alternatives_for if it fails, and disabling near match
1505         searches fort that case.  When SCOPE is the global namespace,
1506         pass true for new param to suggest_alternatives_for to allow for
1507         fuzzy name lookups.
1508         * lex.c (unqualified_name_lookup_error): Pass true for new param
1509         to suggest_alternatives_for.
1510         * name-lookup.c (consider_binding_level): Add forward decl.
1511         (suggest_alternatives_for): Add "suggest_misspellings" param,
1512         using it to conditionalize the fuzzy name-lookup code.
1513         (suggest_alternative_in_explicit_scope): New function.
1514         * parser.c (cp_parser_primary_expression): When calling
1515         finish_id_expression, pass location of id_expression rather
1516         than that of id_expr_token.
1517         (cp_parser_id_expression): Convert local "unqualified_id" from
1518         tree to cp_expr to avoid implicitly dropping location information.
1520 2017-01-20  Marek Polacek  <polacek@redhat.com>
1522         PR c/64279
1523         * call.c (build_conditional_expr_1): Warn about duplicated branches.
1524         * semantics.c (finish_expr_stmt): Build statement using the proper
1525         location.
1527 2017-01-19  Jason Merrill  <jason@redhat.com>
1529         US 20 - forwarding references and class template argument deduction
1530         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
1531         * pt.c (push_template_decl_real): Set it.
1532         (maybe_adjust_types_for_deduction): Check it.
1533         (rewrite_template_parm): Copy it.
1535         US 19 - deduction guides and constructors
1536         * call.c (joust): Prefer deduction guides to constructors.
1537         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
1538         (deduction_guide_p): Check DECL_P.
1540         * decl.c (check_initializer): Always use build_aggr_init for array
1541         decomposition.
1543         PR c++/79130 - decomposition and direct-initialization
1544         * init.c (build_aggr_init): Communicate direct-initialization to
1545         build_vec_init.
1546         (build_vec_init): Check for array copy sooner.
1547         * parser.c (cp_parser_decomposition_declaration): Remove call to
1548         build_x_compound_expr_from_list.
1550 2017-01-18  Jason Merrill  <jason@redhat.com>
1552         PR c++/68666 - member variable template-id
1553         * typeck.c (finish_class_member_access_expr): Handle variable
1554         template-id.
1555         * pt.c (lookup_and_finish_template_variable): No longer static.
1556         * cp-tree.h: Declare it.
1558 2017-01-18  Nathan Sidwell  <nathan@acm.org>
1560         PR c++/78488
1561         * call.c (build_over_call): When checking ellipsis conversions for
1562         an inherited ctor, make sure there is at least one conversion.
1564 2017-01-18  Jason Merrill  <jason@redhat.com>
1566         PR c++/78894 - ICE with class deduction and default arg
1567         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
1569 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
1571         PR c++/77489
1572         * mangle.c (write_discriminator): Reorganize abi warning check.
1574 2017-01-18  Nathan Sidwell  <nathan@acm.org>
1576         * cp-tree.h: Clarify exception spec node comment.
1577         * except.c (nothrow_spec_p): Simplify by checking node-equality.
1579         PR c++/79091
1580         * mangle.c (write_exception_spec): Check nothrow explicitly.
1581         (write_encoding): Don't increment processing_template_decl around
1582         encoding.
1584 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
1586         PR c++/70182
1587         * mangle.c (write_template_args): Add "on" for operator names.
1589 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
1591         PR c++/77489
1592         * mangle.c (write_discriminator): Handle discriminator >= 10.
1594 2017-01-17  Nathan Sidwell  <nathan@acm.org>
1596         PR c++/61636
1597         * cp-tree.h (maybe_generic_this_capture): Declare.
1598         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
1599         (maybe_resolve_dummy): ... here.  Call it.
1600         (maybe_generic_this_capture): New.
1601         * parser.c (cp_parser_postfix_expression): Speculatively capture
1602         this in generic lambda in unresolved member function call.
1603         * pt.c (tsubst_copy_and_build): Force hard error from failed
1604         member function lookup in generic lambda.
1606 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
1608         PR c++/70565
1609         * cp-array-notation.c (expand_array_notation_exprs): Handle
1610         OMP_PARALLEL.
1612 2017-01-11  Jason Merrill  <jason@redhat.com>
1614         PR c++/78337 - ICE on invalid with generic lambda
1615         * semantics.c (process_outer_var_ref): Check if containing_function
1616         is null.  Move inform call under complain test.
1618 2017-01-11  Nathan Sidwell  <nathan@acm.org>
1620         PR c++/77812
1621         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
1622         is a new overload.
1624 2017-01-11  Nathan Sidwell  <nathan@acm.org>
1626         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
1628 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
1630         PR c++/78341
1631         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
1632         assertion.  Formatting fix.
1634         PR c++/72813
1635         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
1636         writing PCH file.
1638 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
1640         PR c++/77949
1641         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
1642         a missing semicolon if we have a valid insertion location for
1643         the fix-it hint.
1645 2017-01-10  Jason Merrill  <jason@redhat.com>
1647         FI 20, decomposition declaration with parenthesized initializer.
1648         * parser.c (cp_parser_decomposition_declaration): Use
1649         cp_parser_initializer.
1651 2017-01-09  Jason Merrill  <jason@redhat.com>
1653         Implement P0195R2, C++17 variadic using.
1654         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
1655         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
1656         * error.c (dump_decl): Likewise.
1658 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
1660         PR translation/79019
1661         PR translation/79020
1662         * semantics.c (finish_omp_clauses): Add missing whitespace to
1663         translatable strings.
1664         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
1666 2017-01-07  Jason Merrill  <jason@redhat.com>
1668         PR c++/78948 - instantiation from discarded statement
1669         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
1670         * cp-tree.h (in_discarded_stmt): Declare it.
1671         (struct saved_scope): Add discarded_stmt bitfield.
1672         (in_discarded_stmt): New macro.
1673         * decl2.c (mark_used): Check it.
1674         * parser.c (cp_parser_selection_statement): Adjust.
1675         (cp_parser_jump_statement): Adjust.
1677 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
1679         PR c++/78931
1680         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
1681         REFERENCE_REF_P, set tt to its operand.
1683         PR c++/78890
1684         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
1685         unions even for C++11 and later.
1687 2017-01-05  Nathan Sidwell  <nathan@acm.org>
1689         PR c++/78765
1690         * pt.c (convert_nontype_argument): Don't try and see if integral
1691         or enum expressions are constants prematurely.
1693 2017-01-04  Marek Polacek  <polacek@redhat.com>
1695         PR c++/64767
1696         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
1697         a zero character literal.
1699 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
1701         PR c++/78949
1702         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
1703         vector type.
1705         PR c++/78693
1706         * parser.c (cp_parser_simple_declaration): Only complain about
1707         inconsistent auto deduction if auto_result doesn't use auto.
1709         * parser.c (cp_parser_simple_declaration): Diagnose function
1710         declaration among more than one init-declarators with auto
1711         specifier.
1713         PR c++/71182
1714         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
1715         assertion, as lexer->buffer may be NULL.
1717 2017-01-04  Marek Polacek  <polacek@redhat.com>
1719         PR c++/77545
1720         PR c++/77284
1721         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
1723 2017-01-04  Nathan Sidwell  <nathan@acm.org>
1725         PR c++/66735
1726         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
1727         (lambda_capture_field_type): Update prototype.
1728         * lambda.c (lambda_capture_field_type): Add is_reference parm.
1729         Add referenceness here.
1730         (add_capture): Adjust lambda_capture_field_type call, refactor
1731         error checking.
1732         * pt.c (tsubst): Adjust lambda_capture_field_type call.
1734 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
1736         Update copyright years.
1738 Copyright (C) 2017 Free Software Foundation, Inc.
1740 Copying and distribution of this file, with or without modification,
1741 are permitted in any medium without royalty provided the copyright
1742 notice and this notice are preserved.