OSDN Git Service

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