OSDN Git Service

2009-07-29 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2009-07-29  Richard Guenther  <rguenther@suse.de>
2
3         PR c++/40834
4         * cp-gimplify.c (cp_genericize_r): Properly walk the BIND_EXPR
5         vars.
6
7 2009-07-26  Simon Martin  <simartin@users.sourceforge.net>
8
9         PR c++/40749
10         * decl.c (grokdeclarator): Do not set TREE_NO_WARNING for functions
11         with a qualified return type.
12
13 2009-07-24  Jason Merrill  <jason@redhat.com>
14
15         Core issue 901
16         * call.c (build_op_delete_call): If this is for a new-expression
17         and the op delete is deleted, do nothing.
18
19         Core issue 702
20         * call.c (compare_ics): Give list-initialization of std::init_list
21         priority over conversion to scalar, too.
22
23 2009-07-22  Jason Merrill  <jason@redhat.com>
24
25         * mangle.c (mangle_type_string_for_rtti): Rename to be clearer.
26         (needs_fake_anon): New.
27         (write_name): Check it.
28         (write_nested_name): Add a fake anonymous namespace scope if true.
29         * name-lookup.c (get_anonymous_namespace_name): No longer static.
30         * rtti.c, cp-tree.h: Adjust.
31
32 2009-07-22  Richard Guenther  <rguenther@suse.de>
33
34         PR c++/40799
35         * cp-gimplify.c (cp_gimplify_expr): Move handling of using
36         related exprs to ...
37         (cp_genericize_r): ... genericization stage.
38         (cp_genericize): Adjust.
39
40 2009-07-21  Jason Merrill  <jason@redhat.com>
41
42         Core issue 934
43         * call.c (reference_binding): Implement binding to { }.
44         (initialize_reference): Binding temporary to non-const && is fine.
45         * decl.c (grok_reference_init): Remove error for CONSTRUCTOR.
46
47         * decl.c (reshape_init_r): { T } is not an aggregate initializer
48         for class T.
49
50 2009-07-17  Richard Guenther  <rguenther@suse.de>
51
52         PR c/40401
53         * decl.c (finish_function): Do not emit unused result warnings
54         from here.
55         * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use
56         c_warn_unused_result_pass.
57         * semantics.c (expand_or_defer_fn): Adjust assertion about IL status.
58         * optimize.c (clone_body): Clone in GENERIC.
59         (maybe_clone_body): Do not clear DECL_SAVED_TREE.
60         * decl2.c (cp_write_global_declarations): Fix body test.
61         Do not call cgraph_optimize.
62         * Make-lang.in (optimize.o): Add tree-iterator.h dependency.
63         * method.c (use_thunk): Register thunk with
64         cgraph_finalize_function.
65         * error.c (function_category): Guard access of DECL_LANG_SPECIFIC.
66
67 2009-07-17  Richard Guenther  <rguenther@suse.de>
68
69         * init.c (build_vec_delete_1): Do not set DECL_REGISTER on the
70         temporary pointer.
71
72 2009-07-17  Aldy Hernandez  <aldyh@redhat.com>
73             Manuel López-Ibáñez  <manu@gcc.gnu.org>
74
75         PR 40435 
76         * typeck.c, init.c, class.c, method.c, rtti.c, except.c, error.c,
77         tree.c, cp-gimplify.c, cxx-pretty-print.c, pt.c, semantics.c,
78         call.c, cvt.c, mangle.c: Add location argument to
79         fold_{unary,binary,ternary}, fold_build[123], build_call_expr,
80         build_size_arg, build_fold_addr_expr, build_call_array,
81         non_lvalue, size_diffop, fold_build1_initializer,
82         fold_build2_initializer, fold_build3_initializer,
83         fold_build_call_array, fold_build_call_array_initializer,
84         fold_single_bit_test, omit_one_operand, omit_two_operands,
85         invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref,
86         fold_indirect_ref, combine_comparisons, fold_builtin_*,
87         fold_call_expr, build_range_check, maybe_fold_offset_to_address,
88         round_up, round_down.
89
90 2009-07-16  Jason Merrill  <jason@redhat.com>
91
92         PR libstdc++/37907
93         Split POD into "standard-layout" and "trivial" as per N2230,
94         Support std::is_standard_layout and std::is_trivial traits.
95         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_STD_LAYOUT,
96         CPTK_IS_TRIVIAL.
97         (struct lang_type_class): Add non_std_layout.
98         (CLASSTYPE_NON_STD_LAYOUT): New.
99         * class.c (check_bases): Set it.
100         (check_field_decls): Likewise.
101         (check_bases_and_members): Likewise.
102         * parser.c (cp_parser_primary_expression): Handle RID_IS_STD_LAYOUT,
103         RID_IS_TRIVIAL.
104         (cp_parser_trait_expr): Likewise.
105         * semantics.c (trait_expr_value): Handle CPTK_IS_STD_LAYOUT,
106         CPTK_IS_TRIVIAL.
107         (finish_trait_expr): Likewise.
108         * tree.c (scalarish_type_p, trivial_type_p, std_layout_type_p): New.
109         (pod_type_p): Use them.
110         (type_has_nontrivial_copy_init, type_has_nontrivial_default_init): New.
111
112         Adjust bits of the language that no longer refer to POD types.
113         * call.c (convert_arg_to_ellipsis): Use type_has_nontrivial_copy_init
114         and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
115         (build_x_va_arg): Likewise.
116         (call_builtin_trap): Remove.
117         * decl.c (declare_local_label): Use type_has_nontrivial_default_init
118         and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
119         (cp_finish_decl): Likewise.
120         (check_previous_goto_1, check_goto): Adjust error.
121         * typeck.c (build_class_member_access_expr): Check
122         CLASSTYPE_NON_STD_LAYOUT rather than CLASSTYPE_NON_POD_P.
123
124 2009-07-14  Taras Glek  <tglek@mozilla.com>
125             Rafael Espindola  <espindola@google.com>
126
127         * Make-lang.in: Added CP_PLUGIN_HEADERS and
128         c.install-target to export cp-tree.h cxx-pretty-print.h
129         name-lookup.h headers for plugins.
130
131 2009-07-14  Jason Merrill  <jason@redhat.com>
132
133         PR c++/37276
134         * decl.c (decls_match): A non-extern-C declaration doesn't match
135         a builtin extern-C declaration.
136
137         PR c++/40746
138         * name-lookup.c (qualified_lookup_using_namespace): Don't stop
139         looking in used namespaces just because we found something on
140         another branch.
141
142         PR c++/40740
143         * semantics.c (perform_koenig_lookup): Handle empty template args.
144
145         * call.c (build_over_call): Use can_trust_pointer_alignment.
146
147 2009-07-14  Dodji Seketeli  <dodji@redhat.com>
148
149         PR debug/40705
150         PR c++/403057
151         * decl2.c (grokfield): Don't call set_underlying_type on typedef
152         decls that are type names.
153
154 2009-07-13  Andrew Pinski  <andrew_pinski@playstation.sony.com>
155
156         PR C++/22154
157         * parser.c (cp_parser_elaborated_type_specifier): Accept typename in
158         front of qualified names.
159
160 2009-07-12  Jason Merrill  <jason@redhat.com>
161
162         PR c++/36628
163         * tree.c (rvalue): Use lvalue_or_rvalue_with_address_p.
164
165         PR c++/37206
166         * cp-tree.h (enum cp_lvalue_kind_flags): Add clk_rvalueref.
167         * tree.c (lvalue_p_1): Return it.  Remove
168         treat_class_rvalues_as_lvalues parm.
169         (real_lvalue_p): Disallow pseudo-lvalues here.
170         (lvalue_or_rvalue_with_address_p): New fn.
171         * call.c (initialize_reference): Use it instead of real_lvalue_p.
172
173         PR c++/40689
174         * init.c (build_new_1): Handle initializer list as array initializer.
175         (build_vec_init): Likewise.
176         * typeck.c (cp_build_modify_expr): Likewise.
177         * typeck2.c (process_init_constructor_array): Error rather than abort
178         if too many initializers.
179
180 2009-07-10  Jakub Jelinek  <jakub@redhat.com>
181
182         PR c++/40502
183         * error.c (cp_print_error_function): Check for NULL block.
184
185 2008-07-09  Simon Martin  <simartin@users.sourceforge.net>
186             Jason Merrill  <jason@redhat.com>
187
188         * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
189         append_type_to_template_for_access_check_1): Use CLASS_TYPE_P.
190
191 2009-07-09  Dodji Seketeli  <dodji@redhat.com>
192
193         PR c++/40684
194         * pt.c (type_unification_real): Use tsubst_template_arg instead
195         of tsubst to substitute default template arguments.
196
197 2009-07-08  Manuel López-Ibáñez  <manu@gcc.gnu.org>
198
199         PR c++/31246
200         * init.c (build_new_1): Set TREE_NO_WARNING for compiler-generated
201         code.
202         * cp-gimplify.c (genericize_eh_spec_block): Likewise.
203         
204
205 2009-07-07  Jason Merrill  <jason@redhat.com>
206
207         PR c++/35828
208         * pt.c (tsubst_decl): Don't abort if we didn't change anything
209         in a TEMPLATE_DECL's args.
210
211 2009-07-07  Manuel López-Ibáñez  <manu@gcc.gnu.org>
212
213         * semantics.c (finalize_nrv_r): Replace EXPR_LOCUS by
214         EXPR_LOCATION.
215         
216 2009-07-07  Jason Merrill  <jason@redhat.com>
217
218         PR c++/37816
219         * decl.c (build_enumerator): Don't add enumerators for a
220         scoped enum to the enclosing class.
221
222         PR c++/40639
223         * decl.c (start_enum): Allow dependent underlying type.
224
225         PR c++/40633
226         * decl.c (finish_enum): Finish scope even in a template.
227
228 2009-07-07  Manuel López-Ibáñez  <manu@gcc.gnu.org>
229
230         * init.c: Replace %J by an explicit location. Update all calls.
231         * decl.c: Likewise.
232         * typeck2.c: Likewise.
233         * pt.c: Likewise.
234         * name-lookup.c: Likewise.
235         
236 2009-07-06  Manuel López-Ibáñez  <manu@gcc.gnu.org>
237
238         * decl.c: Replace %H by an explicit location. Update all calls.
239         * except.c: Likewise.
240         * semantics.c: Likewise.
241         * parser.c: Likewise.
242
243 2009-07-06  Simon Martin  <simartin@users.sourceforge.net>
244
245         PR c++/40557
246         * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
247         append_type_to_template_for_access_check_1): Use
248         RECORD_OR_UNION_CODE_P.
249
250 2009-07-04  Jason Merrill  <jason@redhat.com>
251
252         * pt.c (retrieve_specialization): Don't get confused by a
253         using-declaration that brings in another instance of this template
254         from a base class.
255
256         * ptree.c (cxx_print_type): Fix logic.
257
258         * cp-tree.h (LANG_DECL_FN_CHECK): Fix non-checking version.
259
260         PR c++/40619
261         * cp-tree.h (struct lang_decl_parm): New.
262         (struct lang_decl): Add it.
263         (LANG_DECL_PARM_CHECK): New.
264         (DECL_PARM_INDEX): New.
265         * decl2.c (parm_index): Remove.
266         * lex.c (retrofit_lang_decl): Handle parms.
267         (cxx_dup_lang_specific_decl): Likewise.
268         * mangle.c (write_expression): Adjust.
269         * tree.c (cp_tree_equal): Adjust.
270         (decl_linkage): Only check DECL_COMDAT for functions and variables.
271         * parser.c (cp_parser_parameter_declaration_list): Set
272         DECL_PARM_INDEX.
273         * pt.c (iterative_hash_template_arg): Hash it.
274
275 2009-07-03  Jason Merrill  <jason@redhat.com>
276
277         * cp-tree.h (struct lang_decl): Overhaul.
278         (struct lang_decl_flags): Remove.
279         (struct lang_decl_base): New.
280         (struct lang_decl_min): New.
281         (struct lang_decl_fn): New.
282         (struct lang_decl_ns): New.
283         (CAN_HAVE_FULL_LANG_DECL_P): Replace with LANG_DECL_HAS_MIN.
284         (LANG_DECL_MIN_CHECK): New.
285         (LANG_DECL_FN_CHECK): New.
286         (LANG_DECL_NS_CHECK): New.
287         (STRIP_TEMPLATE): New.
288         (NON_THUNK_FUNCTION_CHECK): Remove.
289         (DECL_DECLARES_FUNCTION_P): New.
290         (lots): Adjust.
291         * lex.c (retrofit_lang_decl, cxx_dup_lang_specific_decl): Adjust.
292         * decl.c (push_local_name, duplicate_decls): Adjust.
293         * decl2.c (start_objects): Don't set u2sel.
294         * semantics.c (finish_omp_threadprivate): Adjust.
295         * class.c (build_clone): Don't do much on TEMPLATE_DECLs.
296         (decl_cloned_function_p): Out-of-line implementation of macros.
297         (clone_function_decl, adjust_clone_args): Use DECL_CLONED_FUNCTION_P.
298         * mangle.c (write_unqualified_name): Don't check function flags
299         on non-functions.
300         * method.c (make_alias_for): Don't set DECL_CLONED_FUNCTION.
301         * pt.c (build_template_decl): Don't set function flags.
302         (check_default_tmpl_args): Check that it's a function.
303         (instantiate_template): Use DECL_ABSTRACT_ORIGIN to find the
304         cloned template.
305
306         * pt.c (tsubst_decl) [FUNCTION_DECL]: Don't tsubst
307         DECL_CLONED_FUNCTION.
308
309         * cp-tree.h (struct lang_type_class): Move sorted_fields here.
310         * class.c (finish_struct_1): Adjust.
311         * ptree.c (cxx_print_decl, cxx_print_type): Adjust.
312         * search.c (lookup_field_1): Adjust.
313
314         * cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Remove.
315         * decl.c (finish_method): Don't add to it.
316         * class.c (fixup_pending_inline): Remove.
317         (fixup_inline_methods): Remove.
318         (finish_struct_1): Don't call it.
319
320         * error.c (dump_function_name): Handle null name.
321
322 2009-07-02  Mark Mitchell  <mark@codesourcery.com>
323
324         * typeck.c (cp_build_binary_op): Move warnings about use of NULL
325         in arithmetic earlier and allow comparisions of NULL with
326         pointers-to-members.
327
328 2009-07-02  Jason Merrill  <jason@redhat.com>
329
330         Use hash tables for template specialization lookup.
331         * pt.c (struct spec_entry): New type.
332         (decl_specializations, type_specializations): New hash tables.
333         (register_specialization, retrieve_specialization): Use them.
334         (reregister_specialization, lookup_template_class): Use them.
335         (eq_specializations, hash_tmpl_and_args, hash_specialization): New.
336         (iterative_hash_template_arg): New.
337         (init_template_processing): New
338         (process_partial_specialization): Don't look to see if we already
339         have this partial specialization.
340         (maybe_process_partial_specialization): Handle reassigning
341         full specializations when we get an explicit specialization
342         of the partial instantiation.
343         (tsubst_friend_function): Adjust specialization reassignment code.
344         (instantiate_template): Only do one lookup.
345         (instantiate_decl): Don't do any lookup.
346         * cp-tree.h: Declare init_template_processing.
347         * decl.c (duplicate_decls): Pass args to reregister_specialization.
348
349 2009-07-01  Jason Merrill  <jason@redhat.com>
350
351         * cp-tree.h (DECL_CLASS_TEMPLATE_P): Use DECL_IMPLICIT_TYPEDEF_P.
352
353         * pt.c (register_specialization): Use duplicate_decls to merge
354         the argument with a previous specialization.
355         (check_explicit_specialization): Call register_specialization to
356         merge the TEMPLATE_DECL with a previous version.
357         (determine_specialization): Return the args even if fn is a template.
358
359 2009-07-01  Ian Lance Taylor  <iant@google.com>
360
361         * g++spec.c (lang_specific_driver): Bump num_args by 1.
362
363 2009-06-30  Jason Merrill  <jason@redhat.com>
364
365         PR c++/40595
366         * pt.c (tsubst_pack_expansion): Handle unexpanded packs in an
367         EXPR_PACK_EXPANSION.
368
369 2009-06-29  Jason Merrill  <jason@redhat.com>
370
371         PR c++/40274
372         * error.c (dump_template_parms): Pass all args to
373         count_non_default_template_args.
374         (count_non_default_template_args): Pull out the inner ones.
375
376 2009-06-26  H.J. Lu  <hongjiu.lu@intel.com>
377
378         * decl.c (duplicate_decls): Re-indent.
379
380 2009-06-25  Ian Lance Taylor  <iant@google.com>
381
382         * call.c (avoid_sign_compare_warnings): New static function.
383         (build_new_op): Call it.
384         * typeck.c (cp_build_binary_op): Don't call warn_sign_compare if
385         TREE_NO_WARNING is set on either operand.
386
387 2009-06-25  Ian Lance Taylor  <iant@google.com>
388
389         * g++spec.c (SKIPOPT): define.
390         (lang_specific_driver): Handle -static-libstdc++.  Only add
391         LIBSTDCXX_STATIC if we add LIBSTDCXX.
392
393 2009-06-25  Ian Lance Taylor  <iant@google.com>
394
395         * cvt.c (convert_to_void): Only warn about COND_EXPR if neither
396         the second nor third operand has side effects.
397
398 2009-06-25  Ian Lance Taylor  <iant@google.com>
399
400         * parser.c (cp_parser_binary_expression): Increment
401         c_inhibit_evaluation_warnings while parsing the right hand side of
402         "true || x" or "false && x".
403         * typeck.c (cp_build_binary_op): Only call warn_for_sign_compare
404         if c_inhibit_evaluation_warnings is zero.
405
406 2009-06-24  Jason Merrill  <jason@redhat.com>
407
408         * error.c (dump_decl): Do say "typedef" for the injected class name.
409
410         * pt.c (lookup_template_class): Use currently_open_class,
411         compare template args later.
412
413         PR c++/40342
414         * decl.c (decls_match): Check DECL_TI_TEMPLATE too.
415         * class.c (resolve_address_of_overloaded_function): Fix typo.
416
417 2009-06-18  Aldy Hernandez  <aldyh@redhat.com>
418
419         * class.c (get_vtable_decl): Replace finish_decl with cp_finish_decl.
420         * decl.c (finish_decl): Remove.
421         (declare_global_var): Replace finish_decl with cp_finish_decl.
422         (start_method): Same.
423         * rtti.c (emit_tinfo_decl): Same.
424         * pt.c (tsubst_expr): Same.
425         (instantiate_decl): Same.
426         * decl2.c (grokbitfield): Same.
427         * name-lookup.c (pushdecl_top_level_1): Same.
428         * cp-tree.h: Remove finish_decl.
429
430 2009-06-16  David Edelsohn  <edelsohn@gnu.org>
431
432         * g++-spec.c (LIBSTDCXX_STATIC): Default to NULL.
433         (lang_specific_driver): Always allocate extra argument.
434         Add LIBSTDCXX_STATIC to arglist if defined and linking
435         statically.
436
437 2009-06-16  Ian Lance Taylor  <iant@google.com>
438
439         * Make-lang.in (cp/class.o): Depend upon gt-cp-class.h.
440         (cp/semantics.o): Depend upon gt-cp-semantics.h.
441
442 2009-06-16  Ian Lance Taylor  <iant@google.com>
443
444         * parser.c (cp_unevaluated_operand): Define global variable.
445         (cp_parser_question_colon_clause): Increment
446         c_inhibit_evaluation_warnings when evaluating an expression which
447         will never be executed.
448         (cp_parser_decltype): Increment cp_unevaluated_operand and
449         c_inhibit_evaluation_warnings, not skip_evaluation.
450         (cp_parser_sizeof_operand): Likewise.
451         (cp_parser_enclosed_template_argument_list): Save
452         cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
453         skip_evaluation.
454         * cp-tree.h (struct saved_scope): Remove skip_evaluation field.
455         Add unevaluated_operand and inhibit_evaluation_warnings fields.
456         (cp_unevaluated_operand): Declare.
457         * name-lookup.c (push_to_top_level): Save cp_unevaluated_operand
458         and c_inhibit_evaluation_warnings rather than skip_evaluation.
459         (pop_from_top_level): Restore cp_unevaluated_operand and
460         c_inhibit_evaluation_warnings rather than skip_evaluation.
461         * class.c (build_base_path): Check cp_unevaluated_operand rather
462         than skip_evaluation.
463         * typeck.c (build_class_member_access_expr): Likewise.
464         (cp_build_binary_op): Don't warn about bad shift counts if
465         c_inhibit_evaluation_warnings is non-zero.
466         * pt.c (coerce_template_parms): Save state of
467         cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
468         skip_evaluation.
469         (tsubst_aggr_type): Likewise.
470         (tsubst_pack_expansion): Check cp_unevaluated_operand rather than
471         skip_evaluation.
472         (tsubst_copy): Likewise.
473         (tsubst): Set cp_unevaluated_operand and
474         c_inhibit_evaluation_warnings, not skip_evaluation.
475         (tsubst_copy_and_build): Likewise.
476         * call.c (convert_arg_to_ellipsis): Check cp_unevaluated_operand
477         rather than skip_evaluation.
478         * decl2.c (mark_used): Likewise.
479         * semantics.c (finish_non_static_data_member): Likewise.
480         * cvt.c (cp_convert_and_check): Check
481         c_inhibit_evaluation_warnings rather than skip_evaluation.
482         * mangle.c (write_type): Set cp_unevaluated_operand rather than
483         skip_evaluation.
484
485 2009-06-15  Ian Lance Taylor  <iant@google.com>
486
487         * parser.c (cp_parser_direct_declarator): Add braces around
488         variables declared before label.
489
490 2009-06-15  Rafael Avila de Espindola  <espindola@google.com>
491
492         * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Remove.
493         * cp-tree.h (cxx_comdat_group): Change signature.
494         * decl.c (duplicate_decls): Use DECL_COMDAT_GROUP.
495         (cxx_comdat_group): Change signature.
496         * decl2.c (comdat_linkage, maybe_make_one_only): Update call to
497         make_decl_one_only.
498         (constrain_visibility, get_guard): Use DECL_COMDAT_GROUP.
499         * method.c (use_thunk): Update call to make_decl_one_only.
500         * optimize.c (maybe_clone_body): Use DECL_COMDAT_GROUP
501
502 2009-06-12  Aldy Hernandez  <aldyh@redhat.com>
503
504         * typeck.c (cp_build_binary_op): Pass location to overflow_warning.
505         (build_modify_expr): New arg.
506         * semantics.c (finish_unary_op_expr): Pass location to
507         overflow_warning.
508         (handle_omp_for_class_iterator): Pass location to build_modify_expr.
509         * typeck.c (cxx_sizeof_or_alignof_type): Pass location to
510         c_sizeof_or_alignof_type.
511         (build_array_ref): New argument.
512         (build_compound_expr): Same.
513         (build_const_cast): Same.
514         (build_ptrmemfunc): Pass location to build_c_cast.
515         * init.c (avoid_placement_new_aliasing): Pass location to
516         build_stmt.
517         (build_vec_delete_1): Pass location to cp_build_modify_expr,
518         build_compound_expr.
519         * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
520         * decl.c (poplevel): Pass location to c_build_bind_expr.
521         (finish_case_label): Pass location to build_case_label.
522         (finish_constructor_body): Same.
523         (finish_destructor_body): Pass location to build_stmt.
524         (cxx_maybe_build_cleanup): Same, but to build_compound_expr.
525         * call.c (build_new_op): Pass location to build_array_ref.
526         (build_x_va_arg): Pass location to build_va_arg.
527         * except.c (expand_end_catch_block): Pass location to
528         build_stmt.
529         * cp-tree.h (build_array_ref): New argument.
530         (build_compound_expr): Same.
531         (build_c_cast): Same.
532         * cp-gimplify.c (gimplify_if_stmt): Pass location on down.
533         (gimplify_switch_stmt): Same.
534         * typeck2.c (split_nonconstant_init_1): Same.
535         * pt.c (tsubst_copy): Same.
536         * semantics.c (add_decl_expr): Same.
537         (do_poplevel): Same.
538         (push_cleanup): Same.
539         (finish_goto_stmt): Same.
540         (finish_expr_stmt): Same.
541         (begin_if_stmt): Same.
542         (begin_while_stmt): Same.
543         (begin_do_stmt): Same.
544         (finish_return_stmt): Same.
545         (begin_for_stmt): Same.
546         (finish_break_stmt): Same.
547         (finish_continue_stmt): Same.
548         (begin_switch_stmt): Same.
549         (begin_try_block): Same.
550         (begin_handler): Same.
551         (finish_asm_stmt): Same.
552         (finish_label_stmt): Same.
553         (finish_stmt_expr_expr): Same.
554         (finalize_nrv_r): Same.
555         (finish_omp_atomic): Same.
556         * name-lookup.c (do_using_directive): Same.
557         * decl2.c (grok_array_decl): Same.
558         * parser.c (cp_parser_cast_expression): Same.
559         (cp_parser_selection_statement): Same.
560         (cp_parser_implicitly_scoped_statement): Same.
561         (cp_parser_objc_selector_expression): Same.
562         (cp_parser_objc_synchronized_statement): Same.
563         (cp_parser_objc_throw_statement): Same.
564         (cp_parser_omp_critical): Same.
565         (cp_parser_omp_master): Same.
566         * typeck.c (build_function_call): Add location argument.
567         * init.c: Add location argument to all build_decl calls.
568         * class.c: Same.
569         * method.c: Same.
570         * rtti.c: Same.
571         * tree.c: Same.
572         * pt.c: Same.
573         * semantics.c: Same.
574         * lex.c: Same.
575         * decl2.c: Same.
576         * cp-gimplify.c: Same.
577         * decl.c: Same.
578         (cp_make_fname_decl): Add location argument.  Pass location ot
579         build_decl.
580         (finish_case_label): Same.
581         * cp-tree.h (finish_case_label): Add location argument.
582         * parser.c (cp_parser_label_for_labeled_statement): Pass location to
583         finish_case_label.
584         
585 2009-06-09  Jason Merrill  <jason@redhat.com>
586
587         PR c++/40381
588         * decl2.c (mark_used): Return after complaining about deleted fn.
589
590 2009-06-08  Jason Merrill  <jason@redhat.com>
591
592         * parser.c (cp_parser_type_id_1): 'auto' type is ok with a
593         late-specified return type.
594
595 2009-06-08  Jakub Jelinek  <jakub@redhat.com>
596
597         PR c++/40373
598         * call.c (check_dtor_name): Return false even if
599         get_type_value (name) is error_mark_node.
600
601         PR c++/40370
602         PR c++/40372
603         * parser.c (cp_parser_direct_declarator): Don't set TREE_SIDE_EFFECTS
604         on error_mark_node.  Check for VLAs outside of function context
605         before check whether to wrap bounds into a NOP_EXPR with
606         TREE_SIDE_EFFECTS.
607
608 2009-06-08  Alexandre Oliva  <aoliva@redhat.com>
609
610         * repo.c (get_base_filename): Use aux_base_name rather than
611         alternate temporary file during second compare debug compilation.
612         (finish_repo): Skip during -fcompare-debug-second.
613
614 2009-06-06  Ian Lance Taylor  <iant@google.com>
615
616         * parser.c (cp_parser_label_for_labeled_statement): Support
617         attribute on labels if immediately followed by semicolon.
618         * semantics.c (finish_label_stmt): Return new label.
619         * pt.c (tsubst_expr): Handle attributes for LABEL_EXPR.
620
621 2009-06-03  Ian Lance Taylor  <iant@google.com>
622
623         * Make-lang.in (cc1plus-checksum.o): Depend upon $(CONFIG_H) and
624         $(SYSTEM_H).
625
626 2009-06-02  Mark Mitchell  <mark@codesourcery.com>
627
628         * decl.c (maybe_deduce_size_from_array_init): Use relayout_decl.
629
630 2009-06-02  Jason Merrill  <jason@redhat.com>
631
632         PR c++/40308
633         PR c++/40311
634         * typeck.c (cp_build_modify_expr): Always pass init-lists to the
635         conversion code.
636         * call.c (implicit_conversion): Allow init-list conversion to scalar
637         during direct-initialization, too.  Mark the conversion bad if it
638         has too many levels of braces.
639         (convert_like_real): And give a helpful error.
640
641         PR c++/40306
642         PR c++/40307
643         * decl.c (cp_finish_decl): Handle auto deduction from ().
644         * typeck.c (build_x_indirect_ref): Handle dereferencing an operand
645         with dependent type that is known to be a pointer.
646
647 2009-06-02  Simon Martin  <simartin@users.sourceforge.net>
648
649         PR c++/38089
650         * pt.c (register_specialization): Properly setup DECL_CONTEXT for
651         specializations in an invalid namespace.
652
653 2009-06-01  Aldy Hernandez  <aldyh@redhat.com>
654
655         * error.c (print_instantiation_partial_context): Print column
656         numbers.
657
658 2009-05-29  Ian Lance Taylor  <iant@google.com>
659
660         * error.c (cp_printer): Don't use va_arg with enum type.
661
662 2009-05-28  Dodji Seketeli  <dodji@redhat.com>
663
664         PR c++/39754
665         * cp-tree.h (canonical_type_variant): Remove this function declaration.
666         (strip_typedefs): New function declaration.
667         * tree.c (strip_typedefs): New function definition.
668         (canonical_type_variant): Remove function definition.
669         * cvt.c (convert_from_reference): No need to use
670         canonical_type_variant.
671         * typeck.c (cp_build_indirect_ref): Likewise.
672         * error.c (dump_template_bindings): Use strip_typedefs instead of
673         canonical_type_variant.
674         * pt.c (convert_template_argument, unify): Likewise.
675         * mangle.c (canonicalize_for_substitution): Don't use
676         canonical_type_variant.
677
678 2009-05-27  Jason Merrill  <jason@redhat.com>
679
680         * call.c (implicit_conversion): Handle conversion from
681         initializer-list to scalar.
682         (convert_like_real): Likewise.  Avoid crashing on list
683         initialization with bad conversions.
684         (can_convert): Use LOOKUP_EXPLICIT.
685         (can_convert_arg_bad): Add flags parm.
686         * cp-tree.h: Adjust.
687         * typeck.c (convert_for_assignment): Pass flags.
688
689 2009-05-27  Ian Lance Taylor  <iant@google.com>
690
691         * Make-lang.in (g++$(exeext)): Change $(COMPILER) to $(LINKER).
692         (cc1plus-dummy$(exeext), cc1plus$(exeext)): Likewise.
693
694 2009-05-26  Ian Lance Taylor  <iant@google.com>
695
696         * Make-lang.in (g++spec.o): Use $(COMPILER).
697         (g++$(exeext), cc1plus-dummy$(exeext)): Likewise.
698         (cc1plus$(exeext)): Likewise.
699
700 2009-05-26  Dodji Seketeli  <dodji@redhat.com>
701
702         PR c++/40007
703         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Remove this accessor.
704         (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): New accessor.
705         (get_types_needing_access_check): Declare new entry point.
706         * pt.c (append_type_to_template_for_access_check_1,
707         get_types_needing_access_check): New functions.
708         (perform_typedefs_access_check): Accept FUNCTION_DECLs and
709         RECORD_TYPEs rather than TEMPLATE_DECLs. Use the new
710         get_types_needing_access_check, no more
711         MEMBER_TYPES_NEEDING_ACCESS_CHECK.
712         (instantiate_class_template): Set input_location to the source
713         location of the most specialized template definition.
714         Perform access check using the RECORD_TYPE of the template, not its
715         associated most generic TEMPLATE_DECL.
716         (append_type_to_template_for_access_check): Augment function
717         comments. Use the new get_types_needing_access_check, not
718         MEMBER_TYPE_NEEDING_ACCESS_CHECK. Use the new
719         append_type_to_template_for_access_check_1 subroutine.
720
721 2009-05-22  Jason Merrill  <jason@redhat.com>
722
723         PR c++/38064
724         * typeck.c (cp_build_binary_op): Allow ENUMERAL_TYPE in
725         arithmetic comparisons.
726         (cp_common_type): Handle scoped enums.
727
728         * call.c (promoted_arithmetic_type_p): Don't use INTEGRAL_TYPE_P.
729         (add_builtin_candidate, add_builtin_candidates): Likewise.
730         (convert_like_real): Likewise.
731         * class.c (check_bitfield_decl): Likewise.
732         * decl.c (check_static_variable_definition): Likewise.
733         (compute_array_index_type): Likewise.
734         * decl2.c (grokbitfield): Likewise.
735         * init.c (build_new_1): Likewise.
736         * pt.c (convert_nontype_argument): Likewise.
737         (current_instantiation): Likewise.
738         * tree.c (pod_type_p): Likewise.
739         * typeck.c (build_static_cast_1): Likewise.
740         (build_reinterpret_cast_1): Likewise.
741
742 2009-05-22  Richard Guenther  <rguenther@suse.de>
743
744         PR middle-end/38964
745         * init.c (avoid_placement_new_aliasing): Remove.
746         (build_new_1): Do not call it.
747
748 2009-05-22  Mark Mitchell  <mark@codesourcery.com>
749
750         * decl2.c (decl_needed_p): Consider dllexport'd functions needed.
751         * semantics.c (expand_or_defer_fn): Similarly.
752
753 2009-05-20  Ian Lance Taylor  <iant@google.com>
754
755         * parser.c (cp_parser_postfix_expression): Change args to a vec.
756         Release it when done.
757         (tree_vector): Define typedef.  Define VEC functions.
758         (cp_parser_parenthesized_expression_list): Change return type to
759         vec.  Change all callers.
760         (cp_parser_new_expression): Change placement and initializer to
761         vecs.  Release them when done.
762         (cp_parser_new_placement): Change return type to vec.  Change all
763         callers.
764         (cp_parser_new_initializer): Likewise.
765         * typeck.c (build_function_call_vec): Just call
766         cp_build_function_call_vec.
767         (cp_build_function_call): Just build a vec and call
768         cp_build_function_call_vec.
769         (cp_build_function_call_vec): New function based on old
770         cp_build_function_call.
771         (convert_arguments): Remove nargs and argarray parameters.  Change
772         values to a vec.  Change caller.
773         (build_x_compound_expr_from_vec): New function.
774         (cp_build_modify_expr): Build vec to pass to
775         build_special_member_call.
776         * call.c (struct z_candidate): Add first_arg field.  Change args
777         field to vec.
778         (convert_class_to_reference): Handle first argument separately.
779         (add_candidate): Add first_arg parameter.  Change args parameter
780         to vec.  Change all callers.
781         (add_function_candidate, add_conv_candidate): Likewise.
782         (add_template_candidate_real, add_template_candidate): Likewise.
783         (add_template_conv_candidate): Likewise.
784         (build_user_type_conversion_1): Handle first argument separately.
785         (resolve_args): Change return type and parameter type to vecs.
786         Change all callers.
787         (perform_overload_resolution): Change args parameter to vec.
788         Change all callers.
789         (build_new_function_call, build_operator_new_call): Likewise.
790         (add_candidates): Likewise.
791         (build_op_call): New globally visible function, built from and
792         replacing static function build_object_call.
793         (build_new_op): Don't handle CALL_EXPR.  Build vec, not tree_list,
794         of arguments.
795         (build_op_delete_call): Build vec to pass to
796         cp_build_function_call_vec.
797         (build_temp): Build vec to pass to build_special_member_call.
798         (convert_like_real): Likewise.
799         (perform_direct_initialization_if_possible): Likewise.
800         (build_over_call): Handle first_arg field.  Use build_call_array
801         rather than build_call_list.
802         (build_special_member_call): Change args parameter to vec.  Change
803         all callers.
804         (build_new_method_call): Likewise.
805         * init.c (expand_default_init): Change parms to vec.
806         (build_raw_new_expr): Change placement and init to vecs.  Change
807         all callers.
808         (build_new_1, build_new): Likewise.
809         * class.c (resolve_address_of_overloaded_function): Build array to
810         pass to fn_type_unification.
811         * pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
812         build_new.  For CALL_EXPR create a vec rather than a tree_list;
813         expand a pack if necessary.
814         (fn_type_unification): Change args parameter to const tree *.  Add
815         nargs parameter.  Change all callers.
816         (type_unification_real): Likewise.
817         (unify): Build array to pass to type_unification_real.
818         (get_bindings): Build array to pass to fn_type_unification.
819         (any_type_dependent_arguments_p): Change args parameter to a vec.
820         Change all callers.
821         (make_args_non_dependent): Renamed from build_non_dependent_args.
822         Change return type to void.  Change parameter type to vec.  Change
823         all callers.
824         (do_auto_deduction): Pass an array to type_unification_real.
825         * semantics.c (perform_koenig_lookup): Change args to vec.  Change
826         all callers.
827         (finish_call_expr): Change args to vec.  Change all callers.  Call
828         build_op_call instead of passing CALL_EXPR to build_new_op.
829         (cxx_omp_create_clause_info): Allocate vec to pass to
830         build_special_member_call.
831         * decl2.c (build_offset_ref_call_from_tree): Change args parameter
832         to vec.  Change all callers.
833         * name-lookup.c (lookup_function_nonclass): Likewise.
834         (struct arg_lookup): Change args to vec.
835         (arg_assoc_namespace): Handle args as a vec.
836         (arg_assoc_args_vec): New static function.
837         (lookup_arg_dependent): Change args parameter to vec.  Change all
838         callers.
839         * method.c (do_build_assign_ref): Allocate vec to pass to
840         build_special_member_call.
841         * except.c (build_throw): Likewise.
842         * typeck2.c (build_functional_cast): Likewise.
843         * cvt.c (ocp_convert): Likewise.
844         * tree.c (build_min_non_dep_call_vec): Change last parameter to
845         vec.  Change all callers.
846         * cp-tree.h: Update declarations.
847         * name-lookup.h: Update declarations.
848
849 2009-05-20  Sandra Loosemore  <sandra@codesourcery.com>
850
851         * typeck.c (default_conversion): Check targetm.promoted_type.
852         * decl.c (grokdeclarator): Check targetm.invalid_return_type.
853         (grokparms): Check targetm.invalid_parameter_type.
854         * cvt.c (ocp_convert): Check targetm.convert_to_type.
855         (build_expr_type_conversion): Check targetm.promoted_type.
856
857 2009-05-19  Andrew Pinski  <andrew_pinski@playstation.sony.com>
858
859         * typeck.c (build_binary_op): Allow % on integal vectors.
860
861 2009-05-18  Jason Merrill  <jason@redhat.com>
862
863         Implement explicit conversions ops as specified in N2437.
864         * decl.c (grokdeclarator): Handle explicit conversion ops.
865         (check_initializer): Pass flags to store_init_value.
866         * decl2.c (maybe_emit_vtables): Likewise.
867         * init.c (expand_aggr_init_1): Likewise.
868         * call.c (convert_class_to_reference): Take flags parm,
869         check DECL_NONCONVERTING_P.
870         (build_user_type_conversion_1): Check DECL_NONCONVERTING_P.
871         (add_builtin_candidates): Simplify getting type of conversion.
872         (build_object_call): Likewise.  Check DECL_NONCONVERTING_P.
873         (implicit_conversion): Pass through LOOKUP_ONLYCONVERTING.
874         (reference_binding): Take flags parm.  Direct-initialize copy parm.
875         (add_function_candidate): Direct-initialize the copy parm.
876         (add_conv_candidate): Use LOOKUP_IMPLICIT, not LOOKUP_NORMAL.
877         (build_builtin_candidate): Add LOOKUP_ONLYCONVERTING.
878         (conditional_conversion): Likewise.
879         (convert_like_real): Only complain about DECL_NONCONVERTING_P
880         constructors.
881         (perform_implicit_conversion_flags): Add flags parm to
882         perform_implicit_conversion.  Improve diagnostics.
883         * cp-tree.h (LOOKUP_IMPLICIT): New macro.
884         (LOOKUP_COPY_PARM): New bit macro.
885         * cvt.c (build_expr_type_conversion): Check DECL_NONCONVERTING_P.
886         * typeck.c (convert_for_assignment): Take flags parm, pass it to
887         perform_implicit_conversion_flags.
888         (cp_build_modify_expr): Pass flags to convert_for_assignment.
889         (convert_for_initialization): Likewise.
890         * typeck2.c (store_init_value): Take flags parm, pass to
891         digest_init_flags.
892         (digest_init_flags): Add flags parm to digest_init.
893         (digest_init_r): Take flags parm, pass to convert_for_initialization.
894         (process_init_constructor_array): Pass it.
895         (process_init_constructor_record): Likewise.
896         (process_init_constructor_union): Likewise.
897
898 2009-05-16  Jason Merrill  <jason@redhat.com>
899
900         PR c++/40139
901         * pt.c (tsubst_qualified_id): Retain the type if we aren't dealing
902         with a dependent type.  Actually look up the destructor.
903         * semantics.c (finish_id_expression): Fix logic.
904         (finish_qualified_id_expr): Don't try to use 'this' if we aren't in
905         a function.
906         * typeck.c (build_x_unary_op): Diagnose taking the address of a
907         constructor or destructor.
908         * tree.c (get_first_fn): Handle OFFSET_REF.
909
910 2009-05-17  Joseph Myers  <joseph@codesourcery.com>
911
912         * tree.c (cxx_printable_name_internal): Allow consecutive
913         translated and untranslated cached copies of the name of the
914         current function.
915
916 2009-05-15  Ian Lance Taylor  <iant@google.com>
917
918         * cp-tree.h (enum cp_lvalue_kind_flags): Rename from
919         cp_lvalue_kind.  Change all uses.
920         (enum base_access_flags): Rename from enum base_access.  Change
921         all uses.
922         * parser.c (enum cp_parser_flags): Remove enum tag.
923
924 2009-05-15  Manuel López-Ibáñez  <manu@gcc.gnu.org>
925
926         PR 16302
927         * call.c (build_new_op): Update calls to warn_logical_operator.
928
929 2009-05-14  Ian Lance Taylor  <iant@google.com>
930
931         * class.c (layout_class_type): Change itk to unsigned int.
932         * decl.c (finish_enum): Change itk to unsigned int.
933         * parser.c (cp_parser_check_decl_spec): Change ds to int.  Remove
934         casts.
935
936 2009-05-13  David Mandelin <dmandelin@mozilla.com>:
937
938         * decl.c (duplicate_decls): Preserve parameter attributes.
939
940 2009-05-10  Jan Hubicka  <jh@suse.cz>
941
942         * decl2.c (cxx_callgraph_analyze_expr): Use
943         cgraph_mark_address_taken.
944
945 2009-05-10  Joseph Myers  <joseph@codesourcery.com>
946
947         * call.c (name_as_c_string): Call type_as_string_translate.
948         Translate identifiers to locale character set.
949         * cp-tree.h (lang_decl_name): Update prototype.
950         (type_as_string_translate, decl_as_string_translate,
951         cxx_printable_name_translate): Declare.
952         * cxx-pretty-print.c (M_): Define.
953         (pp_cxx_unqualified_id, pp_cxx_canonical_template_parameter): Mark
954         English fragments for conditional translation with M_.
955         * decl.c (grokdeclarator): Translate identifiers to locale
956         character set for diagnostics.
957         * error.c (M_): Define.
958         (dump_template_bindings, dump_type, dump_aggr_type,
959         dump_type_prefix, dump_global_iord, dump_simple_decl, dump_decl,
960         dump_function_decl, dump_template_parms, dump_expr,
961         dump_binary_op, op_to_string, assop_to_string): Mark English
962         fragments for conditional translation with M_.
963         (type_as_string): Disable translation of identifiers.
964         (type_as_string_translate): New.
965         (expr_as_string): Disable translation of identifiers.
966         (decl_as_string): Disable translation of identifiers.
967         (decl_as_string_translate): New.
968         (lang_decl_name): Add parameter translate.
969         (args_to_string): Call type_as_string_translate.
970         (cp_print_error_function): Call cxx_printable_name_translate.
971         (print_instantiation_full_context,
972         print_instantiation_partial_context): Call
973         decl_as_string_translate.
974         * parser.c (cp_lexer_get_preprocessor_token): Use %qE for
975         identifier in diagnostic.
976         * tree.c (cxx_printable_name): Change to
977         cxx_printable_name_internal.  Add parameter translate.
978         (cxx_printable_name, cxx_printable_name_translate): New wrappers
979         round cxx_printable_name_internal.
980
981 2009-05-08  H.J. Lu  <hongjiu.lu@intel.com>
982
983         PR c/36892
984         * call.c (build_call_a): Updated warn_deprecated_use call.
985         (build_over_call): Likewise.
986         * decl.c (grokdeclarator): Likewise.
987         (grokparms): Likewise.
988         * semantics.c (finish_id_expression): Likewise.
989         * typeck.c (build_class_member_access_expr): Likewise.
990         (finish_class_member_access_expr): Likewise.
991
992 2009-05-06  Dodji Seketeli  <dodji@redhat.com>
993
994         PR c++/17395
995         * pt.c (tsubst_copy) <case PARM_DECL>: We don't want to tsubst the
996         whole list of PARM_DECLs, just the current one.
997
998 2009-05-05  Shujing Zhao  <pearly.zhao@oracle.com>
999
1000         * cp-tree.h:
1001         (opname_tab, assignop_tab, update_member_visibility, yyerror, yyhook,
1002         mangle_compound_literal): Remove unused declarations.
1003         (build_vfield_ref, cxx_print_statistics, clone_function_decl,
1004         adjust_clone_args, maybe_push_cleanup_level, pushtag, make_anon_name,
1005         pushdecl_top_level_maybe_friend, pushdecl_top_level_and_finish,
1006         check_for_out_of_scope_variable, print_other_binding_stack,
1007         maybe_push_decl, cxx_mark_addressable, force_target_expr,
1008         build_target_expr_with_type, finish_case_label,
1009         cxx_maybe_build_cleanup, begin_eh_spec_block, finish_eh_spec_block,
1010         check_template_keyword, cxx_omp_predetermined_sharing,
1011         cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
1012         cxx_omp_clause_assign_op, cxx_omp_clause_dtor, cxx_omp_finish_clause,
1013         cxx_omp_privatize_by_reference): Rearrange the declarations line to
1014         match the comment that indicates the .c file which the functions are
1015         defined.
1016         (cxx_print_xnode, cxx_print_decl, cxx_print_type,
1017         cxx_print_identifier, cxx_print_error_function, pushdecl): Add comment.
1018
1019 2009-05-05  Nathan Sidwell  <nathan@codesourcery.com>
1020
1021         * typeck.c (cp_build_compound_expr): Require RHS to have a known
1022         type.
1023         * class.c (resolve_address_of_overloaded_function): Use
1024         OVL_CURRENT for error message.
1025         (instantiate_type): Forbid COMPOUND_EXPRs and remove code dealing
1026         with them.  Do not copy the node.
1027
1028 2009-05-05  Jakub Jelinek  <jakub@redhat.com>
1029
1030         PR c++/40013
1031         * pt.c (tsubst): If magic NOP_EXPR with side-effects has no type,
1032         set it from its operand's type after tsubst_expr.
1033
1034 2009-05-04  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1035
1036         PR c++/28152
1037         * parser.c (cp_lexer_get_preprocessor_token):  Do not store the
1038         canonical spelling for keywords.
1039         (cp_parser_attribute_list): Use the canonical spelling for
1040         keywords in attributes.
1041
1042 2009-05-01  Joseph Myers  <joseph@codesourcery.com>
1043
1044         * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id,
1045         pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression,
1046         pp_cxx_new_expression, pp_cxx_delete_expression,
1047         pp_cxx_unary_expression, pp_cxx_assignment_operator,
1048         pp_cxx_assignment_expression, pp_cxx_expression,
1049         pp_cxx_function_specifier, pp_cxx_decl_specifier_seq,
1050         pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq,
1051         pp_cxx_exception_specification, pp_cxx_direct_declarator,
1052         pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement,
1053         pp_cxx_namespace_alias_definition, pp_cxx_template_parameter,
1054         pp_cxx_canonical_template_parameter, pp_cxx_template_declaration,
1055         pp_cxx_declaration, pp_cxx_typeid_expression,
1056         pp_cxx_va_arg_expression, pp_cxx_offsetof_expression,
1057         pp_cxx_trait_expression): Mostly use pp_string and
1058         pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
1059         for non-identifiers.  Mark English strings for translation.
1060         * cxx-pretty-print.h (pp_cxx_ws_string): Define.
1061         * error.c (dump_template_parameter, dump_template_bindings,
1062         dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl,
1063         dump_decl, dump_template_decl, dump_function_decl,
1064         dump_parameters, dump_exception_spec, dump_template_parms,
1065         dump_expr, dump_binary_op, dump_unary_op, op_to_string,
1066         assop_to_string, args_to_string, cp_print_error_function,
1067         print_instantiation_full_context,
1068         print_instantiation_partial_context): Mostly use pp_string and
1069         pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
1070         for non-identifiers.  Mark English strings for translation.
1071         (dump_global_iord): Mark strings for translation; use longer
1072         strings instead of substituting single words.
1073         (function_category): Return a format string marked for
1074         translation, not a single word or phrase to substitute in a longer
1075         phrase.
1076
1077 2009-04-28  Ben Elliston  <bje@au.ibm.com>
1078
1079         PR c++/35652
1080         Revert:
1081
1082         2009-03-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1083
1084         * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
1085
1086 2009-04-27  Ian Lance Taylor  <iant@google.com>
1087
1088         * semantics.c (finish_omp_clauses): Change type of c_kind to enum
1089         omp_clause_code.
1090
1091 2009-04-27  Jakub Jelinek  <jakub@redhat.com>
1092
1093         PR c++/39875
1094         * cvt.c (convert_to_void) <case INDIRECT_REF>: Only warn about
1095         -Wunused-value if implicit.
1096
1097 2009-04-24  Ian Lance Taylor  <iant@google.com>
1098
1099         * call.c (build_temp): Change 0 to enum constant.
1100         * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
1101         type.
1102         * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
1103         * decl2.c (constrain_visibility): Likewise.
1104         * parser.c (cp_lexer_get_preprocessor_token): Likewise.
1105         (cp_parser_flags): Typedef to int rather than enum type.
1106         (cp_parser_expression_stack_entry): Change prec field to enum
1107         cp_parser_prec.
1108
1109         * typeck.c (build_modify_expr): Add lhs_origtype parameter.
1110         Change all callers.
1111
1112 2009-04-22  Dodji Seketeli  <dodji@redhat.com>
1113
1114         PR c++/39639
1115         * parser.c (cp_parser_template_argument_list): Display an error
1116         when an ellipsis is not preceded by a parameter pack. Also, warn
1117         about variadic templates usage without -std=c++0x.
1118
1119 2009-04-21  Taras Glek <tglek@mozilla.com>
1120
1121         * cp-tree.h: Update GTY annotations to new syntax.
1122         * decl.c: Likewise.
1123         * mangle.c: Likewise.
1124         * name-lookup.c: Likewise.
1125         * name-lookup.h: Likewise.
1126         * parser.c: Likewise.
1127         * pt.c: Likewise.
1128         * rtti.c: Likewise.
1129         * semantics.c: Likewise.
1130         * typeck2.c: Likewise.
1131
1132 2009-04-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1133
1134         PR c++/14875
1135         * parser.c (cp_parser_error): Pass token->flags to c_parse_error.
1136
1137 2009-04-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1138
1139         PR c++/35711
1140         * typeck.c (check_for_casting_away_constness): We diagnose casting
1141         away any qualifiers not just constness.
1142         (casts_away_constness): Mention that it handles more than just
1143         constness.
1144         
1145 2009-04-21  Joseph Myers  <joseph@codesourcery.com>
1146
1147         * ChangeLog, ChangeLog-1993, ChangeLog-1994, ChangeLog-1995,
1148         ChangeLog-1996, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999,
1149         ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003,
1150         ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
1151         ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, NEWS,
1152         cfns.gperf: Add copyright and license notices.
1153         * cfns.h: Regenerate.
1154         * ChangeLog, ChangeLog-2004: Correct dates.
1155
1156 2009-04-21  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1157
1158         PR 16202
1159         * tree.c (lvalue_p_1): Use const_tree.
1160         Use CONST_CAST_TREE to avoid warning.
1161         (lvalue_p): Returns bool, receives const_tree.
1162
1163 2009-04-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1164
1165         PR c++/13358
1166         * parser.c (cp_parser_check_decl_spec): Drop redundant flags.
1167         * error.c (pedwarn_cxx98): New.
1168         * cp-tree.h (pedwarn_cxx98): Declare.
1169
1170 2009-04-20  Le-Chun Wu  <lcwu@google.com>
1171
1172         PR c++/39803
1173         * init.c (build_vec_init): Set TREE_NO_WARNING on the
1174         compiler-generated INDIRECT_REF expression.
1175
1176 2009-04-20  Ian Lance Taylor  <iant@google.com>
1177
1178         * typeck.c (build_function_call_vec): New function.
1179         (cp_build_function_call): Only pass first parameter to
1180         objc_rewrite_function_call.
1181         (build_modify_expr): Add rhs_origtype parameter.  Change all
1182         callers.
1183         * decl.c (finish_decl): Add origtype parameter.  Change all
1184         callers.
1185         * semantics.c (finish_call_expr): Pass VEC to
1186         resolve_overloaded_builtin.
1187
1188 2009-04-20  Ian Lance Taylor  <iant@google.com>
1189
1190         * cp-tree.h (base_access): Change typedef to int.
1191         * parser.c (cp_parser_omp_flush): Change 0 to OMP_CLAUSE_ERROR.
1192         (cp_parser_omp_threadprivate): Likewise.
1193         * pt.c (unify_pack_expansion): Add casts to enum type.
1194
1195 2009-04-19  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1196
1197         PR c/32061
1198         PR c++/36954
1199         * call.c (build_new_op): Save the original codes of operands
1200         before folding.
1201
1202 2009-04-18  Kazu Hirata  <kazu@codesourcery.com>
1203
1204         * cp-tree.h: Remove the prototype for insert_block.
1205         * decl.c (insert_block): Remove.
1206
1207 2009-04-16  Ian Lance Taylor  <iant@google.com>
1208
1209         * cp-tree.h (enum tsubst_flags): Rename from enum tsubst_flags_t.
1210         (tsubst_flags_t): Change typedef from enum type to int.
1211
1212 2009-04-16  Paolo Bonzini  <bonzini@gnu.org>
1213
1214         * decl.c (check_initializer): Use TYPE_VECTOR_OPAQUE
1215         instead of targetm.vector_opaque_p.
1216
1217 2009-04-15  Le-Chun Wu  <lcwu@google.com>
1218
1219         PR c++/39551
1220         * call.c (build_over_call): Set TREE_NO_WARNING on the
1221         compiler-generated INDIRECT_REF expression.
1222         * cvt.c (convert_to_void): Emit warning when stripping off
1223         INDIRECT_REF.
1224
1225 2009-04-14  Diego Novillo  <dnovillo@google.com>
1226
1227         * parser.c (cp_parser_type_specifier_seq): Move call to
1228         invoke_plugin_callbacks ...
1229         (cp_parser_type_specifier_seq): ... here.
1230
1231 2009-04-14  Le-Chun Wu  <lcwu@google.com>
1232
1233         * Make-lang.in: Modify dependencies of files including plugin.h.
1234         * decl.c (finish_function): Call invoke_plugin_callbacks.
1235         * parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.
1236
1237 2009-04-14  Jason Merrill  <jason@redhat.com>
1238
1239         PR c++/39763
1240         * name-lookup.c (pushdecl_maybe_friend): Avoid all warnings
1241         about shadowing by tentative parms.
1242
1243 2009-04-13  Jason Merrill  <jason@redhat.com>
1244
1245         PR c++/39480
1246         * call.c (build_over_call): Don't call memcpy if the target is
1247         the same as the source.
1248
1249 2009-04-13  Jason Merrill  <jason@redhat.com>
1250
1251         PR c++/39750
1252         * pt.c (uses_template_parms): Handle CONSTRUCTOR.
1253
1254 2009-04-12  Jason Merrill  <jason@redhat.com>
1255
1256         PR c++/39742
1257         * call.c (joust): Don't crash on variadic fn.
1258
1259 2009-04-10  Jason Merrill  <jason@redhat.com>
1260
1261         PR c++/28301
1262         * parser.c (cp_parser_skip_to_end_of_block_or_statement): Return
1263         if we see a close brace without an open brace.
1264
1265 2009-04-10  H.J. Lu  <hongjiu.lu@intel.com>
1266
1267         * parser.c (cp_parser_class_specifier): Remove the unused
1268         has_trailing_semicolon.
1269
1270 2009-04-10  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1271
1272         PR  c++/20118
1273         * parser.c (cp_parser_check_template_parameters): Take a
1274         cp_declarator parameter.
1275         (cp_parser_elaborated_type_specifier): Update to
1276         cp_parser_check_template_parameters.
1277         (cp_parser_class_head): Likewise.
1278         (cp_parser_check_declarator_template_parameters): Likewise.
1279         (cp_parser_check_template_parameters): Handle first the non-error
1280         conditions. Give more accurate diagnostics if a declarator is
1281         given. 
1282
1283 2009-04-08  Jason Merrill  <jason@redhat.com>
1284
1285         PR c++/25185
1286         * error.c (dump_aggr_type): Chase template typedefs if
1287         -fno-pretty-templates.
1288
1289 2009-04-08  Dodji Seketeli  <dodji@redhat.com>
1290
1291         PR c++/39637
1292         * parser.c (cp_parser_enumerator_definition): Make sure the
1293         initializer of the enumerator doesn't contain any bare parameter pack.
1294
1295 2009-04-07  Jason Merrill  <jason@redhat.com>
1296
1297         PR c++/34691
1298         * name-lookup.c (merge_functions): Keep multiple extern "C" functions.
1299         * call.c (joust): Complain about mismatched default arguments
1300         in extern "C" functions.
1301         * class.c (resolve_address_of_overloaded_function): Handle multiple
1302         extern "C" functions.
1303         * pt.c (resolve_overloaded_unification): Likewise.
1304
1305 2009-04-07  Jason Merrill  <jason@redhat.com>
1306
1307         PR c++/25185
1308         * error.c (dump_function_decl): Don't pretty-print templates
1309         if -fno-pretty-templates.
1310         (count_non_default_template_args): Print all args if
1311         -fno-pretty-templates.
1312
1313 2009-04-06  Jason Merrill  <jason@redhat.com>
1314
1315         PR c++/35146
1316         * pt.c (fn_type_unification): For DEDUCE_EXACT check that
1317         the deduced template arguments give us the parameter types
1318         we're looking for.
1319
1320 2009-04-05  Giovanni Bajo <giovannibajo@libero.it>
1321             Jason Merrill  <jason@redhat.com>
1322
1323         PR c++/14912
1324         * error.c (count_non_default_template_args): New fn.
1325         (dump_template_parms): Call it.
1326         (dump_template_argument_list): Call it.  Add parms parm.
1327         (dump_template_argument): Adjust call to dump_template_argument_list.
1328         (dump_type, dump_decl): Likewise.
1329         (dump_template_bindings): Refactor logic.
1330
1331 2009-04-03  Jason Merrill  <jason@redhat.com>
1332
1333         PR c++/25185
1334         * error.c (dump_template_bindings): Look through typedefs in
1335         typename results.
1336         (dump_type) [TYPENAME_TYPE]: Print the typedef name if any.
1337         (find_typenames_r): Also collect typedefs.
1338         * pt.c (unify): Strip typedefs.
1339
1340         PR c++/39608
1341         * semantics.c (finish_id_expression): Don't assume a dependent
1342         member of the current instantiation isn't a valid integral
1343         constant expression.  Check dependent_scope_p.
1344         * pt.c (dependent_scope_p): Check TYPE_P.
1345         (tsubst_copy): If args is null, just return.
1346
1347 2009-04-02  Jason Merrill  <jason@redhat.com>
1348
1349         PR c++/25185
1350         * error.c (find_typenames, find_typenames_r): New fns.
1351         (dump_function_decl): Call find_typenames.
1352         (dump_template_bindings): Print typenames as well.
1353         * pt.c (tsubst): Non-static.
1354         * cp-tree.h: Declare it.
1355
1356 2009-04-02  Dodji Seketeli  <dodji@redhat.com>
1357
1358         PR c++/26693
1359         * decl2.c (grokfield): when a typedef appears in a
1360         class, create the typedef variant type node for it.
1361         (save_template_attributes): Creating typedef variant type node
1362          here is now useless.
1363         * decl.c (grokdeclarator): If the typedef'ed struct/class was
1364         anonymous, set the proper type name to all its type variants.
1365         (xref_basetypes) : Fixup the variant types after setting
1366         TYPE_BINFO on REF.
1367         * name-lookup.c (pushdecl_maybe_friend): Reuse the
1368         set_underlying_type function to install typedef variant types.
1369         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
1370         macro.
1371         (append_type_to_template_for_access_check): New entry points.
1372         * semantics.c (check_accessibility_of_qualified_id):
1373         When a typedef that is a member of a class appears in a template,
1374         add it to the template. It will be ...
1375         * class.c (finish_struct_bits): Split type variant fixup into ...
1376         (fixup_type_variants): A new entry point.
1377         * pt.c (instantiate_class_template, instantiate_template ): ... access
1378         checked at template instantiation time.
1379         (resolve_type_name_type): The type name should be the name of the
1380         main type variant.
1381         (retrieve_specialization): Specializations of template typedefs aren't
1382         to looked up in DECL_TEMPLATE_INSTANTIATIONS (tmpl).
1383         (append_type_to_template_for_access_check): New entry point.
1384         (tsubst_decl): For typedefs, build the variant type from the correct
1385         original type.
1386         (get_class_bindings): Fix function comment.
1387         (perform_typedefs_access_check): New entry point.
1388
1389 2009-03-31  Jason Merrill  <jason@redhat.com>
1390
1391         PR c++/34691
1392         * name-lookup.c (pushdecl_maybe_friend): Diagnose mismatched
1393         extern "C" declarations.
1394
1395         C++ DR 613
1396         * semantics.c (finish_non_static_data_member): Allow such references
1397         without an associated object in sizeof/decltype/alignof.
1398
1399         * ptree.c (cxx_print_decl): Pretty-print full name of
1400         function/template.
1401         (cxx_print_type): Pretty-print full name of class.
1402
1403         * decl.c (grokdeclarator): Reject pointer to qualified function
1404         type.
1405
1406         PR c++/37806, core issue 547
1407         * typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals
1408         to a typedef.
1409         * tree.c (cp_build_qualified_type_real): Don't apply restrict to a 
1410         function type.
1411         * decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG.
1412         * decl.c (groktypename): Add is_template_arg parameter.
1413         (grokdeclarator): Allow function cv-quals on a template type arg.
1414         * parser.c (cp_parser_new_type_id, cp_parser_type_id): Add
1415         is_template_arg argument in calls to groktypename.
1416         * cp-tree.h: Adjust prototype.
1417         * error.c (dump_type_prefix, dump_type_suffix): Fix plain 
1418         FUNCTION_TYPE printing.
1419         
1420         * mangle.c (write_expression): Mangle dependent name as
1421         source-name.
1422
1423         PR c++/38030, 38850, 39070
1424         * pt.c (type_dependent_expression_p_push): New fn.
1425         (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
1426         substitution makes the call non-dependent.  Preserve koenig_p.
1427         * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
1428         for non-dependent calls.
1429         * semantics.c (finish_call_expr): Revert earlier changes.
1430         * cp-tree.h: Revert change to finish_call_expr prototype.
1431
1432 2009-03-29  Joseph Myers  <joseph@codesourcery.com>
1433
1434         PR preprocessor/34695
1435         * cp-tree.h (cp_cpp_error): Remove.
1436         * error.c (cp_cpp_error): Remove.
1437         * parser.c (cp_lexer_new_main): Set done_lexing instead of
1438         client_diagnostic and error callback.
1439
1440 2009-03-28  Paolo Bonzini  <bonzini@gnu.org>
1441
1442         * cp/cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1443         * cp/cp-objcp-common.c (cxx_staticp): Remove.
1444         * cp/cp-tree.h (cxx_staticp): Remove.
1445
1446 2009-03-28  Jakub Jelinek  <jakub@redhat.com>
1447
1448         PR c++/39554
1449         * parser.c (cp_parser_postfix_expression): Don't call
1450         warning_if_disallowed_function_p.
1451
1452 2009-03-27  Jan Hubicka  <jh@suse.cz>
1453
1454         * except.c (choose_personality_routine): Set terminate_node to abort
1455         for java exceptions.
1456
1457 2009-03-27  Dodji Seketeli  <dodji@redhat.com>
1458             Jakub Jelinek  <jakub@redhat.com>
1459
1460         PR debug/37959
1461         * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
1462         (cp_function_decl_explicit_p): New prototype.
1463         * cp-objcp-common.c (cp_function_decl_explicit_p): New function.
1464
1465 2009-03-27  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1466
1467         PR c++/38638
1468         * parser.c (cp_parser_elaborated_type_specifier): If we have a
1469         typename tag and don't have either a TYPE_DECL or a
1470         TEMPLATE_ID_EXPR, set the type to NULL.
1471
1472 2009-03-27  Simon Martin  <simartin@users.sourceforge.net>
1473
1474         PR c++/37647
1475         * decl.c (grokdeclarator): Reject [con|de]stuctors in a non-class
1476         scope.
1477
1478 2009-03-27  Simon Martin  <simartin@users.sourceforge.net>
1479
1480         PR c++/29727
1481         * decl.c (check_array_designated_initializer): Handle error_mark_node.
1482
1483 2009-03-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1484
1485         PR c++/35652
1486         * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
1487
1488 2009-03-26  Andrew Haley  <aph@redhat.com>
1489
1490         PR C++/39380
1491         * decl2.c (possibly_inlined_p): If java exceptions are in use
1492         don't inline a decl unless it is explicitly marked inline.
1493         * lex.c: (pragma_java_exceptions): New variable.
1494         (handle_pragma_java_exceptions): Set pragma_java_exceptions.
1495         * cp-tree.h (pragma_java_exceptions): Declare new variable.
1496
1497 2009-03-24  Jason Merrill  <jason@redhat.com>
1498
1499         PR c++/28274
1500         * name-lookup.c (pushdecl_maybe_friend): Check default args later.
1501
1502 2009-03-23  Jakub Jelinek  <jakub@redhat.com>
1503
1504         PR c/39495
1505         * semantics.c (handle_omp_for_class_iterator): Swap cond operands and
1506         code if iter is the second operand.
1507         * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p
1508         argument.  If it is set, don't build the toplevel expression with
1509         build_x_binary_op, but build2.
1510         (cp_parser_assignment_expression,  cp_parser_omp_for_incr): Adjust
1511         callers.
1512         (cp_parser_omp_for_cond): Don't assume the first operand of the
1513         comparison must be decl.
1514
1515 2009-03-23  Jason Merrill  <jason@redhat.com>
1516
1517         PR c++/37729
1518         * pt.c (make_fnparm_pack): Split out from...
1519         (instantiate_decl): ...here.
1520         (tsubst_pack_expansion): Handle being called in a late-specified
1521         return type.
1522
1523         PR c++/39526
1524         * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
1525         a parm with a parm.
1526
1527 2009-03-20  Jason Merrill  <jason@redhat.com>
1528
1529         PR c++/28879
1530         * parser.c (cp_parser_direct_declarator): In a template, wrap 
1531         non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
1532         * pt.c (tsubst): Preserve it in a partial instantiation.
1533         (dependent_type_p_r): Don't check value_dependent_expression_p.
1534         * decl.c (compute_array_index_type): Don't check
1535         value_dependent_expression_p if TREE_SIDE_EFFECTS.
1536
1537         C++ core issue 703
1538         * typeck2.c (check_narrowing): Don't complain about loss of 
1539         precision when converting a floating-point constant.
1540
1541 2009-03-19  Jakub Jelinek  <jakub@redhat.com>
1542
1543         PR c/39495
1544         * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
1545         (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
1546
1547 2009-03-18  Jakub Jelinek  <jakub@redhat.com>
1548
1549         * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
1550         (eof_token): Adjust.
1551
1552 2009-03-18  H.J. Lu  <hongjiu.lu@intel.com>
1553
1554         PR c++/39425
1555         * parser.c (cp_parser_explicit_specialization): Don't skip the
1556         rest of the specialization when begin_specialization returns
1557         false.
1558
1559 2009-03-17  Jason Merrill  <jason@redhat.com>
1560
1561         * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
1562         (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
1563         * pt.c (check_explicit_specialization): Likewise.
1564         (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
1565         local specialization.
1566         * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
1567         * decl2.c (parm_index): New fn.
1568         * semantics.c (finish_decltype_type): Don't use describable_type.
1569         * mangle.c (write_expression): Likewise.  Mangle ALIGNOF_EXPR.
1570         Give a sorry for unsupported codes rather than crash.  Mangle
1571         conversions with other than 1 operand.  New mangling for PARM_DECL.
1572         * operators.def (ALIGNOF_EXPR): Mangle as "az".
1573
1574 2009-03-17  Jing Yu  <jingyu@google.com>
1575
1576         PR middle-end/39378
1577         * method.c (use_thunk): Change is_thunk from crtl to cfun.
1578
1579 2009-03-17  Paolo Carlini  <paolo.carlini@oracle.com>
1580
1581         PR c++/39475
1582         * semantics.c (check_trait_type): New.
1583         (finish_trait_expr): Use it.
1584
1585 2009-03-17  Jakub Jelinek  <jakub@redhat.com>
1586
1587         * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
1588         instead of calling imported_module_or_decl debug hook if
1589         building_stmt_tree ().
1590         * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
1591         is a NAMESPACE_DECL.
1592
1593         PR debug/37890
1594         * name-lookup.c (do_namespace_alias): Don't call global_decl debug
1595         hook at function scope.
1596
1597         PR debug/39471
1598         * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
1599         on IMPORTED_DECL.
1600
1601 2009-03-09  Jakub Jelinek  <jakub@redhat.com>
1602
1603         PR c++/39371
1604         * semantics.c (finish_switch_cond): Don't call get_unwidened.
1605         * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
1606         instead of TREE_TYPE (cond).
1607
1608 2009-03-08  H.J. Lu  <hongjiu.lu@intel.com>
1609
1610         PR c++/39060
1611         * parser.c (cp_parser_late_parsing_default_args): Continue
1612         the loop when cp_parser_assignment_expression returns
1613         error_mark_node.
1614
1615 2009-03-07  Jason Merrill  <jason@redhat.com>
1616
1617         PR c++/39367
1618         * init.c (build_new_1): Don't use a VLA type.
1619         (build_vec_init): Handle getting a pointer for BASE.
1620
1621 2009-03-06  H.J. Lu  <hongjiu.lu@intel.com>
1622
1623         PR c++/37520
1624         * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
1625         when mangling symbols.
1626
1627 2009-03-06  Paolo Carlini  <paolo.carlini@oracle.com>
1628
1629         PR c++/33492
1630         * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
1631
1632 2009-03-06  Alexandre Oliva  <aoliva@redhat.com>
1633
1634         * decl.c (record_builtin_java_type): Use canonicalized integer
1635         types.
1636
1637 2009-03-04  Jason Merrill  <jason@redhat.com>
1638
1639         PR c++/38908
1640         * class.c (is_really_empty_class): New fn.
1641         * cp-tree.h: Declare it.
1642         * cp-objcp-common.c (cp_expr_size): Use it.
1643
1644         PR c++/13549
1645         * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
1646         * parser.c (cp_parser_postfix_expression): Call it for 
1647         TEMPLATE_ID_EXPR.
1648         * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
1649         (get_first_fn): Likewise.
1650
1651         PR c++/9634
1652         PR c++/29469
1653         PR c++/29607
1654         Implement DR 224.
1655         * decl.c (make_typename_type): Do look inside currently open classes.
1656         * parser.c (cp_parser_lookup_name): Likewise.
1657         (cp_parser_template_name): Likewise.
1658         * pt.c (dependent_scope_p): New function.
1659         * cp-tree.h: Declare it.
1660         * class.c (currently_open_class): Return fast if T isn't a class.
1661
1662 2009-02-26  H.J. Lu  <hongjiu.lu@intel.com>
1663
1664         PR c++/37789
1665         * parser.c (cp_parser_mem_initializer): Return error_mark_node
1666         if cp_parser_mem_initializer_id returns error_mark_node.
1667
1668 2009-02-24  Richard Guenther  <rguenther@suse.de>
1669
1670         PR c++/39242
1671         * pt.c (instantiate_decl): Do not instantiate extern, non-inline
1672         declared functions.
1673
1674 2009-02-23  H.J. Lu  <hongjiu.lu@intel.com>
1675
1676         PR c++/36411
1677         * pt.c (coerce_template_template_parms): Return 0 if parameter
1678         is error_mark_node.
1679
1680 2009-02-23  Jason Merrill  <jason@redhat.com>
1681
1682         * pt.c (unify): Call maybe_adjust_types_for_deduction when
1683         deducing from an initializer list.
1684
1685 2009-02-20  Jason Merrill  <jason@redhat.com>
1686
1687         PR c++/39225
1688         * decl.c (grokdeclarator): Handle ~identifier.
1689
1690 2009-02-19  Jakub Jelinek  <jakub@redhat.com>
1691
1692         PR target/39175
1693         * decl2.c (determine_visibility): If visibility changed and
1694         DECL_RTL has been already set, call make_decl_rtl to update symbol
1695         flags.
1696
1697 2009-02-19  H.J. Lu  <hongjiu.lu@intel.com>
1698
1699         PR c++/39188
1700         * cp-tree.h (maybe_commonize_var): New.
1701
1702         * decl.c (maybe_commonize_var): Make it extern.
1703
1704         * decl2.c (finish_anon_union): Call maybe_commonize_var.
1705
1706 2009-02-18  H.J. Lu  <hongjiu.lu@intel.com>
1707
1708         PR c++/39219
1709         * parser.c (cp_parser_enum_specifier): Apply all attributes.
1710
1711 2009-02-18  Jason Merrill  <jason@redhat.com>
1712
1713         * cfns.h: Tweak pathname for cfns.gperf.
1714
1715 2009-02-13  Jason Merrill  <jason@redhat.com>
1716
1717         PR c++/39070
1718         * semantics.c (finish_call_expr): Change koenig_p parm to int.
1719         If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
1720         * cp-tree.h: Adjust prototype.
1721         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
1722
1723 2009-02-12  Jason Merrill  <jason@redhat.com>
1724
1725         PR c++/38950
1726         * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
1727
1728 2009-02-11  Jason Merrill  <jason@redhat.com>
1729
1730         PR c++/39153
1731         * decl2.c (cp_write_global_declarations): 
1732         Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
1733
1734         PR c++/30111
1735         * init.c (build_value_init_noctor): Split out from...
1736         (build_value_init): ...here.
1737         (expand_aggr_init_1): Handle value-initialization.
1738         * cp-tree.h: Add declaration.
1739         * class.c (type_has_user_provided_constructor): 
1740         Handle non-class arguments.
1741
1742 2009-02-10  Jason Merrill  <jason@redhat.com>
1743
1744         PR c++/38649
1745         * class.c (defaultable_fn_p): Handle ... properly.
1746
1747         PR c++/36744
1748         * tree.c (lvalue_p_1): Condition rvalue ref handling on
1749         treat_class_rvalues_as_lvalues, too.
1750
1751 2009-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
1752
1753         PR c++/34397
1754         * typeck.c (build_x_array_ref): New.
1755         * cp-tree.h: Declare it.
1756         * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
1757
1758 2009-02-09  Jason Merrill  <jason@redhat.com>
1759
1760         PR c++/39109
1761         * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
1762         * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
1763         * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
1764         * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
1765         for build_value_init TARGET_EXPR.
1766         * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
1767
1768 2009-02-06  Paolo Carlini  <paolo.carlini@oracle.com>
1769
1770         PR c++/35147
1771         PR c++/37737
1772         * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
1773
1774 2009-02-04  Jakub Jelinek  <jakub@redhat.com>
1775
1776         PR c++/39095
1777         * operators.def: Use COMPONENT_REF code for ->/pt operator again,
1778         remove ./dt operator.
1779         * mangle.c (write_expression): Handle COMPONENT_REF after handling
1780         ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
1781         write_string ("dt") instead of using operators.def.
1782
1783 2009-02-03  Jason Merrill  <jason@redhat.com>
1784
1785         * typeck.c (cp_build_unary_op): Only complain about taking address
1786         of main if pedantic.
1787
1788 2009-02-03  Jakub Jelinek  <jakub@redhat.com>
1789
1790         PR inline-asm/39059
1791         * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
1792
1793         PR c++/39056
1794         * typeck2.c (digest_init_r): Don't call process_init_constructor
1795         for COMPLEX_TYPE.
1796
1797 2009-02-03  Paolo Bonzini  <bonzini@gnu.org>
1798
1799         PR c++/36897
1800         * pt.c (convert_nontype_argument_function): Expect expr to be an
1801         ADDR_EXPR.
1802
1803         PR c++/37314
1804         * typeck.c (merge_types): Call resolve_typename_type if only
1805         one type is a typename.
1806
1807 2009-02-02  Jason Merrill  <jason@redhat.com>
1808
1809         PR c++/39054
1810         * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node 
1811         in BIT_NOT_EXPR.
1812
1813 2009-02-01  Paolo Carlini  <paolo.carlini@oracle.com>
1814
1815         PR c++/39053
1816         * parser.c (cp_parser_pure_specifier): If there are no tokens left
1817         do not call cp_lexer_consume_token.
1818
1819 2009-01-30  Jakub Jelinek  <jakub@redhat.com>
1820
1821         PR c++/39028
1822         * parser.c (cp_parser_already_scoped_statement): Handle __label__
1823         declarations.
1824
1825 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
1826
1827         PR c++/33465
1828         * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
1829
1830 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
1831
1832         PR c++/38655
1833         * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
1834
1835 2009-01-29  Paolo Carlini  <paolo.carlini@oracle.com>
1836
1837         * typeck.c (invalid_nonstatic_memfn_p): Use
1838         DECL_NONSTATIC_MEMBER_FUNCTION_P.
1839
1840 2009-01-27  Paolo Carlini  <paolo.carlini@oracle.com>
1841
1842         PR c++/37554
1843         * call.c (build_over_call): If convert_for_arg_passing returns
1844         error_mark_node unconditionally return it.
1845
1846 2009-01-22  Adam Nemet  <anemet@caviumnetworks.com>
1847
1848         * class.c (check_field_decls): Also inherit packed for bitfields
1849         regardless of their type.
1850
1851 2009-01-22  Dodji Seketeli  <dodji@redhat.com>
1852
1853         PR c++/38930
1854         * decl2.c (grokfield): Reverting changes of PR c++/26693
1855         (save_template_attributes): Likewise.
1856         * decl.c (grokdeclarator): Likewise.
1857         * name-lookup.c (pushdecl_maybe_friend): Likewise.
1858         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
1859         (append_type_to_template_for_access_check): Likewise.
1860         * semantics.c (check_accessibility_of_qualified_id): Likewise.
1861         * pt.c (instantiate_class_template, instantiate_template ): Likewise.
1862         (tsubst): Likewise.
1863         (resolve_type_name_type): Likewise.
1864         (append_type_to_template_for_access_check): Likewise.
1865
1866 2009-01-21  Dodji Seketeli  <dodji@redhat.com>
1867
1868         PR c++/26693
1869         * decl2.c (grokfield): when a typedef appears in a
1870         class, create the typedef variant type node for it.
1871         (save_template_attributes): Creating typedef variant type node
1872          here is now useless.
1873         * decl.c (grokdeclarator): If the typedef'ed struct/class was
1874         anonymous, set the proper type name to all its type variants.
1875         * name-lookup.c (pushdecl_maybe_friend): Reuse the
1876         set_underlying_type function to install typedef variant types.
1877         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
1878         macro.
1879         (append_type_to_template_for_access_check): New entry points.
1880         * semantics.c (check_accessibility_of_qualified_id):
1881         When a typedef that is a member of a class appears in a template,
1882         add it to the template. It will be ...
1883         * pt.c (instantiate_class_template, instantiate_template ): ... access
1884         checked at template instantiation time.
1885         (tsubst): Handle the case of being called with NULL args.
1886         (resolve_type_name_type): The type name should be the name of the
1887         main type variant.
1888         (append_type_to_template_for_access_check): New entry point.
1889
1890 2009-01-19  Jason Merrill  <jason@redhat.com>
1891
1892         PR c++/23287
1893         * parser.c (cp_parser_unqualified_id): In a template,
1894         accept ~identifier.
1895         * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
1896
1897 2009-01-16  Jason Merrill  <jason@redhat.com>
1898
1899         PR c++/38877
1900         * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
1901         * init.c (build_new): Don't call describable_type unless we
1902         have an auto.
1903
1904         PR c++/29470
1905         * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
1906
1907         PR c++/38579
1908         * search.c (protected_accessible_p): N doesn't vary.
1909
1910 2009-01-15  Jason Merrill  <jason@redhat.com>
1911
1912         PR c++/38850
1913         * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
1914         accept hidden friends.
1915
1916 2009-01-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1917
1918         PR C++/29388
1919         * decl.c (grokdeclarator): Check for a non namespace/class context.
1920
1921 2009-01-15  Jason Merrill  <jason@redhat.com>
1922
1923         PR c++/36334
1924         PR c++/37646
1925         * tree.c (lvalue_p_1): Handle BASELINK.  A COMPONENT_REF to
1926         a function isn't necessarily an lvalue. Take tree, not const_tree.
1927         (lvalue_p, real_lvalue_p): Take tree, not const_tree.
1928         * typeck.c (lvalue_or_else): Likewise.
1929         * cp-tree.h: Adjust prototypes.
1930
1931 2009-01-15  Steve Ellcey  <sje@cup.hp.com>
1932
1933         PR c++/38357
1934         * pt.c (tsubst): Check for NULL args.
1935
1936 2009-01-15  Dodji Seketeli  <dodji@redhat.com>
1937
1938         PR c++/38636
1939         * name-lookup.c (pushtag): Don't create members to types that are not
1940         being created.
1941
1942 2009-01-14  Nick Clifton  <nickc@redhat.com>
1943
1944         PR c++/37862
1945         * parser.c: Pass cp_id_kind computed in
1946         cp_parser_postfix_dot_deref_expression to
1947         cp_parser_primary_expression.
1948
1949 2009-01-13  Jakub Jelinek  <jakub@redhat.com>
1950
1951         PR c++/38795
1952         * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
1953         STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
1954         as CAST_EXPR.
1955
1956 2009-01-12  Jason Merrill  <jason@redhat.com>
1957             Steve Ellcey  <sje@cup.hp.com>
1958
1959         PR c++/35109
1960         * name-lookup.c (lookup_name_real): Keep looking past a hidden 
1961         binding.
1962
1963 2009-01-12  Dodji Seketeli  <dodji@redhat.com>
1964
1965         PR c++/36019
1966         * pt.c (parameter_of_template_p): New function.
1967         * cp-tree.h: Declare it.
1968         * name-lookup.c (binding_to_template_parms_of_scope_p): New
1969         function.
1970         (outer_binding): Take template parameters in account when looking for
1971         a name binding.
1972
1973 2009-01-12  Jason Merrill  <jason@redhat.com>
1974
1975         PR c++/31488
1976         * tree.c (pod_type_p): Return 1 for structs created by the back end.
1977
1978 2009-01-12  Jakub Jelinek  <jakub@redhat.com>
1979
1980         PR c/32041
1981         * parser.c (cp_parser_builtin_offsetof): Allow `->' in
1982         offsetof member-designator, handle it as `[0].'.
1983
1984         PR c++/38794
1985         * decl.c (start_function): If grokdeclarator hasn't returned
1986         FUNCTION_DECL nor error_mark_node, issue diagnostics.
1987
1988 2009-01-11  Jakub Jelinek  <jakub@redhat.com>
1989
1990         PR c++/36254
1991         * cp-gimplify.c (genericize_if_stmt): Renamed from ...
1992         (gimplify_if_stmt): ... this.
1993         (cp_gimplify_expr): Don't handle IF_STMT here.
1994         (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
1995
1996 2009-01-10  Andrew Pinski  <pinskia@gmail.com>
1997
1998         PR c++/38648
1999         * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
2000
2001         PR c++/36695
2002         * typeck2.c (build_functional_cast): Check for reference type and NULL
2003         PARMS.
2004
2005 2009-01-09  Steve Ellcey  <sje@cup.hp.com>
2006
2007         * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
2008
2009 2009-01-09  Jakub Jelinek  <jakub@redhat.com>
2010
2011         PR c++/35335
2012         * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
2013
2014 2009-01-09  John F. Carr  <jfc@mit.edu>
2015
2016         PR c++/37877
2017         * parser.c (cp_parser_class_specifier): Clear
2018         parser->in_unbraced_linkage_specification_p while parsing class
2019         specifiers.
2020
2021 2009-01-07  Jakub Jelinek  <jakub@redhat.com>
2022
2023         PR c++/38725
2024         * semantics.c (finish_goto_stmt): Convert destination to
2025         void *.
2026
2027 2009-01-06  Jason Merrill  <jason@redhat.com>
2028
2029         PR c++/35297
2030         PR c++/35477
2031         PR c++/35784
2032         PR c++/36846
2033         PR c++/38276
2034         * pt.c (check_default_tmpl_args): Don't complain about
2035         out-of-order parameter packs in the enclosing class
2036         or parameter packs after default args.
2037         (coerce_template_parms): If we have more than one
2038         parameter pack, don't flatten argument packs.
2039         (template_args_equal): Handle argument packs.
2040         (comp_template_args): Don't flatten argument packs.
2041         (check_instantiated_arg): Split out from...
2042         (check_instantiated_args): Here.  Handle arg packs.
2043         (convert_template_argument): Just check that nontype argument
2044         packs have the right type.
2045
2046 2009-01-05  Dodji Seketeli  <dodji@redhat.com>
2047
2048         PR c++/38472
2049         * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
2050
2051 2009-01-05  Jason Merrill  <jason@redhat.com>
2052
2053         PR c++/38698
2054         * typeck2.c (process_init_constructor_union): Handle union with
2055         no fields.
2056
2057         * mangle.c (write_expression): Remove mangling for zero-operand
2058         casts.
2059
2060         PR c++/38701
2061         * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
2062         defaulting.
2063
2064         PR c++/38702
2065         * class.c (defaultable_fn_p): Only operator== can be a copy
2066         assignment operator.
2067
2068 2009-01-02  Jason Merrill  <jason@redhat.com>
2069
2070         PR c++/38698
2071         * typeck2.c (process_init_constructor_union): Handle excess
2072         initializers.
2073         (process_init_constructor_record): Likewise.
2074
2075         PR c++/38684
2076         * typeck2.c (digest_init_r): Don't use process_init_constructor
2077         for non-aggregate classes.
2078
2079 \f
2080 Copyright (C) 2009 Free Software Foundation, Inc.
2081
2082 Copying and distribution of this file, with or without modification,
2083 are permitted in any medium without royalty provided the copyright
2084 notice and this notice are preserved.