OSDN Git Service

gcc/ChangeLog:
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2009-06-08  Alexandre Oliva  <aoliva@redhat.com>
2
3         * repo.c (get_base_filename): Use aux_base_name rather than
4         alternate temporary file during second compare debug compilation.
5         (finish_repo): Skip during -fcompare-debug-second.
6
7 2009-06-06  Ian Lance Taylor  <iant@google.com>
8
9         * parser.c (cp_parser_label_for_labeled_statement): Support
10         attribute on labels if immediately followed by semicolon.
11         * semantics.c (finish_label_stmt): Return new label.
12         * pt.c (tsubst_expr): Handle attributes for LABEL_EXPR.
13
14 2009-06-03  Ian Lance Taylor  <iant@google.com>
15
16         * Make-lang.in (cc1plus-checksum.o): Depend upon $(CONFIG_H) and
17         $(SYSTEM_H).
18
19 2009-06-02  Mark Mitchell  <mark@codesourcery.com>
20
21         * decl.c (maybe_deduce_size_from_array_init): Use relayout_decl.
22
23 2009-06-02  Jason Merrill  <jason@redhat.com>
24
25         PR c++/40308
26         PR c++/40311
27         * typeck.c (cp_build_modify_expr): Always pass init-lists to the
28         conversion code.
29         * call.c (implicit_conversion): Allow init-list conversion to scalar
30         during direct-initialization, too.  Mark the conversion bad if it
31         has too many levels of braces.
32         (convert_like_real): And give a helpful error.
33
34         PR c++/40306
35         PR c++/40307
36         * decl.c (cp_finish_decl): Handle auto deduction from ().
37         * typeck.c (build_x_indirect_ref): Handle dereferencing an operand
38         with dependent type that is known to be a pointer.
39
40 2009-06-02  Simon Martin  <simartin@users.sourceforge.net>
41
42         PR c++/38089
43         * pt.c (register_specialization): Properly setup DECL_CONTEXT for
44         specializations in an invalid namespace.
45
46 2009-06-01  Aldy Hernandez  <aldyh@redhat.com>
47
48         * error.c (print_instantiation_partial_context): Print column
49         numbers.
50
51 2009-05-29  Ian Lance Taylor  <iant@google.com>
52
53         * error.c (cp_printer): Don't use va_arg with enum type.
54
55 2009-05-28  Dodji Seketeli  <dodji@redhat.com>
56
57         PR c++/39754
58         * cp-tree.h (canonical_type_variant): Remove this function declaration.
59         (strip_typedefs): New function declaration.
60         * tree.c (strip_typedefs): New function definition.
61         (canonical_type_variant): Remove function definition.
62         * cvt.c (convert_from_reference): No need to use
63         canonical_type_variant.
64         * typeck.c (cp_build_indirect_ref): Likewise.
65         * error.c (dump_template_bindings): Use strip_typedefs instead of
66         canonical_type_variant.
67         * pt.c (convert_template_argument, unify): Likewise.
68         * mangle.c (canonicalize_for_substitution): Don't use
69         canonical_type_variant.
70
71 2009-05-27  Jason Merrill  <jason@redhat.com>
72
73         * call.c (implicit_conversion): Handle conversion from
74         initializer-list to scalar.
75         (convert_like_real): Likewise.  Avoid crashing on list
76         initialization with bad conversions.
77         (can_convert): Use LOOKUP_EXPLICIT.
78         (can_convert_arg_bad): Add flags parm.
79         * cp-tree.h: Adjust.
80         * typeck.c (convert_for_assignment): Pass flags.
81
82 2009-05-27  Ian Lance Taylor  <iant@google.com>
83
84         * Make-lang.in (g++$(exeext)): Change $(COMPILER) to $(LINKER).
85         (cc1plus-dummy$(exeext), cc1plus$(exeext)): Likewise.
86
87 2009-05-26  Ian Lance Taylor  <iant@google.com>
88
89         * Make-lang.in (g++spec.o): Use $(COMPILER).
90         (g++$(exeext), cc1plus-dummy$(exeext)): Likewise.
91         (cc1plus$(exeext)): Likewise.
92
93 2009-05-26  Dodji Seketeli  <dodji@redhat.com>
94
95         PR c++/40007
96         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Remove this accessor.
97         (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): New accessor.
98         (get_types_needing_access_check): Declare new entry point.
99         * pt.c (append_type_to_template_for_access_check_1,
100         get_types_needing_access_check): New functions.
101         (perform_typedefs_access_check): Accept FUNCTION_DECLs and
102         RECORD_TYPEs rather than TEMPLATE_DECLs. Use the new
103         get_types_needing_access_check, no more
104         MEMBER_TYPES_NEEDING_ACCESS_CHECK.
105         (instantiate_class_template): Set input_location to the source
106         location of the most specialized template definition.
107         Perform access check using the RECORD_TYPE of the template, not its
108         associated most generic TEMPLATE_DECL.
109         (append_type_to_template_for_access_check): Augment function
110         comments. Use the new get_types_needing_access_check, not
111         MEMBER_TYPE_NEEDING_ACCESS_CHECK. Use the new
112         append_type_to_template_for_access_check_1 subroutine.
113
114 2009-05-22  Jason Merrill  <jason@redhat.com>
115
116         PR c++/38064
117         * typeck.c (cp_build_binary_op): Allow ENUMERAL_TYPE in
118         arithmetic comparisons.
119         (cp_common_type): Handle scoped enums.
120
121         * call.c (promoted_arithmetic_type_p): Don't use INTEGRAL_TYPE_P.
122         (add_builtin_candidate, add_builtin_candidates): Likewise.
123         (convert_like_real): Likewise.
124         * class.c (check_bitfield_decl): Likewise.
125         * decl.c (check_static_variable_definition): Likewise.
126         (compute_array_index_type): Likewise.
127         * decl2.c (grokbitfield): Likewise.
128         * init.c (build_new_1): Likewise.
129         * pt.c (convert_nontype_argument): Likewise.
130         (current_instantiation): Likewise.
131         * tree.c (pod_type_p): Likewise.
132         * typeck.c (build_static_cast_1): Likewise.
133         (build_reinterpret_cast_1): Likewise.
134
135 2009-05-22  Richard Guenther  <rguenther@suse.de>
136
137         PR middle-end/38964
138         * init.c (avoid_placement_new_aliasing): Remove.
139         (build_new_1): Do not call it.
140
141 2009-05-22  Mark Mitchell  <mark@codesourcery.com>
142
143         * decl2.c (decl_needed_p): Consider dllexport'd functions needed.
144         * semantics.c (expand_or_defer_fn): Similarly.
145
146 2009-05-20  Ian Lance Taylor  <iant@google.com>
147
148         * parser.c (cp_parser_postfix_expression): Change args to a vec.
149         Release it when done.
150         (tree_vector): Define typedef.  Define VEC functions.
151         (cp_parser_parenthesized_expression_list): Change return type to
152         vec.  Change all callers.
153         (cp_parser_new_expression): Change placement and initializer to
154         vecs.  Release them when done.
155         (cp_parser_new_placement): Change return type to vec.  Change all
156         callers.
157         (cp_parser_new_initializer): Likewise.
158         * typeck.c (build_function_call_vec): Just call
159         cp_build_function_call_vec.
160         (cp_build_function_call): Just build a vec and call
161         cp_build_function_call_vec.
162         (cp_build_function_call_vec): New function based on old
163         cp_build_function_call.
164         (convert_arguments): Remove nargs and argarray parameters.  Change
165         values to a vec.  Change caller.
166         (build_x_compound_expr_from_vec): New function.
167         (cp_build_modify_expr): Build vec to pass to
168         build_special_member_call.
169         * call.c (struct z_candidate): Add first_arg field.  Change args
170         field to vec.
171         (convert_class_to_reference): Handle first argument separately.
172         (add_candidate): Add first_arg parameter.  Change args parameter
173         to vec.  Change all callers.
174         (add_function_candidate, add_conv_candidate): Likewise.
175         (add_template_candidate_real, add_template_candidate): Likewise.
176         (add_template_conv_candidate): Likewise.
177         (build_user_type_conversion_1): Handle first argument separately.
178         (resolve_args): Change return type and parameter type to vecs.
179         Change all callers.
180         (perform_overload_resolution): Change args parameter to vec.
181         Change all callers.
182         (build_new_function_call, build_operator_new_call): Likewise.
183         (add_candidates): Likewise.
184         (build_op_call): New globally visible function, built from and
185         replacing static function build_object_call.
186         (build_new_op): Don't handle CALL_EXPR.  Build vec, not tree_list,
187         of arguments.
188         (build_op_delete_call): Build vec to pass to
189         cp_build_function_call_vec.
190         (build_temp): Build vec to pass to build_special_member_call.
191         (convert_like_real): Likewise.
192         (perform_direct_initialization_if_possible): Likewise.
193         (build_over_call): Handle first_arg field.  Use build_call_array
194         rather than build_call_list.
195         (build_special_member_call): Change args parameter to vec.  Change
196         all callers.
197         (build_new_method_call): Likewise.
198         * init.c (expand_default_init): Change parms to vec.
199         (build_raw_new_expr): Change placement and init to vecs.  Change
200         all callers.
201         (build_new_1, build_new): Likewise.
202         * class.c (resolve_address_of_overloaded_function): Build array to
203         pass to fn_type_unification.
204         * pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
205         build_new.  For CALL_EXPR create a vec rather than a tree_list;
206         expand a pack if necessary.
207         (fn_type_unification): Change args parameter to const tree *.  Add
208         nargs parameter.  Change all callers.
209         (type_unification_real): Likewise.
210         (unify): Build array to pass to type_unification_real.
211         (get_bindings): Build array to pass to fn_type_unification.
212         (any_type_dependent_arguments_p): Change args parameter to a vec.
213         Change all callers.
214         (make_args_non_dependent): Renamed from build_non_dependent_args.
215         Change return type to void.  Change parameter type to vec.  Change
216         all callers.
217         (do_auto_deduction): Pass an array to type_unification_real.
218         * semantics.c (perform_koenig_lookup): Change args to vec.  Change
219         all callers.
220         (finish_call_expr): Change args to vec.  Change all callers.  Call
221         build_op_call instead of passing CALL_EXPR to build_new_op.
222         (cxx_omp_create_clause_info): Allocate vec to pass to
223         build_special_member_call.
224         * decl2.c (build_offset_ref_call_from_tree): Change args parameter
225         to vec.  Change all callers.
226         * name-lookup.c (lookup_function_nonclass): Likewise.
227         (struct arg_lookup): Change args to vec.
228         (arg_assoc_namespace): Handle args as a vec.
229         (arg_assoc_args_vec): New static function.
230         (lookup_arg_dependent): Change args parameter to vec.  Change all
231         callers.
232         * method.c (do_build_assign_ref): Allocate vec to pass to
233         build_special_member_call.
234         * except.c (build_throw): Likewise.
235         * typeck2.c (build_functional_cast): Likewise.
236         * cvt.c (ocp_convert): Likewise.
237         * tree.c (build_min_non_dep_call_vec): Change last parameter to
238         vec.  Change all callers.
239         * cp-tree.h: Update declarations.
240         * name-lookup.h: Update declarations.
241
242 2009-05-20  Sandra Loosemore  <sandra@codesourcery.com>
243
244         * typeck.c (default_conversion): Check targetm.promoted_type.
245         * decl.c (grokdeclarator): Check targetm.invalid_return_type.
246         (grokparms): Check targetm.invalid_parameter_type.
247         * cvt.c (ocp_convert): Check targetm.convert_to_type.
248         (build_expr_type_conversion): Check targetm.promoted_type.
249
250 2009-05-19  Andrew Pinski  <andrew_pinski@playstation.sony.com>
251
252         * typeck.c (build_binary_op): Allow % on integal vectors.
253
254 2009-05-18  Jason Merrill  <jason@redhat.com>
255
256         Implement explicit conversions ops as specified in N2437.
257         * decl.c (grokdeclarator): Handle explicit conversion ops.
258         (check_initializer): Pass flags to store_init_value.
259         * decl2.c (maybe_emit_vtables): Likewise.
260         * init.c (expand_aggr_init_1): Likewise.
261         * call.c (convert_class_to_reference): Take flags parm,
262         check DECL_NONCONVERTING_P.
263         (build_user_type_conversion_1): Check DECL_NONCONVERTING_P.
264         (add_builtin_candidates): Simplify getting type of conversion.
265         (build_object_call): Likewise.  Check DECL_NONCONVERTING_P.
266         (implicit_conversion): Pass through LOOKUP_ONLYCONVERTING.
267         (reference_binding): Take flags parm.  Direct-initialize copy parm.
268         (add_function_candidate): Direct-initialize the copy parm.
269         (add_conv_candidate): Use LOOKUP_IMPLICIT, not LOOKUP_NORMAL.
270         (build_builtin_candidate): Add LOOKUP_ONLYCONVERTING.
271         (conditional_conversion): Likewise.
272         (convert_like_real): Only complain about DECL_NONCONVERTING_P
273         constructors.
274         (perform_implicit_conversion_flags): Add flags parm to
275         perform_implicit_conversion.  Improve diagnostics.
276         * cp-tree.h (LOOKUP_IMPLICIT): New macro.
277         (LOOKUP_COPY_PARM): New bit macro.
278         * cvt.c (build_expr_type_conversion): Check DECL_NONCONVERTING_P.
279         * typeck.c (convert_for_assignment): Take flags parm, pass it to
280         perform_implicit_conversion_flags.
281         (cp_build_modify_expr): Pass flags to convert_for_assignment.
282         (convert_for_initialization): Likewise.
283         * typeck2.c (store_init_value): Take flags parm, pass to
284         digest_init_flags.
285         (digest_init_flags): Add flags parm to digest_init.
286         (digest_init_r): Take flags parm, pass to convert_for_initialization.
287         (process_init_constructor_array): Pass it.
288         (process_init_constructor_record): Likewise.
289         (process_init_constructor_union): Likewise.
290
291 2009-05-16  Jason Merrill  <jason@redhat.com>
292
293         PR c++/40139
294         * pt.c (tsubst_qualified_id): Retain the type if we aren't dealing
295         with a dependent type.  Actually look up the destructor.
296         * semantics.c (finish_id_expression): Fix logic.
297         (finish_qualified_id_expr): Don't try to use 'this' if we aren't in
298         a function.
299         * typeck.c (build_x_unary_op): Diagnose taking the address of a
300         constructor or destructor.
301         * tree.c (get_first_fn): Handle OFFSET_REF.
302
303 2009-05-17  Joseph Myers  <joseph@codesourcery.com>
304
305         * tree.c (cxx_printable_name_internal): Allow consecutive
306         translated and untranslated cached copies of the name of the
307         current function.
308
309 2009-05-15  Ian Lance Taylor  <iant@google.com>
310
311         * cp-tree.h (enum cp_lvalue_kind_flags): Rename from
312         cp_lvalue_kind.  Change all uses.
313         (enum base_access_flags): Rename from enum base_access.  Change
314         all uses.
315         * parser.c (enum cp_parser_flags): Remove enum tag.
316
317 2009-05-15  Manuel López-Ibáñez  <manu@gcc.gnu.org>
318
319         PR 16302
320         * call.c (build_new_op): Update calls to warn_logical_operator.
321
322 2009-05-14  Ian Lance Taylor  <iant@google.com>
323
324         * class.c (layout_class_type): Change itk to unsigned int.
325         * decl.c (finish_enum): Change itk to unsigned int.
326         * parser.c (cp_parser_check_decl_spec): Change ds to int.  Remove
327         casts.
328
329 2009-05-13  David Mandelin <dmandelin@mozilla.com>:
330
331         * decl.c (duplicate_decls): Preserve parameter attributes.
332
333 2009-05-10  Jan Hubicka  <jh@suse.cz>
334
335         * decl2.c (cxx_callgraph_analyze_expr): Use
336         cgraph_mark_address_taken.
337
338 2009-05-10  Joseph Myers  <joseph@codesourcery.com>
339
340         * call.c (name_as_c_string): Call type_as_string_translate.
341         Translate identifiers to locale character set.
342         * cp-tree.h (lang_decl_name): Update prototype.
343         (type_as_string_translate, decl_as_string_translate,
344         cxx_printable_name_translate): Declare.
345         * cxx-pretty-print.c (M_): Define.
346         (pp_cxx_unqualified_id, pp_cxx_canonical_template_parameter): Mark
347         English fragments for conditional translation with M_.
348         * decl.c (grokdeclarator): Translate identifiers to locale
349         character set for diagnostics.
350         * error.c (M_): Define.
351         (dump_template_bindings, dump_type, dump_aggr_type,
352         dump_type_prefix, dump_global_iord, dump_simple_decl, dump_decl,
353         dump_function_decl, dump_template_parms, dump_expr,
354         dump_binary_op, op_to_string, assop_to_string): Mark English
355         fragments for conditional translation with M_.
356         (type_as_string): Disable translation of identifiers.
357         (type_as_string_translate): New.
358         (expr_as_string): Disable translation of identifiers.
359         (decl_as_string): Disable translation of identifiers.
360         (decl_as_string_translate): New.
361         (lang_decl_name): Add parameter translate.
362         (args_to_string): Call type_as_string_translate.
363         (cp_print_error_function): Call cxx_printable_name_translate.
364         (print_instantiation_full_context,
365         print_instantiation_partial_context): Call
366         decl_as_string_translate.
367         * parser.c (cp_lexer_get_preprocessor_token): Use %qE for
368         identifier in diagnostic.
369         * tree.c (cxx_printable_name): Change to
370         cxx_printable_name_internal.  Add parameter translate.
371         (cxx_printable_name, cxx_printable_name_translate): New wrappers
372         round cxx_printable_name_internal.
373
374 2009-05-08  H.J. Lu  <hongjiu.lu@intel.com>
375
376         PR c/36892
377         * call.c (build_call_a): Updated warn_deprecated_use call.
378         (build_over_call): Likewise.
379         * decl.c (grokdeclarator): Likewise.
380         (grokparms): Likewise.
381         * semantics.c (finish_id_expression): Likewise.
382         * typeck.c (build_class_member_access_expr): Likewise.
383         (finish_class_member_access_expr): Likewise.
384
385 2009-05-06  Dodji Seketeli  <dodji@redhat.com>
386
387         PR c++/17395
388         * pt.c (tsubst_copy) <case PARM_DECL>: We don't want to tsubst the
389         whole list of PARM_DECLs, just the current one.
390
391 2009-05-05  Shujing Zhao  <pearly.zhao@oracle.com>
392
393         * cp-tree.h:
394         (opname_tab, assignop_tab, update_member_visibility, yyerror, yyhook,
395         mangle_compound_literal): Remove unused declarations.
396         (build_vfield_ref, cxx_print_statistics, clone_function_decl,
397         adjust_clone_args, maybe_push_cleanup_level, pushtag, make_anon_name,
398         pushdecl_top_level_maybe_friend, pushdecl_top_level_and_finish,
399         check_for_out_of_scope_variable, print_other_binding_stack,
400         maybe_push_decl, cxx_mark_addressable, force_target_expr,
401         build_target_expr_with_type, finish_case_label,
402         cxx_maybe_build_cleanup, begin_eh_spec_block, finish_eh_spec_block,
403         check_template_keyword, cxx_omp_predetermined_sharing,
404         cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
405         cxx_omp_clause_assign_op, cxx_omp_clause_dtor, cxx_omp_finish_clause,
406         cxx_omp_privatize_by_reference): Rearrange the declarations line to
407         match the comment that indicates the .c file which the functions are
408         defined.
409         (cxx_print_xnode, cxx_print_decl, cxx_print_type,
410         cxx_print_identifier, cxx_print_error_function, pushdecl): Add comment.
411
412 2009-05-05  Nathan Sidwell  <nathan@codesourcery.com>
413
414         * typeck.c (cp_build_compound_expr): Require RHS to have a known
415         type.
416         * class.c (resolve_address_of_overloaded_function): Use
417         OVL_CURRENT for error message.
418         (instantiate_type): Forbid COMPOUND_EXPRs and remove code dealing
419         with them.  Do not copy the node.
420
421 2009-05-05  Jakub Jelinek  <jakub@redhat.com>
422
423         PR c++/40013
424         * pt.c (tsubst): If magic NOP_EXPR with side-effects has no type,
425         set it from its operand's type after tsubst_expr.
426
427 2009-05-04  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
428
429         PR c++/28152
430         * parser.c (cp_lexer_get_preprocessor_token):  Do not store the
431         canonical spelling for keywords.
432         (cp_parser_attribute_list): Use the canonical spelling for
433         keywords in attributes.
434
435 2009-05-01  Joseph Myers  <joseph@codesourcery.com>
436
437         * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id,
438         pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression,
439         pp_cxx_new_expression, pp_cxx_delete_expression,
440         pp_cxx_unary_expression, pp_cxx_assignment_operator,
441         pp_cxx_assignment_expression, pp_cxx_expression,
442         pp_cxx_function_specifier, pp_cxx_decl_specifier_seq,
443         pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq,
444         pp_cxx_exception_specification, pp_cxx_direct_declarator,
445         pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement,
446         pp_cxx_namespace_alias_definition, pp_cxx_template_parameter,
447         pp_cxx_canonical_template_parameter, pp_cxx_template_declaration,
448         pp_cxx_declaration, pp_cxx_typeid_expression,
449         pp_cxx_va_arg_expression, pp_cxx_offsetof_expression,
450         pp_cxx_trait_expression): Mostly use pp_string and
451         pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
452         for non-identifiers.  Mark English strings for translation.
453         * cxx-pretty-print.h (pp_cxx_ws_string): Define.
454         * error.c (dump_template_parameter, dump_template_bindings,
455         dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl,
456         dump_decl, dump_template_decl, dump_function_decl,
457         dump_parameters, dump_exception_spec, dump_template_parms,
458         dump_expr, dump_binary_op, dump_unary_op, op_to_string,
459         assop_to_string, args_to_string, cp_print_error_function,
460         print_instantiation_full_context,
461         print_instantiation_partial_context): Mostly use pp_string and
462         pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
463         for non-identifiers.  Mark English strings for translation.
464         (dump_global_iord): Mark strings for translation; use longer
465         strings instead of substituting single words.
466         (function_category): Return a format string marked for
467         translation, not a single word or phrase to substitute in a longer
468         phrase.
469
470 2009-04-28  Ben Elliston  <bje@au.ibm.com>
471
472         PR c++/35652
473         Revert:
474
475         2009-03-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
476
477         * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
478
479 2009-04-27  Ian Lance Taylor  <iant@google.com>
480
481         * semantics.c (finish_omp_clauses): Change type of c_kind to enum
482         omp_clause_code.
483
484 2009-04-27  Jakub Jelinek  <jakub@redhat.com>
485
486         PR c++/39875
487         * cvt.c (convert_to_void) <case INDIRECT_REF>: Only warn about
488         -Wunused-value if implicit.
489
490 2009-04-24  Ian Lance Taylor  <iant@google.com>
491
492         * call.c (build_temp): Change 0 to enum constant.
493         * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
494         type.
495         * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
496         * decl2.c (constrain_visibility): Likewise.
497         * parser.c (cp_lexer_get_preprocessor_token): Likewise.
498         (cp_parser_flags): Typedef to int rather than enum type.
499         (cp_parser_expression_stack_entry): Change prec field to enum
500         cp_parser_prec.
501
502         * typeck.c (build_modify_expr): Add lhs_origtype parameter.
503         Change all callers.
504
505 2009-04-22  Dodji Seketeli  <dodji@redhat.com>
506
507         PR c++/39639
508         * parser.c (cp_parser_template_argument_list): Display an error
509         when an ellipsis is not preceded by a parameter pack. Also, warn
510         about variadic templates usage without -std=c++0x.
511
512 2009-04-21  Taras Glek <tglek@mozilla.com>
513
514         * cp-tree.h: Update GTY annotations to new syntax.
515         * decl.c: Likewise.
516         * mangle.c: Likewise.
517         * name-lookup.c: Likewise.
518         * name-lookup.h: Likewise.
519         * parser.c: Likewise.
520         * pt.c: Likewise.
521         * rtti.c: Likewise.
522         * semantics.c: Likewise.
523         * typeck2.c: Likewise.
524
525 2009-04-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
526
527         PR c++/14875
528         * parser.c (cp_parser_error): Pass token->flags to c_parse_error.
529
530 2009-04-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
531
532         PR c++/35711
533         * typeck.c (check_for_casting_away_constness): We diagnose casting
534         away any qualifiers not just constness.
535         (casts_away_constness): Mention that it handles more than just
536         constness.
537         
538 2009-04-21  Joseph Myers  <joseph@codesourcery.com>
539
540         * ChangeLog, ChangeLog-1993, ChangeLog-1994, ChangeLog-1995,
541         ChangeLog-1996, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999,
542         ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003,
543         ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
544         ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, NEWS,
545         cfns.gperf: Add copyright and license notices.
546         * cfns.h: Regenerate.
547         * ChangeLog, ChangeLog-2004: Correct dates.
548
549 2009-04-21  Manuel López-Ibáñez  <manu@gcc.gnu.org>
550
551         PR 16202
552         * tree.c (lvalue_p_1): Use const_tree.
553         Use CONST_CAST_TREE to avoid warning.
554         (lvalue_p): Returns bool, receives const_tree.
555
556 2009-04-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
557
558         PR c++/13358
559         * parser.c (cp_parser_check_decl_spec): Drop redundant flags.
560         * error.c (pedwarn_cxx98): New.
561         * cp-tree.h (pedwarn_cxx98): Declare.
562
563 2009-04-20  Le-Chun Wu  <lcwu@google.com>
564
565         PR c++/39803
566         * init.c (build_vec_init): Set TREE_NO_WARNING on the
567         compiler-generated INDIRECT_REF expression.
568
569 2009-04-20  Ian Lance Taylor  <iant@google.com>
570
571         * typeck.c (build_function_call_vec): New function.
572         (cp_build_function_call): Only pass first parameter to
573         objc_rewrite_function_call.
574         (build_modify_expr): Add rhs_origtype parameter.  Change all
575         callers.
576         * decl.c (finish_decl): Add origtype parameter.  Change all
577         callers.
578         * semantics.c (finish_call_expr): Pass VEC to
579         resolve_overloaded_builtin.
580
581 2009-04-20  Ian Lance Taylor  <iant@google.com>
582
583         * cp-tree.h (base_access): Change typedef to int.
584         * parser.c (cp_parser_omp_flush): Change 0 to OMP_CLAUSE_ERROR.
585         (cp_parser_omp_threadprivate): Likewise.
586         * pt.c (unify_pack_expansion): Add casts to enum type.
587
588 2009-04-19  Manuel López-Ibáñez  <manu@gcc.gnu.org>
589
590         PR c/32061
591         PR c++/36954
592         * call.c (build_new_op): Save the original codes of operands
593         before folding.
594
595 2009-04-18  Kazu Hirata  <kazu@codesourcery.com>
596
597         * cp-tree.h: Remove the prototype for insert_block.
598         * decl.c (insert_block): Remove.
599
600 2009-04-16  Ian Lance Taylor  <iant@google.com>
601
602         * cp-tree.h (enum tsubst_flags): Rename from enum tsubst_flags_t.
603         (tsubst_flags_t): Change typedef from enum type to int.
604
605 2009-04-16  Paolo Bonzini  <bonzini@gnu.org>
606
607         * decl.c (check_initializer): Use TYPE_VECTOR_OPAQUE
608         instead of targetm.vector_opaque_p.
609
610 2009-04-15  Le-Chun Wu  <lcwu@google.com>
611
612         PR c++/39551
613         * call.c (build_over_call): Set TREE_NO_WARNING on the
614         compiler-generated INDIRECT_REF expression.
615         * cvt.c (convert_to_void): Emit warning when stripping off
616         INDIRECT_REF.
617
618 2009-04-14  Diego Novillo  <dnovillo@google.com>
619
620         * parser.c (cp_parser_type_specifier_seq): Move call to
621         invoke_plugin_callbacks ...
622         (cp_parser_type_specifier_seq): ... here.
623
624 2009-04-14  Le-Chun Wu  <lcwu@google.com>
625
626         * Make-lang.in: Modify dependencies of files including plugin.h.
627         * decl.c (finish_function): Call invoke_plugin_callbacks.
628         * parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.
629
630 2009-04-14  Jason Merrill  <jason@redhat.com>
631
632         PR c++/39763
633         * name-lookup.c (pushdecl_maybe_friend): Avoid all warnings
634         about shadowing by tentative parms.
635
636 2009-04-13  Jason Merrill  <jason@redhat.com>
637
638         PR c++/39480
639         * call.c (build_over_call): Don't call memcpy if the target is
640         the same as the source.
641
642 2009-04-13  Jason Merrill  <jason@redhat.com>
643
644         PR c++/39750
645         * pt.c (uses_template_parms): Handle CONSTRUCTOR.
646
647 2009-04-12  Jason Merrill  <jason@redhat.com>
648
649         PR c++/39742
650         * call.c (joust): Don't crash on variadic fn.
651
652 2009-04-10  Jason Merrill  <jason@redhat.com>
653
654         PR c++/28301
655         * parser.c (cp_parser_skip_to_end_of_block_or_statement): Return
656         if we see a close brace without an open brace.
657
658 2009-04-10  H.J. Lu  <hongjiu.lu@intel.com>
659
660         * parser.c (cp_parser_class_specifier): Remove the unused
661         has_trailing_semicolon.
662
663 2009-04-10  Manuel López-Ibáñez  <manu@gcc.gnu.org>
664
665         PR  c++/20118
666         * parser.c (cp_parser_check_template_parameters): Take a
667         cp_declarator parameter.
668         (cp_parser_elaborated_type_specifier): Update to
669         cp_parser_check_template_parameters.
670         (cp_parser_class_head): Likewise.
671         (cp_parser_check_declarator_template_parameters): Likewise.
672         (cp_parser_check_template_parameters): Handle first the non-error
673         conditions. Give more accurate diagnostics if a declarator is
674         given. 
675
676 2009-04-08  Jason Merrill  <jason@redhat.com>
677
678         PR c++/25185
679         * error.c (dump_aggr_type): Chase template typedefs if
680         -fno-pretty-templates.
681
682 2009-04-08  Dodji Seketeli  <dodji@redhat.com>
683
684         PR c++/39637
685         * parser.c (cp_parser_enumerator_definition): Make sure the
686         initializer of the enumerator doesn't contain any bare parameter pack.
687
688 2009-04-07  Jason Merrill  <jason@redhat.com>
689
690         PR c++/34691
691         * name-lookup.c (merge_functions): Keep multiple extern "C" functions.
692         * call.c (joust): Complain about mismatched default arguments
693         in extern "C" functions.
694         * class.c (resolve_address_of_overloaded_function): Handle multiple
695         extern "C" functions.
696         * pt.c (resolve_overloaded_unification): Likewise.
697
698 2009-04-07  Jason Merrill  <jason@redhat.com>
699
700         PR c++/25185
701         * error.c (dump_function_decl): Don't pretty-print templates
702         if -fno-pretty-templates.
703         (count_non_default_template_args): Print all args if
704         -fno-pretty-templates.
705
706 2009-04-06  Jason Merrill  <jason@redhat.com>
707
708         PR c++/35146
709         * pt.c (fn_type_unification): For DEDUCE_EXACT check that
710         the deduced template arguments give us the parameter types
711         we're looking for.
712
713 2009-04-05  Giovanni Bajo <giovannibajo@libero.it>
714             Jason Merrill  <jason@redhat.com>
715
716         PR c++/14912
717         * error.c (count_non_default_template_args): New fn.
718         (dump_template_parms): Call it.
719         (dump_template_argument_list): Call it.  Add parms parm.
720         (dump_template_argument): Adjust call to dump_template_argument_list.
721         (dump_type, dump_decl): Likewise.
722         (dump_template_bindings): Refactor logic.
723
724 2009-04-03  Jason Merrill  <jason@redhat.com>
725
726         PR c++/25185
727         * error.c (dump_template_bindings): Look through typedefs in
728         typename results.
729         (dump_type) [TYPENAME_TYPE]: Print the typedef name if any.
730         (find_typenames_r): Also collect typedefs.
731         * pt.c (unify): Strip typedefs.
732
733         PR c++/39608
734         * semantics.c (finish_id_expression): Don't assume a dependent
735         member of the current instantiation isn't a valid integral
736         constant expression.  Check dependent_scope_p.
737         * pt.c (dependent_scope_p): Check TYPE_P.
738         (tsubst_copy): If args is null, just return.
739
740 2009-04-02  Jason Merrill  <jason@redhat.com>
741
742         PR c++/25185
743         * error.c (find_typenames, find_typenames_r): New fns.
744         (dump_function_decl): Call find_typenames.
745         (dump_template_bindings): Print typenames as well.
746         * pt.c (tsubst): Non-static.
747         * cp-tree.h: Declare it.
748
749 2009-04-02  Dodji Seketeli  <dodji@redhat.com>
750
751         PR c++/26693
752         * decl2.c (grokfield): when a typedef appears in a
753         class, create the typedef variant type node for it.
754         (save_template_attributes): Creating typedef variant type node
755          here is now useless.
756         * decl.c (grokdeclarator): If the typedef'ed struct/class was
757         anonymous, set the proper type name to all its type variants.
758         (xref_basetypes) : Fixup the variant types after setting
759         TYPE_BINFO on REF.
760         * name-lookup.c (pushdecl_maybe_friend): Reuse the
761         set_underlying_type function to install typedef variant types.
762         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
763         macro.
764         (append_type_to_template_for_access_check): New entry points.
765         * semantics.c (check_accessibility_of_qualified_id):
766         When a typedef that is a member of a class appears in a template,
767         add it to the template. It will be ...
768         * class.c (finish_struct_bits): Split type variant fixup into ...
769         (fixup_type_variants): A new entry point.
770         * pt.c (instantiate_class_template, instantiate_template ): ... access
771         checked at template instantiation time.
772         (resolve_type_name_type): The type name should be the name of the
773         main type variant.
774         (retrieve_specialization): Specializations of template typedefs aren't
775         to looked up in DECL_TEMPLATE_INSTANTIATIONS (tmpl).
776         (append_type_to_template_for_access_check): New entry point.
777         (tsubst_decl): For typedefs, build the variant type from the correct
778         original type.
779         (get_class_bindings): Fix function comment.
780         (perform_typedefs_access_check): New entry point.
781
782 2009-03-31  Jason Merrill  <jason@redhat.com>
783
784         PR c++/34691
785         * name-lookup.c (pushdecl_maybe_friend): Diagnose mismatched
786         extern "C" declarations.
787
788         C++ DR 613
789         * semantics.c (finish_non_static_data_member): Allow such references
790         without an associated object in sizeof/decltype/alignof.
791
792         * ptree.c (cxx_print_decl): Pretty-print full name of
793         function/template.
794         (cxx_print_type): Pretty-print full name of class.
795
796         * decl.c (grokdeclarator): Reject pointer to qualified function
797         type.
798
799         PR c++/37806, core issue 547
800         * typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals
801         to a typedef.
802         * tree.c (cp_build_qualified_type_real): Don't apply restrict to a 
803         function type.
804         * decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG.
805         * decl.c (groktypename): Add is_template_arg parameter.
806         (grokdeclarator): Allow function cv-quals on a template type arg.
807         * parser.c (cp_parser_new_type_id, cp_parser_type_id): Add
808         is_template_arg argument in calls to groktypename.
809         * cp-tree.h: Adjust prototype.
810         * error.c (dump_type_prefix, dump_type_suffix): Fix plain 
811         FUNCTION_TYPE printing.
812         
813         * mangle.c (write_expression): Mangle dependent name as
814         source-name.
815
816         PR c++/38030, 38850, 39070
817         * pt.c (type_dependent_expression_p_push): New fn.
818         (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
819         substitution makes the call non-dependent.  Preserve koenig_p.
820         * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
821         for non-dependent calls.
822         * semantics.c (finish_call_expr): Revert earlier changes.
823         * cp-tree.h: Revert change to finish_call_expr prototype.
824
825 2009-03-29  Joseph Myers  <joseph@codesourcery.com>
826
827         PR preprocessor/34695
828         * cp-tree.h (cp_cpp_error): Remove.
829         * error.c (cp_cpp_error): Remove.
830         * parser.c (cp_lexer_new_main): Set done_lexing instead of
831         client_diagnostic and error callback.
832
833 2009-03-28  Paolo Bonzini  <bonzini@gnu.org>
834
835         * cp/cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
836         * cp/cp-objcp-common.c (cxx_staticp): Remove.
837         * cp/cp-tree.h (cxx_staticp): Remove.
838
839 2009-03-28  Jakub Jelinek  <jakub@redhat.com>
840
841         PR c++/39554
842         * parser.c (cp_parser_postfix_expression): Don't call
843         warning_if_disallowed_function_p.
844
845 2009-03-27  Jan Hubicka  <jh@suse.cz>
846
847         * except.c (choose_personality_routine): Set terminate_node to abort
848         for java exceptions.
849
850 2009-03-27  Dodji Seketeli  <dodji@redhat.com>
851             Jakub Jelinek  <jakub@redhat.com>
852
853         PR debug/37959
854         * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
855         (cp_function_decl_explicit_p): New prototype.
856         * cp-objcp-common.c (cp_function_decl_explicit_p): New function.
857
858 2009-03-27  Andrew Pinski  <andrew_pinski@playstation.sony.com>
859
860         PR c++/38638
861         * parser.c (cp_parser_elaborated_type_specifier): If we have a
862         typename tag and don't have either a TYPE_DECL or a
863         TEMPLATE_ID_EXPR, set the type to NULL.
864
865 2009-03-27  Simon Martin  <simartin@users.sourceforge.net>
866
867         PR c++/37647
868         * decl.c (grokdeclarator): Reject [con|de]stuctors in a non-class
869         scope.
870
871 2009-03-27  Simon Martin  <simartin@users.sourceforge.net>
872
873         PR c++/29727
874         * decl.c (check_array_designated_initializer): Handle error_mark_node.
875
876 2009-03-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
877
878         PR c++/35652
879         * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
880
881 2009-03-26  Andrew Haley  <aph@redhat.com>
882
883         PR C++/39380
884         * decl2.c (possibly_inlined_p): If java exceptions are in use
885         don't inline a decl unless it is explicitly marked inline.
886         * lex.c: (pragma_java_exceptions): New variable.
887         (handle_pragma_java_exceptions): Set pragma_java_exceptions.
888         * cp-tree.h (pragma_java_exceptions): Declare new variable.
889
890 2009-03-24  Jason Merrill  <jason@redhat.com>
891
892         PR c++/28274
893         * name-lookup.c (pushdecl_maybe_friend): Check default args later.
894
895 2009-03-23  Jakub Jelinek  <jakub@redhat.com>
896
897         PR c/39495
898         * semantics.c (handle_omp_for_class_iterator): Swap cond operands and
899         code if iter is the second operand.
900         * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p
901         argument.  If it is set, don't build the toplevel expression with
902         build_x_binary_op, but build2.
903         (cp_parser_assignment_expression,  cp_parser_omp_for_incr): Adjust
904         callers.
905         (cp_parser_omp_for_cond): Don't assume the first operand of the
906         comparison must be decl.
907
908 2009-03-23  Jason Merrill  <jason@redhat.com>
909
910         PR c++/37729
911         * pt.c (make_fnparm_pack): Split out from...
912         (instantiate_decl): ...here.
913         (tsubst_pack_expansion): Handle being called in a late-specified
914         return type.
915
916         PR c++/39526
917         * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
918         a parm with a parm.
919
920 2009-03-20  Jason Merrill  <jason@redhat.com>
921
922         PR c++/28879
923         * parser.c (cp_parser_direct_declarator): In a template, wrap 
924         non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
925         * pt.c (tsubst): Preserve it in a partial instantiation.
926         (dependent_type_p_r): Don't check value_dependent_expression_p.
927         * decl.c (compute_array_index_type): Don't check
928         value_dependent_expression_p if TREE_SIDE_EFFECTS.
929
930         C++ core issue 703
931         * typeck2.c (check_narrowing): Don't complain about loss of 
932         precision when converting a floating-point constant.
933
934 2009-03-19  Jakub Jelinek  <jakub@redhat.com>
935
936         PR c/39495
937         * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
938         (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
939
940 2009-03-18  Jakub Jelinek  <jakub@redhat.com>
941
942         * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
943         (eof_token): Adjust.
944
945 2009-03-18  H.J. Lu  <hongjiu.lu@intel.com>
946
947         PR c++/39425
948         * parser.c (cp_parser_explicit_specialization): Don't skip the
949         rest of the specialization when begin_specialization returns
950         false.
951
952 2009-03-17  Jason Merrill  <jason@redhat.com>
953
954         * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
955         (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
956         * pt.c (check_explicit_specialization): Likewise.
957         (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
958         local specialization.
959         * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
960         * decl2.c (parm_index): New fn.
961         * semantics.c (finish_decltype_type): Don't use describable_type.
962         * mangle.c (write_expression): Likewise.  Mangle ALIGNOF_EXPR.
963         Give a sorry for unsupported codes rather than crash.  Mangle
964         conversions with other than 1 operand.  New mangling for PARM_DECL.
965         * operators.def (ALIGNOF_EXPR): Mangle as "az".
966
967 2009-03-17  Jing Yu  <jingyu@google.com>
968
969         PR middle-end/39378
970         * method.c (use_thunk): Change is_thunk from crtl to cfun.
971
972 2009-03-17  Paolo Carlini  <paolo.carlini@oracle.com>
973
974         PR c++/39475
975         * semantics.c (check_trait_type): New.
976         (finish_trait_expr): Use it.
977
978 2009-03-17  Jakub Jelinek  <jakub@redhat.com>
979
980         * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
981         instead of calling imported_module_or_decl debug hook if
982         building_stmt_tree ().
983         * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
984         is a NAMESPACE_DECL.
985
986         PR debug/37890
987         * name-lookup.c (do_namespace_alias): Don't call global_decl debug
988         hook at function scope.
989
990         PR debug/39471
991         * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
992         on IMPORTED_DECL.
993
994 2009-03-09  Jakub Jelinek  <jakub@redhat.com>
995
996         PR c++/39371
997         * semantics.c (finish_switch_cond): Don't call get_unwidened.
998         * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
999         instead of TREE_TYPE (cond).
1000
1001 2009-03-08  H.J. Lu  <hongjiu.lu@intel.com>
1002
1003         PR c++/39060
1004         * parser.c (cp_parser_late_parsing_default_args): Continue
1005         the loop when cp_parser_assignment_expression returns
1006         error_mark_node.
1007
1008 2009-03-07  Jason Merrill  <jason@redhat.com>
1009
1010         PR c++/39367
1011         * init.c (build_new_1): Don't use a VLA type.
1012         (build_vec_init): Handle getting a pointer for BASE.
1013
1014 2009-03-06  H.J. Lu  <hongjiu.lu@intel.com>
1015
1016         PR c++/37520
1017         * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
1018         when mangling symbols.
1019
1020 2009-03-06  Paolo Carlini  <paolo.carlini@oracle.com>
1021
1022         PR c++/33492
1023         * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
1024
1025 2009-03-06  Alexandre Oliva  <aoliva@redhat.com>
1026
1027         * decl.c (record_builtin_java_type): Use canonicalized integer
1028         types.
1029
1030 2009-03-04  Jason Merrill  <jason@redhat.com>
1031
1032         PR c++/38908
1033         * class.c (is_really_empty_class): New fn.
1034         * cp-tree.h: Declare it.
1035         * cp-objcp-common.c (cp_expr_size): Use it.
1036
1037         PR c++/13549
1038         * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
1039         * parser.c (cp_parser_postfix_expression): Call it for 
1040         TEMPLATE_ID_EXPR.
1041         * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
1042         (get_first_fn): Likewise.
1043
1044         PR c++/9634
1045         PR c++/29469
1046         PR c++/29607
1047         Implement DR 224.
1048         * decl.c (make_typename_type): Do look inside currently open classes.
1049         * parser.c (cp_parser_lookup_name): Likewise.
1050         (cp_parser_template_name): Likewise.
1051         * pt.c (dependent_scope_p): New function.
1052         * cp-tree.h: Declare it.
1053         * class.c (currently_open_class): Return fast if T isn't a class.
1054
1055 2009-02-26  H.J. Lu  <hongjiu.lu@intel.com>
1056
1057         PR c++/37789
1058         * parser.c (cp_parser_mem_initializer): Return error_mark_node
1059         if cp_parser_mem_initializer_id returns error_mark_node.
1060
1061 2009-02-24  Richard Guenther  <rguenther@suse.de>
1062
1063         PR c++/39242
1064         * pt.c (instantiate_decl): Do not instantiate extern, non-inline
1065         declared functions.
1066
1067 2009-02-23  H.J. Lu  <hongjiu.lu@intel.com>
1068
1069         PR c++/36411
1070         * pt.c (coerce_template_template_parms): Return 0 if parameter
1071         is error_mark_node.
1072
1073 2009-02-23  Jason Merrill  <jason@redhat.com>
1074
1075         * pt.c (unify): Call maybe_adjust_types_for_deduction when
1076         deducing from an initializer list.
1077
1078 2009-02-20  Jason Merrill  <jason@redhat.com>
1079
1080         PR c++/39225
1081         * decl.c (grokdeclarator): Handle ~identifier.
1082
1083 2009-02-19  Jakub Jelinek  <jakub@redhat.com>
1084
1085         PR target/39175
1086         * decl2.c (determine_visibility): If visibility changed and
1087         DECL_RTL has been already set, call make_decl_rtl to update symbol
1088         flags.
1089
1090 2009-02-19  H.J. Lu  <hongjiu.lu@intel.com>
1091
1092         PR c++/39188
1093         * cp-tree.h (maybe_commonize_var): New.
1094
1095         * decl.c (maybe_commonize_var): Make it extern.
1096
1097         * decl2.c (finish_anon_union): Call maybe_commonize_var.
1098
1099 2009-02-18  H.J. Lu  <hongjiu.lu@intel.com>
1100
1101         PR c++/39219
1102         * parser.c (cp_parser_enum_specifier): Apply all attributes.
1103
1104 2009-02-18  Jason Merrill  <jason@redhat.com>
1105
1106         * cfns.h: Tweak pathname for cfns.gperf.
1107
1108 2009-02-13  Jason Merrill  <jason@redhat.com>
1109
1110         PR c++/39070
1111         * semantics.c (finish_call_expr): Change koenig_p parm to int.
1112         If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
1113         * cp-tree.h: Adjust prototype.
1114         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
1115
1116 2009-02-12  Jason Merrill  <jason@redhat.com>
1117
1118         PR c++/38950
1119         * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
1120
1121 2009-02-11  Jason Merrill  <jason@redhat.com>
1122
1123         PR c++/39153
1124         * decl2.c (cp_write_global_declarations): 
1125         Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
1126
1127         PR c++/30111
1128         * init.c (build_value_init_noctor): Split out from...
1129         (build_value_init): ...here.
1130         (expand_aggr_init_1): Handle value-initialization.
1131         * cp-tree.h: Add declaration.
1132         * class.c (type_has_user_provided_constructor): 
1133         Handle non-class arguments.
1134
1135 2009-02-10  Jason Merrill  <jason@redhat.com>
1136
1137         PR c++/38649
1138         * class.c (defaultable_fn_p): Handle ... properly.
1139
1140         PR c++/36744
1141         * tree.c (lvalue_p_1): Condition rvalue ref handling on
1142         treat_class_rvalues_as_lvalues, too.
1143
1144 2009-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
1145
1146         PR c++/34397
1147         * typeck.c (build_x_array_ref): New.
1148         * cp-tree.h: Declare it.
1149         * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
1150
1151 2009-02-09  Jason Merrill  <jason@redhat.com>
1152
1153         PR c++/39109
1154         * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
1155         * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
1156         * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
1157         * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
1158         for build_value_init TARGET_EXPR.
1159         * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
1160
1161 2009-02-06  Paolo Carlini  <paolo.carlini@oracle.com>
1162
1163         PR c++/35147
1164         PR c++/37737
1165         * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
1166
1167 2009-02-04  Jakub Jelinek  <jakub@redhat.com>
1168
1169         PR c++/39095
1170         * operators.def: Use COMPONENT_REF code for ->/pt operator again,
1171         remove ./dt operator.
1172         * mangle.c (write_expression): Handle COMPONENT_REF after handling
1173         ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
1174         write_string ("dt") instead of using operators.def.
1175
1176 2009-02-03  Jason Merrill  <jason@redhat.com>
1177
1178         * typeck.c (cp_build_unary_op): Only complain about taking address
1179         of main if pedantic.
1180
1181 2009-02-03  Jakub Jelinek  <jakub@redhat.com>
1182
1183         PR inline-asm/39059
1184         * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
1185
1186         PR c++/39056
1187         * typeck2.c (digest_init_r): Don't call process_init_constructor
1188         for COMPLEX_TYPE.
1189
1190 2009-02-03  Paolo Bonzini  <bonzini@gnu.org>
1191
1192         PR c++/36897
1193         * pt.c (convert_nontype_argument_function): Expect expr to be an
1194         ADDR_EXPR.
1195
1196         PR c++/37314
1197         * typeck.c (merge_types): Call resolve_typename_type if only
1198         one type is a typename.
1199
1200 2009-02-02  Jason Merrill  <jason@redhat.com>
1201
1202         PR c++/39054
1203         * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node 
1204         in BIT_NOT_EXPR.
1205
1206 2009-02-01  Paolo Carlini  <paolo.carlini@oracle.com>
1207
1208         PR c++/39053
1209         * parser.c (cp_parser_pure_specifier): If there are no tokens left
1210         do not call cp_lexer_consume_token.
1211
1212 2009-01-30  Jakub Jelinek  <jakub@redhat.com>
1213
1214         PR c++/39028
1215         * parser.c (cp_parser_already_scoped_statement): Handle __label__
1216         declarations.
1217
1218 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
1219
1220         PR c++/33465
1221         * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
1222
1223 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
1224
1225         PR c++/38655
1226         * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
1227
1228 2009-01-29  Paolo Carlini  <paolo.carlini@oracle.com>
1229
1230         * typeck.c (invalid_nonstatic_memfn_p): Use
1231         DECL_NONSTATIC_MEMBER_FUNCTION_P.
1232
1233 2009-01-27  Paolo Carlini  <paolo.carlini@oracle.com>
1234
1235         PR c++/37554
1236         * call.c (build_over_call): If convert_for_arg_passing returns
1237         error_mark_node unconditionally return it.
1238
1239 2009-01-22  Adam Nemet  <anemet@caviumnetworks.com>
1240
1241         * class.c (check_field_decls): Also inherit packed for bitfields
1242         regardless of their type.
1243
1244 2009-01-22  Dodji Seketeli  <dodji@redhat.com>
1245
1246         PR c++/38930
1247         * decl2.c (grokfield): Reverting changes of PR c++/26693
1248         (save_template_attributes): Likewise.
1249         * decl.c (grokdeclarator): Likewise.
1250         * name-lookup.c (pushdecl_maybe_friend): Likewise.
1251         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
1252         (append_type_to_template_for_access_check): Likewise.
1253         * semantics.c (check_accessibility_of_qualified_id): Likewise.
1254         * pt.c (instantiate_class_template, instantiate_template ): Likewise.
1255         (tsubst): Likewise.
1256         (resolve_type_name_type): Likewise.
1257         (append_type_to_template_for_access_check): Likewise.
1258
1259 2009-01-21  Dodji Seketeli  <dodji@redhat.com>
1260
1261         PR c++/26693
1262         * decl2.c (grokfield): when a typedef appears in a
1263         class, create the typedef variant type node for it.
1264         (save_template_attributes): Creating typedef variant type node
1265          here is now useless.
1266         * decl.c (grokdeclarator): If the typedef'ed struct/class was
1267         anonymous, set the proper type name to all its type variants.
1268         * name-lookup.c (pushdecl_maybe_friend): Reuse the
1269         set_underlying_type function to install typedef variant types.
1270         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
1271         macro.
1272         (append_type_to_template_for_access_check): New entry points.
1273         * semantics.c (check_accessibility_of_qualified_id):
1274         When a typedef that is a member of a class appears in a template,
1275         add it to the template. It will be ...
1276         * pt.c (instantiate_class_template, instantiate_template ): ... access
1277         checked at template instantiation time.
1278         (tsubst): Handle the case of being called with NULL args.
1279         (resolve_type_name_type): The type name should be the name of the
1280         main type variant.
1281         (append_type_to_template_for_access_check): New entry point.
1282
1283 2009-01-19  Jason Merrill  <jason@redhat.com>
1284
1285         PR c++/23287
1286         * parser.c (cp_parser_unqualified_id): In a template,
1287         accept ~identifier.
1288         * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
1289
1290 2009-01-16  Jason Merrill  <jason@redhat.com>
1291
1292         PR c++/38877
1293         * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
1294         * init.c (build_new): Don't call describable_type unless we
1295         have an auto.
1296
1297         PR c++/29470
1298         * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
1299
1300         PR c++/38579
1301         * search.c (protected_accessible_p): N doesn't vary.
1302
1303 2009-01-15  Jason Merrill  <jason@redhat.com>
1304
1305         PR c++/38850
1306         * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
1307         accept hidden friends.
1308
1309 2009-01-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1310
1311         PR C++/29388
1312         * decl.c (grokdeclarator): Check for a non namespace/class context.
1313
1314 2009-01-15  Jason Merrill  <jason@redhat.com>
1315
1316         PR c++/36334
1317         PR c++/37646
1318         * tree.c (lvalue_p_1): Handle BASELINK.  A COMPONENT_REF to
1319         a function isn't necessarily an lvalue. Take tree, not const_tree.
1320         (lvalue_p, real_lvalue_p): Take tree, not const_tree.
1321         * typeck.c (lvalue_or_else): Likewise.
1322         * cp-tree.h: Adjust prototypes.
1323
1324 2009-01-15  Steve Ellcey  <sje@cup.hp.com>
1325
1326         PR c++/38357
1327         * pt.c (tsubst): Check for NULL args.
1328
1329 2009-01-15  Dodji Seketeli  <dodji@redhat.com>
1330
1331         PR c++/38636
1332         * name-lookup.c (pushtag): Don't create members to types that are not
1333         being created.
1334
1335 2009-01-14  Nick Clifton  <nickc@redhat.com>
1336
1337         PR c++/37862
1338         * parser.c: Pass cp_id_kind computed in
1339         cp_parser_postfix_dot_deref_expression to
1340         cp_parser_primary_expression.
1341
1342 2009-01-13  Jakub Jelinek  <jakub@redhat.com>
1343
1344         PR c++/38795
1345         * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
1346         STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
1347         as CAST_EXPR.
1348
1349 2009-01-12  Jason Merrill  <jason@redhat.com>
1350             Steve Ellcey  <sje@cup.hp.com>
1351
1352         PR c++/35109
1353         * name-lookup.c (lookup_name_real): Keep looking past a hidden 
1354         binding.
1355
1356 2009-01-12  Dodji Seketeli  <dodji@redhat.com>
1357
1358         PR c++/36019
1359         * pt.c (parameter_of_template_p): New function.
1360         * cp-tree.h: Declare it.
1361         * name-lookup.c (binding_to_template_parms_of_scope_p): New
1362         function.
1363         (outer_binding): Take template parameters in account when looking for
1364         a name binding.
1365
1366 2009-01-12  Jason Merrill  <jason@redhat.com>
1367
1368         PR c++/31488
1369         * tree.c (pod_type_p): Return 1 for structs created by the back end.
1370
1371 2009-01-12  Jakub Jelinek  <jakub@redhat.com>
1372
1373         PR c/32041
1374         * parser.c (cp_parser_builtin_offsetof): Allow `->' in
1375         offsetof member-designator, handle it as `[0].'.
1376
1377         PR c++/38794
1378         * decl.c (start_function): If grokdeclarator hasn't returned
1379         FUNCTION_DECL nor error_mark_node, issue diagnostics.
1380
1381 2009-01-11  Jakub Jelinek  <jakub@redhat.com>
1382
1383         PR c++/36254
1384         * cp-gimplify.c (genericize_if_stmt): Renamed from ...
1385         (gimplify_if_stmt): ... this.
1386         (cp_gimplify_expr): Don't handle IF_STMT here.
1387         (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
1388
1389 2009-01-10  Andrew Pinski  <pinskia@gmail.com>
1390
1391         PR c++/38648
1392         * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
1393
1394         PR c++/36695
1395         * typeck2.c (build_functional_cast): Check for reference type and NULL
1396         PARMS.
1397
1398 2009-01-09  Steve Ellcey  <sje@cup.hp.com>
1399
1400         * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
1401
1402 2009-01-09  Jakub Jelinek  <jakub@redhat.com>
1403
1404         PR c++/35335
1405         * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
1406
1407 2009-01-09  John F. Carr  <jfc@mit.edu>
1408
1409         PR c++/37877
1410         * parser.c (cp_parser_class_specifier): Clear
1411         parser->in_unbraced_linkage_specification_p while parsing class
1412         specifiers.
1413
1414 2009-01-07  Jakub Jelinek  <jakub@redhat.com>
1415
1416         PR c++/38725
1417         * semantics.c (finish_goto_stmt): Convert destination to
1418         void *.
1419
1420 2009-01-06  Jason Merrill  <jason@redhat.com>
1421
1422         PR c++/35297
1423         PR c++/35477
1424         PR c++/35784
1425         PR c++/36846
1426         PR c++/38276
1427         * pt.c (check_default_tmpl_args): Don't complain about
1428         out-of-order parameter packs in the enclosing class
1429         or parameter packs after default args.
1430         (coerce_template_parms): If we have more than one
1431         parameter pack, don't flatten argument packs.
1432         (template_args_equal): Handle argument packs.
1433         (comp_template_args): Don't flatten argument packs.
1434         (check_instantiated_arg): Split out from...
1435         (check_instantiated_args): Here.  Handle arg packs.
1436         (convert_template_argument): Just check that nontype argument
1437         packs have the right type.
1438
1439 2009-01-05  Dodji Seketeli  <dodji@redhat.com>
1440
1441         PR c++/38472
1442         * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
1443
1444 2009-01-05  Jason Merrill  <jason@redhat.com>
1445
1446         PR c++/38698
1447         * typeck2.c (process_init_constructor_union): Handle union with
1448         no fields.
1449
1450         * mangle.c (write_expression): Remove mangling for zero-operand
1451         casts.
1452
1453         PR c++/38701
1454         * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
1455         defaulting.
1456
1457         PR c++/38702
1458         * class.c (defaultable_fn_p): Only operator== can be a copy
1459         assignment operator.
1460
1461 2009-01-02  Jason Merrill  <jason@redhat.com>
1462
1463         PR c++/38698
1464         * typeck2.c (process_init_constructor_union): Handle excess
1465         initializers.
1466         (process_init_constructor_record): Likewise.
1467
1468         PR c++/38684
1469         * typeck2.c (digest_init_r): Don't use process_init_constructor
1470         for non-aggregate classes.
1471
1472 \f
1473 Copyright (C) 2009 Free Software Foundation, Inc.
1474
1475 Copying and distribution of this file, with or without modification,
1476 are permitted in any medium without royalty provided the copyright
1477 notice and this notice are preserved.