OSDN Git Service

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