OSDN Git Service

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