* decl.c (expand_static_init): Add missing } in a comment.
[official-gcc.git] / gcc / cp / ChangeLog
blob03f92565772c1391f13dd11080be5d0906846235
1 2017-02-27  Marek Polacek  <polacek@redhat.com>
3         * decl.c (expand_static_init): Add missing } in a comment.
5 2017-02-27  Volker Reichelt  <v.reichelt@netcologne.de>
7         * init.c: Include intl.h.
8         (build_new_1): Move message strings into pedwarn to make them
9         -Wformat-security friendly. Mark string for translation.
10         * pt.c (tsubst_copy_and_build): Mark string for translation.
11         Make the pointer const.
12         * semantics.c (finish_id_expression): Mark strings for translation.
14 2017-02-25  Jakub Jelinek  <jakub@redhat.com>
16         * call.c (build_op_delete_call): Make msg1 and msg2 const.
18 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
20         PR c++/79588
21         * call.c (build_over_call): Call check_function_arguments even for
22         -Wrestrict, adjust check_function_arguments caller.
23         * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
24         here.
25         * typeck.c (cp_build_function_call_vec): Adjust
26         check_function_arguments caller.
28 2017-02-24  Marek Polacek  <polacek@redhat.com>
30         PR translation/79705
31         * decl.c (check_redeclaration_exception_specification): Mark a string
32         for translation.  Make the pointer const.
34 2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>
36         PR c++/79361
37         * pt.c (register_specialization): Check duplicate_decls return value
38         for error_mark_node and pass it back.
40 2017-02-22  Jason Merrill  <jason@redhat.com>
42         PR c++/79679 - missing destructor for argument
43         * call.c (build_over_call): Don't pass tf_no_cleanup to argument
44         conversions.
46         * pt.c (do_class_deduction): Handle 0 argument case.
48 2017-02-22  Jakub Jelinek  <jakub@redhat.com>
50         PR c++/79664
51         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
52         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
53         * constexpr.c (potential_constant_expression_1): Handle
54         OMP_*, OACC_* and CILK_* trees.  Use error_at with
55         EXPR_LOC_OR_LOC (t, input_location) computed early
56         instead of error, or error_at with location_of (t).
58 2017-02-22  Marek Polacek  <polacek@redhat.com>
60         PR c++/79653
61         * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
62         if the alignas expression is erroneous.
63         * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
64         error_mark_node.
66         PR c++/79657
67         * semantics.c (finish_underlying_type): Bail out for incomplete enums.
69 2017-02-21  Jason Merrill  <jason@redhat.com>
71         PR c++/50308 - wrong deprecated warning with ADL
72         PR c++/17729 - duplicate deprecated warning
73         * semantics.c (finish_id_expression): Only call mark_used on a
74         function if we aren't building a call.
76         PR c++/41727 - ICE with partial spec of partial instantiation
77         * pt.c (process_partial_specialization): For now, don't check more
78         specialized if there is more than one level of args.
80 2017-02-21  Marek Polacek  <polacek@redhat.com>
82         PR c++/79535
83         * cp-tree.h (maybe_reject_flexarray_init): Declare.
84         * init.c (maybe_reject_flexarray_init): No longer static.
85         Add check for current_function_decl.
86         * parser.c (cp_parser_late_parse_one_default_arg): Reject
87         a default mem-initializer for a flexible array.
89 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
90             Paolo Carlini  <paolo.carlini@oracle.com>
92         PR c++/79654
93         * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
94         on error.
95         * pt.c (tsubst_decomp_names): Return error_mark_node if the first
96         decl after the decomposition artificial decl has error_mark_node.
97         * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
98         instead of just == error_mark_node comparison.
100 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
102         PR sanitizer/79589
103         * decl.c: Include gimplify.h.
104         (cp_finish_decomp): Make sure there is no sharing of trees
105         in between DECL_VALUE_EXPR of decomposition decls.
107         PR c++/79655
108         * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
110         PR c++/79639
111         * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
112         call cplus_expand_constant on it first.
114 2017-02-19  Jason Merrill  <jason@redhat.com>
116         PR c++/78139 - destructor needed by new-expression
117         * call.c (build_special_member_call): Use tf_no_cleanup.
119         PR c++/78282 - auto template and pack expansion
120         * pt.c (find_parameter_packs_r): Don't walk into the type of
121         templates other than template template-parameters.
123         PR c++/79606 - ICE with this->base_member in NSDMI
124         * class.c (build_base_path): Check processing_template_decl.
126         PR c++/79607 - ICE with T{} initializer
127         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
129         PR c++/79566 - elaborated-type-specifier in range for
130         * parser.c (cp_parser_simple_declaration): Fix check for type
131         definition.
133         PR c++/79400 - confusing suggestion of 'noexcept'
134         * parser.c (cp_parser_exception_specification_opt): Remove
135         suggestion for deprecated dynamic exception-specification.
137         PR c++/79470 - partial ordering with reference parameters
138         * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
140         PR c++/79500 - ICE with non-template deduction guide
141         * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
142         DECL_TEMPLATE_RESULT.
144         PR c++/79580 - ICE with compound literal
145         * parser.c (cp_parser_class_head): If we're in the middle of an
146         expression, use ts_within_enclosing_non_class.
148         PR c++/79503 - inherited ctor taking base class
149         * call.c (add_function_candidate): Also check that
150         DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
152 2017-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
154         PR c++/79380
155         * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
156         argument.
158 2017-02-19  Eric Fiselier  <eric@efcs.ca>
159             Jonathan Wakely  <jwakely@redhat.com>
161         PR c++/69523
162         * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
163         control warning about literal suffix identifiers without a leading
164         underscore.
166 2017-02-17  Jason Merrill  <jason@redhat.com>
168         PR c++/79508 - lookup error with member template
169         * parser.c (cp_parser_template_name): Clear
170         parser->context->object_type if we aren't doing lookup.
172         PR c++/78690 - ICE with using and global type with same name
173         * pt.c (type_dependent_object_expression_p): True for
174         IDENTIFIER_NODE.
176         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
177         * pt.c (convert_template_argument): Just return an auto arg pack.
178         (tsubst_template_args): Don't tsubst an auto pack type.
180         PR c++/79556 - C++17 ICE with non-type auto
181         * pt.c (do_auto_deduction): Don't try to deduce from null type.
183         PR c++/79533 - C++17 ICE with temporary cast to reference
184         * call.c (build_over_call): Conversion to a reference prevents copy
185         elision.
187 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
188             Jason Merrill  <jason@redhat.com>
190         PR c++/79502 - lost nodiscard attribute
191         * pt.c (apply_late_template_attributes): Do apply non-dependent
192         attributes to types.
194 2017-02-16  Jason Merrill  <jason@redhat.com>
196         PR c++/78572 - ICE with self-modifying array initializer
197         * constexpr.c (cxx_eval_store_expression): The object we're
198         initializing is outside the constant-expression.
199         (cxx_eval_call_expression): Set ctx->call.
201         PR c++/79050 - ICE with undeduced auto and LTO
202         * decl.c (poplevel): Remove undeduced auto decls.
204 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
206         PR c++/79512
207         * parser.c (cp_parser_omp_target): For -fopenmp-simd
208         ignore #pragma omp target even when not followed by identifier.
210 2017-02-15  Jason Merrill  <jason@redhat.com>
211             Jakub Jelinek  <jakub@redhat.com>
213         PR c++/79464 - ICE in IPA with omitted constructor parms
214         * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
215         (adjust_clone_args): Adjust.
216         (add_method): Remember omitted parms.
217         * call.c (add_function_candidate): Likewise.
218         * mangle.c (write_method_parms): Likewise.
219         * method.c (ctor_omit_inherited_parms): Return false if there are no
220         parms to omit.
222 2017-02-15  Martin Sebor  <msebor@redhat.com>
224         PR c++/79363
225         * init.c (maybe_reject_flexarray_init): New function.
226         (perform_member_init): Call it.
228 2017-02-15  Jakub Jelinek  <jakub@redhat.com>
230         PR c++/79301
231         * parser.c (cp_parser_std_attribute): Don't pedwarn about
232         [[deprecated]] with -std=c++11 and [[fallthrough]] with
233         -std=c++11 and -std=c++14.
235         PR c++/79288
236         * decl.c (grokdeclarator): For static data members, handle thread_p
237         only after handling inline.
239 2017-02-14  Marek Polacek  <polacek@redhat.com>
241         PR c++/79420
242         PR c++/79463
243         * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
244         clobbering if the postfix expression isn't an EXPR_P.
246 2017-02-13  Jason Merrill  <jason@redhat.com>
248         PR c++/79461 - ICE with lambda in constexpr constructor
249         * constexpr.c (build_data_member_initialization): Ignore
250         initialization of a local variable.
252 2017-02-13  Jakub Jelinek  <jakub@redhat.com>
254         * init.c (warn_placement_new_too_small): Add missing space in
255         diagnostics.
256         * parser.c (cp_parser_oacc_declare): Likewise.
257         * mangle.c (maybe_check_abi_tags): Likewise.
259         PR c++/79232
260         * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
261         on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
262         in the rightmost operand.
264 2017-02-13  Nathan Sidwell  <nathan@acm.org>
266         PR c++/79296 - ICE mangling localized template instantiation
267         * decl2.c (determine_visibility): Use template fn context for
268         local class instantiations.
270 2017-02-11  Jason Merrill  <jason@redhat.com>
272         PR c++/77659 - ICE with new and C++14 aggregate NSDMI
273         * init.c (build_new): Make backups of any CONSTRUCTORs in init.
274         (build_new_1): Use replace_placeholders.
275         * tree.c (replace_placeholders_t): Also track whether we've seen a
276         placeholder.
277         (replace_placeholders, replace_placeholders_r): Adjust.
278         * cp-tree.h: Adjust.
280         PR c++/77790 - ICE with auto function in C++11 mode
281         * decl.c (undeduced_auto_decl): Remove C++14 limitation.
282         (require_deduced_type): Add complain parm, return bool.
283         * cp-tree.h: Adjust.
284         * decl2.c (mark_used): Use require_deduced_type.
286 2017-02-10  Jason Merrill  <jason@redhat.com>
288         PR c++/78908 - template ops and bitfields
289         * tree.c (build_min_non_dep): Use unlowered_expr_type.
291         PR c++/78897 - constexpr union
292         * constexpr.c (cxx_eval_store_expression): A store to a union member
293         erases a previous store to another member.
295         PR c++/71285 - member of fold-expression
296         * semantics.c (finish_unary_fold_expr)
297         (finish_binary_fold_expr): Use null type for fold-expressions.
299         PR c++/79401 - protected inherited constructor
300         * call.c (enforce_access): For inheriting constructor, find a base
301         binfo in the path we already have.
303 2017-02-10  Marek Polacek  <polacek@redhat.com>
305         PR c++/79435
306         * pt.c (type_dependent_expression_p): Check if the expression type
307         is null.
309         PR c++/79184
310         * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
311         if warnings shouldn't be given.
313 2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
315         PR c++/71737
316         * pt.c (tsubst_decl): Don't try to preserve a typedef that names
317         an error_mark_node as type.
319 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
320             Jason Merrill  <jason@redhat.com>
322         PR c++/79143
323         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
324         from pattern to type.
326 2017-02-09  Jason Merrill  <jason@redhat.com>
328         PR c++/79316 - default argument in deduction guide
329         PR c++/79350 - explicit deduction guide
330         * parser.c (cp_parser_constructor_declarator_p)
331         (cp_parser_direct_declarator): Parse deduction guides more like
332         constructors.
333         * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
334         * tree.c (special_function_p): Return it.
335         * decl.c (check_special_function_return_type): Handle it.
336         (grokdeclarator, grokfndecl): Adjust.
337         (cp_finish_decl): Pass flags to do_auto_deduction.
338         * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
339         * pt.c (dguide_name_p): Take a const_tree.
340         (do_class_deduction): Handle explicit.
341         (do_auto_deduction): Pass flags through.
342         (build_deduction_guide): Copy explicit flag.
344 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
346         PR c++/79429
347         * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
348         non-pragma_compound context here.
349         (cp_parser_omp_target): Likewise.
350         (cp_parser_pragma): Don't call push_omp_privatization_clauses and
351         parsing for ordered and target omp pragmas in non-pragma_stmt
352         non-pragma_compound contexts.
354         PR c/79431
355         * parser.c (cp_parser_oacc_declare): Formatting fix.
356         (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
357         automatic variables.
359 2016-02-09  Nathan Sidwell  <nathan@codesourcery.com>
360             Chung-Lin Tang  <cltang@codesourcery.com>
362         * parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
363         parsing.  Parse constant expression. Remove semantic checking.
364         (cp_parser_omp_clause_collapse): Disallow tile.
365         (cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
366         error about missing for after already emitting one.  Use more
367         conventional for idiom for unbounded loop.
368         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
369         * semantics.c (finish_omp_clauses): Correct TILE semantic check.
370         (finish_omp_for): Deal with tile clause.
372 2017-02-07  Nathan Sidwell  <nathan@acm.org>
374         * method.c (synthesized_method_base_walk): New.  Broken out of ...
375         (synthesized_method_walk): ... here.  Call it.  Cleanup
376         initializations.
378 2017-02-07  Patrick Palka  <ppalka@gcc.gnu.org>
380         PR c++/79360
381         * typeck2.c (process_init_constructor_union): Consider only
382         FIELD_DECLs when looking for an NSDMI.
384 2017-02-06  Jason Merrill  <jason@redhat.com>
386         PR c++/71193 - incomplete types in templates
387         * parser.c (cp_parser_postfix_dot_deref_expression): In a template
388         handle incomplete type by pedwarning and then treating as dependent.
390 2017-02-06  Jakub Jelinek  <jakub@redhat.com>
392         PR c++/79379
393         * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
394         (potential_constant_expression_1): Likewise.
396         PR c++/79377
397         * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
398         allow one fewer than expected arguments if flag_permissive.
400         PR c++/79372
401         * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
402         * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
403         with error_mark_node type.
405 2017-02-03  Jason Merrill  <jason@redhat.com>
407         PR c++/78689 - ICE on constructor with label
408         * optimize.c (maybe_clone_body): Replace omitted parameters with
409         null lvalues.
410         * class.c (build_clone): Fix logic for omitting inherited parms.
412         PR c++/12245 - excessive memory use
413         * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
414         back in.  Don't cache constants.
415         (maybe_constant_init): Don't cache constants.
417         PR c++/79294 - ICE with invalid template argument
418         * pt.c (convert_nontype_argument_function): Check value-dependence.
419         (convert_nontype_argument): Don't check it here for function ptrs.
421 2017-02-02  Richard Biener  <rguenther@suse.de>
423         PR cp/14179
424         * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
425         it lazily on the first changed element only and copy it
426         fully upfront, only storing changed elements.
428 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
430         PR c++/69637
431         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
432         to the width.
434 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
436         PR c++/79304
437         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
438         after ARROW_EXPR.
440 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
442         PR c++/79298
443         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
444         any namespace aliases.
446 2017-01-31  Nathan Sidwell  <nathan@acm.org>
448         PR c++/79290
449         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
451         PR c++/67273
452         PR c++/79253
453         * pt.c: (instantiate_decl): Push to top level when current
454         function scope doesn't match.  Only push lmabda scope stack when
455         pushing to top.
457         * cp-tree.h (instantiate_decl): Make defer_ok bool.
458         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
459         (instantiate_decl): Simplify and reorder state saving and restoration.
461         PR c++/79264
462         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
463         * semantics.c (finish_member_declaration): Assert class is being
464         defined.
466 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
468         Introduce C++ support in libcc1.
469         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
470         (ansi_opname): Rename to...
471         (cp_operator_id): ... this.  Adjust all callers.
472         (ansi_assopname): Rename to...
473         (cp_assignment_operator_id): ... this.  Adjust all callers.
474         (cp_literal_operator_id): Declare.
475         (set_global_friend): Declare.
476         (is_global_friend): Declare.
477         (enum cp_oracle_request): New type.
478         (cp_binding_oracle_function): New type.
479         (cp_binding_oracle): Declare.
480         (cp_finish_injected_record_type): Declare.
481         * friend.c (global_friend): New var.
482         (set_global_friend): New fn.
483         (is_global_friend): New fn.
484         (is_friend): Call is_global_friend.
485         * name-lookup.c (cp_binding_oracle): New var.
486         (query_oracle): New fn.
487         (qualified_lookup_using_namespace): Call query_oracle.
488         (lookup_name_real_1): Likewise.
489         * parser.c (cp_literal_operator_id): Drop static.
490         * search.c (friend_accessible_p): Call is_global_friend.
491         * semantics.c (is_this_parameter): Accept a variable if the
492         binding oracle is enabled.
494 2017-01-27  Jason Merrill  <jason@redhat.com>
496         PR c++/78771 - ICE with inherited constructor.
497         * call.c (build_over_call): Call deduce_inheriting_ctor here.
498         * pt.c (tsubst_decl): Not here.
499         * class.c (add_method): Or here.
500         * method.c (deduce_inheriting_ctor): Handle clones.
501         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
503 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
505         PR c++/64382
506         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
507         New function.
508         * cp/cp-tree.h: Declare it.
509         * cp/semantics.c (finish_id_expression): Resolve names within a default
510         capturing generic lambda defined within a template prior to
511         instantiation to allow for captures to be added to the closure type.
513 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
515         PR c++/68727
516         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
517         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
518         * parser.c (cp_parser_builtin_offsetof): Pass result of
519         build_static_cast of null_pointer_node to finish_offsetof.
520         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
521         it for -Winvalid-offsetof pedwarn instead of trying to guess
522         original offsetof type from EXPR.  Save OBJECT_PTR as a new
523         second operand to OFFSETOF_EXPR.
524         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
525         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
526         as OBJECT_PTR.
528 2017-01-26  Jason Merrill  <jason@redhat.com>
530         * name-lookup.c (parse_using_directive): Deprecate strong using.
532         PR c++/79176 - lambda ICE with -flto -Os
533         * decl2.c (vague_linkage_p): Handle decloned 'tors.
534         * tree.c (decl_linkage): Likewise.
536 2017-01-25  Martin Sebor  <msebor@redhat.com>
538         * decl.c (grokdeclarator): Fix a typo in a comment.
540 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
542         PR c++/78896
543         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
544         lambda expressions.
546         PR c++/77914
547         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
548         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
550 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
552         PR lto/79061
553         * decl.c (cxx_init_decl_processing): Pass main_input_filename
554         to build_translation_unit_decl.
556 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
558         PR c++/79205
559         * cp-gimplify.c (cp_genericize_r): Add result of
560         convert_from_reference on invisiref parm to p_set.
562 2017-01-24  Nathan Sidwell  <nathan@acm.org>
564         PR c++/78469 - defaulted ctor and inaccessible dtor
565         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
566         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
567         * tree.c (build_target_expr): Check tf_no_cleanup.
569         PR c++/79118 - anon-members and constexpr
570         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
571         ctor decl.  Recursively check anonymous members.
572         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
573         call.
574         (explain_invalid_constexpr_fn): Likewise.
576 2017-01-23  Nathan Sidwell  <nathan@acm.org>
578         PR c++/71710 - template using directive of field
579         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
580         check earlier.
582         PR c++/71406 - ICE with scope-ref'd template id exprs
583         PR c++/77508
584         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
585         before breaking up TEMPLATE_ID_EXPR.
587 2017-01-20  Nathan Sidwell  <nathan@acm.org>
589         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
590         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
592 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
594         PR c++/77829
595         PR c++/78656
596         * cp-tree.h (suggest_alternatives_for): Add bool param.
597         (suggest_alternative_in_explicit_scope): New decl.
598         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
599         that isn't the global one, call new function
600         suggest_alternative_in_explicit_scope, only calling
601         suggest_alternatives_for if it fails, and disabling near match
602         searches fort that case.  When SCOPE is the global namespace,
603         pass true for new param to suggest_alternatives_for to allow for
604         fuzzy name lookups.
605         * lex.c (unqualified_name_lookup_error): Pass true for new param
606         to suggest_alternatives_for.
607         * name-lookup.c (consider_binding_level): Add forward decl.
608         (suggest_alternatives_for): Add "suggest_misspellings" param,
609         using it to conditionalize the fuzzy name-lookup code.
610         (suggest_alternative_in_explicit_scope): New function.
611         * parser.c (cp_parser_primary_expression): When calling
612         finish_id_expression, pass location of id_expression rather
613         than that of id_expr_token.
614         (cp_parser_id_expression): Convert local "unqualified_id" from
615         tree to cp_expr to avoid implicitly dropping location information.
617 2017-01-20  Marek Polacek  <polacek@redhat.com>
619         PR c/64279
620         * call.c (build_conditional_expr_1): Warn about duplicated branches.
621         * semantics.c (finish_expr_stmt): Build statement using the proper
622         location.
624 2017-01-19  Jason Merrill  <jason@redhat.com>
626         US 20 - forwarding references and class template argument deduction
627         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
628         * pt.c (push_template_decl_real): Set it.
629         (maybe_adjust_types_for_deduction): Check it.
630         (rewrite_template_parm): Copy it.
632         US 19 - deduction guides and constructors
633         * call.c (joust): Prefer deduction guides to constructors.
634         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
635         (deduction_guide_p): Check DECL_P.
637         * decl.c (check_initializer): Always use build_aggr_init for array
638         decomposition.
640         PR c++/79130 - decomposition and direct-initialization
641         * init.c (build_aggr_init): Communicate direct-initialization to
642         build_vec_init.
643         (build_vec_init): Check for array copy sooner.
644         * parser.c (cp_parser_decomposition_declaration): Remove call to
645         build_x_compound_expr_from_list.
647 2017-01-18  Jason Merrill  <jason@redhat.com>
649         PR c++/68666 - member variable template-id
650         * typeck.c (finish_class_member_access_expr): Handle variable
651         template-id.
652         * pt.c (lookup_and_finish_template_variable): No longer static.
653         * cp-tree.h: Declare it.
655 2017-01-18  Nathan Sidwell  <nathan@acm.org>
657         PR c++/78488
658         * call.c (build_over_call): When checking ellipsis conversions for
659         an inherited ctor, make sure there is at least one conversion.
661 2017-01-18  Jason Merrill  <jason@redhat.com>
663         PR c++/78894 - ICE with class deduction and default arg
664         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
666 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
668         PR c++/77489
669         * mangle.c (write_discriminator): Reorganize abi warning check.
671 2017-01-18  Nathan Sidwell  <nathan@acm.org>
673         * cp-tree.h: Clarify exception spec node comment.
674         * except.c (nothrow_spec_p): Simplify by checking node-equality.
676         PR c++/79091
677         * mangle.c (write_exception_spec): Check nothrow explicitly.
678         (write_encoding): Don't increment processing_template_decl around
679         encoding.
681 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
683         PR c++/70182
684         * mangle.c (write_template_args): Add "on" for operator names.
686 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
688         PR c++/77489
689         * mangle.c (write_discriminator): Handle discriminator >= 10.
691 2017-01-17  Nathan Sidwell  <nathan@acm.org>
693         PR c++/61636
694         * cp-tree.h (maybe_generic_this_capture): Declare.
695         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
696         (maybe_resolve_dummy): ... here.  Call it.
697         (maybe_generic_this_capture): New.
698         * parser.c (cp_parser_postfix_expression): Speculatively capture
699         this in generic lambda in unresolved member function call.
700         * pt.c (tsubst_copy_and_build): Force hard error from failed
701         member function lookup in generic lambda.
703 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
705         PR c++/70565
706         * cp-array-notation.c (expand_array_notation_exprs): Handle
707         OMP_PARALLEL.
709 2017-01-11  Jason Merrill  <jason@redhat.com>
711         PR c++/78337 - ICE on invalid with generic lambda
712         * semantics.c (process_outer_var_ref): Check if containing_function
713         is null.  Move inform call under complain test.
715 2017-01-11  Nathan Sidwell  <nathan@acm.org>
717         PR c++/77812
718         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
719         is a new overload.
721 2017-01-11  Nathan Sidwell  <nathan@acm.org>
723         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
725 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
727         PR c++/78341
728         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
729         assertion.  Formatting fix.
731         PR c++/72813
732         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
733         writing PCH file.
735 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
737         PR c++/77949
738         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
739         a missing semicolon if we have a valid insertion location for
740         the fix-it hint.
742 2017-01-10  Jason Merrill  <jason@redhat.com>
744         FI 20, decomposition declaration with parenthesized initializer.
745         * parser.c (cp_parser_decomposition_declaration): Use
746         cp_parser_initializer.
748 2017-01-09  Jason Merrill  <jason@redhat.com>
750         Implement P0195R2, C++17 variadic using.
751         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
752         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
753         * error.c (dump_decl): Likewise.
755 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
757         PR translation/79019
758         PR translation/79020
759         * semantics.c (finish_omp_clauses): Add missing whitespace to
760         translatable strings.
761         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
763 2017-01-07  Jason Merrill  <jason@redhat.com>
765         PR c++/78948 - instantiation from discarded statement
766         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
767         * cp-tree.h (in_discarded_stmt): Declare it.
768         (struct saved_scope): Add discarded_stmt bitfield.
769         (in_discarded_stmt): New macro.
770         * decl2.c (mark_used): Check it.
771         * parser.c (cp_parser_selection_statement): Adjust.
772         (cp_parser_jump_statement): Adjust.
774 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
776         PR c++/78931
777         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
778         REFERENCE_REF_P, set tt to its operand.
780         PR c++/78890
781         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
782         unions even for C++11 and later.
784 2017-01-05  Nathan Sidwell  <nathan@acm.org>
786         PR c++/78765
787         * pt.c (convert_nontype_argument): Don't try and see if integral
788         or enum expressions are constants prematurely.
790 2017-01-04  Marek Polacek  <polacek@redhat.com>
792         PR c++/64767
793         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
794         a zero character literal.
796 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
798         PR c++/78949
799         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
800         vector type.
802         PR c++/78693
803         * parser.c (cp_parser_simple_declaration): Only complain about
804         inconsistent auto deduction if auto_result doesn't use auto.
806         * parser.c (cp_parser_simple_declaration): Diagnose function
807         declaration among more than one init-declarators with auto
808         specifier.
810         PR c++/71182
811         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
812         assertion, as lexer->buffer may be NULL.
814 2017-01-04  Marek Polacek  <polacek@redhat.com>
816         PR c++/77545
817         PR c++/77284
818         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
820 2017-01-04  Nathan Sidwell  <nathan@acm.org>
822         PR c++/66735
823         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
824         (lambda_capture_field_type): Update prototype.
825         * lambda.c (lambda_capture_field_type): Add is_reference parm.
826         Add referenceness here.
827         (add_capture): Adjust lambda_capture_field_type call, refactor
828         error checking.
829         * pt.c (tsubst): Adjust lambda_capture_field_type call.
831 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
833         Update copyright years.
835 Copyright (C) 2017 Free Software Foundation, Inc.
837 Copying and distribution of this file, with or without modification,
838 are permitted in any medium without royalty provided the copyright
839 notice and this notice are preserved.