OSDN Git Service

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