OSDN Git Service

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