OSDN Git Service

gcc/cp/ChangeLog:
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2008-01-22  Jakub Jelinek  <jakub@redhat.com>, Alexandre Oliva  <aoliva@redhat.com>
2
3         PR c++/33984
4         * call.c (reference_binding): For bitfields use the declared bitfield
5         type.
6         (add_builtin_candidates): Likewise.
7         * class.c (layout_class_type): For bitfields copy over the
8         original type quals.
9
10 2008-01-22  Jason Merrill  <jason@redhat.com>
11
12         PR c++/34912
13         * friend.c (do_friend): Check for prior declaration of a friend 
14         function of a local class.
15         * name-lookup.c (lookup_name_innermost_nonclass_level): 
16         No longer static.
17         * name-lookup.h: Declare it.
18
19 2008-01-22  Tom Tromey  <tromey@redhat.com>
20
21         PR c++/34829:
22         * init.c (build_new_1): Only disallow Java aggregates.
23
24 2008-01-22  Jakub Jelinek  <jakub@redhat.com>
25
26         PR c++/34607
27         * semantics.c (finish_omp_for): Don't call c_finish_omp_for
28         if decl or init is error_mark_node.
29
30         PR c++/34918
31         * error.c (dump_expr): Handle VECTOR_CST.
32
33 2008-01-21  Jason Merrill  <jason@redhat.com>
34
35         PR c++/33959
36         * pt.c (tsubst_aggr_type): Make sure our context is complete.
37
38         PR c++/34573
39         * pt.c (retrieve_local_specialization): Robustify.
40         (tsubst_pack_expansion, tsubst_decl): Remove redundant checks.
41
42         PR c++/34846
43         * pt.c (tsubst): Only call retrieve_local_specialization if the
44         original typedef was in a function template.
45
46         PR c++/34196
47         * decl.c (wrap_cleanups_r): Set TRY_CATCH_IS_CLEANUP.
48
49 2008-01-21  Richard Guenther  <rguenther@suse.de>
50
51         PR c++/34850
52         * error.c (cp_print_error_function): Deal with recursive
53         BLOCK trees.
54
55 2008-01-20  Paolo Carlini  <pcarlini@suse.de>
56
57         PR c++/34891
58         * error.c (dump_expr): Deal with VIEW_CONVERT_EXPR.
59
60 2008-01-20  Paolo Carlini  <pcarlini@suse.de>
61
62         PR c++/34776
63         PR c++/34486
64         * name-lookup.c (do_class_using_decl): Do not call constructor_name_p
65         on non-IS_AGGR_TYPE scope.
66         (constructor_name_p): Assert IS_AGGR_TYPE.
67
68 2008-01-18  Ian Lance Taylor  <iant@google.com>
69
70         PR c++/33407
71         * decl.c (duplicate_decls): Copy DECL_IS_OPERATOR_NEW flag.
72         (grok_op_properties): For NEW_EXPR and VEC_NEW_EXPR set
73         DECL_IS_OPERATOR_NEW flag.
74
75 2008-01-16  Richard Guenther  <rguenther@suse.de>
76
77         PR c++/33819
78         * typeck.c (is_bitfield_expr_with_lowered_type): Recurse
79         for conversions to type variants.
80
81 2008-01-15  Andreas Tobler  <a.tobler@schweiz.org>
82
83         * parser.c (cp_parser_template_parameter): Fix C90 issue with mixing
84         declaration and code.  Update copyright year.
85
86 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
87
88         PR c++/34399
89         * friend.c (do_friend): Don't query TYPE_BEING_DEFINED unless we
90         know we have a class type.
91
92 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
93
94         PR c++/34751
95         * pt.c (coerce_template_parameter_pack): When substituting into
96         the type of a non-type template parameter pack. use the
97         deduced/substituted arguments.
98         * parser.c (declarator_can_be_parameter_pack): A pointer-to-member
99         can be a parameter pack with the ellipsis following it.  When we
100         have an erroneous declaration, allow it to be a parameter pack.
101         (cp_parser_template_parameter): Complain about default
102         arguments on non-type template parameter packs, and parse them
103         using the new cp_parser_default_argument.
104         (cp_parser_parameter_declaration): Complain about parameter packs
105         with default arguments. Move parsing of default arguments into a
106         new function, cp_parser_default_argument.
107         (cp_parser_default_argument): New; extracted from
108         cp_parser_parameter_declaration.
109
110 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
111
112         PR c++/34051
113         PR c++/34055
114         PR c++/34102
115         PR c++/34103
116         * typeck.c (check_return_expr): If there are bare parameter packs
117         in the return value, set it to error_mark_node.
118         * tree.c (cp_walk_subtrees): Walk USING_DECL nodes.
119         * pt.c (find_parameter_packs_r): Look at the type of
120         IDENTIFIER_NODEs (e.g., for user-defined conversions).
121         (check_for_bare_parameter_packs): Flip the result: now returns
122         TRUE when there were bare parameter packs, FALSE otherwise.
123         (push_template_decl_real): Deal with flipped result of
124         check_for_bare_parameter_packs.
125         * semantics.c (finish_cond): If there are bare parameter packs in
126         the conditional, set it to error_mark_node.
127         (finish_expr_stmt): If there are bare parameter packs in the
128         expression, set it to error_mark_node.
129         (finish_for_expr): Ditto.
130         (finish_switch_cond): If there are bare parameter packs in
131         the conditional, set it to error_mark_node.
132         (finish_mem_initializers): If there are bare parameter packs in
133         the member initializer, set it to error_mark_node.
134         (finish_member_declaration): Check the attributes of the
135         declaration for bare parameter packs, and remove the attributes if
136         any have bare parameter packs.
137         * parser.c (cp_parser_using_declaration): Check the using
138         declaration for bare parameter packs.
139         (cp_parser_base_clause): If there are bare parameter packs in a
140         base specifier, don't add it to the chain.
141
142 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
143
144        PR c++/34314
145        * error.c (dump_simple_decl): Display ellipsis for template
146        non-type parameter packs.
147        (dump_decl): Display ellipsis for template type parameter packs.
148        (dump_template_decl): Display ellipsis for template template
149        parameter packs.
150        * pt.c (redeclare_class_template): When redeclaring a class
151        template, check for collisions between template parameters and
152        template parameter packs.
153
154 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
155
156        PR c++/33964
157        * pt.c (process_partial_specialization): Don't mark template
158        parameters that occur in non-deduced contexts.
159        (struct pair_fn_data): Add include_nondeduced_p.
160        (for_each_template_parm_r): Only visit non-deduced contexts if
161        include_nondeduced_p is set.
162        (for_each_template_parm): Added parameter include_nondeduced_p,
163        which states whether template parameters found in non-deduced
164        contexts should be visited.
165        (uses_template_parms): Visit all template parameters, even those
166        in non-deduced contexts.
167
168 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
169
170        PR c++/34052
171        * pt.c (check_default_tmpl_args): Check for parameter packs that
172        aren't at the end of a primary template.
173        (push_template_decl_real): Remove check for parameter packs that
174        aren't at the end of a primary template; that now happens in
175        check_default_tmpl_args.
176        * semantics.c (finish_template_template_parm): Use
177        check_default_tmpl_args to check for errors in the template
178        parameter list.
179         
180 2008-01-12  Doug Kwan  <dougkwan@google.com>
181
182         * decl.c: (grokdeclarator): Use OPT_Wignored_qualifiers
183         instead of OPT_Wreturn_type in warning due to ignored return type
184         qualifiers.
185         * pt.c: (tsubst_function_type): Use OPT_Wignored_qualifiers
186         instead of OPT_Wreturn_type in warning due to ignored return type
187         qualifiers.
188
189 2008-01-08  Jakub Jelinek  <jakub@redhat.com>
190
191         PR c++/33890
192         * semantics.c (finish_omp_for): Don't call
193         fold_build_cleanup_point_expr if processing_template_decl.
194
195 2008-01-04  Paolo Carlini  <pcarlini@suse.de>
196             Jakub Jelinek  <jakub@redhat.com>
197
198         PR c++/34611
199         * error.c (dump_template_argument): Deal with TREE_LIST.
200
201 2008-01-01  Douglas Gregor  <doug.gregor@gmail.com>
202
203        * parser.c (cp_parser_check_decl_spec): Don't warn about "long
204        long" in C++0x mode; change the warning to note that "long long"
205        is only unsupported in C++98 mode.
206
207 2007-12-20  Jason Merrill  <jason@redhat.com>
208
209         PR c++/34111
210         * call.c (standard_conversion): Derived-to-base is considered a
211         standard conversion.
212
213 2007-12-19  Jakub Jelinek  <jakub@redhat.com>
214
215         PR c++/34513
216         * parser.c (cp_parser_omp_parallel): For non-combined parallel
217         call cp_parser_statement rather than
218         cp_parser_already_scoped_statement.
219
220 2007-12-18  Jason Merrill  <jason@redhat.com>
221
222         PR c++/34206
223         * pt.c (tsubst_aggr_type): Do nothing if the type already doesn't 
224         use template parms.
225         (dependent_type_p_r): Handle the domain of an array.
226
227 2007-12-18  Douglas Gregor  <doug.gregor@gmail.com>
228             Jakub Jelinek  <jakub@redhat.com>
229         
230         PR c++/32565
231         PR c++/33943
232         PR c++/33965
233         * pt.c (template_template_parm_bindings_ok_p): New; verifies
234         bindings of template template parameters after all template
235         arguments have been deduced.
236         (coerce_template_parms): Don't complain when COMPLAIN doesn't
237         include tf_error.
238         (fn_type_unification): Use template_template_parm_bindings_ok_p. 
239         (unify): Deal with variadic, bound template template parameters. 
240         (get_class_bindings): Use template_template_parm_bindings_ok_p. 
241
242 2007-12-18  Jakub Jelinek  <jakub@redhat.com>
243
244         PR c++/34488
245         * decl.c (grokdeclarator): Reject friend sfk_constructor
246         FUNCTION_TYPE.
247
248 2007-12-17  Jakub Jelinek  <jakub@redhat.com>
249
250         PR c/34506
251         * parser.c (cp_parser_omp_all_clauses): Accept optional comma
252         in between clauses.
253
254 2007-12-15  Alexandre Oliva  <aoliva@redhat.com>
255
256         PR debug/7081
257         * cp-lang.c (cp_classify_record): New.
258         (LANG_HOOKS_CLASSIFY_RECORD): Override.
259
260 2007-12-11  Jakub Jelinek  <jakub@redhat.com>
261
262         PR c++/34238
263         * decl2.c (cp_write_global_declarations): Revert 2007-11-22 change.
264
265         PR c++/34364
266         * rtti.c (build_dynamic_cast): Call convert_from_reference even for
267         dynamic_cast in a template.
268
269 2007-12-10  Simon Martin  <simartin@users.sourceforge.net>
270
271         PR c++/34059
272         * typeck.c (build_class_member_access_expr): Compute MEMBER_SCOPE from
273         MEMBER's BASELINK_ACCESS_BINFO instead of its BASELINK_BINFO.
274
275 2007-12-10  Jakub Jelinek  <jakub@redhat.com>
276
277         PR c++/34395
278         * error.c (dump_type_prefix, dump_type_suffix): Handle
279         TYPE_PACK_EXPANSION.
280
281         PR c++/34394
282         * error.c (dump_expr): Handle ABS_EXPR.
283
284 2007-12-09  Jakub Jelinek  <jakub@redhat.com>
285
286         PR c++/34178
287         PR c++/34340
288         * repo.c (repo_emit_p): Return 2 for DECL_INTEGRAL_CONSTANT_VAR_P
289         in class scope rather than DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
290         Return 2 also if DECL_EXPLICIT_INSTANTIATION.
291         * decl2.c (import_export_decl): Don't make VAR_DECLs import_p when
292         flag_use_repository and repo_emit_p returned 2.
293
294 2007-12-06  Jakub Jelinek  <jakub@redhat.com>
295
296         PR c++/34336
297         * tree.c (stabilize_call, stabilize_init): Do nothing if
298         processing_template_decl.
299
300 2007-12-05  Jakub Jelinek  <jakub@redhat.com>
301
302         PR c++/34271
303         * semantics.c (finish_decltype_type): For SCOPE_REF issue an
304         error instead of assertion failure.
305         * parser.c (cp_parser_decltype): If closing paren is not found,
306         return error_mark_node.
307
308 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
309
310        PR c++/34101
311        * name-lookup.c (arg_assoc_template_arg): Recurse on argument
312        packs.
313        (arg_assoc_type): We don't need to handle TYPE_ARGUMENT_PACK here,
314        since arg_assoc_template_arg will deal with them (better).
315
316 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
317
318        PR c++/33509
319        * pt.c (tsubst_exception_specification): Handle substitutions into
320        member templates, where tsubst_pack_expansion returns a
321        TYPE_PACK_EXPANSION.
322
323 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
324
325        PR c++/33091
326        * pt.c (unify_pack_expansion): If we didn't deduce any actual
327        bindings for the template parameter pack, don't try to keep the
328        empty deduced arguments.
329        (unify): If a parameter is a template-id whose template argument
330        list contains a pack expansion that is not at the end, then we
331        cannot unify against that template-id.
332
333 2007-12-02  Paolo Carlini  <pcarlini@suse.de>
334
335         PR c++/34061
336         * pt.c (current_template_args): Use error_operand_p.
337
338 2007-12-02  Paolo Carlini  <pcarlini@suse.de>
339
340         PR c++/34273
341         * error.c (dump_decl): Handle TREE_BINFO.
342
343 2007-12-01  Ollie Wild  <aaw@google.com>
344
345         PR c++/8171
346         * typeck.c (build_binary_op): Add conversion of pointers to function
347         members appearing as operands to the equality operators.
348
349 2007-11-30  Jakub Jelinek  <jakub@redhat.com>
350
351         PR c++/34275
352         * error.c (dump_expr): Handle OBJ_TYPE_REF.
353
354 2007-11-29  Jakub Jelinek  <jakub@redhat.com>
355
356         PR c++/34270
357         * tree.c (lvalue_p_1) <case COND_EXPR>: Handle x ?: y
358         in templates.
359         * typeck.c (is_bitfield_expr_with_lowered_type) <case COND_EXPR>:
360         Likewise.
361
362         PR c++/34267
363         PR c++/34268
364         * parser.c (cp_parser_decltype): Don't call finish_id_expression
365         on ~type.
366         * semantics.c (finish_decltype_type): Issue error on types, TYPE_DECLs
367         and ~type early.
368
369 2007-11-27  Jakub Jelinek  <jakub@redhat.com>
370
371         PR tree-optimization/34181
372         * method.c (use_thunk): Don't inline the call in the thunk.
373
374         PR c++/34213
375         * tree.c (decl_linkage): Static data members and static member
376         functions in anonymous ns classes are lk_external.
377
378 2007-11-26  Andreas Krebbel  <krebbel1@de.ibm.com>
379
380         PR c++/34081
381         * decl.c (start_preparsed_function): Pass 
382         processing_template_decl for the new allocate_struct_function
383         parameter.
384
385 2007-11-25  Richard Guenther  <rguenther@suse.de>
386
387         * decl.c (poplevel): Use BLOCK_CHAIN.
388
389 2007-11-24  Ollie Wild  <aaw@google.com>
390
391         * typeck.c (delta_from_ptrmemfunc): New function.
392         (get_member_function_from_ptrfunc): Call delta_from_ptrmemfunc.
393         (build_binary_op): Call delta_from_ptrmemfunc.
394
395 2007-11-23  Jakub Jelinek  <jakub@redhat.com>
396
397         PR c++/30293
398         PR c++/30294
399         * decl.c (cp_finish_decl): Disallow variable or field
400         definitions if extern "Java" aggregates.
401         (grokparms): Disallow parameters with extern "Java"
402         aggregates.
403         (check_function_type): Disallow function return values
404         with extern "Java" aggregates.
405         * init.c (build_new_1): Disallow placement new with
406         extern "Java" aggregates.
407
408 2007-11-23  Mark Mitchell  <mark@codesourcery.com>
409             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
410         
411         PR c++/5310
412         * call.c (convert_like_real): Build a zero constant when __null is
413         converted to an integer type.
414         
415 2007-11-22  Jakub Jelinek  <jakub@redhat.com>
416
417         PR c++/34094
418         * decl2.c (cp_write_global_declarations): Issue error about static
419         data members in anonymous namespace which are declared and used,
420         but not defined.
421
422 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
423
424         PR c++/34089
425         * parser.c (cp_parser_class_head): Reject function template ids.
426
427         PR c++/28879
428         * tree.c (build_cplus_array_type_1): Don't pass any VLA types
429         when processing_template_decl to build_array_type.
430
431         PR c++/33962
432         * pt.c (more_specialized_fn): Don't segfault if one or
433         both argument list end with ellipsis.
434
435 2007-11-18  Jakub Jelinek  <jakub@redhat.com>
436
437         PR c++/30988
438         * semantics.c (finish_call_expr): Set
439         current_function_returns_abnormally if fn is noreturn FUNCTION_DECL
440         or OVERLOAD with all noreturn functions.
441
442 2007-11-16  Jakub Jelinek  <jakub@redhat.com>
443
444         PR c++/34100
445         * pt.c (apply_late_template_attributes): Do nothing if decl's type is
446         error_mark_node.
447
448 2007-11-13  Jakub Jelinek  <jakub@redhat.com>
449
450         PR c++/34054
451         PR c++/34056
452         PR c++/34057
453         PR c++/34058
454         PR c++/34060
455         * pt.c (find_parameter_packs_r): If ppd->set_packs_to_error,
456         set to error_mark_node the outermost POINTER_TYPE to the pack if
457         it is seen in a POINTER_TYPE.
458         (push_template_decl_real): If check_for_bare_parameter_packs
459         fails for function return type, set the return type to
460         integer_type_node.  If check_for_bare_parameter_packs failed
461         for non-function, return error_mark_node.
462
463         PR c++/29225
464         * call.c (build_new_op): Call resolve_args before calling
465         build_over_call.
466
467 2007-11-11  Tom Tromey  <tromey@redhat.com>
468
469         PR c++/17577:
470         * lex.c (handle_pragma_implementation): Use cpp_included_before.
471
472 2007-11-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
473
474         PR c++/8570
475         * pt.c (redeclare_class_template): Update error message. Use a
476         note to show the previous declaration.
477         (tsubst_friend_class): Use the location of the friend template as
478         the input location before calling redeclare_class_template.
479
480 2007-11-11  Jakub Jelinek  <jakub@redhat.com>
481
482         PR c++/34068
483         * semantics.c (finish_pseudo_destructor_expr): Handle
484         object == error_mark_node.
485
486 2007-11-10  Jakub Jelinek  <jakub@redhat.com>
487
488         PR c++/32241
489         * pt.c (tsubst_copy_and_build) <case COMPONENT_REF>: If object_type
490         is not scalar type, let finish_class_member_access_expr handle
491         diagnostics.  Pass BIT_NOT_EXPR argument to
492         finish_pseudo_destructor_expr.  Handle SCOPE_REF properly.
493
494 2007-11-09  Douglas Gregor  <doug.gregor@gmail.com>
495
496         PR c++/33510
497         * decl.c (cp_complete_array_type): If any of the initializer
498         elements are pack expansions, don't compute the array size yet.
499
500 2007-11-08  Andrew Pinski  <pinskia@gmail.com>
501
502         PR c++/30297:
503         * tree.c (decl_linkage): Fields have no linkage.
504
505 2007-11-08  Daniel Jacobowitz  <dan@codesourcery.com>
506
507         * class.c (build_ctor_vtbl_group): Lay out the new type and decl.
508
509 2007-11-07  Douglas Gregor  <doug.gregor@gmail.com>
510
511         PR c++/33045
512         PR c++/33837
513         PR c++/33838
514         * semantics.c (finish_decltype_type): See through INDIRECT_REFs.
515         Be careful with ERROR_MARK_NODEs.
516         * parser.c (cp_parser_check_access_in_redeclaration): Handle NULL
517         argument.
518
519 2007-11-07  Jakub Jelinek  <jakub@redhat.com>
520
521         PR c++/33501
522         * call.c (build_over_call): Don't check TREE_ADDRESSABLE
523         on incomplete type.
524
525 2007-11-06  Douglas Gregor  <doug.gregor@gmail.com>
526
527         PR c++/33977
528         PR c++/33886
529         * tree.c (c_build_qualified_type): Define bridge to
530         cp_build_qualified_type.
531
532 2007-11-06  Douglas Gregor  <doug.gregor@gmail.com>
533
534         PR c++/31439
535         PR c++/32114
536         PR c++/32115
537         PR c++/32125
538         PR c++/32126
539         PR c++/32127
540         PR c++/32128
541         PR c++/32253
542         PR c++/32566
543         * typeck.c (check_return_expr): Pass address of retval to
544         check_for_bare_parameter_packs.
545         * class.c (build_base_field): Tolerate bases that have no layout
546         due to errors.
547         (end_of_base): Ditto.
548         * tree.c (canonical_type_variant): Be careful with
549         ERROR_MARK_NODE.
550         * cp-tree.h (check_for_bare_parameter_packs): Now accepts a
551         tree*.
552         * pt.c (find_parameter_pack_data): Add set_packs_to_error field,
553         which states whether parameter packs should be replaced with
554         ERROR_MARK_NODE.
555         (find_parameter_packs_r): Pass addresses to cp_walk_tree wherever
556         possible. If set_packs_to_error is set true, replace the parameter
557         pack with ERROR_MARK_NODE. Manage our own pointer sets.
558         (uses_parameter_packs): Don't set parameter packs to
559         ERROR_MARK_NODE.
560         (check_for_bare_parameter_packs): Now takes a pointer to a tree,
561         which may be modified (if it is a parameter pack). Instructs
562         find_parameter_packs_r to replace parameter packs with
563         ERROR_MARK_NODE (so that they won't cause errors later on).
564         (process_template_parm): Pass pointer to
565         check_for_bare_parameter_packs.
566         (process_partial_specialization): Replace pack expansions before
567         the end of the template argument list with ERROR_MARK_NODE.
568         (push_template_decl_real): Pass pointer to
569         check_for_bare_parameter_packs. Replace parameter packs not at the
570         end of the template parameter list with ERROR_MARK_NODE.
571         (convert_template_argument): Be more careful about using DECL_NAME
572         on only declarations.
573         (unify): Can't unify against ERROR_MARK_NODE.
574         * semantics.c (finish_cond): Pass pointer to
575         check_for_bare_parameter_packs.
576         (finish_expr_stmt): Ditto.
577         (finish_for_expr): Ditto.
578         (finish_switch_cond): Pass pointer to
579         check_for_bare_parameter_packs, and call it before we put the
580         condition into the statement.
581         (finish_mem_initializers): Pass pointer to
582         check_for_bare_parameter_packs.
583         (finish_member_declaration): Ditto.
584         * parser.c (cp_parser_base_clause): Ditto.
585         
586 2007-11-06  Jakub Jelinek  <jakub@redhat.com>
587
588         PR target/33168
589         * decl.c (cp_finish_decl): Call make_rtl_for_nonlocal_decl already
590         with the final TREE_READONLY flag in place.  processing_template_decl
591         is known to be 0 in this part of function.
592
593         PR c++/33894
594         * cp-tree.h: Update comment - TYPE_LANG_FLAG_0 is not
595         OMP_ATOMIC_DEPENDENT_P in OMP_ATOMIC.
596         * pt.c (tsubst_expr): Assert OMP_ATOMIC_DEPENDENT_P.
597         * semantics.c (finish_omp_atomic): Revert most of the
598         2007-02-05 changes, just keep the new representation of
599         OMP_ATOMIC_DEPENDENT_P OMP_ATOMIC.
600
601 2007-11-05  H.J. Lu  <hongjiu.lu@intel.com>
602
603         PR c++/33871
604         * decl2.c (constrain_visibility): Clear DECL_ONE_ONLY if marked
605         local.
606
607 2007-11-05  Douglas Gregor  <doug.gregor@gmail.com>
608
609         PR c++/33996
610         PR c++/33235
611         PR c++/33930
612         * typeck.c (merge_types): Don't lose rvalue references when
613         merging types.
614         * call.c (build_over_call): Don't elide move constructors just
615         because the copy constructor is trivial (!).
616         (compare_ics): If comparing cv-qualifiers fails, we can still order
617         based on binding lvalues vs. rvalues.
618
619 2007-11-05  Douglas Gregor  <doug.gregor@gmail.com>
620
621         PR c++/33939
622         * pt.c (unify_pack_expansion): bring handling of function call
623         arguments into line with type_unification_real. 
624
625 2007-11-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
626
627         * typeck.c (build_binary_op): Use pedwarn instead of error for
628         consistency.
629
630 2007-11-05  Jakub Jelinek  <jakub@redhat.com>
631
632         PR c++/33836
633         * parser.c (cp_parser_unary_expression): For &&label call
634         cp_parser_non_integral_constant_expression and return error_mark_node
635         if it returned true.
636
637         PR c++/33969
638         * decl.c (grokdeclarator): Don't call build_memfn_type if type
639         is neither FUNCTION_TYPE nor METHOD_TYPE.
640
641 2007-11-02  Jakub Jelinek  <jakub@redhat.com>
642
643         PR c++/33516
644         * parser.c (cp_parser_nested_name_specifier_opt): Use
645         TYPE_MAIN_VARIANT (new_scope) as scope if new_scope is an incomplete
646         typedef of currently open class.
647
648 2007-11-02  Paolo Carlini  <pcarlini@suse.de>
649
650         PR c++/33495
651         * error.c (dump_expr): Deal specially with statements.
652
653 2007-11-01  Jason Merrill  <jason@redhat.com>
654
655         PR c++/30897
656         * pt.c (push_template_decl_real): Set DECL_CONTEXT on template
657         template parms.
658         (lookup_template_class): Use it to get the outer template args
659         for instantiating one.
660
661         PR c++/29236
662         * pt.c (reduce_template_parm_level): tsubst the parameters
663         of a template template parm.
664
665 2007-11-01  Douglas Gregor  <doug.gregor@gmail.com>
666
667         PR c++/33955
668         * pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE.
669
670 2007-11-01  Jakub Jelinek  <jakub@redhat.com>
671
672         PR c++/32384
673         * parser.c (cp_parser_postfix_dot_deref_expression): If
674         POSTFIX_EXPRESSION is type dependent, try to parse it as pseudo dtor
675         first and if that succeeds and type is SCALAR_TYPE_P, create
676         PSEUDO_DTOR_EXPR.
677
678         PR c++/32260
679         * rtti.c (enum_tinfo_kind): Fix TK_TYPE_INFO_TYPE comment.
680         (typeid_ok_p): Use the same alias set for abi::__type_info_pseudo
681         as for std::type_info.
682
683 2007-10-31  Paolo Carlini  <pcarlini@suse.de>
684
685         PR c++/33494
686         * cxx-pretty-print.c (pp_cxx_typeid_expression,
687         pp_cxx_delete_expression): Change to static linkage.
688         * cxx-pretty-print.h: Adjust declarations.
689         * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR,
690         MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR,
691         MODOP_EXPR): Forward to pp_expression.
692
693         * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR):
694         Fix typo.
695
696 2007-10-31 Christian Bruel  <christian.bruel@st.com>
697            Mark Mitchell  <mark@codesourcery.com>
698
699         PR c++/19531
700         * typeck.c (check_return_expr): Don't set named_return_value_okay_p
701         if retval is volatile. 
702         
703 2007-10-30  Jakub Jelinek  <jakub@redhat.com>
704
705         PR c++/33616
706         * decl2.c (build_offset_ref_call_from_tree): Call
707         build_non_dependent_expr on object prior to building ADDR_EXPR from it
708         if FN is DOTSTAR_EXPR.
709
710 2007-10-30  Douglas Gregor  <doug.gregor@gmail.com>
711
712         PR c++/31993
713         PR c++/32252
714         * pt.c (find_parameter_packs_r): Fix typo in comment.
715         (convert_template_argument): Look at the pattern of a pack
716         expansion to determine what kind of entity we're converting.
717         (coerce_template_parameter_pack): When we have coerced a non-type
718         template parameter pack, substitute into the type of that pack.
719         (tsubst_pack_expansion): When our substitution of a parameter pack
720         is a "trivial" substitution of itself, just substitute into the
721         pack expansion rather than actually expanding.
722
723 2007-10-29  Jakub Jelinek  <jakub@redhat.com>
724
725         PR c++/33841
726         * class.c (check_bitfield_decl): Don't set field's type to error_mark_node
727         for non-integral type bitfields.  Return true if bitfield is correct, false
728         error has been diagnosed.
729         (check_field_decls): If check_bitfield_decl returned false, call also
730         check_field_decl.
731
732 2007-10-28  Paolo Carlini  <pcarlini@suse.de>
733             Mark Mitchell  <mark@codesourcery.com>
734
735         PR c++/30659
736         * pt.c (do_decl_instantiation): If the VAR_DECL is not a
737         class member error out and return.
738
739 2007-10-27  Jakub Jelinek  <jakub@redhat.com>
740
741         * error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope
742         to current_function_decl rather than 0.
743
744         PR c++/33844
745         * cxx-pretty-print.c (pp_cxx_pm_expression) <case MEMBER_REF>: Print
746         ->* rather than .*.
747         * error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR.
748
749 2007-10-27  Jason Merrill  <jason@redhat.com>
750
751         PR c++/5247
752         * call.c (convert_default_arg): Detect recursion.
753
754 2007-10-27  Jakub Jelinek  <jakub@redhat.com>
755
756         PR c++/33842
757         * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype.
758         * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
759         OFFSETOF_EXPR.
760         (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New
761         functions.
762         * error.c (dump_expr): Handle OFFSETOF_EXPR.
763
764 2007-10-26  Jason Merrill  <jason@redhat.com>
765
766         PR c++/24791
767         * pt.c (get_template_info): New fn.
768         (template_class_depth): Use it.
769         (push_template_decl_real): Check that the template args of the 
770         definition match the args of the previous declaration.
771
772 2007-10-26  Paolo Carlini  <pcarlini@suse.de>
773
774         PR c++/31988
775         * decl2.c (coerce_new_type): Do not allow a default argument for
776         the first parameter.
777
778 2007-10-26  Douglas Gregor  <doug.gregor@gmail.com>
779
780         PR c++/33839
781         * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we
782         don't see the leading '('. Only lookup names if we get an
783         IDENTIFIER_NODE.
784
785 2007-10-26  Jakub Jelinek  <jakub@redhat.com>
786
787         PR c++/33744
788         * parser.c (cp_parser_parenthesized_expression_list): Set
789         greater_than_is_operator_p to true in between the parens.
790
791 2007-10-26  Paolo Carlini  <pcarlini@suse.de>
792
793         PR c++/31747
794         * decl.c (grokdeclarator): In case of conflicting specifiers
795         just return error_mark_node.
796
797 2007-10-26  Ollie Wild  <aaw@google.com>
798
799         * expr.c (cxx_expand_expr): Removed.
800         * cp-tree.h (exx_expand_expr): Removed.
801         * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr
802         with c_expand_expr.
803
804 2007-10-25  Paolo Carlini  <pcarlini@suse.de>
805
806         PR c++/33843
807         * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR.
808
809 2007-10-23  Jason Merrill  <jason@redhat.com>
810
811         PR c++/25950 (DR 391)
812         * call.c (struct conversion): Remove check_copy_constructor_p.
813         (reference_binding): Always bind a reference directly to a 
814         compatible class rvalue.  Pass down LOOKUP_NO_TEMP_BIND during 
815         temporary creation.
816         (check_constructor_callable): Remove.
817         (convert_like_real): Don't call it.
818         (initialize_reference): Don't call check_constructor_callable.
819         (standard_conversion): Check LOOKUP_NO_CONVERSION instead of
820         LOOKUP_CONSTRUCTOR_CALLABLE.  Don't require a temporary for base
821         conversions if LOOKUP_NO_TEMP_BIND.
822         (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND.
823         (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for
824         second conversion.
825         * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove.
826
827 2007-10-22  Jakub Jelinek  <jakub@redhat.com>
828
829         PR c++/33372
830         * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p
831         before checking if its type is integral.
832
833 2007-10-22  Jason Merrill  <jason@redhat.com>
834
835         PR c++/33620
836         * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
837         * pt.c (apply_late_template_attributes): Splice out dependent
838         attributes from DECL_ATTRIBUTES.
839
840         * decl.c (cxx_maybe_build_cleanup): Use build_address.
841
842 2007-10-17  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
843
844         * typeck.c (build_binary_op) : Use appropriate warning option
845         instead of unnamed warning.
846
847 2007-10-16  Paolo Carlini  <pcarlini@suse.de>
848
849         PR c++/31446
850         * pt.c (current_template_args): Do not change TREE_LIST elements
851         with a TREE_VALUE of error_mark_node.
852
853 2007-10-16  Mark Mitchell  <mark@codesourcery.com>
854
855         * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
856         * decl.c (start_decl): Tidy.
857         (start_decl_1): Call cp_apply_type_quals_to_decl after completing
858         the type.
859         (grokdeclarator): Clarify comment.
860
861 2007-10-14  Andrew Pinski  <pinskia@gmail.com>
862
863         PR c++/30303
864         * decl.c (grokfndecl): Return NULL after the "definition of
865         implicitly-declared" error happened.
866
867 2007-10-12  Simon Martin  <simartin@users.sourceforge.net>
868
869         PR c++/26698
870         * call.c (build_user_type_conversion_1): Do not consider conversion
871         functions to convert a (possibly cv-qualified) object to the (possibly
872         cv-qualified) same object type (or a reference to it), to a (possibly
873         cv-qualified) base class of that type (or a reference to it).
874
875 2007-10-12  Paolo Carlini  <pcarlini@suse.de>
876
877         * pt.c (tsubst): Use template_parm_level_and_index.
878
879 2007-10-12  Jakub Jelinek  <jakub@redhat.com>
880
881         PR c++/32121
882         * parser.c (cp_parser_compound_statement): Handle label-declarations
883         at the beginning of the compound statement.
884         (cp_parser_block_declaration): Issue diagnostics about __label__
885         not at the beginning of a block.
886
887 2007-10-11  Paolo Carlini  <pcarlini@suse.de>
888
889         PR c++/33461
890         * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
891         to convert_template_argument.
892         (coerce_template_parms): Return error_mark_node after fixed-length
893         error.
894         (tsubst_decl): Check for error_mark_node the return value of the
895         first tsubst in 'case VAR_DECL'.
896
897 2007-10-08  Ollie Wild  <aaw@google.com>
898
899         * typeck2.c (digest_init): Call cplus_expand_constant after
900         convert_for_initialization.
901         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
902         * expr.c (cplus_expand_constant): Updated function description.
903
904 2007-10-04  Jason Merrill  <jason@redhat.com>
905
906         PR c++/20416
907         * call.c (initialize_reference): Handle local static reference
908         temps properly.
909
910 2007-10-03  Jason Merrill  <jason@redhat.com>
911
912         PR c++/32470
913         * name-lookup.c (push_namespace_with_attrs): Fold back into...
914         (push_namespace): Here.
915         (handle_namespace_attrs): New fn for the attr code.
916         (leave_scope): Don't pop_visibility.
917         * name-lookup.h (struct cp_binding_level): Remove has_visibility.
918         * parser.c (cp_parser_namespace_definition): Call
919         handle_namespace_attrs and pop_visibility as appropriate. 
920
921         PR c++/11756
922         * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
923
924 2007-10-03  Alexandre Oliva  <aoliva@redhat.com>
925
926         * decl.c (duplicate_decls): Preserve linkage flags for mere
927         redeclarations of gnu_inline definitions.
928
929 2007-10-03  Jason Merrill  <jason@redhat.com>
930
931         PR c++/15764
932         * decl.c (wrap_cleanups_r): New fn.
933         (wrap_temporary_cleanups): New fn.
934         (initialize_local_var): Call it.
935
936 2007-09-29  Jason Merrill  <jason@redhat.com>
937
938         PR c++/33094
939         * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member 
940         constant to not have DECL_EXTERNAL if it's file-local.
941
942 2007-09-28  Ollie Wild  <aaw@google.com>
943
944         Revert
945         2007-09-27  Ollie Wild  <aaw@google.com>
946
947         * typeck2.c (digest_init): Call cplus_expand_constant after
948         convert_for_initialization.
949         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
950         * expr.c (cplus_expand_constant): Updated function description.
951
952 2007-09-28  Jason Merrill  <jason@redhat.com>
953
954         PR c++/10179
955         * class.c (layout_empty_base): Take rli parameter, update
956         rli->record_align if empty base has user-specified alignment.
957         (build_base_field): Pass rli to it.
958
959 2007-09-28  Paolo Carlini  <pcarlini@suse.de>
960
961         PR c++/33213
962         * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
963
964 2007-09-28  Paolo Carlini  <pcarlini@suse.de>
965
966         PR c++/33118
967         * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
968         (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
969         (dump_parameters): Just call dump_type for argument packs too.
970
971 2007-09-28  Jakub Jelinek  <jakub@redhat.com>
972
973         PR c++/31434
974         * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
975         qualification by creating qualified PACK_EXPANSION_PATTERN and
976         then calling make_pack_expansion on it.
977
978 2007-09-27  Ollie Wild  <aaw@google.com>
979
980         * typeck2.c (digest_init): Call cplus_expand_constant after
981         convert_for_initialization.
982         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
983         * expr.c (cplus_expand_constant): Updated function description.
984
985 2007-09-27  Jason Merrill  <jason@redhat.com>
986
987         PR c++/33571
988         * decl2.c (is_late_template_attribute): Don't crash on unknown
989         attribute.
990
991 2007-09-27  Paolo Carlini  <pcarlini@suse.de>
992
993         PR c++/33493
994         * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
995         * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
996         spaces in the formatting.
997         * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
998
999 2007-09-27  Jakub Jelinek  <jakub@redhat.com>
1000
1001         * error.c (cxx_print_error_function): Add third argument, pass
1002         it over to lhd_print_error_function.
1003         (cp_print_error_function): If diagnostic->abstract_origin, print
1004         virtual backtrace.
1005         * cp-tree.h (struct diagnostic_info): New forward decl.
1006         (cxx_print_error_function): Add third argument.
1007
1008 2007-09-25  Simon Martin  <simartin@users.sourceforge.net>
1009
1010         PR c++/33207
1011         * name-lookup.c (pushtag): Do not create an implicit typedef before
1012         the associated type declaration is known to be valid.
1013
1014 2007-09-25  Jakub Jelinek  <jakub@redhat.com>
1015
1016         * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
1017         rather than pointers.
1018
1019 2007-09-24  Danny Smith  <dannysmith@user.sourceforge.net>
1020
1021         PR c++/14688
1022         * search.c (check_final_overrider): Fail if
1023         targetm.comp_type_attributes returns 0.
1024
1025 2007-09-24  Jason Merrill  <jason@redhat.com>
1026
1027         PR c++/33239
1028         * pt.c (resolve_typename_type): Don't look things up in the original
1029         template if it would mean losing template arguments.    
1030
1031 2007-09-24  Jakub Jelinek  <jakub@redhat.com>
1032
1033         PR c++/33506
1034         * cp-tree.h (cxx_type_hash_eq): New prototype.
1035         * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
1036         * tree.c (cxx_type_hash_eq): New function.
1037
1038 2007-09-24  Douglas Gregor  <doug.gregor@gmail.com>
1039
1040         PR c++/33185    
1041         * tree.c (cp_build_qualified_type_real): Build a canonical
1042         ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
1043         
1044 2007-09-24  Douglas Gregor  <doug.gregor@gmail.com>
1045
1046         PR c++/33112
1047         PR c++/33185    
1048         * tree.c (cplus_array_compare): Compare pointers, not types.
1049         (build_cplus_array_type_1): Store new array type into the hash
1050         table before building the canonical type; build the canonical type
1051         correctly.
1052         (cp_build_qualified_type_real): Put all of the array types with
1053         cv-qualified element types into the C++ array hash table, built as 
1054         variants of the unqualified versions.
1055         
1056 2007-09-23  Jason Merrill  <jason@redhat.com>
1057
1058         PR c++/16370
1059         * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
1060         for deprecation warnings.
1061
1062 2007-09-22  Jason Merrill  <jason@redhat.com>
1063
1064         PR c++/15269
1065         * call.c (build_over_call): Warn about deprecated virtuals.
1066
1067         PR c++/19407
1068         * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
1069         (MAYBE_TAGGED_TYPE_P): Remove.
1070         * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
1071         instead of calling is_late_template_attribute again.
1072         (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
1073         (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
1074         Don't crash on typedefs from non-template classes.
1075         * decl2.c (grokfield): Don't sorry about attrs on template parms.
1076         (is_late_template_attribute): All attributes applied to template
1077         parms or typename types are dependent.  Static.
1078         (splice_template_attributes): Pass decl through.
1079         (save_template_attributes): Likewise.
1080
1081 2007-09-20  Jakub Jelinek  <jakub@redhat.com>
1082
1083         PR c++/33496
1084         * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
1085         returned from tsubst_pack_expansion.
1086         (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
1087         (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
1088
1089 2007-09-20  Paolo Carlini  <pcarlini@suse.de>
1090
1091         PR c++/33460
1092         * semantics.c (finish_id_expression): Use consistently
1093         context_for_name_lookup.
1094         * decl.c (fixup_anonymous_aggr): Fix error message for
1095         anonymous struct (vs union).
1096
1097 2007-09-19  Jason Merrill  <jason@redhat.com>
1098
1099         PR c++/7586
1100         * pt.c (tsubst): Handle typedefs by looking for the specialization.
1101         (retrieve_specialization): Only tagged types use 
1102         DECL_TEMPLATE_INSTANTIATIONS.
1103         (instantiate_class_template): Push nested classes too.
1104         (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
1105         tagged types.
1106         * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
1107         * init.c (is_aggr_type): Remove redundant tests.
1108         * class.c (push_nested_class): Use CLASS_TYPE_P.
1109
1110 2007-09-20  Paolo Carlini  <pcarlini@suse.de>
1111
1112         PR c++/33459
1113         * init.c (build_zero_init): If, recursively, build_zero_init
1114         returns a NULL_TREE, do not append it to the VEC of constructors.
1115
1116 2007-09-18  Jason Merrill  <jason@redhat.com>
1117
1118         PR c++/17743
1119         * pt.c (apply_late_template_attributes): Set processing_template_decl.
1120         (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
1121         ATTR_FLAG_TYPE_IN_PLACE.
1122         (tsubst): Do unqualified lookup to find typedefs from current class.
1123         [ARRAY_TYPE]: Propagate alignment info.
1124         * decl2.c (is_late_template_attribute): Only defer handling of
1125         attribute aligned if the expression is dependent.
1126         (save_template_attributes): If we're deferring any attributes,
1127         make this a naming typedef.
1128
1129 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
1130
1131         PR c++/33462 (again)
1132         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
1133         va_arg instead of __builtin_va_arg.
1134
1135 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
1136
1137         PR c++/33462
1138         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
1139         (pp_cxx_primary_expression): Use it.
1140         * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
1141         * error.c (dump_expr): Use it.
1142
1143 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
1144
1145         PR c++/33463
1146         * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
1147         out case TYPEID_EXPR to...
1148         (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
1149         and pp_cxx_right_paren.
1150         * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
1151         * error.c (dump_expr): Use it.
1152
1153 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
1154
1155         PR c++/33464
1156         * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
1157         (pp_cxx_primary_expression): Use it.
1158         * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
1159         * error.c (dump_expr): Use it.
1160
1161 2007-09-16  Paolo Carlini  <pcarlini@suse.de>
1162
1163         PR c++/33124
1164         * init.c (build_new): Remove warning for zero-element
1165         allocations.
1166
1167 2007-09-16  Nathan Sidwell  <nathan@codesourcery.com>
1168
1169         PR c++/32756
1170         * call.c (maybe_handle_implicit_object): Set this_p, clear
1171         rvaluedness_matches_p.
1172         (compare_ics): Do not compare rvaluedness matching when one of the
1173         operands is an implicit object.
1174
1175 2007-09-14  Jason Merrill  <jason@redhat.com>
1176
1177         PR c++/17743, c++/19163
1178         * decl2.c (is_late_template_attribute): New fn.
1179         (splice_template_attributes, save_template_attributes): New fns.
1180         (cplus_decl_attributes): Call save_template_attributes.
1181         * pt.c (apply_late_template_attributes): New fn.
1182         (instantiate_class_template, tsubst_decl): Use it.
1183         * cp-tree.h: Declare is_late_template_attribute.
1184
1185 2007-09-13  Tom Tromey  <tromey@redhat.com>
1186
1187         * parser.c (cp_lexer_new_main): Don't use
1188         c_lex_return_raw_strings.
1189         (cp_lexer_get_preprocessor_token): Update.  Add special case when
1190         lexer is NULL.
1191
1192 2007-09-11  Jan Hubicka <jh@suse.cz>
1193
1194         * method.c (use_thunk): Use tree_rest_of_compilation
1195         * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
1196         (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
1197         * cp-tree.h (expand_body): Kill.
1198         (emit_associated_thunks): Declare.
1199         * semantics.c (emit_associated_thunks): Export.
1200         (expand_body): Kill.
1201
1202 2007-09-09  David Daney  <ddaney@avtrex.com>
1203
1204         PR c++/33324
1205         * init.c (build_new_1):  Use POINTER_PLUS_EXPR instead of MINUS_EXPR
1206         to calculate cookie_ptr.
1207
1208 2007-09-08  Jason Merrill  <jason@redhat.com>
1209
1210         PR c++/33342
1211         * pt.c (most_specialized_class): Set processing_template_decl
1212         while tsubsting partial spec args.
1213
1214 2007-09-06  Jason Merrill  <jason@redhat.com>
1215
1216         * decl2.c (get_guard): Copy visibility from the guarded variable.
1217
1218 2007-09-06  Jan Hubicka  <jh@suse.cz>
1219
1220         * semantics.c (expand_body): Do not mark arguments of clones used.
1221
1222 2007-09-06  Paolo Carlini  <pcarlini@suse.de>
1223
1224         PR c++/32674
1225         * decl.c (cp_finish_decl): When processing_template_decl,
1226         deal correctly with init as TREE_LIST.
1227
1228 2007-09-06  Tom Tromey  <tromey@redhat.com>
1229
1230         * decl.c (finish_function): Put return's location on line zero of
1231         file.
1232
1233 2007-09-05  Jason Merrill  <jason@redhat.com>
1234
1235         PR c++/15745
1236         * except.c (prepare_eh_type): Use type_decays_to.
1237
1238         PR c++/15097
1239         * init.c (build_delete): Use build_headof to get the address of the
1240         complete object if we aren't using the deleting destructor.
1241         * rtti.c (build_headof): No longer static.
1242         * cp-tree.h: Declare it.
1243
1244 2007-09-06  Jakub Jelinek  <jakub@redhat.com>
1245
1246         * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
1247         decl if a prototype for XX is provided with throw().
1248
1249         PR c++/33289
1250         * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
1251         on __*_chk non-__builtin_* decls.
1252
1253 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
1254
1255         PR c++/30302
1256         * semantics.c (finish_id_expression): Use context_for_name_lookup
1257         insted of DECL_CONTEXT, to see through anonymous structs and unions.
1258         * class.c (finish_struct_anon): Deal correctly with anonymous
1259         structs (vs unions, as GNU extension) in error messages.
1260
1261 2007-09-05  Jan Hubicka  <jh@suse.cz>
1262
1263         * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
1264         call, DECL_EXTERNAL checks and current_function_decl saving.
1265
1266 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
1267
1268         PR c++/29731 (again)
1269         * parser.c (cp_parser_primary_expression): Return error_mark_node
1270         when a statement-expression is found in a template-argument list.
1271
1272 2007-09-04  Jason Merrill  <jason@redhat.com>
1273
1274         * except.c (initialize_handler_parm): Use
1275         fold_build_cleanup_point_expr.
1276
1277         PR c++/31419
1278         * call.c (reference_binding): Don't look for user-defined conversions
1279         to the same type.
1280
1281         PR c++/31411
1282         * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
1283         the MUST_NOT_THROW_EXPR.
1284
1285 2007-09-04  Richard Sandiford  <richard@codesourcery.com>
1286
1287         * decl.c (cp_finish_decl): Call determine_visibility before
1288         make_rtl_for_nonlocal_decl.
1289
1290 2007-09-04  Jason Merrill  <jason@redhat.com>
1291
1292         PR c++/14032
1293         * pt.c (most_specialized_class): Substitute outer template
1294         arguments into the arguments of a member template partial
1295         specialization.
1296         (strip_innermost_template_args): New fn.
1297
1298 2007-09-03  Daniel Jacobowitz  <dan@codesourcery.com>
1299
1300         * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
1301
1302 2007-09-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1303
1304         * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
1305         * decl.c (cp_make_fname_decl): Likewise,
1306         * parser.c (cp_parser_string_literal): Likewise,
1307         * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
1308         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
1309         Likewise,
1310
1311 2007-09-02  Paolo Carlini  <pcarlini@suse.de>
1312
1313         PR c++/33208
1314         * typeck.c (build_unary_op): Fix error message for
1315         Boolean expression as operand to operator--.
1316
1317 2007-09-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1318
1319         * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
1320         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
1321         Likewise.
1322
1323 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
1324
1325         PR c++/32597
1326         * init.c (build_default_init): Make extern.
1327         * cp-tree.h (build_default_init): Declare here.
1328         * pt.c (tsubst_expr): When the instantiation of the initializer of
1329         a variable results in an empty list, default-initialize the
1330         variable.
1331         (tsubst_copy_and_build): When the instantiation of the initializer
1332         in a new expression results in an empty initializer list,
1333         default-initialize it.
1334
1335 2007-08-31  Douglas Gregor  <doug.gregor@gmail.com>
1336
1337         * mangle.c (write_type): Change mangling of rvalue reference from
1338         `RR' to `O'. 
1339
1340 2007-08-31  Jakub Jelinek  <jakub@redhat.com>
1341
1342         * decl.c (duplicate_decls): Remove duplicated line.
1343
1344 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
1345
1346         PR c++/33210
1347         * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
1348         BOUND_TEMPLATE_TEMPLATE_PARM.
1349
1350 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
1351
1352         PR c++/32113
1353         * search.c (lookup_member): Check the name argument for
1354         error_mark_node.
1355
1356 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
1357
1358         PR c++/33212
1359         * parser.c (cp_parser_trait_expr): Check rerurn value of
1360         cp_parser_type_id.
1361
1362 2007-08-30  Ollie Wild  <aaw@google.com>
1363
1364         * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
1365         convert_ptrmem for pointer to member conversions.
1366         (convert_to_pointer_force): Update cp_convert_to_pointer call.
1367         (ocp_convert): Update cp_convert_to_pointer call.
1368         * typeck.c (convert_ptrmem): Add conditional for null pointers to
1369         members.
1370         (build_static_cast_1): Check can_convert for conversions in either
1371         direction.
1372         (get_delta_difference_1): New function.
1373         (get_delta_difference): Refactor to call get_delta_difference_1.
1374
1375 2007-08-30  Jakub Jelinek  <jakub@redhat.com>
1376
1377         * decl.c (start_preparsed_function): Set
1378         DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
1379
1380 2007-08-28  Paolo Carlini  <pcarlini@suse.de>
1381
1382         PR c++/33209
1383         * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
1384         BOUND_TEMPLATE_TEMPLATE_PARM.
1385
1386 2007-08-28  Jakub Jelinek  <jakub@redhat.com>
1387
1388         PR c++/32596
1389         PR c++/32400
1390         * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
1391         and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
1392
1393 2007-08-27  Jason Merrill  <jason@redhat.com>
1394
1395         PR c++/29000
1396         * pt.c (build_non_dependent_expr, type_dependent_expression_p): 
1397         Look inside STMT_EXPR.
1398         * semantics.c (stmt_expr_value_expr): New fn.
1399         * cp-tree.h: Declare it.
1400
1401         PR c++/28558
1402         * decl.c (groktypename): Ignore attributes applied to class type.
1403
1404 2007-08-28  Richard Guenther  <rguenther@suse.de>
1405
1406         * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
1407
1408 2007-08-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1409         
1410         * error.c (dump_expr): Handle COMPLEX_CST.
1411         * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
1412         (pp_cxx_expression): Likewise.
1413
1414 2007-08-27  Alexandre Oliva  <aoliva@redhat.com>
1415
1416         * decl.c (GNU_INLINE_P): New.
1417         (duplicate_decls): Handle gnu_inline.  Merge attributes and
1418         some flags in overriding definitions.
1419         (redeclaration_error_message): Handle gnu_inline.
1420         (start_preparsed_function): Likewise.
1421
1422 2007-08-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1423
1424         * call.c (sufficient_parms_p): Constify.
1425         * class.c (same_signature_p): Likewise.
1426         * cp-gimplify.c (is_invisiref_parm,
1427         cxx_omp_privatize_by_reference): Likewise.
1428         * cp-objcp-common.c (has_c_linkage): Likewise.
1429         * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
1430         sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
1431         grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
1432         num_artificial_parms_for, comp_template_parms,
1433         template_parameter_pack_p, any_dependent_template_arguments_p,
1434         any_type_dependent_arguments_p, any_value_dependent_elements_p,
1435         repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
1436         zero_init_p, member_p, cp_lvalue_kind,
1437         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
1438         varargs_function_p, is_dummy_object, special_function_kind,
1439         string_conv_p, type_unknown_p, comp_except_specs, compparms,
1440         comp_cv_qualification, is_bitfield_expr_with_lowered_type,
1441         unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
1442         cp_has_mutable_p, at_least_as_qualified_p,
1443         invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
1444         * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
1445         * except.c (nothrow_libfn_p): Likewise.
1446         * method.c (skip_artificial_parms_for, num_artificial_parms_for):
1447         Likewise.
1448         * pt.c (comp_template_parms, template_parameter_pack_p,
1449         any_type_dependent_arguments_p, any_value_dependent_elements_p,
1450         any_dependent_template_arguments_p): Likewise.
1451         * repo.c (repo_export_class_p): Likewise.
1452         * semantics.c (anon_aggr_type_p): Likewise.
1453         * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
1454         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
1455         varargs_function_p, member_p, is_dummy_object, pod_type_p,
1456         zero_init_p, special_function_p): Likewise.
1457         * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
1458         comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
1459         compparms, invalid_nonstatic_memfn_p,
1460         is_bitfield_expr_with_lowered_type, unlowered_expr_type,
1461         string_conv_p, ptr_reasonably_similar, cp_type_readonly,
1462         cp_has_mutable_p, lvalue_or_else): Likewise.
1463
1464 2007-08-25  Paolo Bonzini  <bonzini@gnu.org>
1465
1466         * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
1467         * cp-objcp-common.c (cp_tree_size): Ditto.
1468         * tree.c (cp_walk_subtrees): Ditto
1469         * cp-tree.def (TINST_LEVEL): Go away.
1470         * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
1471         move together with other non-tree structs.
1472         (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
1473         (union lang_tree_node): Eliminate tinst_level field.
1474         (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
1475         (current_instantiation, outermost_tinst_level): Return
1476         a "struct tinst_level *".
1477
1478         * error.c (print_instantiation_partial_context): Change second
1479         parameter to a "struct tinst_level *".  Replace accessor macros
1480         with field access.
1481         (print_instantiation_full_context): Likewise.
1482         * lex.c (in_main_input_context): Likewise.
1483
1484         * pt.c (struct pending_templates): New.
1485         (pending_templates, last_pending_template): Use it as a type.
1486         (current_tinst_level): Change typo to "struct tinst_level *"
1487         (reopen_tinst_level): Accept "struct tinst_level *", return decl.
1488         (add_pending_template): Construct a "struct pending_template".
1489         Replace TINST_LEVEL accessor macros with field access.
1490         (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
1491         (pop_tinst_level): Likewise.
1492         (instantiate_pending_templates): Likewise.  Factor common code used
1493         when an instantiation has been done.
1494         (outermost_tinst_level): Replace tree_last with loop.
1495         (current_instantiation): Return a "struct tinst_level *".
1496
1497 2007-08-24  Ollie Wild  <aaw@google.com>
1498
1499         * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
1500         * name-lookup.h (cp_binding_level): Remove vtables member.
1501
1502 2007-08-24  Richard Guenther  <rguenther@suse.de>
1503
1504         * tree.c (cp_cannot_inline_tree_fn): Remove.
1505         * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
1506         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
1507         Remove define.
1508
1509 2007-08-24  Jakub Jelinek  <jakub@redhat.com>
1510
1511         PR c++/32567
1512         * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
1513         error_mark_node right away if build_expr_type_conversion
1514         returned it.
1515
1516         PR c++/32898
1517         * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
1518         is error_mark_node rather than NULL_TREE.
1519         * pt.c (check_explicit_specialization): Likewise.
1520
1521         PR c++/31941
1522         * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
1523         TARGET_VTABLE_USES_DESCRIPTORS targets properly.
1524
1525 2007-08-22  Jason Merrill  <jason@redhat.com>
1526
1527         PR c++/29365
1528         * pt.c (outermost_tinst_level): New function.
1529         * lex.c (in_main_input_context): New function.
1530         * cp-tree.h: Declare it.
1531         * decl2.c (constrain_class_visibility): Use it to avoid warning
1532         about uses of the anonymous namespace in the main input file.
1533
1534 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
1535
1536         * init.c (build_new_1): Use get_target_expr instead of save_expr.
1537
1538 2007-08-20  Pawel Sikora  <pluto@pld-linux.org>
1539
1540         PR c++/7302
1541         * class.c (finish_struct_1): Warn when a class has virtual
1542         functions and accessible non-virtual destructor.
1543
1544 2007-08-20  Richard Guenther  <rguenther@suse.de>
1545
1546         PR c++/22369
1547         PR c++/22451
1548         * call.c (build_new_method_call): Convert initializer to
1549         the basetype.
1550         * init.c (build_aggr_init): Do not fiddle with types.
1551         (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
1552         * except.c (build_throw): Do not drop qualifiers for the
1553         pointer type.
1554         * typeck.c (get_member_function_from_ptrfunc): Do not
1555         fiddle with types, instead convert.
1556         (build_ptrmemfunc1): Convert to the target type for
1557         initialization.
1558         (gfc_trans_allocate): Convert result to target type.
1559         * cp-objcp-common.c (cxx_get_alias_set): Pointers to
1560         pointer-to-member structures shall have alias set zero as well.
1561
1562 2007-08-20  Richard Guenther  <rguenther@suse.de>
1563
1564         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
1565         Remove.
1566         * cp-tree.h (cp_auto_var_in_fn_p): Remove.
1567         (nonstatic_local_decl_p): Likewise.
1568         * tree.c (cp_auto_var_in_fn_p): Remove.
1569         * decl.c (nonstatic_local_decl_p): Remove.
1570
1571 2007-08-20  Richard Guenther  <rguenther@suse.de>
1572
1573         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
1574         Remove define.
1575         * tree.h (cp_walk_tree): New define to walk_tree_1 with
1576         cp_walk_subtrees lh parameter.
1577         (cp_walk_tree_without_duplicates): New define to
1578         walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
1579         * tree.c (count_trees): Call
1580         cp_walk_tree_without_duplicates.
1581         (verify_stmt_tree): Call cp_walk_tree.
1582         (break_out_target_exprs): Likewise.
1583         (WALK_SUBTREE): Likewise.
1584         * cp-gimplify.c (cp_genericize): Likewise.
1585         * cp-pt.c (find_parameter_packs_r): Likewise.
1586         (uses_parameter_packs): Likewise.
1587         (make_pack_expansion): Likewise.
1588         (check_for_bare_parameter_packs): Likewise.
1589         (for_each_template_parm): Likewise.
1590         * decl.c (check_default_argument): Call
1591         cp_walk_tree_without_duplicates.
1592         * except.c (build_throw): Likewise.
1593         * decl2.c (type_visibility): Likewise.
1594         * semantics.c (expand_or_defer_fn): Likewise.
1595         (finalize_nrv): Call cp_walk_tree.
1596
1597 2007-08-20  Jakub Jelinek  <jakub@redhat.com>
1598
1599         PR c++/33025
1600         * init.c (build_new_1): Rename placement_var variable to placement_expr.
1601         Initialize it with save_expr rather than get_temp_regvar.
1602
1603 2007-08-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1604
1605         PR c++/28989
1606         * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
1607         lvalues.
1608
1609 2007-08-17  Ollie Wild  <aaw@google.com>
1610
1611         PR c++/31749
1612         * name-lookup.c (do_nonmember_using_decl): Shift implicit type
1613         declarations into appropriate slots for comparison.  Fix type
1614         comparison.
1615
1616 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
1617
1618         PR c++/32112
1619         * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
1620         * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
1621
1622 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
1623
1624         PR c++/32870
1625         * parser.c (cp_parser_class_head): Improve error message.
1626
1627 2007-08-16  Seongbae Park  <seongbae.park@gmail.com>
1628
1629         * pt.c (instantiate_decl): Set input_location
1630         for the function end.
1631
1632 2007-08-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1633
1634         * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
1635         Constify.
1636         * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
1637         class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
1638         cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
1639         cxx_warn_unused_global_decl, cp_expr_size): Likewise.
1640         * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
1641         * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
1642         * typeck.c (cp_type_quals): Likewise.
1643         * typeck2.c (cxx_incomplete_type_diagnostic,
1644         cxx_incomplete_type_error): Likewise.
1645
1646 2007-08-16  Paolo Carlini  <pcarlini@suse.de>
1647
1648         PR c++/31132
1649         * pt.c (tsubst_friend_function): When check_classfn
1650         returns error_mark_node likewise return it.
1651
1652 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
1653
1654         PR c++/32992
1655         * typeck.c (check_return_expr): Don't NRV optimize vars in
1656         anonymous unions.
1657         * decl.c (finish_function): Comment fix.
1658
1659 2007-08-15  Paolo Carlini  <pcarlini@suse.de>
1660
1661         PR c++/33035
1662         * pt.c (push_template_decl_real): Depending on TYPE_P
1663         use either TYPE_CONTEXT or DECL_CONTEXT.
1664
1665 2007-08-14  Mark Mitchell  <mark@codesourcery.com>
1666
1667         * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
1668         constructors and destructors return this.
1669
1670 2007-08-14  Paolo Carlini  <pcarlini@suse.de>
1671
1672         PR c++/27211
1673         * decl2.c (check_classfn): Return error_mark_node in case of error;
1674         in that case, do not call add_method.
1675         * decl.c (start_decl): Deal with check_classfn returning
1676         error_mark_node.
1677         (grokfndecl): Likewise.
1678         * pt.c (tsubst_friend_function): Likewise.
1679
1680 2007-08-14  Andrew Pinski  <pinskia@gmail.com>
1681
1682         PR c++/30428
1683         * typeck.c (build_binary_op): Disallow vector float types with
1684         BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
1685
1686 2007-08-11  Ian Lance Taylor  <iant@google.com>
1687
1688         * cp-objcp-common.c (cxx_get_alias_set): Change return type to
1689         alias_set_type.
1690         * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
1691
1692 2007-08-10  Ollie Wild  <aaw@google.com>
1693
1694         * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
1695         type lookups.
1696         (ambiguous_decl): Construct tree of ambiguous types.  Remove extaneous
1697         function parameter.
1698         (unqualified_namespace_lookup): Fix ambiguous_decl call.
1699         (lookup_using_namespace): Fix ambiguous_decl call.
1700         (qualified_lookup_using_namespace): Fix ambiguous_decl call.
1701
1702 2007-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1703
1704         * call.c (name_as_c_string): Use CONST_CAST.
1705         * decl.c (build_decl): Likewise.
1706         * parser.c (cp_parser_string_literal): Likewise.
1707
1708 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
1709
1710         PR c++/17763
1711         * error.c (dump_expr): Consistently use the *_cxx_*
1712         variants of the pretty-print functions.
1713
1714 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
1715
1716         PR c++/22256
1717         * decl.c (check_special_function_return_type): Just error
1718         on return type specified for conversion operator.
1719
1720 2007-08-09  Daniel Berlin  <dberlin@dberlin.org>
1721
1722         * typeck2.c (readonly_error): Handle general expressions.
1723         * error.c (dump_expr): Handle POINTER_PLUS_EXPR
1724
1725 2007-08-06  Dan Hipschman  <dsh@google.com>
1726
1727         * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
1728         access function name.
1729
1730 2007-08-04  Alfred Minarik  <a.minarik@aon.at>
1731
1732         PR pch/13676
1733         * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
1734         * g++spec.c (lang_specific_driver): Check them.
1735
1736 2007-08-06  Paolo Carlini  <pcarlini@suse.de>
1737
1738         PR c++/19532
1739         * pt.c (inline_needs_template_parms): Fix comment; change return type
1740         to bool.
1741
1742 2007-08-05  Volker Reichelt  <v.reichelt@netcologne.de>
1743
1744         Revert:
1745         2007-03-26  Dirk Mueller  <dmueller@suse.de>
1746
1747         * parser.c (cp_parser_member_declaration): Pedwarn
1748         about stray semicolons after member declarations.
1749
1750 2007-08-02  Lee Millward  <lee.millward@gmail.com>
1751
1752         PR c++/30849
1753         PR c++/30850
1754         PR c++/30851
1755         * parser.c (cp_parser_asm_definition): Detect and discard asm
1756         statements with invalid inputs or outputs.
1757         (cp_parser_asm_operand_list): Return error mark node if any
1758         of the operands are invalid. Adjust documentation.
1759         
1760 2007-08-02  Nick Clifton  <nickc@redhat.com>
1761
1762         * typeck.c: Change copyright header to refer to version 3 of the
1763         GNU General Public License and to point readers at the COPYING3
1764         file and the FSF's license web page.
1765         * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
1766         config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
1767         Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
1768         cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
1769         tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
1770         cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
1771         cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
1772         name-lookup.h, parser.c: Likewise.
1773
1774 2007-08-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1775
1776         PR middle-end/32668
1777         * call.c (magic_varargs_p): Honor the "type generic" attribute.
1778
1779 2007-07-30  Paolo Carlini  <pcarlini@suse.de>
1780
1781         PR c++/32108
1782         * semantics.c (finish_label_stmt): Reject the __label__
1783         extension outside function scopes.
1784
1785 2007-07-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1786
1787         * parser.c (eof_token): Un-constify.
1788         (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
1789         cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
1790         casts.
1791
1792 2007-07-28  Kazu Hirata  <kazu@codesourcery.com>
1793
1794         * pt.c, tree.c, typeck2.c: Fix comment typos.
1795
1796 2007-07-28  Simon Martin  <simartin@users.sourceforge.net>
1797             Mark Mitchell  <mark@codesourcery.com>
1798
1799         PR c++/30917
1800         * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
1801         hidden due to friend declarations in local classes.
1802
1803 2007-07-27  Douglas Gregor  <doug.gregor@gmail.com>
1804
1805         * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
1806         * cp-tree.def (DECLTYPE_TYPE): New.
1807         * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
1808         (dump_type_prefix): Ditto.
1809         (dump_type_suffix): Ditto.
1810         * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
1811         * mangle.c (write_type): Handle DECLTYPE_TYPE.
1812         * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
1813         types.
1814         (DECLTYPE_TYPE_EXPR): New.
1815         (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
1816         (finish_declared_type): Declare.
1817         * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
1818         DECLTYPE_TYPE nodes.
1819         (pp_cxx_type_id): Ditto.
1820         * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
1821         (tsubst): Substitute into a DECLTYPE_TYPE node.
1822         (tsubst_copy): Ditto.
1823         (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
1824         nodes.
1825         (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
1826         * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
1827         structural equality (because we can't hash the expressions).
1828         (finish_declared_type): New.
1829         * lex.c (reswords): Add "decltype" keyword.
1830         * parser.c cp_lexer_next_token_is_decl_specifier_keyword
1831         (cp_parser_postfix_expression): Add member_access_only_p to
1832         restrict postfix expression to member access expressions.
1833         (cp_parser_unary_expression): Update call to
1834         cp_parser_postfix_expression to reflect new parameter.
1835         (cp_parser_declared_type): New.
1836         (cp_parser_simple_type_specifier): Parse decltype types.
1837
1838 2007-07-27  Mark Mitchell  <mark@codesourcery.com>
1839
1840         PR c++/32346
1841         * call.c (convert_for_arg_passing): Only widen bitfields to their
1842         declared types if necessary.
1843
1844 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1845
1846         * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
1847         Constify.
1848
1849 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1850
1851         * decl.c (typename_hash, typename_compare): Constify.
1852         * mangle.c (hash_type, compare_type): Likewise.
1853         * pt.c (eq_local_specializations, hash_local_specialization):
1854         Likewise.
1855         * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
1856         list_hash): Likewise.
1857         * typeck2.c (pat_compare): Likewise.
1858
1859 2007-07-24  Nathan Sidwell  <nathan@codesourcery.com>
1860
1861         * method.c (implicitly_declare_fn): Increase alignment if member
1862         function pointer format requires it.
1863
1864 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
1865
1866         PR c++/29001
1867         * typeck.c (check_return_expr): Do not pass a null argument
1868         to null_ptr_cst_p.
1869
1870 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
1871
1872         PR c++/32561
1873         * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
1874         only on VAR_DECL.
1875
1876 2007-07-22  Nathan Sidwell  <nathan@codesourcery.com>
1877
1878         PR c++/32839
1879         * typeck.c (convert_arguments): Only use default args if we have
1880         a function decl.
1881
1882         PR c++/30818
1883         * typeck.c (structural_comptypes): No need to check
1884         resolve_typename_type return value here.
1885         * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
1886         * pt.c (resolve_typename_type): Follow typename typedefs.  Return
1887         original type rather than error_mark_node in case of failure.
1888         * parser.c (cp_parser_nested_name_specifier_opt): Adjust
1889         resolve_typename_type result check.
1890         (cp_parser_direct_declarator, cp_parser_head,
1891         cp_parser_constructor_declarator_p): Likewise.
1892
1893 2007-07-12  Kazu Hirata  <kazu@codesourcery.com>
1894
1895         * pt.c (template_parms_variadic_p): Remove.
1896         * cp-tree.h: Remove the prototype for template_parms_variadic_p.
1897
1898 2007-07-12  Jakub Jelinek  <jakub@redhat.com>
1899
1900         PR c++/30854
1901         * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
1902         argument to dump_aggr_init_expr_args instead of false.
1903
1904 2007-07-11  Douglas Gregor  <doug.gregor@gmail.com>
1905
1906         * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
1907         canonical types; otherwise, fall back to structural type
1908         comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
1909         internal compiler error if the canonical types are wrong.
1910         
1911 2007-07-11  Paolo Carlini  <pcarlini@suse.de>
1912
1913         PR c++/32560
1914         * parser.c (cp_parser_make_indirect_declarator): When the
1915         the code argument is ERROR_MARK return cp_error_declarator.
1916
1917 2007-07-09  Geoffrey Keating  <geoffk@apple.com>
1918
1919         PR 32617
1920         * decl.c (cxx_init_decl_processing): Don't set
1921         force_align_functions_log.
1922         (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
1923         * typeck.c (cxx_alignof_expr): When alignof is used on a plain
1924         FUNCTION_DECL, return its alignment.
1925
1926 2007-07-09  Richard Guenther  <rguenther@suse.de>
1927
1928         * decl.c (start_preparsed_function): Do not promote return type.
1929
1930 2007-07-08  Paolo Carlini  <pcarlini@suse.de>
1931
1932         PR c++/30535
1933         * pt.c (unify): Never pass error_mark_node to template_decl_level.
1934
1935 2007-07-07  Mark Mitchell  <mark@codesourcery.com>
1936
1937         PR c++/32232
1938         * pt.c (resolve_overloaded_unification): Robustify.  Return a
1939         bool, not an int.
1940         (type_unification_real): Adjust accordingly.
1941
1942 2007-07-06  Richard Guenther  <rguenther@suse.de>
1943
1944         * init.c (build_new_1): Use the correct pointer type.
1945         * typeck2.c (build_m_component_ref): Likewise.
1946
1947 2007-07-05  Mark Mitchell  <mark@codesourcery.com>
1948
1949         PR c++/32245
1950         * init.c (build_zero_init): Always build an initializer for
1951         non-static storage.
1952         * typeck2.c (build_functional_cast): Use build_zero_init.
1953
1954         PR c++/32251
1955         * init.c (build_new_1): Always pass the allocation function to
1956         build_op_delete_call.
1957         * call.c (build_op_delete_call): Handle operator delete with a
1958         variable-argument list.  Do not issue an error when no matching
1959         deallocation function is available for a new operator.
1960
1961         PR c++/31992
1962         * cp-tree.h (any_value_dependent_elements_p): Declare it.
1963         * decl.c (value_dependent_init_p): New function.
1964         (cp_finish_decl): Use it.
1965         * pt.c (value_dependent_expression_p): Use
1966         any_value_dependent_elements_p.
1967         * parser.c (cp_parser_primary_expression): Add comment about
1968         treating dependent qualified names as integral
1969         constant-expressions.
1970
1971 2007-07-04  Douglas Gregor  <doug.gregor@gmail.com>
1972
1973         * decl.c (build_ptrmemfunc_type): Always use structural equality
1974         tests when comparing pointer-to-member-function types, because the
1975         handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
1976         types.
1977         
1978 2007-07-03  Mark Mitchell  <mark@codesourcery.com>
1979
1980         * init.c (build_new): Tweak comment.
1981
1982 2007-06-29  Dave Brolley  <brolley@redhat.com>
1983
1984         PR c++/31743
1985         * parser.c (cp_parser_new_type_id): Don't reduce a named array
1986         type to its base type and number of elements here.
1987         * init.c (build_new): Call complete_type_or_else to ensure that the
1988         type is complete and to issue a diagnostic if it is not.
1989         (build_new_1): Don't call complete_type_or_else here.
1990
1991 2007-07-03  Richard Guenther  <rguenther@suse.de>
1992
1993         PR c++/32609
1994         * class.c (fixed_type_or_null): Re-lookup the hashtable slot
1995         after recursing.
1996
1997 2007-07-02  Simon Baldwin  <simonb@google.com>
1998
1999         * parser.c (cp_parser_elaborated_type_specifier): Added a warning
2000         for inner-style nested forward declarations that don't declare
2001         anything useful.
2002
2003 2007-07-02  Jakub Jelinek  <jakub@redhat.com>
2004
2005         PR c++/31748
2006         * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
2007         DECL_P in not a variable and appears more than once error messages.
2008
2009 2007-07-01  Ollie Wild  <aaw@google.com>
2010
2011         * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
2012         (select_decl): Remove function.
2013         (unqualified_namespace_lookup): Populate binding by calling
2014         ambiguous_decl.  Remove select_decl call.
2015         (lookup_qualified_name): Remove select_decl call.
2016         * decl.c (lookup_and_check_tag): Check for ambiguous references.
2017         * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
2018         generation when name lookup is ambiguous.
2019
2020 2007-06-29  Douglas Gregor  <doug.gregor@gmail.com>
2021
2022         PR c++/31724
2023         * init.c (build_new_1): Use structural equality on the copy of the
2024         array type.
2025
2026 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
2027
2028         * decl2.c (determine_visibility): Implement
2029         flag_visibility_ms_compat effect on type info.
2030         * decl.c (cxx_init_decl_processing): Implement
2031         global effect of flag_visibility_ms_compat.
2032
2033 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
2034
2035         * decl2.c (start_objects): Mark constructor-running function
2036         as artificial.
2037
2038 2007-06-26  Simon Martin  <simartin@users.sourceforge.net>
2039
2040         PR c++/32111
2041         * decl.c (grokdeclarator): Reset friendp for member functions declared
2042         friend of their own class.
2043
2044 2007-06-23  Mark Mitchell  <mark@codesourcery.com>
2045
2046         * decl2.c (determine_visibility): Don't look for dllexport here.
2047         (determine_visibility_from_class): Tidy.
2048
2049 2007-06-18  Simon Baldwin <simonb@google.com>
2050
2051         PR c++/31923
2052         * parser.c (cp_parser_single_declaration): Added check for storage
2053         class other than sc_none in parsed declaration, and a flag to indicate
2054         if the call is part of an explicit template specialization parse.
2055         * (cp_parser_explicit_specialization): Specialization check flag added
2056         to call to cp_parser_single_declaration(), set true.
2057         * (cp_parser_template_declaration_after_export): Specialization check
2058         flag added to call to cp_parser_single_declaration(), set false.
2059         * pt.c (check_explicit_specialization): Added code to copy visiblity
2060         and linkage from the templated function to the explicit specialization.
2061
2062 2007-06-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2063
2064         * typeck.c (build_binary_op): For templates build the
2065         expression in pieces to avoid the assert in build2_stat.
2066         (get_member_function_from_ptrfunc):
2067         Change over to using POINTER_PLUS_EXPR and convert
2068         the second operand to sizetype.
2069         * typeck2.c (build_m_component_ref):  Likewise.
2070         * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
2071         instead of PLUS_EXPR for pointers.
2072         (build_new_1): Likewise.
2073         (build_vec_delete_1): Likewise.
2074         (build_vec_delete): Likewise.
2075         * class.c (build_base_path): Likewise.
2076         (build_base_path): Likewise.
2077         (convert_to_base_statically): Likewise.
2078         (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
2079         (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
2080         instead of PLUS_EXPR.
2081         (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
2082         instead of PLUS_EXPR for pointers.
2083         * call.c (build_special_member_call): Likewise.
2084         * rtti.c (build_headof): Likewise.
2085         Use sizetype instead of ptrdiff_type_node.
2086         (tinfo_base_init): Create a POINTER_PLUS_EXPR
2087         instead of PLUS_EXPR for pointers.
2088         * except.c (expand_start_catch_block):  Do a
2089         NEGATIVE and then a POINTER_PLUS_EXPR instead
2090         of a MINUS_EXPR.
2091         * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
2092         PLUS_EXPR on pointer types over to use
2093         POINTER_PLUS_EXPR and remove the conversion
2094         to the pointer types.
2095         * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
2096         adding to a pointer type. Use size_int instead of
2097         ssize_int. Convert the index to sizetype before
2098         adding it to the pointer.
2099
2100 2007-06-15  Mark Mitchell  <mark@codesourcery.com>
2101
2102         * cp-tree.h (DECL_VAR_MARKED_P): Remove.
2103         (DECL_ANON_UNION_VAR_P): New macro.
2104         * class.c (fixed_type_or_null): Tidy.  Use a hash table, rather
2105         than DECL_VAR_MARKED_P, to keep track of which variables we have
2106         seen.
2107         * decl.c (redeclaration_error_message): Complain about redeclaring
2108         anonymous union members at namespace scope.
2109         * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
2110
2111 2007-06-14  Geoff Keating  <geoffk@apple.com>
2112
2113         * decl2.c (determine_visibility): Ensure that functions with
2114         hidden types as parameters are hidden.
2115
2116         PR 31093
2117         * decl2.c (determine_visibility): Remove duplicate code for
2118         handling type info.
2119
2120 2007-06-12  Ian Lance Taylor  <iant@google.com>
2121
2122         PR libstdc++/29286
2123         * init.c (avoid_placement_new_aliasing): New static function.
2124         (build_new_1): Call it.
2125
2126 2007-06-11  Rafael Avila de Espindola  <espindola@google.com>
2127
2128         * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
2129         (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
2130
2131 2007-06-08  Jakub Jelinek  <jakub@redhat.com>
2132
2133         PR c++/32177
2134         * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
2135         on init, the non-decl cond operand and increment value.
2136
2137 2007-06-07  Simon Martin  <simartin@users.sourceforge.net>
2138
2139         PR c++/30759
2140         * decl.c (check_initializer): Report an error when a brace enclosed
2141         initializer is used for a non-aggregate type in C++98.
2142         (redeclaration_error_message): Rewrote flag_cpp0x in terms of
2143         cxx_dialect.
2144         (grokdeclarator): Likewise.
2145         (move_fn_p): Likewise.
2146         * typeck.c (check_return_expr): Likewise.
2147         * call.c (reference_binding): Likewise.
2148         * error.c (cp_cpp_error): Likewise.
2149         * pt.c (check_default_tmpl_args): Likewise.
2150         (tsubst): Likewise.
2151         * lex.c (init_reswords): Likewise.
2152         * parser.c (p_parser_primary_expression): Likewise.
2153         (TOKEN_PRECEDENCE): Likewise.
2154         (cp_parser_init_declarator): Likewise.
2155         (cp_parser_ptr_operator): Likewise.
2156         (cp_parser_parameter_declaration): Likewise.
2157         (cp_parser_enclosed_template_argument_list): Likewise.
2158         (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
2159         (cp_parser_next_token_ends_template_argument_p): Likewise.
2160
2161 2007-06-04  Simon Baldwin  <simonb@google.com>
2162
2163         * decl.c (grokdeclarator): Readability change.  Moved case labels
2164         into direct switch statement scope.
2165
2166 2007-06-04  Paolo Carlini  <pcarlini@suse.de>
2167
2168         * call.c (convert_like_real): Remove pointless code.
2169
2170 2007-05-31  Mark Mitchell  <mark@codesourcery.com>
2171
2172         * decl.c (get_atexit_fn_ptr_type): New function.
2173         (get_atexit_node): Use it.
2174         (start_cleanup_fn): Likewise.
2175         (register_dtor_fn): Use the object's destructor, instead of a
2176         separate cleanup function, where possible.
2177         * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
2178         (atexit_fn_ptr_type_node): New macro.
2179         * decl2.c (build_cleanup): Use build_address.
2180
2181 2007-05-31  Daniel Berlin  <dberlin@dberlin.org>
2182
2183         * typeck.c (build_binary_op): Include types in error.
2184
2185 2007-05-31  Jakub Jelinek  <jakub@redhat.com>
2186
2187         PR c++/31806
2188         * decl.c (cp_finish_decl): Also clear was_readonly if a static var
2189         needs runtime initialization.
2190
2191 2007-05-31  Paolo Carlini  <pcarlini@suse.de>
2192
2193         PR c++/32158
2194         * semantics.c (finish_trait_expr): Complete the types.
2195
2196 2007-05-30  Russell Yanofsky <russ@yanofsky.org>
2197             Douglas Gregor <doug.gregor@gmail.com>
2198             Pedro Lamarao <pedro.lamarao@mndfck.org>
2199             Howard Hinnant <howard.hinnant@gmail.com>
2200
2201         PR c++/7412
2202         PR c++/29939
2203         * typeck.c (comptypes): Don't consider rvalue and lvalue
2204         reference types to be equivalent.
2205         (check_return_expr): Move from certain lvalues when returning
2206         them.
2207         * decl.c (grokdeclarator): Implement reference collapsing.
2208         (copy_fn_p): Don't consider constructors taking rvalue references
2209         to be copy constructors.
2210         (move_fn_p): New.
2211         * call.c (conversion): New "rvaluedness_matches_p" member.
2212         (convert_class_to_reference): Require reference type as first
2213         parameter instead of base type.
2214         (reference_binding): Add logic to handle rvalue references.
2215         (implicit_conversion): Update inaccurate comment.
2216         (convert_like_real): Disable creation of temporaries that are
2217         impossible to initialize for types with move constructors.
2218         (build_over_call): Elide move constructors when possible.
2219         (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
2220         (maybe_handle_ref_bind): Return conversion instead of type node.
2221         (compare_ics): Add logic to use "rvaluedness_matches_p" values to
2222         determine preferred conversion sequences.
2223         * cp-tree.h (TYPE_REF_IS_RVALUE): New.
2224         (LOOKUP_PREFER_RVALUE): New.
2225         (DECL_MOVE_CONSTRUCTOR_P): New.
2226         (struct cp_declarator): Add "reference" member for reference
2227         types, with new "rvalue_ref" flag.
2228         (cp_build_reference_type): Declare.
2229         (move_fn_p): Declare.
2230         * error.c (dump_type_prefix): Format rvalue reference types
2231         correctly in error messages.
2232         * except.c (build_throw): Move from certain lvalues when
2233         throwing.
2234         * mangle.c (write_type): Mangle rvalue references differently
2235         than regular references.
2236         * parser.c (make_reference_declarator): Add boolean parameter for
2237         rvalue references.
2238         (cp_parser_make_indirect_declarator): New.
2239         (cp_parser_new_declarator_opt): Call
2240         cp_parser_make_indirect_declarator. 
2241         (cp_parser_conversion_declarator_opt): Ditto.
2242         (cp_parser_declarator): Ditto.
2243         (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
2244         declarators.
2245         * pt.c (tsubst): Implement reference collapsing.
2246         (maybe_adjust_types_for_deduction): Implement special template
2247         parameter deduction rule for rvalue references.
2248         (type_unification_real): Update calls to
2249         maybe_adjust_types_for_deduction.
2250         (try_one_overload): Ditto.
2251         (unify_pack_expansion): Ditto.
2252         * tree.c (lvalue_p_1): Handle rvalue reference types.
2253         (cp_build_reference_type): New.
2254
2255 2007-05-30  Jakub Jelinek  <jakub@redhat.com>
2256
2257         PR c++/31809
2258         * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
2259         variables that need runtime initialization.
2260
2261 2007-05-28  Andrew Pinski  <Andrew_pinski@playstation.sony.com>
2262
2263         PR c++/31339
2264         * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
2265         case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
2266         case POSTDECREMENT_EXPR>): Return the error_mark_node
2267         if either the real or imaginary parts would an
2268         error_mark_node.
2269         
2270 2007-05-25  Simon Martin  <simartin@users.sourceforge.net>
2271             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2272
2273         PR c++/31745
2274         * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
2275         token is a closing brace, false if there are no tokens left.
2276         (cp_parser_namespace_alias_definition): Only consume the next token if
2277         it is a closing brace.
2278
2279         * parser.c (cp_parser_class_specifier): Likewise.
2280
2281 2007-05-25  H.J. Lu  <hongjiu.lu@intel.com>
2282
2283         * semantics.c (finish_member_declaration): Fix a typo in the
2284         last checkin.
2285
2286 2007-05-25  Douglas Gregor <doug.gregor@gmail.com>
2287
2288         PR c++/31431
2289         PR c++/31432
2290         PR c++/31434
2291         PR c++/31435
2292         PR c++/31437
2293         PR c++/31438
2294         PR c++/31442
2295         PR c++/31443
2296         PR c++/31444
2297         PR c++/31445
2298         * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
2299         * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
2300         * pt.c (check_for_bare_parameter_packs): Return bool indicated
2301         whether everything was okay. Fix indentation.
2302         (push_template_decl_real): Check for bare parameter packs in
2303         function parameters; where errors occur, mark the parameter types
2304         with ERROR_MARK_NODEs to avert ICEs.
2305         (coerce_template_parameter_pack): New.
2306         (coerce_template_parms): Moved parameter pack coercion into
2307         coerce_template_parameter_pack, and permit it anywhere in the
2308         template parameter list (not just at the end). Parameter and
2309         argument indices can vary (somewhat) separately now, so add
2310         PARM_IDX and ARG_IDX.
2311         (fn_type_unification): Don't set an argument pack as incomplete if
2312         no argument pack was deduced.
2313         (type_unification_real): If a type parameter is a parameter pack
2314         and has not otherwise been deduced, it will be deduced to an empty
2315         parameter pack.
2316         (more_specialized_fn): Use the actual lengths of the argument
2317         lists when comparing against expansions.
2318         * semantics.c (finish_member_declaration): If a field's type has
2319         bare parameter packs, error and set its type to ERROR_MARK_NODE.
2320
2321 2007-05-24  Danny Smith  <dannysmith@users.sourceforge.net>
2322
2323         PR target/27067
2324         * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
2325
2326 2007-05-22  Ollie Wild  <aaw@google.com>
2327
2328         * name-lookup.c (ambiguous_decl): Adds check for hidden types.
2329         (unqualified_namespace_lookup): Adds check for hidden types.
2330
2331 2007-05-22  Ollie Wild  <aaw@google.com>
2332
2333         * decl.c (duplicate_decls): Verify namespace names are unique.
2334
2335 2007-05-21  Mark Mitchell  <mark@codesourcery.com>
2336
2337         * decl.c (cxx_maybe_build_cleanup): Handle
2338         __attribute__((cleanup)).
2339
2340 2007-05-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2341
2342         * cvt.c (cp_convert_and_check): Don't check warnings if the
2343         conversion failed.
2344
2345 2007-05-18  Geoffrey Keating  <geoffk@apple.com>
2346
2347         * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
2348
2349 2007-05-14  Paolo Carlini  <pcarlini@suse.de>
2350
2351         PR c++/29928
2352         * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
2353         type only if is a class type (5.2.8/4).
2354
2355 2007-05-14  Rafael Avila de Espindola  <espindola@google.com>
2356
2357         * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
2358         * decl.c (grokdeclarator): Use unsigned_type_for instead of
2359         c_common_unsigned_type.
2360
2361 2007-05-11  Silvius Rus  <rus@google.com>
2362
2363         * cp/typeck.c (build_indirect_ref): Add call to
2364         strict_aliasing_warning.
2365         (build_reinterpret_cast_1): Condition call to
2366         strict_aliasing_warning. 
2367
2368 2007-05-11  Jan Hubicka  <jh@suse.cz>
2369
2370         * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
2371         * decl2.c (start_objects): ctors and dtors are no longer public.
2372         (cp_write_global_declarations): Do not call c_build_cdtor_fns.
2373         
2374 2007-05-07  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2375
2376         * typeck.c (build_unary_op): Remove code that used to
2377         handle non lvalue increments/decrements.
2378
2379 2007-05-07  Mike Stump  <mrs@apple.com>
2380
2381         * parser.c (check_empty_body): Add.
2382         (cp_parser_iteration_statement): Add call to check_empty_body.
2383
2384 2007-05-05  Geoffrey Keating  <geoffk@apple.com>
2385
2386         PR 31775
2387         * mangle.c (write_mangled_name): Mangle static variable names.
2388         (write_unqualified_name): Use local-source-name for
2389         namespace-scope static variables.
2390
2391 2007-05-04  Dirk Mueller  <dmueller@suse.de>
2392
2393         * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
2394         not in effect.
2395
2396 2007-05-02  Seongbae Park  <seongbae.park@gmail.com>
2397
2398         PR c++/31663
2399         * decl2.c (constrain_class_visibility): 
2400         Use strip_pointer_or_array_types instead of strip_array_types.
2401
2402 2007-04-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2403
2404         PR C++/30221
2405         * decl.c (reshape_init_r): Don't reshape the first element if it
2406         is a pointer to member function.
2407
2408 2007-04-27  Simon Baldwin  <simonb@google.com>
2409
2410         * decl.c (grokparms): Changed message format from %qD to %qE.
2411
2412 2007-04-27  Douglas Gregor  <doug.gregor@gmail.com>
2413
2414         * error.c (maybe_warn_variadic_templates): Variadic templates are
2415        now in C++0x, so only warn about them in C++98 mode.
2416         
2417 2007-04-26  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2418
2419         PR C++/30016
2420         * typeck.c (build_reinterpret_cast_1): Only allow conversion to
2421         integeral types from vectors types.
2422
2423 2007-04-26  Jakub Jelinek  <jakub@redhat.com>
2424
2425         PR c++/31598
2426         * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
2427         for type dependent OMP_CLAUSE_DECLs.
2428
2429 2007-04-24  Mark Mitchell  <mark@codesourcery.com>
2430
2431         PR c++/31338
2432         * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
2433         * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
2434         COMPLEX_TYPE is now an ARITHMETIC_TYPE.
2435         * init.c (build_zero_init): Adjust, as
2436         COMPLEX_TYPE is now a SCALAR_TYPE.
2437         * typeck2.c (digest_init): Allow brace-enclosed initializers for
2438         COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
2439
2440 2007-04-25  Paolo Carlini  <pcarlini@suse.de>
2441
2442         * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
2443         per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
2444         (trait_expr_value): Adjust.
2445
2446 2007-04-23  Simon Baldwin  <simonb@google.com>
2447
2448         * decl.c (grokparms): Added new error for duplicate function
2449         parameters names in function prototypes, to match gcc behavior.
2450
2451 2007-04-23  Jan Hubicka  <jh@suse.cz>
2452
2453         * cp/decl2.c (finish_objects): Do not call target constructor/destructor
2454         bits dirrectly.
2455
2456 2007-04-21  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2457
2458         * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
2459         instead of checking GIMPLE_STMT_P in chain_next.
2460
2461 2007-04-17  Mark Mitchell  <mark@codesourcery.com>
2462
2463         PR c++/31513
2464         * call.c (convert_for_arg_passing): Convert bitfields to their
2465         declared types.
2466
2467 2007-04-17  Simon Martin  <simartin@users.sourceforge.net>
2468
2469         PR c++/31517
2470         * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
2471
2472 2007-04-16  Seongbae Park <seongbae.park@gmail.com>
2473
2474         PR c++/29365
2475         * cp/decl2.c (constrain_class_visibility):
2476         Do not warn about the use of anonymous namespace in the main input file.
2477
2478 2007-04-15  Mark Mitchell  <mark@codesourcery.com>
2479
2480         * cp-tree.h (current_template_parms): Fix typo in comment.
2481
2482 2007-04-15  Kazu Hirata  <kazu@codesourcery.com>
2483
2484         * cp-tree.h, error.c: Fix comment typos.
2485
2486 2007-04-13  Jason Merrill  <jason@redhat.com>
2487
2488         PR c++/31074
2489         * call.c (reference_binding): Add c_cast_p parm.  If true,
2490         add quals to TO as needed to make it reference-compatible.
2491
2492 2007-04-11  Jan Hubicka  <jh@suse.cz>
2493
2494         * cp/class.c (convert_to_base_statically): Fold produced tree; verify
2495         that we are not processing template_decl.
2496
2497 2007-04-09  Mark Mitchell  <mark@codesourcery.com>
2498
2499         PR c++/31449
2500         * class.c (build_base_path): Ensure that the converted pointer has
2501         the same cv-qualification as the input.
2502
2503 2007-04-09  Paolo Carlini  <pcarlini@suse.de>
2504
2505         * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
2506
2507 2007-04-08  Steven Bosscher  <steven@gcc.gnu.org>
2508
2509         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
2510         Do not set it.
2511         (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
2512         * tree.c (cp_add_pending_fn_decls): Remove.
2513         * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
2514
2515 2007-04-07  Daniel Berlin  <dberlin@dberlin.org>
2516
2517         Revert change removing staticp.
2518
2519 2007-04-06  Daniel Berlin  <dberlin@dberlin.org>
2520
2521         * cp-objcp-common.c (cxx_staticp): Remove.
2522         * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
2523         * cp-tree.h (cxx_staticp):      
2524
2525 2007-04-04  Danny Smith  <dannysmith.users.sourceforge.net>
2526
2527         * class.c (check_for_override): Don't remove dllmport attribute
2528         of virtual methods.
2529
2530 2007-04-03  Jakub Jelinek  <jakub@redhat.com>
2531
2532         PR c++/30847
2533         * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
2534         type issue error and return early.
2535
2536 2007-03-30  Jason Merrill  <jason@redhat.com>
2537
2538         PR c++/31187
2539         * typeck.c (cp_type_readonly): New fn.
2540         * cp-tree.h: Declare it.
2541         * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
2542         (cp_finish_decl): Not here.
2543
2544 2007-03-31  Richard Guenther  <rguenther@suse.de>
2545
2546         * optimize.c (maybe_clone_body): Replace splay-tree usage by
2547         pointer-map.
2548
2549 2007-03-31  Douglas Gregor  <doug.gregor@gmail.com>
2550
2551         PR c++/31138
2552         PR c++/31140
2553         PR c++/31141
2554         * parser.c (declarator_can_be_parameter_pack): New.
2555         (cp_parser_template_parameter): Only parse the `...' if the
2556         declarator can be a parameter pack.
2557         (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
2558         is NULL.
2559         * pt.c (find_parameter_packs_r): Look into the bounds on integer
2560         types (they could be used as array bounds). 
2561         (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
2562         (tsubst_pack_expansion): Handle failure to expand parameter
2563         packs.
2564         
2565 2007-03-30  Paolo Carlini  <pcarlini@suse.de>
2566
2567         PR c++/26099
2568         * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
2569         TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
2570         (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
2571         (CLASS_TYPE_NON_UNION_P): Add.
2572         (struct lang_type_class): Add has_complex_dflt.
2573         (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
2574         (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
2575         * cp-tree.def: Add TRAIT_EXPR.
2576         * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
2577         * lex.c (struct resword): Add __has_nothrow_assign,
2578         __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
2579         __has_trivial_constructor, __has_trivial_copy,
2580         __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
2581         __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
2582         __is_pod, __is_polymorphic, __is_union.
2583         * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
2584         (cp_parser_trait_expr): New.
2585         * semantics.c (finish_trait_expr, trait_expr_value
2586         classtype_has_nothrow_copy_or_assign_p): New.
2587         * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
2588         as static.
2589         * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
2590         * class.c (check_bases, check_field_decl, check_bases_and_members):
2591         Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
2592         * pt.c (uses_template_parms, tsubst_copy_and_build,
2593         value_dependent_expression_p, type_dependent_expression_p): Deal with
2594         TRAIT_EXPR.
2595         * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
2596
2597 2007-03-29  Richard Guenther  <rguenther@suse.de>
2598
2599         * tree.c (cp_walk_subtrees): Do not set input_location.
2600
2601 2007-03-28  Simon Martin  <simartin@users.sourceforge.net>
2602
2603         PR c++/29077
2604         * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
2605         destructor.
2606
2607 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
2608
2609         * parser.c (struct cp_parser): Update comment for
2610         greater_than_is_operator_p.
2611         (cp_parser_primary_expression): In C++0x mode, a cast operator can
2612         be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
2613         (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
2614         !GREATER_THAN_IS_OPERATOR_P.
2615         (cp_parser_binary_expression): When -Wc++0x-compat, warn about
2616         `>>' operators that will become two `>' tokens in C++0x.
2617         (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
2618         mode, allowing it to terminate default arguments.
2619         (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
2620         `>>' like two consecutive `>' tokens.
2621         (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
2622         (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
2623         ends a template argument.
2624
2625 2007-03-28  Douglas Gregor  <doug.gregor@gmail.com>
2626
2627         * decl.c (redeclaration_error_message): Complain when redeclaring
2628         a friend function with default template arguments (C++0x mode only).
2629         * cp-tree.h (check_default_tmpl_args): Declare.
2630         * pt.c (check_default_tmpl_args): In C++0x mode, permit default
2631         template arguments in function templates. Add support for checking
2632         the default template arguments of friend templates.
2633         (push_template_decl_real): Fix call to check_default_tmpl_args.
2634         (type_unification_real): If a template parameter has not been
2635         deduced but provides a default template argument, substitute into
2636         that default template argument.
2637         * parser.c (cp_parser_init_declarator): When declaring (but not
2638         defining!) a function template in C++0x mode, check for default
2639         template arguments.
2640
2641 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
2642
2643         PR c++/29993
2644         * decl.c (grokdeclarator): Deal with cv-qualified function type
2645         typedefs in the same way for member and non-member functions.
2646
2647 2007-03-26  Dirk Mueller  <dmueller@suse.de>
2648
2649         * parser.c (cp_parser_member_declaration): Pedwarn
2650         about stray semicolons after member declarations.
2651
2652 2007-03-26  Paolo Carlini  <pcarlini@suse.de>
2653
2654         PR c++/30500
2655         * pt.c (instantiate_decl): Set in_system_header.
2656
2657 2007-03-22  Mark Mitchell  <mark@codesourcery.com>
2658
2659         * cp-tree.h (current_tempalte_parms): Improve documentation.
2660         * pt.c (current_template_args): Likewise.
2661
2662         PR c++/30863
2663         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
2664         not consume tokens when failing.
2665
2666 2007-03-22  Jim Wilson  <wilson@specifix.com>
2667             Mark Mitchell  <mark@codesourcery.com>
2668
2669         PR c++/31273
2670         * call.c (standard_conversion): Use type_decays_to.  Keep FCODE
2671         consistent with FROM.
2672
2673 2007-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2674
2675         * error.c (dump_expr): Handle dependent names that designate types.
2676         * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
2677
2678 2007-03-17  Kazu Hirata  <kazu@codesourcery.com>
2679
2680         * cp-tree.def, parser.c, pt.c: Fix comment typos.
2681
2682 2007-03-16  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2683
2684         * cvt.c (cp_convert_and_check) : Define.
2685         * cp-tree.h (cp_convert_and_check): Declare.
2686         * call.c (convert_conversion_warnings): Rename to
2687         conversion_null_warnings.  The warning for floating-point to
2688         integer is handled by convert_and_check in convert_like_real.
2689         (convert_like_real): convert_conversion_warnings was renamed as
2690         conversion_null_warnings.
2691         * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
2692         overflow and changes of value during conversion.
2693
2694 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2695
2696         PR c++/30891
2697         * parser.c (cp_parser_statement): If 'namespace' is found, this
2698         only can be a namespace alias definition, so parse it now.
2699         (cp_parser_namespace_alias_definition): if we find an open brace
2700         instead of '=', then this is actually a misplaced namespace
2701         definition.
2702         
2703 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2704
2705         PR c++/24924
2706         * decl.c (cxx_init_decl_processing): Move command-line options
2707         processing to c-opts.c.
2708         
2709 2007-03-15  Douglas Gregor  <doug.gregor@gmail.com>
2710
2711         * ptree.c (cxx_print_type): Use formatting markup for integers
2712         when printing template parameter index/level/orig level.
2713         (cxx_print_xnode): Ditto.
2714         * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
2715         (struct template_parm_index_s): Remove the PARAMETER_PACK member.
2716         Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
2717         HOST_WIDE_INTs.
2718         (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
2719         rather than a HOST_WIDE_INT.
2720         Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
2721         NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
2722         better bit-packing.
2723         (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
2724         RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
2725         IN_BASE_INITIALIZER bool bitfields.
2726         (struct cp_declarator): Make KIND a 4-bit field. Make
2727         PARAMETER_PACK_P a bool bitfield just after KIND.
2728         * pt.c (uses_parameter_packs): Destroy the pointer set.
2729         (make_pack_expansion): Ditto.
2730         (check_for_bare_parameter_packs): Ditto.
2731         * name-lookup.c (push_to_top_level): Make need_pop a bool value.
2732         
2733 2007-03-14  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2734
2735         PR c++/31165
2736         * call.c  (convert_default_arg): Instead of copying the node,
2737         unshare it.
2738
2739 2007-03-15  Dirk Mueller  <dmueller@suse.de>
2740
2741         PR c++/30860
2742         * call.c (convert_conversion_warnings): New..
2743         (convert_like_real): .. factored out from here.
2744         (convert_conversion_warnings): Add warning about
2745         false being converted to NULL in argument passing.
2746
2747 2007-03-14  Dirk Mueller  <dmueller@suse.de>
2748
2749         * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
2750         (finish_do_body): Warn about empty body in do/while statement.
2751
2752 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2753
2754         * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
2755         
2756 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2757
2758         PR c/21438
2759         * typeck.c (build_binary_op): Call warn_for_div_zero instead of
2760         warning.
2761         
2762 2007-03-13  Alexandre Oliva  <aoliva@redhat.com>
2763
2764         * cp/repo.c (init_repo): Initialize random_seed saved options.
2765         (finish_repo): Adjust.
2766
2767 2007-03-13  Mark Mitchell  <mark@codesourcery.com>
2768
2769         PR bootstrap/30899
2770         * Make-lang.in (doc/g++.1): Use $< to specify the location from
2771         which to copy.
2772
2773 2007-03-12  Seongbae Park <seongbae.park@gmail.com>
2774
2775         * decl.c (compute_array_index_type): New warning flag warn_vla.
2776
2777 2007-03-12  Mark Mitchell  <mark@codesourcery.com>
2778
2779         PR c++/30108
2780         * call.c (convert_default_arg): Copy non-constant arguments.
2781
2782 2007-03-11  Mark Mitchell  <mark@codesourcery.com>
2783
2784         PR c++/31038
2785         * parser.c (cp_parser_postfix_expression): Disallow compound
2786         literals in constant expressions.
2787
2788         PR c++/30328
2789         * semantics.c (finish_typeof): Use unlowered_expr_type.
2790         
2791 2007-03-10  Mark Mitchell  <mark@codesourcery.com>
2792
2793         PR c++/30274
2794         * cp-tree.h (unlowered_expr_type): New function.
2795         * typeck.c (is_bitfield_expr_with_lowered_type): Handle
2796         COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
2797         (unlowered_expr_type): New function.
2798         (build_unary_op): Disallow predecrements of bool bitfields.
2799         * call.c (build_conditional_expr): Use unlowered_expr_type.
2800         * pt.c (type_unification_real): Likewise.
2801
2802 2007-03-09  Douglas Gregor  <doug.gregor@gmail.com>
2803
2804         PR c++/20599
2805         * typeck.c (check_return_expr): Check for bare parameter packs.
2806         (comptypes): Compare template parameter packs and
2807         type pack expansions.
2808         * decl.c (grokdeclarator): Deal with the declaration of function
2809         parameter packs.
2810         (grokparms): Verify that the (optional) function parameter pack is
2811         at the end of the parameter list.
2812         (xref_basetypes): Handle pack expansions in the base class.
2813         (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
2814         * cp-tree.def (TYPE_ARGUMENT_PACK): New.
2815         (NONTYPE_ARGUMENT_PACK): New.
2816         (TYPE_PACK_EXPANSION): New.
2817         (EXPR_PACK_EXPANSION): New.
2818         (ARGUMENT_PACK_SELECT): New.
2819         * cp-objcp-common.c (cp_tree_size): Compute size of
2820         (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
2821         ARGUMENT_PACK_SELECT.
2822         * error.c (dump_template_argument): Print template argument packs.
2823         (dump_template_argument_list): Ditto.
2824         (dump_template_parameter): Dump `...' for template type parameter
2825         packs.
2826         (dump_type): Dump TYPE_PACK_EXPANSION nodes.
2827         (dump_parameters): Print function parameter packs.
2828         (dump_template_parms): Print template argument packs.
2829         (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
2830         (maybe_warn_variadic_templates): New.
2831         * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
2832         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2833         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2834         CAST_EXPR. 
2835         * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
2836         (write_template_arg): Write argument packs as separate arguments.
2837         * cp-tree.h (struct template_parm_index_s): Add flag that
2838         indicates that the template parameter is actually a parameter
2839         pack.
2840         (struct tree_argument_pack_select): New.
2841         (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
2842         (union lang_tree_node): Add argument_pack_select.
2843         (FUNCTION_PARAMETER_PACK_P): New.
2844         (PACK_EXPANSION_P): New.
2845         (PACK_EXPANSION_PATTERN): New.
2846         (SET_PACK_EXPANSION_PATTERN): New.
2847         (PACK_EXPANSION_PARAMETER_PACKS): New.
2848         (ARGUMENT_PACK_P): New.
2849         (ARGUMENT_PACK_ARGS): New.
2850         (SET_ARGUMENT_PACK_ARGS): New.
2851         (ARGUMENT_PACK_INCOMPLETE_P): New.
2852         (ARGUMENT_PACK_EXPLICIT_ARGS): New.
2853         (TEMPLATE_PARM_PARAMETER_PACK): New.
2854         (TEMPLATE_TYPE_PARAMETER_PACK): New.
2855         (ARGUMENT_PACK_SELECT_FROM_PACK): New.
2856         (ARGUMENT_PACK_SELECT_INDEX): New.
2857         (ARGUMENT_PACK_SELECT_ARG): New.
2858         (struct cp_declarator): Add parameter_pack_p flag.
2859         (maybe_warn_variadic_templates): Declare.
2860         (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
2861         indicate a template parameter pack. 
2862         (uses_parameter_packs): Declare.
2863         (template_parameter_pack_p): Declare.
2864         (template_parms_variadic_p): Declare.
2865         (make_pack_expansion): Declare.
2866         (check_for_bare_parameter_packs): Declare.
2867         * cxx-pretty-print.c (pp_cxx_unary_expression): Print
2868         sizeof... expressions. 
2869         (pp_cxx_expression): Print pack expansions and non-type argument
2870         packs.
2871         (pp_cxx_exception_specification): Print pack expansions. 
2872         (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
2873         (pp_cxx_ctor_initializer): Print pack expansions.
2874         (pp_cxx_type_id): Print pack expansions.
2875         (pp_cxx_template_argument_list): Print argument packs.
2876         (pp_cxx_template_parameter): Print ellipsis for template parameter
2877         packs.
2878         * pt.c (comp_template_parms): Compare template parameter packs.
2879         (template_parameter_pack_p): New.
2880         (template_parms_variadic_p): New.
2881         (template_args_variadic_p): New.
2882         (make_ith_pack_parameter_name): New.
2883         (struct find_parameter_pack_data): New.
2884         (find_parameter_packs_r): New.
2885         (uses_parameter_packs): New.
2886         (make_pack_expansion): New.
2887         (check_for_bare_parameter_packs): New.
2888         (expand_template_argument_pack): New.
2889         (reduce_template_parm_level): Propagate parameter pack flag.
2890         (process_template_parm): Add is_parameter_pack parameter to state
2891         when the parameter is actually a parameter pack. Create template
2892         parameter packs when is_parameter_pack is true.
2893         (current_template_args): The argument for a template parameter
2894         pack is an argument pack containing a single pack expansion.
2895         (process_partial_specialization): When checking that non-type
2896         argument expressions do not involve template parameters, loop over
2897         the arguments in argument packs separately.
2898         (push_template_decl_real): Check that the type of the declaration
2899         does not have any bare parameter packs. Check that primary
2900         templates have no more than one parameter pack, and that it comes
2901         at the end of the template parameter list.
2902         (convert_template_argument): Handle coercions for pack expansion
2903         expressions by coercing the pattern then rebuilding the expansion.
2904         (coerce_template_parms): When coercing the arguments for a
2905         variadic template, pack "extra" arguments into an argument pack.
2906         (coerce_template_template_parms): Cannot coerce between parameter
2907         packs and non-pack parameters.
2908         (template_args_equal): Compare PACK_EXPANSION_P expressions.
2909         (comp_template_args): Expand all template arguments packs before
2910         comparing template argument lists.
2911         (mangle_class_name_for_template): Make argument packs as separate
2912         template arguments.
2913         (for_each_template_parm_r): No need to handle BASELINK. 
2914         (instantiate_class_template): Handle pack expansions in the base
2915         class list.
2916         (tsubst_pack_expansion): New.
2917         (tsubst_template_args): Handle substitutions of argument packs and
2918         pack expansion into template argument lists.
2919         (tsubst_decl): Expand function parameter packs into separate
2920         function parameters.
2921         (tsubst_arg_types): Expand a type pack expansion into separate
2922         argument types.
2923         (tsubst_exception_specification): Handle pack expansions in
2924         exception specifiers.
2925         (tsubst): See through ARGUMENT_PACK_SELECT arguments when 
2926         replacing a template parameter with its argument. If we encounter
2927         a substitution for an argument pack, just return the parameter
2928         itself. 
2929         (tsubst_copy): sizeof(X...) returns the number of elements in
2930         parameter pack X.  See through ARGUMENT_PACK_SELECT when the
2931         PARM_DECL is a parameter pack.
2932         (tsubst_expr): Expression pack expansions and argument packs
2933         cannot show up here; they will all be handled through function
2934         calls, sizeof, and template argument lists.
2935         (tsubst_copy_and_build): sizeof(X...) returns the number of
2936         elements in parameter pack X.  Handle pack expansions in TREE_LIST
2937         and CONSTRUCTOR nodes.
2938         (fn_type_unification): Handle "incomplete" explicit template
2939         argument lists that specify some of the arguments for a template
2940         parameter pack.
2941         (type_unification_real): Unify arguments against pack expansions.
2942         (template_parm_level_and_index): New, helper function.
2943         (unify_pack_expansion): New.
2944         (unify): Unify argument packs on an argument-by-argument basis,
2945         handling variadic argument packs as well.
2946         (more_specialized_fn): Handle unification of function parameter
2947         packs. All things being equal, prefer non-variadic function
2948         templates to variadic function templates.
2949         (more_specialized_class): Prefer the variadic class template
2950         partial specialization that binds fewer arguments to a parameter
2951         pack.
2952         (regenerate_decl_from_template): Expand function parameter packs
2953         into separate parameters.
2954         (instantiate_decl): Ditto.
2955         (tsubst_initializer_list): Handle pack expansions for base-class
2956         initializers.
2957         (dependent_type_p_r): Determine dependent types in argument packs
2958         and pack expansions.
2959         (value_dependent_expression_p): Determine value-dependence of
2960         non-type argument packs.
2961         (dependent_template_arg_p): Handle argument packs.
2962         * semantics.c (finish_cond): Check for bare parameter packs.
2963         (finish_expr_stmt): Ditto.
2964         (finish_for_expr): Ditto.
2965         (finish_switch_cond): Ditto.
2966         (finish_mem_initializers): Ditto.
2967         * name-lookup.c (arg_assoc_type): Handle pack expansions and
2968         argument packs.
2969         * decl2.c (cp_build_parm_decl): Mark function parameter packs.
2970         * parser.c (make_declarator): Declarator is not an expansion.
2971         (make_pointer_declarator): Transfer parameter pack flag to outer
2972         declarator.
2973         (make_reference_declarator): Ditto.
2974         (make_ptrmem_declarator): Ditto.
2975         (make_call_declarator): Ditto.
2976         (make_array_declarator): Ditto.
2977         (cp_parser_postfix_expression): Allow pack expansion expressions
2978         in the argument list for a call expression.
2979         (cp_parser_parenthesized_expression_list): Add new parameter
2980         ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
2981         into separate arguments."
2982         (cp_parser_new_placement): Allow pack expansion expressions.
2983         (cp_parser_new_initializer): Ditto.
2984         (cp_parser_mem_initializer_list): Allow ellipsis to create a
2985         base-class initializer expansion.
2986         (cp_parser_mem_initializer): Ditto.
2987         (cp_parser_template_parameter_list): Keep track of whether the
2988         template parameter is a template parameter pack.
2989         (cp_parser_template_parameter): Parse the ellipsis to indicate a
2990         template parameter pack.
2991         (cp_parser_type_parameter): Ditto.
2992         (cp_parser_template_argument_list): Parse the ellipsis to indicate
2993         a pack expansion.
2994         (cp_parser_direct_declarator): Parse the ellipsis to indicate that
2995         this declarator is a parameter pack.
2996         (cp_parser_parameter_declaration): The ellipsis does not end the
2997         parameter declaration, because it might be a parameter pack. Parse
2998         the ellipsis to indicate a parameter pack.
2999         (cp_parser_initializer): Allow pack expansions.
3000         (cp_parser_initializer_list): Allow ellipsis to create an
3001         initializer expansion.
3002         (cp_parser_base_clause): Allow ellipsis to create a base specifier
3003         expansion.
3004         (cp_parser_type_id_list): Allow ellipsis to create an exception
3005         specifier expansion.
3006         (cp_parser_attribute_list): Don't allow pack expansions.
3007         (cp_parser_functional_cast): Allow pack expansions.
3008         (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
3009         compute the length of a parameter pack.
3010         (cp_parser_next_token_ends_template_argument_p): An ellipsis can
3011         end a template argument.
3012         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
3013         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
3014         CAST_EXPR. 
3015
3016 2007-03-09  Dirk Mueller  <dmueller@suse.de>
3017
3018         * cp/call.c (build_new_op): Call warn_logical_operator.
3019
3020 2007-03-08  Volker Reichelt  <reichelt@netcologne.de>
3021
3022         PR c++/30852
3023         * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
3024
3025         PR c++/30534
3026         * pt.c (any_template_arguments_need_structural_equality_p):
3027         Robustify.
3028
3029 2007-03-08  Alexandre Oliva  <aoliva@redhat.com>
3030
3031         * decl.c (grokdeclarator): Disable warnings for anonymous
3032         bitfields.
3033
3034 2007-03-05  Volker Reichelt  <reichelt@netcologne.de>
3035
3036         * typeck2.c (readonly_error): Always emit a hard error.
3037         Remove last argument.
3038         * cp-tree.h (readonly_error): Adjust prototype.
3039         * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
3040         * typeck.c (build_unary_op): Likewise.
3041         (build_modify_expr): Likewise.
3042
3043 2007-03-04  Simon Martin  <simartin@users.sourceforge.net>
3044
3045         PR c++/30895
3046         * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
3047
3048 2007-03-03  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3049
3050         PR c++/15787
3051         * parser.c (struct cp_parser): New IN_IF_STMT.
3052         (cp_parser_statement_seq_opt): Handle an unexpected 'else',
3053         returning if parsing the body of an 'if' statement or issuing an
3054         error and continuing.
3055         (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
3056         body of 'if'.
3057         (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
3058         
3059 2007-03-02  Simon Martin  <simartin@users.sourceforge.net>
3060
3061         PR c++/28253
3062         * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
3063         for thunks.
3064
3065 2007-03-02  Geoffrey Keating  <geoffk@apple.com>
3066
3067         * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
3068         Objective-C++.  Don't exit early if -shared-libgcc needs to be
3069         added.
3070
3071 2007-03-02  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3072
3073         * typeck.c (common_base_type): Delete unused function.
3074         
3075 2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
3076
3077         * Make-lang.in: Add dummy lang.install-pdf target.
3078
3079 2007-03-01  Simon Baldwin <simonb@google.com>
3080
3081         PR c++/23689
3082         * decl.c (check_tag_decl): Added new warning for typedef ignored
3083         when it precedes an otherwise valid non-typedef declaration.
3084
3085 2007-02-28  Sandra Loosemore  <sandra@codesourcery.com>
3086
3087         * typeck.c (build_function_call): Store converted arguments
3088         in a stack-allocated array instead of building a list.
3089         (convert_arguments): Store arguments in the array passed in as an
3090         argument, and return the actual number of arguments.
3091         * call.c (build_call): Delete, and replace with...
3092         (build_call_n, build_call_a): New.
3093         (build_op_delete_call): Rewrite to avoid constructing argument lists.
3094         (build_over_call): Store converted arguments in a stack-allocated
3095         array instead of building a list.
3096         (build_cxx_call): Pass arguments in an array instead of as a list.
3097         (build_java_interface_fn_ref): Rewrite to avoid constructing
3098         argument lists.
3099         * tree.h: Update declarations to reflect above changes.
3100         * method.c (use_thunk): Use a stack-allocated array to hold
3101         the arguments instead of a list.
3102         * rtti.c (throw_bad_cast): Update call to cxx_call.
3103         (throw_bad_typeid): Likewise.
3104         (build_dynamic_cast_1): Likewise.
3105         * init.c (build_builtin_delete_call): Use build_call_n.
3106         * decl.c (expand_static_init): Likewise.
3107         * except.c (cp_protect_cleanup_actions): Likewise.
3108         * cp-gimplify.c (genericize_eh_spec_block): Likewise.
3109         (gimplify_must_not_throw_expr): Likewise.
3110         (cxx_omp_apply_fn): Use build_call_a.
3111
3112 2007-02-26  Mark Mitchell  <mark@codesourcery.com>
3113
3114         * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
3115         * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
3116
3117 2007-02-25  Mark Mitchell  <mark@codesourcery.com>
3118
3119         * cp-tree.h (static_ctors): Remove.
3120         * cp-tree.h (static_dtors): Likewise.
3121         * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
3122         refactoring of tree_map hierarchy.
3123         (decl_shadowed_for_var_insert): Likewise.
3124         * semantics.c (expand_body): Use c_expand_body.
3125         (expand_or_defer_fn): Don't update static_ctors or static_dtors.
3126         * decl2.c (static_ctors): Remove.
3127         (static_dtors): Likewise.
3128         (generate_ctor_or_dtor_function): Pass NULL_TREE to
3129         objc_generate_static_init_call.  Do not call static_[cd]tors.
3130         (generate_ctor_and_dtor_functions_for_priority): Do not check for
3131         static_[cd]tors.
3132         (cp_write_global_declarations): Likewise.
3133
3134 2007-02-23  Richard Guenther  <rguenther@suse.de>
3135
3136         * class.c (note_name_declared_in_class): Make declaration
3137         changes meaning a pedwarn.
3138
3139 2007-02-22  Michael Matz  <matz@suse.de>
3140
3141         PR c++/29433
3142         * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
3143         * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
3144         dump_function_decl): Guard emitting outer scopes by new flag.
3145         * cp-lang.c (cxx_dwarf_name): New function.
3146         (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
3147         * pt.c (classtype_mangled_name, mangle_class_name_for_template):
3148         Remove functions.
3149         (push_template_decl_real, lookup_template_class): Remove calls
3150         to above functions.
3151
3152 2007-02-19  Mark Mitchell  <mark@codesourcery.com>
3153
3154         * call.c (build_new_method_call): Ensure that explicit calls of
3155         destructors have type "void".
3156
3157 2007-02-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3158
3159         * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
3160         and -Walways-true with -Waddress.
3161         * cvt.c (convert_to_void): Replace unconditional warning with
3162         -Waddress.
3163
3164 2007-02-18  Kazu Hirata  <kazu@codesourcery.com>
3165
3166         * decl.c, tree.c: Fix comment typos.
3167
3168 2007-02-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
3169
3170         PR C++/30158
3171         * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the 
3172         statement expression if we had an error mark node.
3173
3174 2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
3175             Brooks Moses  <brooks.moses@codesourcery.com>
3176             Lee Millward  <lee.millward@codesourcery.com>
3177
3178         * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
3179         Change class to tcc_vl_exp.
3180
3181         * call.c (build_call): Use build_call_list instead 
3182         of build3. 
3183         (build_over_call): Likewise.
3184         (build_new_method_call): Use build_min_non_dep_call_list 
3185         instead of build_min_non_dep.
3186
3187         * error.c (dump_call_expr_args): New function.
3188         (dump_aggr_init_expr_args): New function.
3189         (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. 
3190         Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
3191
3192         * cvt.c (convert_to_void): Use build_call_array instead
3193         of build3; use new AGGR_INIT_EXPR accessor macros.
3194
3195         * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
3196         instead of TREE_CODE_LENGTH.
3197
3198         * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
3199         AGGR_INIT_EXPR accessor macros.
3200
3201         * cp-gimplify.c (cp_gimplify_init_expr): Use 
3202         AGGR_INIT_EXPR_SLOT to set the slot operand.
3203
3204         * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
3205         (AGGR_INIT_EXPR_SLOT): New macro.
3206         (AGGR_INIT_EXPR_ARG): New macro.
3207         (aggr_init_expr_nargs): New macro.
3208         (AGGR_INIT_EXPR_ARGP): New macro.
3209         (aggr_init_expr_arg_iterator): New.
3210         (init_aggr_init_expr_arg_iterator): New.
3211         (next_aggr_init_expr_arg): New.
3212         (first_aggr_init_expr_arg): New.
3213         (more_aggr_init_expr_args_p): New.
3214         (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
3215         (stabilize_aggr_init): New declaration.
3216         (build_min_non_dep_call_list): Likewise.
3217
3218         * tree.c (process_aggr_init_operands): New function.
3219         (build_aggr_init_array) New function.
3220         (build_cplus_new): Update to use new CALL_EXPR and
3221         AGGR_INIT_EXPR accessor macros. Replace use of build3 with
3222         build_aggr_init_array.
3223         (build_min_non_dep_call_list) New function.
3224         (build_min_nt): Assert input code parameter is not a variable
3225         length expression class.
3226         (build_min, build_min_non_dep): Likewise.
3227         (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
3228         to check for equality instead of recursing. Handle tcc_vl_exp
3229         tree code classes.
3230         (stabilize_call): Update to only handle CALL_EXPRs, not 
3231         AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
3232         (stabilize_aggr_init): New function.
3233         (stabilize_init): Use it.
3234
3235         * cxx-pretty-print.c (pp_cxx_postfix_expression)
3236         <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
3237         AGGR_INIT_EXPR accessor macros and argument iterators.
3238         
3239         * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
3240         build_vl_exp. Iterate through the operands, recursively 
3241         processing each one.
3242         (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
3243         CALL_EXPR accessor macros.
3244         (value_dependent_expression_p) <default>: Handle tcc_vl_exp
3245         tree code classes. Use TREE_OPERAND_LENGTH instead of 
3246         TREE_CODE_LENGTH.
3247
3248         * semantics.c (finish_call_expr): Use build_nt_call_list
3249         instead of build_nt.
3250         (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR 
3251         accessor macros. Use build_call_array to construct the 
3252         CALL_EXPR node instead of build3
3253         
3254         * decl2.c (build_offset_ref_call_from_tree): Use 
3255         build_nt_call_list and build_min_non_dep_call_list instead
3256         of build_min_nt and build_min_non_dep.
3257
3258         * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
3259         Use build_nt_call_list instead of build_min_nt.
3260
3261 2007-02-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3262
3263         PR c++/28943
3264         * call.c (build_conditional_expr): Improve error message.
3265         
3266 2007-02-13  Dirk Mueller  <dmueller@suse.de>
3267
3268         * friend.c (do_friend): Annotate warning about friend
3269         declarations in templates with OPT_Wnon_template_friend.
3270         Convert informal message from warning() to inform().
3271
3272 2007-02-12  Simon Martin  <simartin@users.sourceforge.net>
3273             Mark Mitchell  <mark@codesourcery.com>
3274
3275         PR c++/14622
3276         * pt.c (do_decl_instantiation): Detect type mismatches in explicit
3277         instantiations for variables.
3278
3279 2007-02-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3280
3281         PR middle-end/7651
3282         * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
3283         Check warn_unused_value just once.
3284
3285 2007-02-11  Mark Mitchell  <mark@codesourcery.com>
3286
3287         PR c++/26988
3288         * pt.c (determine_specialization): Use skip_artificial_parms_for.
3289         (fn_type_unificiation): Likewise.
3290         (get_bindings): Likewise.
3291
3292 o2007-02-06  Mark Mitchell  <mark@codesourcery.com>
3293
3294         PR target/29487
3295         * decl.c (finish_function): Use DECL_REPLACEABLE.
3296         * tree.c (cp_cannot_inline_tree_fn): Likewise.
3297
3298 2007-02-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3299
3300         * parser.c (cp_parser_primary_expression): Reformat overly long lines.
3301
3302 2007-02-10  Richard Henderson  <rth@redhat.com>, Jakub Jelinek  <jakub@redhat.com>
3303
3304         * decl.c (grokvardecl): Don't error if !have_tls.
3305         (grokdeclarator): Likewise.
3306         * parser.c (cp_parser_omp_threadprivate): Likewise.
3307
3308 2007-02-07  Jakub Jelinek  <jakub@redhat.com>
3309
3310         PR c++/30703
3311         * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
3312         parameters and result decls in omp clauses.
3313         (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
3314         by reference.
3315
3316 2007-02-05  Dirk Mueller  <dmueller@suse.de>
3317
3318         PR bootstrap/30510
3319         * parser.c (cp_parser_class_specifier): Always initialize bases.
3320
3321 2007-02-05  Paolo Bonzini  <bonzini@gnu.org>
3322
3323         * cp-tree.h (OMP_ATOMIC_CODE): Delete.
3324         (OMP_ATOMIC_DEPENDENT_P): Rewrite.
3325         * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
3326         expressions.
3327         * semantics.c (finish_omp_atomic): Store a whole expression node
3328         in operand 1, and integer_zero_node in operand 0, for dependent
3329         OMP_ATOMIC.  Rewrite to make flow easier to understand.
3330
3331 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3332
3333         * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
3334
3335 2007-02-04  Kazu Hirata  <kazu@codesourcery.com>
3336
3337         * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
3338         parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
3339
3340 2007-02-03  Douglas Gregor  <doug.gregor@gmail.com>
3341
3342        * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
3343        keyword warning to -Wc++0x-compat.
3344         
3345 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3346
3347         * decl.c (grokdeclarator): Update documentation.
3348
3349 2007-02-02  Jakub Jelinek  <jakub@redhat.com>
3350
3351         PR c++/30536
3352         * decl.c (grokdeclarator): If __thread is used together with
3353         a storage class other than extern and static, clear thread_p
3354         after issuing diagnostics and fall through to checking the
3355         storage class.
3356
3357 2007-01-30  Roger Sayle  <roger@eyesopen.com>
3358
3359         * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
3360         calculating the size of an array (to avoid recursive errors).
3361
3362 2007-01-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3363
3364         PR c++/24745
3365         * typeck.c (build_binary_op): Fix logic for warning. Move warning
3366         to -Wpointer-arith.
3367         * call.c (convert_like_real): Don't warn when converting to
3368         boolean type.
3369         
3370 2007-01-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3371
3372         * decl.c (pop_label): Replace warning with call to
3373         warn_for_unused_label.
3374
3375 2007-01-28  Andrew Pinski  <pinskia@gmail.com>
3376
3377         PR C++/28988
3378         * semantics.c (finish_pseudo_destructor_expr): Check the
3379         destrutor name by calling check_dtor_name.
3380
3381 2007-01-24  Douglas Gregor  <dgregor@osl.iu.edu>
3382
3383         * lex.c (D_CPP0X): Rename.
3384         (D_CXX0X): To this.
3385         (reswords): D_CPP0X -> D_CXX0X.
3386         (init_reswords): Ditto.
3387         * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
3388         of C++0x keywords as identifiers.
3389
3390 2007-01-23  Simon Martin  <simartin@users.sourceforge.net>
3391
3392         PR c++/27492
3393         * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
3394         function decls.
3395
3396 2007-01-23  Ian Lance Taylor  <iant@google.com>
3397
3398         * typeck.c (convert_for_assignment): Only warn about a = b = c
3399         when converting to bool.
3400
3401 2007-01-23  Roger Sayle  <roger@eyesopen.com>
3402
3403         * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
3404         TREE_OVERFLOW.
3405         * typeck.c (ignore_overflows): Remove the remaining uses of
3406         TREE_CONSTANT_OVERFLOW.
3407
3408 2007-01-20  Jan Hubicka  <jh@suse.cz>
3409
3410         * decl2.c (start_objects, start_static_storage_duration_function):
3411         Do not make the functions uninlinable.
3412
3413 2007-01-17  Ian Lance Taylor  <iant@google.com>
3414
3415         * class.c (add_method): Call VEC_reserve_exact rather than passing
3416         a negative size to VEC_reserve.
3417
3418 2007-01-11  Simon Martin  <simartin@users.sourceforge.net>
3419
3420         PR c++/29573
3421         * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
3422
3423 2007-01-10  Mark Mitchell  <mark@codesourcery.com>
3424
3425         PR c++/28999
3426         * decl.c (make_typename_type): If the qualified name is not a
3427         type, issue an error.
3428         * parser.c (cp_parser_elaborated_type_specifier): Fix comment
3429         formatting.
3430
3431 2007-01-08  Geoffrey Keating  <geoffk@apple.com>
3432
3433         * rtti.c: Include target.h.
3434         (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
3435         don't emit typeinfo for fundamental types as weak.
3436         * Make-lang.in (cp/rtti.o): Update and correct dependencies.
3437
3438 2007-01-08  Richard Guenther  <rguenther@suse.de>
3439
3440         * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
3441
3442 2007-01-08  Mark Shinwell  <shinwell@codesourcery.com>
3443
3444         * call.c (standard_conversion): Pass flag to
3445         vector_types_convertible_p to disallow emission of note.
3446         * typeck.c (convert_for_assignment): Pass flag to
3447         vector_types_convertible_p to allow emission of note.
3448         (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
3449         to disallow emission of note.
3450
3451 2007-01-07  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3452
3453         PR c++/28986
3454         * typeck.c (build_binary_op): Call overflow_warning if
3455         TREE_OVERFLOW_P is true for the result and not for any of the
3456         operands.
3457         
3458 2007-01-06  Lee Millward  <lee.millward@codesourcery.com>
3459
3460        PR c++/19439
3461        * class.c (add_method): Don't wait until template
3462        instantiation time to complain about duplicate methods.
3463         
3464 2007-01-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3465
3466         PR c/19978
3467         * semantics.c (finish_unary_op_expr): Warn only if result
3468         overflowed and operands did not.
3469
3470 2007-01-05  Ian Lance Taylor  <iant@google.com>
3471
3472         * typeck.c (build_binary_op): Warn about comparing a non-weak
3473         address to NULL.
3474
3475 2007-01-05  Douglas Gregor  <doug.gregor@gmail.com>
3476
3477         * pt.c (tsubst): Propagate the need for structural equality checks
3478         when reducing the level of template parameters.
3479
3480 2007-01-03  Kazu Hirata  <kazu@codesourcery.com>
3481
3482         * pt.c: Fix a comment typo.
3483
3484 2007-01-02  Ian Lance Taylor  <iant@google.com>
3485
3486         * semantics.c (maybe_convert_cond): Optionally warn when using an
3487         assignment as a condition.
3488         * typeck.c (convert_for_assignment): Optionally warn about
3489         assigning the result of an assignment to a bool.
3490
3491 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
3492
3493         * pt.c (canonical_template_parms): Correct typo in comment.
3494         
3495 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
3496
3497         * typeck.c (structural_comptypes): Renamed from "comptypes".
3498         (comptypes): Use canonical type information to perform fast type
3499         comparison. When VERIFY_CANONICAL_TYPES, verify that the
3500         canonical type comparison returns the same results as we would see
3501         from the current, structural check. Support COMPARE_STRUCTURAL
3502         when we need structural checks.
3503         * decl.c (typename_compare): Fix comment.
3504         (build_typename_type): TYPENAME_TYPE nodes require structural
3505         equality checks, because they resolve different based on the
3506         current class type.
3507         (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
3508         require structural equality checks (for now).
3509         (build_ptrmemfunc_type): Build the canonical pointer to member
3510         function type.
3511         (compute_array_index_type): Whenever we build a new index type
3512         to represent the size of an array in a template, we need to mark
3513         this index type as requiring structural equality. This goes for
3514         arrays with value-dependent sizes with the current ABI, or all
3515         arrays with ABI-1.
3516         * tree.c (cplus_array_hash): New.
3517         (struct cplus_array_info): New.
3518         (cplus_array_compare): New.
3519         (cplus_array_htab): New.
3520         (build_cplus_array_type_1): Use a hash table to cache the array
3521         types we build. Build the canonical array type for each array
3522         type.
3523         (cp_build_qualified_type_real): When building a cv-qualified array
3524         type, use the hash table of array types and build canonical array
3525         types as necessary.
3526         (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
3527         use structural equality (for now).
3528         * cp-tree.h (COMPARE_STRUCTURAL): New.
3529         * pt.c (canonical_template_parms): New.
3530         (canonical_type_parameter): New.
3531         (process_template_parm): Find the canonical type parameter.
3532         (lookup_template_class): When we have named the primary template
3533         type, set the canonical type for our template class to the primary
3534         template type. If any of the template arguments need structural
3535         equality checks, the template class needs structural equality
3536         checks.
3537         (tsubst): When reducing the level of a template template
3538         parameter, we require structural equality tests for the resulting
3539         parameter because its template parameters have not had their types
3540         canonicalized. When reducing a template type parameter, find the
3541         canonical reduced type parameter.
3542         (any_template_arguments_need_structural_equality_p): New.
3543