OSDN Git Service

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