OSDN Git Service

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