re PR c++/44859 (missed warning: returning reference to temporary)
[gcc.git] / gcc / cp / ChangeLog
1 2014-03-31 Patrick Palka patrick@parcs.ath.cx
2
3 PR c++/44859
4 * typeck.c (maybe_warn_about_returning_address_of_local): Unwrap
5 COMPONENT_REFs and ARRAY_REFs sooner.
6
7 2014-03-29 Adam Butcher <adam@jessamine.co.uk>
8
9 PR c++/60626
10 * parser.c (cp_parser_init_declarator): Handle erroneous generic type
11 usage in non-functions with pushed scope.
12
13 2014-03-28 Adam Butcher <adam@jessamine.co.uk>
14
15 PR c++/60573
16 * name-lookup.h (cp_binding_level): New transient field defining_class_p
17 to indicate whether a scope is in the process of defining a class.
18 * semantics.c (begin_class_definition): Set defining_class_p.
19 * name-lookup.c (leave_scope): Reset defining_class_p.
20 * parser.c (synthesize_implicit_template_parm): Use cp_binding_level::
21 defining_class_p rather than TYPE_BEING_DEFINED as the predicate for
22 unwinding to class-defining scope to handle the erroneous definition of
23 a generic function of an arbitrarily nested class within an enclosing
24 class.
25
26 2014-03-26 Fabien ChĂȘne <fabien@gcc.gnu.org>
27
28 PR c++/52369
29 * cp/method.c (walk_field_subobs): improve the diagnostic
30 locations for both REFERENCE_TYPEs and non-static const members.
31 * cp/init.c (diagnose_uninitialized_cst_or_ref_member): use %q#D
32 instead of %qD to be consistent with the c++11 diagnostic.
33
34 2014-03-25 Jason Merrill <jason@redhat.com>
35
36 PR c++/60566
37 PR c++/58678
38 * class.c (build_vtbl_initializer): Handle abstract dtors here.
39 * search.c (get_pure_virtuals): Not here.
40
41 PR c++/60375
42 * parser.c (cp_parser_lambda_expression): Don't parse the body of
43 a lambda in unevaluated context.
44
45 PR c++/60628
46 * decl.c (create_array_type_for_decl): Complain about array of auto.
47
48 2014-03-25 Jakub Jelinek <jakub@redhat.com>
49
50 PR c++/60331
51 * semantics.c (potential_constant_expression_1): Handle
52 DECL_EXPR.
53
54 2014-03-24 Adam Butcher <adam@jessamine.co.uk>
55
56 PR c++/60627
57 * parser.c (cp_parser_parameter_declaration_clause): Prevent 'auto' from
58 introducing an implicit function template parameter within an explicit
59 instantiation.
60
61 2014-03-22 Jason Merrill <jason@redhat.com>
62
63 PR c++/60574
64 * decl.c (grokdeclarator): Change permerror about 'virtual auto'
65 to error.
66
67 2014-03-21 Paolo Carlini <paolo.carlini@oracle.com>
68
69 PR c++/60384
70 * name-lookup.c (push_class_level_binding_1): Check identifier_p
71 on the name argument.
72
73 2014-03-20 Jakub Jelinek <jakub@redhat.com>
74
75 PR c++/60572
76 * init.c (build_zero_init_1): Ignore fields with error_mark_node
77 type.
78
79 2014-03-19 Paolo Carlini <paolo.carlini@oracle.com>
80
81 PR c++/51474
82 * call.c (build_new_method_call_1): Handle pure virtuals called by
83 NSDMIs too.
84
85 2014-03-17 Adam Butcher <adam@jessamine.co.uk>
86
87 PR c++/60390
88 * parser.c (cp_parser_member_declaration): Don't allow
89 finish_fully_implicit_template to consider friend declarations to be
90 class member templates.
91 (synthesize_implicit_template_parm): Handling winding back through class
92 scope to the class being defined in order to inject a template argument
93 list.
94
95 PR c++/60391
96 * parser.c (cp_parser_skip_to_end_of_block_or_statement): Unwind generic
97 function scope as per cp_parser_skip_to_end_of_statement.
98
99 2014-03-17 Paolo Carlini <paolo.carlini@oracle.com>
100
101 PR c++/59571
102 * typeck2.c (check_narrowing): Use fold_non_dependent_expr_sfinae.
103
104 2014-03-14 Jason Merrill <jason@redhat.com>
105
106 PR c++/60532
107 PR c++/58678
108 * search.c (get_pure_virtuals): Handle abstract dtor here.
109 (dfs_get_pure_virtuals): Not here.
110
111 PR c++/58678
112 * search.c (dfs_get_pure_virtuals): Treat the destructor of an
113 abstract class as pure.
114
115 2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
116
117 PR c++/60383
118 * pt.c (maybe_process_partial_specialization): Check return value
119 of check_specialization_namespace.
120
121 2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
122
123 PR c++/60254
124 * semantics.c (finish_static_assert): Call cxx_constant_value only
125 if require_potential_rvalue_constant_expression returns true.
126
127 2014-03-11 Paolo Carlini <paolo.carlini@oracle.com>
128
129 PR c++/60389
130 * method.c (get_inherited_ctor): New.
131 * cp-tree.h (get_inherited_ctor): Declare it.
132 * semantics.c (is_valid_constexpr_fn): Use it.
133
134 2014-03-10 Jason Merrill <jason@redhat.com>
135
136 PR c++/60367
137 * call.c (convert_default_arg): Remove special handling for
138 CONSTRUCTOR.
139
140 PR c++/53492
141 * parser.c (cp_parser_class_head): Also check PRIMARY_TEMPLATE_P
142 when deciding whether to call push_template_decl for a member class.
143 * pt.c (push_template_decl_real): Return after wrong levels error.
144
145 2014-03-08 Adam Butcher <adam@jessamine.co.uk>
146
147 PR c++/60033
148 * pt.c (tsubst_copy): When retrieving a capture pack from a generic
149 lambda, remove the lambda's own template argument list prior to fetching
150 the specialization.
151
152 PR c++/60393
153 * parser.c (cp_parser_parameter_declaration_clause): Move generic
154 function template unwinding on error into a more general location, ...
155 (cp_parser_skip_to_end_of_statement): ... here.
156
157 2014-03-07 Jason Merrill <jason@redhat.com>
158
159 * Make-lang.in (check_g++_parallelize): Split dg.exp.
160
161 * parser.c (cp_parser_type_id_1): Only allow 'auto' in C++1y if
162 we're in a trailing return type.
163
164 * typeck.c (comp_template_parms_position): 'auto' and
165 'decltype(auto)' are different from real template parms.
166
167 * parser.c (cp_parser_using_declaration): Consume the semicolon
168 after bare parameter pack error.
169
170 * cp-tree.h (REF_PARENTHESIZED_P): New.
171 * semantics.c (force_paren_expr): Set it.
172 * pt.c (do_auto_deduction): Check it.
173 (tsubst) [COMPONENT_REF]: Copy it.
174 * typeck.c (maybe_warn_about_useless_cast): Don't strip dereference.
175
176 * decl.c (create_array_type_for_decl): Only warn about invalid
177 C++1y VLA if flag_iso or warn_vla>0.
178 (grokdeclarator): Likewise.
179 * pt.c (tsubst): Likewise.
180 * semantics.c (finish_decltype_type): Likewise.
181 * typeck.c (cxx_sizeof_or_alignof_type): Likewise.
182 (cp_build_addr_expr_1): Likewise.
183 * init.c (build_new_1): Improve diagnostics.
184
185 2014-03-07 Paolo Carlini <paolo.carlini@oracle.com>
186
187 PR c++/58609
188 * decl.c (check_initializer): Return NULL_TREE after error;
189 consistently use inform.
190
191 2014-03-07 Paolo Carlini <paolo.carlini@oracle.com>
192
193 * decl.c (check_initializer): Remove dead code.
194
195 2014-03-06 Marek Polacek <polacek@redhat.com>
196
197 PR c/60197
198 * typeck.c (check_return_expr): Call contains_cilk_spawn_stmt instead
199 of checking tree code.
200
201 2014-03-06 Paolo Carlini <paolo.carlini@oracle.com>
202
203 * parser.c (cp_lexer_set_source_position): New.
204 (cp_parser_mem_initializer): Use it.
205 (cp_parser_postfix_open_square_expression): Likewise.
206 (cp_parser_parenthesized_expression_list): Likewise.
207 (cp_parser_new_initializer): Likewise.
208 (cp_parser_jump_statement): Likewise.
209 (cp_parser_initializer): Likewise.
210 (cp_parser_functional_cast): Likewise.
211
212 2014-03-05 Jason Merrill <jason@redhat.com>
213
214 PR c++/60409
215 * semantics.c (force_paren_expr): Only add a PAREN_EXPR to a
216 dependent expression.
217
218 PR c++/60361
219 * parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID
220 if re-parsing might succeed.
221 * semantics.c (finish_id_expression): Use of a parameter outside
222 the function body is a parse error.
223
224 * parser.c (cp_parser_mem_initializer): Set input_location
225 properly for init-list warning.
226 (cp_parser_postfix_open_square_expression): Likewise.
227 (cp_parser_parenthesized_expression_list): Likewise.
228 (cp_parser_new_initializer): Likewise.
229 (cp_parser_jump_statement): Likewise.
230 (cp_parser_initializer): Likewise.
231 (cp_parser_functional_cast): Likewise.
232
233 2014-03-04 Jason Merrill <jason@redhat.com>
234
235 PR c++/60417
236 * typeck2.c (process_init_constructor_record): Set
237 CONSTRUCTOR_IS_DIRECT_INIT on {} for omitted initializers.
238
239 PR c++/60415
240 PR c++/54359
241 * parser.c (cp_parser_direct_declarator): Set declarator to
242 cp_error_declarator on invalid qualified-id.
243
244 2014-03-04 Paolo Carlini <paolo.carlini@oracle.com>
245
246 PR c++/60376
247 * parser.c (cp_parser_using_declaration): Early return when
248 cp_parser_nested_name_specifier errors out.
249
250 2014-03-01 Adam Butcher <adam@jessamine.co.uk>
251
252 PR c++/60377
253 * parser.c (cp_parser_parameter_declaration_clause): Unwind generic
254 function scope on parse error in function parameter list.
255
256 2014-03-01 Paolo Carlini <paolo.carlini@oracle.com>
257
258 * method.c (implicitly_declare_fn): Remove redundant
259 DECL_TEMPLATE_RESULT and STRIP_TEMPLATE uses.
260 * semantics.c (is_instantiation_of_constexpr): Likewise.
261 * error.c (dump_function_decl): Likewise.
262
263 2014-03-01 Jason Merrill <jason@redhat.com>
264
265 PR c++/60379
266 * semantics.c (begin_maybe_infinite_loop): Use
267 fold_non_dependent_expr_sfinae.
268
269 2014-02-28 Jason Merrill <jason@redhat.com>
270
271 PR c++/58845
272 * typeck.c (cp_build_binary_op): Sorry on vector&&vector.
273
274 2014-02-28 Paolo Carlini <paolo.carlini@oracle.com>
275
276 PR c++/58610
277 * cp-tree.h (DECL_DELETED_FN): Use LANG_DECL_FN_CHECK.
278 * call.c (print_z_candidate): Remove STRIP_TEMPLATE use.
279 * lambda.c (maybe_add_lambda_conv_op): Likewise.
280
281 2014-02-27 Paolo Carlini <paolo.carlini@oracle.com>
282
283 PR c++/60253
284 * call.c (convert_arg_to_ellipsis): Return error_mark_node after
285 error_at.
286
287 2014-02-27 Jason Merrill <jason@redhat.com>
288
289 PR c++/60353
290 PR c++/55877
291 * decl2.c (tentative_decl_linkage): Don't mess with functions that
292 are not yet defined.
293
294 2014-02-26 Jason Merrill <jason@redhat.com>
295
296 PR c++/60347
297 PR lto/53808
298 * class.c (clone_function_decl): Don't note_vague_linkage_fn.
299 * init.c (build_vtbl_address): Do it here.
300
301 PR c++/59231
302 PR c++/11586
303 PR c++/14710
304 PR c++/57132
305 * pt.c (struct warning_sentinel): New.
306 (tsubst_copy_and_build): Use it instead of
307 c_inhibit_evaluation_warnings.
308 * typeck.c (maybe_warn_about_useless_cast): Remove
309 c_inhibit_evaluation_warnings check.
310
311 PR c++/54440
312 * pt.c (get_template_parm_index): New.
313 (fixed_parameter_pack_p_1, fixed_parameter_pack_p): New.
314 (process_template_parm): Allow bare packs in template template
315 parm template parms.
316 (coerce_template_parameter_pack): Handle fixed template template
317 parm packs and fixed packs not at the end of the parm list.
318 (coerce_template_parms): Handle template parm packs not at the end
319 of the parm list.
320 (gen_elem_of_pack_expansion_instantiation): Handle a decl expansion.
321
322 PR c++/60182
323 * pt.c (unify): Ignore alias templates when deducing a template
324 template parameter.
325
326 PR c++/60345
327 Revert:
328 DR 1571
329 * call.c (reference_binding): Recurse on user-defined conversion.
330 (convert_like_real) [ck_ref_bind]: Explain cv-qual mismatch.
331
332 2014-02-25 Jason Merrill <jason@redhat.com>
333
334 DR 1571
335 * call.c (reference_binding): Recurse on user-defined conversion.
336 (convert_like_real) [ck_ref_bind]: Explain cv-qual mismatch.
337
338 * call.c (print_conversion_rejection): Handle n_arg of -2.
339 (build_user_type_conversion_1): Pass it.
340
341 PR c++/55877
342 * decl2.c (no_linkage_error): Handle C++98 semantics.
343 (reset_type_linkage): Move from decl.c.
344 (reset_type_linkage_1, reset_type_linkage_2, bt_reset_linkage_1)
345 (bt_reset_linkage_2, reset_decl_linkage): New.
346 (tentative_decl_linkage): Factor out of expand_or_defer_fn_1.
347 (cp_write_global_declarations): Move condition into no_linkage_error.
348 * decl.c (grokfndecl, grokvardecl): Use no_linkage_error.
349 * semantics.c (expand_or_defer_fn_1): Factor out
350 tentative_decl_linkage.
351 * cp-tree.h: Adjust.
352
353 * decl2.c (finish_static_data_member_decl): Diagnose static data
354 member in unnamed class.
355 * class.c (finish_struct_anon_r): Avoid redundant diagnostic.
356
357 PR lto/53808
358 * class.c (clone_function_decl): Call note_vague_linkage_fn for
359 defaulted virtual dtor.
360
361 DR 1286
362 PR c++/60328
363 * pt.c (get_underlying_template): Fix equivalence calculation.
364
365 2014-02-25 Adam Butcher <adam@jessamine.co.uk>
366
367 PR c++/60311
368 * parser.c (function_being_declared_is_template_p): Return false when
369 processing a template parameter list.
370 (cp_parser_parameter_declaration_clause): Don't set
371 auto_is_implicit_function_template_parm_p when processing a
372 template parameter list.
373
374 * parser.c (synthesize_implicit_template_parm): Inject new template
375 argument list appropriately when a generic member function
376 of a class template is declared out-of-line.
377
378 PR c++/60065
379 * parser.c (cp_parser_direct_declarator): Don't save and
380 restore num_template_parameter_lists around call to
381 cp_parser_parameter_declaration_list.
382 (function_being_declared_is_template_p): New predicate.
383 (cp_parser_parameter_declaration_list): Use
384 function_being_declared_is_template_p as predicate for
385 inspecting current function template parameter list length
386 rather than num_template_parameter_lists.
387
388 2014-02-24 Jason Merrill <jason@redhat.com>
389
390 PR c++/60146
391 * pt.c (tsubst_omp_for_iterator): Don't let substitution of the
392 DECL_EXPR initialize a non-class iterator.
393
394 PR c++/60312
395 * parser.c (cp_parser_template_type_arg): Check for invalid 'auto'.
396
397 2014-02-21 Jason Merrill <jason@redhat.com>
398
399 PR c++/58170
400 * parser.c (cp_parser_type_name): Always check dependency.
401 (cp_parser_type_specifier_seq): Call
402 cp_parser_parse_and_diagnose_invalid_type_name.
403
404 PR c++/60108
405 * semantics.c (expand_or_defer_fn_1): Check DECL_DEFAULTED_FN.
406
407 PR c++/60185
408 * parser.c (cp_parser_default_argument): Clear
409 current_class_ptr/current_class_ref like tsubst_default_argument.
410
411 PR c++/60252
412 * lambda.c (maybe_resolve_dummy): Check lambda_function rather
413 than current_binding_level.
414
415 PR c++/60186
416 * typeck2.c (massage_init_elt): Call fold_non_dependent_expr_sfinae.
417
418 PR c++/60187
419 * parser.c (cp_parser_enum_specifier): Call
420 check_for_bare_parameter_packs.
421
422 PR c++/59347
423 * pt.c (tsubst_decl) [TYPE_DECL]: Don't try to instantiate an
424 erroneous typedef.
425
426 PR c++/60241
427 * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
428 of the partial instantiation, not the most general template.
429 (maybe_process_partial_specialization): Reassign everything on
430 that list.
431
432 PR c++/60216
433 * pt.c (register_specialization): Copy DECL_DELETED_FN to clones.
434 (check_explicit_specialization): Don't clone.
435
436 PR c++/60219
437 * pt.c (coerce_template_parms): Bail if argument packing fails.
438
439 PR c++/60224
440 * decl.c (cp_complete_array_type, maybe_deduce_size_from_array_init):
441 Don't get confused by a CONSTRUCTOR that already has a type.
442
443 PR c++/60227
444 * call.c (build_array_conv): Don't crash on VLA.
445
446 PR c++/60248
447 * mangle.c (mangle_decl): Don't make an alias for a TYPE_DECL.
448
449 PR c++/60252
450 * lambda.c (maybe_resolve_dummy): Don't try to capture this
451 in declaration context.
452
453 DR 1591
454 PR c++/60051
455 * pt.c (unify): Only unify if deducible. Handle 0-length list.
456
457 PR c++/60250
458 * parser.c (cp_parser_direct_declarator): Don't wrap a
459 type-dependent expression in a NOP_EXPR.
460
461 PR c++/60251
462 * lambda.c (is_normal_capture_proxy): Handle VLA capture.
463
464 PR c++/60167
465 PR c++/60222
466 PR c++/58606
467 * parser.c (cp_parser_template_argument): Restore dereference.
468 * pt.c (template_parm_to_arg): Dereference non-pack expansions too.
469 (process_partial_specialization): Handle deref.
470 (unify): Likewise.
471
472 2014-02-21 Adam Butcher <adam@jessamine.co.uk>
473
474 PR c++/60052
475 PR c++/60053
476 * parser.c (cp_parser_parameter_declaration_list): Correctly reset
477 implicit_template_scope upon leaving an out-of-line generic member
478 function definition.
479
480 2014-02-20 Kai Tietz <ktietz@redhat.com>
481
482 PR c++/58873
483 * parser.c (cp_parser_functional_cast): Treat NULL_TREE
484 valued type argument as error_mark_node.
485
486 PR c++/58835
487 * semantics.c (finish_fname): Handle error_mark_node.
488
489 2014-02-19 Jason Merrill <jason@redhat.com>
490
491 PR c++/60046
492 * pt.c (maybe_instantiate_noexcept): Don't instantiate exception
493 spec from template context.
494
495 2014-02-19 Jakub Jelinek <jakub@redhat.com>
496
497 PR debug/56563
498 * cp-objcp-common.c (cp_function_decl_explicit_p): Remove
499 FUNCTION_FIRST_USER_PARMTYPE (decl) != void_list_node check.
500
501 PR c++/60267
502 * pt.c (tsubst_expr): Handle ANNOTATE_EXPR.
503
504 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
505
506 PR c++/60225
507 * semantics.c (ensure_literal_type_for_constexpr_object): Use
508 strip_array_types.
509
510 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
511
512 PR c++/60215
513 * semantics.c (cxx_eval_constant_expression, [COMPONENT_REF]):
514 During error recovery allow_non_constant may be false.
515
516 2014-02-18 Adam Butcher <adam@jessamine.co.uk>
517
518 PR c++/60190
519 * parser.c (cp_parser_lambda_declarator_opt): Pop template parameter
520 scope whenever a template parameter list has been started, independent
521 of whether the function call operator was well-formed or not.
522
523 PR c++/60064
524 * parser.c (cp_parser_member_declaration): Pop fully implicit template
525 scope for generic friend declarations as well as for non-friends.
526
527 2014-02-12 Paolo Carlini <paolo.carlini@oracle.com>
528
529 PR c++/60047
530 * method.c (implicitly_declare_fn): A constructor of a class with
531 virtual base classes isn't constexpr (7.1.5p4).
532
533 2014-02-05 Jan Hubicka <hubicka@ucw.cz
534
535 * parser.c (synthesize_implicit_template_parm): Use grow_tree_vec.
536
537 2014-02-05 Jakub Jelinek <jakub@redhat.com>
538
539 PR c++/58703
540 * parser.c (cp_parser_omp_declare_reduction): Save and free
541 declarator_obstack.
542
543 2014-02-03 Marc Glisse <marc.glisse@inria.fr>
544
545 PR c++/53017
546 PR c++/59211
547 * tree.c (handle_init_priority_attribute): Call default_conversion on
548 the attribute argument.
549
550 2014-02-03 Paolo Carlini <paolo.carlini@oracle.com>
551
552 PR c++/58871
553 * method.c (synthesized_method_walk): If vbases is non-null but
554 is_empty is true, likewise don't worry about the virtual bases.
555
556 2014-02-01 Paolo Carlini <paolo.carlini@oracle.com>
557
558 PR c++/51219
559 * typeck2.c (process_init_constructor_record): Just skip unnamed
560 bit-fields.
561
562 2014-01-31 Jason Merrill <jason@redhat.com>
563
564 PR c++/59469
565 * pt.c (mark_decl_instantiated): Call mark_needed.
566
567 PR c++/58672
568 * decl2.c (handle_tls_init): Handle null init fn.
569
570 PR c++/55800
571 * decl2.c (get_tls_init_fn): Copy DECL_EXTERNAL from the variable.
572
573 2014-01-31 Paolo Carlini <paolo.carlini@oracle.com>
574
575 PR c++/59082
576 * class.c (build_vfield_ref): Early return error_mark_node if
577 TYPE_VFIELD (type) is null.
578 (build_base_path): Check return value of build_vfield_ref.
579
580 2014-01-31 Jason Merrill <jason@redhat.com>
581
582 PR c++/59646
583 * call.c (convert_like_real) [ck_aggr]: Set TARGET_EXPR_LIST_INIT_P.
584 [ck_list]: Check for error_mark_node.
585 (build_aggr_conv): Set LOOKUP_NO_NARROWING and check_narrowing.
586
587 PR c++/57043
588 * pt.c (fn_type_unification): Don't do DEDUCE_EXACT check
589 during partial ordering.
590
591 2014-01-31 Marek Polacek <polacek@redhat.com>
592
593 PR c/59963
594 * typeck.c (build_function_call_vec): Add dummy arg_loc parameter.
595
596 2014-01-30 Jason Merrill <jason@redhat.com>
597
598 PR c++/57899
599 * cp-tree.h (struct saved_scope): Add x_local_specializations.
600 (local_specializations): New macro.
601 * pt.c (local_specializations): Remove variable.
602
603 2014-01-30 Richard Sandiford <rdsandiford@googlemail.com>
604
605 PR c++/58708
606 * parser.c (make_string_pack): Use double_int::from_buffer.
607
608 2014-01-30 Marek Polacek <polacek@redhat.com>
609
610 PR c/59940
611 * typeck.c (build_ptrmemfunc1): Call convert_and_check with
612 input_location.
613 * cvt.c (cp_convert_and_check): Call warnings_for_convert_and_check
614 with input_location.
615 * call.c (build_conditional_expr_1): Call unsafe_conversion_p with
616 loc parameter.
617
618 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
619
620 PR c++/58843
621 * typeck.c (lookup_destructor): Check dtor_type for error_mark_node.
622
623 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
624
625 PR c++/58649
626 * pt.c (lookup_template_class_1): Check start_enum return value
627 for error_mark_node.
628
629 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
630
631 * decl.c (duplicate_decls, typename_hash, typename_compare):
632 Use TYPE_IDENTIFIER.
633 * error.c (dump_type): Likewise.
634 * mangle.c (dump_substitution_candidates): Likewise.
635
636 2014-01-30 Jason Merrill <jason@redhat.com>
637
638 PR c++/59633
639 * decl2.c (attributes_naming_typedef_ok): New.
640 * cp-tree.h: Declare it.
641 * decl.c (grokdeclarator): Check it.
642 * tree.c (no_linkage_check): Handle VECTOR_TYPE.
643
644 2014-01-29 Jason Merrill <jason@redhat.com>
645
646 PR c++/59707
647 * call.c (add_builtin_candidate): Catch dependent types.
648
649 PR c++/59989
650 * pt.c (expand_template_argument_pack): Correct
651 non_default_args_count calculation.
652
653 PR c++/58466
654 * pt.c (unify_pack_expansion): Call expand_template_argument_pack.
655
656 PR c++/59956
657 * friend.c (do_friend): Pass the TEMPLATE_DECL to add_friend if we
658 have a friend template in a class template.
659 * pt.c (tsubst_friend_function): Look through it.
660 (push_template_decl_real): A friend member template is
661 primary.
662
663 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
664
665 PR c++/58846
666 * decl.c (get_dso_handle_node): Don't crash if dso_handle_node
667 == error_mark_node.
668
669 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
670
671 PR c++/58674
672 * pt.c (instantiate_template_1): Check for error_mark_node the second
673 argument too.
674
675 2014-01-29 Jason Merrill <jason@redhat.com>
676
677 PR c++/59916
678 * optimize.c (maybe_thunk_body): Build a RETURN_EXPR for
679 cdtor_returns_this case.
680
681 PR c++/59315
682 * decl.c (cxx_maybe_build_cleanup): Call mark_used.
683
684 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
685
686 PR c++/58702
687 * semantics.c (finish_omp_reduction_clause): Check type for
688 error_mark_node.
689
690 2014-01-28 Jason Merrill <jason@redhat.com>
691
692 PR c++/59791
693 * pt.c (tsubst_decl) [VAR_DECL]: Allow in unevaluated context.
694 (tsubst_copy): Use it if lookup fails.
695
696 PR c++/59818
697 * pt.c (tsubst_function_type): Make sure we keep the same function
698 quals.
699
700 PR c++/58701
701 * semantics.c (build_anon_member_initialization): Stop walking
702 when we run out of COMPONENT_REFs.
703
704 PR c++/58632
705 * decl.c (lookup_and_check_tag): Ignore template parameters if
706 scope == ts_current.
707 * pt.c (check_template_shadow): Don't complain about the injected
708 class name.
709
710 * decl.c (duplicate_decls): Tweak.
711
712 PR c++/53756
713 * mangle.c (write_unqualified_name): Handle operator auto.
714
715 2014-01-27 Jason Merrill <jason@redhat.com>
716
717 PR c++/59823
718 Core DR 1138
719 * call.c (reference_binding): Pass LOOKUP_NO_TEMP_BIND for
720 list-initialization. A conversion to rvalue ref that involves
721 an lvalue-rvalue conversion is bad.
722 (convert_like_real): Give helpful error message.
723
724 PR c++/54652
725 * decl.c (duplicate_decls): Always use oldtype for TYPE_DECL.
726
727 PR c++/58504
728 * pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Use tsubst for
729 types.
730
731 PR c++/58606
732 * pt.c (template_parm_to_arg): Call convert_from_reference.
733 (tsubst_template_arg): Don't strip reference refs.
734
735 PR c++/58639
736 * call.c (build_aggr_conv): Reject value-initialization of reference.
737
738 PR c++/58812
739 PR c++/58651
740 * call.c (convert_like_real): Give helpful error about excess braces
741 for ck_rvalue of scalar type.
742
743 Core DR 1288
744 * call.c (reference_binding): Only elide braces if the single
745 element is reference-related.
746
747 PR c++/58814
748 * typeck.c (cp_build_modify_expr): Make the RHS an rvalue before
749 stabilizing.
750
751 PR c++/58837
752 * typeck.c (cp_truthvalue_conversion): Use explicit comparison for
753 FUNCTION_DECL.
754
755 PR c++/59097
756 * decl.c (compute_array_index_type): Don't call
757 maybe_constant_value for a non-integral expression.
758
759 2014-01-24 Balaji V. Iyer <balaji.v.iyer@intel.com>
760
761 * call.c (magic_varargs_p): Replaced flag_enable_cilkplus with
762 flag_cilkplus.
763 * cp-gimplify.c (cp_genericize): Likewise.
764 * decl.c (grokfndecl): Likewise.
765 * parser.c (cp_parser_postfix_expression): Likewise.
766 (cp_parser_postfix_open_square_expression): Likewise.
767 (cp_parser_direct_declarator): Likewise.
768 (is_cilkplus_vector_p): Likewise.
769 (cp_parser_omp_clause_name): Likewise.
770 (cp_parser_omp_all_clauses): Likewise.
771 * pt.c (apply_late_template_attributes): Likewise.
772 * typeck.c (cp_build_array_ref): Likewise.
773 (cp_build_compound_expr): Likewise.
774 (check_return_expr): Likewise.
775
776 2014-01-24 Jason Merrill <jason@redhat.com>
777
778 PR c++/58550
779 * decl.c (grokdeclarator): Turn pedwarn about auto return type in
780 c++11 into error.
781
782 PR c++/59886
783 PR c++/59659
784 * typeck2.c (process_init_constructor_array): Don't create
785 RANGE_EXPR yet.
786
787 2014-01-24 Jakub Jelinek <jakub@redhat.com>
788
789 * typeck2.c (split_nonconstant_init_1): Fix num_split_elts
790 handling for RANGE_ARRAY case.
791
792 2014-01-24 Paolo Carlini <paolo.carlini@oracle.com>
793
794 PR c++/57524
795 * name-lookup.c (push_using_directive): Use timevar_cond_start.
796
797 2014-01-23 Marek Polacek <polacek@redhat.com>
798
799 PR c/59846
800 * typeck.c (cp_build_binary_op): Pass location to shorten_compare.
801
802 2014-01-23 Marek Polacek <polacek@redhat.com>
803
804 PR c/58346
805 * typeck.c (pointer_diff): Give an error on arithmetic on pointer to
806 an empty aggregate.
807
808 2014-01-23 Jason Merrill <jason@redhat.com>
809
810 PR c++/55189
811 * cp-tree.h (struct language_function): Add infinite_loop and
812 infinite_loops.
813 (current_function_infinite_loop): New.
814 * semantics.c (begin_maybe_infinite_loop, end_maybe_infinite_loop)
815 (break_maybe_infinite_loop): New.
816 (finish_while_stmt_cond, finish_while_stmt, begin_do_stmt)
817 (finish_do_stmt, finish_for_cond, finish_for_stmt)
818 (begin_range_for_stmt): Use them.
819 * decl.c (finish_function): Don't warn about missing return
820 if current_function_infinite_loop.
821 * pt.c (instantiate_decl): Copy current_function_infinite_loop.
822 * parser.c (cp_parser_jump_statement): Call break_maybe_infinite_loop.
823
824 * call.c (build_op_delete_call): Use make_tree_vector and
825 release_tree_vector.
826
827 2014-01-23 Paolo Carlini <paolo.carlini@oracle.com>
828
829 PR c++/58980
830 * parser.c (cp_parser_enum_specifier): Handle TYPENAME_TYPE as
831 nested_name_specifier.
832
833 2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
834
835 * parser.c (cp_parser_direct_declarator): When Cilk Plus is enabled
836 see if there is an attribute after function decl. If so, then
837 parse them now.
838 (cp_parser_late_return_type_opt): Handle parsing of Cilk Plus SIMD
839 enabled function late parsing.
840 (cp_parser_gnu_attribute_list): Parse all the tokens for the vector
841 attribute for a SIMD-enabled function.
842 (cp_parser_omp_all_clauses): Skip parsing to the end of pragma when
843 the function is used by SIMD-enabled function (indicated by NULL
844 pragma token). Added 3 new clauses: PRAGMA_CILK_CLAUSE_MASK,
845 PRAGMA_CILK_CLAUSE_NOMASK and PRAGMA_CILK_CLAUSE_VECTORLENGTH
846 (cp_parser_cilk_simd_vectorlength): Modified this function to handle
847 vectorlength clause in SIMD-enabled function and #pragma SIMD's
848 vectorlength clause. Added a new bool parameter to differentiate
849 between the two.
850 (cp_parser_cilk_simd_fn_vector_attrs): New function.
851 (is_cilkplus_vector_p): Likewise.
852 (cp_parser_late_parsing_elem_fn_info): Likewise.
853 (cp_parser_omp_clause_name): Added a check for "mask", "nomask"
854 and "vectorlength" clauses when Cilk Plus is enabled.
855 (cp_parser_omp_clause_linear): Added a new parameter of type bool
856 and emit a sorry message when step size is a parameter.
857 * parser.h (cp_parser::cilk_simd_fn_info): New field.
858 * decl.c (grokfndecl): Added flag_enable_cilkplus along with
859 flag_openmp.
860 * pt.c (apply_late_template_attributes): Likewise.
861
862 2014-01-23 Jakub Jelinek <jakub@redhat.com>
863
864 PR middle-end/58809
865 * semantics.c (finish_omp_reduction_clause): Reject
866 BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR on COMPLEX_TYPEs.
867
868 2014-01-22 Ville Voutilainen <ville.voutilainen@gmail.com>
869
870 PR c++/59482
871 * parser.c (cp_parser_class_head): Push the class before parsing
872 the base-clause, pop after it.
873
874 2014-01-20 Eric Botcazou <ebotcazou@adacore.com>
875
876 * decl2.c (cpp_check): Revert prototype change.
877
878 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
879
880 PR c++/59270
881 PR c++/58811
882 * init.c (build_value_init_noctor): Don't pass error_mark_node to
883 build_value_init.
884
885 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
886
887 PR c++/59269
888 * init.c (build_value_init_noctor): Assert !TYPE_HAS_COMPLEX_DFLT
889 only when errorcount == 0.
890
891 2014-01-17 Marek Polacek <polacek@redhat.com>
892
893 PR c++/59838
894 * cvt.c (ocp_convert): Don't segfault on non-existing
895 ENUM_UNDERLYING_TYPE.
896
897 2014-01-16 Jason Merrill <jason@redhat.com>
898
899 PR c++/59821
900 * tree.c (bot_manip): Update the location of builtin_LINE and
901 builtin_FILE calls.
902
903 2014-01-14 Jason Merrill <jason@redhat.com>
904
905 PR c++/59659
906 * typeck2.c (massage_init_elt): New.
907 (process_init_constructor_record)
908 (process_init_constructor_union): Use it.
909 (process_init_constructor_array): Use it. Use RANGE_EXPR.
910 (split_nonconstant_init_1): Handle it.
911 * semantics.c (cxx_eval_vec_init_1): Use force_rvalue.
912
913 2014-01-09 Balaji V. Iyer <balaji.v.iyer@intel.com>
914
915 PR c++/59631
916 * parser.c (cp_parser_postfix_expression): Added a new if-statement
917 and replaced an existing if-statement with else-if statement.
918 Changed an existing error message wording to match the one from the C
919 parser.
920
921 2014-01-08 Jason Merrill <jason@redhat.com>
922
923 PR c++/59614
924 * class.c (abi_tag_data): Add tags field.
925 (check_abi_tags): Initialize it.
926 (find_abi_tags_r): Support collecting missing tags.
927 (mark_type_abi_tags): Don't look at template args.
928 (inherit_targ_abi_tags): New.
929 (check_bases_and_members): Use it.
930 * cp-tree.h (ABI_TAG_IMPLICIT): New.
931 * mangle.c (write_abi_tags): Check it.
932
933 2014-01-07 Jason Merrill <jason@redhat.com>
934
935 PR c++/58856
936 * pt.c (num_innermost_template_parms): New.
937 (get_underlying_template): Use it.
938
939 PR c++/58965
940 * mangle.c (write_guarded_var_name): Handle null DECL_NAME.
941
942 2014-01-07 Paolo Carlini <paolo.carlini@oracle.com>
943
944 * semantics.c (trait_expr_value, [CPTK_IS_BASE_OF]): Implement
945 the letter of 20.11.6 about Base and Derived naming the same
946 class type modulo cv-qualifiers.
947
948 2014-01-06 Adam Butcher <adam@jessamine.co.uk>
949
950 PR c++/59635
951 * lambda.c (maybe_add_lambda_conv_op): Handle marking conversion
952 function as unimplemented for generic lambdas with varargs.
953
954 PR c++/59636
955 * parser.c (cp_parser_template_parameter): Early out with
956 error_mark_node if parameter declaration was not parsed.
957
958 PR c++/59629
959 * parser.c (cp_parser_lambda_expression): Save/reset/restore
960 auto_is_implicit_function_template_parm_p around lambda body.
961
962 PR c++/59638
963 * parser.c (cp_parser_init_declarator): Undo fully implicit
964 template parameter list when declarator is not a function.
965
966 2014-01-03 Marc Glisse <marc.glisse@inria.fr>
967
968 PR c++/58950
969 * cvt.c (convert_to_void): Handle VEC_PERM_EXPR and VEC_COND_EXPR.
970
971 2014-01-03 Tobias Burnus <burnus@net-b.de>
972
973 PR c++/58567
974 * pt.c (tsubst_omp_for_iterator): Early return for error_mark_node.
975
976 2014-01-03 Paolo Carlini <paolo.carlini@oracle.com>
977
978 Core DR 1442
979 PR c++/59165
980 * parser.c (cp_parser_perform_range_for_lookup): Don't pass true
981 as include_std to perform_koenig_lookup.
982 (cp_parser_postfix_expression): Adjust.
983 * pt.c (tsubst_copy_and_build): Likewise.
984 * semantics.c (perform_koenig_lookup): Remove bool parameter.
985 (omp_reduction_lookup): Adjust.
986 * name-lookup.c (lookup_arg_dependent_1): Remove bool parameter.
987 (lookup_arg_dependent): Likewise.
988 (lookup_function_nonclass): Adjust.
989 * name-lookup.h: Adjust declaration.
990 * cp-tree.h: Likewise.
991
992 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
993
994 PR c++/59087
995 * parser.c (cp_parser_userdef_numeric_literal): Mention
996 -fext-numeric-literals in the message.
997
998 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
999
1000 PR c++/59641
1001 * call.c (build_conditional_expr_1): Check the return value of
1002 force_rvalue.
1003
1004 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
1005
1006 * call.c (convert_like_real): Check complain.
1007
1008 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
1009
1010 PR c++/59378
1011 * typeck.c (build_x_vec_perm_expr): Handle non-dependent arguments
1012 in templates.
1013
1014 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
1015
1016 Update copyright years
1017
1018 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
1019
1020 * cp-array-notation.c, cp-cilkplus.c, vtable-class-hierarchy.c: Use
1021 the standard form for the copyright notice.
1022 \f
1023 Copyright (C) 2014 Free Software Foundation, Inc.
1024
1025 Copying and distribution of this file, with or without modification,
1026 are permitted in any medium without royalty provided the copyright
1027 notice and this notice are preserved.