OSDN Git Service

* cp-tree.h (struct tinst_level): Add chain_next GTY
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2011-06-08  Jakub Jelinek  <jakub@redhat.com>
2
3         * cp-tree.h (struct tinst_level): Add chain_next GTY
4         markup.
5
6 2011-06-08  Jason Merrill  <jason@redhat.com>
7
8         PR c++/49322
9         * pt.c (deduction_tsubst_fntype): Don't free the tinst entry
10         if a pending_template entry is pointing at it.
11
12 2011-06-07  Jason Merrill  <jason@redhat.com>
13
14         PR c++/48969
15         PR c++/44175
16         * error.c (subst_to_string): New.
17         (cp_printer): Use it for 'S'.
18         (print_instantiation_partial_context_line): Handle subst context.
19         * pt.c (push_tinst_level): Handle subst context.
20         (deduction_tsubst_fntype): Don't track specific substitutions.
21         Use push_tinst_level.
22
23         * pt.c (deduction_tsubst_fntype): Use push_deduction_access_scope.
24         (fn_type_unification): Don't call push_deduction_access_scope here.
25
26 2011-06-06  Jason Merrill  <jason@redhat.com>
27
28         PR c++/48780
29         * typeck.c (perform_integral_promotions): Don't promote scoped enums.
30         * call.c (convert_arg_to_ellipsis): Promote them here in old ABI.
31
32 2011-06-06  Nicola Pero  <nicola.pero@meta-innovation.com>,
33
34         PR obj-c++/48275
35         * parser.c (cp_parser_objc_at_property_declaration): Allow setter
36         and getter names to use all the allowed method names.
37
38 2011-06-06  Jason Merrill  <jason@redhat.com>
39
40         PR c++/49298
41         * semantics.c (potential_constant_expression_1): Handle FIELD_DECL.
42
43         PR objc++/49221
44         * decl.c (cp_finish_decl): Check DECL_FUNCTION_SCOPE_P rather than
45         at_function_scope_p.
46
47         PR c++/49134
48         * tree.c (build_target_expr): Deal with ARM ABI tweaks.
49
50 2011-06-04  Jonathan Wakely  <jwakely.gcc@gmail.com>
51
52         * init.c (build_delete): Warn when deleting type with non-virtual
53         destructor.
54
55 2011-06-03  Jakub Jelinek  <jakub@redhat.com>
56
57         PR c++/49276
58         * mangle.c (write_nested_name): Use CP_DECL_CONTEXT instead of
59         DECL_CONTEXT.
60
61 2011-06-01  Jason Merrill  <jason@redhat.com>
62
63         * pt.c (build_non_dependent_expr): Remove special handling of
64         REFERENCE_REF_P.
65
66         PR c++/44175
67         * pt.c (template_args_equal): Handle one arg being NULL_TREE.
68         (deduction_tsubst_fntype): Handle excessive non-infinite recursion.
69
70         PR c++/49253
71         * typeck2.c (build_x_arrow): Don't use build_min_nt.
72
73 2010-05-31  Fabien ChĂȘne  <fabien@gcc.gnu.org>
74
75         PR c++/48010
76         * name-lookup.c (supplement_binding_1): If the old binding was a
77         type name, also check that the DECL actually refers to the same
78         type or is not a type.
79
80 2011-05-31  Jason Merrill  <jason@redhat.com>
81
82         PR c++/44870
83         * tree.c (lvalue_kind): Recurse on NON_DEPENDENT_EXPR.  Handle
84         ARROW_EXPR, TYPEID_EXPR, and arbitrary class-valued expressions.
85         (build_min_non_dep): Preserve reference refs.
86         (build_min_non_dep_call_vec): Likewise
87
88 2011-05-30  Jakub Jelinek  <jakub@redhat.com>
89
90         PR c++/49223
91         * semantics.c (finish_omp_clauses): Call require_complete_type
92         even for copyin/copyprivate clauses.  Only call
93         cxx_omp_create_clause_info if inner_type is COMPLETE_TYPE_P.
94
95 2011-05-28  Jason Merrill  <jason@redhat.com>
96
97         PR c++/46124
98         * parser.c (cp_parser_lambda_expression): Improve error recovery.
99         (cp_parser_lambda_declarator_opt): Likewise.  Return bool.
100
101 2011-05-27  Jason Merrill  <jason@redhat.com>
102
103         PR c++/47277
104         * parser.c (cp_parser_pseudo_destructor_name): Commit to parse
105         after we see the ~.
106
107         * mangle.c (mangle_decl_string): Make sure we don't try to mangle
108         templates.
109
110         PR c++/47049
111         * semantics.c (maybe_add_lambda_conv_op): Fix COMDAT sharing.
112         * decl.c (start_preparsed_function): Don't call comdat_linkage for
113         a template.
114
115         PR c++/47132
116         * mangle.c (write_expression): Handle MODOP_EXPR.
117
118         PR c++/47277
119         * parser.c (cp_parser_unqualified_id): Don't check
120         constructor_name_p for enums.
121
122         PR c++/47687
123         * pt.c (dependent_type_p_r): Avoid infinite recursion.
124
125         PR c++/48284
126         * error.c (dump_expr) [COMPONENT_REF]: Use pp_cxx_dot
127         with INDIRECT_REF of REFERENCE_TYPE.
128
129         PR c++/49181
130         * pt.c (get_mostly_instantiated_function_type): Use push_access_scope.
131
132 2011-05-27  Nathan Froyd  <froydnj@codesourcery.com>
133
134         * cp-tree.h (building_stmt_tree): Delete.
135         * decl.c (save_function_data): Tweak initializer for x_cur_stmt_list.
136         (build_aggr_init_full_exprs): Call building_stmt_list_p
137         instead of building_stmt_tree.
138         (initialize_local_var): Likewise.
139         (finish_function): Likewise.
140         * decl2.c (finish_anon_union): Likewise.
141         * init.c (begin_init_stmts): Likewise.
142         (finish_init_stmts): Likewise.
143         (expand_aggr_init_1): Likewise.
144         * name-lookup.c (do_local_using_decl): Likewise.
145         (do_namespace_alias): Likewise.
146         (do_using_directive): Likewise.
147         (cp_emit_debug_info_for_using): Likewise.
148         * semantics.c (add_stmt): Assert that stmt_list_stack is non-empty.
149
150 2011-05-27  Paolo Carlini  <paolo.carlini@oracle.com>
151
152         PR c++/42056
153         * typeck2.c (build_functional_cast): Complain early for invalid uses
154         of 'auto' and set type to error_mark_node.
155
156 2011-05-26  Jason Merrill  <jason@redhat.com>
157
158         PR c++/47721
159         * parser.c (cp_parser_member_declaration): Allow friend T.
160         * friend.c (make_friend_class): Ignore non-classes.
161         * pt.c (instantiate_class_template_1): Handle TEMPLATE_TYPE_PARM.
162
163         DR 1004
164         * pt.c (convert_template_argument): Don't complain about using
165         injected-class-name as template template argument.
166
167         PR c++/47956
168         * decl.c (check_static_variable_definition): Now static.
169         (cp_finish_decl): Call it here.
170         (grokdeclarator): Not here.
171         * pt.c (instantiate_class_template_1): Or here.
172         * cp-tree.h: Don't declare it.
173
174 2011-05-26  Janis Johnson  <janis187@us.ibm.com>
175             Nathan Froyd  <froydnj@codesourcery.com>
176
177         PR c++/2288
178         PR c++/18770
179         * name-lookup.h (enum scope_kind): Add sk_cond.
180         * name-lookup.c (pushdecl_maybe_friend): Get scope of shadowed local.
181         Detect and report error for redeclaration from for-init or if
182         or switch condition.
183         (begin_scope): Handle sk_cond.
184         * semantics.c (begin_if_stmt): Use sk_cond.
185         (begin switch_stmt): Ditto.
186
187 2011-05-26  Jason Merrill  <jason@redhat.com>
188
189         PR c++/48211
190         * name-lookup.h (cp_class_binding): Make base a pointer.
191         * name-lookup.c (new_class_binding): Adjust.
192         (poplevel_class): Adjust.
193
194         PR c++/48424
195         * decl.c (grokparms): Function parameter packs don't need to
196         go at the end.
197         * pt.c (type_unification_real): But they aren't deduced otherwise.
198
199 2011-05-25  Jason Merrill  <jason@redhat.com>
200
201         PR c++/48536
202         * decl.c (build_enumerator): If incremented enumerator won't fit in
203         previous integral type, find one it will fit in.
204
205         PR c++/48599
206         * decl.c (create_array_type_for_decl): Complain about array of auto.
207
208         PR c++/44994
209         PR c++/49156
210         * error.c (dump_template_bindings): Set processing_template_decl
211         for a partial instantiation.
212
213         PR c++/45401
214         * decl.c (grokdeclarator): Don't change type when adding rvalue ref
215         to another reference type.
216
217         PR c++/44311
218         * decl.c (case_conversion): New.
219         (finish_case_label): Use it.
220
221         * ptree.c (cxx_print_xnode): Handle ARGUMENT_PACK_SELECT.
222
223         PR c++/45698
224         * pt.c (dependent_template_arg_p): See through ARGUMENT_PACK_SELECT.
225
226         PR c++/46005
227         * decl.c (grokdeclarator): Complain about auto typedef.
228
229         PR c++/46245
230         * decl.c (grokdeclarator): Complain later for auto parameter.
231         * pt.c (splice_late_return_type): Handle use in a template
232         type-parameter.
233
234         PR c++/46696
235         * typeck.c (cp_build_modify_expr): Check DECL_DEFAULTED_FN.
236
237         PR c++/47184
238         * parser.c (cp_parser_parameter_declaration): Recognize
239         list-initialization.
240         (cp_parser_direct_declarator): Check for the closing
241         paren before parsing definitely.
242
243         PR c++/48935
244         * parser.c (cp_parser_constructor_declarator_p): Don't check
245         constructor_name_p for enums.
246         (cp_parser_diagnose_invalid_type_name): Correct error message.
247
248         PR c++/45418
249         * init.c (perform_member_init): Handle list-initialization
250         of array of non-trivial class type.
251
252         PR c++/45080
253         * pt.c (instantiate_class_template_1): Call maybe_add_lambda_conv_op.
254         * semantics.c (lambda_function): Check COMPLETE_OR_OPEN_TYPE_P.
255
256         PR c++/48292
257         * pt.c (tsubst_decl) [PARM_DECL]: Handle partial instantiation of
258         function parameter pack.
259         (tsubst_pack_expansion): Likewise.
260
261         * cp-objcp-common.c (cp_common_init_ts): TYPE_ARGUMENT_PACK has
262         TS_COMMON.
263
264 2011-05-25  Jakub Jelinek  <jakub@redhat.com>
265
266         * cp-objcp-common.c (cp_common_init_ts): Mark CTOR_INITIALIZER
267         as TS_TYPED.
268
269         PR c++/49136
270         * semantics.c (cxx_eval_bit_field_ref): Handle the
271         case when BIT_FIELD_REF doesn't cover only a single field.
272
273 2011-05-24  Jason Merrill  <jason@redhat.com>
274
275         PR c++/49042
276         * pt.c (get_mostly_instantiated_function_type): Use
277         push_deferring_access_checks rather than set flag_access_control.
278
279 2011-05-24  Nicola Pero  <nicola.pero@meta-innovation.com>,
280
281         * parser.c (cp_parser_objc_class_ivars): Deal gracefully with a
282         syntax error in declaring an ObjC instance variable.
283
284 2011-05-24  Jason Merrill  <jason@redhat.com>
285
286         PR c++/48884
287         * class.c (pushclass): Accept NULL argument.
288         (popclass): Deal with popping null class.
289         * pt.c (push_access_scope, pop_access_scope): Use them rather than
290         push_to_top_level/pop_from_top_level.
291         (push_deduction_access_scope, pop_defarg_context): New.
292         (fn_type_unification): Use them.
293         * name-lookup.c (lookup_name_real_1): Check current_class_type.
294
295 2011-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
296
297         * decl.c (grokdeclarator): Use current_class_name.
298
299 2011-05-24  Joseph Myers  <joseph@codesourcery.com>
300
301         * Make-lang.in (GXX_OBJS): Remove prefix.o.
302         (g++$(exeext)): Use libcommon-target.a.
303         (CXX_C_OBJS): Remove prefix.o.
304
305 2011-05-23  Jason Merrill  <jason@redhat.com>
306
307         * pt.c (tsubst_copy_and_build): Use current_class_name.
308
309         PR c++/49102
310         * call.c (convert_arg_to_ellipsis): Call force_rvalue.
311
312         PR c++/49105
313         * typeck.c (cp_build_c_cast): Don't strip cv-quals when
314         converting to reference.
315         (build_static_cast_1): Update for glvalues.
316
317         PR c++/49105
318         * typeck.c (build_const_cast_1): Handle rvalue references.
319
320         PR c++/47263
321         * decl.c (use_eh_spec_block): Do use an EH spec block for a
322         lambda op().
323
324         PR c++/49058
325         * call.c (splice_viable): Be strict in templates.
326
327         PR c++/47336
328         * error.c (dump_template_bindings): Suppress access control.
329
330         PR c++/47544
331         * pt.c (instantiate_decl): Handle =default.
332
333         PR c++/48617
334         * pt.c (invalid_nontype_parm_type_p): Allow DECLTYPE_TYPE.
335
336 2011-05-23  Nathan Froyd  <froydnj@codesourcery.com>
337
338         * call.c (build_over_call): Tweak call to check_function_arguments.
339         * typeck.c (cp_build_function_call_vec): Likewise.
340
341 2011-05-23  Jonathan Wakely  <jwakely.gcc@gmail.com>
342
343         PR c++/18016
344         * init.c (perform_member_init): Check for self-initialization.
345
346 2011-05-22  Jason Merrill  <jason@redhat.com>
347
348         PR c++/48647
349         * typeck.c (composite_pointer_type_r): Return error_mark_node
350         on error in SFINAE context.
351
352 2011-05-20  Jason Merrill  <jason@redhat.com>
353
354         PR c++/48945
355         * decl.c (grokdeclarator): Don't add set const function-cv-qual
356         for constexpr fns to memfn_quals, just add it to the type.
357         (revert_static_member_fn): Don't complain about quals.
358         (check_static_quals): New.
359         (grokfndecl): Call it.
360         (start_preparsed_function): Don't call revert_static_member_fn.
361
362         PR c++/48945
363         * decl.c (revert_static_member_fn): Ignore const on constexpr fn.
364
365         PR c++/48780
366         * cvt.c (type_promotes_to): Don't promote scoped enums.
367
368         PR c++/49066
369         * decl.c (duplicate_decls): Preserve DECL_DELETED_FN.
370
371         PR c++/48873
372         * tree.c (stabilize_expr): Fix typo.
373
374         DR 1073
375         PR c++/49082
376         * typeck.c (comp_except_specs): noexcept(false) is not compatible
377         with throw(type-list).
378         * typeck2.c (merge_exception_specifiers): noexcept(false)
379         beats any more limited specification.
380
381         PR c++/24163
382         PR c++/29131
383         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Avoid repeating
384         unqualified lookup.
385         * semantics.c (perform_koenig_lookup): Add complain parm.
386         * cp-tree.h: Adjust.
387         * parser.c (cp_parser_postfix_expression): Adjust.
388         (cp_parser_perform_range_for_lookup): Adjust.
389
390 2011-05-20  Jason Merrill  <jason@redhat.com>
391
392         * semantics.c (finish_call_expr): SET_EXPR_LOCATION.
393
394 2011-05-20  Joseph Myers  <joseph@codesourcery.com>
395
396         * Make-lang.in (GXX_OBJS): Remove intl.o and version.o.
397
398 2011-05-19  Jakub Jelinek  <jakub@redhat.com>
399
400         PR c++/49043
401         * decl.c (check_omp_return): Stop searching on sk_function_parms.
402
403         PR c++/48869
404         * method.c (get_dtor, get_copy_ctor): Add COMPLAIN argument,
405         pass it down to locate_fn_flags.
406         * cp-tree.h (get_dtor, get_copy_ctor): Adjust prototypes.
407         * semantics.c (cxx_omp_create_clause_info): Adjust callers.
408         * cp-gimplify.c: Include splay-tree.h.
409         (splay_tree_compare_decl_uid, omp_var_to_track,
410         omp_cxx_notice_variable): New functions.
411         (struct cp_genericize_omp_taskreg): New type.
412         (struct cp_genericize_data): Add omp_ctx field.
413         (cp_genericize_r): Attempt to determine implicitly determined
414         firstprivate class type variables.
415         (cp_genericize): Clear omp_ctx.
416         * Make-lang.in (cp/cp-gimplify.o): Depend on $(SPLAY_TREE_H).
417
418 2011-05-18  Jason Merrill  <jason@redhat.com>
419
420         PR c++/48948
421         PR c++/49015
422         * class.c (finalize_literal_type_property): Do check
423         for constexpr member functions of non-literal class.
424         (finish_struct): Don't call check_deferred_constexpr_decls.
425         * cp-tree.h: Don't declare it.
426         (DECL_DEFERRED_CONSTEXPR_CHECK): Remove.
427         * decl.c (grok_special_member_properties): Don't check it
428         (grokfnedcl): Don't call validate_constexpr_fundecl.
429         (start_preparsed_function): Do call it.
430         * pt.c (tsubst_decl): Don't call it.
431         (instantiate_class_template_1): Don't call
432         check_deferred_constexpr_decls.
433         * semantics.c (literal_type_p): Check for any incompleteness.
434         (ensure_literal_type_for_constexpr_object): Likewise.
435         (is_valid_constexpr_fn): Revert deferral changes.
436         (validate_constexpr_fundecl): Likewise.
437         (register_constexpr_fundef): Likewise.
438         (check_deferred_constexpr_decls): Remove.
439
440 2011-05-16  Jason Merrill  <jason@redhat.com>
441
442         PR c++/48969
443         * pt.c (deduction_tsubst_fntype): Use a VEC initially.
444
445 2011-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
446
447         * cxx-pretty-print.c: Update comment.
448         * semantics.c (trait_expr_value, finish_trait_expr):
449         Reorder the cases.
450         * parser.c (cp_parser_primary_expression): Likewise.
451
452 2011-05-15  Jonathan Wakely  <jwakely.gcc@gmail.com>
453
454         PR c++/48994
455         * parser.c (cp_parser_perform_range_for_lookup): Call complete_type.
456
457 2011-05-13  Ville Voutilainen  <ville.voutilainen@gmail.com>
458
459         Implement final on class.
460         * class.c (check_bases): Diagnose derivation from a final class.
461         * cp-tree.h (lang_type_class): Add is_final and adjust dummy.
462         (CLASSTYPE_FINAL): New.
463         * parser.c (cp_parser_class_head): Parse class-virt-specifier, set
464         CLASSTYPE_FINAL.
465         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_FINAL.
466
467 2011-05-13  Jason Merrill  <jason@redhat.com>
468
469         PR c++/48969
470         * pt.c (deduction_tsubst_fntype): New.
471         (fn_type_unification): Use it.
472         (init_template_processing): Initialize hash table.
473         (print_template_statistics): Print hash table stats.
474
475         * call.c (build_op_call): Use timevar_cond_start/stop.
476         (build_user_type_conversion): Likewise.
477
478 2011-05-12  Jason Merrill  <jason@redhat.com>
479
480         * cp-tree.h (DECL_DEFERRED_CONSTEXPR_CHECK): New.
481         * semantics.c (validate_constexpr_fundecl): Set it.
482         (check_deferred_constexpr_decls): Clear it.
483         (register_constexpr_fundef): Make sure it isn't set.
484         * decl.c (grok_special_member_properties): Check it.
485
486 2011-05-11  Jason Merrill  <jason@redhat.com>
487
488         PR c++/48948
489         * semantics.c (validate_constexpr_fundecl): Defer checking if
490         an argument type is being defined.
491         (is_valid_constexpr_fn): Add defer_ok parm.
492         (cxx_eval_call_expression): Adjust.
493         (check_deferred_constexpr_decls): New.
494         (literal_type_p): Make sure type isn't being defined.
495         (ensure_literal_type_for_constexpr_object): Handle type being defined.
496         * cp-tree.h: Declare check_deferred_constexpr_decls.
497         * decl.c (grokfndecl): Call validate_constexpr_fundecl here.
498         (start_preparsed_function, cp_finish_decl): Not here.
499         * class.c (finalize_literal_type_property): Don't call
500         validate_constexpr_fundecl.
501         (finish_struct): Call check_deferred_constexpr_decls.
502         * pt.c (tsubst_decl): Call validate_constexpr_fundecl.
503         (instantiate_class_template): Call check_deferred_constexpr_decls.
504
505         * semantics.c (validate_constexpr_fundecl): Check DECL_TEMPLATE_INFO
506         rather than DECL_TEMPLATE_INSTANTIATION.
507         (cxx_eval_call_expression): Likewise.
508
509         * semantics.c (register_constexpr_fundef): Add to hash table here.
510         (validate_constexpr_fundecl): Not here.
511
512         * decl.c (grokdeclarator): Only set DECL_DECLARED_CONSTEXPR_P once.
513
514         * pt.c (build_non_dependent_expr): Don't check null_ptr_cst_p,
515         do call maybe_constant_value in C++0x mode.
516         * semantics.c (cxx_eval_constant_expression): Handle TEMPLATE_DECL.
517
518         PR c++/48745
519         * pt.c (value_dependent_expr_p): Handle CONSTRUCTOR.
520
521 2011-05-11  Nathan Froyd  <froydnj@codesourcery.com>
522
523         * cp-tree.h (TYPENAME_TYPE_FULLNAME, TYPEOF_TYPE_EXPR): Use
524         TYPE_VALUES_RAW.
525         (UNDERLYING_TYPE_TYPE, DECLTYPE_TYPE_EXPR): Likewise.
526         (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): Likewise.
527         (TEMPLATE_TYPE_PARM_INDEX): Likewise.
528
529 2011-05-10  Jason Merrill  <jason@redhat.com>
530
531         PR c++/48930
532         * class.c (type_build_ctor_call): New.
533         * cp-tree.h: Declare it.
534         * decl.c (check_initializer): Use it instead of
535         TYPE_NEEDS_CONSTRUCTING.
536         * init.c (build_value_init, build_value_init_noctor): Likewise.
537         (perform_member_init, expand_aggr_init_1, build_new_1): Likewise.
538         (build_vec_init): Likewise.
539         * typeck2.c (process_init_constructor_array): Likewise.
540         (process_init_constructor_record): Likewise.
541
542         PR c++/48736
543         * pt.c (tsubst_copy_and_build): Handle substitution of a pack
544         expansion producing another expansion.
545
546 2011-05-10  Ville Voutilainen  <ville.voutilainen@gmail.com>
547
548         Fixes for override/final.
549         * class.c (check_for_override): Diagnose final on a nonvirtual
550         member function, diagnose override for a virtual with no matching
551         override. Don't fiddle around with DECL_VINDEX.
552
553 2011-05-10  Nathan Froyd  <froydnj@codesourcery.com>
554
555         * cp-tree.def (EXPR_PACK_EXPANSION): Add an operand.
556         * cp-objcp-common.c (cp_common_init_ts): Mark it as TS_TYPED.
557         * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS): Use the new
558         operand of EXPR_PACK_EXPANSION.
559         (cp_tree_operand_length): Declare.
560         * tree.c (cp_tree_operand_length): Define.
561         (cp_tree_equal): Call it.
562         * pt.c (value_dependent_expr_P): Likewise.
563         * mangle.c (write_expression): Likewise.
564
565 2011-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
566
567         PR c++/48737
568         PR c++/48744
569         * decl.c (reshape_init): Take a complain parameter and do
570         not call error if tf_error is not set.
571         (check_initializer, reshape_init_r, reshape_init_array,
572         reshape_init_array_1, reshape_init_vector, reshape_init_class):
573         Adjust.
574         * typeck2.c (digest_init_r): Take a complain parameter and
575         pass it to convert_for_initialization.
576         (digest_init, digest_init_flags, process_init_constructor_array,
577         process_init_constructor_record, process_init_constructor_union,
578         process_init_constructor, digest_init_r): Adjust.
579         * init.c (expand_default_init, build_new_1): Likewise.
580         * typeck.c (cp_build_modify_expr): Likewise.
581         * decl2.c (grokfield): Likewise.
582         * call.c (convert_like_real, convert_default_arg): Likewise.
583         * semantics.c (finish_compound_literal): Pass complain to
584         reshape_init and digest_init.
585         * cp-tree.h: Adjust declarations.
586
587 2011-05-07  Fabien ChĂȘne  <fabien@gcc.gnu.org>
588
589         PR c++/48859
590         * init.c (diagnose_uninitialized_cst_or_ref_member_1): stop the
591         recursion if there is user defined constructor.
592
593 2011-05-09  Jason Merrill  <jason@redhat.com>
594
595         PR c++/34772
596         * decl.c (initialize_local_var): Use DECL_INITIAL for simple
597         initialization.
598
599 2011-05-08  Ville Voutilainen  <ville.voutilainen@gmail.com>
600
601         Implement final/override for member functions.
602         * class.c (check_for_override): Check for DECL_OVERRIDE_P.
603         * cp-tree.h (DECL_OVERRIDE_P, DECL_FINAL_P): New.
604         (cp_virt_specifiers, enum virt_specifier): New.
605         * decl.c (set_virt_specifiers): New.
606         (grokdeclarator): Use them. Diagnose virt-specifiers on non-fields.
607         * parser.c (make_call_declarator): add virt-specifiers parameter.
608         (cp_parser_lambda_declarator_opt): Adjust.
609         (cp_parser_direct_declarator): Likewise.
610         (cp_parser_virt_specifier_seq_opt): New.
611         * search.c (check_final_overrider): Diagnose attempts to override
612         a final member function.
613
614 2011-05-09  Dodji Seketeli  <dodji@redhat.com>
615
616         PR c++/48574
617         * class.c (fixed_type_or_null): Use type_dependent_p_push to test
618         if the instance has a dependent initializer.
619
620 2011-05-08  Paolo Carlini  <paolo.carlini@oracle.com>
621
622         PR c++/48816
623         * cxx-pretty-print.c (pp_cxx_template_declaration): Remove
624         effectively unused variable.
625
626 2011-05-07  Eric Botcazou  <ebotcazou@adacore.com>
627
628         * name-lookup.h (global_bindings_p): Adjust prototype.
629         * name-lookup.c (global_bindings_p): Return bool.
630
631 2011-05-06  Jason Merrill  <jason@redhat.com>
632
633         * decl.c (stabilize_save_expr_r): Set *walk_subtrees as
634         appropriate.
635
636         PR c++/48909
637         * semantics.c (cxx_eval_conditional_expression): Check
638         integer_zerop instead.
639         (potential_constant_expression_1): Likewise.
640
641         PR c++/48911
642         * semantics.c (cxx_eval_array_reference): Handle implicit
643         initializers.
644
645 2011-05-06  Nathan Froyd  <froydnj@codesourcery.com>
646
647         * cp-tree.h (type_of_this_parm, class_of_this_parm): New functions.
648         * call.c (standard_conversion): Call class_of_this_parm.
649         * cxx-pretty-print.c (pp_cxx_implicit_parameter_type): Likewise.
650         (pp_cxx_direct_abstract_declarator): Likewise.
651         * decl2.c (change_return_type): Likewise.
652         (cp_reconstruct_complex_type): Likewise.
653         * error.c (dump_type_suffix, dump_function_decl): Likewise.
654         * mangle.c (write_function_type): Likewise.
655         * pt.c (unify): Likewise.
656         * typeck.c (merge_types, type_memfn_quals): Likewise.
657         * decl.c (build_this_parm): Call type_of_this_parm.
658
659 2011-05-06  Dodji Seketeli  <dodji@redhat.com>
660
661         PR c++/48838
662         * cp-tree.h (non_static_member_function_p): Declare new function.
663         * tree.c (non_static_member_function_p): Define it.
664         * semantics.c (finish_call_expr): Use it.
665
666 2011-05-05  Nathan Froyd  <froydnj@codesourcery.com>
667
668         * decl.c (finish_case_label): Omit the loc argument to
669         build_case_label.
670
671 2011-05-05  Jason Merrill  <jason@redhat.com>
672
673         * cp-tree.h (REFERENCE_REF_P): Just check the type.
674         * cvt.c (convert_from_reference): Adjust.
675         * pt.c (build_non_dependent_expr): Adjust.
676         * semantics.c (finish_offsetof): Adjust.
677         * tree.c (lvalue_kind): Use it.
678
679         PR c++/48873
680         * tree.c (stabilize_expr): Don't make gratuitous copies of classes.
681
682 2011-05-05  Eric Botcazou  <ebotcazou@adacore.com>
683
684         * decl.c (start_preparsed_function): Do not set
685         dont_save_pending_sizes_p.
686
687 2011-05-05  Joseph Myers  <joseph@codesourcery.com>
688
689         * parser.c (cp_parser_objc_method_definition_list): Update call to
690         objc_start_method_definition.
691
692 2011-05-04  Jason Merrill  <jason@redhat.com>
693
694         PR c++/48749
695         * class.c (resolves_to_fixed_type_p): Don't look closely
696         in templates.
697
698 2011-05-03  Paolo Carlini  <paolo.carlini@oracle.com>
699
700         PR c++/28501
701         * call.c (add_builtin_candidate): Handle REALPART_EXPR and
702         IMAGPART_EXPR.
703
704 2011-05-02  Lawrence Crowl  <crowl@google.com>
705
706         * decl.c: (push_local_name): Change TV_NAME_LOOKUP to start/stop.
707         (poplevel): Refactor POP_TIMEVAR_AND_RETURN to plain code.
708         Change TV_NAME_LOOKUP to start/stop.
709         (define_label): Refactor timevar calls out to a wrapper function.
710         Change TV_NAME_LOOKUP to start/stop.
711         (xref_tag): Likewise.
712         (lookup_label): Refactor timevar calls out to a wrapper function.
713         Change TV_NAME_LOOKUP to start_cond/stop_cond.
714
715         * pt.c: (instantiate_class_template): Add a wrapper to push/pop new
716         TV_TEMPLATE_INST.
717         (instantiate_template): Add a wrapper to push/pop new TV_TEMPLATE_INST.
718         (lookup_template_class): Refactor timevar calls out to a wrapper
719         function.  Change use of TV_NAME_LOOKUP to TV_TEMPLATE_INST.
720         (instantiate_decl): Change TV_PARSE to TV_TEMPLATE_INST.
721
722         * name-lookup.c: (store_bindings): Change TV_NAME_LOOKUP to start/stop.
723         (poplevel_class): Change TV_NAME_LOOKUP to start_cond/stop_cond.
724         (push_namespace): Likewise.
725         (pop_nested_namespace): Likewise.
726         (pushdecl_namespace_level): Likewise.
727         (store_class_bindings): Likewise.
728         (push_to_top_level): Likewise.
729         (identifier_type_value): Refactor timevar calls out to a wrapper
730         function.  Change TV_NAME_LOOKUP to start/stop.
731         (find_binding): Likewise.
732         (push_using_decl): Likewise.
733         (lookup_arg_dependent): Likewise.
734         (push_using_directive): Likewise.
735         (qualified_lookup_using_namespace): Refactor POP_TIMEVAR_AND_RETURN
736         to plain code.  Change TV_NAME_LOOKUP to start/stop.
737         (lookup_type_current_level): Likewise.  Refactor inner return to
738         break.
739         (pushdecl_class_level): Refactor POP_TIMEVAR_AND_RETURN to plain
740         code.  Change TV_NAME_LOOKUP to start_cond/stop_cond.
741         (pushdecl_top_level_1): Likewise.
742         (lookup_using_namespace): Likewise.
743         (pushdecl_with_scope): Refactor timevar calls out to a wrapper
744         function.  Change TV_NAME_LOOKUP to start_cond/stop_cond.
745         (push_overloaded_decl): Likewise.
746         (push_class_level_binding): Likewise.
747         (namespace_binding): Likewise.
748         (set_namespace_binding): Likewise.
749         (supplement_binding): Likewise.
750         (unqualified_namespace_lookup): Likewise.
751         (lookup_name_real): Likewise.
752         (lookup_type_scope): Likewise.
753         (namespace_ancestor): Likewise.
754         (lookup_name_innermost_nonclass_level): Likewise.
755         (pushtag): Likewise.
756         (pop_from_top_level): Likewise.
757         (pushdecl_maybe_friend): Refactor timevar calls out to a wrapper
758         function.  Change TV_NAME_LOOKUP to start_cond/stop_cond.  Wrap long
759         lines.
760         (add_using_namespace): Refactor timevar calls out to a wrapper
761         function.  Change TV_NAME_LOOKUP to start_cond/stop_cond.  Bypass
762         wrapper on call to self.
763
764         * decl2.c: (cp_write_global_declarations):  Add start/stop of
765         new TV_PHASE_DEFERRED, TV_PHASE_CGRAPH, TV_PHASE_CHECK_DBGINFO.
766         Remove push/pop calls to TV_VARCONST.
767
768         * parser.c: Add include of "timevar.h".
769         (cp_parser_explicit_instantiation): Add push/pop calls to
770         TV_TEMPLATE_INST.
771         (cp_parser_enum_specifier): Add push/pop calls to new TV_PARSE_ENUM.
772         (cp_parser_class_specifier): Add wrapper to add push/pop calls to
773         TV_PARSE_STRUCT.
774         (cp_parser_function_definition_from_specifiers_and_declarator): Add
775         push/pop calls to new TV_PARSE_FUNC or TV_PARSE_INLINE.
776         (cp_parser_late_parsing_for_member):  Add push/pop calls to
777         new TV_PARSE_INMETH.
778
779         * call.c: Add include of "timevar.h".
780         (convert_class_to_reference): Wrap and add push/pop calls to 
781         TV_OVERLOAD.
782         (build_op_call): Likewise.
783         (build_conditional_expr): Likewise.
784         (build_new_op): Likewise.
785         (build_new_method_call): Likewise.
786         (build_user_type_conversion): Reorganize to single return and add
787         push/pop calls to TV_OVERLOAD.
788         (perform_overload_resolution): Likewise.
789
790         * Make-lang.in: Add dependence of call.o and parser.o on $(TIMEVAR_H).
791
792 2011-05-02  Jason Merrill  <jason@redhat.com>
793
794         * tree.c (build_vec_init_expr): Take complain parm.
795         (build_vec_init_elt): Likewise.  Free arg vector.
796         (diagnose_non_constexpr_vec_init, build_array_copy): Adjust.
797         * cp-tree.h (VEC_INIT_EXPR_SLOT): Use VEC_INIT_EXPR_CHECK.
798         (VEC_INIT_EXPR_INIT): Likewise.
799         Adjust build_vec_init_expr declaration.
800         * init.c (perform_member_init): Adjust.
801
802         Revert:
803         PR c++/40975
804         * cp-tree.def (VEC_INIT_EXPR): Add third operand.
805         * cp-tree.h (VEC_INIT_EXPR_NELTS): New.
806         * cp-gimplify.c (cp_gimplify_expr) [VEC_INIT_EXPR]: Handle it.
807         * tree.c (build_vec_init_expr): Handle getting pointer/nelts.
808         (build_vec_init_elt): Don't expect an array type.
809         (build_array_copy): Adjust.
810         * init.c (perform_member_init): Adjust.
811         (build_new_1): Use build_vec_init_expr.
812
813         PR c++/48834
814         * tree.c (build_vec_init_expr): Set TREE_SIDE_EFFECTS.
815         Protect an explicit target.
816
817         PR c++/48446
818         * decl.c (stabilize_save_expr_r, stabilize_vla_size): New.
819         (compute_array_index_type): Revert earlier 48446 changes.
820         (grokdeclarator): Use stabilize_vla_size.
821
822 2011-05-02  Dmitry Gorbachev  <d.g.gorbachev@gmail.com>
823             Eric Botcazou <ebotcazou@adacore.com>
824
825         * parser.c (cp_parser_init_declarator): Set pushed_scope to NULL_TREE
826         instead of inappropriate zero values.
827
828 2011-05-02  Paolo Carlini  <paolo.carlini@oracle.com>
829
830         PR c++/47969
831         * decl.c (compute_array_index_type): Check build_expr_type_conversion
832         return value for NULL_TREE.
833
834 2011-04-29  Paolo Carlini  <paolo.carlini@oracle.com>
835
836         PR c++/48606
837         * init.c (perform_member_init): Check build_value_init return
838         value for error_mark_node.
839
840 2011-04-29  Diego Novillo  <dnovillo@google.com>
841             Le-Chun Wu  <lcwu@google.com>
842
843         * call.c (conversion_null_warnings): Also handle assignments
844         when warning about NULL conversions.
845
846 2011-04-29  Le-Chun Wu  <lcwu@google.com>
847
848         * cp-tree.h (LOOKUP_EXPLICIT_TMPL_ARGS): Define.
849         * call.c (build_new_function_call): Set it for TEMPLATE_ID_EXPRs.
850         (build_over_call): Use it to determine whether to emit a NULL
851         warning for template function instantiations.
852         (build_new_method_call): Set LOOKUP_EXPLICIT_TMPL_ARGS if
853         EXPLICIT_TARGS is set.
854
855 2011-04-29  Nicola Pero  <nicola.pero@meta-innovation.com>,
856             Mike Stump <mikestump@comcast.net>
857
858         * Make-lang.in ($(srcdir)/cp/cfns.h): Enable the dependency only
859         in maintainer mode.  Use the --output-file option of gperf instead
860         of > to prevent creating an empty cp/cfns.h when gperf is not
861         available.
862
863 2011-04-28  Paolo Carlini  <paolo.carlini@oracle.com>
864
865         PR c++/48798
866         * semantics.c (finish_base_specifier): cv-qualified base class
867         is fine, per DR 484.
868
869 2011-04-28  Dodji Seketeli  <dodji@redhat.com>
870
871         PR c++/48656
872         * semantics.c (finish_call_expr): Don't forget BASELINK nodes when
873         considering call expressions involving a member function.
874
875 2011-04-28  Paolo Carlini  <paolo.carlini@oracle.com>
876
877         PR c++/48530
878         * tree.c (build_cplus_new): Check build_target_expr return
879         value for error_mark_node.
880
881 2011-04-28  Paolo Carlini  <paolo.carlini@oracle.com>
882
883         PR c++/48771
884         * semantics.c (literal_type_p): Reference types are literal types,
885         per the FDIS.
886         (valid_type_in_constexpr_fundecl_p): Remove.
887         (is_valid_constexpr_fn): Adjust.
888
889 2011-04-27  Jason Merrill  <jason@redhat.com>
890
891         PR libstdc++/48760
892         Implement list-initialization of _Complex.
893         * decl.c (reshape_init_r): Allow {real,imag} for _Complex.
894         (check_initializer): Likewise.
895         * call.c (build_complex_conv): New.
896         (implicit_conversion): Call it.
897         (convert_like_real): Handle it.
898         * typeck2.c (check_narrowing): Handle it.
899
900         * init.c (build_vec_delete_1): Look for sfk_deleting_destructor to
901         decide whether to delete.
902         (build_vec_init): Pass sfk_complete_destructor.
903
904         PR c++/40975
905         * cp-tree.def (VEC_INIT_EXPR): Add third operand.
906         * cp-tree.h (VEC_INIT_EXPR_NELTS): New.
907         * cp-gimplify.c (cp_gimplify_expr) [VEC_INIT_EXPR]: Handle it.
908         * tree.c (build_vec_init_expr): Handle getting pointer/nelts.
909         (build_vec_init_elt): Don't expect an array type.
910         (build_array_copy): Adjust.
911         * init.c (perform_member_init): Adjust.
912         (build_new_1): Use build_vec_init_expr.
913
914         * class.c (resolve_address_of_overloaded_function): Don't
915         change OVERLOAD to TREE_LIST.
916         * pt.c (print_candidates_1): Remove nonsensical assert.
917
918         PR c++/48046
919         * parser.c (cp_parser_diagnose_invalid_type_name): Commit
920         to tentative parse sooner.
921
922 2011-04-26  Jason Merrill  <jason@redhat.com>
923
924         PR c++/42687
925         * parser.c (cp_parser_primary_expression): Set *idk to
926         CP_ID_KIND_NONE for a parenthesized identifier.
927
928         * ptree.c (cxx_print_type) [TYPENAME_TYPE]: Dump fullname.
929         (cxx_print_identifier): Correct indentation.
930
931         PR c++/48530
932         * decl.c (cxx_maybe_build_cleanup): Add complain parm.
933         * tree.c (force_target_expr): Add complain parm.
934         (build_target_expr_with_type): Likewise.
935         (get_target_expr_sfinae): Split out.
936         (build_vec_init_expr, bot_manip): Adjust.
937         * init.c (build_vec_delete, build_vec_delete_1): Add complain parm.
938         (build_delete, build_dtor_call): Likewise.
939         (perform_direct_initialization_if_possible): Adjust.
940         (build_vec_init): Handle error return.
941         * cvt.c (force_rvalue): Add complain parm.
942         Call build_special_member_call directly.
943         * decl2.c (delete_sanity): Add complain parm.
944         (build_cleanup): Adjust.
945         * pt.c (tsubst_copy_and_build, tsubst_expr): Adjust.
946         * semantics.c (finish_stmt_expr_expr): Adjust.
947         (finish_compound_literal): Adjust.
948         * parser.c (cp_parser_delete_expression): Adjust.
949         * typeck2.c (build_functional_cast): Adjust.
950         * cp-tree.h: Adjust.
951
952 2011-04-26  Martin Jambor  <mjambor@suse.cz>
953
954         * class.c (cp_fold_obj_type_ref): Remove.
955         * cp-tree.h (cp_fold_obj_type_ref): Remove declaration.
956
957 2011-04-25  Paolo Carlini  <paolo.carlini@oracle.com>
958
959         * cp-tree.def: Add a new UNDERLYING_TYPE tree code.
960         * cp-tree.h (enum cp_trait_kind): Add CPTK_UNDERLYING_TYPE, tidy.
961         (UNDERLYING_TYPE_TYPE): Add.
962         * cp-objcp-common.c (cp_common_init_ts): Mark UNDERLYING_TYPE
963         as TS_COMMON.
964         * parser.c (cp_lexer_next_token_is_decl_specifier_keyword,
965         cp_parser_simple_type_specifier): Handle UNDERLYING_TYPE.
966         (cp_parser_trait_expr): Deal with RID_UNDERLYING_TYPE; tidy.
967         * semantics.c (finish_underlying_type): New.
968         * typeck.c (structural_comptypes): Handle UNDERLYING_TYPE.
969         * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
970         * cxx-pretty-print.c (p_cxx_type_id): Likewise.
971         * tree.c (cp_walk_subtrees): Likewise.
972         * pt.c (for_each_template_parm_r, tsubst, unify,
973         dependent_type_p_r): Likewise.
974         * mangle.c (write_type): Sorry for __underlying_type.
975
976 2011-04-25  Jason Merrill  <jason@redhat.com>
977
978         PR c++/48707
979         * decl.c (type_dependent_init_p): New.
980         (cp_finish_decl): Check it.
981         * pt.c (any_type_dependent_elements_p): New.
982         * cp-tree.h: Declare it.
983
984 2011-04-20  Jason Merrill  <jason@redhat.com>
985
986         * semantics.c (finish_compound_literal): Don't put an array
987         with a dtor in a static variable.
988
989         * call.c (build_over_call): Handle trivial dtor.
990
991         * search.c (lookup_fnfields_slot): Call complete_type.
992
993         PR c++/48594
994         * decl2.c (build_offset_ref_call_from_tree): Move
995         non-dependency of object outside condition.
996
997         PR c++/48657
998         * decl.c (cp_finish_decl): Simplify template handling.
999
1000 2011-04-20  Jim Meyering  <meyering@redhat.com>
1001
1002         * tree.c (cxx_printable_name_internal): Remove useless if-before-free.
1003
1004 2011-04-19  Jason Merrill  <jason@redhat.com>
1005
1006         PR c++/46304
1007         * typeck.c (cp_build_binary_op): Fold COMPLEX_EXPR.
1008
1009         PR c++/45267
1010         * decl.c (duplicate_decls): Keep always_inline attribute
1011         in sync with DECL_DISREGARD_INLINE_LIMITS.
1012
1013 2011-04-18  Jason Merrill  <jason@redhat.com>
1014
1015         PR c++/48569
1016         * typeck2.c (build_functional_cast): Handle VOID_TYPE.
1017
1018         PR c++/48537
1019         * init.c (build_value_init): Handle UNION_TYPE the same.
1020
1021 2011-04-18  Jakub Jelinek  <jakub@redhat.com>
1022
1023         PR c++/48632
1024         * parser.c (cp_parser_omp_for_loop): Don't use cp_parser_omp_for_incr
1025         for type dependent pointers.
1026
1027 2011-04-18  Jim Meyering  <meyering@redhat.com>
1028
1029         * pt.c (type_unification_real): Fix typo in comment: s/in in/in/.
1030
1031 2011-04-17  Jan Hubicka  <jh@suse.cz>
1032
1033         * semantics.c (finish_goto_stmt): Do set UNINLINABLE flag on computed
1034         gotos.
1035
1036 2011-04-17  Jason Merrill  <jason@redhat.com>
1037
1038         PR c++/48531
1039         * typeck2.c (build_functional_cast): Disallow array type.
1040
1041         * tree.c (get_target_expr): Handle VEC_INIT_EXPR.
1042
1043 2011-04-17  Jan Hubicka  <jh@suse.cz>
1044
1045         * class.c (cp_fold_obj_type_ref): Drop vtable_method.
1046
1047 2011-04-15  Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
1048
1049         Implement N3271
1050         * parser.c (cp_convert_range_for): Split into
1051         cp_parser_perform_range_for_lookup.
1052         (cp_parser_perform_range_for_lookup): New.
1053         (cp_parser_range_for_member_function): New.
1054         (cp_parser_for_init_statement): Correct error message.
1055         * semantics.c (finish_call_expr): Accept COMPONENT_REF.
1056
1057 2011-04-14  Nicola Pero  <nicola.pero@meta-innovation.com>
1058
1059         * parser.c (cp_parser_objc_protocol_declaration): Updated for
1060         change from objc_declare_protocols() to objc_declare_protocol().
1061
1062 2011-04-14  Nathan Froyd  <froydnj@codesourcery.com>
1063
1064         PR objc++/48479
1065         * typeck.c (cxx_mark_addressable) [CONST_DECL]: Mark addressable
1066         and return immediately.
1067
1068 2011-04-14  Nathan Froyd  <froydnj@codesourcery.com>
1069
1070         * cp-tree.def (SWITCH_STMT): Add an extra operand.
1071         * cp-objcp-common.c (cp_common_init_ts): Mark it as TS_TYPED.
1072         * cp-tree.h (SWITCH_STMT_SCOPE): Define.
1073         * semantics.c (begin_switch__stmt): Pass scope to build_stmt.
1074         (finish_switch_stmt): Use SWITCH_STMT_SCOPE instead of TREE_CHAIN.
1075
1076 2011-04-14  Nathan Froyd  <froydnj@codesourcery.com>
1077
1078         * cp-tree.def (IF_STMT): Add an extra operand.
1079         * cp-objcp-common.c (cp_common_init_ts): Mark it as TS_TYPED.
1080         * cp-tree.h (IF_SCOPE): Define.
1081         * semantics.c (begin_if_stmt): Pass scope to build_stmt.
1082         (finish_if_stmt): Use IF_SCOPE instead of TREE_CHAIN.
1083
1084 2011-04-14  Nathan Froyd  <froydnj@codesourcery.com>
1085
1086         * cp-tree.def (FOR_STMT, RANGE_FOR_STMT): Add an extra operand.
1087         * cp-objcp-common.c (cp_common_init_ts): Mark them as TS_TYPED.
1088         * cp-tree.h (FOR_SCOPE, RANGE_FOR_SCOPE): Define.
1089         * semantics.c (begin_for_stmt): Pass an extra arg to build_stmt.
1090         Use FOR_SCOPE instead of TREE_CHAIN.
1091         (begin_range_for_stmt): Likewise, with RANGE_FOR_SCOPE.
1092         (finish_for_stmt): Likewise.
1093
1094 2011-04-14  Jason Merrill  <jason@redhat.com>
1095
1096         * parser.c (cp_parser_postfix_expression): Fix flags passed to
1097         build_new_method_call.
1098         * semantics.c (finish_call_expr): Likewise.
1099
1100         PR c++/48531
1101         * init.c (build_value_init_noctor): Check complain consistently.
1102
1103         PR c++/48557
1104         * typeck.c (cp_build_binary_op): Don't decay void operands.
1105
1106         PR c++/48446
1107         * decl.c (compute_array_index_type): Use get_temp_regvar instead
1108         of variable_size.
1109         * init.c (get_temp_regvar): No longer static.
1110         * cp-tree.h: Declare it.
1111
1112 2011-04-14  Nicola Pero  <nicola.pero@meta-innovation.com>
1113
1114         * parser.c (cp_parser_objc_class_declaration): Updated for change
1115         in objc_declare_class().
1116
1117 2011-04-14  Nathan Froyd  <froydnj@codesourcery.com>
1118
1119         * decl.c (poplevel): Use block_chainon.
1120
1121 2011-04-13  Jason Merrill  <jason@redhat.com>
1122
1123         PR c++/48594
1124         * decl2.c (build_offset_ref_call_from_tree): Fix calling a functor
1125         or pointer to (non-member) function.
1126
1127 2011-04-13  Jakub Jelinek  <jakub@redhat.com>
1128
1129         PR c++/48570
1130         * semantics.c (cxx_eval_array_reference): Handle reading from
1131         wchar_t, char16_t and char32_t STRING_CST.
1132
1133 2011-04-13  Dodji Seketeli  <dodji@redhat.com>
1134
1135         PR c++/48574
1136         * class.c (fixed_type_or_null): We cannot determine the dynamic
1137         type of a reference variable if its initializer is dependent.
1138
1139 2011-04-13  Jason Merrill  <jason@redhat.com>
1140
1141         PR c++/48581
1142         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Don't complain about
1143         unqualified lookup failing if we're still in a template.
1144
1145 2011-04-12  Nathan Froyd  <froydnj@codesourcery.com>
1146
1147         * cp-lang.c (cp_init_ts): Call cp_common_init_ts.  Move
1148         tree_contains_struct initialization to...
1149         * cp-objcp-common.c (cp_common_init_ts): ...here.  Use MARK_*
1150         macros.
1151         * cp-objcp-common.h (cp_common_init_ts): Declare.
1152         * cp-tree.h (union lang_tree_node): Check for TS_COMMON before
1153         calling TREE_CHAIN.
1154
1155 2011-04-12  Nicola Pero  <nicola.pero@meta-innovation.com>
1156
1157         * parser.c (cp_parser_objc_message_expression): Updated call
1158         to objc_build_message_expr.
1159
1160 2011-04-12  Martin Jambor  <mjambor@suse.cz>
1161
1162         * class.c (cp_fold_obj_type_ref): Call cgraph_get_node instead of
1163         cgraph_get_create_node.
1164         * decl2.c (cp_write_global_declarations): Call cgraph_get_node
1165         instead of cgraph_get_create_node.
1166         * method.c (make_alias_for_thunk): Call cgraph_get_node
1167         instead of cgraph_get_create_node, assert it returns non-NULL.
1168         (use_thunk): Likewise.
1169         * optimize.c (maybe_clone_body): Call cgraph_same_body_alias only
1170         when flag_syntax_only is not set.  Call cgraph_get_node instead of
1171         cgraph_get_create_node.
1172         (maybe_clone_body): Call cgraph_get_node instead of
1173         cgraph_get_create_node.
1174
1175 2011-04-12  Martin Jambor  <mjambor@suse.cz>
1176
1177         * class.c (cp_fold_obj_type_ref): Call cgraph_get_create_node
1178         instead of cgraph_node.
1179         * decl2.c (cxx_callgraph_analyze_expr): Likewise.
1180         (cp_write_global_declarations): Likewise.
1181         * optimize.c (maybe_clone_body): Likewise.
1182         * semantics.c (maybe_add_lambda_conv_op): Likewise.
1183         * mangle.c (mangle_decl): Likewise.
1184         * method.c (make_alias_for_thunk): Likewise.
1185         (use_thunk): Likewise.
1186
1187 2011-04-11  Jason Merrill  <jason@redhat.com>
1188
1189         PR c++/48535
1190         * decl.c (cp_complete_array_type_or_error): New.
1191         * semantics.c (finish_compound_literal): Use it.
1192         * cp-tree.h: Declare it.
1193
1194         PR c++/48535
1195         * semantics.c (finish_compound_literal): Handle references.
1196
1197         PR c++/48535
1198         * semantics.c (finish_compound_literal): Take complain parm.
1199         (build_lambda_object): Adjust.
1200         * cp-tree.h: Adjust.
1201         * call.c (convert_like_real): Adjust.
1202         * decl.c (check_initializer): Adjust.
1203         * parser.c (cp_parser_postfix_expression): Adjust.
1204         (cp_parser_functional_cast): Adjust.
1205         * pt.c (tsubst_copy_and_build): Adjust.
1206         * typeck2.c (process_init_constructor_record): Adjust.
1207
1208         PR c++/48534
1209         * cvt.c (ocp_convert): Use build_nop to convert to underlying type
1210         of scoped enum.
1211
1212         PR c++/48523
1213         * tree.c (maybe_dummy_object): Use build_x_indirect_ref rather
1214         than cp_build_indirect_ref.
1215
1216         PR c++/48457, Core 1238
1217         * call.c (reference_binding): Allow rvalue reference to bind to
1218         function lvalue.
1219         * tree.c (lvalue_kind): Functions are always lvalues.
1220
1221 2011-04-07  Jason Merrill  <jason@redhat.com>
1222
1223         PR c++/48500
1224         * semantics.c (potential_constant_expression_1) [CALL_EXPR]: Check
1225         arguments even if we don't know the function.
1226
1227         PR c++/48481
1228         * tree.c (build_overload): Allow an unwrapped FUNCTION_DECL
1229         at the end of the chain.
1230         * pt.c (dependent_template_p): Use OVL_CURRENT/NEXT.
1231         (iterative_hash_template_arg): Likewise.
1232
1233         PR c++/48481
1234         * cp-tree.h (OVL_ARG_DEPENDENT): New.
1235         * name-lookup.c (add_function): Set it.
1236         * semantics.c (finish_call_expr): Free OVERLOADs if it's set.
1237
1238         PR c++/48481
1239         * call.c (build_user_type_conversion_1): Use lookup_fnfields_slot.
1240         Release unused vector.
1241
1242         PR c++/48451
1243         * pt.c (fn_type_unification): Don't clear incomplete pack flag.
1244         (type_unification_real): Clear it here instead.
1245
1246         PR c++/48468
1247         * except.c (build_noexcept_spec): Propagate error_mark_node.
1248         (finish_noexcept_expr): Likewise.
1249
1250         PR c++/48452
1251         * typeck.c (build_x_compound_expr_from_list): Return error_mark_node
1252         in SFINAE context.
1253
1254         PR c++/48450
1255         * call.c (resolve_args): Take complain.
1256         (build_new_function_call, build_operator_new_call): Pass it.
1257         (build_op_call, build_new_op, build_new_method_call): Pass it.
1258
1259         PR c++/48450
1260         * typeck.c (check_for_casting_away_constness): Take complain.
1261         (build_static_cast_1, build_reinterpret_cast_1): Pass it.
1262         (build_const_cast_1): Pass it.  Take full complain parm.
1263         (build_const_cast, cp_build_c_cast): Adjust.
1264
1265         * tree.c (build_aggr_init_expr): Always return error_mark_node
1266         on abstract violation.
1267
1268         PR c++/48450
1269         * tree.c (build_cplus_new, build_aggr_init_expr): Take complain.
1270         (bot_manip): Adjust.
1271         * cp-tree.h: Adjust.
1272         * call.c (convert_like_real, build_cxx_call): Adjust.
1273         (perform_direct_initialization_if_possible): Adjust.
1274         * cvt.c (ocp_convert): Adjust.
1275         * init.c (build_value_init): Adjust.
1276         * semantics.c (maybe_add_lambda_conv_op): Adjust.
1277         * typeck.c (unary_complex_lvalue, cp_build_modify_expr): Adjust.
1278         * typeck2.c (build_functional_cast): Adjust.
1279
1280         * init.c (build_value_init_noctor): Handle REFERENCE_TYPE at top
1281         level.
1282         (perform_member_init): Not here.
1283         * typeck2.c (build_functional_cast): Limit REFERENCE_TYPE special
1284         case to templates.
1285         (abstract_virtuals_error_sfinae): Remove RESULT_DECL special case.
1286
1287         PR c++/48449
1288         * typeck2.c (build_functional_cast): Check complain consistently.
1289         Use build_value_init and abstract_virtuals_error_sfinae.
1290         (abstract_virtuals_error_sfinae): Split out.
1291         * cp-tree.h: Declare it.
1292         * init.c (build_new_1): Use it.
1293         (build_value_init_noctor): Handle FUNCTION_TYPE.
1294
1295         * semantics.c (finish_decltype_type): Simplify handling of unknown
1296         type.
1297
1298         * semantics.c (finish_decltype_type): Add complain parm.
1299         * cp-tree.h: Adjust.
1300         * parser.c (cp_parser_decltype): Adjust.
1301         * pt.c (tsubst): Adjust.
1302
1303         PR c++/48450
1304         * cvt.c (ocp_convert): Handle converting scoped enum to bool.
1305
1306 2011-03-31  Jason Merrill  <jason@redhat.com>
1307
1308         PR c++/48277
1309         * semantics.c (finish_call_expr): Remove assert.
1310
1311         PR c++/48280
1312         * method.c (defaultable_fn_check): Templates are not defaultable.
1313
1314         * parser.c (cp_parser_init_declarator): Avoid redundant
1315         cp_finish_decl for member declarations.
1316
1317 2011-03-30  Jason Merrill  <jason@redhat.com>
1318
1319         PR c++/48212
1320         * semantics.c (non_const_var_error): Just return if DECL_INITIAL
1321         is error_mark_node.
1322
1323 2011-03-30  Jason Merrill  <jason@redhat.com>
1324
1325         PR c++/48369
1326         * semantics.c (potential_constant_expression_1): Handle
1327         UNORDERED_EXPR and ORDERED_EXPR.
1328
1329         PR c++/48281
1330         * semantics.c (finish_compound_literal): Do put static/constant
1331         arrays in static variables.
1332
1333         * call.c (convert_like_real) [ck_list]: Build up the
1334         initializer_list object directly.
1335         * decl.c (build_init_list_var_init): Adjust.
1336
1337         * call.c (convert_like_real): Correct TREE_CONSTANT on CONSTRUCTOR.
1338         * decl.c (reshape_init_array_1): Likewise.
1339
1340 2011-03-29  Jason Merrill  <jason@redhat.com>
1341
1342         PR c++/48265
1343         * pt.c (value_dependent_expression_p) [VAR_DECL]: Make sure
1344         the variable is constant before looking at its initializer.
1345
1346         PR c++/48319
1347         * pt.c (value_dependent_expression_p): Handle TEMPLATE_ID_EXPR.
1348
1349         PR c++/48089
1350         * semantics.c (potential_constant_expression_1): Change error about
1351         use of *this in constructor into sorry.
1352
1353         PR c++/48296
1354         * decl.c (cp_finish_decl): Defer validation of constexpr member
1355         functions.
1356         * class.c (finalize_literal_type_property): Validate them here.
1357         * semantics.c (is_valid_constexpr_fn): Don't check completeness.
1358
1359         * semantics.c (is_valid_constexpr_fn): Specify input location.
1360
1361 2011-03-28  Jason Merrill  <jason@redhat.com>
1362
1363         PR c++/48313
1364         * pt.c (maybe_adjust_types_for_deduction): Handle T&& deduction
1365         from overloaded function.
1366
1367         Core 1232
1368         * call.c (build_array_conv): New.
1369         (implicit_conversion): Use it.
1370
1371         * call.c (reference_binding): Allow direct binding to an array
1372         rvalue.
1373
1374         Core 898
1375         * parser.c (cp_parser_compound_statement): Add function_body parm.
1376         Complain about non-body compound-stmt in constexpr fn.
1377         (cp_parser_primary_expression, cp_parser_statement): Adjust.
1378         (cp_parser_implicitly_scoped_statement): Adjust.
1379         (cp_parser_function_body, cp_parser_try_block): Adjust.
1380         (cp_parser_handler, cp_parser_objc_synchronized_statement): Adjust.
1381         (cp_parser_objc_try_catch_finally_statement): Adjust.
1382
1383         Core 898
1384         * semantics.c (constexpr_fn_retval): New.  Allow using-declaration
1385         and using-definition.
1386         (register_constexpr_fundef): Call it.
1387
1388         * except.c (build_noexcept_spec): Call cxx_constant_value after
1389         converting to bool.
1390
1391 2011-03-25  Kai Tietz  <ktietz@redhat.com>
1392
1393         * lex.c (interface_strcmp): Handle dos-paths.
1394         (handle_pragma_implementation): Use filename_cmp instead of
1395         strcmp.
1396         (in_main_input_context): Likewise.
1397
1398 2011-03-25  Jason Merrill  <jason@redhat.com>
1399
1400         Core 1135
1401         * method.c (defaulted_late_check): Check for exception spec mismatch.
1402         (defaultable_fn_check): Allow exception spec and virtual.
1403         * class.c (check_for_override): A virtual dtor is non-trivial.
1404
1405         PR c++/48289
1406         * pt.c (build_non_dependent_expr): Keep dereferences outside the
1407         NON_DEPENDENT_EXPR.
1408
1409 2011-03-25  Kai Tietz  <ktietz@redhat.com>
1410
1411         * decl.c (decls_match): Replace target hook
1412         call of comp_type_attributes by version in tree.c file.
1413         * search.c (check_final_overrider): Likewise.
1414         * typeck.c (structural_comptypes): Likewise.
1415
1416 2011-03-21  Kai Tietz  <ktietz@redhat.com>
1417
1418         PR target/12171
1419         * cxx-pretty-print.c (pp_cxx_ptr_operator):
1420         Display allowed attributes for function pointer types.
1421         * error.c (dump_type_prefix): Likewise.
1422
1423         * tree.c (cxx_attribute_table): Adjust table.
1424
1425 2011-03-18  Jason Merrill  <jason@redhat.com>
1426
1427         PR c++/48162
1428         * semantics.c (finish_call_expr): Allow TARGET_EXPR for now.
1429
1430         PR c++/48118
1431         * call.c (build_over_call): Don't skip ck_rvalue.
1432
1433 2011-03-17  Jason Merrill  <jason@redhat.com>
1434
1435         PR c++/47504
1436         * semantics.c (cxx_eval_constant_expression) [NOP_EXPR]: Don't let
1437         the conversion set TREE_OVERFLOW.
1438
1439         Core 1212
1440         * semantics.c (finish_decltype_type): Return T&& for xvalue.
1441         * typeck.c (unlowered_expr_type): Preserve cv-quals.
1442
1443         PR c++/48166
1444         * decl.c (revert_static_member_fn): Strip function-cv-quals.
1445
1446 2011-03-16  Jason Merrill  <jason@redhat.com>
1447
1448         PR c++/48089
1449         * semantics.c (potential_constant_expression_1): Don't allow *this
1450         in a constructor.
1451         (register_constexpr_fundef): Use potential_rvalue_constant_expression.
1452
1453         PR c++/47301
1454         * decl.c (compute_array_index_type): Don't bother trying to deal
1455         with literal classes in ABI v1.
1456
1457         PR c++/46336
1458         * decl.c (duplicate_decls): Return NULL_TREE for clashing
1459         C functions.
1460
1461         PR c++/47570
1462         * semantics.c (cxx_eval_constant_expression) [COMPOUND_EXPR]: Don't
1463         use the generic binary expression handling.
1464
1465 2011-03-16  Diego Novillo  <dnovillo@google.com>
1466
1467         * Make-lang.in (CXX_PARSER_H): New.
1468         (cp/parser.o): Add dependency on CXX_PARSER_H.
1469         Add dependency on tree-pretty-print.h
1470         (cp/cp-lang.o): Add dependency on CXX_PARSER_H.
1471         * cp-lang.c: Include parser.h.
1472         * parser.c: Include parser.h.
1473         (struct cp_token): Add bitfield purged_p.
1474         Update all users.
1475         Move to parser.h.
1476         (CPP_PURGED): Remove.  Update all users.
1477         (struct cp_lexer): Change field buffer to be a VEC of cp_token.
1478         Remove field buffer_length.
1479         Update all users.
1480         Move to parser.h.
1481         (struct tree_check): Move to parser.h.
1482         (cp_token_position): Likewise.
1483         (struct cp_token_cache): Likewise.
1484         (CPP_KEYWORD): Likewise.
1485         (CPP_TEMPLATE_ID): Likewise.
1486         (CPP_NESTED_NAME_SPECIFIER): Likewise.
1487         (N_CP_TTYPES): Likewise.
1488         (enum cp_parser_status_kind): Likewise.
1489         (struct cp_parser_context): Likewise.
1490         (struct cp_default_arg_entry_d): Likewise.
1491         (struct cp_unparsed_functions_entry_d): Likewise.
1492         (struct cp_parser): Likewise.
1493         (cp_lexer_dump_tokens): New.
1494         (cp_lexer_debug_tokens): New.
1495         (cp_lexer_finished_p): New.
1496         (cp_lexer_alloc): Factor out of cp_lexer_new_main.
1497         (cp_lexer_new_main): Re-write main lexing loop to push
1498         tokens into the new VEC buffer.
1499         (cp_lexer_print_token): Improve printing of CPP_NUMBER tokens.
1500         Do not abort if the token type is not recognized, just print
1501         its code.
1502         * parser.h: New file.
1503         * config-lang.in (gtfiles): Add cp/parser.h.
1504
1505 2011-03-16  Jason Merrill  <jason@redhat.com>
1506
1507         Core 1148
1508         * typeck.c (check_return_expr): Fix conditions for setting
1509         LOOKUP_PREFER_RVALUE.
1510
1511         * call.c (build_over_call): Remove require_complete_type_sfinae call.
1512
1513         PR c++/48132
1514         * decl.c (check_array_designated_initializer): Allow integer index.
1515         (reshape_init_array_1): Set index on the elements.
1516
1517 2011-03-16  Jason Merrill  <jason@redhat.com>
1518
1519         PR c++/48113
1520         * typeck.c (convert_for_initialization): Use
1521         perform_implicit_conversion_flags.
1522         * call.c (standard_conversion): If LOOKUP_PREFER_RVALUE, set
1523         rvaluedness_matches_p on ck_rvalue.
1524         (convert_like_real) [ck_rvalue]: And restore it here.
1525
1526         PR c++/48115
1527         * call.c (convert_arg_to_ellipsis): Handle incomplete type.
1528
1529 2011-03-16  Jason Merrill  <jason@redhat.com>
1530
1531         * parser.c (cp_parser_abort_tentative_parse): Make sure we haven't
1532         committed to this tentative parse.
1533
1534         PR c++/47999
1535         * semantics.c (finish_call_expr): Preserve reference semantics
1536         in templates.
1537
1538         * call.c (convert_default_arg): Use LOOKUP_IMPLICIT.
1539
1540 2011-03-16  Jakub Jelinek  <jakub@redhat.com>
1541
1542         * cp-objcp-common.c (cp_function_decl_explicit_p): Don't crash if
1543         DECL_LANG_SPECIFIC is NULL.
1544
1545 2011-03-15  Jason Merrill  <jason@redhat.com>
1546
1547         Core 1074
1548         * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Don't
1549         check value_dependent_expression_p on the operand.
1550
1551         * semantics.c (push_cx_call_context): Return bool.
1552         (cxx_eval_call_expression): Handle excess depth.
1553
1554         Core 1191
1555         * method.c (synthesized_method_walk): Cleanups don't affect the
1556         triviality of a constructor, but do affect deletion and exception
1557         specification.
1558
1559 2011-03-15  Rodrigo Rivas Costa  <rodrigorivascosta@gmail.com>
1560
1561         * decl2.c (cp_check_const_attributes): New.
1562         (cplus_decl_attributes): Call cp_check_const_attributes.
1563
1564 2011-03-15  Jason Merrill  <jason@redhat.com>
1565
1566         PR c++/34758
1567         * call.c (convert_default_arg): Use DECL_ORIGIN of fn.  Check for
1568         recursion first.
1569         (push_defarg_context, pop_defarg_context): New.
1570         * parser.c (cp_parser_late_parsing_default_args): Use them.
1571         * cp-tree.h: Declare them.
1572
1573 2011-03-11  Dodji Seketeli  <dodji@redhat.com>
1574
1575         * call.c (add_builtin_candidate)<case INDIRECT_REF>: The type of
1576         the argument of the indirection operator should not be dependent.
1577         Fix the comment.
1578
1579 2011-03-11  Jason Merrill  <jason@redhat.com>
1580
1581         PR c++/47125
1582         * pt.c (tsubst) [TYPENAME_TYPE]: Only give errors if tf_error.
1583
1584         PR c++/47144
1585         * parser.c (cp_parser_template_type_arg): Set
1586         type_definition_forbidden_message.
1587
1588         PR c++/47808
1589         * decl.c (compute_array_index_type): Discard folding
1590         if it didn't produce a constant.
1591
1592 2011-03-11  Jakub Jelinek  <jakub@redhat.com>
1593
1594         PR c++/48035
1595         * init.c (build_zero_init_1): Extracted from build_zero_init.
1596         Add FIELD_SIZE argument, if non-NULL and field bit_position
1597         as not smaller than that, don't add that field's initializer.
1598         Pass DECL_SIZE as last argument to build_zero_init_1
1599         for DECL_FIELD_IS_BASE fields.
1600         (build_zero_init): Use build_zero_init_1.
1601
1602 2011-03-10  Jason Merrill  <jason@redhat.com>
1603
1604         PR c++/48029
1605         * pt.c (iterative_hash_template_arg): Remove special case for
1606         ARRAY_TYPE.
1607
1608         PR c++/47198
1609         * parser.c (cp_parser_single_declaration): Just return if
1610         cp_parser_parse_and_diagnose_invalid_type_name complained.
1611
1612 2011-03-09  Jason Merrill  <jason@redhat.com>
1613
1614         PR c++/44629
1615         * pt.c (unify): An unresolved overload is a nondeduced context.
1616
1617 2011-03-09  Martin Jambor  <mjambor@suse.cz>
1618
1619         PR tree-optimization/47714
1620         * method.c (use_thunk): Clear addressable flag of thunk arguments.
1621
1622 2011-03-08  Dodji Seketeli  <dodji@redhat.com>
1623
1624         PR c++/47705
1625         * pt.c (convert_nontype_argument): Only call decay_conversion on
1626         arrays.
1627
1628 2011-03-08  Jason Merrill  <jason@redhat.com>
1629
1630         PR c++/47488
1631         * mangle.c (write_template_arg_literal) [STRING_CST]: Sorry.
1632
1633         PR c++/47705
1634         * pt.c (convert_nontype_argument): Don't crash on non-pointer
1635         argument to pointer parameter.
1636
1637         PR c++/45651
1638         * pt.c (instantiate_decl): Don't clear DECL_INTERFACE_KNOWN on
1639         !TREE_PUBLIC decls.
1640
1641 2011-03-08  Dodji Seketeli  <dodji@redhat.com>
1642
1643         PR c++/47957
1644         * name-lookup.c (binding_to_template_parms_of_scope_p): Only
1645         consider scopes of primary template definitions.  Adjust comments.
1646
1647 2011-03-07  Jason Merrill  <jason@redhat.com>
1648
1649         PR c++/48003
1650         * pt.c (convert_nontype_argument): Fix -fpermissive allowing
1651         integer overflow.
1652         * semantics.c (potential_constant_expression_1): Check TREE_OVERFLOW.
1653
1654         PR c++/48015
1655         * init.c (constant_value_1): Always require init to be TREE_CONSTANT.
1656
1657         PR c++/48008
1658         * mangle.c (write_type): Strip cv-quals from FUNCTION_TYPE here.
1659         (write_CV_qualifiers_for_type): Not here.
1660
1661 2011-03-06  Joseph Myers  <joseph@codesourcery.com>
1662
1663         * lang-specs.h: Match -save-temps* instead of -save-temps.
1664
1665 2011-03-05  Jason Merrill  <jason@redhat.com>
1666
1667         * mangle.c (write_expression): Change ABI v6 to v5.
1668         (write_type): Likewise.
1669
1670 2011-03-04  Jan Hubicka  <jh@suse.cz>
1671
1672         PR lto/47497
1673         * optimize.c (maybe_clone_body): Update call of cgraph_same_body_alias
1674         and cgraph_add_thunk.
1675         * method.c (make_alias_for_thunk, use_thunk): Likewise.
1676         * mangle.c (mangle_decl): Likewise.
1677
1678 2011-03-04  Jason Merrill  <jason@redhat.com>
1679
1680         PR c++/47971
1681         * pt.c (tsubst_copy_and_build) [PSEUDO_DTOR_EXPR]: Use tsubst for type.
1682         (tsubst_copy) [default]: Just return t if !ENABLE_CHECKING.
1683
1684         PR c++/46220
1685         * search.c (check_final_overrider): Allow pointer to same incomplete
1686         class type with different cv-quals.
1687
1688 2011-03-03  Paolo Carlini  <paolo.carlini@oracle.com>
1689
1690         PR c++/47974
1691         * pt.c (tsubst_template_args): Check argument t for error_mark_node.
1692
1693 2011-03-03  Jason Merrill  <jason@redhat.com>
1694
1695         PR c++/47950
1696         * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Retain TREE_CONSTANT.
1697
1698 2011-03-02  Jason Merrill  <jason@redhat.com>
1699
1700         PR c++/47950
1701         * parser.c (cp_parser_condition): Don't fold_non_dependent_expr here.
1702
1703         PR c++/47774
1704         * tree.c (build_vec_init_elt): Split out from...
1705         (build_vec_init_expr): ...here.
1706         (diagnose_non_constexpr_vec_init): New fn.
1707         * semantics.c (potential_constant_expression_1): Use it.
1708         * cp-tree.h: Declare it.
1709
1710 2011-03-01  Jason Merrill  <jason@redhat.com>
1711
1712         PR c++/46159
1713         * parser.c (cp_parser_primary_expression): Don't warn about a
1714         failed tentative parse.
1715
1716         PR c++/47200
1717         * semantics.c (cxx_bind_parameters_in_call): Don't call
1718         adjust_temp_type on non-constant args.
1719
1720         PR c++/47851
1721         * call.c (standard_conversion): Provide requested cv-quals on
1722         class rvalue conversion.
1723
1724         PR c++/46282
1725         * decl2.c (grokbitfield): Handle type-dependent width.
1726
1727 2011-02-28  Jason Merrill  <jason@redhat.com>
1728
1729         PR c++/47873
1730         * class.c (update_vtable_entry_for_fn): Check BINFO_LOST_PRIMARY_P
1731         after checking for a non-thunk.
1732
1733 2011-02-26  Jason Merrill  <jason@redhat.com>
1734
1735         PR c++/47904
1736         * tree.c (cp_tree_equal): Compare DECL_PARM_LEVEL.
1737         * pt.c (iterative_hash_template_arg): And hash it.
1738
1739         PR c++/47897
1740         * semantics.c (non_const_var_error): Split out from...
1741         (cxx_eval_constant_expression): ...here.
1742         (potential_constant_expression_1) [VAR_DECL]: Use it.
1743         Allow dependent variables.
1744
1745 2011-02-24  Jason Merrill  <jason@redhat.com>
1746
1747         * parser.c (cp_parser_constant_expression): Set
1748         non_integral_constant_expression correctly for C++0x too.
1749         (cp_parser_static_assert): Allow non-constant expression.
1750         (cp_parser_direct_declarator): Expect non_constant_p to be set
1751         properly for C++0x.
1752         * pt.c (value_dependent_expression_p): Handle TYPEID_EXPR.
1753         * semantics.c (maybe_constant_value): Check type_unknown_p too.
1754         (potential_rvalue_constant_expression): New.
1755         (require_potential_rvalue_constant_expression): New.
1756
1757 2011-02-23  Jason Merrill  <jason@redhat.com>
1758
1759         * cp-tree.h (DECL_PARM_LEVEL): New.
1760         (struct lang_decl_parm): Add level field.
1761         * name-lookup.c (function_parm_depth): New fn.
1762         * name-lookup.h: Declare it.
1763         * parser.c (cp_parser_parameter_declaration_list): Use it.
1764         * mangle.c (struct globals): Add parm_depth field.
1765         (write_bare_function_type): Adjust it.
1766         (write_expression): Include the level delta in PARM_DECL mangling
1767         for abi >= 6.
1768
1769         * semantics.c (finish_decltype_type): Remove shortcut for decltype
1770         of id-expression.
1771         * mangle.c (write_type) [DECLTYPE_TYPE]: Strip it here for abi < 6.
1772
1773 2011-02-23  Nathan Froyd  <froydnj@codesourcery.com>
1774
1775         PR c++/46868
1776         * parser.c (cp_parser_class_specifier): Require a closing brace
1777         to attempt error recovery.
1778
1779 2011-02-23  Jakub Jelinek  <jakub@redhat.com>
1780
1781         PR c++/47833
1782         * pt.c (struct pending_template): Add chain_next GTY option.
1783         * decl.c (struct named_label_use_entry): Likewise.
1784
1785 2011-02-22  Paolo Carlini  <paolo.carlini@oracle.com>
1786
1787         PR c++/47242
1788         * semantics.c (build_lambda_object): Bail out if a field is
1789         error_mark_node.
1790
1791 2011-02-22  Dodji Seketeli  <dodji@redhat.com>
1792
1793         PR c++/47666
1794         * class.c (dfs_declare_virt_assop_and_dtor)
1795         (declare_virt_assop_and_dtor): New static functions.
1796         (add_implicitly_declared_members): Use
1797         declare_virt_assop_and_dtor.
1798
1799 2011-02-21  Jason Merrill  <jason@redhat.com>
1800
1801         PR c++/47207
1802         * decl2.c (decl_constant_var_p): A constexpr var needs an
1803         initializer to be constant.
1804         * semantics.c (cxx_eval_constant_expression): Complain about
1805         constexpr var used in its own initializer.
1806         * call.c (set_up_extended_ref_temp): Set
1807         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P too.
1808
1809 2011-02-20  Jason Merrill  <jason@redhat.com>
1810
1811         PR c++/47199
1812         * semantics.c (cxx_eval_call_expression): Call
1813         cxx_eval_constant_expression in trivial shortcut.
1814
1815         PR c++/46831
1816         * call.c (convert_class_to_reference): Don't try to set up a
1817         second conv sequence for non-viable candidates.
1818
1819         PR c++/47703
1820         * error.c (location_of): Handle non-tagged types.
1821
1822         PR c++/46472
1823         * method.c (process_subob_fn): Instantiate constexpr templates.
1824         * optimize.c (maybe_clone_body): Propagate DECL_DECLARED_CONSTEXPR_P.
1825
1826 2011-02-20  Dodji Seketeli  <dodji@redhat.com>
1827
1828         PR c++/46394
1829         * pt.c (tsubst_pack_expansion): do not use
1830         cp_tree_equal/same_type_p to detect an expansion of a parameter
1831         pack.
1832
1833 2011-02-19  Jason Merrill  <jason@redhat.com>
1834
1835         PR c++/47503
1836         * semantics.c (cxx_eval_call_expression): Shortcut trivial copy.
1837
1838 2011-02-18  Paolo Carlini  <paolo.carlini@oracle.com>
1839
1840         PR c++/47795
1841         * semantics.c (finish_non_static_data_member): Early return if
1842         object is error_mark_node.
1843
1844 2011-02-18  Dodji Seketeli  <dodji@redhat.com>
1845
1846         PR c++/47208
1847         * pt.c (do_auto_deduction): Do not mention error_mark_node in
1848         diagnostics.
1849         * semantics.c (finish_id_expression): Do not pass erroneous decl
1850         to decl_constant_var_p.
1851
1852 2011-02-17  Jakub Jelinek  <jakub@redhat.com>
1853
1854         PR c++/47783
1855         * cvt.c (convert_from_reference): Call mark_exp_read.
1856
1857 2011-02-11  Dodji Seketeli  <dodji@redhat.com>
1858
1859         PR c++/47172
1860         * pt.c (finish_call_expr): Consider a call expression that has a
1861         dependent "this" pointer as being dependent.  Add comments.
1862         (dependent_type_p, type_dependent_expression_p): Update comments.
1863
1864 2011-02-16  Dodji Seketeli  <dodji@redhat.com>
1865
1866         PR c++/47326
1867         * pt.c (tsubst_copy)<case SIZEOF_EXPR>: Ensure that even pack
1868         expansion arguments are not evaluated.
1869
1870 2011-02-16  Jakub Jelinek  <jakub@redhat.com>
1871
1872         PR c++/47704
1873         * cp-tree.h (ENUM_FIXED_UNDERLYING_TYPE_P): Use TYPE_LANG_FLAG_5
1874         instead of TYPE_LANG_FLAG_3.
1875         * pt.c (lookup_template_class): Copy over
1876         ENUM_FIXED_UNDERLYING_TYPE_P.
1877
1878 2011-02-15  Jason Merrill  <jason@redhat.com>
1879
1880         PR c++/46807
1881         * method.c (synthesized_method_walk): Always exit early for
1882         trivial fn in C++98 mode.
1883
1884 2011-02-14  Jason Merrill  <jason@redhat.com>
1885
1886         PR c++/47482
1887         * parser.c (cp_parser_enumerator_definition): Call
1888         fold_non_dependent_expr.
1889
1890 2011-02-09  Jason Merrill  <jason@redhat.com>
1891
1892         * decl.c (cp_make_fname_decl): Set DECL_THIS_STATIC at toplevel.
1893         * semantics.c (finish_fname): Only return the name if we're in
1894         a function.
1895
1896         * decl.c (build_enumerator): Don't perform integral promotions on
1897         non-integral constants.
1898
1899         * cvt.c (convert_to_void): Handle null op1.
1900
1901         * class.c (type_has_constexpr_default_constructor): Make sure the
1902         caller stripped an enclosing array.
1903         * init.c (perform_member_init): Strip arrays before calling it.
1904
1905         PR c++/47511
1906         * semantics.c (potential_constant_expression_1): Handle TEMPLATE_DECL.
1907
1908 2011-02-03  Dodji Seketeli  <dodji@redhat.com>
1909
1910         PR c++/47398
1911         * tree.c (cp_tree_equal)<TEMPLATE_PARM_INDEX>: Take the number of
1912         template parameters in account.
1913
1914 2011-02-03  Nathan Froyd  <froydnj@codesourcery.com>
1915
1916         PR c++/46890
1917         * parser.c (cp_parser_class_specifier): Fix setting of
1918         want_semicolon.
1919
1920 2011-01-31  Jakub Jelinek  <jakub@redhat.com>
1921
1922         PR c++/47416
1923         * semantics.c (build_data_member_initialization): Handle
1924         STATEMENT_LIST always instead of just for CLEANUP_BODY.
1925
1926 2011-01-31  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1927
1928         * g++spec.c (lang_specific_driver) [HAVE_LD_STATIC_DYNAMIC] Use
1929         LD_STATIC_OPTION, LD_DYNAMIC_OPTION.
1930
1931 2011-01-29  Dodji Seketeli  <dodji@redhat.com>
1932
1933         PR c++/47311
1934         * cp-tree.h (fixup_template_parms): Declare.
1935         * pt.c (end_template_parm_list): Do not fixup template parms here.
1936         (fixup_template_parms): Remove static. Fix typo in the
1937         comments. Remove useless code statement.
1938         (fixup_template_parm): For a template template parameter, fixup
1939         its attributes before fixing up its type.
1940         * parser.c
1941         (cp_parser_template_declaration_after_export): After parsing
1942         template parameters fixup their types.
1943
1944 2011-01-26  Jakub Jelinek  <jakub@redhat.com>
1945
1946         PR c++/47476
1947         * semantics.c (potential_constant_expression_1): Handle
1948         TRUTH_XOR_EXPR.
1949
1950 2011-01-26  Dave Korn  <dave.korn.cygwin@gmail.com>
1951
1952         PR c++/43601
1953         * semantics.c (expand_or_defer_fn_1): Handle it.
1954         * decl2.c (decl_needed_p): Likewise.
1955
1956 2011-01-21  Jason Merrill  <jason@redhat.com>
1957
1958         PR c++/47041
1959         * semantics.c (build_constexpr_constructor_member_initializers):
1960         Handle trivial copy.
1961
1962 2011-01-21  Jakub Jelinek  <jakub@redhat.com>
1963
1964         PR c++/47388
1965         * semantics.c (begin_for_stmt): If -fno-for-scope, don't
1966         assume init must be NULL if scope is NULL.
1967         (begin_range_for_stmt): Likewise.
1968
1969 2011-01-21  Jason Merrill  <jason@redhat.com>
1970
1971         PR c++/46552
1972         * semantics.c (cxx_eval_constant_expression): Handle OFFSET_REF.
1973
1974         PR c++/46977
1975         * semantics.c (potential_constant_expression_1): Split out from
1976         potential_constant_expression.  Add want_rval parm.  Handle
1977         template expression forms.  Don't enforce restriction on address
1978         of automatic variable here.  Add a couple of diagnostics that
1979         had been missing.
1980         (require_potential_constant_expression): New entry point.
1981         (build_data_member_initialization, register_constexpr_fundef): Adjust.
1982         (maybe_constant_value): Check potential_constant_expression.
1983         * pt.c (fold_non_dependent_expr_sfinae): Likewise.
1984         * tree.c (build_vec_init_expr): Adjust.
1985
1986 2011-01-19  Jakub Jelinek  <jakub@redhat.com>
1987
1988         PR c++/47303
1989         * decl2.c (finish_anon_union): Only call mangle_decl if TREE_STATIC
1990         or DECL_EXTERNAL.
1991
1992 2011-01-17  Jason Merrill  <jason@redhat.com>
1993
1994         PR c++/47067
1995         * semantics.c (base_field_constructor_elt): New fn.
1996         (cxx_eval_bare_aggregate): Use it.
1997         (build_data_member_initialization): Leave COMPONENT_REF for
1998         vfield inits.
1999
2000 2011-01-14  Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
2001
2002         * parser.c (cp_parser_range_for): Remove the "unused variable" warning
2003         workaround.
2004
2005 2011-01-15  Giovanni Funchal  <gafunchal@gmail.com>
2006             Jonathan Wakely  <jwakely.gcc@gmail.com>
2007
2008         PR c++/33558
2009         * decl.c (grokdeclarator): Reject mutable reference members.
2010
2011 2011-01-14  Jason Merrill  <jason@redhat.com>
2012
2013         PR c++/47289
2014         * pt.c (coerce_template_parms): Fix error recovery.
2015
2016         PR c++/46903
2017         * typeck2.c (check_narrowing): Only check arithmetic types.
2018
2019         PR c++/46688
2020         * tree.c (build_vec_init_expr): Handle flexible array
2021         properly.
2022
2023 2011-01-13  Kai Tietz  <kai.tietz@onevision.com>
2024
2025         PR c++/47213
2026         * cp-tree.h (CLASSTYPE_VISIBILITY): Use
2027         TYPE_MAIN_DECL instead of TYPE_NAME.
2028         (CLASSTYPE_VISIBILITY_SPECIFIED): Likewise.
2029         * decl2.c (determine_visibility): Add check
2030         of CLASS_TYPE_P for underlying_type.
2031
2032 2011-01-12  Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
2033
2034         * cp-tree.h (begin_for_scope): New prototype.
2035         (begin_for_stmt): Update prototype.
2036         (begin_range_for_stmt): Update prototype.
2037         * init.c (build_vec_init): Update call to begin_for_stmt.
2038         * parser.c (cp_parser_for): New.
2039         (cp_parser_c_for): Add three new parameters.
2040         (cp_parser_range_for): Likewise. Most parsing code removed.
2041         (cp_parser_iteration_statement): Call cp_parser_for instead of
2042         cp_parser_c_for and cp_parser_range_for.
2043         (cp_parser_for_init_statement): Add new parameter and return type.
2044         (cp_parser_block_declaration): Update call to
2045         cp_parser_simple_declaration.
2046         (cp_parser_simple_declaration): Add new parameter.
2047         Update call to cp_parser_init_declarator.
2048         (cp_parser_init_declarator): Add new parameter.
2049         * pt.c (tsubst_expr): Update call to begin_for_stmt.
2050         * semantics.c (begin_for_scope): New.
2051         (begin_for_stmt): Add two new parameters.
2052         (begin_range_for_stmt): Likewise.
2053
2054 2011-01-12  Nicola Pero  <nicola.pero@meta-innovation.com>
2055
2056         * parser.c (cp_parser_objc_at_property_declaration): Improved
2057         error message.
2058
2059 2011-01-11  Dodji Seketeli  <dodji@redhat.com>
2060
2061         PR debug/46955
2062         * cp-lang.c (get_template_innermost_arguments_folded)
2063         (get_template_argument_pack_elems_folded)
2064         (template_arg_needs_folding, fold_cplus_constants): New static
2065         functions.
2066         (LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS): Set this hook to
2067         get_template_innermost_arguments_folded.
2068         (LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS): Set this hook to
2069         get_template_argument_pack_elems_folded.
2070
2071 2011-01-11  Jason Merrill  <jason@redhat.com>
2072
2073         PR c++/46658
2074         * init.c (build_new_1): Handle value-init in templates differently.
2075
2076         PR c++/45520
2077         * tree.c (maybe_dummy_object): Check current_class_ref against
2078         context, not current_class_type.
2079
2080 2011-01-08  Nicola Pero  <nicola.pero@meta-innovation.com>
2081
2082         PR objc/47078
2083         * parser.c (cp_parser_objc_typename): If the type is unknown, for
2084         error recovery purposes behave as if it was not specified so that
2085         the default type is used.
2086
2087 2011-01-07  Jakub Jelinek  <jakub@redhat.com>
2088
2089         PR c++/47022
2090         * pt.c (tsubst_copy_and_build): Use tsubst instead of tsubst_copy
2091         for the second build_x_va_arg argument.
2092
2093 2011-01-05  Tom Tromey  <tromey@redhat.com>
2094
2095         * typeck.c (cp_build_addr_expr_1): Update call to lvalue_error.
2096         (lvalue_or_else): Likewise.
2097
2098 2011-01-01  Kai Tietz  <kai.tietz@onevision.com>
2099
2100         PR target/38662
2101         * tree.c (cxx_type_hash_eq):
2102         Allow METHOD_TYPE, too.
2103
2104 \f
2105 Copyright (C) 2011 Free Software Foundation, Inc.
2106
2107 Copying and distribution of this file, with or without modification,
2108 are permitted in any medium without royalty provided the copyright
2109 notice and this notice are preserved.