PR c++/78771 - ICE with inherited constructor.
[gcc.git] / gcc / cp / ChangeLog
1 2017-01-27 Jason Merrill <jason@redhat.com>
2
3 PR c++/78771 - ICE with inherited constructor.
4 * call.c (build_over_call): Call deduce_inheriting_ctor here.
5 * pt.c (tsubst_decl): Not here.
6 * class.c (add_method): Or here.
7 * method.c (deduce_inheriting_ctor): Handle clones.
8 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
9
10 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
11
12 PR c++/64382
13 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
14 New function.
15 * cp/cp-tree.h: Declare it.
16 * cp/semantics.c (finish_id_expression): Resolve names within a default
17 capturing generic lambda defined within a template prior to
18 instantiation to allow for captures to be added to the closure type.
19
20 2017-01-26 Jakub Jelinek <jakub@redhat.com>
21
22 PR c++/68727
23 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
24 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
25 * parser.c (cp_parser_builtin_offsetof): Pass result of
26 build_static_cast of null_pointer_node to finish_offsetof.
27 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
28 it for -Winvalid-offsetof pedwarn instead of trying to guess
29 original offsetof type from EXPR. Save OBJECT_PTR as a new
30 second operand to OFFSETOF_EXPR.
31 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
32 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
33 as OBJECT_PTR.
34
35 2017-01-26 Jason Merrill <jason@redhat.com>
36
37 * name-lookup.c (parse_using_directive): Deprecate strong using.
38
39 PR c++/79176 - lambda ICE with -flto -Os
40 * decl2.c (vague_linkage_p): Handle decloned 'tors.
41 * tree.c (decl_linkage): Likewise.
42
43 2017-01-25 Martin Sebor <msebor@redhat.com>
44
45 * decl.c (grokdeclarator): Fix a typo in a comment.
46
47 2017-01-25 Jakub Jelinek <jakub@redhat.com>
48
49 PR c++/78896
50 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
51 lambda expressions.
52
53 PR c++/77914
54 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
55 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
56
57 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
58
59 PR lto/79061
60 * decl.c (cxx_init_decl_processing): Pass main_input_filename
61 to build_translation_unit_decl.
62
63 2017-01-24 Jakub Jelinek <jakub@redhat.com>
64
65 PR c++/79205
66 * cp-gimplify.c (cp_genericize_r): Add result of
67 convert_from_reference on invisiref parm to p_set.
68
69 2017-01-24 Nathan Sidwell <nathan@acm.org>
70
71 PR c++/78469 - defaulted ctor and inaccessible dtor
72 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
73 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
74 * tree.c (build_target_expr): Check tf_no_cleanup.
75
76 PR c++/79118 - anon-members and constexpr
77 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
78 ctor decl. Recursively check anonymous members.
79 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
80 call.
81 (explain_invalid_constexpr_fn): Likewise.
82
83 2017-01-23 Nathan Sidwell <nathan@acm.org>
84
85 PR c++/71710 - template using directive of field
86 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
87 check earlier.
88
89 PR c++/71406 - ICE with scope-ref'd template id exprs
90 PR c++/77508
91 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
92 before breaking up TEMPLATE_ID_EXPR.
93
94 2017-01-20 Nathan Sidwell <nathan@acm.org>
95
96 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
97 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
98
99 2017-01-20 David Malcolm <dmalcolm@redhat.com>
100
101 PR c++/77829
102 PR c++/78656
103 * cp-tree.h (suggest_alternatives_for): Add bool param.
104 (suggest_alternative_in_explicit_scope): New decl.
105 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
106 that isn't the global one, call new function
107 suggest_alternative_in_explicit_scope, only calling
108 suggest_alternatives_for if it fails, and disabling near match
109 searches fort that case. When SCOPE is the global namespace,
110 pass true for new param to suggest_alternatives_for to allow for
111 fuzzy name lookups.
112 * lex.c (unqualified_name_lookup_error): Pass true for new param
113 to suggest_alternatives_for.
114 * name-lookup.c (consider_binding_level): Add forward decl.
115 (suggest_alternatives_for): Add "suggest_misspellings" param,
116 using it to conditionalize the fuzzy name-lookup code.
117 (suggest_alternative_in_explicit_scope): New function.
118 * parser.c (cp_parser_primary_expression): When calling
119 finish_id_expression, pass location of id_expression rather
120 than that of id_expr_token.
121 (cp_parser_id_expression): Convert local "unqualified_id" from
122 tree to cp_expr to avoid implicitly dropping location information.
123
124 2017-01-20 Marek Polacek <polacek@redhat.com>
125
126 PR c/64279
127 * call.c (build_conditional_expr_1): Warn about duplicated branches.
128 * semantics.c (finish_expr_stmt): Build statement using the proper
129 location.
130
131 2017-01-19 Jason Merrill <jason@redhat.com>
132
133 US 20 - forwarding references and class template argument deduction
134 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
135 * pt.c (push_template_decl_real): Set it.
136 (maybe_adjust_types_for_deduction): Check it.
137 (rewrite_template_parm): Copy it.
138
139 US 19 - deduction guides and constructors
140 * call.c (joust): Prefer deduction guides to constructors.
141 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
142 (deduction_guide_p): Check DECL_P.
143
144 * decl.c (check_initializer): Always use build_aggr_init for array
145 decomposition.
146
147 PR c++/79130 - decomposition and direct-initialization
148 * init.c (build_aggr_init): Communicate direct-initialization to
149 build_vec_init.
150 (build_vec_init): Check for array copy sooner.
151 * parser.c (cp_parser_decomposition_declaration): Remove call to
152 build_x_compound_expr_from_list.
153
154 2017-01-18 Jason Merrill <jason@redhat.com>
155
156 PR c++/68666 - member variable template-id
157 * typeck.c (finish_class_member_access_expr): Handle variable
158 template-id.
159 * pt.c (lookup_and_finish_template_variable): No longer static.
160 * cp-tree.h: Declare it.
161
162 2017-01-18 Nathan Sidwell <nathan@acm.org>
163
164 PR c++/78488
165 * call.c (build_over_call): When checking ellipsis conversions for
166 an inherited ctor, make sure there is at least one conversion.
167
168 2017-01-18 Jason Merrill <jason@redhat.com>
169
170 PR c++/78894 - ICE with class deduction and default arg
171 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
172
173 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
174
175 PR c++/77489
176 * mangle.c (write_discriminator): Reorganize abi warning check.
177
178 2017-01-18 Nathan Sidwell <nathan@acm.org>
179
180 * cp-tree.h: Clarify exception spec node comment.
181 * except.c (nothrow_spec_p): Simplify by checking node-equality.
182
183 PR c++/79091
184 * mangle.c (write_exception_spec): Check nothrow explicitly.
185 (write_encoding): Don't increment processing_template_decl around
186 encoding.
187
188 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
189
190 PR c++/70182
191 * mangle.c (write_template_args): Add "on" for operator names.
192
193 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
194
195 PR c++/77489
196 * mangle.c (write_discriminator): Handle discriminator >= 10.
197
198 2017-01-17 Nathan Sidwell <nathan@acm.org>
199
200 PR c++/61636
201 * cp-tree.h (maybe_generic_this_capture): Declare.
202 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
203 (maybe_resolve_dummy): ... here. Call it.
204 (maybe_generic_this_capture): New.
205 * parser.c (cp_parser_postfix_expression): Speculatively capture
206 this in generic lambda in unresolved member function call.
207 * pt.c (tsubst_copy_and_build): Force hard error from failed
208 member function lookup in generic lambda.
209
210 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
211
212 PR c++/70565
213 * cp-array-notation.c (expand_array_notation_exprs): Handle
214 OMP_PARALLEL.
215
216 2017-01-11 Jason Merrill <jason@redhat.com>
217
218 PR c++/78337 - ICE on invalid with generic lambda
219 * semantics.c (process_outer_var_ref): Check if containing_function
220 is null. Move inform call under complain test.
221
222 2017-01-11 Nathan Sidwell <nathan@acm.org>
223
224 PR c++/77812
225 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
226 is a new overload.
227
228 2017-01-11 Nathan Sidwell <nathan@acm.org>
229
230 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
231
232 2017-01-11 Jakub Jelinek <jakub@redhat.com>
233
234 PR c++/78341
235 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
236 assertion. Formatting fix.
237
238 PR c++/72813
239 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
240 writing PCH file.
241
242 2017-01-10 David Malcolm <dmalcolm@redhat.com>
243
244 PR c++/77949
245 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
246 a missing semicolon if we have a valid insertion location for
247 the fix-it hint.
248
249 2017-01-10 Jason Merrill <jason@redhat.com>
250
251 FI 20, decomposition declaration with parenthesized initializer.
252 * parser.c (cp_parser_decomposition_declaration): Use
253 cp_parser_initializer.
254
255 2017-01-09 Jason Merrill <jason@redhat.com>
256
257 Implement P0195R2, C++17 variadic using.
258 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
259 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
260 * error.c (dump_decl): Likewise.
261
262 2017-01-09 Jakub Jelinek <jakub@redhat.com>
263
264 PR translation/79019
265 PR translation/79020
266 * semantics.c (finish_omp_clauses): Add missing whitespace to
267 translatable strings.
268 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
269
270 2017-01-07 Jason Merrill <jason@redhat.com>
271
272 PR c++/78948 - instantiation from discarded statement
273 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
274 * cp-tree.h (in_discarded_stmt): Declare it.
275 (struct saved_scope): Add discarded_stmt bitfield.
276 (in_discarded_stmt): New macro.
277 * decl2.c (mark_used): Check it.
278 * parser.c (cp_parser_selection_statement): Adjust.
279 (cp_parser_jump_statement): Adjust.
280
281 2017-01-05 Jakub Jelinek <jakub@redhat.com>
282
283 PR c++/78931
284 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
285 REFERENCE_REF_P, set tt to its operand.
286
287 PR c++/78890
288 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
289 unions even for C++11 and later.
290
291 2017-01-05 Nathan Sidwell <nathan@acm.org>
292
293 PR c++/78765
294 * pt.c (convert_nontype_argument): Don't try and see if integral
295 or enum expressions are constants prematurely.
296
297 2017-01-04 Marek Polacek <polacek@redhat.com>
298
299 PR c++/64767
300 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
301 a zero character literal.
302
303 2017-01-04 Jakub Jelinek <jakub@redhat.com>
304
305 PR c++/78949
306 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
307 vector type.
308
309 PR c++/78693
310 * parser.c (cp_parser_simple_declaration): Only complain about
311 inconsistent auto deduction if auto_result doesn't use auto.
312
313 * parser.c (cp_parser_simple_declaration): Diagnose function
314 declaration among more than one init-declarators with auto
315 specifier.
316
317 PR c++/71182
318 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
319 assertion, as lexer->buffer may be NULL.
320
321 2017-01-04 Marek Polacek <polacek@redhat.com>
322
323 PR c++/77545
324 PR c++/77284
325 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
326
327 2017-01-04 Nathan Sidwell <nathan@acm.org>
328
329 PR c++/66735
330 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
331 (lambda_capture_field_type): Update prototype.
332 * lambda.c (lambda_capture_field_type): Add is_reference parm.
333 Add referenceness here.
334 (add_capture): Adjust lambda_capture_field_type call, refactor
335 error checking.
336 * pt.c (tsubst): Adjust lambda_capture_field_type call.
337
338 2017-01-01 Jakub Jelinek <jakub@redhat.com>
339
340 Update copyright years.
341 \f
342 Copyright (C) 2017 Free Software Foundation, Inc.
343
344 Copying and distribution of this file, with or without modification,
345 are permitted in any medium without royalty provided the copyright
346 notice and this notice are preserved.