/cp
[official-gcc.git] / gcc / cp / ChangeLog
blobfbea09af7fc47aaf221eef725b6c91bee41e2c15
1 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
3         PR c++/69637
4         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
5         to the width.
7 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
9         PR c++/79304
10         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
11         after ARROW_EXPR.
13 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
15         PR c++/79298
16         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
17         any namespace aliases.
19 2017-01-31  Nathan Sidwell  <nathan@acm.org>
21         PR c++/79290
22         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
24         PR c++/67273
25         PR c++/79253
26         * pt.c: (instantiate_decl): Push to top level when current
27         function scope doesn't match.  Only push lmabda scope stack when
28         pushing to top.
30         * cp-tree.h (instantiate_decl): Make defer_ok bool.
31         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
32         (instantiate_decl): Simplify and reorder state saving and restoration.
34         PR c++/79264
35         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
36         * semantics.c (finish_member_declaration): Assert class is being
37         defined.
39 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
41         Introduce C++ support in libcc1.
42         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
43         (ansi_opname): Rename to...
44         (cp_operator_id): ... this.  Adjust all callers.
45         (ansi_assopname): Rename to...
46         (cp_assignment_operator_id): ... this.  Adjust all callers.
47         (cp_literal_operator_id): Declare.
48         (set_global_friend): Declare.
49         (is_global_friend): Declare.
50         (enum cp_oracle_request): New type.
51         (cp_binding_oracle_function): New type.
52         (cp_binding_oracle): Declare.
53         (cp_finish_injected_record_type): Declare.
54         * friend.c (global_friend): New var.
55         (set_global_friend): New fn.
56         (is_global_friend): New fn.
57         (is_friend): Call is_global_friend.
58         * name-lookup.c (cp_binding_oracle): New var.
59         (query_oracle): New fn.
60         (qualified_lookup_using_namespace): Call query_oracle.
61         (lookup_name_real_1): Likewise.
62         * parser.c (cp_literal_operator_id): Drop static.
63         * search.c (friend_accessible_p): Call is_global_friend.
64         * semantics.c (is_this_parameter): Accept a variable if the
65         binding oracle is enabled.
67 2017-01-27  Jason Merrill  <jason@redhat.com>
69         PR c++/78771 - ICE with inherited constructor.
70         * call.c (build_over_call): Call deduce_inheriting_ctor here.
71         * pt.c (tsubst_decl): Not here.
72         * class.c (add_method): Or here.
73         * method.c (deduce_inheriting_ctor): Handle clones.
74         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
76 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
78         PR c++/64382
79         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
80         New function.
81         * cp/cp-tree.h: Declare it.
82         * cp/semantics.c (finish_id_expression): Resolve names within a default
83         capturing generic lambda defined within a template prior to
84         instantiation to allow for captures to be added to the closure type.
86 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
88         PR c++/68727
89         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
90         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
91         * parser.c (cp_parser_builtin_offsetof): Pass result of
92         build_static_cast of null_pointer_node to finish_offsetof.
93         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
94         it for -Winvalid-offsetof pedwarn instead of trying to guess
95         original offsetof type from EXPR.  Save OBJECT_PTR as a new
96         second operand to OFFSETOF_EXPR.
97         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
98         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
99         as OBJECT_PTR.
101 2017-01-26  Jason Merrill  <jason@redhat.com>
103         * name-lookup.c (parse_using_directive): Deprecate strong using.
105         PR c++/79176 - lambda ICE with -flto -Os
106         * decl2.c (vague_linkage_p): Handle decloned 'tors.
107         * tree.c (decl_linkage): Likewise.
109 2017-01-25  Martin Sebor  <msebor@redhat.com>
111         * decl.c (grokdeclarator): Fix a typo in a comment.
113 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
115         PR c++/78896
116         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
117         lambda expressions.
119         PR c++/77914
120         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
121         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
123 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
125         PR lto/79061
126         * decl.c (cxx_init_decl_processing): Pass main_input_filename
127         to build_translation_unit_decl.
129 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
131         PR c++/79205
132         * cp-gimplify.c (cp_genericize_r): Add result of
133         convert_from_reference on invisiref parm to p_set.
135 2017-01-24  Nathan Sidwell  <nathan@acm.org>
137         PR c++/78469 - defaulted ctor and inaccessible dtor
138         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
139         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
140         * tree.c (build_target_expr): Check tf_no_cleanup.
142         PR c++/79118 - anon-members and constexpr
143         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
144         ctor decl.  Recursively check anonymous members.
145         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
146         call.
147         (explain_invalid_constexpr_fn): Likewise.
149 2017-01-23  Nathan Sidwell  <nathan@acm.org>
151         PR c++/71710 - template using directive of field
152         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
153         check earlier.
155         PR c++/71406 - ICE with scope-ref'd template id exprs
156         PR c++/77508
157         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
158         before breaking up TEMPLATE_ID_EXPR.
160 2017-01-20  Nathan Sidwell  <nathan@acm.org>
162         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
163         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
165 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
167         PR c++/77829
168         PR c++/78656
169         * cp-tree.h (suggest_alternatives_for): Add bool param.
170         (suggest_alternative_in_explicit_scope): New decl.
171         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
172         that isn't the global one, call new function
173         suggest_alternative_in_explicit_scope, only calling
174         suggest_alternatives_for if it fails, and disabling near match
175         searches fort that case.  When SCOPE is the global namespace,
176         pass true for new param to suggest_alternatives_for to allow for
177         fuzzy name lookups.
178         * lex.c (unqualified_name_lookup_error): Pass true for new param
179         to suggest_alternatives_for.
180         * name-lookup.c (consider_binding_level): Add forward decl.
181         (suggest_alternatives_for): Add "suggest_misspellings" param,
182         using it to conditionalize the fuzzy name-lookup code.
183         (suggest_alternative_in_explicit_scope): New function.
184         * parser.c (cp_parser_primary_expression): When calling
185         finish_id_expression, pass location of id_expression rather
186         than that of id_expr_token.
187         (cp_parser_id_expression): Convert local "unqualified_id" from
188         tree to cp_expr to avoid implicitly dropping location information.
190 2017-01-20  Marek Polacek  <polacek@redhat.com>
192         PR c/64279
193         * call.c (build_conditional_expr_1): Warn about duplicated branches.
194         * semantics.c (finish_expr_stmt): Build statement using the proper
195         location.
197 2017-01-19  Jason Merrill  <jason@redhat.com>
199         US 20 - forwarding references and class template argument deduction
200         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
201         * pt.c (push_template_decl_real): Set it.
202         (maybe_adjust_types_for_deduction): Check it.
203         (rewrite_template_parm): Copy it.
205         US 19 - deduction guides and constructors
206         * call.c (joust): Prefer deduction guides to constructors.
207         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
208         (deduction_guide_p): Check DECL_P.
210         * decl.c (check_initializer): Always use build_aggr_init for array
211         decomposition.
213         PR c++/79130 - decomposition and direct-initialization
214         * init.c (build_aggr_init): Communicate direct-initialization to
215         build_vec_init.
216         (build_vec_init): Check for array copy sooner.
217         * parser.c (cp_parser_decomposition_declaration): Remove call to
218         build_x_compound_expr_from_list.
220 2017-01-18  Jason Merrill  <jason@redhat.com>
222         PR c++/68666 - member variable template-id
223         * typeck.c (finish_class_member_access_expr): Handle variable
224         template-id.
225         * pt.c (lookup_and_finish_template_variable): No longer static.
226         * cp-tree.h: Declare it.
228 2017-01-18  Nathan Sidwell  <nathan@acm.org>
230         PR c++/78488
231         * call.c (build_over_call): When checking ellipsis conversions for
232         an inherited ctor, make sure there is at least one conversion.
234 2017-01-18  Jason Merrill  <jason@redhat.com>
236         PR c++/78894 - ICE with class deduction and default arg
237         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
239 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
241         PR c++/77489
242         * mangle.c (write_discriminator): Reorganize abi warning check.
244 2017-01-18  Nathan Sidwell  <nathan@acm.org>
246         * cp-tree.h: Clarify exception spec node comment.
247         * except.c (nothrow_spec_p): Simplify by checking node-equality.
249         PR c++/79091
250         * mangle.c (write_exception_spec): Check nothrow explicitly.
251         (write_encoding): Don't increment processing_template_decl around
252         encoding.
254 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
256         PR c++/70182
257         * mangle.c (write_template_args): Add "on" for operator names.
259 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
261         PR c++/77489
262         * mangle.c (write_discriminator): Handle discriminator >= 10.
264 2017-01-17  Nathan Sidwell  <nathan@acm.org>
266         PR c++/61636
267         * cp-tree.h (maybe_generic_this_capture): Declare.
268         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
269         (maybe_resolve_dummy): ... here.  Call it.
270         (maybe_generic_this_capture): New.
271         * parser.c (cp_parser_postfix_expression): Speculatively capture
272         this in generic lambda in unresolved member function call.
273         * pt.c (tsubst_copy_and_build): Force hard error from failed
274         member function lookup in generic lambda.
276 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
278         PR c++/70565
279         * cp-array-notation.c (expand_array_notation_exprs): Handle
280         OMP_PARALLEL.
282 2017-01-11  Jason Merrill  <jason@redhat.com>
284         PR c++/78337 - ICE on invalid with generic lambda
285         * semantics.c (process_outer_var_ref): Check if containing_function
286         is null.  Move inform call under complain test.
288 2017-01-11  Nathan Sidwell  <nathan@acm.org>
290         PR c++/77812
291         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
292         is a new overload.
294 2017-01-11  Nathan Sidwell  <nathan@acm.org>
296         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
298 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
300         PR c++/78341
301         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
302         assertion.  Formatting fix.
304         PR c++/72813
305         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
306         writing PCH file.
308 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
310         PR c++/77949
311         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
312         a missing semicolon if we have a valid insertion location for
313         the fix-it hint.
315 2017-01-10  Jason Merrill  <jason@redhat.com>
317         FI 20, decomposition declaration with parenthesized initializer.
318         * parser.c (cp_parser_decomposition_declaration): Use
319         cp_parser_initializer.
321 2017-01-09  Jason Merrill  <jason@redhat.com>
323         Implement P0195R2, C++17 variadic using.
324         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
325         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
326         * error.c (dump_decl): Likewise.
328 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
330         PR translation/79019
331         PR translation/79020
332         * semantics.c (finish_omp_clauses): Add missing whitespace to
333         translatable strings.
334         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
336 2017-01-07  Jason Merrill  <jason@redhat.com>
338         PR c++/78948 - instantiation from discarded statement
339         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
340         * cp-tree.h (in_discarded_stmt): Declare it.
341         (struct saved_scope): Add discarded_stmt bitfield.
342         (in_discarded_stmt): New macro.
343         * decl2.c (mark_used): Check it.
344         * parser.c (cp_parser_selection_statement): Adjust.
345         (cp_parser_jump_statement): Adjust.
347 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
349         PR c++/78931
350         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
351         REFERENCE_REF_P, set tt to its operand.
353         PR c++/78890
354         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
355         unions even for C++11 and later.
357 2017-01-05  Nathan Sidwell  <nathan@acm.org>
359         PR c++/78765
360         * pt.c (convert_nontype_argument): Don't try and see if integral
361         or enum expressions are constants prematurely.
363 2017-01-04  Marek Polacek  <polacek@redhat.com>
365         PR c++/64767
366         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
367         a zero character literal.
369 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
371         PR c++/78949
372         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
373         vector type.
375         PR c++/78693
376         * parser.c (cp_parser_simple_declaration): Only complain about
377         inconsistent auto deduction if auto_result doesn't use auto.
379         * parser.c (cp_parser_simple_declaration): Diagnose function
380         declaration among more than one init-declarators with auto
381         specifier.
383         PR c++/71182
384         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
385         assertion, as lexer->buffer may be NULL.
387 2017-01-04  Marek Polacek  <polacek@redhat.com>
389         PR c++/77545
390         PR c++/77284
391         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
393 2017-01-04  Nathan Sidwell  <nathan@acm.org>
395         PR c++/66735
396         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
397         (lambda_capture_field_type): Update prototype.
398         * lambda.c (lambda_capture_field_type): Add is_reference parm.
399         Add referenceness here.
400         (add_capture): Adjust lambda_capture_field_type call, refactor
401         error checking.
402         * pt.c (tsubst): Adjust lambda_capture_field_type call.
404 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
406         Update copyright years.
408 Copyright (C) 2017 Free Software Foundation, Inc.
410 Copying and distribution of this file, with or without modification,
411 are permitted in any medium without royalty provided the copyright
412 notice and this notice are preserved.