re PR c++/60252 ([c++11] ICE with invalid variable-length array in lambda parameter)
[gcc.git] / gcc / cp / ChangeLog
1 2014-02-21 Jason Merrill <jason@redhat.com>
2
3 PR c++/60252
4 * lambda.c (maybe_resolve_dummy): Check lambda_function rather
5 than current_binding_level.
6
7 PR c++/60186
8 * typeck2.c (massage_init_elt): Call fold_non_dependent_expr_sfinae.
9
10 PR c++/60187
11 * parser.c (cp_parser_enum_specifier): Call
12 check_for_bare_parameter_packs.
13
14 PR c++/59347
15 * pt.c (tsubst_decl) [TYPE_DECL]: Don't try to instantiate an
16 erroneous typedef.
17
18 PR c++/60241
19 * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
20 of the partial instantiation, not the most general template.
21 (maybe_process_partial_specialization): Reassign everything on
22 that list.
23
24 PR c++/60216
25 * pt.c (register_specialization): Copy DECL_DELETED_FN to clones.
26 (check_explicit_specialization): Don't clone.
27
28 PR c++/60219
29 * pt.c (coerce_template_parms): Bail if argument packing fails.
30
31 PR c++/60224
32 * decl.c (cp_complete_array_type, maybe_deduce_size_from_array_init):
33 Don't get confused by a CONSTRUCTOR that already has a type.
34
35 PR c++/60227
36 * call.c (build_array_conv): Don't crash on VLA.
37
38 PR c++/60248
39 * mangle.c (mangle_decl): Don't make an alias for a TYPE_DECL.
40
41 PR c++/60252
42 * lambda.c (maybe_resolve_dummy): Don't try to capture this
43 in declaration context.
44
45 DR 1591
46 PR c++/60051
47 * pt.c (unify): Only unify if deducible. Handle 0-length list.
48
49 PR c++/60250
50 * parser.c (cp_parser_direct_declarator): Don't wrap a
51 type-dependent expression in a NOP_EXPR.
52
53 PR c++/60251
54 * lambda.c (is_normal_capture_proxy): Handle VLA capture.
55
56 PR c++/60167
57 PR c++/60222
58 PR c++/58606
59 * parser.c (cp_parser_template_argument): Restore dereference.
60 * pt.c (template_parm_to_arg): Dereference non-pack expansions too.
61 (process_partial_specialization): Handle deref.
62 (unify): Likewise.
63
64 2014-02-21 Adam Butcher <adam@jessamine.co.uk>
65
66 PR c++/60052
67 PR c++/60053
68 * parser.c (cp_parser_parameter_declaration_list): Correctly reset
69 implicit_template_scope upon leaving an out-of-line generic member
70 function definition.
71
72 2014-02-20 Kai Tietz <ktietz@redhat.com>
73
74 PR c++/58873
75 * parser.c (cp_parser_functional_cast): Treat NULL_TREE
76 valued type argument as error_mark_node.
77
78 PR c++/58835
79 * semantics.c (finish_fname): Handle error_mark_node.
80
81 2014-02-19 Jason Merrill <jason@redhat.com>
82
83 PR c++/60046
84 * pt.c (maybe_instantiate_noexcept): Don't instantiate exception
85 spec from template context.
86
87 2014-02-19 Jakub Jelinek <jakub@redhat.com>
88
89 PR debug/56563
90 * cp-objcp-common.c (cp_function_decl_explicit_p): Remove
91 FUNCTION_FIRST_USER_PARMTYPE (decl) != void_list_node check.
92
93 PR c++/60267
94 * pt.c (tsubst_expr): Handle ANNOTATE_EXPR.
95
96 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
97
98 PR c++/60225
99 * semantics.c (ensure_literal_type_for_constexpr_object): Use
100 strip_array_types.
101
102 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
103
104 PR c++/60215
105 * semantics.c (cxx_eval_constant_expression, [COMPONENT_REF]):
106 During error recovery allow_non_constant may be false.
107
108 2014-02-18 Adam Butcher <adam@jessamine.co.uk>
109
110 PR c++/60190
111 * parser.c (cp_parser_lambda_declarator_opt): Pop template parameter
112 scope whenever a template parameter list has been started, independent
113 of whether the function call operator was well-formed or not.
114
115 PR c++/60064
116 * parser.c (cp_parser_member_declaration): Pop fully implicit template
117 scope for generic friend declarations as well as for non-friends.
118
119 2014-02-12 Paolo Carlini <paolo.carlini@oracle.com>
120
121 PR c++/60047
122 * method.c (implicitly_declare_fn): A constructor of a class with
123 virtual base classes isn't constexpr (7.1.5p4).
124
125 2014-02-05 Jan Hubicka <hubicka@ucw.cz
126
127 * parser.c (synthesize_implicit_template_parm): Use grow_tree_vec.
128
129 2014-02-05 Jakub Jelinek <jakub@redhat.com>
130
131 PR c++/58703
132 * parser.c (cp_parser_omp_declare_reduction): Save and free
133 declarator_obstack.
134
135 2014-02-03 Marc Glisse <marc.glisse@inria.fr>
136
137 PR c++/53017
138 PR c++/59211
139 * tree.c (handle_init_priority_attribute): Call default_conversion on
140 the attribute argument.
141
142 2014-02-03 Paolo Carlini <paolo.carlini@oracle.com>
143
144 PR c++/58871
145 * method.c (synthesized_method_walk): If vbases is non-null but
146 is_empty is true, likewise don't worry about the virtual bases.
147
148 2014-02-01 Paolo Carlini <paolo.carlini@oracle.com>
149
150 PR c++/51219
151 * typeck2.c (process_init_constructor_record): Just skip unnamed
152 bit-fields.
153
154 2014-01-31 Jason Merrill <jason@redhat.com>
155
156 PR c++/59469
157 * pt.c (mark_decl_instantiated): Call mark_needed.
158
159 PR c++/58672
160 * decl2.c (handle_tls_init): Handle null init fn.
161
162 PR c++/55800
163 * decl2.c (get_tls_init_fn): Copy DECL_EXTERNAL from the variable.
164
165 2014-01-31 Paolo Carlini <paolo.carlini@oracle.com>
166
167 PR c++/59082
168 * class.c (build_vfield_ref): Early return error_mark_node if
169 TYPE_VFIELD (type) is null.
170 (build_base_path): Check return value of build_vfield_ref.
171
172 2014-01-31 Jason Merrill <jason@redhat.com>
173
174 PR c++/59646
175 * call.c (convert_like_real) [ck_aggr]: Set TARGET_EXPR_LIST_INIT_P.
176 [ck_list]: Check for error_mark_node.
177 (build_aggr_conv): Set LOOKUP_NO_NARROWING and check_narrowing.
178
179 PR c++/57043
180 * pt.c (fn_type_unification): Don't do DEDUCE_EXACT check
181 during partial ordering.
182
183 2014-01-31 Marek Polacek <polacek@redhat.com>
184
185 PR c/59963
186 * typeck.c (build_function_call_vec): Add dummy arg_loc parameter.
187
188 2014-01-30 Jason Merrill <jason@redhat.com>
189
190 PR c++/57899
191 * cp-tree.h (struct saved_scope): Add x_local_specializations.
192 (local_specializations): New macro.
193 * pt.c (local_specializations): Remove variable.
194
195 2014-01-30 Richard Sandiford <rdsandiford@googlemail.com>
196
197 PR c++/58708
198 * parser.c (make_string_pack): Use double_int::from_buffer.
199
200 2014-01-30 Marek Polacek <polacek@redhat.com>
201
202 PR c/59940
203 * typeck.c (build_ptrmemfunc1): Call convert_and_check with
204 input_location.
205 * cvt.c (cp_convert_and_check): Call warnings_for_convert_and_check
206 with input_location.
207 * call.c (build_conditional_expr_1): Call unsafe_conversion_p with
208 loc parameter.
209
210 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
211
212 PR c++/58843
213 * typeck.c (lookup_destructor): Check dtor_type for error_mark_node.
214
215 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
216
217 PR c++/58649
218 * pt.c (lookup_template_class_1): Check start_enum return value
219 for error_mark_node.
220
221 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
222
223 * decl.c (duplicate_decls, typename_hash, typename_compare):
224 Use TYPE_IDENTIFIER.
225 * error.c (dump_type): Likewise.
226 * mangle.c (dump_substitution_candidates): Likewise.
227
228 2014-01-30 Jason Merrill <jason@redhat.com>
229
230 PR c++/59633
231 * decl2.c (attributes_naming_typedef_ok): New.
232 * cp-tree.h: Declare it.
233 * decl.c (grokdeclarator): Check it.
234 * tree.c (no_linkage_check): Handle VECTOR_TYPE.
235
236 2014-01-29 Jason Merrill <jason@redhat.com>
237
238 PR c++/59707
239 * call.c (add_builtin_candidate): Catch dependent types.
240
241 PR c++/59989
242 * pt.c (expand_template_argument_pack): Correct
243 non_default_args_count calculation.
244
245 PR c++/58466
246 * pt.c (unify_pack_expansion): Call expand_template_argument_pack.
247
248 PR c++/59956
249 * friend.c (do_friend): Pass the TEMPLATE_DECL to add_friend if we
250 have a friend template in a class template.
251 * pt.c (tsubst_friend_function): Look through it.
252 (push_template_decl_real): A friend member template is
253 primary.
254
255 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
256
257 PR c++/58846
258 * decl.c (get_dso_handle_node): Don't crash if dso_handle_node
259 == error_mark_node.
260
261 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
262
263 PR c++/58674
264 * pt.c (instantiate_template_1): Check for error_mark_node the second
265 argument too.
266
267 2014-01-29 Jason Merrill <jason@redhat.com>
268
269 PR c++/59916
270 * optimize.c (maybe_thunk_body): Build a RETURN_EXPR for
271 cdtor_returns_this case.
272
273 PR c++/59315
274 * decl.c (cxx_maybe_build_cleanup): Call mark_used.
275
276 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
277
278 PR c++/58702
279 * semantics.c (finish_omp_reduction_clause): Check type for
280 error_mark_node.
281
282 2014-01-28 Jason Merrill <jason@redhat.com>
283
284 PR c++/59791
285 * pt.c (tsubst_decl) [VAR_DECL]: Allow in unevaluated context.
286 (tsubst_copy): Use it if lookup fails.
287
288 PR c++/59818
289 * pt.c (tsubst_function_type): Make sure we keep the same function
290 quals.
291
292 PR c++/58701
293 * semantics.c (build_anon_member_initialization): Stop walking
294 when we run out of COMPONENT_REFs.
295
296 PR c++/58632
297 * decl.c (lookup_and_check_tag): Ignore template parameters if
298 scope == ts_current.
299 * pt.c (check_template_shadow): Don't complain about the injected
300 class name.
301
302 * decl.c (duplicate_decls): Tweak.
303
304 PR c++/53756
305 * mangle.c (write_unqualified_name): Handle operator auto.
306
307 2014-01-27 Jason Merrill <jason@redhat.com>
308
309 PR c++/59823
310 Core DR 1138
311 * call.c (reference_binding): Pass LOOKUP_NO_TEMP_BIND for
312 list-initialization. A conversion to rvalue ref that involves
313 an lvalue-rvalue conversion is bad.
314 (convert_like_real): Give helpful error message.
315
316 PR c++/54652
317 * decl.c (duplicate_decls): Always use oldtype for TYPE_DECL.
318
319 PR c++/58504
320 * pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Use tsubst for
321 types.
322
323 PR c++/58606
324 * pt.c (template_parm_to_arg): Call convert_from_reference.
325 (tsubst_template_arg): Don't strip reference refs.
326
327 PR c++/58639
328 * call.c (build_aggr_conv): Reject value-initialization of reference.
329
330 PR c++/58812
331 PR c++/58651
332 * call.c (convert_like_real): Give helpful error about excess braces
333 for ck_rvalue of scalar type.
334
335 Core DR 1288
336 * call.c (reference_binding): Only elide braces if the single
337 element is reference-related.
338
339 PR c++/58814
340 * typeck.c (cp_build_modify_expr): Make the RHS an rvalue before
341 stabilizing.
342
343 PR c++/58837
344 * typeck.c (cp_truthvalue_conversion): Use explicit comparison for
345 FUNCTION_DECL.
346
347 PR c++/59097
348 * decl.c (compute_array_index_type): Don't call
349 maybe_constant_value for a non-integral expression.
350
351 2014-01-24 Balaji V. Iyer <balaji.v.iyer@intel.com>
352
353 * call.c (magic_varargs_p): Replaced flag_enable_cilkplus with
354 flag_cilkplus.
355 * cp-gimplify.c (cp_genericize): Likewise.
356 * decl.c (grokfndecl): Likewise.
357 * parser.c (cp_parser_postfix_expression): Likewise.
358 (cp_parser_postfix_open_square_expression): Likewise.
359 (cp_parser_direct_declarator): Likewise.
360 (is_cilkplus_vector_p): Likewise.
361 (cp_parser_omp_clause_name): Likewise.
362 (cp_parser_omp_all_clauses): Likewise.
363 * pt.c (apply_late_template_attributes): Likewise.
364 * typeck.c (cp_build_array_ref): Likewise.
365 (cp_build_compound_expr): Likewise.
366 (check_return_expr): Likewise.
367
368 2014-01-24 Jason Merrill <jason@redhat.com>
369
370 PR c++/58550
371 * decl.c (grokdeclarator): Turn pedwarn about auto return type in
372 c++11 into error.
373
374 PR c++/59886
375 PR c++/59659
376 * typeck2.c (process_init_constructor_array): Don't create
377 RANGE_EXPR yet.
378
379 2014-01-24 Jakub Jelinek <jakub@redhat.com>
380
381 * typeck2.c (split_nonconstant_init_1): Fix num_split_elts
382 handling for RANGE_ARRAY case.
383
384 2014-01-24 Paolo Carlini <paolo.carlini@oracle.com>
385
386 PR c++/57524
387 * name-lookup.c (push_using_directive): Use timevar_cond_start.
388
389 2014-01-23 Marek Polacek <polacek@redhat.com>
390
391 PR c/59846
392 * typeck.c (cp_build_binary_op): Pass location to shorten_compare.
393
394 2014-01-23 Marek Polacek <polacek@redhat.com>
395
396 PR c/58346
397 * typeck.c (pointer_diff): Give an error on arithmetic on pointer to
398 an empty aggregate.
399
400 2014-01-23 Jason Merrill <jason@redhat.com>
401
402 PR c++/55189
403 * cp-tree.h (struct language_function): Add infinite_loop and
404 infinite_loops.
405 (current_function_infinite_loop): New.
406 * semantics.c (begin_maybe_infinite_loop, end_maybe_infinite_loop)
407 (break_maybe_infinite_loop): New.
408 (finish_while_stmt_cond, finish_while_stmt, begin_do_stmt)
409 (finish_do_stmt, finish_for_cond, finish_for_stmt)
410 (begin_range_for_stmt): Use them.
411 * decl.c (finish_function): Don't warn about missing return
412 if current_function_infinite_loop.
413 * pt.c (instantiate_decl): Copy current_function_infinite_loop.
414 * parser.c (cp_parser_jump_statement): Call break_maybe_infinite_loop.
415
416 * call.c (build_op_delete_call): Use make_tree_vector and
417 release_tree_vector.
418
419 2014-01-23 Paolo Carlini <paolo.carlini@oracle.com>
420
421 PR c++/58980
422 * parser.c (cp_parser_enum_specifier): Handle TYPENAME_TYPE as
423 nested_name_specifier.
424
425 2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
426
427 * parser.c (cp_parser_direct_declarator): When Cilk Plus is enabled
428 see if there is an attribute after function decl. If so, then
429 parse them now.
430 (cp_parser_late_return_type_opt): Handle parsing of Cilk Plus SIMD
431 enabled function late parsing.
432 (cp_parser_gnu_attribute_list): Parse all the tokens for the vector
433 attribute for a SIMD-enabled function.
434 (cp_parser_omp_all_clauses): Skip parsing to the end of pragma when
435 the function is used by SIMD-enabled function (indicated by NULL
436 pragma token). Added 3 new clauses: PRAGMA_CILK_CLAUSE_MASK,
437 PRAGMA_CILK_CLAUSE_NOMASK and PRAGMA_CILK_CLAUSE_VECTORLENGTH
438 (cp_parser_cilk_simd_vectorlength): Modified this function to handle
439 vectorlength clause in SIMD-enabled function and #pragma SIMD's
440 vectorlength clause. Added a new bool parameter to differentiate
441 between the two.
442 (cp_parser_cilk_simd_fn_vector_attrs): New function.
443 (is_cilkplus_vector_p): Likewise.
444 (cp_parser_late_parsing_elem_fn_info): Likewise.
445 (cp_parser_omp_clause_name): Added a check for "mask", "nomask"
446 and "vectorlength" clauses when Cilk Plus is enabled.
447 (cp_parser_omp_clause_linear): Added a new parameter of type bool
448 and emit a sorry message when step size is a parameter.
449 * parser.h (cp_parser::cilk_simd_fn_info): New field.
450 * decl.c (grokfndecl): Added flag_enable_cilkplus along with
451 flag_openmp.
452 * pt.c (apply_late_template_attributes): Likewise.
453
454 2014-01-23 Jakub Jelinek <jakub@redhat.com>
455
456 PR middle-end/58809
457 * semantics.c (finish_omp_reduction_clause): Reject
458 BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR on COMPLEX_TYPEs.
459
460 2014-01-22 Ville Voutilainen <ville.voutilainen@gmail.com>
461
462 PR c++/59482
463 * parser.c (cp_parser_class_head): Push the class before parsing
464 the base-clause, pop after it.
465
466 2014-01-20 Eric Botcazou <ebotcazou@adacore.com>
467
468 * decl2.c (cpp_check): Revert prototype change.
469
470 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
471
472 PR c++/59270
473 PR c++/58811
474 * init.c (build_value_init_noctor): Don't pass error_mark_node to
475 build_value_init.
476
477 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
478
479 PR c++/59269
480 * init.c (build_value_init_noctor): Assert !TYPE_HAS_COMPLEX_DFLT
481 only when errorcount == 0.
482
483 2014-01-17 Marek Polacek <polacek@redhat.com>
484
485 PR c++/59838
486 * cvt.c (ocp_convert): Don't segfault on non-existing
487 ENUM_UNDERLYING_TYPE.
488
489 2014-01-16 Jason Merrill <jason@redhat.com>
490
491 PR c++/59821
492 * tree.c (bot_manip): Update the location of builtin_LINE and
493 builtin_FILE calls.
494
495 2014-01-14 Jason Merrill <jason@redhat.com>
496
497 PR c++/59659
498 * typeck2.c (massage_init_elt): New.
499 (process_init_constructor_record)
500 (process_init_constructor_union): Use it.
501 (process_init_constructor_array): Use it. Use RANGE_EXPR.
502 (split_nonconstant_init_1): Handle it.
503 * semantics.c (cxx_eval_vec_init_1): Use force_rvalue.
504
505 2014-01-09 Balaji V. Iyer <balaji.v.iyer@intel.com>
506
507 PR c++/59631
508 * parser.c (cp_parser_postfix_expression): Added a new if-statement
509 and replaced an existing if-statement with else-if statement.
510 Changed an existing error message wording to match the one from the C
511 parser.
512
513 2014-01-08 Jason Merrill <jason@redhat.com>
514
515 PR c++/59614
516 * class.c (abi_tag_data): Add tags field.
517 (check_abi_tags): Initialize it.
518 (find_abi_tags_r): Support collecting missing tags.
519 (mark_type_abi_tags): Don't look at template args.
520 (inherit_targ_abi_tags): New.
521 (check_bases_and_members): Use it.
522 * cp-tree.h (ABI_TAG_IMPLICIT): New.
523 * mangle.c (write_abi_tags): Check it.
524
525 2014-01-07 Jason Merrill <jason@redhat.com>
526
527 PR c++/58856
528 * pt.c (num_innermost_template_parms): New.
529 (get_underlying_template): Use it.
530
531 PR c++/58965
532 * mangle.c (write_guarded_var_name): Handle null DECL_NAME.
533
534 2014-01-07 Paolo Carlini <paolo.carlini@oracle.com>
535
536 * semantics.c (trait_expr_value, [CPTK_IS_BASE_OF]): Implement
537 the letter of 20.11.6 about Base and Derived naming the same
538 class type modulo cv-qualifiers.
539
540 2014-01-06 Adam Butcher <adam@jessamine.co.uk>
541
542 PR c++/59635
543 * lambda.c (maybe_add_lambda_conv_op): Handle marking conversion
544 function as unimplemented for generic lambdas with varargs.
545
546 PR c++/59636
547 * parser.c (cp_parser_template_parameter): Early out with
548 error_mark_node if parameter declaration was not parsed.
549
550 PR c++/59629
551 * parser.c (cp_parser_lambda_expression): Save/reset/restore
552 auto_is_implicit_function_template_parm_p around lambda body.
553
554 PR c++/59638
555 * parser.c (cp_parser_init_declarator): Undo fully implicit
556 template parameter list when declarator is not a function.
557
558 2014-01-03 Marc Glisse <marc.glisse@inria.fr>
559
560 PR c++/58950
561 * cvt.c (convert_to_void): Handle VEC_PERM_EXPR and VEC_COND_EXPR.
562
563 2014-01-03 Tobias Burnus <burnus@net-b.de>
564
565 PR c++/58567
566 * pt.c (tsubst_omp_for_iterator): Early return for error_mark_node.
567
568 2014-01-03 Paolo Carlini <paolo.carlini@oracle.com>
569
570 Core DR 1442
571 PR c++/59165
572 * parser.c (cp_parser_perform_range_for_lookup): Don't pass true
573 as include_std to perform_koenig_lookup.
574 (cp_parser_postfix_expression): Adjust.
575 * pt.c (tsubst_copy_and_build): Likewise.
576 * semantics.c (perform_koenig_lookup): Remove bool parameter.
577 (omp_reduction_lookup): Adjust.
578 * name-lookup.c (lookup_arg_dependent_1): Remove bool parameter.
579 (lookup_arg_dependent): Likewise.
580 (lookup_function_nonclass): Adjust.
581 * name-lookup.h: Adjust declaration.
582 * cp-tree.h: Likewise.
583
584 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
585
586 PR c++/59087
587 * parser.c (cp_parser_userdef_numeric_literal): Mention
588 -fext-numeric-literals in the message.
589
590 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
591
592 PR c++/59641
593 * call.c (build_conditional_expr_1): Check the return value of
594 force_rvalue.
595
596 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
597
598 * call.c (convert_like_real): Check complain.
599
600 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
601
602 PR c++/59378
603 * typeck.c (build_x_vec_perm_expr): Handle non-dependent arguments
604 in templates.
605
606 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
607
608 Update copyright years
609
610 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
611
612 * cp-array-notation.c, cp-cilkplus.c, vtable-class-hierarchy.c: Use
613 the standard form for the copyright notice.
614 \f
615 Copyright (C) 2014 Free Software Foundation, Inc.
616
617 Copying and distribution of this file, with or without modification,
618 are permitted in any medium without royalty provided the copyright
619 notice and this notice are preserved.