OSDN Git Service

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