C++: fix fix-it hints for misspellings within explicit namespaces
[official-gcc.git] / gcc / cp / ChangeLog
blob9b71c90f742053a36ef91d45e35ada6057978b3d
1 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
3         PR c++/77829
4         PR c++/78656
5         * cp-tree.h (suggest_alternatives_for): Add bool param.
6         (suggest_alternative_in_explicit_scope): New decl.
7         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
8         that isn't the global one, call new function
9         suggest_alternative_in_explicit_scope, only calling
10         suggest_alternatives_for if it fails, and disabling near match
11         searches fort that case.  When SCOPE is the global namespace,
12         pass true for new param to suggest_alternatives_for to allow for
13         fuzzy name lookups.
14         * lex.c (unqualified_name_lookup_error): Pass true for new param
15         to suggest_alternatives_for.
16         * name-lookup.c (consider_binding_level): Add forward decl.
17         (suggest_alternatives_for): Add "suggest_misspellings" param,
18         using it to conditionalize the fuzzy name-lookup code.
19         (suggest_alternative_in_explicit_scope): New function.
20         * parser.c (cp_parser_primary_expression): When calling
21         finish_id_expression, pass location of id_expression rather
22         than that of id_expr_token.
23         (cp_parser_id_expression): Convert local "unqualified_id" from
24         tree to cp_expr to avoid implicitly dropping location information.
26 2017-01-20  Marek Polacek  <polacek@redhat.com>
28         PR c/64279
29         * call.c (build_conditional_expr_1): Warn about duplicated branches.
30         * semantics.c (finish_expr_stmt): Build statement using the proper
31         location.
33 2017-01-19  Jason Merrill  <jason@redhat.com>
35         US 20 - forwarding references and class template argument deduction
36         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
37         * pt.c (push_template_decl_real): Set it.
38         (maybe_adjust_types_for_deduction): Check it.
39         (rewrite_template_parm): Copy it.
41         US 19 - deduction guides and constructors
42         * call.c (joust): Prefer deduction guides to constructors.
43         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
44         (deduction_guide_p): Check DECL_P.
46         * decl.c (check_initializer): Always use build_aggr_init for array
47         decomposition.
49         PR c++/79130 - decomposition and direct-initialization
50         * init.c (build_aggr_init): Communicate direct-initialization to
51         build_vec_init.
52         (build_vec_init): Check for array copy sooner.
53         * parser.c (cp_parser_decomposition_declaration): Remove call to
54         build_x_compound_expr_from_list.
56 2017-01-18  Jason Merrill  <jason@redhat.com>
58         PR c++/68666 - member variable template-id
59         * typeck.c (finish_class_member_access_expr): Handle variable
60         template-id.
61         * pt.c (lookup_and_finish_template_variable): No longer static.
62         * cp-tree.h: Declare it.
64 2017-01-18  Nathan Sidwell  <nathan@acm.org>
66         PR c++/78488
67         * call.c (build_over_call): When checking ellipsis conversions for
68         an inherited ctor, make sure there is at least one conversion.
70 2017-01-18  Jason Merrill  <jason@redhat.com>
72         PR c++/78894 - ICE with class deduction and default arg
73         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
75 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
77         PR c++/77489
78         * mangle.c (write_discriminator): Reorganize abi warning check.
80 2017-01-18  Nathan Sidwell  <nathan@acm.org>
82         * cp-tree.h: Clarify exception spec node comment.
83         * except.c (nothrow_spec_p): Simplify by checking node-equality.
85         PR c++/79091
86         * mangle.c (write_exception_spec): Check nothrow explicitly.
87         (write_encoding): Don't increment processing_template_decl around
88         encoding.
90 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
92         PR c++/70182
93         * mangle.c (write_template_args): Add "on" for operator names.
95 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
97         PR c++/77489
98         * mangle.c (write_discriminator): Handle discriminator >= 10.
100 2017-01-17  Nathan Sidwell  <nathan@acm.org>
102         PR c++/61636
103         * cp-tree.h (maybe_generic_this_capture): Declare.
104         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
105         (maybe_resolve_dummy): ... here.  Call it.
106         (maybe_generic_this_capture): New.
107         * parser.c (cp_parser_postfix_expression): Speculatively capture
108         this in generic lambda in unresolved member function call.
109         * pt.c (tsubst_copy_and_build): Force hard error from failed
110         member function lookup in generic lambda.
112 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
114         PR c++/70565
115         * cp-array-notation.c (expand_array_notation_exprs): Handle
116         OMP_PARALLEL.
118 2017-01-11  Jason Merrill  <jason@redhat.com>
120         PR c++/78337 - ICE on invalid with generic lambda
121         * semantics.c (process_outer_var_ref): Check if containing_function
122         is null.  Move inform call under complain test.
124 2017-01-11  Nathan Sidwell  <nathan@acm.org>
126         PR c++/77812
127         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
128         is a new overload.
130 2017-01-11  Nathan Sidwell  <nathan@acm.org>
132         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
134 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
136         PR c++/78341
137         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
138         assertion.  Formatting fix.
140         PR c++/72813
141         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
142         writing PCH file.
144 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
146         PR c++/77949
147         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
148         a missing semicolon if we have a valid insertion location for
149         the fix-it hint.
151 2017-01-10  Jason Merrill  <jason@redhat.com>
153         FI 20, decomposition declaration with parenthesized initializer.
154         * parser.c (cp_parser_decomposition_declaration): Use
155         cp_parser_initializer.
157 2017-01-09  Jason Merrill  <jason@redhat.com>
159         Implement P0195R2, C++17 variadic using.
160         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
161         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
162         * error.c (dump_decl): Likewise.
164 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
166         PR translation/79019
167         PR translation/79020
168         * semantics.c (finish_omp_clauses): Add missing whitespace to
169         translatable strings.
170         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
172 2017-01-07  Jason Merrill  <jason@redhat.com>
174         PR c++/78948 - instantiation from discarded statement
175         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
176         * cp-tree.h (in_discarded_stmt): Declare it.
177         (struct saved_scope): Add discarded_stmt bitfield.
178         (in_discarded_stmt): New macro.
179         * decl2.c (mark_used): Check it.
180         * parser.c (cp_parser_selection_statement): Adjust.
181         (cp_parser_jump_statement): Adjust.
183 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
185         PR c++/78931
186         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
187         REFERENCE_REF_P, set tt to its operand.
189         PR c++/78890
190         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
191         unions even for C++11 and later.
193 2017-01-05  Nathan Sidwell  <nathan@acm.org>
195         PR c++/78765
196         * pt.c (convert_nontype_argument): Don't try and see if integral
197         or enum expressions are constants prematurely.
199 2017-01-04  Marek Polacek  <polacek@redhat.com>
201         PR c++/64767
202         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
203         a zero character literal.
205 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
207         PR c++/78949
208         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
209         vector type.
211         PR c++/78693
212         * parser.c (cp_parser_simple_declaration): Only complain about
213         inconsistent auto deduction if auto_result doesn't use auto.
215         * parser.c (cp_parser_simple_declaration): Diagnose function
216         declaration among more than one init-declarators with auto
217         specifier.
219         PR c++/71182
220         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
221         assertion, as lexer->buffer may be NULL.
223 2017-01-04  Marek Polacek  <polacek@redhat.com>
225         PR c++/77545
226         PR c++/77284
227         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
229 2017-01-04  Nathan Sidwell  <nathan@acm.org>
231         PR c++/66735
232         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
233         (lambda_capture_field_type): Update prototype.
234         * lambda.c (lambda_capture_field_type): Add is_reference parm.
235         Add referenceness here.
236         (add_capture): Adjust lambda_capture_field_type call, refactor
237         error checking.
238         * pt.c (tsubst): Adjust lambda_capture_field_type call.
240 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
242         Update copyright years.
244 Copyright (C) 2017 Free Software Foundation, Inc.
246 Copying and distribution of this file, with or without modification,
247 are permitted in any medium without royalty provided the copyright
248 notice and this notice are preserved.